106 lines
3.0 KiB
JavaScript
106 lines
3.0 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
require("../../store/index.js");
|
|
const api_api = require("../../api/api.js");
|
|
if (!Array) {
|
|
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
|
|
_easycom_z_paging2();
|
|
}
|
|
const _easycom_z_paging = () => "../../uni_modules/z-paging/components/z-paging/z-paging.js";
|
|
if (!Math) {
|
|
_easycom_z_paging();
|
|
}
|
|
const _sfc_main = {
|
|
__name: "setMealList",
|
|
setup(__props) {
|
|
common_vendor.reactive([
|
|
"https://cdn.uviewui.com/uview/swiper/swiper1.png",
|
|
"https://cdn.uviewui.com/uview/swiper/swiper2.png",
|
|
"https://cdn.uviewui.com/uview/swiper/swiper3.png"
|
|
]);
|
|
const paging = common_vendor.ref(null);
|
|
let dataList = common_vendor.ref([]);
|
|
let isPagingRefNotFound = () => {
|
|
return !paging.value;
|
|
};
|
|
common_vendor.onPullDownRefresh(() => {
|
|
if (isPagingRefNotFound())
|
|
return;
|
|
paging.value.reload().catch(() => {
|
|
});
|
|
});
|
|
common_vendor.onPageScroll((e) => {
|
|
if (isPagingRefNotFound())
|
|
return;
|
|
paging.value.updatePageScrollTop(e.scrollTop);
|
|
e.scrollTop < 10 && paging.value.doChatRecordLoadMore();
|
|
});
|
|
common_vendor.onReachBottom(() => {
|
|
if (isPagingRefNotFound())
|
|
return;
|
|
paging.value.pageReachBottom();
|
|
});
|
|
common_vendor.reactive([
|
|
{
|
|
img: "/static/icon/dz.png",
|
|
name: "我的电桩",
|
|
path: "/pages/piles/piles"
|
|
},
|
|
{
|
|
img: "/static/icon/zz.png",
|
|
name: "成为桩柱"
|
|
},
|
|
{
|
|
img: "/static/icon/kf.png",
|
|
name: "联系客服"
|
|
},
|
|
{
|
|
img: "/static/icon/share.png",
|
|
name: "分享海报"
|
|
}
|
|
]);
|
|
let toShop = (e) => {
|
|
common_vendor.index.navigateTo({
|
|
url: "/pages/setMeal/setMeal?id=" + e.id
|
|
});
|
|
};
|
|
const queryList = (pageNo, pageSize) => {
|
|
const params = {
|
|
current: pageNo,
|
|
pageSize
|
|
};
|
|
api_api.selectListByPage(params).then((res) => {
|
|
paging.value.complete(res.records);
|
|
}).catch((res) => {
|
|
paging.value.complete(false);
|
|
});
|
|
};
|
|
return (_ctx, _cache) => {
|
|
return {
|
|
a: common_vendor.f(common_vendor.unref(dataList), (i, k0, i0) => {
|
|
return {
|
|
a: JSON.parse(i.picture)[0],
|
|
b: common_vendor.t(i.packagesName),
|
|
c: common_vendor.t(i.salePrice),
|
|
d: i,
|
|
e: common_vendor.o(($event) => common_vendor.unref(toShop)(i))
|
|
};
|
|
}),
|
|
b: () => ({
|
|
r: paging,
|
|
k: "paging"
|
|
}),
|
|
c: common_vendor.o(queryList),
|
|
d: common_vendor.o(($event) => common_vendor.isRef(dataList) ? dataList.value = $event : dataList = $event),
|
|
e: common_vendor.p({
|
|
["use-page-scroll"]: true,
|
|
modelValue: common_vendor.unref(dataList)
|
|
})
|
|
};
|
|
};
|
|
}
|
|
};
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-05db1d3a"]]);
|
|
_sfc_main.__runtimeHooks = 1;
|
|
my.createPage(MiniProgramPage);
|