"use strict"; const common_vendor = require("../../common/vendor.js"); const pagesOne_winner_utils_source = require("./utils/source.js"); const services_ams = require("../../services/ams.js"); if (!Array) { const _easycom_wd_gap2 = common_vendor.resolveComponent("wd-gap"); _easycom_wd_gap2(); } const _easycom_wd_gap = () => "../../node-modules/wot-design-uni/components/wd-gap/wd-gap.js"; if (!Math) { (_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( "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/Group%201.png" ); let aData = common_vendor.reactive({ discounts: [] }); let list = common_vendor.ref([]); 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 }; }); console.log("---------------------", aData); }).catch((err) => { console.log(err); }); }; const handledUpload = () => { common_vendor.index.getLocation({ type: "gcj02", success: async (res) => { const { latitude, longitude } = res; const key = "7c607ea6b491804270ddcdd72daad58c"; const url = `https://restapi.amap.com/v3/geocode/regeo?key=${key}&location=${longitude},${latitude}`; await common_vendor.index.request({ url }); console.log("用户所在位置", res); }, fail: (err) => { common_vendor.index.showToast({ title: "获取位置失败", icon: "none" }); } }); }; common_vendor.onShow(() => { getList(); }); return (_ctx, _cache) => { return { a: backImage.value, b: common_vendor.o(($event) => common_vendor.isRef(showDesc) ? showDesc.value = true : showDesc = true), c: common_vendor.unref(pagesOne_winner_utils_source.imgObj).rule, d: common_vendor.o(($event) => _ctx.showWinner = true), e: common_vendor.unref(pagesOne_winner_utils_source.imgObj).record, f: common_vendor.unref(pagesOne_winner_utils_source.imgObj).photo, g: common_vendor.o(($event) => common_vendor.isRef(showExample) ? showExample.value = true : showExample = true), h: common_vendor.unref(pagesOne_winner_utils_source.imgObj).book, i: common_vendor.o(($event) => common_vendor.isRef(showRecord) ? showRecord.value = true : showRecord = true), j: common_vendor.unref(pagesOne_winner_utils_source.gifObj).pointer, k: common_vendor.o(handledUpload), l: 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 }; }), m: common_vendor.p({ ["bg-color"]: "transparent" }), n: common_vendor.o(($event) => common_vendor.isRef(showExample) ? showExample.value = $event : showExample = $event), o: common_vendor.p({ show: common_vendor.unref(showExample) }), p: common_vendor.o(($event) => common_vendor.isRef(showUpload) ? showUpload.value = $event : showUpload = $event), q: common_vendor.p({ list: common_vendor.unref(list), show: common_vendor.unref(showUpload) }), r: common_vendor.o(($event) => common_vendor.isRef(showWiner) ? showWiner.value = $event : showWiner = $event), s: common_vendor.p({ show: common_vendor.unref(showWiner) }), t: common_vendor.o(($event) => common_vendor.isRef(showRecord) ? showRecord.value = $event : showRecord = $event), v: common_vendor.p({ show: common_vendor.unref(showRecord) }), w: common_vendor.o(($event) => common_vendor.isRef(showDesc) ? showDesc.value = $event : showDesc = $event), x: common_vendor.p({ show: common_vendor.unref(showDesc) }) }; }; } }); const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3457e999"]]); wx.createPage(MiniProgramPage);