学员端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

221 lines
5.9 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="">
  3. <view class="pad">
  4. <view class="card">
  5. <view class="top_row">
  6. <view class="tit">{{ info.tit }}</view>
  7. <u-checkbox-group >
  8. <u-checkbox v-model="info.anonymity" shape="circle" label="匿名提交" :iconSize="12" name="匿名提交" :labelSize="12" @change="changeChe"></u-checkbox>
  9. </u-checkbox-group>
  10. </view>
  11. <view class="user_row">
  12. <view class="avatar">
  13. <image :src="info.photoPath" mode=""></image>
  14. </view>
  15. <view class="name">{{info.school? info.schoolName: info.coachName}}</view>
  16. </view>
  17. <view class="star_row">
  18. <view class="lab">服务态度</view>
  19. <view class="star">
  20. <u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" v-model="info.serviceLevel" ></u-rate>
  21. </view>
  22. </view>
  23. <view class="star_row" v-if="info.school">
  24. <view class="lab">驾校风貌</view>
  25. <view class="star">
  26. <u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" v-model="info.schoolLevel" ></u-rate>
  27. </view>
  28. </view>
  29. <view class="star_row">
  30. <view class="lab">教学安排</view>
  31. <view class="star">
  32. <u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" v-model="info.teachLevel" ></u-rate>
  33. </view>
  34. </view>
  35. <view class="star_row">
  36. <view class="lab">教学质量</view>
  37. <view class="star">
  38. <u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" v-model="info.qualityLevel" ></u-rate>
  39. </view>
  40. </view>
  41. <!-- 写内容上传图片 -->
  42. <view class="textareaBg">
  43. <view class="flex">
  44. <view class="icon">
  45. <image src="@/static/images/index/edit.png" mode=""></image>
  46. </view>
  47. <view class="inputBox">
  48. <u-textarea v-model="info.description" ref="textarea" placeholder="详细说明问题,以便获得更好的回答~" border="none"></u-textarea>
  49. </view>
  50. </view>
  51. <view class="phoneBox">
  52. <view class="imgBox">
  53. <view class="img" v-for="(item,index) in info.imgArr" :key="item">
  54. <view class="minusCircle" @click="deleteImg(item)">
  55. <u-icon name="close-circle-fill" size="20" color="#b9061d"></u-icon>
  56. </view>
  57. <image :src="item" mode=""></image>
  58. </view>
  59. </view>
  60. <view class="phone" @click="chooseImages" v-if="info.imgArr&&info.imgArr.length<3">
  61. <view class="phoneIcon">
  62. <image src="@/static/images/index/btn_tupian.png" mode=""></image>
  63. </view>
  64. <view class="lab">添加图片</view>
  65. </view>
  66. <view class="phone" @click="chooseVideo" v-if="!info.videoUrl" >
  67. <view class="phoneIcon">
  68. <image src="@/static/images/index/btn_tupian.png" mode=""></image>
  69. </view>
  70. <view class="lab">添加视频</view>
  71. </view>
  72. <view class="imgBox" style="margin-left: 16rpx;" v-else>
  73. <view class="img">
  74. <view class="minusCircle" @click="info.videoUrl=''">
  75. <u-icon name="close-circle-fill" size="20" color="#b9061d"></u-icon>
  76. </view>
  77. <video :src="info.videoUrl" style="width: 160rpx;height: 160rpx;display: block;" ></video>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. import { uploadImgApi } from '@/config/utils.js'
  88. export default {
  89. props: [ 'info' ],
  90. data() {
  91. return {
  92. checked: false,
  93. imgArr:[]
  94. }
  95. },
  96. methods: {
  97. // 1是匿名 2是不匿名
  98. changeChe(val) {
  99. // console.log(this.info.anonymity)
  100. console.log(val)
  101. if(val) {
  102. this.info.anonymity = 1
  103. }else {
  104. this.info.anonymity = 2
  105. }
  106. },
  107. deleteImg(item) {
  108. let index = this.info.imgArr.findIndex(val=>val==item)
  109. this.info.imgArr.splice(index, 1)
  110. },
  111. chooseVideo() {
  112. uni.chooseVideo({
  113. sourceType: ['album', 'camera'],
  114. compressed: true,
  115. success: async (res)=> {
  116. // 在这里处理选定的视频文件
  117. console.log(res.tempFilePath);
  118. // 调用上传视频函数
  119. let videoUrl = await uploadImgApi(res.tempFilePath, res.name, 'video')
  120. if(videoUrl) this.info.videoUrl = videoUrl
  121. },
  122. fail: function (error) {
  123. console.log(error);
  124. }
  125. });
  126. },
  127. //选择图片
  128. chooseImages(type) {
  129. let imgNum = 3 - (this.imgArr.length)
  130. uni.chooseImage({
  131. count: imgNum, //允许选择的数量
  132. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  133. sourceType: ['album', 'camera'], //从相册选择
  134. success: res => {
  135. uni.showLoading({
  136. title: '图片上传中...'
  137. });
  138. console.log(res)
  139. res.tempFiles.forEach(async (item,index)=>{
  140. let imgLink = await uploadImgApi(item.path, index)
  141. if(imgLink) this.info.imgArr.push(imgLink)
  142. })
  143. }
  144. })
  145. },
  146. }
  147. }
  148. </script>
  149. <style lang="scss" scoped>
  150. @import '../../../../common/css/textareaBg.scss';
  151. .phoneBox {
  152. flex-wrap: wrap;
  153. .img {
  154. margin-bottom: 16rpx;
  155. }
  156. .phone {
  157. margin-right: 16rpx;
  158. }
  159. .imgBox {
  160. flex-wrap: wrap;
  161. }
  162. }
  163. .card {
  164. padding: 28rpx;
  165. margin-bottom: 20rpx;
  166. .top_row {
  167. display: flex;
  168. align-items: center;
  169. padding-bottom: 24rpx;
  170. border-bottom: 2rpx solid #E8E9EC;
  171. justify-content: space-between;
  172. .tit {
  173. font-weight: 600;
  174. color: #333333;
  175. font-size: 32rpx;
  176. }
  177. }
  178. .user_row {
  179. width: 100%;
  180. height: 100rpx;
  181. display: flex;
  182. align-items: center;
  183. .avatar {
  184. width: 60rpx;
  185. height: 60rpx;
  186. border-radius: 50%;
  187. overflow: hidden;
  188. }
  189. .name {
  190. font-size: 28rpx;
  191. font-weight: 500;
  192. padding-left: 26rpx;
  193. }
  194. }
  195. .star_row {
  196. padding: 14rpx 0;
  197. display: flex;
  198. align-items: center;
  199. .lab {
  200. font-size: 28rpx;
  201. font-weight: 500;
  202. padding-right: 32rpx;
  203. }
  204. .star {
  205. }
  206. }
  207. .textareaBg {
  208. margin-top: 22rpx;
  209. }
  210. }
  211. </style>