index.vue 12 KB

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