学员端小程序
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.

365 lines
9.4 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 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 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="pageBgImg">
  3. <topNavbar title="我要投诉"></topNavbar>
  4. <view class="pad">
  5. <!-- 投诉类别 -->
  6. <view class="card">
  7. <view class="row">
  8. <view class="label">投诉类别</view>
  9. <view class="rightSelect">
  10. <u-radio-group
  11. v-model="form.userType"
  12. >
  13. <u-radio
  14. :customStyle="{marginRight: '24rpx'}"
  15. v-for="(item, index) in radiolist1"
  16. :key="index"
  17. :label="item.name"
  18. :name="item.id"
  19. >
  20. </u-radio>
  21. </u-radio-group>
  22. </view>
  23. </view>
  24. </view>
  25. <!-- 驾校名称 教练名称 -->
  26. <view class="card">
  27. <view class="row">
  28. <view class="label">驾校名称</view>
  29. <view @click="showSchool=true" class="select_row my" >
  30. <input v-model="form.schoolName" placeholder="请选择" @click="showSchool=true" disabled style="pointer-events: none;"/></input>
  31. <u-icon name="arrow-right" size="14" color="#686B73" style="margin-left: 12rpx;" ></u-icon>
  32. </view>
  33. </view>
  34. <view class="row">
  35. <view class="label">教练名称</view>
  36. <view @click="goCoach" class="select_row" >
  37. <input v-model="form.coachName" placeholder="请选择" @click="goCoach" style="pointer-events: none;" disabled/></input>
  38. <u-icon name="arrow-right" size="14" color="#686B73" style="margin-left: 12rpx;" ></u-icon>
  39. </view>
  40. </view>
  41. </view>
  42. <!-- 投诉类型 -->
  43. <view class="card">
  44. <view class="row">
  45. <view class="label">投诉类型</view>
  46. <view @click="showComplainType=true" class="select_row" >
  47. <input v-model="form.complainTypeName" placeholder="请选择" @click="showComplainType=true" style="pointer-events: none;" disabled/></input>
  48. <u-icon name="arrow-right" size="14" color="#686B73" style="margin-left: 12rpx;" ></u-icon>
  49. </view>
  50. </view>
  51. </view>
  52. <!-- 咨询内容 -->
  53. <view class="card" style="padding: 0 24rpx 24rpx 24rpx ;">
  54. <view class="h2">咨询内容</view>
  55. <view class="textareaBg">
  56. <view class="flex">
  57. <view class="icon">
  58. <image src="@/static/images/index/edit.png" mode=""></image>
  59. </view>
  60. <view class="inputBox">
  61. <u-textarea v-model.trim="form.content" ref="textarea" placeholder="详细说明问题,以便获得更好的回答~"></u-textarea>
  62. </view>
  63. </view>
  64. <view class="phoneBox">
  65. <view class="imgBox">
  66. <view class="img" v-for="(item,index) in imgArr" :key="item">
  67. <view class="minusCircle" @click="deleteImg(item)">
  68. <u-icon name="close-circle-fill" size="20" color="#b9061d"></u-icon>
  69. </view>
  70. <image :src="item" mode=""></image>
  71. </view>
  72. </view>
  73. <view class="phone" @click="chooseImages" v-if="imgArr.length<3">
  74. <view class="phoneIcon">
  75. <image src="@/static/images/index/btn_tupian.png" mode=""></image>
  76. </view>
  77. <view class="lab">添加图片</view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="card">
  83. <view class="phone_row">
  84. <view class="label">联系电话</view>
  85. <view class="uInput my">{{ this.vuex_userInfo.mobile }}</view>
  86. </view>
  87. </view>
  88. <view class="btn" :class="{active: btnActive}" @click="submintFn">提交</view>
  89. </view>
  90. <u-picker :show="showComplainType" :columns="complainTypeArr" keyName="label" @confirm="confirmComplainType" @cancel="showComplainType=false"></u-picker>
  91. <u-popup :show="showSchool" mode="bottom" :round="8" @close="showSchool=false">
  92. <searchSchool @chooseSchool="chooseSchool"/>
  93. </u-popup>
  94. <!-- <u-picker :show="show" :columns="shoolArr" keyName="lab"></u-picker> -->
  95. </view>
  96. </template>
  97. <script>
  98. import { createcomplain, consultationType } from '@/config/api.js'
  99. import searchSchool from '@/pages/indexEntry/enroll/registInfo/comp/searchSchool.vue'
  100. import { uploadImgApi } from '@/config/utils.js'
  101. export default {
  102. components: { searchSchool },
  103. data() {
  104. return {
  105. showSchool: false,
  106. value: '',
  107. imgArr: [],
  108. showComplainType: false,
  109. // 1、服务态度,2、教学质量、3、退费问题,4、学时问题,5、考试预约,6、转校问题,示例值(1)
  110. complainTypeArr: [],
  111. form: {
  112. value: '投诉驾校',
  113. complainType: '',
  114. complainTypeName: '',
  115. userType: 1,
  116. coachName: '',
  117. schoolName: '',
  118. schoolId: '',
  119. content: '',
  120. type: 2
  121. },
  122. radiolist1: [{
  123. name: '投诉驾校',
  124. id: 1,
  125. disabled: false
  126. },
  127. {
  128. name: '投诉教练',
  129. id: 2,
  130. disabled: false
  131. },
  132. ],
  133. }
  134. },
  135. computed: {
  136. btnActive() {
  137. if(this.form.schoolId&&this.form.complainType&&this.form.content) {
  138. return true
  139. }else {
  140. return false
  141. }
  142. }
  143. },
  144. onLoad() {
  145. uni.$on('upDateCoachItem',(item)=>{
  146. console.log(item)
  147. this.form.coachId = item.id
  148. this.form.coachName = item.name
  149. })
  150. this.consultationTypeFn()
  151. },
  152. methods: {
  153. // 投诉类型
  154. async consultationTypeFn() {
  155. const {data: res} = await consultationType()
  156. this.complainTypeArr = [res]
  157. },
  158. // 选择投诉类型
  159. confirmComplainType(val) {
  160. console.log(val)
  161. let item = val.value[0]
  162. this.form.complainType = item.value
  163. this.form.complainTypeName = item.label
  164. this.showComplainType = false
  165. },
  166. // 选择驾校
  167. chooseSchool(item) {
  168. this.form.schoolName = item.name
  169. this.form.schoolId = item.id
  170. console.log(this.columnsCar)
  171. this.showSchool = false
  172. },
  173. // 跳转到选择教练
  174. goCoach() {
  175. if(!this.form.schoolId) return this.$u.toast('请先选择驾校')
  176. this.$goPage('/pages/indexEntry/enroll/registInfo/chooseCoach/chooseCoach?schoolId=' + this.form.schoolId)
  177. },
  178. deleteImg(item) {
  179. let index = this.imgArr.findIndex(val=>val==item)
  180. this.imgArr.splice(index, 1)
  181. },
  182. //选择图片
  183. chooseImages(type) {
  184. let imgNum = 3 - (this.imgArr.length)
  185. uni.chooseImage({
  186. count: imgNum, //允许选择的数量
  187. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  188. sourceType: ['album', 'camera'], //从相册选择
  189. success: res => {
  190. uni.showLoading({
  191. title: '图片上传中...'
  192. });
  193. // console.log(res)
  194. res.tempFiles.forEach( async (item,index)=>{
  195. let imgLink = await uploadImgApi(item.path, item.name)
  196. this.imgArr.push(imgLink)
  197. })
  198. }
  199. })
  200. },
  201. async submintFn() {
  202. if(!this.btnActive) return
  203. if(!this.form.content) return this.$u.toast('请输入内容')
  204. this.form.images = this.imgArr.join(',')
  205. let obj = Object.assign({}, this.form)
  206. delete obj.value
  207. delete obj.complainTypeName
  208. const {data: res} = await createcomplain(this.form)
  209. this.$u.toast('发布成功')
  210. setTimeout(()=>{
  211. this.$goPage('/pages/indexEntry/consult/record/record?tab=2')
  212. },1500)
  213. },
  214. }
  215. }
  216. </script>
  217. <style lang="scss" scoped>
  218. .pageBgImg {
  219. .card {
  220. margin-bottom: 20rpx;
  221. .h2 {
  222. font-size: 28rpx;
  223. font-weight: 600;
  224. line-height: 96rpx;
  225. }
  226. .textareaBg {
  227. min-height: 364rpx;
  228. background: #F8F8F8;
  229. border-radius: 16rpx;
  230. border: 2rpx solid #E8E9EC;
  231. display: flex;
  232. flex-direction: column;
  233. justify-content: space-between;
  234. .flex {
  235. padding: 20rpx;
  236. align-items: flex-start;
  237. .icon {
  238. width: 24rpx;
  239. height: 24rpx;
  240. margin: 0 14rpx 0 24rpx;
  241. }
  242. .inputBox {
  243. flex: 1;
  244. }
  245. /deep/ .inputBox .u-textarea {
  246. padding: 0 !important;
  247. border: none !important;
  248. background: none !important;
  249. }
  250. }
  251. .phoneBox {
  252. display: flex;
  253. padding: 0 10rpx 20rpx 20rpx;
  254. .imgBox {
  255. display: flex;
  256. .img {
  257. margin-right: 14rpx;
  258. position: relative;
  259. width: 160rpx;
  260. height: 160rpx;
  261. image {
  262. width: 160rpx;
  263. height: 160rpx;
  264. border-radius: 8rpx;
  265. overflow: hidden;
  266. }
  267. .minusCircle {
  268. position: absolute;
  269. right: -14rpx;
  270. top: -20rpx;
  271. z-index: 9;
  272. }
  273. }
  274. }
  275. .phone {
  276. border: 2rpx dashed #CDCED0;
  277. width: 160rpx;
  278. height: 160rpx;
  279. background: #F8F8F8;
  280. border-radius: 8rpx;
  281. overflow: hidden;
  282. display: flex;
  283. align-items: center;
  284. justify-content: center;
  285. flex-direction: column;
  286. .phoneIcon {
  287. width: 60rpx;
  288. height: 60rpx;
  289. }
  290. .lab {
  291. font-size: 20rpx;
  292. color: #686B73;
  293. margin-top: 8rpx;
  294. }
  295. }
  296. }
  297. }
  298. }
  299. .phone_row {
  300. display: flex;
  301. height: 104rpx;
  302. padding: 0 28rpx;
  303. line-height: 104rpx;
  304. .label {
  305. font-size: 28rpx;
  306. font-weight: 600;
  307. margin-right: 50rpx;
  308. }
  309. .uInput {
  310. flex: 1;
  311. }
  312. }
  313. .btn {
  314. width: 396rpx;
  315. height: 72rpx;
  316. background: #D1E7FE;
  317. border-radius: 8rpx;
  318. font-size: 28rpx;
  319. text-align: center;
  320. line-height: 72rpx;
  321. margin: 100rpx auto 114rpx auto;
  322. color: #fff;
  323. &.active {
  324. background: $themC;
  325. }
  326. }
  327. }
  328. .row {
  329. height: 120rpx;
  330. display: flex;
  331. align-items: center;
  332. padding-right: 30rpx;
  333. .label {
  334. font-size: 28rpx;
  335. font-weight: 600;
  336. width: 184rpx;
  337. text-align: center;
  338. }
  339. .select_row {
  340. display: flex;
  341. align-items: center;
  342. justify-content: space-between;
  343. flex: 1;
  344. input {
  345. font-size: 28rpx;
  346. color: #333;
  347. }
  348. }
  349. }
  350. </style>