71 lines
1.4 KiB
JavaScript
71 lines
1.4 KiB
JavaScript
var app = getApp();
|
||
Component({
|
||
properties: {
|
||
params: {
|
||
type: null
|
||
},
|
||
data: {
|
||
type: null
|
||
}
|
||
},
|
||
data: {
|
||
title: '',
|
||
logo: ''
|
||
}, // 私有数据,可用于模板渲染
|
||
|
||
lifetimes: {
|
||
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
||
attached() {
|
||
this.getData();
|
||
},
|
||
moved() {},
|
||
detached() {},
|
||
},
|
||
|
||
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
||
attached() {
|
||
|
||
}, // 此处attached的声明会被lifetimes字段中的声明覆盖
|
||
ready() {
|
||
|
||
},
|
||
|
||
pageLifetimes: {
|
||
// 组件所在页面的生命周期函数
|
||
show() {},
|
||
hide() {},
|
||
resize() {},
|
||
},
|
||
|
||
methods: {
|
||
getData() {
|
||
var that = this;
|
||
var urlStr = app.getNetAddresss("setting.get");
|
||
app._getNetWork({
|
||
showToastIn: false,
|
||
url: urlStr,
|
||
success: function(resdata) {
|
||
var res = resdata.data;
|
||
if (res.result == 1) {
|
||
that.setData({
|
||
title: res.data.name?res.data.name:'',
|
||
logo: res.data.logo?res.data.logo:''
|
||
});
|
||
} else {
|
||
console.log(res.msg);
|
||
// wx.showToast({
|
||
// icon: 'none',
|
||
// title: res.msg,
|
||
// duration: 1500
|
||
// })
|
||
}
|
||
|
||
},
|
||
fail: function(res) {
|
||
|
||
}
|
||
});
|
||
}
|
||
}
|
||
});
|