修复一些问题

main
董哲奇 1 week ago
parent c105c22a68
commit b02d8ed18b

@ -25,6 +25,10 @@
const params = new URLSearchParams(query); // URLSearchParams const params = new URLSearchParams(query); // URLSearchParams
ticket=params.get('ticket'); ticket=params.get('ticket');
} }
if (!ticket){
this.closeWindow()
}
// alert(ticket) // alert(ticket)
if(ticket){ if(ticket){
uni.showLoading({ uni.showLoading({
@ -66,7 +70,6 @@
// } // }
// }); // });
// } // }
uni.request({ uni.request({
header: { header: {
"Content-Type": "application/json", "Content-Type": "application/json",
@ -78,9 +81,8 @@
}, },
method: "POST", method: "POST",
success: res => { success: res => {
console.log(res); uni.hideLoading()
if(res.data){ if(res.data){
console.log(res.data)
var data=res.data; var data=res.data;
if(data.data){ if(data.data){
var datas=data.data; var datas=data.data;
@ -93,25 +95,25 @@
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}); });
} }else{
else{
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '获取登录token失败,请重新登录后进入!', content: '登录失败,请重新登录后进入!',
cancelText: '取消', cancelText: '取消',
confirmText: '确定', confirmText: '确定',
success: ress => { success: ress => {
this.closeWindow()
} }
}); });
} }
} }else{
else{
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '获取登录token失败,请重新登录后进入!', content: '登录失败,请重新登录后进入!',
cancelText: '取消', cancelText: '取消',
confirmText: '确定', confirmText: '确定',
success: ress => { success: ress => {
this.closeWindow()
} }
}); });
} }
@ -120,10 +122,11 @@
console.log("err",err); console.log("err",err);
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '获取登录token请求失败,请重新登录后进入!', content: '登录请求失败,请重新登录后进入!',
cancelText: '取消', cancelText: '取消',
confirmText: '确定', confirmText: '确定',
success: ress => { 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> </script>

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

@ -141,19 +141,19 @@
this.initMenu(); this.initMenu();
}, },
onShow() { onShow() {
if (!uni.getStorageSync("token")) { // if (!uni.getStorageSync("token")) {
uni.showToast({ // uni.showToast({
title: '登录已失效!请您重新登录!', // title: '',
duration: 2000, // duration: 2000,
icon: "none" // icon: "none"
}); // });
setTimeout(function() { // setTimeout(function() {
uni.redirectTo({ // uni.redirectTo({
url: '/pages/login/index' // url: '/pages/login/index'
}); // });
}, 2000); // }, 2000);
//
} // }
//#ifdef APP-PLUS //#ifdef APP-PLUS
@ -197,6 +197,22 @@
}, },
// //
gotoMenu(item){ 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=="扫码查询"){ if(item.name=="扫码查询"){

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

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

Loading…
Cancel
Save