test_lgq/niucloud/public/wap/assets/u-avatar.2111318d.js

2 lines
12 KiB
JavaScript
Raw Permalink Normal View History

2024-01-24 17:36:08 +08:00
import{_ as A}from"./u-icon.e3aa4770.js";import{U as e,V as t,W as a,h as n,i,w as l,J as o,K as r,I as s,n as u,M as c,aU as d,p as f,q as p,H as m,l as y,j as g,t as x,aV as h,D as S,S as b,E as v,F as k,L as I}from"./index-849cf30e.js";import{_ as H}from"./_plugin-vue_export-helper.1b428a4d.js";const R=H({name:"u-link",mixins:[t,a,{props:{color:{type:String,default:e.link.color},fontSize:{type:[String,Number],default:e.link.fontSize},underLine:{type:Boolean,default:e.link.underLine},href:{type:String,default:e.link.href},mpTips:{type:String,default:e.link.mpTips},lineColor:{type:String,default:e.link.lineColor},text:{type:String,default:e.link.text}}}],computed:{linkStyle(){return{color:this.color,fontSize:uni.$u.addUnit(this.fontSize),lineHeight:uni.$u.addUnit(uni.$u.getPx(this.fontSize)+2),textDecoration:this.underLine?"underline":"none"}}},methods:{openLink(){window.open(this.href),this.$emit("click")}}},[["render",function(A,e,t,a,d,f){const p=c;return n(),i(p,{class:"u-link",onClick:s(f.openLink,["stop"]),style:u([f.linkStyle,A.$u.addStyle(A.customStyle)])},{default:l((()=>[o(r(A.text),1)])),_:1},8,["onClick","style"])}],["__scopeId","data-v-a339e5f1"]]),B={computed:{value(){const{text:A,mode:e,format:t,href:a}=this;return"price"===e?(/^\d+(\.\d+)?$/.test(A)||uni.$u.error("金额模式下text参数需要为金额格式"),uni.$u.test.func(t)?t(A):uni.$u.priceFormat(A,2)):"date"===e?(!uni.$u.test.date(A)&&uni.$u.error("日期模式下text参数需要为日期或时间戳格式"),uni.$u.test.func(t)?t(A):t?uni.$u.timeFormat(A,t):uni.$u.timeFormat(A,"yyyy-mm-dd")):"phone"===e?uni.$u.test.func(t)?t(A):"encrypt"===t?`${A.substr(0,3)}****${A.substr(7)}`:A:"name"===e?("string"!=typeof A&&uni.$u.error("姓名模式下text参数需要为字符串格式"),uni.$u.test.func(t)?t(A):"encrypt"===t?this.formatName(A):A):"link"===e?(!uni.$u.test.url(a)&&uni.$u.error("超链接模式下href参数需要为URL格式"),A):A}},methods:{formatName(A){let e="";if(2===A.length)e=A.substr(0,1)+"*";else if(A.length>2){let t="";for(let e=0,a=A.length-2;e<a;e++)t+="*";e=A.substr(0,1)+t+A.substr(-1,1)}else e=A;return e}}},N={props:{type:{type:String,default:e.text.type},show:{type:Boolean,default:e.text.show},text:{type:[String,Number],default:e.text.text},prefixIcon:{type:String,default:e.text.prefixIcon},suffixIcon:{type:String,default:e.text.suffixIcon},mode:{type:String,default:e.text.mode},href:{type:String,default:e.text.href},format:{type:[String,Function],default:e.text.format},call:{type:Boolean,default:e.text.call},openType:{type:String,default:e.text.openType},bold:{type:Boolean,default:e.text.bold},block:{type:Boolean,default:e.text.block},lines:{type:[String,Number],default:e.text.lines},color:{type:String,default:e.text.color},size:{type:[String,Number],default:e.text.size},iconStyle:{type:[Object,String],default:e.text.iconStyle},decoration:{tepe:String,default:e.text.decoration},margin:{type:[Object,String,Number],default:e.text.margin},lineHeight:{type:[String,Number],default:e.text.lineHeight},align:{type:String,default:e.text.align},wordWrap:{type:String,default:e.text.wordWrap}}};const w=H({name:"u--text",mixins:[t,a,N],components:{uvText:H({name:"u--text",mixins:[t,a,B,N],emits:["click"],computed:{valueStyle(){const A={textDecoration:this.decoration,fontWeight:this.bold?"bold":"normal",wordWrap:this.wordWrap,fontSize:uni.$u.addUnit(this.size)};return!this.type&&(A.color=this.color),this.isNvue&&this.lines&&(A.lines=this.lines),this.lineHeight&&(A.lineHeight=uni.$u.addUnit(this.lineHeight)),!this.isNvue&&this.block&&(A.display="block"),uni.$u.deepMerge(A,uni.$u.addStyle(this.customStyle))},isNvue:()=>!1,isMp:()=>!1},data:()=>({}),methods:{clickHandler(){this.call&&"phone"===this.mode&&d({phoneNumber:this.text}),this.$emit("click")}}},[["render",function(e,t,a,s,d,S){const b=c,v=f(p("u-icon"),A),k=x,I=f(p("u-link"),R),H=h;return e.show?(n(),i(k,{key:0,class:m(["u-text",[]]),style:u({margin:e.margin,justifyContent:"left"===e.align?"flex-start":"center"===e.align?"center":"flex-end"}),onClick:S.clickHandler},{def