修复一些问题

main
董哲奇 1 week ago
parent c105c22a68
commit b02d8ed18b

@ -25,6 +25,10 @@
const params = new URLSearchParams(query); // URLSearchParams
ticket=params.get('ticket');
}
if (!ticket){
this.closeWindow()
}
// alert(ticket)
if(ticket){
uni.showLoading({
@ -66,7 +70,6 @@
// }
// });
// }
uni.request({
header: {
"Content-Type": "application/json",
@ -78,9 +81,8 @@
},
method: "POST",
success: res => {
console.log(res);
uni.hideLoading()
if(res.data){
console.log(res.data)
var data=res.data;
if(data.data){
var datas=data.data;
@ -93,25 +95,25 @@
uni.switchTab({
url: '/pages/index/index'
});
}
else{
}else{
uni.showModal({
title: '提示',
content: '获取登录token失败,请重新登录后进入!',
content: '登录失败,请重新登录后进入!',
cancelText: '取消',
confirmText: '确定',
success: ress => {
this.closeWindow()
}
});
}
}
else{
}else{
uni.showModal({
title: '提示',
content: '获取登录token失败,请重新登录后进入!',
content: '登录失败,请重新登录后进入!',
cancelText: '取消',
confirmText: '确定',
success: ress => {
this.closeWindow()
}
});
}
@ -120,10 +122,11 @@
console.log("err",err);
uni.showModal({
title: '提示',
content: '获取登录token请求失败,请重新登录后进入!',
content: '登录请求失败,请重新登录后进入!',
cancelText: '取消',
confirmText: '确定',
success: ress => {
this.closeWindow()
}
});
}
@ -204,7 +207,20 @@
}
}
},
closeWindow(){
if (window.plus) { // App
const main = plus.android.runtimeMainActivity(); // Android退
main.finish(); // Android退
// 使iOS...
} else {
console.log('Not in App environment.'); // App
setTimeout(function() {
uni.redirectTo({
url: '/pages/login/index'
});
}, 2000);
}
}
}
}
</script>

@ -174,6 +174,7 @@
},
handleSuccess(result) {
result=result.replace('\r','').replace('\n')
uni.vibrateShort();
uni.showModal({
title: '扫码结果',

@ -141,19 +141,19 @@
this.initMenu();
},
onShow() {
if (!uni.getStorageSync("token")) {
uni.showToast({
title: '登录已失效!请您重新登录!',
duration: 2000,
icon: "none"
});
setTimeout(function() {
uni.redirectTo({
url: '/pages/login/index'
});
}, 2000);
}
// if (!uni.getStorageSync("token")) {
// uni.showToast({
// title: '',
// duration: 2000,
// icon: "none"
// });
// setTimeout(function() {
// uni.redirectTo({
// url: '/pages/login/index'
// });
// }, 2000);
//
// }
//#ifdef APP-PLUS
@ -197,6 +197,22 @@
},
//
gotoMenu(item){
const token= uni.getStorageSync("token");
if(!token){
if (window.plus) { // App
const main = plus.android.runtimeMainActivity(); // Android退
main.finish(); // Android退
// 使iOS...
} else {
console.log('Not in App environment.'); // App
setTimeout(function() {
uni.redirectTo({
url: '/pages/login/index'
});
}, 2000);
}
return false;
}
if(item.name=="扫码查询"){

@ -37,9 +37,9 @@
</u-form>
</view>
<view class="loginout" @click="loginout">
<!-- <view class="loginout" @click="loginout">
退出当前账户
</view>
</view>-->
</view>
<u-modal v-model="show" show-cancel-button @confirm="confirm" content="是否退出用户"></u-modal>
</view>
@ -226,9 +226,9 @@
uni.removeStorageSync('token');
uni.removeStorageSync('user');
uni.removeStorageSync('bmmc');
uni.redirectTo({
url: '/pages/login/index'
});
// uni.redirectTo({
// url: '/pages/login/index'
// });
},500);
},
setpsd(){

@ -101,13 +101,13 @@
</view>
<!-- 散装管件清单 -->
<view class="detail-header" v-if="itemList.deliveryNo" >
<!-- <view class="detail-header" v-if="itemList.deliveryNo" >
<text class="detail-title">散装管件清单</text>
<view class="detail-tip" @click="gotolsDetail">
<text class="tip">点击查看</text>
<uni-icons type="right" size="16" color="#999"></uni-icons>
</view>
</view>
</view>-->
<!-- 配送单照片 -->
<view class="list-section">

Loading…
Cancel
Save