s-coupon-list.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const sheep_hooks_useGoods = require("../../hooks/useGoods.js");
  4. const sheep_index = require("../../index.js");
  5. require("../../url/index.js");
  6. require("../../store/index.js");
  7. require("../../store/app.js");
  8. require("../../api/promotion/diy.js");
  9. require("../../request/index.js");
  10. require("../../config/index.js");
  11. require("../../platform/index.js");
  12. require("../../platform/provider/wechat/index.js");
  13. require("../../platform/provider/wechat/miniProgram.js");
  14. require("../../api/member/auth.js");
  15. require("../../api/member/social.js");
  16. require("../../api/member/user.js");
  17. require("../../platform/provider/apple/index.js");
  18. require("../../platform/share.js");
  19. require("../../router/index.js");
  20. require("../../hooks/useModal.js");
  21. require("../../helper/index.js");
  22. require("../../helper/test.js");
  23. require("../../helper/digit.js");
  24. require("../../api/member/signin.js");
  25. require("../../helper/throttle.js");
  26. require("../../platform/pay.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("../../util/index.js");
  37. require("../../api/index.js");
  38. require("../../api/distri/score.js");
  39. require("../../api/distri/share.js");
  40. require("../../api/distri/team.js");
  41. require("../../api/infra/file.js");
  42. require("../../api/member/address.js");
  43. require("../../api/member/point.js");
  44. require("../../api/migration/app.js");
  45. require("../../api/migration/chat.js");
  46. require("../../api/migration/index.js");
  47. require("../../api/migration/third.js");
  48. require("../../api/pay/channel.js");
  49. require("../../api/product/category.js");
  50. require("../../api/product/comment.js");
  51. require("../../api/product/favorite.js");
  52. require("../../api/product/history.js");
  53. require("../../api/product/spu.js");
  54. require("../../api/promotion/activity.js");
  55. require("../../api/promotion/article.js");
  56. require("../../api/promotion/bargain.js");
  57. require("../../api/promotion/combination.js");
  58. require("../../api/promotion/rewardActivity.js");
  59. require("../../api/promotion/seckill.js");
  60. require("../../api/system/area.js");
  61. require("../../api/system/voice.js");
  62. require("../../api/trade/afterSale.js");
  63. require("../../api/trade/brokerage.js");
  64. require("../../api/trade/config.js");
  65. require("../../api/trade/delivery.js");
  66. require("../../config/zIndex.js");
  67. const _sfc_main = {
  68. __name: "s-coupon-list",
  69. props: {
  70. data: {
  71. type: Object,
  72. default: {}
  73. },
  74. disabled: {
  75. type: Boolean,
  76. default: false
  77. },
  78. type: {
  79. type: String,
  80. default: "coupon"
  81. // coupon 优惠劵模版;user 用户优惠劵
  82. }
  83. },
  84. setup(__props) {
  85. common_vendor.reactive({});
  86. const isDisable = common_vendor.computed(() => {
  87. if (props.type === "coupon") {
  88. return false;
  89. }
  90. return props.data.status !== 1;
  91. });
  92. const props = __props;
  93. return (_ctx, _cache) => {
  94. return common_vendor.e({
  95. a: common_vendor.t(__props.data.discountType === 1 ? "满减券" : "折扣券"),
  96. b: common_vendor.n(isDisable.value ? "disabled-bg-color" : "info-bg-color"),
  97. c: common_vendor.t(__props.data.name),
  98. d: common_vendor.n(isDisable.value ? "disabled-color" : "info-color"),
  99. e: __props.data.discountType === 1
  100. }, __props.data.discountType === 1 ? {} : {}, {
  101. f: common_vendor.t(__props.data.discountType === 1 ? common_vendor.unref(sheep_hooks_useGoods.fen2yuan)(__props.data.discountPrice) : __props.data.discountPercent / 10),
  102. g: __props.data.discountType === 2
  103. }, __props.data.discountType === 2 ? {} : {}, {
  104. h: common_vendor.n(isDisable.value ? "disabled-color" : "price-text"),
  105. i: __props.data.validityType === 2
  106. }, __props.data.validityType === 2 ? {
  107. j: common_vendor.t(__props.data.fixedEndTerm),
  108. k: common_vendor.n(isDisable.value ? "disabled-color" : "subtitle-color")
  109. } : {
  110. l: common_vendor.t(common_vendor.unref(sheep_index.sheep).$helper.timeFormat(__props.data.validStartTime, "yyyy-mm-dd")),
  111. m: common_vendor.t(common_vendor.unref(sheep_index.sheep).$helper.timeFormat(__props.data.validEndTime, "yyyy-mm-dd")),
  112. n: common_vendor.n(isDisable.value ? "disabled-color" : "subtitle-color")
  113. }, {
  114. o: common_vendor.t(common_vendor.unref(sheep_hooks_useGoods.fen2yuan)(__props.data.usePrice)),
  115. p: common_vendor.n(isDisable.value ? "disabled-color" : "subtitle-color"),
  116. q: common_vendor.t(__props.data.description),
  117. r: __props.disabled ? "0.5" : "1"
  118. });
  119. };
  120. }
  121. };
  122. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-81b7b3dc"], ["__file", "D:/zx/mall-front-app/sheep/components/s-coupon-list/s-coupon-list.vue"]]);
  123. wx.createComponent(Component);