|
|
@@ -26,11 +26,9 @@
|
|
|
v-if="product.salePrice == product.actualPrice && product.marketPrice > 0&&product.salePrice<product.marketPrice">¥{{product.marketPrice}}</text>
|
|
|
</view>
|
|
|
<view class=" sellStock" v-if="product.sellStock>0">销量:<text>{{product.sellStock}}</text></view>
|
|
|
- <!-- #ifdef MP-WEIXIN -->
|
|
|
<view class="share" @tap="showShare">
|
|
|
<image src="/static/pages/images/fxico.png"></image>分享
|
|
|
</view>
|
|
|
- <!-- #endif -->
|
|
|
|
|
|
|
|
|
</view>
|
|
|
@@ -179,7 +177,7 @@
|
|
|
<view class="botbtn" @click="goHome()">
|
|
|
<image src="/static/pages/images/sy.png"></image>首页
|
|
|
</view>
|
|
|
- <view class="botbtn" @tap="jumpCart('/pages/cart/cart')">
|
|
|
+ <view class="botbtn" @tap="jumpCart('pages/cart/cart')">
|
|
|
<image src="/static/pages/images/gwc.png"></image>购物车<text class="message"
|
|
|
v-if="product.count > 0">{{product.count}}</text>
|
|
|
</view>
|
|
|
@@ -388,7 +386,6 @@
|
|
|
}
|
|
|
await this.bindUser(params);
|
|
|
} else {
|
|
|
- await req.silenceLogin();
|
|
|
}
|
|
|
return false
|
|
|
if (options.hideShop) {
|
|
|
@@ -425,13 +422,6 @@
|
|
|
}, 10000);
|
|
|
setTimeout(() => {
|
|
|
actionsdk.initAction();
|
|
|
- // actionsdk.saveBrowse({
|
|
|
- // type: 1,
|
|
|
- // bindId: this.query.id,
|
|
|
- // uid: req.getStorage('userInfo').id,
|
|
|
- // shareUid: this.query.userId ? this.query.userId : null,
|
|
|
- // parentCode: this.query.parentCode ? this.query.parentCode : null
|
|
|
- // });
|
|
|
}, 2000)
|
|
|
},
|
|
|
async onShow() {
|
|
|
@@ -488,14 +478,13 @@
|
|
|
}, 4 * 1000);
|
|
|
// #endif
|
|
|
},
|
|
|
-
|
|
|
methods: {
|
|
|
initLocation() {
|
|
|
this.getMerchant();
|
|
|
},
|
|
|
|
|
|
goHome() {
|
|
|
- h5util.jumpIndex()
|
|
|
+ h5util.jumpIndex('/pages/tabBar/index?channel=home')
|
|
|
// app.globalData.openHome();
|
|
|
},
|
|
|
|
|
|
@@ -503,20 +492,14 @@
|
|
|
let merchantId = '';
|
|
|
let path = '';
|
|
|
let isSolution = '';
|
|
|
- // #ifndef H5
|
|
|
isSolution = req.env[req.env.NODE_ENV].isSolution;
|
|
|
- // #endif
|
|
|
- // #ifdef H5
|
|
|
- isSolution = false;
|
|
|
- // #endif
|
|
|
let userInfo = req.getStorage('userInfo');
|
|
|
let shopId = '';
|
|
|
if (isSolution) {
|
|
|
path = '/share/home/index?appId=' + req.getStorage('appId') + '&userId=' + req.getStorage(
|
|
|
'userInfo').id;
|
|
|
} else {
|
|
|
- path = '/product/detail/detail?id=' + this.query.id + '&isShare=' + true + '&appId=' + req
|
|
|
- .getStorage('appId');
|
|
|
+ path = '/product/detail/detail?id=' + this.query.id
|
|
|
// console.log(!req.getStorage('userInfo').id);
|
|
|
if (!userInfo.id) {} else {
|
|
|
path += '&userId=' + userInfo.id;
|
|
|
@@ -538,25 +521,9 @@
|
|
|
}
|
|
|
}
|
|
|
route.share(1, userInfo.id, path, merchantId, shopId, 1, this.query.id);
|
|
|
-
|
|
|
- if (options && options.from == "menu") {
|
|
|
- this.parentCode = await new Promise((r, j) => {
|
|
|
- actionsdk.saveBehavior({
|
|
|
- behaviorType: 5,
|
|
|
- type: 1,
|
|
|
- bindId: this.query.id,
|
|
|
- uid: req.getStorage('userInfo').id,
|
|
|
- success: (data) => {
|
|
|
- r(data)
|
|
|
- }
|
|
|
- });
|
|
|
- })
|
|
|
- }
|
|
|
- if (this.parentCode) {
|
|
|
- path = path + '&parentCode=' + this.parentCode
|
|
|
- }
|
|
|
- console.log(path);
|
|
|
-
|
|
|
+
|
|
|
+ path = this.SHARE_BEHAVIOR_FN({path:path,sendShare:false}).path
|
|
|
+ console.log('---share path----',path)
|
|
|
return {
|
|
|
title: this.product.title,
|
|
|
imageUrl: this.product.pic,
|
|
|
@@ -671,36 +638,23 @@
|
|
|
})
|
|
|
},
|
|
|
async showShare() {
|
|
|
- this.parentCode = await new Promise((r, j) => {
|
|
|
- actionsdk.saveBehavior({
|
|
|
- behaviorType: 5,
|
|
|
- type: 1,
|
|
|
- bindId: this.query.id,
|
|
|
- uid: req.getStorage('userInfo').id,
|
|
|
- success: (data) => {
|
|
|
- r(data)
|
|
|
- }
|
|
|
- });
|
|
|
- })
|
|
|
- // console.log(11111,this.hideShare)
|
|
|
- // #ifdef H5
|
|
|
- this.setData({
|
|
|
- hideShare: false
|
|
|
- });
|
|
|
-
|
|
|
- // #endif
|
|
|
- // #ifndef H5
|
|
|
- req.isLogin().then(success => {
|
|
|
- // console.log(success)
|
|
|
- if (success) {
|
|
|
- this.getCodeUrl()
|
|
|
- this.setData({
|
|
|
- hideShare: false
|
|
|
- });
|
|
|
- // console.log(this.hideShare)
|
|
|
+ let shareD = await this.onShareMessage()
|
|
|
+ h5util.jumpShare({
|
|
|
+ title:shareD.title,
|
|
|
+ imageUrl:shareD.imageUrl,
|
|
|
+ path:shareD.path,
|
|
|
+ shareType:2,
|
|
|
+ id:this.product.id,
|
|
|
+ merchantId:this.query.merchantId,
|
|
|
+ sendBehaviorObj:{
|
|
|
+ BIND_TYPE : this.BIND_TYPE,
|
|
|
+ BIND_ID : this.BIND_ID,
|
|
|
+ USER_ID : this.USER_ID,
|
|
|
+ SHARE_USER_ID : this.SHARE_USER_ID,
|
|
|
+ PARENT_CODE : this.PARENT_CODE,
|
|
|
+ CURRENT_CODE : this.CURRENT_CODE
|
|
|
}
|
|
|
- });
|
|
|
- // #endif
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -943,10 +897,18 @@
|
|
|
if (userInfo.listShopBase && userInfo.listShopBase.length > 0) {
|
|
|
form.shopId = userInfo.listShopBase[0].id;
|
|
|
}
|
|
|
- req.getRequest('/api/product/detail', form, data => {
|
|
|
+ req.getRequest('/api/product/detail', form, async data => {
|
|
|
//富文本图片放大
|
|
|
var nodes = data.detail;
|
|
|
- that.postShareMessage(data.title,data.pic)
|
|
|
+ let shareD = await this.onShareMessage()
|
|
|
+ that.postShareMessage(shareD.title,shareD.imageUrl,shareD.path,{
|
|
|
+ BIND_TYPE : this.BIND_TYPE,
|
|
|
+ BIND_ID : this.BIND_ID,
|
|
|
+ USER_ID : this.USER_ID,
|
|
|
+ SHARE_USER_ID : this.SHARE_USER_ID,
|
|
|
+ PARENT_CODE : this.PARENT_CODE,
|
|
|
+ CURRENT_CODE : this.CURRENT_CODE
|
|
|
+ })
|
|
|
// console.log(nodes)
|
|
|
// if (nodes) {
|
|
|
// if (nodes.indexOf("src") >= 0) {
|
|
|
@@ -1100,8 +1062,8 @@
|
|
|
|
|
|
toAddress() {
|
|
|
this.changeFreshen()
|
|
|
- h5util.jumpUrlExternal({url:'/mine/address/address'})
|
|
|
- // app.globalData.openPage('mine/address/address');
|
|
|
+ // h5util.jumpUrlExternal({url:'/mine/address/address'})
|
|
|
+ app.globalData.openPage('mine/address/address');
|
|
|
},
|
|
|
|
|
|
atOnceBuy() {
|
|
|
@@ -1232,6 +1194,9 @@
|
|
|
let url = '/product/detail/detail?' + path;
|
|
|
route.share(2, userInfo.id, url, merchantId, shopId, 1, this.query.id);
|
|
|
// console.log(path, url);
|
|
|
+
|
|
|
+ path = this.SHARE_BEHAVIOR_FN({path:path,sendShare:false}).path
|
|
|
+
|
|
|
return {
|
|
|
title: this.product.title,
|
|
|
query: path,
|
|
|
@@ -1251,8 +1216,10 @@
|
|
|
if (this.about.User_Limit_Store == 1) {
|
|
|
|
|
|
} else {
|
|
|
- h5util.jumpUrlExternal({url:url})
|
|
|
- // app.globalData.openPage(url);
|
|
|
+ // h5util.jumpUrlExternal({url:url})
|
|
|
+ uni.navigateTo({
|
|
|
+ url:url
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -1342,10 +1309,10 @@
|
|
|
},
|
|
|
jumpUrl(url) {
|
|
|
this.changeFreshen()
|
|
|
- h5util.jumpUrlExternal({url:url})
|
|
|
- // uni.navigateTo({
|
|
|
- // url: url
|
|
|
- // })
|
|
|
+ // h5util.jumpUrlExternal({url:url})
|
|
|
+ uni.navigateTo({
|
|
|
+ url: url
|
|
|
+ })
|
|
|
},
|
|
|
getUpdate() {
|
|
|
let userInfos = req.getStorage('userInfo');
|
|
|
@@ -1373,11 +1340,11 @@
|
|
|
},
|
|
|
jumpCart(url) {
|
|
|
if (req.getStorage('cartTab')) {
|
|
|
- // app.globalData.reLaunchTo(url);
|
|
|
- h5util.jumpUrlExternal({url:url})
|
|
|
+ app.globalData.reLaunchTo(url);
|
|
|
+ // h5util.jumpUrlExternal({url:url})
|
|
|
} else {
|
|
|
- // app.globalData.openPage(url)
|
|
|
- h5util.jumpUrlExternal({url:url})
|
|
|
+ app.globalData.openPage(url)
|
|
|
+ // h5util.jumpUrlExternal({url:url})
|
|
|
}
|
|
|
}
|
|
|
}
|