2 lines
3.1 KiB
JavaScript
2 lines
3.1 KiB
JavaScript
"use strict";var e=Object.defineProperty,o=Object.defineProperties,t=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,s=(o,t,a)=>t in o?e(o,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):o[t]=a;const r=require("../../../../common/vendor.js");if(!Array){r.resolveComponent("wd-icon")()}Math;const l=r.defineComponent((c=((e,o)=>{for(var t in o||(o={}))n.call(o,t)&&s(e,t,o[t]);if(a)for(var t of a(o))i.call(o,t)&&s(e,t,o[t]);return e})({},{name:"wd-button",options:{addGlobalClass:!0,virtualHost:!0,styleIsolation:"shared"}}),d={props:r.buttonProps,emits:["click","getuserinfo","contact","getphonenumber","error","launchapp","opensetting","chooseavatar","agreeprivacyauthorization"],setup(e,{emit:o}){const t=e,a=o,n=r.ref(20),i=r.ref(70),s=r.ref(""),l=r.computed((()=>`background-image: url(${s.value});`));function c(e){t.disabled||t.loading||a("click",e.detail)}function d(e){a("getuserinfo",e.detail)}function p(e){a("contact",e.detail)}function f(e){a("getphonenumber",e.detail)}function u(e){a("error",e.detail)}function g(e){a("launchapp",e.detail)}function b(e){a("opensetting",e.detail)}function m(e){a("chooseavatar",e.detail)}function v(e){a("agreeprivacyauthorization",e.detail)}return r.watch((()=>t.loading),(()=>{!function(){const{loadingColor:e,type:o,plain:a}=t;let n=e;if(!n)switch(o){case"primary":n="#4D80F0";break;case"success":n="#34d19d";break;case"info":case"default":n="#333";break;case"warning":n="#f0883a";break;case"error":n="#fa4350"}const i=((e="#4D80F0",o=!0)=>`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><defs><linearGradient x1="100%" y1="0%" x2="0%" y2="0%" id="a"><stop stop-color="${o?e:"#fff"}" offset="0%" stop-opacity="0"/><stop stop-color="${o?e:"#fff"}" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path d="M21 1c11.046 0 20 8.954 20 20s-8.954 20-20 20S1 32.046 1 21 9.954 1 21 1zm0 7C13.82 8 8 13.82 8 21s5.82 13 13 13 13-5.82 13-13S28.18 8 21 8z" fill="${o?"#fff":e}"/><path d="M4.599 21c0 9.044 7.332 16.376 16.376 16.376 9.045 0 16.376-7.332 16.376-16.376" stroke="url(#a)" stroke-width="3.5" stroke-linecap="round"/></g></svg>`)(n,!a);s.value=`"data:image/svg+xml;base64,${r.encode(i)}"`}()}),{deep:!0,immediate:!0}),(e,o)=>r.e({a:e.loading},e.loading?{b:r.s(l.value)}:e.icon?{d:r.p({"custom-class":"wd-button__icon",name:e.icon})}:{},{c:e.icon,e:e.disabled||e.loading?"":"wd-button--active",f:r.s(e.customStyle),g:r.n("is-"+e.type),h:r.n("is-"+e.size),i:r.n(e.plain?"is-plain":""),j:r.n(e.disabled?"is-disabled":""),k:r.n(e.round?"is-round":""),l:r.n(e.hairline?"is-hairline":""),m:r.n(e.block?"is-block":""),n:r.n(e.loading?"is-loading":""),o:r.n(e.customClass),p:n.value,q:i.value,r:e.openType,s:e.sendMessageTitle,t:e.sendMessagePath,v:e.sendMessageImg,w:e.appParameter,x:e.showMessageCard,y:e.sessionFrom,z:e.lang,A:e.hoverStopPropagation,B:e.formType,C:r.o(c),D:r.o(d),E:r.o(p),F:r.o(f),G:r.o(u),H:r.o(g),I:r.o(b),J:r.o(m),K:r.o(v)})}},o(c,t(d))));var c,d;const p=r._export_sfc(l,[["__scopeId","data-v-9e4c9bf5"]]);wx.createComponent(p);
|