授权、登录优化

master
Lee 2023-01-04 15:09:21 +08:00
parent 685c994596
commit 445902516d
29 changed files with 93 additions and 60 deletions

View File

@ -160,7 +160,11 @@
if(uni.getStorageSync('authorization')==1){
this.showAuth = true;
}else{
this.showAuth = false;
if(uni.getStorageSync('paramsUrl').indexOf('/pagesA/getReadyDan/getReadyDan-two')!==-1){
this.showAuth = true;
}else{
this.showAuth = false;
}
}
// this.$requst.post('user/first-enter',{openid:res.data.data.openid,path:uni.getStorageSync('urlparams')}).then(res=>{})
}else {

View File

@ -127,7 +127,11 @@
}
break;
case 4:
existMobile!==0&&existActive!==0 ? uni.reLaunch({url:'/pages/tabbar/my/staffDuan'}) : this.goLogin();
if(uni.getStorageSync('authorization')==1){
existMobile!==0&&existActive!==0 ? uni.reLaunch({url:'/pages/tabbar/my/staffDuan'}) : this.goLogin();
}else{
uni.reLaunch({url:'/pages/tabbar/my/staffDuan'})
}
break;
}
},

View File

@ -27,9 +27,13 @@
</view>
<view class="login-box">
<view @tap="setMiniColor">
<button class='login-btn' open-type="getPhoneNumber" @getphonenumber="getphonenumber" :style="{background:publicColor}" type='primary'>手机号授权登录</button>
<button class='login-btn' v-if="!ifAgree" @tap="noAgree" style="background-color: #3875F6; color: #ffffff;"></button>
<button class='login-btn' v-else open-type="getPhoneNumber" @getphonenumber="getphonenumber" :style="{background:publicColor}" type='primary'>手机号授权登录</button>
</view>
<view class="xie-box">
<view class="radio-btn" :class="ifAgree?'checked':''" @tap="ifAgree=!ifAgree"></view>
<text>是否阅读并同意<text @tap="goXie" class="xieCon">用户服务协议</text></text>
</view>
<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon">用户服务协议</text></view>
</view>
<!-- <view v-if="isShowP" class="disjcac posAll">
<view class="bacf radius20 width100 tank-box">
@ -91,6 +95,7 @@
appletName:'恒美植发',//
appletImg:'',//logo
isShowP:false,
ifAgree:false,//
};
},
computed: {
@ -120,6 +125,11 @@
if (uni.getUserProfile) {
this.canIGetUserProfile = true;
}
if(uni.getStorageSync('authorization')==1){
this.ifAgree = true;
}else{
this.ifAgree = false;
}
},
methods: {
// logo
@ -141,6 +151,10 @@
uni.setStorageSync('publicColor', res.data.mainColor) //#3875F6 #2E8B57
})
},
//
noAgree(){
this.$toolAll.tools.showToast('请先同意《用户服务协议》');
},
getphonenumber(e){//
let ya = this;
wx.login({
@ -294,4 +308,21 @@
.xie-box{display: flex;justify-content: center;align-items: center;color: @tcolor;margin-top: 30rpx;}
.xieCon{color: @tcolorp;}
.radio-btn{
box-sizing: border-box;
width: 40rpx;
height: 40rpx;
border: 2rpx solid #afafaf;
border-radius: 100%;
margin: 4rpx 10rpx 0 0;
overflow: hidden;
}
.radio-btn.checked{
border: 2rpx solid #3875F6;
background-color: #3875F6;
background-image: url('/static/public/icon-checked.png');
background-position: center;
background-repeat: no-repeat;
background-size: 32rpx 32rpx;
}
</style>

View File

@ -9,12 +9,12 @@
<view class="disjbac">
<view class="disac colf">
<!-- 头像 -->
<image @tap="openXiao" class="mar-sx30" :src="userInfo.headimgurl || ''" mode="aspectFill"></image>
<image @tap="openXiao" class="mar-sx30" :src="userInfo.headimgurl || appletImg" mode="aspectFill"></image>
<view class="mar-z30">
<!-- 昵称 -->
<view class="disac">
<view class="fon36 bold clips1" style="max-width: 260rpx;">{{userInfo.nickname || ''}}</view>
<view class="gao-name">{{userInfo.level.name}}</view>
<view class="fon36 bold clips1" style="max-width: 260rpx;">{{userInfo.nickname || '游客用户'}}</view>
<view class="gao-name" v-if="userInfo.level.name">{{userInfo.level.name}}</view>
</view>
<view class="disac mar-s10" v-if="userPhone!==''">
<image src="/static/public/phone-02.png" class="gao-phone" mode=""></image>
@ -224,6 +224,7 @@
customerInfo:'',
times:0,
openSettingBtnHidden: true,//
appletImg:uni.getStorageSync('appletImg'),
}
},
onUnload: function() {

View File

@ -148,7 +148,7 @@
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='3'></foot-tab>
<!-- 购物车 -->
<navigator :url="phone_active!==0?'/pagesA/shopCart/shopCart?isScore=false':'/pages/login/login'" hover-class="none">
<navigator :url="'/pagesA/shopCart/shopCart?isScore=false'" hover-class="none">
<view class="cart-box">
<view class="posir">
<image src="/static/public/cart.png" mode="aspectFill"></image>
@ -204,7 +204,6 @@
positionMode:'sticky',
gaodu:0,
shareData:[],
phone_active:uni.getStorageSync('phone_active'),
}
},
computed: {
@ -256,7 +255,11 @@
}
},
onShow() {
if(uni.getStorageSync('phone')!=0 && uni.getStorageSync('is_active')!=0) {
if(uni.getStorageSync('authorization')==1){
if(uni.getStorageSync('phone')!=0 && uni.getStorageSync('is_active')!=0) {
this.cartNumEv();//
}
}else{
this.cartNumEv();//
}
this.isAutoPlay = true;

View File

@ -85,7 +85,11 @@
},
onLoad(options) {
options.isScore=='score' ? this.isScore = 'score' : ''
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
if(uni.getStorageSync('authorization')==1){
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkList();
}
}else{
this.checkList();
}
},

