|
|
@@ -173,7 +173,7 @@
|
|
|
</view>
|
|
|
<!-- #endif -->
|
|
|
<!-- #ifdef MP-TOUTIAO -->
|
|
|
- <template v-if="power != ''">
|
|
|
+ <template v-if="power">
|
|
|
<navigator open-type="switchTab" class="animated item" :class="animated == true ? 'bounceIn' : ''" url="/pages/order_addcart/order_addcart" hover-class="none">
|
|
|
<view class="iconfont icon-gouwuche1">
|
|
|
<text v-if="CartCount > 0" class="num bg-color">{{ CartCount || 0 }}</text>
|
|
|
@@ -385,7 +385,10 @@ export default {
|
|
|
onLoad(options) {
|
|
|
let that = this;
|
|
|
// #ifdef APP-PLUS
|
|
|
- that.ppower = uni.getStorageSync('power')
|
|
|
+ // that.ppower = uni.getStorageSync('power')
|
|
|
+ // #endif
|
|
|
+ // #ifdef MP-TOUTIAO
|
|
|
+ this.getppower()
|
|
|
// #endif
|
|
|
if (options.spid) {
|
|
|
app.globalData.spid = options.spid;
|
|
|
@@ -1350,6 +1353,24 @@ export default {
|
|
|
image: url
|
|
|
});
|
|
|
return res.data.image;
|
|
|
+
|
|
|
+ },
|
|
|
+ getppower() {
|
|
|
+ getPower().then( ({data}) => {
|
|
|
+ if(data.openlink) {
|
|
|
+ this.ppower = true
|
|
|
+ this.power = data.openlink
|
|
|
+ uni.setStorageSync('power', data.openlink);
|
|
|
+ }else {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ showCancel: false,
|
|
|
+ content: '抖音小程序主要为商品展示,不支持加入购物车和购买功能!',
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
},
|
|
|
getPower() {
|
|
|
let obj = this;
|
|
|
@@ -1367,6 +1388,8 @@ export default {
|
|
|
path: curRouter,
|
|
|
query: query
|
|
|
}).then(({ data }) => {
|
|
|
+ obj.power = data.openlink;
|
|
|
+ console.log(obj.power,'obj.power-befo')
|
|
|
if (data.openlink) {
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
@@ -1374,12 +1397,12 @@ export default {
|
|
|
content: '抖音小程序为商品展示,请点击下方的复制链接,通过微信打开!',
|
|
|
confirmText: '复制链接',
|
|
|
success: () => {
|
|
|
- obj.power = data.openlink;
|
|
|
+ console.log(obj.power,'obj.power-after')
|
|
|
uni.setClipboardData({
|
|
|
data: obj.power,
|
|
|
success: function() {
|
|
|
console.log('success');
|
|
|
- return true;
|
|
|
+ // return true;
|
|
|
},
|
|
|
fail: function() {
|
|
|
console.log('err')
|