function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } $().ready(function(){ // wxLogin(); }) function wxLogin(callback) { var appId = 'wx5368d1cefb12d04e'; var oauth_url = 'https://tbk.726p.com/api/v2/yys/getYysrebate'; var url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appId + "&redirect_uri=" + location.href.split('#')[0] + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect" var code = getUrlParam("code"); if (!code) { window.location = url; } else { $.ajax({ type: 'GET', url: oauth_url, dataType: 'json', data: { code: code }, success: function (res) { // console.log(res.rst.data) var data=res.rst.data ,jintie=data.jintieInfo ,moneyHtml='' , day_estimateHtml='' , month_estimateHtml='' , month_accumulativeHtml='',balanceHtml = ''; //存储用户id localStorage.setItem('user_id',data.user_id); if(res.errno == "0" && res.rst){ moneyHtml += ' ¥ '+ jintie.totalJintie +'共'+ jintie.totalCount +'笔' ; day_estimateHtml += '
今日预估津贴
'+ jintie.todayCount +'订单¥'+ jintie.todayJintie +'津贴昨日预估津贴
'+ jintie.lastdayCount +'订单¥'+ jintie.lastdayJintie +'津贴本月预估津贴
'+ jintie.thisCount1 +'订单¥'+ jintie.thisJintie1 +'津贴上月预估津贴
'+ jintie.lastCount1 +'订单¥'+ jintie.lastJintie1 +'津贴本月结算津贴
'+ jintie.thisCount2 +'订单¥'+ jintie.thisJintie2 +'津贴上月结算津贴
'+ jintie.lastCount2 +'订单¥'+ jintie.lastJintie2 +'津贴今日预估津贴
'+ jintie.todayCount +'订单¥'+ jintie.todayJintie +'津贴昨日预估津贴
'+ jintie.lastdayCount +'订单¥'+ jintie.lastdayJintie +'津贴本月预估津贴
'+ jintie.thisCount1 +'订单¥'+ jintie.thisJintie1 +'津贴上月预估津贴
'+ jintie.lastCount1 +'订单¥'+ jintie.lastJintie1 +'津贴本月结算津贴
'+ jintie.thisCount2 +'订单¥'+ jintie.thisJintie2 +'津贴上月结算津贴
'+ jintie.lastCount2 +'订单¥'+ jintie.lastJintie2 +'津贴