Browse Source

add api

master
刘嘉炜 4 years ago
parent
commit
aa544932b4
  1. 1
      src/js/api.js
  2. 12
      src/pages/approve/list/list.vue
  3. 33
      src/pages/approve/record/record.vue
  4. 3
      src/pages/course/class_change/class_change.vue
  5. 24
      src/pages/course/student_list/student_list.vue
  6. 60
      src/pages/mine_trainee/mine_trainee.vue

1
src/js/api.js

@ -9,6 +9,7 @@ export const API = {
getHomeData: `${ORIGIN}/stadium/coach/getHomeData`, // 小程序-获取教练主页的数据
saveFeedback: `${ORIGIN}/stadium/coach/saveFeedback`, // 小程序-保存教练反馈
getMyStudentList: `${ORIGIN}/stadium/coach/getMyStudentList`, // 小程序-我的学员
coach_feedback: `${ORIGIN}/upload/file/coach_feedback`, // 上传文件 - 教练反馈
task_publish: `${ORIGIN}/upload/file/task_publish`, // 上传文件 - 布置作业

12
src/pages/approve/list/list.vue

@ -100,10 +100,8 @@ export default {
},
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,
@ -140,11 +138,11 @@ export default {
}
})
}, 300, 300),
tabChange(i){
tabChange: util.debounce(function(i){
this.approveList = [];
this.tabIdx = i;
this.getApproveList(i);
},
}, 300, 300),
toRecord(){
util.routeTo(`/pages/approve/record/record`,'nT');
},
@ -162,7 +160,7 @@ export default {
})
.then(res=>{
util.hideLoad();
let _list = res.list || [{},{}];
let _list = res.list || [];
this.approveList = _list;
console.warn('approve list --->', res);
})
@ -281,9 +279,7 @@ export default {
font-size: 28upx;
line-height: 52upx;
color: #333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
@include textHide(1);
}
}
.c-status{

33
src/pages/approve/record/record.vue

@ -23,25 +23,31 @@
<view class="r-list">
<view class="l-item" v-for="(e, i) in approveList" :key="i">
<view class="l-content">
<view class="c-user">
<image></image>
<view>胡可课</view>
<image :src="e.user_data.avatar_url" mode="aspectFit"></image>
<view>{{e.user_name || '-'}}</view>
</view>
<view class="c-content">
<view class="c-name">羽毛球课程(羽毛球课)</view>
<view class="c-name">{{e.course_name || '-'}}</view>
<view class="c-times">
<view v-for="i in 10" :key="i">2020-08-22 10:30</view>
<view v-for="(k, j) in e.duration_list" :key="j">{{k || '-'}}</view>
</view>
</view>
<view class="c-status">
<view class="s-icon" v-if="false"></view>
<view class="s-txt s-active" v-else>通过</view>
<view :class="['s-txt', e.status ==2?'s-active':'']">
{{
e.status == 0?'待审批':
e.status == 1?'通过':
e.status == 2?'拒绝': '-'
}}
</view>
</view>
</view>
<view class="l-reason">
<view>原因:</view>
<view>作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内</view>
<view>{{e.for_leave_reason || '-'}}</view>
</view>
<view class="l-unfold">
<view>
@ -73,9 +79,11 @@ export default {
this.getApproveList();
},
methods: {
tabChange(i){
tabChange: util.debounce(function(i){
this.approveList = [];
this.tabIdx = i;
},
this.getApproveList(i);
}, 300, 300),
getApproveList(approve_type = 0){
let { storeInfo } = this;
util.showLoad();
@ -90,7 +98,7 @@ export default {
})
.then(res=>{
util.hideLoad();
let _list = res.list || [{},{}];
let _list = res.list || [];
this.approveList = _list;
console.warn('approve list --->', res);
})
@ -169,7 +177,6 @@ export default {
width: 100upx;
height: 100upx;
border-radius: 50%;
background-color: skyblue;
}
>view{
max-width: 120upx;
@ -187,9 +194,7 @@ export default {
font-size: 28upx;
line-height: 52upx;
color: #333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
@include textHide(1);
}
}
.c-status{

3
src/pages/course/class_change/class_change.vue

@ -2,7 +2,7 @@
<view class="class-change">
<view class="cc-user">
<image class="cu-avatar" mode="aspectFit" :src="optionsQuery.user_avatar"></image>
<view>Adjoin</view>
<view>{{optionsQuery.user_name}}</view>
<image class="cu-icon" mode="aspectFit" :src="`/static/images/sex_${optionsQuery.user_gender-1}.png`"></image>
</view>
@ -35,6 +35,7 @@ export default {
onLoad(options){
let _query = util.jsonPar(options.query);
this.optionsQuery = _query;
console.warn(_query)
this.getClassList(_query.course_id)
},
methods: {

24
src/pages/course/student_list/student_list.vue

@ -10,15 +10,15 @@
<view>
<view class="sc-info">
<view class="si-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="si-phone">
<view>{{e.mobile || '-'}}</view>
<image mode="aspectFit" src="/static/images/phone_c33.png" @click="phoneCall(e.mobile)"></image>
<view>{{e.course_order.mobile || '-'}}</view>
<image mode="aspectFit" src="/static/images/phone_c33.png" @click="phoneCall(e.course_order.mobile)"></image>
</view>
</view>
<view class="sc-lave">剩余次数: {{e.number || 0}}</view>
<view class="sc-lave">剩余次数: {{e.course_order.number || 0}}</view>
</view>
</view>
<view class="si-btns">
@ -70,9 +70,9 @@ export default {
toReview(e){
let { optionsQuery } = this;
let _query = {
order_no: e.order_no,
user_id: e.user_id,
user_name: e.name,
order_no: e.course_order.order_no,
user_id: e.attendance_record.user_id,
user_name: e.course_order.name,
...optionsQuery,
}
util.routeTo(`/pages/course/student_review/student_review?query=${util.jsonStr(_query)}`, 'nT');
@ -80,10 +80,10 @@ export default {
toShift(e){
let { optionsQuery } = this;
let _query = {
order_no: e.order_no,
user_id: e.user_id,
user_name: e.name,
user_gender: e.gender,
order_no: e.course_order.order_no,
user_id: e.attendance_record.user_id,
user_name: e.course_order.name,
user_gender: e.course_order.gender,
user_avatar: e.user_info.avatar_url,
...optionsQuery,
}

60
src/pages/mine_trainee/mine_trainee.vue

@ -3,21 +3,21 @@
<view class="t-header">
<view class="h-frame">
<image mode="aspectFit" src="/static/images/search_cf9.png"></image>
<input placeholder="请输入姓名/手机号" />
<image mode="aspectFit" src="/static/images/close_cf9.png"></image>
<input placeholder="请输入姓名/手机号" v-model="keyWord" />
<image v-if="isShowClear" mode="aspectFit" src="/static/images/close_cf9.png" @click="keyWord = ''"></image>
</view>
<view class="h-txt">搜索</view>
<view class="h-txt" @click="searchBtn">搜索</view>
</view>
<view class="t-list">
<view class="l-item" v-for="i in 10" :key="i">
<view class="l-item" v-for="(e, i) in studentList" :key="i">
<view class="i-user">
<image class="u-avatar" mode="aspectFit" src="/static/images/logo.png"></image>
<view>#Adjoin</view>
<image class="u-icon" mode="aspectFit" src="/static/images/sex_0.png"></image>
<image class="u-avatar" mode="aspectFit" :src="e.user.avatar_url"></image>
<view>{{e.course_order.name || '-'}}</view>
<image class="u-icon" mode="aspectFit" :src="`/static/images/sex_${e.course_order.gender-1}.png`"></image>
</view>
<view class="i-phone">
<view>00000000000</view>
<image mode="aspectFit" src="/static/images/phone_c33.png"></image>
<view>{{e.course_order.mobile || '-'}}</view>
<image mode="aspectFit" src="/static/images/phone_c33.png" @click="phoneCall(e.course_order.mobile)"></image>
</view>
</view>
</view>
@ -25,8 +25,48 @@
</template>
<script>
import { API } from '../../js/api'
import { servers } from '../../js/server'
import util from '../../utils/util'
export default {
computed: {
isShowClear(){
return !!this.keyWord
}
},
data(){
return {
keyWord: '',
studentList: [],
}
},
onLoad(){
this.getStudentList()
},
methods: {
phoneCall(num = ''){
uni.makePhoneCall({
phoneNumber: num || '-'
})
},
searchBtn: util.debounce(function(){
let { keyWord } = this;
this.getStudentList(keyWord)
}, 300, 300),
getStudentList(keyword = ''){
util.showLoad();
servers.get({
url: API.getMyStudentList,
data: { keyword },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
console.warn(res)
this.studentList = res.list || [];
})
}
},
}
</script>

Loading…
Cancel
Save