index.vue 13 KB

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