|
- const Http = require("../../utils/HttpBasics");
- const config = require("../../config/config");
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- businessList: {
- type: Array,
- value: []
- },
- businessData: {
- type: Array,
- value: []
- },
- },
-
- /**
- * 组件的初始数据
- */
- data: {
- classIndex: 0,
- couponListShowSelled: ""
- },
-
- /**
- * 组件的方法列表
- */
- methods: {
- 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) {
- let index = e.currentTarget.dataset.index
- let id = e.currentTarget.dataset.id
- this.triggerEvent('businessid', id)
- this.setData({
- classIndex: index
- })
- },
-
-
- },
- attached() {
- Http.get({
- url: config.api.couponListShowSelled,
- }).then(res => {
- this.setData({
- couponListShowSelled: res.data || ""
- })
- }).catch(err => {
-
- })
- }
- })
|