index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. <template>
  2. <view class="container">
  3. <view class="top flex">
  4. <view class="icon1 flex">
  5. <image src="/static/image/img01.png" style="width: 139rpx;" mode="widthFix"></image>
  6. <view class="myName">我的</view>
  7. </view>
  8. <view class="flex">
  9. <image src="/static/image/img03.png" style="width: 39rpx;margin-right: 38rpx;" mode="widthFix"></image>
  10. <image src="/static/image/img02.png" style="width: 39rpx;" mode="widthFix"></image>
  11. </view>
  12. </view>
  13. <view class="swiper-box">
  14. <u-swiper :list="swiperList" indicator indicatorMode="line" height="280rpx" circular></u-swiper>
  15. </view>
  16. <view class="flex noteBox">
  17. <view class="flex_item noteTpl">
  18. <image src="/static/image/img04.png" style="width: 42rpx;" mode="widthFix"></image>
  19. <view class="clamp textTpl">上线活动的公告等等公告内容上线活动的公告等等公告内容等上线活动的公告等等公告内容等</view>
  20. </view>
  21. <view class="tip"></view>
  22. </view>
  23. <view class="flex navList">
  24. <view class="navTpl" @click="openurl('/pages/index/recharge')">
  25. <image src="/static/image/img06.png" style="width: 123rpx;" mode="widthFix"></image>
  26. <view class="navName">充值</view>
  27. </view>
  28. <view class="navTpl" @click="openurl('/pages/index/personal')">
  29. <image src="/static/image/img07.png" style="width: 123rpx;" mode="widthFix"></image>
  30. <view class="navName">实名认证</view>
  31. </view>
  32. <view class="navTpl" @click="openurl('/pages/index/transaction')">
  33. <image src="/static/image/img08.png" style="width: 123rpx;" mode="widthFix"></image>
  34. <view class="navName">交易密码</view>
  35. </view>
  36. <view class="navTpl" @click="openurl('/pages/index/information')">
  37. <image src="/static/image/img09.png" style="width: 123rpx;" mode="widthFix"></image>
  38. <view class="navName">收款信息</view>
  39. </view>
  40. <view class="navTpl" @click="openKf">
  41. <image src="/static/image/img10.png" style="width: 123rpx;" mode="widthFix"></image>
  42. <view class="navName">联系客服</view>
  43. </view>
  44. </view>
  45. <view class="starBox flex">
  46. <view class="starTpl flex_item">
  47. <image src="/static/image/img12.png" style="width: 75rpx;" mode="widthFix"></image>
  48. <view class="starText">
  49. <view class="name">okx(欧易)</view>
  50. <view class="num">7.21</view>
  51. </view>
  52. </view>
  53. <view class="starTpl flex_item">
  54. <image src="/static/image/img13.png" style="width: 75rpx;" mode="widthFix"></image>
  55. <view class="starText">
  56. <view class="name">STAR(星空)</view>
  57. <view class="num">7.21</view>
  58. </view>
  59. </view>
  60. </view>
  61. <image src="/static/image/img11.png" style="width: 692rpx;padding-top: 31rpx;" mode="widthFix"></image>
  62. <view class="titleBox">
  63. <view class="titleTip">累计成交量</view>
  64. </view>
  65. <view class="flex totalBox">
  66. <view class="totalTpl">
  67. <view class="totalNum">10,910,000<text>USDT</text></view>
  68. <view class="totalName">累计买入</view>
  69. </view>
  70. <view class="totalTpl">
  71. <view class="totalNum">10,910,000<text>USDT</text></view>
  72. <view class="totalName">累计卖出</view>
  73. </view>
  74. </view>
  75. <view class="titleBox">
  76. <view class="titleTip">平台优势</view>
  77. </view>
  78. <view class="advantageBox flex">
  79. <view class="advantageTpl">
  80. <image src="/static/image/img16.png" style="width:149rpx;" mode="widthFix"></image>
  81. <view class="advantageName">简单</view>
  82. </view>
  83. <view class="advantageTpl">
  84. <image src="/static/image/img15.png" style="width:149rpx;" mode="widthFix"></image>
  85. <view class="advantageName">安全</view>
  86. </view>
  87. <view class="advantageTpl">
  88. <image src="/static/image/img14.png" style="width:149rpx;" mode="widthFix"></image>
  89. <view class="advantageName">省心</view>
  90. </view>
  91. <view class="advantageTpl">
  92. <image src="/static/image/img17.png" style="width:149rpx;" mode="widthFix"></image>
  93. <view class="advantageName">极速</view>
  94. </view>
  95. </view>
  96. <uni-popup
  97. ref="popupkf"
  98. type="center">
  99. <view class="popup-box">
  100. <view class="img">
  101. <image
  102. src="/static/image/img24.png"
  103. mode=""></image>
  104. </view>
  105. <view class="mian">
  106. <view class="delivery">
  107. <view class="title">已经为您定制专属客服</view>
  108. <image
  109. src="/static/image/img25.png"
  110. mode=""></image>
  111. </view>
  112. <view class="nocancel">客服VX:{{ kefu }}</view>
  113. <view class="comfirm-box">
  114. <view
  115. class="cancel"
  116. @click="cancel"
  117. >取消</view
  118. >
  119. <view
  120. class="comfirm"
  121. @click="comfirm(kefu)"
  122. >复制微信</view
  123. >
  124. </view>
  125. </view>
  126. </view>
  127. </uni-popup>
  128. </view>
  129. </template>
  130. <script>
  131. import {
  132. getIndex
  133. } from '@/api/index.js';
  134. import {
  135. getGameList,
  136. } from "@/api/game.js";
  137. import {
  138. mapState,
  139. mapActions,
  140. mapMutations
  141. } from "vuex";
  142. export default {
  143. data() {
  144. return {
  145. gameList: [],
  146. active_user: '0',
  147. swiperList:['/static/image/img05.png'],
  148. kefu:'ch125221',
  149. }
  150. },
  151. computed: {
  152. ...mapState({
  153. langList: "langList",
  154. lang: "lang",
  155. }),
  156. ...mapState('user', ['userInfo']),
  157. label() {
  158. const label = this.langList.find((item) => {
  159. console.log(this.lang, item.value);
  160. return item.value == this.lang
  161. }).label;
  162. return label
  163. }
  164. },
  165. onLoad(option) {
  166. // #ifndef MP
  167. if (option.spread) {
  168. // 存储其他邀请人
  169. uni.setStorageSync('spread', option.spread);
  170. }
  171. // #endif
  172. // #ifdef MP
  173. if (option.scene) {
  174. // 存储小程序邀请人
  175. uni.setStorage({
  176. key: 'spread_code',
  177. data: option.scene
  178. });
  179. }
  180. // #endif
  181. },
  182. onShow() {
  183. this.getGameList();
  184. this.loadData();
  185. },
  186. methods: {
  187. ...mapMutations('user', ['setUserInfo', 'login']),
  188. ...mapActions({
  189. setLang: "setLang",
  190. }),
  191. openurl(url){
  192. uni.navigateTo({
  193. url: url,
  194. fail: (err) => {
  195. uni.showModal({
  196. title: '错误',
  197. content: err,
  198. showCancel: false,
  199. });
  200. }
  201. });
  202. },
  203. // 打开客服
  204. openKf() {
  205. this.$refs.popupkf.open();
  206. },
  207. // 关闭客服
  208. cancel() {
  209. this.$refs.popupkf.close();
  210. },
  211. // 请求载入数据
  212. async loadData() {
  213. getIndex({})
  214. .then(({
  215. data
  216. }) => {
  217. this.active_user = data.active_user
  218. console.log(data);
  219. })
  220. .catch(e => {});
  221. },
  222. selectLang(value) {
  223. this.setLang(this.langList[value.detail.value].value);
  224. },
  225. getGameList() {
  226. getGameList().then((res) => {
  227. this.gameList = res.data.list;
  228. if (this.gameList.length > 2) {
  229. this.gameList = this.gameList.slice(0, 2)
  230. }
  231. })
  232. },
  233. comfirm(text) {
  234. console.log(text);
  235. const result = this.uniCopy(text);
  236. if (result === false) {
  237. uni.showToast({
  238. title: "不支持",
  239. });
  240. } else {
  241. uni.showToast({
  242. title: "复制成功",
  243. icon: "none",
  244. });
  245. }
  246. this.$refs.popupkf.close();
  247. },
  248. uniCopy(content) {
  249. /**
  250. * 小程序端 和 app端的复制逻辑
  251. */
  252. //#ifndef H5
  253. uni.setClipboardData({
  254. data: content,
  255. success: function () {
  256. console.log("success");
  257. return true;
  258. },
  259. });
  260. //#endif
  261. /**
  262. * H5端的复制逻辑
  263. */
  264. // #ifdef H5
  265. if (!document.queryCommandSupported("copy")) {
  266. //为了兼容有些浏览器 queryCommandSupported 的判断
  267. // 不支持
  268. return false;
  269. }
  270. let textarea = document.createElement("textarea");
  271. textarea.value = content;
  272. textarea.readOnly = "readOnly";
  273. document.body.appendChild(textarea);
  274. textarea.select(); // 选择对象
  275. textarea.setSelectionRange(0, content.length); //核心
  276. let result = document.execCommand("copy"); // 执行浏览器复制命令
  277. textarea.remove();
  278. return result;
  279. // #endif
  280. },
  281. },
  282. }
  283. </script>
  284. <style lang="scss">
  285. .container {
  286. width: 100%;
  287. background-color: #051137;
  288. padding: 0rpx 30rpx;
  289. padding-top: calc(60px + var(--status-bar-height));
  290. padding-bottom: 50rpx;
  291. }
  292. .top {
  293. font-weight: 500;
  294. padding: 40rpx 30rpx 24rpx 30rpx;
  295. line-height: 1;
  296. position: fixed;
  297. top: 0;
  298. left: 0;
  299. width: 100%;
  300. background: #051137;
  301. z-index: 99;
  302. .icon1 {
  303. line-height: 0;
  304. position: relative;
  305. .myName{
  306. position: absolute;
  307. right: 22rpx;
  308. font-weight: 500;
  309. font-size: 24rpx;
  310. color: #2884FF;
  311. }
  312. }
  313. }
  314. .noteBox{
  315. padding: 46rpx 0rpx;
  316. .noteTpl{
  317. color: #fff;
  318. width: 85%;
  319. .textTpl{
  320. width: calc(100% - 42rpx);
  321. font-family: PingFang SC;
  322. font-weight: 500;
  323. font-size: 26rpx;
  324. color: #FFFFFF;
  325. padding-left: 30rpx;
  326. }
  327. }
  328. .tip{
  329. width: 12rpx;
  330. height: 12rpx;
  331. background: #F7453D;
  332. border-radius: 100%;
  333. }
  334. }
  335. .navList{
  336. text-align: center;
  337. padding:15rpx 0rpx;
  338. .navTpl{
  339. .navName{
  340. padding-top: 23rpx;
  341. font-family: PingFang SC;
  342. font-weight: 500;
  343. font-size: 26rpx;
  344. color: #FFFFFF;
  345. }
  346. }
  347. }
  348. .starBox{
  349. padding-top: 43rpx;
  350. .starTpl{
  351. width: 48%;
  352. background: #1F2A4A;
  353. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50,50,52,0.06);
  354. border-radius: 20rpx;
  355. padding: 20rpx 18rpx;
  356. .starText{
  357. padding-left: 25rpx;
  358. .name{
  359. font-family: PingFang SC;
  360. font-weight: 500;
  361. font-size: 22rpx;
  362. color: #FFFFFF;
  363. line-height: 24rpx;
  364. }
  365. .num{
  366. padding-top: 15rpx;
  367. font-family: PingFang SC;
  368. font-weight: bold;
  369. font-size: 30rpx;
  370. color: #FFA235;
  371. line-height: 24rpx;
  372. }
  373. }
  374. }
  375. }
  376. .titleBox{
  377. text-align: center;
  378. padding: 45rpx 0rpx;
  379. .titleTip{
  380. flex: 1;
  381. display: flex;
  382. justify-content: center;
  383. align-items: center;
  384. height: 100%;
  385. position: relative;
  386. font-weight: bold;
  387. font-size: 42rpx;
  388. color: #FFFFFF;
  389. line-height: 110rpx;
  390. &:after {
  391. content: '';
  392. position: absolute;
  393. left: 50%;
  394. bottom: 0;
  395. transform: translateX(-50%);
  396. width: 44px;
  397. height: 0;
  398. border-bottom: 3px solid #FFFFFF;
  399. border-radius: 25rpx;
  400. }
  401. }
  402. }
  403. .totalBox{
  404. padding-top: 30rpx;
  405. .totalTpl{
  406. width: 45%;
  407. background: url('../../static/image/img18.png') no-repeat;
  408. background-size: 100% 100%;
  409. text-align: center;
  410. padding: 45rpx 0rpx;
  411. .totalNum{
  412. font-family: FZCuHeiSongS-B-GB;
  413. font-weight: 400;
  414. font-size: 39rpx;
  415. color: #66FFFF;
  416. text{
  417. font-family: PingFang SC;
  418. font-weight: 500;
  419. font-size: 22rpx;
  420. color: #66FFFF;
  421. }
  422. }
  423. .totalName{
  424. padding-top: 20rpx;
  425. font-family: Source Han Sans CN;
  426. font-weight: bold;
  427. font-size: 26rpx;
  428. color: #FFFFFF;
  429. }
  430. }
  431. }
  432. .advantageBox{
  433. padding-top: 50rpx;
  434. .advantageTpl{
  435. text-align: center;
  436. .advantageName{
  437. padding-top: 25rpx;
  438. font-family: PingFang SC;
  439. font-weight: 500;
  440. font-size: 28rpx;
  441. color: #FFFFFF;
  442. }
  443. }
  444. }
  445. .popup-box {
  446. width: 522rpx;
  447. height: 605rpx;
  448. background-color: #ffffff;
  449. border-radius: 20rpx;
  450. position: relative;
  451. .img {
  452. position: relative;
  453. top: -56rpx;
  454. left: 0;
  455. width: 522rpx;
  456. height: 132rpx;
  457. display: flex;
  458. justify-content: center;
  459. image {
  460. border-radius: 20rpx 20rpx 0 0;
  461. width: 450rpx;
  462. height: 132rpx;
  463. }
  464. }
  465. .mian {
  466. margin-top: -44rpx;
  467. display: flex;
  468. flex-direction: column;
  469. align-items: center;
  470. // padding: 32rpx 32rpx;
  471. background-color: #ffffff;
  472. border-radius: 0 0 20rpx 20rpx;
  473. text-align: center;
  474. .delivery {
  475. font-size: 40rpx;
  476. color: #333333;
  477. display: flex;
  478. align-items: center;
  479. flex-direction: column;
  480. .title {
  481. }
  482. image {
  483. margin-top: 48rpx;
  484. width: 172rpx;
  485. height: 160rpx;
  486. }
  487. }
  488. .nocancel {
  489. font-size: 32rpx;
  490. color: #333333;
  491. margin-top: 14rpx;
  492. }
  493. .comfirm-box {
  494. margin-top: 52rpx;
  495. display: flex;
  496. // margin-bottom: 32rpx;
  497. // justify-content: space-around;
  498. .cancel {
  499. display: flex;
  500. align-items: center;
  501. justify-content: center;
  502. width: 197rpx;
  503. height: 74rpx;
  504. border: 1px solid #dcc786;
  505. border-radius: 38rpx;
  506. font-size: 32rpx;
  507. color: #605128;
  508. }
  509. .comfirm {
  510. margin-left: 32rpx;
  511. display: flex;
  512. align-items: center;
  513. justify-content: center;
  514. width: 197rpx;
  515. height: 74rpx;
  516. background: linear-gradient(
  517. -90deg,
  518. #d1ba77 0%,
  519. #f7e8ad 100%
  520. );
  521. border-radius: 38px;
  522. font-size: 32rpx;
  523. color: #605128;
  524. }
  525. }
  526. }
  527. }
  528. </style>