|
|
@ -4,33 +4,38 @@ |
|
|
|
<view class="top-bar"><text>{{optionsQuery.course_name || '-'}}</text></view> |
|
|
|
</picker> |
|
|
|
<view class="rc-time"> |
|
|
|
<view>课程时间: 2020/12/19 13:00~14:15</view> |
|
|
|
<view>5/2</view> |
|
|
|
<view>课程时间: {{ pageInfo.course_duration.date || '-' }} {{ pageInfo.course_duration.start_duration || '-' }}~{{ pageInfo.course_duration.end_duration || '-' }}</view> |
|
|
|
<view>{{pageInfo.has_call_name_num || 0}}/{{pageInfo.not_call_name_num || 0}}</view> |
|
|
|
</view> |
|
|
|
<view class="rc-list"> |
|
|
|
<view class="rl-item" v-for="(e, i) in studentList" :key="i"> |
|
|
|
<view class="ri-selected"> |
|
|
|
<image mode="aspectFit" src="/static/images/selected_c97.png"></image> |
|
|
|
<view class="rl-item" v-for="(e, i) in studentList" :key="i" @click="itemSelect(i)"> |
|
|
|
<view :class="['ri-selected',!e._selectStatus?'border':'']"> |
|
|
|
<image v-if="e._selectStatus" mode="aspectFit" src="/static/images/selected_c97.png"></image> |
|
|
|
</view> |
|
|
|
<image class="ri-avatar" mode="aspectFit" :src="e.user_info.avatar_url"></image> |
|
|
|
<view class="ri-content"> |
|
|
|
<view class="rc-info"> |
|
|
|
<view class="ri-name"> |
|
|
|
<view>{{e.name || '-'}}</view> |
|
|
|
<image mode="aspectFit" :src="`/src/static/images/sex_${e.gender-1}.png`"></image> |
|
|
|
<view>{{e.course_order.name || '-'}}</view> |
|
|
|
<image mode="aspectFit" :src="`/src/static/images/sex_${e.course_order.gender-1}.png`"></image> |
|
|
|
</view> |
|
|
|
<view class="ri-phone"> |
|
|
|
<view>{{e.mobile || '-'}}</view> |
|
|
|
<view class="ri-phone" @click.stop="phoneCall(e.course_order.mobile)"> |
|
|
|
<view>{{e.course_order.mobile || '-'}}</view> |
|
|
|
<image mode="aspectFit" src="/static/images/phone_c33.png"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="rc-tip"> |
|
|
|
<view>剩余次数: {{e.number || 0}}次</view> |
|
|
|
<view>未点名</view> |
|
|
|
<view>剩余次数: {{e.course_order.number || 0}}次</view> |
|
|
|
<view :class="[e.attendance_record.id !==0 ? 'green' : '']"> |
|
|
|
{{ |
|
|
|
e.attendance_record.id === 0? '未点名': '已点名' |
|
|
|
}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="fixed-bot-btn"><view hover-class="hover-active" @click="rollCallBtn">快速点名</view></view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
@ -43,8 +48,18 @@ export default { |
|
|
|
return { |
|
|
|
optionsQuery: {}, |
|
|
|
studentList: [], |
|
|
|
pageInfo: {}, |
|
|
|
page: 1, |
|
|
|
} |
|
|
|
}, |
|
|
|
onReachBottom(){ |
|
|
|
let { optionsQuery, page } = this; |
|
|
|
this.getUserList({ |
|
|
|
course_id: optionsQuery.course_id, |
|
|
|
class_id: optionsQuery.class_id, |
|
|
|
page: ++page |
|
|
|
}) |
|
|
|
}, |
|
|
|
onLoad(options){ |
|
|
|
console.warn(util.jsonPar(options.query)); |
|
|
|
let _query = util.jsonPar(options.query) || {}; |
|
|
@ -55,12 +70,58 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
rollCallBtn: util.debounce(function(){ |
|
|
|
let { studentList, pageInfo } = this; |
|
|
|
let _order_nos = studentList.filter(e=>e._selectStatus).map(e=>e.course_order.order_no) || []; |
|
|
|
if(_order_nos.length<=0)return; |
|
|
|
util.showLoad(); |
|
|
|
servers.post({ |
|
|
|
url: API.course.checkOrder, |
|
|
|
data: { |
|
|
|
duration_id: pageInfo.course_duration.id, |
|
|
|
order_nos: _order_nos |
|
|
|
}, |
|
|
|
isDefaultGet: false |
|
|
|
}) |
|
|
|
.then(res=>{ |
|
|
|
util.hideLoad(); |
|
|
|
if(res.data.code == 0){ |
|
|
|
util.showNone(res.data.message || '操作成功!'); |
|
|
|
setTimeout(_=>{ |
|
|
|
let { optionsQuery } = this; |
|
|
|
this.studentList = []; |
|
|
|
this.page = 1; |
|
|
|
this.getUserList({ |
|
|
|
course_id: optionsQuery.course_id, |
|
|
|
class_id: optionsQuery.class_id, |
|
|
|
}) |
|
|
|
}, 1200) |
|
|
|
|
|
|
|
}else{ |
|
|
|
util.showNone(res.data.message || '操作失败!'); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, 300, 300), |
|
|
|
phoneCall(number){ |
|
|
|
uni.makePhoneCall({ |
|
|
|
phoneNumber: number || '-' |
|
|
|
}) |
|
|
|
}, |
|
|
|
itemSelect(idx){ |
|
|
|
let _list = [...this.studentList]; |
|
|
|
if(_list[idx].attendance_record.id!==0)return; |
|
|
|
_list[idx]['_selectStatus'] = !_list[idx]['_selectStatus']; |
|
|
|
this.studentList = _list; |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
getUserList({ |
|
|
|
course_id, |
|
|
|
class_id, |
|
|
|
page= 1, |
|
|
|
page_size= 15, |
|
|
|
}){ |
|
|
|
util.showLoad(); |
|
|
|
servers.get({ |
|
|
|
url: API.course.getCourseStudentList, |
|
|
|
data: { |
|
|
@ -72,9 +133,14 @@ export default { |
|
|
|
failMsg: '加载失败!' |
|
|
|
}) |
|
|
|
.then(res=>{ |
|
|
|
util.hideLoad(); |
|
|
|
let _list = res.list || []; |
|
|
|
let { list, ..._pageInfo } = res; |
|
|
|
console.warn(_pageInfo, '_pageInfo'); |
|
|
|
this.pageInfo = _pageInfo; |
|
|
|
if(page == 1)return this.studentList = _list; |
|
|
|
if(_list.length <=0)return util.showNone('没有更多!'); |
|
|
|
this.page = page; |
|
|
|
this.studentList = [...this.studentList, ..._list]; |
|
|
|
|
|
|
|
}) |
|
|
@ -122,10 +188,14 @@ export default { |
|
|
|
margin-right: 26upx; |
|
|
|
width: 40upx; |
|
|
|
height: 40upx; |
|
|
|
border-radius: 50%; |
|
|
|
>image{ |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
} |
|
|
|
&.border{ |
|
|
|
box-shadow: inset 0 0 0 2upx #9a9a9d; |
|
|
|
} |
|
|
|
} |
|
|
|
.ri-avatar{ |
|
|
|
flex-shrink: 0; |
|
|
@ -182,7 +252,10 @@ export default { |
|
|
|
flex-shrink: 0; |
|
|
|
font-weight: 500; |
|
|
|
font-size: 28upx; |
|
|
|
color: $themeColor; |
|
|
|
color: #9A9A9D; |
|
|
|
&.green{ |
|
|
|
color: $themeColor; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|