wangfumin 1 月之前
父節點
當前提交
362eb7fe96
共有 51 個文件被更改,包括 1758 次插入618 次删除
  1. 2 0
      .gitignore
  2. 8 3
      app.js
  3. 3 3
      app.json
  4. 1 1
      common/components/component-list/component-list.js
  5. 二進制
      imgs/heritage.png
  6. 二進制
      imgs/heritage_active.png
  7. 2 2
      miniprogram_npm/eventemitter3/index.js
  8. 1 1
      miniprogram_npm/eventemitter3/index.js.map
  9. 2 2
      miniprogram_npm/extend/index.js
  10. 1 1
      miniprogram_npm/extend/index.js.map
  11. 2 2
      miniprogram_npm/weapp-qrcode/index.js
  12. 1 1
      miniprogram_npm/weapp-qrcode/index.js.map
  13. 2 2
      miniprogram_npm/widget-ui/index.js
  14. 5 1
      pages/cg_detail/index.js
  15. 1 1
      pages/cg_detail/index.wxml
  16. 6 6
      pages/guicang/index.js
  17. 2 2
      pages/guicang/index.wxss
  18. 31 93
      pages/guicangDetails/index.js
  19. 1 1
      pages/guicangDetails/index.json
  20. 26 22
      pages/guicangDetails/index.wxml
  21. 5 2
      pages/guicangDetails/index.wxss
  22. 5 5
      pages/login_page/index.js
  23. 26 7
      pages/swkz/index.js
  24. 397 106
      pages/tongcheng/index.js
  25. 69 43
      pages/tongcheng/search/index.js
  26. 2 2
      pages/tongcheng/search/index.wxml
  27. 249 33
      pages/user/index.js
  28. 22 4
      pages/user/index.wxml
  29. 60 0
      pages/user/index.wxss
  30. 26 11
      pages/user/my_comment/index.js
  31. 42 14
      pages/user/my_follow/index.js
  32. 25 6
      pages/user/my_order/index.js
  33. 42 13
      pages/user/my_saw/index.js
  34. 1 0
      pages/webview/index.json
  35. 6 3
      pages/wv_page/index.js
  36. 42 12
      pages/yuezhan/comment_detail/index.js
  37. 11 6
      pages/yuezhan/html_detail/index.js
  38. 128 55
      pages/yuezhan/index.js
  39. 8 8
      pages/yuezhan/index.wxml
  40. 15 2
      pages/yuezhan/index.wxss
  41. 7 3
      pages/yuezhan/pay_page/index.js
  42. 24 9
      pages/yuezhan/search/index.js
  43. 70 29
      pages/yuezhan/search_result/index.js
  44. 3 3
      pages/yuezhan/search_result/index.wxml
  45. 298 84
      pages/zhanxun/index.js
  46. 4 4
      pages/zhanxun/index.wxml
  47. 4 0
      pages/zhanxun/index.wxss
  48. 6 3
      pages/zl_detail/create_evaluation/index.js
  49. 11 3
      pages/zl_detail/index.js
  50. 2 2
      project.private.config.json
  51. 51 2
      utils/newServices.js

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+# 忽略node_modules目录
+node_modules

+ 8 - 3
app.js

