s-popup-image.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const sheep_index = require("../../index.js");
  4. const sheep_hooks_useModal = require("../../hooks/useModal.js");
  5. require("../../api/index.js");
  6. require("../../api/distri/score.js");
  7. require("../../request/index.js");
  8. require("../../config/index.js");
  9. require("../../store/index.js");
  10. require("../../store/app.js");
  11. require("../../api/promotion/diy.js");
  12. require("../../platform/index.js");
  13. require("../../platform/provider/wechat/index.js");
  14. require("../../platform/provider/wechat/miniProgram.js");
  15. require("../../api/member/auth.js");
  16. require("../../api/member/social.js");
  17. require("../../api/member/user.js");
  18. require("../../platform/provider/apple/index.js");
  19. require("../../platform/share.js");
  20. require("../../router/index.js");
  21. require("../../helper/throttle.js");
  22. require("../../url/index.js");
  23. require("../../platform/pay.js");
  24. require("../../helper/index.js");
  25. require("../../helper/test.js");
  26. require("../../helper/digit.js");
  27. require("../../api/pay/order.js");
  28. require("../../store/user.js");
  29. require("../../store/cart.js");
  30. require("../../api/trade/cart.js");
  31. require("../../api/pay/wallet.js");
  32. require("../../api/trade/order.js");
  33. require("../../api/promotion/coupon.js");
  34. require("../../store/sys.js");
  35. require("../../store/modal.js");
  36. require("../../api/distri/share.js");
  37. require("../../api/distri/team.js");
  38. require("../../api/infra/file.js");
  39. require("../../api/member/address.js");
  40. require("../../api/member/point.js");
  41. require("../../api/member/signin.js");
  42. require("../../api/migration/app.js");
  43. require("../../api/migration/chat.js");
  44. require("../../api/migration/index.js");
  45. require("../../api/migration/third.js");
  46. require("../../api/pay/channel.js");
  47. require("../../api/product/category.js");
  48. require("../../api/product/comment.js");
  49. require("../../api/product/favorite.js");
  50. require("../../api/product/history.js");
  51. require("../../api/product/spu.js");
  52. require("../../api/promotion/activity.js");
  53. require("../../api/promotion/article.js");
  54. require("../../api/promotion/bargain.js");
  55. require("../../api/promotion/combination.js");
  56. require("../../api/promotion/rewardActivity.js");
  57. require("../../api/promotion/seckill.js");
  58. require("../../api/system/area.js");
  59. require("../../api/system/voice.js");
  60. require("../../api/trade/afterSale.js");
  61. require("../../api/trade/brokerage.js");
  62. require("../../api/trade/config.js");
  63. require("../../api/trade/delivery.js");
  64. require("../../config/zIndex.js");
  65. if (!Array) {
  66. const _easycom_su_popup2 = common_vendor.resolveComponent("su-popup");
  67. _easycom_su_popup2();
  68. }
  69. const _easycom_su_popup = () => "../../ui/su-popup/su-popup.js";
  70. if (!Math) {
  71. _easycom_su_popup();
  72. }
  73. const _sfc_main = {
  74. __name: "s-popup-image",
  75. props: {
  76. data: {
  77. type: Object,
  78. default() {
  79. }
  80. }
  81. },
  82. setup(__props) {
  83. const props = __props;
  84. const modalStore = JSON.parse(common_vendor.index.getStorageSync("modal-store") || "{}");
  85. console.log(modalStore);
  86. const advHistory = modalStore.advHistory || [];
  87. const currentIndex = common_vendor.ref(0);
  88. const popupList = common_vendor.computed(() => {
  89. const list = props.data.list || [];
  90. const newList = [];
  91. if (list.length > 0) {
  92. list.forEach((adv) => {
  93. if (adv.showType === "once" && advHistory.includes(adv.imgUrl)) {
  94. adv.isShow = false;
  95. } else {
  96. adv.isShow = true;
  97. newList.push(adv);
  98. }
  99. sheep_hooks_useModal.saveAdvHistory(adv);
  100. });
  101. }
  102. return newList;
  103. });
  104. function onPopup(path) {
  105. sheep_index.sheep.$router.go(path);
  106. }
  107. function onClose(index) {
  108. currentIndex.value = index + 1;
  109. popupList.value[index].isShow = false;
  110. }
  111. return (_ctx, _cache) => {
  112. return {
  113. a: common_vendor.f(popupList.value, (item, index, i0) => {
  114. return common_vendor.e({
  115. a: index === currentIndex.value
  116. }, index === currentIndex.value ? {
  117. b: common_vendor.unref(sheep_index.sheep).$url.cdn(item.imgUrl),
  118. c: common_vendor.o(($event) => onPopup(item.url), index),
  119. d: common_vendor.o(($event) => onClose(index), index),
  120. e: "ef138843-0-" + i0,
  121. f: common_vendor.p({
  122. show: item.isShow,
  123. type: "center",
  124. backgroundColor: "none",
  125. round: "0",
  126. showClose: true,
  127. isMaskClick: false
  128. })
  129. } : {}, {
  130. g: index
  131. });
  132. })
  133. };
  134. };
  135. }
  136. };
  137. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ef138843"], ["__file", "D:/zx/mall-front-app/sheep/components/s-popup-image/s-popup-image.vue"]]);
  138. wx.createComponent(Component);