shish 1 год назад
Родитель
Сommit
4de344d18a
1 измененных файлов с 16 добавлено и 20 удалено
  1. 16 20
      mallApp/src/pages/home/recent.vue

+ 16 - 20
mallApp/src/pages/home/recent.vue

@@ -1,16 +1,17 @@
 <template>
-  <view>
+  <scroll-view
+    scroll-y
+    style="height: 100vh; width: 100vw;"
+    @scrolltolower="toBottom"
+  >
     <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>
         </view>
       </block>
       <block v-else>
-
         <view class="ghs_list_page flex-col" v-if="!$util.isEmpty(list.data)">
-
           <view style="background-color:white;margin-bottom:20upx;display: flex;flex-direction: row;justify-content: space-around;">
             <button class="admin-button-com mini-btn blue top-button" @click="">修改密码</button>
             <button class="admin-button-com mini-btn blue top-button" @click="">改进建议</button>
@@ -18,9 +19,7 @@
             <button class="admin-button-com mini-btn blue top-button" @click="">采购统计</button>
             <button class="admin-button-com mini-btn blue top-button" @click="logout()">退出登录</button>
           </view>
-
           <view class="ghs_list_area flex-col justify-end">
-
               <view class="ghs_box flex-col justify-end" v-for="item in list.data" :key="item.id">
                 <view class="image-text_7 flex-row justify-between" @click.stop="bug(item)">
                   <view class="section_1 flex-col">
@@ -39,16 +38,14 @@
                 </view>
                 <view class="button_4 flex-col" @click.stop="bug(item)"><text class="text_13">买花</text></view>
               </view>
-
           </view>
         </view>
         <view v-else>
           <text style="margin-top:200upx;margin-left:80upx;font-size:30upx;font-weight:bold;">暂无花店</text>
         </view>
       </block>
-
-  </view>
-  </view>
+    </view>
+  </scroll-view>
 </template>
 <script>
 import AppSwiper from "@/components/app-swiper";
@@ -90,17 +87,16 @@ export default {
         this.loginStyle = 0
       }
   },
-  onReachBottom(){
-    console.log('bottom')
-    if (!this.list.finished) {
-      this.getMyHdList().then(res => {
-        uni.stopPullDownRefresh()
-      })
-    } else {
-      uni.stopPullDownRefresh()
-    }
-  },
   methods: {
+    toBottom(){
+      if (!this.list.finished) {
+        this.getMyHdList().then(res => {
+          uni.stopPullDownRefresh()
+        })
+      } else {
+        uni.stopPullDownRefresh()
+      }
+    },
     logout(){
       let that = this
       that.$util.confirmModal({content:'确认退出?'},() => {