index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <view class="container">
  3. <!-- 轮播图 start -->
  4. <swiper class="top-swiper" autoplay="true" duration="400" interval="5000" @change="swiperChange">
  5. <swiper-item v-for="(item, index) in 2" :key="index" class="carousel-item" @click="bannerNavToUrl(item)">
  6. <image src="../../static/img/banner.png" />
  7. </swiper-item>
  8. </swiper>
  9. <!-- 轮播图 end -->
  10. <!-- 功能盒 start -->
  11. <view class="gnh-wrap">
  12. <view class="gnh-top flex">
  13. <view class="top-item flex">
  14. <image src="../../static/icon/gn-1.png" mode="" class=""></image>
  15. <view class="">认购</view>
  16. </view>
  17. <view class="top-item flex">
  18. <image src="../../static/icon/gn-2.png" mode="" class=""></image>
  19. <view class="">充币</view>
  20. </view>
  21. <view class="top-item flex">
  22. <image src="../../static/icon/gn-3.png" mode="" class=""></image>
  23. <view class="">提币</view>
  24. </view>
  25. <view class="top-item flex">
  26. <image src="../../static/icon/gn-4.png" mode="" class=""></image>
  27. <view class="">语言</view>
  28. </view>
  29. <view class="top-item flex">
  30. <image src="../../static/icon/gn-5.png" mode="" class=""></image>
  31. <view class="">客服</view>
  32. </view>
  33. </view>
  34. <view class="gnh-btm flex">
  35. <view class="btm-item">
  36. <view class="btm-item-name">
  37. BTC/USDT
  38. </view>
  39. <view class="btm-item-val">
  40. 15716.53
  41. </view>
  42. <view class="btm-item-bl">
  43. -2.44%
  44. </view>
  45. </view>
  46. <view class="btm-item">
  47. <view class="btm-item-name">
  48. BTC/USDT
  49. </view>
  50. <view class="btm-item-val">
  51. 15716.53
  52. </view>
  53. <view class="btm-item-bl">
  54. -2.44%
  55. </view>
  56. </view>
  57. <view class="btm-item">
  58. <view class="btm-item-name">
  59. ETH/USDT
  60. </view>
  61. <view class="btm-item-val">
  62. 15716.53
  63. </view>
  64. <view class="btm-item-bl">
  65. -2.44%
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <!-- 功能盒 end -->
  71. </view>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {
  77. };
  78. },
  79. computed: {
  80. },
  81. onLoad: function(option) {
  82. },
  83. onShow: function() {
  84. },
  85. //下拉刷新
  86. onPullDownRefresh() {
  87. },
  88. methods: {
  89. // 轮播图跳转
  90. bannerNavToUrl(item) {
  91. // #ifdef H5
  92. console.log(item.wap_url.indexOf('http'), 'banner');
  93. if (item.wap_url.indexOf('http') >= 0) {
  94. window.location.href = item.wap_url;
  95. }
  96. // #endif
  97. //测试数据没有写id,用title代替
  98. uni.navigateTo({
  99. url: item.wap_url
  100. });
  101. },
  102. }
  103. };
  104. </script>
  105. <style lang="scss">
  106. // 顶部轮播图
  107. .top-swiper {
  108. margin: auto;
  109. width: 726rpx;
  110. height: 273rpx;
  111. .carousel-item {
  112. }
  113. // margin: 20rpx 0 0;
  114. image {
  115. // margin: auto;
  116. width: 726rpx;
  117. height: 273rpx;
  118. }
  119. }
  120. .gnh-wrap {
  121. margin: 20rpx 0;
  122. width: 750rpx;
  123. height: 315rpx;
  124. background-color: #fff;
  125. border-radius: 50rpx 50rpx 0 0;
  126. .gnh-top {
  127. justify-content: space-around;
  128. height: 156rpx;
  129. .top-item {
  130. flex-direction: column;
  131. justify-content: center;
  132. align-items: center;
  133. image {
  134. width: 66rpx;
  135. height: 75rpx;
  136. }
  137. view {
  138. font-weight: 500;
  139. color: #525C6E;
  140. }
  141. }
  142. }
  143. .gnh-btm {
  144. justify-content: space-around;
  145. .btm-item {
  146. width: 33%;
  147. text-align: center;
  148. padding-top: 20rpx;
  149. .btm-item-name {
  150. font-size: 24rpx;
  151. font-weight: 500;
  152. color: #525C6E;
  153. }
  154. .btm-item-val {
  155. font-size: 26rpx;
  156. font-weight: 500;
  157. color: #DD3745;
  158. padding: 20rpx 0;
  159. }
  160. .btm-item-bl {
  161. font-size: 24rpx;
  162. font-weight: 500;
  163. color: #DD3745;
  164. }
  165. }
  166. }
  167. }
  168. </style>