| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <!doctype html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <link rel="stylesheet" href="layui/css/layui.mobile.css" />
- <script src="layui/layui.js?1.1"></script>
- <script src="js/zepto.js?1.1"></script>
- <script src="js/jquery.min.js?1.1"></script>
- <script src="Script/Common/huayi.config.js?1.1"></script>
- <script src="Script/Common/huayi.http.js?1.1"></script>
- <script type="text/javascript">
- var token = localStorage.getItem("token");
- //测试数据
- //token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiI1YjJiMDk5NmNiYmY0ZTI4NzQ5YzVlNDkiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL2dyb3Vwc2lkIjoiNCIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL3NpZCI6Im9nTnltMVVTMEluS1RacXZjSlNCUm9LSURqbWsiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoi5pu56b6Z55CqIiwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9yb2xlIjoiIiwiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvZGVueW9ubHlzaWQiOiJvZ055bTFVUzBJbktUWnF2Y0pTQlJvS0lEam1rIiwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9leHBpcmF0aW9uIjoiNi8yOC8xOCAxMDoxODo0NSBBTSIsIm5iZiI6MTUyOTU0NzUyNSwiZXhwIjoxNTMwMTUyMzI1LCJpc3MiOiJIeVNpZ25Ub2tlbiIsImF1ZCI6Ikh5Q2FsbENlbnRlckFwaSJ9.XKizK9BWQ6HCXNtJX6msdwI5ACBjdHY-WMnpbzklhCE'
- var code = helper.request.queryString("code");
- var id = helper.request.queryString("id");
- var type = helper.request.queryString("type");
- var menucode = helper.request.queryString("menucode");
- var url = helper.request.queryString("url");
- if (id) {
- localStorage.setItem("id", id);
- }
- if (!token) {
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + 'wechatapi/api/Login/getuserinfotoken',
- data: {
- code: code
- },
- dataType: 'json',
- success: function (result) {
- if (result.state.toLowerCase() == "success") {
- localStorage.setItem("token", result.data.token);
- //获取信息
- localStorage.setItem("openid", result.data.usercode);
- gourl();
- }
- }
- });
- } else {
- $.getJSON(huayi.config.callcenter_url + 'signtokenapi/api/useraccount/getnowuser', function (result) {
- if (result.state.toLowerCase() == "success") {
- localStorage.setItem("openid", result.data.usercode);
- gourl();
- }
- });
- }
- function gourl() {
- var openid = localStorage.getItem("openid");
- $.getJSON(huayi.config.callcenter_url + 'wechatapi/api/login/getuserinfo', { openid: openid}, function (result) {
- if (result.state.toLowerCase() == "success") {
- localStorage.setItem("username", result.data.nickname);
- localStorage.setItem("weixin_name", result.data.nickname);
- localStorage.setItem("weixin_img", result.data.headimgurl);
- if (result.data.subscribe == '0') {
- window.location = "html/focus.html?r=" + Math.random();
- }
- else {
- switch (menucode) {
- case "WXSM":
- window.location.replace("html/personal.html?r=" + Math.random());
- break; //微信扫码界面
- case "WXCX":
- window.location.replace("html/WorkSeach.html?r=" + Math.random());
- break; //工单列表
- case "SBXX":
- window.location.replace("html/EquipmentMessage.html?id=" + id + "&type=" + type + "&r=" + Math.random());
- break; //设备信息
- case "KSBX":
- window.location.replace("html/choosePage.html?id=" + id + "&type=" + type + "&r=" + Math.random());
- break; //项目选择进入界面
- case "CKXQ":
- window.location.replace("html/WorkDeail.html?id=" + id + "&r=" + Math.random());
- break; //报修工单详情
- case "PSDD":
- window.location.replace("html/deliveryOrderDetail.html?id=" + id + "&r=" + Math.random());
- break; //配送工单详情
- case "WXDL":
- window.location.replace("html/personage.html?r=" + Math.random());
- break; //我的
- default:
- if (url) {
- window.location.replace(decodeURIComponent(url));
- //window.history.back();
- }
- else {
- window.location.replace("html/error.html");
- }
- break;
- }
- }
- }
- });
- }
- </script>
- </head>
- <body>
- </body>
- </html>
|