index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <template>
  2. <view class="index-data">
  3. <view class="index-top">
  4. <top-head></top-head>
  5. <view class="top-text">
  6. <view class="text-item">{{$t('index.index.top.one')}}</view>
  7. <view class="text-item">{{$t('index.index.top.two')}}</view>
  8. <view class="text-item">{{$t('index.index.top.three')}}</view>
  9. <view class="text-item">{{$t('index.index.top.four')}}</view>
  10. </view>
  11. <view class="top-but">
  12. <button @click="goToUrl(1)">{{$t('index.index.investment')}}</button>
  13. </view>
  14. <view class="top-bottom">
  15. <image class="bottom-img" src="@/static/img/index/dagou.svg" mode="aspectFill"></image>
  16. <text class="bottom-text">{{$t('index.index.top.five')}}</text>
  17. <text class="bottom-text" @click="goToUrl(2)">{{$t('index.index.top.six')}}</text>
  18. </view>
  19. </view>
  20. <view class="index-list">
  21. <view class="list-title">
  22. <view class="title-img">
  23. <image src="@/static/img/index/bnb2.png" mode="aspectFill"></image>
  24. </view>
  25. <view class="title-text">{{$t('index.index.list.title')}}({{total}})</view>
  26. </view>
  27. <division></division>
  28. <earning-list @setTotal="setTotal"></earning-list>
  29. </view>
  30. <view class="index-bottom"></view>
  31. </view>
  32. </template>
  33. <script>
  34. import tokenpocketBnb from "@/common/wallet/tokenpocket-wallet/tokenpocket-bnb";
  35. import {getMemberInfo} from "@/api/member";
  36. import Division from "@/pages/index/components/division";
  37. import TopHead from "@/pages/index/components/top-head";
  38. import EarningList from "@/pages/index/components/earning-list";
  39. export default {
  40. components: {EarningList, TopHead, Division},
  41. data() {
  42. return {
  43. applicationLocale: '',
  44. systemLocale: '',
  45. showLang: false,
  46. isAjax: false,
  47. langList: [{'name': 'zh-Hans', 'value': '简体中文'}, {'name': 'en', 'value': 'English'}, {
  48. 'name': 'ja',
  49. 'value': '日本語'
  50. }, {'name': 'ko', 'value': '한국어'}],
  51. tabNum: 0,
  52. investData: {
  53. id: 1,
  54. invest_money: '',
  55. sysAddress: "",
  56. sendNum: "",
  57. },
  58. memberData: {
  59. "id": 30,
  60. "address": "",
  61. "invite_code": "72592982",
  62. "level_id": 0,
  63. "levelName": "V0",
  64. "recommendNum": 0,
  65. "teamNum": 0
  66. },
  67. bnbNum: 0,
  68. babAddress: '',
  69. total:0
  70. }
  71. },
  72. watch: {},
  73. async onLoad(query) {
  74. this.getMyData()
  75. },
  76. mounted() {
  77. },
  78. methods: {
  79. setTotal(total){
  80. this.total=total
  81. },
  82. goToUrl(type) {
  83. switch (type) {
  84. case 1:
  85. uni.navigateTo({
  86. 'url': 'pages/index/contract'
  87. })
  88. break
  89. case 2:
  90. uni.navigateTo({
  91. 'url': 'pages/index/intro'
  92. })
  93. break
  94. case 3:
  95. uni.navigateTo({
  96. 'url': 'pages/index/contract'
  97. })
  98. break
  99. }
  100. },
  101. setShowLang() {
  102. this.showLang = !this.showLang
  103. },
  104. setTabNum(tabNum) {
  105. if (tabNum !== this.tabNum) {
  106. this.tabNum = tabNum
  107. }
  108. },
  109. getMyData() {
  110. this.babAddress = tokenpocketBnb.getMyAddress()
  111. getMemberInfo().then((res) => {
  112. if (res.code === 1) {
  113. this.memberData = res.data
  114. }
  115. })
  116. },
  117. },
  118. }
  119. </script>
  120. <style lang="scss" scoped>
  121. //@import "/static/css/common.css";
  122. .index-data {
  123. .index-top {
  124. box-shadow: 0 0 24rpx 0 rgba(0,0,0,0.08);
  125. box-sizing: border-box;
  126. overflow: hidden;
  127. padding: 40rpx 0;
  128. width: 100%;
  129. background: linear-gradient(0deg, rgb(64, 74, 96) 0%, rgb(9, 21, 36) 100%);
  130. .top-head {
  131. display: flex;
  132. justify-content: space-between;
  133. height: 84rpx;
  134. padding-left: 20rpx;
  135. .head-item {
  136. display: flex;
  137. justify-content: left;
  138. }
  139. .head-left {
  140. .left-img {
  141. margin-top: 1rpx;
  142. image {
  143. width: 80rpx;
  144. height: 80rpx;
  145. }
  146. }
  147. .left-text {
  148. padding-top: 5px;
  149. margin-left: 10px;
  150. .item-item {
  151. font-size: 22rpx;
  152. color: #fff;
  153. }
  154. .item-item:nth-of-type(1) {
  155. font-size: 32rpx;
  156. font-weight: bold;
  157. }
  158. }
  159. }
  160. .head-right {
  161. justify-content: right;
  162. .right-img {
  163. width: 70rpx;
  164. height: 70rpx;
  165. image {
  166. width: 70rpx;
  167. height: 70rpx;
  168. }
  169. }
  170. .right-text {
  171. margin-left: 20rpx;
  172. height: 70rpx;
  173. line-height: 70rpx;
  174. width: 200rpx;
  175. overflow: hidden;
  176. text-overflow: ellipsis;
  177. color: rgb(116, 132, 164);
  178. }
  179. }
  180. }
  181. .top-text {
  182. clear: both;
  183. padding: 40rpx;
  184. margin-top: 40rpx;
  185. .text-item {
  186. color: #fff;
  187. font-size: 50rpx;
  188. font-weight: bold;
  189. }
  190. }
  191. .top-but {
  192. width: 80%;
  193. margin: 60rpx auto 0;
  194. button {
  195. height: 90rpx;
  196. line-height: 90rpx;
  197. text-align: center;
  198. background: rgb(0, 87, 255);
  199. color: #fff;
  200. border-radius: 20rpx;
  201. font-weight: bold;
  202. }
  203. }
  204. .top-bottom {
  205. padding: 40rpx;
  206. .bottom-img {
  207. display: inline-block;
  208. width: 24rpx;
  209. height: 24rpx;
  210. margin-right: 10rpx;
  211. }
  212. .bottom-text {
  213. font-size: 24rpx;
  214. color: #7484a4;
  215. }
  216. .bottom-text:nth-of-type(2) {
  217. margin-left: 0.5em;
  218. text-decoration: underline;
  219. }
  220. }
  221. }
  222. .index-list {
  223. background: #fff;
  224. width: 90%;
  225. margin: 40rpx auto;
  226. border-radius: 10px;
  227. padding: 20px 10px;
  228. overflow: hidden;
  229. font-size: 13px;
  230. box-shadow: 0 8rpx 16rpx 0 rgba(0, 0, 0, 0.08);
  231. .list-title {
  232. display: flex;
  233. justify-content: left;
  234. .title-img {
  235. background: rgb(0, 87, 255);
  236. padding: 10rpx;
  237. border-radius: 20rpx;
  238. image {
  239. width: 80rpx;
  240. height: 80rpx;
  241. }
  242. }
  243. .title-text {
  244. margin-left: 20rpx;
  245. line-height: 100rpx;
  246. font-size: 34rpx;
  247. font-weight: bold;
  248. }
  249. }
  250. }
  251. .index-bottom {
  252. height: 50rpx;
  253. }
  254. }
  255. </style>