my_tran_detail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. <template>
  2. <view class="container">
  3. <view class="introduce-section">
  4. <view class="price-box">
  5. <view class="title">{{tran.tranNo}}</view>
  6. <view class="title-tip">
  7. <text class="price-tip">¥</text>
  8. <text class="price">{{tran.price}}</text>
  9. <text class="price-tip">元/吨</text>
  10. </view>
  11. </view>
  12. <view class="bot-row">
  13. <view class='cu-tag radius line-orange'>{{tran.sender}}</view>
  14. <view class='cu-tag radius line-orange'>{{tran.senderPhone}}</view>
  15. </view>
  16. <view class="bot-row">
  17. <view class='cu-tag radius line-orange'>剩余量: {{tran.total - tran.tranCount}}吨</view>
  18. <view class='cu-tag radius line-orange'>总量: {{tran.total}}吨</view>
  19. </view>
  20. </view>
  21. <view class="detail-desc">
  22. <view class="d-header">
  23. <text>基本信息</text>
  24. </view>
  25. <view class="c-list">
  26. <view v-if="tran.receiver" class="c-row b-b">
  27. <text class="tit">收货人</text>
  28. <view class="con-list">
  29. <text>{{tran.receiver}}</text>
  30. </view>
  31. </view>
  32. <view v-if="tran.receiverPhone" class="c-row b-b">
  33. <text class="tit">收货人电话</text>
  34. <view class="con-list">
  35. <text>{{tran.receiverPhone}}</text>
  36. </view>
  37. </view>
  38. <view v-if="tran.goodsName" class="c-row b-b">
  39. <text class="tit">货名</text>
  40. <view class="con-list">
  41. <text>{{tran.goodsName}}</text>
  42. </view>
  43. </view>
  44. <view class="c-row b-b">
  45. <text class="tit">起始地</text>
  46. <view class="con-list">
  47. <text>{{tran.startPlace}}</text>
  48. </view>
  49. </view>
  50. <view class="c-row b-b">
  51. <text class="tit">目的地</text>
  52. <view class="con-list">
  53. <text>{{tran.endPlace}}</text>
  54. </view>
  55. </view>
  56. <view class="c-row b-b">
  57. <text class="tit">剩余量</text>
  58. <view class="con-list">
  59. <text>{{tran.total-tran.tranCount}}</text>
  60. </view>
  61. </view>
  62. </view>
  63. <view class = "cu-card" v-for="(item, index) in car" :key="index">
  64. <view class="d-header">
  65. <text>承运人:{{item.driver}}</text>
  66. <text class="text-red" v-if="item.status == 0">待受理</text>
  67. <text class="text-green" v-else-if="item.status == 1">已承运</text>
  68. <text class="text-orange" v-else-if="item.status == 2">待匹配</text>
  69. </view>
  70. <view class="c-list">
  71. <view class="c-row b-b">
  72. <text class="tit">车牌号</text>
  73. <view class="con-list">{{item.carNo}}</view>
  74. </view>
  75. <view v-if="tran.driverPhone" class="c-row b-b">
  76. <text class="tit">承运人电话</text>
  77. <view class="con-list">{{item.driverPhone}}</view>
  78. </view>
  79. <view v-if="tran.price" class="c-row b-b">
  80. <text class="tit">价格</text>
  81. <view class="con-list">{{item.price}}</view>
  82. </view>
  83. <view class="c-row b-b">
  84. <text class="tit">承运吨数</text>
  85. <view class="con-list">{{item.tranCount}}</view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. import uniNumberBox from '@/components/uni-number-box.vue';
  94. import {
  95. mapState
  96. } from 'vuex';
  97. export default {
  98. components: {
  99. uniNumberBox
  100. },
  101. data() {
  102. return {
  103. tran: {
  104. id: undefined,
  105. tranCount: 0,
  106. tranNo:'',
  107. total: 0,
  108. price: 0,
  109. startPlace: undefined,
  110. endPlace: undefined,
  111. goodsName: undefined,
  112. sender:'',
  113. senderPhone:'',
  114. status:0,
  115. receiver:'',
  116. receiverPhone:'',
  117. carNo:'',
  118. verifyCode:''
  119. },
  120. car:{},
  121. driver:'',
  122. driverPhone:'',
  123. carNo:'',
  124. tranCount: 0,
  125. sendText:'获取验证码',
  126. sendDisabled: false,
  127. verifyCode:''
  128. };
  129. },
  130. onShow() {
  131. },
  132. onLoad(options) {
  133. const that = this
  134. uni.showLoading({
  135. title: '正在加载',
  136. mask:true
  137. })
  138. that.$api.request('tran', 'getTranDetailInfo', {
  139. id: options.id
  140. }, failres => {
  141. that.$api.msg(failres.errmsg)
  142. uni.hideLoading()
  143. }).then(res => {
  144. that.tran = res.data
  145. that.car = res.data.carInfo
  146. uni.hideLoading()
  147. })
  148. },
  149. computed: {
  150. ...mapState(['hasLogin','userInfo'])
  151. },
  152. methods: {
  153. },
  154. }
  155. </script>
  156. <style lang='scss'>
  157. page {
  158. background: $page-color-base;
  159. padding-bottom: 160upx;
  160. }
  161. .icon-you {
  162. font-size: $font-base + 2upx;
  163. color: #888;
  164. }
  165. .carousel {
  166. height: 722upx;
  167. position: relative;
  168. swiper {
  169. height: 100%;
  170. }
  171. .image-wrapper {
  172. width: 100%;
  173. height: 100%;
  174. }
  175. .swiper-item {
  176. display: flex;
  177. justify-content: center;
  178. align-content: center;
  179. height: 750upx;
  180. overflow: hidden;
  181. image {
  182. width: 100%;
  183. height: 100%;
  184. }
  185. }
  186. }
  187. .c-list {
  188. font-size: $font-sm + 2upx;
  189. color: $font-color-base;
  190. background: #fff;
  191. .c-row {
  192. display: flex;
  193. align-items: center;
  194. padding: 20upx 30upx;
  195. position: relative;
  196. }
  197. .tit {
  198. width: 220upx;
  199. }
  200. .con {
  201. flex: 1;
  202. color: $font-color-dark;
  203. .selected-text {
  204. margin-right: 10upx;
  205. }
  206. }
  207. .bz-list {
  208. height: 40upx;
  209. font-size: $font-sm+2upx;
  210. color: $font-color-dark;
  211. text {
  212. display: inline-block;
  213. margin-right: 30upx;
  214. }
  215. }
  216. .con-list {
  217. flex: 1;
  218. display: flex;
  219. flex-direction: column;
  220. color: $font-color-dark;
  221. line-height: 40upx;
  222. text-align: right;
  223. padding-right: 20upx;
  224. }
  225. .red {
  226. color: $uni-color-primary;
  227. }
  228. }
  229. /* 评价 */
  230. .eva-section {
  231. display: flex;
  232. flex-direction: column;
  233. padding: 20upx 30upx;
  234. background: #fff;
  235. margin-top: 16upx;
  236. .e-header {
  237. display: flex;
  238. align-items: center;
  239. height: 70upx;
  240. font-size: $font-sm + 2upx;
  241. color: $font-color-light;
  242. .tit {
  243. font-size: $font-base + 2upx;
  244. color: $font-color-dark;
  245. margin-right: 4upx;
  246. }
  247. .tip {
  248. flex: 1;
  249. text-align: right;
  250. }
  251. .icon-you {
  252. margin-left: 10upx;
  253. }
  254. }
  255. }
  256. .eva-box {
  257. display: flex;
  258. padding: 20upx 0;
  259. .portrait {
  260. flex-shrink: 0;
  261. width: 80upx;
  262. height: 80upx;
  263. border-radius: 100px;
  264. }
  265. .right {
  266. flex: 1;
  267. display: flex;
  268. flex-direction: column;
  269. font-size: $font-base;
  270. color: $font-color-base;
  271. padding-left: 26upx;
  272. .con {
  273. font-size: $font-base;
  274. color: $font-color-dark;
  275. padding: 20upx 0;
  276. }
  277. .bot {
  278. display: flex;
  279. justify-content: space-between;
  280. font-size: $font-sm;
  281. color: $font-color-light;
  282. }
  283. }
  284. }
  285. /* 详情 */
  286. .detail-desc {
  287. background: #fff;
  288. margin-top: 16upx;
  289. width: 750upx;
  290. .d-header {
  291. display: flex;
  292. justify-content: center;
  293. align-items: center;
  294. height: 80upx;
  295. font-size: $font-base + 2upx;
  296. color: $font-color-dark;
  297. position: relative;
  298. text {
  299. padding: 0 20upx;
  300. background: #fff;
  301. position: relative;
  302. z-index: 1;
  303. }
  304. &:after {
  305. position: absolute;
  306. left: 50%;
  307. top: 50%;
  308. transform: translateX(-50%);
  309. width: 300upx;
  310. height: 0;
  311. content: '';
  312. border-bottom: 1px solid #ccc;
  313. }
  314. }
  315. }
  316. /* 规格选择弹窗 */
  317. .attr-content {
  318. padding: 10upx 30upx;
  319. .a-t {
  320. display: flex;
  321. image {
  322. width: 170upx;
  323. height: 170upx;
  324. flex-shrink: 0;
  325. margin-top: -40upx;
  326. border-radius: 8upx;
  327. ;
  328. }
  329. .right {
  330. display: flex;
  331. flex-direction: column;
  332. padding-left: 24upx;
  333. font-size: $font-sm + 2upx;
  334. color: $font-color-base;
  335. line-height: 42upx;
  336. .price {
  337. font-size: $font-lg;
  338. color: $uni-color-primary;
  339. margin-bottom: 10upx;
  340. }
  341. .selected-text {
  342. margin-right: 10upx;
  343. }
  344. }
  345. }
  346. .attr-list {
  347. display: flex;
  348. flex-direction: column;
  349. font-size: $font-base + 2upx;
  350. color: $font-color-base;
  351. padding-top: 30upx;
  352. padding-left: 10upx;
  353. }
  354. .item-list {
  355. padding: 30upx 0 0;
  356. display: flex;
  357. flex-wrap: wrap;
  358. text {
  359. display: flex;
  360. align-items: center;
  361. justify-content: center;
  362. background: #eee;
  363. margin-right: 20upx;
  364. margin-bottom: 20upx;
  365. border-radius: 100upx;
  366. min-width: 60upx;
  367. height: 60upx;
  368. padding: 0 20upx;
  369. font-size: $font-base;
  370. color: $font-color-dark;
  371. }
  372. .selected {
  373. background: #fbebee;
  374. color: $uni-color-primary;
  375. }
  376. }
  377. }
  378. /* 弹出层 */
  379. .popup {
  380. position: fixed;
  381. left: 0;
  382. top: 0;
  383. right: 0;
  384. bottom: 0;
  385. z-index: 99;
  386. &.show {
  387. display: block;
  388. .mask {
  389. animation: showPopup 0.2s linear both;
  390. }
  391. .layer {
  392. animation: showLayer 0.2s linear both;
  393. }
  394. }
  395. &.hide {
  396. .mask {
  397. animation: hidePopup 0.2s linear both;
  398. }
  399. .layer {
  400. animation: hideLayer 0.2s linear both;
  401. }
  402. }
  403. &.none {
  404. display: none;
  405. }
  406. .mask {
  407. position: fixed;
  408. top: 0;
  409. width: 100%;
  410. height: 100%;
  411. z-index: 1;
  412. background-color: rgba(0, 0, 0, 0.4);
  413. }
  414. .layer {
  415. position: fixed;
  416. z-index: 99;
  417. bottom: 0;
  418. width: 100%;
  419. min-height: 40vh;
  420. border-radius: 10upx 10upx 0 0;
  421. background-color: #fff;
  422. .btn {
  423. height: 66upx;
  424. line-height: 66upx;
  425. border-radius: 100upx;
  426. background: $uni-color-primary;
  427. font-size: $font-base + 2upx;
  428. color: #fff;
  429. margin: 30upx auto 20upx;
  430. }
  431. }
  432. @keyframes showPopup {
  433. 0% {
  434. opacity: 0;
  435. }
  436. 100% {
  437. opacity: 1;
  438. }
  439. }
  440. @keyframes hidePopup {
  441. 0% {
  442. opacity: 1;
  443. }
  444. 100% {
  445. opacity: 0;
  446. }
  447. }
  448. @keyframes showLayer {
  449. 0% {
  450. transform: translateY(120%);
  451. }
  452. 100% {
  453. transform: translateY(0%);
  454. }
  455. }
  456. @keyframes hideLayer {
  457. 0% {
  458. transform: translateY(0);
  459. }
  460. 100% {
  461. transform: translateY(120%);
  462. }
  463. }
  464. }
  465. /* 底部操作菜单 */
  466. .page-bottom {
  467. position: fixed;
  468. left: 30upx;
  469. bottom: 30upx;
  470. z-index: 95;
  471. display: flex;
  472. justify-content: center;
  473. align-items: center;
  474. width: 690upx;
  475. height: 100upx;
  476. background: rgba(255, 255, 255, .9);
  477. box-shadow: 0 0 20upx 0 rgba(0, 0, 0, .5);
  478. border-radius: 16upx;
  479. .p-b-btn {
  480. display: flex;
  481. flex-direction: column;
  482. align-items: center;
  483. justify-content: center;
  484. font-size: $font-sm;
  485. color: $font-color-base;
  486. width: 96upx;
  487. height: 80upx;
  488. .yticon {
  489. font-size: 40upx;
  490. line-height: 48upx;
  491. color: $font-color-light;
  492. }
  493. &.active,
  494. &.active .yticon {
  495. color: $uni-color-primary;
  496. }
  497. .icon-fenxiang2 {
  498. font-size: 42upx;
  499. transform: translateY(-2upx);
  500. }
  501. .icon-shoucang {
  502. font-size: 46upx;
  503. }
  504. }
  505. }
  506. .rich-img {
  507. width: 100%;
  508. height: auto;
  509. margin: 0;
  510. padding: 0;
  511. line-height: 0px;
  512. }
  513. button::after {
  514. border: none;
  515. }
  516. /* 销售信息 */
  517. .introduce-section {
  518. background: #fff;
  519. padding: 20upx 30upx;
  520. padding-bottom: 100upx;
  521. .guess-item {
  522. padding-bottom: 20upx;
  523. border-bottom: 1px solid #ccc;
  524. }
  525. .title {
  526. font-size: 28upx;
  527. color: $font-color-dark;
  528. font-weight:bold;
  529. height: 50upx;
  530. line-height: 50upx;
  531. flex:2.5;
  532. }
  533. .title-tip {
  534. flex:1;
  535. }
  536. .price-box {
  537. display: flex;
  538. align-items: baseline;
  539. height: 70upx;
  540. padding: 10upx 0;
  541. font-size: 26upx;
  542. color: $uni-color-primary;
  543. }
  544. .price {
  545. font-size: $font-lg + 2upx;
  546. }
  547. .m-price {
  548. margin: 0 12upx;
  549. color: $font-color-light;
  550. text-decoration: line-through;
  551. }
  552. .coupon-tip {
  553. align-items: center;
  554. padding: 4upx 10upx;
  555. background: $uni-color-primary;
  556. font-size: $font-sm;
  557. color: #fff;
  558. border-radius: 6upx;
  559. line-height: 1;
  560. transform: translateY(-4upx);
  561. }
  562. .bot-row {
  563. display: flex;
  564. align-items: center;
  565. height: 50upx;
  566. font-size: $font-sm;
  567. color: $font-color-light;
  568. view {
  569. flex: 1;
  570. }
  571. }
  572. }
  573. </style>