"use strict"; const common_vendor = require("../../common/vendor.js"); const utils_system = require("../../utils/system.js"); const pagesOne_winner_utils_source = require("./utils/source.js"); const services_ams = require("../../services/ams.js"); if (!Array) { const _easycom_wd_icon2 = common_vendor.resolveComponent("wd-icon"); const _easycom_wd_gap2 = common_vendor.resolveComponent("wd-gap"); (_easycom_wd_icon2 + _easycom_wd_gap2)(); } const _easycom_wd_icon = () => "../../node-modules/wot-design-uni/components/wd-icon/wd-icon.js"; const _easycom_wd_gap = () => "../../node-modules/wot-design-uni/components/wd-gap/wd-gap.js"; if (!Math) { (_easycom_wd_icon + _easycom_wd_gap + PhotoExamplePopup + UploadReceptPopop + WinRecordPopup + UploadRecordPopup + ActivityDescPopup)(); } const PhotoExamplePopup = () => "./components/photoExamplePopup.js"; const UploadReceptPopop = () => "./components/uploadReceptPopop.js"; const WinRecordPopup = () => "./components/winRecordPopup.js"; const UploadRecordPopup = () => "./components/uploadRecordPopup.js"; const ActivityDescPopup = () => "./components/activityDescPopup.js"; const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "index", setup(__props) { let showExample = common_vendor.ref(false); let showUpload = common_vendor.ref(false); let showWiner = common_vendor.ref(false); let showRecord = common_vendor.ref(false); let showDesc = common_vendor.ref(false); const appid = common_vendor.index.getStorageSync("appid"); const backImage = common_vendor.ref(""); let aData = common_vendor.reactive({ discounts: [] }); let list = common_vendor.ref([]); const openid = common_vendor.index.getStorageSync("openid"); common_vendor.computed(() => { return aData.authCheck.includes("2") ? true : false; }); const getList = () => { services_ams.getActivity(appid).then((res) => { aData = res.data[0] || {}; aData.authCheck = aData.authCheck.split(","); list.value = aData.discounts.map((item) => { return { ...item, checked: false }; }); common_vendor.index.setStorageSync("activityData", JSON.stringify(aData)); backImage.value = res.data[0].activityImage; }).catch((err) => { console.log(err); }); }; const rewardData = common_vendor.ref([]); const getRewardList = () => { console.log("openid", openid); services_ams.rewardList({ openid }).then((res) => { rewardData.value = res.rows; }); }; const showUploadRecord = () => { getRewardList(); showRecord.value = true; }; const winnerData = common_vendor.ref([]); const getWinnerList = () => { services_ams.auditSuccessList({ openid }).then((res) => { winnerData.value = res.rows; }); }; const showWinerRecord = () => { getWinnerList(); showWiner.value = true; }; const onBack = () => { common_vendor.index.navigateBack({ delta: 1 }); }; const handledUpload = () => { showUpload.value = true; }; common_vendor.onShow(() => { getList(); }); common_vendor.ref(0); common_vendor.onLoad(() => { }); return (_ctx, _cache) => { return { a: common_vendor.unref(utils_system.getStatusBarHeight)() + "px", b: common_vendor.o(onBack), c: common_vendor.p({ name: "thin-arrow-left", size: "44rpx", color: "#000" }), d: common_vendor.unref(utils_system.getNavBarPaddingTop)() + "px", e: backImage.value, f: common_vendor.o(($event) => common_vendor.isRef(showDesc) ? showDesc.value = true : showDesc = true), g: common_vendor.unref(pagesOne_winner_utils_source.imgObj).rule, h: common_vendor.unref(pagesOne_winner_utils_source.imgObj).record, i: common_vendor.o(showWinerRecord), j: common_vendor.unref(pagesOne_winner_utils_source.imgObj).photo, k: common_vendor.o(($event) => common_vendor.isRef(showExample) ? showExample.value = true : showExample = true), l: common_vendor.unref(pagesOne_winner_utils_source.imgObj).book, m: common_vendor.o(showUploadRecord), n: common_vendor.unref(pagesOne_winner_utils_source.gifObj).pointer, o: common_vendor.o(handledUpload), p: common_vendor.t(common_vendor.unref(aData).startTime), q: common_vendor.t(common_vendor.unref(aData).endTime), r: common_vendor.f(common_vendor.unref(list), (item, k0, i0) => { return { a: common_vendor.t(item.cashbackAmount), b: common_vendor.t(item.thresholdAmount), c: common_vendor.t(item.cashbackAmount), d: item.id }; }), s: common_vendor.p({ ["bg-color"]: "transparent" }), t: common_vendor.o(($event) => common_vendor.isRef(showExample) ? showExample.value = $event : showExample = $event), v: common_vendor.p({ show: common_vendor.unref(showExample) }), w: common_vendor.unref(aData).id, x: common_vendor.o(($event) => common_vendor.isRef(showUpload) ? showUpload.value = $event : showUpload = $event), y: common_vendor.p({ list: common_vendor.unref(list), id: common_vendor.unref(aData).id, show: common_vendor.unref(showUpload) }), z: common_vendor.o(($event) => common_vendor.isRef(showWiner) ? showWiner.value = $event : showWiner = $event), A: common_vendor.p({ list: winnerData.value, show: common_vendor.unref(showWiner) }), B: common_vendor.o(($event) => common_vendor.isRef(showRecord) ? showRecord.value = $event : showRecord = $event), C: common_vendor.p({ list: rewardData.value, show: common_vendor.unref(showRecord) }), D: common_vendor.o(($event) => common_vendor.isRef(showDesc) ? showDesc.value = $event : showDesc = $event), E: common_vendor.p({ show: common_vendor.unref(showDesc) }) }; }; } }); const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3457e999"]]); wx.createPage(MiniProgramPage);