vehicleMaintain.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  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. @click="$goBack(2,'/pages/vehicleMaintain/vehicleMaintainDetails?id=1')">
  21. <view class="serveImg">
  22. <image :src="v.imgUrl" v-if="v.imgUrl" mode="aspectFill" class="img"></image>
  23. <view class="iconBox" v-else>
  24. <image src="../../static/images/imgFailed.png" mode="aspectFit" class="icon">
  25. </image>
  26. </view>
  27. </view>
  28. <view class="serveDetails">
  29. <view class="list topList">
  30. <view class="name">
  31. {{v.name}}
  32. </view>
  33. </view>
  34. <view class="list distance">
  35. <view class="name">
  36. 服务时间:{{v.serveTime}}
  37. </view>
  38. <view class="distanceText">
  39. 0.12Km
  40. </view>
  41. </view>
  42. <view class="list siteList">
  43. <view class="name">
  44. <view class="user">
  45. <view class="userName">
  46. <u-icon name="account-fill" color="#4C81CF" size="32"></u-icon>
  47. <text>{{v.contactsName}}</text>
  48. </view>
  49. <view class="userPhone">
  50. <u-icon name="phone-fill" color="#4C81CF" size="32"></u-icon>
  51. <text>{{v.contactsMobile}}</text>
  52. </view>
  53. </view>
  54. <view class="place">
  55. <u-icon name="map-fill" color="#4C81CF" size="32"></u-icon>
  56. <text>{{v.address}}</text>
  57. </view>
  58. </view>
  59. <!-- <view class="operate">
  60. <u-icon class="icon" size="45" name="../../static/images/location.png"></u-icon>
  61. <text class="text">去这里</text>
  62. </view> -->
  63. </view>
  64. </view>
  65. </view>
  66. <u-loadmore :status="status" v-if="total != 0" fontSize="30" iconSize="30" />
  67. </scroll-view>
  68. </view>
  69. <!-- 搜索下拉框 -->
  70. <u-picker :show="locationShow" :columns="locationColumns" @cancel="locationShow = false" itemHeight="120"
  71. @confirm="locationAffirm"></u-picker>
  72. </view>
  73. </template>
  74. <script>
  75. import {
  76. getList
  77. } from "@/api/list.js"
  78. export default {
  79. data() {
  80. return {
  81. // 竖向滚动条位置
  82. scrollTop: 0,
  83. old: {
  84. scrollTop: 0
  85. },
  86. // 地点
  87. location: '龙观乡',
  88. // 下拉框
  89. locationShow: false,
  90. locationColumns: [
  91. ['龙观乡', '龙观乡', '龙观乡', '龙观乡', '龙观乡', '龙观乡']
  92. ],
  93. // 搜索
  94. searchText: "",
  95. // 查询参数
  96. queryParams: {
  97. pageNum: 1,
  98. pageSize: 10,
  99. serveType: 5,
  100. address: null,
  101. name: null,
  102. },
  103. // 列表数据
  104. ListData: [],
  105. // 总数
  106. total: 0,
  107. // 加载更多
  108. status: 'loadmore',
  109. };
  110. },
  111. onLoad() {
  112. this.getListData()
  113. },
  114. methods: {
  115. // 地点选择确认
  116. locationAffirm(data) {
  117. this.location = data.value[0]
  118. this.locationShow = false
  119. },
  120. // 搜索
  121. search() {
  122. this.queryParams.pageSize = 10
  123. this.queryParams.address = this.queryParams.name = this.searchText
  124. this.getListData()
  125. },
  126. // 触底事件
  127. lower(e) {
  128. if (this.ListData.length < this.total) {
  129. this.status = 'loading'
  130. this.queryParams.pageSize += 10
  131. this.getListData()
  132. } else {
  133. this.status = 'nomore'
  134. }
  135. },
  136. // 获取列表数据
  137. async getListData() {
  138. let res = await getList(this.queryParams)
  139. if (res.code == 200) {
  140. this.total = res.total
  141. this.ListData = res.rows
  142. this.status = 'loadmore'
  143. // console.log(this.ListData);
  144. }
  145. }
  146. }
  147. }
  148. </script>
  149. <style lang="scss" scoped>
  150. .highwayPost {
  151. height: 100%;
  152. .main {
  153. position: relative;
  154. .scroll-Y {
  155. height: calc(100% - 80rpx);
  156. }
  157. .search {
  158. height: 68rpx;
  159. border: 1px solid #75BFFF;
  160. border-radius: 105.26rpx;
  161. display: flex;
  162. padding: 0 20rpx;
  163. margin-bottom: 34rpx;
  164. .pullDown {
  165. width: 126.32rpx;
  166. height: 100%;
  167. line-height: 67.37rpx;
  168. font-size: 29.47rpx;
  169. text-align: center;
  170. font-weight: 600;
  171. margin-right: 21.05rpx;
  172. padding-right: 20rpx;
  173. position: relative;
  174. &::after {
  175. content: "◢";
  176. display: inline-block;
  177. position: absolute;
  178. right: 0;
  179. bottom: -10rpx;
  180. }
  181. }
  182. }
  183. .scroll-view-item {
  184. display: flex;
  185. .serveImg {
  186. flex: none;
  187. width: 220rpx;
  188. height: 220rpx;
  189. .img {
  190. width: 100%;
  191. height: 100%;
  192. border-radius: 16.84rpx;
  193. }
  194. .iconBox {
  195. width: 100%;
  196. height: 100%;
  197. border-radius: 16.84rpx;
  198. position: relative;
  199. border: 1px solid #dfdfdf;
  200. .icon {
  201. width: 30%;
  202. height: 50%;
  203. position: absolute;
  204. top: 50%;
  205. left: 50%;
  206. transform: translate(-50%, -50%);
  207. }
  208. }
  209. }
  210. .serveDetails {
  211. flex: 1;
  212. padding-left: 18rpx;
  213. position: relative;
  214. .list {
  215. display: flex;
  216. align-items: center;
  217. justify-content: space-between;
  218. margin-bottom: 10.53rpx;
  219. &:last-child {
  220. margin-bottom: 0;
  221. }
  222. .name {
  223. width: 336.84rpx;
  224. // overflow: hidden;
  225. // white-space: nowrap;
  226. // text-overflow: ellipsis;
  227. // -o-text-overflow: ellipsis;
  228. }
  229. }
  230. .topList {
  231. .name {
  232. width: 100%;
  233. font-weight: 600;
  234. font-size: 29.47rpx;
  235. }
  236. .btn {
  237. width: 75.79rpx;
  238. height: 31.58rpx;
  239. line-height: 25rpx;
  240. font-size: 21.05rpx;
  241. text-align: center;
  242. color: #4C81CF;
  243. border: 1px solid #4C81CF;
  244. border-radius: 105.26rpx;
  245. }
  246. }
  247. .distance {
  248. font-size: 21.05rpx;
  249. .distanceText {
  250. flex: 1;
  251. width: 33.68rpx;
  252. }
  253. }
  254. .serveList {
  255. .name {
  256. color: #516789;
  257. font-size: 25.26rpx;
  258. }
  259. }
  260. .siteList {
  261. align-items: flex-end;
  262. font-size: 25.26rpx;
  263. color: #516789;
  264. position: absolute;
  265. bottom: 0;
  266. .name {
  267. width: 100%;
  268. .user {
  269. display: flex;
  270. .userName,
  271. .userPhone {
  272. display: flex;
  273. }
  274. }
  275. .place {
  276. display: flex;
  277. align-items: flex-start;
  278. }
  279. }
  280. .operate {
  281. display: flex;
  282. flex-direction: column;
  283. align-items: center;
  284. .text {
  285. font-size: 21.05rpx;
  286. }
  287. }
  288. }
  289. }
  290. }
  291. }
  292. }
  293. </style>