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

366 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
12 months 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">{{ vuex_userInfo.phone }}</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. obj.studentPhone = this.vuex_userInfo.phone,
  207. delete obj.value
  208. delete obj.complainTypeName
  209. const {data: res} = await createcomplain(obj)
  210. this.$u.toast('发布成功')
  211. setTimeout(()=>{
  212. this.$goPage('/pages/indexEntry/consult/record/record?tab=2')
  213. },1500)
  214. },
  215. }
  216. }
  217. </script>
  218. <style lang="scss" scoped>
  219. .pageBgImg {
  220. .card {
  221. margin-bottom: 20rpx;
  222. .h2 {
  223. font-size: 28rpx;
  224. font-weight: 600;
  225. line-height: 96rpx;
  226. }
  227. .textareaBg {
  228. min-height: 364rpx;
  229. background: #F8F8F8;
  230. border-radius: 16rpx;
  231. border: 2rpx solid #E8E9EC;
  232. display: flex;
  233. flex-direction: column;
  234. justify-content: space-between;
  235. .flex {
  236. padding: 20rpx;
  237. align-items: flex-start;
  238. .icon {
  239. width: 24rpx;
  240. height: 24rpx;
  241. margin: 0 14rpx 0 24rpx;
  242. }
  243. .inputBox {
  244. flex: 1;
  245. }
  246. /deep/ .inputBox .u-textarea {
  247. padding: 0 !important;
  248. border: none !important;
  249. background: none !important;
  250. }
  251. }
  252. .phoneBox {
  253. display: flex;
  254. padding: 0 10rpx 20rpx 20rpx;
  255. .imgBox {
  256. display: flex;
  257. .img {
  258. margin-right: 14rpx;
  259. position: relative;
  260. width: 160rpx;
  261. height: 160rpx;
  262. image {
  263. width: 160rpx;
  264. height: 160rpx;
  265. border-radius: 8rpx;
  266. overflow: hidden;
  267. }
  268. .minusCircle {
  269. position: absolute;
  270. right: -14rpx;
  271. top: -20rpx;
  272. z-index: 9;
  273. }
  274. }
  275. }
  276. .phone {
  277. border: 2rpx dashed #CDCED0;
  278. width: 160rpx;
  279. height: 160rpx;
  280. background: #F8F8F8;
  281. border-radius: 8rpx;
  282. overflow: hidden;
  283. display: flex;
  284. align-items: center;
  285. justify-content: center;
  286. flex-direction: column;
  287. .phoneIcon {
  288. width: 60rpx;
  289. height: 60rpx;
  290. }
  291. .lab {
  292. font-size: 20rpx;
  293. color: #686B73;
  294. margin-top: 8rpx;
  295. }
  296. }
  297. }
  298. }
  299. }
  300. .phone_row {
  301. display: flex;
  302. height: 104rpx;
  303. padding: 0 28rpx;
  304. line-height: 104rpx;
  305. .label {
  306. font-size: 28rpx;
  307. font-weight: 600;
  308. margin-right: 50rpx;
  309. }
  310. .uInput {
  311. flex: 1;
  312. }
  313. }
  314. .btn {
  315. width: 396rpx;
  316. height: 72rpx;
  317. background: #D1E7FE;
  318. border-radius: 8rpx;
  319. font-size: 28rpx;
  320. text-align: center;
  321. line-height: 72rpx;
  322. margin: 100rpx auto 114rpx auto;
  323. color: #fff;
  324. &.active {
  325. background: $themC;
  326. }
  327. }
  328. }
  329. .row {
  330. height: 120rpx;
  331. display: flex;
  332. align-items: center;
  333. padding-right: 30rpx;
  334. .label {
  335. font-size: 28rpx;
  336. font-weight: 600;
  337. width: 184rpx;
  338. text-align: center;
  339. }
  340. .select_row {
  341. display: flex;
  342. align-items: center;
  343. justify-content: space-between;
  344. flex: 1;
  345. input {
  346. font-size: 28rpx;
  347. color: #333;
  348. }
  349. }
  350. }
  351. </style>