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.
50 lines
1.1 KiB
50 lines
1.1 KiB
const app = getApp();
|
|
const config = global.config;
|
|
const imgUrl = config.imgDir+"blank_info_bg.png";
|
|
const scenes = {
|
|
imgUrl,
|
|
401:{
|
|
message:"请先登陆哦",
|
|
btnText:"点击登陆"
|
|
}
|
|
}
|
|
Component({
|
|
properties: {
|
|
status:{
|
|
type:Number,
|
|
observer:function(res){
|
|
this.refresh()
|
|
}
|
|
},
|
|
config:Object,
|
|
bg:{
|
|
type:String,
|
|
value:"#00b0f0"
|
|
}
|
|
},
|
|
data: {
|
|
|
|
},
|
|
methods: {
|
|
refresh(){
|
|
let {config, status} = this.data;
|
|
var {message="", btnText="", imgUrl=""} = scenes;
|
|
if(scenes[status])
|
|
var {message=message, btnText=btnText, imgUrl=imgUrl} = scenes[status];
|
|
if(config[status])
|
|
var {message=message, btnText=btnText, imgUrl=imgUrl} = config[status];
|
|
this.setData({message, btnText, imgUrl});
|
|
},
|
|
onTapBody(){
|
|
console.log("tapbody")
|
|
let {status} = this.data;
|
|
this.triggerEvent("refresh",{target:"body", status})
|
|
},
|
|
onTapButton(){
|
|
console.log("tapButton")
|
|
let {status } =this.data;
|
|
this.triggerEvent("refresh",{target:"button", status})
|
|
}
|
|
}
|
|
})
|