"use strict";const e=require("../common/vendor.js"),o=require("./IDCardVerification.js"),i=require("./base64.js"),t=require("../config/host.js"),n={loginModalState:!0,getloctiontime(){e.index.request({url:"https://restapi.amap.com/v5/direction/driving",method:"POST",data:{key:"高德地图KEY",origin:"",destination:"",waypoints:"",show_fields:"cost"},success(e){console.log(e)}})},urlToObj:e=>{let o={},i=e.slice(e.indexOf("?")+1).split("&");for(let t=i.length,n=0;n(console.log("file",o),new Promise(((n,s)=>{e.index.showLoading({title:"上传中"});let r={},c=e.index.getStorageSync("access_token");r["Blade-Auth"]=`bearer ${c}`,r.Authorization=`Basic ${i.base64.encode(t.APPKEY)}`,e.index.uploadFile({url:`${t.host}blade-resource/oss/endpoint/put-file`,filePath:o,name:"file",header:r,success:o=>{e.index.hideLoading(),console.log(123123),n(JSON.parse(o.data).data)}})}))),imgurl:e=>e?-1==e.indexOf("http")?t.imghost+e:e:"",error:o=>new Promise(((i,t)=>{e.index.showToast({title:o,icon:"none",duration:2e3}),setTimeout((()=>{i()}),2e3)})),success:o=>new Promise(((i,t)=>{e.index.showToast({title:o,icon:"success",duration:2e3}),setTimeout((()=>{i()}),2e3)})),confirm:o=>new Promise(((i,t)=>{e.index.showModal({title:"提示",content:o,success:function(e){e.confirm&&i()}})})),payment:o=>new Promise(((i,t)=>{e.index.requestPayment({provider:"wxpay",timeStamp:o.timeStamp,nonceStr:o.nonceStr,package:o.package,signType:o.signType,paySign:o.paySign,success:function(e){i(e)},fail:function(e){console.log(e),n.error("支付失败")}})})),checkFormat_IDCardNumber:e=>""!=e&&(!1===/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(e)?(console.log("错误1"),!1):!1===o.checkIDCard_province(e)?(console.log("错误2"),!1):!1===o.checkIDCard_birthday(e)?(console.log("错误3"),!1):!1!==o.checkParity(e)||(console.log("错误4"),!1))};exports.api=n;