"use strict"; var common_vendor = require("../../common/vendor.js"); var uni_modules_mescrollUni_components_mescrollUni_mescrollMixins = require("../../uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js"); var api_package = require("../../api/package.js"); require("../../common/request.js"); const Menu = () => "../../components/Menu.js"; const _sfc_main = { components: { Menu }, mixins: [uni_modules_mescrollUni_components_mescrollUni_mescrollMixins.MescrollMixin], data() { return { top: null, cates: [], diseaseType: 0, keyword: "", mescroll: null, downOption: { use: true, auto: false }, upOption: { onScroll: false, use: true, page: { pae: 0, size: 10 }, noMoreSize: 10, textNoMore: "\u5DF2\u7ECF\u5230\u5E95\u4E86", empty: { icon: "https://cos.his.cdwjyyh.com/fs/20240423/cf4a86b913a04341bb44e34bb4d37aa2.png", tip: "\u6682\u65E0\u6570\u636E" } }, dataList: [] }; }, onLoad() { this.getPackagCateList(1); }, methods: { menuClick(item) { this.diseaseType = item.cateCode; this.mescroll.resetUpScroll(); }, getPackagCateList(type) { var data = { type }; var that = this; api_package.getPackagCateList(data).then((res) => { if (res.code == 200) { this.cates = res.data; var query = common_vendor.index.createSelectorQuery().in(that); setTimeout(function() { query.select(".top-content").boundingClientRect((data2) => { if (data2) { console.log("View height:", data2.height + "px"); that.top = data2.height + "px"; } }).exec(); }, 500); } }, (err) => { }); }, doSearch() { this.mescroll.resetUpScroll(); }, navTo(url) { common_vendor.index.navigateTo({ url }); }, mescrollInit(mescroll) { this.mescroll = mescroll; }, downCallback() { this.mescroll.resetUpScroll(); }, upCallback(page) { var that = this; var data = { isShow: 1, diseaseType: this.diseaseType, keyword: this.keyword, pageNum: page.num, pageSize: page.size }; api_package.getPackageList(data).then((res) => { if (res.code == 200) { if (page.num == 1) { that.dataList = res.data.list; } else { that.dataList = that.dataList.concat(res.data.list); } that.mescroll.endBySize(res.data.list.length, res.data.total); } else { common_vendor.index.showToast({ icon: "none", title: "\u8BF7\u6C42\u5931\u8D25" }); that.dataList = null; that.mescroll.endErr(); } }); } } }; if (!Array) { const _component_Menu = common_vendor.resolveComponent("Menu"); const _easycom_mescroll_body2 = common_vendor.resolveComponent("mescroll-body"); (_component_Menu + _easycom_mescroll_body2)(); } const _easycom_mescroll_body = () => "../../uni_modules/mescroll-uni/components/mescroll-body/mescroll-body.js"; if (!Math) { _easycom_mescroll_body(); } function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return common_vendor.e({ a: common_vendor.o((...args) => $options.doSearch && $options.doSearch(...args)), b: $data.keyword, c: common_vendor.o(($event) => $data.keyword = $event.detail.value), d: $data.cates.length > 0 }, $data.cates.length > 0 ? { e: common_vendor.o($options.menuClick), f: common_vendor.p({ list: $data.cates }) } : {}, { g: $data.top != null }, $data.top != null ? { h: common_vendor.f($data.dataList, (item, index, i0) => { return { a: item.imgUrl, b: common_vendor.t(item.packageName), c: common_vendor.t(item.price.toFixed(2)), d: common_vendor.t(item.sales), e: common_vendor.o(($event) => $options.navTo("/pages_index/packageDetails?packageId=" + item.packageId)) }; }), i: common_vendor.sr("mescrollRef", "38de483b-1"), j: common_vendor.o($options.mescrollInit), k: common_vendor.o($options.downCallback), l: common_vendor.o($options.upCallback), m: common_vendor.p({ top: $data.top, bottom: "0", down: $data.downOption, up: $data.upOption }) } : {}); } var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-38de483b"], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages/store/index.vue"]]); wx.createPage(MiniProgramPage);