// 请求地址 // var ajaxUrl= 'https://sgmhks.sgmlink.com/sgm_weixin_card'; var projectUrl = 'https://sgmhks.sgmlink.com/sgm_txh_web/'; // 测试地址 // var ajaxUrl= 'http://shaopf.jiinfo.cn/'; const ajaxUrl = 'https://sgmhkstest-web.sgmlink.com/hks-card/' // const ajaxUrl = 'https://txh.suggest.vip' // var projectUrl = 'https://sgmhks.sgmlink.com/sgm_weixin_card_web/'; var isDev = false; // var ajaxUrl= 'https://txh.suggest.vip'; //var workWxAuthUrl = 'https://auth2-shgm.qyhub.cn/auth/auth?url=https%3a%2f%2fsgmhks.sgmlink.com%2fsgm_weixin_card%2fapi%2fweixin%2fcp%2flogin%2fhome&appid=584e2fd227448&extattr=name,avatar,weixinid,extraData.business_unit,extraData.business_dept,extraData.business_role_desc'; var workWxAuthUrl = 'https://auth-shgm-wx.cw.sgmlink.com/auth/auth?url=https%3a%2f%2fsgmhks.sgmlink.com%2fsgm_weixin_card%2fapi%2fweixin%2fcp%2flogin%2fhome&appid=5ee8b1317b62a&extattr=name,avatar,weixinid,extraData.business_unit,extraData.business_dept,extraData.business_role_desc'; // var workWxAuthUrl = 'https%3a%2f%2fsgmhkstest-web.sgmlink.com%2fhks-card%2fapi%2fweixin%2fcp%2flogin%2fhome&appid=5836556fa9d9a&extattr=name,avatar,ldap_userid,weixinid,extraData.sex,extraData.birthdate,extraData.business_unit,extraData.business_dept,extraData.business_role_desc'; const api = { //前台-推荐人-我的推荐 myRecommendLog :'/api/sgm/activity/AllStaffMarketingFacade/myRecommendLog', //前台-被推荐人-查询状态 recQueryStatus:'/api/sgm/activity/AllStaffMarketingFacade/recQueryStatus', //微信授权 getAuthUrl:'/jiinfo/weixin/WeiXinController/getAuthUrl', //微信登录 getJsapiTicket:'/jiinfo/weixin/WeiXinController/getJsapiTicket', //查找省市 findProvinceAndCity:'/api/sgm/weixin/card/ReplacementFacade/findProvinceAndCity', //查找门店 findPage:'/api/sgm/weixin/card/ReplacementFacade/findPage', //获取短信验证码 getAuthCode :'/api/sgm/weixin/miniprogram/MpLoginFacade/login', //绑定手机号 register:'/api/sgm/weixin/card/LoginFacade/register', //小程序token登录 tokenLogin:'/api/sgm/weixin/card/MpLogin/tokenLogin', //前台-提交留资 submit:'/api/sgm/activity/AllStaffMarketingFacade/submit', //前台-选择礼遇 chooseEntity:'/api/sgm/activity/AllStaffMarketingFacade/chooseEntity', //邀请 invite:'/api/sgm/activity/AllStaffMarketingFacade/invite', //获取礼品列表 queryEntityList:'/api/sgm/activity/AllStaffMarketingFacade/queryEntityList', //根据条件分页查询 queryCarsList:'/api/sgm/weixin/marketing/TCpwxCarReadFacade/findPage', //根据条件分页查询 queryCarTypeList:'/api/sgm/weixin/marketing/TCpwxCarReadFacade/findCarTypeList', //更新点击量 updateCount:'/api/sgm/weixin/marketing/TCpwxCarWriteFacade/updateCount', // tallType告知行为类型 tallType:'/api/sgm/activity/AllStaffMarketingFacade/statistics', // 表示用户已读 readAdvert:'/api/sgm/activity/AllStaffMarketingFacade/readAdvert', // 手机号认证 getAuthPhone:'/api/weixin/getAuthPhone', // 获取验证码 getCode:'/api/weixin/getCode', // 分页查询渠道奖品信息 getFlag:'/api/sgm/weixin/card/PcwController/getFlag', // flag addFlag:'/api/sgm/weixin/card/PcwController/addFlag', //获取抽奖剩余次数 getDrawRemainingCount:`/api/sgm/weixin/card/PcwController/getDrawRemainingCount`, //抽奖 draw:`/api/sgm/weixin/card/PcwController/draw`, //根据渠道ID查询获奖信息 getMyPrize:`/api/sgm/weixin/card/PcwController/getMyPrize`, //查询页面 enterPage: `/api/sgm/weixin/card/PcwController/enterPage`, } //防止安卓input导致页面变形 //获取url参数 function GetQueryString(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); // if(r!=null)return unescape(r[2].replace(/\<|\>|\(|\)|\{|\}|\;|\/|\`|\,|\"|\'|\%|\&|\$|\@|\\’|\ \”|\|/g,"")); return null; } //添加replaceAll函数 String.prototype.replaceAll = function(s1,s2){ return this.replace(new RegExp(s1,"gm"),s2); } //获取终端 function getTerminal(){ var ua = navigator.userAgent.toLowerCase(); if (/iphone|ipad|ipod/.test(ua)) { return "ios" } else if (/android/.test(ua)) { return "android" }else { return "pc" } } function showLoading(text){ $('body').append(`