index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. <template>
  2. <view class="container">
  3. <view class="top flex">
  4. <view class="icon1 flex">
  5. <image class="img margin-r-10" src="../../static/shouye/shouye1.png" mode="scaleToFill"></image>
  6. <text class="tet">{{$t('login.a0')}}</text>
  7. </view>
  8. <view class="flex">
  9. <view class="icon2 text margin-r-10">
  10. oxs***23b
  11. </view>
  12. <view class="icon1 margin-r-10">
  13. <image class="langTip" src="../../static/shouye/shouye2.png" mode="scaleToFill"></image>
  14. </view>
  15. <view class="text1 margin-r-10">
  16. <picker :range="langList" range-key='label' @change="selectLang">
  17. <view>{{label}}</view>
  18. </picker>
  19. </view>
  20. <view class="icon1">
  21. <image class="langTipDom" src="../../static/shouye/shouye3.png" mode="scaleToFill"></image>
  22. </view>
  23. </view>
  24. </view>
  25. <!-- 轮播图 -->
  26. <view class="uni-margin-wrap margin-b-10">
  27. <swiper indicator-color='rgba(255,255,255,0.69)' indicator-active-color='#FFF' class="swiper" circular
  28. :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
  29. <swiper-item class="swiper-box">
  30. <image class="swiper-item" src="../../static/shouye/shouye4.png" mode="scaleToFill"></image>
  31. </swiper-item>
  32. <swiper-item class="swiper-box">
  33. <image class="swiper-item" src="../../static/shouye/shouye4.png" mode="scaleToFill"></image>
  34. </swiper-item>
  35. </swiper>
  36. </view>
  37. <!-- 底部 -->
  38. <view class="tra flex margin-b-10">
  39. <view class="tra-item">
  40. {{$t('home.b8')}}
  41. </view>
  42. <view class="tra-item">
  43. {{$t('home.k1')}}
  44. </view>
  45. <view class="tra-item">
  46. {{$t('home.b0')}}
  47. </view>
  48. </view>
  49. <!-- 每一项 -->
  50. <view class="list flex" v-for="(item,ind) in navList.orderList">
  51. <view class="list-item flex-start">
  52. <image class="img margin-r-10" :src="item.img" mode="scaleToFill"> </image>
  53. <text class="tli">TRX</text>
  54. </view>
  55. <view class="list-item">
  56. 29385.97
  57. </view>
  58. <view class="list-item ">
  59. <text class="button" :class="{up:item.fl==1,dom:item.fl==0}">
  60. {{item.fl==1?'+':'-'}} {{item.bfb}}%
  61. </text>
  62. </view>
  63. </view>
  64. <taber tab='index'></taber>
  65. </view>
  66. </template>
  67. <script>
  68. import {prices} from "@/api/index.js"
  69. import {
  70. mapState,
  71. mapActions
  72. } from "vuex";
  73. import taber from "@/components/footer/footer.vue";
  74. export default {
  75. components: {
  76. taber
  77. },
  78. data() {
  79. return {
  80. indicatorDots: true,
  81. autoplay: true,
  82. interval: 5000,
  83. duration: 500,
  84. navList: {
  85. loadingType: 'more',
  86. orderList: [{
  87. type: 'BTC',
  88. img: '../../static/shouye/shouye5.png',
  89. money: 2222,
  90. fl: 1,
  91. bfb: 0.25,
  92. }, {
  93. type: 'BTC',
  94. img: '../../static/shouye/shouye6.png',
  95. money: 2222,
  96. fl: 0,
  97. bfb: 9.25,
  98. }, {
  99. type: 'ETH',
  100. img: '../../static/shouye/shouye7.png',
  101. money: 2222,
  102. fl: 1,
  103. bfb: 0.25,
  104. }, {
  105. type: 'BNB',
  106. img: '../../static/shouye/shouye8.png',
  107. money: 2222,
  108. fl: 1,
  109. bfb: 0.25,
  110. }, {
  111. type: 'LTC',
  112. img: '../../static/shouye/shouye9.png',
  113. money: 2222,
  114. fl: 0,
  115. bfb: 0.25,
  116. }],
  117. page: 1, //当前页数
  118. limit: 10 //每次信息条数
  119. },
  120. }
  121. },
  122. computed: {
  123. ...mapState({
  124. langList: "langList",
  125. lang: "lang",
  126. }),
  127. label() {
  128. const label = this.langList.find((item) => {
  129. console.log(this.lang, item.value);
  130. return item.value == this.lang
  131. }).label;
  132. return label
  133. }
  134. },
  135. onLoad() {
  136. this.prices()
  137. },
  138. methods: {
  139. ...mapActions({
  140. setLang: "setLang",
  141. }),
  142. async prices() {
  143. const res = await prices();
  144. console.log('123', res);
  145. },
  146. getCurrent() {
  147. let pages = getCurrentPages();
  148. let curPage = pages[pages.length - 1];
  149. return curPage
  150. },
  151. selectLang(value) {
  152. this.setLang(this.langList[value.detail.value].value);
  153. let path = '/' + this.getCurrent().route
  154. },
  155. loadData(source) {
  156. //这里是将订单挂载到tab列表下
  157. let navItem = this.navList;
  158. if (source === 'tabChange' && navItem.loaded === true) {
  159. //tab切换只有第一次需要加载数据
  160. return;
  161. }
  162. if (navItem.loadingType === 'loading') {
  163. //防止重复加载
  164. return;
  165. }
  166. // 修改当前对象状态为加载中
  167. navItem.loadingType = 'loading';
  168. getCertList({
  169. page: navItem.page,
  170. limit: navItem.limit
  171. })
  172. // prices({
  173. // page: navItem.page,
  174. // limit: navItem.limit
  175. // })
  176. .then(({
  177. data
  178. }) => {
  179. console.log(data, '111');
  180. // TODO
  181. let list = data.list.data;
  182. navItem.orderList = navItem.orderList.concat(list);
  183. navItem.page++;
  184. if (navItem.limit == list.length) {
  185. //判断是否还有数据, 有改为 more, 没有改为noMore
  186. navItem.loadingType = 'more';
  187. return;
  188. } else {
  189. //判断是否还有数据, 有改为 more, 没有改为noMore
  190. navItem.loadingType = 'noMore';
  191. if (navItem.orderList.length == 0) {
  192. uni.showModal({
  193. title: '提示',
  194. content: '您未申请证书是否立即申请',
  195. success: res => {
  196. if (res.confirm) {
  197. uni.navigateTo({
  198. url: '/pages/certificate/apply'
  199. })
  200. }
  201. },
  202. fail: () => {},
  203. complete: () => {}
  204. });
  205. }
  206. }
  207. uni.hideLoading();
  208. this.$set(navItem, 'loaded', true);
  209. })
  210. .catch(e => {
  211. console.log(e);
  212. });
  213. },
  214. },
  215. }
  216. </script>
  217. <style lang="scss">
  218. .container {
  219. width: 100%;
  220. height: 1600rpx;
  221. background-color: #000000;
  222. padding-top: var(--status-bar-height);
  223. }
  224. .top {
  225. font-weight: 500;
  226. padding: 40rpx 30rpx 24rpx 30rpx;
  227. line-height: 1;
  228. .icon1 {
  229. line-height: 0;
  230. .img {
  231. width: 47rpx;
  232. height: 47rpx;
  233. }
  234. .tet {
  235. font-size: 28rpx;
  236. color: #C3A76C;
  237. }
  238. }
  239. .icon2 {
  240. background: #292C3D;
  241. border: 2px solid #414243;
  242. border-radius: 21rpx;
  243. }
  244. .langTip {
  245. width: 34rpx;
  246. height: 34rpx;
  247. }
  248. .langTipDom {
  249. width: 23rpx;
  250. height: 15rpx;
  251. }
  252. .text {
  253. font-size: 24rpx;
  254. color: #FFFFFF;
  255. padding: 10rpx 20rpx;
  256. }
  257. .text1 {
  258. font-size: 24rpx;
  259. color: #FFFFFF;
  260. }
  261. }
  262. .uni-margin-wrap {
  263. height: 394rpx;
  264. .swiper {
  265. height: 100%;
  266. .swiper-box {
  267. height: 100%;
  268. text-align: center;
  269. .swiper-item {
  270. width: 100%;
  271. height: 100%;
  272. }
  273. }
  274. }
  275. }
  276. .tra {
  277. height: 93rpx;
  278. background: #2B2A26;
  279. padding: 0 30rpx;
  280. font-size: 24rpx;
  281. color: #999999;
  282. .tra-item {
  283. width: 33.3%;
  284. }
  285. .tra-item:nth-child(2) {
  286. text-align: center;
  287. }
  288. .tra-item:nth-child(3) {
  289. text-align: right;
  290. }
  291. }
  292. .list {
  293. font-weight: bold;
  294. font-size: 30rpx;
  295. color: #FFFFFF;
  296. padding: 20rpx 30rpx 20rpx 30rpx;
  297. line-height: 1;
  298. border-bottom: 1px solid #2B2A26;
  299. .list-item:nth-child(2) {
  300. text-align: center;
  301. }
  302. .list-item:nth-child(3) {
  303. text-align: right;
  304. }
  305. .list-item {
  306. width: 33.3%;
  307. .img {
  308. width: 60rpx;
  309. height: 60rpx;
  310. }
  311. .button {
  312. padding: 10rpx 20rpx;
  313. border-radius: 10rpx;
  314. min-width: 150rpx;
  315. text-align: center;
  316. display: inline-block;
  317. &.up {
  318. background: #FB5E57;
  319. }
  320. &.dom {
  321. background: #77DA90;
  322. }
  323. }
  324. }
  325. }
  326. </style>