"use strict";
const common_vendor = require("../../../common/vendor.js");
const utils_emitter = require("../../../utils/emitter.js");
const common_assets = require("../../../common/assets.js");
if (!Array) {
  const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
  _easycom_uni_popup2();
}
const _easycom_uni_popup = () => "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
  (addProduct + _easycom_uni_popup)();
}
const addProduct = () => "../../Shopping-cart/component/addProduct2.js";
const _sfc_main = {
  __name: "ProductDetails",
  setup(__props) {
    const popup = common_vendor.ref(null);
    const goodObject = common_vendor.ref({});
    const idInfo = common_vendor.ref([]);
    const userInfo = common_vendor.ref({});
    const labelList = common_vendor.ref([]);
    common_vendor.onLoad((options) => {
      goodObject.value = JSON.parse(options.info);
      idInfo.value = [{
        goodId: goodObject.value.id,
        quantity: 1
        //暂时为1
      }];
      labelList.value = goodObject.value.label.split(";");
      labelList.value = labelList.value.filter((s) => {
        return s;
      });
    });
    common_vendor.onShow(() => {
      userInfo.value = wx.getStorageSync("userInfo");
      console.log("商品对象--->", goodObject.value);
    });
    common_vendor.onMounted(() => {
      utils_emitter.emitter.on("close", () => {
        close();
      });
    });
    const loadPop = () => {
      popup.value.open("bottom");
      utils_emitter.emitter.emit("product", goodObject.value);
    };
    const close = () => {
      popup.value.close();
    };
    const jump_buy = () => {
      common_vendor.index.navigateTo({
        url: "../../../pages/order/product-waitpay/product-waitpay?cartInfo=" + JSON.stringify(idInfo.value)
      });
    };
    return (_ctx, _cache) => {
      return {
        a: goodObject.value.goodImg,
        b: common_vendor.unref(common_assets.show1),
        c: common_vendor.unref(common_assets.show2),
        d: common_vendor.unref(common_assets.show3),
        e: common_vendor.unref(common_assets.show4),
        f: common_vendor.unref(common_assets.show3),
        g: common_vendor.t(goodObject.value.price),
        h: common_vendor.t(goodObject.value.name),
        i: common_vendor.unref(common_assets.denglong),
        j: common_vendor.t(goodObject.value.introDetail),
        k: common_vendor.f(labelList.value, (item, index, i0) => {
          return {
            a: common_vendor.t(labelList.value[index]),
            b: index
          };
        }),
        l: common_vendor.unref(common_assets.kefu),
        m: common_vendor.o(($event) => loadPop()),
        n: common_vendor.o(jump_buy),
        o: () => ({
          r: popup,
          k: "popup"
        }),
        p: common_vendor.p({
          ["background-color"]: "#fff"
        })
      };
    };
  }
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3361b524"], ["__file", "D:/jiangchengfeiyi-xiaochengxu/pages/store-home/ProductDetails/ProductDetails.vue"]]);
my.createPage(MiniProgramPage);
