index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. <template>
  2. <view class="container">
  3. <view class="top flex">
  4. <view class="icon1 flex" @click="openurl('/pages/user/set/set')">
  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/user/set/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/user/collection')">
  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. saveUrl,
  136. interceptor
  137. } from '@/utils/loginUtils.js';
  138. import {
  139. mapState,
  140. mapActions,
  141. mapMutations
  142. } from "vuex";
  143. export default {
  144. data() {
  145. return {
  146. gameList: [],
  147. active_user: '0',
  148. swiperList:['/static/image/img05.png'],
  149. kefu:'ch125221',
  150. }
  151. },
  152. computed: {
  153. ...mapState({
  154. langList: "langList",
  155. lang: "lang",
  156. }),
  157. ...mapState('user', ['userInfo','hasLogin']),
  158. label() {
  159. const label = this.langList.find((item) => {
  160. console.log(this.lang, item.value);
  161. return item.value == this.lang
  162. }).label;
  163. return label
  164. }
  165. },
  166. onLoad(option) {
  167. // #ifndef MP
  168. if (option.spread) {
  169. // 存储其他邀请人
  170. uni.setStorageSync('spread', option.spread);
  171. }
  172. // #endif
  173. // #ifdef MP
  174. if (option.scene) {
  175. // 存储小程序邀请人
  176. uni.setStorage({
  177. key: 'spread_code',
  178. data: option.scene
  179. });
  180. }
  181. // #endif
  182. },
  183. onShow() {
  184. this.loadData();
  185. },
  186. methods: {
  187. ...mapActions({
  188. setLang: "setLang",
  189. }),
  190. openurl(url){
  191. if(!this.hasLogin){
  192. saveUrl();
  193. interceptor();
  194. return
  195. }
  196. uni.navigateTo({
  197. url: url,
  198. fail: (err) => {
  199. uni.showModal({
  200. title: '错误',
  201. content: err,
  202. showCancel: false,
  203. });
  204. }
  205. });
  206. },
  207. // 打开客服
  208. openKf() {
  209. this.$refs.popupkf.open();
  210. },
  211. // 关闭客服
  212. cancel() {
  213. this.$refs.popupkf.close();
  214. },
  215. // 请求载入数据
  216. async loadData() {
  217. getIndex({})
  218. .then(({
  219. data
  220. }) => {
  221. this.active_user = data.active_user
  222. console.log(data);
  223. })
  224. .catch(e => {});
  225. },
  226. comfirm(text) {
  227. console.log(text);
  228. const result = this.uniCopy(text);
  229. if (result === false) {
  230. uni.showToast({
  231. title: "不支持",
  232. });
  233. } else {
  234. uni.showToast({
  235. title: "复制成功",
  236. icon: "none",
  237. });
  238. }
  239. this.$refs.popupkf.close();
  240. },
  241. uniCopy(content) {
  242. /**
  243. * 小程序端 和 app端的复制逻辑
  244. */
  245. //#ifndef H5
  246. uni.setClipboardData({
  247. data: content,
  248. success: function () {
  249. console.log("success");
  250. return true;
  251. },
  252. });
  253. //#endif
  254. /**
  255. * H5端的复制逻辑
  256. */
  257. // #ifdef H5
  258. if (!document.queryCommandSupported("copy")) {
  259. //为了兼容有些浏览器 queryCommandSupported 的判断
  260. // 不支持
  261. return false;
  262. }
  263. let textarea = document.createElement("textarea");
  264. textarea.value = content;
  265. textarea.readOnly = "readOnly";
  266. document.body.appendChild(textarea);
  267. textarea.select(); // 选择对象
  268. textarea.setSelectionRange(0, content.length); //核心
  269. let result = document.execCommand("copy"); // 执行浏览器复制命令
  270. textarea.remove();
  271. return result;
  272. // #endif
  273. },
  274. },
  275. }
  276. </script>
  277. <style lang="scss">
  278. .container {
  279. width: 100%;
  280. background-color: #051137;
  281. padding: 0rpx 30rpx;
  282. padding-top: calc(60px + var(--status-bar-height));
  283. padding-bottom: 50rpx;
  284. }
  285. .top {
  286. font-weight: 500;
  287. padding: 40rpx 30rpx 24rpx 30rpx;
  288. line-height: 1;
  289. position: fixed;
  290. top: 0;
  291. left: 0;
  292. width: 100%;
  293. background: #051137;
  294. z-index: 99;
  295. .icon1 {
  296. line-height: 0;
  297. position: relative;
  298. .myName{
  299. position: absolute;
  300. right: 22rpx;
  301. font-weight: 500;
  302. font-size: 24rpx;
  303. color: #2884FF;
  304. }
  305. }
  306. }
  307. .noteBox{
  308. padding: 46rpx 0rpx;
  309. .noteTpl{
  310. color: #fff;
  311. width: 85%;
  312. .textTpl{
  313. width: calc(100% - 42rpx);
  314. font-family: PingFang SC;
  315. font-weight: 500;
  316. font-size: 26rpx;
  317. color: #FFFFFF;
  318. padding-left: 30rpx;
  319. }
  320. }
  321. .tip{
  322. width: 12rpx;
  323. height: 12rpx;
  324. background: #F7453D;
  325. border-radius: 100%;
  326. }
  327. }
  328. .navList{
  329. text-align: center;
  330. padding:15rpx 0rpx;
  331. .navTpl{
  332. .navName{
  333. padding-top: 23rpx;
  334. font-family: PingFang SC;
  335. font-weight: 500;
  336. font-size: 26rpx;
  337. color: #FFFFFF;
  338. }
  339. }
  340. }
  341. .starBox{
  342. padding-top: 43rpx;
  343. .starTpl{
  344. width: 48%;
  345. background: #1F2A4A;
  346. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50,50,52,0.06);
  347. border-radius: 20rpx;
  348. padding: 20rpx 18rpx;
  349. .starText{
  350. padding-left: 25rpx;
  351. .name{
  352. font-family: PingFang SC;
  353. font-weight: 500;
  354. font-size: 22rpx;
  355. color: #FFFFFF;
  356. line-height: 24rpx;
  357. }
  358. .num{
  359. padding-top: 15rpx;
  360. font-family: PingFang SC;
  361. font-weight: bold;
  362. font-size: 30rpx;
  363. color: #FFA235;
  364. line-height: 24rpx;
  365. }
  366. }
  367. }
  368. }
  369. .titleBox{
  370. text-align: center;
  371. padding: 45rpx 0rpx;
  372. .titleTip{
  373. flex: 1;
  374. display: flex;
  375. justify-content: center;
  376. align-items: center;
  377. height: 100%;
  378. position: relative;
  379. font-weight: bold;
  380. font-size: 42rpx;
  381. color: #FFFFFF;
  382. line-height: 110rpx;
  383. &:after {
  384. content: '';
  385. position: absolute;
  386. left: 50%;
  387. bottom: 0;
  388. transform: translateX(-50%);
  389. width: 44px;
  390. height: 0;
  391. border-bottom: 3px solid #FFFFFF;
  392. border-radius: 25rpx;
  393. }
  394. }
  395. }
  396. .totalBox{
  397. padding-top: 30rpx;
  398. .totalTpl{
  399. width: 45%;
  400. background: url('../../static/image/img18.png') no-repeat;
  401. background-size: 100% 100%;
  402. text-align: center;
  403. padding: 45rpx 0rpx;
  404. .totalNum{
  405. font-family: FZCuHeiSongS-B-GB;
  406. font-weight: 400;
  407. font-size: 39rpx;
  408. color: #66FFFF;
  409. text{
  410. font-family: PingFang SC;
  411. font-weight: 500;
  412. font-size: 22rpx;
  413. color: #66FFFF;
  414. }
  415. }
  416. .totalName{
  417. padding-top: 20rpx;
  418. font-family: Source Han Sans CN;
  419. font-weight: bold;
  420. font-size: 26rpx;
  421. color: #FFFFFF;
  422. }
  423. }
  424. }
  425. .advantageBox{
  426. padding-top: 50rpx;
  427. .advantageTpl{
  428. text-align: center;
  429. .advantageName{
  430. padding-top: 25rpx;
  431. font-family: PingFang SC;
  432. font-weight: 500;
  433. font-size: 28rpx;
  434. color: #FFFFFF;
  435. }
  436. }
  437. }
  438. .popup-box {
  439. width: 522rpx;
  440. height: 605rpx;
  441. background-color: #ffffff;
  442. border-radius: 20rpx;
  443. position: relative;
  444. .img {
  445. position: relative;
  446. top: -56rpx;
  447. left: 0;
  448. width: 522rpx;
  449. height: 132rpx;
  450. display: flex;
  451. justify-content: center;
  452. image {
  453. border-radius: 20rpx 20rpx 0 0;
  454. width: 450rpx;
  455. height: 132rpx;
  456. }
  457. }
  458. .mian {
  459. margin-top: -44rpx;
  460. display: flex;
  461. flex-direction: column;
  462. align-items: center;
  463. // padding: 32rpx 32rpx;
  464. background-color: #ffffff;
  465. border-radius: 0 0 20rpx 20rpx;
  466. text-align: center;
  467. .delivery {
  468. font-size: 40rpx;
  469. color: #333333;
  470. display: flex;
  471. align-items: center;
  472. flex-direction: column;
  473. .title {
  474. }
  475. image {
  476. margin-top: 48rpx;
  477. width: 172rpx;
  478. height: 160rpx;
  479. }
  480. }
  481. .nocancel {
  482. font-size: 32rpx;
  483. color: #333333;
  484. margin-top: 14rpx;
  485. }
  486. .comfirm-box {
  487. margin-top: 52rpx;
  488. display: flex;
  489. // margin-bottom: 32rpx;
  490. // justify-content: space-around;
  491. .cancel {
  492. display: flex;
  493. align-items: center;
  494. justify-content: center;
  495. width: 197rpx;
  496. height: 74rpx;
  497. border: 1px solid #dcc786;
  498. border-radius: 38rpx;
  499. font-size: 32rpx;
  500. color: #605128;
  501. }
  502. .comfirm {
  503. margin-left: 32rpx;
  504. display: flex;
  505. align-items: center;
  506. justify-content: center;
  507. width: 197rpx;
  508. height: 74rpx;
  509. background: linear-gradient(
  510. -90deg,
  511. #d1ba77 0%,
  512. #f7e8ad 100%
  513. );
  514. border-radius: 38px;
  515. font-size: 32rpx;
  516. color: #605128;
  517. }
  518. }
  519. }
  520. }
  521. </style>