2025start.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <ay-container v-show="store.webapi.strategy.get_by_Name.success">
  3. <div v-if="data.activity2025.open">
  4. <div class="whitespace-pre-wrap mb-spac" v-html="data.activity2025.desc"></div>
  5. <div class="flex justify-between font-bold mb-spac row">
  6. <div>排名</div>
  7. <div>驾驶员信息</div>
  8. <div>累计加气量</div>
  9. </div>
  10. <div
  11. class="center justify-between s-fz row item-row"
  12. :class="{ even: i % 2 === 0 }"
  13. v-for="(dr, i) in data.driverRank"
  14. :key="i"
  15. >
  16. <div>{{ dr.rank }}</div>
  17. <div>{{ dr.driverName }}</div>
  18. <div>{{ dr.gasQty }}</div>
  19. </div>
  20. </div>
  21. <div v-else class="font-bold text-center">活动已结束</div>
  22. </ay-container>
  23. </template>
  24. <script lang="ts" setup>
  25. const methods = {}
  26. const data = ay.initData({
  27. /** 2025年初运营活动信息 */
  28. activity2025: { open: 0 } as { open: number; title: string; bannerImg: string; desc: string },
  29. driverRank: [] as DriverRankVO[],
  30. })
  31. ay.entrance((args) => {
  32. // #ifdef MP
  33. uni.showShareMenu({
  34. // path: config.pages.activity_2025start._url,
  35. withShareTicket: true,
  36. menus: ['shareAppMessage', 'shareTimeline'],
  37. })
  38. // #endif
  39. webapi.strategy
  40. .get_by_Name<null, SystemConfig对象>({
  41. //
  42. name: 'activity2025',
  43. })
  44. .then((res) => {
  45. if (res?.value) {
  46. try {
  47. data.activity2025 = JSON.parse(res.value)
  48. uni.setNavigationBarTitle({ title: data.activity2025.title })
  49. } catch (e) {}
  50. }
  51. })
  52. webapi.settle.driver_rank<null, DriverRankVO[]>().then((res) => {
  53. data.driverRank = res
  54. })
  55. })
  56. </script>
  57. <style lang="scss" scoped>
  58. .row {
  59. & > div,
  60. > view {
  61. // margin-bottom: $p-spac;
  62. text-align: center;
  63. }
  64. & > div:first-child,
  65. > view:first-child {
  66. width: 15%;
  67. }
  68. & > div:last-child,
  69. > view:last-child {
  70. width: 25%;
  71. }
  72. }
  73. .item-row {
  74. min-height: 80rpx;
  75. background-color: #0084f433;
  76. &.even {
  77. background-color: #ec808d1a;
  78. }
  79. }
  80. </style>