Commit bfbb8bb3 by 高淑倩

当前用户是否关注公众号

parent dae56f42
......@@ -13,6 +13,7 @@ wxService.page({
data: {
amount: 0,
status: 'S',
isSubscribe: false
},
/**
......@@ -37,14 +38,15 @@ wxService.page({
this.setData({
amount,
status
},()=> {
// 当前用户是否关注公众号
this.getMemberSubscribe()
})
// 动态设置title
wx.setNavigationBarTitle({
title: status == 'S' ? '支付成功' : '支付失败'
})
},
toPlus() {
wxService.post(`/merchant/modelPage/mainSetting/page?brandId=${app.globalData.brandId}&isMain=3&type=2`).then(res => {
......@@ -54,6 +56,19 @@ wxService.page({
}
})
},
getMemberSubscribe(){
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const { openid } = baseUserInfo.member
wxService.post(`/member/subscribe?openid=${openid}`).then(res => {
const { result, data } = res.data
if (result == 0){
// 0 未关注 1 已关注
this.setData({
isSubscribe: data == 0 ? false : true
})
}
})
},
goPayAgain() {
console.log('goPayAgain')
},
......
......@@ -19,7 +19,7 @@
</view>
</view>
<view class="status-look df">
<view class="status-look df" wx:if="{{!isSubscribe}}">
<official-account style="width:100%;height:168rpx;"></official-account>
</view>
......
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