Explorar o código

新增富文本解析器和bugfix

wangfumin hai 1 mes
pai
achega
450ef54ede
Modificáronse 100 ficheiros con 1198 adicións e 173 borrados
  1. 124 3
      app.js
  2. 1 0
      app.wxss
  3. 3 2
      components/loading/index.wxss
  4. 42 24
      components/time-select/time-select.js
  5. 1 1
      pages/collection/index.json
  6. 19 1
      pages/exhibition/activeDetails/index.js
  7. 4 4
      pages/exhibition/activeDetails/index.json
  8. 1 1
      pages/exhibition/activeDetails/index.wxml
  9. 5 6
      pages/exhibition/index.js
  10. 3 3
      pages/exhibition/index.json
  11. 7 7
      pages/exhibition/index.wxml
  12. 1 0
      pages/exhibition/index.wxss
  13. 110 6
      pages/index/active-page/active-page.js
  14. 1 1
      pages/index/active-page/active-page.json
  15. 10 1
      pages/index/active-page/active-page.wxml
  16. 12 0
      pages/index/active-page/active-page.wxss
  17. 1 1
      pages/index/active-people/active-people.js
  18. 1 1
      pages/index/active-people/active-people.json
  19. 108 2
      pages/index/active-preview/active-preview.js
  20. 2 2
      pages/index/active-preview/active-preview.json
  21. 13 8
      pages/index/active-preview/active-preview.wxml
  22. 1 1
      pages/index/activity/activity.json
  23. 50 2
      pages/index/index.js
  24. 1 1
      pages/index/index.json
  25. 6 6
      pages/index/index.wxml
  26. 12 0
      pages/index/index.wxss
  27. 1 1
      pages/index/news/news.json
  28. 135 14
      pages/index/start-preview/start-preview.js
  29. 2 2
      pages/index/start-preview/start-preview.json
  30. 4 4
      pages/index/start-preview/start-preview.wxml
  31. 12 0
      pages/index/start-preview/start-preview.wxss
  32. 1 1
      pages/index/visit-people/visit-people.js
  33. 137 2
      pages/index/visit-preview/visit-preview.js
  34. 2 2
      pages/index/visit-preview/visit-preview.json
  35. 10 5
      pages/index/visit-preview/visit-preview.wxml
  36. 1 1
      pages/user/feedback/index.json
  37. 68 15
      pages/user/index.js
  38. 3 3
      pages/user/index.wxml
  39. 10 1
      pages/user/index.wxss
  40. 146 16
      pages/user/map/index.js
  41. 1 1
      pages/user/map/index.json
  42. 24 14
      pages/user/map/index.wxml
  43. 33 0
      pages/user/map/index.wxss
  44. 4 4
      pages/user/my-preview/index.js
  45. 1 1
      pages/user/my-preview/index.json
  46. 1 1
      pages/user/userList/index.json
  47. 62 0
      utils/api.js
  48. 1 1
      utils/request.js
  49. BIN=BIN
      utils/wxParse/emojis/00.gif
  50. BIN=BIN
      utils/wxParse/emojis/01.gif
  51. BIN=BIN
      utils/wxParse/emojis/02.gif
  52. BIN=BIN
      utils/wxParse/emojis/03.gif
  53. BIN=BIN
      utils/wxParse/emojis/04.gif
  54. BIN=BIN
      utils/wxParse/emojis/05.gif
  55. BIN=BIN
      utils/wxParse/emojis/06.gif
  56. BIN=BIN
      utils/wxParse/emojis/07.gif
  57. BIN=BIN
      utils/wxParse/emojis/08.gif
  58. BIN=BIN
      utils/wxParse/emojis/09.gif
  59. BIN=BIN
      utils/wxParse/emojis/10.gif
  60. BIN=BIN
      utils/wxParse/emojis/100.gif
  61. BIN=BIN
      utils/wxParse/emojis/101.gif
  62. BIN=BIN
      utils/wxParse/emojis/102.gif
  63. BIN=BIN
      utils/wxParse/emojis/103.gif
  64. BIN=BIN
      utils/wxParse/emojis/104.gif
  65. BIN=BIN
      utils/wxParse/emojis/105.gif
  66. BIN=BIN
      utils/wxParse/emojis/106.gif
  67. BIN=BIN
      utils/wxParse/emojis/107.gif
  68. BIN=BIN
      utils/wxParse/emojis/108.gif
  69. BIN=BIN
      utils/wxParse/emojis/109.gif
  70. BIN=BIN
      utils/wxParse/emojis/11.gif
  71. BIN=BIN
      utils/wxParse/emojis/110.gif
  72. BIN=BIN
      utils/wxParse/emojis/111.gif
  73. BIN=BIN
      utils/wxParse/emojis/112.gif
  74. BIN=BIN
      utils/wxParse/emojis/113.gif
  75. BIN=BIN
      utils/wxParse/emojis/114.gif
  76. BIN=BIN
      utils/wxParse/emojis/115.gif
  77. BIN=BIN
      utils/wxParse/emojis/116.gif
  78. BIN=BIN
      utils/wxParse/emojis/117.gif
  79. BIN=BIN
      utils/wxParse/emojis/118.gif
  80. BIN=BIN
      utils/wxParse/emojis/119.gif
  81. BIN=BIN
      utils/wxParse/emojis/12.gif
  82. BIN=BIN
      utils/wxParse/emojis/120.gif
  83. BIN=BIN
      utils/wxParse/emojis/121.gif
  84. BIN=BIN
      utils/wxParse/emojis/122.gif
  85. BIN=BIN
      utils/wxParse/emojis/123.gif
  86. BIN=BIN
      utils/wxParse/emojis/124.gif
  87. BIN=BIN
      utils/wxParse/emojis/125.gif
  88. BIN=BIN
      utils/wxParse/emojis/126.gif
  89. BIN=BIN
      utils/wxParse/emojis/127.gif
  90. BIN=BIN
      utils/wxParse/emojis/128.gif
  91. BIN=BIN
      utils/wxParse/emojis/129.gif
  92. BIN=BIN
      utils/wxParse/emojis/13.gif
  93. BIN=BIN
      utils/wxParse/emojis/130.gif
  94. BIN=BIN
      utils/wxParse/emojis/131.gif
  95. BIN=BIN
      utils/wxParse/emojis/132.gif
  96. BIN=BIN
      utils/wxParse/emojis/133.gif
  97. BIN=BIN
      utils/wxParse/emojis/134.gif
  98. BIN=BIN
      utils/wxParse/emojis/14.gif
  99. BIN=BIN
      utils/wxParse/emojis/15.gif
  100. 0 0
      utils/wxParse/emojis/16.gif

+ 124 - 3
app.js

@@ -9,8 +9,44 @@ App({
     const logs = wx.getStorageSync('logs') || []
     // logs.unshift(Date.now())
     // wx.setStorageSync('logs', logs)
-    // 微信登录获取token
-    this.wxLogin()
+    
+    // 检查是否已有登录状态
+    const token = wx.getStorageSync('token')
+    if (token) {
+      // 已登录,直接设置全局数据
+      this.globalData.token = token
+      const userInfo = wx.getStorageSync('userInfo')
+      if (userInfo) {
+        this.globalData.userInfo = userInfo
+      }
+      // 获取访问token
+      this.getAccessToken()
+      // 启动定时刷新token
+      this.startTokenRefreshTimer()
+    } else {
+      // 未登录,显示授权弹窗
+      this.showLoginModal()
+    }
+  },
+
+  // 显示登录授权弹窗
+  showLoginModal() {
+    wx.showModal({
+      title: '登录授权',
+      content: '为了给您提供更好的服务,需要获取您的微信登录信息,是否同意?',
+      confirmText: '同意',
+      cancelText: '暂不',
+      success: (res) => {
+        if (res.confirm) {
+          // 用户同意,进行微信登录
+          this.wxLogin()
+        } else {
+          // 用户拒绝,保持未登录状态
+          console.log('用户拒绝登录授权,保持未登录状态')
+          this.globalData.isGuest = true
+        }
+      }
+    })
   },
 
   // 微信登录方法
@@ -58,9 +94,15 @@ App({
           this.globalData.token = token
           // 也存储到本地存储
           wx.setStorageSync('token', token)
+          // 登录成功,设置为非游客状态
+          this.globalData.isGuest = false
           console.log('token获取成功:', token)
           // 登录成功后获取token
           this.getAccessToken()
+          // 启动定时刷新token
+          this.startTokenRefreshTimer()
+          // 通知所有页面更新登录状态
+          this.notifyLoginStatusChange()
         } else {
           console.error('登录失败:', response.data.message || '未知错误')
         }
@@ -100,8 +142,87 @@ App({
     })
   },
 
+  // 手动触发登录(供其他页面调用)
+  triggerLogin() {
+    this.showLoginModal()
+  },
+
+  // 启动定时刷新token
+  startTokenRefreshTimer() {
+    // 清除之前的定时器
+    if (this.globalData.refreshTimer) {
+      clearInterval(this.globalData.refreshTimer)
+    }
+    
+    // 设置每10分钟刷新一次token(600000毫秒)
+    this.globalData.refreshTimer = setInterval(() => {
+      if (this.globalData.token) {
+        console.log('定时刷新token开始')
+        utils.refreshToken()
+          .then(newToken => {
+            console.log('定时刷新token成功:', newToken)
+          })
+          .catch(error => {
+            console.error('定时刷新token失败:', error)
+            // 如果刷新失败,可能需要重新登录
+            if (error.includes('token') || error.includes('401')) {
+              this.logout()
+              this.showLoginModal()
+            }
+          })
+      }
+    }, 600000) // 10分钟 = 600000毫秒
+  },
+
+  // 停止定时刷新token
+  stopTokenRefreshTimer() {
+    if (this.globalData.refreshTimer) {
+      clearInterval(this.globalData.refreshTimer)
+      this.globalData.refreshTimer = null
+    }
+  },
+
+  // 退出登录
+  logout() {
+    // 停止定时刷新token
+    this.stopTokenRefreshTimer()
+    
+    // 清除本地存储
+    wx.removeStorageSync('token')
+    wx.removeStorageSync('userInfo')
+    wx.removeStorageSync('accessToken')
+    
+    // 清除全局数据
+    this.globalData.userInfo = null
+    this.globalData.token = null
+    this.globalData.accessToken = null
+    this.globalData.isGuest = true
+    
+    console.log('用户已退出登录')
+    
+    // 通知所有页面更新登录状态
+    this.notifyLoginStatusChange()
+  },
+
+  // 通知所有页面更新登录状态
+  notifyLoginStatusChange() {
+    // 获取当前页面栈
+    const pages = getCurrentPages()
+    if (pages.length > 0) {
+      // 获取当前页面
+      const currentPage = pages[pages.length - 1]
+      // 如果当前页面有checkLoginStatus方法,则调用它
+      if (currentPage && typeof currentPage.checkLoginStatus === 'function') {
+        currentPage.checkLoginStatus()
+      }
+    }
+  },
+
   globalData: {
     userInfo: null,
-    token: null
+    token: null,
+    accessToken: null,
+    isGuest: false, // 是否为游客状态
+    refreshTimer: null // 定时刷新token的定时器
   }
 })

