You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
2.1 KiB
2 lines
2.1 KiB
"use strict";const e=require("../../common/vendor.js"),o=require("../../sheep/config/index.js");Array||e.resolveComponent("uni-file-picker")();const f=()=>"../../uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.js";Math||(h+f)();const h=()=>"../components/header_tops_tips.js",g={__name:"authentication",setup(r){const a=e.ref(null),u=e.ref(null),n=e.ref(null);function d(i){l(i.tempFilePaths,1)}function p(i){l(i.tempFilePaths,2)}function _(i){l(i.tempFilePaths,3)}function l(i,c){e.index.uploadFile({url:`${o.baseUrl+o.apiPath}/infra/file/upload`,filePath:i[0],name:"file",method:"post",header:{"tenant-id":1,Authorization:e.index.getStorageSync("token")},success:t=>{const s=JSON.parse(t.data);if(s.code==0)switch(c){case 1:a.value=s.data;break;case 2:u.value=s.data;break;case 3:n.value=s.data;break}}})}function m(){a.value==""||a.value==null?e.index.showModal({title:"请上传",content:"请先上传身份证正面照",success:i=>{}}):u.value==""||u.value==null?e.index.showModal({title:"请上传",content:"请先上传身份证反面照",success:i=>{}}):n.value==""||n.value==null?e.index.showModal({title:"请上传",content:"请先上传本人头像照",success:i=>{}}):e.index.request({url:`${o.baseUrl+o.apiPath}/share/member-ext/update`,method:"PUT",data:{id:e.index.getStorageSync("userId"),idCardFront:a.value,idCardBack:u.value,selfPhoto:n.value,realNameAuthFlag:"2"},header:{"tenant-id":1,Authorization:e.index.getStorageSync("token")},success:i=>{i.data.code==0?(e.index.showToast({title:"认证成功",icon:"success"}),e.index.redirectTo({url:"/pages/index/immediately"})):e.index.showToast({title:i.data.msg,icon:"error"})},fail:i=>{console.log(i,"error")}})}return(i,c)=>({a:e.o(d),b:e.p({limit:"1",title:"请点击上传身份证正面照"}),c:e.o(p),d:e.p({limit:"1",title:"请点击上传身份证国徽面"}),e:e.o(_),f:e.p({limit:"1",title:"请点击上传本人头像照"}),g:e.o((...t)=>i.upper&&i.upper(...t)),h:e.o((...t)=>i.lower&&i.lower(...t)),i:e.o(m)})}},F=e._export_sfc(g,[["__scopeId","data-v-c0b6cdef"],["__file","D:/xiangmu/佰安出行/app/s-applet/pages/index/authentication.vue"]]);wx.createPage(F);
|