order-supplier-area.vue 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view class="order-supplier-area">
  3. <!-- 供应商信息 -->
  4. <view class="area-top">
  5. <image class="shop-logo" :src="shopData.logo" mode="widthFix"></image>
  6. <view class="shop-name" v-text="shopData.name"></view>
  7. <view class="order-status" v-if="isShowState">
  8. <text>{{ stateExpFormat(shopData.shopStatus) }}</text>
  9. <!-- <text>{{ stateExpFormat(shopData.shopStatus) }}</text> -->
  10. </view>
  11. </view>
  12. <!-- 商品列表 -->
  13. <view class="product" v-for="product in shopData.productList" :key="product.productId">
  14. <order-product :productInfo="product" :numType="numType" @countChange="onCountChange"></order-product>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. // import OrderProduct from '../order-product/order-product.vue'
  20. import orderList from '../../mixins/orderList.js'
  21. export default {
  22. name: 'order-supplier-area',
  23. mixins: [orderList],
  24. props: {
  25. shopInfo: {
  26. type: Object,
  27. default: () => {}
  28. },
  29. submitType: {
  30. type: String,
  31. default: 'cart'
  32. },
  33. isShowState: { // 是否显示订单状态
  34. type: Boolean,
  35. default: false
  36. }
  37. },
  38. computed: {
  39. shopData() {
  40. return {
  41. logo: this.shopInfo.logo || this.shopInfo.shopLogo,
  42. name: this.shopInfo.name || this.shopInfo.shopName,
  43. productList: this.shopInfo.productList || this.shopInfo.orderProductList,
  44. shopStatus: this.shopInfo.shopStatus
  45. }
  46. },
  47. numType() {
  48. return this.submitType === 'shareBuy' ? 2 : 1
  49. }
  50. },
  51. methods: {
  52. onCountChange(value) {
  53. this.$emit('countChange', value)
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss">
  59. .order-supplier-area {
  60. background-color: #fff;
  61. .area-top {
  62. position: relative;
  63. @extend .cm-flex-between;
  64. justify-content: flex-start;
  65. margin-bottom: 24rpx;
  66. .shop-logo {
  67. width: 56rpx;
  68. height: 56rpx;
  69. border-radius: 4rpx;
  70. }
  71. .shop-name {
  72. margin-left: 24rpx;
  73. font-size: 30rpx;
  74. color: #333333;
  75. font-weight: bold;
  76. }
  77. .order-status {
  78. position: absolute;
  79. right: 0;
  80. color: #FF457B;
  81. font-size: 26rpx;
  82. }
  83. }
  84. .product {
  85. margin-bottom: 24rpx;
  86. &:last-child {
  87. margin-bottom: 0;
  88. }
  89. }
  90. }
  91. </style>