"use strict"; const common_vendor = require("../../../common/vendor.js"); const sheep_index = require("../../../sheep/index.js"); const sheep_hooks_useGoods = require("../../../sheep/hooks/useGoods.js"); const sheep_hooks_useModal = require("../../../sheep/hooks/useModal.js"); const sheep_api_promotion_combination = require("../../../sheep/api/promotion/combination.js"); require("../../../sheep/api/index.js"); require("../../../sheep/api/distri/score.js"); require("../../../sheep/request/index.js"); require("../../../sheep/config/index.js"); require("../../../sheep/store/index.js"); require("../../../sheep/store/app.js"); require("../../../sheep/api/promotion/diy.js"); require("../../../sheep/platform/index.js"); require("../../../sheep/platform/provider/wechat/index.js"); require("../../../sheep/platform/provider/wechat/miniProgram.js"); require("../../../sheep/api/member/auth.js"); require("../../../sheep/api/member/social.js"); require("../../../sheep/api/member/user.js"); require("../../../sheep/platform/provider/apple/index.js"); require("../../../sheep/platform/share.js"); require("../../../sheep/router/index.js"); require("../../../sheep/helper/throttle.js"); require("../../../sheep/url/index.js"); require("../../../sheep/platform/pay.js"); require("../../../sheep/helper/index.js"); require("../../../sheep/helper/test.js"); require("../../../sheep/helper/digit.js"); require("../../../sheep/api/pay/order.js"); require("../../../sheep/store/user.js"); require("../../../sheep/store/cart.js"); require("../../../sheep/api/trade/cart.js"); require("../../../sheep/api/pay/wallet.js"); require("../../../sheep/api/trade/order.js"); require("../../../sheep/api/promotion/coupon.js"); require("../../../sheep/store/sys.js"); require("../../../sheep/store/modal.js"); require("../../../sheep/api/distri/share.js"); require("../../../sheep/api/distri/team.js"); require("../../../sheep/api/infra/file.js"); require("../../../sheep/api/member/address.js"); require("../../../sheep/api/member/point.js"); require("../../../sheep/api/member/signin.js"); require("../../../sheep/api/migration/app.js"); require("../../../sheep/api/migration/chat.js"); require("../../../sheep/api/migration/index.js"); require("../../../sheep/api/migration/third.js"); require("../../../sheep/api/pay/channel.js"); require("../../../sheep/api/product/category.js"); require("../../../sheep/api/product/comment.js"); require("../../../sheep/api/product/favorite.js"); require("../../../sheep/api/product/history.js"); require("../../../sheep/api/product/spu.js"); require("../../../sheep/api/promotion/activity.js"); require("../../../sheep/api/promotion/article.js"); require("../../../sheep/api/promotion/bargain.js"); require("../../../sheep/api/promotion/rewardActivity.js"); require("../../../sheep/api/promotion/seckill.js"); require("../../../sheep/api/system/area.js"); require("../../../sheep/api/system/voice.js"); require("../../../sheep/api/trade/afterSale.js"); require("../../../sheep/api/trade/brokerage.js"); require("../../../sheep/api/trade/config.js"); require("../../../sheep/api/trade/delivery.js"); require("../../../sheep/config/zIndex.js"); require("../../../sheep/util/index.js"); if (!Array) { const _easycom_s_goods_item2 = common_vendor.resolveComponent("s-goods-item"); const _easycom_s_select_groupon_sku2 = common_vendor.resolveComponent("s-select-groupon-sku"); const _easycom_s_empty2 = common_vendor.resolveComponent("s-empty"); const _easycom_s_layout2 = common_vendor.resolveComponent("s-layout"); (_easycom_s_goods_item2 + _easycom_s_select_groupon_sku2 + _easycom_s_empty2 + _easycom_s_layout2)(); } const _easycom_s_goods_item = () => "../../../sheep/components/s-goods-item/s-goods-item.js"; const _easycom_s_select_groupon_sku = () => "../../../sheep/components/s-select-groupon-sku/s-select-groupon-sku.js"; const _easycom_s_empty = () => "../../../sheep/components/s-empty/s-empty.js"; const _easycom_s_layout = () => "../../../sheep/components/s-layout/s-layout.js"; if (!Math) { (_easycom_s_goods_item + _easycom_s_select_groupon_sku + _easycom_s_empty + _easycom_s_layout)(); } const _sfc_main = { __name: "detail", setup(__props) { common_vendor.useCssVars((_ctx) => ({ "37930634": common_vendor.unref(headerBg) })); const headerBg = sheep_index.sheep.$url.css("/static/img/shop/user/withdraw_bg.png"); const statusBarHeight = sheep_index.sheep.$platform.device.statusBarHeight * 2; const state = common_vendor.reactive({ data: {}, // 拼团详情 loading: true, grouponAction: "create", showSelectSku: false, grouponNum: 0, number: 0, activity: {}, combinationHeadId: null // 拼团团长编号 }); const shareInfo = common_vendor.computed(() => { var _a, _b, _c; if (common_vendor.lodashExports.isEmpty(state.data)) return {}; return sheep_index.sheep.$platform.share.getShareInfo( { title: state.data.headRecord.spuName, image: sheep_index.sheep.$url.cdn(state.data.headRecord.picUrl), desc: (_a = state.data.goods) == null ? void 0 : _a.subtitle, params: { page: "5", query: state.data.id } }, { type: "groupon", // 邀请拼团海报 title: state.data.headRecord.spuName, // 商品标题 image: sheep_index.sheep.$url.cdn(state.data.headRecord.picUrl), // 商品主图 price: (_b = state.data.goods) == null ? void 0 : _b.price, // 商品价格 original_price: (_c = state.data.goods) == null ? void 0 : _c.original_price // 商品原价 } ); }); function onDetail(orderId) { sheep_index.sheep.$router.go("/pages/order/detail", { id: orderId }); } function onCreateGroupon() { state.grouponAction = "create"; state.grouponId = 0; state.showSelectSku = true; } function onSkuChange(e) { state.selectedSkuPrice = e; } function onJoinGroupon() { state.grouponAction = "join"; state.grouponId = state.data.activityId; state.combinationHeadId = state.data.id; state.grouponNum = state.data.num; state.showSelectSku = true; } function onBuy(sku) { sheep_index.sheep.$router.go("/pages/order/confirm", { data: JSON.stringify({ order_type: "goods", combinationActivityId: state.data.activity.id, combinationHeadId: state.combinationHeadId, items: [ { skuId: sku.id, count: sku.count } ] }) }); } const endTime = common_vendor.computed(() => { return sheep_hooks_useGoods.useDurationTime(state.data.headRecord.expireTime); }); async function getGrouponDetail(id) { const { code, data } = await sheep_api_promotion_combination.CombinationApi.getCombinationRecordDetail(id); if (code === 0) { state.data = data; const remainNumber = Number(state.data.headRecord.userSize - state.data.headRecord.userCount); state.remainNumber = remainNumber > 0 ? remainNumber : 0; const { data: activity } = await sheep_api_promotion_combination.CombinationApi.getCombinationActivity(data.headRecord.activityId); state.activity = activity; } else { state.data = null; } state.loading = false; } function onShare() { sheep_hooks_useModal.showShareModal(); } common_vendor.onLoad((options) => { getGrouponDetail(options.id); }); return (_ctx, _cache) => { return common_vendor.e({ a: state.loading }, state.loading ? {} : {}, { b: state.data && !state.loading }, state.data && !state.loading ? common_vendor.e({ c: state.data.headRecord }, state.data.headRecord ? { d: common_vendor.t(state.data.headRecord.userSize), e: common_vendor.t(state.data.headRecord.userCount), f: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/goods/groupon", { id: state.data.headRecord.activityId })), g: common_vendor.s({ top: Number(statusBarHeight + 108) + "rpx" }), h: common_vendor.p({ img: state.data.headRecord.picUrl, title: state.data.headRecord.spuName, price: state.data.headRecord.combinationPrice, priceColor: "#E1212B" }), i: common_vendor.s({ marginTop: "-" + Number(statusBarHeight + 88) + "rpx", paddingTop: Number(statusBarHeight + 108) + "rpx" }) } : {}, { j: state.data.headRecord.status === 1 }, state.data.headRecord.status === 1 ? common_vendor.e({ k: state.data.orderId }, state.data.orderId ? {} : {}) : {}, { l: state.data.headRecord.status === 2 }, state.data.headRecord.status === 2 ? { m: common_vendor.t(state.data.orderId ? "拼团超时,已自动退款" : "该团已解散") } : {}, { n: state.data.headRecord.status === 0 }, state.data.headRecord.status === 0 ? common_vendor.e({ o: state.data.headRecord.expireTime <= (/* @__PURE__ */ new Date()).getTime() }, state.data.headRecord.expireTime <= (/* @__PURE__ */ new Date()).getTime() ? {} : { p: common_vendor.t(state.data.headRecord.userSize - state.data.headRecord.userCount), q: common_vendor.t(endTime.value.h), r: common_vendor.t(endTime.value.m), s: common_vendor.t(endTime.value.s) }) : {}, { t: common_vendor.unref(sheep_index.sheep).$url.cdn(state.data.headRecord.avatar), v: common_vendor.f(state.data.memberRecords, (item, k0, i0) => { return common_vendor.e({ a: common_vendor.unref(sheep_index.sheep).$url.cdn(item.avatar), b: item.is_leader == "1" }, item.is_leader == "1" ? {} : {}, { c: item.id }); }), w: common_vendor.f(state.remainNumber, (item, k0, i0) => { return { a: item }; }), x: common_vendor.unref(sheep_index.sheep).$url.static("/static/images/unknown.png"), y: state.data.headRecord.status === 1 || state.data.headRecord.status === 2 }, state.data.headRecord.status === 1 || state.data.headRecord.status === 2 ? common_vendor.e({ z: state.data.orderId }, state.data.orderId ? { A: common_vendor.o(($event) => onDetail(state.data.orderId)) } : { B: common_vendor.o(onCreateGroupon) }) : {}, { C: state.data.headRecord.status === 0 }, state.data.headRecord.status === 0 ? common_vendor.e({ D: state.data.headRecord.expireTime <= (/* @__PURE__ */ new Date()).getTime() }, state.data.headRecord.expireTime <= (/* @__PURE__ */ new Date()).getTime() ? common_vendor.e({ E: state.data.orderId }, state.data.orderId ? { F: common_vendor.o(($event) => onDetail(state.data.orderId)) } : { G: common_vendor.o(($event) => onDetail(state.data.orderId)) }) : common_vendor.e({ H: state.data.orderId }, state.data.orderId ? { I: endTime.value.ms <= 0, J: common_vendor.o(onShare) } : { K: endTime.value.ms <= 0, L: common_vendor.o(($event) => onJoinGroupon()) })) : {}, { M: state.data.goods }, state.data.goods ? { N: common_vendor.o(onBuy), O: common_vendor.o(onSkuChange), P: common_vendor.o(($event) => state.showSelectSku = false), Q: common_vendor.p({ show: state.showSelectSku, goodsInfo: state.data.goods, grouponAction: state.grouponAction, grouponNum: state.grouponNum }) } : {}) : {}, { R: !state.data && !state.loading }, !state.data && !state.loading ? { S: common_vendor.p({ icon: "/static/goods-empty.png" }) } : {}, { T: common_vendor.s(_ctx.__cssVars()), U: common_vendor.p({ title: "拼团详情", navbar: state.data && !state.loading ? "inner" : "normal", onShareAppMessage: shareInfo.value }) }); }; } }; const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f4b0e588"], ["__file", "D:/zx/mall-front-app/pages/activity/groupon/detail.vue"]]); _sfc_main.__runtimeHooks = 2; wx.createPage(MiniProgramPage);