index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  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">互娛共享</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 :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
  28. :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. </view>
  65. </template>
  66. <script>
  67. import { mapState, mapActions } from "vuex";
  68. export default {
  69. data() {
  70. return {
  71. indicatorDots: true,
  72. autoplay: true,
  73. interval: 5000,
  74. duration: 500,
  75. navList: {
  76. loadingType: 'more',
  77. orderList: [{
  78. type:'TRX',
  79. img:'../../static/shouye/shouye5.png',
  80. money:2222,
  81. fl:1,
  82. bfb:0.25,
  83. },{
  84. type:'TRX',
  85. img:'../../static/shouye/shouye6.png',
  86. money:2222,
  87. fl:0,
  88. bfb:9.25,
  89. },{
  90. type:'TRX',
  91. img:'../../static/shouye/shouye7.png',
  92. money:2222,
  93. fl:1,
  94. bfb:0.25,
  95. },{
  96. type:'TRX',
  97. img:'../../static/shouye/shouye8.png',
  98. money:2222,
  99. fl:1,
  100. bfb:0.25,
  101. },{
  102. type:'TRX',
  103. img:'../../static/shouye/shouye9.png',
  104. money:2222,
  105. fl:0,
  106. bfb:0.25,
  107. }],
  108. page: 1, //当前页数
  109. limit: 10 //每次信息条数
  110. },
  111. }
  112. },
  113. computed: {
  114. ...mapState({
  115. langList: "langList",
  116. lang: "lang",
  117. }),
  118. label() {
  119. const label = this.langList.find((item) =>{
  120. console.log(this.lang,item.value);
  121. return item.value == this.lang
  122. }).label;
  123. return label
  124. }
  125. },
  126. methods: {
  127. ...mapActions({
  128. setLang: "setLang",
  129. }),
  130. getCurrent(){
  131. let pages = getCurrentPages();
  132. let curPage = pages[pages.length - 1];
  133. return curPage
  134. },
  135. selectLang(value) {
  136. this.setLang(this.langList[value.detail.value].value);
  137. let path = '/'+this.getCurrent().route
  138. },
  139. loadData(source) {
  140. //这里是将订单挂载到tab列表下
  141. let navItem = this.navList;
  142. if (source === 'tabChange' && navItem.loaded === true) {
  143. //tab切换只有第一次需要加载数据
  144. return;
  145. }
  146. if (navItem.loadingType === 'loading') {
  147. //防止重复加载
  148. return;
  149. }
  150. // 修改当前对象状态为加载中
  151. navItem.loadingType = 'loading';
  152. getCertList({
  153. page: navItem.page,
  154. limit: navItem.limit
  155. })
  156. .then(({
  157. data
  158. }) => {
  159. let list = data.list.data;
  160. navItem.orderList = navItem.orderList.concat(list);
  161. navItem.page++;
  162. if (navItem.limit == list.length) {
  163. //判断是否还有数据, 有改为 more, 没有改为noMore
  164. navItem.loadingType = 'more';
  165. return;
  166. } else {
  167. //判断是否还有数据, 有改为 more, 没有改为noMore
  168. navItem.loadingType = 'noMore';
  169. if(navItem.orderList.length==0){
  170. uni.showModal({
  171. title: '提示',
  172. content: '您未申请证书是否立即申请',
  173. success: res => {
  174. if(res.confirm){
  175. uni.navigateTo({
  176. url:'/pages/certificate/apply'
  177. })
  178. }
  179. },
  180. fail: () => {},
  181. complete: () => {}
  182. });
  183. }
  184. }
  185. uni.hideLoading();
  186. this.$set(navItem, 'loaded', true);
  187. })
  188. .catch(e => {
  189. console.log(e);
  190. });
  191. },
  192. },
  193. }
  194. </script>
  195. <style lang="scss">
  196. .container {
  197. width: 100%;
  198. height: 1600rpx;
  199. background-color: #000000;
  200. }
  201. .top {
  202. font-family: PingFang SC;
  203. font-weight: 500;
  204. padding: 40rpx 30rpx 24rpx 30rpx;
  205. line-height: 1;
  206. .icon1 {
  207. line-height: 0;
  208. .img {
  209. width: 47rpx;
  210. height: 47rpx;
  211. }
  212. .tet {
  213. font-size: 28rpx;
  214. color: #C3A76C;
  215. }
  216. }
  217. .icon2 {
  218. background: #292C3D;
  219. border: 2px solid #414243;
  220. border-radius: 21rpx;
  221. }
  222. .langTip {
  223. width: 34rpx;
  224. height: 34rpx;
  225. }
  226. .langTipDom {
  227. width: 23rpx;
  228. height: 15rpx;
  229. }
  230. .text {
  231. font-size: 24rpx;
  232. color: #FFFFFF;
  233. padding: 10rpx 20rpx;
  234. }
  235. .text1 {
  236. font-size: 24rpx;
  237. color: #FFFFFF;
  238. }
  239. }
  240. .uni-margin-wrap {
  241. height: 394rpx;
  242. .swiper {
  243. height: 100%;
  244. .swiper-box {
  245. height: 100%;
  246. text-align: center;
  247. .swiper-item {
  248. width: 100%;
  249. height: 100%;
  250. }
  251. }
  252. }
  253. }
  254. .tra {
  255. height: 93rpx;
  256. background: #2B2A26;
  257. padding: 0 30rpx;
  258. font-size: 24rpx;
  259. color: #999999;
  260. .tra-item{
  261. width: 33.3%;
  262. }
  263. .tra-item:nth-child(2){
  264. text-align: center;
  265. }
  266. .tra-item:nth-child(3){
  267. text-align: right;
  268. }
  269. }
  270. .list {
  271. font-weight: bold;
  272. font-size: 30rpx;
  273. color: #FFFFFF;
  274. padding: 20rpx 30rpx 20rpx 30rpx;
  275. line-height: 1;
  276. border-bottom: 1px solid #2B2A26;
  277. .list-item:nth-child(2){
  278. text-align: center;
  279. }
  280. .list-item:nth-child(3){
  281. text-align: right;
  282. }
  283. .list-item {
  284. width: 33.3%;
  285. .img {
  286. width: 60rpx;
  287. height: 60rpx;
  288. }
  289. .button {
  290. padding: 10rpx 20rpx;
  291. border-radius: 10rpx;
  292. min-width: 150rpx;
  293. text-align: center;
  294. display: inline-block;
  295. &.up{
  296. background: #FB5E57;
  297. }
  298. &.dom{
  299. background: #77DA90;
  300. }
  301. }
  302. }
  303. }
  304. </style>