"use strict"; var common_vendor = require("../common/vendor.js"); var api_order = require("../api/order.js"); var api_live = require("../api/live.js"); require("../common/request.js"); const popupBottom = () => "../components/px-popup-bottom/px-popup-bottom.js"; const _sfc_main = { components: { popupBottom }, data() { return { totalNum: 1, orderKey: null, type: null, liveOrderList: [], liveId: null, serviceList: ["\u514D\u90AE\u53D1\u8D27", "\u836F\u5E08\u670D\u52A1", "\u9690\u79C1\u4FDD\u62A4"], editShow: false, productId: null, goosDetail: {}, loadding: true, buyText: "\u7ACB\u5373\u8D2D\u4E70", showStorePicker: false, goodsNum: 0, productValueSelect: { price: 0, serviceFee: 0 }, attrs: [], values: [], stores: [], storeNames: [], storeIdx: 0, storeName: "", product: { price: 0, otPrice: 0 }, showModal: false, activeBanner: 1, cartCount: 0, specVisible: false, specNum: 1, config: null, showServiceFee: false, selectVal: "", urlStoreId: void 0, storePriceList: [], storeSelectInfo: {}, choseSpecSubIndex: 0, choseSpecIndex: 0 }; }, onLoad(options) { if (options.productId) { this.productId = options.productId; console.log("\u63A5\u6536\u5230\u7684productId:", this.productId); } this.liveId = options.liveId; }, mounted() { this.getliveGoods(); var userInfo = common_vendor.index.getStorageSync("userInfo"); console.log("\u4E4B\u524D\u7684\u6570\u636E\u5728\u8FD9\u91CC", userInfo); }, onShow() { }, methods: { getKey() { api_order.liveOrderKey().then((res) => { if (res.code == 200) { console.log("\u4E0B\u8BA2\u5355\u7684key>>>>", res); this.orderKey = res.orderKey; console.log("key>>>>", this.orderKey); common_vendor.index.navigateTo({ url: "/pages_shop/confirmCreateOrder?orderKey=" + this.orderKey + "&liveId=" + this.liveId + "&productId=" + this.productId + "&totalNum=" + this.totalNum + "&price=" + this.goosDetail.price }); } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } }, (rej) => { }); }, operateOrder(type) { let orderId = this.liveOrderList; console.log("orderId>>", orderId); }, goodsNumChange(e) { console.log("\u5F53\u524D\u9009\u62E9\u5546\u54C1\u6570\u91CF\u4E3A: " + e.value); this.totalNum = e.value; }, submit() { this.specVisible = false; this.getKey(); }, addCart(type) { this.type = type; this.specVisible = true; }, navgetTo(url) { console.log("\u8DF3\u8F6C"); common_vendor.index.navigateTo({ url }); }, openEditMoney() { this.editShow = true; }, getliveGoods() { api_live.liveGoodsDetail(this.productId).then((res) => { if (res.code == 200) { console.log("\u5C0F\u9EC4\u8F66 \u5546\u54C1\u8BE6\u60C5>>>>", res); this.goosDetail = res.data; } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } }, (rej) => { }); } } }; if (!Array) { const _component_uni_badge = common_vendor.resolveComponent("uni-badge"); const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon"); const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup"); const _easycom_u_number_box2 = common_vendor.resolveComponent("u-number-box"); const _component_popupBottom = common_vendor.resolveComponent("popupBottom"); (_component_uni_badge + _easycom_u_icon2 + _easycom_u_popup2 + _easycom_u_number_box2 + _component_popupBottom)(); } const _easycom_u_icon = () => "../uni_modules/uview-plus/components/u-icon/u-icon.js"; const _easycom_u_popup = () => "../uni_modules/uview-plus/components/u-popup/u-popup.js"; const _easycom_u_number_box = () => "../uni_modules/uview-plus/components/u-number-box/u-number-box.js"; if (!Math) { (_easycom_u_icon + _easycom_u_popup + _easycom_u_number_box)(); } function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { var _a; return common_vendor.e({ a: $data.goosDetail.imgUrl, b: $data.product.productType == 2 }, $data.product.productType == 2 ? {} : {}, { c: common_vendor.t($data.goosDetail.price), d: common_vendor.t($data.goosDetail.otPrice), e: common_vendor.t($data.goosDetail.sales), f: common_vendor.f($data.serviceList, (item, index, i0) => { return { a: common_vendor.t(item), b: index }; }), g: common_vendor.o(($event) => $options.openEditMoney()), h: $data.editShow }, $data.editShow ? { i: common_vendor.o(($event) => _ctx.cancelEditMoney()), j: common_vendor.o(($event) => _ctx.cancelEditMoney()), k: common_vendor.o(($event) => _ctx.cancelEditMoney()) } : {}, { l: common_vendor.t(), m: common_vendor.o(($event) => $options.navgetTo("/pages_shop/store?liveId=" + $data.liveId)), n: $data.product.description, o: common_vendor.o(($event) => $options.navgetTo("./store")), p: common_vendor.p({ size: "small", text: $data.cartCount, absolute: "rightTop", type: "error" }), q: common_vendor.o(($event) => $options.navgetTo("./cart")), r: common_vendor.o(($event) => $options.addCart("cart")), s: common_vendor.t($data.buyText), t: common_vendor.o(($event) => $options.addCart("buy")), v: ((_a = $data.goosDetail) == null ? void 0 : _a.imgUrl) || _ctx.$img.img, w: common_vendor.t($data.goosDetail.productName), x: common_vendor.t($data.goosDetail.price ? $data.goosDetail.price.toFixed(2) : "0.00"), y: common_vendor.t($data.goosDetail.sales), z: common_vendor.f($data.storePriceList, (item, index, i0) => { return { a: common_vendor.t(item.price.toFixed(2)), b: common_vendor.t(_ctx.utils.formatSalesNum(item.sales)), c: common_vendor.t(item.storeName), d: "14e5f6c8-3-" + i0 + ",14e5f6c8-2", e: index, f: common_vendor.n($data.productValueSelect.storeId == item.storeId ? "item hover" : "item"), g: common_vendor.o(($event) => _ctx.pickerStore(item, index), index) }; }), A: common_vendor.p({ name: "arrow-right", color: "#000", size: "14" }), B: common_vendor.p({ show: $data.showStorePicker, round: 16, mode: "bottom" }), C: common_vendor.o($options.goodsNumChange), D: common_vendor.o(($event) => $data.goodsNum = $event), E: common_vendor.p({ bgColor: "#ececec", modelValue: $data.goodsNum }), F: common_vendor.o((...args) => $options.submit && $options.submit(...args)), G: common_vendor.sr("popup", "14e5f6c8-1"), H: common_vendor.p({ visible: $data.specVisible, title: " ", radius: "32", maxHeight: "800" }) }); } var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "C:/Users/Administrator/Desktop/\u9879\u76EE/\u76F4\u64AD/liveH5-v3/pages_shop/goods.vue"]]); wx.createPage(MiniProgramPage);