wangfumin hace 3 meses
padre
commit
ebec0e4746
Se han modificado 3 ficheros con 11 adiciones y 10 borrados
  1. 0 3
      pages/collection/index.js
  2. 4 0
      pages/collection/index.wxml
  3. 7 7
      utils/request.js

+ 0 - 3
pages/collection/index.js

@@ -55,12 +55,10 @@ Page({
       };
       
       const res = await museumApi.getArtifactList(params);
-      console.log('获取收藏列表参数:', res);
       if (res.records) {
         const newList = res.records || [];
         const artifactList = reset ? newList : [...this.data.artifactList, ...newList];
         const hasMore = newList.length === this.data.pageSize;
-        console.log('获取收藏列表成功:', artifactList);
         this.setData({
           artifactList,
           hasMore,
@@ -68,7 +66,6 @@ Page({
         });
       }
     } catch (error) {
-      console.error('获取收藏列表失败:', error);
       wx.showToast({
         title: '获取数据失败',
         icon: 'none'

+ 4 - 0
pages/collection/index.wxml

@@ -61,5 +61,9 @@
         <view class="empty-text">暂无数据</view>
       </view>
     </view>
+    <!-- 加载状态 -->
+    <view wx:if="{{loading}}" class="loading-container">
+      <view class="loading-text">加载中...</view>
+    </view>
   </scroll-view>
 </view>

+ 7 - 7
utils/request.js

@@ -47,11 +47,11 @@ function request(options) {
     // 完整的请求URL
     const fullUrl = url.startsWith('http') ? url : baseURL + url;
 
-    console.log('发送请求:', {
-      url: fullUrl,
-      method,
-      data
-    });
+    // console.log('发送请求:', {
+    //   url: fullUrl,
+    //   method,
+    //   data
+    // });
 
     wx.request({
       url: fullUrl,
@@ -59,7 +59,7 @@ function request(options) {
       data: data,
       header: defaultHeader,
       success: (res) => {
-        console.log('请求成功:', res);
+        // console.log('请求成功:', res);
         
         // 统一处理响应数据
         const { data: responseData } = res;
@@ -70,7 +70,7 @@ function request(options) {
             resolve(responseData.data || responseData);
           } else if (responseData.code === 4008) {
             // 登录失效,提示并延迟跳转到用户页面
-            console.log('登录失效,跳转到用户页面');
+            // console.log('登录失效,跳转到用户页面');
             wx.showToast({
               title: '未登录,即将跳转',
               icon: 'none',