index.vue 6.3 KB

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