|
@ -2,22 +2,22 @@ |
|
|
<view class="student-review fixed-bot-padding"> |
|
|
<view class="student-review fixed-bot-padding"> |
|
|
<view class="sr-section"> |
|
|
<view class="sr-section"> |
|
|
<view class="ss-name"> |
|
|
<view class="ss-name"> |
|
|
<view>羽毛球课包学会(带体验课)</view> |
|
|
|
|
|
<view>一班</view> |
|
|
|
|
|
|
|
|
<view>{{ optionsQuery.course_name || '-' }}</view> |
|
|
|
|
|
<view>{{ optionsQuery.class_name || '-' }}</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="ss-user"> |
|
|
<view class="ss-user"> |
|
|
<view>学员名称:</view> |
|
|
<view>学员名称:</view> |
|
|
<picker class="su-picker"> |
|
|
|
|
|
|
|
|
<picker class="su-picker" disabled> |
|
|
<view> |
|
|
<view> |
|
|
<input disabled placeholder="选择姓名" /> |
|
|
|
|
|
<image></image> |
|
|
|
|
|
|
|
|
<input disabled placeholder="选择姓名" :value="optionsQuery.user_name || '-'" /> |
|
|
|
|
|
<!-- <image></image> --> |
|
|
</view> |
|
|
</view> |
|
|
</picker> |
|
|
</picker> |
|
|
</view> |
|
|
</view> |
|
|
<view class="ss-review"> |
|
|
<view class="ss-review"> |
|
|
<view>学员点评:</view> |
|
|
<view>学员点评:</view> |
|
|
<view> |
|
|
<view> |
|
|
<textarea placeholder="请输入您的点评、建议或者发现的问题"></textarea> |
|
|
|
|
|
|
|
|
<textarea placeholder="请输入您的点评、建议或者发现的问题" v-model="descTxt"></textarea> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="ss-title"> |
|
|
<view class="ss-title"> |
|
@ -25,25 +25,108 @@ |
|
|
(最多上传3张,只支持.jpg、png 格式) |
|
|
(最多上传3张,只支持.jpg、png 格式) |
|
|
</view> |
|
|
</view> |
|
|
<view class="ss-pics"> |
|
|
<view class="ss-pics"> |
|
|
<view class="sp-item" v-for="i in 5" :key="i"> |
|
|
|
|
|
<image class="si-close"></image> |
|
|
|
|
|
<image class="si-img"></image> |
|
|
|
|
|
|
|
|
<view class="sp-item" v-for="(e, i) in imageList" :key="i"> |
|
|
|
|
|
<image class="si-close" mode="aspectFit" src="/static/images/close_c00.png" @click="clearImage(i)"></image> |
|
|
|
|
|
<image class="si-img" mode="aspectFit" :src="e" @click="previewImage(e)"></image> |
|
|
</view> |
|
|
</view> |
|
|
<view class="sp-item sp-add"> |
|
|
|
|
|
|
|
|
<view class="sp-item sp-add" @click="imgSelect"> |
|
|
<view></view> |
|
|
<view></view> |
|
|
<view>上传照片</view> |
|
|
<view>上传照片</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="fixed-bot-btn"> |
|
|
<view class="fixed-bot-btn"> |
|
|
<view hover-class="hover-active">确定</view> |
|
|
|
|
|
|
|
|
<view hover-class="hover-active" @click="submitBtn">确定</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
|
|
|
import { API } from '../../../js/api'; |
|
|
|
|
|
import { servers } from '../../../js/server'; |
|
|
|
|
|
import util from '../../../utils/util'; |
|
|
export default { |
|
|
export default { |
|
|
|
|
|
data(){ |
|
|
|
|
|
return { |
|
|
|
|
|
imageList: [], |
|
|
|
|
|
descTxt: '', |
|
|
|
|
|
optionsQuery: {}, |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
onLoad(options){ |
|
|
|
|
|
this.optionsQuery = util.jsonPar(options.query); |
|
|
|
|
|
console.warn(util.jsonPar(options.query)); |
|
|
|
|
|
}, |
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
|
|
|
|
// 删除图片 |
|
|
|
|
|
clearImage(index){ |
|
|
|
|
|
let _imgs = [...this.imageList]; |
|
|
|
|
|
_imgs.splice(index,1); |
|
|
|
|
|
this.imageList = _imgs; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 查看大图片 |
|
|
|
|
|
previewImage(src) { |
|
|
|
|
|
uni.previewImage({ |
|
|
|
|
|
current: src, |
|
|
|
|
|
urls: this.imageList |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
submitBtn: util.debounce(function(){ |
|
|
|
|
|
let { descTxt, imageList, optionsQuery } = this; |
|
|
|
|
|
console.warn(descTxt, 'descTxtdescTxtdescTxt') |
|
|
|
|
|
if(descTxt == '')return util.showNone('请输入'); |
|
|
|
|
|
servers.post({ |
|
|
|
|
|
url: API.course.SaveStudentComment, |
|
|
|
|
|
data: { |
|
|
|
|
|
order_no: optionsQuery.order_no, |
|
|
|
|
|
course_id: optionsQuery.course_id, |
|
|
|
|
|
user_id: optionsQuery.user_id, |
|
|
|
|
|
comment: descTxt, |
|
|
|
|
|
imgs: imageList, |
|
|
|
|
|
}, |
|
|
|
|
|
isDefaultGet: false, |
|
|
|
|
|
}) |
|
|
|
|
|
.then(e=>{ |
|
|
|
|
|
if(e.data.code == 0){ |
|
|
|
|
|
console.warn(e); |
|
|
|
|
|
util.showNone(e.data.message || '操作成功!'); |
|
|
|
|
|
setTimeout(util.routeTo, 1200); |
|
|
|
|
|
}else{ |
|
|
|
|
|
util.showNone(e.data.message || '操作失败!'); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, 300, 300), |
|
|
|
|
|
// 从相册选择图片 |
|
|
|
|
|
imgSelect() { |
|
|
|
|
|
uni.chooseImage({ |
|
|
|
|
|
count: 1, |
|
|
|
|
|
sizeType: [ 'compressed ' ], |
|
|
|
|
|
success: res => { |
|
|
|
|
|
util.showLoad(); |
|
|
|
|
|
servers.uploadFile({ |
|
|
|
|
|
url: API.student_review, |
|
|
|
|
|
filePath: res.tempFilePaths[0], |
|
|
|
|
|
}) |
|
|
|
|
|
.then(e=>{ |
|
|
|
|
|
util.hideLoad(); |
|
|
|
|
|
let _res = util.jsonPar(e.data); |
|
|
|
|
|
if(_res.code == 0){ |
|
|
|
|
|
this.imageList = [_res.data.url, ...this.imageList] |
|
|
|
|
|
}else{ |
|
|
|
|
|
console.error('上传图片失败--->',_res); |
|
|
|
|
|
util.showNone(_res.message || '上传图片失败,请重试!') |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(err=>{ |
|
|
|
|
|
console.error('上传图片失败--->',err); |
|
|
|
|
|
util.showNone('上传图片失败,稍后重试!') |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
@ -106,7 +189,6 @@ export default { |
|
|
flex-shrink: 0; |
|
|
flex-shrink: 0; |
|
|
width: 28upx; |
|
|
width: 28upx; |
|
|
height: 28upx; |
|
|
height: 28upx; |
|
|
background-color: skyblue; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -158,7 +240,6 @@ export default { |
|
|
width: 200upx; |
|
|
width: 200upx; |
|
|
height: 200upx; |
|
|
height: 200upx; |
|
|
border-radius: 10upx; |
|
|
border-radius: 10upx; |
|
|
background-color: greenyellow; |
|
|
|
|
|
overflow: hidden; |
|
|
overflow: hidden; |
|
|
&:not(:nth-child(3n)){ |
|
|
&:not(:nth-child(3n)){ |
|
|
margin-right: 44upx; |
|
|
margin-right: 44upx; |
|
@ -170,22 +251,21 @@ export default { |
|
|
z-index: 2; |
|
|
z-index: 2; |
|
|
width: 40upx; |
|
|
width: 40upx; |
|
|
height: 40upx; |
|
|
height: 40upx; |
|
|
background-color: skyblue; |
|
|
|
|
|
} |
|
|
} |
|
|
.si-img{ |
|
|
.si-img{ |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
height: 100%; |
|
|
height: 100%; |
|
|
background-color: royalblue; |
|
|
|
|
|
} |
|
|
} |
|
|
&.sp-add{ |
|
|
&.sp-add{ |
|
|
padding-top: 36upx; |
|
|
padding-top: 36upx; |
|
|
|
|
|
border: 2upx solid #d8d8d8; |
|
|
>view{ |
|
|
>view{ |
|
|
&:first-child{ |
|
|
&:first-child{ |
|
|
position: relative; |
|
|
position: relative; |
|
|
margin: 0 auto 30upx; |
|
|
margin: 0 auto 30upx; |
|
|
width: 60upx; |
|
|
width: 60upx; |
|
|
height: 60upx; |
|
|
height: 60upx; |
|
|
background-color: springgreen; |
|
|
|
|
|
|
|
|
|
|
|
&::before{ |
|
|
&::before{ |
|
|
content: ''; |
|
|
content: ''; |
|
|
position: absolute; |
|
|
position: absolute; |
|
|