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

320 lines
7.6 KiB

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.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. .card {
  178. margin-bottom: 20rpx;
  179. .h2 {
  180. font-size: 28rpx;
  181. font-weight: 600;
  182. line-height: 96rpx;
  183. }
  184. .textareaBg {
  185. min-height: 364rpx;
  186. background: #F8F8F8;
  187. border-radius: 16rpx;
  188. border: 2rpx solid #E8E9EC;
  189. display: flex;
  190. flex-direction: column;
  191. justify-content: space-between;
  192. .flex {
  193. padding: 20rpx;
  194. align-items: flex-start;
  195. .icon {
  196. width: 24rpx;
  197. height: 24rpx;
  198. margin: 0 14rpx 0 24rpx;
  199. }
  200. .inputBox {
  201. flex: 1;
  202. }
  203. /deep/ .inputBox .u-textarea {
  204. padding: 0 !important;
  205. border: none !important;
  206. background: none !important;
  207. }
  208. }
  209. .phoneBox {
  210. display: flex;
  211. padding: 0 10rpx 20rpx 20rpx;
  212. .imgBox {
  213. display: flex;
  214. .img {
  215. margin-right: 14rpx;
  216. position: relative;
  217. width: 160rpx;
  218. height: 160rpx;
  219. image {
  220. width: 160rpx;
  221. height: 160rpx;
  222. border-radius: 8rpx;
  223. overflow: hidden;
  224. }
  225. .minusCircle {
  226. position: absolute;
  227. right: -14rpx;
  228. top: -20rpx;
  229. z-index: 9;
  230. }
  231. }
  232. }
  233. .phone {
  234. border: 2rpx dashed #CDCED0;
  235. width: 160rpx;
  236. height: 160rpx;
  237. background: #F8F8F8;
  238. border-radius: 8rpx;
  239. overflow: hidden;
  240. display: flex;
  241. align-items: center;
  242. justify-content: center;
  243. flex-direction: column;
  244. .phoneIcon {
  245. width: 60rpx;
  246. height: 60rpx;
  247. }
  248. .lab {
  249. font-size: 20rpx;
  250. color: #686B73;
  251. margin-top: 8rpx;
  252. }
  253. }
  254. }
  255. }
  256. }
  257. .phone_row {
  258. display: flex;
  259. height: 104rpx;
  260. padding: 0 28rpx;
  261. line-height: 104rpx;
  262. .label {
  263. font-size: 28rpx;
  264. font-weight: 600;
  265. margin-right: 50rpx;
  266. }
  267. .uInput {
  268. flex: 1;
  269. }
  270. }
  271. .btn {
  272. width: 396rpx;
  273. height: 72rpx;
  274. background: #D1E7FE;
  275. border-radius: 8rpx;
  276. font-size: 28rpx;
  277. text-align: center;
  278. line-height: 72rpx;
  279. margin: 100rpx auto 114rpx auto;
  280. color: #fff;
  281. &.active {
  282. background: $themC;
  283. }
  284. }
  285. }
  286. .row {
  287. height: 120rpx;
  288. display: flex;
  289. align-items: center;
  290. padding-right: 30rpx;
  291. .label {
  292. font-size: 28rpx;
  293. font-weight: 600;
  294. width: 184rpx;
  295. text-align: center;
  296. }
  297. .select_row {
  298. display: flex;
  299. align-items: center;
  300. justify-content: space-between;
  301. flex: 1;
  302. input {
  303. font-size: 28rpx;
  304. color: #333;
  305. }
  306. }
  307. }
  308. </style>