index.vue 7.4 KB

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