wangfumin пре 1 месец
родитељ
комит
04992b2a32

+ 1 - 1
pages/collection/index.json

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

+ 1 - 1
pages/exhibition/index.json

@@ -3,6 +3,6 @@
   "navigationBarBackgroundColor": "#fff",
   "navigationBarTextStyle": "black",
   "backgroundColor": "#f8f8f8",
-  "enablePullDownRefresh": false,
+  "enablePullDownRefresh": true,
   "usingComponents": {}
 }

+ 3 - 1
pages/exhibition/index.wxml

@@ -3,7 +3,8 @@
   <!-- 轮播图 -->
   <view class="carousel-section">
     <!-- <swiper class="carousel" indicator-dots="{{true}}" autoplay="{{true}}" interval="3000" duration="500"> -->
-      <view class="carousel" bindtap="onOnlineExhibitionTap">
+    <navigator hover-class='none' url="https://www.4dmodel.com/SuperTwoCustom/KLMYscene/?m=SG-alDn3FU4jQ8" class='fdkz-card'>
+      <view class="carousel">
         <image class="carousel-image" src="https://sit-kelamayi.4dage.com/mini/wxImg/zhanlan.png" mode="aspectFill"></image>
         <!-- 线上观展标识 -->
         <view class="online-exhibition" bindtap="onOnlineExhibitionTap">
@@ -12,6 +13,7 @@
         </view>
       </view>
     <!-- </swiper> -->
+    </navigator>
   </view>
 
   <!-- 分类选择 -->

+ 3 - 1
pages/index/active-page/active-page.js

@@ -142,7 +142,9 @@ Page({
       });
       return;
     }
-    
+    if(this.data.currentTicketCount <= 0){
+      return;
+    }
     if (this.data.selectedDate && this.data.activityData.title) {
       console.log('选择的日期:', this.data.selectedDate);
       console.log('活动标题:', this.data.activityData.title);

+ 1 - 1
pages/index/index.json

@@ -2,7 +2,7 @@
   "usingComponents": {
     "loading": "/components/loading/index"
   },
-  "enablePullDownRefresh": false,
+  "enablePullDownRefresh": true,
   "navigationBarTitleText": "克拉玛依市博物馆",
   "navigationStyle": "default"
 }

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

