wangfumin 3 mesiacov pred
rodič
commit
4863a03339

+ 14 - 3
app.js

@@ -9,7 +9,16 @@ App({
     const logs = wx.getStorageSync('logs') || []
     // logs.unshift(Date.now())
     // wx.setStorageSync('logs', logs)
-    
+    wx.loadFontFace({
+      family: 'heavy',
+      source: "https://klmybwg.4dage.com/mini/wxImg/SOURCEHANSERIFSC-HEAVY.OTF",
+      success(res) {
+        console.log('加载成功:', res + 'heavy')
+      },
+      fail(err) {
+        console.log('加载失败:', err)
+      }
+    })
     // 检查是否已有登录状态
     const token = wx.getStorageSync('token')
     if (token) {
@@ -70,7 +79,8 @@ App({
   // 调用登录接口
   callLoginApi(code) {
     wx.request({
-      url: 'https://klmybwg.4dage.com/api/museum/wxMini/login',
+      // url: 'https://klmybwg.4dage.com/api/museum/wxMini/login',
+      url: 'https://sit-kelamayi.4dage.com/api/museum/wxMini/login',
       method: 'GET',
       data: {
         code: code
@@ -116,7 +126,8 @@ App({
   // 获取访问token
   getAccessToken() {
     wx.request({
-      url: 'https://klmybwg.4dage.com/api/museum/wxMini/getAccessToken',
+      // url: 'https://klmybwg.4dage.com/api/museum/wxMini/getAccessToken',
+      url: 'https://sit-kelamayi.4dage.com/api/museum/wxMini/getAccessToken',
       method: 'GET',
       header: {
         'content-type': 'application/x-www-form-urlencoded'

+ 2 - 1
app.wxss

@@ -7,4 +7,5 @@
   justify-content: space-between;
   padding: 200rpx 0;
   box-sizing: border-box;
-} 
+  font-family: "heavy";
+}

+ 45 - 0
custom-tab-bar/index.js

@@ -0,0 +1,45 @@
+Component({
+    data: {
+      selected: 0,
+      color: "#412A12",
+      selectedColor: "#B1967B",
+      borderStyle: "black",
+      backgroundColor: "#ffffff",
+      list: [{
+        "pagePath": "/pages/index/index",
+        "iconPath": "/imgs/icon_home_normal.png",
+        "selectedIconPath": "/imgs/icon_home_active.png",
+        "text": "首页"
+      },
+      {
+        "pagePath": "/pages/exhibition/index",
+        "iconPath": "/imgs/icon_exhibition_normal.png",
+        "selectedIconPath": "/imgs/icon_exhibition_active.png",
+        "text": "展览"
+      },
+      {
+        "pagePath": "/pages/collection/index",
+        "iconPath": "/imgs/icon_culture_normal.png",
+        "selectedIconPath": "/imgs/icon_culture_active.png",
+        "text": "典藏"
+      },
+      {
+        "pagePath": "/pages/user/index",
+        "iconPath": "/imgs/icon_user_normal.png",
+        "selectedIconPath": "/imgs/icon_user_active.png",
+        "text": "我的"
+      }]
+    },
+    attached() {
+    },
+    methods: {
+      switchTab(e) {
+        const data = e.currentTarget.dataset
+        const url = data.path
+        wx.switchTab({url})
+        this.setData({
+          selected: data.index
+        })
+      }
+    }
+  })

+ 3 - 0
custom-tab-bar/index.json

@@ -0,0 +1,3 @@
+{
+    "component": true
+  }

+ 8 - 0
custom-tab-bar/index.wxml

@@ -0,0 +1,8 @@
+<!--miniprogram/custom-tab-bar/index.wxml-->
+<view class="tab-bar">
+  <view class="tab-bar-border"></view>
+  <view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
+    <image src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></image>
+    <view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view>
+  </view>
+</view>

+ 38 - 0
custom-tab-bar/index.wxss

@@ -0,0 +1,38 @@
+.tab-bar {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  height: 48px;
+  background: white;
+  display: flex;
+  padding-bottom: env(safe-area-inset-bottom);
+}
+
+.tab-bar-border {
+  background-color: rgba(0, 0, 0, 0.33);
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 1px;
+  transform: scaleY(0.5);
+}
+
+.tab-bar-item {
+  flex: 1;
+  text-align: center;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  flex-direction: column;
+}
+
+.tab-bar-item image {
+  width: 27px;
+  height: 27px;
+}
+
+.tab-bar-item view {
+  font-size: 10px;
+}

+ 1 - 1
pages/collection/index.wxml

@@ -17,7 +17,7 @@
     <!-- 搜索框 -->
     <view class="search-container">
       <view class="search-input">
-        <input type="text" placeholder="请输入要搜索的内容..." value="{{searchText}}" bindinput="onSearchInput" bindconfirm="onSearch" />
+        <input type="text" style="text-align: center;" placeholder="请输入要搜索的内容..." value="{{searchText}}" bindinput="onSearchInput" bindconfirm="onSearch" />
         <view class="search-icon" wx:if="{{!searchText}}" bindtap="onSearch">
           <icon class="icon-small" type="search" size="24"></icon>
         </view>

+ 8 - 5
pages/collection/index.wxss

@@ -45,18 +45,18 @@
 }
 
 .category-item.active .category-text {
-  border-bottom: 2rpx solid #F3B200;
+  border-bottom: 12rpx solid #F3B200;
 }
 
 .search-container {
-  padding: 20rpx 30rpx;
+  padding: 20rpx 0rpx;
 }
 
 .search-input {
   position: relative;
   height: 90rpx;
   border-radius: 40rpx;
-  border: 2rpx solid #5B472E;
+  border: 1rpx solid #5B472E;
   background-color: transparent;
   display: flex;
   align-items: center;
@@ -155,11 +155,12 @@
 }
 
 .item-title {
-  font-size: 72rpx;
+  font-size: 60rpx;
   font-weight: bold;
   color: #fff;
   margin-bottom: 8rpx;
-  line-height: 1.2;
+  line-height: 120%;
+  font-family: "heavy"
 }
 
 .item-description {
@@ -167,6 +168,8 @@
   color: #fff;
   overflow: hidden;
   text-overflow: ellipsis;
+  height: 44rpx;
+  width: 100%;
   white-space: nowrap;
 }
 

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

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

+ 1 - 0
pages/exhibition/index.wxss

@@ -163,6 +163,7 @@
   overflow: hidden;
   text-overflow: ellipsis;
   padding: 0 20rpx;
+  font-family: "heavy";
 }
 
 .exhibition-desc {

+ 1 - 0
pages/index/activity/activity.wxss

@@ -106,6 +106,7 @@
   font-weight: bold;
   color: #fff;
   margin-bottom: 8rpx;
+  font-family: 'heavy';
 }
 
 .item-description {

+ 77 - 74
pages/index/index.wxml

@@ -19,92 +19,95 @@
     </view>
   </view>
 
-  <!-- 功能区域 -->
-  <view class="function-section">
-    <view class="function-item {{!isLoggedIn ? 'function-item-disabled' : ''}}" bindtap="handleFunctionClick" data-type="visit">
-      <image src="https://klmybwg.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 {{!isLoggedIn ? 'function-item-disabled' : ''}}" bindtap="handleFunctionClick" data-type="activity">
-      <image src="https://klmybwg.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://klmybwg.4dage.com/mini/wxImg/indexPage/map.png" alt="展馆地图" class="function-icon"></image>
-      <text class="function-text">展馆地图</text>
-    </view>
-    <view class="function-item" bindtap="handleFunctionClick" data-type="introduce">
-      <image src="https://klmybwg.4dage.com/mini/wxImg/indexPage/introduce.png" alt="展馆介绍" class="function-icon"></image>
-      <text class="function-text">展馆介绍</text>
+   <!-- 全部内容区域 -->
+  <view class="all-content">
+    <!-- 功能区域 -->
+    <view class="function-section">
+      <view class="function-item {{!isLoggedIn ? 'function-item-disabled' : ''}}" bindtap="handleFunctionClick" data-type="visit">
+        <image src="https://klmybwg.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 {{!isLoggedIn ? 'function-item-disabled' : ''}}" bindtap="handleFunctionClick" data-type="activity">
+        <image src="https://klmybwg.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://klmybwg.4dage.com/mini/wxImg/indexPage/map.png" alt="展馆地图" class="function-icon"></image>
+        <text class="function-text">展馆地图</text>
+      </view>
+      <view class="function-item" bindtap="handleFunctionClick" data-type="introduce">
+        <image src="https://klmybwg.4dage.com/mini/wxImg/indexPage/introduce.png" alt="展馆介绍" class="function-icon"></image>
+        <text class="function-text">展馆介绍</text>
+      </view>
     </view>
-  </view>
 
-  <!-- 展览资讯 -->
-  <view class="section">
-    <view class="section-header">
-      <text class="section-title">展馆资讯</text>
-      <text class="view-more" bindtap="viewMore" data-section="recommended">查看更多 +</text>
-    </view>
-    <view wx:if="{{newsList && newsList.length > 0}}">
-      <view class="news-item" wx:for="{{newsList}}" wx:key="informationId" bindtap="viewNews" data-item="{{item}}">
-        <image src="{{urlImg + item.indexImg}}" alt="展览资讯" class="news-img" mode="aspectFill"></image>
-        <view class="news-content">
-          <text class="news-title">{{item.title}}</text>
-          <text class="news-desc">⇀</text>
+    <!-- 展览资讯 -->
+    <view class="section">
+      <view class="section-header">
+        <text class="section-title">展馆资讯</text>
+        <text class="view-more" bindtap="viewMore" data-section="recommended">查看更多 +</text>
+      </view>
+      <view wx:if="{{newsList && newsList.length > 0}}">
+        <view class="news-item" wx:for="{{newsList}}" wx:key="informationId" bindtap="viewNews" data-item="{{item}}">
+          <image src="{{urlImg + item.indexImg}}" alt="展览资讯" class="news-img" mode="aspectFill"></image>
+          <view class="news-content">
+            <text class="news-title">{{item.title}}</text>
+            <text class="news-desc">⇀</text>
+          </view>
         </view>
       </view>
+      <view wx:else class="empty-data">
+        <text class="empty-text">暂无数据</text>
+      </view>
     </view>
-    <view wx:else class="empty-data">
-      <text class="empty-text">暂无数据</text>
-    </view>
-  </view>
 
-  <!-- 推荐展览 -->
-  <view class="section">
-    <view class="section-header">
-      <text class="section-title">推荐展览</text>
-      <text class="view-more" bindtap="viewMore" data-section="exhibition">查看更多 +</text>
-    </view>
-    <view wx:if="{{exhibitionList && exhibitionList.length > 0}}">
-      <scroll-view class="scroll-container" scroll-x="{{true}}">
-        <view class="scroll-wrapper">
-          <view class="exhibition-item" wx:for="{{exhibitionList}}" wx:key="exhibitId" bindtap="viewExhibition" data-item="{{item}}">
-            <image src="{{urlImg + item.img}}" alt="展览" class="exhibition-img" mode="aspectFill"></image>
-            <view class="exhibition-info">
-              <text class="exhibition-title">{{item.title}}</text>
+    <!-- 推荐展览 -->
+    <view class="section">
+      <view class="section-header">
+        <text class="section-title">推荐展览</text>
+        <text class="view-more" bindtap="viewMore" data-section="exhibition">查看更多 +</text>
+      </view>
+      <view wx:if="{{exhibitionList && exhibitionList.length > 0}}">
+        <scroll-view class="scroll-container" scroll-x="{{true}}">
+          <view class="scroll-wrapper">
+            <view class="exhibition-item" wx:for="{{exhibitionList}}" wx:key="exhibitId" bindtap="viewExhibition" data-item="{{item}}">
+              <image src="{{urlImg + item.img}}" alt="展览" class="exhibition-img" mode="aspectFill"></image>
+              <view class="exhibition-info">
+                <text class="exhibition-title">{{item.title}}</text>
+              </view>
             </view>
           </view>
-        </view>
-      </scroll-view>
-    </view>
-    <view wx:else class="empty-data">
-      <text class="empty-text">暂无数据</text>
+        </scroll-view>
+      </view>
+      <view wx:else class="empty-data">
+        <text class="empty-text">暂无数据</text>
+      </view>
     </view>
-  </view>
 
-  <!-- 社教活动 -->
-  <view class="section">
-    <view class="section-header">
-      <text class="section-title">社教活动</text>
-      <text class="view-more" bindtap="viewMore" data-section="activity">查看更多 +</text>
-    </view>
-    <view wx:if="{{activeList && activeList.length > 0}}">
-      <scroll-view class="scroll-container" scroll-x="{{true}}">
-        <view class="scroll-wrapper">
-          <view class="activity-item" wx:for="{{activeList}}" wx:key="activityId" bindtap="viewActivity" data-item="{{item}}">
-            <view class="active-top">
-              <image src="{{urlImg + item.indexImg}}" alt="活动" class="activity-img" mode="aspectFill"></image>
-              <text class="active-go">></text>
-            </view>
-            <view class="activity-info">
-              <text class="activity-title">{{item.title}}</text>
+    <!-- 社教活动 -->
+    <view class="section">
+      <view class="section-header">
+        <text class="section-title">社教活动</text>
+        <text class="view-more" bindtap="viewMore" data-section="activity">查看更多 +</text>
+      </view>
+      <view wx:if="{{activeList && activeList.length > 0}}">
+        <scroll-view class="scroll-container" scroll-x="{{true}}">
+          <view class="scroll-wrapper">
+            <view class="activity-item" wx:for="{{activeList}}" wx:key="activityId" bindtap="viewActivity" data-item="{{item}}">
+              <view class="active-top">
+                <image src="{{urlImg + item.indexImg}}" alt="活动" class="activity-img" mode="aspectFill"></image>
+                <image class="active-go" src="https://klmybwg.4dage.com/mini/wxImg/indexPage/active-arrow.png"></image>
+              </view>
+              <view class="activity-info">
+                {{item.title}}
+              </view>
             </view>
           </view>
-        </view>
-      </scroll-view>
-    </view>
-    <view wx:else class="empty-data">
-      <text class="empty-text">暂无数据</text>
+        </scroll-view>
+      </view>
+      <view wx:else class="empty-data">
+        <text class="empty-text">暂无数据</text>
+      </view>
     </view>
   </view>
 </view>

+ 28 - 17
pages/index/index.wxss

@@ -1,11 +1,20 @@
 /* 小程序首页样式 */
 .home-container {
+  position: relative;
   height: 100vh;
-  overflow-y: auto;
+  overflow: hidden;
+}
+.all-content{
+  position: absolute;
+  top: 340rpx;
+  width: 100vw;
+  height: calc(100vh - 360rpx);
+  padding-top: 40rpx;
   background: url('https://klmybwg.4dage.com/mini/wxImg/bg.png') no-repeat center top;
   background-size: 100% auto;
+  overflow-y: auto;
+  border-radius: 30rpx;
 }
-
 .home-not-overflow {
   overflow: hidden;
 }
@@ -13,7 +22,6 @@
 /* 轮播图区域 */
 .carousel-section {
   width: 100%;
-  margin-bottom: 30rpx;
 }
 .nobanner-data{
   display: flex;
@@ -23,14 +31,17 @@
   color: #999;
 }
 .carousel-swiper {
-  height: 360rpx;
+  height: 366rpx;
 }
 
 .carousel-img {
   width: 100%;
   height: 100%;
 }
-
+.carousel-swiper .wx-swiper-dot {
+  position: absolute;
+  bottom: 20rpx;
+}
 /* 功能区域 */
 .function-section {
   display: flex;
@@ -143,6 +154,7 @@
   -webkit-line-clamp: 2;
   -webkit-box-orient: vertical;
   overflow: hidden;
+  font-family: "heavy";
 }
 
 .news-desc {
@@ -168,7 +180,7 @@
 .exhibition-item {
   position: relative;
   flex: 0 0 auto;
-  width: 654rpx;
+  width: 650rpx;
   height: 412rpx;
   margin-right: 20rpx;
   border-radius: 16rpx;
@@ -185,7 +197,7 @@
 }
 
 .exhibition-info {
-  width: 690rpx;
+  width: 100%;
   height: 60rpx;
   display: flex;
   justify-content: center;
@@ -211,7 +223,7 @@
   width: 216rpx;
   margin-right: 20rpx;
   border-radius: 16rpx;
-  overflow: hidden;
+  //overflow: hidden;
 }
 
 .activity-item:last-child {
@@ -227,30 +239,29 @@
 }
 
 .active-go {
-  display: flex;
-  justify-content: center;
-  align-items: center;
   width: 32rpx;
   height: 32rpx;
   position: absolute;
   bottom: 8rpx;
   right: 16rpx;
-  border: 2rpx solid #FCE39E;
-  border-radius: 50%;
-  color: #FCE39E;
-  font-size: 24rpx;
 }
-
 .activity-img {
   width: 216rpx;
   height: 248rpx;
 }
 
 .activity-info {
-  padding: 16rpx;
+  padding: 16rpx 0;
+  width: 216rpx;
+  font-size: 24rpx;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  color: #584735;
 }
 
 .activity-title {
+  width: 216rpx;
   font-size: 24rpx;
   white-space: nowrap;
   overflow: hidden;

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

@@ -24,7 +24,7 @@
         <!-- 查看详情按钮 -->
         <view class="view-details-button" bindtap="viewNews" data-item="{{item}}">
           <text>查看详情</text>
-          <text class="arrow">></text>
+          <image src="https://klmybwg.4dage.com/mini/wxImg/indexPage/news.png"></image>
         </view>
       </view>
     </view>

+ 6 - 0
pages/index/news/news.wxss

@@ -133,6 +133,7 @@
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
+  font-family: 'heavy';
 }
 
 .view-details-button {
@@ -153,6 +154,11 @@
 
 .view-details-button text {
   margin-right: 32rpx;
+  color: #fff;
+}
+.view-details-button image{
+  width: 44rpx;
+  height: 44rpx;
 }
 
 .arrow {

+ 1 - 1
project.private.config.json

@@ -3,7 +3,7 @@
   "projectname": "karamay_wx",
   "setting": {
     "compileHotReLoad": true,
-    "urlCheck": true,
+    "urlCheck": false,
     "coverView": true,
     "lazyloadPlaceholderEnable": false,
     "skylineRenderEnable": false,

+ 1 - 0
utils/util.js

@@ -1,4 +1,5 @@
 const urlImg = 'https://klmybwg.4dage.com' // 改这个公共图片地址的时候别忘记改wxparse的image和video的前缀
+// const urlImg = '' // 测试环境
 const formatTime = date => {
   // 确保date是Date对象
   const dateObj = date instanceof Date ? date : new Date(date)