index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <u-popup :show="show" mode="left" @close="close" @open="open">
  3. <view class="popupBox">
  4. <view class="cancel" @click="close">
  5. <image src="/static/img/img13.png"></image>
  6. </view>
  7. <view class="listBox">
  8. <view class="listTpl flex_item" v-for="item,index in list" :key="index" :class="{ atcive: currTab == index }" @click="navTo(item.url,index)">
  9. <image class="icon" :src="item.icon" mode="widthFix"></image>
  10. <view class="name">{{item.name}}</view>
  11. </view>
  12. </view>
  13. </view>
  14. </u-popup>
  15. </template>
  16. <script>
  17. export default {
  18. props:['currTab'],
  19. data() {
  20. return {
  21. show: false,
  22. list:[]
  23. }
  24. },
  25. mounted() {},
  26. methods: {
  27. open(){
  28. this.list = [{
  29. name:'Home',
  30. icon:'/static/img/img14.png',
  31. url:'/pages/index/index'
  32. },{
  33. name:'BF swap',
  34. icon:'/static/img/img15.png',
  35. url:''
  36. },{
  37. name:this.$t('indexs.i2'),
  38. icon:'/static/img/img16.png',
  39. url:'/pages/supermarket/index'
  40. },{
  41. name:this.$t('indexs.i3'),
  42. icon:'/static/img/img17.png',
  43. url:''
  44. },{
  45. name:this.$t('indexs.i4'),
  46. icon:'/static/img/img19.png',
  47. url:'/pages/diagram/index'
  48. },{
  49. name:this.$t('indexs.i7'),
  50. icon:'/static/img/img25.png',
  51. url:''
  52. },
  53. {
  54. name:this.$t('indexs.i5'),
  55. icon:'/static/img/img18.png',
  56. url:'https://t.me/Benfolds_cn'
  57. }]
  58. this.show = true
  59. },
  60. // 关闭弹窗
  61. close() {
  62. this.show = false
  63. },
  64. navTo(url,index){
  65. this.show = false
  66. if(index == 6){
  67. window.open(url)
  68. }else{
  69. if (url == "") {
  70. let url = '/pages/404/index?index='+index
  71. uni.navigateTo({
  72. url,
  73. fail() {
  74. uni.switchTab({
  75. url,
  76. });
  77. },
  78. });
  79. } else {
  80. uni.navigateTo({
  81. url,
  82. fail() {
  83. uni.switchTab({
  84. url,
  85. });
  86. },
  87. });
  88. }
  89. }
  90. },
  91. }
  92. }
  93. </script>
  94. <style lang="scss" scoped>
  95. .popupBox{
  96. width: 522rpx;
  97. height: 100%;
  98. background: #111111;
  99. padding-left: 50rpx;
  100. padding-right: 43rpx;
  101. .cancel{
  102. width: 100%;
  103. text-align: right;
  104. margin: 82rpx 0rpx 125rpx 0rpx;
  105. image{
  106. width: 30rpx;
  107. height: 30rpx;
  108. }
  109. }
  110. .listBox{
  111. .listTpl{
  112. font-size: 32rpx;
  113. color: #FFFFFF;
  114. padding: 25rpx 30rpx;
  115. margin-bottom: 20rpx;
  116. .icon{
  117. width: 44rpx;
  118. height: 43rpx;
  119. }
  120. .name{
  121. padding-left: 29rpx;
  122. }
  123. }
  124. .atcive{
  125. box-shadow: -4rpx -4rpx 13rpx 0rpx rgba(168,168,206,0.13), 4rpx 4rpx 7rpx 3rpx rgba(0,0,0,0.4);
  126. border-radius: 10rpx;
  127. color: #FFCC12 !important;
  128. }
  129. }
  130. }
  131. </style>