CRMEB/backend/public/assets/useSharePoster.Boxh2YoF.js
2026-10-22 10:04:43 +08:00

2 lines
1.7 KiB
JavaScript

import{r as e,bN as t,u as o,i as a,bo as n,I as s,bO as i,Z as u,a6 as c}from"./index-zpxrlmYx.js";const r=c().statusBarHeight+"px";function l(c){const l=e(!1),d=e(!1),v=e(!1),f=e(""),p=e(""),g=e(!1),h=e(!1),m=e(""),I=e(""),w=e(!1),P=e("1"),S=e(""),F=e(200),b=e("upx"),x=e("#FFF"),k=e("#000"),C=e("#000"),_=e(""),B=e(40),H=e(3),T=e(!0),y=e(!0),z=e(0),D=e(0),O=e(""),j=e({}),q=e(!1),M=e(0),N=()=>c()||{};function Q(e){const t=N().storeInfo||{};n({src:f.value,success(){""==e[2]||s(a=>{o.PosterCanvas(e,t.store_name,t.price,t.ot_price,function(e){p.value=e,g.value=!0,d.value=!1,h.value=!h.value})})},fail:function(e){return o.Tips({title:e})}})}function R(e){return(e=e?e.toString():"").indexOf("https://")>-1?e:e.replace("http://","https://")}return{posters:l,canvasStatus:d,isDown:v,PromotionCode:f,posterImage:p,posterImageStatus:g,actionSheetHidden:h,storeImage:m,storeImageBase64:I,codeShow:w,cid:P,codeVal:S,size:F,unit:b,background:x,foreground:k,pdground:C,codeIcon:_,iconsize:B,lv:H,onval:T,loadMake:y,base64Show:z,shareQrcode:D,followCode:O,selectSku:j,currentPage:q,sysHeight:r,isShow:M,qrR:function(e){u.isWeixin()&&"1"==D.value||(f.value=e,O.value="")},getImageBase64:function(){const e=N().storeInfo||{};i(m.value,e.wechat_code).then(t=>{I.value=t.data.image,e.wechat_code&&(f.value=t.data.code)}).catch(()=>{})},initPoster:Q,goPoster:async function(e){let t;if(l.value=!1,d.value=!0,t=[N().posterbackgd,I.value,f.value],!I.value)return o.Tips({title:a.t("正在下载海报,请稍后再试")});Q(t)},setDomain:R,downloadFilestoreImage:function(){const e=N().storeInfo||{};t({url:R(e.image),success:function(e){m.value=e.tempFilePath,I.value=e.tempFilePath},fail:function(){return o.Tips({title:""})}})},downloadFilePromotionCode:function(e){}}}export{l as u};