西藏巴青项目

index.vue 23KB

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