detail.js 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. require("../../../sheep/index.js");
  4. const sheep_api_promotion_bargain = require("../../../sheep/api/promotion/bargain.js");
  5. require("../../../sheep/api/index.js");
  6. require("../../../sheep/api/distri/score.js");
  7. require("../../../sheep/request/index.js");
  8. require("../../../sheep/config/index.js");
  9. require("../../../sheep/store/index.js");
  10. require("../../../sheep/store/app.js");
  11. require("../../../sheep/api/promotion/diy.js");
  12. require("../../../sheep/platform/index.js");
  13. require("../../../sheep/platform/provider/wechat/index.js");
  14. require("../../../sheep/platform/provider/wechat/miniProgram.js");
  15. require("../../../sheep/api/member/auth.js");
  16. require("../../../sheep/api/member/social.js");
  17. require("../../../sheep/api/member/user.js");
  18. require("../../../sheep/platform/provider/apple/index.js");
  19. require("../../../sheep/platform/share.js");
  20. require("../../../sheep/router/index.js");
  21. require("../../../sheep/hooks/useModal.js");
  22. require("../../../sheep/helper/index.js");
  23. require("../../../sheep/helper/test.js");
  24. require("../../../sheep/helper/digit.js");
  25. require("../../../sheep/api/member/signin.js");
  26. require("../../../sheep/helper/throttle.js");
  27. require("../../../sheep/url/index.js");
  28. require("../../../sheep/platform/pay.js");
  29. require("../../../sheep/api/pay/order.js");
  30. require("../../../sheep/store/user.js");
  31. require("../../../sheep/store/cart.js");
  32. require("../../../sheep/api/trade/cart.js");
  33. require("../../../sheep/api/pay/wallet.js");
  34. require("../../../sheep/api/trade/order.js");
  35. require("../../../sheep/api/promotion/coupon.js");
  36. require("../../../sheep/store/sys.js");
  37. require("../../../sheep/store/modal.js");
  38. require("../../../sheep/api/distri/share.js");
  39. require("../../../sheep/api/distri/team.js");
  40. require("../../../sheep/api/infra/file.js");
  41. require("../../../sheep/api/member/address.js");
  42. require("../../../sheep/api/member/point.js");
  43. require("../../../sheep/api/migration/app.js");
  44. require("../../../sheep/api/migration/chat.js");
  45. require("../../../sheep/api/migration/index.js");
  46. require("../../../sheep/api/migration/third.js");
  47. require("../../../sheep/api/pay/channel.js");
  48. require("../../../sheep/api/product/category.js");
  49. require("../../../sheep/api/product/comment.js");
  50. require("../../../sheep/api/product/favorite.js");
  51. require("../../../sheep/api/product/history.js");
  52. require("../../../sheep/api/product/spu.js");
  53. require("../../../sheep/api/promotion/activity.js");
  54. require("../../../sheep/api/promotion/article.js");
  55. require("../../../sheep/api/promotion/combination.js");
  56. require("../../../sheep/api/promotion/rewardActivity.js");
  57. require("../../../sheep/api/promotion/seckill.js");
  58. require("../../../sheep/api/system/area.js");
  59. require("../../../sheep/api/system/voice.js");
  60. require("../../../sheep/api/trade/afterSale.js");
  61. require("../../../sheep/api/trade/brokerage.js");
  62. require("../../../sheep/api/trade/config.js");
  63. require("../../../sheep/api/trade/delivery.js");
  64. require("../../../sheep/config/zIndex.js");
  65. if (!Array) {
  66. const _easycom_s_count_down2 = common_vendor.resolveComponent("s-count-down");
  67. const _easycom_s_layout2 = common_vendor.resolveComponent("s-layout");
  68. (_easycom_s_count_down2 + _easycom_s_layout2)();
  69. }
  70. const _easycom_s_count_down = () => "../../../sheep/components/s-count-down/s-count-down.js";
  71. const _easycom_s_layout = () => "../../../sheep/components/s-layout/s-layout.js";
  72. if (!Math) {
  73. (_easycom_s_count_down + _easycom_s_layout)();
  74. }
  75. const _sfc_main = {
  76. __name: "detail",
  77. setup(__props) {
  78. const state = common_vendor.reactive({
  79. id: "",
  80. buyPrice: "",
  81. bargainInfo: {},
  82. bgColor: {
  83. "bgColor": "#333333",
  84. "Color": "#fff",
  85. "width": "44rpx",
  86. "timeTxtwidth": "16rpx",
  87. "isDay": true
  88. },
  89. bargainUserHelpList: [],
  90. couponsHidden: true
  91. });
  92. async function getBargainDetails() {
  93. let {
  94. data,
  95. code
  96. } = await sheep_api_promotion_bargain.BargainApi.getBargainActivityDetail({
  97. id: state.id
  98. });
  99. if (code == 0) {
  100. state.bargainInfo = data;
  101. state.buyPrice = state.bargainInfo.bargainFirstPrice;
  102. }
  103. }
  104. common_vendor.onLoad(function(options) {
  105. if (options.hasOwnProperty("id")) {
  106. options.id ? state.id = options.id : state.id = "";
  107. }
  108. getBargainDetails();
  109. });
  110. function fen2yuan(price) {
  111. return (price / 100).toFixed(2);
  112. }
  113. return (_ctx, _cache) => {
  114. return common_vendor.e({
  115. a: state.bargainInfo.picUrl,
  116. b: common_vendor.t(state.bargainInfo.name),
  117. c: common_vendor.t(fen2yuan(state.bargainInfo.bargainMinPrice)),
  118. d: common_vendor.t(state.bargainInfo.stock),
  119. e: common_vendor.t(state.bargainInfo.unitName),
  120. f: common_vendor.t(fen2yuan(state.buyPrice)),
  121. g: state.bargainInfo.endTime > (/* @__PURE__ */ new Date()).getTime() && state.bargainInfo.stock > 0
  122. }, state.bargainInfo.endTime > (/* @__PURE__ */ new Date()).getTime() && state.bargainInfo.stock > 0 ? {
  123. h: common_vendor.p({
  124. tipText: " ",
  125. bgColor: state.bgColor,
  126. dayText: ":",
  127. hourText: ":",
  128. minuteText: ":",
  129. secondText: " ",
  130. datatime: state.bargainInfo.endTime / 1e3,
  131. isDay: true
  132. })
  133. } : state.bargainInfo.endTime <= (/* @__PURE__ */ new Date()).getTime() ? {
  134. j: common_vendor.o((...args) => _ctx.currentBargainUser && _ctx.currentBargainUser(...args))
  135. } : state.bargainInfo.stock <= 0 ? {
  136. l: common_vendor.o((...args) => _ctx.currentBargainUser && _ctx.currentBargainUser(...args))
  137. } : {}, {
  138. i: state.bargainInfo.endTime <= (/* @__PURE__ */ new Date()).getTime(),
  139. k: state.bargainInfo.stock <= 0,
  140. m: common_vendor.o((...args) => _ctx.goProduct && _ctx.goProduct(...args)),
  141. n: state.bargainUserHelpList.length > 0
  142. }, state.bargainUserHelpList.length > 0 ? common_vendor.e({
  143. o: _ctx.index < 3 || !state.couponsHidden
  144. }, _ctx.index < 3 || !state.couponsHidden ? {
  145. p: common_vendor.f(state.bargainUserHelpList, (item, index, i0) => {
  146. return {
  147. a: item.avatar,
  148. b: common_vendor.t(item.nickname),
  149. c: common_vendor.t(_ctx.formatDate(item.createTime)),
  150. d: common_vendor.t(fen2yuan(item.reducePrice)),
  151. e: index
  152. };
  153. })
  154. } : {}, {
  155. q: state.bargainUserHelpList.length > 3
  156. }, state.bargainUserHelpList.length > 3 ? {
  157. r: common_vendor.t(state.couponsHidden ? "展开更多" : "关闭展开"),
  158. s: common_vendor.n(state.couponsHidden ? "icon-xiangxia" : "icon-xiangshang"),
  159. t: common_vendor.o((...args) => _ctx.openTap && _ctx.openTap(...args))
  160. } : {}) : {}, {
  161. v: state.bargainUserHelpList.length === 0
  162. }, state.bargainUserHelpList.length === 0 ? {} : {}, {
  163. w: common_vendor.p({
  164. title: "砍价详情"
  165. })
  166. });
  167. };
  168. }
  169. };
  170. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-6d33792e"], ["__file", "D:/zx/mall-front-app/pages/activity/bargain/detail.vue"]]);
  171. wx.createPage(MiniProgramPage);