|
|
@@ -274,7 +274,7 @@ export default {
|
|
|
|
|
|
this.buttonGroup[1].text =
|
|
|
"下单省\n¥" +
|
|
|
- (this.yj_price + this.detail.coupon_discount / 100);
|
|
|
+ Math.floor((this.yj_price + this.detail.coupon_discount / 100)*100)/100;
|
|
|
} else {
|
|
|
uni.showModal({
|
|
|
title: "提示",
|
|
|
@@ -309,9 +309,9 @@ export default {
|
|
|
|
|
|
this.buttonGroup[1].text =
|
|
|
"下单省\n¥" +
|
|
|
- (Number(this.detail.reserve_price) -
|
|
|
+ Math.floor((Number(this.detail.reserve_price) -
|
|
|
Number(this.goods_price) +
|
|
|
- Number(this.yj_price));
|
|
|
+ Number(this.yj_price)) *100)/100;
|
|
|
} else {
|
|
|
uni.showModal({
|
|
|
title: "提示",
|
|
|
@@ -359,32 +359,34 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
} else if (this.type == 2) {
|
|
|
- post("v1/cashback/taobaoUrl", {
|
|
|
- item_id: _this.detail.input_num_iid,
|
|
|
- }).then((res) => {
|
|
|
- if (res.code === 0) {
|
|
|
- let data = JSON.parse(res.data)
|
|
|
- .tbk_dg_general_link_convert_response.data.item_url_list
|
|
|
- .item_url_list[0].link_info_dto.coupon_full_tpwd;
|
|
|
-
|
|
|
- console.log(data);
|
|
|
- uniCopy({
|
|
|
- content: data,
|
|
|
- success: (res) => {
|
|
|
- uni.showToast({
|
|
|
- title: "商品链接已复制,请转到淘宝APP查看",
|
|
|
- icon: "none",
|
|
|
- duration: 2000,
|
|
|
- });
|
|
|
- },
|
|
|
- error: (e) => {},
|
|
|
+ _this.isOauth()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getTaobaoUrl() {
|
|
|
+ let _this = this;
|
|
|
+ post("v1/cashback/taobaoUrl", {
|
|
|
+ item_id: _this.detail.input_num_iid,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ let data = JSON.parse(res.data)
|
|
|
+ .tbk_dg_general_link_convert_response.data.item_url_list
|
|
|
+ .item_url_list[0].link_info_dto.coupon_full_tpwd;
|
|
|
+ console.log(data);
|
|
|
+ uniCopy({
|
|
|
+ content: data,
|
|
|
+ success: (res) => {
|
|
|
+ uni.showToast({
|
|
|
+ title: "商品链接已复制,请转到淘宝APP查看",
|
|
|
+ icon: "none",
|
|
|
+ duration: 2000,
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
+ error: (e) => {},
|
|
|
});
|
|
|
}
|
|
|
- }
|
|
|
+ });
|
|
|
},
|
|
|
-
|
|
|
login(invite) {
|
|
|
let that = this;
|
|
|
// #ifdef MP-WEIXIN
|
|
|
@@ -415,6 +417,42 @@ export default {
|
|
|
async getuserInfo() {
|
|
|
this.userinfo = await uni.userfun();
|
|
|
},
|
|
|
+ isOauth() {
|
|
|
+ let _this = this;
|
|
|
+ post("v1/user/userinfo").then((res) => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ console.log(res.data.data);
|
|
|
+
|
|
|
+ if (res.data.data.special_id != 0) {
|
|
|
+ _this.getTaobaoUrl()
|
|
|
+ } else {
|
|
|
+ post("v1/cashback/taobaoCode", {}).then(res1 => {
|
|
|
+ console.log(res1);
|
|
|
+ uniCopy({
|
|
|
+ content: res1.data,
|
|
|
+ success: (res) => {
|
|
|
+ uni.showModal({
|
|
|
+ content: `您还未完成淘宝授权操作,链接已复制到剪贴板,请先转到浏览器粘贴打开完成淘宝授权操作`,
|
|
|
+ confirmText: "知道了",
|
|
|
+ showCancel: false,
|
|
|
+ success(res) {
|
|
|
+
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ error: (e) => {},
|
|
|
+ });
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.reLaunch({
|
|
|
+ url:'/pages/my/index'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
},
|
|
|
onShareAppMessage() {
|
|
|
// let userinfo = uni.getStorageSync("userinfo");
|