index.vue 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592
  1. <template>
  2. <view class="dashboard-container">
  3. <!-- 顶部用户信息卡片 -->
  4. <view class="user-info-card">
  5. <view class="user-info">
  6. <text class="greeting">您好,{{ userData.nickname }}</text>
  7. <view class="plot-info">
  8. <text class="plot-label">当前地块:</text>
  9. <text class="plot-name">{{ userData.selectedPlot }}</text>
  10. <view class="switch-plot-btn" v-if="isLogin">
  11. <u-picker :show="show" :columns="columns" :defaultIndex="defaultIndex" @cancel="show = false"
  12. @confirm="onConfirm"></u-picker>
  13. <text @click="handleSwitchPlot">切换</text>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="avatar-container" @click="navigateToProfile">
  18. <view class="avatar">
  19. <image :src="userData.avatar" mode="aspectFill"></image>
  20. </view>
  21. </view>
  22. </view>
  23. <!-- 顶部统计概览 -->
  24. <view class="stats-overview">
  25. <view class="alert-card" v-for="(alert, index) in alertSummaries" :key="index"
  26. @click="navigateToAlertDetail(alert.type)">
  27. <view class="alert-header">
  28. <view class="alert-icon-container">
  29. <image class="custom-icon" :src="alert.iconSrc"></image>
  30. </view>
  31. <text class="alert-title">{{ alert.title }}</text>
  32. </view>
  33. <text class="alert-value">{{ alert.value }}</text>
  34. <text class="alert-description">{{ alert.description }}</text>
  35. </view>
  36. </view>
  37. <!-- 天气卡片 -->
  38. <view class="card weather-card">
  39. <view class="card-header">
  40. <view class="title-section">
  41. <view class="title-line"></view>
  42. <text class="card-title">天气与预报</text>
  43. </view>
  44. </view>
  45. <view class="weather-content">
  46. <view class="current-weather">
  47. <view class="weather-icon-container">
  48. <view class="weather-icon">
  49. <text v-if="weatherData.description === '晴朗'">☀️</text>
  50. <text v-else-if="weatherData.description.includes('雨')">🌧️</text>
  51. <text v-else-if="weatherData.description.includes('云')">⛅</text>
  52. <text v-else>🌤️</text>
  53. </view>
  54. </view>
  55. <view class="weather-details">
  56. <text class="weather-temp">{{ weatherData.temperature }}°C</text>
  57. <text class="weather-desc">{{ weatherData.description }}</text>
  58. </view>
  59. </view>
  60. <view class="weather-metrics">
  61. <view class="weather-metric">
  62. <text class="metric-label">湿度</text>
  63. <text class="metric-value">{{ weatherData.humidity }}%</text>
  64. </view>
  65. <view class="vertical-divider"></view>
  66. <view class="weather-metric">
  67. <text class="metric-label">风力</text>
  68. <text class="metric-value">{{ weatherData.windLevel }} 级</text>
  69. </view>
  70. <view class="vertical-divider"></view>
  71. <view class="weather-metric">
  72. <text class="metric-label">降水量</text>
  73. <text class="metric-value">{{ weatherData.rainfall }} mm</text>
  74. </view>
  75. </view>
  76. <view class="weather-advice">
  77. <view class="advice-header">
  78. <view class="icon-tile small">
  79. <u-icon name="info" color="#ffffff" size="14"></u-icon>
  80. </view>
  81. <text class="advice-title">今日建议:</text>
  82. </view>
  83. <text class="advice-content">{{ weatherData.advice }}</text>
  84. </view>
  85. </view>
  86. </view>
  87. <!-- 农场绩效卡片 -->
  88. <view class="card farm-performance">
  89. <view class="card-header">
  90. <view class="title-section">
  91. <view class="title-line"></view>
  92. <text class="card-title">产值分析</text>
  93. </view>
  94. <view class="period-selector">
  95. <text class="period" :class="{ active: currentPeriod === 'month' }"
  96. @click="changePeriod('month')">月</text>
  97. <text class="period" :class="{ active: currentPeriod === 'quarter' }"
  98. @click="changePeriod('quarter')">季</text>
  99. <text class="period" :class="{ active: currentPeriod === 'year' }"
  100. @click="changePeriod('year')">年</text>
  101. </view>
  102. </view>
  103. <view class="performance-stats">
  104. <view class="metric-column">
  105. <text class="metric-value">128<text class="metric-unit">亩</text></text>
  106. <text class="metric-label">管理面积总计</text>
  107. <view class="growth positive">
  108. <u-icon name="arrow-upward" color="#3BB44A" size="12"></u-icon>
  109. <text>比上月增长12%</text>
  110. </view>
  111. </view>
  112. <view class="metric-divider"></view>
  113. <view class="metric-column">
  114. <text class="metric-value">¥36,480</text>
  115. <text class="metric-label">预计产值</text>
  116. <view class="growth positive">
  117. <u-icon name="arrow-upward" color="#3BB44A" size="12"></u-icon>
  118. <text>比上月增长8.2%</text>
  119. </view>
  120. </view>
  121. </view>
  122. <view class="chart-container">
  123. <view class="chart-header">
  124. <text class="chart-title">产值趋势 (万元)</text>
  125. <view class="chart-legend">
  126. <view class="legend-item">
  127. <view class="legend-color" style="background: #3BB44A;"></view>
  128. <text>今年</text>
  129. </view>
  130. <view class="legend-item">
  131. <view class="legend-color" style="background: #E0E0E0;"></view>
  132. <text>去年</text>
  133. </view>
  134. </view>
  135. </view>
  136. <view class="chart-body">
  137. <view class="y-axis">
  138. <text v-for="(value, index) in [4, 3, 2, 1, 0]" :key="index">{{ value }}</text>
  139. </view>
  140. <view class="bars-container">
  141. <view class="month-group" v-for="(month, index) in farmPerformanceData.months" :key="index">
  142. <view class="bar-wrapper">
  143. <view class="bar last-year"
  144. :style="{ height: (farmPerformanceData.lastYearValues[index] / 4) * 100 + '%' }">
  145. </view>
  146. <view class="bar this-year"
  147. :style="{ height: (farmPerformanceData.thisYearValues[index] / 4) * 100 + '%' }">
  148. </view>
  149. </view>
  150. <text class="month-label">{{ month }}</text>
  151. </view>
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. <!-- 监控设备概览 -->
  157. <view class="card device-overview">
  158. <view class="card-header">
  159. <view class="title-section">
  160. <view class="title-line"></view>
  161. <text class="card-title">监控设备概览</text>
  162. </view>
  163. </view>
  164. <view class="device-metrics-grid">
  165. <view class="device-metric-card" v-for="(metric, index) in deviceMetrics" :key="index">
  166. <view class="device-metric-header">
  167. <view class="icon-tile" :style="{ background: metric.gradient }">
  168. <u-icon :name="metric.icon" color="#ffffff" size="18"></u-icon>
  169. </view>
  170. <text class="metric-name">{{ metric.name }}</text>
  171. </view>
  172. <view class="device-metric-value">{{ metric.value }}</view>
  173. <view class="device-metric-trend" :class="metric.trend.type">
  174. <u-icon :name="metric.trend.type === 'up' ? 'arrow-upward' : 'arrow-downward'"
  175. :color="metric.trend.type === 'up' ? '#3BB44A' : '#FF5252'" size="14"></u-icon>
  176. <text>{{ metric.trend.value }}</text>
  177. </view>
  178. </view>
  179. </view>
  180. </view>
  181. <!-- 农业机械活动 -->
  182. <view class="card machinery-activity">
  183. <view class="card-header">
  184. <view class="title-section">
  185. <view class="title-line"></view>
  186. <text class="card-title">农机作业概览</text>
  187. </view>
  188. </view>
  189. <view class="machinery-metrics-grid">
  190. <view class="machinery-metric-card" v-for="(metric, index) in machineryMetrics" :key="index">
  191. <view class="machinery-metric-header">
  192. <view class="icon-tile" :style="{ background: metric.gradient }">
  193. <u-icon :name="metric.icon" color="#ffffff" size="18"></u-icon>
  194. </view>
  195. <text class="metric-name">{{ metric.name }}</text>
  196. </view>
  197. <view class="machinery-metric-value">{{ metric.value }}</view>
  198. <view v-if="metric.trend" class="machinery-metric-trend" :class="metric.trend.type">
  199. <u-icon :name="metric.trend.type === 'up' ? 'arrow-upward' : 'arrow-downward'"
  200. :color="metric.trend.type === 'up' ? '#3BB44A' : '#FF5252'" size="14"></u-icon>
  201. <text>{{ metric.trend.value }}</text>
  202. </view>
  203. <view v-else class="machinery-metric-unit">
  204. <text>{{ metric.unit }}</text>
  205. </view>
  206. </view>
  207. </view>
  208. </view>
  209. <!-- 农场活动卡片 -->
  210. <view class="card farm-activities">
  211. <view class="card-header">
  212. <view class="title-section">
  213. <view class="title-line"></view>
  214. <text class="card-title">农事活动</text>
  215. </view>
  216. <view class="action-button">
  217. <text>查看全部</text>
  218. <u-icon name="arrow-right" color="#ffffff" size="14"></u-icon>
  219. </view>
  220. </view>
  221. <view class="activities-list">
  222. <view class="activity-item" v-for="(activity, index) in farmData.recentActivities" :key="index">
  223. <view class="activity-dot" :class="activity.status"></view>
  224. <view class="activity-details">
  225. <view class="activity-title-row">
  226. <text class="activity-title">{{ activity.title }}</text>
  227. <text class="activity-date">{{ activity.date }}</text>
  228. </view>
  229. <view class="activity-meta-row">
  230. <text class="activity-executor">{{ activity.executor }}</text>
  231. <view class="activity-action" @click.stop="navigateToActivity(activity)">
  232. <text class="action-text">查看</text>
  233. <u-icon name="arrow-right" color="#3BB44A" size="14"></u-icon>
  234. </view>
  235. </view>
  236. </view>
  237. </view>
  238. </view>
  239. </view>
  240. </view>
  241. </template>
  242. <script>
  243. import storage from "@/utils/storage.js";
  244. import {
  245. listFieldName
  246. } from "@/api/services/field.js"
  247. export default {
  248. data() {
  249. return {
  250. isLogin:false,
  251. show: false,
  252. columns: [
  253. []
  254. ],
  255. defaultIndex: [0],
  256. // 用户数据
  257. userData: {
  258. nickname: '游客',
  259. selectedPlot: '未选择地块',
  260. avatar: '/static/images/user-avatar.png',
  261. },
  262. // 农场数据
  263. farmData: {
  264. plotCount: 5,
  265. deviceCount: 12,
  266. deviceOnlineRate: 85,
  267. taskCompletionRate: 76,
  268. recentActivities: [{
  269. title: '稻田水稻施肥',
  270. date: '2023-05-15',
  271. status: 'pending',
  272. id: 1,
  273. executor: '李四'
  274. },
  275. {
  276. title: '南地块除草',
  277. date: '2023-05-12',
  278. status: 'completed',
  279. id: 2,
  280. executor: '王五'
  281. },
  282. {
  283. title: '西北区域杀虫',
  284. date: '2023-05-08',
  285. status: 'completed',
  286. id: 3,
  287. executor: '张三'
  288. }
  289. ]
  290. },
  291. // 天气数据
  292. weatherData: {
  293. temperature: 28,
  294. description: '晴朗',
  295. humidity: 65,
  296. windLevel: 3,
  297. rainfall: 0,
  298. advice: '今日适宜进行春玉米防虫作业,注意水分管理。'
  299. },
  300. // 作物数据
  301. crops: [{
  302. name: '水稻',
  303. area: 48,
  304. progress: 75,
  305. icon: '🌾',
  306. bgColor: '#4CAF50'
  307. },
  308. {
  309. name: '小麦',
  310. area: 36,
  311. progress: 60,
  312. icon: '🌿',
  313. bgColor: '#66BB6A'
  314. },
  315. {
  316. name: '玉米',
  317. area: 32,
  318. progress: 85,
  319. icon: '🌽',
  320. bgColor: '#43A047'
  321. },
  322. {
  323. name: '大豆',
  324. area: 12,
  325. progress: 40,
  326. icon: '🫘',
  327. bgColor: '#388E3C'
  328. }
  329. ],
  330. // 监控设备指标
  331. deviceMetrics: [{
  332. name: '在线设备',
  333. value: '28',
  334. icon: 'wifi',
  335. gradient: 'linear-gradient(135deg, #26A69A, #00796B)',
  336. trend: {
  337. type: 'up',
  338. value: '5.2%'
  339. }
  340. },
  341. {
  342. name: '告警设备',
  343. value: '3',
  344. icon: 'error-circle',
  345. gradient: 'linear-gradient(135deg, #FF7043, #E64A19)',
  346. trend: {
  347. type: 'down',
  348. value: '2.1%'
  349. }
  350. },
  351. {
  352. name: '离线设备',
  353. value: '5',
  354. icon: 'close-circle',
  355. gradient: 'linear-gradient(135deg, #78909C, #455A64)',
  356. trend: {
  357. type: 'down',
  358. value: '1.8%'
  359. }
  360. },
  361. {
  362. name: '数据稳定性',
  363. value: '96.3%',
  364. icon: 'checkmark-circle',
  365. gradient: 'linear-gradient(135deg, #66BB6A, #388E3C)',
  366. trend: {
  367. type: 'up',
  368. value: '0.5%'
  369. }
  370. }
  371. ],
  372. // 农业机械指标
  373. machineryMetrics: [{
  374. name: '今日运行时长',
  375. value: '36.5',
  376. unit: '小时',
  377. icon: 'clock',
  378. gradient: 'linear-gradient(135deg, #42A5F5, #1976D2)'
  379. },
  380. {
  381. name: '今日作业地块',
  382. value: '8',
  383. unit: '块',
  384. icon: 'map',
  385. gradient: 'linear-gradient(135deg, #66BB6A, #388E3C)'
  386. },
  387. {
  388. name: '今日执行任务',
  389. value: '12',
  390. unit: '个',
  391. icon: 'calendar',
  392. gradient: 'linear-gradient(135deg, #FFA726, #F57C00)'
  393. },
  394. {
  395. name: '使用率',
  396. value: '78.2%',
  397. icon: 'star',
  398. gradient: 'linear-gradient(135deg, #5C6BC0, #3949AB)',
  399. trend: {
  400. type: 'up',
  401. value: '3.7%'
  402. }
  403. }
  404. ],
  405. // 当前选择的周期
  406. currentPeriod: 'month',
  407. // 警报摘要数据
  408. alertSummaries: [{
  409. title: '设备离线',
  410. value: '3 台',
  411. iconSrc: '/static/icons/offline.png',
  412. description: '最长离线时长:26 小时',
  413. type: 'device-offline'
  414. },
  415. {
  416. title: '虫害预警',
  417. value: '稻飞虱|小地老虎',
  418. iconSrc: '/static/icons/Pest_Alert.png',
  419. description: '预警等级:中',
  420. type: 'pest-warning'
  421. },
  422. {
  423. title: '气象预警',
  424. value: '强风(8级)',
  425. iconSrc: '/static/icons/weather_risk.png',
  426. description: '预计:未来 12 小时内',
  427. type: 'weather-risk'
  428. },
  429. {
  430. title: '作业延迟',
  431. value: '5 项',
  432. iconSrc: '/static/icons/task_delay.png',
  433. description: '最长延迟:3 天',
  434. type: 'task-delay'
  435. }
  436. ],
  437. // 农场绩效图表数据 - 月度数据
  438. monthlyData: {
  439. months: ['1月', '2月', '3月', '4月', '5月', '6月'],
  440. thisYearValues: [2.8, 3.4, 2.9, 3.6, 3.8, 3.2],
  441. lastYearValues: [2.5, 2.8, 2.4, 3.0, 3.2, 2.7]
  442. },
  443. // 季度数据
  444. quarterlyData: {
  445. months: ['Q1', 'Q2', 'Q3', 'Q4'],
  446. thisYearValues: [3.2, 3.7, 4.0, 3.5],
  447. lastYearValues: [2.7, 3.3, 3.6, 3.0]
  448. },
  449. // 年度数据
  450. yearlyData: {
  451. months: ['2019', '2020', '2021', '2022', '2023'],
  452. thisYearValues: [2.2, 2.5, 3.0, 3.5, 3.8],
  453. lastYearValues: [2.0, 2.3, 2.7, 3.2, 3.4]
  454. }
  455. };
  456. },
  457. computed: {
  458. // 核心统计数据
  459. coreStats() {
  460. return [{
  461. label: '地块',
  462. value: this.farmData.plotCount,
  463. icon: 'map',
  464. },
  465. {
  466. label: '设备',
  467. value: this.farmData.deviceCount,
  468. icon: 'setting',
  469. },
  470. {
  471. label: '设备在线',
  472. value: this.farmData.deviceOnlineRate + '%',
  473. icon: 'wifi',
  474. },
  475. {
  476. label: '任务完成',
  477. value: this.farmData.taskCompletionRate + '%',
  478. icon: 'checkmark-circle',
  479. }
  480. ];
  481. },
  482. // 根据当前周期计算要显示的数据
  483. farmPerformanceData() {
  484. if (this.currentPeriod === 'month') {
  485. return this.monthlyData;
  486. } else if (this.currentPeriod === 'quarter') {
  487. return this.quarterlyData;
  488. } else {
  489. return this.yearlyData;
  490. }
  491. }
  492. },
  493. methods: {
  494. loadPhots(userId) {
  495. console.log("加载用户字段", userId);
  496. listFieldName(userId)
  497. .then(res => {
  498. const {
  499. data
  500. } = res || {};
  501. if (data?.code !== 200 || !Array.isArray(data.data)) {
  502. console.warn("接口返回异常或数据格式不正确", res);
  503. return;
  504. }
  505. const fieldList = data.data;
  506. const fields = [];
  507. fieldList.forEach(item => {
  508. const fieldName = item?.fieldName;
  509. if (fieldName && !fields.includes(fieldName)) {
  510. fields.push({
  511. text: fieldName,
  512. value: item.id
  513. });
  514. }
  515. });
  516. this.columns = [fields]; // 符合 u-picker 的二维数组格式
  517. storage.setCurrentUserPlotsList(fields)
  518. console.log("字段加载完成:", this.columns);
  519. // 字段加载完成后立即设置默认索引
  520. this.setDefaultSelectedPlot();
  521. })
  522. .catch(err => {
  523. console.error("加载字段失败", err);
  524. });
  525. },
  526. // 初始化地块列表
  527. initPlotColumns() {
  528. const cached = storage.getCurrentUserPlotsList();
  529. if (Array.isArray(cached) && cached.length > 0) {
  530. this.columns = [cached]; // 结构上是二维数组
  531. console.log("从缓存加载字段:", this.columns);
  532. } else {
  533. this.loadPhots(this.userData.userId); // 异步方法内部要处理赋值 columns
  534. }
  535. },
  536. // 设置默认选中项
  537. setDefaultSelectedPlot() {
  538. try {
  539. const currentPlots = JSON.parse(storage.getPlots() || '{}');
  540. console.log("设置默认地块", currentPlots);
  541. if (currentPlots?.name) {
  542. this.userData.selectedPlot = currentPlots.name;
  543. // 防止 this.columns 未定义或格式不正确
  544. if (Array.isArray(this.columns) && this.columns.length > 0 && Array.isArray(this.columns[0])) {
  545. const plots = this.columns[0];
  546. const index = plots.findIndex(item => item.text === currentPlots.name);
  547. if (index !== -1) {
  548. this.defaultIndex = [index];
  549. console.log("设置默认选中地块索引:", index, "defaultIndex:", this.defaultIndex);
  550. } else {
  551. console.warn("未找到匹配的地块:", currentPlots.name);
  552. this.defaultIndex = [0]; // 默认选中第一项
  553. }
  554. } else {
  555. console.warn("columns数据格式不正确:", this.columns);
  556. this.defaultIndex = [0]; // 默认选中第一项
  557. }
  558. } else {
  559. console.warn("未设置默认地块或地块名为空");
  560. this.defaultIndex = [0]; // 默认选中第一项
  561. }
  562. } catch (error) {
  563. console.error("设置默认地块时出错:", error);
  564. this.defaultIndex = [0]; // 出错时默认选中第一项
  565. }
  566. },
  567. onConfirm(e) {
  568. console.log('选择了:', e);
  569. this.userData.selectedPlot = e.value[0].text
  570. let obj = {id:e.value[0].value,name:e.value[0].text}
  571. storage.setPlots(JSON.stringify(obj))
  572. this.show = false;
  573. },
  574. // 处理切换地块
  575. handleSwitchPlot() {
  576. // 在显示picker前重新设置defaultIndex
  577. this.setDefaultSelectedPlot();
  578. this.show = true;
  579. },
  580. // 导航到个人资料
  581. navigateToProfile() {
  582. uni.navigateTo({
  583. url: '/pages/user/index'
  584. });
  585. },
  586. // 导航到活动详情
  587. navigateToActivity(activity) {
  588. uni.navigateTo({
  589. url: `/pages/activity/detail?id=${activity.id}`
  590. });
  591. },
  592. // 导航到警报详情
  593. navigateToAlertDetail(type) {
  594. // 实现导航到警报详情页的逻辑
  595. console.log(`Navigating to alert detail for type: ${type}`);
  596. },
  597. // 切换周期
  598. changePeriod(period) {
  599. this.currentPeriod = period;
  600. }
  601. },
  602. onShow() {
  603. const userInfo = storage.getUserInfo()
  604. console.log("userInfo", userInfo);
  605. this.userData.nickname = userInfo.nickName || '未登录'
  606. this.userData.avatar = userInfo.avatar || '/static/icons/user_icon.png'
  607. this.userData.userId = userInfo.userId
  608. if(storage.getHasLogin()){
  609. this.isLogin = true;
  610. // 加载当前登录用户所属所有地块信息
  611. const cached = storage.getCurrentUserPlotsList();
  612. if (Array.isArray(cached) && cached.length > 0) {
  613. // 如果有缓存,直接用缓存构造 columns
  614. this.columns = [cached];
  615. console.log("从缓存加载字段:", this.columns);
  616. // 有缓存时,在columns设置后立即设置defaultIndex
  617. this.setDefaultSelectedPlot();
  618. } else {
  619. // 无缓存时请求接口,在接口完成后会调用setDefaultSelectedPlot
  620. this.loadPhots(this.userData.userId);
  621. }
  622. console.log("columns", this.columns);
  623. }
  624. },
  625. mounted() {
  626. }
  627. };
  628. </script>
  629. <style lang="scss" scoped>
  630. .dashboard-container {
  631. padding: 24rpx;
  632. background-color: #F6FDF9;
  633. min-height: 100vh;
  634. }
  635. // 顶部用户信息卡片
  636. .user-info-card {
  637. display: flex;
  638. justify-content: space-between;
  639. align-items: center;
  640. background: white;
  641. border-radius: 20rpx;
  642. padding: 24rpx 28rpx;
  643. margin-bottom: 24rpx;
  644. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.04);
  645. .user-info {
  646. flex: 1;
  647. .greeting {
  648. font-size: 32rpx;
  649. font-weight: 600;
  650. color: #2C3E50;
  651. margin-bottom: 8rpx;
  652. }
  653. .plot-info {
  654. display: flex;
  655. align-items: center;
  656. .plot-label {
  657. font-size: 24rpx;
  658. color: #8C9396;
  659. }
  660. .plot-name {
  661. font-size: 24rpx;
  662. color: #2C3E50;
  663. margin: 0 8rpx;
  664. }
  665. .switch-plot-btn {
  666. display: flex;
  667. align-items: center;
  668. justify-content: center;
  669. background: linear-gradient(135deg, #3BB44A, #66CC6A);
  670. border-radius: 16rpx;
  671. padding: 4rpx 16rpx;
  672. box-shadow: 0 2rpx 8rpx rgba(59, 180, 74, 0.25);
  673. text {
  674. font-size: 22rpx;
  675. color: white;
  676. }
  677. }
  678. }
  679. }
  680. .avatar-container {
  681. .avatar {
  682. width: 80rpx;
  683. height: 80rpx;
  684. border-radius: 50%;
  685. background-color: rgba(59, 180, 74, 0.1);
  686. border: 2px solid rgba(255, 255, 255, 0.8);
  687. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
  688. overflow: hidden;
  689. image {
  690. width: 100%;
  691. height: 100%;
  692. object-fit: cover;
  693. }
  694. }
  695. }
  696. }
  697. // Top Stats Overview
  698. .stats-overview {
  699. display: grid;
  700. grid-template-columns: repeat(2, 1fr);
  701. gap: 16rpx;
  702. margin-bottom: 24rpx;
  703. .alert-card {
  704. background: white;
  705. border-radius: 16rpx;
  706. padding: 20rpx;
  707. display: flex;
  708. flex-direction: column;
  709. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
  710. position: relative;
  711. overflow: hidden;
  712. transition: transform 0.2s, box-shadow 0.2s;
  713. &:active {
  714. transform: translateY(2rpx);
  715. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
  716. }
  717. &::after {
  718. content: "";
  719. position: absolute;
  720. right: 12rpx;
  721. bottom: 12rpx;
  722. width: 16rpx;
  723. height: 16rpx;
  724. border-top: 2rpx solid #E0E0E0;
  725. border-right: 2rpx solid #E0E0E0;
  726. transform: rotate(45deg);
  727. opacity: 0.5;
  728. }
  729. .alert-header {
  730. display: flex;
  731. align-items: center;
  732. margin-bottom: 12rpx;
  733. .alert-icon-container {
  734. margin-right: 12rpx;
  735. width: 40rpx;
  736. height: 40rpx;
  737. display: flex;
  738. align-items: center;
  739. justify-content: center;
  740. .custom-icon {
  741. width: 40rpx;
  742. height: 40rpx;
  743. object-fit: contain;
  744. }
  745. }
  746. .alert-title {
  747. font-size: 26rpx;
  748. color: #333333;
  749. font-weight: 600;
  750. }
  751. }
  752. .alert-value {
  753. font-size: 30rpx;
  754. font-weight: 700;
  755. color: #3BB44A;
  756. margin-bottom: 6rpx;
  757. line-height: 1.2;
  758. padding-left: 52rpx;
  759. }
  760. .alert-description {
  761. font-size: 22rpx;
  762. color: #757575;
  763. padding-left: 52rpx;
  764. }
  765. }
  766. }
  767. // Card Base Styles
  768. .card {
  769. background: white;
  770. border-radius: 20rpx;
  771. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.04), 0 1rpx 4rpx rgba(0, 0, 0, 0.02);
  772. margin-bottom: 24rpx;
  773. overflow: hidden;
  774. .card-header {
  775. display: flex;
  776. justify-content: space-between;
  777. align-items: center;
  778. padding: 24rpx 28rpx;
  779. border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  780. .title-section {
  781. display: flex;
  782. align-items: center;
  783. .title-line {
  784. width: 4rpx;
  785. height: 28rpx;
  786. border-radius: 0;
  787. background: linear-gradient(180deg, #3BB44A, #66CC6A);
  788. margin-right: 16rpx;
  789. }
  790. .card-title {
  791. font-size: 28rpx;
  792. font-weight: 600;
  793. color: #2C3E50;
  794. }
  795. }
  796. .period-selector {
  797. display: flex;
  798. background: rgba(0, 0, 0, 0.03);
  799. border-radius: 20rpx;
  800. padding: 2rpx;
  801. .period {
  802. font-size: 22rpx;
  803. color: #8C9396;
  804. padding: 8rpx 16rpx;
  805. border-radius: 16rpx;
  806. &.active {
  807. background: white;
  808. color: #3BB44A;
  809. font-weight: 500;
  810. box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.05);
  811. }
  812. }
  813. }
  814. .action-button {
  815. display: flex;
  816. align-items: center;
  817. background: linear-gradient(135deg, #3BB44A, #66CC6A);
  818. border-radius: 24rpx;
  819. padding: 8rpx 16rpx;
  820. box-shadow: 0 2rpx 8rpx rgba(59, 180, 74, 0.25);
  821. text {
  822. font-size: 22rpx;
  823. color: white;
  824. margin-right: 6rpx;
  825. }
  826. }
  827. }
  828. }
  829. // Farm Performance Card
  830. .farm-performance {
  831. .performance-stats {
  832. display: flex;
  833. padding: 24rpx 28rpx;
  834. .metric-column {
  835. flex: 1;
  836. display: flex;
  837. flex-direction: column;
  838. .metric-value {
  839. font-size: 48rpx;
  840. font-weight: 700;
  841. color: #2C3E50;
  842. margin-bottom: 6rpx;
  843. line-height: 1.1;
  844. .metric-unit {
  845. font-size: 24rpx;
  846. font-weight: 500;
  847. color: #8C9396;
  848. margin-left: 4rpx;
  849. }
  850. }
  851. .metric-label {
  852. font-size: 24rpx;
  853. color: #8C9396;
  854. margin-bottom: 12rpx;
  855. }
  856. .growth {
  857. display: flex;
  858. align-items: center;
  859. font-size: 22rpx;
  860. &.positive {
  861. color: #3BB44A;
  862. }
  863. &.negative {
  864. color: #FF5252;
  865. }
  866. }
  867. }
  868. .metric-divider {
  869. width: 1px;
  870. background: rgba(0, 0, 0, 0.04);
  871. margin: 0 28rpx;
  872. }
  873. }
  874. .chart-container {
  875. padding: 24rpx 28rpx;
  876. .chart-header {
  877. display: flex;
  878. justify-content: space-between;
  879. align-items: center;
  880. margin-bottom: 16rpx;
  881. .chart-title {
  882. font-size: 28rpx;
  883. font-weight: 600;
  884. color: #2C3E50;
  885. }
  886. .chart-legend {
  887. display: flex;
  888. align-items: center;
  889. .legend-item {
  890. display: flex;
  891. align-items: center;
  892. margin-left: 16rpx;
  893. .legend-color {
  894. width: 16rpx;
  895. height: 16rpx;
  896. border-radius: 4rpx;
  897. margin-right: 8rpx;
  898. }
  899. text {
  900. font-size: 22rpx;
  901. color: #8C9396;
  902. }
  903. }
  904. }
  905. }
  906. .chart-body {
  907. display: flex;
  908. height: 240rpx;
  909. position: relative;
  910. margin-top: 12rpx;
  911. .y-axis {
  912. width: 40rpx;
  913. height: 200rpx;
  914. display: flex;
  915. flex-direction: column;
  916. justify-content: space-between;
  917. text-align: right;
  918. padding-right: 16rpx;
  919. margin-bottom: 30rpx;
  920. text {
  921. font-size: 22rpx;
  922. color: #8C9396;
  923. }
  924. }
  925. .bars-container {
  926. flex: 1;
  927. display: flex;
  928. justify-content: space-around;
  929. height: 200rpx;
  930. position: relative;
  931. &::before {
  932. content: "";
  933. position: absolute;
  934. left: 0;
  935. bottom: 0;
  936. width: 100%;
  937. height: 1px;
  938. background-color: #E0E0E0;
  939. }
  940. .month-group {
  941. display: flex;
  942. flex-direction: column;
  943. align-items: center;
  944. width: 14%;
  945. .bar-wrapper {
  946. height: 200rpx;
  947. width: 70%;
  948. display: flex;
  949. justify-content: center;
  950. position: relative;
  951. .bar {
  952. position: absolute;
  953. bottom: 0;
  954. width: 45%;
  955. border-radius: 4rpx 4rpx 0 0;
  956. transition: height 0.3s ease;
  957. }
  958. .last-year {
  959. left: 0;
  960. background: #E0E0E0;
  961. }
  962. .this-year {
  963. right: 0;
  964. background: #3BB44A;
  965. }
  966. }
  967. .month-label {
  968. font-size: 22rpx;
  969. color: #8C9396;
  970. margin-top: 8rpx;
  971. }
  972. }
  973. }
  974. }
  975. }
  976. }
  977. // Crop Portfolio
  978. .crop-portfolio {
  979. .crop-grid {
  980. padding: 16rpx;
  981. display: grid;
  982. grid-template-columns: repeat(2, 1fr);
  983. gap: 16rpx;
  984. }
  985. .crop-item {
  986. padding: 16rpx;
  987. background: rgba(0, 0, 0, 0.01);
  988. border-radius: 16rpx;
  989. display: flex;
  990. align-items: center;
  991. .crop-icon {
  992. width: 48rpx;
  993. height: 48rpx;
  994. border-radius: 12rpx;
  995. display: flex;
  996. align-items: center;
  997. justify-content: center;
  998. margin-right: 16rpx;
  999. .crop-icon-text {
  1000. font-size: 24rpx;
  1001. }
  1002. }
  1003. .crop-details {
  1004. flex: 1;
  1005. .crop-info {
  1006. display: flex;
  1007. justify-content: space-between;
  1008. align-items: center;
  1009. margin-bottom: 10rpx;
  1010. .crop-name {
  1011. font-size: 26rpx;
  1012. font-weight: 600;
  1013. color: #2C3E50;
  1014. }
  1015. .crop-area {
  1016. font-size: 22rpx;
  1017. color: #8C9396;
  1018. }
  1019. }
  1020. .crop-stats {
  1021. display: flex;
  1022. align-items: center;
  1023. .crop-progress-container {
  1024. flex: 1;
  1025. height: 8rpx;
  1026. background: rgba(0, 0, 0, 0.03);
  1027. border-radius: 4rpx;
  1028. margin-right: 12rpx;
  1029. overflow: hidden;
  1030. .crop-progress {
  1031. height: 100%;
  1032. border-radius: 4rpx;
  1033. }
  1034. }
  1035. .crop-progress-text {
  1036. font-size: 22rpx;
  1037. color: #8C9396;
  1038. min-width: 36rpx;
  1039. text-align: right;
  1040. }
  1041. }
  1042. }
  1043. }
  1044. }
  1045. // Resource Efficiency
  1046. .resource-efficiency {
  1047. .resource-grid {
  1048. padding: 16rpx;
  1049. display: grid;
  1050. grid-template-columns: repeat(2, 1fr);
  1051. gap: 16rpx;
  1052. }
  1053. .resource-item {
  1054. padding: 16rpx;
  1055. background: rgba(0, 0, 0, 0.01);
  1056. border-radius: 16rpx;
  1057. .resource-header {
  1058. display: flex;
  1059. align-items: center;
  1060. margin-bottom: 12rpx;
  1061. .icon-tile {
  1062. width: 28rpx;
  1063. height: 28rpx;
  1064. border-radius: 6rpx;
  1065. display: flex;
  1066. align-items: center;
  1067. justify-content: center;
  1068. margin-right: 10rpx;
  1069. &.small {
  1070. width: 28rpx;
  1071. height: 28rpx;
  1072. }
  1073. }
  1074. .resource-name {
  1075. font-size: 24rpx;
  1076. color: #8C9396;
  1077. }
  1078. }
  1079. .resource-value {
  1080. margin-bottom: 12rpx;
  1081. .value {
  1082. font-size: 36rpx;
  1083. font-weight: 700;
  1084. color: #2C3E50;
  1085. }
  1086. .unit {
  1087. font-size: 22rpx;
  1088. color: #8C9396;
  1089. margin-left: 4rpx;
  1090. }
  1091. }
  1092. .resource-progress-container {
  1093. .resource-progress-bg {
  1094. height: 8rpx;
  1095. background: rgba(0, 0, 0, 0.03);
  1096. border-radius: 4rpx;
  1097. margin-bottom: 8rpx;
  1098. overflow: hidden;
  1099. .resource-progress {
  1100. height: 100%;
  1101. border-radius: 4rpx;
  1102. }
  1103. }
  1104. .resource-efficiency {
  1105. font-size: 22rpx;
  1106. color: #8C9396;
  1107. }
  1108. }
  1109. }
  1110. }
  1111. // Farm Activities
  1112. .farm-activities {
  1113. .activities-list {
  1114. padding: 8rpx 0;
  1115. }
  1116. .activity-item {
  1117. display: flex;
  1118. align-items: center;
  1119. padding: 20rpx 28rpx;
  1120. border-bottom: 1px solid rgba(0, 0, 0, 0.02);
  1121. &:last-child {
  1122. border-bottom: none;
  1123. }
  1124. .activity-dot {
  1125. width: 10rpx;
  1126. height: 10rpx;
  1127. border-radius: 50%;
  1128. margin-right: 16rpx;
  1129. flex-shrink: 0;
  1130. &.completed {
  1131. background: #4CAF50;
  1132. }
  1133. &.pending {
  1134. background: #FFC107;
  1135. }
  1136. &.failed {
  1137. background: #FF5252;
  1138. }
  1139. }
  1140. .activity-details {
  1141. flex: 1;
  1142. .activity-title-row {
  1143. display: flex;
  1144. justify-content: space-between;
  1145. align-items: center;
  1146. margin-bottom: 6rpx;
  1147. .activity-title {
  1148. font-size: 26rpx;
  1149. font-weight: 500;
  1150. color: #2C3E50;
  1151. }
  1152. .activity-date {
  1153. font-size: 22rpx;
  1154. color: #8C9396;
  1155. }
  1156. }
  1157. .activity-meta-row {
  1158. display: flex;
  1159. justify-content: space-between;
  1160. align-items: center;
  1161. .activity-executor {
  1162. font-size: 22rpx;
  1163. color: #8C9396;
  1164. }
  1165. .activity-action {
  1166. display: flex;
  1167. align-items: center;
  1168. .action-text {
  1169. font-size: 22rpx;
  1170. color: #3BB44A;
  1171. margin-right: 6rpx;
  1172. }
  1173. }
  1174. }
  1175. }
  1176. }
  1177. }
  1178. // Weather Card
  1179. .weather-card {
  1180. .weather-content {
  1181. padding: 20rpx 28rpx;
  1182. }
  1183. .current-weather {
  1184. display: flex;
  1185. align-items: center;
  1186. margin-bottom: 24rpx;
  1187. .weather-icon-container {
  1188. margin-right: 20rpx;
  1189. .weather-icon {
  1190. font-size: 60rpx;
  1191. line-height: 1;
  1192. }
  1193. }
  1194. .weather-details {
  1195. .weather-temp {
  1196. font-size: 48rpx;
  1197. font-weight: 700;
  1198. color: #2C3E50;
  1199. line-height: 1.1;
  1200. }
  1201. .weather-desc {
  1202. font-size: 26rpx;
  1203. color: #8C9396;
  1204. }
  1205. }
  1206. }
  1207. .weather-metrics {
  1208. display: flex;
  1209. justify-content: space-between;
  1210. align-items: center;
  1211. padding: 16rpx 24rpx;
  1212. margin-bottom: 24rpx;
  1213. border-radius: 12rpx;
  1214. background-color: rgba(247, 247, 247, 0.5);
  1215. border: 1px solid rgba(0, 0, 0, 0.03);
  1216. .weather-metric {
  1217. flex: 1;
  1218. display: flex;
  1219. flex-direction: column;
  1220. align-items: center;
  1221. .metric-label {
  1222. font-size: 22rpx;
  1223. color: #8C9396;
  1224. margin-bottom: 6rpx;
  1225. }
  1226. .metric-value {
  1227. font-size: 28rpx;
  1228. font-weight: 600;
  1229. color: #2C3E50;
  1230. }
  1231. }
  1232. .vertical-divider {
  1233. width: 1px;
  1234. height: 36rpx;
  1235. background-color: rgba(0, 0, 0, 0.05);
  1236. }
  1237. }
  1238. .weather-advice {
  1239. background: rgba(59, 180, 74, 0.05);
  1240. border-radius: 16rpx;
  1241. padding: 16rpx;
  1242. .advice-header {
  1243. display: flex;
  1244. align-items: center;
  1245. margin-bottom: 10rpx;
  1246. .icon-tile {
  1247. width: 24rpx;
  1248. height: 24rpx;
  1249. border-radius: 50%;
  1250. background: linear-gradient(135deg, #3BB44A, #66CC6A);
  1251. display: flex;
  1252. align-items: center;
  1253. justify-content: center;
  1254. margin-right: 10rpx;
  1255. box-shadow: 0 2rpx 8rpx rgba(59, 180, 74, 0.25);
  1256. &.small {
  1257. width: 24rpx;
  1258. height: 24rpx;
  1259. }
  1260. }
  1261. .advice-title {
  1262. font-size: 24rpx;
  1263. font-weight: 600;
  1264. color: #2C3E50;
  1265. }
  1266. }
  1267. .advice-content {
  1268. font-size: 24rpx;
  1269. color: #2C3E50;
  1270. line-height: 1.4;
  1271. }
  1272. }
  1273. }
  1274. // For small screens - mobile responsiveness
  1275. @media screen and (max-width: 768px) {
  1276. .stats-overview {
  1277. grid-template-columns: repeat(2, 1fr);
  1278. }
  1279. .crop-grid {
  1280. grid-template-columns: 1fr;
  1281. }
  1282. }
  1283. // 监控设备概览
  1284. .device-overview {
  1285. .device-metrics-grid {
  1286. display: grid;
  1287. grid-template-columns: repeat(2, 1fr);
  1288. gap: 16rpx;
  1289. padding: 16rpx;
  1290. }
  1291. .device-metric-card {
  1292. background: white;
  1293. border-radius: 16rpx;
  1294. padding: 20rpx;
  1295. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
  1296. border: 1px solid rgba(0, 0, 0, 0.02);
  1297. .device-metric-header {
  1298. display: flex;
  1299. align-items: center;
  1300. margin-bottom: 16rpx;
  1301. .icon-tile {
  1302. width: 24rpx;
  1303. height: 24rpx;
  1304. border-radius: 50%;
  1305. display: flex;
  1306. align-items: center;
  1307. justify-content: center;
  1308. margin-right: 10rpx;
  1309. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.08);
  1310. }
  1311. .metric-name {
  1312. font-size: 24rpx;
  1313. color: #8C9396;
  1314. }
  1315. }
  1316. .device-metric-value {
  1317. font-size: 44rpx;
  1318. font-weight: 700;
  1319. color: #2C3E50;
  1320. margin-bottom: 12rpx;
  1321. }
  1322. .device-metric-trend {
  1323. display: flex;
  1324. align-items: center;
  1325. font-size: 22rpx;
  1326. &.up {
  1327. color: #3BB44A;
  1328. }
  1329. &.down {
  1330. color: #FF5252;
  1331. }
  1332. text {
  1333. margin-left: 4rpx;
  1334. }
  1335. }
  1336. }
  1337. }
  1338. // 农业机械活动
  1339. .machinery-activity {
  1340. .machinery-metrics-grid {
  1341. display: grid;
  1342. grid-template-columns: repeat(2, 1fr);
  1343. gap: 16rpx;
  1344. padding: 16rpx;
  1345. }
  1346. .machinery-metric-card {
  1347. background: white;
  1348. border-radius: 16rpx;
  1349. padding: 20rpx;
  1350. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
  1351. border: 1px solid rgba(0, 0, 0, 0.02);
  1352. .machinery-metric-header {
  1353. display: flex;
  1354. align-items: center;
  1355. margin-bottom: 16rpx;
  1356. .icon-tile {
  1357. width: 24rpx;
  1358. height: 24rpx;
  1359. border-radius: 50%;
  1360. display: flex;
  1361. align-items: center;
  1362. justify-content: center;
  1363. margin-right: 10rpx;
  1364. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.08);
  1365. }
  1366. .metric-name {
  1367. font-size: 24rpx;
  1368. color: #8C9396;
  1369. }
  1370. }
  1371. .machinery-metric-value {
  1372. font-size: 44rpx;
  1373. font-weight: 700;
  1374. color: #2C3E50;
  1375. margin-bottom: 12rpx;
  1376. }
  1377. .machinery-metric-trend {
  1378. display: flex;
  1379. align-items: center;
  1380. font-size: 22rpx;
  1381. &.up {
  1382. color: #3BB44A;
  1383. }
  1384. &.down {
  1385. color: #FF5252;
  1386. }
  1387. text {
  1388. margin-left: 4rpx;
  1389. }
  1390. }
  1391. .machinery-metric-unit {
  1392. font-size: 22rpx;
  1393. color: #8C9396;
  1394. }
  1395. }
  1396. }
  1397. // 添加测试样式
  1398. .test-block {
  1399. background-color: #4CAF50;
  1400. padding: 30rpx;
  1401. margin: 20rpx;
  1402. border-radius: 12rpx;
  1403. display: flex;
  1404. justify-content: center;
  1405. align-items: center;
  1406. }
  1407. .test-text {
  1408. color: white;
  1409. font-size: 36rpx;
  1410. font-weight: bold;
  1411. }
  1412. </style>