40 lines
833 B
JavaScript
40 lines
833 B
JavaScript
Component({
|
||
properties: {
|
||
datas: {
|
||
type: null
|
||
},
|
||
component_id: {
|
||
type: null
|
||
},
|
||
store_id: {
|
||
type: null,
|
||
},
|
||
},
|
||
// 私有数据,可用于模板渲染
|
||
data: {
|
||
list:{},
|
||
},
|
||
lifetimes: {},
|
||
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
||
attached() {
|
||
this.setData({
|
||
list: this.data.datas.list
|
||
});
|
||
},
|
||
// 此处attached的声明会被lifetimes字段中的声明覆盖
|
||
ready() {},
|
||
pageLifetimes: {},
|
||
methods: {
|
||
// 点击图片
|
||
clickImages(e){
|
||
// 参数获取
|
||
let item = e.currentTarget.dataset.item;
|
||
// 跳转页面
|
||
if(item.supplier_id > 0){
|
||
wx.navigateTo({
|
||
url: '/packageA/member/supplier/goods/goods?supplier_id=' + item.supplier_id
|
||
});
|
||
}
|
||
}
|
||
}
|
||
}); |