You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.3 KiB
42 lines
1.3 KiB
const app = getApp()
|
|
export default function Scene(config) {
|
|
const { onLoad, onUnload } = config
|
|
config.onLoad = function(options) {
|
|
if (onLoad) {
|
|
onLoad.call(this, options)
|
|
}
|
|
this.onNotice = function(message) {
|
|
this.notification = this.notification || this.selectComponent('#qn-notification')
|
|
if(this.notification){
|
|
this.notification.notify(message)
|
|
}
|
|
}
|
|
this.onAttention = function(message) {
|
|
this.vipDialog = this.vipDialog || this.selectComponent('#vip-dialog')
|
|
if(this.vipDialog){
|
|
this.vipDialog.attention(message)
|
|
}
|
|
}
|
|
this.closeAttention = function() {
|
|
this.vipDialog = this.vipDialog || this.selectComponent('#vip-dialog')
|
|
if(this.vipDialog){
|
|
this.vipDialog.onClose()
|
|
}
|
|
}
|
|
}
|
|
// config.onUnload = function(options) {
|
|
// if (onUnload) {
|
|
// onUnload.call(this, options)
|
|
// }
|
|
// let pages = getCurrentPages() //当前页面栈
|
|
// if (pages.length == 1 && pages[0].route != 'pages/index/index') {
|
|
// console.log('to login or to home>>>')
|
|
// if (app.userInfo && app.userInfo.userId) {
|
|
// wx.redirectTo({ url: '/pages/index/index' })
|
|
// } else {
|
|
// wx.reLaunch({ url: '/pages/login/index' })
|
|
// }
|
|
// }
|
|
// }
|
|
return Page(config)
|
|
}
|