|
|
@@ -12,46 +12,69 @@ Page({ |
|
|
|
{ |
|
|
|
id: 0, |
|
|
|
imgUrl: "../../asset/image/Audi-RS7-item.png", |
|
|
|
title: "标题", |
|
|
|
name: "标题", |
|
|
|
detail: "简述简述简述" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 1, |
|
|
|
id: '1', |
|
|
|
imgUrl: "../../asset/image/Audi-RS7-item.png", |
|
|
|
title: "标题", |
|
|
|
name: "标题", |
|
|
|
detail: "简述简述简述" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 2, |
|
|
|
imgUrl: "../../asset/image/Audi-RS7-item.png", |
|
|
|
title: "标题", |
|
|
|
name: "标题", |
|
|
|
detail: "简述简述简述" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 3, |
|
|
|
imgUrl: "../../asset/image/Audi-RS7-item.png", |
|
|
|
title: "标题", |
|
|
|
name: "标题", |
|
|
|
detail: "简述简述简述" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 4, |
|
|
|
imgUrl: "../../asset/image/Audi-RS7-item.png", |
|
|
|
title: "标题", |
|
|
|
name: "标题", |
|
|
|
detail: "简述简述简述" |
|
|
|
}, |
|
|
|
] |
|
|
|
}, |
|
|
|
|
|
|
|
getList() { |
|
|
|
const that = this |
|
|
|
request.get({ |
|
|
|
url: '/api/promote/list' |
|
|
|
}).then(res => { |
|
|
|
console.log(res, 'res'); |
|
|
|
// if (res.data) { |
|
|
|
// that.setData({ |
|
|
|
// list: res.data |
|
|
|
// }) |
|
|
|
// } |
|
|
|
}).catch(err => { |
|
|
|
console.log(err, 'err'); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
getTypeList(id) { |
|
|
|
const that = this |
|
|
|
return request.get({ |
|
|
|
url: `/api/promote/titleList?typeId=${id}` |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
goDetail(e) { |
|
|
|
const id = e.currentTarget.dataset.id |
|
|
|
this.getTypeList(id) |
|
|
|
.then(res => { |
|
|
|
console.log(res, 'res'); |
|
|
|
}).catch(err => { |
|
|
|
console.log(err, 'err'); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
*/ |
|
|
|