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

321 lines
7.7 KiB

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.radiovalue1"
  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.name"
  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="showShoolName=true" class="select_row my" >
  30. <input v-model="form.classModel" placeholder="请选择" @click="showShoolName=true" disabled/></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="showShoolName=true" class="select_row" >
  37. <input v-model="form.classModel" placeholder="请选择" @click="showShoolName=true" 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="showShoolName=true" class="select_row" >
  47. <input v-model="form.classModel" placeholder="请选择" @click="showShoolName=true" 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="value" ref="textarea" placeholder="详细说明问题,以便获得更好的回答~"></u-textarea>
  62. </view>
  63. </view>
  64. <view class="phoneBox">
  65. <view class="imgBox">
  66. <view class="img">
  67. <view class="minusCircle">
  68. <u-icon name="close-circle-fill" size="20" color="#b9061d"></u-icon>
  69. </view>
  70. <image src="../../../../static/logo.png" mode=""></image>
  71. </view>
  72. </view>
  73. <view class="phone" @click="chooseImages">
  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">
  86. <u--input placeholder="输入手机号码,以便我们回复您!" v-model="value" border="none" type="number" fontSize="14"></u--input>
  87. </view>
  88. </view>
  89. </view>
  90. <view class="btn active">提交</view>
  91. </view>
  92. <u-picker :show="showShoolName" :columns="shoolArr" keyName="lab" @confirm="confirmSex" @cancel="showShoolName=false"></u-picker>
  93. <!-- <u-picker :show="show" :columns="shoolArr" keyName="lab"></u-picker> -->
  94. </view>
  95. </template>
  96. <script>
  97. import { APP_API, APP_HOST } from '@/site.config.js';
  98. const _url = APP_HOST + APP_API + '/util/manage/uploadFile.do';
  99. export default {
  100. data() {
  101. return {
  102. value: '',
  103. imgArr: [],
  104. showShoolName: false,
  105. shoolArr: [
  106. [
  107. {lab: '翔力驾校',id: 1}
  108. ]
  109. ],
  110. form: {
  111. value: '投诉驾校'
  112. },
  113. radiolist1: [{
  114. name: '投诉驾校',
  115. disabled: false
  116. },
  117. {
  118. name: '投诉教练',
  119. disabled: false
  120. },
  121. ],
  122. }
  123. },
  124. methods: {
  125. // 选择驾校
  126. confirmSex(val) {
  127. console.log(val)
  128. this.showShoolName = false
  129. },
  130. //选择图片
  131. chooseImages(type) {
  132. let imgNum = 3 - (this.imgArr.length)
  133. uni.chooseImage({
  134. count: imgNum, //允许选择的数量
  135. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  136. sourceType: ['album', 'camera'], //从相册选择
  137. success: res => {
  138. uni.showLoading({
  139. title: '图片上传中...'
  140. });
  141. res.tempFilePaths.forEach( (item,index)=>{
  142. this.uploadImgApi(item)
  143. })
  144. }
  145. })
  146. },
  147. uploadImgApi(filePath) {
  148. console.log(filePath)
  149. let _this = this
  150. // 上传图片到服务器
  151. uni.uploadFile({
  152. url: _url,//接口
  153. filePath: filePath,//要上传的图片的本地路径
  154. name: 'file',
  155. formData: {
  156. fileType: 1,
  157. fileSuffix: "png"
  158. },
  159. header: {
  160. token: uni.getStorageSync("Authorization") || '',
  161. },
  162. success(res) {
  163. console.log('上传成功')
  164. let res2 = JSON.parse(res.data)
  165. _this.imgArr.push(res2.data)
  166. console.log(res2)
  167. uni.hideLoading();
  168. },
  169. complete: ()=> {}
  170. })
  171. },
  172. }
  173. }
  174. </script>
  175. <style lang="scss" scoped>
  176. .pageBgImg {
  177. .pad {}
  178. .card {
  179. margin-top: 20rpx;
  180. .h2 {
  181. font-size: 28rpx;
  182. font-weight: 600;
  183. line-height: 96rpx;
  184. }
  185. .textareaBg {
  186. min-height: 364rpx;
  187. background: #F8F8F8;
  188. border-radius: 16rpx;
  189. border: 2rpx solid #E8E9EC;
  190. display: flex;
  191. flex-direction: column;
  192. justify-content: space-between;
  193. .flex {
  194. padding: 20rpx;
  195. align-items: flex-start;
  196. .icon {
  197. width: 24rpx;
  198. height: 24rpx;
  199. margin: 0 14rpx 0 24rpx;
  200. }
  201. .inputBox {
  202. flex: 1;
  203. }
  204. /deep/ .inputBox .u-textarea {
  205. padding: 0 !important;
  206. border: none !important;
  207. background: none !important;
  208. }
  209. }
  210. .phoneBox {
  211. display: flex;
  212. padding: 0 10rpx 20rpx 20rpx;
  213. .imgBox {
  214. display: flex;
  215. .img {
  216. margin-right: 14rpx;
  217. position: relative;
  218. width: 160rpx;
  219. height: 160rpx;
  220. image {
  221. width: 160rpx;
  222. height: 160rpx;
  223. border-radius: 8rpx;
  224. overflow: hidden;
  225. }
  226. .minusCircle {
  227. position: absolute;
  228. right: -14rpx;
  229. top: -20rpx;
  230. z-index: 9;
  231. }
  232. }
  233. }
  234. .phone {
  235. border: 2rpx dashed #CDCED0;
  236. width: 160rpx;
  237. height: 160rpx;
  238. background: #F8F8F8;
  239. border-radius: 8rpx;
  240. overflow: hidden;
  241. display: flex;
  242. align-items: center;
  243. justify-content: center;
  244. flex-direction: column;
  245. .phoneIcon {
  246. width: 60rpx;
  247. height: 60rpx;
  248. }
  249. .lab {
  250. font-size: 20rpx;
  251. color: #686B73;
  252. margin-top: 8rpx;
  253. }
  254. }
  255. }
  256. }
  257. }
  258. .phone_row {
  259. display: flex;
  260. height: 104rpx;
  261. padding: 0 28rpx;
  262. line-height: 104rpx;
  263. .label {
  264. font-size: 28rpx;
  265. font-weight: 600;
  266. margin-right: 50rpx;
  267. }
  268. .uInput {
  269. flex: 1;
  270. }
  271. }
  272. .btn {
  273. width: 396rpx;
  274. height: 72rpx;
  275. background: #D1E7FE;
  276. border-radius: 8rpx;
  277. font-size: 28rpx;
  278. text-align: center;
  279. line-height: 72rpx;
  280. margin: 100rpx auto 114rpx auto;
  281. color: #fff;
  282. &.active {
  283. background: $themC;
  284. }
  285. }
  286. }
  287. .row {
  288. height: 120rpx;
  289. display: flex;
  290. align-items: center;
  291. padding-right: 30rpx;
  292. .label {
  293. font-size: 28rpx;
  294. font-weight: 600;
  295. width: 184rpx;
  296. text-align: center;
  297. }
  298. .select_row {
  299. display: flex;
  300. align-items: center;
  301. justify-content: space-between;
  302. flex: 1;
  303. input {
  304. font-size: 28rpx;
  305. color: #333;
  306. }
  307. }
  308. }
  309. </style>