shish 1 год назад
Родитель
Сommit
156b454899
2 измененных файлов с 73 добавлено и 39 удалено
  1. 1 1
      mallApp/src/pages.json
  2. 72 38
      mallApp/src/pages/home/recent.vue

+ 1 - 1
mallApp/src/pages.json

@@ -1,5 +1,5 @@
 {
-    "pages": [{ "path": "pages/home/recent", "style": { "navigationBarTitleText": "我的花店" } },
+    "pages": [{ "path": "pages/home/recent", "style": { "navigationBarTitleText": "我的花店","enablePullDownRefresh":true} },
         { "path": "pages/home/index", "style": { "navigationBarTitleText": "首页" } },
         { "path": "pages/home/category", "style": { "navigationBarTitleText": "花束花礼" } },
         { "path": "pages/home/shop", "style": { "navigationBarTitleText": "门店" } },

+ 72 - 38
mallApp/src/pages/home/recent.vue

@@ -1,6 +1,5 @@
 <template>
-  <scroll-view scroll-y style="height: 100vh; width: 100vw;" @scrolltolower="toBottom" >
-    <view class="shop-list_box">
+  <view class="shop-list_box">
       <block v-if="loginStyle  == 0">
         <view style="width:100vw;height:500upx;display:flex;align-items:center;justify-content:center;">
           <button class="admin-button-com big blue" style="border:none;" @click="pageTo({url:'/pages/login/index'})">点我登录</button>
@@ -83,7 +82,6 @@
         </view>
       </block>
     </view>
-  </scroll-view>
 </template>
 <script>
 import AppSwiper from "@/components/app-swiper";
@@ -133,6 +131,23 @@ export default {
       }
 
   },
+  onPullDownRefresh() {
+    // 下拉刷新时重置数据
+    this.list.page = 1
+    this.list.data = []
+    this.list.finished = false
+    
+    // 重新获取数据
+    this.getMyHdList().then(() => {
+      uni.stopPullDownRefresh()
+    }).catch(() => {
+      uni.stopPullDownRefresh()
+    })
+  },
+  onReachBottom() {
+    // 滚动到底部加载更多
+    this.toBottom()
+  },
   methods: {
     recharge(item) {
       this.pageTo({ url: '/pages/member/recharge?hdId='+item.id+'&account='+item.shopId})
@@ -209,72 +224,91 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
+page {
+  height: 100%;
+}
 
 .shop-list_box {
+  min-height: 100vh;
+  
   .ghs_list_page {
     background-color: rgba(255, 255, 255, 1);
-    position: relative;
     width: 750upx;
-    .top-button{
-      padding-top:18upx;padding-bottom:18upx;border:none;margin-top:10upx;
+    
+    .top-button {
+      padding-top: 18upx;
+      padding-bottom: 18upx;
+      border: none;
+      margin-top: 10upx;
     }
+    
     .flex-col {
       display: flex;
       flex-direction: column;
     }
+    
     .flex-row {
       display: flex;
       flex-direction: row;
     }
+    
     .justify-between {
-        display: flex;
-        justify-content: space-between;
+      display: flex;
+      justify-content: space-between;
     }
+    
     .justify-end {
-        display: flex;
-        justify-content: flex-end;
+      display: flex;
+      justify-content: flex-end;
     }
 
     .ghs_list_area {
       padding-top: 25rpx;
       width: 750upx;
       background-color: #ece5e5;
+      
       .ghs_box {
         background-color: rgba(255, 255, 255, 1);
         position: relative;
         width: 750upx;
         height: auto;
-        margin-bottom:25upx;
+        margin-bottom: 25upx;
         overflow: hidden;
+        
         .image-text_7 {
           width: 674upx;
           height: 120upx;
           margin: 40upx 0 0 31upx;
+          
           .section_1 {
             width: 120upx;
             height: 120upx;
-            .logo{
-              width:120upx;
-              height:120upx;
-              border-radius:10upx;
+            
+            .logo {
+              width: 120upx;
+              height: 120upx;
+              border-radius: 10upx;
             }
           }
+          
           .text-group_7 {
             width: 533upx;
             height: 99upx;
             margin-top: 5upx;
+            
             .text_8 {
               width: 458upx;
               height: 38upx;
               color: rgba(51, 51, 51, 1);
               font-size: 36upx;
-              font-weight:bold;
+              font-weight: bold;
               text-align: left;
               white-space: nowrap;
-              line-height:38upx;
-              overflow:hidden;
-              text-overflow:ellipsis;
+              line-height: 38upx;
+              overflow: hidden;
+              text-overflow: ellipsis;
             }
+            
             .text_9 {
               width: 250upx;
               height: 29upx;
@@ -282,19 +316,21 @@ export default {
               font-size: 26upx;
               text-align: left;
               white-space: nowrap;
-              text-overflow:ellipsis;
+              text-overflow: ellipsis;
               line-height: 29upx;
               margin-top: 10upx;
               overflow: hidden;
             }
           }
         }
+        
         .box_4 {
           background-color: rgba(238, 238, 238, 1);
           width: 750upx;
           height: 1upx;
           margin-top: 40upx;
         }
+        
         .box_9 {
           height: 65upx;
           padding: 23upx 15upx 22upx 15upx;
@@ -303,6 +339,7 @@ export default {
           align-items: center;
           justify-content: space-evenly;
           box-sizing: content-box;
+          
           .tag_2 {
             background-color: rgba(255, 255, 255, 1);
             border-radius: 8px;
@@ -317,51 +354,52 @@ export default {
             padding-left: 10upx;
             padding-right: 10upx;
           }
-
         }
+        
         .box_6 {
           background-color: rgb(248, 242, 242);
           width: 750upx;
-          height:85upx;
+          height: 85upx;
           margin-top: 10upx;
           box-sizing: content-box;
+          
           .show_clear_area {
             width: 247upx;
             height: 29upx;
             margin: 26upx 0 0 30upx;
+            
             .waite_clear_order {
               width: 214upx;
               height: 29upx;
               color: rgba(255, 40, 66, 1);
               font-size: 30upx;
-              font-weight:bold;
+              font-weight: bold;
               text-align: left;
               white-space: nowrap;
               line-height: 29upx;
             }
           }
-
         }
 
         .button_4 {
           height: 80upx;
-          line-height:80upx;
-          text-align:center;
-          background-color:#FF2842;
+          line-height: 80upx;
+          text-align: center;
+          background-color: #FF2842;
           width: 130upx;
           position: absolute;
           right: 100upx;
           top: 105upx;
-          border-radius:20upx;
+          border-radius: 20upx;
           z-index: 10;
+          
           .text_13 {
             color: rgba(255, 255, 255, 1);
             font-size: 30upx;
-            font-weight:bold;
+            font-weight: bold;
           }
         }
 
-        // 右上角tip按钮样式 - 三点"更多选项"设计
         .tip-button {
           position: absolute;
           top: 15upx;
@@ -398,7 +436,6 @@ export default {
             align-items: center;
             justify-content: center;
             
-            // 使用单个元素创建三个点的效果
             &::before {
               content: '';
               width: 6upx;
@@ -407,10 +444,9 @@ export default {
               border-radius: 50%;
               position: absolute;
               transition: all 0.2s ease;
-              // 使用box-shadow创建另外两个点
               box-shadow: 
-                0 -8upx 0 0 #666,  /* 上面的点 */
-                0 8upx 0 0 #666;   /* 下面的点 */
+                0 -8upx 0 0 #666,
+                0 8upx 0 0 #666;
             }
           }
           
@@ -419,13 +455,12 @@ export default {
               background-color: #333;
               transform: scale(1.1);
               box-shadow: 
-                0 -8upx 0 0 #333,  /* 上面的点变色 */
-                0 8upx 0 0 #333;   /* 下面的点变色 */
+                0 -8upx 0 0 #333,
+                0 8upx 0 0 #333;
             }
           }
         }
 
-        // 更多选项弹出菜单样式
         .more-options-popup {
           position: fixed;
           top: 0;
@@ -486,7 +521,6 @@ export default {
             }
           }
         }
-
       }
     }
   }