Commit 73c4b1de by 高淑倩

add: 新激活会员卡弹框

parent 09dad438
......@@ -8,7 +8,15 @@ Component({
* 组件的属性列表
*/
properties: {
isAuthorization: Boolean
isAuthorization: Boolean,
isAuthorizationActiveText: {
type: String,
value: ''
},
isAuthorizationType: {
type: Number,
value: 2
},
},
/**
......@@ -19,9 +27,8 @@ Component({
userInfo: {},
hasUserInfo: false,
env: envInfo.env,
checkAll: true,
checkAll: true
},
/**
* 组件的方法列表
*/
......@@ -32,7 +39,7 @@ Component({
})
},
handelToMemberRules() {
wxService.router('/pages/memberRules/memberRules?type=2')
wxService.router(`/pages/memberRules/memberRules?type=${this.data.isAuthorizationType}`)
},
//再想想
close() {
......@@ -75,6 +82,15 @@ Component({
})
}
},
handleActiveAgree() {
// 子组件触发父组件 去开卡
wxService.nextTick(() => {
this.triggerEvent('activeTocard', true)
})
this.setData({
isAuthorization: false
})
},
setUserInfo () {
// 判断有无开卡
// const memberActivateStatus = wx.getStorageSync('memberActivateStatus')
......
......@@ -4,10 +4,10 @@
<view class='auth-avatar'>
<image class='auth-avatar-img' src='/assets/imgs/auth-avatar.png'></image>
</view>
<view class='auth-shop'>
广东7-Eleven申请获取授权,用于会员服务
</view>
<button type='primary' bindgetuserinfo="_getUserInfo" open-type='getUserInfo' class='agree' disabled='{{!checkAll}}'>同意</button>
<view class='auth-shop' wx:if="{{isAuthorizationActiveText}}">{{isAuthorizationActiveText}}</view>
<view class='auth-shop' wx:else>广东7-Eleven申请获取授权,用于会员服务</view>
<button type='primary' wx:if="{{!isAuthorizationActiveText}}" bindgetuserinfo="_getUserInfo" open-type='getUserInfo' class='agree' disabled='{{!checkAll}}'>同意</button>
<button type='primary' wx:else class='agree' disabled='{{!checkAll}}' bindtap="handleActiveAgree">同意</button>
<view class='rule-wrap'>
<view class='agree-rule'>
<view class="agree-icon"><icon size="18" type="{{checkAll ? 'success' : 'circle'}}" bindtap="checkAll"></icon></view>
......
......@@ -22,7 +22,9 @@ Component({
data: {
imagewidth: 0,//缩放后的宽
imageheight: 0,//缩放后的高
isAuthorization: false
isAuthorization: false,
isAuthorizationActiveText: '',
isAuthorizationType: 2
},
/**
* 组件的方法列表
......@@ -42,7 +44,7 @@ Component({
const accountInfo = utils.getAccountInfo()
const userInfo = wx.getStorageSync('_baseUserInfo')
// 2019.06.14
// 2019.06.14
let currentClickType = app.globalData.commonFunc.getLink(item.link.type, item)
if (link.type == 1) {
// 触发父组件更新页面 外部小程序
......@@ -51,13 +53,21 @@ Component({
})
return false
} else if (!userInfo) {
// userInfo 不存在 授权弹框
this.setData({
isAuthorization: true
})
return false
} else if (userInfo && userInfo.member && !userInfo.member.mobile) {
wxService.openCard()
return false
} else if(userInfo && userInfo.member && !userInfo.member.mobile) {
// userInfo 存在 手机号不存在 跳转激活领卡页面
this.setData({
isAuthorizationActiveText:'新激活领卡',
isAuthorization: true
},()=> {
wxService.openCard()
return false
})
}
if (link.type == 2) {
......@@ -74,12 +84,27 @@ Component({
} else if (link.type == 4) {
wxService.router(`${currentClickType}`)
} else if (link.type == 5) {
if (currentClickType == 1) {
// wxService.openCardList()
wxService.openCard()
} else if (currentClickType == 2) {
if(userInfo && userInfo.member && !userInfo.member.mobile) {
this.setData({
isAuthorizationActiveText:'新激活领卡',
isAuthorizationType: 3,
isAuthorization: true
})
} else {
wxService.openCard()
}
// if (currentClickType == 1) {
// // wxService.openCardList()
// wxService.openCard()
// } else if (currentClickType == 2) {
// wxService.openCard()
// }
}
},
activeTocard(e){
if(e.detail){
wxService.openCard()
}
}
}
......
......@@ -9,4 +9,4 @@
<authorization-modal isAuthorization='{{isAuthorization}}'/>
-->
<view class="pic-nav"><view wx:for="{{picNav}}" wx:key="{{index}}" wx:for-item="item" class="nav-block" style="width: {{imagewidth}}px;height: {{imageheight}}px;"><image class="pic-img" style="width: {{imagewidth}}px;height: {{imageheight}}px;" src="http://testimg3.bigaka.com{{item.imageUrl}}" data-appid="{{item.link.appid}}" data-path="{{item.link.url}}" data-link="{{item.link}}" data-item="{{item}}" bindload="imageLoad" bindtap='preview'/></view></view>
<authorization-modal isAuthorization='{{isAuthorization}}'/>
\ No newline at end of file
<authorization-modal isAuthorization='{{isAuthorization}}' bind:activeTocard="activeTocard" isAuthorizationType="{{isAuthorizationType}}" isAuthorizationActiveText="{{isAuthorizationActiveText}}"/>
\ No newline at end of file
......@@ -47,7 +47,7 @@ class WXService extends Http {
this.setPageLoadStatus()
wx.hideLoading()
}).catch(res => {
if (res.msg.indexOf('未登录') > -1) {
if (res.msg && res.msg.indexOf('未登录') > -1) {
// 重新登陆 更新缓存
this.reLogin()
setTimeout(()=>{
......@@ -525,7 +525,7 @@ class WXService extends Http {
reject({ state: 0 })
}
})
// 注释原因 所有跳转前 判断新老会员
// return new Promise((resolve, reject) => {
// if (baseUserInfo && baseUserInfo.member && baseUserInfo.member.mobile) {
// console.log('已开卡')
......
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