@@ -1,3 +1,5 @@
+import { newServerName } from './utils/newServices';
+
 //app.js
 const {
   request,serverName
@@ -24,7 +26,7 @@ App({
 
     if (loginSessionKey) {
       wx.request({
-        url: serverName + '/wx/api/user/getBrowsedExhibitions',
+        url: newServerName + '/wx/user/getBrowsedExhibitions',
         data: {
           loginSessionKey
         },
@@ -113,7 +115,7 @@ App({
     //关闭应用的时候发送你浏览过的场景
     if (loginSessionKey) {
       wx.request({
-        url: serverName + '/wx/api/user/saveBrowsedExhibitions',
+        url: newServerName + '/wx/user/saveBrowsedExhibitions',
         data: {
           ids:ids,
           loginSessionKey
@@ -132,7 +134,10 @@ App({
 
   globalData: {
     userInfo: null,
-    city: "",
+    city: "北京",
+    latitude: 39.9042, // 北京天安门纬度
+    longitude: 116.4074, // 北京天安门经度
+    locationName: "", // 位置名称,初始为空
     collectedArr: [],
     collectedChange: false,
     clickToSelect: false,

+ 3 - 3
app.json

@@ -57,15 +57,15 @@
       },
       {
         "pagePath": "pages/zhanxun/index",
-        "text": "展",
+        "text": "展",
         "iconPath": "imgs/swkz.png",
         "selectedIconPath": "./imgs/swkz_active.png"
       },
       {
         "pagePath": "pages/guicang/index",
         "text": "归藏",
-        "iconPath": "imgs/tongcheng.png",
-        "selectedIconPath": "./imgs/tongcheng_active.png" 
+        "iconPath": "imgs/heritage_active.png",
+        "selectedIconPath": "./imgs/heritage.png" 
       },
       {
         "pagePath": "pages/user/index",

+ 1 - 1
common/components/component-list/component-list.js

@@ -50,7 +50,7 @@ Component({
    */
   methods: {
     goBigScene: function(){
-      if (this.data.hasProduct){
+      if (this.data.online === 1){
         app.globalData.currentUrl = this.data.link
         wx.navigateTo({
           url: `../../wv_page/index?id=${this.data.sceneId}`,

二進制
imgs/heritage.png


二進制
imgs/heritage_active.png


文件差異過大導致無法顯示
+ 2 - 2
miniprogram_npm/eventemitter3/index.js


文件差異過大導致無法顯示
+ 1 - 1
miniprogram_npm/eventemitter3/index.js.map


文件差異過大導致無法顯示
+ 2 - 2
miniprogram_npm/extend/index.js


文件差異過大導致無法顯示
+ 1 - 1
miniprogram_npm/extend/index.js.map


文件差異過大導致無法顯示
+ 2 - 2
miniprogram_npm/weapp-qrcode/index.js


文件差異過大導致無法顯示
+ 1 - 1
miniprogram_npm/weapp-qrcode/index.js.map


文件差異過大導致無法顯示
+ 2 - 2
miniprogram_npm/widget-ui/index.js


+ 5 - 1
pages/cg_detail/index.js

@@ -1,5 +1,9 @@
 // pages/zl_detail/index.js
 const { request, serverName, imgServer } = require('../../utils/services');
+const {
+  newRequestFns,
+  newServerName
+} = require('../../utils/newServices.js');
 const WxParse = require('../../common/component/wxParse/wxParse.js');
 const { defaultImg } = require('../../utils/images');
 const app = getApp();
@@ -81,7 +85,7 @@ Page({
 
   getPavilionDetail: function () {
     let pavilionId = this.data.pavilionId;
-    request["getPavilionDetail"]({
+    newRequestFns["getPavilionDetail"]({
       pavilionId: pavilionId
     },"", res => {
       let { data: pavilionDetail } = res.data;

+ 1 - 1
pages/cg_detail/index.wxml

@@ -39,7 +39,7 @@
           <view class='iconfont iconshijian'></view>
           <text class='cg_detail_time'>{{pavilionDetail.openTime}} 提前一个小时入馆 周一闭馆</text>
         </view>
-        <navigator class='cg_address_warpper' url="./cg_introduce/index?id={{pavilionId}}">
+        <navigator class='cg_address_warpper' url="./cg_introduce/index?id={{pavilionId}}&lo={{pavilionDetail.longitude}}&la={{pavilionDetail.latitude}}">
           <view class=' iconfont iconweizhi'></view>
           <text class='cg_address'>{{pavilionDetail.address}}</text>
           <view class='iconfont icon-youbian'></view>

+ 6 - 6
pages/guicang/index.js

@@ -1,5 +1,5 @@
 // index.js
-const { request, cosBaseUrl } = require('../../utils/newServices');
+const { newRequest, cosBaseUrl } = require('../../utils/newServices');
 
 Page({
   data: {
@@ -33,13 +33,13 @@ Page({
   // 加载轮播图数据
   loadSwiperData: function() {
     const params = {
-      orderBy: 'pv',
       sortBy: 'DESC',
+      hot: 1,
       pageNo: 1,
       pageSize: 1
     };
 
-    request.getAntiqueList(
+    newRequest.getAntiqueList(
       params,
       'GET',
       (res) => {
@@ -47,7 +47,7 @@ Page({
         if (res.data && res.data.data && res.data.data.pageData) {
           const swiperData = res.data.data.pageData.map(item => ({
             id: item.id,
-            imageUrl: cosBaseUrl + item.coverImgUrl,
+            imageUrl: item.coverImgUrl.includes('http') ? item.coverImgUrl : cosBaseUrl + item.coverImgUrl,
             title: item.name,
             date: item.createTime ? item.createTime.split(' ')[0] : '',
             source: item.source || '归藏'
@@ -78,7 +78,7 @@ Page({
       pageSize: 20
     };
 
-    request.getAntiqueList(
+    newRequest.getAntiqueList(
       params,
       'GET',
       (res) => {
@@ -86,7 +86,7 @@ Page({
         if (res.data && res.data.data && res.data.data.pageData) {
           const newItems = res.data.data.pageData.map(item => ({
             id: item.id,
-            imageUrl: cosBaseUrl + item.coverImgUrl,
+            imageUrl: item.coverImgUrl.includes('http') ? item.coverImgUrl : cosBaseUrl + item.coverImgUrl,
             title: item.name,
             date: item.createTime ? item.createTime.split(' ')[0] : '',
             source: item.source || '归藏'

+ 2 - 2
pages/guicang/index.wxss

@@ -43,12 +43,12 @@
 
 .swiper-info {
   background: url('https://swkz-1332577016.cos.ap-guangzhou.myqcloud.com/swkzGuicang/heritage_bg.png') no-repeat;
+  background-size: cover;
   position: absolute;
   bottom: 0;
   left: 0;
-  width: 100%;
+  width: 95%;
   padding: 20rpx;
-  background-size: 100%;
   border-bottom-left-radius: 20rpx;
   border-bottom-right-radius: 20rpx;
 }

+ 31 - 93
pages/guicangDetails/index.js

@@ -2,7 +2,7 @@
 
 import drawQrcode from 'weapp-qrcode';
 import { getwxml, style } from './shareJson.js';
-const { request, cosBaseUrl, fileBaseURL } = require('../../utils/newServices');
+const { newRequest, cosBaseUrl, fileBaseURL } = require('../../utils/newServices');
 
 Page({
   data: {
@@ -57,7 +57,7 @@ Page({
     });
     
     // 调用详情接口
-    request.getAntiqueDetail(
+    newRequest.getAntiqueDetail(
       {},
       'GET',
       (res) => {
@@ -73,8 +73,8 @@ Page({
             description: detail.description || '',
             dimensions: detail.dimensions || detail.size,
             material: detail.material,
-            imageUrl: cosBaseUrl + detail.coverImgUrl,
-            file: cosBaseUrl + detail.fileList.find(file => file.name.includes('usdz')).url,
+            imageUrl: detail.coverImgUrl.includes('http') ? detail.coverImgUrl : cosBaseUrl + detail.coverImgUrl,
+            // file: cosBaseUrl + detail.fileList.find(file => file.name.includes('usdz')).url,
             h5Url: `${fileBaseURL}?m=${cosBaseUrl + detail.fileList.find(file => file.name.includes('usdz')).url}`,
             shareUrl: `${fileBaseURL}?m=${cosBaseUrl + detail.fileList.find(file => file.name.includes('usdz')).url}`,
           };
@@ -160,14 +160,14 @@ Page({
     setTimeout(() => {
       this.initCanvas();
     }, 1000)
-    },
-    // 关闭分享弹窗
-    closeSharePopup: function() {
-      this.setData({
-        showSharePopup: false,
-        shareImagePath: '',
-      });
-    },
+  },
+  // 关闭分享弹窗
+  closeSharePopup: function() {
+    this.setData({
+      showSharePopup: false,
+      shareImagePath: '',
+    });
+  },
   // 生成分享图片
   generateShareImage: function() {
     const that = this;
@@ -197,6 +197,10 @@ Page({
   extraImage() {
     const p2 = this.widget.canvasToTempFilePath()
     p2.then(res => {
+      wx.hideToast();
+      wx.showShareImageMenu({
+        path: res.tempFilePath
+      })
       this.setData({
         shareImagePath: res.tempFilePath,
       })
@@ -205,13 +209,13 @@ Page({
   // 生成二维码
   showQRCode() {
     let that = this;
-    let url = 'https://3d-usdz.4dkankan.com/index.html?m=13719751007/captureModel/202503131501024131/data'
+    let url = that.data.itemDetail.h5Url
     drawQrcode({
         width: 72,
         height: 72,
         canvasId: 'myQrcode',
         text: url,
-        correctLevel: 3
+        correctLevel: 2
       })
 
     // 创建一个选择器查询对象
@@ -240,66 +244,10 @@ Page({
       }
     });
   },
-  // 保存图片到本地
-  saveToLocal: function() {
-    const that = this;
-    if (!that.data.shareImagePath) {
-      wx.showToast({
-        title: '图片生成中,请稍候',
-        icon: 'none'
-      });
-      return;
-    }
-    
-    // 获取保存图片到相册的权限
-    wx.getSetting({
-      success: function(res) {
-        if (!res.authSetting['scope.writePhotosAlbum']) {
-          wx.authorize({
-            scope: 'scope.writePhotosAlbum',
-            success: function() {
-              that.saveImageToAlbum();
-            },
-            fail: function() {
-              wx.showModal({
-                title: '提示',
-                content: '需要您授权保存图片到相册',
-                showCancel: false,
-                success: function() {
-                  wx.openSetting();
-                }
-              });
-            }
-          });
-        } else {
-          that.saveImageToAlbum();
-        }
-      }
-    });
-  },
-  // 保存图片到相册
-  saveImageToAlbum: function() {
-    const that = this;
-    wx.saveImageToPhotosAlbum({
-      filePath: that.data.shareImagePath,
-      success: function() {
-        wx.showToast({
-          title: '保存成功',
-          icon: 'success'
-        });
-      },
-      fail: function() {
-        wx.showToast({
-          title: '保存失败',
-          icon: 'none'
-        });
-      }
-    });
-  },
   // 复制链接
   copyLink: function() {
     wx.setClipboardData({
-      data: this.data.shareUrl,
+      data: this.data.itemDetail.shareUrl,
       success: function() {
         wx.showToast({
           title: '链接已复制',
@@ -313,31 +261,21 @@ Page({
   shareToWechat: function() {
     if (!this.data.shareImagePath) {
       wx.showToast({
-        title: '图片生成中,请稍候',
-        icon: 'none'
-      });
-      return;
-    }
-    
-    wx.showShareImageMenu({
-      path: this.data.shareImagePath
-    })
-  },
-
-  // 分享到朋友圈
-  shareToTimeline: function() {
-    if (!this.data.shareImagePath) {
-      wx.showToast({
-        title: '图片生成中,请稍候',
-        icon: 'none'
+        title: '正在生成分享图片,请稍候',
+        icon: 'none',
+        duration: 10000,
+        mask: true,
       });
-      return;
+      this.showQRCode();
+      setTimeout(() => {
+        this.initCanvas();
+      }, 1000)
+    } else {
+      wx.showShareImageMenu({
+        path: this.data.shareImagePath
+      })
     }
     
-    wx.showShareMenu({
-      withShareTicket: true,
-      menus: ['shareTimeline']
-    });
   },
 
   // 分享给朋友(小程序自带分享功能)

+ 1 - 1
pages/guicangDetails/index.json

@@ -1,5 +1,5 @@
 {
-  "navigationBarTitleText": "详情",
+  "navigationBarTitleText": "归藏",
   "navigationBarTextStyle": "white",
   "navigationBarBackgroundColor": "#111",
   "enablePullDownRefresh": false,

+ 26 - 22
pages/guicangDetails/index.wxml

@@ -1,7 +1,7 @@
 <!-- pages/guicangDetails/index.wxml -->
 <view class="container" wx:if="{{itemDetail}}">
   <!-- 下载app提示 -->
-  <view class="app-download-banner" wx:if="{{showAppBanner}}">
+  <!-- <view class="app-download-banner" wx:if="{{showAppBanner}}">
     <view class="banner-content">
       <view class="close-btn" bindtap="closeAppBanner">
       ×
@@ -15,7 +15,7 @@
         <view class="download-btn" bindtap="downloadApp">下载APP</view>
       </view>
     </view>
-  </view>
+  </view> -->
   <!-- 顶部图片区域 -->
   <view class="image-container" bindtap="openH5Page">
     <image src="{{itemDetail.imageUrl}}" mode="aspectFill" class="main-image"></image>
@@ -38,7 +38,10 @@
           <view class="title">{{itemDetail.title}}</view>
           <view class="subtitle">{{itemDetail.date}} · {{itemDetail.source}}</view>
         </view>
-        <view wx:if="{{!isFullScreen}}" class="share-button" bindtap="shareItem">
+        <view wx:if="{{!isFullScreen}}" class="share-button" bindtap="copyLink">
+          <image src="../../imgs/guicang/share_link.png" mode="aspectFit" class="down-icon"></image>
+        </view>
+        <view wx:if="{{!isFullScreen}}" class="share-button" bindtap="shareToWechat">
           <image src="../../imgs/guicang/share.png" mode="aspectFit" class="share-icon"></image>
         </view>
       </view>
@@ -63,16 +66,17 @@
   <view class="weui-loading"></view>
   <view class="loading-text">加载中...</view>
 </view>
-
+<canvas style="width: 72px;height: 72px;" class="canvas-code" canvas-id="myQrcode" id="myQrcode"></canvas>
+<wxml-to-canvas class="widget" width="360" height="256"></wxml-to-canvas>
 <!-- 分享弹窗 -->
-<view class="share-popup" wx:if="{{showSharePopup}}">
-  <canvas style="width: 72px;height: 72px;" class="canvas-code" canvas-id="myQrcode" id="myQrcode"></canvas>
-  <view class="share-popup-mask" bindtap="closeSharePopup"></view>
+<!-- <view class="share-popup" wx:if="{{showSharePopup}}"> -->
+  <!-- <canvas style="width: 72px;height: 72px;" class="canvas-code" canvas-id="myQrcode" id="myQrcode"></canvas> -->
+  <!-- <view class="share-popup-mask" bindtap="closeSharePopup"></view>
   <view class="share-popup-content">
-    <view class="share-title">分享到</view>
+    <view class="share-title">分享到</view> -->
     
     <!-- 分享图片预览 -->
-    <view class="share-image-container" style="display: none;" show-menu-by-longpress="{{true}}">
+    <!-- <view class="share-image-container" style="display: none;" show-menu-by-longpress="{{true}}">
       <view class="top-image">
         <image class="wenwubg" src="https://swkz-1332577016.cos.ap-guangzhou.myqcloud.com/swkzGuicang/test.png"></image>
       </view>
@@ -86,22 +90,22 @@
           <image class="qrcode" :src="{{qrcodeUrl}}"></image>
         </view>
       </view>
-    </view>
-    <wxml-to-canvas class="widget" width="360" height="256"></wxml-to-canvas>
-    <view class="share-png-box" hover-class="none" hover-stop-propagation="false">
+    </view> -->
+    <!-- <wxml-to-canvas class="widget" width="360" height="256"></wxml-to-canvas> -->
+    <!-- <view class="share-png-box" hover-class="none" hover-stop-propagation="false">
       <text wx:if="{{!shareImagePath}}" class="share-tips">图片生成中</text>
       <image wx:else class="share-png" src="{{shareImagePath}}" show-menu-by-longpress></image>
-    </view>
+    </view> -->
     
     <!-- 分享按钮区域 -->
-    <view class="share-options">
-      <view class="share-option-item" bindtap="saveToLocal">
+    <!-- <view class="share-options"> -->
+      <!-- <view class="share-option-item" bindtap="saveToLocal">
         <view class="option-img" hover-class="none" hover-stop-propagation="false">
           <image src="../../imgs/guicang/down.png" class="option-icon"></image>
         </view>
         <text class="option-text">保存本地</text>
-      </view>
-      <view class="share-option-item" bindtap="copyLink">
+      </view> -->
+      <!-- <view class="share-option-item" bindtap="copyLink">
         <view class="option-img" hover-class="none" hover-stop-propagation="false">
           <image src="../../imgs/guicang/share_link.png" class="option-icon"></image>
         </view>
@@ -112,16 +116,16 @@
           <image src="../../imgs/guicang/wechat.png" class="option-icon"></image>
         </view>
         <text class="option-text">微信</text>
-      </view>
+      </view> -->
       <!-- <view class="share-option-item" bindtap="shareToTimeline">
         <view class="option-img" hover-class="none" hover-stop-propagation="false">
           <image src="../../imgs/guicang/pengyouquan.png" class="option-icon"></image>
         </view>
         <text class="option-text">朋友圈</text>
       </view> -->
-    </view>
+    <!-- </view> -->
     
     <!-- 取消按钮 -->
-    <view class="cancel-button" bindtap="closeSharePopup">取消</view>
-  </view>
-</view>
+    <!-- <view class="cancel-button" bindtap="closeSharePopup">取消</view> -->
+  <!-- </view> -->
+<!-- </view> -->

+ 5 - 2
pages/guicangDetails/index.wxss

@@ -1,7 +1,7 @@
 /* pages/guicangDetails/index.wxss */
 .container {
   padding: 0;
-  background: url('https://swkz-1332577016.cos.ap-guangzhou.myqcloud.com/swkzGuicang/bg.png') no-repeat 100% 180%;
+  background: url('https://swkz-1332577016.cos.ap-guangzhou.myqcloud.com/swkzGuicang/bg.png') no-repeat;
   background-size: cover;
   color: #fff;
   min-height: 100vh;
@@ -241,7 +241,10 @@
   border-radius: 30rpx;
   border: 1px solid #252525;
 }
-
+.down-icon {
+  width: 40rpx;
+  height: 40rpx;
+}
 .share-icon {
   width: 30rpx;
   height: 30rpx;

+ 5 - 5
pages/login_page/index.js

@@ -3,10 +3,10 @@ const {
   request,
   serverName
 } = require('../../utils/services');
-// const {
-//   request,
-//   serverName
-// } = require('../../utils/newServices.js');
+const {
+  newRequestFns,
+  newServerName
+} = require('../../utils/newServices.js');
 // const WxParse = require('../../../common/component/wxParse/wxParse.js');
 const {
   Toast,
@@ -43,7 +43,7 @@ Page({
           } = res;
           if (code) {
             wx.request({
-              url: serverName + '/wx/user/getLoginSessionKey',
+              url: newServerName + '/wx/user/getLoginSessionKey',
               data: {
                 encryptedData,
                 iv,

+ 26 - 7
pages/swkz/index.js

@@ -1,5 +1,9 @@
 //index.js
 const { request, serverName, imgServer } = require('../../utils/services');
+const {
+  newRequestFns,
+  newServerName
+} = require('../../utils/newServices.js');
 const { Toast } = require('../../utils/util.js');
 const { defaultImg, noExhibitionImg } = require('../../utils/images');
 
@@ -107,7 +111,7 @@ Page({
     this.setData({
       loading: true
     })
-    request["getExhibitionList"]({
+    newRequestFns["getExhibitionList"]({
       page: page,
       type: type
     }, '', res => {
@@ -115,18 +119,33 @@ Page({
       let tempContent = this.data.exhibitionList
         ? this.data.exhibitionList
         : [];
-      let { last: lastPage, totalPages, content: exhibitionList } = res.data.data;
+      let { pageData: exhibitionList, total } = res.data.data;
+
+      // 判断是否为最后一页(返回空数组表示没有更多数据)
+      let isLastPage = !exhibitionList || exhibitionList.length === 0;
+
+      if (isLastPage) {
+        this.setData({
+          loading: false,
+          lastPage: true // 标记为最后一页
+        });
+        wx.stopPullDownRefresh();
+        return;
+      }
 
-      let { openTime } = exhibitionList;
       exhibitionList.forEach((currentValue) => {
         currentValue.product ? currentValue.product.link = escape(currentValue.product.link) : '';
         currentValue.product ? currentValue.product.imageUrl = escape(currentValue.product.imageUrl) : '';
       })
+
+      // 拼接新数据
+      let newExhibitionList = tempContent.concat(exhibitionList);
+
       this.setData({
-        currentPage: res.data.data.number + 1,
-        lastPage,
+        currentPage: page,
+        lastPage: false, // 有数据时设为false
         loading: false,
-        exhibitionList: tempContent.concat(exhibitionList),
+        exhibitionList: newExhibitionList,
       });
       wx.stopPullDownRefresh();
 
@@ -154,7 +173,7 @@ Page({
 
     let loginSessionKey = wx.getStorageSync('token') || "";
     // if (loginSessionKey){
-    request['isCollect']({
+    newRequestFns['isCollect']({
       loginSessionKey,
       exhibitionId: id,
       type: Number(type),

+ 397 - 106
pages/tongcheng/index.js

@@ -4,6 +4,10 @@ const { request, serverName,imgServer } = require('../../utils/services');
 const { Toast, qqmapsdk } = require('../../utils/util.js');
 const { defaultImg, noExhibitionImg } = require('../../utils/images');
 const WxParse = require('../../common/component/wxParse/wxParse.js');
+const {
+  newRequestFns,
+  newServerName
+} = require('../../utils/newServices.js');
 
 // const QQMapWX = require('../../common/component/mapSDK/qqmap-wx-jssdk.min.js');
 
@@ -51,7 +55,7 @@ Page({
     interval: 5000,
     duration: 1000,
     activeIndex: 0,
-    locationName: "珠海",
+    locationName: "北京",
     locationNameDesp:"",
     isLike: false,
     showConfirm: false,
@@ -95,15 +99,33 @@ Page({
 
   },
   onShow: function () {
-    let { city, clickToSelect, collectedArr, collectedChange } = app.globalData;
+    let { city, clickToSelect, collectedArr, collectedChange, latitude, longitude, locationName } = app.globalData;
     let { activeIndex, exhibitionList } = this.data
     if (clickToSelect) {
+      // 使用 globalData 中的位置信息
+      let finalLocationName = locationName || city || "北京";
+      
       this.setData({
-        locationName: city || "珠海",
+        locationName: finalLocationName,
         exhibitionList: [],
         activeIndex: 0,
         type: 5
       });
+      
+      // 如果有完整的位置信息,也设置坐标
+      if (latitude && longitude) {
+        this.setData({
+          latitude: latitude,
+          longitude: longitude
+        });
+      }
+      
+      // 确保 city 与 locationName 一致
+      if (finalLocationName && finalLocationName !== "北京") {
+        app.globalData.city = finalLocationName;
+      } else {
+        app.globalData.city = "北京";
+      }
 
       if (activeIndex == 1) {
         this.getNearByList(1);
@@ -151,7 +173,7 @@ Page({
 
     let loginSessionKey = wx.getStorageSync('token') || "";
     // if (loginSessionKey){
-    request['isCollect']({
+    newRequestFns['isCollect']({
       loginSessionKey,
       exhibitionId: id,
       type: Number(type),
@@ -218,55 +240,102 @@ Page({
   },
 
   getLocationName: function () {
-    // 调用接口
-    wx.getLocation({
-      type: 'wgs84',
-      success: (res) => {
-        this.setData({
-          latitude: res.latitude,
-          longitude: res.longitude
-        })
-        //2、根据坐标获取当前位置名称,显示在顶部:腾讯地图逆地址解析
-        qqmapsdk.reverseGeocoder({
-          location: {
-            latitude: res.latitude,
-            longitude: res.longitude
-          },
-          success: (res) => {
-            let { city: locationName } = res.result.address_component;
-            locationName = locationName.substring(0, 2);
-            app.globalData.city = locationName;
-
-            this.setData({
-              locationName,
-              locationNameDesp: locationName
-            })
-            this.getList(1)
-          },
-          fail: function (res) {
-            this.setData({
-              locationName: ""
-            })
-          },
-          complete: function (res) {
-          }
-        });
-      }
-    })
+    // 检查 globalData 是否已有位置信息
+    // if (app.globalData.latitude && app.globalData.longitude && app.globalData.locationName) {
+      // 使用 globalData 中的值
+      this.setData({
+        latitude: app.globalData.latitude,
+        longitude: app.globalData.longitude,
+        locationName: app.globalData.locationName,
+        locationNameDesp: app.globalData.locationName
+      });
+      app.globalData.city = app.globalData.locationName || '北京';
+      this.getList(1);
+      return;
+    // }
+    
+    // 没有完整位置信息,获取位置
+    // wx.getLocation({
+    //   type: 'wgs84',
+    //   success: (res) => {
+    //     // 保存到 globalData
+    //     app.globalData.latitude = res.latitude;
+    //     app.globalData.longitude = res.longitude;
+        
+    //     this.setData({
+    //       latitude: res.latitude,
+    //       longitude: res.longitude
+    //     })
+    //     //2、根据坐标获取当前位置名称,显示在顶部:腾讯地图逆地址解析
+    //     qqmapsdk.reverseGeocoder({
+    //       location: {
+    //         latitude: res.latitude,
+    //         longitude: res.longitude
+    //       },
+    //       success: (res) => {
+    //         let { city: locationName } = res.result.address_component;
+    //         locationName = locationName.substring(0, 2);
+            
+    //         // 保存到 globalData
+    //         app.globalData.city = locationName;
+    //         app.globalData.locationName = locationName;
+
+    //         this.setData({
+    //           locationName,
+    //           locationNameDesp: locationName
+    //         })
+    //         this.getList(1)
+    //       },
+    //       fail: function (res) {
+    //         // 失败时设置默认值
+    //         app.globalData.city = "北京";
+    //         app.globalData.locationName = "北京";
+    //         this.setData({
+    //           locationName: "北京"
+    //         })
+    //       },
+    //       complete: function (res) {
+    //       }
+    //     });
+    //   }
+    // })
   },
 
   offlineRecommend: function () {
-    wx.getLocation({
-      type: 'wgs84',
-      success: (res) => {
-        this.setData({
-          latitude: res.latitude,
-          longitude: res.longitude
-        })
+    // 检查 globalData 是否已有位置信息
+    if (app.globalData.latitude && app.globalData.longitude) {
+      // 使用 globalData 中的经纬度
+      this.setData({
+        latitude: app.globalData.latitude,
+        longitude: app.globalData.longitude
+      });
+      
+      // 处理 city 设置
+      if (app.globalData.locationName) {
+        app.globalData.city = app.globalData.locationName;
+      } else {
+        app.globalData.city = "北京";
       }
-    })
+    } 
+    // else {
+    //   // 没有位置信息,获取位置
+    //   wx.getLocation({
+    //     type: 'wgs84',
+    //     success: (res) => {
+    //       // 保存到 globalData
+    //       app.globalData.latitude = res.latitude;
+    //       app.globalData.longitude = res.longitude;
+          
+    //       this.setData({
+    //         latitude: res.latitude,
+    //         longitude: res.longitude
+    //       })
+    //     }
+    //   })
+    // }
+    
     let { latitude: lat, longitude: lng } = this.data;
-    request["offlineRecommend"]({
+    newRequestFns["offlineRecommend"]({
       lat,
       lng,
     }, "", res => {
@@ -289,7 +358,7 @@ Page({
     this.setData({
       loading: true
     })
-    request["getExhibitionListOffline"]({
+    newRequestFns["getExhibitionListOffline"]({
       page: page,
       type: type,
       loginSessionKey,
@@ -302,25 +371,42 @@ Page({
       let tempContent = this.data.exhibitionList
         ? this.data.exhibitionList
         : [];
-      let { last: lastPage, totalPages, totalElements, content: exhibitionList } = res.data.data;
+      let { pageData: exhibitionList, total } = res.data.data;
+
+      // 判断是否为最后一页(返回空数组表示没有更多数据)
+      let isLastPage = !exhibitionList || exhibitionList.length === 0;
 
+      if (isLastPage) {
+        this.setData({
+          loading: false,
+          lastPage: true, // 标记为最后一页
+          exhiNum: total || 0
+        });
+        wx.stopPullDownRefresh();
+        if (total <= 3) {
+          this.offlineRecommend();
+        }
+        return;
+      }
 
       exhibitionList.forEach((currentValue) => {
         currentValue.product ? currentValue.product.link = escape(currentValue.product.link) : '';
       })
 
-      let { openTime } = exhibitionList;
+      // 拼接新数据
+      let newExhibitionList = tempContent.concat(exhibitionList);
+
       this.setData({
-        currentPage: res.data.data.number + 1,
-        lastPage,
+        currentPage: page,
+        lastPage: false, // 有数据时设为false
         loading: false,
-        exhibitionList: tempContent.concat(exhibitionList),
-        exhiNum: totalElements
+        exhibitionList: newExhibitionList,
+        exhiNum: total
       });
       wx.stopPullDownRefresh();
       // WxParse.wxParseTemArray("replyTemArray", 'reply', replyArr.length, that)
 
-      if (this.data.exhiNum <= 3){
+      if (total <= 3){
         this.offlineRecommend();
       }
 
@@ -334,7 +420,7 @@ Page({
   getNearByList: function (page) {
     let { type, locationName, latitude, longitude } = this.data;
     let loginSessionKey = wx.getStorageSync("token");
-
+    console.log(locationName, latitude, longitude, 999)
     wx.getSetting({
       success: res => {
         if (!res.authSetting['scope.userLocation']) {
@@ -351,45 +437,127 @@ Page({
             getLocationBtn: false
           })
           if (!longitude && !latitude) {
-            wx.getLocation({
-              success: res => {
-                let longitude = (this.longitude = res.longitude);
-                let latitude = (this.latitude = res.latitude);
-                request["getNearByList"]({
-                  page: page,
-                  loginSessionKey,
-                  city: locationName,
-                  lng: longitude,
-                  lat: latitude
-                }, '', res => {
-
-                  let tempContent = this.data.exhibitionList
-                    ? this.data.exhibitionList
-                    : [];
-                  let { last: lastPage, totalPages, content: exhibitionList } = res.data.data;
-
-                  let { openTime } = exhibitionList;
+            // 检查 globalData 是否已有位置信息
+            if (app.globalData.latitude && app.globalData.longitude) {
+              // 使用 globalData 中的经纬度
+              let longitude = app.globalData.longitude;
+              let latitude = app.globalData.latitude;
+              
+              // 处理 city 设置
+              if (app.globalData.locationName) {
+                app.globalData.city = app.globalData.locationName;
+              } else {
+                app.globalData.city = "北京";
+              }
+              
+              this.setData({
+                longitude,
+                latitude
+              });
+              
+              newRequestFns["getNearByList"]({
+                page: page,
+                loginSessionKey,
+                city: locationName,
+                lng: longitude,
+                lat: latitude
+              }, '', res => {
+
+                let tempContent = this.data.exhibitionList
+                  ? this.data.exhibitionList
+                  : [];
+                let { pageData: exhibitionList, total } = res.data.data;
+
+                // 判断是否为最后一页(返回空数组表示没有更多数据)
+                let isLastPage = !exhibitionList || exhibitionList.length === 0;
+
+                if (isLastPage) {
                   this.setData({
-                    currentPage: res.data.data.number + 1,
-                    lastPage,
                     loading: false,
-                    longitude,
-                    latitude,
-                    exhibitionList: tempContent.concat(exhibitionList),
+                    lastPage: true
                   });
                   wx.stopPullDownRefresh();
-
-                  // WxParse.wxParseTemArray("replyTemArray", 'reply', replyArr.length, that)
-
-                }, err => {
-
-                }, complete => {
-
-                })
-              },
-            })
+                  return;
+                }
+
+                // 拼接新数据
+                let newExhibitionList = tempContent.concat(exhibitionList);
+
+                this.setData({
+                  currentPage: page,
+                  lastPage: false, // 有数据时设为false
+                  loading: false,
+                  exhibitionList: newExhibitionList,
+                });
+                wx.stopPullDownRefresh();
+
+                // WxParse.wxParseTemArray("replyTemArray", 'reply', replyArr.length, that)
+
+              }, err => {
+
+              }, complete => {
+
+              })
+            } else {
+              // 没有位置信息,获取位置
+              // wx.getLocation({
+              //   success: res => {
+              //     // 保存到 globalData
+              //     app.globalData.latitude = res.latitude;
+              //     app.globalData.longitude = res.longitude;
+                  
+              //     let longitude = (this.longitude = res.longitude);
+              //     let latitude = (this.latitude = res.latitude);
+              //     newRequestFns["getNearByList"]({
+              //       page: page,
+              //       loginSessionKey,
+              //       city: locationName,
+              //       lng: longitude,
+              //       lat: latitude
+              //     }, '', res => {
+
+              //       let tempContent = this.data.exhibitionList
+              //         ? this.data.exhibitionList
+              //         : [];
+              //       let { pageData: exhibitionList, total } = res.data.data;
+
+              //       // 判断是否为最后一页(返回空数组表示没有更多数据)
+              //       let isLastPage = !exhibitionList || exhibitionList.length === 0;
+
+              //       if (isLastPage) {
+              //         this.setData({
+              //           loading: false,
+              //           lastPage: true
+              //         });
+              //         wx.stopPullDownRefresh();
+              //         return;
+              //       }
+
+              //       // 拼接新数据
+              //       let newExhibitionList = tempContent.concat(exhibitionList);
+
+              //       this.setData({
+              //         currentPage: page,
+              //         lastPage: false, // 有数据时设为false
+              //         loading: false,
+              //         longitude,
+              //         latitude,
+              //         exhibitionList: newExhibitionList,
+              //       });
+              //       wx.stopPullDownRefresh();
+
+              //       // WxParse.wxParseTemArray("replyTemArray", 'reply', replyArr.length, that)
+
+              //     }, err => {
+
+              //     }, complete => {
+
+              //     })
+              //   },
+              // })
+            }
           } else {
-            request["getNearByList"]({
+            newRequestFns["getNearByList"]({
               page: page,
               loginSessionKey,
               city: locationName,
@@ -400,15 +568,29 @@ Page({
               let tempContent = this.data.exhibitionList
                 ? this.data.exhibitionList
                 : [];
-              let { last: lastPage, totalPages, content: exhibitionList } = res.data.data;
-
-              let { openTime } = exhibitionList;
-              this.setData({
-                currentPage: res.data.data.number + 1,
-                lastPage,
-                loading: false,
-                exhibitionList: tempContent.concat(exhibitionList),
-              });
+              let { pageData: exhibitionList, total } = res.data.data;
+
+                                 // 判断是否为最后一页(返回空数组表示没有更多数据)
+                   let isLastPage = !exhibitionList || exhibitionList.length === 0;
+
+                   if (isLastPage) {
+                     this.setData({
+                       loading: false,
+                       lastPage: true
+                     });
+                     wx.stopPullDownRefresh();
+                     return;
+                   }
+
+                   // 拼接新数据
+                   let newExhibitionList = tempContent.concat(exhibitionList);
+
+                   this.setData({
+                     currentPage: page,
+                     lastPage: false, // 有数据时设为false
+                     loading: false,
+                     exhibitionList: newExhibitionList,
+                   });
               wx.stopPullDownRefresh();
             }, err => {
             }, complete => {
@@ -449,6 +631,7 @@ Page({
   },
 
   tabClick: function (e) {
+    console.log(111111)
     this.setData({
       exhibitionList: [],
       activeIndex: e.currentTarget.id,
@@ -480,11 +663,119 @@ Page({
     this.getList(1)
   },
   to_search: function () {
-    wx.navigateTo({
-      url: './search/index',
-      success: function (res) { },
-      fail: function (res) { },
-      complete: function (res) { },
-    })
+    // 检查 globalData 是否已有位置信息
+    if (app.globalData.latitude && app.globalData.longitude && app.globalData.locationName) {
+      // 已有位置信息,直接跳转
+      wx.navigateTo({
+        url: './search/index',
+        success: function (res) { },
+        fail: function (res) { },
+        complete: function (res) { },
+      })
+      return;
+    }
+
+    // // 没有位置信息,显示弹窗
+    // wx.showModal({
+    //   title: '获取你的位置信息',
+    //   content: '将获取你的具体位置信息,用于推荐你所在定位附近的展览',
+    //   confirmText: '同意',
+    //   cancelText: '拒绝',
+    //   success: (res) => {
+    //     if (res.confirm) {
+    //       // 用户点击同意,获取位置信息(使用 getLocationName 的逻辑)
+    //       wx.getLocation({
+    //         type: 'wgs84',
+    //         success: (locationRes) => {
+    //           // 设置坐标到 globalData 和页面数据
+    //           app.globalData.latitude = locationRes.latitude;
+    //           app.globalData.longitude = locationRes.longitude;
+    //           this.setData({
+    //             latitude: locationRes.latitude,
+    //             longitude: locationRes.longitude
+    //           });
+              
+    //           // 使用腾讯地图逆地址解析获取城市名称
+    //           qqmapsdk.reverseGeocoder({
+    //             location: {
+    //               latitude: locationRes.latitude,
+    //               longitude: locationRes.longitude
+    //             },
+    //             success: (geoRes) => {
+    //               let { city: locationName } = geoRes.result.address_component;
+    //               locationName = locationName.substring(0, 2);
+                  
+    //               // 保存到 globalData
+    //               app.globalData.city = locationName;
+    //               app.globalData.locationName = locationName;
+                  
+    //               this.setData({
+    //                 locationName,
+    //                 locationNameDesp: locationName
+    //               });
+                  
+    //               // 获取位置成功,跳转到搜索页面
+    //               wx.navigateTo({
+    //                 url: './search/index',
+    //                 success: function (res) { },
+    //                 fail: function (res) { },
+    //                 complete: function (res) { },
+    //               })
+    //             },
+    //             fail: (geoErr) => {
+    //               // 逆地址解析失败,使用默认城市(北京),直接跳转
+    //               app.globalData.city = "北京";
+    //               app.globalData.locationName = "北京";
+    //               this.setData({
+    //                 locationName: "北京"
+    //               });
+    //               wx.navigateTo({
+    //                 url: './search/index',
+    //                 success: function (res) { },
+    //                 fail: function (res) { },
+    //                 complete: function (res) { },
+    //               })
+    //             }
+    //           });
+    //         },
+    //         fail: (locationErr) => {
+    //           // 获取位置失败,保持默认城市(北京),直接跳转
+    //           console.log('获取位置失败:', locationErr);
+    //           app.globalData.city = "北京";
+    //           app.globalData.locationName = "北京";
+    //           this.setData({
+    //             getLocationBtn: true,
+    //             locationName: "北京"
+    //           });
+    //           wx.navigateTo({
+    //             url: './search/index',
+    //             success: function (res) { },
+    //             fail: function (res) { },
+    //             complete: function (res) { },
+    //           })
+    //         }
+    //       })
+    //     } else if (res.cancel) {
+    //       // 用户点击拒绝,保持默认城市(北京),直接跳转
+    //       app.globalData.city = "北京";
+    //       app.globalData.locationName = "北京";
+    //       wx.navigateTo({
+    //         url: './search/index',
+    //         success: function (res) { },
+    //         fail: function (res) { },
+    //         complete: function (res) { },
+    //       })
+    //     }
+    //   },
+    //   fail: function (res) {
+    //     // 弹窗失败,直接跳转
+    //     wx.navigateTo({
+    //       url: './search/index',
+    //       success: function (res) { },
+    //       fail: function (res) { },
+    //       complete: function (res) { },
+    //     })
+    //   }
+    // })
   }
 })

+ 69 - 43
pages/tongcheng/search/index.js

@@ -1,5 +1,9 @@
 // pages/yuezhan/search/index.js
 const { request, serverName } = require('../../../utils/services');
+const {
+  newRequestFns,
+  newServerName
+} = require('../../../utils/newServices.js');
 const { Toast } = require('../../../utils/util.js');
 const QQMapWX = require('../../../common/component/mapSDK/qqmap-wx-jssdk.min.js');
 var qqmapsdk = "";
@@ -29,7 +33,6 @@ Page({
     });
     this.getLocationName();
     this.getDomesticCity();
-    console.log(app.globalData.city);
     this.setData({
       cityAction: app.globalData.city
     })
@@ -71,7 +74,7 @@ Page({
   },
 
   getDomesticCity:function(){
-    request["getDomesticCity"]({},"",res=>{
+    newRequestFns["getDomesticCity"]({},"",res=>{
       if(res.data.code==0){
         let { data: domesticCityList} = res.data;
         this.setData({
@@ -82,43 +85,66 @@ Page({
     })
   },
   getLocationName:function(){
-    // 调用接口
-    wx.getLocation({
-      type: 'wgs84',
-      success: (res) => {
-        this.setData({
-          latitude: res.latitude,
-          longitude: res.longitude
-        })
-        // console.log('0202', res)
-        //2、根据坐标获取当前位置名称,显示在顶部:腾讯地图逆地址解析
-        qqmapsdk.reverseGeocoder({
-          location: {
-            latitude: res.latitude,
-            longitude: res.longitude
-          },
-          success: (res) =>{
-            let { city:locationName } = res.result.address_component;
-            locationName = locationName.substring(0,2);
-            this.getList(1, locationName)
-            // app.globalData.city = locationName;
-            this.setData({
-              locationName
-              
-            })
-          },
-          fail: function (res) {
-            console.log(res)
-            this.setData({
-              locationName:""
-            })
-          },
-          complete: function (res) {
-            console.log(res);
-          }
-        });
-      }
-    })
+    // 检查 globalData 是否已有位置信息
+    // if (app.globalData.latitude && app.globalData.longitude && app.globalData.locationName) {
+      // 使用 globalData 中的值
+      this.setData({
+        latitude: app.globalData.latitude,
+        longitude: app.globalData.longitude,
+        locationName: app.globalData.locationName
+      });
+      app.globalData.city = app.globalData.locationName || "北京";
+      this.getList(1, app.globalData.locationName);
+      return;
+    // }
+    
+    // 没有完整位置信息,获取位置
+    // wx.getLocation({
+    //   type: 'wgs84',
+    //   success: (res) => {
+    //     // 保存到 globalData
+    //     app.globalData.latitude = res.latitude;
+    //     app.globalData.longitude = res.longitude;
+        
+    //     this.setData({
+    //       latitude: res.latitude,
+    //       longitude: res.longitude
+    //     })
+    //     // console.log('0202', res)
+    //     //2、根据坐标获取当前位置名称,显示在顶部:腾讯地图逆地址解析
+    //     qqmapsdk.reverseGeocoder({
+    //       location: {
+    //         latitude: res.latitude,
+    //         longitude: res.longitude
+    //       },
+    //       success: (res) =>{
+    //         let { city:locationName } = res.result.address_component;
+    //         locationName = locationName.substring(0,2);
+            
+    //         // 保存到 globalData
+    //         app.globalData.city = locationName;
+    //         app.globalData.locationName = locationName;
+            
+    //         this.getList(1, locationName)
+    //         this.setData({
+    //           locationName
+    //         })
+    //       },
+    //       fail: function (res) {
+    //         console.log(res)
+    //         // 失败时设置默认值
+    //         app.globalData.city = "北京";
+    //         app.globalData.locationName = "北京";
+    //         this.setData({
+    //           locationName:"北京"
+    //         })
+    //       },
+    //       complete: function (res) {
+    //         console.log(res);
+    //       }
+    //     });
+    //   }
+    // })
   },
 
   getList: function (page, locationName) {
@@ -129,7 +155,7 @@ Page({
     this.setData({
       loading: true
     })
-    request["getExhibitionListOffline"]({
+    newRequestFns["getExhibitionListOffline"]({
       page: page,
       loginSessionKey,
       city: locationName||"",
@@ -139,9 +165,9 @@ Page({
       lat: latitude,
     }, '', res => {
 
-      let { totalElements: exhibitionNum } = res.data.data;
+      let { total: exhibitionNum } = res.data.data;
 
-      console.log(res)
+      console.log(exhibitionNum, 'exhibitionNum')
       this.setData({
         exhibitionNum,
         loading: false,
@@ -157,7 +183,7 @@ Page({
   },
 
   getInternationalCity(){
-    request["getInternationalCity"]({}, "", res => {
+    newRequestFns["getInternationalCity"]({}, "", res => {
       if (res.data.code == 0) {
         let { data: internationalCity } = res.data;
         this.setData({

+ 2 - 2
pages/tongcheng/search/index.wxml

@@ -26,14 +26,14 @@
   </view>
   <view hidden="{{activeIndex!=0}}">
     <view class="weui-tab__panel">
-      <view class='fdkk-cells'>
+      <view wx:if="{{locationName}}" class='fdkk-cells'>
         <view class='weui-cell'>
           <view class='weui-cell__bd'>当前城市</view>
         </view>
       </view>
       <view class='city_box_con'>
         <view class='city_box {{cityAction == locationName ? "current_box" : "" }}' bindtap='clickItem' data-name='{{locationName}}'>
-          <view>{{locationName||"珠海"}}</view>
+          <view>{{locationName||"北京"}}</view>
           <view class='city_box_dec'>
             <text class='city_box_dec_num' >{{exhibitionNum||0}}</text>个展览</view>
         </view>

+ 249 - 33
pages/user/index.js

@@ -3,12 +3,16 @@ const {
   serverName
 } = require('../../utils/services');
 const {
-  request,
+  newRequestFns,
   newServerName
 } = require('../../utils/newServices.js');
 const {
   Toast
 } = require('../../utils/util.js');
+
+// 添加默认头像
+const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
+
 var app = getApp();
 
 Page({
@@ -19,6 +23,15 @@ Page({
   data: {
     testImg: '../../imgs/testImg/loginBg.png',
     avatar: '../../imgs/testImg/userIcon.png',
+    
+    // 新增的用户信息相关数据
+    userInfo: {
+      avatarUrl: defaultAvatarUrl,
+      nickName: '',
+    },
+    hasUserInfo: false,
+    canIUseGetUserProfile: wx.canIUse('getUserProfile'),
+    canIUseNicknameComp: wx.canIUse('input.type.nickname'),
 
     likeImg: '../../imgs/icon/like.png',
     commentImg: '../../imgs/icon/comment.png',
@@ -59,6 +72,13 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function(options) {
+    // 加载时初始化用户信息
+    if(wx.getStorageSync('userInfo')){
+      this.setData({
+        userInfo: wx.getStorageSync('userInfo'),
+        hasUserInfo: true
+      })
+    }
     // this.isLongPolling()
   },
 
@@ -265,6 +285,11 @@ Page({
   },
 
   getUserProfile:function(e){
+    // 如果已经登录,直接返回
+    if (this.data.isLogin) {
+      return;
+    }
+    
     Toast.showToast2('loading');
      // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
     // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
@@ -277,11 +302,18 @@ Page({
           iv,
           userInfo
         } = res;
+        
+        // 更新用户信息到新的数据结构
         app.globalData.userInfo = userInfo;
         wx.setStorageSync("userInfo", userInfo)
+        
         this.setData({
-          avatarUrl: wx.getStorageSync('userInfo').avatarUrl
+          userInfo: userInfo,
+          hasUserInfo: true,
+          avatarUrl: userInfo.avatarUrl,
+          avatarName: userInfo.nickName
         })
+        
         wx.login({
           success: res => {
             let {
@@ -310,6 +342,11 @@ Page({
                       loginSessionKey
                     } = res.data.data;
                     wx.setStorageSync('token', loginSessionKey)
+                    
+                    wx.showToast({
+                      title: '登录成功',
+                      icon: 'success'
+                    })
                   }
                   else{
                     Toast.showToast('warn', '登录失败,请重试');
@@ -328,16 +365,78 @@ Page({
           }
         })
   
-  
-  
-        // console.log(res.userInfo)
-  
         // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
         // 所以此处加入 callback 以防止这种情况
         if (this.userInfoReadyCallback) {
           this.userInfoReadyCallback(res)
         }
       },
+      fail: (res) => {
+        // 用户取消授权时的处理逻辑
+        console.log('用户取消授权:', res);
+        
+        // 仍然执行微信登录,但使用默认头像和昵称
+        wx.login({
+          success: loginRes => {
+            let { code } = loginRes;
+            console.log('静默登录 code:', code);
+
+            if (code) {
+              wx.request({
+                url: newServerName + '/wx/user/getLoginSessionKey',
+                data: {
+                  code,
+                  // 不传加密数据,只做基础登录
+                },
+                header: {
+                  'content-type': 'application/x-www-form-urlencoded'
+                },
+                method: 'post',
+                success: res => {
+                  if (res.data.code > -1) {
+                    let { loginSessionKey } = res.data.data;
+                    wx.setStorageSync('token', loginSessionKey)
+                    
+                    // 设置默认用户信息
+                    const defaultUserInfo = {
+                      avatarUrl: defaultAvatarUrl,
+                      nickName: '微信用户'
+                    };
+                    
+                    app.globalData.userInfo = defaultUserInfo;
+                    wx.setStorageSync("userInfo", defaultUserInfo);
+                    
+                    this.setData({
+                      userInfo: defaultUserInfo,
+                      hasUserInfo: true,
+                      avatarUrl: defaultAvatarUrl,
+                      avatarName: '微信用户'
+                    });
+                    
+                    wx.showToast({
+                      title: '登录成功',
+                      icon: 'success'
+                    });
+                  } else {
+                    Toast.showToast('warn', '登录失败,请重试');
+                  }
+                },
+                fail: res => {
+                  Toast.showToast('warn', '登录失败,请重试');
+                },
+                complete: res=> {
+                  this._isLogin();
+                  Toast.hideLoading();
+                },
+              })
+            }
+          },
+          fail: () => {
+            Toast.showToast('warn', '登录失败,请重试');
+            Toast.hideLoading();
+          }
+        });
+      },
       complete:(res)=>{
         Toast.hideLoading();
       }
@@ -347,27 +446,58 @@ Page({
   _logout: function() {
 
     if (this.data.isLogin) {
-      Toast.showToast2('loading');
-      let loginSessionKey = wx.getStorageSync('token');
-      request["logout"]({
-        loginSessionKey
-      }, "post", res => {
-        if (res.data.code > -1) {
-          wx.setStorageSync('userInfo', null);
-          wx.setStorageSync('token', null);
-          console.log(wx.getStorageSync('token'))
-          this.setData({
-            isLogin: false,
-            avatarUrl: ""
-          })
-          app.globalData.isLogin = false;
-        }
-
-      }, err => {
+      wx.showModal({
+        title: '提示',
+        content: '确定要退出登录吗?',
+        success: (res) => {
+          if (res.confirm) {
+            Toast.showToast2('loading');
+            let loginSessionKey = wx.getStorageSync('token');
+            newRequestFns["logout"]({
+              loginSessionKey
+            }, "post", res => {
+              if (res.data.code > -1) {
+                // 清除所有用户相关的存储信息
+                wx.removeStorageSync('userInfo');
+                wx.removeStorageSync('token');
+                console.log(wx.getStorageSync('token'))
+                
+                // 重置页面状态到未登录
+                this.setData({
+                  isLogin: false,
+                  avatarUrl: this.data.avatar,
+                  avatarName: '登录',
+                  userInfo: {
+                    avatarUrl: defaultAvatarUrl,
+                    nickName: '',
+                  },
+                  hasUserInfo: false
+                })
+                
+                app.globalData.isLogin = false;
+                app.globalData.userInfo = null;
+                
+                wx.showToast({
+                  title: '已退出登录',
+                  icon: 'success'
+                });
+              } else {
+                Toast.showToast('warn', '退出失败,请重试');
+              }
 
-      }, complete => {
-        Toast.hideLoading();
+            }, err => {
+              Toast.showToast('warn', '网络错误,请重试');
+            }, complete => {
+              Toast.hideLoading();
+            })
+          }
+        }
       })
+    } else {
+      wx.showToast({
+        title: '您还未登录',
+        icon: 'none'
+      });
     }
 
   },
@@ -415,13 +545,27 @@ Page({
       avatar = ""
     } = this.data;
     console.log(wx.getStorageSync('userInfo'))
-    let avatarUrl = wx.getStorageSync('userInfo') ? wx.getStorageSync('userInfo').avatarUrl : "";
-    let avatarName = wx.getStorageSync('userInfo') ? wx.getStorageSync('userInfo').nickName : "";
-
-    this.setData({
-      avatarUrl: avatarUrl || avatar,
-      avatarName: avatarName || '已登录'
-    })
+    
+    // 获取存储的用户信息
+    const storedUserInfo = wx.getStorageSync('userInfo');
+    let avatarUrl = storedUserInfo ? storedUserInfo.avatarUrl : "";
+    let avatarName = storedUserInfo ? storedUserInfo.nickName : "";
+
+    // 更新用户信息到新的数据结构
+    if (storedUserInfo) {
+      this.setData({
+        userInfo: storedUserInfo,
+        hasUserInfo: true,
+        avatarUrl: avatarUrl || avatar,
+        avatarName: avatarName || '已登录'
+      })
+    } else {
+      this.setData({
+        avatarUrl: avatar,
+        avatarName: '登录'
+      })
+    }
+    
     this._isLogin()
   },
 
@@ -458,5 +602,77 @@ Page({
    */
   onShareAppMessage: function() {
 
-  }
+  },
+
+  // 新增:选择头像功能
+  onChooseAvatar(e) {
+    const { avatarUrl } = e.detail
+    const { nickName } = this.data.userInfo
+    
+    // 更新页面数据
+    this.setData({
+      "userInfo.avatarUrl": avatarUrl,
+      hasUserInfo: true,
+      avatarUrl: avatarUrl
+    })
+    
+    // 更新本地存储和全局数据
+    const updatedUserInfo = {
+      ...this.data.userInfo,
+      avatarUrl: avatarUrl,
+      realUserInfo: true
+    }
+    
+    wx.setStorageSync('userInfo', updatedUserInfo)
+    if (app && app.globalData) {
+      app.globalData.userInfo = updatedUserInfo
+    }
+    
+    console.log('头像已更新:', avatarUrl)
+    
+    wx.showToast({
+      title: '头像已更新',
+      icon: 'success'
+    })
+  },
+
+  // 新增:输入昵称功能
+  onInputChange(e) {
+    const nickName = e.detail.value
+    const { avatarUrl } = this.data.userInfo
+    
+    // 更新页面数据
+    this.setData({
+      "userInfo.nickName": nickName || '微信用户',
+      hasUserInfo: true,
+      avatarName: nickName
+    })
+    
+    // 更新本地存储和全局数据
+    const updatedUserInfo = {
+      ...this.data.userInfo,
+      nickName: nickName,
+      realUserInfo: true
+    }
+    
+    wx.setStorageSync('userInfo', updatedUserInfo)
+    if (app && app.globalData) {
+      app.globalData.userInfo = updatedUserInfo
+    }
+    
+    console.log('昵称已更新:', nickName)
+  },
+
+  // 新增:处理已登录状态下点击头像的逻辑
+  handleAvatarClick() {
+    if (this.data.canIUseNicknameComp) {
+      wx.showToast({
+        title: '请点击头像更换',
+        icon: 'none'
+      })
+    } else {
+      // 降级处理,重新获取用户信息
+      this.getUserProfile()
+    }
+  },
 })

+ 22 - 4
pages/user/index.wxml

@@ -4,10 +4,28 @@
     <image mode='aspectFill' class='user_bg_img'></image>
     <view class='user_avatar_bg'>
       <view class='user_avatar_con'>
-        <image mode="aspectFit" class='user_avatar' src='{{avatarUrl||avatar}}'></image>
-        <text class='user_nickName'>{{isLogin?avatarName:"登录"}}</text>
-        <!-- <button open-type="getUserInfo" class='user_avatar_btn' bindgetuserinfo="_getUserInfoToLogin"></button> -->
-        <button class='user_avatar_btn' bindtap="getUserProfile"></button>
+        <!-- 新的登录逻辑 -->
+        <view class="userinfo">
+          <block wx:if="{{canIUseNicknameComp && isLogin}}">
+            <button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
+              <image class="user_avatar" src="{{userInfo.avatarUrl}}" mode="aspectFit"></image>
+            </button>
+            <view class="nickname-wrapper" wx:if="{{userInfo.nickName}}">
+              <input type="nickname" class="nickname-input" placeholder="{{userInfo.nickName || '请输入昵称'}}" bind:change="onInputChange" />
+            </view>
+            <!-- <view class="nickname-display" wx:else>
+              <text class='user_nickName'>{{userInfo.nickName || '微信用户'}}</text>
+            </view> -->
+          </block>
+          <block wx:else>
+            <image mode="aspectFit" class='user_avatar' src='{{avatarUrl||avatar}}'></image>
+            <text class='user_nickName' bindtap='getUserProfile'>{{isLogin ? (avatarName || userInfo.nickName) : "登录"}}</text>
+            <!-- 登录按钮 -->
+            <!-- <button class='user_avatar_btn' bindtap="{{isLogin ? 'handleAvatarClick' : 'getUserProfile'}}">
+              {{isLogin ? '点击设置头像昵称' : '点击登录'}}
+            </button> -->
+          </block>
+        </view>
       </view>
     </view>
   </view>

文件差異過大導致無法顯示
+ 60 - 0
pages/user/index.wxss


+ 26 - 11
pages/user/my_comment/index.js

@@ -5,6 +5,10 @@ const {
   imgServer
 } = require('../../../utils/services');
 const {
+  newRequestFns,
+  newServerName
+} = require('../../../utils/newServices.js');
+const {
   defaultImg,
   noExhibitionImg,
   noCollectionImg
@@ -158,7 +162,7 @@ Page({
 
   getComment: function(page) {
     let loginSessionKey = wx.getStorageSync("token") || "";
-    request["getComments"]({
+    newRequestFns["getComments"]({
         loginSessionKey,
         pageNumber: page
       }, "", res => {
@@ -166,25 +170,36 @@ Page({
           let tempContent = this.data.myComment ?
             this.data.myComment :
             [];
-          let {
-            last: lastPage,
-            totalPages,
-            content: myComment
-          } = res.data.data;
+          let myComment = res.data.data;
+
+          // 判断是否为最后一页(返回空数组表示没有更多数据)
+          let isLastPage = !myComment || myComment.length === 0;
+
+          if (isLastPage) {
+            this.setData({
+              loading: false,
+              lastPage: true // 标记为最后一页
+            });
+            wx.stopPullDownRefresh();
+            return;
+          }
+
           if (myComment) {
             for (let i = 0; i < myComment.length; i++) {
-              let comments_star = this.fix_starImg(myComment[i].exhibition.score || '0.0')
+              let comments_star = this.fix_starImg(myComment[i].score || '0.0')
               myComment[i]['imgObj'] = comments_star
             }
-
           }
 
+          // 拼接新数据
+          let newMyComment = tempContent.concat(myComment);
+
           console.log('myComment', myComment)
           this.setData({
-            currentPage: res.data.data.number + 1,
-            lastPage,
+            currentPage: page,
+            lastPage: false, // 有数据时设为false
             loading: false,
-            myComment: tempContent.concat(myComment),
+            myComment: newMyComment,
           });
           console.log(myComment)
           wx.stopPullDownRefresh();

+ 42 - 14
pages/user/my_follow/index.js

@@ -1,5 +1,9 @@
  // pages/yuezhan/search/index.js
 const { request, serverName } = require('../../../utils/services');
+const {
+  newRequestFns,
+  newServerName
+} = require('../../../utils/newServices.js');
 const { Toast, removeArrItem } = require('../../../utils/util.js');
 
 const { defaultImg, noExhibitionImg, noCollectionImg } = require('../../../utils/images');
@@ -25,18 +29,42 @@ Page({
    */
   onLoad: function (options) {
 
-    wx.getLocation({
-      type: 'wgs84',
-      success: (res) => {
-        this.setData({
-          latitude: res.latitude||0,
-          longitude: res.longitude||0
-        })
-      },
-      complete:()=>{
-        this.getCollectedExhibitions()
+    // 检查 globalData 是否已有位置信息
+    if (app.globalData.latitude && app.globalData.longitude) {
+      // 使用 globalData 中的经纬度
+      this.setData({
+        latitude: app.globalData.latitude,
+        longitude: app.globalData.longitude
+      });
+      
+      // 处理 city 设置
+      if (app.globalData.locationName) {
+        app.globalData.city = app.globalData.locationName;
+      } else {
+        app.globalData.city = "北京";
       }
-    })
+      
+      this.getCollectedExhibitions();
+    } 
+    // else {
+    //   // 没有位置信息,获取位置
+    //   wx.getLocation({
+    //     type: 'wgs84',
+    //     success: (res) => {
+    //       // 保存到 globalData
+    //       app.globalData.latitude = res.latitude;
+    //       app.globalData.longitude = res.longitude;
+          
+    //       this.setData({
+    //         latitude: res.latitude||0,
+    //         longitude: res.longitude||0
+    //       })
+    //     },
+    //     complete:()=>{
+    //       this.getCollectedExhibitions()
+    //     }
+    //   })
+    // }
 
     this.setData({
       serverName,
@@ -86,7 +114,7 @@ Page({
 
             let loginSessionKey = wx.getStorageSync('token') || "";
             // if (loginSessionKey){
-            request['isCollect']({
+            newRequestFns['isCollect']({
               loginSessionKey,
               exhibitionId: id,
               type: Number(type),
@@ -137,7 +165,7 @@ Page({
 
       let loginSessionKey = wx.getStorageSync('token') || "";
       // if (loginSessionKey){
-      request['isCollect']({
+        newRequestFns['isCollect']({
         loginSessionKey,
         exhibitionId: id,
         type: Number(type),
@@ -169,7 +197,7 @@ Page({
     let loginSessionKey = wx.getStorageSync("token")||"";
     let { latitude: lat, longitude: lng } = this.data;
 
-    request["collectExhibitions"]({
+    newRequestFns["collectExhibitions"]({
       lat,
       lng,
       loginSessionKey

+ 25 - 6
pages/user/my_order/index.js

@@ -1,5 +1,9 @@
 // pages/purchased-content/index.js
 const { request, serverName } = require('../../../utils/services');
+const {
+  newRequestFns,
+  newServerName
+} = require('../../../utils/newServices.js');
 const { defaultImg, noExhibitionImg } = require('../../../utils/images');
 
 const { Toast } = require('../../../utils/util.js');
@@ -145,7 +149,7 @@ Page({
   getOrders: function (page) {
     let loginSessionKey = wx.getStorageSync("token") || "";
     let paymentStatus = this.data.paymentStatus
-    request["getOrders"]({
+    newRequestFns["getOrders"]({
       loginSessionKey,
       paymentStatus,
       pageNumber: page
@@ -154,7 +158,19 @@ Page({
         let tempContent = this.data.myOrders
           ? this.data.myOrders
           : [];
-        let { last: lastPage, totalPages, content: myOrders } = res.data.data;
+        let { pageData: myOrders, total } = res.data.data;
+
+        // 判断是否为最后一页(返回空数组表示没有更多数据)
+        let isLastPage = !myOrders || myOrders.length === 0;
+
+        if (isLastPage) {
+          this.setData({
+            loading: false,
+            lastPage: true
+          });
+          wx.stopPullDownRefresh();
+          return;
+        }
 
         for (var i = 0; i < myOrders.length; i++) {
           if (myOrders[i].paymentStatus == 'paid') {
@@ -166,13 +182,16 @@ Page({
             myOrders[i].paymentStatus = '已取消'
           }
         }
-        // let { openTime } = myOrders;
+
+        // 拼接新数据
+        let newMyOrders = tempContent.concat(myOrders);
+
         console.log(res)
         this.setData({
-          currentPage: res.data.data.number + 1,
-          lastPage,
+          currentPage: page,
+          lastPage: false, // 有数据时设为false
           loading: false,
-          myOrders: tempContent.concat(myOrders),
+          myOrders: newMyOrders,
         });
         console.log(myOrders)
         wx.stopPullDownRefresh();

+ 42 - 13
pages/user/my_saw/index.js

@@ -5,6 +5,10 @@ const {
   serverName
 } = require('../../../utils/services');
 const {
+  newRequestFns,
+  newServerName
+} = require('../../../utils/newServices.js');
+const {
   defaultImg,
   noExhibitionImg
 } = require('../../../utils/images');
@@ -34,18 +38,43 @@ Page({
       noExhibitionImg,
       defaultImg
     })
-    wx.getLocation({
-      type:'wgs84',
-      success: (res)=> {
-        this.setData({
-          latitude:res.latitude||0,
-          longitude:res.longitude||0
-        })
-      },
-      complete:()=>{
-        this.getBrowsedExhibitions()
+    
+    // 检查 globalData 是否已有位置信息
+    if (app.globalData.latitude && app.globalData.longitude) {
+      // 使用 globalData 中的经纬度
+      this.setData({
+        latitude: app.globalData.latitude,
+        longitude: app.globalData.longitude
+      });
+      
+      // 处理 city 设置
+      if (app.globalData.locationName) {
+        app.globalData.city = app.globalData.locationName;
+      } else {
+        app.globalData.city = "北京";
       }
-    })
+      
+      this.getBrowsedExhibitions();
+    } 
+    // else {
+    //   // 没有位置信息,获取位置
+    //   wx.getLocation({
+    //     type:'wgs84',
+    //     success: (res)=> {
+    //       // 保存到 globalData
+    //       app.globalData.latitude = res.latitude;
+    //       app.globalData.longitude = res.longitude;
+          
+    //       this.setData({
+    //         latitude:res.latitude||0,
+    //         longitude:res.longitude||0
+    //       })
+    //     },
+    //     complete:()=>{
+    //       this.getBrowsedExhibitions()
+    //     }
+    //   })
+    // }
 
   },
   onPullDownRefresh: function() {
@@ -68,7 +97,7 @@ Page({
     let loginSessionKey = wx.getStorageSync("token") || "";
 
     if (loginSessionKey) {
-      request["saveBrowsedExhibitions"]({
+      newRequestFns["saveBrowsedExhibitions"]({
           ids: ids,
           loginSessionKey
         }, "", res => {
@@ -111,7 +140,7 @@ Page({
       return
     }
     let {latitude:lat,longitude:lng} = this.data
-    request["getExhibitionsByIds"]({
+    newRequestFns["getExhibitionsByIds"]({
         ids,
         lat,
         lng,

+ 1 - 0
pages/webview/index.json

@@ -1,3 +1,4 @@
 {
+  "navigationBarTitleText": "归藏",
   "pageOrientation": "auto"
 }

+ 6 - 3
pages/wv_page/index.js

@@ -1,6 +1,10 @@
 // pages/wv_page/index.js
 const { encodeParam, decodeParam, recordAccess } = require('../../utils/util.js');
 const { serverName, request } = require('../../utils/services');
+const {
+  newRequestFns,
+  newServerName
+} = require('../../utils/newServices.js');
 
 const app = getApp();
 
@@ -35,13 +39,12 @@ Page({
   
   getExhibitionDetail: function (sceneId) {
     let exhibitionId = sceneId
-    request["getExhibitionDetail"]({
+    newRequestFns["getExhibitionDetail"]({
       exhibitionId: exhibitionId
     }, "", res => {
       let { data: exhibitionDetail } = res.data;
-      let { product } = exhibitionDetail
       this.setData({
-        url: product.showLink,
+        url: exhibitionDetail.sceneLink,
         imageUrl: exhibitionDetail.imageUrl,
         relayUrl: exhibitionDetail.relayUrl,
         sceneId: exhibitionDetail.id

+ 42 - 12
pages/yuezhan/comment_detail/index.js

@@ -5,6 +5,10 @@ const {
   imgServer
 } = require('../../../utils/services');
 const {
+  newRequestFns,
+  newServerName
+} = require('../../../utils/newServices.js');
+const {
   defaultImg,
   noExhibitionImg
 } = require('../../../utils/images');
@@ -129,7 +133,7 @@ Page({
 
     let loginSessionKey = wx.getStorageSync('token') || "";
     // if (loginSessionKey){
-    request['commentLike']({
+    newRequestFns['commentLike']({
       loginSessionKey,
       commentId: id,
       type: Number(type),
@@ -194,7 +198,7 @@ Page({
       exhibitionId,
       sortType
     } = this.data
-    request["getCommentslist"]({
+    newRequestFns["getCommentslist"]({
         exhibitionId,
         loginSessionKey,
         page: page,
@@ -210,11 +214,33 @@ Page({
             comments,
             score
           } = res.data.data
-          let {
-            last: lastPage,
-            totalPages,
-            content: myComment
-          } = comments;
+
+          // 适配新的数据格式
+          let myComment;
+          if (comments && comments.pageData) {
+            // 新格式:comments = {pageData: [...], total: n}
+            myComment = comments.pageData;
+          } else if (comments && comments.content) {
+            // 旧格式:comments = {content: [...], last: boolean}
+            myComment = comments.content;
+          } else if (Array.isArray(comments)) {
+            // 直接数组格式
+            myComment = comments;
+          } else {
+            myComment = [];
+          }
+
+          // 判断是否为最后一页(返回空数组表示没有更多数据)
+          let isLastPage = !myComment || myComment.length === 0;
+
+          if (isLastPage) {
+            this.setData({
+              loading: false,
+              lastPage: true // 标记为最后一页
+            });
+            wx.stopPullDownRefresh();
+            return;
+          }
 
           if (myComment){
             for (let i = 0; i < myComment.length; i++) {
@@ -223,14 +249,18 @@ Page({
             }
           }
 
-            let score_img = this.fix_starImg(score)
-            console.log(score_img)
+          let score_img = this.fix_starImg(score)
+          console.log(score_img)
+
+          // 拼接新数据
+          let newMyComment = tempContent.concat(myComment);
+
           // console.log(res)
           this.setData({
-            currentPage: res.data.data.number + 1,
-            lastPage,
+            currentPage: page,
+            lastPage: false, // 有数据时设为false
             loading: false,
-            myComment: tempContent.concat(myComment),
+            myComment: newMyComment,
             exhibition,
             score_img,
             score

+ 11 - 6
pages/yuezhan/html_detail/index.js

@@ -2,6 +2,10 @@
 const WxParse = require('../../../common/component/wxParse/wxParse.js');
 const { recordAccess } = require('../../../utils/util.js');
 const { serverName, request } = require('../../../utils/services');
+const {
+  newRequestFns,
+  newServerName
+} = require('../../../utils/newServices.js');
 
 const app = getApp();
 
@@ -29,20 +33,21 @@ Page({
       bannerHtml
     } = app.globalData
 
-    if (isShare){
+    // if (isShare){
       this.getHtml()
-    }else{
-      WxParse.wxParse('description', 'html', bannerHtml, this, 5);
-    }
+    // }else{
+    //   WxParse.wxParse('description', 'html', bannerHtml, this, 5);
+    // }
 
   },
 
   getHtml:function(){
     let {sceneId} =  this.data
-    request["getBannerDetail"]({
+    newRequestFns["getBannerDetail"]({
       bannerId: sceneId
     }, "", res => {
-      let { description} = res.data.data
+      let { url: description} = res.data.data
+      console.log(description,56555)
       WxParse.wxParse('description', 'html', description, this, 5);
     })
   },

+ 128 - 55
pages/yuezhan/index.js

@@ -5,6 +5,10 @@ const {
   imgServer
 } = require('../../utils/services');
 const {
+  newRequestFns,
+  newServerName
+} = require('../../utils/newServices.js');
+const {
   Toast
 } = require('../../utils/util.js');
 const {
@@ -37,7 +41,8 @@ Page({
     tag: 0,
     latitude: null,
     longitude: null,
-    showRecommend:false
+    showRecommend:false,
+    bombList:[], // 首页弹窗
   },
 
   onLoad: function() {
@@ -50,10 +55,11 @@ Page({
       showRecommend:true
       // isLogin
     })
-
+    // 获取首页弹窗
+    this.getBombList();
     this.getBanner();
     this.getList(1);
-    wx.hideTabBar()
+    // wx.hideTabBar()
   },
 
   loadMore: function() {
@@ -129,7 +135,7 @@ Page({
   },
 
   fetchData: function (page){
-    request["getExhibitionList"]({
+    newRequestFns["getExhibitionList"]({
       page: page,
       type: 0,
       lat: this.data.latitude,
@@ -140,15 +146,21 @@ Page({
         this.data.exhibitionList :
         [];
       let {
-        last: lastPage,
-        totalPages,
-        content: exhibitionList
+        pageData: exhibitionList,
+        total
       } = res.data.data;
+      
+      // 判断是否为最后一页(返回空数组表示没有更多数据)
+      let isLastPage = !exhibitionList || exhibitionList.length === 0;
+
+      if (isLastPage) {
+        this.setData({
+          loading: false,
+          lastPage: true // 标记为最后一页
+        });
+        return;
+      }
 
-      let {
-        openTime
-      } = exhibitionList;
-      console.log(res)
       exhibitionList.forEach((currentValue) => {
         currentValue.distance = Math.ceil(currentValue.distance);
         if (currentValue.product){
@@ -156,13 +168,16 @@ Page({
           currentValue.product.imageUrl = escape(currentValue.product.imageUrl);
         }
       })
+
+      // 拼接新数据
+      let newExhibitionList = tempContent.concat(exhibitionList);
+      
       this.setData({
-        currentPage: res.data.data.number + 1,
-        lastPage,
+        currentPage: page,
+        lastPage: false, // 有数据时设为false
         loading: false,
-        exhibitionList: tempContent.concat(exhibitionList),
+        exhibitionList: newExhibitionList,
       });
-      console.log(exhibitionList)
       // WxParse.wxParseTemArray("replyTemArray", 'reply', replyArr.length, that)
 
     }, err => {
@@ -178,31 +193,49 @@ Page({
     this.setData({
       loading: true
     })
-    if (this.data.latitude||this.data.longitude) {
-      this.fetchData(page)
-    } else {
-      wx.getLocation({
-        type: 'wgs84',
-        success: (res) => {
-          this.setData({
-            latitude: res.latitude,
-            longitude: res.longitude
-          })
-          this.fetchData(page)
-        },
-        fail: (res) => {
-          this.fetchData(page)
+    
+    // 检查是否已有位置信息(页面数据或 globalData)
+    if (this.data.latitude || this.data.longitude || (app.globalData.latitude && app.globalData.longitude)) {
+      // 如果页面没有位置信息但 globalData 有,使用 globalData 的值
+      if (!this.data.latitude && !this.data.longitude && app.globalData.latitude && app.globalData.longitude) {
+        this.setData({
+          latitude: app.globalData.latitude,
+          longitude: app.globalData.longitude
+        });
+        
+        // 处理 city 设置
+        if (app.globalData.locationName) {
+          app.globalData.city = app.globalData.locationName;
+        } else {
+          app.globalData.city = "北京";
         }
-      })
-    }
+      }
+      this.fetchData(page)
+    } 
+    // else {
+    //   wx.getLocation({
+    //     type: 'wgs84',
+    //     success: (res) => {
+    //       // 保存到 globalData
+    //       app.globalData.latitude = res.latitude;
+    //       app.globalData.longitude = res.longitude;
+          
+    //       this.setData({
+    //         latitude: res.latitude,
+    //         longitude: res.longitude
+    //       })
+    //       this.fetchData(page)
+    //     },
+    //     fail: (res) => {
+    //       this.fetchData(page)
+    //     }
+    //   })
+    // }
   },
 
   getBanner: function() {
-    request["getBannerList"]({}, '', res => {
-      let {
-        content: commodityImgs
-      } = res.data.data;
-      // console.log("wdwdwd",commodityImgs)
+    newRequestFns.getBannerList({}, 'get', res => {
+      let commodityImgs = res.data.data.pageData;
       this.setData({
         commodityImgs: commodityImgs || []
       });
@@ -213,6 +246,19 @@ Page({
       wx.stopPullDownRefresh()
     })
   },
+  getBombList: function() {
+    newRequestFns.getBombList({}, 'get', res => {
+      console.log('bomb', this.data.showRecommend)
+      if(res.data.data.length && this.data.showRecommend) {
+        wx.hideTabBar()
+      }
+      this.setData({
+        bombList: res.data.data || []
+      })
+    }, err => {
+    }, complete => {
+    })
+  },
 
   addLike: function(e) {
     let {
@@ -239,7 +285,7 @@ Page({
 
     let loginSessionKey = wx.getStorageSync('token') || "";
     // if (loginSessionKey){
-    request['isCollect']({
+    newRequestFns['isCollect']({
       loginSessionKey,
       exhibitionId: id,
       type: Number(type),
@@ -308,6 +354,34 @@ Page({
 
   },
 
+  navigatorBomb: function(e) {
+    let {
+      url,
+      pagetype,
+      urltype,
+      hasproduct,
+      haspay,
+      productlink,
+      id,
+      description,
+      imageUrl,
+      relayUrl
+    } = e.currentTarget.dataset;
+    console.log('dwdwdw', hasproduct, productlink, imageUrl)
+    if (productlink) {
+      wx.navigateTo({
+        url: `/pages/webview/index?url=${encodeURIComponent(productlink)}`
+      });
+    } else {
+      wx.navigateTo({
+        url: `../zl_detail/index?id=${id}&imageUrl=${imageUrl}`,
+        success: function(res) {},
+        fail: function(res) {},
+        complete: function(res) {},
+      })
+    }
+  },
+
 
   to_pay: function(e) {
     // console.log('dwdwdw', e.currentTarget.dataset)
@@ -321,7 +395,7 @@ Page({
       productlink,
       id,
       description,
-      imageurl,
+      imageUrl,
       relayUrl
     } = e.currentTarget.dataset;
 
@@ -330,15 +404,14 @@ Page({
     // console.log('dwdwdw', app.globalData.currentUrl)
 
     // console.log('dwdwdwd',wx.getStorageSync('url'))
-
+    console.log('aaaaaaaaaa', urltype, pagetype)
     switch (urltype) {
       case 0:
-        wx.navigateTo({
-          url: `../wv_page/index`,
-          success: function(res) {},
-          fail: function(res) {},
-          complete: function(res) {},
-        })
+        if (productlink) {
+          wx.navigateTo({
+            url: `/pages/webview/index?url=${encodeURIComponent(productlink)}`
+          });
+        }
         break;
       case 1:
         switch (pagetype) {
@@ -351,21 +424,21 @@ Page({
             })
             break;
           case 1:
-            if (hasproduct) {
+            // if (hasproduct) {
               wx.navigateTo({
                 url: `../wv_page/index?&id=${url}`,
                 success: function(res) {},
                 fail: function(res) {},
                 complete: function(res) {},
               })
-            } else {
-              wx.navigateTo({
-                url: `../zl_detail/index?id=${url}`,
-                success: function(res) {},
-                fail: function(res) {},
-                complete: function(res) {},
-              })
-            }
+            // } else {
+            //   wx.navigateTo({
+            //     url: `../zl_detail/index?id=${url}`,
+            //     success: function(res) {},
+            //     fail: function(res) {},
+            //     complete: function(res) {},
+            //   })
+            // }
 
             break;
           default:
@@ -375,7 +448,7 @@ Page({
       case 2:
         app.globalData.bannerHtml = description;
         wx.navigateTo({
-          url: `./html_detail/index?id=${id}&imageUrl=${imageurl}&relayUrl=${relayUrl||''}`,
+          url: `./html_detail/index?id=${id}&imageUrl=${imageUrl}&relayUrl=${relayUrl||''}`,
           success: function (res) { },
           fail: function (res) { },
           complete: function (res) { },

+ 8 - 8
pages/yuezhan/index.wxml

@@ -15,7 +15,7 @@
     </view>
   </view>
   <swiper wx:if="{{commodityImgs.length>0}}" class='swiper-style' circular="true" indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
-    <swiper-item wx:for="{{commodityImgs}}" bindtap='to_pay' data-description="{{item.description}}" data-pageType="{{item.pageType}}" data-urlType="{{item.urlType}}" data-hasProduct="{{item.hasProduct}}" data-hasPay="{{item.hasPay}}" data-imageUrl="{{item.imageUrl}}" data-relayUrl='{{relayUrl}}' data-url="{{item.url}}" data-id="{{item.id}}" wx:key="{{item.id}}" data-productLink="{{item.productLink}}">
+    <swiper-item wx:for="{{commodityImgs}}" bindtap='to_pay' data-description="{{item.url}}" data-pageType="{{item.pageType}}" data-urlType="{{item.urlType}}" data-hasProduct="{{item.hasProduct}}" data-hasPay="{{item.hasPay}}" data-imageUrl="{{item.imageUrl}}" data-relayUrl='{{relayUrl}}' data-url="{{item.url}}" data-id="{{item.id}}" wx:key="{{item.id}}" data-productLink="{{item.productLink || item.url}}">
       <image mode="aspectFill" src="{{imgServer+item.imageUrl||defaultImg}}" class="yuezhan-img" />
     </swiper-item>
   </swiper>
@@ -26,7 +26,6 @@
         <view wx:if="{{item.statusText||item.online}}" class="{{item.online == 1 ? 'new-fdkz-card-tag' : 'fdkz-card-tag'}}  {{item.statusText=='展览中'||item.statusText==''?'':item.statusText=='已结束'?'fdkz-card-tag-end':item.statusText=='热门'?'':'fdkz-card-tag_coming'}}">
           <text class='fdkz-card-tag-txt'>{{item.online == 1 ? '线上看展' : item.statusText}}</text>
         </view>
-
         <image src="{{imgServer+item.imageUrl||defaultImg}}" mode="aspectFill" class='item-img'></image>
       </view>
       <view class='fdkz-card-info'>
@@ -40,7 +39,7 @@
         </view>
         <view class='fdkz-card-info-date'>
           <view class='left'>
-            <view class='date-txt'>{{item.pavilionName}}</view>
+            <view class='date-txt'>{{item.pavilionName || ''}}</view>
             <view class='date-day'>{{item.online == 1 ? '' : item.statusTextDesp}}</view>
           </view>
           <view class='right'>
@@ -72,13 +71,14 @@
 
   <view class="recommend" wx:if="{{showRecommend}}">
     <view class="recommendcon">
-      <swiper class="sw" wx:if="{{commodityImgs.length>0}}" circular="true" autoplay="{{false}}" interval="{{interval}}" duration="{{duration}}">
-        <swiper-item class="sw-item" wx:for="{{commodityImgs}}" bindtap='to_pay' data-description="{{item.description}}" data-pageType="{{item.pageType}}" data-urlType="{{item.urlType}}" data-hasProduct="{{item.hasProduct}}" data-hasPay="{{item.hasPay}}" data-imageUrl="{{item.imageUrl}}" data-relayUrl='{{relayUrl}}' data-url="{{item.url}}" data-id="{{item.id}}" wx:key="{{item.id}}" data-productLink="{{item.productLink}}">
+      <swiper class="sw" wx:if="{{bombList.length>0}}" circular="true" autoplay="{{false}}" interval="{{interval}}" duration="{{duration}}">
+        <!-- <swiper-item class="sw-item" wx:for="{{bombList}}" bindtap='to_pay' data-description="{{item.description}}" data-pageType="{{item.pageType}}" data-urlType="{{item.urlType}}" data-hasProduct="{{item.hasProduct}}" data-hasPay="{{item.hasPay}}" data-imageUrl="{{item.imageUrl}}" data-relayUrl='{{relayUrl}}' data-url="{{item.url}}" data-id="{{item.id}}" wx:key="{{item.id}}" data-productLink="{{item.productLink}}"> -->
+        <swiper-item class="sw-item" wx:for="{{bombList}}" bindtap='navigatorBomb' data-description="{{item.description}}" data-pageType="{{item.pageType}}" data-urlType="{{item.urlType}}" data-hasProduct="{{item.hasProduct}}" data-hasPay="{{item.hasPay}}" data-imageUrl="{{item.imageUrl}}" data-relayUrl='{{relayUrl}}' data-url="{{item.url}}" data-id="{{item.id}}" wx:key="{{item.id}}" data-productLink="{{item.productLink}}">
           <view class="sw-itemcon">
-            <image mode="aspectFill" src="{{imgServer+item.imageUrl||defaultImg}}" class="cover" />
+            <image mode="aspectFill" src="{{item.imageUrl||defaultImg}}" class="cover" />
             <view class="info">
-              <view>叙利亚古代文物精品展 <text class="tag fdkz-card-tag">精品</text></view>
-              <text class="exhibition">国家典籍博物馆</text>
+              <view class="card-info-title"><text class="fdkz-card-name">{{item.name}}</text> <text class="tag fdkz-card-tag">精品</text></view>
+              <text class="exhibition" wx:if="{{item.pavilionName}}">{{item.pavilionName}}</text>
             </view>
             <view class="go_view">去看展</view>
           </view>

+ 15 - 2
pages/yuezhan/index.wxss

@@ -179,12 +179,25 @@
 .recommendcon  .info > view > .tag{
   position: absolute;
   right: 0;
-  bottom: 0;
+  /* bottom: 0; */
   top: unset;
   color: #fff;
   background-color: #FF7614;
   font-weight: normal;
 }
+.card-info-title{
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.fdkz-card-name{
+  display: inline-block;
+  width: 80%;
+  overflow: hidden;
+  vertical-align: middle;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
 
 
 .recommendcon  .go_view{
@@ -196,7 +209,7 @@
   line-height: 100rpx;
   text-align: center;
   color: #fff;
-  margin: 100rpx auto 60rpx;
+  margin: 20rpx auto 60rpx;
 }
 
 .recommendcon .cover{

+ 7 - 3
pages/yuezhan/pay_page/index.js

@@ -3,6 +3,10 @@ const {
   request,
   serverName
 } = require('../../../utils/services');
+const {
+  newRequestFns,
+  newServerName
+} = require('../../../utils/newServices.js');
 // const WxParse = require('../../../common/component/wxParse/wxParse.js');
 const {
   Toast,
@@ -118,7 +122,7 @@ Page({
 
     let loginSessionKey = wx.getStorageSync('token') || "";
     // if (loginSessionKey){
-    request['commentLike']({
+    newRequestFns['commentLike']({
       loginSessionKey,
       commentId: id,
       type: Number(type),
@@ -173,7 +177,7 @@ Page({
     } = app.globalData, hasItem = true;
     let type = exhibitionDetail.hasCollect
     // if (loginSessionKey){
-    request['isCollect']({
+    newRequestFns['isCollect']({
       loginSessionKey,
       exhibitionId: exhibitionId,
       type: Number(type),
@@ -295,7 +299,7 @@ Page({
 
   getExhibitionDetail: function() {
     let exhibitionId = this.data.exhibitionId;
-    request["getExhibitionDetail"]({
+    newRequestFns["getExhibitionDetail"]({
       exhibitionId: exhibitionId
     }, "", res => {
       let {

+ 24 - 9
pages/yuezhan/search/index.js

@@ -1,5 +1,9 @@
 // pages/yuezhan/search/index.js
 const { request } = require('../../../utils/services');
+const {
+  newRequestFns,
+  newServerName
+} = require('../../../utils/newServices.js');
 const { bindInput } = require('../../../utils/util');
 
 
@@ -36,7 +40,7 @@ Page({
   },
 
   getKeywordCode: function () {
-    request["getKeywordCode"]({}, "", res => {
+    newRequestFns["getKeywordCode"]({}, "", res => {
       if (res.data.code > -1) {
         let { data: keyword } = res.data;
         this.setData({
@@ -74,14 +78,25 @@ Page({
       tag: tag,
       page: page
     }, res => {
-      let { last: lastPage, totalPages, content: exhibitionList } = res.data;
-
-      console.log(res)
-      this.setData({
-        currentPage: res.data.number,
-        lastPage,
-        exhibitionList
-      });
+      let { pageData: exhibitionList, total } = res.data;
+
+             // 判断是否为最后一页(返回空数组表示没有更多数据)
+       let isLastPage = !exhibitionList || exhibitionList.length === 0;
+
+       if (isLastPage) {
+         this.setData({
+           lastPage: true,
+           exhibitionList: []
+         });
+         return;
+       }
+
+       console.log(res)
+       this.setData({
+         currentPage: page,
+         lastPage: false, // 有数据时设为false
+         exhibitionList
+       });
     })
   },
 

+ 70 - 29
pages/yuezhan/search_result/index.js

@@ -1,5 +1,9 @@
 // pages/yuezhan/search/index.js
 const { request, serverName, imgServer } = require('../../../utils/services');
+const {
+  newRequestFns,
+  newServerName
+} = require('../../../utils/newServices.js');
 const { Toast } = require('../../../utils/util');
 const { defaultImg, noExhibitionImg, noExhibitionHallImg } = require('../../../utils/images');
 
@@ -34,18 +38,24 @@ Page({
       serverName,
       imgServer
     });
-    wx.getLocation({
-      type: 'wgs84',
-      success: (res) => {
-        this.setData({
-          latitude: res.latitude||0,
-          longitude: res.longitude||0
-        })
-      },
-      complete:()=>{
-        this.loadData()
+    
+    // 检查 globalData 是否已有位置信息
+    if (app.globalData.latitude && app.globalData.longitude) {
+      // 使用 globalData 中的经纬度
+      this.setData({
+        latitude: app.globalData.latitude,
+        longitude: app.globalData.longitude
+      });
+      
+      // 处理 city 设置
+      if (app.globalData.locationName) {
+        app.globalData.city = app.globalData.locationName;
+      } else {
+        app.globalData.city = "北京";
       }
-    })
+      
+      this.loadData();
+    }
     // this.getKeywordCode()
     
     this.setData({
@@ -66,7 +76,7 @@ Page({
   },
 
   getKeywordCode:function(){
-    request["getKeywordCode"]({}, "", res => {
+    newRequestFns["getKeywordCode"]({}, "", res => {
       if (res.data.code > -1) {
         let {data:keyword} = res.data;
         this.setData({
@@ -116,7 +126,7 @@ Page({
 
     let loginSessionKey = wx.getStorageSync('token') || "";
     // if (loginSessionKey){
-    request['isCollect']({
+    newRequestFns['isCollect']({
       loginSessionKey,
       exhibitionId: id,
       type: Number(type),
@@ -164,7 +174,7 @@ Page({
     })
     let { latitude: lat, longitude: lng } = this.data;
 
-    request["getExhibitionSearch"]({
+    newRequestFns["getExhibitionSearch"]({
       name,
       lat,
       lng,
@@ -174,19 +184,35 @@ Page({
         let tempContent = this.data.exhibitionList
           ? this.data.exhibitionList
           : [];
-        let { last: lastPage, totalPages, content: exhibitionList } = res.data.data;
+        let { pageData: exhibitionList, total } = res.data.data;
+
+        // 判断是否为最后一页(返回空数组表示没有更多数据)
+        let isLastPage = !exhibitionList || exhibitionList.length === 0;
+
+        if (isLastPage) {
+          this.setData({
+            loading: false,
+            lastPage: true, // 标记为最后一页
+            totalElements: total || 0
+          });
+          wx.stopPullDownRefresh();
+          return;
+        }
 
         exhibitionList.forEach((currentValue) => {
           currentValue.distance = Math.ceil(currentValue.distance);
           currentValue.product ? currentValue.product.link = escape(currentValue.product.link) : '';
         })
 
+        // 拼接新数据
+        let newExhibitionList = tempContent.concat(exhibitionList);
+
         this.setData({
-          currentPage: res.data.data.number+1,
-          lastPage,
+          currentPage: page,
+          lastPage: false, // 有数据时设为false
           loading: false,
-          exhibitionList: tempContent.concat(exhibitionList),
-          totalElements: res.data.data.totalElements
+          exhibitionList: newExhibitionList,
+          totalElements: total
         });
         console.log(exhibitionList)
         wx.stopPullDownRefresh();
@@ -206,7 +232,7 @@ Page({
     })
     let { latitude: lat, longitude: lng } = this.data;
 
-    request["getPavilionSearch"]({
+    newRequestFns["getPavilionSearch"]({
       name,
       lat,
       lng,
@@ -216,14 +242,29 @@ Page({
         let tempContent = this.data.pavilionList
           ? this.data.pavilionList
           : [];
-        let { last: lastPage, totalPages, content: pavilionList } = res.data.data;
-
-        this.setData({
-          currentPage: res.data.data.number+1,
-          lastPage,
-          loading: false,
-          pavilionList: tempContent.concat(pavilionList),
-        });
+        let { pageData: pavilionList, total } = res.data.data;
+
+                 // 判断是否为最后一页(返回空数组表示没有更多数据)
+         let isLastPage = !pavilionList || pavilionList.length === 0;
+
+         if (isLastPage) {
+           this.setData({
+             loading: false,
+             lastPage: true
+           });
+           wx.stopPullDownRefresh();
+           return;
+         }
+
+         // 拼接新数据
+         let newPavilionList = tempContent.concat(pavilionList);
+
+         this.setData({
+           currentPage: page,
+           lastPage: false, // 有数据时设为false
+           loading: false,
+           pavilionList: newPavilionList,
+         });
         console.log(pavilionList)
         wx.stopPullDownRefresh();
         console.log(res)
@@ -277,7 +318,7 @@ Page({
   popular : function(){
     let { latitude: lat, longitude: lng } = this.data;
 
-    request["recommend"]({
+    newRequestFns["recommend"]({
       lat,
       lng,
     }, "", res => {

+ 3 - 3
pages/yuezhan/search_result/index.wxml

@@ -32,7 +32,7 @@
   <view class='search-container' hidden="{{activeIndex!=0}}">
     <view class="weui-tab__panel">
       <block wx:for="{{exhibitionList}}" wx:key="index">
-        <navigator hover-class='none' url="{{item.hasProduct ? ('../../wv_page/index?id='+item.id):('../../zl_detail/index?id='+item.id)}}" class='weui-tab__content_item'>
+        <navigator hover-class='none' url="{{item.online === 1 ? ('../../wv_page/index?id='+item.id):('../../zl_detail/index?id='+item.id)}}" class='weui-tab__content_item'>
           <view class="fdkk-cells">
             <view class="weui-panel__bd">
               <view class="weui-media-box weui-media-box_appmsg">
@@ -102,7 +102,7 @@
                     <view class="weui-flex__item" style='margin-bottom:20rpx;'>{{item.name}}</view>
                   </view>
                   <text class='weui-media-box__desc'>{{item.address}}</text>
-                  <text class='weui-media-box__desc'>有{{item.relatedActivitiesSize}}个展览正在进行</text>
+                  <text class='weui-media-box__desc'>有{{item.relatedActivities.length}}个展览正在进行</text>
                 </view>
 
                 <view>
@@ -132,7 +132,7 @@
           <text wx:for="{{keyword}}" wx:key="index" bindtap='keywordSearch' data-keyword='{{item.dataValue}}' class='hot-tag-item'>{{item.dataValue}}</text>
         </view> -->
           <block wx:for="{{ExhibitionPopular}}" wx:key="index">
-            <navigator hover-class='none' url="{{item.hasProduct ? ('../../wv_page/index?&id='+item.id):('../../zl_detail/index?id='+item.id)}}" class='weui-tab__content_item'>
+            <navigator hover-class='none' url="{{item.online ? ('../../wv_page/index?&id='+item.id):('../../zl_detail/index?id='+item.id)}}" class='weui-tab__content_item'>
               <view class="fdkk-cells">
                 <view class="weui-panel__bd">
                   <view class="weui-media-box weui-media-box_appmsg">

+ 298 - 84
pages/zhanxun/index.js

@@ -1,5 +1,9 @@
 // pages/zhanxun/index.js
 const { request, serverName, imgServer } = require('../../utils/services');
+const {
+  newRequestFns,
+  newServerName
+} = require('../../utils/newServices.js');
 const { Toast, qqmapsdk } = require('../../utils/util.js');
 const { defaultImg, noExhibitionImg } = require('../../utils/images');
 const WxParse = require('../../common/component/wxParse/wxParse.js');
@@ -62,7 +66,7 @@ Page({
     autoplay: true,
     interval: 5000,
     duration: 1000,
-    locationName: "珠海",
+    locationName: "北京",
     locationNameDesp: "",
     isLike: false,
     showConfirm: false,
@@ -87,8 +91,22 @@ Page({
       noExhibitionImg,
       imgServer
     });
-    
-    this.getLocationName();
+    // 检查 globalData 是否已有位置信息
+    if (app.globalData.latitude && app.globalData.longitude) {
+      // 使用 globalData 中的经纬度
+      this.setData({
+        latitude: app.globalData.latitude,
+        longitude: app.globalData.longitude
+      });
+      
+      // 处理 city 设置
+      if (app.globalData.locationName) {
+        app.globalData.city = app.globalData.locationName;
+      } else {
+        app.globalData.city = "北京";
+      }
+    } 
+    // this.getLocationName(); 初始进来不在获取位置信息
     // 初始加载线上看展数据
     this.getOnlineExhibitionList(1);
   },
@@ -119,23 +137,55 @@ Page({
       loading: true
     });
     
-    request["getExhibitionList"]({
+    newRequestFns["getExhibitionList"]({
       page: page,
       type: 1 // 线上看展类型
     }, '', res => {
       let tempContent = this.data.onlineExhibitionList || [];
-      let { last: lastPage, content: exhibitionList } = res.data.data;
+      let { pageData: exhibitionList, total } = res.data.data;
+      
+      // 判断是否为最后一页(返回空数组表示没有更多数据)
+      let isLastPage = !exhibitionList || exhibitionList.length === 0;
+
+      if (isLastPage) {
+        this.setData({
+          loading: false,
+          onlineLastPage: true // 标记为最后一页
+        });
+        return;
+      }
       
       exhibitionList.forEach((currentValue) => {
         currentValue.product ? currentValue.product.link = escape(currentValue.product.link) : '';
         currentValue.product ? currentValue.product.imageUrl = escape(currentValue.product.imageUrl) : '';
+        
+        // 处理状态标签逻辑
+        if (!currentValue.statusText && currentValue.endTime) {
+          // 如果没有 statusText,根据 endTime 判断是否已结束
+          const today = new Date();
+          const endDate = new Date(currentValue.endTime);
+          
+          // 将日期设置为当天的开始时间进行比较
+          today.setHours(0, 0, 0, 0);
+          endDate.setHours(0, 0, 0, 0);
+          
+          if (endDate < today) {
+            currentValue.statusText = '已结束';
+            currentValue.isExpired = true;
+          }
+        } else if (currentValue.statusText === '热门') {
+          currentValue.isHot = true;
+        }
       });
       
+      // 拼接新数据
+      let newOnlineExhibitionList = page === 1 ? exhibitionList : tempContent.concat(exhibitionList);
+      
       this.setData({
         onlineCurrentPage: page,
-        onlineLastPage: lastPage,
+        onlineLastPage: false, // 有数据时设为false
         loading: false,
-        onlineExhibitionList: page === 1 ? exhibitionList : tempContent.concat(exhibitionList),
+        onlineExhibitionList: newOnlineExhibitionList,
       });
       
       wx.stopPullDownRefresh();
@@ -157,7 +207,7 @@ Page({
       loading: true
     });
     
-    request["getExhibitionListOffline"]({
+    newRequestFns["getExhibitionListOffline"]({
       page: page,
       loginSessionKey,
       city: locationName,
@@ -167,23 +217,60 @@ Page({
       lat: this.data.latitude,
     }, '', res => {
       let tempContent = this.data.offlineExhibitionList || [];
-      let { last: lastPage, totalElements, content: exhibitionList } = res.data.data;
+      let { pageData: exhibitionList, total } = res.data.data;
+      
+      // 判断是否为最后一页(返回空数组表示没有更多数据)
+      let isLastPage = !exhibitionList || exhibitionList.length === 0;
+
+      if (isLastPage) {
+        this.setData({
+          loading: false,
+          offlineLastPage: true, // 标记为最后一页
+          exhiNum: total || 0
+        });
+        wx.stopPullDownRefresh();
+        if (total <= 3) {
+          this.offlineRecommend();
+        }
+        return;
+      }
       
       exhibitionList.forEach((currentValue) => {
         currentValue.product ? currentValue.product.link = escape(currentValue.product.link) : '';
+        
+        // 处理状态标签逻辑
+        if (!currentValue.statusText && currentValue.endTime) {
+          // 如果没有 statusText,根据 endTime 判断是否已结束
+          const today = new Date();
+          const endDate = new Date(currentValue.endTime);
+          
+          // 将日期设置为当天的开始时间进行比较
+          today.setHours(0, 0, 0, 0);
+          endDate.setHours(0, 0, 0, 0);
+          
+          if (endDate < today) {
+            currentValue.statusText = '已结束';
+            currentValue.isExpired = true;
+          }
+        } else if (currentValue.statusText === '热门') {
+          currentValue.isHot = true;
+        }
       });
       
+      // 拼接新数据
+      let newOfflineExhibitionList = page === 1 ? exhibitionList : tempContent.concat(exhibitionList);
+      
       this.setData({
         offlineCurrentPage: page,
-        offlineLastPage: lastPage,
+        offlineLastPage: false, // 有数据时设为false
         loading: false,
-        offlineExhibitionList: page === 1 ? exhibitionList : tempContent.concat(exhibitionList),
-        exhiNum: totalElements
+        offlineExhibitionList: newOfflineExhibitionList,
+        exhiNum: total
       });
       
       wx.stopPullDownRefresh();
       
-      if (this.data.exhiNum <= 3) {
+      if (total <= 3) {
         this.offlineRecommend();
       }
     }, err => {
@@ -243,7 +330,7 @@ Page({
     Toast.showToast2('loading');
 
     let loginSessionKey = wx.getStorageSync('token') || "";
-    request['isCollect']({
+    newRequestFns['isCollect']({
       loginSessionKey,
       exhibitionId: id,
       type: Number(type),
@@ -289,59 +376,62 @@ Page({
   },
   
   // 获取位置名称
-  getLocationName: function() {
-    wx.getLocation({
-      type: 'wgs84',
-      success: (res) => {
-        this.setData({
-          latitude: res.latitude,
-          longitude: res.longitude
-        });
-        
-        qqmapsdk.reverseGeocoder({
-          location: {
-            latitude: res.latitude,
-            longitude: res.longitude
-          },
-          success: (res) => {
-            let { city: locationName } = res.result.address_component;
-            locationName = locationName.substring(0, 2);
-            app.globalData.city = locationName;
+  // getLocationName: function() {
+  //   console.log(11111)
+  //   wx.getLocation({
+  //     type: 'wgs84',
+  //     success: (res) => {
+  //       this.setData({
+  //         latitude: res.latitude,
+  //         longitude: res.longitude
+  //       });
+  //       console.log(res, 22222)
+  //       qqmapsdk.reverseGeocoder({
+  //         location: {
+  //           latitude: res.latitude,
+  //           longitude: res.longitude
+  //         },
+  //         success: (res) => {
+  //           let { city: locationName } = res.result.address_component;
+  //           console.log(locationName, 'locationName')
+  //           locationName = locationName.substring(0, 2);
+  //           app.globalData.city = locationName;
             
-            this.setData({
-              locationName,
-              locationNameDesp: locationName
-            });
-          },
-          fail: function (res) {
-            this.setData({
-              locationName: ""
-            });
-          }
-        });
-      },
-      fail: () => {
-        this.setData({
-          getLocationBtn: true
-        });
-      }
-    });
-  },
+  //           this.setData({
+  //             locationName,
+  //             locationNameDesp: locationName
+  //           });
+  //         },
+  //         fail: function (res) {
+  //           this.setData({
+  //             locationName: ""
+  //           });
+  //         }
+  //       });
+  //     },
+  //     fail: () => {
+  //       console.log(33333)
+  //       this.setData({
+  //         getLocationBtn: true
+  //       });
+  //     }
+  //   });
+  // },
   
   // 线下推荐
   offlineRecommend: function () {
-    wx.getLocation({
-      type: 'wgs84',
-      success: (res) => {
-        this.setData({
-          latitude: res.latitude,
-          longitude: res.longitude
-        });
-      }
-    });
+    // wx.getLocation({
+    //   type: 'wgs84',
+    //   success: (res) => {
+    //     this.setData({
+    //       latitude: res.latitude,
+    //       longitude: res.longitude
+    //     });
+    //   }
+    // });
     
     let { latitude: lat, longitude: lng } = this.data;
-    request["offlineRecommend"]({
+    newRequestFns["offlineRecommend"]({
       lat,
       lng,
     }, "", res => {
@@ -355,9 +445,103 @@ Page({
   
   // 前往搜索页面
   to_search: function() {
-    wx.navigateTo({
-      url: '../tongcheng/search/index'
-    });
+    // 检查 globalData 是否已有位置信息
+    if (app.globalData.latitude && app.globalData.longitude && app.globalData.locationName) {
+      // 已有位置信息,直接跳转
+      wx.navigateTo({
+        url: '../tongcheng/search/index'
+      });
+      return;
+    }
+
+    // 没有位置信息,显示弹窗
+    wx.showModal({
+      title: '获取你的位置信息',
+      content: '将获取你的具体位置信息,用于推荐你所在定位附近的展览',
+      confirmText: '同意',
+      cancelText: '拒绝',
+      success: (res) => {
+        if (res.confirm) {
+          // 用户点击同意,获取位置信息
+          wx.getLocation({
+            type: 'wgs84',
+            success: (locationRes) => {
+              // 设置坐标到 globalData 和页面数据
+              app.globalData.latitude = locationRes.latitude;
+              app.globalData.longitude = locationRes.longitude;
+              this.setData({
+                latitude: locationRes.latitude,
+                longitude: locationRes.longitude
+              });
+              
+              // 使用腾讯地图逆地址解析获取城市名称
+              qqmapsdk.reverseGeocoder({
+                location: {
+                  latitude: locationRes.latitude,
+                  longitude: locationRes.longitude
+                },
+                success: (geoRes) => {
+                  let { city: locationName } = geoRes.result.address_component;
+                  locationName = locationName.substring(0, 2);
+                  
+                  // 保存到 globalData
+                  app.globalData.city = locationName;
+                  app.globalData.locationName = locationName;
+                  
+                  this.setData({
+                    locationName,
+                    locationNameDesp: locationName
+                  });
+                  // 获取当前城市的展览列表
+                  this.getOfflineExhibitionList(1);
+                  // 获取位置成功,跳转到搜索页面
+                  wx.navigateTo({
+                    url: '../tongcheng/search/index'
+                  });
+                },
+                fail: (geoErr) => {
+                  // 逆地址解析失败,使用默认城市(北京),直接跳转
+                  app.globalData.city = "北京";
+                  app.globalData.locationName = "北京";
+                  this.setData({
+                    locationName: "北京"
+                  });
+                  wx.navigateTo({
+                    url: '../tongcheng/search/index'
+                  });
+                }
+              });
+            },
+            fail: (locationErr) => {
+              // 获取位置失败,保持默认城市(北京),直接跳转
+              console.log('获取位置失败:', locationErr);
+              app.globalData.city = "北京";
+              app.globalData.locationName = "北京";
+              this.setData({
+                getLocationBtn: true,
+                locationName: "北京"
+              });
+              wx.navigateTo({
+                url: '../tongcheng/search/index'
+              });
+            }
+          })
+        } else if (res.cancel) {
+          // 用户点击拒绝,保持默认城市(北京),直接跳转
+          app.globalData.city = "北京";
+          app.globalData.locationName = "";
+          wx.navigateTo({
+            url: '../tongcheng/search/index'
+          });
+        }
+      },
+      fail: function (res) {
+        // 弹窗失败,直接跳转
+        wx.navigateTo({
+          url: '../tongcheng/search/index'
+        });
+      }
+    })
   },
   
   // 展览搜索
@@ -424,7 +608,7 @@ Page({
   getNearByList: function (page) {
     let { locationName, latitude, longitude } = this.data;
     let loginSessionKey = wx.getStorageSync("token");
-
+    console.log(locationName, latitude, longitude, 666)
     wx.getSetting({
       success: res => {
         if (!res.authSetting['scope.userLocation']) {
@@ -446,7 +630,7 @@ Page({
                 let longitude = res.longitude;
                 let latitude = res.latitude;
                 
-                request["getNearByList"]({
+                newRequestFns["getNearByList"]({
                   page: page,
                   loginSessionKey,
                   city: locationName,
@@ -454,16 +638,31 @@ Page({
                   lat: latitude
                 }, '', res => {
                   let tempContent = this.data.offlineExhibitionList || [];
-                  let { last: lastPage, content: exhibitionList } = res.data.data;
+                  let { pageData: exhibitionList, total } = res.data.data;
 
-                  this.setData({
-                    offlineCurrentPage: page,
-                    offlineLastPage: lastPage,
-                    loading: false,
-                    longitude,
-                    latitude,
-                    offlineExhibitionList: page === 1 ? exhibitionList : tempContent.concat(exhibitionList),
-                  });
+                                     // 判断是否为最后一页(返回空数组表示没有更多数据)
+                   let isLastPage = !exhibitionList || exhibitionList.length === 0;
+
+                   if (isLastPage) {
+                     this.setData({
+                       loading: false,
+                       offlineLastPage: true
+                     });
+                     wx.stopPullDownRefresh();
+                     return;
+                   }
+
+                   // 拼接新数据
+                   let newExhibitionList = page === 1 ? exhibitionList : tempContent.concat(exhibitionList);
+
+                   this.setData({
+                     offlineCurrentPage: page,
+                     offlineLastPage: false, // 有数据时设为false
+                     loading: false,
+                     longitude,
+                     latitude,
+                     offlineExhibitionList: newExhibitionList,
+                   });
                   
                   wx.stopPullDownRefresh();
                 }, err => {
@@ -472,7 +671,7 @@ Page({
               }
             });
           } else {
-            request["getNearByList"]({
+            newRequestFns["getNearByList"]({
               page: page,
               loginSessionKey,
               city: locationName,
@@ -480,14 +679,29 @@ Page({
               lat: latitude
             }, '', res => {
               let tempContent = this.data.offlineExhibitionList || [];
-              let { last: lastPage, content: exhibitionList } = res.data.data;
+              let { pageData: exhibitionList, total } = res.data.data;
 
-              this.setData({
-                offlineCurrentPage: page,
-                offlineLastPage: lastPage,
-                loading: false,
-                offlineExhibitionList: page === 1 ? exhibitionList : tempContent.concat(exhibitionList),
-              });
+                             // 判断是否为最后一页(返回空数组表示没有更多数据)
+               let isLastPage = !exhibitionList || exhibitionList.length === 0;
+
+               if (isLastPage) {
+                 this.setData({
+                   loading: false,
+                   offlineLastPage: true
+                 });
+                 wx.stopPullDownRefresh();
+                 return;
+               }
+
+               // 拼接新数据
+               let newExhibitionList = page === 1 ? exhibitionList : tempContent.concat(exhibitionList);
+
+               this.setData({
+                 offlineCurrentPage: page,
+                 offlineLastPage: false, // 有数据时设为false
+                 loading: false,
+                 offlineExhibitionList: newExhibitionList,
+               });
               
               wx.stopPullDownRefresh();
             }, err => {
@@ -504,7 +718,7 @@ Page({
     
     if (clickToSelect) {
       this.setData({
-        locationName: city || "珠海",
+        locationName: city || "北京",
         offlineExhibitionList: [],
         offlineCurrentPage: 1
       });

+ 4 - 4
pages/zhanxun/index.wxml

@@ -65,7 +65,7 @@
           <component-search></component-search>
         </view>
         <view class="yuezhan-navbar yuezhan-navbar-online">
-          <view bindtap='to_search' class='nav-tag nav-active'>{{locationName || "珠海"}}
+          <view bindtap='to_search' class='nav-tag nav-active'>{{locationName || "北京"}}
             <text class='iconfont iconpaixuxialacaidan'></text>
           </view>
           <view class='nav-right'>
@@ -83,7 +83,7 @@
     <view class='fdkz-card-warpper'>
       <navigator hover-class='none' url="{{item.hasProduct ? ('../wv_page/index?link='+item.product.link+'&id='+item.id+'&imageUrl='+item.imageUrl):('../zl_detail/index?id='+item.id+'&imageUrl='+item.imageUrl)}}" wx:for="{{offlineExhibitionList}}" wx:key="index" class='fdkz-card'>
         <view class='fdkz-card-img'>
-          <view wx:if="{{item.statusText}}" class="fdkz-card-tag {{item.statusText == '即将开始' ? 'fdkz-card-tag-start' : ''}} {{item.statusText == '已结束' ? 'fdkz-card-tag-end' : ''}}">
+          <view wx:if="{{item.statusText}}" class="fdkz-card-tag {{item.statusText == '即将开始' ? 'fdkz-card-tag-start' : ''}} {{item.statusText == '已结束' || item.isExpired ? 'fdkz-card-tag-end' : ''}} {{item.statusText == '热门' || item.isHot ? 'fdkz-card-tag-hot' : ''}}">
             <text class='fdkz-card-tag-txt'>{{item.statusText}}</text>
           </view>
           <image src="{{imgServer+item.imageUrl||defaultImg}}" mode="aspectFill" class='item-img'></image>
@@ -114,9 +114,9 @@
       <view class="tips">
         暂无展会信息
       </view>
-      <view class='locationBtn' wx:if='{{getLocationBtn&&activeIndex==1}}'>
+      <!-- <view class='locationBtn' wx:if='{{getLocationBtn}}'>
         <button type="warn" open-type='openSetting'>获取地理位置</button>
-      </view>
+      </view> -->
     </view>
     
     <view wx:if="{{showConfirm}}" class='comfirmDialog'>

+ 4 - 0
pages/zhanxun/index.wxss

@@ -171,6 +171,10 @@
   background: #999;
 }
 
+.fdkz-card-tag-hot {
+  background: #E65858;
+}
+
 .item-img {
   width: 100%;
   height: 100%;

+ 6 - 3
pages/zl_detail/create_evaluation/index.js

@@ -3,6 +3,10 @@ const {
   request,
   serverName
 } = require('../../../utils/services');
+const {
+  newRequestFns,
+  newServerName
+} = require('../../../utils/newServices.js');
 // const WxParse = require('../../../common/component/wxParse/wxParse.js');
 const wxStar = require('../../../common/component/wxStar/wxStar/wxStar.js');
 
@@ -68,7 +72,7 @@ Page({
     let loginSessionKey = wx.getStorageSync('token') || "";
 
     if (content && currentStar) {
-      request["writtenComments"]({
+      newRequestFns["writtenComments"]({
         comment: content,
         exhibitionId,
         score: currentStar,
@@ -89,9 +93,8 @@ Page({
         }
       }, err => {
         // wx.showToast({
-        //   title: '评论失败',
+        //   title: '您已经发表过评论,不能重复评论。',
         //   icon: 'none',
-        //   duration: 2000
         // })
       }, complete => {
         

+ 11 - 3
pages/zl_detail/index.js

@@ -1,5 +1,9 @@
 // pages/zl_detail/index.js
 const { request, serverName, imgServer } = require('../../utils/services');
+const {
+  newRequestFns,
+  newServerName
+} = require('../../utils/newServices.js');
 const WxParse = require('../../common/component/wxParse/wxParse.js');
 
 const { Toast, removeArrItem } = require('../../utils/util.js');
@@ -134,7 +138,7 @@ Page({
 
     let loginSessionKey = wx.getStorageSync('token') || "";
     // if (loginSessionKey){
-    request['commentLike']({
+    newRequestFns['commentLike']({
       loginSessionKey,
       commentId: id,
       type: Number(type),
@@ -189,7 +193,7 @@ Page({
     } = app.globalData, hasItem = true;
     let type = exhibitionDetail.hasCollect
     // if (loginSessionKey){
-    request['isCollect']({
+    newRequestFns['isCollect']({
       loginSessionKey,
       exhibitionId: exhibitionId,
       type: Number(type),
@@ -306,7 +310,7 @@ Page({
 
   getExhibitionDetail: function () {
     let exhibitionId = this.data.exhibitionId;
-    request["getExhibitionDetail"]({
+    newRequestFns["getExhibitionDetail"]({
       exhibitionId: exhibitionId
     }, "", res => {
       let { data: exhibitionDetail } = res.data;
@@ -319,6 +323,10 @@ Page({
           commentsCon[i]['imgObj'] = comments_star
         }
       }
+      // 没有name字段,则取pavilion的name字段
+      if(!exhibitionDetail.pavilionName){
+        exhibitionDetail.pavilionName = exhibitionDetail.pavilion.name || '';
+      }
       this.setData({
         exhibitionDetail,
         likeNum: exhibitionDetail.collectionsCount,

+ 2 - 2
project.private.config.json

@@ -4,7 +4,7 @@
   "projectname": "swkz_wx",
   "setting": {
     "compileHotReLoad": true,
-    "urlCheck": false,
+    "urlCheck": true,
     "coverView": false,
     "lazyloadPlaceholderEnable": false,
     "skylineRenderEnable": false,
@@ -20,5 +20,5 @@
     "ignoreDevUnusedFiles": true,
     "bigPackageSizeSupport": false
   },
-  "libVersion": "3.8.9"
+  "libVersion": "3.8.10"
 }

+ 51 - 2
utils/newServices.js

@@ -19,6 +19,47 @@ const urls = {
   collectExhibitions: "/wx/user/getExhibitions",
   getOrders: '/wx/user/getOrders',
 
+  //轮播图
+  getBannerList: '/wx/banner/list',
+  getBannerDetail:'/wx/banner/detail',
+  // 首页弹窗
+  getBombList: '/wx/exhibition/bomb/list',
+
+  //展会
+  getExhibitionList: "/wx/exhibition/listByType",
+  getExhibitionListOffline: "/wx/exhibition/offline",
+  getExhibitionDetail: "/wx/exhibition/detail",
+  getExhibitionSearch: "/wx/exhibition/search",
+  getKeywordCode: "/wx/dataDictionary/keywordCode",
+
+  //展馆
+  getPavilionDetail: "/wx/pavilion/detail",
+  getPavilionSearch: "/wx/pavilion/search",
+
+  //看过
+  getExhibitionsByIds: '/wx/exhibition/getExhibitionsByIds',
+  //保存浏览
+  saveBrowsedExhibitions: '/wx/user/saveBrowsedExhibitions',
+
+  //评论
+  getComments: '/wx/user/getComments',
+  getCommentslist: '/wx/comment/list',
+  //评论
+  writtenComments: '/wx/comment/written',
+  //收藏
+  commentLike: '/wx/comment/like',
+
+  //同城
+  getDomesticCity: '/wx/exhibition/domesticCity',
+  getInternationalCity: '/wx/exhibition/internationalCity',
+  getNearByList: '/wx/exhibition/nearByList', // 目测废弃了,没看到有使用的方法
+
+  //搜索的热门推荐
+  recommend: '/wx/exhibition/recommend',
+
+  //线下展讯热门推荐
+  offlineRecommend: '/wx/exhibition/offlineRecommend',
+
   // 归藏轮播图接口
   getAntiqueList: '/wx/antique/page',
   // 归藏详情接口
@@ -84,8 +125,14 @@ Object.keys(urls).forEach(function(key) {
         } else if (res.data.code == -1) {
           Toast.showToast('warn', '请求发送失败');
           fail(res);
+        } else if (res.data.code == 15001) {
+          Toast.showToast('warn', '您已经发表过评论,不能重复评论');
+          fail(res);
+        } else if(res.data.code == 16001){
+          Toast.showToast('warn', '未登录,无法操作');
+          fail(res);
         } else {
-          Toast.showToast('warn', res.data.msg || '网络超时,请检查网络');
+          // Toast.showToast('warn', res.data.msg || '网络超时,请检查网络');
           fail(res);
         }
       },
@@ -99,6 +146,7 @@ Object.keys(urls).forEach(function(key) {
   };
 });
 
+// 归藏的api写在这里了
 const request = {
   getAntiqueList: function(data, method, success, fail) {
     wx.request({
@@ -223,7 +271,8 @@ const request = {
   }
 };
 
-module.exports.request = request;
+module.exports.newRequest = request;
+module.exports.newRequestFns = requestFns;
 module.exports.serverName = serverName;
 module.exports.newServerName = newServerName;
 module.exports.cosBaseUrl = cosBaseUrl;