su-coupon.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const sheep_index = require("../../index.js");
  4. require("../../api/index.js");
  5. require("../../api/distri/score.js");
  6. require("../../request/index.js");
  7. require("../../config/index.js");
  8. require("../../store/index.js");
  9. require("../../store/app.js");
  10. require("../../api/promotion/diy.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("../../url/index.js");
  27. require("../../platform/pay.js");
  28. require("../../api/pay/order.js");
  29. require("../../store/user.js");
  30. require("../../store/cart.js");
  31. require("../../api/trade/cart.js");
  32. require("../../api/pay/wallet.js");
  33. require("../../api/trade/order.js");
  34. require("../../api/promotion/coupon.js");
  35. require("../../store/sys.js");
  36. require("../../store/modal.js");
  37. require("../../api/distri/share.js");
  38. require("../../api/distri/team.js");
  39. require("../../api/infra/file.js");
  40. require("../../api/member/address.js");
  41. require("../../api/member/point.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. const _sfc_main = {
  66. __name: "su-coupon",
  67. props: {
  68. size: {
  69. type: String,
  70. default: "lg"
  71. },
  72. textColor: {
  73. type: String,
  74. default: "#FF6000"
  75. },
  76. background: {
  77. type: String,
  78. default: "#FFC19C"
  79. },
  80. btnBg: {
  81. type: String,
  82. default: "#fff"
  83. },
  84. btnTextColor: {
  85. type: String,
  86. default: "#FF6000"
  87. },
  88. state: {
  89. type: Number,
  90. default: 0
  91. },
  92. couponId: {
  93. type: Number,
  94. default: 0
  95. },
  96. title: {
  97. type: String,
  98. default: "这是优惠券"
  99. },
  100. value: {
  101. type: [Number, String],
  102. default: 50
  103. },
  104. sellBy: {
  105. type: String,
  106. default: "2019.11.25至2019.12.25"
  107. },
  108. surplus: {
  109. type: [Number, String],
  110. default: 0
  111. },
  112. type: {
  113. type: String,
  114. default: ""
  115. }
  116. },
  117. setup(__props) {
  118. common_vendor.useCssVars((_ctx) => ({
  119. "c1c89bcc": __props.textColor,
  120. "66b278d6": __props.btnTextColor,
  121. "babd14b6": __props.btnBg
  122. }));
  123. const state = common_vendor.reactive({
  124. stateMap: {
  125. 0: "立即领取",
  126. 1: "去使用"
  127. }
  128. });
  129. const props = __props;
  130. const cardStyle = common_vendor.computed(() => {
  131. return {
  132. background: props.background
  133. };
  134. });
  135. return (_ctx, _cache) => {
  136. return common_vendor.e({
  137. a: props.size === "xs"
  138. }, props.size === "xs" ? {
  139. b: common_vendor.t(__props.type === "reduce" ? __props.value : Number(__props.value)),
  140. c: common_vendor.t(__props.type === "reduce" ? "元" : "折"),
  141. d: common_vendor.t(props.title),
  142. e: common_vendor.t(state.stateMap[props.state]),
  143. f: common_vendor.s(cardStyle.value),
  144. g: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/coupon/detail", {
  145. id: __props.couponId
  146. }))
  147. } : {}, {
  148. h: props.size === "md"
  149. }, props.size === "md" ? common_vendor.e({
  150. i: common_vendor.t(__props.type === "reduce" ? __props.value : Number(__props.value)),
  151. j: common_vendor.t(__props.type === "reduce" ? "元" : "折"),
  152. k: common_vendor.t(props.title),
  153. l: props.surplus
  154. }, props.surplus ? {
  155. m: common_vendor.t(props.surplus)
  156. } : {}, {
  157. n: common_vendor.t(state.stateMap[props.state]),
  158. o: common_vendor.s(cardStyle.value),
  159. p: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/coupon/detail", {
  160. id: __props.couponId
  161. }))
  162. }) : {}, {
  163. q: props.size === "lg"
  164. }, props.size === "lg" ? common_vendor.e({
  165. r: common_vendor.t(__props.type === "reduce" ? __props.value : Number(__props.value)),
  166. s: common_vendor.t(__props.type === "reduce" ? "元" : "折"),
  167. t: common_vendor.t(props.title),
  168. v: common_vendor.t(props.sellBy),
  169. w: common_vendor.t(state.stateMap[props.state]),
  170. x: props.surplus
  171. }, props.surplus ? {
  172. y: common_vendor.t(props.surplus)
  173. } : {}, {
  174. z: common_vendor.s(cardStyle.value),
  175. A: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/coupon/detail", {
  176. id: __props.couponId
  177. }))
  178. }) : {}, {
  179. B: common_vendor.s(_ctx.__cssVars())
  180. });
  181. };
  182. }
  183. };
  184. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-34099896"], ["__file", "D:/zx/mall-front-app/sheep/ui/su-coupon/su-coupon.vue"]]);
  185. wx.createComponent(Component);