@@ -14,7 +14,8 @@ Page({
     afternoonDisabled: false,
     morningDisabled: false,
     showMorning: true,
-    showAfternoon: true
+    showAfternoon: true,
+    isNextButtonDisabled: false
   },
 
   onLoad(options) {
@@ -149,6 +150,7 @@ Page({
             morningText = `余票${morningData.pcs}张`;
           } else {
             morningText = '已约满';
+            morningDisabled = true;
           }
           morningTime = morningData.time;
           morningId = morningData.id;
@@ -166,6 +168,7 @@ Page({
             afternoonText = `余票${afternoonData.pcs}张`;
           } else {
             afternoonText = '已约满';
+            afternoonDisabled = true;
           }
           afternoonTime = afternoonData.time;
           afternoonId = afternoonData.id;
@@ -176,16 +179,18 @@ Page({
         
         // 检查时间段是否已过期(只有未被禁用且不是闭馆状态的时间段才检查过期)
         if (morningData && !morningDisabled && morningText !== '闭馆') {
-          morningDisabled = this.isTimeSlotExpired(morningTime, this.data.selectedDate);
-          if (morningDisabled) {
+          const isExpired = this.isTimeSlotExpired(morningTime, this.data.selectedDate);
+          if (isExpired) {
             morningText = '已过期';
+            morningDisabled = true;
           }
         }
         
         if (afternoonData && !afternoonDisabled && afternoonText !== '闭馆') {
-          afternoonDisabled = this.isTimeSlotExpired(afternoonTime, this.data.selectedDate);
-          if (afternoonDisabled) {
+          const isExpired = this.isTimeSlotExpired(afternoonTime, this.data.selectedDate);
+          if (isExpired) {
             afternoonText = '已过期';
+            afternoonDisabled = true;
           }
         }
       } else {
@@ -205,14 +210,16 @@ Page({
             afternoonText = `余票${singleData.pcs}张`;
           } else {
             afternoonText = '已约满';
+            afternoonDisabled = true;
           }
           afternoonTime = singleData.time;
           afternoonId = singleData.id;
           
           if (!afternoonDisabled) {
-            afternoonDisabled = this.isTimeSlotExpired(afternoonTime, this.data.selectedDate);
-            if (afternoonDisabled) {
+            const isExpired = this.isTimeSlotExpired(afternoonTime, this.data.selectedDate);
+            if (isExpired) {
               afternoonText = '已过期';
+              afternoonDisabled = true;
             }
           }
           
@@ -227,14 +234,16 @@ Page({
             morningText = `余票${singleData.pcs}张`;
           } else {
             morningText = '已约满';
+            morningDisabled = true;
           }
           morningTime = singleData.time;
           morningId = singleData.id;
           
           if (!morningDisabled) {
-            morningDisabled = this.isTimeSlotExpired(morningTime, this.data.selectedDate);
-            if (morningDisabled) {
+            const isExpired = this.isTimeSlotExpired(morningTime, this.data.selectedDate);
+            if (isExpired) {
               morningText = '已过期';
+              morningDisabled = true;
             }
           }
           
@@ -258,6 +267,22 @@ Page({
         }
       }
     }
+
+    // 计算下一步按钮是否应该禁用
+    let isNextButtonDisabled = false;
+    
+    // 计算有几个时间段显示
+    const visibleSlots = [];
+    if (showMorning) visibleSlots.push({ disabled: morningDisabled, name: 'morning' });
+    if (showAfternoon) visibleSlots.push({ disabled: afternoonDisabled, name: 'afternoon' });
+    
+    if (visibleSlots.length === 1) {
+      // 只有一个时间段,如果该时间段被禁用则置灰按钮
+      isNextButtonDisabled = visibleSlots[0].disabled;
+    } else if (visibleSlots.length === 2) {
+      // 有两个时间段,如果两个时间段都被禁用则置灰按钮
+      isNextButtonDisabled = visibleSlots.every(slot => slot.disabled);
+    }
     
     this.setData({
       morningAvailability: morningText,
@@ -269,7 +294,8 @@ Page({
       afternoonDisabled: afternoonDisabled,
       morningDisabled: morningDisabled,
       showMorning: showMorning,
-      showAfternoon: showAfternoon
+      showAfternoon: showAfternoon,
+      isNextButtonDisabled: isNextButtonDisabled
     });
   },
 
@@ -303,6 +329,15 @@ Page({
 
   // 下一步
   goNext() {
+    // 如果按钮被禁用,不允许进入下一步
+    if (this.data.isNextButtonDisabled) {
+      // wx.showToast({
+      //   title: '当前时间段不可预约',
+      //   icon: 'none'
+      // });
+      return;
+    }
+    
     if (this.data.selectedTime && this.data.selectedDate) {
       console.log('选择的时间段:', this.data.selectedTime);
       console.log('选择的日期:', this.data.selectedDate);
@@ -323,10 +358,10 @@ Page({
         url: `/pages/index/visit-people/visit-people?date=${this.data.selectedDate}&time=${actualTime}&appointmentSlotsId=${appointmentSlotsId}&type=1`
       });
     } else {
-      wx.showToast({
-        title: '请选择日期和时间段',
-        icon: 'none'
-      });
+      // wx.showToast({
+      //   title: '请选择日期和时间段',
+      //   icon: 'none'
+      // });
     }
   },
 

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

@@ -19,7 +19,7 @@
           <view class="check-icon" wx:if="{{selectedTime === 'afternoon' && !afternoonDisabled}}">✓</view>
         </view>
         
-        <view class="next-btn {{!selectedTime ? 'disabled' : ''}}" bindtap="goNext" disabled="{{!selectedTime}}">
+        <view class="next-btn {{(!selectedTime || isNextButtonDisabled) ? 'disabled' : ''}}" bindtap="goNext" disabled="{{!selectedTime || isNextButtonDisabled}}">
           下一步
         </view>
       </view>

+ 0 - 2
utils/wxParse/html2json.js

@@ -109,14 +109,12 @@ function html2json(html, bindName) {
                     var name = attr.name;
                     var value = attr.value;
                     if (name == 'class') {
-                        console.dir(value);
                         //  value = value.join("")
                         node.classStr = value;
                     }
                     // has multi attibutes
                     // make it array of attribute
                     if (name == 'style') {
-                        console.dir(value);
                         //  value = value.join("")
                         node.styleStr = value;
                     }

+ 2 - 2
utils/wxParse/wxParse.js

@@ -33,12 +33,12 @@ function wxParse(bindName = 'wxParseData', type='html', data='<div class="color:
   var transData = {};//存放转化后的数据
   if (type == 'html') {
     transData = HtmlToJson.html2json(data, bindName);
-    console.log(JSON.stringify(transData, ' ', ' '));
+    // console.log(JSON.stringify(transData, ' ', ' '));
   } else if (type == 'md' || type == 'markdown') {
     var converter = new showdown.Converter();
     var html = converter.makeHtml(data);
     transData = HtmlToJson.html2json(html, bindName);
-    console.log(JSON.stringify(transData, ' ', ' '));
+    // console.log(JSON.stringify(transData, ' ', ' '));
   }
   transData.view = {};
   transData.view.imagePadding = 0;

+ 1 - 1
utils/wxParse/wxParse.wxml

@@ -34,7 +34,7 @@
 </template>
 
 <template name="WxParseBr">
-  <text>{{'\n'}}</text>
+  <text>\n</text>
 </template>
 <!--入口模版-->
 

+ 6 - 2
utils/wxParse/wxParse.wxss

@@ -18,7 +18,8 @@
     line-height: 1.8;
 }
 view{
-    word-break:break-all; overflow:auto;
+     /* word-break:break-all; */
+      /* overflow:auto;  */
 }
 .wxParse-inline{
     display: inline;
@@ -65,7 +66,7 @@ view{
   margin-bottom: .04em;
 }
 
-.wxParse-h1, .wxParse-h2, .wxParse-h3, .wxParse-h4, .wxParse-h5, .wxParse-h6, .wxParse-b, .wxParse-strong  { font-weight: bolder }
+.wxParse-h1, .wxParse-h2, .wxParse-h3, .wxParse-h4, .wxParse-h5, .wxParse-h6, .wxParse-b, .wxParse-strong  { font-weight: bold }
 
 .wxParse-i,.wxParse-cite,.wxParse-em,.wxParse-var,.wxParse-address{font-style:italic}
 .wxParse-pre,.wxParse-tt,.wxParse-code,.wxParse-kbd,.wxParse-samp{font-family:monospace}
@@ -204,3 +205,6 @@ view{
 .wxParse-figure {
   overflow: hidden;
 }
+.wxParse-p image{
+  width: 100%!important;
+}