nav.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <view class="nav-box">
  3. <view class="nav-muen">
  4. <view class="nav-item" v-for="(item , index) in navMuen" :key="`nav_muen_${index}`" @click.stop="openNav(item)">
  5. <image class="nav-icon" :src="item.icon" mode="aspectFit"></image>
  6. <text class="nav-name">{{ item.name }}</text>
  7. </view>
  8. </view>
  9. <view class="nav-function">
  10. <view :class="['function-item' , `function-item_${index}`]" v-for="(item , index) in navFunction"
  11. :key="`nav_function_${index}`" @click.stop="openMore(item)">
  12. <view class="function-content">
  13. <view class="function-title">{{ item.name }}</view>
  14. <view class="function-btn">{{ item.btn }}</view>
  15. </view>
  16. <image class="function-icon" :src="item.icon" mode="aspectFit"></image>
  17. </view>
  18. </view>
  19. <!-- 暂未开放 -->
  20. <unopen ref="unopenRef"/>
  21. </view>
  22. </template>
  23. <script>
  24. import { ifLogin_ } from "@/utils/common.js"
  25. export default {
  26. name: "navModules",
  27. data() {
  28. return {
  29. navMuen: [{
  30. icon: require("./../../../static/images/nav_01.png"),
  31. name: '永续合约',
  32. },
  33. {
  34. icon: require("./../../../static/images/nav_02.png"),
  35. name: '快捷合约',
  36. },
  37. {
  38. icon: require("./../../../static/images/nav_03.png"),
  39. name: '赠金交易',
  40. },
  41. {
  42. icon: require("./../../../static/images/nav_04.png"),
  43. name: '模拟合约',
  44. },
  45. {
  46. icon: require("./../../../static/images/nav_05.png"),
  47. name: '积分商城',
  48. },
  49. {
  50. icon: require("./../../../static/images/nav_06.png"),
  51. name: 'NFT',
  52. },
  53. {
  54. icon: require("./../../../static/images/nav_07.png"),
  55. name: '在线客服',
  56. },
  57. {
  58. icon: require("./../../../static/images/nav_08.png"),
  59. name: '新人指南',
  60. }
  61. ],
  62. navFunction: [{
  63. icon: require("./../../../static/images/nav_09.png"),
  64. name: '充币',
  65. btn: '立即赚',
  66. path:'/pages/content/select-currency',
  67. },
  68. {
  69. icon: require("./../../../static/images/nav_10.png"),
  70. name: '牛熊对战',
  71. btn: '立即参与',
  72. },
  73. {
  74. icon: require("./../../../static/images/nav_11.png"),
  75. name: '跟单社区',
  76. btn: '跟单玩合约',
  77. }
  78. ]
  79. };
  80. },
  81. methods:{
  82. openNav(){
  83. this.$nextTick(() => {
  84. this.$refs.unopenRef.open()
  85. })
  86. },
  87. openMore(item){
  88. ifLogin_().then(res => {
  89. uni.navigateTo({
  90. url: item.path
  91. })
  92. })
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. .nav-box {
  99. width: 100%;
  100. background-color: $modules-box-bg;
  101. padding: 30rpx $pages-padding 20rpx;
  102. .nav-muen {
  103. width: 100%;
  104. display: flex;
  105. flex-wrap: wrap;
  106. .nav-item {
  107. flex-shrink: 0;
  108. width: 25%;
  109. display: flex;
  110. flex-direction: column;
  111. align-items: center;
  112. margin-bottom: 30rpx;
  113. .nav-icon {
  114. width: 65rpx;
  115. height: 58rpx;
  116. }
  117. .nav-name {
  118. padding-top: 10rpx;
  119. font-size: 24rpx;
  120. font-family: PingFang SC, PingFang SC-Regular;
  121. font-weight: 400;
  122. text-align: center;
  123. color: #333333;
  124. line-height: 33rpx;
  125. letter-spacing: 0.48rpx;
  126. }
  127. }
  128. }
  129. .nav-function {
  130. width: 100%;
  131. display: flex;
  132. justify-content: space-between;
  133. align-items: center;
  134. .function-item {
  135. width: calc((100% - 28rpx) / 3);
  136. height: 122rpx;
  137. border-radius: 9rpx;
  138. position: relative;
  139. .function-icon {
  140. position: absolute;
  141. right: 15rpx;
  142. top: 50%;
  143. width: 74rpx;
  144. height: 74rpx;
  145. transform: translateY(-50%);
  146. z-index: 1;
  147. }
  148. .function-content {
  149. position: absolute;
  150. left: 0;
  151. top: 50%;
  152. transform: translateY(-50%);
  153. // width: 100%;
  154. // height: 100%;
  155. z-index: 2;
  156. padding: 0 15rpx;
  157. // display: flex;
  158. // flex-direction: column;
  159. // // align-items: center;
  160. // justify-content: center;
  161. .function-title {
  162. font-size: 26rpx;
  163. font-family: PingFang SC, PingFang SC-Bold;
  164. font-weight: 700;
  165. color: #1a1a1a;
  166. line-height: 37rpx;
  167. }
  168. .function-btn {
  169. margin-top: 6rpx;
  170. border-radius: 6rpx;
  171. padding: 4rpx 13rpx;
  172. font-size: 22rpx;
  173. font-family: PingFang SC, PingFang SC-Regular;
  174. font-weight: 400;
  175. color: #ffffff;
  176. line-height: 30rpx;
  177. letter-spacing: 0.44rpx;
  178. }
  179. }
  180. }
  181. .function-item_0 {
  182. background: linear-gradient(180deg, #fef1d0, #fcf2d3);
  183. .function-btn {
  184. background-color: #ffcf6d;
  185. }
  186. }
  187. .function-item_1 {
  188. background: linear-gradient(180deg, #c9ebfc, #c8ecfc);
  189. .function-btn {
  190. background-color: #61C1FE;
  191. }
  192. }
  193. .function-item_2 {
  194. background: linear-gradient(180deg, #cff0eb, #cdf2ea);
  195. .function-btn {
  196. background-color: #63EBC3;
  197. }
  198. }
  199. }
  200. }
  201. </style>