index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  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.loadData()
  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. let list = data.list.data;
  181. navItem.orderList = navItem.orderList.concat(list);
  182. navItem.page++;
  183. if (navItem.limit == list.length) {
  184. //判断是否还有数据, 有改为 more, 没有改为noMore
  185. navItem.loadingType = 'more';
  186. return;
  187. } else {
  188. //判断是否还有数据, 有改为 more, 没有改为noMore
  189. navItem.loadingType = 'noMore';
  190. if (navItem.orderList.length == 0) {
  191. uni.showModal({
  192. title: '提示',
  193. content: '您未申请证书是否立即申请',
  194. success: res => {
  195. if (res.confirm) {
  196. uni.navigateTo({
  197. url: '/pages/certificate/apply'
  198. })
  199. }
  200. },
  201. fail: () => {},
  202. complete: () => {}
  203. });
  204. }
  205. }
  206. uni.hideLoading();
  207. this.$set(navItem, 'loaded', true);
  208. })
  209. .catch(e => {
  210. console.log(e);
  211. });
  212. },
  213. },
  214. }
  215. </script>
  216. <style lang="scss">
  217. .container {
  218. width: 100%;
  219. height: 1600rpx;
  220. background-color: #000000;
  221. padding-top: var(--status-bar-height);
  222. }
  223. .top {
  224. font-weight: 500;
  225. padding: 40rpx 30rpx 24rpx 30rpx;
  226. line-height: 1;
  227. .icon1 {
  228. line-height: 0;
  229. .img {
  230. width: 47rpx;
  231. height: 47rpx;
  232. }
  233. .tet {
  234. font-size: 28rpx;
  235. color: #C3A76C;
  236. }
  237. }
  238. .icon2 {
  239. background: #292C3D;
  240. border: 2px solid #414243;
  241. border-radius: 21rpx;
  242. }
  243. .langTip {
  244. width: 34rpx;
  245. height: 34rpx;
  246. }
  247. .langTipDom {
  248. width: 23rpx;
  249. height: 15rpx;
  250. }
  251. .text {
  252. font-size: 24rpx;
  253. color: #FFFFFF;
  254. padding: 10rpx 20rpx;
  255. }
  256. .text1 {
  257. font-size: 24rpx;
  258. color: #FFFFFF;
  259. }
  260. }
  261. .uni-margin-wrap {
  262. height: 394rpx;
  263. .swiper {
  264. height: 100%;
  265. .swiper-box {
  266. height: 100%;
  267. text-align: center;
  268. .swiper-item {
  269. width: 100%;
  270. height: 100%;
  271. }
  272. }
  273. }
  274. }
  275. .tra {
  276. height: 93rpx;
  277. background: #2B2A26;
  278. padding: 0 30rpx;
  279. font-size: 24rpx;
  280. color: #999999;
  281. .tra-item {
  282. width: 33.3%;
  283. }
  284. .tra-item:nth-child(2) {
  285. text-align: center;
  286. }
  287. .tra-item:nth-child(3) {
  288. text-align: right;
  289. }
  290. }
  291. .list {
  292. font-weight: bold;
  293. font-size: 30rpx;
  294. color: #FFFFFF;
  295. padding: 20rpx 30rpx 20rpx 30rpx;
  296. line-height: 1;
  297. border-bottom: 1px solid #2B2A26;
  298. .list-item:nth-child(2) {
  299. text-align: center;
  300. }
  301. .list-item:nth-child(3) {
  302. text-align: right;
  303. }
  304. .list-item {
  305. width: 33.3%;
  306. .img {
  307. width: 60rpx;
  308. height: 60rpx;
  309. }
  310. .button {
  311. padding: 10rpx 20rpx;
  312. border-radius: 10rpx;
  313. min-width: 150rpx;
  314. text-align: center;
  315. display: inline-block;
  316. &.up {
  317. background: #FB5E57;
  318. }
  319. &.dom {
  320. background: #77DA90;
  321. }
  322. }
  323. }
  324. }
  325. </style>