"use strict"; const common_vendor = require("../../common/vendor.js"); const api_shop_goods_index = require("../../api/shop/goods/index.js"); const store_modules_car = require("../../store/modules/car.js"); const carStore = store_modules_car.useCarStore(); const { goodsList, orderInfo, totalPrice, carNum, merchantId, merchantName, merchantCode, type, dateTime } = common_vendor.storeToRefs(carStore); const _sfc_main = { data() { return { id: 0, form: {}, // 场馆相册 photo: [], isLogin: false, disabled: true, orderInfo, goodsList, totalPrice, carNum, merchantId, merchantName, merchantCode, type, dateTime, options: [{ icon: "headphones", text: "客服" }, { icon: "cart", text: "购物车", info: 2 }], buttonGroup: [ { text: "立即购买", backgroundColor: "linear-gradient(90deg, #ccff66, #008e04)", color: "#fff" } ], customButtonGroup1: [{ text: "立即购买", backgroundColor: "linear-gradient(90deg, #ccff66, #008e04)", color: "#fff" }] }; }, onLoad(option) { this.id = option.id; this.reload(); }, onShow() { if (common_vendor.index.getStorageSync("user_id") && common_vendor.index.getStorageSync("access_token")) { this.isLogin = true; } }, methods: { async reload() { const app = this; Promise.all([app.getGoods()]).then((data) => { console.log("data: ", data); const form = data[0]; app.form = form; carStore.merchantId = form.merchantId; carStore.merchantName = form.merchantName; carStore.merchantCode = form.merchantCode; common_vendor.index.setNavigationBarTitle({ title: form.goodsName }); if (form.files) { app.photo = JSON.parse(form.files); } }); }, getGoods() { return new Promise((resolve, reject) => { api_shop_goods_index.getGoods(this.id).then((result) => { resolve(result); }).catch(reject); }); }, onDisabled() { this.disabled = !this.disabled; }, navTo(url) { common_vendor.index.navigateTo({ url }); }, openBookingTel() { this.$refs.popup.open("center"); }, closeBookingTel() { this.$refs.popup.close(); }, callPhone(phone) { common_vendor.index.makePhoneCall({ phoneNumber: phone }); }, onMap() { common_vendor.index.getLocation({ type: "gcj02", //返回可以用于uni.openLocation的经纬度 success: function(res) { console.log("返回可以用于uni.openLocation的经纬度: ", res); const latitude = this.merchant.latitude; const longitude = this.merchant.longitude; common_vendor.index.openLocation({ latitude, longitude, success: function() { console.log("success"); } }); } }); }, save() { if (!this.disabled) { common_vendor.index.showToast({ title: "请先阅读并同意订票协议", icon: "none" }); return false; } const app = this; const { form } = this; carStore.totalPrice = form.price; app.goodsList = []; form.image = JSON.parse(form.image)[0]; app.goodsList.push(form); carStore.goodsList = app.goodsList; common_vendor.index.navigateTo({ url: "/package/goods/checkout?goodsId=" + this.id }); } } }; if (!Array) { const _easycom_uv_swiper2 = common_vendor.resolveComponent("uv-swiper"); const _easycom_uv_cell2 = common_vendor.resolveComponent("uv-cell"); const _easycom_uv_cell_group2 = common_vendor.resolveComponent("uv-cell-group"); const _easycom_uni_card2 = common_vendor.resolveComponent("uni-card"); const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons"); const _easycom_uv_gap2 = common_vendor.resolveComponent("uv-gap"); const _easycom_uv_button2 = common_vendor.resolveComponent("uv-button"); const _easycom_uv_icon2 = common_vendor.resolveComponent("uv-icon"); const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup"); const _easycom_ws_login2 = common_vendor.resolveComponent("ws-login"); (_easycom_uv_swiper2 + _easycom_uv_cell2 + _easycom_uv_cell_group2 + _easycom_uni_card2 + _easycom_uni_icons2 + _easycom_uv_gap2 + _easycom_uv_button2 + _easycom_uv_icon2 + _easycom_uni_popup2 + _easycom_ws_login2)(); } const _easycom_uv_swiper = () => "../../uni_modules/uv-swiper/components/uv-swiper/uv-swiper.js"; const _easycom_uv_cell = () => "../../uni_modules/uv-cell/components/uv-cell/uv-cell.js"; const _easycom_uv_cell_group = () => "../../uni_modules/uv-cell/components/uv-cell-group/uv-cell-group.js"; const _easycom_uni_card = () => "../../uni_modules/uni-card/components/uni-card/uni-card.js"; const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js"; const _easycom_uv_gap = () => "../../uni_modules/uv-gap/components/uv-gap/uv-gap.js"; const _easycom_uv_button = () => "../../uni_modules/uv-button/components/uv-button/uv-button.js"; const _easycom_uv_icon = () => "../../uni_modules/uv-icon/components/uv-icon/uv-icon.js"; const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js"; const _easycom_ws_login = () => "../../uni_modules/ws-login/components/ws-login/ws-login.js"; if (!Math) { (_easycom_uv_swiper + _easycom_uv_cell + _easycom_uv_cell_group + _easycom_uni_card + _easycom_uni_icons + _easycom_uv_gap + _easycom_uv_button + _easycom_uv_icon + _easycom_uni_popup + _easycom_ws_login)(); } function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return common_vendor.e({ a: common_vendor.p({ list: $data.photo, indicator: true, indicatorMode: "line", circular: true, height: "750rpx", radius: "0" }), b: common_vendor.t($data.form.price), c: common_vendor.t($data.form.price * 2), d: common_vendor.p({ cellStyle: { padding: "10px 5px" } }), e: common_vendor.p({ title: $data.form.goodsName, label: "商品名称", cellStyle: { padding: "10px 5px" } }), f: common_vendor.p({ title: "选择款式", label: `100zz【藏青色】、100zz【古红色】`, isLink: true, cellStyle: { padding: "10px 5px" } }), g: common_vendor.p({ title: "参数", label: $data.form.goodsName, cellStyle: { padding: "10px 5px" } }), h: common_vendor.o(($event) => $options.callPhone("0771-8888888")), i: common_vendor.p({ title: "客服电话", label: "0771-8888888", border: false, cellStyle: { padding: "10px 5px" } }), j: common_vendor.p({ customStyle: { backgroundColor: "#ffffff" }, border: false }), k: common_vendor.p({ border: false, ["is-shadow"]: false, padding: 0 }), l: $data.form.content, m: common_vendor.p({ title: "商品详情", ["is-shadow"]: false, border: false, padding: 0 }), n: !$data.disabled }, !$data.disabled ? { o: common_vendor.o($options.onDisabled), p: common_vendor.p({ type: "circle", size: "20", color: "#a4a5a7" }) } : { q: common_vendor.o($options.onDisabled), r: common_vendor.p({ type: "checkbox", size: "20", color: "#11a954" }) }, { s: common_vendor.o(($event) => $options.navTo("/package/article/detail?articleId=503")), t: common_vendor.o((...args) => $options.onDisabled && $options.onDisabled(...args)), v: common_vendor.p({ height: "50" }), w: common_vendor.o($options.save), x: common_vendor.p({ customStyle: { background: "linear-gradient(to right, #ccff66, #008e04)", borderRadius: "30px", color: "#ffffff" }, text: "立即购买" }), y: common_vendor.p({ name: "close-circle", color: "#ffffff", size: "30" }), z: common_vendor.o((...args) => $options.closeBookingTel && $options.closeBookingTel(...args)), A: common_vendor.sr("popup", "fc93fbf0-13"), B: common_vendor.p({ type: "center" }), C: common_vendor.sr("login", "fc93fbf0-15"), D: common_vendor.o($options.reload), E: common_vendor.p({ logo: _ctx.logo }) }); } const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-fc93fbf0"], ["__file", "/Users/gxwebsoft/APP/gxtyzx-uniapp-cli/src/package/goods/detail.vue"]]); wx.createPage(MiniProgramPage);