|
|
@@ -1,12 +1,13 @@ |
|
|
|
// components/optimization/optimization.js |
|
|
|
const Http = require("../../utils/HttpBasics"); |
|
|
|
const config = require("../../config/config"); |
|
|
|
Component({ |
|
|
|
/** |
|
|
|
* 组件的属性列表 |
|
|
|
*/ |
|
|
|
properties: { |
|
|
|
businessList:{ |
|
|
|
type:Array, |
|
|
|
value:[] |
|
|
|
businessList: { |
|
|
|
type: Array, |
|
|
|
value: [] |
|
|
|
}, |
|
|
|
businessData: { |
|
|
|
type: Array, |
|
|
@@ -18,28 +19,41 @@ Component({ |
|
|
|
* 组件的初始数据 |
|
|
|
*/ |
|
|
|
data: { |
|
|
|
classIndex:0 |
|
|
|
classIndex: 0, |
|
|
|
couponListShowSelled: "" |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 组件的方法列表 |
|
|
|
*/ |
|
|
|
methods: { |
|
|
|
goDetail(e){ |
|
|
|
goDetail(e) { |
|
|
|
let couponChannelId = e.currentTarget.dataset.id |
|
|
|
let couponId = e.currentTarget.dataset.couponid |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, |
|
|
|
}) |
|
|
|
}, |
|
|
|
setIndex(e){ |
|
|
|
setIndex(e) { |
|
|
|
let index = e.currentTarget.dataset.index |
|
|
|
let id = e.currentTarget.dataset.id |
|
|
|
this.triggerEvent('businessid',id) |
|
|
|
this.triggerEvent('businessid', id) |
|
|
|
this.setData({ |
|
|
|
classIndex: index |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
attached() { |
|
|
|
Http.get({ |
|
|
|
url: config.api.couponListShowSelled, |
|
|
|
}).then(res => { |
|
|
|
this.setData({ |
|
|
|
classIndex:index |
|
|
|
couponListShowSelled: res.data || "" |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
}) |