index.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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, marketingActivityId: aData.id }).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, marketingActivityId: aData.id }).then(
  67. (res) => {
  68. winnerData.value = res.rows;
  69. }
  70. );
  71. };
  72. const showWinerRecord = () => {
  73. getWinnerList();
  74. showWiner.value = true;
  75. };
  76. const onBack = () => {
  77. common_vendor.index.navigateBack({ delta: 1 });
  78. };
  79. const handledUpload = () => {
  80. showUpload.value = true;
  81. };
  82. common_vendor.onShow(() => {
  83. getList();
  84. });
  85. common_vendor.ref(0);
  86. common_vendor.onLoad(() => {
  87. });
  88. return (_ctx, _cache) => {
  89. return {
  90. a: common_vendor.unref(utils_system.getStatusBarHeight)() + "px",
  91. b: common_vendor.o(onBack),
  92. c: common_vendor.p({
  93. name: "thin-arrow-left",
  94. size: "44rpx",
  95. color: "#000"
  96. }),
  97. d: common_vendor.unref(utils_system.getNavBarPaddingTop)() + "px",
  98. e: backImage.value,
  99. f: common_vendor.o(($event) => common_vendor.isRef(showDesc) ? showDesc.value = true : showDesc = true),
  100. g: common_vendor.unref(pagesOne_winner_utils_source.imgObj).rule,
  101. h: common_vendor.unref(pagesOne_winner_utils_source.imgObj).record,
  102. i: common_vendor.o(showWinerRecord),
  103. j: common_vendor.unref(pagesOne_winner_utils_source.imgObj).photo,
  104. k: common_vendor.o(($event) => common_vendor.isRef(showExample) ? showExample.value = true : showExample = true),
  105. l: common_vendor.unref(pagesOne_winner_utils_source.imgObj).book,
  106. m: common_vendor.o(showUploadRecord),
  107. n: common_vendor.unref(pagesOne_winner_utils_source.gifObj).pointer,
  108. o: common_vendor.o(handledUpload),
  109. p: common_vendor.t(common_vendor.unref(aData).startTime),
  110. q: common_vendor.t(common_vendor.unref(aData).endTime),
  111. r: common_vendor.f(common_vendor.unref(list), (item, k0, i0) => {
  112. return {
  113. a: common_vendor.t(item.cashbackAmount),
  114. b: common_vendor.t(item.thresholdAmount),
  115. c: common_vendor.t(item.cashbackAmount),
  116. d: item.id
  117. };
  118. }),
  119. s: common_vendor.p({
  120. ["bg-color"]: "transparent"
  121. }),
  122. t: common_vendor.o(($event) => common_vendor.isRef(showExample) ? showExample.value = $event : showExample = $event),
  123. v: common_vendor.p({
  124. show: common_vendor.unref(showExample)
  125. }),
  126. w: common_vendor.unref(aData).id,
  127. x: common_vendor.o(($event) => common_vendor.isRef(showUpload) ? showUpload.value = $event : showUpload = $event),
  128. y: common_vendor.p({
  129. list: common_vendor.unref(list),
  130. id: common_vendor.unref(aData).id,
  131. show: common_vendor.unref(showUpload)
  132. }),
  133. z: common_vendor.o(($event) => common_vendor.isRef(showWiner) ? showWiner.value = $event : showWiner = $event),
  134. A: common_vendor.p({
  135. list: winnerData.value,
  136. show: common_vendor.unref(showWiner)
  137. }),
  138. B: common_vendor.o(($event) => common_vendor.isRef(showRecord) ? showRecord.value = $event : showRecord = $event),
  139. C: common_vendor.p({
  140. list: rewardData.value,
  141. show: common_vendor.unref(showRecord)
  142. }),
  143. D: common_vendor.o(($event) => common_vendor.isRef(showDesc) ? showDesc.value = $event : showDesc = $event),
  144. E: common_vendor.p({
  145. description: common_vendor.unref(aData).description,
  146. show: common_vendor.unref(showDesc)
  147. })
  148. };
  149. };
  150. }
  151. });
  152. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3457e999"]]);
  153. wx.createPage(MiniProgramPage);