+ 1 - 0
app.wxss

@@ -1,4 +1,5 @@
 /**app.wxss**/
+@import "utils/wxParse/wxParse.wxss";
 .container {
   height: 100%;
   display: flex;

+ 3 - 2
components/loading/index.wxss

@@ -8,7 +8,7 @@
   display: flex;
   flex-direction: column;
   justify-content: center;
-  align-items: center;
+  /* align-items: center; */
   position: relative;
 }
 
@@ -97,7 +97,8 @@
   display: flex;
   flex-direction: column;
   align-items: center;
-  justify-content: center;
+  /* justify-content: center; */
+  padding-top: 30%;
   width: 100%;
   height: 100%;
   overflow: hidden;

+ 42 - 24
components/time-select/time-select.js

@@ -1,3 +1,4 @@
+const { museumApi } = require('../../utils/api.js');
 Component({
   properties: {
     // 可以接收外部传入的属性
@@ -27,30 +28,47 @@ Component({
   methods: {
     // 加载预约时段数据
     loadAppointmentSlots() {
-      // 这里应该调用实际的API接口
-      // 暂时使用模拟数据
-      const mockApiData = {
-        time: {
-          monday: 385,
-          tuesday: 250,
-          wednesday: 250,
-          thursday: 250,
-          friday: 250,
-          saturday: 250,
-          sunday: 250
-        },
-        stopDate: {
-          rtf: "2025-06-08,2025-06-14"
-        }
-      };
-      
-      this.setData({
-        apiData: mockApiData
-      }, () => {
-        // 确保apiData设置完成后再初始化日历和默认日期
-        this.initCalendar();
-        this.initDefaultDate();
-      });
+      museumApi.getSlots()
+        .then(response => {
+          console.log('获取预约时段数据成功:', response);
+          
+          // 根据实际API返回的数据结构进行处理
+          const apiData = response.data || response;
+          
+          this.setData({
+            apiData: apiData
+          }, () => {
+            // 确保apiData设置完成后再初始化日历和默认日期
+            this.initCalendar();
+            this.initDefaultDate();
+          });
+        })
+        .catch(error => {
+          console.error('获取预约时段数据失败:', error);
+          
+          // 如果API调用失败,使用默认数据确保组件正常工作
+          const defaultApiData = {
+            time: {
+              monday: 0,
+              tuesday: 0,
+              wednesday: 0,
+              thursday: 0,
+              friday: 0,
+              saturday: 0,
+              sunday: 0
+            },
+            stopDate: {
+              rtf: ""
+            }
+          };
+          
+          this.setData({
+            apiData: defaultApiData
+          }, () => {
+            this.initCalendar();
+            this.initDefaultDate();
+          });
+        });
     },
 
     // 初始化日历

+ 1 - 1
pages/collection/index.json

@@ -1,5 +1,5 @@
 {
-  "navigationBarTitleText": "典藏",
+  "navigationBarTitleText": "克拉玛依市博物馆",
   "enablePullDownRefresh": false,
   "onReachBottomDistance": 50,
   "usingComponents": {}

+ 19 - 1
pages/exhibition/activeDetails/index.js

@@ -13,13 +13,17 @@ Page({
     isFrom: '',
     shouldShowBackButton: true,
     isPreviewMode: false,
-    formattedPublishTime: ''
+    formattedPublishTime: '',
+    isLoggedIn: false
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
+    // 检查登录状态
+    this.checkLoginStatus();
+    
     // 检查是否来自微信,如果是则隐藏返回按钮
     if (options.isfrom === 'weixin') {
       this.setData({
@@ -409,7 +413,21 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow() {
+    // 每次显示页面时检查登录状态
+    this.checkLoginStatus();
+  },
 
+  /**
+   * 检查登录状态
+   */
+  checkLoginStatus() {
+    const app = getApp();
+    const token = wx.getStorageSync('token');
+    const isLoggedIn = !!(token && !app.globalData.isGuest);
+    
+    this.setData({
+      isLoggedIn: isLoggedIn
+    });
   },
 
   /**

+ 4 - 4
pages/exhibition/activeDetails/index.json

@@ -1,9 +1,9 @@
 {
-  "usingComponents": {},
-  "navigationBarTitleText": "详情",
-  "navigationBarBackgroundColor": "#B8956A",
-  "navigationBarTextStyle": "white",
+  "navigationBarTitleText": "克拉玛依市博物馆",
+  "navigationBarTextStyle": "black",
+  "navigationBarBackgroundColor": "#fff",
   "backgroundColor": "#f8f8f8",
   "enablePullDownRefresh": false,
+  "usingComponents": {},
   "onReachBottomDistance": 50
 }

+ 1 - 1
pages/exhibition/activeDetails/index.wxml

@@ -63,7 +63,7 @@
     </view>
     
     <!-- 活动预约按钮 -->
-    <view wx:if="{{detailData.personCount > 0 && fromtype == 'activity'}}" class="active-preview-btn">
+    <view wx:if="{{detailData.personCount > 0 && fromtype == 'activity' && isLoggedIn}}" class="active-preview-btn">
       <view class="preview-btn" bindtap="goToActivePreview">
         活动预约
       </view>

+ 5 - 6
pages/exhibition/index.js

@@ -137,14 +137,13 @@ Page({
 
   // 线上观展点击事件
   onOnlineExhibitionTap(e) {
-    console.log('线上观展点击事件触发', e.currentTarget.dataset.item);
     // e.stopPropagation(); // 阻止事件冒泡
-    const item = e.currentTarget.dataset.item;
-    if (item.webSite) {
-      console.log('跳转到webSite:', item.webSite);
-      navigateToWebview(item.webSite,'open');
+    const webSite = 'https://www.4dmodel.com/SuperTwoCustom/KLMYscene/?m=SG-alDn3FU4jQ8';
+    if (webSite) {
+      console.log('跳转到webSite:', webSite);
+      navigateToWebview(webSite,'open');
     } else {
-      this.goToDetail(item.exhibitId);
+      // this.goToDetail(item.exhibitId);
       console.log('webSite为空');
     }
   },

+ 3 - 3
pages/exhibition/index.json

@@ -1,7 +1,7 @@
 {
-  "navigationBarTitleText": "展览",
-  "navigationBarBackgroundColor": "#B1967B",
-  "navigationBarTextStyle": "white",
+  "navigationBarTitleText": "克拉玛依市博物馆",
+  "navigationBarBackgroundColor": "#fff",
+  "navigationBarTextStyle": "black",
   "backgroundColor": "#f8f8f8",
   "enablePullDownRefresh": false,
   "usingComponents": {}

+ 7 - 7
pages/exhibition/index.wxml

@@ -2,16 +2,16 @@
 <view class="exhibition-container">
   <!-- 轮播图 -->
   <view class="carousel-section">
-    <swiper class="carousel" indicator-dots="{{true}}" autoplay="{{true}}" interval="3000" duration="500">
-      <swiper-item wx:for="{{carouselList}}" wx:key="exhibitId" bindtap="onOnlineExhibitionTap" data-item="{{item}}">
-        <image class="carousel-image" src="{{item.img}}" mode="aspectFill"></image>
+    <!-- <swiper class="carousel" indicator-dots="{{true}}" autoplay="{{true}}" interval="3000" duration="500"> -->
+      <view class="carousel" bindtap="onOnlineExhibitionTap">
+        <image class="carousel-image" src="https://sit-kelamayi.4dage.com/mini/wxImg/zhanlan.png" mode="aspectFill"></image>
         <!-- 线上观展标识 -->
-        <view class="online-exhibition" wx:if="{{item.webSite}}" bindtap="onOnlineExhibitionTap" data-item="{{item}}">
+        <view class="online-exhibition" bindtap="onOnlineExhibitionTap">
           <image class="online-icon" src="https://sit-kelamayi.4dage.com/mini/wxImg/exhibition/online-kz.png" mode="aspectFit"></image>
           <text class="online-text">线上观展</text>
         </view>
-      </swiper-item>
-    </swiper>
+      </view>
+    <!-- </swiper> -->
   </view>
 
   <!-- 分类选择 -->
@@ -33,7 +33,7 @@
     <view class="exhibition-item" wx:for="{{exhibitionList}}" wx:key="exhibitId" bindtap="onExhibitionTap" data-item="{{item}}">
       <image class="exhibition-image" src="{{item.img}}" mode="aspectFill"></image>
       <view class="exhibition-content">
-        <text class="exhibition-title">{{item.exhibitName || '记忆与传承的艺术史'}}</text>
+        <text class="exhibition-title">{{item.title || '记忆与传承的艺术史'}}</text>
       </view>
     </view>
   </view>

+ 1 - 0
pages/exhibition/index.wxss

@@ -13,6 +13,7 @@
 }
 
 .carousel {
+  position: relative;
   height: 400rpx;
   width: 100%;
 }

+ 110 - 6
pages/index/active-page/active-page.js

@@ -8,7 +8,10 @@ Page({
     step: 1,
     activityId: 0, // 活动ID
     type: 1, // 预约类型:1-普通预约,2-活动预约
-    activityData: {}
+    activityData: {},
+    isTimeExpired: false, // 时间段是否已过期
+    currentTicketCount: 0, // 当前选择日期的票数
+    currentActivityTime: '' // 当前选择日期的活动时间
   },
 
   onLoad(options) {
@@ -46,13 +49,17 @@ Page({
     if (selectedDate) {
       this.setData({
         selectedDate: selectedDate,
-        selectedTime: '' // 清空时间选择状态
+        selectedTime: '', // 清空时间选择状态
       });
+      
+      // 获取该日期的活动票数和时间信息
+      this.getActivityTicketInfo(selectedDate);
     } else {
       // 如果日期不可选,清空选择状态
       this.setData({
         selectedDate: null,
-        selectedTime: ''
+        selectedTime: '',
+        isTimeExpired: false
       });
     }
   },
@@ -65,15 +72,50 @@ Page({
     return `${year}-${month}-${day}`;
   },
 
+  // 检查活动时间是否已过期
+  checkActivityTimeExpired(activityTime, selectedDate) {
+    if (!activityTime || !selectedDate) return false;
+    
+    const now = new Date();
+    const today = this.formatDate(now);
+    
+    // 如果选择的不是今天,则不需要检查过期
+    if (selectedDate !== today) return false;
+    
+    // 解析活动时间段,获取结束时间
+    const timeMatch = activityTime.match(/(\d{1,2}):(\d{2})-(\d{1,2}):(\d{2})/);
+    if (!timeMatch) return false;
+    
+    const endHour = parseInt(timeMatch[3]);
+    const endMinute = parseInt(timeMatch[4]);
+    
+    // 创建今天的结束时间
+    const endTime = new Date();
+    endTime.setHours(endHour, endMinute, 0, 0);
+    
+    // 如果当前时间已经超过结束时间,则过期
+    return now > endTime;
+  },
+
 
 
   // 选择时间段
   selectTime(e) {
-    if (this.data.selectedDate && this.data.activityData.time) {
+    // 如果时间已过期,则不允许选择
+    if (this.data.isTimeExpired) {
+      wx.showToast({
+        title: '已超时可预约时间段',
+        icon: 'none'
+      });
+      return;
+    }
+    
+    const timeToUse = this.data.currentActivityTime || this.data.activityData.time;
+    if (this.data.selectedDate && timeToUse) {
       this.setData({
         selectedTime: 'selected'
       });
-      console.log('选择的时间段:', this.data.activityData.time);
+      console.log('选择的时间段:', timeToUse);
     } else {
       wx.showToast({
         title: '请先选择日期',
@@ -84,6 +126,23 @@ Page({
 
   // 下一步
   goNext() {
+    if (!this.data.selectedDate) {
+      wx.showToast({
+        title: '请选择日期',
+        icon: 'none'
+      });
+      return;
+    }
+    
+    // 检查时间是否已过期
+    if (this.data.isTimeExpired) {
+      wx.showToast({
+        title: '当前时间不在可预约时间段内',
+        icon: 'none'
+      });
+      return;
+    }
+    
     if (this.data.selectedDate && this.data.activityData.title) {
       console.log('选择的日期:', this.data.selectedDate);
       console.log('活动标题:', this.data.activityData.title);
@@ -117,10 +176,16 @@ Page({
         if (response) {
           const activityData = response;
           console.log('活动数据:', activityData);
-          // 将活动数据设置到页面data中,通过属性传递给子组件
+          
+          // 将活动数据设置到页面data中
           this.setData({
             activityData: activityData
           });
+          
+          // 如果已经选择了日期,获取该日期的票数和时间信息
+          if (this.data.selectedDate) {
+            this.getActivityTicketInfo(this.data.selectedDate);
+          }
         } else {
           console.log('API响应数据为空:', response);
         }
@@ -128,5 +193,44 @@ Page({
       .catch(error => {
         console.error('获取活动详情失败:', error);
       });
+  },
+
+  // 获取活动票数和时间信息
+  getActivityTicketInfo(date) {
+    if (!this.data.activityId || !date) {
+      return;
+    }
+    
+    const params = {
+      activityId: this.data.activityId,
+      date: date
+    };
+    
+    console.log('获取活动票数信息,参数:', params);
+    
+    museumApi.getActivityticket(params)
+      .then(response => {
+        console.log('获取活动票数成功:', response);
+        if (response) {
+          // 检查活动时间是否已过期
+          const isExpired = this.checkActivityTimeExpired(response.time, date);
+          
+          // 更新当前选择日期的票数和时间信息
+           this.setData({
+             currentActivityTime: response.time,
+             currentTicketCount: response.personCount,
+             isTimeExpired: isExpired
+           });
+        } else {
+          console.log('获取活动票数API响应数据为空:', response);
+        }
+      })
+      .catch(error => {
+        console.error('获取活动票数失败:', error);
+        wx.showToast({
+          title: '获取票数信息失败',
+          icon: 'none'
+        });
+      });
   }
 });

+ 1 - 1
pages/index/active-page/active-page.json

@@ -1,5 +1,5 @@
 {
-  "navigationBarTitleText": "活动预约",
+  "navigationBarTitleText": "克拉玛依市博物馆",
   "usingComponents": {
     "active-time-select": "/components/active-time-select/index",
     "active-people": "/pages/index/active-people/active-people"

+ 10 - 1
pages/index/active-page/active-page.wxml

@@ -3,7 +3,16 @@
     <active-time-select activity-data="{{activityData}}" bind:datechange="onDateChange"></active-time-select>
     <view class="divider"></view>
     <view class="select-moon" wx:if="{{selectedDate}}">
-      <view class="next-btn {{!selectedDate ? 'disabled' : ''}}" bindtap="goNext" disabled="{{!selectedDate}}">下一步</view>
+      <text class="moon-time">请选择进馆时间</text>
+      <view class="morning-moon">
+        <view class="time-card {{!isTimeExpired ? 'active' : ''}} {{isTimeExpired ? 'disabled' : ''}}" bindtap="selectTime">
+          <view class="time-range">({{currentActivityTime || activityData.time}})</view>
+          <view class="availability">{{'余票' + currentTicketCount + '张'}}</view>
+          <view class="check-icon" wx:if="{{!isTimeExpired}}">✓</view>
+        </view>
+        
+        <view class="next-btn {{!currentTicketCount || isTimeExpired ? 'disabled' : ''}}" bindtap="goNext" disabled="{{!currentTicketCount || isTimeExpired}}">下一步</view>
+      </view>
     </view>
   </view>
 </view>

+ 12 - 0
pages/index/active-page/active-page.wxss

@@ -53,6 +53,18 @@
   border-color: #B1967B;
 }
 
+.time-card.disabled {
+  opacity: 0.5;
+  border-color: #ccc;
+  pointer-events: none;
+}
+
+.time-card.disabled .time-period,
+.time-card.disabled .time-range,
+.time-card.disabled .availability {
+  color: #999;
+}
+
 .time-period {
   font-size: 32rpx;
   font-weight: bold;

+ 1 - 1
pages/index/active-people/active-people.js

@@ -362,7 +362,7 @@ Page({
         showSuccessModal: false
       });
       // 跳转到我的预约页面
-      wx.navigateTo({
+      wx.reLaunch({
         url: '/pages/user/my-preview/index'
       })
     },

+ 1 - 1
pages/index/active-people/active-people.json

@@ -1,4 +1,4 @@
 {
-  "navigationBarTitleText": "参观人信息",
+  "navigationBarTitleText": "克拉玛依市博物馆",
   "usingComponents": {}
 }

+ 108 - 2
pages/index/active-preview/active-preview.js

@@ -3,12 +3,17 @@ const { museumApi } = require('../../../utils/api.js');
 
 Page({
   data: {
-    activityList: [] // 活动列表
+    activityList: [], // 活动列表
+    openTime: '10:00', // 开馆时间
+    closeTime: '18:00', // 闭馆时间
+    stopCheckTime: '17:00', // 停止检票时间
+    noticeContent: '' // 预约须知内容
   },
 
   onLoad(options) {
     // 页面加载时的逻辑
     this.loadActivityList();
+    this.loadNoticeContent();
   },
 
   onShow() {
@@ -19,7 +24,8 @@ Page({
   loadActivityList() {
     museumApi.getSocialActivityList({
       pageSize: 100,
-      status: 1
+      status: 1,
+      subscribe: 1
     })
     .then(response => {
       console.log('获取活动列表成功:', response);
@@ -27,6 +33,7 @@ Page({
         this.setData({
           activityList: response.records
         });
+        this.updateTimeInfoFromActivity(response.records);
       }
     })
     .catch(error => {
@@ -34,6 +41,105 @@ Page({
     });
   },
 
+  // 加载预约须知内容
+  loadNoticeContent() {
+    console.log('获取预约须知内容');
+    
+    // 调用API获取预约须知
+    museumApi.getSlots()
+      .then(res => {
+        console.log('获取预约须知成功:', res);
+        if (res) {
+          this.setData({
+            noticeContent: res.notice.rtf
+          });
+          
+        } else {
+          console.error('获取预约须知失败:', res.message || '未知错误');
+        }
+      })
+      .catch(err => {
+        console.error('获取预约须知异常:', err);
+      });
+  },
+
+  // 从活动数据更新时间信息
+  updateTimeInfoFromActivity(activityList) {
+    // 获取当前日期的预约时段来更新时间信息
+    const today = new Date();
+    const dateString = today.getFullYear() + '-' + 
+      String(today.getMonth() + 1).padStart(2, '0') + '-' + 
+      String(today.getDate()).padStart(2, '0');
+    
+    museumApi.getSlotsByDate(dateString)
+      .then(res => {
+        if (res && res.length > 0) {
+          this.updateTimeInfo(res);
+        }
+      })
+      .catch(err => {
+        console.error('获取预约时段异常:', err);
+      });
+  },
+
+  // 更新时间信息
+  updateTimeInfo(data) {
+    let openTime = '10:00';
+    let closeTime = '18:00';
+    let stopCheckTime = '17:00';
+
+    if (data.length === 1) {
+      // 只有一项数据,直接取time
+      const timeRange = data[0].time;
+      if (timeRange && timeRange.includes('-')) {
+        const times = timeRange.split('-');
+        openTime = times[0];
+        closeTime = times[1];
+      }
+    } else if (data.length >= 2) {
+      // 有两项或更多数据
+      const firstTime = data[0].time;
+      const lastTime = data[data.length - 1].time;
+      
+      if (firstTime && firstTime.includes('-')) {
+        openTime = firstTime.split('-')[0];
+      }
+      
+      if (lastTime && lastTime.includes('-')) {
+        closeTime = lastTime.split('-')[1];
+      }
+    }
+
+    // 计算停止检票时间(闭馆时间往前一个小时)
+    stopCheckTime = this.calculateStopCheckTime(closeTime);
+
+    this.setData({
+      openTime: openTime,
+      closeTime: closeTime,
+      stopCheckTime: stopCheckTime
+    });
+
+    console.log('更新时间信息:', { openTime, closeTime, stopCheckTime });
+  },
+
+  // 计算停止检票时间(闭馆时间往前一个小时)
+  calculateStopCheckTime(closeTime) {
+    try {
+      const [hours, minutes] = closeTime.split(':').map(Number);
+      let stopHour = hours - 1;
+      
+      // 处理跨天的情况
+      if (stopHour < 0) {
+        stopHour = 23;
+      }
+      
+      return String(stopHour).padStart(2, '0') + ':' + String(minutes).padStart(2, '0');
+    } catch (error) {
+      console.error('计算停止检票时间失败:', error);
+      return '17:00'; // 默认值
+    }
+  },
+
   // 返回首页
   goBack() {
     wx.switchTab({

+ 2 - 2
pages/index/active-preview/active-preview.json

@@ -1,6 +1,6 @@
 {
-  "navigationBarTitleText": "活动预约",
-  "navigationBarBackgroundColor": "#E0D2B4",
+  "navigationBarTitleText": "克拉玛依市博物馆",
+  "navigationBarBackgroundColor": "#fff",
   "navigationBarTextStyle": "black",
   "backgroundColor": "#E0D2B4",
   "enablePullDownRefresh": false,

+ 13 - 8
pages/index/active-preview/active-preview.wxml

@@ -18,30 +18,35 @@
 
     <view class="reservation-info">
       <view class="title">预约须知</view>
-
+      
       <view class="time-info">
         <view class="time-section">
           <text class="time-title">开馆时间</text>
-          <view class="time-value">10:00</view>
+          <view class="time-value">{{openTime}}</view>
         </view>
         <view class="line"></view>
         <view class="time-section">
           <text class="time-title">闭馆时间</text>
-          <view class="time-value">18:00</view>
+          <view class="time-value">{{closeTime}}</view>
         </view>
         <view class="divider"></view>
         <view class="time-section">
-          <view class="stop-time">17:00</view>
+          <view class="stop-time">{{stopCheckTime}}</view>
           <view class="stop-desc">停止检票</view>
         </view>
       </view>
-
+      
       <view class="time-note">周一闭馆(法定节假日除外,除夕、正月初一闭馆)。</view>
-
+      
       <view class="reservation-title">预约参观</view>
       <view class="reservation-rules">
-        <text class="rule-content">①所有观众(包括享受优待政策的观众及其陪同人员)<text class="notice">均须实名预约</text>。放票时间为<text class="notice">每日18:00,可提前7日(不包括当日)通过官方微信小程序预约</text>,预约时段分为上午(9:00-13:00)和下午(12:00-16:00),当天不再放票;</text>
-        <text class="rule-content">②参观当日须按照预约时段入馆参观,错过预约时段将谢绝入馆。<text class="notice">同一证件号</text>当天可进出馆2次,预约上午票的观众首次入馆时间必须在13:00前;</text>
+        <view wx:if="{{noticeContent}}" class="rule-content">
+          <text class="notice">{{noticeContent}}</text>
+        </view>
+        <view wx:else>
+          <text class="rule-content">①所有观众(包括享受优待政策的观众及其陪同人员)<text class="notice">均须实名预约</text>。放票时间为<text class="notice">每日18:00,可提前7日(不包括当日)通过官方微信小程序预约</text>,预约时段分为上午(9:00-13:00)和下午(12:00-16:00),当天不再放票;</text>
+          <text class="rule-content">②参观当日须按照预约时段入馆参观,错过预约时段将谢绝入馆。<text class="notice">同一证件号</text>当天可进出馆2次,预约上午票的观众首次入馆时间必须在13:00前;</text>
+        </view>
       </view>
     </view>
   </view>

+ 1 - 1
pages/index/activity/activity.json

@@ -1,5 +1,5 @@
 {
-  "navigationBarTitleText": "社教活动",
+  "navigationBarTitleText": "克拉玛依市博物馆",
   "navigationBarBackgroundColor": "#ffffff",
   "navigationBarTextStyle": "black",
   "backgroundColor": "#f5f5f5",

+ 50 - 2
pages/index/index.js

@@ -14,13 +14,17 @@ Page({
     newsList: [], // 资讯列表
     exhibitionList: [], // 展览列表
     activeList: [], // 活动列表
-    loading: false // 加载状态
+    loading: false, // 加载状态
+    isLoggedIn: false // 登录状态
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
+    // 检查登录状态
+    this.checkLoginStatus();
+    
     // 检查是否首次访问
     const hasVisited = wx.getStorageSync('hasVisited');
     if (!hasVisited) {
@@ -211,6 +215,13 @@ Page({
     const { type } = e.currentTarget.dataset;
     console.log(`点击了${type}功能`);
     
+    // 检查是否需要登录的功能
+    if ((type === 'visit' || type === 'activity') && !this.data.isLoggedIn) {
+      // 未登录,显示登录提示
+      this.showLoginPrompt();
+      return;
+    }
+    
     // 根据不同功能跳转到webview页面
     switch (type) {
       case 'visit':
@@ -247,7 +258,10 @@ Page({
   viewActivity(e) {
     const { item } = e.currentTarget.dataset;
     console.log(`查看活动${item.activityId}详情`);
-    this.navigateToWebview(`/allDetailsShow?isFrom=weixin&id=${item.activityId}&type=activity`);
+    // this.navigateToWebview(`/allDetailsShow?isFrom=weixin&id=${item.activityId}&type=activity`);
+    wx.navigateTo({
+      url: `/pages/exhibition/activeDetails/index?isFrom=weixin&id=${item.activityId}&type=activity`
+    });
   },
 
   /**
@@ -287,7 +301,41 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow() {
+    // 每次显示页面时检查登录状态
+    this.checkLoginStatus();
+  },
 
+  /**
+   * 检查登录状态
+   */
+  checkLoginStatus() {
+    const app = getApp();
+    const token = wx.getStorageSync('token');
+    const isLoggedIn = !!(token && !app.globalData.isGuest);
+    
+    this.setData({
+      isLoggedIn: isLoggedIn
+    });
+  },
+
+  /**
+   * 显示登录提示
+   */
+  showLoginPrompt() {
+    const app = getApp();
+    wx.showModal({
+      title: '登录提示',
+      content: '为了给您提供更好的服务,需要获取您的微信登录信息,是否同意?',
+      confirmText: '立即登录',
+      cancelText: '取消',
+      success: (res) => {
+        if (res.confirm) {
+          // 用户确认登录,调用app的登录方法
+          app.wxLogin();
+          // 登录弹窗关闭后,页面会重新显示,onShow会被触发,从而更新登录状态
+        }
+      }
+    });
   },
 
   /**

+ 1 - 1
pages/index/index.json

@@ -3,6 +3,6 @@
     "loading": "/components/loading/index"
   },
   "enablePullDownRefresh": false,
-  "navigationBarTitleText": "克拉玛依博物馆",
+  "navigationBarTitleText": "克拉玛依博物馆",
   "navigationStyle": "default"
 }

+ 6 - 6
pages/index/index.wxml

@@ -21,13 +21,13 @@
 
   <!-- 功能区域 -->
   <view class="function-section">
-    <view class="function-item" bindtap="handleFunctionClick" data-type="visit">
-      <image src="https://sit-kelamayi.4dage.com/mini/wxImg/indexPage/visit.png" alt="预约参观" class="function-icon"></image>
-      <text class="function-text">预约参观</text>
+    <view class="function-item {{!isLoggedIn ? 'function-item-disabled' : ''}}" bindtap="handleFunctionClick" data-type="visit">
+      <image src="https://sit-kelamayi.4dage.com/mini/wxImg/indexPage/visit.png" alt="预约参观" class="function-icon {{!isLoggedIn ? 'function-icon-disabled' : ''}}"></image>
+      <text class="function-text {{!isLoggedIn ? 'function-text-disabled' : ''}}">预约参观</text>
     </view>
-    <view class="function-item" bindtap="handleFunctionClick" data-type="activity">
-      <image src="https://sit-kelamayi.4dage.com/mini/wxImg/indexPage/activity.png" alt="活动预约" class="function-icon"></image>
-      <text class="function-text">活动预约</text>
+    <view class="function-item {{!isLoggedIn ? 'function-item-disabled' : ''}}" bindtap="handleFunctionClick" data-type="activity">
+      <image src="https://sit-kelamayi.4dage.com/mini/wxImg/indexPage/activity.png" alt="活动预约" class="function-icon {{!isLoggedIn ? 'function-icon-disabled' : ''}}"></image>
+      <text class="function-text {{!isLoggedIn ? 'function-text-disabled' : ''}}">活动预约</text>
     </view>
     <view class="function-item" bindtap="handleFunctionClick" data-type="map">
       <image src="https://sit-kelamayi.4dage.com/mini/wxImg/indexPage/map.png" alt="展馆地图" class="function-icon"></image>

+ 12 - 0
pages/index/index.wxss

@@ -46,17 +46,29 @@
   width: 22%;
 }
 
+.function-item-disabled {
+  opacity: 0.5;
+}
+
 .function-icon {
   width: 112rpx;
   height: 112rpx;
   margin-bottom: 10rpx;
 }
 
+.function-icon-disabled {
+  filter: grayscale(100%);
+}
+
 .function-text {
   font-size: 32rpx;
   color: #B1967B;
 }
 
+.function-text-disabled {
+  color: #999;
+}
+
 /* 通用区块样式 */
 .section {
   margin: 0 30rpx 0;

+ 1 - 1
pages/index/news/news.json

@@ -1,5 +1,5 @@
 {
-  "navigationBarTitleText": "展馆资讯",
+  "navigationBarTitleText": "克拉玛依市博物馆",
   "navigationBarBackgroundColor": "#ffffff",
   "navigationBarTextStyle": "black",
   "backgroundColor": "#f5f5f5",

+ 135 - 14
pages/index/start-preview/start-preview.js

@@ -10,7 +10,11 @@ Page({
     morningTime: '10:00-14:00',
     afternoonTime: '14:00-18:00',
     morningId: null,
-    afternoonId: null
+    afternoonId: null,
+    afternoonDisabled: false,
+    morningDisabled: false,
+    showMorning: true,
+    showAfternoon: true
   },
 
   onLoad(options) {
@@ -19,6 +23,7 @@ Page({
 
   onShow() {
     // 页面显示时的逻辑
+    console.log(22222)
   },
 
   // 日期选择回调
@@ -79,29 +84,122 @@ Page({
       });
   },
 
+  // 检查时间段是否已过期
+  isTimeSlotExpired(timeRange, selectedDate) {
+    if (!timeRange || !selectedDate) return false;
+    
+    const now = new Date();
+    const today = this.formatDate(now);
+    
+    // 如果选择的不是今天,则不需要检查过期
+    if (selectedDate !== today) return false;
+    
+    // 解析时间段,获取结束时间
+    const timeMatch = timeRange.match(/(\d{1,2}):(\d{2})-(\d{1,2}):(\d{2})/);
+    if (!timeMatch) return false;
+    
+    const endHour = parseInt(timeMatch[3]);
+    const endMinute = parseInt(timeMatch[4]);
+    
+    // 创建今天的结束时间
+    const endTime = new Date();
+    endTime.setHours(endHour, endMinute, 0, 0);
+    
+    // 如果当前时间已经超过结束时间,则过期
+    return now > endTime;
+  },
+
   // 更新余票显示
   updateAvailability(data) {
     // 根据API返回的数据更新余票显示
-    // 只取前两项数据,第一项为上午,第二项为下午
     let morningText = '余票充足';
     let afternoonText = '余票充足';
     let morningTime = '10:00-14:00';
     let afternoonTime = '14:00-18:00';
     let morningId = null;
     let afternoonId = null;
+    let afternoonDisabled = false;
+    let morningDisabled = false;
+    let showMorning = true;
+    let showAfternoon = true;
+    
     console.log('更新余票显示,数据:', data);
-    if (data && Array.isArray(data) && data.length >= 2) {
-      // 第一项为上午
-      const morningData = data[0];
-      morningText = morningData.pcs > 0 ? `余票${morningData.pcs}张` : '已约满';
-      morningTime = morningData.time;
-      morningId = morningData.id;
+    
+    if (data && Array.isArray(data) && data.length > 0) {
+      if (data.length >= 2) {
+        // 有两项数据,按现有逻辑显示
+        const morningData = data[0];
+        const afternoonData = data[1];
+        
+        morningText = morningData.pcs > 0 ? `余票${morningData.pcs}张` : '已约满';
+        morningTime = morningData.time;
+        morningId = morningData.id;
+        
+        afternoonText = afternoonData.pcs > 0 ? `余票${afternoonData.pcs}张` : '已约满';
+        afternoonTime = afternoonData.time;
+        afternoonId = afternoonData.id;
+        
+        // 检查时间段是否已过期
+        morningDisabled = this.isTimeSlotExpired(morningTime, this.data.selectedDate);
+        if (morningDisabled) {
+          morningText = '已过期';
+        }
+        
+        afternoonDisabled = this.isTimeSlotExpired(afternoonTime, this.data.selectedDate);
+        if (afternoonDisabled) {
+          afternoonText = '已过期';
+        }
+      } else {
+        // 只有一项数据,根据时间段判断显示上午还是下午
+        const singleData = data[0];
+        const timeStr = singleData.time;
+        
+        // 解析时间段,判断是否大于14:00
+        const isAfternoon = this.isAfternoonTime(timeStr);
+        
+        if (isAfternoon) {
+          // 显示下午,隐藏上午
+          afternoonText = singleData.pcs > 0 ? `余票${singleData.pcs}张` : '已约满';
+          afternoonTime = singleData.time;
+          afternoonId = singleData.id;
+          
+          afternoonDisabled = this.isTimeSlotExpired(afternoonTime, this.data.selectedDate);
+          if (afternoonDisabled) {
+            afternoonText = '已过期';
+          }
+          
+          showMorning = false;
+          morningDisabled = true;
+        } else {
+          // 显示上午,隐藏下午
+          morningText = singleData.pcs > 0 ? `余票${singleData.pcs}张` : '已约满';
+          morningTime = singleData.time;
+          morningId = singleData.id;
+          
+          morningDisabled = this.isTimeSlotExpired(morningTime, this.data.selectedDate);
+          if (morningDisabled) {
+            morningText = '已过期';
+          }
+          
+          showAfternoon = false;
+          afternoonDisabled = true;
+        }
+      }
       
-      // 第二项为下午
-      const afternoonData = data[1];
-      afternoonText = afternoonData.pcs > 0 ? `余票${afternoonData.pcs}张` : '已约满';
-      afternoonTime = afternoonData.time;
-      afternoonId = afternoonData.id;
+      // 如果当前选中的时间段已过期或被禁用,自动切换到可用的时间段
+      if (this.data.selectedTime === 'morning' && (morningDisabled || !showMorning)) {
+        if (!afternoonDisabled && showAfternoon) {
+          this.setData({ selectedTime: 'afternoon' });
+        } else {
+          this.setData({ selectedTime: '' });
+        }
+      } else if (this.data.selectedTime === 'afternoon' && (afternoonDisabled || !showAfternoon)) {
+        if (!morningDisabled && showMorning) {
+          this.setData({ selectedTime: 'morning' });
+        } else {
+          this.setData({ selectedTime: '' });
+        }
+      }
     }
     
     this.setData({
@@ -110,13 +208,36 @@ Page({
       morningTime: morningTime,
       afternoonTime: afternoonTime,
       morningId: morningId,
-      afternoonId: afternoonId
+      afternoonId: afternoonId,
+      afternoonDisabled: afternoonDisabled,
+      morningDisabled: morningDisabled,
+      showMorning: showMorning,
+      showAfternoon: showAfternoon
     });
   },
 
+  // 判断时间段是否为下午(大于14:00)
+  isAfternoonTime(timeStr) {
+    // 时间格式如:"10:00-14:00" 或 "14:00-18:00"
+    const startTime = timeStr.split('-')[0].trim();
+    const hour = parseInt(startTime.split(':')[0]);
+    return hour >= 14;
+  },
+
   // 选择时间段
   selectTime(e) {
     const time = e.currentTarget.dataset.time;
+    
+    // 如果点击的是上午且上午被禁用,则不允许选择
+    if (time === 'morning' && this.data.morningDisabled) {
+      return;
+    }
+    
+    // 如果点击的是下午且下午被禁用,则不允许选择
+    if (time === 'afternoon' && this.data.afternoonDisabled) {
+      return;
+    }
+    
     this.setData({
       selectedTime: time
     });

+ 2 - 2
pages/index/start-preview/start-preview.json

@@ -1,6 +1,6 @@
 {
-  "navigationBarTitleText": "开始预约",
-  "navigationBarBackgroundColor": "#E0D2B4",
+  "navigationBarTitleText": "克拉玛依市博物馆",
+  "navigationBarBackgroundColor": "#fff",
   "navigationBarTextStyle": "black",
   "backgroundColor": "#E0D2B4",
   "enablePullDownRefresh": false,

+ 4 - 4
pages/index/start-preview/start-preview.wxml

@@ -5,18 +5,18 @@
     <view class="select-moon" wx:if="{{selectedDate}}">
       <text class="moon-time">请选择进馆时间</text>
       <view class="morning-moon">
-        <view class="time-card {{selectedTime === 'morning' ? 'active' : ''}}" bindtap="selectTime" data-time="morning">
+        <view class="time-card {{selectedTime === 'morning' ? 'active' : ''}} {{morningDisabled ? 'disabled' : ''}}" bindtap="selectTime" data-time="morning" wx:if="{{showMorning}}">
           <view class="time-period">上午</view>
           <view class="time-range">({{morningTime}})</view>
           <view class="availability">{{morningAvailability}}</view>
-          <view class="check-icon" wx:if="{{selectedTime === 'morning'}}">✓</view>
+          <view class="check-icon" wx:if="{{selectedTime === 'morning' && !morningDisabled}}">✓</view>
         </view>
         
-        <view class="time-card {{selectedTime === 'afternoon' ? 'active' : ''}}" bindtap="selectTime" data-time="afternoon">
+        <view class="time-card {{selectedTime === 'afternoon' ? 'active' : ''}} {{afternoonDisabled ? 'disabled' : ''}}" bindtap="selectTime" data-time="afternoon" wx:if="{{showAfternoon}}">
           <view class="time-period">下午</view>
           <view class="time-range">({{afternoonTime}})</view>
           <view class="availability">{{afternoonAvailability}}</view>
-          <view class="check-icon" wx:if="{{selectedTime === 'afternoon'}}">✓</view>
+          <view class="check-icon" wx:if="{{selectedTime === 'afternoon' && !afternoonDisabled}}">✓</view>
         </view>
         
         <view class="next-btn {{!selectedTime ? 'disabled' : ''}}" bindtap="goNext" disabled="{{!selectedTime}}">

+ 12 - 0
pages/index/start-preview/start-preview.wxss

@@ -53,6 +53,18 @@
   border-color: #B1967B;
 }
 
+.time-card.disabled {
+  opacity: 0.5;
+  border-color: #ccc;
+  pointer-events: none;
+}
+
+.time-card.disabled .time-period,
+.time-card.disabled .time-range,
+.time-card.disabled .availability {
+  color: #999;
+}
+
 .time-period {
   font-size: 32rpx;
   font-weight: bold;

+ 1 - 1
pages/index/visit-people/visit-people.js

@@ -353,7 +353,7 @@ Page({
         showSuccessModal: false
       });
       // 跳转到我的预约页面
-      wx.navigateTo({
+      wx.reLaunch({
         url: '/pages/user/my-preview/index'
       })
     },

+ 137 - 2
pages/index/visit-preview/visit-preview.js

@@ -1,15 +1,150 @@
+const {museumApi} = require('../../../utils/api.js');
+
 Page({
   data: {
-    
+    appointmentSlots: [], // 存储预约时段数据
+    openTime: '10:00', // 开馆时间
+    closeTime: '18:00', // 闭馆时间
+    stopCheckTime: '17:00', // 停止检票时间
+    noticeContent: '' // 预约须知内容
   },
 
   onLoad(options) {
     // 页面加载时的逻辑
-    console.log(111111)
+    console.log('页面加载');
+    this.loadAppointmentSlots();
+    this.loadNoticeContent();
+  },
+
+  // 加载预约时段数据
+  loadAppointmentSlots() {
+    // 获取当前日期
+    const today = new Date();
+    const dateString = today.getFullYear() + '-' + 
+      String(today.getMonth() + 1).padStart(2, '0') + '-' + 
+      String(today.getDate()).padStart(2, '0');
+    
+    console.log('获取预约时段,日期:', dateString);
+    
+    // 调用API获取预约时段
+    museumApi.getSlotsByDate(dateString)
+      .then(res => {
+        console.log('获取预约时段成功:', res);
+        if (res) {
+          this.setData({
+            appointmentSlots: res
+          });
+          this.updateTimeInfo(res);
+        } else {
+          console.error('获取预约时段失败:', res.message || '未知错误');
+          this.setDefaultTime();
+          wx.showToast({
+            title: '获取预约时段失败',
+            icon: 'none'
+          });
+        }
+      })
+      .catch(err => {
+        console.error('获取预约时段异常:', err);
+        this.setDefaultTime();
+        // wx.showToast({
+        //   title: '网络异常,请稍后重试',
+        //   icon: 'none'
+        // });
+      });
+  },
+
+  // 加载预约须知内容
+  loadNoticeContent() {
+    console.log('获取预约须知内容');
+    
+    // 调用API获取预约须知
+    museumApi.getSlots()
+      .then(res => {
+        console.log('获取预约须知成功:', res);
+        if (res) {
+          this.setData({
+            noticeContent: res.notice.rtf
+          });
+          
+        } else {
+          console.error('获取预约须知失败:', res.message || '未知错误');
+        }
+      })
+      .catch(err => {
+        console.error('获取预约须知异常:', err);
+      });
+  },
+
+  // 更新时间信息
+  updateTimeInfo(data) {
+    let openTime = '10:00';
+    let closeTime = '18:00';
+    let stopCheckTime = '17:00';
+
+    if (data.length === 1) {
+      // 只有一项数据,直接取time
+      const timeRange = data[0].time;
+      if (timeRange && timeRange.includes('-')) {
+        const times = timeRange.split('-');
+        openTime = times[0];
+        closeTime = times[1];
+      }
+    } else if (data.length >= 2) {
+      // 有两项或更多数据
+      const firstTime = data[0].time;
+      const lastTime = data[data.length - 1].time;
+      
+      if (firstTime && firstTime.includes('-')) {
+        openTime = firstTime.split('-')[0];
+      }
+      if (lastTime && lastTime.includes('-')) {
+        closeTime = lastTime.split('-')[1];
+      }
+    }
+
+    // 计算停止检票时间(闭馆时间往前一个小时)
+    stopCheckTime = this.calculateStopCheckTime(closeTime);
+
+    this.setData({
+      openTime: openTime,
+      closeTime: closeTime,
+      stopCheckTime: stopCheckTime
+    });
+
+    console.log('更新时间信息:', { openTime, closeTime, stopCheckTime });
+  },
+
+  // 设置默认时间
+  setDefaultTime() {
+    this.setData({
+      openTime: '10:00',
+      closeTime: '18:00',
+      stopCheckTime: '17:00'
+    });
+  },
+
+  // 计算停止检票时间(闭馆时间往前一个小时)
+  calculateStopCheckTime(closeTime) {
+    try {
+      const [hours, minutes] = closeTime.split(':').map(Number);
+      let stopHour = hours - 1;
+      
+      // 处理跨天的情况
+      if (stopHour < 0) {
+        stopHour = 23;
+      }
+      
+      return String(stopHour).padStart(2, '0') + ':' + String(minutes).padStart(2, '0');
+    } catch (error) {
+      console.error('计算停止检票时间失败:', error);
+      return '17:00'; // 默认值
+    }
   },
 
   onShow() {
     // 页面显示时的逻辑
+    console.log(111111)
   },
 
   // 返回首页

+ 2 - 2
pages/index/visit-preview/visit-preview.json

@@ -1,6 +1,6 @@
 {
-  "navigationBarTitleText": "预约参观",
-  "navigationBarBackgroundColor": "#E0D2B4",
+  "navigationBarTitleText": "克拉玛依市博物馆",
+  "navigationBarBackgroundColor": "#fff",
   "navigationBarTextStyle": "black",
   "backgroundColor": "#E0D2B4",
   "enablePullDownRefresh": false,

+ 10 - 5
pages/index/visit-preview/visit-preview.wxml

@@ -13,16 +13,16 @@
     <view class="time-info">
       <view class="time-section">
         <text class="time-title">开馆时间</text>
-        <view class="time-value">10:00</view>
+        <view class="time-value">{{openTime}}</view>
       </view>
       <view class="line"></view>
       <view class="time-section">
         <text class="time-title">闭馆时间</text>
-        <view class="time-value">18:00</view>
+        <view class="time-value">{{closeTime}}</view>
       </view>
       <view class="divider"></view>
       <view class="time-section">
-        <view class="stop-time">17:00</view>
+        <view class="stop-time">{{stopCheckTime}}</view>
         <view class="stop-desc">停止检票</view>
       </view>
     </view>
@@ -31,8 +31,13 @@
     
     <view class="reservation-title">预约参观</view>
     <view class="reservation-rules">
-      <text class="rule-content">①所有观众(包括享受优待政策的观众及其陪同人员)<text class="notice">均须实名预约</text>。放票时间为<text class="notice">每日18:00,可提前7日(不包括当日)通过官方微信小程序预约</text>,预约时段分为上午(9:00-13:00)和下午(12:00-16:00),当天不再放票;</text>
-      <text class="rule-content">②参观当日须按照预约时段入馆参观,错过预约时段将谢绝入馆。<text class="notice">同一证件号</text>当天可进出馆2次,预约上午票的观众首次入馆时间必须在13:00前;</text>
+      <view wx:if="{{noticeContent}}" class="rule-content">
+        <text class="notice">{{noticeContent}}</text>
+      </view>
+      <view wx:else>
+        <text class="rule-content">①所有观众(包括享受优待政策的观众及其陪同人员)<text class="notice">均须实名预约</text>。放票时间为<text class="notice">每日18:00,可提前7日(不包括当日)通过官方微信小程序预约</text>,预约时段分为上午(9:00-13:00)和下午(12:00-16:00),当天不再放票;</text>
+        <text class="rule-content">②参观当日须按照预约时段入馆参观,错过预约时段将谢绝入馆。<text class="notice">同一证件号</text>当天可进出馆2次,预约上午票的观众首次入馆时间必须在13:00前;</text>
+      </view>
     </view>
     
     <view class="reservation-button">

+ 1 - 1
pages/user/feedback/index.json

@@ -1,5 +1,5 @@
 {
-  "navigationBarTitleText": "意见反馈",
+  "navigationBarTitleText": "克拉玛依市博物馆",
   "navigationBarBackgroundColor": "#ffffff",
   "navigationBarTextStyle": "black"
 }

+ 68 - 15
pages/user/index.js

@@ -11,6 +11,7 @@ Page({
     hasUserInfo: false,
     canIUseGetUserProfile: wx.canIUse('getUserProfile'),
     canIUseNicknameComp: wx.canIUse('input.type.nickname'),
+    isLoggedIn: false,
   },
   onLoad() {
     if(wx.getStorageSync('userInfo')){
@@ -19,7 +20,14 @@ Page({
         hasUserInfo: true
       })
     }
+    this.checkLoginStatus();
   },
+
+  onShow() {
+    // 每次显示页面时检查登录状态
+    this.checkLoginStatus();
+  },
+
   bindViewTap() {
     wx.navigateTo({
       url: '../logs/logs'
@@ -90,6 +98,10 @@ Page({
   },
   // 跳转到我的参观人页面
   goToUserList() {
+    if (!this.data.isLoggedIn) {
+      this.startLogin();
+      return;
+    }
     wx.navigateTo({
       url: '/pages/user/userList/index'
     })
@@ -97,6 +109,10 @@ Page({
 
   // 跳转到我的预约
   startPreview() {
+    if (!this.data.isLoggedIn) {
+      this.startLogin();
+      return;
+    }
     console.log(11111)
     wx.navigateTo({
       url: '/pages/user/my-preview/index'
@@ -105,6 +121,10 @@ Page({
 
   // 意见反馈
   goToFeedback() {
+    if (!this.data.isLoggedIn) {
+      this.startLogin();
+      return;
+    }
     wx.navigateTo({
       url: '/pages/user/feedback/index'
     });
@@ -134,6 +154,11 @@ Page({
             app.globalData.userInfo = null;
           }
           
+          // 调用app的logout方法统一处理退出登录
+          if (app && app.logout) {
+            app.logout();
+          }
+          
           // 清除页面用户信息,设置为未登录状态
           this.setData({
             userInfo: {
@@ -141,6 +166,7 @@ Page({
               nickName: '',
             },
             hasUserInfo: false,
+            isLoggedIn: false,
           });
           
           wx.showToast({
@@ -161,20 +187,47 @@ Page({
   },
   startLogin() {
     // 触发自动登录
-    if (app && app.wxLogin) {
-      wx.showToast({
-        title: '正在登录',
-        icon: 'none',
-        duration: 1000
-      });
-      app.wxLogin();
-      this.setData({
-        userInfo: {
-          avatarUrl: defaultAvatarUrl,
-          nickName: '微信用户',
-        },
-        hasUserInfo: true,
-      });
-    }
+    wx.showModal({
+      title: '登录授权',
+      content: '为了给您提供更好的服务,需要获取您的微信登录信息,是否同意?',
+      confirmText: '同意',
+      cancelText: '暂不',
+      success: (res) => {
+        if (res.confirm) {
+          if (app && app.wxLogin) {
+            wx.showToast({
+              title: '正在登录',
+              icon: 'none',
+              duration: 1000
+            });
+            app.wxLogin();
+            this.setData({
+              userInfo: {
+                avatarUrl: defaultAvatarUrl,
+                nickName: '微信用户',
+              },
+              hasUserInfo: true,
+            });
+          }
+        } else {
+          // 用户拒绝,保持未登录状态
+          console.log('用户拒绝登录授权,保持未登录状态')
+          this.globalData.isGuest = true
+        }
+      }
+    })
+  },
+
+  /**
+   * 检查登录状态
+   */
+  checkLoginStatus() {
+    const app = getApp();
+    const token = wx.getStorageSync('token');
+    const isLoggedIn = !!(token && !app.globalData.isGuest);
+    
+    this.setData({
+      isLoggedIn: isLoggedIn
+    });
   }
 })

+ 3 - 3
pages/user/index.wxml

@@ -30,12 +30,12 @@
     <!-- 功能按钮区域 -->
     <view class="function-section">
       <view class="main-buttons">
-        <view class="btn-reserve" bindtap="startPreview">我的预约</view>
-        <view class="btn-people" bindtap="goToUserList">我的参观人</view>
+        <view class="btn-reserve {{!isLoggedIn ? 'btn-disabled' : ''}}" bindtap="startPreview">我的预约</view>
+        <view class="btn-people {{!isLoggedIn ? 'btn-disabled' : ''}}" bindtap="goToUserList">我的参观人</view>
       </view>
       
       <view class="secondary-buttons">
-        <view class="btn-feed" bindtap="goToFeedback">意见反馈</view>
+        <view class="btn-feed {{!isLoggedIn ? 'btn-disabled' : ''}}" bindtap="goToFeedback">意见反馈</view>
         <view class="btn-out" bindtap="logout">退出登录</view>
       </view>
     </view>

+ 10 - 1
pages/user/index.wxss

@@ -3,10 +3,13 @@ page {
   height: 100vh;
   display: flex;
   flex-direction: column;
-  background-image: url('https://sit-kelamayi.4dage.com/mini/wxImg/bg.png');
+  /* background: url('https://sit-kelamayi.4dage.com/mini/wxImg/user-bg.png') no-repeat; */
+  /* background-size: cover; */
 }
 .user-container{
   height: 100%;
+  background: url('https://sit-kelamayi.4dage.com/mini/wxImg/user-bg.png') no-repeat;
+  background-size: cover;
   display: flex;
   flex-direction: column;
   align-items: center;
@@ -155,3 +158,9 @@ page {
   border: 1px solid #D9D9D9;
   color: #584735;
 }
+
+/* 按钮置灰样式 */
+.btn-disabled {
+  opacity: 0.5;
+  filter: grayscale(50%);
+}

+ 146 - 16
pages/user/map/index.js

@@ -1,6 +1,7 @@
 // pages/user/map/index.js
 const { museumApi } = require('../../../utils/api.js');
 const { processHtmlContent } = require('../../../utils/htmlProcessor.js');
+const WxParse = require('../../../utils/wxParse/wxParse.js');
 
 Page({
   /**
@@ -62,6 +63,7 @@ Page({
    * 加载详情数据
    */
   loadDetailData() {
+    let that = this;
     this.setData({
       loading: true
     });
@@ -69,11 +71,13 @@ Page({
     museumApi.getMuseumDetail(2)
       .then(response => {
         if (response) {
-          const parsedContent = this.parseContent(response.content || response.context);
-          console.log('解析后的内容:', parsedContent);
+          // const parsedContent = this.parseContent(response.content || response.context);
+          let article = response.context;
+          // console.log('解析后的内容:', parsedContent);
+          WxParse.wxParse('article', 'html', article, that, 5);
           this.setData({
             detailData: response,
-            contentItems: parsedContent
+            // contentItems: parsedContent
           });
         }
       })
@@ -95,6 +99,59 @@ Page({
   },
 
   /**
+   * 处理HTML实体编码
+   */
+  processHtmlEntities(text) {
+    if (!text) return '';
+    return text
+      .replace(/&nbsp;/g, '&nbsp;')
+      .replace(/&ensp;/g, '&nbsp;&nbsp;')
+      .replace(/&emsp;/g, '&nbsp;&nbsp;&nbsp;&nbsp;')
+      .replace(/&#160;/g, '&nbsp;')
+      .replace(/ /g, '&nbsp;');
+  },
+
+  /**
+   * 解析style属性
+   */
+  parseStyleAttribute(styleStr) {
+    const styles = {};
+    if (styleStr) {
+      styleStr.split(';').forEach(rule => {
+        const [property, value] = rule.split(':').map(s => s.trim());
+        if (property && value) {
+          styles[property] = value;
+        }
+      });
+    }
+    return styles;
+  },
+
+  /**
+   * 检查是否有删除线样式
+   */
+  hasStrikethrough(attributes) {
+    // 检查style属性中的text-decoration
+    const styleMatch = attributes.match(/style="([^"]*)"/i);
+    if (styleMatch) {
+      const styles = this.parseStyleAttribute(styleMatch[1]);
+      return styles['text-decoration']?.includes('line-through') || 
+             styles['text-decoration-line']?.includes('line-through');
+    }
+    
+    // 检查class属性中是否包含删除线相关类名
+    const classMatch = attributes.match(/class="([^"]*)"/i);
+    if (classMatch) {
+      const classes = classMatch[1].toLowerCase();
+      return classes.includes('strikethrough') || 
+             classes.includes('line-through') || 
+             classes.includes('deleted');
+    }
+    
+    return false;
+  },
+
+  /**
    * 解析HTML内容为不同类型的内容项
    */
   parseContent(content) {
@@ -105,26 +162,67 @@ Page({
     
     // 定义所有匹配规则
     const patterns = [
+      {        regex: /<h[1-6]([^>]*?)>(.*?)<\/h[1-6]>/gi,        type: 'heading',        handler: (match) => {          let text = match[2].replace(/<[^>]*>/g, '');          let attributes = match[1];          let isCenter = /text-align\s*:\s*center/i.test(attributes) || /style="[^"]*text-align\s*:\s*center[^"]*"/i.test(attributes);          return {            type: 'heading',            content: this.processHtmlEntities(text),            center: isCenter          };        }      },
+      {
+        regex: /<span[^>]*>(.*?)<\/span>/gi,
+        type: 'span',
+        handler: (match) => {
+          let text = match[1].replace(/<[^>]*>/g, '');
+          return {
+            type: 'span',
+            content: this.processHtmlEntities(text)
+          };
+        }
+      },
+      // 检测删除线标签(del, s, strike)
+      {
+        regex: /<(del|s|strike)[^>]*>(.*?)<\/(del|s|strike)>/gi,
+        type: 'strikethrough',
+        handler: (match) => {
+          let text = match[2].replace(/<[^>]*>/g, '');
+          return {
+            type: 'strikethrough',
+            content: this.processHtmlEntities(text)
+          };
+        }
+      },
+      // 检测带有删除线样式的任意标签
+      {
+        regex: /<(\w+)([^>]*style="[^"]*text-decoration[^"]*line-through[^"]*"[^>]*)>(.*?)<\/\1>/gi,
+        type: 'strikethrough',
+        handler: (match) => {
+          let text = match[3].replace(/<[^>]*>/g, '');
+          return {
+            type: 'strikethrough',
+            content: this.processHtmlEntities(text)
+          };
+        }
+      },
+      // 检测带有删除线类名的任意标签
+      {
+        regex: /<(\w+)([^>]*class="[^"]*(?:strikethrough|line-through|deleted)[^"]*"[^>]*)>(.*?)<\/\1>/gi,
+        type: 'strikethrough',
+        handler: (match) => {
+          let text = match[3].replace(/<[^>]*>/g, '');
+          return {
+            type: 'strikethrough',
+            content: this.processHtmlEntities(text)
+          };
+        }
+      },
       {
         regex: /<p[^>]*>(.*?)<\/p>/gi,
         type: 'text',
         handler: (match) => {
           let text = match[1].replace(/<[^>]*>/g, '');
-          // 将HTML实体编码的空格转换为对应数量的&nbsp;
-          text = text.replace(/&nbsp;/g, '&nbsp;');
-          text = text.replace(/&ensp;/g, '&nbsp;&nbsp;');
-          text = text.replace(/&emsp;/g, '&nbsp;&nbsp;&nbsp;&nbsp;');
-          text = text.replace(/&#160;/g, '&nbsp;');
-          // 将普通空格也转换为&nbsp;
-          text = text.replace(/ /g, '&nbsp;');
           return {
             type: 'text',
-            content: text
+            content: this.processHtmlEntities(text)
           };
         }
       },
       {
-        regex: /<div[^>]*class="[^"]*media-wrap[^"]*image-wrap[^"]*"[^>]*>.*?<img[^>]*src="([^"]+)"[^>]*(?:alt="([^"]*)")?\/?>.*?<\/div>/gi,
+        regex: /<div[^>]*class="[^"]*media-wrap[^"]*image-wrap[^"]*"[^>]*>.*?<img[^>]*src="([^"]+)"[^>]*(?:alt="([^"]*)")?\/?>.* ?<\/div>/gi,
         type: 'image',
         handler: (match) => ({
           type: 'image',
@@ -133,7 +231,7 @@ Page({
         })
       },
       {
-        regex: /<div[^>]*class="[^"]*media-wrap[^"]*video-wrap[^"]*"[^>]*>.*?<video[^>]*src="([^"]+)"[^>]*(?:poster="([^"]*)")?\/?>.*?<\/div>/gi,
+        regex: /<div[^>]*class="[^"]*media-wrap[^"]*video-wrap[^"]*"[^>]*>.*?<video[^>]*src="([^"]+)"[^>]*(?:poster="([^"]*)")?\/?>.* ?<\/div>/gi,
         type: 'video',
         handler: (match) => ({
           type: 'video',
@@ -142,7 +240,7 @@ Page({
         })
       },
       {
-        regex: /<div[^>]*class="[^"]*media-wrap[^"]*audio-wrap[^"]*"[^>]*>.*?<audio[^>]*src="([^"]+)"[^>]*(?:title="([^"]*)")?\/?>.*?<\/div>/gi,
+        regex: /<div[^>]*class="[^"]*media-wrap[^"]*audio-wrap[^"]*"[^>]*>.*?<audio[^>]*src="([^"]+)"[^>]*(?:title="([^"]*)")?\/?>.* ?<\/div>/gi,
         type: 'audio',
         handler: (match) => ({
           type: 'audio',
@@ -161,17 +259,49 @@ Page({
          if ((item.type === 'text' && item.content.trim()) || item.type !== 'text') {
            matches.push({
              index: match.index,
+             length: match[0].length,
              item: item
            });
          }
        }
     });
-    
+
     // 按照在原HTML中的位置排序
     matches.sort((a, b) => a.index - b.index);
+
+    // 移除重叠的匹配项(保持原始顺序,只过滤真正重复的内容)
+    const filteredMatches = [];
+    const typesPriority = ['heading', 'strikethrough', 'span', 'text']; // 优先级从高到低
+    
+    for (let i = 0; i < matches.length; i++) {
+      const current = matches[i];
+      let shouldSkip = false;
+      
+      // 检查是否与已添加的项有重叠
+      for (let j = 0; j < filteredMatches.length; j++) {
+        const existing = filteredMatches[j];
+        // 检查是否有重叠
+        if (current.index < existing.index + existing.length && 
+            current.index + current.length > existing.index) {
+          // 如果有重叠,比较优先级
+          const currentPriority = typesPriority.indexOf(current.item.type);
+          const existingPriority = typesPriority.indexOf(existing.item.type);
+          
+          // 只有当前项优先级明显低于已存在项时才跳过
+          if (currentPriority > existingPriority && existingPriority !== -1) {
+            shouldSkip = true;
+            break;
+          }
+        }
+      }
+      
+      if (!shouldSkip) {
+        filteredMatches.push(current);
+      }
+    }
     
     // 提取排序后的内容项
-    return matches.map(match => match.item);
+    return filteredMatches.map(match => match.item);
   },
 
   /**

+ 1 - 1
pages/user/map/index.json

@@ -1,6 +1,6 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "展馆地图",
+  "navigationBarTitleText": "克拉玛依市博物馆",
   "navigationBarBackgroundColor": "#ffffff",
   "navigationBarTextStyle": "black",
   "backgroundColor": "#f5f5f5",

+ 24 - 14
pages/user/map/index.wxml

@@ -1,3 +1,4 @@
+<import src="../../../utils/wxParse/wxParse.wxml"/> 
 <!--地图页面-->
 <view class="detail-container">
   <!-- 加载状态 -->
@@ -11,35 +12,44 @@
     <view class="detail-title">{{detailData.title || '展馆地图'}}</view>
 
     <view class="line"></view>
-
+    <template is="wxParse" data="{{wxParseData: article.nodes}}"/>
     <!-- 内容项列表 -->
-    <view wx:if="{{contentItems && contentItems.length > 0}}" class="content-list">
-      <view wx:for="{{contentItems}}" wx:key="index" class="content-item">
+    <!-- <view wx:if="{{contentItems && contentItems.length > 0}}" class="content-list"> -->
+      <!-- <view wx:for="{{contentItems}}" wx:key="index" class="content-item {{item.center ? 'heading-center' : ''}}"> -->
+        <!-- 标题内容 -->
+        <!-- <text decode='true' wx:if="{{item.type === 'heading'}}" class="heading-content {{item.center ? 'heading-center' : ''}}">{{item.content}}</text> -->
+        
+        <!-- span内容 -->
+        <!-- <text decode='true' wx:elif="{{item.type === 'span'}}" class="span-content">{{item.content}}</text> -->
+        
+        <!-- 删除线内容 -->
+        <!-- <text decode='true' wx:elif="{{item.type === 'strikethrough'}}" class="strikethrough-content">{{item.content}}</text> -->
+        
         <!-- 文本内容 -->
-        <text decode='true' wx:if="{{item.type === 'text'}}" class="text-content">{{item.content}}</text>
+        <!-- <text decode='true' wx:elif="{{item.type === 'text'}}" class="text-content">{{item.content}}</text> -->
         
         <!-- 图片内容 -->
-        <view wx:elif="{{item.type === 'image'}}" class="image-content">
+        <!-- <view wx:elif="{{item.type === 'image'}}" class="image-content">
           <image src="{{item.src}}" alt="{{item.alt}}" mode="widthFix" class="content-image"></image>
-        </view>
+        </view> -->
         
         <!-- 视频内容 -->
-        <view wx:elif="{{item.type === 'video'}}" class="video-content">
+        <!-- <view wx:elif="{{item.type === 'video'}}" class="video-content">
           <video src="{{item.src}}" poster="{{item.poster}}" class="content-video" controls></video>
-        </view>
+        </view> -->
         
         <!-- 音频内容 -->
-        <view wx:elif="{{item.type === 'audio'}}" class="audio-content">
+        <!-- <view wx:elif="{{item.type === 'audio'}}" class="audio-content">
           <view class="audio-title">{{item.title}}</view>
           <audio src="{{item.src}}" class="content-audio" controls></audio>
-        </view>
-      </view>
-    </view>
+        </view> -->
+      <!-- </view> -->
+    <!-- </view> -->
 
     <!-- 描述 -->
-    <view wx:elif="{{detailData.description}}" class="detail-description">
+    <!-- <view wx:elif="{{detailData.description}}" class="detail-description">
       {{detailData.description}}
-    </view>
+    </view> -->
   </view>
 
   <!-- 错误状态 -->

+ 33 - 0
pages/user/map/index.wxss

@@ -100,6 +100,39 @@
   margin-bottom: 30rpx;
 }
 
+/* 标题内容样式 */
+.heading-content {
+  line-height: 1.4;
+  color: #584735;
+  font-size: 36rpx;
+  font-weight: bold;
+  margin: 30rpx 0 20rpx 0;
+}
+
+/* 居中标题样式 */
+.heading-center {
+  width: 100%;
+  text-align: center;
+}
+
+/* span内容样式 */
+.span-content {
+  line-height: 1.6;
+  color: #333;
+  font-size: 28rpx;
+  margin: 15rpx 0;
+}
+
+/* 删除线内容样式 */
+.strikethrough-content {
+  line-height: 1.6;
+  color: #666;
+  font-size: 28rpx;
+  margin: 0;
+  text-decoration: line-through;
+  display: inline;
+}
+
 /* 文本内容样式 */
 .text-content {
   line-height: 1.6;

+ 4 - 4
pages/user/my-preview/index.js

@@ -118,10 +118,10 @@ Page({
       }
     }).catch(error => {
       console.error('获取预约数据失败:', error);
-      wx.showToast({
-        title: '网络错误,请重试',
-        icon: 'none'
-      });
+      // wx.showToast({
+      //   title: '网络错误,请重试',
+      //   icon: 'none'
+      // });
       this.setData({ loading: false });
     });
   },

+ 1 - 1
pages/user/my-preview/index.json

@@ -1,6 +1,6 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "我的预约",
+  "navigationBarTitleText": "克拉玛依市博物馆",
   "enablePullDownRefresh": true,
   "backgroundColor": "#f5f5f5",
   "backgroundTextStyle": "dark"

+ 1 - 1
pages/user/userList/index.json

@@ -1,5 +1,5 @@
 {
-  "navigationBarTitleText": "我的参观人",
+  "navigationBarTitleText": "克拉玛依市博物馆",
   "navigationBarBackgroundColor": "#ffffff",
   "navigationBarTextStyle": "black",
   "backgroundColor": "#f8f8f8",

+ 62 - 0
utils/api.js

@@ -57,6 +57,50 @@ const utils = {
         }
       });
     });
+  },
+
+  // 刷新token
+  refreshToken() {
+    const app = getApp();
+    const currentToken = (app && app.globalData && app.globalData.token) || wx.getStorageSync('token');
+    
+    if (!currentToken) {
+      console.error('当前没有token,无法刷新');
+      return Promise.reject('当前没有token,无法刷新');
+    }
+
+    return new Promise((resolve, reject) => {
+      wx.request({
+        url: 'https://sit-kelamayi.4dage.com/api/museum/refresh',
+        method: 'POST',
+        header: {
+          'token': currentToken
+        },
+        success: (response) => {
+          console.log('刷新token接口调用成功:', response.data);
+          if (response.data && response.data.code === 0) {
+            const newToken = response.data.data;
+            // 更新全局数据中的token
+            if (app && app.globalData && newToken) {
+              app.globalData.token = newToken;
+            }
+            // 更新本地存储中的token
+            if(newToken){
+              wx.setStorageSync('token', newToken);
+              console.log('token刷新成功:', newToken);
+            }
+            resolve(newToken);
+          } else {
+            console.error('刷新token失败:', response.data.message || '未知错误');
+            reject(response.data.message || '刷新token失败');
+          }
+        },
+        fail: (error) => {
+          console.error('刷新token接口调用失败:', error);
+          reject(error);
+        }
+      });
+    });
   }
 };
 
@@ -189,6 +233,15 @@ const museumApi = {
       method: 'POST',
     });
   },
+  // 获取活动剩余票数
+  getActivityticket(data) {
+    return request({
+      url: `/museum/activity/wxinfo`,
+      method: 'POST',
+      data: data,
+      useToken: true
+    });
+  },
 
   // 获取展馆介绍详情
   getMuseumDetail(type) {
@@ -267,6 +320,15 @@ const museumApi = {
     });
   },
 
+  // 获取预约时段信息
+  getSlots() {
+    return request({
+      url: '/museum/appointmentSlots/getSlots',
+      method: 'POST',
+      useToken: true
+    });
+  },
+
   // 获取我的参观人列表
   getMyVisitors() {
     return request({

+ 1 - 1
utils/request.js

@@ -1,5 +1,5 @@
 // 小程序网络请求封装
-const baseURL = 'https://sit-kelamayi.4dage.com/api'; // 根据环境配置
+const baseURL = 'https://sit-kelamayi.4dage.com/api'; // 根据环境配置(本地测试)
 
 /**
  * 封装wx.request

BIN=BIN
utils/wxParse/emojis/00.gif


BIN=BIN
utils/wxParse/emojis/01.gif


BIN=BIN
utils/wxParse/emojis/02.gif


BIN=BIN
utils/wxParse/emojis/03.gif


BIN=BIN
utils/wxParse/emojis/04.gif


BIN=BIN
utils/wxParse/emojis/05.gif


BIN=BIN
utils/wxParse/emojis/06.gif


BIN=BIN
utils/wxParse/emojis/07.gif


BIN=BIN
utils/wxParse/emojis/08.gif


BIN=BIN
utils/wxParse/emojis/09.gif


BIN=BIN
utils/wxParse/emojis/10.gif


BIN=BIN
utils/wxParse/emojis/100.gif


BIN=BIN
utils/wxParse/emojis/101.gif


BIN=BIN
utils/wxParse/emojis/102.gif


BIN=BIN
utils/wxParse/emojis/103.gif


BIN=BIN
utils/wxParse/emojis/104.gif


BIN=BIN
utils/wxParse/emojis/105.gif


BIN=BIN
utils/wxParse/emojis/106.gif


BIN=BIN
utils/wxParse/emojis/107.gif


BIN=BIN
utils/wxParse/emojis/108.gif


BIN=BIN
utils/wxParse/emojis/109.gif


BIN=BIN
utils/wxParse/emojis/11.gif


BIN=BIN
utils/wxParse/emojis/110.gif


BIN=BIN
utils/wxParse/emojis/111.gif


BIN=BIN
utils/wxParse/emojis/112.gif


BIN=BIN
utils/wxParse/emojis/113.gif


BIN=BIN
utils/wxParse/emojis/114.gif


BIN=BIN
utils/wxParse/emojis/115.gif


BIN=BIN
utils/wxParse/emojis/116.gif


BIN=BIN
utils/wxParse/emojis/117.gif


BIN=BIN
utils/wxParse/emojis/118.gif


BIN=BIN
utils/wxParse/emojis/119.gif


BIN=BIN
utils/wxParse/emojis/12.gif


BIN=BIN
utils/wxParse/emojis/120.gif


BIN=BIN
utils/wxParse/emojis/121.gif


BIN=BIN
utils/wxParse/emojis/122.gif


BIN=BIN
utils/wxParse/emojis/123.gif


BIN=BIN
utils/wxParse/emojis/124.gif


BIN=BIN
utils/wxParse/emojis/125.gif


BIN=BIN
utils/wxParse/emojis/126.gif


BIN=BIN
utils/wxParse/emojis/127.gif


BIN=BIN
utils/wxParse/emojis/128.gif


BIN=BIN
utils/wxParse/emojis/129.gif


BIN=BIN
utils/wxParse/emojis/13.gif


BIN=BIN
utils/wxParse/emojis/130.gif


BIN=BIN
utils/wxParse/emojis/131.gif


BIN=BIN
utils/wxParse/emojis/132.gif


BIN=BIN
utils/wxParse/emojis/133.gif


BIN=BIN
utils/wxParse/emojis/134.gif


BIN=BIN
utils/wxParse/emojis/14.gif


BIN=BIN
utils/wxParse/emojis/15.gif


+ 0 - 0
utils/wxParse/emojis/16.gif


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio