deliveryPrice.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <div class="send-box">
  3. <div class="title-label">预计配送和预计费用</div>
  4. <div class="send-type">
  5. <el-popover
  6. v-for="(item,index) of data" :key="index"
  7. placement="top-start"
  8. width="200"
  9. trigger="hover">
  10. <div class="price-info">
  11. <div class="price-title">预估费用明细:</div>
  12. <div class="price-row freight">
  13. <span class="p-label">运费:</span>
  14. <span class="p-value">¥{{item.estimateFreight}}</span>
  15. </div>
  16. <div class="price-row">
  17. <span class="p-label">单价:</span>
  18. <span class="p-value">¥{{item.unitprice}}</span>
  19. </div>
  20. <div class="price-row">
  21. <span class="p-label">重量:</span>
  22. <span class="p-value">{{item.weight}}</span>
  23. </div>
  24. <div class="price-row">
  25. <span class="p-label">体积:</span>
  26. <span class="p-value">{{item.volume}}</span>
  27. </div>
  28. <div class="price-row">
  29. <span class="p-label">单位:</span>
  30. <span class="p-value">{{item.unit}}</span>
  31. </div>
  32. </div>
  33. <div slot="reference" class="send-item" :title="item.ruleName" :class="{'onSend':currentValue.id == item.id}" @click="priceHandle(index)" >
  34. <div class="label-name">{{item.ruleName}}</div>
  35. <div class="send-info">
  36. <div class="s-time">{{item.endTime}}前</div>
  37. <div class="send-price">¥{{item.estimateFreight}}</div>
  38. </div>
  39. </div>
  40. </el-popover>
  41. </div>
  42. </div>
  43. </template>
  44. <script lang="ts">
  45. import { Component, Prop, Vue, Watch } from "vue-property-decorator";
  46. @Component({components:{}})
  47. export default class DeliveryPrice extends Vue {
  48. @Prop()
  49. data?:Array<any>;
  50. @Prop()
  51. currentValue?:any;
  52. onIndex:any=null;
  53. mounted(){
  54. }
  55. priceHandle(index:number){
  56. // this.onIndex = item.id;
  57. this.$emit('prichChange',index)
  58. }
  59. }
  60. </script>
  61. <style lang="scss" scoped>
  62. .send-box{
  63. width: 100%;
  64. box-sizing: border-box;
  65. padding: 16px;
  66. padding-bottom: 0;
  67. background-color: rgba(255, 226, 160, 0.3);
  68. .title-label{
  69. font-size: 14px;
  70. padding-bottom: 8px;
  71. }
  72. .send-type{
  73. width: 100%;
  74. display: flex;
  75. align-items: center;
  76. flex-wrap:wrap;
  77. .send-item{
  78. width: 165px;
  79. box-sizing: border-box;
  80. border:solid 3px #999;
  81. border-radius: 6px;
  82. overflow: hidden;
  83. margin-right: 32px;
  84. cursor: pointer;
  85. margin-bottom: 16px;
  86. .label-name{
  87. background-color: #999;
  88. color: #FFF;
  89. font-size: 16px;
  90. font-weight: 700;
  91. padding: 2px 0 4px;
  92. text-align: center;
  93. width: 100%;
  94. overflow: hidden;
  95. text-overflow: ellipsis;
  96. white-space: nowrap;
  97. }
  98. .send-info{
  99. padding: 8px 0;
  100. text-align: center;
  101. background-color: #FFF;
  102. .s-time{
  103. font-size: 14px;
  104. color: #1684FC;
  105. font-weight: 700;
  106. }
  107. .send-price{
  108. font-size: 20px;
  109. padding-top: 4px;
  110. }
  111. }
  112. }
  113. .send-item:hover,.onSend{
  114. border:solid 3px #1684FC;
  115. .label-name{
  116. background-color: #1684FC;
  117. }
  118. }
  119. }
  120. }
  121. </style>
  122. <style lang="scss">
  123. .price-info{
  124. width: 100%;
  125. color: #000;
  126. .price-title{
  127. font-size: 16px;
  128. font-weight: 700;
  129. padding-bottom: 4px;
  130. }
  131. .price-row{
  132. width: 100%;
  133. display: flex;
  134. font-size: 12px;
  135. padding: 3px;
  136. // display: flex;
  137. // justify-content: space-between;
  138. }
  139. .freight{
  140. font-size: 14px;
  141. font-weight: 700;
  142. }
  143. }
  144. </style>