nav.vue 5.9 KB

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