index.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184
  1. <template>
  2. <view class="content">
  3. <!-- 顶部背景装饰 -->
  4. <view class="bg-decoration">
  5. <view class="bg-circle bg-circle-1"></view>
  6. <view class="bg-circle bg-circle-2"></view>
  7. </view>
  8. <!-- 顶部标题 -->
  9. <view class="header">
  10. <text class="header-title">旅游规划</text>
  11. <text class="header-subtitle">创造您的完美旅行体验</text>
  12. </view>
  13. <!-- 行程规划选项 -->
  14. <view class="planning-options">
  15. <view class="option-card custom-plan" hover-class="card-hover" @tap="createCustomPlan">
  16. <view class="option-icon-wrap">
  17. <image class="option-icon" src="/static/custom_plan_icon.png"></image>
  18. </view>
  19. <text class="option-title">自定义行程</text>
  20. <text class="option-desc">根据自己的想法安排行程</text>
  21. <view class="option-arrow">
  22. <text class="arrow-text">开始规划</text>
  23. <text class="arrow-icon">→</text>
  24. </view>
  25. </view>
  26. <view class="option-card ai-plan" hover-class="card-hover" @tap="createAiPlan">
  27. <view class="option-icon-wrap ai-icon-wrap">
  28. <image class="option-icon" src="/static/ai_plan_icon.png"></image>
  29. </view>
  30. <text class="option-title">AI规划行程</text>
  31. <text class="option-desc">智能推荐最佳行程路线</text>
  32. <view class="option-arrow">
  33. <text class="arrow-text">智能生成</text>
  34. <text class="arrow-icon">→</text>
  35. </view>
  36. </view>
  37. </view>
  38. <!-- 待出发行程 -->
  39. <view class="upcoming-trips">
  40. <view class="section-header">
  41. <view class="section-title-wrap">
  42. <text class="section-title">待出发</text>
  43. <view class="title-underline"></view>
  44. </view>
  45. <view class="section-more" @tap="showMoreTrips">
  46. <text class="more-text">查看全部</text>
  47. <text class="more-icon">></text>
  48. </view>
  49. </view>
  50. <!-- 行程卡片列表 -->
  51. <view class="trip-list">
  52. <!-- 显示已保存的行程(限制为2条) -->
  53. <view
  54. v-for="(trip, index) in displayTrips"
  55. :key="trip.id"
  56. class="trip-card"
  57. hover-class="card-hover"
  58. @tap="viewTripDetail(trip.id)"
  59. >
  60. <!-- 添加景区图片背景 -->
  61. <image
  62. class="trip-background-image"
  63. :src="getTripCoverImage(trip)"
  64. mode="aspectFill"
  65. ></image>
  66. <view class="trip-overlay"></view>
  67. <view class="trip-info">
  68. <view class="trip-location">
  69. <image class="location-icon" src="/static/location_icon.png"></image>
  70. <view class="trip-main-info">
  71. <text class="trip-name">{{trip.name}}</text>
  72. <text v-if="trip.startDate" class="trip-date">{{formatDate(trip.startDate)}}</text>
  73. <view v-else class="trip-date-wrap">
  74. <text class="trip-date-label">出发时间</text>
  75. <text class="trip-date-value">待定</text>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="trip-members">
  80. <image class="member-icon" src="/static/member_icon.png"></image>
  81. <text class="member-count">共{{trip.peopleCount || 1}}名成员</text>
  82. </view>
  83. </view>
  84. <view class="trip-stats">
  85. <view class="trip-tag">
  86. <text class="tag-title">THE TRIP</text>
  87. <text class="tag-subtitle">MUST GO ON</text>
  88. <image class="globe-icon" src="/static/globe_icon.png"></image>
  89. </view>
  90. <view class="trip-divider"></view>
  91. <view class="trip-duration">
  92. <text class="stat-label">时长:</text>
  93. <text class="stat-value">{{trip.days}}天{{trip.days - 1}}晚</text>
  94. </view>
  95. <view v-if="trip.budget" class="trip-distance">
  96. <text class="stat-label">预算:</text>
  97. <text class="stat-value">¥{{trip.budget}}</text>
  98. </view>
  99. </view>
  100. <view class="card-shadow"></view>
  101. </view>
  102. <!-- 没有行程时显示的提示 -->
  103. <view class="empty-trip" v-if="savedTrips.length === 0">
  104. <view class="empty-icon">🗺️</view>
  105. <view class="empty-text">您还没有创建任何行程</view>
  106. <view class="empty-subtext">点击上方选项开始规划您的旅行</view>
  107. </view>
  108. </view>
  109. </view>
  110. <!-- 底部推荐 -->
  111. <view class="recommendations">
  112. <view class="recommendation-title">
  113. <text>热门目的地</text>
  114. </view>
  115. <view class="recommendation-list">
  116. <!-- 直接显示两条模拟数据 -->
  117. <view class="spots-grid">
  118. <!-- 北京故宫 -->
  119. <view class="spot-card" @tap="selectDestination('故宫博物院', {name: '故宫博物院', city: '北京', district: '东城区'})">
  120. <view class="spot-tag">5A</view>
  121. <image class="spot-image" src="/static/beijing.jpg" mode="aspectFill"></image>
  122. <view class="spot-name">故宫博物院</view>
  123. <view class="spot-location">
  124. <text class="location-dot">●</text>
  125. <text>北京东城区</text>
  126. </view>
  127. </view>
  128. <!-- 上海外滩 -->
  129. <view class="spot-card" @tap="selectDestination('上海外滩', {name: '上海外滩', city: '上海', district: '黄浦区'})">
  130. <view class="spot-tag">5A</view>
  131. <image class="spot-image" src="/static/shanghai.jpg" mode="aspectFill"></image>
  132. <view class="spot-name">上海外滩</view>
  133. <view class="spot-location">
  134. <text class="location-dot">●</text>
  135. <text>上海黄浦区</text>
  136. </view>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. </template>
  143. <script>
  144. // 导入景点API
  145. import { findalls, findById } from '@/pages/api/luyou.js';
  146. export default {
  147. data() {
  148. return {
  149. title: '旅游规划',
  150. isLoadingSpots: true,
  151. hotSpots: [],
  152. savedTrips: [],
  153. defaultImages: [
  154. '/static/beijing.jpg',
  155. '/static/shanghai.jpg',
  156. '/static/chengdu.jpg',
  157. '/static/hangzhou.jpg',
  158. '/static/guangzhou.jpg'
  159. ]
  160. }
  161. },
  162. onLoad() {
  163. // 加载热门景点数据
  164. this.loadHotSpots();
  165. // 注册刷新行程事件监听
  166. uni.$on('refreshTrips', () => {
  167. console.log('接收到刷新行程列表事件');
  168. this.loadSavedTrips();
  169. });
  170. },
  171. onShow() {
  172. // 页面显示时加载保存的行程数据
  173. this.loadSavedTrips();
  174. // 页面显示时也尝试加载数据(如果还没有数据)
  175. if (this.hotSpots.length === 0 && !this.isLoadingSpots) {
  176. this.loadHotSpots();
  177. }
  178. },
  179. onUnload() {
  180. // 注销事件监听
  181. uni.$off('refreshTrips');
  182. },
  183. computed: {
  184. // 限制只显示前3个热门景点
  185. displaySpots() {
  186. return this.hotSpots.slice(0, 3);
  187. },
  188. // 限制只显示前2个行程
  189. displayTrips() {
  190. return this.savedTrips.slice(0, 2);
  191. }
  192. },
  193. methods: {
  194. // 加载热门景点数据
  195. loadHotSpots() {
  196. this.isLoadingSpots = true;
  197. // 调用API获取景点数据
  198. findalls().then(res => {
  199. console.log('景点API返回数据:', res);
  200. if (res && res.code === 200) {
  201. // 获取API返回的数据数组
  202. let spotsData = res.obj;
  203. // 如果数据在不同的位置,尝试找到正确的位置
  204. if (!Array.isArray(spotsData)) {
  205. if (Array.isArray(res.data)) {
  206. spotsData = res.data;
  207. } else if (res.data && Array.isArray(res.data.obj)) {
  208. spotsData = res.data.obj;
  209. }
  210. }
  211. // 确保获取到的是数组数据
  212. if (Array.isArray(spotsData) && spotsData.length > 0) {
  213. // 过滤有效的景点数据(必须有名称、经纬度和封面图片)
  214. const validSpots = spotsData.filter(spot =>
  215. spot.name &&
  216. (spot.latitude || spot.latitude === 0) &&
  217. (spot.longitude || spot.longitude === 0)
  218. );
  219. // 按景点等级排序,保留最高级别的热门景点
  220. this.hotSpots = validSpots
  221. .sort((a, b) => {
  222. // 先按等级排序
  223. const levelA = a.level ? a.level.replace('A', '') : '0';
  224. const levelB = b.level ? b.level.replace('A', '') : '0';
  225. const levelDiff = parseInt(levelB) - parseInt(levelA);
  226. // 如果等级相同,按城市排序(优先显示保定的景点)
  227. if (levelDiff === 0) {
  228. if (a.city === '保定市' && b.city !== '保定市') return -1;
  229. if (a.city !== '保定市' && b.city === '保定市') return 1;
  230. }
  231. return levelDiff;
  232. });
  233. // 处理封面图片
  234. this.hotSpots = this.hotSpots.map((spot, index) => {
  235. // 如果没有封面图,使用默认图片
  236. if (!spot.coverImage) {
  237. spot.coverImage = this.defaultImages[index % this.defaultImages.length];
  238. } else if (spot.coverImage.startsWith('http')) {
  239. // 如果是完整URL,直接使用
  240. // 不做处理
  241. } else if (!spot.coverImage.startsWith('/')) {
  242. // 如果不是以/开头,添加/
  243. spot.coverImage = '/' + spot.coverImage;
  244. }
  245. return spot;
  246. });
  247. console.log('已加载热门景点:', this.hotSpots.length);
  248. } else {
  249. console.error('API返回的数据不是数组格式:', spotsData);
  250. this.hotSpots = [];
  251. }
  252. } else {
  253. console.error('API返回错误:', res);
  254. this.hotSpots = [];
  255. }
  256. }).catch(err => {
  257. console.error('加载景点数据失败:', err);
  258. this.hotSpots = [];
  259. }).finally(() => {
  260. this.isLoadingSpots = false;
  261. });
  262. },
  263. // 获取景点的简短描述
  264. getShortDesc(spot) {
  265. if (spot.description) {
  266. // 截取描述的前15个字符,如果超过则添加省略号
  267. return spot.description.length > 15 ?
  268. spot.description.substring(0, 15) + '...' :
  269. spot.description;
  270. } else if (spot.city) {
  271. return spot.city + (spot.category ? ' · ' + spot.category : '');
  272. } else if (spot.category) {
  273. return spot.category;
  274. } else {
  275. return '热门景点';
  276. }
  277. },
  278. // 选择目的地
  279. selectDestination(name, spot = null) {
  280. if (spot) {
  281. // 显示加载提示
  282. uni.showLoading({
  283. title: '加载景点详情...'
  284. });
  285. // 调用API获取景点详情
  286. findById(spot.id).then(res => {
  287. uni.hideLoading();
  288. console.log('景点详情API返回:', res);
  289. let detailSpot = null;
  290. // 解析API返回的数据
  291. if (res && res.code === 200) {
  292. // 尝试从不同位置获取数据
  293. if (res.obj) {
  294. detailSpot = res.obj;
  295. } else if (res.data && res.data.obj) {
  296. detailSpot = res.data.obj;
  297. } else if (res.data) {
  298. detailSpot = res.data;
  299. }
  300. }
  301. // 合并API返回的详情和已有的基本数据
  302. const finalSpot = detailSpot ? {...spot, ...detailSpot} : spot;
  303. // 跳转到景点详情页面
  304. uni.navigateTo({
  305. url: `/pages/spot-detail/index?spotId=${finalSpot.id}&spotName=${encodeURIComponent(finalSpot.name)}`,
  306. fail: (err) => {
  307. console.error('跳转到景点详情页失败:', err);
  308. // 如果景点详情页面不存在,则直接跳转到地图页面
  309. this.navigateToSpotMap(finalSpot);
  310. }
  311. });
  312. }).catch(err => {
  313. uni.hideLoading();
  314. console.error('获取景点详情失败:', err);
  315. // 获取详情失败,使用已有的基本信息跳转到地图页面
  316. this.navigateToSpotMap(spot);
  317. });
  318. } else {
  319. uni.showToast({
  320. title: '已选择目的地: ' + name,
  321. icon: 'none'
  322. });
  323. }
  324. },
  325. // 导航到景点地图页面
  326. navigateToSpotMap(spot) {
  327. uni.navigateTo({
  328. url: `/pages/custom-trip/map?lat=${spot.latitude}&lng=${spot.longitude}&name=${encodeURIComponent(spot.name)}`,
  329. fail: (err) => {
  330. console.error('跳转到地图页面失败:', err);
  331. uni.showToast({
  332. title: '跳转失败',
  333. icon: 'none'
  334. });
  335. }
  336. });
  337. },
  338. createCustomPlan() {
  339. uni.showToast({
  340. title: '跳转到保定自定义行程',
  341. icon: 'none',
  342. duration: 2000
  343. });
  344. // 使用navigateTo方式打开地图页面
  345. uni.navigateTo({
  346. url: '/pages/custom-trip/map',
  347. success: () => {
  348. console.log('成功打开保定自定义行程!');
  349. },
  350. fail: (err) => {
  351. console.error('打开保定自定义行程失败:', err);
  352. uni.showModal({
  353. title: '跳转失败',
  354. content: JSON.stringify(err),
  355. showCancel: false
  356. });
  357. }
  358. });
  359. },
  360. createAiPlan() {
  361. // 直接跳转到AI助手页面,默认使用OpenAI
  362. uni.navigateTo({
  363. url: '/pages/ai-assistant/index',
  364. success: (navRes) => {
  365. // 默认使用OpenAI (aiType = 1)
  366. navRes.eventChannel.emit('setAIType', {
  367. aiType: 1
  368. });
  369. console.log('成功打开AI行程助手!');
  370. },
  371. fail: (err) => {
  372. console.error('打开AI行程助手失败:', err);
  373. uni.showModal({
  374. title: '跳转失败',
  375. content: JSON.stringify(err),
  376. showCancel: false
  377. });
  378. }
  379. });
  380. },
  381. viewTripDetail(id) {
  382. uni.showToast({
  383. title: '查看行程详情: ' + id,
  384. icon: 'none'
  385. });
  386. // 跳转到行程详情页
  387. uni.navigateTo({
  388. url: `/pages/travel-detail/index?planId=${id}`,
  389. fail: (err) => {
  390. console.error('跳转到行程详情页失败:', err);
  391. }
  392. });
  393. },
  394. showMoreTrips() {
  395. // 跳转到全部行程页面
  396. uni.navigateTo({
  397. url: '/pages/planning/all-trips',
  398. success: () => {
  399. console.log('成功跳转到全部行程页面');
  400. },
  401. fail: (err) => {
  402. console.error('跳转到全部行程页面失败:', err);
  403. uni.showToast({
  404. title: '跳转失败',
  405. icon: 'none'
  406. });
  407. }
  408. });
  409. },
  410. // 加载保存的行程数据
  411. loadSavedTrips() {
  412. // 首先尝试从API获取行程数据
  413. const useApi = true; // 是否使用API(可以根据环境设置)
  414. if (useApi && this.$api) {
  415. // 显示加载中提示
  416. uni.showLoading({
  417. title: '加载行程数据...',
  418. mask: false
  419. });
  420. // 调用API获取行程列表
  421. this.$api.trip.list()
  422. .then(res => {
  423. if (res && res.data) {
  424. console.log('从API加载行程数据成功:', res.data.length);
  425. this.savedTrips = res.data;
  426. // 同时更新本地存储,保持同步
  427. uni.setStorageSync('savedTrips', res.data);
  428. } else {
  429. console.log('API没有返回行程数据,尝试从本地存储加载');
  430. this.loadLocalTrips();
  431. }
  432. })
  433. .catch(err => {
  434. console.error('从API加载行程数据失败:', err);
  435. // 加载失败时从本地存储获取
  436. this.loadLocalTrips();
  437. })
  438. .finally(() => {
  439. uni.hideLoading();
  440. });
  441. } else {
  442. // 直接从本地存储加载
  443. this.loadLocalTrips();
  444. }
  445. },
  446. // 从本地存储加载行程数据
  447. loadLocalTrips() {
  448. try {
  449. const trips = uni.getStorageSync('savedTrips') || [];
  450. console.log('从本地存储加载的行程:', trips.length);
  451. this.savedTrips = trips;
  452. // 如果有行程数据且API可用,考虑同步到服务器
  453. if (trips.length > 0 && this.$api) {
  454. console.log('有本地行程数据,可以考虑同步到服务器');
  455. // 这里可以调用API.trip.sync(trips)同步数据到服务器
  456. }
  457. } catch (e) {
  458. console.error('加载本地行程失败:', e);
  459. this.savedTrips = [];
  460. }
  461. },
  462. // 格式化日期显示
  463. formatDate(dateString) {
  464. if (!dateString) return '';
  465. const date = new Date(dateString);
  466. return `${date.getFullYear()}.${date.getMonth() + 1}.${date.getDate()}`;
  467. },
  468. // 获取行程封面图片
  469. getTripCoverImage(trip) {
  470. // 如果行程有spots并且第一个spot有图片,则使用该图片
  471. if (trip.spots && trip.spots.length > 0 && trip.spots[0].coverImage) {
  472. return trip.spots[0].coverImage;
  473. }
  474. // 根据行程名称选择默认图片
  475. if (trip.name.includes('保定')) {
  476. return '/static/baoding.jpg';
  477. } else if (trip.name.includes('西安')) {
  478. return '/static/xian.jpg';
  479. } else if (trip.name.includes('北京')) {
  480. return '/static/beijing.jpg';
  481. } else if (trip.name.includes('上海')) {
  482. return '/static/shanghai.jpg';
  483. }
  484. // 默认使用景点图片数组中的一张
  485. const defaultImages = [
  486. '/static/baoding.jpg',
  487. '/static/custom_plan_icon.png',
  488. '/static/beijing.jpg',
  489. '/static/chengdu.jpg'
  490. ];
  491. // 根据行程ID生成一个固定的索引,确保每次显示相同的图片
  492. const hash = trip.id.split('_')[1] || Date.now();
  493. const index = hash % defaultImages.length;
  494. return defaultImages[index];
  495. }
  496. }
  497. }
  498. </script>
  499. <style>
  500. .content {
  501. display: flex;
  502. flex-direction: column;
  503. background: linear-gradient(to bottom, #dbf0ff 0%, #e3f4ff 40%, #f0f9ff 100%);
  504. min-height: 100vh;
  505. padding: 30rpx;
  506. position: relative;
  507. overflow: hidden;
  508. }
  509. /* 背景装饰 */
  510. .bg-decoration {
  511. position: absolute;
  512. top: 0;
  513. left: 0;
  514. width: 100%;
  515. height: 100%;
  516. z-index: 0;
  517. overflow: hidden;
  518. }
  519. .bg-circle {
  520. position: absolute;
  521. border-radius: 50%;
  522. opacity: 0.1;
  523. }
  524. .bg-circle-1 {
  525. top: -300rpx;
  526. right: -200rpx;
  527. width: 800rpx;
  528. height: 800rpx;
  529. background: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
  530. }
  531. .bg-circle-2 {
  532. bottom: -400rpx;
  533. left: -300rpx;
  534. width: 1000rpx;
  535. height: 1000rpx;
  536. background: linear-gradient(120deg, #89f7fe 0%, #66a6ff 100%);
  537. }
  538. .header {
  539. margin-bottom: 40rpx;
  540. position: relative;
  541. z-index: 1;
  542. }
  543. .header-title {
  544. font-size: 48rpx;
  545. font-weight: bold;
  546. color: #333;
  547. margin-bottom: 10rpx;
  548. text-shadow: 2rpx 2rpx 4rpx rgba(0, 0, 0, 0.1);
  549. }
  550. .header-subtitle {
  551. font-size: 28rpx;
  552. color: #666;
  553. font-style: italic;
  554. }
  555. /* 行程规划选项样式 */
  556. .planning-options {
  557. display: flex;
  558. justify-content: space-between;
  559. margin-bottom: 60rpx;
  560. position: relative;
  561. z-index: 1;
  562. }
  563. .option-card {
  564. width: 48%;
  565. background-color: #fff;
  566. border-radius: 20rpx;
  567. padding: 30rpx;
  568. display: flex;
  569. flex-direction: column;
  570. box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.1);
  571. transition: all 0.3s ease;
  572. position: relative;
  573. overflow: hidden;
  574. }
  575. .card-hover {
  576. transform: translateY(-10rpx);
  577. box-shadow: 0 20rpx 40rpx rgba(0, 0, 0, 0.15);
  578. }
  579. .custom-plan {
  580. background: linear-gradient(to bottom right, #ffffff, #f8f8f8);
  581. border: 1rpx solid #eaeaea;
  582. }
  583. .ai-plan {
  584. background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  585. }
  586. .ai-plan .option-title,
  587. .ai-plan .option-desc,
  588. .ai-plan .arrow-text,
  589. .ai-plan .arrow-icon {
  590. color: #fff;
  591. }
  592. .option-icon-wrap {
  593. width: 100rpx;
  594. height: 100rpx;
  595. border-radius: 50%;
  596. background-color: #f0f8ff;
  597. display: flex;
  598. justify-content: center;
  599. align-items: center;
  600. margin-bottom: 20rpx;
  601. box-shadow: 0 6rpx 15rpx rgba(0, 0, 0, 0.05);
  602. }
  603. .ai-icon-wrap {
  604. background-color: rgba(255, 255, 255, 0.2);
  605. }
  606. .option-icon {
  607. width: 60rpx;
  608. height: 60rpx;
  609. }
  610. .option-title {
  611. font-size: 32rpx;
  612. font-weight: bold;
  613. margin-bottom: 10rpx;
  614. color: #333;
  615. }
  616. .option-desc {
  617. font-size: 24rpx;
  618. color: #666;
  619. margin-bottom: 20rpx;
  620. }
  621. .option-arrow {
  622. display: flex;
  623. align-items: center;
  624. justify-content: space-between;
  625. margin-top: 20rpx;
  626. }
  627. .arrow-text {
  628. font-size: 26rpx;
  629. color: #3a9eeb;
  630. }
  631. .arrow-icon {
  632. font-size: 30rpx;
  633. color: #3a9eeb;
  634. }
  635. /* 待出发行程样式 */
  636. .upcoming-trips {
  637. margin-top: 20rpx;
  638. position: relative;
  639. z-index: 1;
  640. }
  641. .section-header {
  642. display: flex;
  643. justify-content: space-between;
  644. align-items: center;
  645. margin-bottom: 30rpx;
  646. }
  647. .section-title-wrap {
  648. position: relative;
  649. }
  650. .section-title {
  651. font-size: 36rpx;
  652. font-weight: bold;
  653. color: #333;
  654. position: relative;
  655. z-index: 1;
  656. }
  657. .title-underline {
  658. position: absolute;
  659. bottom: 0;
  660. left: 0;
  661. width: 80rpx;
  662. height: 10rpx;
  663. background: linear-gradient(to right, #4facfe, #00f2fe);
  664. border-radius: 10rpx;
  665. }
  666. .section-more {
  667. display: flex;
  668. align-items: center;
  669. }
  670. .more-text {
  671. font-size: 26rpx;
  672. color: #3a9eeb;
  673. }
  674. .more-icon {
  675. margin-left: 5rpx;
  676. font-size: 26rpx;
  677. color: #3a9eeb;
  678. }
  679. .trip-list {
  680. display: flex;
  681. flex-direction: column;
  682. gap: 30rpx;
  683. }
  684. .trip-card {
  685. background-color: #fff;
  686. border-radius: 20rpx;
  687. display: flex;
  688. overflow: hidden;
  689. position: relative;
  690. box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.1);
  691. transition: all 0.3s ease;
  692. }
  693. /* 行程卡片背景图片 */
  694. .trip-background-image {
  695. position: absolute;
  696. top: 0;
  697. left: 0;
  698. width: 100%;
  699. height: 100%;
  700. object-fit: cover;
  701. z-index: 1;
  702. }
  703. .trip-overlay {
  704. position: absolute;
  705. top: 0;
  706. left: 0;
  707. width: 100%;
  708. height: 100%;
  709. background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 100%);
  710. z-index: 2;
  711. }
  712. .card-shadow {
  713. position: absolute;
  714. bottom: 0;
  715. left: 0;
  716. right: 0;
  717. height: 8rpx;
  718. background: linear-gradient(to right, #4facfe, #00f2fe);
  719. border-radius: 0 0 20rpx 20rpx;
  720. z-index: 5;
  721. }
  722. .trip-info {
  723. flex: 1;
  724. padding: 30rpx;
  725. display: flex;
  726. flex-direction: column;
  727. justify-content: space-between;
  728. position: relative;
  729. z-index: 3;
  730. }
  731. .trip-location {
  732. display: flex;
  733. align-items: flex-start;
  734. margin-bottom: 30rpx;
  735. }
  736. .location-icon {
  737. width: 40rpx;
  738. height: 40rpx;
  739. margin-right: 15rpx;
  740. margin-top: 6rpx;
  741. }
  742. .trip-main-info {
  743. flex: 1;
  744. }
  745. /* 修改文本颜色以适应图片背景 */
  746. .trip-name {
  747. font-size: 32rpx;
  748. font-weight: bold;
  749. color: #ffffff;
  750. margin-bottom: 15rpx;
  751. line-height: 1.4;
  752. text-shadow: 1rpx 1rpx 3rpx rgba(0, 0, 0, 0.5);
  753. }
  754. .trip-date {
  755. font-size: 28rpx;
  756. color: #f0f0f0;
  757. text-shadow: 1rpx 1rpx 2rpx rgba(0, 0, 0, 0.5);
  758. }
  759. .trip-date-wrap {
  760. display: flex;
  761. align-items: center;
  762. }
  763. .trip-date-label {
  764. font-size: 26rpx;
  765. color: #e0e0e0;
  766. margin-right: 10rpx;
  767. text-shadow: 1rpx 1rpx 2rpx rgba(0, 0, 0, 0.5);
  768. }
  769. .trip-date-value {
  770. font-size: 26rpx;
  771. color: #ffffff;
  772. background-color: rgba(0, 0, 0, 0.3);
  773. padding: 4rpx 16rpx;
  774. border-radius: 100rpx;
  775. }
  776. .trip-members {
  777. display: flex;
  778. align-items: center;
  779. }
  780. .member-icon {
  781. width: 40rpx;
  782. height: 40rpx;
  783. margin-right: 15rpx;
  784. }
  785. .member-count {
  786. font-size: 26rpx;
  787. color: #f0f0f0;
  788. text-shadow: 1rpx 1rpx 2rpx rgba(0, 0, 0, 0.5);
  789. }
  790. .trip-stats {
  791. width: 200rpx;
  792. background: linear-gradient(to bottom, rgba(182, 230, 255, 0.9), rgba(132, 212, 255, 0.9));
  793. padding: 30rpx 20rpx;
  794. display: flex;
  795. flex-direction: column;
  796. align-items: center;
  797. justify-content: center;
  798. position: relative;
  799. z-index: 3;
  800. }
  801. .trip-tag {
  802. display: flex;
  803. flex-direction: column;
  804. align-items: center;
  805. margin-bottom: 20rpx;
  806. }
  807. .tag-title {
  808. font-size: 24rpx;
  809. font-weight: bold;
  810. color: #333;
  811. }
  812. .tag-subtitle {
  813. font-size: 24rpx;
  814. font-weight: bold;
  815. color: #333;
  816. }
  817. .globe-icon {
  818. width: 40rpx;
  819. height: 40rpx;
  820. margin-top: 10rpx;
  821. }
  822. .trip-divider {
  823. width: 80%;
  824. height: 2rpx;
  825. background-color: rgba(51, 51, 51, 0.2);
  826. margin: 15rpx 0;
  827. }
  828. .trip-duration,
  829. .trip-distance {
  830. width: 100%;
  831. display: flex;
  832. flex-direction: column;
  833. align-items: flex-end;
  834. margin-top: 10rpx;
  835. }
  836. .stat-label {
  837. font-size: 24rpx;
  838. color: #333;
  839. text-align: right;
  840. }
  841. .stat-value {
  842. font-size: 28rpx;
  843. font-weight: bold;
  844. color: #333;
  845. text-align: right;
  846. }
  847. /* 热门目的地推荐 */
  848. .recommendations {
  849. margin-top: 60rpx;
  850. position: relative;
  851. z-index: 1;
  852. padding: 0 10rpx;
  853. }
  854. .recommendation-title {
  855. font-size: 36rpx;
  856. font-weight: bold;
  857. color: #333;
  858. margin-bottom: 20rpx;
  859. display: flex;
  860. align-items: center;
  861. }
  862. .recommendation-title::before {
  863. content: "";
  864. display: inline-block;
  865. width: 8rpx;
  866. height: 36rpx;
  867. background: linear-gradient(to bottom, #4facfe, #00f2fe);
  868. margin-right: 16rpx;
  869. border-radius: 4rpx;
  870. }
  871. .recommendation-scroll {
  872. width: 100%;
  873. }
  874. .recommendation-list {
  875. display: flex;
  876. flex-direction: column;
  877. gap: 20rpx;
  878. padding: 10rpx 0;
  879. }
  880. .recommendation-item {
  881. width: 100%;
  882. height: 220rpx;
  883. border-radius: 16rpx;
  884. overflow: hidden;
  885. box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.1);
  886. position: relative;
  887. transition: all 0.3s ease;
  888. }
  889. .recommendation-item:active {
  890. transform: scale(0.98);
  891. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.15);
  892. }
  893. .recommendation-image {
  894. width: 100%;
  895. height: 100%;
  896. object-fit: cover;
  897. }
  898. .recommendation-overlay {
  899. position: absolute;
  900. top: 0;
  901. left: 0;
  902. right: 0;
  903. bottom: 0;
  904. background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0) 100%);
  905. }
  906. .recommendation-info {
  907. position: absolute;
  908. bottom: 0;
  909. left: 0;
  910. right: 0;
  911. padding: 20rpx;
  912. z-index: 2;
  913. }
  914. .recommendation-name {
  915. font-size: 32rpx;
  916. font-weight: bold;
  917. color: #ffffff;
  918. margin-bottom: 6rpx;
  919. text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  920. }
  921. .recommendation-desc {
  922. font-size: 24rpx;
  923. color: rgba(255,255,255,0.9);
  924. text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  925. }
  926. /* 加载中样式 */
  927. .loading-container {
  928. display: flex;
  929. justify-content: center;
  930. align-items: center;
  931. width: 100%;
  932. height: 200rpx;
  933. background-color: #f2f2f2;
  934. border-radius: 16rpx;
  935. margin-bottom: 20rpx;
  936. }
  937. .loading-text {
  938. font-size: 30rpx;
  939. color: #999;
  940. }
  941. /* 空数据样式 */
  942. .empty-trip {
  943. display: flex;
  944. flex-direction: column;
  945. justify-content: center;
  946. align-items: center;
  947. background-color: #f9f9f9;
  948. border-radius: 20rpx;
  949. padding: 60rpx 0;
  950. box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.05);
  951. }
  952. .empty-icon {
  953. font-size: 80rpx;
  954. margin-bottom: 20rpx;
  955. }
  956. .empty-text {
  957. font-size: 32rpx;
  958. color: #666;
  959. margin-bottom: 10rpx;
  960. }
  961. .empty-subtext {
  962. font-size: 26rpx;
  963. color: #999;
  964. }
  965. .empty-container {
  966. display: flex;
  967. justify-content: center;
  968. align-items: center;
  969. width: 100%;
  970. height: 200rpx;
  971. background-color: #f2f2f2;
  972. border-radius: 16rpx;
  973. margin-bottom: 20rpx;
  974. }
  975. .empty-text {
  976. font-size: 30rpx;
  977. color: #999;
  978. }
  979. /* 测试按钮样式 */
  980. .test-btn {
  981. background-color: #ff9500;
  982. color: #fff;
  983. padding: 15rpx 30rpx;
  984. border-radius: 10rpx;
  985. font-size: 28rpx;
  986. font-weight: bold;
  987. text-align: center;
  988. margin-bottom: 20rpx;
  989. align-self: center;
  990. box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.1);
  991. }
  992. /* 热门目的地样式 */
  993. .spots-grid {
  994. display: flex;
  995. justify-content: space-between;
  996. padding: 0 10rpx;
  997. gap: 30rpx;
  998. }
  999. .spot-card {
  1000. width: 320rpx;
  1001. height: 280rpx;
  1002. background-color: #fff;
  1003. border-radius: 20rpx;
  1004. overflow: hidden;
  1005. position: relative;
  1006. box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.1);
  1007. margin-bottom: 20rpx;
  1008. }
  1009. .spot-image {
  1010. width: 100%;
  1011. height: 180rpx;
  1012. border-radius: 20rpx 20rpx 0 0;
  1013. }
  1014. .spot-tag {
  1015. position: absolute;
  1016. top: 16rpx;
  1017. left: 16rpx;
  1018. background-color: #ff6b35;
  1019. color: white;
  1020. font-size: 24rpx;
  1021. padding: 4rpx 12rpx;
  1022. border-radius: 8rpx;
  1023. font-weight: bold;
  1024. z-index: 1;
  1025. }
  1026. .spot-name {
  1027. font-size: 30rpx;
  1028. font-weight: bold;
  1029. color: #333;
  1030. padding: 16rpx 16rpx 8rpx;
  1031. }
  1032. .spot-location {
  1033. display: flex;
  1034. align-items: center;
  1035. font-size: 24rpx;
  1036. color: #999;
  1037. padding: 0 16rpx;
  1038. }
  1039. .location-dot {
  1040. color: #ff4f81;
  1041. font-size: 24rpx;
  1042. margin-right: 6rpx;
  1043. }
  1044. </style>