授权、登录优化
parent
685c994596
commit
445902516d
|
@ -160,7 +160,11 @@
|
||||||
if(uni.getStorageSync('authorization')==1){
|
if(uni.getStorageSync('authorization')==1){
|
||||||
this.showAuth = true;
|
this.showAuth = true;
|
||||||
}else{
|
}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=>{})
|
// this.$requst.post('user/first-enter',{openid:res.data.data.openid,path:uni.getStorageSync('urlparams')}).then(res=>{})
|
||||||
}else {
|
}else {
|
||||||
|
|
|
@ -127,7 +127,11 @@
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -27,9 +27,13 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="login-box">
|
<view class="login-box">
|
||||||
<view @tap="setMiniColor">
|
<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>
|
||||||
<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon">《用户服务协议》</text></view>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- <view v-if="isShowP" class="disjcac posAll">
|
<!-- <view v-if="isShowP" class="disjcac posAll">
|
||||||
<view class="bacf radius20 width100 tank-box">
|
<view class="bacf radius20 width100 tank-box">
|
||||||
|
@ -91,6 +95,7 @@
|
||||||
appletName:'恒美植发',//小程序名称
|
appletName:'恒美植发',//小程序名称
|
||||||
appletImg:'',//小程序logo
|
appletImg:'',//小程序logo
|
||||||
isShowP:false,
|
isShowP:false,
|
||||||
|
ifAgree:false,// 是否同意授权
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -120,6 +125,11 @@
|
||||||
if (uni.getUserProfile) {
|
if (uni.getUserProfile) {
|
||||||
this.canIGetUserProfile = true;
|
this.canIGetUserProfile = true;
|
||||||
}
|
}
|
||||||
|
if(uni.getStorageSync('authorization')==1){
|
||||||
|
this.ifAgree = true;
|
||||||
|
}else{
|
||||||
|
this.ifAgree = false;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 设置logo图
|
// 设置logo图
|
||||||
|
@ -141,6 +151,10 @@
|
||||||
uni.setStorageSync('publicColor', res.data.mainColor) //#3875F6 #2E8B57
|
uni.setStorageSync('publicColor', res.data.mainColor) //#3875F6 #2E8B57
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 未同意用户协议
|
||||||
|
noAgree(){
|
||||||
|
this.$toolAll.tools.showToast('请先同意《用户服务协议》');
|
||||||
|
},
|
||||||
getphonenumber(e){//授权绑定手机号
|
getphonenumber(e){//授权绑定手机号
|
||||||
let ya = this;
|
let ya = this;
|
||||||
wx.login({
|
wx.login({
|
||||||
|
@ -294,4 +308,21 @@
|
||||||
.xie-box{display: flex;justify-content: center;align-items: center;color: @tcolor;margin-top: 30rpx;}
|
.xie-box{display: flex;justify-content: center;align-items: center;color: @tcolor;margin-top: 30rpx;}
|
||||||
.xieCon{color: @tcolorp;}
|
.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>
|
</style>
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
<view class="disjbac">
|
<view class="disjbac">
|
||||||
<view class="disac colf">
|
<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="mar-z30">
|
||||||
<!-- 昵称 -->
|
<!-- 昵称 -->
|
||||||
<view class="disac">
|
<view class="disac">
|
||||||
<view class="fon36 bold clips1" style="max-width: 260rpx;">{{userInfo.nickname || ''}}</view>
|
<view class="fon36 bold clips1" style="max-width: 260rpx;">{{userInfo.nickname || '游客用户'}}</view>
|
||||||
<view class="gao-name">{{userInfo.level.name}}</view>
|
<view class="gao-name" v-if="userInfo.level.name">{{userInfo.level.name}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disac mar-s10" v-if="userPhone!==''">
|
<view class="disac mar-s10" v-if="userPhone!==''">
|
||||||
<image src="/static/public/phone-02.png" class="gao-phone" mode=""></image>
|
<image src="/static/public/phone-02.png" class="gao-phone" mode=""></image>
|
||||||
|
@ -224,6 +224,7 @@
|
||||||
customerInfo:'',
|
customerInfo:'',
|
||||||
times:0,
|
times:0,
|
||||||
openSettingBtnHidden: true,//是否授权
|
openSettingBtnHidden: true,//是否授权
|
||||||
|
appletImg:uni.getStorageSync('appletImg'),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onUnload: function() {
|
onUnload: function() {
|
||||||
|
|
|
@ -148,7 +148,7 @@
|
||||||
<!-- 底部tab -->
|
<!-- 底部tab -->
|
||||||
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='3'></foot-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="cart-box">
|
||||||
<view class="posir">
|
<view class="posir">
|
||||||
<image src="/static/public/cart.png" mode="aspectFill"></image>
|
<image src="/static/public/cart.png" mode="aspectFill"></image>
|
||||||
|
@ -204,7 +204,6 @@
|
||||||
positionMode:'sticky',
|
positionMode:'sticky',
|
||||||
gaodu:0,
|
gaodu:0,
|
||||||
shareData:[],
|
shareData:[],
|
||||||
phone_active:uni.getStorageSync('phone_active'),
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -256,7 +255,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
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.cartNumEv();//查询购物车数量
|
||||||
}
|
}
|
||||||
this.isAutoPlay = true;
|
this.isAutoPlay = true;
|
||||||
|
|
|
@ -85,7 +85,11 @@
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
options.isScore=='score' ? this.isScore = 'score' : ''
|
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();
|
this.checkList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -447,25 +447,19 @@
|
||||||
},
|
},
|
||||||
// 调起弹框
|
// 调起弹框
|
||||||
tuneUp(index){
|
tuneUp(index){
|
||||||
if(uni.getStorageSync('phone_active')!==0){
|
if(this.isNei!=1) {
|
||||||
if(this.isNei!=1) {
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if(index==1) {
|
||||||
|
this.ifAlone = false;
|
||||||
} else {
|
} else {
|
||||||
if(index==1) {
|
this.ifAlone = true;
|
||||||
this.ifAlone = false;
|
|
||||||
} else {
|
|
||||||
this.ifAlone = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(this.detailObj.is_close==0){
|
}
|
||||||
this.showTK = true;
|
if(this.detailObj.is_close==0){
|
||||||
} else {
|
this.showTK = true;
|
||||||
this.$toolAll.tools.showToast('该商品活动已结束')
|
} else {
|
||||||
}
|
this.$toolAll.tools.showToast('该商品活动已结束')
|
||||||
}else{
|
|
||||||
uni.navigateTo({
|
|
||||||
url:'/pages/login/login'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 数量输入事件
|
// 数量输入事件
|
||||||
|
@ -872,16 +866,9 @@
|
||||||
goShopCart(){//去购物车事件
|
goShopCart(){//去购物车事件
|
||||||
let isScore = '';
|
let isScore = '';
|
||||||
if(this.isNei==3) isScore = 'score';
|
if(this.isNei==3) isScore = 'score';
|
||||||
if(uni.getStorageSync('phone_active')!==0){
|
uni.navigateTo({
|
||||||
uni.navigateTo({
|
url:`/pagesA/shopCart/shopCart?isScore=${isScore}`
|
||||||
url:`/pagesA/shopCart/shopCart?isScore=${isScore}`
|
})
|
||||||
})
|
|
||||||
}else{
|
|
||||||
uni.navigateTo({
|
|
||||||
url:`/pages/login/login`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
goDoctor(id){
|
goDoctor(id){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
|
@ -106,7 +106,7 @@
|
||||||
<cate-tu :list="reSearchList" @delev='delev'></cate-tu>
|
<cate-tu :list="reSearchList" @delev='delev'></cate-tu>
|
||||||
</view>
|
</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="cart-box">
|
||||||
<view class="posir">
|
<view class="posir">
|
||||||
<image src="/static/public/cart.png" mode="aspectFill"></image>
|
<image src="/static/public/cart.png" mode="aspectFill"></image>
|
||||||
|
@ -177,7 +177,6 @@
|
||||||
zanArr:[],
|
zanArr:[],
|
||||||
timer:'',
|
timer:'',
|
||||||
isShowP:false,
|
isShowP:false,
|
||||||
phone_active:uni.getStorageSync('phone_active'),
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
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
Loading…
Reference in New Issue