Commit d6a95277 by 高淑倩

plus_重新登陆更新缓存

parent 661ecb83
...@@ -33,12 +33,12 @@ wxService.page({ ...@@ -33,12 +33,12 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
const { amount,status } = this.options const { amount, status } = this.options
console.log('this.options', status) console.log('this.options', status)
this.setData({ this.setData({
amount, amount,
status status
},()=> { }, () => {
// 当前用户是否关注公众号 // 当前用户是否关注公众号
this.getMemberSubscribe() this.getMemberSubscribe()
this.loginUpdateStroage() //登录更新plus缓存 this.loginUpdateStroage() //登录更新plus缓存
...@@ -49,30 +49,31 @@ wxService.page({ ...@@ -49,30 +49,31 @@ wxService.page({
title: status == 'S' ? '支付成功' : '支付失败' title: status == 'S' ? '支付成功' : '支付失败'
}) })
}, },
loginUpdateStroage(){ loginUpdateStroage() {
const code = wx.getStorageSync('_loginCode') const code = wx.getStorageSync('_loginCode')
const wechatInfo = wx.getStorageSync('_wechatInfo') const wechatInfo = wx.getStorageSync('_wechatInfo')
wxService.login().then((res) => {
wxService.post(`/member/minaLogin`, { wxService.post(`/member/minaLogin`, {
code, code:res.code,
wechatInfo, wechatInfo,
brandId: app.globalData.brandId, brandId: app.globalData.brandId,
}) })
})
}, },
toPlus() { toPlus() {
wxService.post(`/merchant/modelPage/mainSetting/page?brandId=${app.globalData.brandId}&isMain=3&type=2`).then(res => { wxService.post(`/merchant/modelPage/mainSetting/page?brandId=${app.globalData.brandId}&isMain=3&type=2`).then(res => {
const { result, data } = res.data const { result, data } = res.data
if (result == 0){ if (result == 0) {
wxService.router(`/subPackage/page/pages/subPage/subPage?pageId=${data.page.pageId}`) wxService.router(`/subPackage/page/pages/subPage/subPage?pageId=${data.page.pageId}`)
} }
}) })
}, },
getMemberSubscribe(){ getMemberSubscribe() {
const baseUserInfo = wx.getStorageSync('_baseUserInfo') const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const { openid } = baseUserInfo.member const { openid } = baseUserInfo.member
wxService.post(`/member/subscribe?openid=${openid}`).then(res => { wxService.post(`/member/subscribe?openid=${openid}`).then(res => {
const { result, data } = res.data const { result, data } = res.data
if (result == 0){ if (result == 0) {
// 0 未关注 1 已关注 // 0 未关注 1 已关注
this.setData({ this.setData({
isSubscribe: data == 0 ? false : true isSubscribe: data == 0 ? false : true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment