Browse Source

“以这个为第一代”

zzz 2 tuần trước cách đây
mục cha
commit
b99b87d276

+ 2 - 1
sheji(1)/app.json

@@ -19,7 +19,8 @@
     "pages/ai-plan/ai-plan",
     "pages/communicate/communicate",
     "pages/quiz/quiz",
-    "components/navigation-bar/navigation-bar"
+    "components/navigation-bar/navigation-bar",
+    "pages/xinindex/xinindex"
   ],
   "usingComponents": {
     "van-field": "@vant/weapp/field/index",

+ 147 - 0
sheji(1)/pages/index/index.js

@@ -2,6 +2,7 @@
 const app = getApp()
 Page({
   data: {
+    weightedMenuItems: [],
     layoutType: 'default',
     layoutConfig: {},
     featureLayout: [],
@@ -350,6 +351,7 @@ Page({
   },
 
   onLoad: function(options) {
+    this.getMenuWeights();
     this.getLayoutRecommendation();
     this.mapCtx = wx.createMapContext('map');
     wx.getSystemInfo({
@@ -363,6 +365,106 @@ Page({
       }
     });
   },
+  getMenuWeights: function() {
+    
+    wx.request({
+      url: 'http://127.0.0.1:8000/api/recommend-layout/',
+      header: { 'Authorization': `Token ${app.globalData.userInfo.token}` },
+      success: (res) => {
+        if (res.data && res.data.features) {
+          console.log(res.data.features);
+          this.processMenuData(res.data.features);
+        }
+      },
+      fail: () => {
+        // 失败时使用默认布局
+        this.setDefaultMenu();
+      }
+    });
+  },
+
+  // 处理菜单数据
+  processMenuData: function(features) {
+    // 菜单配置映射 - 更新键名与feature_name保持一致
+    const menuConfig = {
+      'ai-plan': {
+        title: '红途定制',
+        icon: '/images/index/生成攻略.png',
+        url: '/pages/ai-plan/ai-plan'
+      },
+      'search-all': {  // 改为search-all以匹配feature_name
+        title: '红游速搜',
+        icon: '/images/搜索分类.png',
+        url: '/pages/gongjiao/gongjiao'
+      },
+      'quiz-main': {  // 添加quiz-main的配置
+        title: '红史问答堂',
+        icon: '/images/index/游学路线.png',
+        url: '/pages/quiz/quiz'
+      }
+    };
+  
+    // 过滤出有配置的功能并按priority排序(priority值越大权重越高)
+    const validFeatures = features
+      .filter(item => menuConfig[item.feature_name])  // 使用feature_name而非name
+      .sort((a, b) => b.priority - a.priority);  // 使用priority排序
+    
+    console.log('有效功能:', validFeatures);
+  
+    // 构建菜单项数据
+    const menuItems = validFeatures.map((item, index) => {
+      const config = menuConfig[item.feature_name];  // 使用feature_name
+      return {
+        title: config.title,
+        icon: config.icon,
+        url: item.page_path,  // 直接使用数据中的page_path
+        weight: item.priority,  // 使用priority作为权重
+        sizeClass: this.getSizeClass(index),
+        isTop: index === 0
+      };
+    });
+  
+    console.log('生成的菜单项:', menuItems);
+    this.data.weightedMenuItems=menuItems
+    this.setData({
+      weightedMenuItems: menuItems
+    })
+    console.log('生成的菜单项:', this.data.weightedMenuItems);
+  },
+
+  // 根据排序确定尺寸类别
+  getSizeClass: function(index) {
+    return index === 0 ? 'large' : 
+           index < 3 ? 'medium' : 'small';
+  },
+
+  // 默认菜单数据
+  getDefaultMenuItems: function() {
+    return [
+      {
+        title: '红途定制',
+        icon: '/images/index/生成攻略.png',
+        url: '/pages/ai-plan/ai-plan',
+        sizeClass: 'medium',
+        isTop: false
+      },
+      {
+        title: '游学路线',
+        icon: '/images/index/游学路线.png',
+        url: '/pages/gongjiao/gongjiao',
+        sizeClass: 'medium',
+        isTop: false
+      },
+      {
+        title: '红游速搜',
+        icon: '/images/搜索分类.png',
+        url: '/pages/search/search',
+        sizeClass: 'medium',
+        isTop: false
+      }
+    ];
+  },
+
   getLayoutRecommendation() {
     wx.request({
       url: 'http://127.0.0.1:8000/api/recommend-layout/',
@@ -739,7 +841,52 @@ onMarkerTap: function(e) {
 
   onShow: function() {
     // 页面显示
+    this.getRecommendLayout();
+  },
+  getRecommendLayout: function() {
+    const token = wx.getStorageSync('token');
+    if (!token) return;
+
+    wx.request({
+      url: 'https://your-api-domain.com/api/recommend-layout/',
+      header: {
+        'Authorization': `Token ${token}`
+      },
+      success: (res) => {
+        if (res.statusCode === 200) {
+          console.log('布局推荐:', res.data);
+          this.applyLayoutConfig(res.data);
+        }
+      }
+    });
   },
+  applyLayoutConfig: function(data) {
+    const layoutMap = {
+      'map_focused': { map: 0.7, vr: 0.2 },
+      'vr_focused': { map: 0.4, vr: 0.4 },
+      'feature_focused': { map: 0.5, vr: 0.3 },
+      'default': { map: 0.6, vr: 0.3 }
+    };
+
+    // 设置布局类型
+    const layoutType = data.layout_type || 'default';
+    this.setData({
+      layoutConfig: layoutMap[layoutType],
+      featureLayout: this.generateFeatureLayout(data.recommended_order)
+    });
+  },
+
+  // 生成功能布局
+  generateFeatureLayout: function(features) {
+    // 根据推荐顺序生成不同大小的布局项
+    return features.map((feature, index) => {
+      return {
+        feature: feature,
+        size: index < 2 ? 'large' : (index < 4 ? 'medium' : 'small')
+      };
+    }).slice(0, 6); // 只显示前6个功能
+  },
+
   recordFeatureUsage(featureName) {
     const app = getApp();
     console.log('发送的Token:', app.globalData.userInfo.token);

+ 0 - 1
sheji(1)/pages/index/index.json

@@ -3,7 +3,6 @@
   "navigationBarBackgroundColor": "#B71C1C",
   "navigationBarTextStyle": "white",
   "navigationBarTitleText": "首页"
-
   }
   
 

+ 18 - 37
sheji(1)/pages/index/index.wxml

@@ -96,44 +96,25 @@
 
   
 
-  <view class="menu">
-    <view class="service-container">
-      <view class="item">
-        <a href="#" class="service-link">
-          <image 
-            bindtap="navigateTopage" 
-            data-url="/pages/ai-plan/ai-plan" 
-            src="/images/index/生成攻略.png" 
-            class="img" 
-          />
-          <text class="title">红途定制</text>
-        </a>
-      </view>
-      
-      
-      <view class="item">
-        <a href="#" class="service-link">
-          <image 
-            bindtap="navigateTopage" 
-            data-url="/pages/gongjiao/gongjiao" 
-            src="/images/index/游学路线.png" 
-            class="img" 
-          />
-          <text class="title">游学路线</text>
-        </a>
-      </view>
-      <view class="item">
-        <a href="#" class="service-link">
-          <image 
-            bindtap="navigateTopage" 
-            data-url="/pages/gongjiao/gongjiao" 
-            src="/images/搜索分类.png" 
-            class="img" 
-          />
-          <text class="title">红游速搜</text>
-        </a>
+<view class="menu">
+  <view class="service-container">
+    <block wx:for="{{weightedMenuItems}}" wx:key="url">
+      <view 
+        class="item-container {{item.isTop ? 'main-item' : 'side-item'}}"
+        style="{{item.isTop ? '' : (index < 1 ? 'order:2' : 'order:3')}}"
+      >
+        <view class="item-frame" bindtap="navigateTopage" data-url="{{item.url}}">
+          <view class="item-content">
+            <view class="icon-container">
+              <image src="{{item.icon}}" class="img"/>
+            </view>
+            <text class="title">{{item.title}}</text>
+          </view>
+          <view wx:if="{{item.isTop}}" class="top-tag">推荐</view>
+        </view>
       </view>
-    </view>
+    </block>
+  </view>
 </view>
 
 <view class="vr-container" style="height: {{layoutConfig.vr * 100}}vh">

+ 112 - 0
sheji(1)/pages/index/index.wxss

@@ -995,4 +995,116 @@ page {
 
 .vr-focused .vr-container {
   height: 50vh !important;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+/* 容器布局 */
+.service-container {
+  display: grid;
+  grid-template-columns: 3fr 1fr; /* 3:1 列宽比例 */
+  grid-template-rows: 1fr 1fr;    /* 两行等高 */
+  gap: 15rpx;
+  padding: 20rpx;
+  height: 500rpx; /* 固定高度 */
+}
+
+/* 主推荐项样式 */
+.main-item {
+  grid-column: 1;    /* 第一列 */
+  grid-row: 1 / span 2; /* 跨两行 */
+}
+
+/* 侧边项样式 */
+.side-item {
+  grid-column: 2;    /* 第二列 */
+  grid-row: auto;    /* 自动行高 */
+}
+
+/* 相框基础样式 */
+.item-frame {
+  width: 100%;
+  height: 100%;
+  border: 6rpx solid #ff4d4f;
+  border-radius: 12rpx;
+  padding: 20rpx;
+  box-sizing: border-box;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  position: relative;
+  background: #fff;
+}
+
+/* 主推荐项特殊样式 */
+.main-item .item-frame {
+  border-width: 8rpx;
+  box-shadow: 0 8rpx 24rpx rgba(255, 77, 79, 0.3);
+  background: #fff9f9;
+}
+
+/* 图标容器 */
+.icon-container {
+  margin-bottom: 20rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+/* 主推荐项图标 */
+.main-item .icon-container {
+  width: 140rpx;
+  height: 140rpx;
+}
+
+/* 侧边项图标 */
+.side-item .icon-container {
+  width: 80rpx;
+  height: 80rpx;
+}
+
+/* 图片样式 */
+.img {
+  width: 100%;
+  height: 100%;
+}
+
+/* 标题样式 */
+.title {
+  font-size: 28rpx;
+  color: #333;
+  text-align: center;
+}
+
+/* 主推荐项标题 */
+.main-item .title {
+  font-size: 36rpx;
+  font-weight: bold;
+}
+
+/* 推荐标签 */
+.top-tag {
+  position: absolute;
+  top: 10rpx;
+  right: 10rpx;
+  background: #ff4d4f;
+  color: white;
+  padding: 4rpx 15rpx;
+  border-radius: 20rpx;
+  font-size: 24rpx;
+  font-weight: bold;
+  z-index: 10;
+  transform: rotate(15deg);
+  box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.2);
 }

+ 846 - 0
sheji(1)/pages/xinindex/xinindex.js

@@ -0,0 +1,846 @@
+// pages/index/jingdianchaxun/jingdianchaxun.js
+const app = getApp()
+Page({
+  data: {
+    layoutType: 'default',
+    layoutConfig: {},
+    featureLayout: [],
+    latitude: 36.5,
+    longitude: 118.0,
+    scale: 7,
+    showImageModal: false,
+    currentMarker: null,
+    showWebView: false,
+    webViewUrl: "",
+    currentVrTitle: "",
+    searchText: "",
+     // 新增控制变量
+    showSearchMarkers: false,
+    searchMarkers: [] , // 新增绿色搜索标记
+
+    markers: [
+      {
+        id: 1,
+        latitude: 36.665282,
+        longitude: 117.119999,
+        width: 30,    // 添加宽度
+        height: 30,   // 添加高度
+        title: '济南战役纪念馆',
+        address: '市中区英雄山路18号',
+        iconPath: '/images/red-marker.png',
+        callout: {
+          content: '济南战役纪念馆\n华东地区规模最大的革命烈士纪念地',
+          color: '#000',
+          fontSize: 14,
+          borderRadius: 5,
+          bgColor: '#fff',
+          padding: 5,
+          display: 'ALWAYS'
+        },
+        imageUrl: 'https://smp.ouc.edu.cn/_upload/article/images/f5/0d/85b29d70430a9261ef3830f24970/959ccc6d-b829-4d3f-8335-2c776c9faca7.png',
+        description: '济南革命烈士陵园,坐落在泉城济南英雄山风景区,占地480亩,于1949年建成。陵园分为革命烈士纪念塔、济南战役纪念馆、革命烈士墓区、"胜利"铜雕、毛泽东主席凭吊革命烈士纪念亭和济南革命烈士纪念群雕等纪念建筑物。陵园以济南战役纪念馆为中心,形成了辐射全市范围的红色旅游景区。是山东省规模最大的烈士陵园,1977年被公布为山东省第一批重点文物保护单位。',
+        detail: [
+          { label: '开放时间', value: '9:00-16:00(周一闭馆,周二至周日开馆)' },
+          { label: '门票', value: '免费' }
+        ]
+      },
+      {
+        id: 2,
+        latitude: 36.090839,
+        longitude: 120.384428,
+        title: '青岛革命烈士纪念馆',
+        address: '市南区芝泉路6号',
+        width: 30,    // 添加宽度
+        height: 30,   // 添加高度
+        iconPath: '/images/red-marker.png',
+        callout: {
+          content: '青岛革命烈士纪念馆\n山东省重点文物保护单位',
+          color: '#000',
+          fontSize: 14,
+          borderRadius: 5,
+          bgColor: '#fff',
+          padding: 5,
+          display: 'ALWAYS'
+        },
+        imageUrl: 'https://bkimg.cdn.bcebos.com/pic/730e0cf3d7ca7bcb0a463bb5de507c63f6246a6002ad?x-bce-process=image/format,f_auto/quality,Q_70/resize,m_lfit,limit_1,w_536',
+        description: '青岛市革命烈士纪念馆(青岛市烈士纪念设施保护中心)位于市南区芝泉路6号,建立于1977年,1981年6月对外开放,占地面积35512平方米,总建筑面积4050平方米。主要纪念设施有烈士纪念堂、抗战馆、军魂馆、"山河魂"烈士群雕、烈士英名碑、流芳亭等。主要承担烈士纪念活动、烈士纪念设施保护及宣教褒扬等工作。被评为国家级烈士纪念设施,国家、省、市爱国主义教育基地,山东省党史教育基地,山东省国防教育基地,山东省党员教育基地,山东省退役军人思想政治教育基地等。',
+        detail: [
+          { label: '开放时间', value: '9:00-16:30(周一闭馆)' },
+          { label: '门票', value: '免费' }
+        ]
+      },
+      {
+        id: 3,
+        latitude: 36.804685,
+        longitude: 118.055008,
+        title: '黑铁山抗日武装起义纪念馆',
+        address: '张店区四宝山街道',
+        width: 30,    // 添加宽度
+       height: 30,   // 添加高度
+        iconPath: '/images/red-marker.png',
+        callout: {
+          content: '黑铁山起义纪念地\n山东抗日三大起义之一',
+          color: '#000',
+          fontSize: 14,
+          borderRadius: 5,
+          bgColor: '#fff',
+          padding: 5,
+          display: 'ALWAYS'
+        },
+        imageUrl: 'https://bkimg.cdn.bcebos.com/pic/d8f9d72a6059252dd42a4051e4c8143b5bb5c9ea1310?x-bce-process=image/format,f_auto/watermark,image_d2F0ZXIvYmFpa2UyNzI,g_7,xp_5,yp_5,P_20/resize,m_lfit,limit_1,h_1080',
+        description: '黑铁山抗日武装起义纪念馆于1995年纪念抗日战争胜利50周年之际奠基,于1996年8月1日落成开馆。由张店区委区政府发出倡议,号召张店区党政机关、人民大众捐资160万元而兴建。主体为二层楼,建筑面积1300平方米。为淄博市市级重点烈士纪念建筑物保护单位、山东省爱国主义教育基地。',
+        detail: [
+          { label: '开放时间', value: '上午8:30-11:30 下午13:30-17:00(周一闭馆)' },
+          { label: '门票', value: '具体收费情况以现场公示为主' }
+        ]
+      },
+      {
+        id: 4,
+        latitude: 34.810488,
+        longitude: 117.323725,
+        title: '台儿庄大战纪念馆',
+        width: 30,    // 添加宽度
+         height: 30,   // 添加高度
+        address: '台儿庄区沿河南路6号',
+        iconPath: '/images/red-marker.png',
+        callout: {
+          content: '台儿庄大战纪念馆\n抗日战争正面战场首次重大胜利',
+          color: '#000',
+          fontSize: 14,
+          borderRadius: 5,
+          bgColor: '#fff',
+          padding: 5,
+          display: 'ALWAYS'
+        },
+        imageUrl: 'https://bkimg.cdn.bcebos.com/pic/58ee3d6d55fbb2fbee8d1683414a20a44723dcf9?x-bce-process=image/format,f_auto/watermark,image_d2F0ZXIvYmFpa2UyNzI,g_7,xp_5,yp_5,P_20/resize,m_lfit,limit_1,h_1080',
+        description: '台儿庄大战纪念馆,位于山东省枣庄市台儿庄区城区西南郊,是为了纪念抗日战争初期著名的台儿庄战役而修建,于1992年由台儿庄区人民政府筹资建成,1993年4月8日正式对外开放,后经扩建,占地面积达96亩,建筑面积1.2万平方米。台儿庄大战纪念馆由纪念碑、陈列馆、影视馆、全景画馆、战地记者馆、无名英雄墓、国防教育园等部分组成,并设有临时展厅、多功能报告厅和红色图书室。展出文物、图片和史料2000余件,通过历史文物、历史图片、文献资料与各类辅助陈列手段的有机结合,全景再现台儿庄大战中爱国将士报效祖国的壮举。截至2022年底,馆有藏品数量6598件/套,年度观众总数为155323人。台儿庄大战纪念馆是全国百家爱国主义教育示范基地、全国中小学爱国主义教育基地、中国侨联爱国主义教育基地、国家首批国防教育示范基地、国家AAAA级旅游景区,并曾多年获评"山东省文明单位"。2014年8月24日,台儿庄大战纪念馆被列入《第一批国家级抗战纪念设施、遗址名录》。',
+        detail: [
+          { label: '开放时间', value: '8:00-17:00(全年)' },
+          { label: '门票', value: '免费' }
+        ]
+      },
+      {
+        id: 5,
+        latitude: 37.058161,
+        longitude: 118.406168,
+        width: 30,    // 添加宽度
+        height: 30,   // 添加高度
+        title: '东营市历史博物馆',
+        address: '广饶街道月河路270号',
+        iconPath: '/images/red-marker.png',
+        callout: {
+          content: '东营市历史博物馆\n中共刘集支部旧址所在地',
+          color: '#000',
+          fontSize: 14,
+          borderRadius: 5,
+          bgColor: '#fff',
+          padding: 5,
+          display: 'ALWAYS'
+        },
+        imageUrl: 'https://bkimg.cdn.bcebos.com/pic/6a600c338744ebf816436f04d8f9d72a6059a7de?x-bce-process=image/format,f_auto/resize,m_lfit,limit_1,w_504',
+        description: '东营市历史博物馆成立于1993年5月,坐落在东营市南部的广饶县城,东连关帝庙和孙武祠,南临月河公园,西靠月河路,北依广饶宾馆,占地面积30余亩。新馆于2002年1月开工建设,2003年10月建成,总建筑面积6812平方米,全框架结构,外观庄重大方,地上三层,地下一层,陈列总面积3500平方米。',
+        detail: [
+          { label: '开放时间', value: '夏8: 00 —11:30,14:00—17:30;冬8: 00 —11:30,13:30—17:00(周一闭馆)' },
+          { label: '门票', value: '免费' }
+        ]
+      },
+      {
+        id: 6,
+        latitude: 37.540619,
+        longitude: 121.390736,
+        width: 30,    // 添加宽度
+        height: 30,   // 添加高度
+        title: '胶东革命纪念馆',
+        address: '芝罘区海岸路20号',
+        iconPath: '/images/red-marker.png',
+        callout: {
+          content: '胶东革命纪念馆\n胶东地区革命历史展示中心',
+          color: '#000',
+          fontSize: 14,
+          borderRadius: 5,
+          bgColor: '#fff',
+          padding: 5,
+          display: 'ALWAYS'
+        },
+        imageUrl: 'https://bkimg.cdn.bcebos.com/pic/c8177f3e6709c93d70cf743ec971efdcd100bba1feec?x-bce-process=image/format,f_auto/quality,Q_70/resize,m_lfit,limit_1,w_536',
+        description: '胶东革命纪念馆位于烟台,占地面积5600平方米,展陈面积2800平方米,旧址于1865年修建,是全国重点文物保护单位。2018年7月1日起,该馆面向市民免费开放,每周一、周四闭馆。基本陈列包括英雄胶东、奋发图强、走向辉煌三个部分,展示了胶东人民在中国共产党领导下近百年来从苦难到辉煌。',
+        detail: [
+          { label: '开放时间', value: '9:00——16:00(每周一、周四闭馆法定节假日除外)' },
+          { label: '门票', value: '免费' }
+        ]
+      },
+      {
+        id: 7,
+        latitude: 36.707668,
+        longitude: 119.161748,
+        width: 30,    // 添加宽度
+        height: 30,   // 添加高度
+        title: '潍县集中营旧址',
+        address: '奎文区广文街道',
+        iconPath: '/images/red-marker.png',
+        callout: {
+          content: '潍县集中营旧址\n二战期间亚洲最大侨民集中营',
+          color: '#000',
+          fontSize: 14,
+          borderRadius: 5,
+          bgColor: '#fff',
+          padding: 5,
+          display: 'ALWAYS'
+        },
+        imageUrl: 'https://www.iwenbo.fun/storage/heritage/20210131/60169f37505f5.jpg',
+        description: '潍县西方侨民集中营旧址,又名乐道院集中营、山东集中营,位于山东省潍坊市奎文区乐道院。清光绪八年(1882年),美国基督教长老会派牧师狄乐播偕夫人阿撤拉氏(一说为狄珍珠)来潍县传教,在老潍县东关处买地建立"乐道院",乐道院由教堂、学堂、诊所3部分组成,用以传教、办学和开办诊所。民国三十一年(1942年)至民国三十四年(1945年),日军在潍县西方侨民集中营旧址设立"敌国人员生活所",一度成为二战期间亚洲境内最大的"集中营"。从1996年起,潍坊市政府先后投资对潍县西方侨民集中营旧址十字楼进行了修缮,建设纪念碑和乐道广场、乐道雕塑,建成展览馆和陈列馆,并对周边河道进行了治理,进行"乐道钟声"景观公园建设,对观众免费开放。作为二战期间亚洲最大的外国侨民集中营旧址——潍县西方侨民集中营旧址,承载着世界反法西斯战争共同的伤痛记忆,对于拓宽公共外交空间具有不可替代的地位和重要作用。2019年10月,潍县西方侨民集中营旧址被中华人民共和国国务院公布为第八批全国重点文物保护单位。',
+        detail: [
+          { label: '开放时间', value: '夏9:00-17:00;冬9:00-16:30(周一闭馆)' },
+          { label: '门票', value: '免费' }
+        ]
+      },
+      {
+        id: 8,
+        latitude: 35.414921,
+        longitude: 116.587116,
+        width: 30,    // 添加宽度
+        height: 30,   // 添加高度
+        title: '微山湖抗日英烈纪念园',
+        address: '微山县微山岛镇',
+        iconPath: '/images/red-marker.png',
+        callout: {
+          content: '微山湖抗日纪念园\n铁道游击队主要活动区域',
+          color: '#000',
+          fontSize: 14,
+          borderRadius: 5,
+          bgColor: '#fff',
+          padding: 5,
+          display: 'ALWAYS'
+        },
+        imageUrl: 'https://bkimg.cdn.bcebos.com/pic/34fae6cd7b899e510fb319ddf4fece33c895d043a7fb?x-bce-process=image/format,f_auto/watermark,image_d2F0ZXIvYmFpa2UyNzI,g_7,xp_5,yp_5,P_20/resize,m_lfit,limit_1,h_1080',
+        description: '微山湖英烈纪念园,位于山东省微山县夏镇西港,始建于1982年,共投资1100余万元,占地33000平方米,原名为微山县烈士陵园,是为纪念微山湖区革命武装和湖区人民团结抗日,浴血奋战而修建的烈士纪念设施。微山湖英烈纪念园内安葬不同时期牺牲的革命烈士587名。著名烈士有"华东战斗英雄"郭继胜、抗日英雄褚雅青、爆破英雄种衍海等。著名战斗主要有杏园战斗、部城遭遇战、收复微山岛、大捐战斗、南庄战斗、程子庙战斗等。纪念园内主要建筑物有微山湖抗日游击大队纪念碑、微山县烈士英名碑、著名烈士墓区、鲁南战役烈士纪念碑、微山湖区党史纪念馆、文史馆等。整座纪念园布局严谨,绿草如茵,松柏苍翠。2014年,经济宁市人民政府批准,微山湖英烈纪念园被列入市级烈士纪念设施保护单位。',
+        detail: [
+          { label: '开放时间', value: '8:30—17:30(农历除夕至大年初三闭园)' },
+          { label: '门票', value: '免费' }
+        ]
+      },
+      {
+        id: 9,
+        latitude: 36.200371,
+        longitude: 117.087614,
+        width: 30,    // 添加宽度
+        height: 30,   // 添加高度
+        title: '陆房突围胜利纪念馆',
+        address: '肥城市安临站镇',
+        iconPath: '/images/red-marker.png',
+        callout: {
+          content: '陆房突围纪念馆\n八路军115师突围战纪念地',
+          color: '#000',
+          fontSize: 14,
+          borderRadius: 5,
+          bgColor: '#fff',
+          padding: 5,
+          display: 'ALWAYS'
+        },
+        imageUrl: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.rMYotSx3O8zaY_LHeW03NgHaE8?w=246&h=180&c=7&r=0&o=7&dpr=1.8&pid=1.7&rm=3',
+        description: '陆房突围胜利纪念馆是为纪念1939年八路军一一五师陆房突围战役而设立的专题纪念馆。该馆始建于1971年,2015年完成扩建后建筑面积达5300平方米,现陈列包含战斗文物、历史文献及军民生活用品等260件/套藏品。截至2023年,年接待量达18万人次,累计接待单位400余个。2024年8月获评国家二级博物馆,同时被列为国家级抗战纪念设施、遗址及省级爱国主义教育基地',
+        detail: [
+          { label: '开放时间', value: '夏9:00 - 11:30,15:00 - 17:30;冬9:00 - 11:30,14:30 - 17:00(周一闭馆)' },
+          { label: '门票', value: '免费' }
+        ]
+      },
+      {
+        id: 10,
+        latitude: 37.501314,
+        longitude: 122.113556,
+        width: 30,    // 添加宽度
+        height: 30,   // 添加高度
+        title: '天福山起义纪念馆',
+        address: '文登区天福山',
+        iconPath: '/images/red-marker.png',
+        callout: {
+          content: '天福山起义纪念馆\n山东人民抗日救国军诞生地',
+          color: '#000',
+          fontSize: 14,
+          borderRadius: 5,
+          bgColor: '#fff',
+          padding: 5,
+          display: 'ALWAYS'
+        },
+        imageUrl: 'https://example.com/tianfu-mountain.jpg',
+        description: '天福山起义纪念馆位于山东省威海市文登区文登营镇天福山森林公园中心,建筑面积450平方米,陈列面积420平方米。1989年,拆除原有简易展厅,在原址上重新扩建420平方米平房展厅。主要陈列有《天福山起义原址》《中共胶东特委会议旧址》《天福山武装起义会场》《天福山起义纪念塔》等。主要藏品有《三军战士用过的枪支》《军旗、军号、印鉴》《大刀、铁矛头、节鞭》等文物藏品。截至2019年末,天福天福山起义纪念馆先后获得"山东省爱国主义教育基地"、"山东省优秀国防教育基地"等荣誉称号。',
+        detail: [
+          { label: '开放时间', value: '8:30-11:00,13:30-17:00(周一闭馆)' },
+          { label: '门票', value: '免费' }
+        ]
+      }
+    ],
+    storyList: [
+      {
+        id: 1,
+        cover: '/images/index/台儿庄.jpg',  
+        title: '台儿庄战役'
+      },
+      {
+        id: 2,
+        cover: '/images/index/沂蒙山革命.webp',
+        title: '沂蒙山革命'
+      },
+      {
+        id: 3,
+        cover: '/images/index/济南革命烈士.jpg',
+        title: '济南革命烈士'
+      },
+      {
+        id: 4,
+        cover: '/images/index/铁道游击队.webp',
+        title: '铁道游击队'
+      },
+      {
+        id: 5,
+        cover: '/images/index/莱芜战役.jpg',
+        title: '莱芜战役'
+      },
+      {
+        id: 6,
+        cover: '/images/index/羊山战役.png',
+        title: '阳山战役'
+      }
+    ],
+    vrList: [
+      {
+        id: 1,
+        title: "聊城革命烈士陵园",
+        desc: "360°全景展示",
+        thumb: "https://bkimg.cdn.bcebos.com/pic/43a7d933c895d143ad4bb00002a995025aafa40fa9c5?x-bce-process=image/format,f_auto/quality,Q_70/resize,m_lfit,limit_1,w_536",
+        url: "https://www.720yun.com/vr/f27j5puurv1"
+      },
+      {
+        id: 2,
+        title: "台儿庄大战纪念馆",
+        desc: "沉浸式VR体验",
+        thumb: "https://bkimg.cdn.bcebos.com/pic/58ee3d6d55fbb2fbee8d1683414a20a44723dcf9?x-bce-process=image/format,f_auto/watermark,image_d2F0ZXIvYmFpa2UyNzI,g_7,xp_5,yp_5,P_20/resize,m_lfit,limit_1,h_1080",
+        url: "https://www.720yun.com/vr/6f4jtrwaOn5"
+      },
+      {
+        id: 3,
+        title: "鲁西南战役纪念馆",
+        desc: "刘邓大军千里跃进",
+        thumb: "https://bkimg.cdn.bcebos.com/pic/7a899e510fb30f2442a7769cd7dac643ad4bd113a557?x-bce-process=image/format,f_auto/quality,Q_70/resize,m_lfit,limit_1,w_536",
+        url: "https://www.720yun.com/vr/a982acOfyna"
+      },
+      {
+        id: 4,
+        title: "孟良崮战役纪念馆",
+        desc: "解放战争",
+        thumb: "https://bkimg.cdn.bcebos.com/pic/b3119313b07eca806538b17b007280dda144ad342557?x-bce-process=image/format,f_auto/watermark,image_d2F0ZXIvYmFpa2UyNzI,g_7,xp_5,yp_5,P_20/resize,m_lfit,limit_1,h_1080",
+        url: "https://www.720yun.com/vr/3d9jOstmrk2"
+      },
+      {
+        id: 5,
+        title: "昌邑抗日殉国烈士祠",
+        desc: "全国重点文物保护单位",
+        thumb: "http://www.changyibwg.cn/upload/default/20200509/756dff458ee61cb41428e42b9b2019e5.jpg",
+        url: "https://www.720yun.com/vr/5fajOstmrk4"
+      }
+    ],
+    touchStartX: 0,
+    touchStartY: 0,
+    positionX: 0,
+    positionY: 0,
+    showMenu: false,
+    walking: false,
+    windowWidth: 0,
+    windowHeight: 0
+  },
+
+  onLoad: function(options) {
+    this.getLayoutRecommendation();
+    this.mapCtx = wx.createMapContext('map');
+    wx.getSystemInfo({
+      success: (res) => {
+        this.setData({
+          windowWidth: res.windowWidth,
+          windowHeight: res.windowHeight,
+          positionX: res.windowWidth - 80,
+          positionY: res.windowHeight - 180
+        });
+      }
+    });
+  },
+  getLayoutRecommendation() {
+    wx.request({
+      url: 'http://127.0.0.1:8000/api/recommend-layout/',
+      method: 'GET',
+      header: {
+        'Authorization': `Token ${app.globalData.userInfo.token}`
+      },
+      success: (res) => {
+        console.log('布局推荐:', res.data);
+        this.setData({
+          layoutType: res.data.layout_type,
+          featureWeights: res.data.feature_weights
+        });
+      },
+      fail: (err) => {
+        console.error('获取布局失败:', err);
+      }
+    });
+  },
+  generateFeatureLayout(weights) {
+    // 根据权重生成特征布局
+    const features = [
+      {feature: 'ai-plan', name: '红途定制', image: '/images/index/生成攻略.png'},
+      {feature: 'gongjiao', name: '游学路线', image: '/images/index/游学路线.png'},
+      {feature: 'search', name: '红游速搜', image: '/images/搜索分类.png'},
+      {feature: 'quiz', name: '红史问答', image: '/images/quiz-icon.png'}
+    ];
+    
+    // 根据权重排序
+    return features.sort((a, b) => weights[b.feature] - weights[a.feature])
+      .map((item, index) => ({
+        ...item,
+        size: this.getSizeClass(index)
+      }));
+  },
+  
+  getSizeClass(index) {
+    // 根据位置决定大小
+    return index === 0 ? 'large' : (index < 3 ? 'medium' : 'small');
+  },
+  
+  applyLayoutStyle() {
+    // 动态应用布局样式
+    const config = this.data.layoutConfig;
+    const query = wx.createSelectorQuery();
+    
+    query.select('.map-container').boundingClientRect();
+    query.select('.menu').boundingClientRect();
+    query.select('.vr-container').boundingClientRect();
+    query.exec(res => {
+      res[0].node.setStyle({height: `${config.map * 100}vh`});
+      res[1].node.setStyle({display: config.features > 0.3 ? 'block' : 'none'});
+      res[2].node.setStyle({height: `${config.vr * 100}vh`});
+    });
+  },
+  onSearchInput: function(e) {
+    this.setData({
+      searchText: e.detail.value
+    });
+  },
+
+  
+  searchLocation: function(keyword) {
+    const qqMapKey = 'LOABZ-FH4LW-PGHRL-Y73W4-7WMNF-BHFQ5'; // 您的真实KEY
+    wx.request({
+      url: `https://apis.map.qq.com/ws/place/v1/search`,
+      data: {
+        keyword: keyword,
+        boundary: 'region(山东,0)', // 限定山东范围
+        key: qqMapKey
+      },
+      
+      success: (res) => {
+        wx.hideLoading();
+        if (res.data.status === 0 && res.data.data) {
+          this.processSearchResults(res.data.data);
+        } else {
+          wx.showToast({ 
+            title: res.data.message || '搜索失败', 
+            icon: 'none' 
+          });
+        }
+      },
+      fail: (err) => {
+        wx.hideLoading();
+        console.error('API请求失败:', err);
+      }
+    });
+  },
+  
+  addMarker: function(location) {
+    if (!this.mapCtx) {
+      this.mapCtx = wx.createMapContext('map');
+    }
+
+    const newMarker = {
+      id: Date.now(),
+      latitude: location.lat,
+      longitude: location.lng,
+      title: location.name,
+      iconPath: '/images/地点.png',
+      width: 30,
+      height: 30,
+      callout: {
+        content: location.name,
+        color: '#fff',
+        bgColor: '#d32f2f',
+        padding: 8,
+        borderRadius: 4
+      },
+      imageUrl: location.imageUrl || '/images/default.jpg',
+      address: location.address,
+      description: location.description,
+      detail: location.detail || []
+    };
+
+    this.setData({
+      latitude: location.lat,
+      longitude: location.lng,
+      scale: 12,
+      markers: [newMarker]
+    });
+
+    this.mapCtx.moveToLocation();
+    setTimeout(() => {
+      this.mapCtx.translateMarker({
+        markerId: newMarker.id,
+        autoRotate: true,
+        duration: 1000
+      });
+    }, 500);
+  },
+  // 点击按钮触发位置选择
+chooseLocation: function() {
+  const that = this;
+  wx.chooseLocation({
+    success: (res) => {
+      console.log('选择的位置:', res);
+      
+      // 生成绿色搜索标记(与原有红色标记共存)
+      const newMarker = {
+        id: Date.now(), // 动态ID避免冲突
+        latitude: res.latitude,
+        longitude: res.longitude,
+        title: res.name || '已选位置',
+        address: res.address,
+        iconPath: '/images/search-marker.png', // 绿色标记图标
+        width: 30,
+        height: 30,
+        callout: {
+          content: res.name,
+          color: '#fff',
+          bgColor: '#07c160',
+          padding: 8,
+          display: 'ALWAYS'
+        }
+      };
+
+      that.setData({
+        searchMarkers: [newMarker], // 替换旧搜索标记
+        latitude: res.latitude,     // 移动视角到选中位置
+        longitude: res.longitude,
+        scale: 16
+      });
+    },
+    fail: (err) => {
+      console.error('位置选择失败:', err);
+      wx.showToast({ title: '位置选择取消', icon: 'none' });
+    }
+  });
+},
+onSearchConfirm: function() {
+  wx.request({
+    url: 'https://apis.map.qq.com/ws/place/v1/search',
+    success: (res) => {
+      this.setData({
+        // 生成绿色搜索标记(ID从10000开始避免冲突)
+        searchMarkers: res.data.data.map((item, index) => ({
+          id: 10000 + index,
+          latitude: item.location.lat,
+          longitude: item.location.lng,
+          title: item.title,
+          iconPath: '/images/search-marker.png', // 绿色图标
+          width: 30,
+          height: 30,
+          callout: {
+            content: item.title,
+            color: '#fff',
+            bgColor: '#07c160', // 绿色背景
+            display: 'BYCLICK'  // 点击才显示,避免遮挡
+          }
+        })),
+        // 保持原有视野不变(避免红色标记移出屏幕)
+        latitude: this.data.latitude,
+        longitude: this.data.longitude
+      });
+    }
+  });
+},
+  // 在搜索成功的回调中:
+processSearchResults(results) {
+  this.setData({
+    searchMarkers: results.map((item, index) => ({
+      id: 10000 + index, // 确保ID不冲突
+      latitude: item.location.lat,
+      longitude: item.location.lng,
+      title: item.title,
+      iconPath: '/images/search-marker.png',
+      width: 30,
+      height: 30
+    })),
+    showSearchMarkers: true,
+    // 自动定位到第一个结果
+    latitude: results[0].location.lat,
+    longitude: results[0].location.lng,
+    scale: 15
+  });
+},// 标记点击事件处理(兼容原有红标和新绿标)
+onMarkerTap: function(e) {
+  const markerId = e.detail.markerId;
+  
+
+  const redMarker = this.data.markers.find(m => m.id === markerId);
+  if (redMarker) {
+    this.setData({ 
+      currentMarker: redMarker,
+      showImageModal: true // 显示详情弹窗
+    });
+    return;
+  }
+},
+  
+  hideImageModal: function() {
+    this.setData({
+      showImageModal: false
+    });
+  },
+
+  stopPropagation: function() {
+    return;
+  },
+
+  openLocation: function() {
+    if (!this.data.currentMarker) return;
+    
+    wx.openLocation({
+      latitude: this.data.currentMarker.latitude,
+      longitude: this.data.currentMarker.longitude,
+      name: this.data.currentMarker.title,
+      address: this.data.currentMarker.address
+    });
+  },
+
+  showWebView: function(e) {
+    const { url, title } = e.currentTarget.dataset;
+    wx.navigateTo({
+      url: `/pages/vr-detail/vr-detail?url=${encodeURIComponent(url)}&title=${encodeURIComponent(title)}`
+    });
+  },
+
+  hideWebView: function() {
+    this.setData({
+      showWebView: false,
+      webViewUrl: "",
+      currentVrTitle: ""
+    });
+  },
+
+  touchStart: function(e) {
+    this.setData({
+      touchStartX: e.touches[0].clientX,
+      touchStartY: e.touches[0].clientY
+    });
+  },
+
+  touchMove: function(e) {
+    const { touchStartX, touchStartY } = this.data;
+    const moveX = e.touches[0].clientX - touchStartX;
+    const moveY = e.touches[0].clientY - touchStartY;
+    
+    this.setData({
+      positionX: this.data.positionX + moveX,
+      positionY: this.data.positionY + moveY,
+      touchStartX: e.touches[0].clientX,
+      touchStartY: e.touches[0].clientY
+    });
+  },
+
+  touchEnd: function() {
+    const { positionX, positionY, windowWidth, windowHeight } = this.data;
+    const btnSize = 80;
+    
+    let finalX = positionX;
+    let finalY = positionY;
+    
+    if (positionX < 0) finalX = 0;
+    if (positionX > windowWidth - btnSize) finalX = windowWidth - btnSize;
+    if (positionY < 0) finalY = 0;
+    if (positionY > windowHeight - btnSize) finalY = windowHeight - btnSize;
+    
+    this.setData({
+      positionX: finalX,
+      positionY: finalY
+    });
+  },
+
+  showFloatMenu: function() {
+    this.setData({
+      showMenu: true
+    });
+  },
+
+  hideFloatMenu: function() {
+    this.setData({
+      showMenu: false
+    });
+  },
+
+  doFunction1: function() {
+    this.setData({ showMenu: false });
+    wx.showToast({
+      title: '功能1已触发',
+      icon: 'none'
+    });
+  },
+
+  doFunction2: function() {
+    this.setData({ showMenu: false });
+    wx.navigateTo({
+      url: '/pages/function2/function2'
+    });
+  },
+
+  doFunction3: function() {
+    this.setData({ showMenu: false });
+    wx.showModal({
+      title: '提示',
+      content: '确定执行功能3吗?',
+      success(res) {
+        if (res.confirm) {
+          wx.showToast({
+            title: '功能3已执行',
+            icon: 'success'
+          });
+        }
+      }
+    });
+  },
+
+  navigateTopage: function(e) {
+    const pagePath = e.currentTarget.dataset.url;
+    if (pagePath) {
+      wx.navigateTo({
+        url: pagePath,
+      });
+    } else {
+      wx.showToast({
+        title: '功能开发中',
+        icon: 'none'
+      });
+    }
+  },
+
+  viewGallery: function(e) {
+    const id = e.currentTarget.dataset.id;
+    wx.navigateTo({
+      url: `/pages/gallery/detail?id=${id}`
+    });
+  },
+
+  onReady: function() {
+    // 页面初次渲染完成
+  },
+
+  onShow: function() {
+    // 页面显示
+    this.getRecommendLayout();
+  },
+  getRecommendLayout: function() {
+    const token = wx.getStorageSync('token');
+    if (!token) return;
+
+    wx.request({
+      url: 'https://your-api-domain.com/api/recommend-layout/',
+      header: {
+        'Authorization': `Token ${token}`
+      },
+      success: (res) => {
+        if (res.statusCode === 200) {
+          console.log('布局推荐:', res.data);
+          this.applyLayoutConfig(res.data);
+        }
+      }
+    });
+  },
+  applyLayoutConfig: function(data) {
+    const layoutMap = {
+      'map_focused': { map: 0.7, vr: 0.2 },
+      'vr_focused': { map: 0.4, vr: 0.4 },
+      'feature_focused': { map: 0.5, vr: 0.3 },
+      'default': { map: 0.6, vr: 0.3 }
+    };
+
+    // 设置布局类型
+    const layoutType = data.layout_type || 'default';
+    this.setData({
+      layoutConfig: layoutMap[layoutType],
+      featureLayout: this.generateFeatureLayout(data.recommended_order)
+    });
+  },
+
+  // 生成功能布局
+  generateFeatureLayout: function(features) {
+    // 根据推荐顺序生成不同大小的布局项
+    return features.map((feature, index) => {
+      return {
+        feature: feature,
+        size: index < 2 ? 'large' : (index < 4 ? 'medium' : 'small')
+      };
+    }).slice(0, 6); // 只显示前6个功能
+  },
+
+  recordFeatureUsage(featureName) {
+    const app = getApp();
+    console.log('发送的Token:', app.globalData.userInfo.token);
+    console.log('发送的featureName:', featureName);
+  
+    wx.request({
+      url: 'http://127.0.0.1:8000/api/record-usage/',
+      method: 'POST',
+      header: {
+        'Authorization': `Token ${app.globalData.userInfo.token}`,
+        'Content-Type': 'application/json' // 确保这个请求头存在
+      },
+      data: JSON.stringify({ // 关键修改:必须使用JSON.stringify
+        feature_name: featureName // 参数名必须与后端一致
+      }),
+      success: (res) => {
+        console.log('行为记录响应:', res.data);
+      },
+      fail: (err) => {
+        console.error('请求失败:', err);
+      }
+    });
+  },
+  onHide: function() {
+    // 页面隐藏
+  },
+
+  onUnload: function() {
+    // 页面卸载
+  },
+
+  onPullDownRefresh: function() {
+    wx.stopPullDownRefresh();
+  },
+
+  onReachBottom: function() {
+    // 上拉加载更多
+  },
+
+  onShareAppMessage: function() {
+    return {
+      title: '山东红色景点地图',
+      path: '/pages/index/jingdianchaxun/jingdianchaxun',
+      imageUrl: '/images/share.jpg'
+    };
+  },
+
+  onPageScroll: function() {
+    // 页面滚动
+  },
+
+  onTabItemTap: function(item) {
+    // tab点击
+  },
+
+  onResize: function() {
+    // 页面尺寸变化
+  }
+});

+ 10 - 0
sheji(1)/pages/xinindex/xinindex.json

@@ -0,0 +1,10 @@
+{
+  "usingComponents": {},
+  "navigationBarBackgroundColor": "#B71C1C",
+  "navigationBarTextStyle": "white",
+  "navigationBarTitleText": "首页"
+
+  }
+  
+
+

+ 252 - 0
sheji(1)/pages/xinindex/xinindex.wxml

@@ -0,0 +1,252 @@
+<view class="page-container">
+  <!-- 顶部导航栏 -->
+  <view class="top-nav">
+    <text class="nav-title">红途定制 · 专属红色之旅</text>
+    <image src="/images/logo.png" class="nav-logo" />
+  </view>
+
+  <!-- 背景图片放在最底层 -->
+  <view class="map-container" style="height: {{layoutConfig.map * 100}}vh">
+    <map 
+      id="map" 
+      longitude="118.0" 
+      latitude="36.5" 
+      scale="7" 
+      markers="{{markers}}" 
+      bindmarkertap="onMarkerTap" 
+      longitude="{{longitude}}" 
+      latitude="{{latitude}}" 
+      scale="{{scale}}"
+      markers="{{markers}}"
+      style="width: 100%; height: 100%;"
+    ></map>
+    <view class="map-fade"></view>
+    
+    <!-- 红途定制快捷入口(悬浮在地图上) -->
+    <view class="custom-quick-entry" bindtap="navigateToAiPlan">
+      <image src="/images/index/生成攻略.png" class="quick-entry-icon" />
+      <text class="quick-entry-text">立即定制行程</text>
+      <view class="entry-highlight"></view>
+    </view>
+  </view>
+
+  <!-- 红途定制核心模块 -->
+  <view class="custom-core-module">
+    <view class="module-header">
+      <text class="module-title">红途定制 · 智能规划</text>
+      <view class="module-desc">基于您的需求,生成专属红色旅游路线</view>
+    </view>
+    
+    <!-- 定制选项卡 -->
+    <view class="custom-tabs">
+      <view class="tab-item active" data-type="history">历史主题</view>
+      <view class="tab-item" data-type="education">研学教育</view>
+      <view class="tab-item" data-type="red-story">红色故事</view>
+      <view class="tab-item" data-type="custom">自定义</view>
+    </view>
+    
+    <!-- 推荐定制方案 -->
+    <view class="custom-recommendations">
+      <block wx:for="{{recommendedPlans}}" wx:key="id">
+        <view class="plan-card" bindtap="viewCustomPlan" data-id="{{item.id}}">
+          <image src="{{item.coverImage}}" mode="widthFix" class="plan-image" />
+          <view class="plan-info">
+            <view class="plan-title">{{item.title}}</view>
+            <view class="plan-meta">
+              <text class="days">{{item.days}}天行程</text>
+              <text class="spots">{{item.spotCount}}个景点</text>
+              <text class="difficulty">{{item.difficulty}}</text>
+            </view>
+            <view class="plan-tags">
+              <view class="tag" wx:for="{{item.tags}}" wx:key="tag">{{item}}</view>
+            </view>
+          </view>
+          <view class="arrow-icon">→</view>
+        </view>
+      </block>
+    </view>
+    
+    <!-- 立即定制按钮 -->
+    <button class="start-custom-btn" bindtap="navigateToAiPlan">
+      立即定制我的专属路线
+    </button>
+  </view>
+
+  <!-- VR全景体验模块 -->
+  <view class="vr-container" style="height: {{layoutConfig.vr * 100}}vh">
+    <view class="section-header">
+      <text class="section-title">VR全景体验</text>
+      <view class="brush-stroke"></view>
+    </view>
+    
+    <!-- 横向滚动VR列表 -->
+    <scroll-view 
+      class="vr-scroll" 
+      scroll-x 
+      enhanced 
+      show-scrollbar="{{false}}"
+    >
+      <view class="vr-list">
+        <block wx:for="{{vrList}}" wx:key="id">
+          <view 
+            class="vr-card" 
+            bindtap="showWebView" 
+            data-url="{{item.url}}"
+            data-title="{{item.title}}"
+          >
+            <image src="{{item.thumb}}" mode="aspectFill" class="vr-image"/>
+            <view class="vr-info">
+              <text class="vr-title">{{item.title}}</text>
+              <text class="vr-desc">{{item.desc}}</text>
+            </view>
+          </view>
+        </block>
+      </view>
+    </scroll-view>
+  </view>
+
+  <!-- 功能菜单 -->
+  <view class="menu">
+    <view class="service-container">
+      <view class="item highlight">
+        <a href="#" class="service-link">
+          <image 
+            bindtap="navigateToAiPlan" 
+            data-url="/pages/ai-plan/ai-plan" 
+            src="/images/index/生成攻略.png" 
+            class="img" 
+          />
+          <text class="title">红途定制</text>
+        </a>
+      </view>
+      
+      <view class="item">
+        <a href="#" class="service-link">
+          <image 
+            bindtap="navigateTopage" 
+            data-url="/pages/gongjiao/gongjiao" 
+            src="/images/index/游学路线.png" 
+            class="img" 
+          />
+          <text class="title">游学路线</text>
+        </a>
+      </view>
+      
+      <view class="item">
+        <a href="#" class="service-link">
+          <image 
+            bindtap="navigateTopage" 
+            data-url="/pages/search/search" 
+            src="/images/搜索分类.png" 
+            class="img" 
+          />
+          <text class="title">红游速搜</text>
+        </a>
+      </view>
+      
+      <view class="item">
+        <a href="#" class="service-link">
+          <image 
+            bindtap="navigateTopage" 
+            data-url="/pages/quiz/quiz" 
+            src="/images/quiz-icon.png" 
+            class="img" 
+          />
+          <text class="title">红史问答堂</text>
+        </a>
+      </view>
+    </view>
+  </view>
+
+  <!-- 自定义全屏弹窗 -->
+  <view 
+    wx:if="{{showImageModal}}" 
+    class="custom-modal"
+    bindtap="hideImageModal"
+  >
+    <view class="modal-content" catchtap="stopPropagation">
+      <scroll-view scroll-y class="scroll-container" style="height: 70vh;">
+        <image 
+          src="{{currentMarker.imageUrl}}" 
+          mode="widthFix" 
+          class="modal-image"
+        />
+        
+        <view class="main-content">
+          <view class="header">
+            <view class="modal-title">{{currentMarker.title}}</view>
+            <view class="modal-address">
+              <text class="icon">📍</text>
+              {{currentMarker.address}}
+            </view>
+          </view>
+          
+          <view class="modal-description">
+            {{currentMarker.description}}
+          </view>
+          
+          <view class="detail-list">
+            <block wx:for="{{currentMarker.detail}}" wx:key="label">
+              <view class="detail-item {{item.label.includes('门票') ? 'highlight-item' : ''}}">
+                <text class="detail-label">{{item.label}}</text>
+                <view class="detail-value-container">
+                  <text wx:if="{{!item.label.includes('门票')}}">{{item.value}}</text>
+                  <block wx:else>
+                    <text class="{{item.value === '免费' ? 'free-text' : 'fee-text'}}">
+                      {{item.value}}
+                    </text>
+                    <text wx:if="{{item.value === '免费'}}" class="free-badge">免费</text>
+                  </block>
+                </view>
+              </view>
+            </block>
+          </view>
+        </view>
+      </scroll-view>
+      
+      <view class="action-bar">
+        <button class="nav-btn" bindtap="openLocation">
+          导航前往
+        </button>
+        <button class="close-btn" bindtap="hideImageModal">
+          关闭
+        </button>
+      </view>
+    </view>
+    
+    <view class="top-close" bindtap="hideImageModal">
+      <text class="close-icon">×</text>
+    </view>
+  </view>
+
+  <!-- WebView弹窗 -->
+  <view wx:if="{{showWebView}}" class="vr-modal">
+    <view class="modal-header">
+      <text class="modal-title">{{currentVrTitle}}</text>
+      <text class="close-btn" bindtap="hideWebView">×</text>
+    </view>
+    <web-view 
+      src="{{webViewUrl}}"
+      style="height: 85vh; width: 100%;"
+    ></web-view>
+  </view>
+
+  <!-- 悬浮按钮 -->
+  <view class="float-container">
+    <image 
+      src="/images/鸽子.png" 
+      class="float-btn {{walking ? 'walking' : ''}}" 
+      bindtap="showFloatMenu"
+      bindtouchstart="touchStart"
+      bindtouchmove="touchMove"
+      bindtouchend="touchEnd"
+      style="left: {{positionX}}px; top: {{positionY}}px;"
+    ></image>
+
+    <view class="float-menu" wx:if="{{showMenu}}">
+      <view class="menu-item"><navigator url="/pages/quiz/quiz">红史问答堂</navigator></view>
+      <view class="menu-item"><navigator url="/pages/favorites/favorites">我的收藏</navigator></view>
+      <view class="menu-item"><navigator url="/pages/history/history">浏览历史</navigator></view>
+    </view>
+  </view>
+</view>

+ 356 - 0
sheji(1)/pages/xinindex/xinindex.wxss

@@ -0,0 +1,356 @@
+/* 基础样式设置 */
+page {
+  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
+  position: relative;
+  height: 100%;
+  background-color: #fff5f5; /* 红色基调背景增强 */
+}
+
+.page-container {
+  position: relative;
+  min-height: 100vh;
+  padding-bottom: 300rpx;
+  overflow-x: hidden;
+}
+
+/* 搜索框样式 - 位置上移,为核心区域腾出空间 */
+.sousuo {
+  background-color: rgba(255, 255, 255, 0.9);
+  backdrop-filter: blur(10rpx);
+  border: 2rpx solid #FFCDD2;
+  display: flex;
+  height: 80rpx;
+  margin: 20rpx 30rpx 10rpx; /* 减少底部距离 */
+  border-radius: 40rpx;
+  align-items: center;
+  padding: 0 20rpx;
+  position: relative;
+  z-index: 2;
+  box-shadow: 0 4rpx 12rpx rgba(211, 47, 47, 0.15);
+}
+
+/* 红途定制核心区域 - 居中放大突出 */
+.red-custom-core {
+  /* 居中放大布局 */
+  width: calc(100% - 60rpx); /* 几乎全屏宽度 */
+  margin: 20rpx auto 40rpx; /* 居中显示,增加底部距离 */
+  padding: 40rpx 30rpx; /* 增加内边距 */
+  background: linear-gradient(135deg, #fff5f5 0%, #ffebee 100%);
+  border-radius: 24rpx; /* 更大圆角 */
+  box-shadow: 0 10rpx 30rpx rgba(211, 47, 47, 0.15); /* 强化阴影 */
+  position: relative;
+  overflow: hidden;
+  z-index: 3; /* 提高层级 */
+}
+
+/* 装饰元素增强 */
+.red-custom-core::before {
+  content: '';
+  position: absolute;
+  top: -50rpx;
+  right: -50rpx;
+  width: 250rpx;
+  height: 250rpx;
+  background: url('/images/star-pattern.png') no-repeat;
+  background-size: contain;
+  opacity: 0.15;
+  z-index: 1;
+}
+
+.red-custom-core::after {
+  content: '';
+  position: absolute;
+  bottom: -30rpx;
+  left: -30rpx;
+  width: 200rpx;
+  height: 200rpx;
+  background: url('/images/red-pattern.png') no-repeat;
+  background-size: contain;
+  opacity: 0.1;
+  z-index: 1;
+}
+
+/* 核心区域标题强化 */
+.custom-header {
+  display: flex;
+  align-items: center;
+  margin-bottom: 35rpx; /* 增加间距 */
+  position: relative;
+  z-index: 2;
+}
+
+.custom-icon {
+  width: 100rpx; /* 放大图标 */
+  height: 100rpx;
+  margin-right: 25rpx;
+  background-color: rgba(255, 255, 255, 0.8);
+  border-radius: 20rpx;
+  padding: 15rpx;
+  box-shadow: 0 4rpx 10rpx rgba(211, 47, 47, 0.2);
+}
+
+.custom-title {
+  font-size: 44rpx; /* 放大标题 */
+  font-weight: bold;
+  color: #D32F2F;
+  line-height: 1.3;
+}
+
+.custom-subtitle {
+  font-size: 28rpx;
+  color: #792828;
+  margin-top: 8rpx;
+  opacity: 0.9;
+}
+
+/* 定制选项卡增强 */
+.custom-tabs {
+  display: flex;
+  margin-bottom: 35rpx; /* 增加间距 */
+  border-radius: 18rpx;
+  overflow: hidden;
+  background: rgba(255, 255, 255, 0.7);
+  backdrop-filter: blur(8rpx);
+}
+
+.custom-tab {
+  flex: 1;
+  padding: 20rpx 0; /* 增加高度 */
+  font-size: 30rpx; /* 放大文字 */
+  font-weight: 500;
+}
+
+.custom-tab.active {
+  background-color: #D32F2F;
+  color: white;
+  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.15) inset;
+}
+
+/* 定制选项内容区 */
+.custom-options {
+  display: flex;
+  flex-wrap: wrap;
+  gap: 15rpx;
+  margin-bottom: 35rpx;
+  z-index: 2;
+  position: relative;
+}
+
+.custom-option-item {
+  background-color: rgba(255, 255, 255, 0.8);
+  border: 1rpx solid #FFCDD2;
+  border-radius: 15rpx;
+  padding: 12rpx 20rpx;
+  font-size: 26rpx;
+  color: #666;
+}
+
+.custom-option-item.active {
+  background-color: #D32F2F;
+  color: white;
+  border-color: #D32F2F;
+}
+
+/* 主按钮强化 */
+.quick-custom-btn {
+  background-color: #D32F2F;
+  color: white;
+  border-radius: 35rpx; /* 更大圆角 */
+  padding: 22rpx 0; /* 增加高度 */
+  font-size: 32rpx; /* 放大文字 */
+  font-weight: bold;
+  text-align: center;
+  margin-top: 10rpx;
+  box-shadow: 0 6rpx 20rpx rgba(211, 47, 47, 0.3);
+  transition: all 0.3s;
+  position: relative;
+  z-index: 2;
+}
+
+.quick-custom-btn::after {
+  content: '→';
+  margin-left: 10rpx;
+  font-size: 28rpx;
+  animation: arrowMove 1.5s infinite;
+}
+
+@keyframes arrowMove {
+  0%, 100% { transform: translateX(0); }
+  50% { transform: translateX(5rpx); }
+}
+
+.quick-custom-btn:active {
+  background-color: #b71c1c;
+  transform: scale(0.98);
+  box-shadow: 0 4rpx 15rpx rgba(211, 47, 47, 0.25);
+}
+
+/* 菜单容器下移 */
+.menu {
+  margin: 10rpx 30rpx 30rpx; /* 减少顶部距离 */
+}
+
+/* 菜单项调整 - 红途定制相关突出 */
+.item {
+  width: 170rpx;
+  height: 170rpx;
+  margin-bottom: 20rpx;
+}
+
+/* 红途定制菜单项特殊样式 */
+.item.red-custom {
+  /* 显著放大 */
+  width: 185rpx;
+  height: 185rpx;
+  background: linear-gradient(135deg, #fff0f0 0%, #ffebee 100%);
+  border: 2rpx solid #FFCDD2;
+  box-shadow: 0 6rpx 20rpx rgba(211, 47, 47, 0.15);
+  transform: translateY(-5rpx); /* 轻微上浮 */
+}
+
+.item.red-custom::before {
+  content: "热门";
+  position: absolute;
+  top: 10rpx;
+  right: 10rpx;
+  background-color: #ff4d4f;
+  color: white;
+  font-size: 20rpx;
+  padding: 3rpx 10rpx;
+  border-radius: 10rpx;
+  z-index: 2;
+  box-shadow: 0 2rpx 5rpx rgba(0, 0, 0, 0.1);
+}
+
+.item.red-custom .img {
+  background: rgba(211, 47, 47, 0.2);
+  transform: scale(1.1);
+}
+
+.item.red-custom .title {
+  color: #D32F2F;
+  font-weight: bold;
+  font-size: 28rpx;
+}
+
+/* 其他区域样式弱化处理 */
+.background-overlay {
+  opacity: 0.8; /* 降低背景强度 */
+}
+
+/* 故事会区域下移并弱化 */
+.story-container {
+  margin: 20rpx 30rpx 0;
+  opacity: 0.95;
+}
+
+.section-title {
+  font-size: 34rpx;
+  margin: 15rpx 0 25rpx 20rpx;
+}
+
+/* VR容器弱化 */
+.vr-container {
+  margin: 20rpx 0;
+  opacity: 0.95;
+}
+
+/* 动态特征区域下移 */
+.dynamic-features {
+  margin: 20rpx 30rpx 30rpx;
+}
+
+/* 悬浮按钮关联红途定制 */
+.float-container {
+  position: fixed;
+  right: 30rpx;
+  bottom: 120rpx;
+}
+
+.float-btn.custom-btn {
+  width: 120rpx;
+  height: 120rpx;
+  background-color: #D32F2F;
+  border-radius: 50%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  box-shadow: 0 6rpx 20rpx rgba(211, 47, 47, 0.4);
+  animation: pulse 2s infinite;
+}
+
+.float-btn.custom-btn .icon {
+  color: white;
+  font-size: 60rpx;
+}
+
+@keyframes pulse {
+  0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.4); }
+  70% { box-shadow: 0 0 0 20rpx rgba(211, 47, 47, 0); }
+  100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
+}
+
+/* 其他原有样式保持不变 */
+.hero-gradient {
+  background: linear-gradient(
+    to bottom, 
+    transparent 0%,
+    rgba(255,255,255,0.3) 30%,
+    rgba(255,255,255,0.7) 70%,
+    #FFFFFF 100%
+  );
+}
+
+.story-scroll {
+  width: 100%;
+  white-space: nowrap;
+}
+
+.story-list {
+  display: inline-flex;
+}
+
+.story-card {
+  display: inline-flex;
+  width: 400rpx;
+  height: 300rpx;
+  margin-right: 24rpx;
+  position: relative;
+  overflow: hidden;
+  border-radius: 12rpx;
+  box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.08);
+  transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
+}
+
+.vr-scroll {
+  width: 100%;
+  white-space: nowrap;
+  margin-top: 20rpx;
+}
+
+.vr-list {
+  display: inline-flex;
+}
+
+.vr-card {
+  display: inline-block;
+  width: 280rpx;
+  margin-right: 20rpx;
+  border-radius: 12rpx;
+  overflow: hidden;
+  box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.1);
+  background: #fff;
+}
+
+.custom-modal {
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background: rgba(0,0,0,0.8);
+  z-index: 1000;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}