zhaojs
2023-04-25 f38ca22088b7a0de7e7db316c564b4bf7526f105
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_util = require("../../common/util.js");
const _sfc_main = {
  data() {
    return {
      getNumData: common_util.getNumData,
      list: [],
      loadingMore: true,
      currentGoodsPage: 1,
      nomore: false,
      nodata: false
    };
  },
  onShow() {
    this.GetRankingGoodsList(1);
  },
  onShareAppMessage: function() {
    return {
      title: "淘券获取",
      path: "/pages/index/index"
      // promise
    };
  },
  onShareTimeline() {
    return {
      title: "淘券获取",
      query: "/pages/index/index"
    };
  },
  methods: {
    GetRankingGoodsList(cur) {
      let me = this;
      common_vendor.index.request({
        url: "https://h.ushopvip.com/api/TkProduct/GetRankingGoodsList",
        method: "POST",
        data: {
          pageNo: cur,
          pageSize: 100,
          hasCoupon: true
        },
        success(res) {
          var _a;
          if ((_a = res.data) == null ? void 0 : _a.success) {
            if (res.data.result.length < 20) {
              me.nomore = true;
            }
            if (cur === 1) {
              me.list = res.data.result;
              me.currentGoodsPage = cur;
              me.loadingMore = true;
            } else {
              let data = me.list;
              me.list = data.concat(res.data.result);
              me.currentGoodsPage = cur;
              me.loadingMore = true;
            }
          } else {
            if (cur === 1) {
              me.nodata = true;
            } else {
              me.nodata = false;
            }
          }
        },
        fail(err) {
          console.log("GetRankingGoodsList失败:", err);
        }
      });
    },
    gotogoodDetail(type, id) {
      if (type == 1) {
        common_vendor.index.navigateTo({
          url: "/pages/goodDetail/index?id=" + id
        });
      }
    },
    loadMore() {
      this.loadingMore = false;
      this.GetRankingGoodsList(this.currentGoodsPage + 1);
    },
    goHome() {
      common_vendor.index.switchTab({
        url: "/pages/index/index"
      });
    }
  }
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return {
    a: common_vendor.o((...args) => $options.goHome && $options.goHome(...args)),
    b: $data.list[1].mainPic,
    c: common_vendor.t($data.getNumData($data.list[1].monthsale)),
    d: common_vendor.t($data.list[1].dtitle),
    e: common_vendor.t($data.list[1].actualPrice),
    f: common_vendor.o(($event) => $options.gotogoodDetail(1, $data.list[1].goodsId)),
    g: $data.list[0].mainPic,
    h: common_vendor.t($data.getNumData($data.list[0].monthsale)),
    i: common_vendor.t($data.list[0].dtitle),
    j: common_vendor.t($data.list[0].actualPrice),
    k: common_vendor.o(($event) => $options.gotogoodDetail(1, $data.list[0].goodsId)),
    l: $data.list[2].mainPic,
    m: common_vendor.t($data.getNumData($data.list[2].monthsale)),
    n: common_vendor.t($data.list[2].dtitle),
    o: common_vendor.t($data.list[2].actualPrice),
    p: common_vendor.o(($event) => $options.gotogoodDetail(1, $data.list[2].goodsId)),
    q: common_vendor.f($data.list, (i, ind, i0) => {
      return common_vendor.e({
        a: ind > 2
      }, ind > 2 ? {
        b: common_vendor.t(ind > 8 ? ind + 1 : "0" + (ind + 1)),
        c: i.mainPic,
        d: common_vendor.t(i.dtitle),
        e: common_vendor.t(i.couponPrice),
        f: common_vendor.t(i.actualPrice),
        g: common_vendor.t(Number(i.actualPrice) + Number(i.couponPrice)),
        h: common_vendor.t($data.getNumData(i.monthsale)),
        i: common_vendor.o(($event) => $options.gotogoodDetail(1, i.goodsId), i.goodsId)
      } : {}, {
        j: i.goodsId
      });
    })
  };
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/项目/Yfcodes/crm_app_new/pages/rankingList/index.vue"]]);
_sfc_main.__runtimeHooks = 6;
wx.createPage(MiniProgramPage);