优化跳转页面的提示

This commit is contained in:
weipengfei 2023-08-24 16:30:23 +08:00
parent 3080fa7248
commit 6c615e599f
9 changed files with 114 additions and 51 deletions

11
App.vue
View File

@ -14,17 +14,6 @@
url: '/pages/oaLogin/oaLogin' url: '/pages/oaLogin/oaLogin'
}) })
} }
// jpushModule.initJPushService()
// const audioContext = uni.createInnerAudioContext()
// audioContext.src = './static/mp3/order.mp3'
// let ida = [0]
// jpushModule.addNotificationListener(function (result) {
// if (!ida.includes(result.messageID)) {
// audioContext.play()
// }
// ida.push(result.messageID)
// })
}, },
onShow: function() { onShow: function() {
const audioContext = uni.createInnerAudioContext() const audioContext = uni.createInnerAudioContext()

View File

@ -110,10 +110,18 @@
}, },
methods: { methods: {
navTo(url) { navTo(url) {
url ? if(url){
uni.navigateTo({ uni.showLoading({
url: url, title: '加载中',
}) : Toast('暂未开放') mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
}else Toast('暂未开放')
}, },
initLoad() { initLoad() {
this.loadConfig.page = 1; this.loadConfig.page = 1;

View File

@ -57,15 +57,23 @@
}, },
methods: { methods: {
navTo(url) { navTo(url) {
url ? if(url){
uni.navigateTo({ uni.showLoading({
url: url title: '加载中',
}) : Toast('暂未开放') mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
}else Toast('暂未开放')
}, },
changeCurrent(e) { changeCurrent(e) {
if(e.currentIndex==3){ if(e.currentIndex==3){
this.$refs.controlRef._onClick(this.current); this.$refs.controlRef._onClick(this.current);
this.navTo('/subpkg/taskAdmin/taskAdmin'); this.navTo('/subpkg/taskAdmin/taskAdmin')
return ; return ;
} }
if (this.current !== e.currentIndex) { if (this.current !== e.currentIndex) {

View File

@ -120,10 +120,18 @@
}, },
methods: { methods: {
navTo(url) { navTo(url) {
url ? if(url){
uni.navigateTo({ uni.showLoading({
url: url, title: '加载中',
}) : Toast('暂未开放') mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
}else Toast('暂未开放')
}, },
clickTask() { clickTask() {
// console.log('', this.$props.datas); // console.log('', this.$props.datas);

View File

@ -381,17 +381,29 @@ export default {
}); });
}, },
navTo (url) { navTo (url) {
url if(url){
? uni.showLoading({
title: '加载中',
mask: true
});
uni.navigateTo({ uni.navigateTo({
url: url, url: url,
success() {
uni.hideLoading()
},
fail () { fail () {
uni.switchTab({ uni.switchTab({
url: url, url: url,
success() {
uni.hideLoading()
},
fail() {
uni.hideLoading()
}
}); });
}, },
}) : })
Toast("暂未开放"); }else Toast('暂未开放')
}, },
navTwo (url, key) { navTwo (url, key) {
let role_id = this.$store.state.app?.userInfo?.admin?.role_id || null; let role_id = this.$store.state.app?.userInfo?.admin?.role_id || null;

View File

@ -156,16 +156,30 @@
const res = await userInfo(); const res = await userInfo();
this.$store.commit('setUserInfo', res.data); this.$store.commit('setUserInfo', res.data);
}, },
navTo(url) { navTo (url) {
url ? if(url){
uni.navigateTo({ uni.showLoading({
url: url, title: '加载中',
fail(e) { mask: true
uni.switchTab({ });
url: url uni.navigateTo({
}) url: url,
} success() {
}) : Toast('暂未开放') uni.hideLoading()
},
fail () {
uni.switchTab({
url: url,
success() {
uni.hideLoading()
},
fail() {
uni.hideLoading()
}
});
},
})
}else Toast('暂未开放')
}, },
alterMyInfo() { alterMyInfo() {
uni.navigateTo({ uni.navigateTo({

View File

@ -159,10 +159,18 @@
}, },
methods: { methods: {
navTo(url) { navTo(url) {
url ? if(url){
uni.navigateTo({ uni.showLoading({
url: url, title: '加载中',
}) : Toast('暂未开放') mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
}else Toast('暂未开放')
}, },
initLoad() { initLoad() {
this.loadConfig.page = 1; this.loadConfig.page = 1;

View File

@ -146,10 +146,18 @@
// console.log(a.substring(0, 10)) // console.log(a.substring(0, 10))
}, },
navTo(url) { navTo(url) {
url ? if(url){
uni.navigateTo({ uni.showLoading({
url: url, title: '加载中',
}) : Toast('暂未开放') mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
}else Toast('暂未开放')
}, },
async initLoad() { async initLoad() {
this.loadConfig.page = 1; this.loadConfig.page = 1;

View File

@ -405,10 +405,18 @@
}) })
}, },
navTo(url) { navTo(url) {
url ? if(url){
uni.navigateTo({ uni.showLoading({
url: url, title: '加载中',
}) : Toast('暂未开放') mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
}else Toast('暂未开放')
}, },
updateShow(value, type) { updateShow(value, type) {
this.updateForm[type] = value; this.updateForm[type] = value;