混凝土运输管理微信小程序、替班
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.

290 lines
7.0 KiB

2 weeks ago
  1. <template>
  2. <view class="content">
  3. <navbar title="车辆详情" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="car-info-container">
  5. <!-- 车辆基本信息 -->
  6. <view class="info-section">
  7. <view class="section-title">车辆信息</view>
  8. <view class="info-item">
  9. <view class="info-label">车牌号</view>
  10. <view class="info-value">{{ carInfo.plateNumber }}</view>
  11. </view>
  12. <view class="info-item">
  13. <view class="info-label">车辆类型</view>
  14. <view class="info-value">{{ carInfo.carType }}</view>
  15. </view>
  16. <view class="info-item">
  17. <view class="info-label">轴数</view>
  18. <view class="info-value">{{ carInfo.axleCount }}</view>
  19. </view>
  20. <view class="info-item">
  21. <view class="info-label">载重量</view>
  22. <view class="info-value">{{ carInfo.loadCapacity }}</view>
  23. </view>
  24. <view class="info-item">
  25. <view class="info-label">审核状态</view>
  26. <view class="info-value" :class="[getStatusClass(carInfo.status)]">{{ getStatusText(carInfo.status) }}</view>
  27. </view>
  28. </view>
  29. <!-- 车辆照片 -->
  30. <view class="info-section">
  31. <view class="section-title">车辆照片</view>
  32. <view class="image-grid">
  33. <view v-for="(image, index) in carInfo.images" :key="index" class="image-item" @click="previewImage(index, 'images')">
  34. <image :src="image" mode="aspectFill" class="car-image"></image>
  35. </view>
  36. </view>
  37. <view v-if="carInfo.images.length === 0" class="empty-tip">
  38. <text>暂无车辆照片</text>
  39. </view>
  40. </view>
  41. <!-- 证件照片 -->
  42. <view class="info-section">
  43. <view class="section-title">相关证件</view>
  44. <view class="image-grid">
  45. <view v-for="(doc, index) in carInfo.documents" :key="index" class="image-item" @click="previewImage(index, 'documents')">
  46. <image :src="doc" mode="aspectFill" class="car-image"></image>
  47. <view class="doc-label">证件{{ index + 1 }}</view>
  48. </view>
  49. </view>
  50. <view v-if="carInfo.documents.length === 0" class="empty-tip">
  51. <text>暂无证件照片</text>
  52. </view>
  53. </view>
  54. <!-- 联系信息 -->
  55. <view class="info-section">
  56. <view class="section-title">联系信息</view>
  57. <view class="info-item">
  58. <view class="info-label">联系人</view>
  59. <view class="info-value">{{ carInfo.contactName }}</view>
  60. </view>
  61. <view class="info-item">
  62. <view class="info-label">联系电话</view>
  63. <view class="info-value contact-phone" @click="callPhone">{{ carInfo.contactPhone }}</view>
  64. </view>
  65. <view class="info-item">
  66. <view class="info-label">所在地区</view>
  67. <view class="info-value">{{ carInfo.location }}</view>
  68. </view>
  69. </view>
  70. <!-- 申请时间 -->
  71. <view class="info-section">
  72. <view class="section-title">申请信息</view>
  73. <view class="info-item">
  74. <view class="info-label">申请时间</view>
  75. <view class="info-value">{{ carInfo.applyTime }}</view>
  76. </view>
  77. <view class="info-item" v-if="carInfo.auditTime">
  78. <view class="info-label">审核时间</view>
  79. <view class="info-value">{{ carInfo.auditTime }}</view>
  80. </view>
  81. <view class="info-item" v-if="carInfo.auditRemark">
  82. <view class="info-label">审核备注</view>
  83. <view class="info-value">{{ carInfo.auditRemark }}</view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </template>
  89. <script>
  90. import navbar from '@/components/base/navbar.vue'
  91. export default {
  92. name: 'BaseShowcar',
  93. components: {
  94. navbar
  95. },
  96. data() {
  97. return {
  98. carId: '',
  99. carInfo: {
  100. plateNumber: '湘A12345',
  101. carType: '泵车',
  102. axleCount: '4轴',
  103. loadCapacity: '25',
  104. status: 'reviewing', // reviewing, approved, rejected
  105. images: [
  106. '/static/re/ide1.png',
  107. '/static/re/ide2.png'
  108. ],
  109. documents: [
  110. '/static/re/ideic1.png',
  111. '/static/re/ideic2.png',
  112. '/static/re/ideic3.png'
  113. ],
  114. contactName: '张师傅',
  115. contactPhone: '13800138000',
  116. location: '长沙市雨花区',
  117. applyTime: '2024-01-15 10:30:00',
  118. auditTime: '',
  119. auditRemark: ''
  120. }
  121. }
  122. },
  123. onLoad(options) {
  124. if (options.id) {
  125. this.carId = options.id;
  126. this.loadCarInfo();
  127. }
  128. uni.setNavigationBarTitle({
  129. title: '车辆证件信息'
  130. });
  131. },
  132. methods: {
  133. loadCarInfo() {
  134. // 模拟根据ID加载车辆信息
  135. if (this.carId === '2') {
  136. this.carInfo.status = 'rejected';
  137. this.carInfo.auditTime = '2024-01-16 14:20:00';
  138. this.carInfo.auditRemark = '证件照片不清晰,请重新上传';
  139. } else if (this.carId === '3') {
  140. this.carInfo.status = 'approved';
  141. this.carInfo.auditTime = '2024-01-16 16:45:00';
  142. this.carInfo.auditRemark = '审核通过,欢迎加入平台';
  143. }
  144. },
  145. getStatusText(status) {
  146. const statusMap = {
  147. reviewing: '审核中',
  148. approved: '审核通过',
  149. rejected: '审核未通过'
  150. };
  151. return statusMap[status] || '未知状态';
  152. },
  153. getStatusClass(status) {
  154. return {
  155. 'status-reviewing': status === 'reviewing',
  156. 'status-approved': status === 'approved',
  157. 'status-rejected': status === 'rejected'
  158. };
  159. },
  160. previewImage(index, type) {
  161. const images = type === 'images' ? this.carInfo.images : this.carInfo.documents;
  162. uni.previewImage({
  163. current: index,
  164. urls: images
  165. });
  166. },
  167. callPhone() {
  168. uni.makePhoneCall({
  169. phoneNumber: this.carInfo.contactPhone
  170. });
  171. }
  172. }
  173. }
  174. </script>
  175. <style scoped lang="scss">
  176. .content {
  177. padding: 20rpx;
  178. min-height: 100vh;
  179. background-color: #f5f5f5;
  180. }
  181. .car-info-container {
  182. display: flex;
  183. flex-direction: column;
  184. gap: 20rpx;
  185. }
  186. .info-section {
  187. background-color: #fff;
  188. border-radius: 10rpx;
  189. padding: 30rpx;
  190. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  191. }
  192. .section-title {
  193. font-size: 32rpx;
  194. font-weight: 500;
  195. color: #333;
  196. margin-bottom: 30rpx;
  197. padding-bottom: 15rpx;
  198. border-bottom: 2rpx solid #f0f0f0;
  199. }
  200. .info-item {
  201. display: flex;
  202. justify-content: space-between;
  203. align-items: center;
  204. padding: 20rpx 0;
  205. border-bottom: 1rpx solid #f8f8f8;
  206. &:last-child {
  207. border-bottom: none;
  208. }
  209. }
  210. .info-label {
  211. font-size: 28rpx;
  212. color: #666;
  213. flex-shrink: 0;
  214. width: 200rpx;
  215. }
  216. .info-value {
  217. font-size: 28rpx;
  218. color: #333;
  219. flex: 1;
  220. text-align: right;
  221. &.contact-phone {
  222. color: #007AFF;
  223. text-decoration: underline;
  224. }
  225. &.status-reviewing {
  226. color: #ff9500;
  227. }
  228. &.status-approved {
  229. color: #34c759;
  230. }
  231. &.status-rejected {
  232. color: #ff3b30;
  233. }
  234. }
  235. .image-grid {
  236. display: flex;
  237. flex-wrap: wrap;
  238. gap: 20rpx;
  239. }
  240. .image-item {
  241. position: relative;
  242. width: 200rpx;
  243. height: 200rpx;
  244. border-radius: 8rpx;
  245. overflow: hidden;
  246. }
  247. .car-image {
  248. width: 100%;
  249. height: 100%;
  250. }
  251. .doc-label {
  252. position: absolute;
  253. bottom: 0;
  254. left: 0;
  255. right: 0;
  256. background-color: rgba(0, 0, 0, 0.6);
  257. color: #fff;
  258. font-size: 22rpx;
  259. text-align: center;
  260. padding: 8rpx;
  261. }
  262. .empty-tip {
  263. text-align: center;
  264. padding: 60rpx 0;
  265. color: #999;
  266. font-size: 28rpx;
  267. }
  268. </style>