edu/h5/assets/pages-customer_service-cust...

2 lines
2.3 KiB
JavaScript

import{an as e,ao as t,ap as s,d as a,u as n,r as c,a as r,o,c as l,w as i,b as u,g as m,l as p,t as f,h as d,a8 as x,k as y,m as _,e as g,f as h,F as b}from"./index.18669c64.js";import{_ as v}from"./u-image.ed329ee7.js";import{_ as j}from"./u-button.5f44fee7.js";import{a as w}from"./shop.77e170b3.js";import"./u-icon.68f989af.js";import"./plugin-vue_export-helper.21dcd24c.js";async function k(a){if(!a)return uni.$u.$toast("图片不存在");uni.$u.$toast("长按图片保存");try{const n=await e({url:a,timeout:1e4});await t({filePath:n.tempFilePath}),s({title:"保存成功",icon:"success"})}catch(n){s({title:n.errMsg||"保存失败",icon:"none"})}}const $=a({__name:"customer-service",props:{content:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})}},setup(e){const{getImageUrl:t}=n();return(s,a)=>{const n=c(r("u-image"),v),_=y,g=c(r("u-button"),j);return o(),l(_,{class:"customer-service bg-white flex flex-col justify-center items-center mx-[36rpx] mt-[20rpx] rounded-lg px-[110rpx] pt-[100rpx] pb-[160rpx]"},{default:i((()=>[u(n,{width:"280",height:"280",src:m(t)(e.content.qrcode)},null,8,["src"]),e.content.title?(o(),l(_,{key:0,class:"text-lg mt-[14rpx] font-medium"},{default:i((()=>[p(f(e.content.title),1)])),_:1})):d("v-if",!0),e.content.time?(o(),l(_,{key:1,class:"text-content mt-[40rpx]"},{default:i((()=>[p("服务时间:"+f(e.content.time),1)])),_:1})):d("v-if",!0),e.content.mobile?(o(),l(_,{key:2,class:"text-content mt-[14rpx] flex flex-wrap"},{default:i((()=>[p(" 客服电话:"+f(e.content.mobile)+" ",1),x("a",{class:"ml-[10rpx] phone text-muted underline",href:"tel:"+e.content.mobile}," 拨打 ",8,["href"])])),_:1})):d("v-if",!0),u(_,{class:"mt-[100rpx] w-full"},{default:i((()=>[u(g,{type:"primary",shape:"circle",onClick:a[0]||(a[0]=t=>m(k)(e.content.qrcode))},{default:i((()=>[p(" 保存二维码图片 ")])),_:1})])),_:1})])),_:1})}}}),O=a({__name:"customer_service",setup(e){const t=_({pages:[]});return(async()=>{const e=await w({id:3});t.pages=JSON.parse(e.pages)})(),(e,s)=>{const a=c(r("w-customer-service"),$),n=y;return o(),l(n,{class:"customer-service"},{default:i((()=>[(o(!0),g(b,null,h(t.pages,((e,t)=>(o(),l(n,{key:t},{default:i((()=>["customer-service"==e.name?(o(),l(a,{key:0,content:e.content,styles:e.styles},null,8,["content","styles"])):d("v-if",!0)])),_:2},1024)))),128))])),_:1})}}});export{O as default};