var d = dialog({ contentType: 'load', skin: 'bk-popup' }); var d1 = dialog({ contentType: 'load', skin: 'bk-popup', content: '退出中..' }); var pagetype = 4; var openid = null; var userAgent = window.localStorage.getItem(agentName); $(function() { checkUserAgent(); }) function queryInit() { d.show(); var jsonstr = $.parseJSON(userAgent); openid = jsonstr.openid; if(openid) { $(".weixing-icon").show(); } var firstUid = window.localStorage.getItem("firstUid"); if(firstUid == null || firstUid == undefined){ $('.qiehuan-jiaren').hide() } queryUserInfo(); //查询用户信息 // getWeixinSign(); //获取微信签名 } //获得微信sdk信息 function getWeixinSign() { var params1 = {}; params1.pageUrl = server + "wx/html/grzx/html/my-detail.html&state=STATE"; $.ajax(server + "weixin/getSign", { data: params1, dataType: "json", type: "post", success: function(res) { if(res.status == 200) { var t = res.data.timestamp; var noncestr = res.data.noncestr; var signature = res.data.signature; wx.config({ //debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId: appId, // 必填,公众号的唯一标识 timestamp: t, // 必填,生成签名的时间戳 nonceStr: noncestr, // 必填,生成签名的随机串 signature: signature, // 必填,签名,见附录1 jsApiList: [ 'chooseImage', 'uploadImage' ] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 }); } } }); } //查询用户信息 function queryUserInfo() { var reqParams = [{ url: "patient/baseinfo", data: {}, reqType: 'post' }] getReqPromises(reqParams).then(function(ress) { var res = ress[0]; d.close(); if(res.status == 200) { var data = res.data; $("#photo").attr("src", getImgUrl(data.photo)) $("#name").html(data.name) } }); } function goPage(url){ window.location.href = url; }