Commit 73c4b1de by 高淑倩

add: 新激活会员卡弹框

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