2024-09-19 07:20:14 +08:00
|
|
|
"use strict";
|
2024-10-01 09:15:35 +08:00
|
|
|
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");
|
2024-09-19 07:20:14 +08:00
|
|
|
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) {
|
2024-10-01 09:15:35 +08:00
|
|
|
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);
|
2024-09-19 07:20:14 +08:00
|
|
|
const SharePosterRef = common_vendor.ref("");
|
|
|
|
const props = __props;
|
|
|
|
const state = common_vendor.reactive({
|
|
|
|
showShareGuide: false,
|
|
|
|
// H5 的指引
|
|
|
|
showPosterModal: false
|
|
|
|
// 海报弹窗
|
|
|
|
});
|
|
|
|
const onShareByPoster = () => {
|
2024-10-01 09:15:35 +08:00
|
|
|
modules_mall_sheep_hooks_useModal.closeShareModal();
|
|
|
|
if (!modules_mall_sheep_index.sheep.$store("user").isLogin) {
|
|
|
|
modules_mall_sheep_hooks_useModal.showAuthModal();
|
2024-09-19 07:20:14 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
console.log(props.shareInfo);
|
|
|
|
common_vendor.unref(SharePosterRef).getPoster();
|
|
|
|
state.showPosterModal = true;
|
|
|
|
};
|
|
|
|
const onShareByForward = () => {
|
2024-10-01 09:15:35 +08:00
|
|
|
modules_mall_sheep_hooks_useModal.closeShareModal();
|
2024-09-19 07:20:14 +08:00
|
|
|
};
|
|
|
|
const onShareByCopyLink = () => {
|
2024-10-01 09:15:35 +08:00
|
|
|
modules_mall_sheep_index.sheep.$helper.copyText(props.shareInfo.link);
|
|
|
|
modules_mall_sheep_hooks_useModal.closeShareModal();
|
2024-09-19 07:20:14 +08:00
|
|
|
};
|
|
|
|
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 ? {
|
2024-10-01 09:15:35 +08:00
|
|
|
d: common_vendor.unref(modules_mall_sheep_index.sheep).$url.static("/static/img/shop/share/share_guide.png")
|
2024-09-19 07:20:14 +08:00
|
|
|
} : {}, {
|
|
|
|
e: shareConfig.value.methods.includes("forward")
|
|
|
|
}, shareConfig.value.methods.includes("forward") ? {
|
2024-10-01 09:15:35 +08:00
|
|
|
f: common_vendor.unref(modules_mall_sheep_index.sheep).$url.static("/static/img/shop/share/share_wx.png"),
|
2024-09-19 07:20:14 +08:00
|
|
|
g: common_vendor.o(onShareByForward)
|
|
|
|
} : {}, {
|
|
|
|
h: shareConfig.value.methods.includes("poster")
|
|
|
|
}, shareConfig.value.methods.includes("poster") ? {
|
2024-10-01 09:15:35 +08:00
|
|
|
i: common_vendor.unref(modules_mall_sheep_index.sheep).$url.static("/static/img/shop/share/share_poster.png"),
|
2024-09-19 07:20:14 +08:00
|
|
|
j: common_vendor.o(onShareByPoster)
|
|
|
|
} : {}, {
|
|
|
|
k: shareConfig.value.methods.includes("link")
|
|
|
|
}, shareConfig.value.methods.includes("link") ? {
|
2024-10-01 09:15:35 +08:00
|
|
|
l: common_vendor.unref(modules_mall_sheep_index.sheep).$url.static("/static/img/shop/share/share_link.png"),
|
2024-09-19 07:20:14 +08:00
|
|
|
m: common_vendor.o(onShareByCopyLink)
|
|
|
|
} : {}, {
|
2024-10-01 09:15:35 +08:00
|
|
|
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)),
|
2024-09-19 07:20:14 +08:00
|
|
|
p: common_vendor.p({
|
|
|
|
show: show.value,
|
|
|
|
round: "10",
|
|
|
|
showClose: false
|
|
|
|
}),
|
2024-10-01 09:15:35 +08:00
|
|
|
q: common_vendor.sr(SharePosterRef, "cb348d5b-2", {
|
2024-09-19 07:20:14 +08:00
|
|
|
"k": "SharePosterRef"
|
|
|
|
}),
|
|
|
|
r: common_vendor.o(($event) => state.showPosterModal = false),
|
|
|
|
s: common_vendor.p({
|
|
|
|
show: state.showPosterModal,
|
|
|
|
shareInfo: __props.shareInfo
|
|
|
|
})
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
2024-10-01 09:15:35 +08:00
|
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-cb348d5b"]]);
|
2024-09-19 07:20:14 +08:00
|
|
|
wx.createComponent(Component);
|