billing-preview.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <app-layout>
  3. <view class="billing-preview">
  4. <view v-for="(mch, index) in mch_list" :key="index">
  5. <view class="shop-name">{{mch.mch.name}}</view>
  6. <view class="goods-list">
  7. <view class="item dir-left-nowrap" v-for="(good) in mch.goods_list">
  8. <image :src="good.goods_attr.pic_url ? good.goods_attr.pic_url : good.goods_attr.cover_pic" class="pic"></image>
  9. <view class="content">
  10. <view class="name t-omit-two">{{good.name}}</view>
  11. <view class="attr dir-left-nowrap">
  12. <view v-for="attr in good.attr_list">
  13. {{attr.attr_group_name}}:{{attr.attr_name}}
  14. </view>
  15. </view>
  16. <view></view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </app-layout>
  23. </template>
  24. <script>
  25. import {mapState} from 'vuex';
  26. export default {
  27. name: "billing-preview",
  28. data() {
  29. return {
  30. mch_list: []
  31. }
  32. },
  33. computed: {
  34. ...mapState('gift', {
  35. form_data: state => state.form_data
  36. })
  37. },
  38. onLoad() { this.$commonLoad.onload();
  39. this.request();
  40. },
  41. methods: {
  42. async request() {
  43. if (this.form_data.type === 'direct_open') {
  44. delete this.form_data.open_num;
  45. delete this.form_data.open_time;
  46. } else if (this.method_type === 'time_open') {
  47. delete this.form_data.open_num;
  48. } else if (this.method_type === 'num_open') {
  49. delete this.form_data.open_time;
  50. }
  51. const res = await this.$request({
  52. url: this.$api.gift.order_preview,
  53. method: 'post',
  54. data: {
  55. ...this.form_data
  56. }
  57. });
  58. if (res.code === 0) {
  59. this.mch_list = res.data.mch_list;
  60. }
  61. }
  62. }
  63. }
  64. </script>
  65. <style scoped lang="scss">
  66. .billing-preview {
  67. width: #{750upx};
  68. background-color: #f7f7f7;
  69. position: absolute;
  70. min-height: 100%;
  71. }
  72. .shop-name {
  73. height: #{80upx};
  74. line-height: #{80upx};
  75. padding: #{0 24upx};
  76. color: #666666;
  77. font-size: #{28upx};
  78. }
  79. .goods-list {
  80. width: #{750upx};
  81. background-color: #ffffff;
  82. overflow: hidden;
  83. .item {
  84. padding: #{0 24upx};
  85. margin-top: #{28upx};
  86. }
  87. .pic {
  88. width: #{155upx};
  89. height: #{156upx};
  90. }
  91. .name {
  92. font-size: #{28upx};
  93. color: #353535;
  94. line-height: #{32upx};
  95. height: #{64upx};
  96. }
  97. .content {
  98. width: #{547upx};
  99. padding: #{0 0 0 24upx};
  100. }
  101. .attr {
  102. margin-top: #{24upx};
  103. > view {
  104. margin-right: #{32upx};
  105. font-size: #{24upx};
  106. line-height: 1;
  107. color: #999999;
  108. }
  109. }
  110. }
  111. </style>