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.

166 lines
4.7 KiB

6 months ago
  1. <template>
  2. <div class="total-wrap" :style="{marginTop: isMainNode?'22rpx':'6rpx'}">
  3. <div class="node-container">
  4. <div class="node-container-left">
  5. <div class="tag-container">
  6. <img v-if="isMainNode" :src="nodeIconUrl"/>
  7. <div v-else class="node-tag-container">
  8. <div class="node-tag"></div>
  9. </div>
  10. </div>
  11. <div class="line-container" :style="{height: isMainNode?'142rpx':'88rpx', paddingTop: isMainNode?'22rpx':'8rpx'}">
  12. <div v-if="!isFirst" class="line" :style="{height: isMainNode?'120rpx':'80rpx'}"></div>
  13. </div>
  14. </div>
  15. <div class="node-container-right" :style="{paddingTop: isMainNode?'0':'8rpx'}">
  16. <div v-if="isMainNode" class="node-title" :style="{color: isNewest?'#222':'#999'}">{{nodeData.statusName}}</div>
  17. <div class="node-desc" :style="{color: isNewest?'#4b4b4b':'#999', marginTop: isMainNode?'10rpx':'0'}">{{acceptStationFixed}}</div>
  18. <div v-if="nodeData.phone" class="node-phone" @click="docall(nodeData.phone)">{{nodeData.phone}}</div>
  19. <div class="node-time">{{nodeData.createTime}}</div>
  20. </div>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. export default {
  26. props: {
  27. isNewest: {
  28. type: Boolean,
  29. default: false
  30. },
  31. isFirst: {
  32. type: Boolean,
  33. default: false
  34. },
  35. isMainNode: {
  36. type: Boolean,
  37. default: false
  38. },
  39. nodeData: {
  40. type: Object,
  41. default () {
  42. return {
  43. status: '',
  44. statusName: '',
  45. createTime: '2019-01-01 00:00:00',
  46. acceptStation: 'xxxxxx'
  47. }
  48. }
  49. }
  50. },
  51. methods:{
  52. docall(phone){
  53. uni.makePhoneCall({
  54. phoneNumber:phone
  55. })
  56. }
  57. },
  58. computed: {
  59. nodeIconUrl () {
  60. if (this.nodeData.status === 'WATTING_PAY') { // 待付款
  61. return this.isNewest ? '/static/images/ic-order-commit.png' : '/static/images/ic-order-commit-G.png'
  62. } else if (this.nodeData.status === 'PAYED') { // 待发货
  63. return this.isNewest ? '/static/images/ic-paied.png' : '/static/images/ic-paied-G.png'
  64. } else if (this.nodeData.status === 'WATTING_DELIVER') { // 已揽件
  65. return this.isNewest ? '/static/images/ic-pacakaging.png' : '/static/images/ic-pacakaging-G.png'
  66. } else if (this.nodeData.status === 'DELIVERING') { // 运输中
  67. return this.isNewest ? '/static/images/ic-sending.png' : '/static/images/ic-sending-G.png'
  68. } else if (this.nodeData.status === 'COMPLETE') { // 已完成
  69. return this.isNewest ? '/static/images/ic-delivering.png' : '/static/images/ic-delivering-G.png'
  70. }
  71. },
  72. acceptStationFixed () {
  73. if (!this.nodeData.acceptStation) return ''
  74. return this.nodeData.acceptStation.replace(/(\d{3})\d{4}(\d{4})/, '')
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. .total-wrap {
  81. margin-top: 22rpx;
  82. width: 100%;
  83. .node-container {
  84. width: 100%;
  85. height: auto;
  86. display: flex;
  87. &-left {
  88. width: 44rpx;
  89. height: auto;
  90. .tag-container {
  91. width: 44rpx;
  92. height: 44rpx;
  93. img {
  94. width: 44rpx;
  95. height: 44rpx;
  96. }
  97. .node-tag-container {
  98. width: 44rpx;
  99. height: 44rpx;
  100. display: flex;
  101. justify-content: center;
  102. align-items: center;
  103. .node-tag {
  104. width: 14rpx;
  105. height: 14rpx;
  106. background-color: #dcdcdc;
  107. border-radius: 50%;
  108. }
  109. }
  110. }
  111. .line-container {
  112. box-sizing: border-box;
  113. width: 44rpx;
  114. display: flex;
  115. align-items: center;
  116. justify-content: center;
  117. .line {
  118. width: 2rpx;
  119. background-color: #dcdcdc;
  120. }
  121. }
  122. }
  123. &-right {
  124. flex: 1;
  125. box-sizing: border-box;
  126. padding: 0 10rpx 0 24rpx;
  127. .node-title {
  128. width: 100%;
  129. height: 40rpx;
  130. line-height: 44rpx;
  131. color: #222;
  132. font-size: 28rpx;
  133. font-family: 'PingFangSC-Medium';
  134. }
  135. .node-desc {
  136. margin-top: 16rpx;
  137. width: 100%;
  138. min-height: 30rpx;
  139. line-height: 30rpx;
  140. color: #222;
  141. font-size: 24rpx;
  142. font-family: 'PingFangSC-Regular';
  143. word-wrap: break-word;
  144. word-break: normal;
  145. }
  146. .node-phone {
  147. margin-top: 8rpx;
  148. width: 100%;
  149. height: 26rpx;
  150. line-height: 26rpx;
  151. color: #FE4E2C;
  152. font-size: 26rpx;
  153. font-family: 'Avenir-Medium';
  154. }
  155. .node-time {
  156. margin-top: 12rpx;
  157. width: 100%;
  158. height: 34rpx;
  159. line-height: 34rpx;
  160. color: #999;
  161. font-size: 24rpx;
  162. font-family: 'Avenir-Book';
  163. }
  164. }
  165. }
  166. }
  167. </style>