|
@@ -268,7 +268,7 @@ Page({
|
|
let optionsStr = decodeURIComponent(options.scene);
|
|
let optionsStr = decodeURIComponent(options.scene);
|
|
let optionsArr = optionsStr.split('&');
|
|
let optionsArr = optionsStr.split('&');
|
|
// 暂时这样写
|
|
// 暂时这样写
|
|
- if (optionsArr[0].split("=")[0] === "type"){
|
|
|
|
|
|
+ if (optionsArr[0].split("=")[0] === "type") {
|
|
console.log('我是团购分享')
|
|
console.log('我是团购分享')
|
|
options.type = optionsArr[0].split("=")[1];
|
|
options.type = optionsArr[0].split("=")[1];
|
|
options.sid = optionsArr[1].split("=")[1];
|
|
options.sid = optionsArr[1].split("=")[1];
|
|
@@ -351,11 +351,11 @@ Page({
|
|
this.uid = wx.getStorageSync('uid');
|
|
this.uid = wx.getStorageSync('uid');
|
|
if (options.sid) {
|
|
if (options.sid) {
|
|
httpRequestApi.getUserRec(options.sid).success(res => {
|
|
httpRequestApi.getUserRec(options.sid).success(res => {
|
|
- options.uid = res.data.data;
|
|
|
|
- this.shareGetPage(options)
|
|
|
|
|
|
+ options.uid = res.data.data;
|
|
|
|
+ this.shareGetPage(options)
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- this.shareGetPage(options)
|
|
|
|
|
|
+ this.shareGetPage(options)
|
|
}
|
|
}
|
|
// if (!this.uid || !grade) {
|
|
// if (!this.uid || !grade) {
|
|
// this.setData({
|
|
// this.setData({
|
|
@@ -394,21 +394,21 @@ Page({
|
|
},
|
|
},
|
|
// 封装分享方法之后跳到页面方法
|
|
// 封装分享方法之后跳到页面方法
|
|
shareGetPage(options) {
|
|
shareGetPage(options) {
|
|
- console.log(this.uid, options.uid ,this.uid !== options.uid)
|
|
|
|
- if(options.type && options.type === 'iphone' && !app.globalData.isIOS && this.uid !== options.uid) {
|
|
|
|
- this.setData({
|
|
|
|
- helpPayHide: false,
|
|
|
|
- tipsType: 'helpPay',
|
|
|
|
- helpPayImg: 'http://reader-wx.ai160.com/images/reader/pay/buy.png',
|
|
|
|
- })
|
|
|
|
|
|
+ console.log(this.uid, options.uid, this.uid !== options.uid)
|
|
|
|
+ if (options.type && options.type === 'iphone' && !app.globalData.isIOS && this.uid !== options.uid) {
|
|
|
|
+ this.setData({
|
|
|
|
+ helpPayHide: false,
|
|
|
|
+ tipsType: 'helpPay',
|
|
|
|
+ helpPayImg: 'http://reader-wx.ai160.com/images/reader/pay/buy.png',
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- if(options.type && options.type === 'ios' && this.uid !== options.uid) {
|
|
|
|
- this.setData({
|
|
|
|
- helpPayHide: false,
|
|
|
|
- tipsType: 'helpPay',
|
|
|
|
- helpPayImg: 'http://reader-wx.ai160.com/images/reader/pay/help.png',
|
|
|
|
- })
|
|
|
|
- console.log(options.uid)
|
|
|
|
|
|
+ if (options.type && options.type === 'ios' && this.uid !== options.uid) {
|
|
|
|
+ this.setData({
|
|
|
|
+ helpPayHide: false,
|
|
|
|
+ tipsType: 'helpPay',
|
|
|
|
+ helpPayImg: 'http://reader-wx.ai160.com/images/reader/pay/help.png',
|
|
|
|
+ })
|
|
|
|
+ console.log(options.uid)
|
|
}
|
|
}
|
|
const recOsType = options.type === 'iphone' ? 'ANDROID' : (options.type === 'ios' && 'IOS');
|
|
const recOsType = options.type === 'iphone' ? 'ANDROID' : (options.type === 'ios' && 'IOS');
|
|
if (options.type && options.uid) {
|
|
if (options.type && options.uid) {
|
|
@@ -418,7 +418,7 @@ Page({
|
|
}).success(res => {
|
|
}).success(res => {
|
|
console.log(res)
|
|
console.log(res)
|
|
})
|
|
})
|
|
- }
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
onShow: function () {
|
|
onShow: function () {
|
|
let grade = wx.getStorageSync('grade');
|
|
let grade = wx.getStorageSync('grade');
|
|
@@ -1115,6 +1115,9 @@ Page({
|
|
* 跳转到活动页
|
|
* 跳转到活动页
|
|
*/
|
|
*/
|
|
goToActivity() {
|
|
goToActivity() {
|
|
|
|
+ httpRequestApi.postActEvent('BANNER').success(res => {
|
|
|
|
+ console.log('活动banner', res)
|
|
|
|
+ })
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../activity/index/index`
|
|
url: `../activity/index/index`
|
|
});
|
|
});
|
|
@@ -1122,35 +1125,36 @@ Page({
|
|
/**
|
|
/**
|
|
* banner点击
|
|
* banner点击
|
|
*/
|
|
*/
|
|
- bannerTap() {
|
|
|
|
|
|
+ bannerTap() {
|
|
if (!this.data.isLogin) {
|
|
if (!this.data.isLogin) {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../../pages/login/login?index=0`
|
|
url: `../../pages/login/login?index=0`
|
|
});
|
|
});
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- if(this.data.isIos || this.data.isVip) {
|
|
|
|
|
|
+ if (this.data.isIos || this.data.isVip) {
|
|
this.myPlase();
|
|
this.myPlase();
|
|
} else {
|
|
} else {
|
|
this.messageAuth();
|
|
this.messageAuth();
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ },
|
|
/**活动改版 */
|
|
/**活动改版 */
|
|
myPlase() {
|
|
myPlase() {
|
|
- if(!wx.getStorageSync('message')) {
|
|
|
|
|
|
+ if (!wx.getStorageSync('message')) {
|
|
wx.requestSubscribeMessage({
|
|
wx.requestSubscribeMessage({
|
|
tmplIds: ['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY',
|
|
tmplIds: ['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY',
|
|
- '-2ZZpWFoyKvAtX1HwEIQLQ92LnN8cryamB94LqLGo98'],
|
|
|
|
- success: (res) => {
|
|
|
|
|
|
+ '-2ZZpWFoyKvAtX1HwEIQLQ92LnN8cryamB94LqLGo98'
|
|
|
|
+ ],
|
|
|
|
+ success: (res) => {
|
|
console.log(res)
|
|
console.log(res)
|
|
if (res['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY'] === 'reject') {
|
|
if (res['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY'] === 'reject') {
|
|
- console.log('用户不同意订阅')
|
|
|
|
- // 用户不同意订阅
|
|
|
|
- wx.setStorageSync('message', false)
|
|
|
|
- } else if(res['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY'] === 'accept') {
|
|
|
|
- console.log('订阅成功')
|
|
|
|
- // 用户点击统一订阅
|
|
|
|
- wx.setStorageSync('message', true)
|
|
|
|
|
|
+ console.log('用户不同意订阅')
|
|
|
|
+ // 用户不同意订阅
|
|
|
|
+ wx.setStorageSync('message', false)
|
|
|
|
+ } else if (res['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY'] === 'accept') {
|
|
|
|
+ console.log('订阅成功')
|
|
|
|
+ // 用户点击统一订阅
|
|
|
|
+ wx.setStorageSync('message', true)
|
|
}
|
|
}
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../vipActivity/vipActivity`
|
|
url: `../vipActivity/vipActivity`
|
|
@@ -1162,7 +1166,7 @@ Page({
|
|
});
|
|
});
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../vipActivity/vipActivity`
|
|
url: `../vipActivity/vipActivity`
|
|
});
|
|
});
|
|
@@ -1199,14 +1203,14 @@ Page({
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
// 去支付需要获取权限
|
|
// 去支付需要获取权限
|
|
this.messageAuth();
|
|
this.messageAuth();
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
// 去产品页
|
|
// 去产品页
|
|
- goToPruduct(){
|
|
|
|
|
|
+ goToPruduct() {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../product/product?price=${this.data.myData.price}`
|
|
url: `../product/product?price=${this.data.myData.price}`
|
|
});
|
|
});
|
|
@@ -1216,15 +1220,16 @@ Page({
|
|
if (!wx.getStorageSync('message')) {
|
|
if (!wx.getStorageSync('message')) {
|
|
wx.requestSubscribeMessage({
|
|
wx.requestSubscribeMessage({
|
|
tmplIds: ['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY',
|
|
tmplIds: ['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY',
|
|
- '-2ZZpWFoyKvAtX1HwEIQLQ92LnN8cryamB94LqLGo98'],
|
|
|
|
- success: (res) => {
|
|
|
|
|
|
+ '-2ZZpWFoyKvAtX1HwEIQLQ92LnN8cryamB94LqLGo98'
|
|
|
|
+ ],
|
|
|
|
+ success: (res) => {
|
|
console.log(res)
|
|
console.log(res)
|
|
if (res['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY'] === 'reject') {
|
|
if (res['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY'] === 'reject') {
|
|
- console.log('用户不同意订阅')
|
|
|
|
- wx.setStorageSync('message', false)
|
|
|
|
- } else if(res['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY'] === 'accept') {
|
|
|
|
- console.log('订阅成功')
|
|
|
|
- wx.setStorageSync('message', true)
|
|
|
|
|
|
+ console.log('用户不同意订阅')
|
|
|
|
+ wx.setStorageSync('message', false)
|
|
|
|
+ } else if (res['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY'] === 'accept') {
|
|
|
|
+ console.log('订阅成功')
|
|
|
|
+ wx.setStorageSync('message', true)
|
|
}
|
|
}
|
|
this.order();
|
|
this.order();
|
|
},
|
|
},
|
|
@@ -1237,7 +1242,7 @@ Page({
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 支付
|
|
// 支付
|
|
- order () {
|
|
|
|
|
|
+ order() {
|
|
// 渠道id
|
|
// 渠道id
|
|
const productId = wx.getStorageSync('productId');
|
|
const productId = wx.getStorageSync('productId');
|
|
httpRequestApi.createOrder(productId).success(res => {
|
|
httpRequestApi.createOrder(productId).success(res => {
|
|
@@ -1261,22 +1266,22 @@ Page({
|
|
}
|
|
}
|
|
httpRequestApi.getAuthActivity().success(res => {
|
|
httpRequestApi.getAuthActivity().success(res => {
|
|
if (!res.data.data) {
|
|
if (!res.data.data) {
|
|
- wx.setStorageSync('vip', false)
|
|
|
|
- wx.setStorageSync('date', '')
|
|
|
|
|
|
+ wx.setStorageSync('vip', false)
|
|
|
|
+ wx.setStorageSync('date', '')
|
|
} else {
|
|
} else {
|
|
- wx.setStorageSync('vip', true)
|
|
|
|
- wx.setStorageSync('date', res.data.data)
|
|
|
|
- this.setData({
|
|
|
|
- ['myData.isVIP']: true,
|
|
|
|
- ['myData.date']: res.data.data
|
|
|
|
- })
|
|
|
|
- this.showGift();
|
|
|
|
|
|
+ wx.setStorageSync('vip', true)
|
|
|
|
+ wx.setStorageSync('date', res.data.data)
|
|
|
|
+ this.setData({
|
|
|
|
+ ['myData.isVIP']: true,
|
|
|
|
+ ['myData.date']: res.data.data
|
|
|
|
+ })
|
|
|
|
+ this.showGift();
|
|
}
|
|
}
|
|
- }).fail(error => {
|
|
|
|
- console.log(error)
|
|
|
|
- })
|
|
|
|
|
|
+ }).fail(error => {
|
|
|
|
+ console.log(error)
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- fail (res) { }
|
|
|
|
|
|
+ fail(res) {}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|