Commit bfbb8bb3 by 高淑倩

当前用户是否关注公众号

parent dae56f42
...@@ -13,6 +13,7 @@ wxService.page({ ...@@ -13,6 +13,7 @@ wxService.page({
data: { data: {
amount: 0, amount: 0,
status: 'S', status: 'S',
isSubscribe: false
}, },
/** /**
...@@ -37,14 +38,15 @@ wxService.page({ ...@@ -37,14 +38,15 @@ wxService.page({
this.setData({ this.setData({
amount, amount,
status status
},()=> {
// 当前用户是否关注公众号
this.getMemberSubscribe()
}) })
// 动态设置title // 动态设置title
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: status == 'S' ? '支付成功' : '支付失败' title: status == 'S' ? '支付成功' : '支付失败'
}) })
}, },
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 => {
...@@ -54,6 +56,19 @@ wxService.page({ ...@@ -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() { goPayAgain() {
console.log('goPayAgain') console.log('goPayAgain')
}, },
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</view> </view>
</view> </view>
<view class="status-look df"> <view class="status-look df" wx:if="{{!isSubscribe}}">
<official-account style="width:100%;height:168rpx;"></official-account> <official-account style="width:100%;height:168rpx;"></official-account>
</view> </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