chatapp-h5/h5/js/KYC-CJAEMKmd-1776148658686.js
2026-04-14 17:58:21 +08:00

2 lines
12 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.

import{aB as M,_ as R,k as K,r as A,aW as Q,I as Y,o as J,c as m,l as I,q as i,b as t,t as l,m as S,F as X,x as V,v as C,n as Z,J as $,aj as ee,S as P,u as te,j as f,D as U,E as F,y as oe,ab as re,aX as se,aY as ae}from"./index-CIAVq8iD-1776148658686.js";import{a as N,s as D}from"./toast-aIWCznBB-1776148658686.js";import{G as ne}from"./GeneralHeader-ClI1i1Ud-1776148658686.js";import{G as T}from"./GradientBorder-CfwSeIMB-1776148658686.js";import{m as ie}from"./MaskLayer-CMaJd7Gb-1776148658686.js";const le="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAN/SURBVHgB1ZqxSxxBFMY/L02KFBZCTgiyRZSAgoIpBIVsmS7XaGwkKSLkT0jhH5HayjKnggmksEhgDzwwlSIWF6sLRFBIwEAKg4HLfLc7x954ezOzO3u3+cHjdvd27943M2/e29kF/nNG4J67kY0qx6+FXcAxLgTQ2bKwR5GNas6/iKwRWSayCPAQOjyHUEQa2CsUEQi7QgrSCGALP0XovEuOkUKIrYAFYT7St7gJQWRGmAqgw6sIh80gaAp7D4PeuAM9HDKvEAbqoOB/cogyPq77nagTwB96Cf3Mkgfsda2IfgKG6bxEimCA/+11QqnPxZxphum8hD6sJn2Z1AO+sMcoDhTBYfRd/aKUcLKP4uGjx4goJZxYRBgPFfWgKoAK51BcPCi5SBXgw4JKpVI+Ojp6Xq1Wn8CSzc3NhbOzsxf8DdjRVcKomfgNLMoEOjA5Oelxu16vHy8tLX0wuU4I9ldWVtqiT05OGrOzs1WYw2B+G3129QCVWdU4tVrtq9xeXFycOzg4eKa7Ju48EY1ge49AHz25owqwYn19/XBnZ6cm93UiVOd3d3eD5eXlGuzx5EZcQKpaRzgUmIhw6DzpNHZmAUQnwrHzhLNle7jLIKbzr5GR7e1tXzjWcZSBfX5+/sux8xIG8pUU4CEs3DKjiojj0HmyJaxZgmPU4SRx7HwH5wJIq9W6dWx8fDyXyta5ADVgJaZ5whYpINWShkqv2cYmT1jSlYkzC0iaKk3zRAraGTw+hFKL0M3zOYjolB9xAamW+UyTlGMRHQHxW0reNFvdC9hmWCGgOT09PSLM4/7ExER5ZmaGx7/BjkDYD27Ee4CqrmHB1NTUfbltOs+rPSFKaQ92yPXUNmoP3BP2AIZcXl7+nJ+fH9vb2/uytrZWN71O9sTNzc2fjY2Nz41G4zfMOUVMgHpD48FRSZEj7RpI7qiJrAkHa/Y5wgWurtmyVybeh2UsDJBAPdBrYYvOMx4eolgE6DE6kmqhQ4TDqSjIpzi36FfMvYOjGikj9GE/6ct+q9McRlRuvVrhEDq/hT4NqXs+IJPGMERonScmT2ikCN6QjGEwNBE6r01wJgIIRZxG2x7yg//zSdhHJDzQUEn7mNWH+0Vg9jKDNdfHrHGkkCzxwRZndqXzTaTA1bsS8jWDMvQLZGxh+ZqBdQWsksfLHoQi1F65QjHySrH4BzaTXH5XKyilAAAAAElFTkSuQmCC",ce="/assets/addImg-DgEAWGmF-1776148661448.png",de=M("lastImg",{state:()=>({imgUrl:null}),actions:{setLastImgUrl(a){this.imgUrl=a,a?localStorage.setItem("lastImgUrl",a):localStorage.removeItem("lastImgUrl")},initFromStorage(){const a=localStorage.getItem("lastImgUrl");a&&(this.imgUrl=a)},clearCache(){this.imgUrl=null,localStorage.removeItem("lastImgUrl")}},persist:{key:"lastImgUrl",storage:localStorage}});function ue(){return/Android/.test(navigator.userAgent)}function ge(a,o){window.renderData=a,window.getIosAccessOriginParam=a;try{if(window.FlutterPageControl){console.log("使用window.FlutterPageControl.postMessage(`uploadImgFile`)"),window.FlutterPageControl.postMessage("uploadImgFile");try{if(ue()){console.debug("Flutter Android WebView 检测"),console.debug("window.app 对象:",window.app),window.app&&(console.debug("window.app 的所有方法:"),console.debug(Object.keys(window.app)),console.debug("getImagePath 方法存在?",typeof window.app.getImagePath),console.debug("getImagePath 是函数?",typeof window.app.getImagePath=="function"));const u=()=>{let d=0;const g=6e3;window._flutterCheckTimeout&&(clearTimeout(window._flutterCheckTimeout),window._flutterCheckTimeout=null);const v=()=>{if(d++,console.debug(`尝试第 ${d} 次检查Flutter接口...`),window.app&&window.app.getImagePath&&typeof window.app.getImagePath=="function"){console.debug("Flutter接口检测成功调用 getImagePath");try{const p=window.app.getImagePath();if(console.debug("getImagePath 返回结果:",p),o&&typeof o=="function"&&!o(p))if(console.debug("数据被过滤函数拒绝,继续检查..."),d<g){window._flutterCheckTimeout=setTimeout(v,100);return}else{console.error("Flutter接口注入超时使用默认数据");const _=JSON.stringify({});a(_);return}window._flutterCheckTimeout&&(clearTimeout(window._flutterCheckTimeout),window._flutterCheckTimeout=null),a(p)}catch(p){console.error("调用 getImagePath 出错:",p)}}else if(d<g)window._flutterCheckTimeout=setTimeout(v,100);else{console.error("Flutter接口注入超时使用默认数据"),window._flutterCheckTimeout&&(clearTimeout(window._flutterCheckTimeout),window._flutterCheckTimeout=null);const p=JSON.stringify({});a(p)}};v()};if(window.app)u();else{console.debug("等待Flutter注入window.app...");let d=0;const g=()=>{d++,window.app?(console.debug("检测到window.app开始连接"),u()):d<50?setTimeout(g,100):(console.error("等待window.app超时"),window.FlutterApp&&window.FlutterApp.postMessage&&window.FlutterApp.postMessage("requestAccessOrigin"))};g()}}else console.debug("非移动设备环境"),console.warn("Not in APP environment, using mock data for development")}catch(u){console.error("Failed to connect to APP:",u)}}else{console.log("window.FlutterPageControl不存在");const u=JSON.stringify("");a(u)}}catch(u){console.error("调出图片选择界面失败:",u);const d=JSON.stringify("");a(d)}}function E(a){try{return{success:!0,data:JSON.parse(a)}}catch(o){return console.error("Failed to parse access origin:",o),{success:!1,error:"accessOrigin Error.",data:null}}}const pe={class:"fullPage"},me={style:{padding:"16px",display:"flex","flex-direction":"column",gap:"8px"}},fe={style:{"font-weight":"600"}},we={style:{padding:"12px"}},he=["placeholder"],ye={style:{"font-weight":"600"}},ve={style:{padding:"12px 12px 20px",position:"relative"}},ke=["placeholder"],Ae={style:{position:"absolute",bottom:"4px",right:"4px",color:"rgba(0, 0, 0, 0.4)","font-size":"0.8em"},class:"word-count"},_e={style:{"font-weight":"600"}},be={style:{display:"flex","align-items":"center",gap:"1vw"}},xe=["src"],Ie=["onClick"],Se={key:0,style:{position:"relative"}},Ce={key:0,style:{display:"flex","align-items":"flex-end",gap:"8px"}},Ne={style:{"font-weight":"600"}},Pe={key:0,style:{"font-weight":"510","font-size":"0.9em",background:"linear-gradient(248deg, #75ff98 5.66%, #3dff54 42.49%)","background-clip":"text","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}},Ue={key:1,style:{"font-weight":"510","font-size":"0.9em",background:"linear-gradient(248deg, #ff7578 5.66%, #ff3d40 42.49%)","background-clip":"text","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}},Fe={key:2,style:{"font-weight":"510","font-size":"0.9em",background:"linear-gradient(248deg, #ffe675 5.66%, #ffc53d 42.49%)","background-clip":"text","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}},De={style:{display:"flex","justify-content":"center","align-items":"center"}},Te={key:0,style:{color:"#fff","font-weight":"590","text-align":"center"}},Ee={key:1,style:{color:"#fff","font-weight":"590","text-align":"center"}},Be={style:{"min-height":"100vh",display:"flex","justify-content":"center","align-items":"center"}},Oe={style:{padding:"20px 20px 0 20px"}},We={style:{margin:"0","font-size":"1.5em","font-weight":"700",color:"rgba(0, 0, 0, 0.8)","text-align":"center"}},ze={style:{padding:"8px 20px"}},je={style:{"font-size":"1.2em","font-weight":"600",color:"rgba(0, 0, 0, 0.4)","line-height":"1.5"}},Ge={style:{display:"flex",gap:"12px",padding:"0 20px 20px 20px"}},qe={__name:"KYC",setup(a){const{t:o,locale:u}=K(),d=te(),g=$(),v=A(g.query||null),p=de();p.initFromStorage();const{imgUrl:_}=Q(p);u.value&&Y(u.value);const k=A(!1),B=P(()=>n.value.otherDescription.length),w=A([]),b=A(!1),n=A({id:"",contactNumber:"",category:"CARD",otherDescription:"",passportFrontUrl:"",passportBackUrl:"meaningless"}),x=P(()=>{const e=n.value.contactNumber.trim();return e.length<=50&&e!=""&&w.value.length>0}),O=e=>{n.value.contactNumber=e.target.value.trim()},W=async()=>{try{await z()}catch(e){console.error("图片选择失败:",e)}},z=async()=>{if(console.log("调用原生图片选择器"),w.value.length>=3)throw new Error("Maximum number of images reached");const e=r=>{try{if(!r||r==='""'||r==="")return!0;const s=E(r);if(s.success&&s.data){const c=s.data;return console.log("检查图片数据:",c.path),_.value&&c.path===_.value?(console.log("检测到重复图片,继续等待新图片..."),!1):!0}return!0}catch(s){return console.error("过滤图片数据时出错:",s),!0}};return new Promise((r,s)=>{try{ge(async c=>{try{if(!c||c==='""'||c===""){console.warn("接收到空的图片数据"),s(new Error("No image selected"));return}const h=E(c);if(h.success&&h.data){const y=h.data;console.log("接收到原生图片数据:",y.path),p.setLastImgUrl(y.path),w.value.push(y.path),r()}else{const y=h.error;console.error("图片选择失败:",y),s(new Error(y))}}catch(h){console.error("处理原生图片选择结果失败:",h),s(h)}},e)}catch(c){console.error("调用原生图片选择器失败:",c),s(c)}})},j=e=>{w.value.splice(e,1)},G=async()=>{console.log("checkStatus.value:",x.value),x.value&&(n.value.passportFrontUrl=JSON.stringify(w.value),b.value?(console.log("更新信息:",n.value),await L()):(console.log("添加信息:",n.value),await H()),k.value=!1,d.go(-1),g.query&&(console.log("route.query:",g.query),re(()=>{d.replace({path:g.query.from,query:{activeAction:g.query.activeAction}})})))},q=async()=>{try{const e=await ee();if(console.log("提现信息列表:",e),e.status&&e.body?.length>0){b.value=!0,n.value=e.body[0];let r=JSON.parse(e.body[0].passportFrontUrl);w.value=r.map(s=>s)}}catch(e){console.error("获取提现信息列表失败:",e),N(e.response?.errorMsg)}},H=async()=>{try{(await ae(n.value)).status&&D(o("application_submitted"))}catch(e){throw N(e.response?.errorMsg),e}},L=async()=>{try{(await se(n.value)).status&&D(o("application_submitted"))}catch(e){throw N(e.response?.errorMsg),e}};return J(()=>{q()}),(e,r)=>(f(),m("div",pe,[I(ne,{showLanguageList:!0,title:i(o)("kyc"),backQuery:v.value,style:{width:"100%"},color:"black"},null,8,["title","backQuery"]),t("div",me,[t("div",fe,l(i(o)("contact_number")),1),I(T,null,{default:S(()=>[t("div",we,[U(t("input",{type:"text","onUpdate:modelValue":r[0]||(r[0]=s=>n.value.contactNumber=s),placeholder:i(o)("enter_contact_number"),maxlength:"50",onBlur:O,style:{width:"100%",border:"none",outline:"none","background-color":"transparent"}},null,40,he),[[F,n.value.contactNumber]])])]),_:1}),t("div",ye,l(i(o)("other_description")),1),I(T,null,{default:S(()=>[t("div",ve,[U(t("textarea",{"onUpdate:modelValue":r[1]||(r[1]=s=>n.value.otherDescription=s),rows:"5",maxlength:"100",placeholder:i(o)("enter_other_description"),style:{width:"100%",border:"none",outline:"none",resize:"none","background-color":"transparent"}},null,8,ke),[[F,n.value.otherDescription]]),t("span",Ae,l(B.value)+"/100",1)])]),_:1}),t("div",_e,l(i(o)("passport_id_card_title"))+":",1),t("div",be,[(f(!0),m(X,null,V(w.value,(s,c)=>(f(),m("div",{key:c,style:{position:"relative"}},[t("img",{src:s,alt:"",style:{display:"block",width:"15vw","aspect-ratio":"1/1","object-fit":"cover","border-radius":"5vw"}},null,8,xe),t("img",{src:le,alt:"",style:{position:"absolute",top:"0",right:"0",display:"block",width:"3vw","aspect-ratio":"1/1","object-fit":"cover"},onClick:h=>j(c)},null,8,Ie)]))),128)),w.value.length<3?(f(),m("div",Se,[r[6]||(r[6]=t("img",{src:ce,alt:"",style:{display:"block",width:"15vw","aspect-ratio":"1/1","object-fit":"cover"}},null,-1)),t("button",{onClick:W,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:"pointer",border:"none"}})])):C("",!0)]),b.value?(f(),m("div",Ce,[t("div",Ne,l(i(o)("current_status")),1),n.value.status==="PASS"?(f(),m("div",Pe,l(i(o)("review_passed")),1)):n.value.status==="NOT_PASS"?(f(),m("div",Ue,l(i(o)("review_failed")),1)):n.value.status==="PENDING"?(f(),m("div",Fe,l(i(o)("awaiting_review")),1)):C("",!0)])):C("",!0),t("div",De,[t("div",{style:Z([{"margin-top":"10px",width:"80%","border-radius":"32px",padding:"12px"},{background:x.value?"linear-gradient(269deg, #FEB219 7.04%, #FF9326 96.78%)":"linear-gradient(135deg, #D1CED6 2.82%, #7C7882 99.15%)"}]),onClick:r[2]||(r[2]=s=>x.value?k.value=!0:"")},[b.value?(f(),m("div",Te,l(i(o)("change_kyc")),1)):(f(),m("div",Ee,l(i(o)("submit")),1))],4)])]),I(ie,{maskLayerShow:k.value,onClick:r[5]||(r[5]=s=>k.value=!1)},{default:S(()=>[t("div",Be,[t("div",{style:{position:"relative",margin:"20% 5%","background-color":"white","border-radius":"12px"},onClick:r[4]||(r[4]=oe(()=>{},["stop"]))},[t("div",Oe,[t("div",We,l(i(o)("tips")),1)]),t("div",ze,[t("div",je,l(i(o)("confirm_modify_kyc")),1)]),t("div",Ge,[t("button",{class:"cancel-btn",onClick:r[3]||(r[3]=s=>k.value=!1)},l(i(o)("cancel")),1),t("button",{class:"confirm-btn",onClick:G},l(i(o)("confirm")),1)])])])]),_:1},8,["maskLayerShow"])]))}},Qe=R(qe,[["__scopeId","data-v-d8c3524d"]]);export{Qe as default};