邹能昇 3 сар өмнө
parent
commit
9210261c3e

+ 10 - 2
nova-tourism/components/collect/index.js

@@ -19,7 +19,7 @@ Component({
         bottomNavHeight: 0,
         contentHeight: 0,
 
-        active: 0,
+
 
         taps: [{
                 url: 'https://file-cloud.fmode.cn/EbxZUK5lBI/20241212/1eil1p104028966.png',
@@ -48,7 +48,8 @@ Component({
         start: '',
         end: '',
         istoday: true,
-        daysBetween: 1
+        daysBetween: 1,
+        currentTab: 0
     },
     lifetimes: {
         detached: function () {},
@@ -77,6 +78,13 @@ Component({
      * 组件的方法列表
      */
     methods: {
+        switchTab (e) {
+            const index = e.currentTarget.dataset.index;
+            this.setData({
+              currentTab: index
+            });
+            console.log(this.data.currentTab);
+          },
         //获取收藏店铺消息
         async gethomestar() {
             const currentUser = Parse.User.current();

+ 2 - 1
nova-tourism/components/collect/index.json

@@ -2,6 +2,7 @@
     "component": true,
     "usingComponents": {
         "van-tab": "@vant/weapp/tab/index",
-        "van-tabs": "@vant/weapp/tabs/index"
+        "van-tabs": "@vant/weapp/tabs/index",
+        "van-empty": "@vant/weapp/empty/index"
     }
 }

+ 30 - 0
nova-tourism/components/collect/index.less

@@ -247,4 +247,34 @@
             }
         }
     }
+    .tab-bar {
+        display: flex;
+        justify-content: space-around;
+      }
+      
+      .tab-item {
+        padding: 10px 0;
+        text-align: center;
+        position: relative;
+        color: #969696;
+      }
+      
+      .tab-item.active {
+        position: relative;
+        color: #67806A;
+      }
+      
+      .tab-item.active::after {
+        content: "";
+        width: 80%;
+        position: absolute;
+        left: 10%;
+        right: 10%; 
+        bottom: 0;
+        height: 6rpx;
+        background-color: #67806A;
+        border-radius: 4rpx;
+        
+      }
+
 }

+ 90 - 83
nova-tourism/components/collect/index.wxml

@@ -2,101 +2,108 @@
 <nav type="title" background-color="#ffffff" frontColor="#000000" title="云上望仙" />
 <view class="all" style="height: {{contentHeight}}rpx;">
     <image class="img2" src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241121/jc17lo114657420.jpg"></image>
-    <van-tabs active="{{ active }}" color='#B2CEB9' title-inactive-color='#969696' title-active-color='#B2CEB9'>
-        <van-tab title="云上风物">
-            <!-- <view class="box">
-                <view class="taps">
-                    <block wx:for="{{taps}}">
-                        <view class="tap">
-                            <image src="{{item.url}}"></image>
-                            <view class="tap-tex">{{item.tex}}</view>
-                        </view>
+    <view class="tab-bar">
+        <view class="tab-item {{currentTab == 0? 'active' : ''}}" bindtap="switchTab" data-index="0">
+            <text>云上风物</text>
+        </view>
+        <view class="tab-item {{currentTab == 1? 'active' : ''}}" bindtap="switchTab" data-index="1">
+            <text>我的收藏</text>
+        </view>
+    </view>
+    <view wx:if="{{currentTab == 0}}">
+        <!-- <view class="box">
+            <view class="taps">
+                <block wx:for="{{taps}}">
+                    <view class="tap">
+                        <image src="{{item.url}}"></image>
+                        <view class="tap-tex">{{item.tex}}</view>
+                    </view>
+                </block>
+            </view>
+            <view class="box-tex">热门推荐</view>
+            <view class="picturebox">
+                <swiper autoplay="{{true}}" indicator-dots='{{true}}' indicator-color='#D9D9D9' indicator-active-color='#F8DA7F' interval="{{3000}}" circular duration="{{500}}" class="img" bindchange="onSwiperChange">
+                    <block wx:for="{{imageUrls}}" wx:key="index" wx:for-item="img">
+                        <swiper-item class="img">
+                            <image src="{{img}}" mode="aspectFill"></image>
+                        </swiper-item>
                     </block>
-                </view>
-                <view class="box-tex">热门推荐</view>
-                <view class="picturebox">
-                    <swiper autoplay="{{true}}" indicator-dots='{{true}}' indicator-color='#D9D9D9' indicator-active-color='#F8DA7F' interval="{{3000}}" circular duration="{{500}}" class="img" bindchange="onSwiperChange">
-                        <block wx:for="{{imageUrls}}" wx:key="index" wx:for-item="img">
-                            <swiper-item class="img">
-                                <image src="{{img}}" mode="aspectFill"></image>
-                            </swiper-item>
-                        </block>
-                    </swiper>
-                </view> -->
-                <!-- 望仙礼遇 -->
-                <!-- <view class="wangbox">
-                    <view class="wang">望仙礼遇</view>
-                    <view class="wang2">望日w望月w来望仙w</view>
-                </view> -->
-                <!-- <view class="picturebox">
-                    <swiper autoplay="{{true}}" indicator-dots='{{true}}' indicator-color='#D9D9D9' indicator-active-color='#F8DA7F' interval="{{3000}}" circular duration="{{500}}" class="img" bindchange="onSwiperChange">
-                        <block wx:for="{{imageUrls}}" wx:key="index" wx:for-item="img">
-                            <swiper-item class="img">
-                                <image src="{{img}}" mode="aspectFill"></image>
-                            </swiper-item>
-                        </block>
-                    </swiper>
-                </view> -->
+                </swiper>
+            </view>
 
-                <!-- <view class="wang-cardbox">
-                    <block wx:for="{{4}}">
-                        <view class="wang-card"  bindtap="gourl2">
-                            <image src="https://file-cloud.fmode.cn//tmp/srFPqGFAzeT5958c828d985e451ed4c0b452e39ff57a.jpeg"></image>
-                            <view class="wang-catex">粉黛胖挑主人杯(无礼盒)·手做</view>
-                            <view class="wang-numbox">
-                                <view class="wang-num">
-                                    <view class="wang-num1">¥</view>
-                                    <view class="wang-num2">19900</view>
-                                </view>
-                                <view class="wang-submit">购买</view>
+            <view class="wangbox">
+                <view class="wang">望仙礼遇</view>
+                <view class="wang2">望日w望月w来望仙w</view>
+            </view>
+            <view class="picturebox">
+                <swiper autoplay="{{true}}" indicator-dots='{{true}}' indicator-color='#D9D9D9' indicator-active-color='#F8DA7F' interval="{{3000}}" circular duration="{{500}}" class="img" bindchange="onSwiperChange">
+                    <block wx:for="{{imageUrls}}" wx:key="index" wx:for-item="img">
+                        <swiper-item class="img">
+                            <image src="{{img}}" mode="aspectFill"></image>
+                        </swiper-item>
+                    </block>
+                </swiper>
+            </view>
+
+            <view class="wang-cardbox">
+                <block wx:for="{{4}}">
+                    <view class="wang-card" bindtap="gourl2">
+                        <image src="https://file-cloud.fmode.cn//tmp/srFPqGFAzeT5958c828d985e451ed4c0b452e39ff57a.jpeg"></image>
+                        <view class="wang-catex">粉黛胖挑主人杯(无礼盒)·手做</view>
+                        <view class="wang-numbox">
+                            <view class="wang-num">
+                                <view class="wang-num1">¥</view>
+                                <view class="wang-num2">19900</view>
                             </view>
+                            <view class="wang-submit">购买</view>
                         </view>
-                    </block>
-                </view>
+                    </view>
+                </block>
+            </view>
 
-                <view class="more">
-                    <view class="more-tex">查看更多 ></view>
-                </view>
+            <view class="more">
+                <view class="more-tex">查看更多 ></view>
+            </view>
 
-                <view class="wangbox">
-                    <view class="wang">妆造旅拍</view>
-                </view>
+            <view class="wangbox">
+                <view class="wang">妆造旅拍</view>
+            </view>
 
 
-            </view> -->
-        </van-tab>
-        <!-- 我的收藏 -->
-        <van-tab title="我的收藏">
-            <!-- 卡片 -->
-            <view class="Legendary-Information" wx:if="{{storeList.length!=0}}">
-                <block wx:for="{{storeList}}" wx:if="{{item.isCollect&&item.homestayStore.isShow}}">
-                    <view class="cardbox">
-                        <image class="pic" src="{{item.homestayStore.cover}}" data-id="{{item.homestayStore.objectId}}" data-url="../../pages/homestay/homestay-detail/index" bindtap="gourl"></image>
-                        <view class="textobx">
-                            <view class="title" data-id="{{item.homestayStore.objectId}}" data-url="../../pages/homestay/homestay-detail/index" bindtap="gourl">
-                                <view class="til">{{item.homestayStore.storeName}}</view>
-                                <image class="collect" wx:if="{{!item.isCollect}}" src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241121/2gcp1e030048570.png?imageView2/1/w/200/h/200"></image>
-                                <image class="collect" wx:if="{{item.isCollect}}" src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241121/8mp9uj030058190.png?imageView2/1/w/200/h/200"></image>
-                            </view>
+        </view> -->
+    </view>
+    <view wx:if="{{currentTab == 1}}">
+        <!-- 卡片 -->
+        <view class="Legendary-Information" wx:if="{{storeList.length!=0}}">
+            <block wx:for="{{storeList}}" wx:if="{{item.isCollect&&item.homestayStore.isShow}}">
+                <view class="cardbox">
+                    <image class="pic" src="{{item.homestayStore.cover}}" data-id="{{item.homestayStore.objectId}}" data-url="../../pages/homestay/homestay-detail/index" bindtap="gourl"></image>
+                    <view class="textobx">
+                        <view class="title" data-id="{{item.homestayStore.objectId}}" data-url="../../pages/homestay/homestay-detail/index" bindtap="gourl">
+                            <view class="til">{{item.homestayStore.storeName}}</view>
+                            <image class="collect" wx:if="{{!item.isCollect}}" src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241121/2gcp1e030048570.png?imageView2/1/w/200/h/200"></image>
+                            <image class="collect" wx:if="{{item.isCollect}}" src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241121/8mp9uj030058190.png?imageView2/1/w/200/h/200"></image>
+                        </view>
 
-                            <view class="miaosu" wx:if="{{item.homestayStore.desc}}" data-id="{{item.homestayStore.objectId}}" data-url="../../pages/homestay/homestay-detail/index" bindtap="gourl">
-                                {{item.homestayStore.desc}}
-                            </view>
+                        <view class="miaosu" wx:if="{{item.homestayStore.desc}}" data-id="{{item.homestayStore.objectId}}" data-url="../../pages/homestay/homestay-detail/index" bindtap="gourl">
+                            {{item.homestayStore.desc}}
+                        </view>
 
-                            <view class="bottom">
-                                <view class="qian" data-id="{{item.homestayStore.objectId}}" data-url="../../pages/homestay/homestay-detail/index" bindtap="gourl">
-                                    ¥
-                                    <view class="numbox">
-                                        {{item.homestayStore.perCapita}}
-                                    </view>
+                        <view class="bottom">
+                            <view class="qian" data-id="{{item.homestayStore.objectId}}" data-url="../../pages/homestay/homestay-detail/index" bindtap="gourl">
+                                ¥
+                                <view class="numbox">
+                                    {{item.homestayStore.perCapita}}
                                 </view>
-                                <view class="soucang" wx:if="{{!item.isCollect}}" data-id="{{item.homestayStore.objectId}}" bindtap="submit">收藏</view>
-                                <view class="soucang" wx:if="{{item.isCollect}}" data-id="{{item.homestayStore.objectId}}" bindtap="cancle">取消</view>
                             </view>
+                            <view class="soucang" wx:if="{{!item.isCollect}}" data-id="{{item.homestayStore.objectId}}" bindtap="submit">收藏</view>
+                            <view class="soucang" wx:if="{{item.isCollect}}" data-id="{{item.homestayStore.objectId}}" bindtap="cancle">取消</view>
                         </view>
                     </view>
-                </block>
-            </view>
-        </van-tab>
-    </van-tabs>
+                </view>
+            </block>
+        </view>
+        <van-empty wx:if="{{storeList.length==0}}" image="network" description="暂无收藏" />
+    </view>
+
 </view>

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
nova-tourism/components/collect/index.wxss


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно