index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. <template>
  2. <view class="container">
  3. <uni-navbar title="车辆信息"></uni-navbar>
  4. <view class="box">
  5. <view class="reject-box commonBj commonMt commonMb infoHeightBig">
  6. <view class="reject-box-top">
  7. <view class="top-left">
  8. <image src="../../static/images/car/yunshu.png" mode="widthFix"></image>
  9. <text class="listTitle">车辆信息</text>
  10. </view>
  11. <view class="top-right">
  12. <u-button @tap="gotoDriverDetailByTruckID" class="custom-style driverBtn" shape="circle"
  13. color="linear-gradient(to top, #F59A02, #FFD334)">
  14. 查看司机
  15. </u-button>
  16. <!-- <image
  17. :src="carInfo.deleteFlag===0?'../../static/images/car/binding.png':'../../static/images/car/binding2.png'"
  18. mode="widthFix"></image>
  19. <text :class="carInfo.deleteFlag===0?'stateText':'nostateText'"
  20. class="state-text">{{carInfo.deleteFlag===0?'已绑定':'未绑定'}}</text> -->
  21. </view>
  22. </view>
  23. <view class="reject-box-bottom infoHeight">
  24. <view class="state-icon">
  25. <view class="flexAlignCenter">
  26. <view class="greenCircle">
  27. </view>
  28. <text class="itemText">企业名称:</text>
  29. </view>
  30. <view class="flexAlignCenter">
  31. <text class="infoText">{{carInfo.companyName}}</text>
  32. </view>
  33. </view>
  34. <!-- <view class="border-style"></view> -->
  35. <view class="state-icon">
  36. <view class="flexAlignCenter">
  37. <view class="greenCircle">
  38. </view>
  39. <text class="itemText">车牌号码:</text>
  40. </view>
  41. <view class="flexAlignCenter">
  42. <text class="infoText">{{carInfo.carNumber}}</text>
  43. </view>
  44. <view class="flexAlignCenter center">
  45. <image style="width: 28rpx; height: 28rpx;"
  46. :src="carInfo.deleteFlag===0?'../../static/images/car/binding.png':'../../static/images/car/binding2.png'"
  47. mode="widthFix"></image>
  48. <text :class="carInfo.deleteFlag===0?'stateText':'nostateText'"
  49. class="state-text ml13">{{carInfo.deleteFlag===0?'已绑定':'未绑定'}}</text>
  50. </view>
  51. </view>
  52. <!-- <view class="border-style"></view> -->
  53. <view class="state-icon">
  54. <view class="flexAlignCenter">
  55. <view class="greenCircle">
  56. </view>
  57. <text class="itemText">车&emsp;&emsp;型:</text>
  58. </view>
  59. <view class="flexAlignCenter">
  60. <text class="infoText">{{carInfo.carType}}</text>
  61. </view>
  62. </view>
  63. <!-- <view class="border-style"></view> -->
  64. <view class="state-icon">
  65. <view class="flexAlignCenter">
  66. <view class="greenCircle">
  67. </view>
  68. <text class="itemText">车&emsp;&emsp;系:</text>
  69. </view>
  70. <view class="flexAlignCenter">
  71. <text class="infoText">{{carInfo.carSeries}}</text>
  72. </view>
  73. </view>
  74. <!-- <view class="border-style"></view> -->
  75. <view class="state-icon">
  76. <view class="flexAlignCenter">
  77. <view class="greenCircle">
  78. </view>
  79. <text class="itemText">载重标准:</text>
  80. </view>
  81. <view class="flexAlignCenter">
  82. <text class="infoText">{{carInfo.carCarry}}</text>
  83. </view>
  84. </view>
  85. <!-- <view class="border-style"></view> -->
  86. <view class="state-icon block">
  87. <view class="flexAlignCenter">
  88. <view class="greenCircle">
  89. </view>
  90. <text class="itemText">车辆行驶证件</text>
  91. </view>
  92. <view class="uploadBox flexAlignCenter block mt30 ">
  93. <!-- <xfx-image-upload class="radius15" :remove="false" :add=false :chooseNum="1"
  94. v-model="drivingLicense" mediaType="image"></xfx-image-upload> -->
  95. <u--image radius="15rpx" :showLoading="true" :src="drivingLicense" width="599rpx"
  96. v-if="drivingLicense" height="270rpx" @tap="previewImg(drivingLicense)">
  97. </u--image>
  98. <text v-else class="infoText">暂无</text>
  99. </view>
  100. </view>
  101. <view class="state-icon mb0 block">
  102. <view class="flexAlignCenter">
  103. <view class="greenCircle">
  104. </view>
  105. <text class="itemText">车辆状态</text>
  106. </view>
  107. <view class="mt30 zhanwei">
  108. <view v-if="imgList.length>0" class="imgBox">
  109. <u--image class="border radius15" radius="15rpx" :key="index"
  110. v-for="(item,index) in imgList" :showLoading="true" :src="item.url" width="287rpx"
  111. height="287rpx" @tap="previewImg(item.url)">
  112. </u--image>
  113. </view>
  114. <view class="state-box-size border radius15 " v-if="vedioList.length>0">
  115. <xfx-image-upload class="state-box-size radius15" :max="1" :remove="false" :add="false"
  116. v-model="vedioList" mediaType="video"></xfx-image-upload>
  117. </view>
  118. <text v-if="vedioList.length===0&&imgList.length===0" class="infoText">暂无</text>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. <!-- 审批状态 -->
  124. <view class="reject-box mt28 commonMb commonGreenBj" v-if="isHomeInfo">
  125. <view class="reject-box-top just-content-start bg-color-green">
  126. <image src="../../static/images/car/yunshu.png" mode="widthFix"></image>
  127. <text class="listTitle">审批状态</text>
  128. </view>
  129. <view class="reject-box-bottom pb0">
  130. <view class="state-icon">
  131. <view class="flexAlignCenter">
  132. <view class="greenCircle">
  133. </view>
  134. <text class="itemText">审批状态:</text>
  135. </view>
  136. <view class="flexAlignCenter">
  137. <u-icon color="#017D3E" style="margin-right: 12rpx;" name="checkmark-circle-fill"></u-icon>
  138. <text class="greenText">通过</text>
  139. </view>
  140. </view>
  141. <!-- <view :class="isPass?'border-style mb':'border-style2'"></view> -->
  142. <!-- <view class="state-icon" v-if="carInfo.deleteFlag === 1">
  143. <view class="flexAlignCenter">
  144. <view class="redCircle">
  145. </view>
  146. <text class="itemText">驳回原因:</text>
  147. </view>
  148. <view class="flexAlignCenter">
  149. <text class="redText">{{}}</text>
  150. </view>
  151. </view> -->
  152. <!-- <view v-if="!isPass" class="border-style2 mb"></view> -->
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. </template>
  158. <script>
  159. import {
  160. carDetail,
  161. watchDriver
  162. } from "@/api/company/car.js"
  163. export default {
  164. data() {
  165. return {
  166. // 详情数据列表
  167. carInfo: {},
  168. // 行驶证列表
  169. drivingLicense: '',
  170. // 视频列表
  171. vedioList: [],
  172. // 车辆状态图片列表
  173. imgList: [],
  174. // 接收的id
  175. id: null,
  176. tempFilePath: '',
  177. srcVideo: '',
  178. isHomeInfo: true
  179. }
  180. },
  181. methods: {
  182. select() {
  183. uni.requireNativePlugin('TX-VideoTool').getVideoThumbnailImage({
  184. "videoPath": this.srcVideo,
  185. "saveImagePath": plus.io.convertLocalFileSystemURL(
  186. "_doc/TXVideoTool/"),
  187. "saveImageName": "testLocal" + new Date().getTime() + ".png",
  188. "second": 0
  189. }, result => {
  190. this.vedioList = [{
  191. cover: result.imagePath,
  192. url: this.srcVideo
  193. }]
  194. });
  195. },
  196. previewImg(urls) {
  197. uni.previewImage({
  198. urls: [urls],
  199. current: urls
  200. })
  201. },
  202. // 获取详情
  203. getDetail() {
  204. carDetail(this.id).then((result) => {
  205. console.log(result, '详情');
  206. this.carInfo = result.data
  207. this.drivingLicense = result.data.drivingLicense[0].url;
  208. this.srcVideo = result.data.carVideo[0].url;
  209. this.imgList = result.data.imgList;
  210. this.vedioList = [{
  211. url: this.srcVideo
  212. }]
  213. this.select();
  214. }).catch(err => {
  215. console.log('请求失败rr');
  216. })
  217. },
  218. // 查看司机
  219. gotoDriverDetailByTruckID() {
  220. watchDriver(this.carInfo.id).then(res => {
  221. console.log('司机id', res);
  222. uni.navigateTo({
  223. url: '/pages/userInfo/index?id=' + res.msg
  224. })
  225. })
  226. },
  227. },
  228. onLoad: function(option) {
  229. // 是否是首页点进去的详情页面
  230. if (option.isHomeInfo) {
  231. this.isHomeInfo = false
  232. } else {
  233. this.isHomeInfo = true
  234. }
  235. if (option.id) {
  236. this.companyName = this.$store.state.user.companyName
  237. this.id = option.id
  238. this.getDetail()
  239. }
  240. },
  241. }
  242. </script>
  243. <style lang="scss" scoped>
  244. .driverBtn {
  245. width: 144rpx;
  246. height: 40rpx !important;
  247. font-size: 24rpx;
  248. margin-bottom: 0;
  249. line-height: 40rpx;
  250. }
  251. .ml13 {
  252. margin-left: 13rpx;
  253. }
  254. .center {
  255. justify-content: center;
  256. align-items: center;
  257. margin-left: 25rpx;
  258. }
  259. // 上传组件样式
  260. .uploadBox {
  261. // width: 599rpx;
  262. // height: 250rpx;
  263. // /deep/ .u-image__loading{
  264. // width: 100%;
  265. // height: 250rpx;
  266. // }
  267. /deep/ .u-image {
  268. border: 1rpx solid #495B93;
  269. }
  270. }
  271. /deep/.xfx-image-upload-Item {
  272. uni-image {
  273. width: 598rpx;
  274. height: 287rpx;
  275. }
  276. .xfx-image-upload-Item-video-fixed {
  277. width: 598rpx;
  278. height: 287rpx;
  279. }
  280. }
  281. .zhanwei {
  282. display: flex;
  283. flex-direction: column;
  284. }
  285. // .zhanwei uni-view:not(:first-child) {
  286. // width: 180rpx !important;
  287. // }
  288. // .zhanwei uni-view:not(:last-child) {
  289. // margin-right: 29rpx;
  290. // }
  291. .reject-box {
  292. .reject-box-top {
  293. width: 100%;
  294. height: 69rpx;
  295. background: #7FB5FF;
  296. border-radius: 26rpx 26rpx 0px 0px;
  297. display: flex;
  298. justify-content: space-between;
  299. .top-right {
  300. display: flex;
  301. justify-content: start;
  302. align-items: center;
  303. margin-right: 36rpx;
  304. uni-image {
  305. width: 28rpx;
  306. margin-left: 32rpx;
  307. vertical-align: middle;
  308. }
  309. .state-text {
  310. margin-left: 13rpx;
  311. line-height: 69rpx;
  312. }
  313. }
  314. uni-image {
  315. width: 50rpx;
  316. margin-left: 32rpx;
  317. vertical-align: middle;
  318. }
  319. }
  320. .reject-box-bottom {
  321. padding: 40rpx;
  322. .state-icon {
  323. display: flex;
  324. margin: 40rpx 0;
  325. }
  326. .state-icon:nth-child(1) {
  327. margin: 0 0 40rpx;
  328. }
  329. .border-style {
  330. border-top: 1rpx dashed #F98803;
  331. width: 90%;
  332. margin: 0 auto;
  333. }
  334. .border-style2 {
  335. border-top: 1rpx dashed #FB5637;
  336. width: 90%;
  337. margin: 0 auto;
  338. }
  339. }
  340. }
  341. .reject-box-bottom:nth-child(2) {
  342. padding: 40rpx 40rx 20rpx !important;
  343. }
  344. .block {
  345. display: block !important;
  346. }
  347. .border {
  348. border: 1rpx solid #495B93;
  349. }
  350. .box-size {
  351. width: 598rpx;
  352. height: 198rpx;
  353. }
  354. .mt30 {
  355. margin-top: 30rpx;
  356. }
  357. .radius15 {
  358. border-radius: 15rpx;
  359. }
  360. .state-box-size {
  361. width: 598rpx;
  362. height: 287rpx;
  363. }
  364. .state-box-size-video {
  365. width: 593rpx !important;
  366. height: 282rpx !important;
  367. }
  368. .space-between {
  369. justify-content: space-between;
  370. }
  371. .just-content-start {
  372. justify-content: flex-start !important;
  373. align-items: center;
  374. }
  375. .bg-color-green {
  376. background: #36C372 !important;
  377. }
  378. .bg-color-red {
  379. background: #FB5637 !important;
  380. }
  381. .fontTongGuo {
  382. font-size: 28rpx !important;
  383. font-weight: bold !important;
  384. color: #007C3C !important;
  385. }
  386. .mb {
  387. margin-bottom: 53rpx !important;
  388. }
  389. .pb0 {
  390. padding-bottom: 0 !important;
  391. }
  392. .mt28 {
  393. margin-top: 28rpx;
  394. }
  395. .mb0 {
  396. margin-bottom: 0rpx !important;
  397. }
  398. .imgBox {
  399. display: flex;
  400. justify-content: space-between;
  401. margin-bottom: 28rpx;
  402. }
  403. </style>