From af14b544a453b3a12a01ea76494bf6885b8016da Mon Sep 17 00:00:00 2001 From: "liujw155@outlook.com" Date: Thu, 18 Feb 2021 18:05:51 +0800 Subject: [PATCH] add api --- src/js/api.js | 1 + src/pages/approve/list/list.vue | 111 +++++++++++++++++++------ src/pages/approve/record/record.vue | 40 +++++++-- src/pages/course/class_list/class_list.vue | 14 +++- src/pages/course/roll_call/roll_call.vue | 78 +++++++++++++---- src/pages/course/student_list/student_list.vue | 7 +- src/pages/course/task_finish/task_finish.vue | 5 +- src/static/images/no_result.png | Bin 0 -> 2137 bytes src/static/images/selected_c97.png | Bin 0 -> 497 bytes 9 files changed, 206 insertions(+), 50 deletions(-) create mode 100644 src/static/images/no_result.png create mode 100644 src/static/images/selected_c97.png diff --git a/src/js/api.js b/src/js/api.js index b921601..e67cb4a 100644 --- a/src/js/api.js +++ b/src/js/api.js @@ -32,6 +32,7 @@ API['course'] = { API['approve'] = { getApproveList: `${ORIGIN}/stadium/coach/getApproveList`, // 小程序-课程列表 + handleApprove: `${ORIGIN}/stadium/coach/handleApprove`, // 小程序-处理审批 } export default { ORIGIN, API }; diff --git a/src/pages/approve/list/list.vue b/src/pages/approve/list/list.vue index 01cca96..d479927 100644 --- a/src/pages/approve/list/list.vue +++ b/src/pages/approve/list/list.vue @@ -4,51 +4,52 @@ 预约审批 - 99 + 请假审批 - 99 + 换班审批 - 99 + - 审核人数:3人 + 审核人数: 0人 审批记录 - - + + 抱歉,没有相关课程订单信息... - + - - 胡可课 + + {{e.user_name || '-'}} - 羽毛球课程(羽毛球课) + {{e.course_name || '-'}} - 2020-08-22 10:30 + {{k || '-'}} - - 通过 + + + 原因: - 作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内… + {{e.for_leave_reason || '-'}} @@ -61,12 +62,13 @@ - - 全选 + + + 全选 - 不同意 - 同意 + 不同意 + 同意 @@ -80,6 +82,12 @@ import { mapState } from 'vuex'; export default { computed: { ...mapState([ 'storeInfo' ]), + isSelectAll(){ + let { approveList } = this; + if(approveList.length<=0)return false; + let bolArr = approveList.map(e=>!!e.defineSelected); + return !bolArr.includes(false); + } }, data(){ return { @@ -91,14 +99,58 @@ export default { this.getApproveList(); }, methods: { + selectAll(){ + let { isSelectAll } = this; + let _list = [...this.approveList]; + if(_list.length<=0)return + console.warn(this.isSelectAll) + this.approveList = _list.map(e=>{ + return { + ...e, + defineSelected: !this.isSelectAll, + } + }) + console.warn(this.approveList) + }, + selectItem(index){ + let _list = [...this.approveList]; + _list[index].defineSelected = !_list[index].defineSelected; + this.approveList = _list; + }, + handleApprove: util.debounce(function(status){ + let { approveList } = this; + let _selectedArr = approveList.filter(ele=>{ + return ele.defineSelected + }) + if(_selectedArr.length<=0)return; + servers.post({ + url: API.approve.handleApprove, + data: { + status, + approve_ids: _selectedArr.map(item=>item.id || ''), + }, + isDefaultGet: false, + }) + .then(res=>{ + if(res.data.code == 0){ + util.showNone(res.data.message || '操作成功!'); + setTimeout(_=> util.routeTo(), 1200); + }else{ + util.showNone(res.data.message || '操作失败!'); + } + }) + }, 300, 300), tabChange(i){ + this.approveList = []; this.tabIdx = i; + this.getApproveList(i); }, toRecord(){ util.routeTo(`/pages/approve/record/record`,'nT'); }, getApproveList(approve_type = 0){ let { storeInfo } = this; + util.showLoad(); servers.get({ url: API.approve.getApproveList, data: { @@ -109,7 +161,8 @@ export default { failMsg: '加载失败!' }) .then(res=>{ - let _list = res.list || []; + util.hideLoad(); + let _list = res.list || [{},{}]; this.approveList = _list; console.warn('approve list --->', res); }) @@ -178,7 +231,6 @@ export default { .l-bar{ padding: 0 50upx; height: 92upx; - background-color: yellowgreen; @include centerFlex(space-between); >view{ font-size: 28upx; @@ -197,6 +249,7 @@ export default { .l-list{ padding: 0 24upx; .l-item{ + margin-bottom: 24upx; padding: 24upx; background-color: #fff; .l-content{ @@ -211,7 +264,6 @@ export default { width: 100upx; height: 100upx; border-radius: 50%; - background-color: skyblue; } >view{ max-width: 120upx; @@ -242,10 +294,10 @@ export default { height: 36upx; border: 2upx solid #9a9a9d; border-radius: 50%; - >image{ - width: 100%; - height: 100%; - } + } + .s-img{ + width: 36upx; + height: 36upx; } .s-txt{ font-size: 28upx; @@ -301,7 +353,6 @@ export default { display: block; width: 346upx; height: 346upx; - background-color: skyblue; } >view{ text-align: center; @@ -327,12 +378,18 @@ export default { color: #333; @include centerFlex(flex-start); >view{ - margin-right: 14upx; width: 36upx; height: 36upx; border-radius: 50%; border: 2upx solid #9a9a9d; } + >image{ + width: 36upx; + height: 36upx; + } + >text{ + margin-left: 14upx; + } } .bb-btns{ diff --git a/src/pages/approve/record/record.vue b/src/pages/approve/record/record.vue index 50a8ce4..f34cd28 100644 --- a/src/pages/approve/record/record.vue +++ b/src/pages/approve/record/record.vue @@ -4,24 +4,24 @@ 预约审批 - 99 + 请假审批 - 99 + 换班审批 - 99 + - + @@ -55,17 +55,46 @@ @@ -125,6 +154,7 @@ export default { .r-list{ padding: 0 24upx; .l-item{ + margin-bottom: 24upx; padding: 24upx; background-color: #fff; .l-content{ diff --git a/src/pages/course/class_list/class_list.vue b/src/pages/course/class_list/class_list.vue index e84184d..1326fa8 100644 --- a/src/pages/course/class_list/class_list.vue +++ b/src/pages/course/class_list/class_list.vue @@ -19,7 +19,7 @@ 学员 - 点名 + 点名 作业 @@ -47,6 +47,18 @@ export default { this.getClassList(_query.course_id) }, methods: { + toRollCall(e){ + return util.showNone('开发中'); + console.warn(e); + let { optionsQuery } = this; + let _query = { + ...optionsQuery, + class_id: e.id, + class_name: e.class_name, + } + console.log(e,'eeeeee') + util.routeTo(`/pages/course/roll_call/roll_call?query=${util.jsonStr(_query)}`, 'nT'); + }, toTask(e){ let { optionsQuery } = this; let _query = { diff --git a/src/pages/course/roll_call/roll_call.vue b/src/pages/course/roll_call/roll_call.vue index ce8418e..f3b5089 100644 --- a/src/pages/course/roll_call/roll_call.vue +++ b/src/pages/course/roll_call/roll_call.vue @@ -1,29 +1,31 @@ @@ -77,7 +126,10 @@ export default { margin-right: 26upx; width: 40upx; height: 40upx; - background-color: skyblue; + >image{ + width: 100%; + height: 100%; + } } .ri-avatar{ flex-shrink: 0; @@ -86,7 +138,6 @@ export default { width: 116upx; height: 116upx; border-radius: 50%; - background-color: skyblue; } .ri-content{ flex-grow: 1; @@ -108,7 +159,6 @@ export default { margin-left: 12upx; width: 36upx; height: 36upx; - background-color: skyblue; } } .ri-phone{ diff --git a/src/pages/course/student_list/student_list.vue b/src/pages/course/student_list/student_list.vue index f61ba87..840b7c8 100644 --- a/src/pages/course/student_list/student_list.vue +++ b/src/pages/course/student_list/student_list.vue @@ -15,7 +15,7 @@ {{e.mobile || '-'}} - + 剩余次数: {{e.number || 0}}次 @@ -62,6 +62,11 @@ export default { }) }, methods: { + phoneCall(num){ + uni.makePhoneCall({ + phoneNumber: num || '-' + }) + }, toReview(e){ let { optionsQuery } = this; let _query = { diff --git a/src/pages/course/task_finish/task_finish.vue b/src/pages/course/task_finish/task_finish.vue index a49ab29..2743c76 100644 --- a/src/pages/course/task_finish/task_finish.vue +++ b/src/pages/course/task_finish/task_finish.vue @@ -62,12 +62,13 @@ export default { methods: { remindAll: util.debounce(function(){ let { optionsQuery, finishList } = this; - console.warn(optionsQuery) + console.warn(optionsQuery, 'optionsQuery') + console.warn(finishList, 'finishList') servers.post({ url: API.course.homeworkRemind, data: { homework_id: optionsQuery.homework_id, - homework_record_ids: finishList.map(e=>e.id), + homework_record_ids: finishList.map(e=>e.record.id), }, isDefaultGet: false, }) diff --git a/src/static/images/no_result.png b/src/static/images/no_result.png new file mode 100644 index 0000000000000000000000000000000000000000..6fe895bb218d9d2129b61fa63bba2a8b91650363 GIT binary patch literal 2137 zcma)7dpOg5A9m3;)yb^aw$^VqYCICY0r5fXP(pzHg%W${-b`Y2Sz~^ABYHc7qB?_rsKD-WJmynRH zMmnAFi31lvZq#dgW#?3&d4Nv93bt*kCN^T9jP+h=Ed#`%UyMTC2)3qf45>)#7% z*n3DRwp$&TjWfVEbC(C+&`GWQg?C!W);&+-bH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0?C_djv{R_N6j~57&o5x9;4pvWUD`otVf`Ao+H zuF)RGYbjK;d|P$YiuJYv)G=_XHt#YrIeR?>gQr5pWIHosq_^GT-$hoIm83nZo> AuK)l5 literal 0 HcmV?d00001 diff --git a/src/static/images/selected_c97.png b/src/static/images/selected_c97.png new file mode 100644 index 0000000000000000000000000000000000000000..cacc64c7654046cbd01c23a535f88097b1902490 GIT binary patch literal 497 zcmViah)5vndvDEJ9=k@Wi-_%vQqBN|K5O8=P0000FbW%=J z0BZaaD*pQQq?X1yE<_p@#m6<7