order-supplier-area.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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>
  8. <!-- 商品列表 -->
  9. <view class="product" v-for="product in shopData.productList" :key="product.productId">
  10. <order-product :productInfo="product" :numType="numType" @countChange="onCountChange"></order-product>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. // import OrderProduct from '../order-product/order-product.vue'
  16. export default {
  17. name: 'order-supplier-area',
  18. props: {
  19. shopInfo: {
  20. type: Object,
  21. default: () => {}
  22. },
  23. submitType: {
  24. type: String,
  25. default: 'cart'
  26. }
  27. },
  28. computed: {
  29. shopData() {
  30. return {
  31. logo: this.shopInfo.logo || this.shopInfo.shopLogo,
  32. name: this.shopInfo.name || this.shopInfo.shopName,
  33. productList: this.shopInfo.productList || this.shopInfo.orderProductList
  34. }
  35. },
  36. numType() {
  37. return this.submitType === 'shareBuy' ? 2 : 1
  38. }
  39. },
  40. methods: {
  41. onCountChange(value) {
  42. this.$emit('countChange', value)
  43. }
  44. }
  45. }
  46. </script>
  47. <style lang="scss">
  48. .order-supplier-area {
  49. background-color: #fff;
  50. .area-top {
  51. @extend .cm-flex-between;
  52. justify-content: flex-start;
  53. margin-bottom: 24rpx;
  54. .shop-logo {
  55. width: 56rpx;
  56. height: 56rpx;
  57. border-radius: 4rpx;
  58. }
  59. .shop-name {
  60. margin-left: 24rpx;
  61. font-size: 30rpx;
  62. color: #333333;
  63. font-weight: bold;
  64. }
  65. }
  66. .product {
  67. margin-bottom: 24rpx;
  68. &:last-child {
  69. margin-bottom: 0;
  70. }
  71. }
  72. }
  73. </style>