西藏巴青项目

market-panel.vue 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907
  1. <template>
  2. <!-- 牦牛行情:顶卡主价;中段走势/预测;底虚拟列表每日行情(见 doc/耗牛行情.md) -->
  3. <view class="tab-page ym-page lang-zh">
  4. <scroll-view scroll-y class="ym-scroll" enable-back-to-top :show-scrollbar="false" @scrolltolower="onScrollToLower">
  5. <!-- 1. 主行情卡 -->
  6. <up-card :show-head="false" :show-foot="false" :border="true" :border-radius="16" margin="24rpx 24rpx 0" :body-style="{ padding: '24rpx' }">
  7. <template #body>
  8. <view class="ym-hero">
  9. <up-avatar shape="square" text="市" size="56" font-size="22" bg-color="#22c55e" color="#ffffff" />
  10. <view class="ym-hero__right">
  11. <text class="ym-hero__price">{{ heroPriceLine }}</text>
  12. <text class="ym-hero__sub text-body">{{ heroMarketLine }}</text>
  13. </view>
  14. </view>
  15. </template>
  16. </up-card>
  17. <!-- 2. 走势 / 预测 -->
  18. <up-card :show-head="false" :show-foot="false" :border="true" :border-radius="16" margin="20rpx 24rpx 0" :body-style="{ padding: '20rpx' }">
  19. <template #body>
  20. <up-subsection
  21. :list="subsectionList"
  22. :current="mainSectionIdx"
  23. active-color="#22c55e"
  24. inactive-color="#000000"
  25. :bold="true"
  26. @update:current="onMainSectionUpdate"
  27. />
  28. <view class="ym-panel-inner">
  29. <view class="ym-stats3">
  30. <view class="ym-stat-col">
  31. <text class="ym-stat-label text-body">{{ tm('statAvg7') }}</text>
  32. <text class="ym-stat-val text-body">{{ stats7.avg }}</text>
  33. <text class="ym-stat-ph text-body">—</text>
  34. </view>
  35. <view class="ym-stat-col">
  36. <text class="ym-stat-label text-body">{{ tm('statLow7') }}</text>
  37. <text class="ym-stat-val ym-stat-val--red text-body">{{ stats7.low }}</text>
  38. <text class="ym-stat-date text-body">{{ stats7.lowDate }}</text>
  39. </view>
  40. <view class="ym-stat-col">
  41. <text class="ym-stat-label text-body">{{ tm('statHigh7') }}</text>
  42. <text class="ym-stat-val ym-stat-val--red text-body">{{ stats7.high }}</text>
  43. <text class="ym-stat-date text-body">{{ stats7.highDate }}</text>
  44. </view>
  45. </view>
  46. <view class="ym-meta-row">
  47. <text class="ym-meta text-body">{{ tm('metaUpdated', { d: stats7.updateYmd }) }}</text>
  48. <text class="ym-meta text-body">{{ metaUnitLine }}</text>
  49. </view>
  50. <!-- 价格走势 -->
  51. <template v-if="mainSectionIdx === 0">
  52. <view class="ym-chart-host">
  53. <mpvueEcharts
  54. ref="yakPriceEcharts"
  55. :onInit="onYakPriceChartInit"
  56. canvasId="yakMkPriceLine"
  57. :disableTouch="true"
  58. />
  59. </view>
  60. <view class="ym-range-chips">
  61. <view
  62. class="ym-chip"
  63. :class="{ 'ym-chip--on': chartRange === '7' }"
  64. role="button"
  65. @tap="chartRange = '7'"
  66. >
  67. <text class="ym-chip__txt text-body">{{ tm('range7') }}</text>
  68. </view>
  69. <view
  70. class="ym-chip"
  71. :class="{ 'ym-chip--on': chartRange === '30' }"
  72. role="button"
  73. @tap="chartRange = '30'"
  74. >
  75. <text class="ym-chip__txt text-body">{{ tm('range30') }}</text>
  76. </view>
  77. </view>
  78. </template>
  79. <!-- 价格预测 -->
  80. <template v-else>
  81. <text class="ym-forecast-title text-body">{{ tm('forecastBlockTitle') }}</text>
  82. <view class="ym-donuts">
  83. <view v-for="ring in forecastRings" :key="ring.key" class="ym-donut-col">
  84. <view class="ym-donut" :style="donutStyle(ring)">
  85. <view class="ym-donut-hole">
  86. <text class="ym-donut-pct">{{ ring.pct }}%</text>
  87. </view>
  88. </view>
  89. <text class="ym-donut-cap text-body">{{ ring.label }}</text>
  90. </view>
  91. </view>
  92. </template>
  93. </view>
  94. </template>
  95. </up-card>
  96. <!-- 3. 每日行情 -->
  97. <text class="ym-section-title text-title">{{ tm('dailyTitle') }}</text>
  98. <view class="ym-list-wrap">
  99. <view v-if="listLoading && !dailyRows.length" class="ym-empty">
  100. <text class="text-body ym-empty__txt">{{ tm('loading') }}</text>
  101. </view>
  102. <view v-else-if="!dailyRows.length" class="ym-empty">
  103. <text class="text-body ym-empty__txt">{{ tm('emptyDaily') }}</text>
  104. </view>
  105. <up-virtual-list
  106. v-else
  107. ref="ymVList"
  108. class="ym-vlist"
  109. :list-data="dailyRows"
  110. :item-height="slotHeightPx"
  111. :height="listHeightPx"
  112. :buffer="4"
  113. key-field="id"
  114. :scroll-top="vScrollTop"
  115. @update:scrollTop="vScrollTop = $event"
  116. >
  117. <template #default="{ item }">
  118. <view class="ym-vcell">
  119. <up-card :show-head="false" :show-foot="false" :border="true" :border-radius="12" margin="0 24rpx 16rpx" :body-style="{ padding: '20rpx' }">
  120. <template #body>
  121. <view class="ym-row1">
  122. <up-avatar shape="square" :text="item.avatarText" size="48" font-size="18" bg-color="#9ca3af" color="#ffffff" />
  123. <view class="ym-row1__right">
  124. <text class="ym-daily-title text-body">{{ item.marketTitle }}</text>
  125. <text class="ym-daily-sub text-body">{{ item.subLine }}</text>
  126. </view>
  127. </view>
  128. <up-divider :hairline="true" line-color="#e5e7eb" text="" />
  129. <view class="ym-row2">
  130. <text class="ym-daily-range-label text-body">{{ item.rangeLabel }}</text>
  131. <text class="ym-daily-range-val text-body">{{ item.rangePrice }}</text>
  132. </view>
  133. <up-divider :hairline="true" line-color="#e5e7eb" text="" />
  134. <text class="ym-daily-detail text-body">{{ tm('lineSlaughter') }}{{ item.slaughter }}</text>
  135. <text class="ym-daily-detail text-body">{{ tm('lineFactors') }}{{ item.factors }}</text>
  136. <text class="ym-daily-detail text-body">{{ tm('lineTrendPred') }}{{ item.trendPred }}</text>
  137. <text class="ym-daily-detail text-body">{{ tm('lineSuggest') }}{{ item.suggest }}</text>
  138. </template>
  139. </up-card>
  140. </view>
  141. </template>
  142. </up-virtual-list>
  143. <view v-if="dailyRows.length && (listLoadingMore || listNoMore)" class="ym-list-foot">
  144. <text class="text-body ym-list-foot__txt">{{
  145. listLoadingMore ? tm('loadMore') : tm('noMore')
  146. }}</text>
  147. </view>
  148. </view>
  149. <view class="ym-footer-spacer" />
  150. </scroll-view>
  151. </view>
  152. </template>
  153. <script>
  154. import * as echarts from '@/uni_modules/mpvue-echarts/components/echarts.esm.min.js'
  155. import mpvueEcharts from '@/uni_modules/mpvue-echarts/components/echarts.vue'
  156. import UCard from 'uview-plus/components/u-card/u-card.vue'
  157. import UAvatar from 'uview-plus/components/u-avatar/u-avatar.vue'
  158. import USubsection from 'uview-plus/components/u-subsection/u-subsection.vue'
  159. import UDivider from 'uview-plus/components/u-divider/u-divider.vue'
  160. import UVirtualList from 'uview-plus/components/u-virtual-list/u-virtual-list.vue'
  161. import {
  162. getYakMarketYesterday,
  163. getYakMarketStats7,
  164. getYakMarketTrend,
  165. getYakMarketForecast,
  166. listYakMarketDaily
  167. } from '@/api/yakMarket'
  168. const ROW_SLOT_RPX = 480
  169. const DASH = '—'
  170. const TM = {
  171. speciesPriceTpl: '牦牛 {price} {unit}',
  172. defaultMarketName: '巴青牦牛交易市场',
  173. heroSubTpl: '{name} {date}',
  174. tabTrend: '价格走势',
  175. tabForecast: '价格预测',
  176. statAvg7: '7日均价',
  177. statLow7: '7日最低价',
  178. statHigh7: '7日最高价',
  179. metaUpdated: '更新时间:{d}',
  180. metaUnitTpl: '单位:{unit}',
  181. range7: '7日',
  182. range30: '30日',
  183. forecastBlockTitle: '后市预测',
  184. predBull: '看涨',
  185. predFlat: '看平',
  186. predBear: '看跌',
  187. dailyTitle: '每日行情',
  188. dailyRangeLabel: '价格区间',
  189. lineSlaughter: '出栏情况:',
  190. lineFactors: '变化因素:',
  191. lineTrendPred: '走势预测:',
  192. lineSuggest: '出栏建议:',
  193. loading: '加载中…',
  194. emptyDaily: '暂无每日行情',
  195. loadMore: '加载更多…',
  196. noMore: '没有更多了'
  197. }
  198. function tm(key, params = {}) {
  199. let text = TM[key] || key
  200. Object.keys(params).forEach((k) => {
  201. text = text.replace(new RegExp(`\\{${k}\\}`, 'g'), params[k] ?? '')
  202. })
  203. return text
  204. }
  205. function formatPrice(val) {
  206. if (val == null || val === '') return DASH
  207. const n = Number(val)
  208. if (Number.isNaN(n)) return String(val)
  209. return n % 1 === 0 ? String(n) : n.toFixed(2)
  210. }
  211. function formatShortDate(ymd) {
  212. if (!ymd) return ''
  213. const s = String(ymd).slice(0, 10)
  214. const parts = s.split('-')
  215. if (parts.length >= 3) {
  216. return `${parts[1]}-${parts[2]}`.toLowerCase()
  217. }
  218. return s
  219. }
  220. function formatDateTime(val) {
  221. if (!val) return DASH
  222. const s = String(val)
  223. return s.length >= 19 ? s.slice(0, 19) : s.slice(0, 10)
  224. }
  225. function mapTrendPoints(list) {
  226. return (list || []).map((p) => ({
  227. label: p.quoteDateLabel || formatShortDate(p.quoteDate),
  228. price: p.avgPrice != null ? Number(p.avgPrice) : null
  229. }))
  230. }
  231. export default {
  232. components: {
  233. 'up-card': UCard,
  234. 'up-avatar': UAvatar,
  235. 'up-subsection': USubsection,
  236. 'up-divider': UDivider,
  237. 'up-virtual-list': UVirtualList,
  238. mpvueEcharts
  239. },
  240. data() {
  241. return {
  242. pageLoading: false,
  243. heroPrice: DASH,
  244. heroUnit: '',
  245. heroMarketName: '',
  246. heroDate: '',
  247. mainSectionIdx: 0,
  248. chartRange: '7',
  249. stats7: {
  250. avg: DASH,
  251. low: DASH,
  252. lowDate: DASH,
  253. high: DASH,
  254. highDate: DASH,
  255. updateYmd: DASH,
  256. priceUnitName: ''
  257. },
  258. forecast: { probRise: 0, probFlat: 0, probFall: 0 },
  259. series7: [],
  260. series30: [],
  261. dailyRows: [],
  262. pageNum: 1,
  263. pageSize: 10,
  264. listTotal: 0,
  265. listLoading: false,
  266. listLoadingMore: false,
  267. slotHeightPx: 220,
  268. listHeightPx: 400,
  269. vScrollTop: 0
  270. }
  271. },
  272. computed: {
  273. subsectionList() {
  274. return [
  275. { name: tm('tabTrend') },
  276. { name: tm('tabForecast') }
  277. ]
  278. },
  279. heroPriceLine() {
  280. if (this.heroPrice === DASH) {
  281. return tm('speciesPriceTpl', {
  282. price: DASH,
  283. unit: this.heroUnit || ''
  284. })
  285. }
  286. return tm('speciesPriceTpl', {
  287. price: this.heroPrice,
  288. unit: this.heroUnit || ''
  289. })
  290. },
  291. heroMarketLine() {
  292. const name = this.heroMarketName || tm('defaultMarketName')
  293. return tm('heroSubTpl', {
  294. name,
  295. date: this.heroDate
  296. })
  297. },
  298. metaUnitLine() {
  299. const unit = this.stats7.priceUnitName || this.heroUnit || DASH
  300. return tm('metaUnitTpl', { unit })
  301. },
  302. forecastRings() {
  303. const f = this.forecast || {}
  304. return [
  305. { key: 'bull', pct: Math.round(Number(f.probRise) || 0), color: '#ef4444', label: tm('predBull') },
  306. { key: 'flat', pct: Math.round(Number(f.probFlat) || 0), color: '#3b82f6', label: tm('predFlat') },
  307. { key: 'bear', pct: Math.round(Number(f.probFall) || 0), color: '#22c55e', label: tm('predBear') }
  308. ]
  309. },
  310. chartSeries() {
  311. return this.chartRange === '7' ? this.series7 : this.series30
  312. },
  313. listNoMore() {
  314. return this.dailyRows.length > 0 && this.dailyRows.length >= this.listTotal
  315. }
  316. },
  317. watch: {
  318. chartRange() {
  319. if (this.mainSectionIdx !== 0) return
  320. this.refreshChart()
  321. }
  322. },
  323. methods: {
  324. tm,
  325. /** Tab 页 onShow 时调用,与 ruoyi-ui-app 行情页 onShow 行为一致 */
  326. reload() {
  327. this.loadPageData()
  328. this.applyListHeightFallback()
  329. this.$nextTick(() => {
  330. this.$refs.ymVList?.measureContainerHeight?.()
  331. })
  332. },
  333. loadPageData() {
  334. this.pageLoading = true
  335. Promise.all([
  336. this.loadYesterday(),
  337. this.loadStats7(),
  338. this.loadTrend(7),
  339. this.loadTrend(30),
  340. this.loadForecast(),
  341. this.loadDailyList(true)
  342. ]).finally(() => {
  343. this.pageLoading = false
  344. })
  345. },
  346. loadYesterday() {
  347. return getYakMarketYesterday()
  348. .then((res) => {
  349. const d = res.data
  350. if (!d) {
  351. this.heroPrice = DASH
  352. this.heroUnit = ''
  353. this.heroDate = ''
  354. return
  355. }
  356. this.heroPrice = formatPrice(d.avgPrice)
  357. this.heroUnit = d.priceUnitName || ''
  358. this.heroDate = formatShortDate(d.quoteDate)
  359. })
  360. .catch(() => {
  361. this.heroPrice = DASH
  362. this.heroUnit = ''
  363. this.heroDate = ''
  364. })
  365. },
  366. loadStats7() {
  367. return getYakMarketStats7()
  368. .then((res) => {
  369. const d = res.data
  370. if (!d) {
  371. this.stats7 = {
  372. avg: DASH,
  373. low: DASH,
  374. lowDate: DASH,
  375. high: DASH,
  376. highDate: DASH,
  377. updateYmd: DASH,
  378. priceUnitName: ''
  379. }
  380. return
  381. }
  382. this.stats7 = {
  383. avg: formatPrice(d.avgPrice7),
  384. low: formatPrice(d.minPrice7),
  385. lowDate: d.minQuoteDateLabel || formatShortDate(d.minQuoteDate) || DASH,
  386. high: formatPrice(d.maxPrice7),
  387. highDate: d.maxQuoteDateLabel || formatShortDate(d.maxQuoteDate) || DASH,
  388. updateYmd: formatDateTime(d.createTime),
  389. priceUnitName: d.priceUnitName || ''
  390. }
  391. })
  392. .catch(() => {})
  393. },
  394. loadTrend(days) {
  395. return getYakMarketTrend({ days })
  396. .then((res) => {
  397. const points = mapTrendPoints(res.data)
  398. if (days === 7) {
  399. this.series7 = points
  400. } else {
  401. this.series30 = points
  402. }
  403. if (this.mainSectionIdx === 0 && String(this.chartRange) === String(days)) {
  404. this.refreshChart()
  405. }
  406. })
  407. .catch(() => {
  408. if (days === 7) {
  409. this.series7 = []
  410. } else {
  411. this.series30 = []
  412. }
  413. })
  414. },
  415. loadForecast() {
  416. return getYakMarketForecast()
  417. .then((res) => {
  418. const d = res.data || {}
  419. this.forecast = {
  420. probRise: d.probRise,
  421. probFlat: d.probFlat,
  422. probFall: d.probFall
  423. }
  424. })
  425. .catch(() => {
  426. this.forecast = { probRise: 0, probFlat: 0, probFall: 0 }
  427. })
  428. },
  429. loadDailyList(reset = false) {
  430. if (!reset) {
  431. if (this.listLoading || this.listLoadingMore || this.listNoMore) {
  432. return Promise.resolve()
  433. }
  434. this.pageNum += 1
  435. this.listLoadingMore = true
  436. } else {
  437. this.pageNum = 1
  438. this.listLoading = true
  439. }
  440. return listYakMarketDaily({ pageNum: this.pageNum, pageSize: this.pageSize })
  441. .then((res) => {
  442. const rows = (res.rows || []).map((row) => this.mapDailyRow(row))
  443. this.listTotal = res.total != null ? Number(res.total) : 0
  444. this.dailyRows = reset ? rows : this.dailyRows.concat(rows)
  445. })
  446. .catch(() => {
  447. if (reset) {
  448. this.dailyRows = []
  449. this.listTotal = 0
  450. } else {
  451. this.pageNum -= 1
  452. }
  453. })
  454. .finally(() => {
  455. if (reset) {
  456. this.listLoading = false
  457. } else {
  458. this.listLoadingMore = false
  459. }
  460. })
  461. },
  462. mapDailyRow(row) {
  463. const unit = row.priceUnitName || ''
  464. const min = formatPrice(row.priceMin)
  465. const max = formatPrice(row.priceMax)
  466. const dateStr = formatShortDate(row.quoteDate)
  467. const marketName = row.tradeMarketName || tm('defaultMarketName')
  468. const location = row.marketLocation || ''
  469. const subParts = [location, dateStr].filter(Boolean)
  470. const avatarText = marketName.slice(0, 1) || '市'
  471. return {
  472. id: row.id,
  473. avatarText,
  474. marketTitle: marketName,
  475. subLine: subParts.join(' · ') || DASH,
  476. rangeLabel: tm('dailyRangeLabel'),
  477. rangePrice: min === DASH || max === DASH ? DASH : `[${min}-${max}]${unit}`,
  478. slaughter: row.supplyStatusName || DASH,
  479. factors: row.changeFactorsText || DASH,
  480. trendPred: row.trendPrediction || DASH,
  481. suggest: row.outboundAdvice || DASH
  482. }
  483. },
  484. onScrollToLower() {
  485. this.loadDailyList(false)
  486. },
  487. refreshChart() {
  488. this.$nextTick(() => {
  489. const inst = this.$refs.yakPriceEcharts
  490. if (inst && inst.chart) {
  491. inst.chart.setOption(this.buildMpvueLineOption(), true)
  492. }
  493. })
  494. },
  495. onMainSectionUpdate(idx) {
  496. this.mainSectionIdx = typeof idx === 'number' ? idx : 0
  497. },
  498. donutStyle(ring) {
  499. const p = Math.min(100, Math.max(0, ring.pct))
  500. return {
  501. background: `conic-gradient(${ring.color} 0% ${p}%, #e8ecf0 ${p}% 100%)`
  502. }
  503. },
  504. onYakPriceChartInit(canvas, width, height) {
  505. const chart = echarts.init(canvas, null, {
  506. width,
  507. height
  508. })
  509. canvas.setChart(chart)
  510. chart.setOption(this.buildMpvueLineOption())
  511. return chart
  512. },
  513. buildMpvueLineOption() {
  514. const data = this.chartSeries
  515. const dates = data.map((d) => d.label)
  516. const prices = data.map((d) => (d.price != null && !Number.isNaN(d.price) ? d.price : null))
  517. const rotate = dates.length > 10 ? 30 : 0
  518. return {
  519. animation: false,
  520. backgroundColor: '#f0f6fb',
  521. color: ['#22c55e'],
  522. grid: {
  523. left: 10,
  524. right: 14,
  525. top: 28,
  526. bottom: 10,
  527. containLabel: true
  528. },
  529. tooltip: { trigger: 'axis' },
  530. xAxis: [
  531. {
  532. type: 'category',
  533. data: dates,
  534. boundaryGap: false,
  535. axisLine: { lineStyle: { color: '#cbd5e1' } },
  536. axisLabel: { color: '#64748b', fontSize: 10, rotate }
  537. }
  538. ],
  539. yAxis: [
  540. {
  541. type: 'value',
  542. scale: true,
  543. splitLine: { lineStyle: { color: '#e2e8f0' } },
  544. axisLabel: { color: '#64748b', fontSize: 10 }
  545. }
  546. ],
  547. series: [
  548. {
  549. type: 'line',
  550. data: prices,
  551. smooth: true,
  552. symbol: 'circle',
  553. symbolSize: 5,
  554. lineStyle: { width: 2, color: '#22c55e' },
  555. itemStyle: { color: '#22c55e' }
  556. }
  557. ]
  558. }
  559. },
  560. applyListHeightFallback() {
  561. const sys = uni.getSystemInfoSync()
  562. const winH = sys.windowHeight || 600
  563. this.listHeightPx = Math.max(280, Math.floor(winH * 0.42))
  564. this.slotHeightPx = Math.ceil(uni.upx2px(ROW_SLOT_RPX))
  565. }
  566. }
  567. }
  568. </script>
  569. <style lang="scss" scoped>
  570. @import '@/styles/morandi.scss';
  571. @import '@/styles/tab-page.scss';
  572. @import '@/styles/app-lang.scss';
  573. @import '@/styles/scroll-fill.scss';
  574. .ym-page {
  575. @include tab-panel-root;
  576. overflow: hidden;
  577. background: $morandi-bg-page;
  578. }
  579. .ym-scroll {
  580. @include flex-scroll-y;
  581. }
  582. .ym-hero {
  583. display: flex;
  584. flex-direction: row;
  585. align-items: center;
  586. gap: 20rpx;
  587. min-width: 0;
  588. }
  589. .ym-hero__right {
  590. flex: 1;
  591. min-width: 0;
  592. display: flex;
  593. flex-direction: column;
  594. gap: 8rpx;
  595. }
  596. .ym-hero__price {
  597. font-size: 34rpx;
  598. font-weight: 700;
  599. color: #ef4444;
  600. line-height: 1.35;
  601. word-break: break-word;
  602. }
  603. .ym-hero__sub {
  604. font-size: 24rpx;
  605. color: $morandi-text-secondary;
  606. text-transform: lowercase;
  607. line-height: 1.45;
  608. }
  609. .ym-panel-inner {
  610. margin-top: 20rpx;
  611. padding: 20rpx;
  612. border-radius: 12rpx;
  613. background: #f0f6fb;
  614. box-sizing: border-box;
  615. }
  616. .ym-stats3 {
  617. display: flex;
  618. flex-direction: row;
  619. align-items: stretch;
  620. min-width: 0;
  621. }
  622. .ym-stat-col {
  623. flex: 1;
  624. min-width: 0;
  625. display: flex;
  626. flex-direction: column;
  627. align-items: center;
  628. text-align: center;
  629. gap: 6rpx;
  630. }
  631. .ym-stat-label {
  632. font-size: 24rpx;
  633. color: $morandi-text-secondary;
  634. }
  635. .ym-stat-val {
  636. font-size: 30rpx;
  637. font-weight: 600;
  638. color: $morandi-text;
  639. }
  640. .ym-stat-val--red {
  641. color: #ef4444;
  642. }
  643. .ym-stat-date,
  644. .ym-stat-ph {
  645. font-size: 22rpx;
  646. color: $morandi-text-muted;
  647. }
  648. .ym-meta-row {
  649. display: flex;
  650. flex-direction: row;
  651. justify-content: space-between;
  652. align-items: center;
  653. margin-top: 16rpx;
  654. min-width: 0;
  655. }
  656. .ym-meta {
  657. font-size: 22rpx;
  658. color: $morandi-text-muted;
  659. }
  660. .ym-chart-host {
  661. width: 100%;
  662. height: 360rpx;
  663. margin-top: 12rpx;
  664. box-sizing: border-box;
  665. border-radius: 8rpx;
  666. overflow: hidden;
  667. background: #f0f6fb;
  668. position: relative;
  669. }
  670. .ym-chart-host :deep(.ec-canvas) {
  671. display: block;
  672. width: 100% !important;
  673. height: 100% !important;
  674. max-width: 100%;
  675. }
  676. .ym-range-chips {
  677. display: flex;
  678. flex-direction: row;
  679. justify-content: center;
  680. gap: 20rpx;
  681. margin-top: 16rpx;
  682. }
  683. .ym-chip {
  684. padding: 8rpx 28rpx;
  685. border-radius: 999rpx;
  686. border: 1rpx solid #cbd5e1;
  687. background: #ffffff;
  688. }
  689. .ym-chip--on {
  690. border-color: #22c55e;
  691. background: rgba(34, 197, 94, 0.12);
  692. }
  693. .ym-chip__txt {
  694. font-size: 24rpx;
  695. color: $morandi-text-secondary;
  696. }
  697. .ym-chip--on .ym-chip__txt {
  698. color: #15803d;
  699. font-weight: 600;
  700. }
  701. .ym-forecast-title {
  702. display: block;
  703. font-size: 24rpx;
  704. color: $morandi-text-muted;
  705. margin-bottom: 16rpx;
  706. }
  707. .ym-donuts {
  708. display: flex;
  709. flex-direction: row;
  710. gap: 10rpx;
  711. justify-content: space-between;
  712. min-width: 0;
  713. }
  714. .ym-donut-col {
  715. flex: 1;
  716. min-width: 0;
  717. display: flex;
  718. flex-direction: column;
  719. align-items: center;
  720. gap: 12rpx;
  721. }
  722. .ym-donut {
  723. width: 120rpx;
  724. height: 120rpx;
  725. border-radius: 50%;
  726. position: relative;
  727. box-sizing: border-box;
  728. }
  729. .ym-donut-hole {
  730. position: absolute;
  731. left: 50%;
  732. top: 50%;
  733. transform: translate(-50%, -50%);
  734. width: 72rpx;
  735. height: 72rpx;
  736. border-radius: 50%;
  737. background: #ffffff;
  738. display: flex;
  739. align-items: center;
  740. justify-content: center;
  741. }
  742. .ym-donut-pct {
  743. font-size: 22rpx;
  744. font-weight: 600;
  745. color: #334155;
  746. }
  747. .ym-donut-cap {
  748. font-size: 24rpx;
  749. color: $morandi-text-secondary;
  750. text-align: center;
  751. }
  752. .ym-section-title {
  753. display: block;
  754. margin: 28rpx 24rpx 12rpx;
  755. font-size: 32rpx;
  756. font-weight: 600;
  757. color: $morandi-text;
  758. }
  759. .ym-list-wrap {
  760. min-width: 0;
  761. padding-bottom: 8rpx;
  762. }
  763. .ym-empty {
  764. padding: 48rpx 24rpx;
  765. text-align: center;
  766. }
  767. .ym-empty__txt {
  768. color: $morandi-text-secondary;
  769. }
  770. .ym-list-foot {
  771. padding: 24rpx 0 8rpx;
  772. text-align: center;
  773. }
  774. .ym-list-foot__txt {
  775. color: $morandi-text-secondary;
  776. font-size: 24rpx;
  777. }
  778. .ym-vlist {
  779. width: 100%;
  780. }
  781. .ym-vcell {
  782. height: 100%;
  783. box-sizing: border-box;
  784. }
  785. .ym-row1 {
  786. display: flex;
  787. flex-direction: row;
  788. align-items: center;
  789. gap: 16rpx;
  790. min-width: 0;
  791. }
  792. .ym-row1__right {
  793. flex: 1;
  794. min-width: 0;
  795. display: flex;
  796. flex-direction: column;
  797. gap: 6rpx;
  798. }
  799. .ym-daily-title {
  800. font-size: 28rpx;
  801. font-weight: 600;
  802. color: $morandi-text;
  803. }
  804. .ym-daily-sub {
  805. font-size: 24rpx;
  806. color: $morandi-text-secondary;
  807. text-transform: lowercase;
  808. }
  809. .ym-row2 {
  810. display: flex;
  811. flex-direction: row;
  812. justify-content: space-between;
  813. align-items: center;
  814. min-width: 0;
  815. padding: 4rpx 0;
  816. }
  817. .ym-daily-range-label {
  818. font-size: 26rpx;
  819. color: $morandi-text-secondary;
  820. }
  821. .ym-daily-range-val {
  822. font-size: 28rpx;
  823. font-weight: 600;
  824. color: #ef4444;
  825. }
  826. .ym-daily-detail {
  827. display: block;
  828. font-size: 24rpx;
  829. line-height: 1.55;
  830. color: $morandi-text-muted;
  831. margin-top: 8rpx;
  832. }
  833. .ym-footer-spacer {
  834. height: 40rpx;
  835. }
  836. .ym-page.lang-bo {
  837. .ym-hero__price {
  838. font-size: 30rpx;
  839. line-height: 1.75;
  840. }
  841. .ym-daily-title {
  842. font-size: 26rpx;
  843. line-height: 1.75;
  844. }
  845. }
  846. </style>