index.js 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const utils_system = require("../../utils/system.js");
  4. const pagesOne_winner_utils_source = require("./utils/source.js");
  5. const services_ams = require("../../services/ams.js");
  6. if (!Array) {
  7. const _easycom_wd_icon2 = common_vendor.resolveComponent("wd-icon");
  8. const _easycom_wd_gap2 = common_vendor.resolveComponent("wd-gap");
  9. (_easycom_wd_icon2 + _easycom_wd_gap2)();
  10. }
  11. const _easycom_wd_icon = () => "../../node-modules/wot-design-uni/components/wd-icon/wd-icon.js";
  12. const _easycom_wd_gap = () => "../../node-modules/wot-design-uni/components/wd-gap/wd-gap.js";
  13. if (!Math) {
  14. (_easycom_wd_icon + _easycom_wd_gap + PhotoExamplePopup + UploadReceptPopop + WinRecordPopup + UploadRecordPopup + ActivityDescPopup)();
  15. }
  16. const PhotoExamplePopup = () => "./components/photoExamplePopup.js";
  17. const UploadReceptPopop = () => "./components/uploadReceptPopop.js";
  18. const WinRecordPopup = () => "./components/winRecordPopup.js";
  19. const UploadRecordPopup = () => "./components/uploadRecordPopup.js";
  20. const ActivityDescPopup = () => "./components/activityDescPopup.js";
  21. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  22. __name: "index",
  23. setup(__props) {
  24. let showExample = common_vendor.ref(false);
  25. let showUpload = common_vendor.ref(false);
  26. let showWiner = common_vendor.ref(false);
  27. let showRecord = common_vendor.ref(false);
  28. let showDesc = common_vendor.ref(false);
  29. const appid = common_vendor.index.getStorageSync("appid");
  30. const backImage = common_vendor.ref("");
  31. let aData = common_vendor.reactive({ discounts: [] });
  32. let list = common_vendor.ref([]);
  33. const openid = common_vendor.index.getStorageSync("openid");
  34. common_vendor.computed(() => {
  35. return aData.authCheck.includes("2") ? true : false;
  36. });
  37. const getList = () => {
  38. services_ams.getActivity(appid).then((res) => {
  39. aData = res.data[0] || {};
  40. aData.authCheck = aData.authCheck.split(",");
  41. list.value = aData.discounts.map((item) => {
  42. return {
  43. ...item,
  44. checked: false
  45. };
  46. });
  47. common_vendor.index.setStorageSync("activityData", JSON.stringify(aData));
  48. backImage.value = res.data[0].activityImage;
  49. }).catch((err) => {
  50. console.log(err);
  51. });
  52. };
  53. const rewardData = common_vendor.ref([]);
  54. const getRewardList = () => {
  55. console.log("openid", openid);
  56. services_ams.rewardList({ openid }).then((res) => {
  57. rewardData.value = res.rows;
  58. });
  59. };
  60. const showUploadRecord = () => {
  61. getRewardList();
  62. showRecord.value = true;
  63. };
  64. const winnerData = common_vendor.ref([]);
  65. const getWinnerList = () => {
  66. services_ams.auditSuccessList({ openid }).then((res) => {
  67. winnerData.value = res.rows;
  68. });
  69. };
  70. const showWinerRecord = () => {
  71. getWinnerList();
  72. showWiner.value = true;
  73. };
  74. const onBack = () => {
  75. common_vendor.index.navigateBack({ delta: 1 });
  76. };
  77. const handledUpload = () => {
  78. showUpload.value = true;
  79. };
  80. common_vendor.onShow(() => {
  81. getList();
  82. });
  83. common_vendor.ref(0);
  84. common_vendor.onLoad(() => {
  85. });
  86. return (_ctx, _cache) => {
  87. return {
  88. a: common_vendor.unref(utils_system.getStatusBarHeight)() + "px",
  89. b: common_vendor.o(onBack),
  90. c: common_vendor.p({
  91. name: "thin-arrow-left",
  92. size: "44rpx",
  93. color: "#000"
  94. }),
  95. d: common_vendor.unref(utils_system.getNavBarPaddingTop)() + "px",
  96. e: backImage.value,
  97. f: common_vendor.o(($event) => common_vendor.isRef(showDesc) ? showDesc.value = true : showDesc = true),
  98. g: common_vendor.unref(pagesOne_winner_utils_source.imgObj).rule,
  99. h: common_vendor.unref(pagesOne_winner_utils_source.imgObj).record,
  100. i: common_vendor.o(showWinerRecord),
  101. j: common_vendor.unref(pagesOne_winner_utils_source.imgObj).photo,
  102. k: common_vendor.o(($event) => common_vendor.isRef(showExample) ? showExample.value = true : showExample = true),
  103. l: common_vendor.unref(pagesOne_winner_utils_source.imgObj).book,
  104. m: common_vendor.o(showUploadRecord),
  105. n: common_vendor.unref(pagesOne_winner_utils_source.gifObj).pointer,
  106. o: common_vendor.o(handledUpload),
  107. p: common_vendor.t(common_vendor.unref(aData).startTime),
  108. q: common_vendor.t(common_vendor.unref(aData).endTime),
  109. r: common_vendor.f(common_vendor.unref(list), (item, k0, i0) => {
  110. return {
  111. a: common_vendor.t(item.cashbackAmount),
  112. b: common_vendor.t(item.thresholdAmount),
  113. c: common_vendor.t(item.cashbackAmount),
  114. d: item.id
  115. };
  116. }),
  117. s: common_vendor.p({
  118. ["bg-color"]: "transparent"
  119. }),
  120. t: common_vendor.o(($event) => common_vendor.isRef(showExample) ? showExample.value = $event : showExample = $event),
  121. v: common_vendor.p({
  122. show: common_vendor.unref(showExample)
  123. }),
  124. w: common_vendor.unref(aData).id,
  125. x: common_vendor.o(($event) => common_vendor.isRef(showUpload) ? showUpload.value = $event : showUpload = $event),
  126. y: common_vendor.p({
  127. list: common_vendor.unref(list),
  128. id: common_vendor.unref(aData).id,
  129. show: common_vendor.unref(showUpload)
  130. }),
  131. z: common_vendor.o(($event) => common_vendor.isRef(showWiner) ? showWiner.value = $event : showWiner = $event),
  132. A: common_vendor.p({
  133. list: winnerData.value,
  134. show: common_vendor.unref(showWiner)
  135. }),
  136. B: common_vendor.o(($event) => common_vendor.isRef(showRecord) ? showRecord.value = $event : showRecord = $event),
  137. C: common_vendor.p({
  138. list: rewardData.value,
  139. show: common_vendor.unref(showRecord)
  140. }),
  141. D: common_vendor.o(($event) => common_vendor.isRef(showDesc) ? showDesc.value = $event : showDesc = $event),
  142. E: common_vendor.p({
  143. show: common_vendor.unref(showDesc)
  144. })
  145. };
  146. };
  147. }
  148. });
  149. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3457e999"]]);
  150. wx.createPage(MiniProgramPage);