xuxueyang
2024-07-26 8c9fe474d3d43265c33653f17bb411336269dfab
pages/home/components/home-top-flow.vue
@@ -3,36 +3,40 @@
      <view class="item flex" v-for="(item,index) of list" :key="index">
         <view class="img">
            <image class="img img100"
               src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/ff/fff3027bd0a146478fd1f0aae816a028%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20240710224139.png">
               :src="item.cover">
            </image>
            <view class="level">
               A级
          {{ ite.levelStr}}
            </view>
         </view>
         <view class="m-l-12 info-container flex1">
            <view class="title">
               橙色芭比
          {{ item.name || '-' }}
               <view class="price">
                  ¥6.60/扎
            ¥{{ item.price || 0 }}/扎
               </view>
            </view>
            <view class="tags">
               <view class="tag red">限时抢购</view>
               <view class="tag green">品质严选</view>
          <view class="tag red" v-for="(tag,k) of item.tagArr" :class="[k===0?'red':'green']" :key="tag">{{
              tag
            }}
          </view>
          <!--               <view class="tag red">限时抢购</view>-->
          <!--               <view class="tag green">品质严选</view>-->
            </view>
            <view class="shop-name">
               小石头花卉
          {{ item.supplierName || '佚名' }}
            </view>
            <view class="other-info flex">
               <view class="m-r-15">
                  已售:7
            已售:{{ item.sales || 0 }}
               </view>
               <view class="m-r-15">
                  剩余:13
            剩余:{{ item.stock || 0 }}
               </view>
               <view class="m-r-15">
                  1支/扎
            {{ item.unit || 0 }}
               </view>
            </view>
         </view>
@@ -44,9 +48,28 @@
   export default {
      data() {
         return {
            list: [{}, {}, {}, {}]
      // list: [{}, {}, {}, {}]
         };
  },
  mounted() {
    this.listApi = '/api/customer/flower/list'
    this.page.size = 4
    this.page.current = 1
    this.getList('post')
  },
  methods: {
    getList_after() {
      if (this.list) {
        for (var item of this.list) {
          item.tagArr = []
          if (item.tags) {
            item.tagArr = item.tags.split(",") || []
      }
        }
      }
    }
  },
   }
</script>
@@ -89,6 +112,7 @@
                  font-size: 24rpx;
                  color: #CD1212;
                  margin-right: 12rpx;
          text-align: center;
               }
               .tag.green {