zhaojs
2023-04-27 582f536845628ffb8132aaed1885ee535fcf08ad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
"use strict";
const common_vendor = require("../../../common/vendor.js");
const _sfc_main = {
  data() {
    return {
      couponList: [
        {
          id: "e2",
          title: "5元优惠券",
          conditon: "满100元使用",
          date: "2023/03/25 - 2023/04/20",
          isGet: false
        },
        {
          id: "e3",
          title: "10元优惠券",
          conditon: "满200元使用",
          date: "2023/03/25 - 2023/04/20",
          isGet: false
        },
        {
          id: "e4",
          title: "15元优惠券",
          conditon: "满200元使用,(仅限于生鲜类)",
          date: "2023/03/25 - 2023/04/20",
          isGet: false
        },
        {
          id: "e1",
          title: "2元优惠券",
          conditon: "满50元使用",
          date: "2023/03/25 - 2023/04/20",
          isGet: true
        }
      ]
    };
  },
  onLoad(option) {
    common_vendor.index.setNavigationBarTitle({
      title: option.title
    });
  },
  methods: {
    getCoupon(id) {
      let data = this.couponList;
      this.couponList.map((item, index) => {
        if (item.id == id) {
          let row = {
            id: item.id,
            title: item.title,
            conditon: item.conditon,
            date: item.date,
            isGet: true
          };
          data.splice(index, 1);
          data = data.concat(row);
        }
      });
      this.couponList = data;
    }
  }
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return {
    a: common_vendor.f($data.couponList, (item, index, i0) => {
      return common_vendor.e({
        a: common_vendor.t(item.title),
        b: common_vendor.t(item.conditon),
        c: common_vendor.t(item.date),
        d: !item.isGet
      }, !item.isGet ? {
        e: common_vendor.o(($event) => $options.getCoupon(item.id), item.id)
      } : {}, {
        f: item.isGet
      }, item.isGet ? {} : {}, {
        g: item.id
      });
    })
  };
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "E:/OPProject/fx_h5_web/pages/index/ability/coupon.vue"]]);
wx.createPage(MiniProgramPage);