index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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. getCurrent() {
  143. let pages = getCurrentPages();
  144. let curPage = pages[pages.length - 1];
  145. return curPage
  146. },
  147. selectLang(value) {
  148. this.setLang(this.langList[value.detail.value].value);
  149. let path = '/' + this.getCurrent().route
  150. },
  151. loadData(source) {
  152. //这里是将订单挂载到tab列表下
  153. let navItem = this.navList;
  154. if (source === 'tabChange' && navItem.loaded === true) {
  155. //tab切换只有第一次需要加载数据
  156. return;
  157. }
  158. if (navItem.loadingType === 'loading') {
  159. //防止重复加载
  160. return;
  161. }
  162. // 修改当前对象状态为加载中
  163. navItem.loadingType = 'loading';
  164. // getCertList({
  165. // page: navItem.page,
  166. // limit: navItem.limit
  167. // })
  168. prices({
  169. page: navItem.page,
  170. limit: navItem.limit
  171. })
  172. .then(({
  173. data
  174. }) => {
  175. console.log(data, '111');
  176. let list = data.list.data;
  177. navItem.orderList = navItem.orderList.concat(list);
  178. navItem.page++;
  179. if (navItem.limit == list.length) {
  180. //判断是否还有数据, 有改为 more, 没有改为noMore
  181. navItem.loadingType = 'more';
  182. return;
  183. } else {
  184. //判断是否还有数据, 有改为 more, 没有改为noMore
  185. navItem.loadingType = 'noMore';
  186. if (navItem.orderList.length == 0) {
  187. uni.showModal({
  188. title: '提示',
  189. content: '您未申请证书是否立即申请',
  190. success: res => {
  191. if (res.confirm) {
  192. uni.navigateTo({
  193. url: '/pages/certificate/apply'
  194. })
  195. }
  196. },
  197. fail: () => {},
  198. complete: () => {}
  199. });
  200. }
  201. }
  202. uni.hideLoading();
  203. this.$set(navItem, 'loaded', true);
  204. })
  205. .catch(e => {
  206. console.log(e);
  207. });
  208. },
  209. },
  210. }
  211. </script>
  212. <style lang="scss">
  213. .container {
  214. width: 100%;
  215. height: 1600rpx;
  216. background-color: #000000;
  217. padding-top: var(--status-bar-height);
  218. }
  219. .top {
  220. font-weight: 500;
  221. padding: 40rpx 30rpx 24rpx 30rpx;
  222. line-height: 1;
  223. .icon1 {
  224. line-height: 0;
  225. .img {
  226. width: 47rpx;
  227. height: 47rpx;
  228. }
  229. .tet {
  230. font-size: 28rpx;
  231. color: #C3A76C;
  232. }
  233. }
  234. .icon2 {
  235. background: #292C3D;
  236. border: 2px solid #414243;
  237. border-radius: 21rpx;
  238. }
  239. .langTip {
  240. width: 34rpx;
  241. height: 34rpx;
  242. }
  243. .langTipDom {
  244. width: 23rpx;
  245. height: 15rpx;
  246. }
  247. .text {
  248. font-size: 24rpx;
  249. color: #FFFFFF;
  250. padding: 10rpx 20rpx;
  251. }
  252. .text1 {
  253. font-size: 24rpx;
  254. color: #FFFFFF;
  255. }
  256. }
  257. .uni-margin-wrap {
  258. height: 394rpx;
  259. .swiper {
  260. height: 100%;
  261. .swiper-box {
  262. height: 100%;
  263. text-align: center;
  264. .swiper-item {
  265. width: 100%;
  266. height: 100%;
  267. }
  268. }
  269. }
  270. }
  271. .tra {
  272. height: 93rpx;
  273. background: #2B2A26;
  274. padding: 0 30rpx;
  275. font-size: 24rpx;
  276. color: #999999;
  277. .tra-item {
  278. width: 33.3%;
  279. }
  280. .tra-item:nth-child(2) {
  281. text-align: center;
  282. }
  283. .tra-item:nth-child(3) {
  284. text-align: right;
  285. }
  286. }
  287. .list {
  288. font-weight: bold;
  289. font-size: 30rpx;
  290. color: #FFFFFF;
  291. padding: 20rpx 30rpx 20rpx 30rpx;
  292. line-height: 1;
  293. border-bottom: 1px solid #2B2A26;
  294. .list-item:nth-child(2) {
  295. text-align: center;
  296. }
  297. .list-item:nth-child(3) {
  298. text-align: right;
  299. }
  300. .list-item {
  301. width: 33.3%;
  302. .img {
  303. width: 60rpx;
  304. height: 60rpx;
  305. }
  306. .button {
  307. padding: 10rpx 20rpx;
  308. border-radius: 10rpx;
  309. min-width: 150rpx;
  310. text-align: center;
  311. display: inline-block;
  312. &.up {
  313. background: #FB5E57;
  314. }
  315. &.dom {
  316. background: #77DA90;
  317. }
  318. }
  319. }
  320. }
  321. </style>