"use strict";const e=require("../../../../common/vendor.js"),r=require("../../../index.js"),s=require("./useCanvas.js");if(require("../../../url/index.js"),require("../../../store/index.js"),require("../../../store/app.js"),require("../../../api/promotion/diy.js"),require("../../../request/index.js"),require("../../../config/index.js"),require("../../../platform/index.js"),require("../../../platform/provider/wechat/index.js"),require("../../../platform/provider/wechat/miniProgram.js"),require("../../../api/member/auth.js"),require("../../../api/member/social.js"),require("../../../api/member/user.js"),require("../../../platform/provider/apple/index.js"),require("../../../platform/share.js"),require("../../../router/index.js"),require("../../../hooks/useModal.js"),require("../../../helper/index.js"),require("../../../helper/test.js"),require("../../../helper/digit.js"),require("../../../api/member/signin.js"),require("../../../helper/throttle.js"),require("../../../platform/pay.js"),require("../../../api/pay/order.js"),require("../../../store/user.js"),require("../../../store/cart.js"),require("../../../api/trade/cart.js"),require("../../../api/pay/wallet.js"),require("../../../api/trade/order.js"),require("../../../api/promotion/coupon.js"),require("../../../store/sys.js"),require("../../../store/modal.js"),require("../../../config/zIndex.js"),require("./poster/index.js"),require("./poster/user.js"),require("./poster/goods.js"),require("./poster/groupon.js"),require("../../../api/infra/file.js"),!Array){e.resolveComponent("su-popup")()}Math;const i={__name:"index",props:{show:{type:Boolean,default:!1},shareInfo:{type:Object,default(){}}},emits:["success","close"],setup(i,{expose:o,emit:t}){const a=i,p=e.reactive({canvasId:"canvasId",width:.9*r.sheep.$platform.device.windowWidth,height:600,src:"",imgData:""}),u=t,n=e.getCurrentInstance(),c=()=>{u("close")},d=()=>{["WechatOfficialAccount","H5"].includes(r.sheep.$platform.name)?r.sheep.$helper.toast("请长按图片保存"):e.index.saveImageToPhotosAlbum({filePath:p.src,success:e=>{c(),r.sheep.$helper.toast("保存成功")},fail:e=>{r.sheep.$helper.toast("保存失败"),console.log("图片保存失败:",e)}})};return e.ref(""),o({getPoster:async function(e){return p.src="",p.shareInfo=a.shareInfo,await s.useCanvas(p,n)}}),(r,s)=>e.e({a:""===p.src},""===p.src?{b:p.height+"px",c:p.width+"px"}:{d:p.src,e:p.height+"px",f:p.width+"px"},{g:p.canvasId,h:p.canvasId,i:p.height+"px",j:p.width+"px",k:""!==p.src},""!==p.src?{l:e.o(c),m:e.o(d)}:{},{n:e.o(c),o:e.p({show:i.show,round:"10",type:"center"})})}},o=e._export_sfc(i,[["__scopeId","data-v-db2761e2"]]);wx.createComponent(o);
