acdr-ui/dist/dev/mp-weixin/modules/mall/sheep/components/s-share-modal/s-share-modal.js
2024-10-01 09:15:35 +08:00

101 lines
3.9 KiB
JavaScript

"use strict";
const common_vendor = require("../../../../../common/vendor.js");
const modules_mall_sheep_index = require("../../index.js");
const modules_mall_sheep_hooks_useModal = require("../../hooks/useModal.js");
if (!Array) {
const _easycom_su_popup2 = common_vendor.resolveComponent("su-popup");
_easycom_su_popup2();
}
const _easycom_su_popup = () => "../../ui/su-popup/su-popup.js";
if (!Math) {
(_easycom_su_popup + canvasPoster)();
}
const canvasPoster = () => "./canvas-poster/index.js";
const _sfc_main = {
__name: "s-share-modal",
props: {
shareInfo: {
type: Object,
default() {
}
}
},
setup(__props) {
const show = common_vendor.computed(() => modules_mall_sheep_index.sheep.$store("modal").share);
const shareConfig = common_vendor.computed(() => modules_mall_sheep_index.sheep.$store("app").platform.share);
const SharePosterRef = common_vendor.ref("");
const props = __props;
const state = common_vendor.reactive({
showShareGuide: false,
// H5 的指引
showPosterModal: false
// 海报弹窗
});
const onShareByPoster = () => {
modules_mall_sheep_hooks_useModal.closeShareModal();
if (!modules_mall_sheep_index.sheep.$store("user").isLogin) {
modules_mall_sheep_hooks_useModal.showAuthModal();
return;
}
console.log(props.shareInfo);
common_vendor.unref(SharePosterRef).getPoster();
state.showPosterModal = true;
};
const onShareByForward = () => {
modules_mall_sheep_hooks_useModal.closeShareModal();
};
const onShareByCopyLink = () => {
modules_mall_sheep_index.sheep.$helper.copyText(props.shareInfo.link);
modules_mall_sheep_hooks_useModal.closeShareModal();
};
function onCloseGuide() {
state.showShareGuide = false;
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.o(onCloseGuide),
b: common_vendor.p({
show: state.showShareGuide,
showClose: false
}),
c: state.showShareGuide
}, state.showShareGuide ? {
d: common_vendor.unref(modules_mall_sheep_index.sheep).$url.static("/static/img/shop/share/share_guide.png")
} : {}, {
e: shareConfig.value.methods.includes("forward")
}, shareConfig.value.methods.includes("forward") ? {
f: common_vendor.unref(modules_mall_sheep_index.sheep).$url.static("/static/img/shop/share/share_wx.png"),
g: common_vendor.o(onShareByForward)
} : {}, {
h: shareConfig.value.methods.includes("poster")
}, shareConfig.value.methods.includes("poster") ? {
i: common_vendor.unref(modules_mall_sheep_index.sheep).$url.static("/static/img/shop/share/share_poster.png"),
j: common_vendor.o(onShareByPoster)
} : {}, {
k: shareConfig.value.methods.includes("link")
}, shareConfig.value.methods.includes("link") ? {
l: common_vendor.unref(modules_mall_sheep_index.sheep).$url.static("/static/img/shop/share/share_link.png"),
m: common_vendor.o(onShareByCopyLink)
} : {}, {
n: common_vendor.o((...args) => common_vendor.unref(modules_mall_sheep_hooks_useModal.closeShareModal) && common_vendor.unref(modules_mall_sheep_hooks_useModal.closeShareModal)(...args)),
o: common_vendor.o(common_vendor.unref(modules_mall_sheep_hooks_useModal.closeShareModal)),
p: common_vendor.p({
show: show.value,
round: "10",
showClose: false
}),
q: common_vendor.sr(SharePosterRef, "cb348d5b-2", {
"k": "SharePosterRef"
}),
r: common_vendor.o(($event) => state.showPosterModal = false),
s: common_vendor.p({
show: state.showPosterModal,
shareInfo: __props.shareInfo
})
});
};
}
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-cb348d5b"]]);
wx.createComponent(Component);