bztang-admin/addons/yun_shop/static/app/js/chunk-aed4912e.d592d7ce.js

1 line
3.8 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-aed4912e"],{"05f2":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"lottery_complaint"}},[a("c-title",{attrs:{hide:!1,text:"抽奖投诉"}}),a("div",{staticClass:"title"},[t._v("投诉原因")]),a("van-field",{attrs:{rows:"5",autosize:"",type:"textarea",placeholder:"请描述投诉的内容"},model:{value:t.reason,callback:function(e){t.reason=e},expression:"reason"}}),a("div",{staticClass:"line"}),a("div",{staticClass:"title"},[t._v("上传图片")]),a("div",{directives:[{name:"show",rawName:"v-show",value:!t.sendStatus,expression:"!sendStatus"}],staticClass:"send-btn",on:{click:t.send}},[t._v("提交")]),a("van-uploader",{attrs:{multiple:"","after-read":t.onRead},on:{delete:t.ondelete},model:{value:t.fileList,callback:function(e){t.fileList=e},expression:"fileList"}})],1)},n=[],s=(a("e7e5"),a("d399")),o=(a("14d9"),a("a434"),a("ac1f"),a("00b4"),{data:function(){return{reason:"",photosize:3145728,fileList:[],imgList:[],sendStatus:!1}},components:{},computed:{},deactivated:function(){Object.assign(this.$data,this.$options.data())},methods:{send:function(){var t=this;this.fun.isTextEmpty(this.reason)?Object(s["a"])("请描述投诉的内容"):this.sendStatus||(this.sendStatus=!0,$http.post("plugin.luck-draw.frontend.index.complaint",{activity_id:this.$route.params.id,reason:this.reason,image:this.imgList},"").then((function(e){1==e.result?(t.sendStatus=!1,Object(s["a"])(e.msg),window.history.length<=1?t.$router.push(t.fun.getUrl("home",{})):t.$router.go(-1)):(t.sendStatus=!1,Object(s["a"])(e.msg))})).catch((function(t){})))},onRead:function(t,e){t.status="uploading",t.message="上传中...";var a=new FormData;!0===e?a.append("file",t):a.append("file",t.file);var i=this,n=this.fun.getRealUrl("upload.uploadPic",{});axios.post(n,a,{headers:{"Content-Type":"multipart/form-data"}}).then((function(e){var a=e.data;1===a.result?(t.status="done ",i.imgList.push(a.data.img_url)):(Object(s["a"])(a.msg),t.status="failed",t.message="上传失败")})).catch((function(t){s["a"].clear()}))},ondelete:function(t,e){this.imgList.splice(e.index,1)},onphotosize:function(t){this.imgPreview(t.file,1)},imgPreview:function(t,e){var a=this;if(t&&window.FileReader&&/^image/.test(t.type)){var i=new FileReader;i.readAsDataURL(t),i.onloadend=function(){var e=this.result,i=new Image;i.src=e,i.onload=function(){var e=this.width,n=this.height,s=400,o=400,l=e,r=n;(e>s||n>o)&&(e/n>s/o?(l=s,r=Math.round(s*(n/e))):(r=o,l=Math.round(o*(e/n)))),canvas.width=l,canvas.height=r,context.clearRect(0,0,l,r),context.drawImage(i,0,0,l,r),canvas.toBlob((function(t){a.onRead(t,!0)}),t.type||"image/png")}}}}}}),l=o,r=(a("ec6d"),a("2877")),d=Object(r["a"])(l,i,n,!1,null,"3386aab7",null);e["default"]=d.exports},"08f4":function(t,e,a){var i=a("8b96");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var n=a("499e").default;n("7b342902",i,!0,{sourceMap:!1,shadowMode:!1})},"8b96":function(t,e,a){var i=a("24fb");e=i(!1),e.push([t.i,"#lottery_complaint[data-v-3386aab7]{padding:0 12px 40px;background:#fff}#lottery_complaint .title[data-v-3386aab7]{line-height:36px;text-align:left;font-weight:700;font-size:12px;color:#000}#lottery_complaint .line[data-v-3386aab7]{width:100%;height:1px;background:#f1f1f1;margin:1rem 0}#lottery_complaint .send-btn[data-v-3386aab7]{position:fixed;bottom:1rem;left:50%;margin-left:-10rem;width:20rem;height:2.5rem;line-height:2.5rem;background-color:#f14e4e;border-radius:1.375rem;font-size:18px;color:#fff}#lottery_complaint .van-cell[data-v-3386aab7]{background:#f1f1f1}#lottery_complaint .van-uploader[data-v-3386aab7]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}",""]),t.exports=e},ec6d:function(t,e,a){"use strict";a("08f4")}}]);