Przeglądaj źródła

移动端 考勤打卡增加wifi网络检测功能

黑龙江艺术高中职
yxq 5 miesięcy temu
rodzic
commit
9187a89ea2
4 zmienionych plików z 59 dodań i 2 usunięć
  1. +7
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/App.vue
  2. +25
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AttendanceCard/list.vue
  3. +26
    -1
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AttendanceCardTeacher/list.vue
  4. +1
    -1
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/vue.config.js

+ 7
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/App.vue Wyświetl plik

@@ -5,6 +5,13 @@
// 考虑到用户刷新网页时会丢失全局数据、页面栈、页面数据等,因此直接跳回首页即可

async onLaunch(param) {
// 版本更新
var newVer = '1.0.1';
var oldVer = localStorage.getItem('version');
    if (newVer != oldVer) {
localStorage.setItem('version', newVer);
this.JUMP_TO("/")
}
// 加载百度地图资源
let ak = this.GET_AK()
var script = document.createElement('script');


+ 25
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AttendanceCard/list.vue Wyświetl plik

@@ -31,6 +31,9 @@
<view style="color: #666;">
{{postData.ClockPlace}}
</view>
<view class="wifiCard" v-if="info.AttendanceType != 5">
定位不精准?<span @click="isInternalNetwork">WIFI信息打卡</span>
</view>
</view>
</view>
<view class="footer">
@@ -314,6 +317,19 @@
toAttendanceCardTeacher() {
this.JUMP_TO('/pages/AttendanceCardTeacher/list', {},true)
},
// 判断是否学校网络
isInternalNetwork(){
this.LOADING()
this.requestBase("https://mp.weixin.qq.com/intp/getuserclientip").then(res=>{
this.HIDE_LOADING()
if(res.data&&['1.190.222.35','1.190.222.34'].inlcudes(res.data.client_ip)){
let postData = {AIsOut:0,ClockPlace:'已连接校园网'}
this.NAV_TO(`./single_zc`,postData,true)
}else{
this.TOAST('未检测到校园网连接')
}
})
},
},
destroyed() {
// let scirpt = document.getElementById('baiduScript')
@@ -431,4 +447,13 @@
filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
filter: gray;
}
.wifiCard{
margin-top: 6px;
font-size: 14px;
text-align: center;
span{
color: #0c86d8;
}
}
</style>

+ 26
- 1
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AttendanceCardTeacher/list.vue Wyświetl plik

@@ -40,6 +40,9 @@
<view>
{{postData.ClockPlace}}
</view>
<view class="wifiCard" v-if="info.AttendanceType != 5">
定位不精准?<span @click="isInternalNetwork">WIFI信息打卡</span>
</view>
</view>
</view>
</view>
@@ -312,7 +315,20 @@

})
});
}
},
// 判断是否学校网络
isInternalNetwork(){
this.LOADING()
this.requestBase("https://mp.weixin.qq.com/intp/getuserclientip").then(res=>{
this.HIDE_LOADING()
if(res.data&&['1.190.222.35','1.190.222.34'].inlcudes(res.data.client_ip)){
let postData = {AIsOut:0,ClockPlace:'已连接校园网'}
this.NAV_TO(`./single_zc`,postData,true)
}else{
this.TOAST('未检测到校园网连接')
}
})
},
},
destroyed() {
let scirpt = document.getElementById('baiduScript')
@@ -430,4 +446,13 @@
filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
filter: gray;
}
.wifiCard{
margin-top: 6px;
font-size: 14px;
text-align: center;
span{
color: #0c86d8;
}
}
</style>

+ 1
- 1
Learun.Framework.Ultimate V7/LearunApp-2.2.0/vue.config.js Wyświetl plik

@@ -14,7 +14,7 @@ module.exports = {
disableHostCheck: true
},
output: { // 输出重构 打包编译后的 文件目录 文件名称 【模块名称.时间戳】
filename: `${filePath}[name]${Timestamp}.js`,
filename: `${filePath}[name]${Timestamp}.js?v=1.0.1`,
chunkFilename: `${filePath}[name]${Timestamp}.js`
},
}


Ładowanie…
Anuluj
Zapisz