index.vue 7.1 KB

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