passengerStation.vue 9.9 KB

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