Browse Source

四维看展最新代码

wangfumin 3 weeks ago
parent
commit
197ca0a8eb

+ 40 - 40
app.js

@@ -24,33 +24,33 @@ App({
 
     let loginSessionKey = wx.getStorageSync("token") || "";
 
-    if (loginSessionKey) {
-      wx.request({
-        url: newServerName + '/wx/user/getBrowsedExhibitions',
-        data: {
-          loginSessionKey
-        },
-        header: {
-          'content-type': 'application/x-www-form-urlencoded'
-        },
-        method: "post",
-        success: (res) => {
-          if (res.data.code == 0) {
-            let cookieIds = res.data.data.ids||undefined
-            if (cookieIds){
-              this.globalData.cookieIDs = cookieIds.split(',');
-
-            }
-
-          } else {
-            return
-
-          }
-        }
-      })
-    }
-    else
-    { }
+    // if (loginSessionKey) {
+    //   wx.request({
+    //     url: newServerName + '/wx/user/getBrowsedExhibitions',
+    //     data: {
+    //       loginSessionKey
+    //     },
+    //     header: {
+    //       'content-type': 'application/x-www-form-urlencoded'
+    //     },
+    //     method: "post",
+    //     success: (res) => {
+    //       if (res.data.code == 0) {
+    //         let cookieIds = res.data.data.ids||undefined
+    //         if (cookieIds){
+    //           this.globalData.cookieIDs = cookieIds.split(',');
+
+    //         }
+
+    //       } else {
+    //         return
+
+    //       }
+    //     }
+    //   })
+    // }
+    // else
+    // { }
     // 获取用户信息
     wx.getSetting({
       success: res => {
@@ -114,19 +114,19 @@ App({
     let loginSessionKey = wx.getStorageSync("token") || "";
     //关闭应用的时候发送你浏览过的场景
     if (loginSessionKey) {
-      wx.request({
-        url: newServerName + '/wx/user/saveBrowsedExhibitions',
-        data: {
-          ids:ids,
-          loginSessionKey
-        },
-        header: {
-          'content-type': 'application/x-www-form-urlencoded'
-        },
-        method: "post",
-        success: (res) => {
-        }
-      })
+      // wx.request({
+      //   url: newServerName + '/wx/user/saveBrowsedExhibitions',
+      //   data: {
+      //     ids:ids,
+      //     loginSessionKey
+      //   },
+      //   header: {
+      //     'content-type': 'application/x-www-form-urlencoded'
+      //   },
+      //   method: "post",
+      //   success: (res) => {
+      //   }
+      // })
     } else {
       return
     }

+ 1 - 0
app.json

@@ -40,6 +40,7 @@
     "navigationBarBackgroundColor": "#fff",
     "navigationBarTitleText": "四维看展",
     "backgroundColor": "#ffffff",
+    "enablePullDownRefresh": false,
     "navigationBarTextStyle": "black",
     "enableShareAppMessage": true,
     "enableShareTimeline": true

+ 42 - 18
common/components/component-list/component-list.js

@@ -1,5 +1,5 @@
 // components/component-list.js
-const { imgServer } = require('../../../utils/services.js')
+const { cosBaseUrl } = require('../../../utils/newServices.js')
 const app = getApp()
 Component({
   /**
@@ -15,6 +15,9 @@ Component({
     sceneId: {
       type: String
     },
+    thumbUrl: {
+      type: String
+    },
     imageUrl: {
       type: String
     },
@@ -30,43 +33,64 @@ Component({
     distance: {
       type: String
     },
+    detailType: {
+      type: [Number, String],
+    },
     online: Number,
     scenePv: Number,
     link: String
   },
   options: {
     addGlobalClass: true,
+    newImg: ''
+  },
+  lifetimes: {
+    attached: function(){
+      let that = this
+      this.setData({
+        newImg: that.getImgUrl()
+      })
+    }
   },
-
   /**
    * 组件的初始数据
    */
   data: {
-    imgServer
+    cosBaseUrl
   },
-
   /**
    * 组件的方法列表
    */
   methods: {
     goBigScene: function(){
-      if (this.data.online === 1){
-        app.globalData.currentUrl = this.data.link
-        wx.navigateTo({
-          url: `../../wv_page/index?id=${this.data.sceneId}`,
-          success: function (res) { },
-          fail: function (res) { },
-          complete: function (res) { },
-        })
-      }else{
+      console.log(this.data.detailType, 666)
+      if(this.data.detailType == 2){
         wx.navigateTo({
-          url: `/pages/zl_detail/index?id=${this.data.sceneId}`,
-          success: function (res) { },
-          fail: function (res) { },
-          complete: function (res) { },
-        })
+          url: '/pages/guicangDetails/index?id=' + this.data.sceneId
+        });
+      } else {
+        if (this.data.online === 1){
+          app.globalData.currentUrl = this.data.link
+          wx.navigateTo({
+            url: `../../wv_page/index?id=${this.data.sceneId}`,
+            success: function (res) { },
+            fail: function (res) { },
+            complete: function (res) { },
+          })
+        }else{
+          wx.navigateTo({
+            url: `/pages/zl_detail/index?id=${this.data.sceneId}`,
+            success: function (res) { },
+            fail: function (res) { },
+            complete: function (res) { },
+          })
+        }
       }
       
+    },
+    getImgUrl: function(){
+      let url = this.data.thumbUrl || this.data.imageUrl
+      return url.includes('http') ? url : (this.data.cosBaseUrl + url)
     }
     
   },

+ 5 - 3
common/components/component-list/component-list.wxml

@@ -6,7 +6,8 @@
         <view class="weui-panel__bd">
           <view class="weui-media-box weui-media-box_appmsg">
             <view class="weui-media-box__hd weui-media-box__hd_in-appmsg">
-              <image class="weui-media-box__thumb" mode='aspectFill' src="{{imgServer + imageUrl||defaultImg}}">
+              {{thumbUrl.includes('http')}}
+              <image class="weui-media-box__thumb" mode='aspectFill' src="{{newImg}}">
               </image>
             </view>
             <view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
@@ -18,9 +19,10 @@
               </view>
               
               <view class='desc'>
-                <view class="weui-media-box__desc">{{statusTextDesp}}</view>
+                <view wx:if="{{detailType == 2}}" class="weui-media-box__desc">归藏</view>
+                <view wx:else class="weui-media-box__desc">{{statusTextDesp}}</view>
 
-                <view wx:if="{{online == 0}}">
+                <view wx:if="{{online == 0 && detailType != 2}}">
                   <view class='iconfont iconweizhi'></view>
                   <text>{{distance || 0 }} km</text>
                 </view>

+ 18 - 2
pages/cg_detail/index.js

@@ -51,10 +51,12 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+    console.log(options, 666)
     this.setData({
       pavilionId: options.id,
       serverName,
-      defaultImg
+      defaultImg,
+      relayUrl: options.relayUrl,
     })
   },
   addLike: function () {
@@ -106,6 +108,16 @@ Page({
       });
       WxParse.wxParse('description', 'html', description, this, 5);
       WxParse.wxParse('openTime', 'html', openTime, this, 5);
+    },fail => {
+      wx.showToast({
+        title: '页面不存在',
+        icon: 'none'
+      });
+      setTimeout(() => {
+        wx.switchTab({
+          url: '/pages/yuezhan/index',
+        })
+      }, 1000);
     })
   },
   clickCell: function () {
@@ -162,6 +174,10 @@ Page({
    * 用户点击右上角分享
    */
   onShareAppMessage: function () {
-  
+    let {sceneId, imageUrl, relayUrl, forwardImg} = this.data;
+    return {
+      path: `/pages/cg_detail/index?&id=${sceneId}`,
+      imageUrl: relayUrl || ''
+    }
   }
 })

+ 1 - 1
pages/cg_detail/index.wxml

@@ -71,7 +71,7 @@
         </view>
       </view>
       <view class='artist_avatar'>
-        <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:if="{{!(index>2)||readActive}}" class='fdkz-card'
+        <navigator hover-class='none' url="{{item.online ? ('../wv_page/index?link='+item.product.link+'&id='+item.id+'&imageUrl='+item.imageUrl):('../zl_detail/index?id='+item.id+'&imageUrl='+item.imageUrl)}}" wx:if="{{!(index>2)||readActive}}" class='fdkz-card'
           wx:for="{{relatedActivities}}" wx:key="index">
           <view class='fdkz-card-img'>
 

+ 1 - 1
pages/guicang/index.js

@@ -36,7 +36,7 @@ Page({
       sortBy: 'DESC',
       hot: 1,
       pageNo: 1,
-      pageSize: 1
+      pageSize: 6
     };
 
     newRequest.getAntiqueList(

+ 4 - 3
pages/guicangDetails/index.js

@@ -55,10 +55,10 @@ Page({
     wx.showLoading({
       title: '加载中...'
     });
-    
+    let loginSessionKey = wx.getStorageSync("token") || "";
     // 调用详情接口
     newRequest.getAntiqueDetail(
-      {},
+      {loginSessionKey},
       'GET',
       (res) => {
         wx.hideLoading();
@@ -75,7 +75,7 @@ Page({
             material: detail.material,
             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}`,
+            h5Url: `${fileBaseURL}?m=${detail.fileList.find(file => file.name.includes('usdz')).url}`,
             shareUrl: `${fileBaseURL}?m=${cosBaseUrl + detail.fileList.find(file => file.name.includes('usdz')).url}`,
           };
           console.log(itemDetail);
@@ -210,6 +210,7 @@ Page({
   showQRCode() {
     let that = this;
     let url = that.data.itemDetail.h5Url
+    // let url = 'www.baidu.com'
     drawQrcode({
         width: 72,
         height: 72,

+ 1 - 0
pages/guicangDetails/index.json

@@ -3,6 +3,7 @@
   "navigationBarTextStyle": "white",
   "navigationBarBackgroundColor": "#111",
   "enablePullDownRefresh": false,
+  "disableScroll":true,
   "backgroundColor": "#f5f5f5",
   "backgroundTextStyle": "light",
   "usingComponents": {

+ 1 - 1
pages/guicangDetails/index.wxss

@@ -4,7 +4,7 @@
   background: url('https://swkz-1332577016.cos.ap-guangzhou.myqcloud.com/swkzGuicang/bg.png') no-repeat;
   background-size: cover;
   color: #fff;
-  min-height: 100vh;
+  height: 100vh;
   position: relative;
   overflow: hidden;
 }

+ 1 - 1
pages/swkz/index.wxml

@@ -1,6 +1,6 @@
 <!--index.wxml-->
 <view class='container'>
- <navigator hover-class='none' url="{{item.hasProduct ?('../wv_page/index?&id='+item.id) : ('../zl_detail/index?id='+item.id+'&imageUrl='+item.imageUrl)}}" wx:for="{{exhibitionList}}" wx:key="index" class='fdkz-card'>
+ <navigator hover-class='none' url="{{item.online ?('../wv_page/index?&id='+item.id) : ('../zl_detail/index?id='+item.id+'&imageUrl='+item.imageUrl)}}" wx:for="{{exhibitionList}}" wx:key="index" class='fdkz-card'>
     <view class='fdkz-card-img'>
       <view class="new-fdkz-card-tag ">
         <text class='fdkz-card-tag-txt'>线上看展</text>

+ 24 - 7
pages/tongcheng/search/index.js

@@ -77,8 +77,16 @@ Page({
     newRequestFns["getDomesticCity"]({},"",res=>{
       if(res.data.code==0){
         let { data: domesticCityList} = res.data;
+        let exhibitionNum = 0;
+        //暂时改成从城市列表获取
+        domesticCityList.find((item) => {
+          if(item[0] == '北京'){
+             exhibitionNum = item[1];
+          }
+        })
         this.setData({
-          domesticCityList
+          domesticCityList,
+          exhibitionNum
         })
       }
       // console.log(domesticCityList)
@@ -93,8 +101,8 @@ Page({
         longitude: app.globalData.longitude,
         locationName: app.globalData.locationName
       });
-      app.globalData.city = app.globalData.locationName || "北京";
-      this.getList(1, app.globalData.locationName);
+      app.globalData.city = app.globalData.city || "北京";
+      this.getList(1, app.globalData.city);
       return;
     // }
     
@@ -165,9 +173,14 @@ Page({
       lat: latitude,
     }, '', res => {
 
-      let { total: exhibitionNum } = res.data.data;
-
-      console.log(exhibitionNum, 'exhibitionNum')
+      // let { total: exhibitionNum } = res.data.data;
+      let exhibitionNum = 0;
+      //暂时改成从城市列表获取
+      this.data.domesticCityList.find((item) => {
+        if(item[0] == '北京'){
+           exhibitionNum = item[1];
+        }
+      })
       this.setData({
         exhibitionNum,
         loading: false,
@@ -198,7 +211,11 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    // 更新选中的城市状态
+    console.log(app.globalData.city, 'app.globalData.city')
+    this.setData({
+      cityAction: app.globalData.city
+    });
   },
 
   /**

+ 78 - 36
pages/user/my_saw/index.js

@@ -26,7 +26,10 @@ Page({
   data: {
     testImg: '../../../imgs/testImg/fdkz.png',
     myBrowsed: [],
-    noCollectionImg
+    noCollectionImg,
+    currentPage: 1,
+    loading: false,
+    hasMore: true
   },
 
   /**
@@ -54,7 +57,7 @@ Page({
         app.globalData.city = "北京";
       }
       
-      this.getBrowsedExhibitions();
+      this.getBrowsedExhibitions(1);
     } 
     // else {
     //   // 没有位置信息,获取位置
@@ -71,7 +74,7 @@ Page({
     //       })
     //     },
     //     complete:()=>{
-    //       this.getBrowsedExhibitions()
+    //       this.getBrowsedExhibitions(1)
     //     }
     //   })
     // }
@@ -80,8 +83,10 @@ Page({
   onPullDownRefresh: function() {
     this.setData({
       myBrowsed: [],
+      currentPage: 1,
+      hasMore: true
     });
-    this.getBrowsedExhibitions()
+    this.getBrowsedExhibitions(1)
   },
   saveBrowsedExhibitions() {
     let {
@@ -102,7 +107,7 @@ Page({
           loginSessionKey
         }, "", res => {
           if (res) {
-            this.getBrowsedExhibitions()
+            this.getBrowsedExhibitions(1)
           }
         }, err => {
 
@@ -116,52 +121,88 @@ Page({
 
   },
 
-  getBrowsedExhibitions: function() {
+  getBrowsedExhibitions: function(page = 1) {
+    if (this.data.loading) return;
+    
     let loginSessionKey = wx.getStorageSync("token") || "";
-    let ids = undefined;
-    console.log(app.globalData)
-    if (app.globalData.cookieIDs) {
-      if (app.globalData.cookieIDs.length > 9) {
-        app.globalData.cookieIDs = app.globalData.cookieIDs.slice(0, 10)
-        // console.log(cookieIDs)
-
-      }
-      console.log(app.globalData.cookieIDs.join(","))
-
-      for (let i = 0; i < app.globalData.cookieIDs.length;i++){
-        if (app.globalData.cookieIDs[i] =='undefined'){
-          app.globalData.cookieIDs.splice(i,1);
-        }
-      }
-      ids = app.globalData.cookieIDs.join(",") || "";
+    // let ids = undefined;
+    // console.log(app.globalData)
+    // if (app.globalData.cookieIDs) {
+    //   if (app.globalData.cookieIDs.length > 9) {
+    //     app.globalData.cookieIDs = app.globalData.cookieIDs.slice(0, 10)
+    //     // console.log(cookieIDs)
+
+    //   }
+    //   console.log(app.globalData.cookieIDs.join(","))
+
+    //   for (let i = 0; i < app.globalData.cookieIDs.length;i++){
+    //     if (app.globalData.cookieIDs[i] =='undefined'){
+    //       app.globalData.cookieIDs.splice(i,1);
+    //     }
+    //   }
+    //   ids = app.globalData.cookieIDs.join(",") || "";
       
-      // console.log("asdasdas",ids)
-    } else {
-      return
-    }
+    //   // console.log("asdasdas",ids)
+    // } else {
+    //   return
+    // }
+    
+    this.setData({
+      loading: true
+    });
+    
     let {latitude:lat,longitude:lng} = this.data
-    newRequestFns["getExhibitionsByIds"]({
-        ids,
+    newRequestFns["getTrace"]({
+        pageNo: page,
         lat,
         lng,
         loginSessionKey
       }, "", res => {
         if (res.data.code > -1) {
-          let {
-            data: myBrowsed
-          } = res.data;
+          let newTraceData = res.data.data ? res.data.data.pageData : [];
+          
+          // 处理数据,添加detailType字段
+          if (newTraceData && newTraceData.length > 0) {
+            newTraceData.forEach(item => {
+              // 根据业务逻辑设置detailType,这里假设根据某个字段判断
+              // 如果有specific字段来区分展会和文物,请根据实际情况修改
+              item.detailType = item.detailType || 1; // 默认为展会类型
+            });
+          }
+          console.log(newTraceData, 999)
+          let updatedMyBrowsed;
+          if (page === 1) {
+            // 第一页,直接替换
+            updatedMyBrowsed = newTraceData || [];
+          } else {
+            // 后续页面,追加数据
+            updatedMyBrowsed = [...this.data.myBrowsed, ...(newTraceData || [])];
+          }
+          
+          // 判断是否还有更多数据
+          let hasMore = newTraceData && newTraceData.length > 0;
+          
           this.setData({
-            myBrowsed
+            myBrowsed: updatedMyBrowsed,
+            currentPage: page,
+            hasMore: hasMore,
+            loading: false
           })
-          console.log(myBrowsed)
+          console.log(updatedMyBrowsed, updatedMyBrowsed, 777)
+        } else {
+          this.setData({
+            loading: false,
+            hasMore: false
+          });
         }
 
       }, err => {
-
+        this.setData({
+          loading: false
+        });
       },
       complete => {
         wx.stopPullDownRefresh();
-
       })
   },
 
@@ -244,7 +285,8 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function() {
-
+    if (this.data.loading || !this.data.hasMore) return;
+    this.getBrowsedExhibitions(this.data.currentPage + 1);
   },
 
   /**

+ 15 - 4
pages/user/my_saw/index.wxml

@@ -5,16 +5,17 @@
       <view class="weui-tab__panel">
         <view class="weui-tab__content">
         <view class='componentList'>
-          <block wx:for="{{myBrowsed}}" wx:key="index">
+          <block wx:for="{{myBrowsed}}" wx:key="{{item.id}}">
             <component-list
               hasProduct="{{item.hasProduct}}"
               hasPay="{{item.hasPay}}"
-              sceneId="{{item.id}}"
-              imageUrl="{{item.imageUrl}}"
+              sceneId="{{item.detailId}}"
+              thumbUrl="{{item.thumbUrl}}"
               name="{{item.name}}"
               pavilionName="{{item.pavilionName}}"
               statusTextDesp="{{item.statusTextDesp}}"
               distance="{{item.distance}}"
+              detailType="{{item.detailType}}"
               online="{{item.online}}"
               scenePv="{{item.pv}}"
               link="{{item.product.showLink}}"
@@ -22,7 +23,17 @@
           </block>
         </view>
         
-        <view class='noCollection' wx:if="{{myBrowsed.length < 1}}" >
+        <!-- 加载中提示 -->
+        <view wx:if="{{loading && currentPage > 1}}" style="text-align: center; padding: 20rpx; color: #999;">
+          正在加载更多...
+        </view>
+        
+        <!-- 没有更多数据提示 -->
+        <view wx:if="{{!hasMore && myBrowsed.length > 0}}" style="text-align: center; padding: 20rpx; color: #999;">
+          没有更多数据了
+        </view>
+        
+        <view class='noCollection' wx:if="{{myBrowsed.length < 1 && !loading}}" >
           <image src='{{noCollectionImg}}'></image>
           <text>没有更多的记录</text>
         </view>

+ 13 - 1
pages/webview/index.js

@@ -3,10 +3,22 @@ Page({
     url: ''
   },
   onLoad: function(options) {
+    let relayUrl = options.relayUrl
     if (options.url) {
       this.setData({
-        url: decodeURIComponent(options.url)
+        url: decodeURIComponent(options.url),
+        relayUrl
       });
     }
+  },
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+    let {url, relayUrl} = this.data;
+    return {
+      path: `/pages/webview/index?url=${encodeURIComponent(url)}&relayUrl=${relayUrl||''}`,
+      imageUrl: relayUrl || ''
+    }
   }
 })

+ 0 - 1
pages/webview/index.json

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

+ 16 - 4
pages/wv_page/index.js

@@ -22,6 +22,7 @@ Page({
    */
   onLoad: function (options) {
     let id = (options.scene && decodeURIComponent(options.scene))|| options.id
+    let relayUrl = options.relayUrl
     recordAccess({
       id
     })
@@ -29,6 +30,9 @@ Page({
     if (id){
       this.getExhibitionDetail(id)
     }
+    this.setData({
+      relayUrl
+    })
   },
 
   forward: function(url){
@@ -46,7 +50,6 @@ Page({
       this.setData({
         url: exhibitionDetail.sceneLink,
         imageUrl: exhibitionDetail.imageUrl,
-        relayUrl: exhibitionDetail.relayUrl,
         sceneId: exhibitionDetail.id
       })
       if (exhibitionDetail.name) {
@@ -54,6 +57,16 @@ Page({
           title: exhibitionDetail.name
         })
       }
+    },fail => {
+      wx.showToast({
+        title: '页面不存在',
+        icon: 'none'
+      });
+      setTimeout(() => {
+        wx.switchTab({
+          url: '/pages/yuezhan/index',
+        })
+      }, 1000);
     })
   },
 
@@ -61,11 +74,10 @@ Page({
    * 用户点击右上角分享
    */
   onShareAppMessage: function () {
-    let {sceneId, imageUrl, relayUrl, forwardImg} = this.data;
-    console.log(imageUrl || forwardImg)
+    let {sceneId, relayUrl} = this.data;
     return {
       path: `/pages/wv_page/index?&id=${sceneId}`,
-      imageUrl: relayUrl || imageUrl || forwardImg
+      imageUrl: relayUrl || ''
     }
   }
 })

+ 15 - 2
pages/yuezhan/html_detail/index.js

@@ -46,9 +46,21 @@ Page({
     newRequestFns["getBannerDetail"]({
       bannerId: sceneId
     }, "", res => {
-      let { url: description} = res.data.data
-      console.log(description,56555)
+      let { url: description, imageUrl, relayUrl} = res.data.data
+      this.setData({
+        relayUrl: relayUrl
+      })
       WxParse.wxParse('description', 'html', description, this, 5);
+    },fail => {
+      wx.showToast({
+        title: '页面不存在',
+        icon: 'none'
+      });
+      setTimeout(() => {
+        wx.switchTab({
+          url: '/pages/yuezhan/index',
+        })
+      }, 1000);
     })
   },
 
@@ -99,6 +111,7 @@ Page({
    */
   onShareAppMessage: function () {
     let { sceneId, imageUrl, relayUrl, forwardImg } = this.data;
+    console.log(relayUrl, imageUrl, 666)
     return {
       path: `/pages/yuezhan/html_detail/index?id=${sceneId}&isShare=1&imageUrl=${imageUrl}&relayUrl=${relayUrl}`,
       imageUrl: relayUrl || imageUrl || forwardImg

+ 8 - 8
pages/yuezhan/index.js

@@ -384,7 +384,7 @@ Page({
 
 
   to_pay: function(e) {
-    // console.log('dwdwdw', e.currentTarget.dataset)
+    console.log('dwdwdw', e.currentTarget.dataset)
 
     let {
       url,
@@ -396,20 +396,19 @@ Page({
       id,
       description,
       imageUrl,
-      relayUrl
+      relayurl
     } = e.currentTarget.dataset;
 
-
+    console.log(relayurl, 6666)
     // app.globalData.currentUrl = url
     // console.log('dwdwdw', app.globalData.currentUrl)
 
     // console.log('dwdwdwd',wx.getStorageSync('url'))
-    console.log('aaaaaaaaaa', urltype, pagetype)
     switch (urltype) {
       case 0:
         if (productlink) {
           wx.navigateTo({
-            url: `/pages/webview/index?url=${encodeURIComponent(productlink)}`
+            url: `/pages/webview/index?url=${encodeURIComponent(productlink)}&relayUrl=${relayurl||''}`
           });
         }
         break;
@@ -417,7 +416,7 @@ Page({
         switch (pagetype) {
           case 0:
             wx.navigateTo({
-              url: `../cg_detail/index?id=${url}`,
+              url: `../cg_detail/index?id=${url}&imageUrl=${imageUrl}&relayUrl=${relayurl||''}`,
               success: function(res) {},
               fail: function(res) {},
               complete: function(res) {},
@@ -425,8 +424,9 @@ Page({
             break;
           case 1:
             // if (hasproduct) {
+              // 需要调一下getExhibitionDetail获取足迹
               wx.navigateTo({
-                url: `../wv_page/index?&id=${url}`,
+                url: `../wv_page/index?&id=${url}&relayUrl=${relayurl||''}`,
                 success: function(res) {},
                 fail: function(res) {},
                 complete: function(res) {},
@@ -448,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) { },

+ 3 - 3
pages/yuezhan/index.wxml

@@ -15,13 +15,13 @@
     </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.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}}">
+    <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='{{item.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>
   <view class='yuezhan-navigator'>
     <view class='navigator-title'>推荐展览</view>
-    <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="{{exhibitionList}}" wx:key="index" class='fdkz-card'>
+    <navigator hover-class='none' url="{{item.online ? ('../wv_page/index?link='+item.product.link+'&id='+item.id+'&imageUrl='+item.imageUrl):('../zl_detail/index?id='+item.id+'&imageUrl='+item.imageUrl)}}" wx:for="{{exhibitionList}}" wx:key="index" class='fdkz-card'>
       <view class='fdkz-card-img'>
         <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>
@@ -40,7 +40,7 @@
         <view class='fdkz-card-info-date'>
           <view class='left'>
             <view class='date-txt'>{{item.pavilionName || ''}}</view>
-            <view class='date-day'>{{item.online == 1 ? '' : item.statusTextDesp}}</view>
+            <view class='date-day'>{{item.online == 1 ? '' : (item.statusTextDesp || '')}}</view>
           </view>
           <view class='right'>
             <view class="date-icon iconfont  {{item.online == 0 ?'iconweizhi':'iconredu'}}"></view>

+ 14 - 2
pages/yuezhan/search_result/index.js

@@ -206,7 +206,13 @@ Page({
 
         // 拼接新数据
         let newExhibitionList = tempContent.concat(exhibitionList);
-
+        // 去重
+        newExhibitionList = newExhibitionList.reduce((acc, curr) => {
+          if (!acc.some(item => item.id === curr.id)) {
+            acc.push(curr);
+          }
+          return acc;
+        }, []);
         this.setData({
           currentPage: page,
           lastPage: false, // 有数据时设为false
@@ -258,6 +264,13 @@ Page({
 
          // 拼接新数据
          let newPavilionList = tempContent.concat(pavilionList);
+         // 去重
+         newPavilionList = newPavilionList.reduce((acc, curr) => {
+          if (!acc.some(item => item.id === curr.id)) {
+            acc.push(curr);
+          }
+          return acc;
+         }, []);
 
          this.setData({
            currentPage: page,
@@ -265,7 +278,6 @@ Page({
            loading: false,
            pavilionList: newPavilionList,
          });
-        console.log(pavilionList)
         wx.stopPullDownRefresh();
         console.log(res)
       }

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

@@ -56,8 +56,8 @@
                   <view class='desc'>
                     <view class="weui-media-box__desc">{{item.online == 1 ? '线上看展' :  item.statusTextDesp}}</view>
                     <view>
-                      <view class="iconfont {{item.hasProduct?'iconredu':'iconweizhi'}}"></view>
-                      <text>{{item.hasProduct?item.pv:(item.distance || 0) +' km'}}</text>
+                      <view class="iconfont {{item.online?'iconredu':'iconweizhi'}}"></view>
+                      <text>{{item.online?item.pv:(item.distance || 0) +' km'}}</text>
                     </view>
                   </view>
                 </view>
@@ -151,8 +151,8 @@
                       <view class='desc'>
                         <view class="weui-media-box__desc">{{item.online == 1 ? '线上看展' :  item.statusTextDesp}}</view>
                         <view>
-                          <view class="iconfont {{item.hasProduct?'iconredu':'iconweizhi'}}"></view>
-                          <text>{{item.hasProduct?item.pv:(item.distance || 0 )+' km'}}</text>
+                          <view class="iconfont {{item.online?'iconredu':'iconweizhi'}}"></view>
+                          <text>{{item.online?item.pv:(item.distance || 0 )+' km'}}</text>
                         </view>
                       </view>
                     </view>

+ 1 - 1
pages/zhanxun/index.wxml

@@ -21,7 +21,7 @@
   <!-- 线上看展内容 -->
   <view hidden="{{activeIndex!=0}}">
     <view class="exhibition-list">
-      <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="{{onlineExhibitionList}}" wx:key="index" class='fdkz-card'>
+      <navigator hover-class='none' url="{{item.online ? ('../wv_page/index?link='+item.product.link+'&id='+item.id+'&imageUrl='+item.imageUrl+'&relayUrl='+item.relayUrl):('../zl_detail/index?id='+item.id+'&imageUrl='+item.imageUrl+'&relayUrl='+item.relayUrl)}}" wx:for="{{onlineExhibitionList}}" wx:key="index" class='fdkz-card'>
         <view class='fdkz-card-img'>
           <view class="new-fdkz-card-tag">
             <text class='fdkz-card-tag-txt'>线上看展</text>

+ 14 - 1
pages/zl_detail/index.js

@@ -334,6 +334,7 @@ Page({
         addressName: exhibitionDetail.address,
         longitude: exhibitionDetail.longitude || 113.324520,
         type: exhibitionDetail.hasCollect,
+        relayUrl: exhibitionDetail.relayUrl,
         comments,
         _show_star: _show_star,
         markers: [
@@ -361,6 +362,16 @@ Page({
           title: exhibitionDetail.name
         })
       }
+    },fail => {
+      wx.showToast({
+        title: '页面不存在',
+        icon: 'none'
+      });
+      setTimeout(() => {
+        wx.switchTab({
+          url: '/pages/yuezhan/index',
+        })
+      }, 1000);
     })
   },
 
@@ -410,6 +421,8 @@ Page({
    * 用户点击右上角分享
    */
   onShareAppMessage: function () {
-
+    return {
+      imageUrl: this.data.relayUrl || '' // 图片 URL
+    }
   }
 })

+ 8 - 2
utils/newServices.js

@@ -63,7 +63,10 @@ const urls = {
   // 归藏轮播图接口
   getAntiqueList: '/wx/antique/page',
   // 归藏详情接口
-  getAntiqueDetail: '/wx/antique'
+  getAntiqueDetail: '/wx/antique',
+
+  // 新足迹接口
+  getTrace: '/wx/user/trace'
 };
 
 const requestFns = {};
@@ -128,9 +131,12 @@ Object.keys(urls).forEach(function(key) {
         } else if (res.data.code == 15001) {
           Toast.showToast('warn', '您已经发表过评论,不能重复评论');
           fail(res);
-        } else if(res.data.code == 16001){
+        } else if(res.data.code == 17001){
           Toast.showToast('warn', '未登录,无法操作');
           fail(res);
+        } else if([16001, 18001, 14001].includes(res.data.code)){
+          // 页面不存在
+          fail(res);
         } else {
           // Toast.showToast('warn', res.data.msg || '网络超时,请检查网络');
           fail(res);