driveTrain.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. <template>
  2. <view class="highwayPost">
  3. <!-- 导航栏 -->
  4. <navigationBar title="驾驶培训">
  5. </navigationBar>
  6. <view class="main">
  7. <view class="search">
  8. <!-- <view class="pullDown" @click="locationShow = true">
  9. {{location}}
  10. </view> -->
  11. <u--input placeholder="搜索店铺" :adjustPosition="false" fontSize="29.47" color="#61696F" shape="circle"
  12. border="none" v-model="searchText">
  13. <template slot="suffix">
  14. <u-icon name="search" @click="search" color="#4F4F4F" size="50"></u-icon>
  15. </template>
  16. </u--input>
  17. </view>
  18. <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltolower="lower">
  19. <view class="scroll-view-item" v-for="(v,i) in ListData" :key="i">
  20. <view class="serveImg">
  21. <image :src="v.imgUrl" v-if="v.imgUrl" mode="aspectFill" class="img"></image>
  22. <view class="iconBox" v-else>
  23. <image src="../../static/images/imgFailed.png" mode="aspectFit" class="icon">
  24. </image>
  25. </view>
  26. </view>
  27. <view class="serveDetails">
  28. <view class="list topList">
  29. <view class="name">
  30. {{v.name}}
  31. </view>
  32. <view class="btn" @click="errorCorrection(v)">
  33. 纠错
  34. </view>
  35. </view>
  36. <view class="list distance">
  37. <view class="name">
  38. 服务时间: {{v.serveTime}}
  39. </view>
  40. <view class="distanceText">
  41. 0.12Km
  42. </view>
  43. </view>
  44. <view class="list siteList">
  45. <view class="name">
  46. <view class="user">
  47. <view class="userName">
  48. <u-icon name="account-fill" color="#4C81CF" size="32"></u-icon>
  49. <text>{{v.contactsName}}</text>
  50. </view>
  51. <view class="userPhone">
  52. <u-icon name="phone-fill" color="#4C81CF" size="32"></u-icon>
  53. <text>{{v.contactsMobile}}</text>
  54. </view>
  55. </view>
  56. <view class="place">
  57. <u-icon name="map-fill" color="#4C81CF" size="32"></u-icon>
  58. <text>{{v.address}}</text>
  59. </view>
  60. </view>
  61. <!-- <view class="operate">
  62. <u-icon class="icon" size="45" name="../../static/images/location.png"></u-icon>
  63. <text class="text">去这里</text>
  64. </view> -->
  65. </view>
  66. </view>
  67. </view>
  68. <u-loadmore :status="status" v-if="total != 0" fontSize="30" iconSize="30" />
  69. </scroll-view>
  70. </view>
  71. <!-- 搜索下拉框 -->
  72. <u-picker :show="locationShow" :columns="locationColumns" @cancel="locationShow = false" itemHeight="120"
  73. @confirm="locationAffirm"></u-picker>
  74. <!-- 纠错 -->
  75. <u-popup :show="errorShow" mode="center" round="14" :customStyle="{width: '90%'}">
  76. <view class="errorBox">
  77. <view class="headline">我要反馈问题</view>
  78. <view class="title">请选择问题</view>
  79. <view class="fast">
  80. <view class="li" :class="{active : active == i}" v-for="(v,i) in errorHintData" :key="i"
  81. @click="(active = i),(errorData.feedbackType = v.dictValue)">
  82. {{v.dictLabel}}
  83. </view>
  84. </view>
  85. <view class="title">问题描述:</view>
  86. <u--textarea v-model="feedbackContent" placeholder="请输入" height="100"></u--textarea>
  87. <view class="btn">
  88. <span class="sBtn" @click="submitFeedback">提交</span>
  89. <span class="qBtn" @click="errorShow = false">关闭</span>
  90. </view>
  91. </view>
  92. </u-popup>
  93. <u-toast ref="uToast"></u-toast>
  94. </view>
  95. </template>
  96. <script>
  97. import {
  98. getList,
  99. errorHint,
  100. setErrorCorrection
  101. } from "@/api/list.js"
  102. export default {
  103. data() {
  104. return {
  105. // 竖向滚动条位置
  106. scrollTop: 0,
  107. old: {
  108. scrollTop: 0
  109. },
  110. // 地点
  111. location: '龙观乡',
  112. // 下拉框
  113. locationShow: false,
  114. locationColumns: [
  115. ['龙观乡', '龙观乡', '龙观乡', '龙观乡', '龙观乡', '龙观乡']
  116. ],
  117. // 搜索
  118. searchText: "",
  119. // 查询参数
  120. queryParams: {
  121. pageNum: 1,
  122. pageSize: 10,
  123. serveType: 2,
  124. address: null,
  125. name: null,
  126. },
  127. // 列表数据
  128. ListData: [],
  129. // 总数
  130. total: 0,
  131. // 加载更多
  132. status: 'loadmore',
  133. // 纠错
  134. errorShow: false,
  135. errorData: {
  136. serveModule: 1,
  137. serveId: null,
  138. feedbackType: null,
  139. feedbackContent: "",
  140. feedbackBy: null,
  141. },
  142. feedbackContent: '',
  143. // 激活
  144. active: null,
  145. // 纠错提示
  146. errorHintData: []
  147. };
  148. },
  149. onLoad() {
  150. this.getListData()
  151. },
  152. methods: {
  153. // 地点选择确认
  154. locationAffirm(data) {
  155. this.location = data.value[0]
  156. this.locationShow = false
  157. },
  158. // 搜索
  159. search() {
  160. this.queryParams.pageSize = 10
  161. this.queryParams.address = this.queryParams.name = this.searchText
  162. this.getListData()
  163. },
  164. // 触底事件
  165. lower(e) {
  166. if (this.ListData.length < this.total) {
  167. this.status = 'loading'
  168. this.queryParams.pageSize += 10
  169. this.getListData()
  170. } else {
  171. this.status = 'nomore'
  172. }
  173. },
  174. // 获取列表数据
  175. async getListData() {
  176. let res = await getList(this.queryParams)
  177. if (res.code == 200) {
  178. this.total = res.total
  179. this.ListData = res.rows
  180. this.status = 'loadmore'
  181. // console.log(this.ListData);
  182. }
  183. },
  184. // 纠错
  185. errorCorrection(data) {
  186. this.active = null
  187. this.errorData.feedbackType = null
  188. this.errorData.feedbackContent = null
  189. this.feedbackContent = null
  190. this.errorData.serveId = data.id
  191. errorHint("feedback_type").then(res => {
  192. this.errorHintData = res.data
  193. // this.errorData = data
  194. this.errorShow = true
  195. })
  196. },
  197. // 提交反馈
  198. submitFeedback() {
  199. this.errorData.feedbackContent = this.feedbackContent
  200. setErrorCorrection(this.errorData).then(res => {
  201. this.errorShow = false
  202. this.$refs.uToast.show({
  203. icon: false,
  204. type: 'success',
  205. message: '反馈成功'
  206. })
  207. })
  208. }
  209. }
  210. }
  211. </script>
  212. <style lang="scss" scoped>
  213. .highwayPost {
  214. height: 100%;
  215. .main {
  216. position: relative;
  217. .scroll-Y {
  218. height: calc(100% - 80rpx);
  219. }
  220. .search {
  221. height: 68rpx;
  222. border: 1px solid #75BFFF;
  223. border-radius: 105.26rpx;
  224. display: flex;
  225. padding: 0 20rpx;
  226. margin-bottom: 34rpx;
  227. .pullDown {
  228. width: 126.32rpx;
  229. height: 100%;
  230. line-height: 67.37rpx;
  231. font-size: 29.47rpx;
  232. text-align: center;
  233. font-weight: 600;
  234. margin-right: 21.05rpx;
  235. padding-right: 20rpx;
  236. position: relative;
  237. &::after {
  238. content: "◢";
  239. display: inline-block;
  240. position: absolute;
  241. right: 0;
  242. bottom: -10rpx;
  243. }
  244. }
  245. }
  246. .scroll-view-item {
  247. display: flex;
  248. .serveImg {
  249. flex: none;
  250. width: 220rpx;
  251. height: 220rpx;
  252. .img {
  253. width: 100%;
  254. height: 100%;
  255. border-radius: 16.84rpx;
  256. }
  257. .iconBox {
  258. width: 100%;
  259. height: 100%;
  260. border-radius: 16.84rpx;
  261. position: relative;
  262. border: 1px solid #dfdfdf;
  263. .icon {
  264. width: 30%;
  265. height: 50%;
  266. position: absolute;
  267. top: 50%;
  268. left: 50%;
  269. transform: translate(-50%, -50%);
  270. }
  271. }
  272. }
  273. .serveDetails {
  274. flex: 1;
  275. padding-left: 18rpx;
  276. position: relative;
  277. .list {
  278. display: flex;
  279. align-items: center;
  280. justify-content: space-between;
  281. margin-bottom: 10.53rpx;
  282. &:last-child {
  283. margin-bottom: 0;
  284. }
  285. .name {
  286. width: 336.84rpx;
  287. // overflow: hidden;
  288. // white-space: nowrap;
  289. // text-overflow: ellipsis;
  290. // -o-text-overflow: ellipsis;
  291. }
  292. }
  293. .topList {
  294. .name {
  295. font-weight: 600;
  296. font-size: 29.47rpx;
  297. }
  298. .btn {
  299. width: 75.79rpx;
  300. height: 31.58rpx;
  301. line-height: 25rpx;
  302. font-size: 21.05rpx;
  303. text-align: center;
  304. color: #4C81CF;
  305. border: 1px solid #4C81CF;
  306. border-radius: 105.26rpx;
  307. }
  308. }
  309. .distance {
  310. font-size: 21.05rpx;
  311. .distanceText {
  312. flex: 1;
  313. width: 33.68rpx;
  314. }
  315. }
  316. .serveList {
  317. .name {
  318. color: #516789;
  319. font-size: 25.26rpx;
  320. }
  321. }
  322. .siteList {
  323. align-items: flex-end;
  324. font-size: 25.26rpx;
  325. color: #516789;
  326. position: absolute;
  327. bottom: 0;
  328. .name {
  329. width: 100%;
  330. .user {
  331. display: flex;
  332. .userName,
  333. .userPhone {
  334. display: flex;
  335. }
  336. }
  337. .place {
  338. display: flex;
  339. align-items: flex-start;
  340. }
  341. }
  342. .operate {
  343. display: flex;
  344. flex-direction: column;
  345. align-items: center;
  346. .text {
  347. font-size: 21.05rpx;
  348. }
  349. }
  350. }
  351. }
  352. }
  353. }
  354. .errorBox {
  355. padding: 33.68rpx 25.26rpx;
  356. .headline {
  357. color: #000A15;
  358. text-align: center;
  359. font-weight: 600;
  360. }
  361. .title {
  362. color: #000A15;
  363. font-weight: 600;
  364. font-size: 29.47rpx;
  365. margin: 42.11rpx 0 21.05rpx 0;
  366. }
  367. .fast {
  368. display: flex;
  369. flex-wrap: wrap;
  370. justify-content: space-between;
  371. .li {
  372. width: 48%;
  373. height: 80rpx;
  374. line-height: 80rpx;
  375. font-size: 29.47rpx;
  376. border-radius: 50px;
  377. color: #798C9B;
  378. text-align: center;
  379. margin-bottom: 20rpx;
  380. background-color: rgba(222, 238, 252, 0.3);
  381. }
  382. .active {
  383. background-color: #D7ECFF;
  384. color: #000A15;
  385. }
  386. }
  387. .btn {
  388. margin-top: 21.05rpx;
  389. display: flex;
  390. justify-content: center;
  391. .sBtn {
  392. padding: 10rpx 50rpx;
  393. font-size: 29.47rpx;
  394. border-radius: 105.26rpx;
  395. background-color: #D7ECFF;
  396. margin-right: 50rpx;
  397. }
  398. .qBtn {
  399. padding: 10rpx 50rpx;
  400. font-size: 29.47rpx;
  401. border-radius: 105.26rpx;
  402. border: 1px solid #D7ECFF;
  403. }
  404. }
  405. }
  406. }
  407. </style>