"use strict";const e=require("../common/vendor.js"),s=require("../api/api.js");exports.call=s=>e.index.makePhoneCall({phoneNumber:s}),exports.copy=s=>e.index.setClipboardData({data:s,success:function(){console.log("success")}}),exports.lookImg=s=>{e.index.previewImage({urls:s})},exports.uploadFiles=o=>new Promise((async(t,a)=>{let l=await s.getOssUploadParams();const n={policy:l.policy,OSSAccessKeyId:l.accessId,success_action_status:200,signature:l.signature,key:l.dir+Date.now()+Math.floor(1e5+9e5*Math.random())+"."+o.substring(o.lastIndexOf(".")+1)};e.index.uploadFile({url:l.host,filePath:o,header:{"content-type":"multipart/form-data"},name:"file",formData:n,success:e=>{t(n.key)},fail:e=>{console.log(e),a(e)}}),console.log()})),exports.urlQuery=e=>{let s=e;s=s.split("?")[1];const o=s?s.split("&"):[],t={};for(let a=0;a<o.length;++a){const[e,s]=o[a].split("=");t[e]=t[e]||decodeURIComponent(s)}return t};
