jt360front/dist/static/js/6.3a8dced414d8fad7b918.js
2025-06-25 12:11:39 +08:00

2 lines
4.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

webpackJsonp([6],{"2sHx":function(t,e,a){t.exports=a.p+"static/img/tip.039dde0.png"},C0fP:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});a("34+y");var i=a("X+yh"),n=a.n(i),o=(a("OgVB"),a("/Lyv")),r=a.n(o),l=a("NYxO"),s=a("Vr0m"),p=a("mtWM"),c=a.n(p),u=a("VKKs"),d=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(t[i]=a[i])}return t},m={data:function(){return{imageUrl:"",file:null,filename:"",photopath:"",ImgObj:new Image}},components:{Back:s.a},methods:{change:function(t){this.filename=t.target.files[0].name,this.file=t.target.files[0],console.log("file文件"+this.file.type);var e=new FileReader,a=this;e.readAsDataURL(this.file),e.onload=function(t){console.log("读取成功"),a.imageUrl=t.target.result}},upload:function(){var t=this;console.log("证件号为:"+this.$refs.getValue.value);var e=["image/jpeg","image/JPEG","image/jpg","image/JPG","image/png","image/PNG"],a=this.filename;if(console.log("filepath:=="+a),a){for(var i=!1,o=0;o<e.length;o++)if(e[o]==this.file.type){i=!0;break}if(!i)return r.a.alert('证件照的后缀名必须为".jpg", ".png", ".jpeg",格式'),this.file="",this.filename="",!1;r.a.confirm("确定上传该证件照吗?").then(function(e){var a=new FormData;a.append("file",t.file),a.append("filename",t.$refs.getValue.value+".jpg"),a.append("apitoken",Object(u.a)("token"));c.a.post("http://admin.jiangtang360.com/api/card/uploadcardimage",a,{headers:{}}).then(function(t){console.log(t),n()("上传成功"),location.reload()},function(t){n()("上传失败,请刷新后再次尝试上传")})},function(){})}else r.a.alert("请重新选择符合要求的证件照")},photoPreview:function(){this.$router.push({path:"/photoPreview"})}},created:function(){},mounted:function(){this.photopath="http://admin.jiangtang360.com/static/admin/cards/"+this.$refs.getValue.value+".jpg?ran="+Math.random(),this.ImgObj.src="http://admin.jiangtang360.com/static/admin/cards/"+this.$refs.getValue.value+".jpg?ran="+Math.random()},computed:d({},Object(l.c)(["loginInfo","apitoken"]))},f={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"file"},[i("back",{attrs:{title:"证件照上传"}}),t._v(" "),1==t.loginInfo.need_upload_photo?i("div",[i("img",{attrs:{src:a("2sHx"),width:"100%",height:"30%"}}),t._v(" "),i("div",{staticClass:"imgreplace"},[i("label",{staticClass:"input-file-button",attrs:{for:"upload"}},[t._v("选择证件照")]),t._v(" "),i("input",{ref:"updata",staticClass:"updata",attrs:{type:"file",accept:"image/*",id:"upload"},on:{change:function(e){return t.change(e)}}}),t._v(" "),i("mt-button",{staticStyle:{"margin-top":"10px"},attrs:{type:"primary",size:"small"},on:{click:function(e){return t.upload()}}},[t._v("上传证件照")])],1),t._v(" "),""!=t.filename?i("p",{attrs:{"padding-top":"33px"}},[t._v("您上传的证件照名:"+t._s(t.filename))]):t._e(),t._v(" "),i("img",{staticClass:"img",attrs:{src:t.imageUrl,alt:"",title:"预览"}}),i("br"),t._v(" "),i("input",{ref:"getValue",attrs:{type:"hidden"},domProps:{value:t.loginInfo.member_passport}}),t._v(" "),i("input",{directives:[{name:"model",rawName:"v-model",value:t.filename,expression:"filename"}],attrs:{type:"hidden"},domProps:{value:t.filename},on:{input:function(e){e.target.composing||(t.filename=e.target.value)}}}),t._v(" "),i("input",{directives:[{name:"model",rawName:"v-model",value:t.photopath,expression:"photopath"}],attrs:{type:"hidden",id:""},domProps:{value:t.photopath},on:{input:function(e){e.target.composing||(t.photopath=e.target.value)}}}),t._v(" "),i("h2",{staticStyle:{"padding-top":"1em","font-size":"2.3em"}},[t._v("已上传的证件照")]),t._v(" "),i("h2",[t._v("(点击证件照预览)")]),t._v(" "),i("img",{staticStyle:{width:"36%",border:"1px solid","box-shadow":"10px 10px 10px rgba(0, 0, 0, 0.5)"},attrs:{src:t.photopath,alt:""},on:{click:function(e){return t.photoPreview()}}})]):1!=t.loginInfo.need_upload_photo?i("div",[i("h1",[t._v("暂未规定上传证件照")])]):t._e()],1)},staticRenderFns:[]};var g=a("VU/8")(m,f,!1,function(t){a("ta32")},"data-v-7876e678",null);e.default=g.exports},ta32:function(t,e){}});
//# sourceMappingURL=6.3a8dced414d8fad7b918.js.map