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
1.6 KiB
2 lines
1.6 KiB
1 year ago
|
"use strict";const e=require("../common/vendor.js"),o=require("./IDCardVerification.js"),i=require("../config/host.js"),t={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<t;n++){let e=i[n].split("=");o[e[0]]=e[1]}return o},upfile:o=>new Promise(((t,n)=>{e.index.showLoading({title:"上传中"}),e.index.uploadFile({url:`${i.host}/other/upload`,filePath:o,name:"file",success:o=>{e.index.hideLoading(),t(JSON.parse(o.data).data)}})})),imgurl:e=>e?-1==e.indexOf("http")?i.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,n)=>{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),t.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=t;
|