freight.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. switch(res.freePostFlag){
  35. case '0':
  36. this.freightText = '包邮';break
  37. case '1':
  38. this.freightText = '需要运费';break
  39. case '-1':
  40. this.freightText = '到付';break
  41. case '-2':
  42. this.freightText = '仪器到付-产品包邮';break
  43. }
  44. },
  45. showTip(){
  46. this.$emit('showFreightAlert');
  47. },
  48. }
  49. }
  50. </script>
  51. <style lang="scss">
  52. .freight-template{
  53. width: 100%;
  54. height: auto;
  55. background: #FFFFFF;
  56. float: left;
  57. margin-top: 24rpx;
  58. .invoice-freight{
  59. width: 702rpx;
  60. padding: 0 24rpx;
  61. height: 86rpx;
  62. line-height: 86rpx;
  63. font-size: $font-size-base;
  64. color: $text-color;
  65. background: #FFFFFF;
  66. float: left;
  67. font-weight: bold;
  68. .freight-left{
  69. float: left;
  70. .icon-yunfeishuoming{
  71. height: 100%;
  72. padding:15rpx;
  73. color: $color-system;
  74. font-weight: normal;
  75. }
  76. }
  77. .freight-right{
  78. float: right;
  79. color: #2A81FF;
  80. }
  81. }
  82. }
  83. </style>