import{b as F,r as Q,a as A,g as E,s as H}from"./link-c1e7c221.js";import{g as W,a as j}from"./link-448f477d.js";import{c as x,_ as q}from"./index-c2dd6a24.js";import{V as L,W as S}from"./icons-a8498fb6.js";import{M as _,S as J,L as K,T as O,Q as R,f as X}from"./ui-ba7aaa7e.js";import{e as Y,r as d,a2 as Z,P as g,a3 as V,a4 as t,a7 as l,f as s,H as c,ab as k,I as r,Q as ee,F as te,aa as ae,ac as se,ad as oe}from"./vue-bf422dc1.js";import"./libs-51817cd7.js";import"./plugins-ca970193.js";import"./others-9f318174.js";import"./echarts-bf9d612c.js";const i=m=>(se("data-v-d09dc540"),m=m(),oe(),m),le={class:"info-block"},ne={class:"info-item"},ie=i(()=>l("h1",null,"链接状态",-1)),ce=i(()=>l("div",{class:"help"},"选择暂停将仅当前商品链接不可用",-1)),de={class:"info-item"},re=i(()=>l("h1",null,"绿标短链",-1)),ue=i(()=>l("div",{class:"help"},"绿标短链接打开就是商品长链接，强烈建议使用绿标短链接作为访问链接；如果在朋友圈等地方打广告请发【绿标短链】这个链接，这样可以让您的朋友直接进入您的店铺",-1)),_e={class:"info-item"},me=i(()=>l("h1",null,"商品链接",-1)),pe=i(()=>l("div",{class:"help"},"重置商品链接后，当前商品的原短链长连接都会失效；严禁使用此链接发广告",-1)),ve={class:"info-item"},he=i(()=>l("h1",null,"电脑端风格",-1)),fe=i(()=>l("div",{class:"help"},"当前商品链接PC页面风格",-1)),ge={name:"GoodsLink"},ke=Y({...ge,setup(m,{expose:D}){const a=d({id:0,link:"",short_link:"",status:0}),h=d(!1),f=async o=>{const{data:e}=await F({id:o});e?(a.value={...e},h.value=!0,$(),w()):_.error("获取链接失败")},y=async o=>{const e=await Q({type:"good",id:a.value.id,status:o});e.code===1&&(_.success(e.msg),f(a.value.id))},I=async o=>{const e=await A({type:"good",id:a.value.id,status:o});e.code===1&&(_.success(e.msg),f(a.value.id))},b=d([]),P=d([]),$=async()=>{const o=await W(),e=await j();b.value=o.data,P.value=e.data},T=d(null),z=d(null),w=async()=>{const{data:o}=await E({id:a.value.id,type:"good"});T.value=o.pc_template,z.value=o.mobile_template},B=async(o,e)=>{const u=await H({field:o,value:e,id:a.value.id,type:"good"});u.code===1?(_.success(u.msg),w()):_.error(u.msg)},M=[{label:"开启",value:1},{label:"暂停",value:0}];return D({init:f}),(o,e)=>{const u=Z("wp-check-tag"),p=J,C=K,v=O,G=R,N=X;return g(),V(N,{visible:h.value,"onUpdate:visible":e[5]||(e[5]=n=>h.value=n),"destroy-on-close":!0,"close-on-overlay-click":!1,width:"750",header:"商品链接",footer:!1},{body:t(()=>[l("div",le,[l("div",ne,[s(p,null,{default:t(()=>[ie,s(u,{modelValue:a.value.status,"onUpdate:modelValue":e[0]||(e[0]=n=>a.value.status=n),items:M,onActions:I},null,8,["modelValue"])]),_:1}),ce]),l("div",de,[s(p,null,{default:t(()=>[re,s(C,{theme:"primary",href:a.value.short_link,target:"_blank"},{default:t(()=>[c(k(a.value.short_link),1)]),_:1},8,["href"]),s(v,{class:"hand-cursor",theme:"primary",variant:"light",size:"small",onClick:e[1]||(e[1]=n=>r(x)(a.value.short_link))},{icon:t(()=>[s(r(L))]),default:t(()=>[c("复制 ")]),_:1}),s(v,{class:"hand-cursor",theme:"primary",size:"small",onClick:e[2]||(e[2]=n=>y(0))},{icon:t(()=>[s(r(S))]),default:t(()=>[c("重置短链 ")]),_:1})]),_:1}),ue]),l("div",_e,[s(p,null,{default:t(()=>[me,s(C,{theme:"primary",href:a.value.link,target:"_blank"},{default:t(()=>[c(k(a.value.link),1)]),_:1},8,["href"]),s(v,{class:"hand-cursor",theme:"primary",variant:"light",size:"small",onClick:e[3]||(e[3]=n=>r(x)(a.value.link))},{icon:t(()=>[s(r(L))]),default:t(()=>[c("复制 ")]),_:1}),s(v,{class:"hand-cursor",theme:"primary",size:"small",onClick:e[4]||(e[4]=n=>y(1))},{icon:t(()=>[s(r(S))]),default:t(()=>[c("重置分接 ")]),_:1})]),_:1}),pe]),l("div",ve,[s(p,null,{default:t(()=>[he,(g(!0),ee(te,null,ae(b.value,(n,U)=>(g(),V(G,{key:U,checked:n.value==T.value,onChange:ye=>B("theme",n.value)},{default:t(()=>[c(k(n.label),1)]),_:2},1032,["checked","onChange"]))),128))]),_:1}),fe])])]),_:1},8,["visible"])}}});const Pe=q(ke,[["__scopeId","data-v-d09dc540"]]);export{Pe as default};
