2 lines
8.0 KiB
JavaScript
2 lines
8.0 KiB
JavaScript
var e,t;import{Y as a,Z as l,o,j as n,w as u,h as s,y as r,I as i,l as d,z as c,m as p,aw as m,A as h,B as v,a as f,O as _,u as y,G as g,i as b,f as x,s as S,ax as j,ay as V,H as C}from"./index-9bec188e.js";import{_ as B}from"./uv-navbar.c519dc25.js";import{_ as $}from"./uv-rate.a6914fa9.js";import{_ as E}from"./uv-line.e2f06039.js";import{_ as P}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as w}from"./uv-upload.2f331acd.js";import{_ as k}from"./uv-button.9242bdc2.js";import{_ as F}from"./layout.62460c6d.js";import{j as N}from"./order.f67793d3.js";import"./uv-status-bar.6dc37cad.js";/* empty css */import"./uv-icon.27c7246d.js";import"./uv-icon.vue_vue_type_style_index_0_scoped_23936b10_lang.7145f5b2.js";import"./uv-navbar.vue_vue_type_style_index_0_scoped_4c301e25_lang.553ed1e6.js";import"./uv-line.vue_vue_type_style_index_0_scoped_6ea9af94_lang.3331ebc5.js";import"./uv-loading-icon.bfbe6dc1.js";import"./uv-loading-icon.vue_vue_type_style_index_0_scoped_bad0efbf_lang.8998f762.js";import"./uv-popup.f272c9ae.js";import"./uv-overlay.6fe03ce8.js";import"./uv-transition.b971e856.js";import"./createAnimation.e5fefaf6.js";import"./uv-button.vue_vue_type_style_index_0_scoped_bc0e850d_lang.79bfdc50.js";/* empty css */const D=P({name:"uv-textarea",mixins:[a,l,{props:{value:{type:[String,Number],default:""},modelValue:{type:[String,Number],default:""},placeholder:{type:[String,Number],default:""},placeholderClass:{type:String,default:"textarea-placeholder"},placeholderStyle:{type:[String,Object],default:"color: #c0c4cc"},height:{type:[String,Number],default:70},confirmType:{type:String,default:"done"},disabled:{type:Boolean,default:!1},count:{type:Boolean,default:!1},focus:{type:Boolean,default:!1},autoHeight:{type:Boolean,default:!1},fixed:{type:Boolean,default:!1},cursorSpacing:{type:Number,default:0},cursor:{type:[String,Number],default:""},showConfirmBar:{type:Boolean,default:!0},selectionStart:{type:Number,default:-1},selectionEnd:{type:Number,default:-1},adjustPosition:{type:Boolean,default:!0},disableDefaultPadding:{type:Boolean,default:!1},holdKeyboard:{type:Boolean,default:!1},maxlength:{type:[String,Number],default:140},border:{type:String,default:"surround"},formatter:{type:[Function,null],default:null},ignoreCompositionEvent:{type:Boolean,default:!0},confirmHold:{type:Boolean,default:!1},textStyle:{type:[Object,String],default:()=>{}},countStyle:{type:[Object,String],default:()=>{}},...null==(t=null==(e=uni.$uv)?void 0:e.props)?void 0:t.textarea}}],data:()=>({innerValue:"",focused:!1,innerFormatter:e=>e}),created(){this.innerValue=this.modelValue},watch:{value(e){this.innerValue=e},modelValue(e){this.innerValue=e}},computed:{textareaClass(){let e=[],{border:t,disabled:a}=this;return"surround"===t&&(e=e.concat(["uv-border","uv-textarea--radius"])),"bottom"===t&&(e=e.concat(["uv-border-bottom","uv-textarea--no-radius"])),a&&e.push("uv-textarea--disabled"),e.join(" ")},textareaStyle(){return this.$uv.deepMerge({},this.$uv.addStyle(this.customStyle))},maxlen(){return this.maxlength<0?this.maxlength<0?-1:140:this.maxlength},getCount(){try{return this.innerValue.length>this.maxlen?this.maxlen:this.innerValue.length}catch(e){return 0}}},methods:{setFormatter(e){this.innerFormatter=e},onFocus(e){this.$emit("focus",e)},onBlur(e){this.$emit("blur",e),this.$uv.formValidate(this,"blur")},onLinechange(e){this.$emit("linechange",e)},onInput(e){let{value:t=""}=e.detail||{};const a=(this.formatter||this.innerFormatter)(t);this.innerValue=t,this.$nextTick((()=>{this.innerValue=a,this.valueChange()}))},valueChange(){const e=this.innerValue;this.$nextTick((()=>{this.$emit("input",e),this.$emit("update:modelValue",e),this.$emit("change",e),this.$uv.formValidate(this,"change")}))},onConfirm(e){this.$emit("confirm",e)},onKeyboardheightchange(e){this.$emit("keyboardheightchange",e)}}},[["render",function(e,t,a,l,f,_){const y=m,g=h,b=v;return o(),n(b,{class:p(["uv-textarea",_.textareaClass]),style:r([_.textareaStyle])},{default:u((()=>[s(y,{class:"uv-textarea__field",value:f.innerValue,style:r([{height:e.$uv.addUnit(e.height)},e.$uv.addStyle(e.textStyle)]),placeholder:e.placeholder,"placeholder-style":e.$uv.addStyle(e.placeholderStyle,"string"),"placeholder-class":e.placeholderClass,disabled:e.disabled,focus:e.focus,autoHeight:e.autoHeight,fixed:e.fixed,cursorSpacing:e.cursorSpacing,cursor:e.cursor,showConfirmBar:e.showConfirmBar,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd,adjustPosition:e.adjustPosition,disableDefaultPadding:e.disableDefaultPadding,holdKeyboard:e.holdKeyboard,maxlength:_.maxlen,confirmType:e.confirmType,ignoreCompositionEvent:e.ignoreCompositionEvent,"confirm-hold":e.confirmHold,onFocus:_.onFocus,onBlur:_.onBlur,onLinechange:_.onLinechange,onInput:_.onInput,onConfirm:_.onConfirm,onKeyboardheightchange:_.onKeyboardheightchange},null,8,["value","style","placeholder","placeholder-style","placeholder-class","disabled","focus","autoHeight","fixed","cursorSpacing","cursor","showConfirmBar","selectionStart","selectionEnd","adjustPosition","disableDefaultPadding","holdKeyboard","maxlength","confirmType","ignoreCompositionEvent","confirm-hold","onFocus","onBlur","onLinechange","onInput","onConfirm","onKeyboardheightchange"]),e.count&&-1!=_.maxlen?(o(),n(g,{key:0,class:"uv-textarea__count",style:r([{"background-color":e.disabled?"transparent":"#fff"},e.$uv.addStyle(e.countStyle)])},{default:u((()=>[i(d(_.getCount)+"/"+d(_.maxlen),1)])),_:1},8,["style"])):c("",!0)])),_:1},8,["class","style"])}],["__scopeId","data-v-e854b4f2"]]),L=P({__name:"evaluate",setup(e){const{getParams:t,push:a}=y(),l=f(0),r=f(0),d=f(null),c=f([]),p=f([]),m=f("");f(null);const h=f(0),{goBack:P}=y(),L=async()=>{await N([{comment:m.value,pics:c.value.toString(),productScore:l.value,serviceScore:r.value,unique:d.value}])&&(S({title:"评价成功",icon:"none",duration:2e3}),P())},I=e=>{c.value.splice(e.index,1),p.value.splice(e.index,1)},K=async e=>{let t=[].concat(e.file),a=p.value.length;t.map((e=>{p.value.push({...e,status:"uploading",message:"上传中"})}));for(let l=0;l<t.length;l++){const e=await T(t[l].url);let o=p.value[a];p.value.splice(a,1,Object.assign(o,{status:"success",message:"",url:e}));let n=JSON.parse(e);c.value.push(n.data),a++}},T=e=>new Promise(((t,a)=>{j({url:V,filePath:e,name:"file",formData:{user:"test"},success:e=>{setTimeout((()=>{t(e.data)}),1e3)}})}));return _((e=>{const a=t(e);d.value=a.unique,h.value=a.orderId})),(e,t)=>{const a=g(C("uv-navbar"),B),d=v,c=g(C("uv-rate"),$),h=g(C("uv-line"),E),f=g(C("uv-textarea"),D),_=g(C("uv-upload"),w),y=g(C("uv-button"),k),S=g(C("layout"),F);return o(),n(S,{class:"evaluate"},{default:u((()=>[s(a,{fixed:!1,title:"评价","left-arrow":"",onLeftClick:b(P)},null,8,["onLeftClick"]),s(d,{class:"evaluate-card mb-20"},{default:u((()=>[x("div",{class:"evaluate-item"},[s(d,{class:"evaluate-label"},{default:u((()=>[i("商品评价")])),_:1}),s(c,{"active-color":"#EE6D46",count:5,modelValue:l.value,"onUpdate:modelValue":t[0]||(t[0]=e=>l.value=e)},null,8,["modelValue"])]),s(h,{color:"#EE6D46"}),s(d,{class:"evaluate-content"},{default:u((()=>[s(f,{border:"none",modelValue:m.value,"onUpdate:modelValue":t[1]||(t[1]=e=>m.value=e),placeholder:"请填写您遇到的问题,这将帮助我们为您提供更好的服务"},null,8,["modelValue"]),s(_,{fileList:p.value,name:"1",multiple:"",maxCount:10,onAfterRead:K,onDelete:I},null,8,["fileList"])])),_:1})])),_:1}),s(d,{class:"card evaluate-card noBorder"},{default:u((()=>[s(d,{class:"card-head"},{default:u((()=>[s(d,{class:"card-title"},{default:u((()=>[i("服务评价")])),_:1})])),_:1}),s(d,{class:"card-content"},{default:u((()=>[x("div",{class:"evaluate-item min"},[s(d,{class:"evaluate-label"},{default:u((()=>[i("服务评价")])),_:1}),s(c,{"active-color":"#EE6D46",count:5,modelValue:r.value,"onUpdate:modelValue":t[2]||(t[2]=e=>r.value=e)},null,8,["modelValue"])])])),_:1})])),_:1}),x("div",{class:"form-buttons"},[s(y,{round:"",block:"",type:"primary",onClick:L},{default:u((()=>[i(" 提交评论 ")])),_:1})])])),_:1})}}},[["__scopeId","data-v-5bc91d38"]]);export{L as default};
|