|
|
@ -1,28 +1,80 @@ |
|
|
|
<template> |
|
|
|
<view class="class-change"> |
|
|
|
<view class="cc-user"> |
|
|
|
<image class="cu-avatar"></image> |
|
|
|
<image class="cu-avatar" mode="aspectFit" :src="optionsQuery.user_avatar"></image> |
|
|
|
<view>Adjoin</view> |
|
|
|
<image class="cu-icon"></image> |
|
|
|
<image class="cu-icon" mode="aspectFit" :src="`/static/images/sex_${optionsQuery.user_gender-1}.png`"></image> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="cc-picker"> |
|
|
|
<picker> |
|
|
|
<picker mode="selector" range-key="class_name" :range="classList" @change="pickerChange"> |
|
|
|
<view> |
|
|
|
<input disabled placeholder="请选择班级" /> |
|
|
|
<image></image> |
|
|
|
<input disabled placeholder="请选择班级" v-model="changeClassInfo.class_name"/> |
|
|
|
<image mode="aspectFit" src="/static/images/triangle_c33.png"></image> |
|
|
|
</view> |
|
|
|
</picker> |
|
|
|
</view> |
|
|
|
<view class="cc-fixed"> |
|
|
|
<view hover-class="hover-active">确定</view> |
|
|
|
<view hover-class="hover-active" @click="confirmChange">确定</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { API } from '../../../js/api'; |
|
|
|
import { servers } from '../../../js/server'; |
|
|
|
import util from '../../../utils/util' |
|
|
|
export default { |
|
|
|
|
|
|
|
data(){ |
|
|
|
return { |
|
|
|
optionsQuery: {}, |
|
|
|
classList: [], |
|
|
|
changeClassInfo: {} |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options){ |
|
|
|
let _query = util.jsonPar(options.query); |
|
|
|
this.optionsQuery = _query; |
|
|
|
this.getClassList(_query.course_id) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
confirmChange: util.debounce(function(){ |
|
|
|
let { changeClassInfo, optionsQuery } = this; |
|
|
|
if(JSON.stringify(changeClassInfo) == '{}')return util.routeTo(); |
|
|
|
servers.get({ |
|
|
|
url: API.course.shiftStudentClass, |
|
|
|
data: { |
|
|
|
order_no: optionsQuery.order_no, |
|
|
|
class_id: changeClassInfo.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), |
|
|
|
pickerChange(e){ |
|
|
|
let { classList } = this; |
|
|
|
this.changeClassInfo = classList[e.detail.value]; |
|
|
|
}, |
|
|
|
getClassList( course_id ){ |
|
|
|
servers.get({ |
|
|
|
url: API.course.getClassList, |
|
|
|
data: { course_id, type: 1 }, |
|
|
|
failMsg: '加载失败!' |
|
|
|
}) |
|
|
|
.then(res=>{ |
|
|
|
let _list = res.list || []; |
|
|
|
this.classList = _list; |
|
|
|
console.warn(res); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
@ -40,7 +92,6 @@ export default { |
|
|
|
>image{ |
|
|
|
flex-grow: 0; |
|
|
|
flex-shrink: 0; |
|
|
|
background-color: skyblue; |
|
|
|
} |
|
|
|
.cu-avatar{ |
|
|
|
margin-right: 32upx; |
|
|
@ -84,7 +135,6 @@ export default { |
|
|
|
margin-left: 20upx; |
|
|
|
width: 28upx; |
|
|
|
height: 28upx; |
|
|
|
background-color: skyblue; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|