|
@@ -268,7 +268,7 @@ Page({
|
|
|
let optionsStr = decodeURIComponent(options.scene);
|
|
|
let optionsArr = optionsStr.split('&');
|
|
|
// 暂时这样写
|
|
|
- if (optionsArr[0].split("=")[0] === "type"){
|
|
|
+ if (optionsArr[0].split("=")[0] === "type") {
|
|
|
console.log('我是团购分享')
|
|
|
options.type = optionsArr[0].split("=")[1];
|
|
|
options.sid = optionsArr[1].split("=")[1];
|
|
@@ -351,11 +351,11 @@ Page({
|
|
|
this.uid = wx.getStorageSync('uid');
|
|
|
if (options.sid) {
|
|
|
httpRequestApi.getUserRec(options.sid).success(res => {
|
|
|
- options.uid = res.data.data;
|
|
|
- this.shareGetPage(options)
|
|
|
+ options.uid = res.data.data;
|
|
|
+ this.shareGetPage(options)
|
|
|
})
|
|
|
} else {
|
|
|
- this.shareGetPage(options)
|
|
|
+ this.shareGetPage(options)
|
|
|
}
|
|
|
// if (!this.uid || !grade) {
|
|
|
// this.setData({
|
|
@@ -394,21 +394,21 @@ Page({
|
|
|
},
|
|
|
// 封装分享方法之后跳到页面方法
|
|
|
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');
|
|
|
if (options.type && options.uid) {
|
|
@@ -418,7 +418,7 @@ Page({
|
|
|
}).success(res => {
|
|
|
console.log(res)
|
|
|
})
|
|
|
- }
|
|
|
+ }
|
|
|
},
|
|
|
onShow: function () {
|
|
|
let grade = wx.getStorageSync('grade');
|
|
@@ -1115,6 +1115,9 @@ Page({
|
|
|
* 跳转到活动页
|
|
|
*/
|
|
|
goToActivity() {
|
|
|
+ httpRequestApi.postActEvent('BANNER').success(res => {
|
|
|
+ console.log('活动banner', res)
|
|
|
+ })
|
|
|
wx.navigateTo({
|
|
|
url: `../activity/index/index`
|
|
|
});
|
|
@@ -1122,35 +1125,36 @@ Page({
|
|
|
/**
|
|
|
* banner点击
|
|
|
*/
|
|
|
- bannerTap() {
|
|
|
+ bannerTap() {
|
|
|
if (!this.data.isLogin) {
|
|
|
wx.navigateTo({
|
|
|
url: `../../pages/login/login?index=0`
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- if(this.data.isIos || this.data.isVip) {
|
|
|
+ if (this.data.isIos || this.data.isVip) {
|
|
|
this.myPlase();
|
|
|
} else {
|
|
|
this.messageAuth();
|
|
|
}
|
|
|
- },
|
|
|
+ },
|
|
|
/**活动改版 */
|
|
|
myPlase() {
|
|
|
- if(!wx.getStorageSync('message')) {
|
|
|
+ if (!wx.getStorageSync('message')) {
|
|
|
wx.requestSubscribeMessage({
|
|
|
tmplIds: ['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY',
|
|
|
- '-2ZZpWFoyKvAtX1HwEIQLQ92LnN8cryamB94LqLGo98'],
|
|
|
- success: (res) => {
|
|
|
+ '-2ZZpWFoyKvAtX1HwEIQLQ92LnN8cryamB94LqLGo98'
|
|
|
+ ],
|
|
|
+ success: (res) => {
|
|
|
console.log(res)
|
|
|
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({
|
|
|
url: `../vipActivity/vipActivity`
|
|
@@ -1162,7 +1166,7 @@ Page({
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
wx.navigateTo({
|
|
|
url: `../vipActivity/vipActivity`
|
|
|
});
|
|
@@ -1199,14 +1203,14 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
// 去支付需要获取权限
|
|
|
this.messageAuth();
|
|
|
}
|
|
|
|
|
|
},
|
|
|
// 去产品页
|
|
|
- goToPruduct(){
|
|
|
+ goToPruduct() {
|
|
|
wx.navigateTo({
|
|
|
url: `../product/product?price=${this.data.myData.price}`
|
|
|
});
|
|
@@ -1216,15 +1220,16 @@ Page({
|
|
|
if (!wx.getStorageSync('message')) {
|
|
|
wx.requestSubscribeMessage({
|
|
|
tmplIds: ['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY',
|
|
|
- '-2ZZpWFoyKvAtX1HwEIQLQ92LnN8cryamB94LqLGo98'],
|
|
|
- success: (res) => {
|
|
|
+ '-2ZZpWFoyKvAtX1HwEIQLQ92LnN8cryamB94LqLGo98'
|
|
|
+ ],
|
|
|
+ success: (res) => {
|
|
|
console.log(res)
|
|
|
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();
|
|
|
},
|
|
@@ -1237,7 +1242,7 @@ Page({
|
|
|
}
|
|
|
},
|
|
|
// 支付
|
|
|
- order () {
|
|
|
+ order() {
|
|
|
// 渠道id
|
|
|
const productId = wx.getStorageSync('productId');
|
|
|
httpRequestApi.createOrder(productId).success(res => {
|
|
@@ -1261,22 +1266,22 @@ Page({
|
|
|
}
|
|
|
httpRequestApi.getAuthActivity().success(res => {
|
|
|
if (!res.data.data) {
|
|
|
- wx.setStorageSync('vip', false)
|
|
|
- wx.setStorageSync('date', '')
|
|
|
+ wx.setStorageSync('vip', false)
|
|
|
+ wx.setStorageSync('date', '')
|
|
|
} 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) {}
|
|
|
})
|
|
|
})
|
|
|
},
|