test_lgq/niucloud/public/wap/assets/u-action-sheet.27d0ae04.js
2024-01-24 17:36:08 +08:00

2 lines
9.0 KiB
JavaScript

import{_ as e}from"./u-icon.e3aa4770.js";import{U as t,V as l,W as a,p as i,q as s,h as o,i as n,w as c,j as r,H as u,S as d,l as p,n as _,J as m,K as y,t as f,M as g,I as h,E as S,F as b,G as k}from"./index-849cf30e.js";import{_ as v}from"./u-line.19eb5c40.js";import{_ as $}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as C}from"./u-loading-icon.d012ecbf.js";import{_ as B}from"./u-popup.e01742d2.js";const T={props:{lang:String,sessionFrom:String,sendMessageTitle:String,sendMessagePath:String,sendMessageImg:String,showMessageCard:Boolean,appParameter:String,formType:String,openType:String}},w={props:{openType:String},methods:{onGetUserInfo(e){this.$emit("getuserinfo",e.detail)},onContact(e){this.$emit("contact",e.detail)},onGetPhoneNumber(e){this.$emit("getphonenumber",e.detail)},onError(e){this.$emit("error",e.detail)},onLaunchApp(e){this.$emit("launchapp",e.detail)},onOpenSetting(e){this.$emit("opensetting",e.detail)}}};const x=$({name:"u-cell",data:()=>({}),mixins:[l,a,{props:{title:{type:[String,Number],default:t.cell.title},label:{type:[String,Number],default:t.cell.label},value:{type:[String,Number],default:t.cell.value},icon:{type:String,default:t.cell.icon},disabled:{type:Boolean,default:t.cell.disabled},border:{type:Boolean,default:t.cell.border},center:{type:Boolean,default:t.cell.center},url:{type:String,default:t.cell.url},linkType:{type:String,default:t.cell.linkType},clickable:{type:Boolean,default:t.cell.clickable},isLink:{type:Boolean,default:t.cell.isLink},required:{type:Boolean,default:t.cell.required},rightIcon:{type:String,default:t.cell.rightIcon},arrowDirection:{type:String,default:t.cell.arrowDirection},iconStyle:{type:[Object,String],default:()=>uni.$u.props.cell.iconStyle},rightIconStyle:{type:[Object,String],default:()=>uni.$u.props.cell.rightIconStyle},titleStyle:{type:[Object,String],default:()=>uni.$u.props.cell.titleStyle},size:{type:String,default:t.cell.size},stop:{type:Boolean,default:t.cell.stop},name:{type:[Number,String],default:t.cell.name}}}],computed:{titleTextStyle(){return uni.$u.addStyle(this.titleStyle)}},emits:["click"],methods:{clickHandler(e){this.disabled||(this.$emit("click",{name:this.name}),this.openPage(),this.stop&&this.preventEvent(e))}}},[["render",function(t,l,a,h,S,b){const k=i(s("u-icon"),e),$=f,C=g,B=i(s("u-line"),v);return o(),n($,{class:u(["u-cell",[t.customClass]]),style:_([t.$u.addStyle(t.customStyle)]),"hover-class":t.disabled||!t.clickable&&!t.isLink?"":"u-cell--clickable","hover-stay-time":250,onClick:b.clickHandler},{default:c((()=>[r($,{class:u(["u-cell__body",[t.center&&"u-cell--center","large"===t.size&&"u-cell__body--large"]])},{default:c((()=>[r($,{class:"u-cell__body__content"},{default:c((()=>[r($,{class:"u-cell__left-icon-wrap"},{default:c((()=>[d(t.$slots,"icon",{},(()=>[t.icon?(o(),n(k,{key:0,name:t.icon,"custom-style":t.iconStyle,size:"large"===t.size?22:18},null,8,["name","custom-style","size"])):p("v-if",!0)]),!0)])),_:3}),r($,{class:"u-cell__title"},{default:c((()=>[d(t.$slots,"title",{},(()=>[t.title?(o(),n(C,{key:0,class:u(["u-cell__title-text",[t.disabled&&"u-cell--disabled","large"===t.size&&"u-cell__title-text--large"]]),style:_([b.titleTextStyle])},{default:c((()=>[m(y(t.title),1)])),_:1},8,["style","class"])):p("v-if",!0)]),!0),d(t.$slots,"label",{},(()=>[t.label?(o(),n(C,{key:0,class:u(["u-cell__label",[t.disabled&&"u-cell--disabled","large"===t.size&&"u-cell__label--large"]])},{default:c((()=>[m(y(t.label),1)])),_:1},8,["class"])):p("v-if",!0)]),!0)])),_:3})])),_:3}),d(t.$slots,"value",{},(()=>[t.$u.test.empty(t.value)?p("v-if",!0):(o(),n(C,{key:0,class:u(["u-cell__value",[t.disabled&&"u-cell--disabled","large"===t.size&&"u-cell__value--large"]])},{default:c((()=>[m(y(t.value),1)])),_:1},8,["class"]))]),!0),r($,{class:u(["u-cell__right-icon-wrap",[`u-cell__right-icon-wrap--${t.arrowDirection}`]])},{default:c((()=>[d(t.$slots,"right-icon",{},(()=>[t.isLink?(o(),n(k,{key:0,name:t.rightIcon,"custom-style":t.rightIconStyle,color:t.disabled?"#c8c9cc":"info",size:"large"===t.size?18:16},null,8,["name","custom-style","color","size"])):p("v-if",!0)]),!0)])),_:3},8,["class"])])),_:3},8,["class"]),t.border?(o(),n(B,{key:0})):p("v-if",!0)])),_:3},8,["class","style","hover-class","onClick"])}],["__scopeId","data-v-ce3eecec"]]);const I=$({name:"u-cell-group",mixins:[l,a,{props:{title:{type:String,default:t.cellGroup.title},border:{type:Boolean,default:t.cellGroup.border}}}]},[["render",function(e,t,l,a,h,S){const b=g,k=f,$=i(s("u-line"),v);return o(),n(k,{style:_([e.$u.addStyle(e.customStyle)]),class:u([[e.customClass],"u-cell-group"])},{default:c((()=>[e.title?(o(),n(k,{key:0,class:"u-cell-group__title"},{default:c((()=>[d(e.$slots,"title",{},(()=>[r(b,{class:"u-cell-group__title__text"},{default:c((()=>[m(y(e.title),1)])),_:1})]),!0)])),_:3})):p("v-if",!0),r(k,{class:"u-cell-group__wrapper"},{default:c((()=>[e.border?(o(),n($,{key:0})):p("v-if",!0),d(e.$slots,"default",{},void 0,!0)])),_:3})])),_:3},8,["style","class"])}],["__scopeId","data-v-bfc8927a"]]);const z=$({name:"u-gap",mixins:[l,a,{props:{bgColor:{type:String,default:t.gap.bgColor},height:{type:[String,Number],default:t.gap.height},marginTop:{type:[String,Number],default:t.gap.marginTop},marginBottom:{type:[String,Number],default:t.gap.marginBottom}}}],computed:{gapStyle(){const e={backgroundColor:this.bgColor,height:uni.$u.addUnit(this.height),marginTop:uni.$u.addUnit(this.marginTop),marginBottom:uni.$u.addUnit(this.marginBottom)};return uni.$u.deepMerge(e,uni.$u.addStyle(this.customStyle))}}},[["render",function(e,t,l,a,i,s){const c=f;return o(),n(c,{class:"u-gap",style:_([s.gapStyle])},null,8,["style"])}],["__scopeId","data-v-148cef11"]]);const O=$({name:"u-action-sheet",mixins:[w,T,a,{props:{show:{type:Boolean,default:t.actionSheet.show},title:{type:String,default:t.actionSheet.title},description:{type:String,default:t.actionSheet.description},actions:{type:Array,default:t.actionSheet.actions},cancelText:{type:String,default:t.actionSheet.cancelText},closeOnClickAction:{type:Boolean,default:t.actionSheet.closeOnClickAction},safeAreaInsetBottom:{type:Boolean,default:t.actionSheet.safeAreaInsetBottom},openType:{type:String,default:t.actionSheet.openType},closeOnClickOverlay:{type:Boolean,default:t.actionSheet.closeOnClickOverlay},round:{type:[Boolean,String,Number],default:t.actionSheet.round}}}],data:()=>({}),computed:{itemStyle(){return e=>{let t={};return this.actions[e].color&&(t.color=this.actions[e].color),this.actions[e].fontSize&&(t.fontSize=uni.$u.addUnit(this.actions[e].fontSize)),this.actions[e].disabled&&(t.color="#c0c4cc"),t}}},methods:{closeHandler(){this.closeOnClickOverlay&&this.$emit("close")},cancel(){this.$emit("close")},selectHandler(e){const t=this.actions[e];!t||t.disabled||t.loading||(this.$emit("select",t),this.closeOnClickAction&&this.$emit("close"))}}},[["render",function(t,l,a,u,$,T){const w=g,x=i(s("u-icon"),e),I=f,O=i(s("u-line"),v),j=i(s("u-loading-icon"),C),A=i(s("u-gap"),z),N=i(s("u-popup"),B);return o(),n(N,{show:t.show,mode:"bottom",onClose:T.closeHandler,safeAreaInsetBottom:t.safeAreaInsetBottom,round:t.round},{default:c((()=>[r(I,{class:"u-action-sheet"},{default:c((()=>[t.title?(o(),n(I,{key:0,class:"u-action-sheet__header"},{default:c((()=>[r(w,{class:"u-action-sheet__header__title u-line-1"},{default:c((()=>[m(y(t.title),1)])),_:1}),r(I,{class:"u-action-sheet__header__icon-wrap",onClick:h(T.cancel,["stop"])},{default:c((()=>[r(x,{name:"close",size:"17",color:"#c8c9cc",bold:""})])),_:1},8,["onClick"])])),_:1})):p("v-if",!0),t.description?(o(),n(w,{key:1,class:"u-action-sheet__description",style:_([{marginTop:`${t.title&&t.description?0:"18px"}`}])},{default:c((()=>[m(y(t.description),1)])),_:1},8,["style"])):p("v-if",!0),d(t.$slots,"default",{},(()=>[t.description?(o(),n(O,{key:0})):p("v-if",!0),r(I,{class:"u-action-sheet__item-wrap"},{default:c((()=>[(o(!0),S(b,null,k(t.actions,((e,l)=>(o(),n(I,{key:l},{default:c((()=>[r(I,{class:"u-action-sheet__item-wrap__item",onClick:h((e=>T.selectHandler(l)),["stop"]),"hover-class":e.disabled||e.loading?"":"u-action-sheet--hover","hover-stay-time":150},{default:c((()=>[e.loading?(o(),n(j,{key:1,"custom-class":"van-action-sheet__loading",size:"18",mode:"circle"})):(o(),S(b,{key:0},[r(w,{class:"u-action-sheet__item-wrap__item__name",style:_([T.itemStyle(l)])},{default:c((()=>[m(y(e.name),1)])),_:2},1032,["style"]),e.subname?(o(),n(w,{key:0,class:"u-action-sheet__item-wrap__item__subname"},{default:c((()=>[m(y(e.subname),1)])),_:2},1024)):p("v-if",!0)],64))])),_:2},1032,["onClick","hover-class"]),l!==t.actions.length-1?(o(),n(O,{key:0})):p("v-if",!0)])),_:2},1024)))),128))])),_:1})]),!0),t.cancelText?(o(),n(A,{key:2,bgColor:"#eaeaec",height:"6"})):p("v-if",!0),r(I,{"hover-class":"u-action-sheet--hover"},{default:c((()=>[t.cancelText?(o(),n(w,{key:0,onTouchmove:l[0]||(l[0]=h((()=>{}),["stop","prevent"])),"hover-stay-time":150,class:"u-action-sheet__cancel-text",onClick:T.cancel},{default:c((()=>[m(y(t.cancelText),1)])),_:1},8,["onClick"])):p("v-if",!0)])),_:1})])),_:3})])),_:3},8,["show","onClose","safeAreaInsetBottom","round"])}],["__scopeId","data-v-37c6ec45"]]);export{x as _,I as a,O as b};