index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  1. <template>
  2. <view class="index-data">
  3. <view class="index-top">
  4. <view class="top-logo">
  5. <view class="logo-img">
  6. <image src="/static/img/index/index-logo.png" mode="aspectFit"></image>
  7. </view>
  8. <view class="logo-lang" @click="setShowLang">
  9. <image v-if="applicationLocale==='en'" src="/static/img/index/en.svg" mode="aspectFit"></image>
  10. <image v-else src="/static/img/index/cn.svg" mode="aspectFit"></image>
  11. <view class="lang-list" @click.stop v-show="showLang">
  12. <view class="lang-item" @click.stop="onLocaleChange('en')" :class="{'lang-item-option':applicationLocale==='en'}">
  13. <image class="image-ok" src="/static/img/index/en.svg" mode="aspectFit"></image>
  14. <image class="image-no" src="/static/img/index/en-no.svg" mode="aspectFit"></image>
  15. <view class="item-vertical"></view>
  16. <view class="item-str">English</view>
  17. </view>
  18. <view class="lang-item" @click.stop="onLocaleChange('zh-Hans')" :class="{'lang-item-option':applicationLocale==='zh-Hans'}">
  19. <image class="image-ok" src="/static/img/index/cn.svg" mode="aspectFit"></image>
  20. <image class="image-no" src="/static/img/index/cn-no.svg" mode="aspectFit"></image>
  21. <view class="item-vertical"></view>
  22. <view class="item-str">简体中文</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="top-name">
  28. <image src="/static/img/index/name.svg" mode="widthFix"></image>
  29. </view>
  30. <view class="top-bg"></view>
  31. </view>
  32. <view class="index-from">
  33. <view class="from-data">
  34. <view class="from-tab">
  35. <view class="tab-item" @click="setOptionType(1)" :class="{'option-tab':optionNum===1}" >
  36. <view class="item-content">{{$t('index.index.investment')}}</view>
  37. <view class="item-img img-left">
  38. <image src="/static/img/index/left.png" mode="heightFix"></image>
  39. </view>
  40. </view>
  41. <view class="tab-item" @click="setOptionType(2)" :class="{'option-tab':optionNum===2}" >
  42. <view class="item-content">{{$t('index.index.after')}}</view>
  43. <view class="item-img img-right">
  44. <image src="/static/img/index/right.png" mode="heightFix"></image>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="from-data">
  49. <view class="from-icon">
  50. <view class="icon-img">
  51. <image src="/static/img/index/USDT(ERC20).png" mode="aspectFill"></image>
  52. </view>
  53. <view class="icon-name">USDT(TRC20)</view>
  54. <view class="icon-icon">
  55. <image src="/static/img/index/select.svg" mode="aspectFill"></image>
  56. </view>
  57. </view>
  58. <view class="from-between"></view>
  59. <view class="from-input">
  60. <view class="input-data">
  61. <view class="data-money">{{$t('index.index.money')}}:0</view>
  62. <view class="data-input">
  63. <view>
  64. <input type="number">
  65. </view>
  66. <view> <button>MAX</button></view>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="from-but">
  71. <button>{{$t('index.index.affirm')}}</button>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. <view class="index-list">
  77. <view class="list-title">
  78. <view class="title-data">
  79. <view><image class="title-img" mode="aspectFit" src="/static/img/index/a.png"></image></view>
  80. <view class="title-str">{{$t('index.index.transaction')}}</view>
  81. </view>
  82. <view class="title-all">{{$t('index.index.all')}}>></view>
  83. </view>
  84. <view class="list-tab">
  85. <view class="tab-items">
  86. <view class="tab-item" @click="setListTab(1)" :class="{'option-tab':listTab===1}">NFT</view>
  87. <view class="tab-item" @click="setListTab(2)" :class="{'option-tab':listTab===2}">{{$t('index.index.team')}}</view>
  88. <view class="tab-item" @click="setListTab(3)" :class="{'option-tab':listTab===3}">{{$t('index.index.code')}}</view>
  89. </view>
  90. <view class="tab-item-bg" :class="{'bg-location-1':listTab===1,'bg-location-2':listTab===2,'bg-location-3':listTab===3}"></view>
  91. </view>
  92. <view class="list-data">
  93. <view class="contract-list"></view>
  94. <view class="team-list"></view>
  95. <view class="recommend-code"></view>
  96. </view>
  97. </view>
  98. </view>
  99. </template>
  100. <script>
  101. export default {
  102. components: {
  103. },
  104. data() {
  105. return {
  106. applicationLocale:'',
  107. systemLocale:'',
  108. showLang:false,
  109. optionNum:1,
  110. listTab:1
  111. }
  112. },
  113. watch: {
  114. },
  115. onLoad(query) {
  116. this.applicationLocale = uni.getLocale();
  117. },
  118. mounted() {
  119. },
  120. methods: {
  121. setShowLang(){
  122. this.showLang=true
  123. },
  124. onLocaleChange(code){
  125. uni.setLocale(code);
  126. this.$i18n.locale = code;
  127. this.applicationLocale = code;
  128. this.showLang=false
  129. },
  130. setOptionType(optionNum){
  131. if(this.optionNum!==optionNum){
  132. this.optionNum=optionNum
  133. }
  134. },
  135. setListTab(listTab){
  136. if(this.listTab!==listTab){
  137. this.listTab=listTab
  138. }
  139. },
  140. goToUrl(type){
  141. switch (type) {
  142. case 1:
  143. uni.navigateTo({
  144. 'url':'pages/contract/add'
  145. })
  146. }
  147. }
  148. },
  149. }
  150. </script>
  151. <style lang="scss" scoped>
  152. .index-data{
  153. min-height: 100vh;
  154. .index-top{
  155. height: 120px;
  156. .top-logo{
  157. height: 35px;
  158. padding:10px 16px;
  159. display: flex;
  160. justify-content: space-between;
  161. .logo-img{
  162. width: 68px;
  163. image{
  164. width: 68px;
  165. height: 29px;
  166. }
  167. }
  168. .logo-lang{
  169. height: 35px;
  170. background: rgba(241,134,134,.04);
  171. border-radius: 12px;
  172. border: 1px solid hsla(0,0%,100%,.2);
  173. position: relative;
  174. image{
  175. margin: 0 5px;
  176. height: 35px;
  177. width: 32px;
  178. }
  179. .lang-list{
  180. padding: 0 10px;
  181. position: absolute;
  182. top: 45px;
  183. right: 0;
  184. height: 100px;
  185. word-break: keep-all;
  186. background: #f6f9ff;
  187. border-radius: 13px;
  188. border: 1px solid rgba(39,127,250,.64);
  189. z-index: 99;
  190. .lang-item{
  191. height: 42px;
  192. padding: 0 10px;
  193. margin: 5px 0;
  194. border-radius: 9px;
  195. display: flex;
  196. justify-content: left;
  197. cursor: pointer;
  198. font-size: 18px;
  199. image{
  200. margin-top: 6px;
  201. width: 30px;
  202. height: 30px;
  203. }
  204. .image-ok{
  205. display: none;
  206. }
  207. .image-no{
  208. display: block;
  209. }
  210. .item-vertical{
  211. height: 20px;
  212. width: 1px;
  213. margin: 11px 5px 0 5px;
  214. background: #277ffa;
  215. }
  216. .item-str{
  217. color: #277ffa;
  218. cursor: pointer;
  219. font-size: 18px;
  220. line-height: 42px;
  221. text-align: left;
  222. margin-left: 5px;
  223. }
  224. }
  225. .lang-item-option{
  226. background: #277ffa;
  227. .image-ok{
  228. display: block;
  229. }
  230. .image-no{
  231. display: none;
  232. }
  233. .item-vertical{
  234. background: #fff;
  235. }
  236. .item-str{
  237. color: #fff;
  238. }
  239. }
  240. }
  241. }
  242. }
  243. .top-name{
  244. image{
  245. width: 100vw;
  246. }
  247. }
  248. .top-bg{
  249. height: 270px;
  250. width: 100%;
  251. position: absolute;
  252. left: 0;
  253. top: 0;
  254. overflow: hidden;
  255. z-index: -99;
  256. background: #277ffa!important;
  257. }
  258. }
  259. .index-from{
  260. padding: 6px;
  261. .from-data{
  262. background: #fff;
  263. border-radius: 30px;
  264. width: calc(100vw - 12px);
  265. .from-tab{
  266. position: relative;
  267. width: calc(100vw - 12px);
  268. border-radius: 30px 30px 0 0;
  269. background: #f7f8fa;
  270. height: 38px;
  271. display: flex;
  272. justify-content: space-between;
  273. .tab-item{
  274. width: 50%;
  275. z-index: 1;
  276. .item-content{
  277. height: 38px;
  278. line-height: 38px;
  279. color: #9197a5;
  280. font-size: 16px;
  281. cursor: pointer;
  282. text-align: center;
  283. }
  284. .item-img{
  285. display: none;
  286. z-index: -1;
  287. position: absolute;
  288. top: -2px;
  289. image{
  290. height: 38px;
  291. }
  292. }
  293. .img-left{
  294. left: 0;
  295. }
  296. .img-right{
  297. right: 0;
  298. }
  299. }
  300. .option-tab{
  301. z-index: 3;
  302. .item-content{
  303. color: #000;
  304. z-index: 5;
  305. }
  306. .item-img{
  307. display: block;
  308. }
  309. }
  310. }
  311. .from-data{
  312. border-radius: 0 0 30px 30px;
  313. padding: 20px;
  314. box-sizing: border-box;
  315. .from-icon{
  316. position: relative;
  317. height: 46px;
  318. display: flex;
  319. justify-content: left;
  320. .icon-img{
  321. margin-right: 10px;
  322. image{
  323. height: 46px;
  324. width: 46px;
  325. }
  326. }
  327. .icon-name{
  328. height: 46px;
  329. line-height: 46px;
  330. font-size: 18px;
  331. }
  332. .icon-icon{
  333. position: absolute;
  334. right: 22px;
  335. top: 13px;
  336. image{
  337. width: 20px;
  338. height: 20px;
  339. }
  340. }
  341. }
  342. .from-between{
  343. margin: 18px 0;
  344. height: 2px;
  345. background: #fbfbfd;
  346. }
  347. .from-input{
  348. box-sizing: border-box;
  349. width: 100%;
  350. height: 45px;
  351. border-radius: 17px;
  352. border: 1px solid #f2f5fa;
  353. margin-bottom: 55px;
  354. .input-data{
  355. width: calc(100% - 20px);
  356. height: 45px;
  357. padding: 10px;
  358. background: #f7f8fa;
  359. border-radius: 16px;
  360. .data-money{
  361. height: 20px;
  362. color: #6b6c70;
  363. font-size: 12px;
  364. }
  365. .data-input{
  366. display: flex;
  367. justify-content: space-between;
  368. input{
  369. height: 25px;
  370. width: 100%;
  371. border: none;
  372. font-size: 18px;
  373. background: #f7f8fa;
  374. padding: 1px 2px;
  375. }
  376. button{
  377. font-size: 12px;
  378. -webkit-text-size-adjust: none;
  379. font-weight: 800;
  380. color: #fff;
  381. width: 38px;
  382. height: 18px;
  383. padding: 2px;
  384. border-radius: 5px;
  385. line-height: 15px;
  386. margin-top: 4px;
  387. cursor: pointer;
  388. background: #277ffa;
  389. }
  390. }
  391. }
  392. }
  393. .from-but{
  394. margin-top: 18px;
  395. height: 64px;
  396. button{
  397. height: 64px;
  398. line-height: 64px;
  399. font-size: 24px;
  400. background: #277ffa;
  401. border-radius: 17px;
  402. color: #fff;
  403. }
  404. }
  405. }
  406. }
  407. }
  408. .index-list{
  409. padding:6px 16px;
  410. .list-title{
  411. display: flex;
  412. justify-content: space-between;
  413. .title-data{
  414. display: flex;
  415. justify-content: left;
  416. .title-img{
  417. width: 24px;
  418. height: 24px;
  419. }
  420. .title-str{
  421. font-size: 16px;
  422. line-height: 24px;
  423. color: #292929;
  424. margin-left: 3px;
  425. }
  426. }
  427. .title-all{
  428. font-size: 15px;
  429. font-weight: 400;
  430. color: #3184fa;
  431. cursor: pointer;
  432. padding: 5px 10px;
  433. }
  434. }
  435. .list-tab{
  436. height: 100%;
  437. background: #eaf2ff;
  438. border-radius: 36px;
  439. cursor: pointer;
  440. position: relative;
  441. .tab-items{
  442. z-index: 10;
  443. display: flex;
  444. justify-content: space-between;
  445. border-radius: 36px;
  446. .tab-item{
  447. z-index: 10;
  448. width: calc(100% / 3);
  449. font-size: 13px;
  450. color: #adbad0;
  451. display: block;
  452. height: 32px;
  453. line-height: 32px;
  454. text-align: center;
  455. }
  456. .option-tab{
  457. color: #292929;
  458. }
  459. }
  460. .tab-item-bg{
  461. position: absolute;
  462. border-radius: 36px;
  463. background: #fff;
  464. transition: .5s ease;
  465. height: 32px;
  466. width: calc(100% / 3);
  467. top: 0;
  468. }
  469. .bg-location-1{
  470. left: 0;
  471. transition: .5s ease;
  472. }
  473. .bg-location-2{
  474. left: 33.33%;
  475. transition: .5s ease;
  476. }
  477. .bg-location-3{
  478. left: 66.66%;
  479. transition: .5s ease;
  480. }
  481. }
  482. }
  483. }
  484. </style>