index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view class="content" :rise-fall="stocksColor">
  3. <!-- 头部 -->
  4. <headContent>
  5. <template #left>
  6. <loginStatus></loginStatus>
  7. </template>
  8. <template #content>
  9. <view class="haed-title">
  10. <image src="../../static/images/logo.png" mode="aspectFit"></image>
  11. <image src="../../static/images/name.png" mode="aspectFit"></image>
  12. </view>
  13. </template>
  14. <template #right>
  15. <message></message>
  16. <share></share>
  17. </template>
  18. </headContent>
  19. <!-- 轮播图 -->
  20. <carousels :BannerList="BannerList"></carousels>
  21. <!-- 滚动消息 -->
  22. <rollMessage :rollMsg="Announcement"></rollMessage>
  23. <view style="width: 100%;height: 1rpx;"></view>
  24. <!-- usdt -->
  25. <usdt></usdt>
  26. <view style="width: 100%;height: 8rpx;"></view>
  27. <!-- 快捷买币 -->
  28. <shortcut></shortcut>
  29. <view style="width: 100%;height: 8rpx;"></view>
  30. <!-- 快捷菜单 -->
  31. <navMuen></navMuen>
  32. <view style="width: 100%;height: 8rpx;"></view>
  33. <!-- 自选 / 市场 -->
  34. <market :market="quotationNew"></market>
  35. </view>
  36. </template>
  37. <script>
  38. import loginStatus from "@/components/headModules/login.vue"
  39. import message from "@/components/headModules/message.vue"
  40. import share from "@/components/headModules/share.vue"
  41. import usdt from "./modules/usdt.vue"
  42. import shortcut from "./modules/shortcut.vue"
  43. import navMuen from "./modules/nav.vue"
  44. import market from "./modules/market.vue"
  45. import {
  46. Api_getNewsList,
  47. Api_getQuotationNew
  48. } from "@/api/index.js"
  49. import {
  50. mapGetters
  51. } from 'vuex'
  52. export default {
  53. components: {
  54. loginStatus,
  55. message,
  56. share,
  57. usdt,
  58. shortcut,
  59. navMuen,
  60. market
  61. },
  62. data() {
  63. return {
  64. title: 'Hello',
  65. BannerList: [],
  66. Announcement: [],
  67. quotationNew:[]
  68. }
  69. },
  70. computed: {
  71. ...mapGetters([
  72. 'stocksColor'
  73. ]),
  74. },
  75. onLoad() {
  76. // console.log('process.env.NODE_ENV = ' , process.env.NODE_ENV)
  77. this.getBanner();
  78. this.getAnnouncement();
  79. this.getQuotationNew()
  80. },
  81. methods: {
  82. // 获取banner
  83. getBanner() {
  84. Api_getNewsList({
  85. cid: 5,
  86. limit: 10
  87. }).then(res => {
  88. this.BannerList = res.list
  89. })
  90. },
  91. // 获取公告
  92. getAnnouncement() {
  93. Api_getNewsList({
  94. cid: 3,
  95. limit: 10
  96. }).then(res => {
  97. this.Announcement = res.list
  98. })
  99. },
  100. // 获取行情 / 首页推荐
  101. getQuotationNew() {
  102. Api_getQuotationNew().then(res => {
  103. this.quotationNew = res;
  104. console.log('this.quotationNew = ' , this.quotationNew)
  105. }).catch(err => {
  106. })
  107. }
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. .content {
  113. // padding: 0 30rpx;
  114. }
  115. .haed-title {
  116. image {
  117. width: 85rpx;
  118. height: 67rpx;
  119. }
  120. }
  121. </style>