修改不强制登录
This commit is contained in:
parent
1cf4dbf08e
commit
9404a03234
@ -31,6 +31,7 @@ const sendRequest = (options)=>{
|
||||
rj(result.data);
|
||||
}
|
||||
}else if(result.statusCode==401){
|
||||
rj(result.data);
|
||||
const pages = getCurrentPages();
|
||||
const currentPages = pages[pages.length-1];
|
||||
|
||||
|
||||
12
app.js
12
app.js
@ -18,12 +18,14 @@ App({
|
||||
if(!(this.globalData.appConfig&&this.globalData.appConfig.share_card_title)){
|
||||
await this.getAppConfig();
|
||||
}
|
||||
if(!(this.globalData.userInfo&&this.globalData.userInfo.user_code)){
|
||||
await this.getUserInfo();
|
||||
}
|
||||
let path = '/pages/help/index/index';
|
||||
if(this.globalData.userInfo.user_code){
|
||||
path = `${path}?shared_user_code=${this.globalData.userInfo.user_code}`;
|
||||
if(this.globalData.accessToken){
|
||||
if(!(this.globalData.userInfo&&this.globalData.userInfo.user_code)){
|
||||
await this.getUserInfo();
|
||||
}
|
||||
if(this.globalData.userInfo.user_code){
|
||||
path = `${path}?shared_user_code=${this.globalData.userInfo.user_code}`;
|
||||
}
|
||||
}
|
||||
return {
|
||||
title:this.globalData.appConfig.share_card_title,
|
||||
|
||||
@ -44,9 +44,6 @@ Page({
|
||||
this.setData({
|
||||
navBarHeight:height
|
||||
})
|
||||
this.setData({
|
||||
isLogin:!!app.globalData.accessToken
|
||||
})
|
||||
// this.getAddress();
|
||||
app.getAppConfig().then((data)=>{
|
||||
this.setData({
|
||||
@ -97,8 +94,16 @@ Page({
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
this.setData({
|
||||
isLogin:!!app.globalData.accessToken
|
||||
})
|
||||
//手动更改了社区,就不要再次更新默认地址
|
||||
if(!this.data.manuallyChangedCommunity){
|
||||
|
||||
if(!app.globalData.accessToken){
|
||||
return;
|
||||
}
|
||||
app.forceGetUserInfo().then((data)=>{
|
||||
if(data.default_address){
|
||||
this.setData({
|
||||
|
||||
@ -64,13 +64,13 @@
|
||||
</view>
|
||||
</view>
|
||||
<button type="primary" class="order-button" bind:tap="preOrder" loading="{{preOrdering}}">立即下单</button>
|
||||
<!-- <view class="login-panel" wx:if="{{!isLogin}}">
|
||||
<view class="login-panel" wx:if="{{!isLogin}}">
|
||||
<image class="icon" src="/assets/icon/help/redpacket@2x.png"/>
|
||||
<view class="text">登录后享跑腿服务</view>
|
||||
<view class="text">登录后, 立享快递代取服务</view>
|
||||
<navigator url="/pages/login/login">
|
||||
<button class="button" size="mini">一键登录</button>
|
||||
<button class="button" size="mini">立即登录</button>
|
||||
</navigator>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="action-bar">
|
||||
<view bind:tap="navToHowToUse" class="item left">
|
||||
<image src="/assets/icon/help/newbie.png" class="icon"/>
|
||||
|
||||
@ -171,7 +171,7 @@
|
||||
align-items: center;
|
||||
padding:20rpx;
|
||||
position: fixed;
|
||||
bottom:0;
|
||||
bottom:20rpx;
|
||||
left:20rpx;
|
||||
right:20rpx;
|
||||
}
|
||||
|
||||
@ -85,6 +85,11 @@ Page({
|
||||
url: `/pages/browser/index?url=${encodeURIComponent(this.data.appConfig.url_user_agreement)}`,
|
||||
})
|
||||
},
|
||||
goBack(){
|
||||
wx.reLaunch({
|
||||
url: '/pages/help/index/index',
|
||||
})
|
||||
},
|
||||
shake(){
|
||||
if(!this.animation){
|
||||
this.animation = wx.createAnimation({
|
||||
|
||||
@ -20,5 +20,6 @@
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
<view class="btn-no-login" bind:tap="goBack">暂不登录</view>
|
||||
<view class="user-code">{{userCode}}</view>
|
||||
</view>
|
||||
@ -45,4 +45,13 @@
|
||||
text-align: center;
|
||||
color:#999999;
|
||||
opacity: .1;
|
||||
}
|
||||
|
||||
.btn-no-login{
|
||||
position: absolute;
|
||||
bottom:60rpx;
|
||||
left:0;
|
||||
width:100%;
|
||||
text-align: center;
|
||||
color: #999999;
|
||||
}
|
||||
@ -14,11 +14,11 @@
|
||||
|
||||
<view class="page-container property">
|
||||
<view class="item" bind:tap="goToCouponList">
|
||||
<view class="value">{{userInfo.coupon_count}}</view>
|
||||
<view class="value">{{userInfo.coupon_count||0}}</view>
|
||||
<view class="key">优惠券(张)</view>
|
||||
</view>
|
||||
<view class="item" bind:tap="goToMoney">
|
||||
<view class="value">{{userInfo.points}}</view>
|
||||
<view class="value">{{userInfo.points||0}}</view>
|
||||
<view class="key">蜂蜜(克)</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -141,9 +141,19 @@ Page({
|
||||
},
|
||||
pager:this.data.pager
|
||||
})
|
||||
}).catch((res)=>{
|
||||
console.log('res',res);
|
||||
this.setData({
|
||||
"pager.tab1.loading":false,
|
||||
"pager.tab1.loadAll":true,
|
||||
refreshTriggered:{
|
||||
tab1:false
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
loadMerchantPayOrderList(){
|
||||
return;
|
||||
//消费买单列表
|
||||
if(this.data.pager.tab2.loading||this.data.pager.tab2.loadAll){
|
||||
return;
|
||||
@ -210,6 +220,14 @@ Page({
|
||||
},
|
||||
pager:this.data.pager
|
||||
})
|
||||
}).catch((res)=>{
|
||||
this.setData({
|
||||
"pager.tab3.loading":false,
|
||||
"pager.tab3.loadAll":true,
|
||||
refreshTriggered:{
|
||||
tab3:false
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
pay(event){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user