|
|
|
@ -23,15 +23,62 @@ Component({ |
|
|
|
clickid: { |
|
|
|
type: String, |
|
|
|
value: "" |
|
|
|
}, |
|
|
|
ids:{ |
|
|
|
type: String, |
|
|
|
value: "" |
|
|
|
} |
|
|
|
}, |
|
|
|
observers:{ |
|
|
|
'ids': function(newVal,oldVal){ |
|
|
|
console.log('newVal--------',newVal) |
|
|
|
console.log('oldVal--------',oldVal) |
|
|
|
if (newVal) { |
|
|
|
this.getTj(newVal) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
lifetimes: { |
|
|
|
created() { |
|
|
|
commonApi._post("product/get_product_by_type", { |
|
|
|
this.data.tjList=[] |
|
|
|
// commonApi._post("product/get_product_by_type", {
|
|
|
|
// offset: 0,
|
|
|
|
// limit: 6,
|
|
|
|
// rand: true,
|
|
|
|
// type: "venue,post,line,ticket",
|
|
|
|
// product_ids:this.data.ids
|
|
|
|
// }).then(res => {
|
|
|
|
// this.setData({
|
|
|
|
// showLoading: false
|
|
|
|
// })
|
|
|
|
// try {
|
|
|
|
// this.setData({
|
|
|
|
// tjList: res.data.list
|
|
|
|
// })
|
|
|
|
// } catch (error) {
|
|
|
|
// console.log(error);
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
} |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 组件的初始数据 |
|
|
|
*/ |
|
|
|
data: { |
|
|
|
tjList: [], |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 组件的方法列表 |
|
|
|
*/ |
|
|
|
methods: { |
|
|
|
getTj() { |
|
|
|
this.data.tjList = [] |
|
|
|
commonApi._post("search/product_recommend", { |
|
|
|
offset: 0, |
|
|
|
limit: 6, |
|
|
|
rand: true, |
|
|
|
type: "venue,post,line,ticket" |
|
|
|
type: "venue,post,line,ticket", |
|
|
|
product_ids:this.data.ids |
|
|
|
}).then(res => { |
|
|
|
this.setData({ |
|
|
|
showLoading: false |
|
|
|
@ -43,19 +90,9 @@ Component({ |
|
|
|
} catch (error) { |
|
|
|
console.log(error); |
|
|
|
} |
|
|
|
console.log('tjList',this.data.tjList); |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 组件的初始数据 |
|
|
|
*/ |
|
|
|
data: { |
|
|
|
tjList: [], |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 组件的方法列表 |
|
|
|
*/ |
|
|
|
methods: { |
|
|
|
}, |
|
|
|
gotoDetail: function (e) { |
|
|
|
let item = e.currentTarget.dataset.item; |
|
|
|
util.pagePoint({ |
|
|
|
@ -74,5 +111,6 @@ Component({ |
|
|
|
util.gotoDetail(item); |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
}) |