|
|
@@ -56,6 +56,27 @@
|
|
|
<view class="text7 bottom">{{ decodeURIComponent(annual_vol) }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="price_info flex_r flex_ac flex_jb" v-else-if="type == 3">
|
|
|
+ <view class="price flex_c flex_jb">
|
|
|
+ <view class="text1"> 到手价 </view>
|
|
|
+ <view class="bottom">
|
|
|
+ <span class="text2">
|
|
|
+ {{ goods_price }}
|
|
|
+ </span>
|
|
|
+ <text class="text3">¥{{ goods_price_origin }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="price flex_c flex_jb">
|
|
|
+ <view class="text4">预估下单获</view>
|
|
|
+ <view class="text5 bottom">
|
|
|
+ {{ yj_price }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="price flex_c flex_jb">
|
|
|
+ <view class="text6">销量</view>
|
|
|
+ <view class="text7 bottom">{{ decodeURIComponent(annual_vol) }}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view class="chabao">
|
|
|
预估下单获得茶宝:{{ Math.floor(goods_price * chabao_ratio * 100) / 100 }}
|
|
|
</view>
|
|
|
@@ -82,6 +103,16 @@
|
|
|
</span>
|
|
|
{{ detail.title }}
|
|
|
</view>
|
|
|
+ <view class="goods_name" v-else-if="type == 3">
|
|
|
+ <span class="product-type">
|
|
|
+ {{
|
|
|
+ tabs.filter((t) => {
|
|
|
+ return type == t.type;
|
|
|
+ })[0].name
|
|
|
+ }}
|
|
|
+ </span>
|
|
|
+ {{ detail.skuName }}
|
|
|
+ </view>
|
|
|
<view
|
|
|
class="quan flex_r flex_ac flex_jb"
|
|
|
v-if="type == 1 && detail.has_coupon"
|
|
|
@@ -102,16 +133,42 @@
|
|
|
</view>
|
|
|
<view
|
|
|
class="quan flex_r flex_ac flex_jb"
|
|
|
- v-if="type == 2 && coupon_discount"
|
|
|
+ v-if="type == 2 && coupon_discount > 0"
|
|
|
+ >
|
|
|
+ <view class="left flex_r flex_ac">
|
|
|
+ <view class="quan_price">{{ coupon_discount }}</view>
|
|
|
+ <view class="flex_c time">
|
|
|
+ <span>专属优惠券</span>
|
|
|
+ <span>
|
|
|
+ {{
|
|
|
+ $day((promotion_start_time / 1000) * 1000).format("YYYY.MM.DD")
|
|
|
+ }}
|
|
|
+ -
|
|
|
+ {{
|
|
|
+ $day((promotion_end_time / 1000) * 1000).format("YYYY.MM.DD")
|
|
|
+ }}
|
|
|
+ </span>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="split"></view>
|
|
|
+ <view class="right" @click="buttonClick"> 立即领券 </view>
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
+ class="quan flex_r flex_ac flex_jb"
|
|
|
+ v-if="type == 3 && coupon_discount > 0"
|
|
|
>
|
|
|
<view class="left flex_r flex_ac">
|
|
|
<view class="quan_price">{{ coupon_discount }}</view>
|
|
|
<view class="flex_c time">
|
|
|
<span>专属优惠券</span>
|
|
|
<span>
|
|
|
- {{ $day(promotion_start_time/1000 *1000).format("YYYY.MM.DD") }}
|
|
|
+ {{
|
|
|
+ $day((promotion_start_time / 1000) * 1000).format("YYYY.MM.DD")
|
|
|
+ }}
|
|
|
-
|
|
|
- {{ $day(promotion_end_time/1000 *1000).format("YYYY.MM.DD") }}
|
|
|
+ {{
|
|
|
+ $day((promotion_end_time / 1000) * 1000).format("YYYY.MM.DD")
|
|
|
+ }}
|
|
|
</span>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -127,12 +184,15 @@
|
|
|
/>
|
|
|
<view class="text7 bottom" v-if="type == 1">{{ detail.mall_name }}</view>
|
|
|
<view class="text7 bottom" v-else-if="type == 2">{{ detail.nick }}</view>
|
|
|
+ <view class="text7 bottom" v-else-if="type == 3">{{
|
|
|
+ decodeURIComponent(shopName)
|
|
|
+ }}</view>
|
|
|
</view>
|
|
|
<!-- 标题信息栏-end -->
|
|
|
<!-- 产品简介 -->
|
|
|
<view class="brief mar_t20">
|
|
|
<view class="brief_title flex_r flex_ac">产品简介</view>
|
|
|
- <view class="brief_con">
|
|
|
+ <view class="brief_con" v-if="type != 3">
|
|
|
<!-- <mp-html :content="detail.goods_content" ref="jyf"></mp-html> -->
|
|
|
<img
|
|
|
v-for="(i, s) in detail.goods_img"
|
|
|
@@ -142,6 +202,16 @@
|
|
|
mode="widthFix"
|
|
|
/>
|
|
|
</view>
|
|
|
+ <view class="brief_con" v-else>
|
|
|
+ <!-- <mp-html :content="detail.goods_content" ref="jyf"></mp-html> -->
|
|
|
+ <img
|
|
|
+ v-for="(i, s) in detail.goods_dimg"
|
|
|
+ :key="s"
|
|
|
+ :src="i"
|
|
|
+ alt=""
|
|
|
+ mode="widthFix"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<!-- 产品简介-end -->
|
|
|
<!-- 底部导航组件 -->
|
|
|
@@ -202,15 +272,17 @@ export default {
|
|
|
userinfo: {},
|
|
|
goodsDa: {},
|
|
|
unid: "",
|
|
|
- goods_price: 0, //到手价
|
|
|
- yj_price: 0, // 返利金额
|
|
|
+ goods_price: 0, //淘宝京东到手价
|
|
|
+ goods_price_origin: 0, //京东到手价
|
|
|
+ yj_price: 0, // 淘宝京东返利金额
|
|
|
+ shopName: "", //京东店铺名称
|
|
|
tabs: [],
|
|
|
radio: 0, // 返利比例
|
|
|
- annual_vol: "", //淘宝销量
|
|
|
+ annual_vol: "", //淘宝京东销量
|
|
|
chabao_ratio: 0, // 茶宝比例
|
|
|
- coupon_discount: 0, //淘宝商品券
|
|
|
- promotion_start_time: 0, // 淘宝商品券开始时间
|
|
|
- promotion_end_time: 0, // 淘宝商品券到期时间
|
|
|
+ coupon_discount: 0, //淘宝京东商品券
|
|
|
+ promotion_start_time: 0, // 淘宝京东商品券开始时间
|
|
|
+ promotion_end_time: 0, // 淘宝京东商品券到期时间
|
|
|
};
|
|
|
},
|
|
|
onLoad(e) {
|
|
|
@@ -226,6 +298,15 @@ export default {
|
|
|
this.coupon_discount = e.coupon_discount || 0;
|
|
|
this.promotion_start_time = e.promotion_start_time;
|
|
|
this.promotion_end_time = e.promotion_end_time;
|
|
|
+ } else if (this.type == 3) {
|
|
|
+ this.yj_price = e.yj_price || 0;
|
|
|
+ this.goods_price = e.goods_price || 0;
|
|
|
+ this.goods_price_origin = e.goods_price_origin || 0;
|
|
|
+ this.annual_vol = e.annual_vol || 0;
|
|
|
+ this.coupon_discount = e.coupon_discount || 0;
|
|
|
+ this.shopName = e.shopName;
|
|
|
+ this.promotion_start_time = e.promotion_start_time;
|
|
|
+ this.promotion_end_time = e.promotion_end_time;
|
|
|
}
|
|
|
this.getIcon();
|
|
|
this.loadData(e);
|
|
|
@@ -274,7 +355,10 @@ export default {
|
|
|
|
|
|
this.buttonGroup[1].text =
|
|
|
"下单省\n¥" +
|
|
|
- Math.floor((this.yj_price + this.detail.coupon_discount / 100)*100)/100;
|
|
|
+ Math.floor(
|
|
|
+ (this.yj_price + this.detail.coupon_discount / 100) * 100
|
|
|
+ ) /
|
|
|
+ 100;
|
|
|
} else {
|
|
|
uni.showModal({
|
|
|
title: "提示",
|
|
|
@@ -309,9 +393,51 @@ export default {
|
|
|
|
|
|
this.buttonGroup[1].text =
|
|
|
"下单省\n¥" +
|
|
|
- Math.floor((Number(this.detail.reserve_price) -
|
|
|
- Number(this.goods_price) +
|
|
|
- Number(this.yj_price)) *100)/100;
|
|
|
+ Math.floor(
|
|
|
+ (Number(this.detail.reserve_price) -
|
|
|
+ Number(this.goods_price) +
|
|
|
+ Number(this.yj_price)) *
|
|
|
+ 100
|
|
|
+ ) /
|
|
|
+ 100;
|
|
|
+ } else {
|
|
|
+ uni.showModal({
|
|
|
+ title: "提示",
|
|
|
+ content: res.msg,
|
|
|
+ showCancel: false,
|
|
|
+ success: function (res) {
|
|
|
+ if (res) {
|
|
|
+ uni.navigateBack({
|
|
|
+ delta: 1,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else if (this.type == 3) {
|
|
|
+ post("v1/cashback/jingdongInfo", da).then((res) => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.detail = JSON.parse(
|
|
|
+ res.data.jd_union_open_goods_bigfield_query_responce.queryResult
|
|
|
+ ).data[0];
|
|
|
+ console.log(this.detail, "----");
|
|
|
+ let arr = [];
|
|
|
+ this.detail?.imageInfo?.imageList.forEach((element) => {
|
|
|
+ arr.push(element.url);
|
|
|
+ });
|
|
|
+ this.detail.goods_img = arr;
|
|
|
+ this.detail.goods_dimg = this.detail.detailImages.split(",");
|
|
|
+
|
|
|
+ this.buttonGroup[1].text =
|
|
|
+ "下单省\n¥" +
|
|
|
+ Math.floor(
|
|
|
+ (Number(this.goods_price_origin) -
|
|
|
+ Number(this.goods_price) +
|
|
|
+ Number(this.yj_price)) *
|
|
|
+ 100
|
|
|
+ ) /
|
|
|
+ 100;
|
|
|
} else {
|
|
|
uni.showModal({
|
|
|
title: "提示",
|
|
|
@@ -359,7 +485,30 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
} else if (this.type == 2) {
|
|
|
- _this.isOauth()
|
|
|
+ _this.isOauth();
|
|
|
+ } else if (this.type == 3) {
|
|
|
+ post("v1/cashback/jingdongUrl", {
|
|
|
+ item_id: _this.detail.itemId,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ let data = JSON.parse(
|
|
|
+ res.data.jd_union_open_promotion_bysubunionid_get_responce.getResult
|
|
|
+ ).data;
|
|
|
+ console.log(data);
|
|
|
+ wx.navigateToMiniProgram({
|
|
|
+ appId: "wx91d27dbf599dff74",
|
|
|
+ path: "pages/union/proxy/proxy?spreadUrl="+data.shortURL,
|
|
|
+ extraData: {
|
|
|
+
|
|
|
+ },
|
|
|
+ envVersion: "release",
|
|
|
+ success(res) {
|
|
|
+ // 打开成功
|
|
|
+ _this.$refs.popup.close();
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -369,9 +518,8 @@ export default {
|
|
|
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;
|
|
|
+ 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,
|
|
|
@@ -417,42 +565,39 @@ 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) => {},
|
|
|
- });
|
|
|
-
|
|
|
- })
|
|
|
- }
|
|
|
+ if (res.code === 0) {
|
|
|
+ console.log(res.data.data);
|
|
|
+
|
|
|
+ if (res.data.data.special_id != 0) {
|
|
|
+ _this.getTaobaoUrl();
|
|
|
} else {
|
|
|
- uni.reLaunch({
|
|
|
- url:'/pages/my/index'
|
|
|
- })
|
|
|
+ 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");
|
|
|
@@ -469,13 +614,21 @@ export default {
|
|
|
} else if (this.type == 2) {
|
|
|
var path = `pagesC/shoppingMallType/p_details?item_id=${this.detail.input_num_iid}&type=${this.type}&goods_price=${this.goods_price}&yj_price=${this.yj_price}&annual_vol=${this.annual_vol}&coupon_discount=${this.coupon_discount}&promotion_start_time=${this.promotion_start_time}&promotion_end_time=${this.promotion_end_time}`;
|
|
|
var title = this.detail.title;
|
|
|
- console.log(this.detail.goods_name);
|
|
|
|
|
|
return {
|
|
|
title: title,
|
|
|
path: path,
|
|
|
imageUrl: this.detail.pict_url,
|
|
|
};
|
|
|
+ } else if (this.type == 3) {
|
|
|
+ var path = `pagesC/shoppingMallType/p_details?item_id=${this.detail.itemId}&type=${this.type}&goods_price=${this.goods_price}&yj_price=${this.yj_price}&annual_vol=${this.annual_vol}&coupon_discount=${this.coupon_discount}&promotion_start_time=${this.promotion_start_time}&promotion_end_time=${this.promotion_end_time}&goods_price_origin=${this.goods_price_origin}&shopName=${this.shopName}`;
|
|
|
+ var title = this.detail.skuName;
|
|
|
+
|
|
|
+ return {
|
|
|
+ title: title,
|
|
|
+ path: path,
|
|
|
+ imageUrl: this.detail.goods_img[0],
|
|
|
+ };
|
|
|
}
|
|
|
},
|
|
|
};
|