WuLiu-step.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view class="ali">
  3. <view class="ali_state">
  4. <block v-for="(item,i) in datas" :key="i">
  5. <view class="State_Four">
  6. <view class="FourBox">
  7. <text class="line" :class="[i == 0?'noline':'']"></text>
  8. <!-- =====如果不够,可以再方法和过滤器中同时添加判断-或者如下的-[v-else-if]操作 -->
  9. <!-- <text class="ali_top_icon" style="margin: 0 0;" v-else-if="item.station.includes('丰巢智能快递柜') && i!= datas.length-1">待</text> -->
  10. <text class="ali_top_icon" :class="[item.station.includes('签收')?'isOk':'']" style="margin: 0 0;" v-if="Type(item.station) == true && i!= datas.length-1">{{item.station | Type}}</text>
  11. <view class="ali_top_icons" style="margin: 0 0;" v-else>
  12. <text class="line" :class="[i == 0?'noline':'']"></text>
  13. <text class="ali_top_iconss"></text>
  14. <text class="line" :class="[i == 0?'noline':'']"></text>
  15. </view>
  16. <text class="line" :class="[i == datas.length -1?'noline':'']"></text>
  17. </view>
  18. <view class="station">
  19. <text class="a14" v-if="i == datas.length-1">已发货</text>
  20. <text class="a14" v-else>{{item.station}}</text>
  21. <text class="a12" style="padding-top: 10upx;">{{item.time}}</text>
  22. </view>
  23. </view>
  24. </block>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default{
  30. props:["datas"],
  31. data(){
  32. return{
  33. }
  34. },
  35. //过滤返回关键字
  36. filters:{
  37. Type(item){
  38. let Info;
  39. let Phone = /\d{11}/;
  40. if(Phone.test(item) && item.includes('正在派')){
  41. Info = "派";
  42. }else if(item.includes('已收取快件')){
  43. Info = "揽";
  44. }else if(item.includes('营业')){
  45. Info = "运";
  46. }else if(item.includes('丰巢智能快递柜')){
  47. Info = "待";
  48. }else if(item.includes('签收')){
  49. Info = "收";
  50. }else{
  51. Info = "";
  52. }
  53. return Info
  54. }
  55. },
  56. methods: {
  57. //判断哪个该展示关键字--还是默认
  58. Type(item){
  59. let Info;
  60. let Phone = /\d{11}/;
  61. if(Phone.test(item) && item.includes('正在派')){
  62. Info = true;
  63. }else if(item.includes('已收取快件')){
  64. Info = true;
  65. }else if(item.includes('营业')){
  66. Info = true;
  67. }else if(item.includes('丰巢智能快递柜')){
  68. Info = true;
  69. }else if(item.includes('签收')){
  70. Info = true;
  71. }else{
  72. Info = false;
  73. }
  74. return Info
  75. }
  76. },
  77. }
  78. </script>
  79. <style>
  80. .isOk{
  81. background-color: #F0AD4E !important;
  82. }
  83. .ali_top_iconss{
  84. width: 12upx;
  85. height: 12upx;
  86. display: block;
  87. background-color: #999;
  88. padding-right: 2upx;
  89. border-radius: 50%;
  90. }
  91. .noline{
  92. background-color: #fff !important;
  93. }
  94. .State_Four{
  95. display: flex;
  96. /* border: 1upx solid red; */
  97. }
  98. .FourBox{
  99. display: flex;
  100. flex-direction: column;
  101. align-items: center;
  102. padding-right: 24upx;
  103. }
  104. .line{
  105. width: 2upx;
  106. display: flex;
  107. flex-direction: column;
  108. flex: 1;
  109. background-color: #999;
  110. }
  111. /* ============= */
  112. .station{
  113. display: flex;
  114. flex-direction: column;
  115. width: 90%;
  116. padding: 24upx 0;
  117. }
  118. .borders{
  119. border-bottom: 1upx solid #F2F2F2;
  120. padding: 24upx 0;
  121. }
  122. .ali_top_icons{
  123. width: 46upx;
  124. height: 46upx;
  125. display: block;
  126. background-color: #FFF;
  127. border-radius: 50%;
  128. display: flex;
  129. flex-direction: column;
  130. align-items: center;
  131. justify-content: center;
  132. align-content: center;
  133. }
  134. .ali_top_icon{
  135. width: 46upx;
  136. height: 46upx;
  137. display: block;
  138. background-color: #83AECF;
  139. color: #fff;
  140. font-size: 28upx;
  141. border-radius: 50%;
  142. display: flex;
  143. justify-content: center;
  144. align-items: center;
  145. margin-right: 20upx;
  146. }
  147. .ali_top{
  148. display: flex;
  149. justify-content: flex-start;
  150. align-items: center;
  151. }
  152. /* ========公共========= */
  153. .a14{
  154. font-size: 28upx;
  155. color: #000000;
  156. }
  157. .a12{
  158. font-size: 24upx;
  159. color: #999;
  160. }
  161. .ali{
  162. /* width: 100%; */
  163. /* border: 1upx solid #F76260; */
  164. background-color: #FFFFFF;
  165. margin: 24upx;
  166. border-radius:18upx;
  167. padding: 0 24upx;
  168. display: flex;
  169. flex: 1;
  170. flex-direction: column;
  171. }
  172. </style>