diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/App.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/App.vue index 55e9bb57a..af8274182 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/App.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/App.vue @@ -5,6 +5,8 @@ // 考虑到用户刷新网页时会丢失全局数据、页面栈、页面数据等,因此直接跳回首页即可 async onLaunch(param) { + // 在App.vue文件中获取到页面到URL (初始化WXsdj) + window.localStorage.setItem('scanUrl',location.href.split('#')[0]) //应用的生命周期 应用启动后触发 // #ifdef H5 || APP-VUE // H5 刷新时获取当前页面路径 diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/js/weixin-js-sdk.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/js/weixin-js-sdk.js new file mode 100644 index 000000000..1b5014bfc --- /dev/null +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/js/weixin-js-sdk.js @@ -0,0 +1 @@ +!function(e,n){"function"==typeof define&&(define.amd||define.cmd)?define(function(){return n(e)}):n(e,!0)}(window,function(o,e){if(!o.jWeixin){var n,c={config:"preVerifyJSAPI",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",onMenuShareQZone:"menu:share:QZone",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest",openEnterpriseRedPacket:"getRecevieBizHongBaoRequest",startSearchBeacons:"startMonitoringBeacons",stopSearchBeacons:"stopMonitoringBeacons",onSearchBeacons:"onBeaconsInRange",consumeAndShareCard:"consumedShareCard",openAddress:"editAddress"},a=function(){var e={};for(var n in c)e[c[n]]=n;return e}(),i=o.document,t=i.title,r=navigator.userAgent.toLowerCase(),s=navigator.platform.toLowerCase(),d=!(!s.match("mac")&&!s.match("win")),u=-1!=r.indexOf("wxdebugger"),l=-1!=r.indexOf("micromessenger"),p=-1!=r.indexOf("android"),f=-1!=r.indexOf("iphone")||-1!=r.indexOf("ipad"),m=(n=r.match(/micromessenger\/(\d+\.\d+\.\d+)/)||r.match(/micromessenger\/(\d+\.\d+)/))?n[1]:"",g={initStartTime:L(),initEndTime:0,preVerifyStartTime:0,preVerifyEndTime:0},h={version:1,appId:"",initTime:0,preVerifyTime:0,networkType:"",isPreVerifyOk:1,systemType:f?1:p?2:-1,clientVersion:m,url:encodeURIComponent(location.href)},v={},S={_completes:[]},y={state:0,data:{}};O(function(){g.initEndTime=L()});var I=!1,_=[],w={config:function(e){B("config",v=e);var t=!1!==v.check;O(function(){if(t)M(c.config,{verifyJsApiList:C(v.jsApiList),verifyOpenTagList:C(v.openTagList)},function(){S._complete=function(e){g.preVerifyEndTime=L(),y.state=1,y.data=e},S.success=function(e){h.isPreVerifyOk=0},S.fail=function(e){S._fail?S._fail(e):y.state=-1};var t=S._completes;return t.push(function(){!function(){if(!(d||u||v.debug||m<"6.0.2"||h.systemType<0)){var i=new Image;h.appId=v.appId,h.initTime=g.initEndTime-g.initStartTime,h.preVerifyTime=g.preVerifyEndTime-g.preVerifyStartTime,w.getNetworkType({isInnerInvoke:!0,success:function(e){h.networkType=e.networkType;var n="https://open.weixin.qq.com/sdk/report?v="+h.version+"&o="+h.isPreVerifyOk+"&s="+h.systemType+"&c="+h.clientVersion+"&a="+h.appId+"&n="+h.networkType+"&i="+h.initTime+"&p="+h.preVerifyTime+"&u="+h.url;i.src=n}})}}()}),S.complete=function(e){for(var n=0,i=t.length;n { + // let url = window.location.href + let url = /(Android)/i.test(navigator.userAgent) ? location.href.split('#')[0] : window + .localStorage + .getItem('scanUrl') + this.HTTP_GET("weixinapi/getweixinwebaccess_token?url=" + encodeURIComponent(url)).then(( + success) => { + if (!success) { + resolve(false) + return + } + wx.config({ + debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 + appId: success.appid, // 必填,公众号的唯一标识 + timestamp: success.timestamp, // 必填,生成签名的时间戳 + nonceStr: success.noncestr, // 必填,生成签名的随机串 + signature: success.certificate, // 必填,签名 + jsApiList: arr // 必填,需要使用的JS接口列表 + }); + wx.ready(() => { + this.wxInit = true + this.TOAST("wx初始化成功") + resolve(true) + }) + wx.error(() => { + this.TOAST("wx初始化失败") + resolve(false) + }) + }) + }) + return promise + }, + // 获取定位 + async getLocation() { + return new Promise(async (resolve) => { + if (!this.wxInit) { + let res = await this.initWx(["getLocation"]) + if(!res){ + resolve(false) + return + } + } + if(!wx.getLocation){ + this.TOAST("无效方法") + resolve(false) + } + wx.getLocation({ + type: "gcj02", // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' + success: function(res) { + var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90 + var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。 + var speed = res.speed; // 速度,以米/每秒计 + var accuracy = res.accuracy; // 位置精度 + console.log(res) + resolve({ + lat:latitude, + lng:longitude + }) + }, + fail: function(error) { + this.TOAST("定位失败") + resolve(false) + } + }); + }) + } + + } +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AttendanceCard/list.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AttendanceCard/list.vue index 5dcbbe85e..7e50b7936 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AttendanceCard/list.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AttendanceCard/list.vue @@ -1,305 +1,316 @@ -