freight.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template name="freight">
  2. <view class="freight-template">
  3. <!-- 运费信息 -->
  4. <view class="invoice-freight">
  5. <view class="freight-left">
  6. 运费<text class="iconfont icon-yunfeishuoming" @click="showTip"></text>
  7. </view>
  8. <view class="freight-right">
  9. <text>{{freightText}}</text>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default{
  16. name:"freight",
  17. props:{
  18. freightData:{
  19. type:Object
  20. }
  21. },
  22. data() {
  23. return{
  24. freightText:'',
  25. }
  26. },
  27. created(){
  28. this.initData(this.freightData)
  29. },
  30. computed: {
  31. },
  32. methods:{
  33. initData(res) {
  34. console.log(res)
  35. switch(res.freePostFlag){
  36. case 0:
  37. this.freightText = '包邮';break
  38. case 1:
  39. this.freightText = res.freePostFlag;break
  40. case -1:
  41. this.freightText = '到付';break
  42. }
  43. },
  44. showTip(){
  45. this.$emit('showFreightAlert');
  46. },
  47. }
  48. }
  49. </script>
  50. <style lang="scss">
  51. .freight-template{
  52. width: 100%;
  53. height: auto;
  54. background: #FFFFFF;
  55. float: left;
  56. margin-top: 24rpx;
  57. .invoice-freight{
  58. width: 702rpx;
  59. padding: 0 24rpx;
  60. height: 86rpx;
  61. line-height: 86rpx;
  62. font-size: $font-size-28;
  63. color: $text-color;
  64. background: #FFFFFF;
  65. float: left;
  66. font-weight: bold;
  67. .freight-left{
  68. float: left;
  69. .icon-yunfeishuoming{
  70. height: 100%;
  71. padding:15rpx;
  72. color: $color-system;
  73. font-weight: normal;
  74. }
  75. }
  76. .freight-right{
  77. float: right;
  78. color: #2A81FF;
  79. }
  80. }
  81. }
  82. </style>