"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, scrollInto: "", newsList: [], list: [], title: "Hello", TabCur: 9, Cur: 0, loadingMore: true, lists: [9, 12, 15, 17, 20], goodsList: [], curHour: 9, currentGoodsPage: 1, loadingMore: true, nomore: false, nodata: false }; }, created() { this.GetExplosiveGoodsList(1); }, onLoad(option) { let now = new Date(); let curH = now.getHours(); this.curHour = curH; let index = this.lists.findIndex((i) => { return i > curH; }); this.TabCur = this.lists[index]; this.Cur = index; }, onShareAppMessage: function() { return { title: "淘券获取", path: " /pages/index/index" // promise }; }, onShareTimeline() { return { title: "淘券获取", query: "/pages/index/index" }; }, methods: { GetExplosiveGoodsList(cur) { let me = this; common_vendor.index.request({ url: "https://h.ushopvip.com/api/TkProduct/GetExplosiveGoodsList", method: "POST", data: { pageNo: cur, pageSize: 100, hasCoupon: true }, success(res) { var _a; if ((_a = res.data) == null ? void 0 : _a.success) { me.nodata = false; if (res.data.result.length < 100) { me.nomore = true; } if (cur === 1) { me.goodsList = res.data.result; me.currentGoodsPage = cur; me.loadingMore = true; } else { let data = me.goodsList; me.goodsList = 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("获取openid失败:", err); } }); }, gotogoodDetail(type, id) { if (type == 1) { common_vendor.index.navigateTo({ url: "/pages/goodDetail/index?id=" + id }); } }, TabClick(id) { for (let i = 0; i < this.lists.length; ++i) { if (id === this.lists[i]) { this.TabCur = this.lists[i]; this.Cur = i; this.scrollInto = this.lists[i]; } } }, loadMore() { this.loadingMore = false; this.GetExplosiveGoodsList(this.currentGoodsPage + 1); }, switchTab(e) { let cur = e.target.current; for (let i = 0; i < this.lists.length; ++i) { if (cur === i) { this.TabCur = this.lists[i]; this.Cur = i; this.scrollInto = this.lists[i]; } } } } }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return common_vendor.e({ a: common_vendor.f($data.goodsList, (item2, index, i0) => { return { a: item2 == null ? void 0 : item2.mainPic, b: common_vendor.t(item2.dtitle), c: common_vendor.t(item2.tip), d: common_vendor.t(item2.couponPrice), e: common_vendor.t(item2.actualPrice), f: common_vendor.t(item2.yprice), g: common_vendor.t($data.getNumData(item2.monthsale)), h: common_vendor.o(($event) => $options.gotogoodDetail(1, item2.goodsId), item2.goodsId), i: item2.goodsId }; }), b: $data.nodata }, $data.nodata ? {} : $data.nomore ? {} : $data.loadingMore && !$data.nomore ? {} : $data.loadingMore == false && !$data.nomore ? {} : {}, { c: $data.nomore, d: $data.loadingMore && !$data.nomore, e: $data.loadingMore == false && !$data.nomore, f: common_vendor.o(($event) => $options.loadMore()) }); } const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/项目/Yfcodes/crm_app_new/pages/madBuy/index.vue"]]); _sfc_main.__runtimeHooks = 6; wx.createPage(MiniProgramPage);