index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <template>
  2. <view class="container">
  3. <navBar></navBar>
  4. <view class="contenCenter">
  5. <!-- 轮播图 -->
  6. <swiper class="top-swiper position-relative" autoplay="true" duration="400" interval="5000">
  7. <swiper-item v-for="(item, index) in bannerList" :key="index" class="carousel-item">
  8. <image :src="baseURL+item" />
  9. </swiper-item>
  10. </swiper>
  11. <!-- 轮播图END -->
  12. <!-- 中间列表 -->
  13. <view class="itemList flex padding-r-30 margin-t-30">
  14. <view class="itemLeft flex">
  15. <image class="itemImg topOne" src="../../static/img/itemList.png" mode="widthFix"></image>
  16. <view class="itemTitle">
  17. {{($t("home.共创社区"))}}
  18. </view>
  19. </view>
  20. <view class="itemRight flex" @click="navto('./community')">
  21. <view>
  22. <view class="moneyLine text-linear-gradient">
  23. $300
  24. </view>
  25. <view class="margin-t-10">
  26. {{($t("home.立即前往"))}}
  27. </view>
  28. </view>
  29. <image class="next" src="../../static/img/mininext.png" mode="scaleToFill"></image>
  30. </view>
  31. </view>
  32. <view class="itemList flex padding-r-30 ">
  33. <view class="itemLeft flex">
  34. <image class="itemImg" src="../../static/img/itemList1.png" mode="center"></image>
  35. <view class="itemTitle">
  36. {{($t("home.闪兑"))}}
  37. </view>
  38. </view>
  39. <view class="itemRight flex" @click="navto('./buling')">
  40. <view>
  41. {{($t("home.立即前往"))}}
  42. </view>
  43. <image class="next" src="../../static/img/mininext.png" mode="scaleToFill"></image>
  44. </view>
  45. </view>
  46. <view class="itemList flex padding-r-30">
  47. <view class="itemLeft flex">
  48. <image class="itemImg" src="../../static/img/itemList2.png" mode="center"></image>
  49. <view class="itemTitle">
  50. {{($t("home.节点认购"))}}
  51. </view>
  52. </view>
  53. <view class="itemRight flex" @click="navto('./node')">
  54. <view>
  55. {{($t("home.立即前往"))}}
  56. </view>
  57. <image class="next" src="../../static/img/mininext.png" mode="scaleToFill"></image>
  58. </view>
  59. </view>
  60. <view class="itemList flex padding-v-30 padding-c-30">
  61. <view class="itemLeft flex">
  62. <view class="imageBg flex-center">
  63. <image class="bgTip" src="../../static/img/itemList3.png" mode="center"></image>
  64. </view>
  65. <view class="itemTitle">
  66. <view class="nameBox flex flex-start">
  67. <view class="name">
  68. BCMM
  69. </view>
  70. <!-- <view class="upNum">
  71. <text class="font-size-sm">+</text>10%
  72. </view> -->
  73. </view>
  74. <view class="type margin-t-10">
  75. {{($t("home.币种"))}}
  76. </view>
  77. </view>
  78. </view>
  79. <view class="itemRight">
  80. <view class="money">
  81. {{indexBase.price}}U
  82. </view>
  83. <view class="moneyText">
  84. {{($t("home.今日价格"))}}
  85. </view>
  86. </view>
  87. </view>
  88. <view class="itemList flex padding-r-30">
  89. <view class="itemLeft flex">
  90. <image class="itemImg" src="../../static/img/itemList4.png" mode="center"></image>
  91. <view class="itemTitle">
  92. {{($t("home.模式说明"))}}
  93. </view>
  94. </view>
  95. <view class="itemRight flex" @click="navto('./info')">
  96. <view>
  97. {{($t("home.立即前往"))}}
  98. </view>
  99. <image class="next" src="../../static/img/mininext.png" mode="scaleToFill"></image>
  100. </view>
  101. </view>
  102. <!-- 中间列表END -->
  103. <!-- 邀请 -->
  104. <view class="contentText">
  105. {{$t('home.邀请地址')}}
  106. </view>
  107. <view class="contentBox flex background-linear-gradient" @click="copyShareLink">
  108. <view class="shareLink clamp">
  109. {{userInfo.address}}
  110. </view>
  111. <view class="copy">
  112. {{($t("home.复制"))}}
  113. </view>
  114. </view>
  115. <!-- 邀请END -->
  116. <!-- 功能排 -->
  117. <view class="listConfige flex">
  118. <view class="list background-linear-gradient" @click="navto('/pages/user/shareItem')">
  119. <view class="listImg">
  120. <image class="imageTip" src="../../static/img/config01.png" mode="widthFix"></image>
  121. </view>
  122. <view class="listName">
  123. {{($t("home.我的邀请"))}}
  124. </view>
  125. <view class="listTip">
  126. {{($t("home.邀请团队信息"))}}
  127. </view>
  128. </view>
  129. <view class="list background-linear-gradient" @click="navto('/pages/user/user')">
  130. <view class="listImg">
  131. <image class="imageTip" src="../../static/img/config02.png" mode="widthFix"></image>
  132. </view>
  133. <view class="listName">
  134. {{($t("home.我的资产"))}}
  135. </view>
  136. <view class="listTip">
  137. {{($t("home.资产明细"))}}
  138. </view>
  139. </view>
  140. <view class="list background-linear-gradient" @click="navto('/pages/user/myDetail?type=BCMM')">
  141. <view class="listImg">
  142. <image class="imageTip" src="../../static/img/config03.png" mode="widthFix"></image>
  143. </view>
  144. <view class="listName">
  145. {{($t("home.我的收益"))}}
  146. </view>
  147. <view class="listTip">
  148. {{($t("home.收益明细"))}}
  149. </view>
  150. </view>
  151. </view>
  152. <!-- 功能排END -->
  153. <!-- 说明 -->
  154. <view class="listConfige flex">
  155. <view class="list big background-linear-gradient">
  156. <view class="listImg">
  157. <image class="imageTip" src="../../static/img/detail01.png" mode="center"></image>
  158. </view>
  159. <view class="listMinName">
  160. {{($t("home.共创"))}}
  161. </view>
  162. <view class="listMinTip">
  163. {{($t("home.行业领先"))}}
  164. </view>
  165. </view>
  166. <view class="list big background-linear-gradient">
  167. <view class="listImg">
  168. <image class="imageTip" src="../../static/img/detail02.png" mode="center"></image>
  169. </view>
  170. <view class="listMinName">
  171. {{($t("home.共享"))}}
  172. </view>
  173. <view class="listMinTip">
  174. {{($t("home.为全球数十个国家"))}}
  175. </view>
  176. </view>
  177. <view class="list big background-linear-gradient">
  178. <view class="listImg">
  179. <image class="imageTip" src="../../static/img/detail03.png" mode="center"></image>
  180. </view>
  181. <view class="listMinName">
  182. {{($t("home.共富"))}}
  183. </view>
  184. <view class="listMinTip">
  185. {{($t("home.BMCC生态"))}}
  186. </view>
  187. </view>
  188. </view>
  189. <!-- 说明END -->
  190. <!-- 底部合作伙伴 -->
  191. <view class="footerTitle margin-t-30 padding-t-30">
  192. {{($t("home.合作伙伴"))}}
  193. </view>
  194. <view class="footerTitle margin-t-20">
  195. Partners
  196. </view>
  197. <view class="footerImage">
  198. <image class="footerImg" src="../../static/img/footerImg.png" mode="scaleToFill"></image>
  199. </view>
  200. <!-- 底部合作伙伴END -->
  201. </view>
  202. <!-- <taber></taber> -->
  203. </view>
  204. </template>
  205. <script>
  206. import {
  207. loadIndexs,
  208. } from '@/api/index.js';
  209. import {
  210. getUserInfo
  211. } from '@/api/user.js';
  212. import {
  213. saveUrl,
  214. interceptor
  215. } from '@/utils/loginUtils.js';
  216. import {
  217. mapState,
  218. mapActions,
  219. mapMutations
  220. } from "vuex";
  221. // import taber from "@/components/footer/footer.vue";
  222. import navBar from "@/components/nav/nav.vue"
  223. export default {
  224. filters: {
  225. failNumber: function(number) {
  226. return +(+number).toFixed(2)
  227. }
  228. },
  229. components: {
  230. navBar
  231. // taber
  232. },
  233. data() {
  234. return {
  235. bannerList: [],
  236. indexBase: {
  237. price: 'loding',
  238. }
  239. }
  240. },
  241. computed: {
  242. ...mapState(['baseURL', 'urlFile']),
  243. ...mapState("user", ['userInfo', 'hasLogin']),
  244. },
  245. onLoad(option) {
  246. if (option.spread) {
  247. // 存储其他邀请人
  248. uni.setStorageSync('spread', option.spread);
  249. }
  250. },
  251. onShow() {
  252. this.loadData();
  253. this.getUserInfo();
  254. },
  255. methods: {
  256. ...mapMutations('user', ['setUserInfo']),
  257. navto(url) {
  258. if (!this.hasLogin) {
  259. // 保存地址
  260. saveUrl();
  261. // 登录拦截
  262. interceptor();
  263. } else {
  264. uni.navigateTo({
  265. url,
  266. });
  267. }
  268. },
  269. // 复制分享链接
  270. copyShareLink() {
  271. const that = this;
  272. if (!that.hasLogin) {
  273. // 保存地址
  274. saveUrl();
  275. // 登录拦截
  276. interceptor();
  277. } else {
  278. uni.setClipboardData({
  279. data: that.baseURL + that.urlFile + '/#/pages/index/index?spread=' + that.userInfo.address,
  280. showToast: false,
  281. success: function() {
  282. uni.showToast({
  283. title: that.$t('home.成功')
  284. })
  285. },
  286. });
  287. }
  288. },
  289. // 请求载入数据
  290. async loadData() {
  291. loadIndexs().then((res) => {
  292. this.bannerList = res.data.banner.split(',');
  293. this.indexBase = res.data;
  294. console.log(this.bannerList)
  295. }).catch((res) => {
  296. console.log(res);
  297. })
  298. },
  299. // 获取更新用户信息
  300. getUserInfo() {
  301. getUserInfo().then((res) => {
  302. this.setUserInfo(res.data);
  303. }).catch((res) => {
  304. console.log(res);
  305. })
  306. },
  307. },
  308. }
  309. </script>
  310. <style lang="scss">
  311. .container {
  312. width: 100%;
  313. line-height: 1;
  314. background-color: rgb(12, 8, 21);
  315. }
  316. .contenCenter{
  317. padding: 25rpx;
  318. }
  319. // 顶部轮播图
  320. .top-swiper {
  321. height: 320rpx;
  322. border-radius: 30rpx;
  323. overflow: hidden;
  324. z-index: 9;
  325. // margin: 20rpx 0 0;
  326. image {
  327. width: 100%;
  328. height: 320rpx;
  329. }
  330. }
  331. .itemList {
  332. margin-bottom: 30rpx;
  333. background: url("../../static/img/itemBg.png") no-repeat;
  334. background-size: 100% 100%;
  335. color: #FFF;
  336. .itemLeft {
  337. font-weight: bold;
  338. .itemImg {
  339. width: 158rpx;
  340. height: 158rpx;
  341. &.topOne {
  342. width: 158rpx;
  343. }
  344. }
  345. .itemTitle {
  346. font-size: 35rpx;
  347. }
  348. }
  349. .itemRight {
  350. font-size: 20rpx;
  351. text-align: right;
  352. .next {
  353. margin-left: 10rpx;
  354. width: 11rpx;
  355. height: 18rpx;
  356. }
  357. .moneyLine {
  358. font-weight: bold;
  359. font-size: 28rpx;
  360. }
  361. .money {
  362. font-weight: bold;
  363. font-size: 26rpx;
  364. color: #FFFFFF;
  365. text-align: right;
  366. }
  367. .moneyText {
  368. font-weight: 500;
  369. font-size: 22rpx;
  370. color: #FFFFFF;
  371. opacity: 0.3;
  372. margin-top: 10rpx;
  373. }
  374. }
  375. .itemTitle {
  376. .name {
  377. font-weight: bold;
  378. font-size: 26rpx;
  379. color: #FFFFFF;
  380. }
  381. .upNum {
  382. background: rgba(28, 215, 183, .22);
  383. border-radius: 19px;
  384. font-weight: 500;
  385. font-size: 22rpx;
  386. color: #1AD9BA;
  387. padding: 10rpx 20rpx;
  388. margin-left: 10rpx;
  389. }
  390. .type {
  391. font-size: 22rpx;
  392. opacity: .30;
  393. }
  394. }
  395. .imageBg {
  396. width: 83rpx;
  397. height: 83rpx;
  398. background: #2C2933;
  399. border-radius: 10rpx;
  400. margin-right: 20rpx;
  401. .bgTip {
  402. width: 33rpx;
  403. height: 41rpx;
  404. }
  405. }
  406. }
  407. .contentText {
  408. font-weight: 500;
  409. font-size: 29rpx;
  410. color: #FFFFFF;
  411. line-height: 46rpx;
  412. padding-left: 30rpx;
  413. padding-top: 30rpx;
  414. }
  415. .contentBox {
  416. margin-top: 30rpx;
  417. color: #FFF;
  418. border-radius: 100rpx;
  419. line-height: 1;
  420. line-height: 70rpx;
  421. .shareLink {
  422. padding: 0 30rpx;
  423. }
  424. .copy {
  425. background: linear-gradient(90deg, #7D32FF, #3EE0FF);
  426. border-radius: 100rpx;
  427. padding: 0rpx 50rpx;
  428. flex-shrink: 0;
  429. }
  430. }
  431. .listConfige {
  432. margin-top: 100rpx;
  433. color: #FFF;
  434. text-align: center;
  435. .list {
  436. width: 215rpx;
  437. height: 244rpx;
  438. border-radius: 30rpx;
  439. line-height: 1;
  440. .listImg {
  441. .imageTip {
  442. margin-top: -130rpx;
  443. margin-left: -40rpx;
  444. width: 280rpx;
  445. height: 280rpx;
  446. }
  447. }
  448. .listName {
  449. margin-top: -40rpx;
  450. font-size: 33rpx;
  451. }
  452. .listTip {
  453. margin-top: 20rpx;
  454. ont-weight: 500;
  455. font-size: 23rpx;
  456. opacity: 0.39;
  457. }
  458. .listMinName {
  459. margin-top: -60rpx;
  460. }
  461. .listMinTip {
  462. line-height: 1.5;
  463. margin-top: 20rpx;
  464. ont-weight: 400;
  465. font-size: 17rpx;
  466. opacity: 0.41;
  467. padding: 0 10rpx;
  468. }
  469. &.big {
  470. height: 287rpx;
  471. }
  472. }
  473. }
  474. .footerTitle {
  475. line-height: 1;
  476. font-weight: bold;
  477. font-size: 29rpx;
  478. color: #FFFFFF;
  479. text-align: center;
  480. }
  481. .footerImage {
  482. text-align: center;
  483. padding-bottom: 100rpx;
  484. .footerImg {
  485. width: 617rpx;
  486. height: 268rpx;
  487. }
  488. }
  489. </style>