index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <template>
  2. <view class="index-data">
  3. <view class="index-top">
  4. <top-head @setBabAddress="setBabAddress"></top-head>
  5. <view class="top-text" @click="goToUrl(2)">
  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" @click="setClipboardData" v-show="memberData.orderNum>0">
  16. <image class="bottom-img" src="@/static/img/index/cp.png" mode="aspectFill"></image>
  17. <text class="bottom-text bottom-text-two">{{ $t('index.index.top.cp') }}</text>
  18. </view>
  19. <view class="top-bottom" v-if="false">
  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">{{ $t('index.index.top.five') }}</text>-->
  23. <text class="bottom-text" @click="goToUrl(2)">{{ $t('index.index.top.six') }}</text>
  24. </view>
  25. </view>
  26. <view class="list-tab">
  27. <view class="tab-items">
  28. <view class="tab-item" @click="setListTab(1)" :class="{'option-tab':listTab===1}">
  29. {{ $t('index.index.list.title') }}
  30. </view>
  31. <view class="tab-item" @click="setListTab(2)" :class="{'option-tab':listTab===2}">
  32. {{ $t('index.index.list.title-two') }}
  33. </view>
  34. <!-- <view class="tab-item" @click="setListTab(3)" :class="{'option-tab':listTab===3}">-->
  35. <!-- {{ $t('index.index.code') }}-->
  36. <!-- </view>-->
  37. </view>
  38. <view class="tab-item-bg"
  39. :class="{'bg-location-1':listTab===1,'bg-location-2':listTab===2,'bg-location-3':listTab===3}"></view>
  40. </view>
  41. <view class="team-but" @click="goToUrl(4)">{{ $t('index.index.tds') }}》</view>
  42. <view class="index-list">
  43. <!-- <view class="list-title">-->
  44. <!-- <view class="title-img">-->
  45. <!-- <image src="@/static/img/index/bnb2.png" mode="aspectFill"></image>-->
  46. <!-- </view>-->
  47. <!-- <view class="title-text">{{ $t('index.index.list.title') }}({{ total }})</view>-->
  48. <!-- </view>-->
  49. <!-- <division></division>-->
  50. <view v-if="listTab===1">
  51. <earning-list @setTotal="setTotal"></earning-list>
  52. </view>
  53. <view v-else>
  54. <common-list @setTotal="setTotal"></common-list>
  55. </view>
  56. </view>
  57. <view class="index-bottom"></view>
  58. </view>
  59. </template>
  60. <script>
  61. import {getMemberInfo} from "@/api/member";
  62. import Division from "@/pages/index/components/division";
  63. import TopHead from "@/pages/index/components/top-head";
  64. import EarningList from "@/pages/index/components/earning-list";
  65. import CommonList from "@/pages/index/components/common-list";
  66. import tokenpocketBnb from "@/common/wallet/tokenpocket-wallet/tokenpocket-bnb";
  67. export default {
  68. components: {CommonList, EarningList, TopHead, Division},
  69. data() {
  70. return {
  71. listTab:1,
  72. applicationLocale: '',
  73. systemLocale: '',
  74. showLang: false,
  75. isAjax: false,
  76. langList: [{'name': 'zh-Hans', 'value': '简体中文'}, {'name': 'en', 'value': 'English'}, {
  77. 'name': 'ja',
  78. 'value': '日本語'
  79. }, {'name': 'ko', 'value': '한국어'}],
  80. tabNum: 0,
  81. investData: {
  82. id: 1,
  83. invest_money: '',
  84. sysAddress: "",
  85. sendNum: "",
  86. },
  87. memberData: {
  88. "id": 30,
  89. "address": "",
  90. "invite_code": "72592982",
  91. "level_id": 0,
  92. "levelName": "V0",
  93. "orderNum": 0,
  94. "recommendNum": 0,
  95. "teamNum": 0
  96. },
  97. bnbNum: 0,
  98. babAddress: '',
  99. total: 0,
  100. days:365
  101. }
  102. },
  103. watch: {},
  104. async onLoad(query) {
  105. this.getMyData()
  106. this.handlerDateDurationCurrent()
  107. },
  108. mounted() {
  109. },
  110. methods: {
  111. setClipboardData(){
  112. console.log(window.location)
  113. uni.setClipboardData({
  114. data: window.origin+'/#/pages/index/index?inviteCode='+this.babAddress,
  115. success: function () {
  116. console.log('success');
  117. }
  118. });
  119. },
  120. setBabAddress(babAddress){
  121. this.babAddress=babAddress
  122. },
  123. handlerDateDurationCurrent() {
  124. let d1 = new Date('2021-11-12')
  125. let d2 = new Date()
  126. let cha = Math.abs(d2.getTime() - d1.getTime())
  127. this.days = parseInt(cha / (24 * 60 * 60 * 1000))
  128. // let hours = parseInt(cha % (24 * 60 * 60 * 1000) / (60 * 60 * 1000))
  129. // let mins = parseInt(cha % (60 * 60 * 1000) / (60 * 1000))
  130. },
  131. setTotal(total) {
  132. this.total = total
  133. },
  134. goToUrl(type) {
  135. switch (type) {
  136. case 1:
  137. uni.navigateTo({
  138. 'url': 'pages/index/contract'
  139. })
  140. break
  141. case 2:
  142. uni.navigateTo({
  143. 'url': 'pages/index/intro'
  144. })
  145. break
  146. case 3:
  147. uni.navigateTo({
  148. 'url': 'pages/index/contract'
  149. })
  150. break
  151. case 4:
  152. uni.navigateTo({
  153. 'url': 'pages/index/team'
  154. })
  155. break
  156. }
  157. },
  158. setShowLang() {
  159. this.showLang = !this.showLang
  160. },
  161. setListTab(listTab) {
  162. if (this.listTab !== listTab) {
  163. this.listTab = listTab
  164. }
  165. },
  166. getMyData() {
  167. let token = uni.getStorageSync('token')
  168. if (token) {
  169. getMemberInfo().then((res) => {
  170. if (res.code === 1) {
  171. this.memberData = res.data
  172. tokenpocketBnb.getAccounts().then((babAddress)=>{
  173. if(babAddress && this.memberData.address.toLocaleLowerCase()!==babAddress.toLocaleLowerCase()){
  174. uni.clearStorageSync()
  175. uni.reLaunch({
  176. 'url': 'pages/login/index'
  177. })
  178. }
  179. })
  180. }
  181. })
  182. }
  183. },
  184. },
  185. }
  186. </script>
  187. <style lang="scss" scoped>
  188. //@import "/static/css/common.css";
  189. .index-data {
  190. min-height: 100vh;
  191. .index-top {
  192. box-shadow: 0 0 24rpx 0 rgba(0, 0, 0, 0.08);
  193. box-sizing: border-box;
  194. overflow: hidden;
  195. padding: 40rpx 0;
  196. width: 100%;
  197. background: linear-gradient(0deg, rgb(64, 74, 96) 0%, rgb(9, 21, 36) 100%);
  198. .top-head {
  199. display: flex;
  200. justify-content: space-between;
  201. height: 84rpx;
  202. padding-left: 20rpx;
  203. .head-item {
  204. display: flex;
  205. justify-content: left;
  206. }
  207. .head-left {
  208. .left-img {
  209. margin-top: 1rpx;
  210. image {
  211. width: 80rpx;
  212. height: 80rpx;
  213. }
  214. }
  215. .left-text {
  216. padding-top: 5px;
  217. margin-left: 10px;
  218. .item-item {
  219. font-size: 22rpx;
  220. color: #fff;
  221. }
  222. .item-item:nth-of-type(1) {
  223. font-size: 32rpx;
  224. font-weight: bold;
  225. }
  226. }
  227. }
  228. .head-right {
  229. justify-content: right;
  230. .right-img {
  231. width: 70rpx;
  232. height: 70rpx;
  233. image {
  234. width: 70rpx;
  235. height: 70rpx;
  236. }
  237. }
  238. .right-text {
  239. margin-left: 20rpx;
  240. height: 70rpx;
  241. line-height: 70rpx;
  242. width: 200rpx;
  243. overflow: hidden;
  244. text-overflow: ellipsis;
  245. color: rgb(116, 132, 164);
  246. }
  247. }
  248. }
  249. .top-text {
  250. clear: both;
  251. padding: 40rpx;
  252. margin-top: 40rpx;
  253. color: #fff;
  254. font-size: 36rpx;
  255. font-weight: bold;
  256. line-height: 36px;
  257. .text-item {
  258. color: #fff;
  259. font-size: 30rpx;
  260. font-weight: bold;
  261. }
  262. }
  263. .top-but {
  264. width: 80%;
  265. margin: 60rpx auto 0;
  266. button {
  267. height: 90rpx;
  268. line-height: 90rpx;
  269. text-align: center;
  270. background: rgb(0, 87, 255);
  271. color: #fff;
  272. border-radius: 20rpx;
  273. font-weight: bold;
  274. }
  275. }
  276. .top-bottom {
  277. padding: 10rpx 40rpx 0 40rpx;
  278. .bottom-img {
  279. display: inline-block;
  280. width: 24rpx;
  281. height: 24rpx;
  282. margin-right: 10rpx;
  283. }
  284. .bottom-text {
  285. font-size: 24rpx;
  286. color: #7484a4;
  287. }
  288. bottom-text-two{
  289. font-size: 23rpx !important;
  290. }
  291. .bottom-text:nth-of-type(2) {
  292. margin-left: 0.5em;
  293. text-decoration: underline;
  294. }
  295. }
  296. //.top-bottom
  297. //.top-bottom:nth-of-type(0) {
  298. // //padding: 40rpx 40rpx 0 40rpx;
  299. // .bottom-text{
  300. // font-size: 28rpx;
  301. // }
  302. //}
  303. }
  304. .list-tab {
  305. width: 90%;
  306. height: 100%;
  307. background: #eaf2ff;
  308. border-radius: 36px;
  309. cursor: pointer;
  310. position: relative;
  311. margin: 20rpx auto;
  312. .tab-items {
  313. z-index: 10;
  314. display: flex;
  315. justify-content: space-between;
  316. border-radius: 36px;
  317. .tab-item {
  318. z-index: 10;
  319. width: calc(100% / 2);
  320. font-size: 13px;
  321. color: #adbad0;
  322. display: block;
  323. height: 32px;
  324. line-height: 32px;
  325. text-align: center;
  326. }
  327. .option-tab {
  328. color: #292929;
  329. }
  330. }
  331. .tab-item-bg {
  332. position: absolute;
  333. border-radius: 36px;
  334. background: #fff;
  335. transition: .5s ease;
  336. height: 32px;
  337. width: calc(100% / 2);
  338. top: 0;
  339. }
  340. .bg-location-1 {
  341. left: 0;
  342. transition: .5s ease;
  343. }
  344. .bg-location-2 {
  345. left: 50%;
  346. transition: .5s ease;
  347. }
  348. .bg-location-3 {
  349. left: 66.66%;
  350. transition: .5s ease;
  351. }
  352. }
  353. .team-but{
  354. width: 90%;
  355. margin: auto;
  356. font-size: 13px;
  357. color: #adbad0;
  358. text-align: right;
  359. //height: 32px;
  360. //line-height: 32px;
  361. }
  362. .index-list {
  363. background: #fff;
  364. width: 90%;
  365. margin: 20rpx auto;
  366. border-radius: 10px;
  367. padding: 20px 10px;
  368. overflow: hidden;
  369. font-size: 13px;
  370. box-shadow: 0 8rpx 16rpx 0 rgba(0, 0, 0, 0.08);
  371. .list-title {
  372. display: flex;
  373. justify-content: left;
  374. .title-img {
  375. background: rgb(0, 87, 255);
  376. padding: 10rpx;
  377. border-radius: 20rpx;
  378. image {
  379. width: 80rpx;
  380. height: 80rpx;
  381. }
  382. }
  383. .title-text {
  384. margin-left: 20rpx;
  385. line-height: 100rpx;
  386. font-size: 34rpx;
  387. font-weight: bold;
  388. }
  389. }
  390. }
  391. .index-bottom {
  392. height: 50rpx;
  393. }
  394. }
  395. </style>