View File

@ -447,25 +447,19 @@
},
//
tuneUp(index){
if(uni.getStorageSync('phone_active')!==0){
if(this.isNei!=1) {
if(this.isNei!=1) {
} else {
if(index==1) {
this.ifAlone = false;
} else {
if(index==1) {
this.ifAlone = false;
} else {
this.ifAlone = true;
}
this.ifAlone = true;
}
if(this.detailObj.is_close==0){
this.showTK = true;
} else {
this.$toolAll.tools.showToast('该商品活动已结束')
}
}else{
uni.navigateTo({
url:'/pages/login/login'
})
}
if(this.detailObj.is_close==0){
this.showTK = true;
} else {
this.$toolAll.tools.showToast('该商品活动已结束')
}
},
//
@ -872,16 +866,9 @@
goShopCart(){//
let isScore = '';
if(this.isNei==3) isScore = 'score';
if(uni.getStorageSync('phone_active')!==0){
uni.navigateTo({
url:`/pagesA/shopCart/shopCart?isScore=${isScore}`
})
}else{
uni.navigateTo({
url:`/pages/login/login`
})
}
uni.navigateTo({
url:`/pagesA/shopCart/shopCart?isScore=${isScore}`
})
},
goDoctor(id){
uni.navigateTo({

View File

@ -106,7 +106,7 @@
<cate-tu :list="reSearchList" @delev='delev'></cate-tu>
</view>
<!-- 购物车 -->
<navigator :url="phone_active!==0?'/pagesA/shopCart/shopCart?isScore=false':'/pages/login/login'" hover-class="none">
<navigator :url="'/pagesA/shopCart/shopCart?isScore=false'" hover-class="none">
<view class="cart-box">
<view class="posir">
<image src="/static/public/cart.png" mode="aspectFill"></image>
@ -177,7 +177,6 @@
zanArr:[],
timer:'',
isShowP:false,
phone_active:uni.getStorageSync('phone_active'),
}
},
computed: {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1008 B

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long