89 lines
8.7 KiB
JavaScript
89 lines
8.7 KiB
JavaScript
$gwx_XC_6=function(_,_v,_n,_p,_s,_wp,_wl,$gwn,$gwl,$gwh,wh,$gstack,$gwrt,gra,grb,TestTest,wfor,_ca,_da,_r,_rz,_o,_oz,_1,_1z,_2,_2z,_m,_mz,nv_getDate,nv_getRegExp,nv_console,nv_parseInt,nv_parseFloat,nv_isNaN,nv_isFinite,nv_decodeURI,nv_decodeURIComponent,nv_encodeURI,nv_encodeURIComponent,$gdc,nv_JSON,_af,_gv,_ai,_grp,_gd,_gapi,$ixc,_ic,_w,_ev,_tsd){return function(path,global){
|
|
if(typeof global==='undefined'){if (typeof __GWX_GLOBAL__==='undefined')global={};else global=__GWX_GLOBAL__;}if(typeof __WXML_GLOBAL__ === 'undefined') {__WXML_GLOBAL__={};
|
|
}__WXML_GLOBAL__.modules = __WXML_GLOBAL__.modules || {};
|
|
var e_={}
|
|
if(typeof(global.entrys)==='undefined')global.entrys={};e_=global.entrys;
|
|
var d_={}
|
|
if(typeof(global.defines)==='undefined')global.defines={};d_=global.defines;
|
|
var f_={}
|
|
if(typeof(global.modules)==='undefined')global.modules={};f_=global.modules || {};
|
|
var p_={}
|
|
__WXML_GLOBAL__.ops_cached = __WXML_GLOBAL__.ops_cached || {}
|
|
__WXML_GLOBAL__.ops_set = __WXML_GLOBAL__.ops_set || {};
|
|
__WXML_GLOBAL__.ops_init = __WXML_GLOBAL__.ops_init || {};
|
|
var z=__WXML_GLOBAL__.ops_set.$gwx_XC_6 || [];
|
|
function gz$gwx_XC_6_1(){
|
|
if( __WXML_GLOBAL__.ops_cached.$gwx_XC_6_1)return __WXML_GLOBAL__.ops_cached.$gwx_XC_6_1
|
|
__WXML_GLOBAL__.ops_cached.$gwx_XC_6_1=[];
|
|
(function(z){var a=11;function Z(ops){z.push(ops)}
|
|
Z([[2,'!'],[[7],[3,'sh']]])
|
|
Z([[2,'=='],[[7],[3,'status']],[1,'0']])
|
|
Z([3,'fromSubmit'])
|
|
Z([[7],[3,'isUp']])
|
|
Z([[2,'=='],[[7],[3,'status']],[1,'1']])
|
|
Z([[2,'=='],[[7],[3,'status']],[1,'3']])
|
|
Z([[2,'||'],[[2,'=='],[[7],[3,'status']],[1,'2']],[[7],[3,'sh']]])
|
|
})(__WXML_GLOBAL__.ops_cached.$gwx_XC_6_1);return __WXML_GLOBAL__.ops_cached.$gwx_XC_6_1
|
|
}
|
|
__WXML_GLOBAL__.ops_set.$gwx_XC_6=z;
|
|
__WXML_GLOBAL__.ops_init.$gwx_XC_6=true;
|
|
var x=['./pages/main/main.wxml'];d_[x[0]]={}
|
|
var m0=function(e,s,r,gg){
|
|
var z=gz$gwx_XC_6_1()
|
|
var eN=_v()
|
|
_(r,eN)
|
|
if(_oz(z,0,e,s,gg)){eN.wxVkey=1
|
|
var oP=_n('view')
|
|
var xQ=_v()
|
|
_(oP,xQ)
|
|
if(_oz(z,1,e,s,gg)){xQ.wxVkey=1
|
|
var cT=_n('form')
|
|
_rz(z,cT,'bindsubmit',2,e,s,gg)
|
|
var hU=_v()
|
|
_(cT,hU)
|
|
if(_oz(z,3,e,s,gg)){hU.wxVkey=1
|
|
}
|
|
hU.wxXCkey=1
|
|
_(xQ,cT)
|
|
}
|
|
var oR=_v()
|
|
_(oP,oR)
|
|
if(_oz(z,4,e,s,gg)){oR.wxVkey=1
|
|
}
|
|
var fS=_v()
|
|
_(oP,fS)
|
|
if(_oz(z,5,e,s,gg)){fS.wxVkey=1
|
|
}
|
|
xQ.wxXCkey=1
|
|
oR.wxXCkey=1
|
|
fS.wxXCkey=1
|
|
_(eN,oP)
|
|
}
|
|
var bO=_v()
|
|
_(r,bO)
|
|
if(_oz(z,6,e,s,gg)){bO.wxVkey=1
|
|
}
|
|
eN.wxXCkey=1
|
|
bO.wxXCkey=1
|
|
return r
|
|
}
|
|
e_[x[0]]={f:m0,j:[],i:[],ti:[],ic:[]}
|
|
if(path&&e_[path]){
|
|
return function(env,dd,global){$gwxc=0;var root={"tag":"wx-page"};root.children=[]
|
|
;g="$gwx_XC_6";var main=e_[path].f
|
|
if (typeof global==="undefined")global={};global.f=$gdc(f_[path],"",1);
|
|
try{
|
|
main(env,{},root,global);
|
|
_tsd(root)
|
|
}catch(err){
|
|
console.log(err)
|
|
}
|
|
;g="";
|
|
return root;
|
|
}
|
|
}
|
|
}
|
|
}(__g.a,__g.b,__g.c,__g.d,__g.e,__g.f,__g.g,__g.h,__g.i,__g.j,__g.k,__g.l,__g.m,__g.n,__g.o,__g.p,__g.q,__g.r,__g.s,__g.t,__g.u,__g.v,__g.w,__g.x,__g.y,__g.z,__g.A,__g.B,__g.C,__g.D,__g.E,__g.F,__g.G,__g.H,__g.I,__g.J,__g.K,__g.L,__g.M,__g.N,__g.O,__g.P,__g.Q,__g.R,__g.S,__g.T,__g.U,__g.V,__g.W,__g.X,__g.Y,__g.Z,__g.aa);if(__vd_version_info__.delayedGwx||false)$gwx_XC_6(); if (__vd_version_info__.delayedGwx) __wxAppCode__['pages/main/main.wxml'] = [$gwx_XC_6, './pages/main/main.wxml'];else __wxAppCode__['pages/main/main.wxml'] = $gwx_XC_6( './pages/main/main.wxml' );
|
|
;__wxRoute = "pages/main/main";__wxRouteBegin = true;__wxAppCurrentFile__="pages/main/main.js";define("pages/main/main.js",function(require,module,exports,window,document,frames,self,location,navigator,localStorage,history,Caches,screen,alert,confirm,prompt,XMLHttpRequest,WebSocket,Reporter,webkit,WeixinJSCore){
|
|
"use strict";var t=require("../../@babel/runtime/helpers/regeneratorRuntime"),a=require("../../@babel/runtime/helpers/asyncToGenerator"),e=require("../../utils/request"),o=require("../../utils/loading.js");Page({data:{sh:!0,imgList:[],maxCount:3,isUp:!0,openid:"",status:null,indexData:null,timeStr:""},indexData:function(){var t=this;e.request({url:"/index.php?s=/api/api/indexData",method:"GET",showLoading:!1}).then((function(a){console.log(a),t.setData({indexData:a.data.data.res}),t.setData({sh:a.data.data.res.shenhe})})).catch((function(t){console.log("ERROR")}))},wxLogin:function(){var t=this;wx.login({success:function(a){a.code?e.request({url:"/index.php?s=/api/api/login",method:"GET",showLoading:!1,data:{code:a.code}}).then((function(a){console.log(a),t.setData({openid:a.data.data.openid}),t.getInfo(),t.getList()})).catch((function(t){console.log("ERROR")})):console.log("登录失败!"+a.errMsg)}})},getList:function(){var t=this,a=this.data.openid;a||(a=""),e.request({method:"GET",showLoading:!1,url:"/index.php?s=/api/api/userbj",data:{openid:a}}).then((function(a){console.log(a),t.setData({a1000:a.data.data.res.a_1000,a1200:a.data.data.res.a_1200,timeStr:a.data.data.res.timeStr})})).catch((function(t){console.log("ERROR")}))},dowimg:function(){var t=this.data.openid;t||(t=""),o.showLoading("下载中"),e.request({method:"GET",showLoading:!1,url:"/index.php?s=/api/api/userbjimg",data:{openid:t}}).then((function(t){console.log(t);t.data.data.img_base64;var a=t.data.data.img_url;wx.downloadFile({url:a,success:function(t){200===t.statusCode&&wx.saveImageToPhotosAlbum({filePath:t.tempFilePath,success:function(t){o.hideLoading(),wx.showToast({title:"保存图片成功!"})},fail:function(t){o.hideLoading(),wx.showToast({title:"保存图片失败!"})}})}})})).catch((function(t){console.log("ERROR")}))},getInfo:function(){var t=this;e.request({url:"/index.php?s=/api/api/userInfo",method:"GET",showLoading:!1,data:{openid:t.data.openid}}).then((function(a){console.log(a),t.setData({status:a.data.data.status})})).catch((function(t){console.log("ERROR")}))},fromSubmit:function(t){var a=this,o=t.detail.value;""!=o.username?""!=o.phone?""!=o.number?""!=o.tjr_phone?(o.images=a.data.imgList,o.openid=a.data.openid,e.request({url:"/index.php?s=/api/api/register",method:"POST",showLoading:!1,data:o}).then((function(t){return 1==t.data.code?(a.setData({status:t.data.data.status}),void wx.showToast({title:"注册成功",icon:"none",duration:3e3})):void wx.showToast({title:"注册失败",icon:"none",duration:3e3})})).catch((function(t){console.log("ERROR")}))):wx.showToast({title:"业务员手机号还没输入呢",icon:"none",duration:3e3}):wx.showToast({title:"您的身份证号还没输入呢",icon:"none",duration:3e3}):wx.showToast({title:"您的手机号还没输入呢",icon:"none",duration:3e3}):wx.showToast({title:"您的称呼还没输入呢",icon:"none",duration:3e3})},uploadImage:function(){var e=this;return a(t().mark((function a(){var o,n,i,s,d,r;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=(o=e).data.imgList,i=o.data.maxCount,t.prev=3,t.next=6,wx.chooseMedia({count:i-n.length,mediaType:["image"],sourceType:["album","camera"],maxDuration:30,sizeType:["compressed"],camera:"back"});case 6:if("chooseMedia:ok"==(s=t.sent).errMsg){t.next=10;break}return wx.showToast({title:"上传失败",icon:"none",duration:3e3}),t.abrupt("return");case 10:if("image"==s.type){t.next=13;break}return wx.showToast({title:"只能上传图片类型",icon:"none",duration:3e3}),t.abrupt("return");case 13:for(wx.showLoading({title:"图片上传中"}),d=s.tempFiles,r=0;r<d.length;r++)wx.uploadFile({name:"iFile",url:"https://lvcai.19year.cn/index.php?s=/api/upload/image&wxapp_id=10001",filePath:d[r].tempFilePath,success:function(t){var a=JSON.parse(t.data);console.log(a.data),1==a.code?(console.log(),n.push(a.data.file_path),o.setData({imgList:n}),wx.hideLoading(),o.data.imgList.length>=o.data.maxCount&&o.setData({isUp:!1})):(wx.hideLoading(),wx.showModal({title:"提示",content:"上传失败",showCancel:!1}))}});t.next=21;break;case 18:t.prev=18,t.t0=t.catch(3),console.log(t.t0);case 21:case"end":return t.stop()}}),a,null,[[3,18]])})))()},reBackImg:function(t){var a=t.currentTarget.dataset.index;console.log(a);var e=this.data.imgList;e.splice(a,1),e.length<this.data.maxCount&&this.setData({isUp:!0}),this.setData({imgList:e})},previewImg:function(t){console.log("放大图片");var a=t.currentTarget.dataset.index,e=this.data.imgList[a];wx.previewImage({current:e,urls:this.data.imgList})},calling:function(){var t=this.data.openid;e.request({url:"/index.php?s=/api/api/phone",method:"GET",showLoading:!1,data:{openid:t}}).then((function(t){wx.makePhoneCall({phoneNumber:t.data.data.phone,success:function(){console.log("拨打电话成功!")},fail:function(){console.log("拨打电话失败!")}})})).catch((function(t){console.log("ERROR")}))},onLoad:function(t){this.wxLogin(),this.indexData()},onReady:function(){},onShow:function(){this.data.openid&&(this.getInfo(),this.getList())},onHide:function(){},onUnload:function(){},onPullDownRefresh:function(){},onReachBottom:function(){},onShareAppMessage:function(){}});
|
|
},{isPage:true,isComponent:true,currentFile:'pages/main/main.js'});require("pages/main/main.js"); |