detail.js 5.8 KB

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