绿满眶商城微信小程序-uniapp
zxl
3 天以前 4c990c71b78a4dc817db706067aed2369dbe6ac3
pages/kitchen/KitchenCustomize.vue
@@ -1,6 +1,7 @@
<template>
    <view class="page">
        <top-bar selectedTitleIndex="kitchenCustomize" textColor="black" bgColor="#ffffff" @changeTab="topBarChange"></top-bar>
        <top-bar selectedTitleIndex="kitchenCustomize" textColor="black" bgColor="#ffffff"
            @changeTab="topBarChange"></top-bar>
        <view class="banner">
            <image class="banner-img" :src="banner" mode="aspectFill"></image>
        </view>
@@ -100,8 +101,10 @@
        async initData() {
            await getKitchenBanner().then(res => {
                if (res.statusCode === 200) {
                    if (res.data.data.length > 0) {
                    this.banner = res.data.data[0].coverUrl;
                    console.log(res)
                    }
                }
            });
            await getKitchenTag().then(res => {
@@ -117,8 +120,13 @@
                    }
                }
            });
            if (this.tags.length > 0) {
            this.queryParams.tagId = this.tags[0].value;
            this.getProductList();
            } else {
                console.warn('标签数据为空,不请求商品列表');
                this.products = []; // 清空商品列表,避免旧数据残留
            }
        },
        getProductList() {
@@ -357,6 +365,7 @@
    color: #999;
    font-size: 24rpx;
}
.topBar {
   position: fixed;
   top: 20rpx;