Commit f5abf9f7 by 赵雅纹

Merge branch 'feature-zyw' into 'dev'

Feature zyw

See merge request !20
parents e43eb651 56cf9ad9
......@@ -113,7 +113,7 @@ App({
loginFirst: false,
imageUrl:"", //图片地址
isFullSucreen: false, // 当前设备是否为 FullSucreen
// brandId: 2005,
brandId: 1001,
brandId: 2005,
// brandId: 1001,
}
})
......@@ -43,19 +43,13 @@ Component({
//立即兑换
query() {},
_getUserInfo(res = {}) {
if(!this.data.checkAll) {
wx.showToast({
title: '请同意会员规则',
icon: 'none'
})
return false
}
this.setData({
isAuthorization: false
})
const userInfo = res.detail || {}
if (res.detail.userInfo) {
utils.getUserInfoByBtn(userInfo).then( (data = {} ) => {
console.log('----',data)
const {token} = data
wx.setStorageSync('_accreditUserInfo', userInfo)
wx.hideNavigationBarLoading()
......
......@@ -7,7 +7,7 @@
<view class='auth-shop'>
广东7-Eleven申请获取授权,用于会员服务
</view>
<button type='primary' bindgetuserinfo="_getUserInfo" open-type='getUserInfo' class='agree' >同意</button>
<button type='primary' bindgetuserinfo="_getUserInfo" open-type='getUserInfo' class='agree' disabled='{{!checkAll}}'>同意</button>
<view class='rule-wrap'>
<view class='agree-rule'>
<view class="agree-icon"><icon size="18" type="{{checkAll ? 'success' : 'circle'}}" bindtap="checkAll"></icon></view>
......
......@@ -3,8 +3,8 @@
<button type="primary" plain='false' bindtap="handleTtoActiveMemebr">激活立享会员特权</button>
</view>-->
<view wx:if='{{!memberActivateStatus}}' class="member-unActive">
<text class="un-active-btn" bindtap="handleTtoActiveMemebr">激活立享会员特权</text>
<view wx:if='{{!memberActivateStatus}}' class="member-unActive" bindtap="handleTtoActiveMemebr">
<text class="un-active-btn" >激活立享会员特权</text>
</view>
<view wx:if='{{memberActivateStatus}}' class="activation-content activation-bg {{true ? 'user-content' : ''}}" style="{{personData.backgroundImageUrl ? 'background-image: url('+ personData.backgroundImageUrl +');' : 'background-image: url(' + baseUrl + ');'}}">
......
......@@ -37,31 +37,37 @@ Component({
},
preview(e) {
const {appid, path} = e.currentTarget.dataset
const {memberActivateStatus} = wx.getStorageSync('_baseUserInfo')
// 获取当前帐号信息
const accountInfo = utils.getAccountInfo()
const userInfo = wx.getStorageSync('_baseUserInfo')
if (userInfo){
// 是当前小程序 直接跳转
if(accountInfo.miniProgram.appId == appid){
wxService.router(`${path}`)
} else {
// 跳转其他小程序
wx.navigateToMiniProgram({
appId: appid,
path: `${path}`,
success: e => {
console.log(e)
},
fail: e => {
console.log(e)
},
complete: e => {
console.log(e)
},
})
if(accountInfo.miniProgram.appId == appid){
if (!memberActivateStatus){
wxService.openCard()
}else{
wxService.router(`${path}`)
}
} else {
// 跳转其他小程序
wx.navigateToMiniProgram({
appId: appid,
path: `${path}`,
success: e => {
console.log(e)
},
fail: e => {
console.log(e)
},
complete: e => {
console.log(e)
},
})
}
// 是当前小程序 直接跳转
}else{
console.log('222')
this.setData({
isAuthorization: true
})
......
const PROJECT_ENV = 'dev' // 生产 prod, 测试 dev, 预生产 pre
const PROJECT_ENV = 'pre' // 生产 prod, 测试 dev, 预生产 pre
const needMock = '' //
// appid_dev_wx wxc3b64b09b1d3dfc2
......
......@@ -13,7 +13,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.6.6",
"appid": "wxc3b64b09b1d3dfc2",
"appid": "wx358b56af62edbde1",
"projectname": "7-Eleven",
"debugOptions": {
"hidedInDevtools": []
......
......@@ -148,7 +148,7 @@ class Http {
content: '请求数据超时'
})
}
if(error.msg){
if (error.msg && error.msg !='该用户尚未登录'){
wx.showToast({
title: `${error.msg}`,
icon: 'none'
......
......@@ -47,38 +47,25 @@ class WXService extends Http {
this.setPageLoadStatus()
wx.hideLoading()
}).catch(res => {
console.log('res', res)
if (res.state === 401) {
// this.openCard()
console.log(res)
if (res.msg === '该用户尚未登录') {
wx.setStorageSync('token', '')
var _this = this
wx.showModal({
title: '温馨提示',
content: '登录已过期,请重新登录',
success(res) {
if (res.confirm) {
let userInfo = wx.getStorageSync('_baseUserInfo')
_this.login().then(result=>{
if(result.code){
_this.post(`/member/minaLogin`, {
code: result.code,
wechatInfo: userInfo,
brandId: 2005,
}).then(data=>{
const { token } = data
if (token) {
wx.setStorageSync('token', token)
} else {
wx.setStorageSync('token', '')
}
wx.setStorageSync('_baseUserInfo', data)
})
}
})
} else if (res.cancel) {
}
let userInfo = wx.getStorageSync('_baseUserInfo')
_this.login().then(result=>{
if(result.code){
_this.post(`/member/minaLogin`, {
code: result.code,
wechatInfo: userInfo,
brandId: 2005,
}).then(response=>{
let dataResp = response.data.data
wx.setStorageSync('token', dataResp.token)
wx.setStorageSync('_baseUserInfo', dataResp)
})
}
})
} else if (res.state === 402) {
return this.getUserInfo().then(() => {
if (!this.getUserInfoLimitCount) {
......@@ -508,6 +495,7 @@ class WXService extends Http {
if(memberActivateStatus) {
resolve(baseUserInfo)
} else {
console.log('开卡', baseUserInfo)
return this.navigateToMiniProgram({
biz: baseUserInfo.biz,
encrypt_card_id: baseUserInfo.encryptCardId,
......
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