index.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const pagesOne_winner_utils_source = require("./utils/source.js");
  4. const services_ams = require("../../services/ams.js");
  5. if (!Array) {
  6. const _easycom_wd_gap2 = common_vendor.resolveComponent("wd-gap");
  7. _easycom_wd_gap2();
  8. }
  9. const _easycom_wd_gap = () => "../../node-modules/wot-design-uni/components/wd-gap/wd-gap.js";
  10. if (!Math) {
  11. (_easycom_wd_gap + PhotoExamplePopup + UploadReceptPopop + WinRecordPopup + UploadRecordPopup + ActivityDescPopup)();
  12. }
  13. const PhotoExamplePopup = () => "./components/photoExamplePopup.js";
  14. const UploadReceptPopop = () => "./components/uploadReceptPopop.js";
  15. const WinRecordPopup = () => "./components/winRecordPopup.js";
  16. const UploadRecordPopup = () => "./components/uploadRecordPopup.js";
  17. const ActivityDescPopup = () => "./components/activityDescPopup.js";
  18. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  19. __name: "index",
  20. setup(__props) {
  21. let showExample = common_vendor.ref(false);
  22. let showUpload = common_vendor.ref(false);
  23. let showWiner = common_vendor.ref(false);
  24. let showRecord = common_vendor.ref(false);
  25. let showDesc = common_vendor.ref(false);
  26. const appid = common_vendor.index.getStorageSync("appid");
  27. const backImage = common_vendor.ref(
  28. "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/Group%201.png"
  29. );
  30. let aData = common_vendor.reactive({ discounts: [] });
  31. let list = common_vendor.ref([]);
  32. common_vendor.computed(() => {
  33. return aData.authCheck.includes("2") ? true : false;
  34. });
  35. const getList = () => {
  36. services_ams.getActivity(appid).then((res) => {
  37. aData = res.data[0] || {};
  38. aData.authCheck = aData.authCheck.split(",");
  39. list.value = aData.discounts.map((item) => {
  40. return {
  41. ...item,
  42. checked: false
  43. };
  44. });
  45. console.log("---------------------", aData);
  46. }).catch((err) => {
  47. console.log(err);
  48. });
  49. };
  50. const handledUpload = () => {
  51. common_vendor.index.getLocation({
  52. type: "gcj02",
  53. success: async (res) => {
  54. const { latitude, longitude } = res;
  55. const key = "7c607ea6b491804270ddcdd72daad58c";
  56. const url = `https://restapi.amap.com/v3/geocode/regeo?key=${key}&location=${longitude},${latitude}`;
  57. await common_vendor.index.request({ url });
  58. console.log("用户所在位置", res);
  59. },
  60. fail: (err) => {
  61. common_vendor.index.showToast({
  62. title: "获取位置失败",
  63. icon: "none"
  64. });
  65. }
  66. });
  67. };
  68. common_vendor.onShow(() => {
  69. getList();
  70. });
  71. return (_ctx, _cache) => {
  72. return {
  73. a: backImage.value,
  74. b: common_vendor.o(($event) => common_vendor.isRef(showDesc) ? showDesc.value = true : showDesc = true),
  75. c: common_vendor.unref(pagesOne_winner_utils_source.imgObj).rule,
  76. d: common_vendor.o(($event) => _ctx.showWinner = true),
  77. e: common_vendor.unref(pagesOne_winner_utils_source.imgObj).record,
  78. f: common_vendor.unref(pagesOne_winner_utils_source.imgObj).photo,
  79. g: common_vendor.o(($event) => common_vendor.isRef(showExample) ? showExample.value = true : showExample = true),
  80. h: common_vendor.unref(pagesOne_winner_utils_source.imgObj).book,
  81. i: common_vendor.o(($event) => common_vendor.isRef(showRecord) ? showRecord.value = true : showRecord = true),
  82. j: common_vendor.unref(pagesOne_winner_utils_source.gifObj).pointer,
  83. k: common_vendor.o(handledUpload),
  84. l: common_vendor.f(common_vendor.unref(list), (item, k0, i0) => {
  85. return {
  86. a: common_vendor.t(item.cashbackAmount),
  87. b: common_vendor.t(item.thresholdAmount),
  88. c: common_vendor.t(item.cashbackAmount),
  89. d: item.id
  90. };
  91. }),
  92. m: common_vendor.p({
  93. ["bg-color"]: "transparent"
  94. }),
  95. n: common_vendor.o(($event) => common_vendor.isRef(showExample) ? showExample.value = $event : showExample = $event),
  96. o: common_vendor.p({
  97. show: common_vendor.unref(showExample)
  98. }),
  99. p: common_vendor.o(($event) => common_vendor.isRef(showUpload) ? showUpload.value = $event : showUpload = $event),
  100. q: common_vendor.p({
  101. list: common_vendor.unref(list),
  102. show: common_vendor.unref(showUpload)
  103. }),
  104. r: common_vendor.o(($event) => common_vendor.isRef(showWiner) ? showWiner.value = $event : showWiner = $event),
  105. s: common_vendor.p({
  106. show: common_vendor.unref(showWiner)
  107. }),
  108. t: common_vendor.o(($event) => common_vendor.isRef(showRecord) ? showRecord.value = $event : showRecord = $event),
  109. v: common_vendor.p({
  110. show: common_vendor.unref(showRecord)
  111. }),
  112. w: common_vendor.o(($event) => common_vendor.isRef(showDesc) ? showDesc.value = $event : showDesc = $event),
  113. x: common_vendor.p({
  114. show: common_vendor.unref(showDesc)
  115. })
  116. };
  117. };
  118. }
  119. });
  120. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3457e999"]]);
  121. wx.createPage(MiniProgramPage);