|
@ -5,31 +5,37 @@ |
|
|
<view class="top_row"> |
|
|
<view class="top_row"> |
|
|
<view class="tit">{{ info.tit }}</view> |
|
|
<view class="tit">{{ info.tit }}</view> |
|
|
<u-checkbox-group iconPlacement="right" :size="14" > |
|
|
<u-checkbox-group iconPlacement="right" :size="14" > |
|
|
<u-checkbox v-model="checked" shape="circle" label="匿名提交" :iconSize="12" :labelSize="12" ></u-checkbox> |
|
|
|
|
|
|
|
|
<u-checkbox v-model="info.anonymity" shape="circle" label="匿名提交" :iconSize="12" :labelSize="12" ></u-checkbox> |
|
|
</u-checkbox-group> |
|
|
</u-checkbox-group> |
|
|
</view> |
|
|
</view> |
|
|
<view class="user_row"> |
|
|
<view class="user_row"> |
|
|
<view class="avatar"> |
|
|
<view class="avatar"> |
|
|
<image src="@/static/images/logo.png" mode=""></image> |
|
|
|
|
|
|
|
|
<image :src="info.photoPath" mode=""></image> |
|
|
</view> |
|
|
</view> |
|
|
<view class="name">王一宝</view> |
|
|
|
|
|
|
|
|
<view class="name">{{info.school? info.schoolName: info.coachName}}</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="star_row"> |
|
|
<view class="star_row"> |
|
|
<view class="lab">服务态度</view> |
|
|
<view class="lab">服务态度</view> |
|
|
<view class="star"> |
|
|
<view class="star"> |
|
|
<u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" :value="4" ></u-rate> |
|
|
|
|
|
|
|
|
<u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" v-model="info.serviceLevel" ></u-rate> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="star_row" v-if="info.school"> |
|
|
|
|
|
<view class="lab">驾校风貌</view> |
|
|
|
|
|
<view class="star"> |
|
|
|
|
|
<u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" v-model="info.schoolLevel" ></u-rate> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="star_row"> |
|
|
<view class="star_row"> |
|
|
<view class="lab">教学安排</view> |
|
|
<view class="lab">教学安排</view> |
|
|
<view class="star"> |
|
|
<view class="star"> |
|
|
<u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" :value="4" ></u-rate> |
|
|
|
|
|
|
|
|
<u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" v-model="info.teachLevel" ></u-rate> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="star_row"> |
|
|
<view class="star_row"> |
|
|
<view class="lab">教学质量</view> |
|
|
<view class="lab">教学质量</view> |
|
|
<view class="star"> |
|
|
<view class="star"> |
|
|
<u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" :value="4" ></u-rate> |
|
|
|
|
|
|
|
|
<u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" v-model="info.qualityLevel" ></u-rate> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<!-- 写内容上传图片 --> |
|
|
<!-- 写内容上传图片 --> |
|
@ -39,24 +45,38 @@ |
|
|
<image src="@/static/images/index/edit.png" mode=""></image> |
|
|
<image src="@/static/images/index/edit.png" mode=""></image> |
|
|
</view> |
|
|
</view> |
|
|
<view class="inputBox"> |
|
|
<view class="inputBox"> |
|
|
<u-textarea v-model="value" ref="textarea" placeholder="详细说明问题,以便获得更好的回答~" border="none"></u-textarea> |
|
|
|
|
|
|
|
|
<u-textarea v-model="info.description" ref="textarea" placeholder="详细说明问题,以便获得更好的回答~" border="none"></u-textarea> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="phoneBox"> |
|
|
<view class="phoneBox"> |
|
|
<view class="imgBox"> |
|
|
<view class="imgBox"> |
|
|
<view class="img"> |
|
|
|
|
|
<view class="minusCircle"> |
|
|
|
|
|
<u-icon name="close-circle-fill" size="20" color="#9FA3A4"></u-icon> |
|
|
|
|
|
|
|
|
<view class="img" v-for="(item,index) in info.imgArr" :key="item"> |
|
|
|
|
|
<view class="minusCircle" @click="deleteImg(item)"> |
|
|
|
|
|
<u-icon name="close-circle-fill" size="20" color="#b9061d"></u-icon> |
|
|
</view> |
|
|
</view> |
|
|
<image src="@/static/logo.png" mode=""></image> |
|
|
|
|
|
|
|
|
<image :src="item" mode=""></image> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="phone" @click="chooseImages"> |
|
|
|
|
|
|
|
|
<view class="phone" @click="chooseImages" v-if="info.imgArr.length<3"> |
|
|
<view class="phoneIcon"> |
|
|
<view class="phoneIcon"> |
|
|
<image src="@/static/images/index/btn_tupian.png" mode=""></image> |
|
|
<image src="@/static/images/index/btn_tupian.png" mode=""></image> |
|
|
</view> |
|
|
</view> |
|
|
<view class="lab">添加图片</view> |
|
|
<view class="lab">添加图片</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<view class="phone" @click="chooseVideo" v-if="!info.videoUrl" > |
|
|
|
|
|
<view class="phoneIcon"> |
|
|
|
|
|
<image src="@/static/images/index/btn_tupian.png" mode=""></image> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="lab">添加视频</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="imgBox" style="margin-left: 16rpx;" v-else> |
|
|
|
|
|
<view class="img"> |
|
|
|
|
|
<view class="minusCircle" @click="info.videoUrl=''"> |
|
|
|
|
|
<u-icon name="close-circle-fill" size="20" color="#b9061d"></u-icon> |
|
|
|
|
|
</view> |
|
|
|
|
|
<video :src="info.videoUrl" style="width: 160rpx;height: 160rpx;display: block;" ></video> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
@ -68,18 +88,131 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
|
|
|
import { WX_API, H5_API, prefix } from '@/config/site.config.js'; |
|
|
|
|
|
var _url = H5_API+ WX_API |
|
|
export default { |
|
|
export default { |
|
|
props: [ 'info' ], |
|
|
props: [ 'info' ], |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
checked: false |
|
|
|
|
|
|
|
|
checked: false, |
|
|
|
|
|
imgArr:[] |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
methods: { |
|
|
|
|
|
deleteImg(item) { |
|
|
|
|
|
let index = this.info.imgArr.findIndex(val=>val==item) |
|
|
|
|
|
this.info.imgArr.splice(index, 1) |
|
|
|
|
|
}, |
|
|
|
|
|
chooseVideo() { |
|
|
|
|
|
uni.chooseVideo({ |
|
|
|
|
|
sourceType: ['album', 'camera'], |
|
|
|
|
|
compressed: true, |
|
|
|
|
|
success: (res)=> { |
|
|
|
|
|
// 在这里处理选定的视频文件 |
|
|
|
|
|
console.log(res.tempFilePath); |
|
|
|
|
|
// 调用上传视频函数 |
|
|
|
|
|
this.uploadImgApi(res.tempFilePath, res.name, 'video') |
|
|
|
|
|
}, |
|
|
|
|
|
fail: function (error) { |
|
|
|
|
|
console.log(error); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
uploadVideo(filePath) { |
|
|
|
|
|
uni.uploadFile({ |
|
|
|
|
|
url: 'https://your-upload-api.com/upload-video', |
|
|
|
|
|
filePath: filePath, |
|
|
|
|
|
name: 'video', |
|
|
|
|
|
formData: { |
|
|
|
|
|
// 你可能需要传递其他表单数据 |
|
|
|
|
|
}, |
|
|
|
|
|
success: function (res) { |
|
|
|
|
|
var data = JSON.parse(res.data); |
|
|
|
|
|
if (data.code === 0) { |
|
|
|
|
|
// 上传成功,处理服务器返回的数据 |
|
|
|
|
|
console.log('上传成功', data); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 上传失败,处理错误信息 |
|
|
|
|
|
console.log('上传失败', data); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
fail: function (error) { |
|
|
|
|
|
console.log('上传失败', error); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
//选择图片 |
|
|
|
|
|
chooseImages(type) { |
|
|
|
|
|
let imgNum = 3 - (this.imgArr.length) |
|
|
|
|
|
uni.chooseImage({ |
|
|
|
|
|
count: imgNum, //允许选择的数量 |
|
|
|
|
|
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 |
|
|
|
|
|
sourceType: ['album', 'camera'], //从相册选择 |
|
|
|
|
|
success: res => { |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: '图片上传中...' |
|
|
|
|
|
}); |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
res.tempFiles.forEach( (item,index)=>{ |
|
|
|
|
|
this.uploadImgApi(item.path, item.name) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
uploadImgApi(filePath, imgName, vdo) { |
|
|
|
|
|
console.log(filePath) |
|
|
|
|
|
let token = 'Bearer '+ this.$store.state.user.vuex_loginInfo.accessToken |
|
|
|
|
|
let _this = this |
|
|
|
|
|
let timer = new Date() * 1 |
|
|
|
|
|
// 上传图片到服务器 |
|
|
|
|
|
uni.uploadFile({ |
|
|
|
|
|
url: _url + 'app-api/infra/file/upload',//接口 |
|
|
|
|
|
filePath: filePath,//要上传的图片的本地路径 |
|
|
|
|
|
name: 'file', |
|
|
|
|
|
|
|
|
|
|
|
formData: { |
|
|
|
|
|
path: 'complain/'+ uni.$u.date(name, 'yyyy-mm-dd')+'/'+timer + '-'+ imgName, |
|
|
|
|
|
type: 1, |
|
|
|
|
|
fileSuffix: "png" |
|
|
|
|
|
}, |
|
|
|
|
|
header: { |
|
|
|
|
|
Authorization: token, |
|
|
|
|
|
'tenant-id': 1 |
|
|
|
|
|
}, |
|
|
|
|
|
success(res) { |
|
|
|
|
|
console.log('上传成功') |
|
|
|
|
|
let res2 = JSON.parse(res.data) |
|
|
|
|
|
if(vdo) { |
|
|
|
|
|
_this.info.videoUrl = res2.data |
|
|
|
|
|
}else { |
|
|
|
|
|
_this.info.imgArr.push(res2.data) |
|
|
|
|
|
} |
|
|
|
|
|
console.log(res2) |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
}, |
|
|
|
|
|
complete: (err)=> { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
@import '../../../../common/css/textareaBg.scss'; |
|
|
@import '../../../../common/css/textareaBg.scss'; |
|
|
|
|
|
.phoneBox { |
|
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
|
.img { |
|
|
|
|
|
margin-bottom: 16rpx; |
|
|
|
|
|
} |
|
|
|
|
|
.phone { |
|
|
|
|
|
margin-right: 16rpx; |
|
|
|
|
|
} |
|
|
|
|
|
.imgBox { |
|
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
.card { |
|
|
.card { |
|
|
padding: 28rpx; |
|
|
padding: 28rpx; |
|
|
margin-bottom: 20rpx; |
|
|
margin-bottom: 20rpx; |
|
|