优化跳转登录

master
Lee 2022-12-07 15:39:02 +08:00
parent dec0aaa6a8
commit 81129e442a
25 changed files with 41 additions and 32 deletions

View File

@ -385,11 +385,11 @@ const tools = {
judgeAuth(){ judgeAuth(){
let auth = false; let auth = false;
clearTimeout(this.authTimer); clearTimeout(this.authTimer);
if(!uni.getStorageSync('token')) { if(!uni.getStorageSync('token') && uni.getStorageSync('is_active')!==1) {
this.showToast('请授权登录'); // this.showToast('请授权登录');
this.authTimer = setTimeout(()=>{ this.authTimer = setTimeout(()=>{
uni.reLaunch({url:'/pages/login/login'}); uni.reLaunch({url:'/pages/login/login'});
},2000) },200)
} else { } else {
auth = true; auth = true;
} }

View File

@ -77,7 +77,6 @@
}, },
"usingComponents" : true, "usingComponents" : true,
"permission" : {} "permission" : {}
// "requiredPrivateInfos" : [ "getLocation" ]
}, },
"mp-baidu" : { "mp-baidu" : {
"appid" : "24346353" "appid" : "24346353"

View File

@ -26,7 +26,7 @@
<view class="title color-8c">联系方式</view> <view class="title color-8c">联系方式</view>
<view class="msg" v-if="showPhone" @tap="this.$toolAll.tools.countCustomer(goodsDetail.phone)">{{goodsDetail.phone}}</view> <view class="msg" v-if="showPhone" @tap="this.$toolAll.tools.countCustomer(goodsDetail.phone)">{{goodsDetail.phone}}</view>
<view class="msg" v-else> <view class="msg" v-else>
<view class="see-phone color-ff font24 background-blue radius20 flex" @tap="showPhone=true"></view> <view class="see-phone color-ff font24 background-blue radius20 flex" @tap="getPhone"></view>
</view> </view>
</view> </view>
</view> </view>
@ -126,6 +126,13 @@
}) })
}, },
//
getPhone(){
if(this.$toolAll.tools.judgeAuth()) {
this.showPhone = true;
}
},
// //
changeStateEv(id){ changeStateEv(id){
if(this.flag){ if(this.flag){

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

View File

@ -11121,11 +11121,11 @@ Object.defineProperty(exports, "__esModule", { value: true });exports.default =
judgeAuth: function judgeAuth() { judgeAuth: function judgeAuth() {
var auth = false; var auth = false;
clearTimeout(this.authTimer); clearTimeout(this.authTimer);
if (!uni.getStorageSync('token')) { if (!uni.getStorageSync('token') && uni.getStorageSync('is_active') !== 1) {
this.showToast('请授权登录'); // this.showToast('请授权登录');
this.authTimer = setTimeout(function () { this.authTimer = setTimeout(function () {
uni.reLaunch({ url: '/pages/login/login' }); uni.reLaunch({ url: '/pages/login/login' });
}, 2000); }, 200);
} else { } else {
auth = true; auth = true;
} }

View File

@ -128,10 +128,6 @@ var render = function() {
_vm.e0 = function($event) { _vm.e0 = function($event) {
return this.$toolAll.tools.countCustomer(_vm.goodsDetail.phone) return this.$toolAll.tools.countCustomer(_vm.goodsDetail.phone)
} }
_vm.e1 = function($event) {
_vm.showPhone = true
}
} }
_vm.$mp.data = Object.assign( _vm.$mp.data = Object.assign(
@ -303,6 +299,13 @@ var _default =
}, },
// 查看联系方式
getPhone: function getPhone() {
if (this.$toolAll.tools.judgeAuth()) {
this.showPhone = true;
}
},
// 更改显示状态 // 更改显示状态
changeStateEv: function changeStateEv(id) {var _this2 = this; changeStateEv: function changeStateEv(id) {var _this2 = this;
if (this.flag) { if (this.flag) {

View File

@ -1 +1 @@
<block wx:if="{{isLoading}}"><view class="{{['data-v-2d579644',type==''?'':'pad-x120']}}"><status-nav vue-id="4132e7e8-1" ifReturn="{{true}}" navBarTitle="商品详情" class="data-v-2d579644" bind:__l="__l"></status-nav><view class="notice-tips color-orange font26 border-box pad-all20 flex data-v-2d579644"><image src="/static/icon-notice.png" mode="widthFix" class="data-v-2d579644"></image>交易前请务必核实对方的身份及信息!</view><view class="goods-detail data-v-2d579644"><view class="goods-info background-white pad-zy20 border-box data-v-2d579644"><view class="item font28 flex data-v-2d579644"><view class="title color-8c data-v-2d579644">商品名称</view><view class="msg data-v-2d579644">{{goodsDetail.name}}</view></view><view class="item font28 flex data-v-2d579644"><view class="title color-8c data-v-2d579644">商品分类</view><view class="msg data-v-2d579644">{{goodsDetail.category_name}}</view></view><view class="item font28 flex data-v-2d579644"><view class="title color-8c data-v-2d579644">商品售价</view><view class="msg data-v-2d579644"><block wx:if="{{$root.m0>0}}"><text class="color-8c font24 data-v-2d579644" style="text-decoration:line-through;margin-right:6rpx;">{{"¥"+goodsDetail.original_price}}</text></block><text class="color-red data-v-2d579644">{{"¥"+goodsDetail.price}}</text></view></view><view class="item font28 flex data-v-2d579644"><view class="title color-8c data-v-2d579644">联系方式</view><block wx:if="{{showPhone}}"><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" class="msg data-v-2d579644" bindtap="__e">{{goodsDetail.phone}}</view></block><block wx:else><view class="msg data-v-2d579644"><view data-event-opts="{{[['tap',[['e1',['$event']]]]]}}" class="see-phone color-ff font24 background-blue radius20 flex data-v-2d579644" bindtap="__e">查看联系方式</view></view></block></view></view><view class="goods-content background-white pad-all20 mar-s20 font28 border-box data-v-2d579644"><view class="goods-describe color-8c data-v-2d579644">{{goodsDetail.msg}}</view><view class="goods-img data-v-2d579644"><block wx:for="{{goodsImg}}" wx:for-item="item" wx:for-index="index" wx:key="index"><image src="{{item}}" mode="widthFix" class="data-v-2d579644"></image></block></view></view></view><block wx:if="{{type=='release'}}"><view class="detail-btns background-white border-box flex data-v-2d579644"><view data-event-opts="{{[['tap',[['changeStateEv',['$0'],['goodsDetail.id']]]]]}}" class="{{['btn','font30','color-ff','radius35','flex','data-v-2d579644',goodsDetail.status==0?'background-orange':'background-8c']}}" bindtap="__e">{{''+(goodsDetail.status==0?'已上架':'已下架')+''}}</view><view data-event-opts="{{[['tap',[['editEv',['$0'],['goodsDetail.id']]]]]}}" class="btn background-blue font30 color-ff radius35 flex data-v-2d579644" bindtap="__e">编辑</view></view></block></view></block> <block wx:if="{{isLoading}}"><view class="{{['data-v-2d579644',type==''?'':'pad-x120']}}"><status-nav vue-id="4132e7e8-1" ifReturn="{{true}}" navBarTitle="商品详情" class="data-v-2d579644" bind:__l="__l"></status-nav><view class="notice-tips color-orange font26 border-box pad-all20 flex data-v-2d579644"><image src="/static/icon-notice.png" mode="widthFix" class="data-v-2d579644"></image>交易前请务必核实对方的身份及信息!</view><view class="goods-detail data-v-2d579644"><view class="goods-info background-white pad-zy20 border-box data-v-2d579644"><view class="item font28 flex data-v-2d579644"><view class="title color-8c data-v-2d579644">商品名称</view><view class="msg data-v-2d579644">{{goodsDetail.name}}</view></view><view class="item font28 flex data-v-2d579644"><view class="title color-8c data-v-2d579644">商品分类</view><view class="msg data-v-2d579644">{{goodsDetail.category_name}}</view></view><view class="item font28 flex data-v-2d579644"><view class="title color-8c data-v-2d579644">商品售价</view><view class="msg data-v-2d579644"><block wx:if="{{$root.m0>0}}"><text class="color-8c font24 data-v-2d579644" style="text-decoration:line-through;margin-right:6rpx;">{{"¥"+goodsDetail.original_price}}</text></block><text class="color-red data-v-2d579644">{{"¥"+goodsDetail.price}}</text></view></view><view class="item font28 flex data-v-2d579644"><view class="title color-8c data-v-2d579644">联系方式</view><block wx:if="{{showPhone}}"><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" class="msg data-v-2d579644" bindtap="__e">{{goodsDetail.phone}}</view></block><block wx:else><view class="msg data-v-2d579644"><view data-event-opts="{{[['tap',[['getPhone',['$event']]]]]}}" class="see-phone color-ff font24 background-blue radius20 flex data-v-2d579644" bindtap="__e">查看联系方式</view></view></block></view></view><view class="goods-content background-white pad-all20 mar-s20 font28 border-box data-v-2d579644"><view class="goods-describe color-8c data-v-2d579644">{{goodsDetail.msg}}</view><view class="goods-img data-v-2d579644"><block wx:for="{{goodsImg}}" wx:for-item="item" wx:for-index="index" wx:key="index"><image src="{{item}}" mode="widthFix" class="data-v-2d579644"></image></block></view></view></view><block wx:if="{{type=='release'}}"><view class="detail-btns background-white border-box flex data-v-2d579644"><view data-event-opts="{{[['tap',[['changeStateEv',['$0'],['goodsDetail.id']]]]]}}" class="{{['btn','font30','color-ff','radius35','flex','data-v-2d579644',goodsDetail.status==0?'background-orange':'background-8c']}}" bindtap="__e">{{''+(goodsDetail.status==0?'已上架':'已下架')+''}}</view><view data-event-opts="{{[['tap',[['editEv',['$0'],['goodsDetail.id']]]]]}}" class="btn background-blue font30 color-ff radius35 flex data-v-2d579644" bindtap="__e">编辑</view></view></block></view></block>