@@ -114,7 +114,7 @@ export default { | |||||
} else if (type === 'today') { | } else if (type === 'today') { | ||||
const e = { | const e = { | ||||
start: moment() | start: moment() | ||||
.subtract(1, 'day') | |||||
.subtract(0, 'day') | |||||
.format('YYYY-MM-DD 00:00:00'), | .format('YYYY-MM-DD 00:00:00'), | ||||
end: todayEnd | end: todayEnd | ||||
} | } | ||||
@@ -123,7 +123,7 @@ export default { | |||||
} else if (type === '7d') { | } else if (type === '7d') { | ||||
const e = { | const e = { | ||||
start: moment() | start: moment() | ||||
.subtract(7, 'days') | |||||
.subtract(6, 'days') | |||||
.format('YYYY-MM-DD 00:00:00'), | .format('YYYY-MM-DD 00:00:00'), | ||||
end: todayEnd | end: todayEnd | ||||
} | } | ||||
@@ -16,11 +16,13 @@ export default { | |||||
// "http://localhost:8088/" | // "http://localhost:8088/" | ||||
// ], | // ], | ||||
"apiHost": [ | "apiHost": [ | ||||
"http://192.168.10.32:8011/" | |||||
"http://192.168.10.31:8032/" | |||||
// "/api/", | |||||
], | ], | ||||
"webHost":"http://192.168.10.31:8031/", | |||||
// 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示 | // 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示 | ||||
"devAccount": [ | "devAccount": [ | ||||
{ username: "2021230206", password: "www.qj.com" } | |||||
{ username: "system", password: "www.qj.com" } | |||||
], | ], | ||||
//是否分布式部署 指WebApi与Web不在一台服务器 | //是否分布式部署 指WebApi与Web不在一台服务器 | ||||
"isDistributed":true, | "isDistributed":true, | ||||
@@ -165,6 +165,17 @@ | |||||
} | } | ||||
}, | }, | ||||
"h5" : { | "h5" : { | ||||
// "devServer": { | |||||
// "proxy" : { | |||||
// "/api" : { | |||||
// "target" : "http://192.168.10.58:8011/", //自己项目接口域名 | |||||
// "changeOrigin" : true, //是否跨域 | |||||
// // "secure" : true, // 设置支持https协议的代理 | |||||
// "pathRewrite": {"^/api":""} //api路径重定向,根据具体情况调整,也可不写 | |||||
// } | |||||
// } | |||||
// }, | |||||
"uniStatistics" : { | "uniStatistics" : { | ||||
"enable" : false | "enable" : false | ||||
}, | }, | ||||
@@ -3,6 +3,7 @@ | |||||
<!-- 主列表页 --> | <!-- 主列表页 --> | ||||
<view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;"> | <view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;"> | ||||
<!-- 顶部条目/分页信息栏 --> | <!-- 顶部条目/分页信息栏 --> | ||||
<!-- @buttonClick="sideOpen = true" --> | |||||
<l-customlist-banner >{{ tips }}</l-customlist-banner> | <l-customlist-banner >{{ tips }}</l-customlist-banner> | ||||
<!-- 滚动列表,跨端支持上拉/下拉 --> | <!-- 滚动列表,跨端支持上拉/下拉 --> | ||||
@@ -164,7 +165,7 @@ export default { | |||||
}, | }, | ||||
// 拉取列表 | // 拉取列表 | ||||
async fetchList() { | |||||
async fetchList(isConcat=true) { | |||||
if (this.page > this.total) { return } | if (this.page > this.total) { return } | ||||
let userInfo = this.GET_GLOBAL('loginUser'); | let userInfo = this.GET_GLOBAL('loginUser'); | ||||
@@ -185,19 +186,19 @@ export default { | |||||
this.total = result.total | this.total = result.total | ||||
this.page = result.page + 1 | this.page = result.page + 1 | ||||
this.list = this.list.concat(result.rows) | |||||
this.list = isConcat?this.list.concat(result.rows):result.rows | |||||
this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项` | this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项` | ||||
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多' | this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多' | ||||
}, | }, | ||||
// 刷新清空列表 | // 刷新清空列表 | ||||
async refreshList() { | |||||
async refreshList(isConcat=true) { | |||||
this.page = 1 | this.page = 1 | ||||
this.total = 2 | this.total = 2 | ||||
this.list = [] | this.list = [] | ||||
await this.fetchList() | |||||
await this.fetchList(isConcat) | |||||
}, | }, | ||||
// 列表下拉 | // 列表下拉 | ||||
@@ -222,7 +223,7 @@ export default { | |||||
Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t))) | Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t))) | ||||
this.searchData = result | this.searchData = result | ||||
await this.refreshList() | |||||
await this.refreshList(false) | |||||
}, | }, | ||||
// 点击「清空查询条件」按钮 | // 点击「清空查询条件」按钮 | ||||
@@ -3,9 +3,9 @@ | |||||
<view v-if="ready" class="contentBox"> | <view v-if="ready" class="contentBox"> | ||||
<view class="content" id="attendContent"> | <view class="content" id="attendContent"> | ||||
<view id="show">{{now}}</view> | <view id="show">{{now}}</view> | ||||
<div class="pen" @click="action('dk')"> | |||||
<view class="pen" @click="action('dk')"> | |||||
<img id="attimg" :src="imgsrc" alt="" width="100%"> | <img id="attimg" :src="imgsrc" alt="" width="100%"> | ||||
</div> | |||||
</view> | |||||
</view> | </view> | ||||
<view class="footer"> | <view class="footer"> | ||||
<img src="../../common/images/2.png" alt="" width="100%"> | <img src="../../common/images/2.png" alt="" width="100%"> | ||||
@@ -26,7 +26,7 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | * 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | ||||
* { "path": "pages/AttendanceCard/list", "style": { "navigationBarTitleText": "考勤打卡" } } | * { "path": "pages/AttendanceCard/list", "style": { "navigationBarTitleText": "考勤打卡" } } | ||||
* | * | ||||
@@ -52,7 +52,7 @@ export default { | |||||
now: null, | now: null, | ||||
imgsrc:dk, | imgsrc:dk, | ||||
ready: false, | ready: false, | ||||
timer:'', | |||||
} | } | ||||
}, | }, | ||||
@@ -66,7 +66,7 @@ export default { | |||||
this.LOADING('加载数据中...') | this.LOADING('加载数据中...') | ||||
this.now = this.getCurrentTime() | this.now = this.getCurrentTime() | ||||
setInterval(this.getCurrentTime,1000) | |||||
this.timer = setInterval(this.getCurrentTime,1000) | |||||
await this.judgeIsDK() | await this.judgeIsDK() | ||||
@@ -78,17 +78,18 @@ export default { | |||||
async action(type) { | async action(type) { | ||||
switch (type) { | switch (type) { | ||||
case 'dk': | case 'dk': | ||||
if(this.imgsrc == "dkred"){ | |||||
if(this.imgsrc == dkred){ | |||||
return | return | ||||
} | } | ||||
this.HTTP_POST('learun/adms/attendance/clockin', {}, '打卡失败').then(success => { | |||||
this.LOADING() | |||||
this.HTTP_POST('learun/adms/attendance/clockin', {}, '打卡失败').then(success => { | |||||
this.HIDE_LOADING() | |||||
if(!success) { | if(!success) { | ||||
this.TOAST('打卡失败') | this.TOAST('打卡失败') | ||||
return | return | ||||
} | } | ||||
this.TOAST('打卡成功','success') | this.TOAST('打卡成功','success') | ||||
setTimeout(this.back,1000) | |||||
setTimeout(this.back,500) | |||||
}) | }) | ||||
return | return | ||||
@@ -122,9 +123,11 @@ export default { | |||||
let mf = nowDate.getMinutes()<10 ? '0'+nowDate.getMinutes() : nowDate.getMinutes(); | let mf = nowDate.getMinutes()<10 ? '0'+nowDate.getMinutes() : nowDate.getMinutes(); | ||||
let ss = nowDate.getSeconds()<10 ? '0'+nowDate.getSeconds() : nowDate.getSeconds(); | let ss = nowDate.getSeconds()<10 ? '0'+nowDate.getSeconds() : nowDate.getSeconds(); | ||||
this.now = hh+':'+mf+':'+ss; | this.now = hh+':'+mf+':'+ss; | ||||
} | |||||
} | |||||
}, | |||||
}, | |||||
destroyed() { | |||||
clearInterval(this.timer) | |||||
} | |||||
} | } | ||||
</script> | </script> | ||||