Files
yshop-pro-uniapp/unpackage/dist/build/h5/assets/views-activity-groupBy-detail.5462c66a.js

2 lines
11 KiB
JavaScript
Raw Normal View History

2024-02-22 18:37:23 +08:00
import{T as e,a,b9 as t,G as s,H as o,o as l,j as i,w as n,h as u,Q as r,I as c,z as d,ac as v,ba as f,a2 as p,aX as m,aT as _,ae as y,bb as g,p as h,B as k,bc as w,O as x,M as b,x as I,W as T,X as j,u as S,i as C,f as P,l as D,e as F,k as G,F as A,A as B}from"./index-d4baa715.js";import{_ as R}from"./uv-icon.b5ddbe11.js";import{H as $}from"./index.704ebef3.js";import{u as q}from"./useScroll.dcb46f58.js";import{G as H}from"./Goods.ed14922a.js";import{I as O}from"./InviteFriends.9f2730eb.js";import{_ as W}from"./uv-overlay.28e9addc.js";import{u as E}from"./useImage.bf0418c3.js";import{_ as N}from"./_plugin-vue_export-helper.1b428a4d.js";import{S as z,u as M}from"./useShare.a1157a10.js";import{a as U}from"./goods.bed5081e.js";import{g as X}from"./utils.052a93d2.js";import{G as Y}from"./good-attr-select.827f4d84.js";import{a as J}from"./product.280a3345.js";import{u as Q}from"./useInterface.2c7749ae.js";import{e as V}from"./cart.301868c6.js";import"./uv-icon.vue_vue_type_style_index_0_scoped_23936b10_lang.7145f5b2.js";import"./index.6c6cd02e.js";import"./images.f0a6f614.js";import"./Popup.965f3d92.js";import"./uv-transition.e8fc5cb3.js";import"./createAnimation.a561e009.js";import"./useShearPlate.1f74bce6.js";import"./uv-image.cfd78d3c.js";import"./space.587a4c0a.js";import"./uv-button.4742932f.js";import"./uv-loading-icon.1a9e10db.js";import"./uv-loading-icon.vue_vue_type_style_index_0_scoped_bad0efbf_lang.8998f762.js";import"./uv-button.vue_vue_type_style_index_0_scoped_bc0e850d_lang.79bfdc50.js";import"./index.dcf9623e.js";const K=N({__name:"GroupBy",setup(x,{expose:b}){const I=e(),{getImageInfo:T,base64ToUrl:j,saveImageToPhotosAlbum:S}=E(),C=a(!1),P=a(void 0),D=a("");function F(){P.value=G.value=void 0,C.value=!1}b({open:async function(e,a){P.value=e,C.value=!0,v({title:"获取数据中..."}),D.value=await f({path:"pages/share/index",name:a.query}),await p((()=>{!function(){v({title:"海报生成中"});_().in(A).select("#goods-canvas").boundingClientRect().exec((async e=>{try{const{width:a,height:t}=e[0];!function(e={}){R.save();e={x:0,y:0,width:0,height:0,round:0,stroke:!1,strokeStyle:"rgb(255,255,255)",fillStyle:"rgb(255,255,255)",...e};const{x:a,y:t,width:s,height:o,round:l,stroke:i,strokeStyle:n,fillStyle:u}=e;R.beginPath(),R.moveTo(a+l,t),R.arcTo(a+s,t,a+s,t+l,l),R.lineTo(a+s,t+o-l),R.arcTo(a+s,t+o,a+s-l,t+o,l),R.lineTo(a+l,t+o),R.arcTo(a,t+o,a,t+o-l,l),R.lineTo(a,t+l),R.arcTo(a,t,a+l,t,l),R.closePath(),R.fillStyle=u,R.strokeStyle=n,R.fill(),i&&R.stroke(),R.restore()}({width:a,height:t,round:10}),await async function(){await $({x:15,y:15,width:32,height:32,src:I.user.avatar}),R.save(),R.font="normal 16px sans-serif",R.fillStyle="#000000",R.translate(68,32),R.fillText(I.user.nickname+"邀请您来拼团啦~",0,8),R.restore()}(),await async function(e){const a=e-48,t=P.value.image;await $({x:24,y:72,width:a,height:a,src:t});const s=P.value.storeName,o=P.value.price,l="快来和我拼团",i=R.measureText(s)>=e/1.5?s:s.slice(0,17)+"...";R.save(),R.translate(24,e+58),R.font="normal bold 16px sans-serif",R.fillStyle="#000000",R.fillText(i,0,0),R.restore(),R.save(),R.translate(24,e+58+36),R.font="normal bold 24px sans-serif",R.fillStyle="#EE6D46",R.fillText(`${o}`,0,0);const n=R.measureText(`${o}`);R.font="normal normal 16px sans-serif",R.fillStyle="#999999",R.fillText(`${l}`,n.width+10,0),R.restore(),R.save(),R.beginPath(),R.strokeStyle="#F0F0F0",R.translate(24,e+58+36+15),R.moveTo(0,0),R.lineWidth=1,R.lineTo(a,0),R.stroke(),R.closePath(),R.restore()}(a),await async function(e){R.save(),R.translate(24,e+58+36+15+25);const a="长按识别图中二维码",t="来自「Yshop商城」小程序";R.font="normal bold 16px sans-serif",R.fillStyle="#000000",R.fillText(a,0,0),R.font="normal normal 14px sans-serif",R.fillStyle="#8C8C8C",R.fillText(t,0,25);const s=await j(D.value);await $({x:e-48-50,y:-18,width:50,height:50,src:s}),R.restore()}(a),console.log("画布绘画完毕"),R.draw(!1,(()=>{!async function(){console.log("开始生成画布"),g({canvasId:"goods-canvas",success:async e=>{G.value=await j(e.tempFilePath),y()