Преглед изворни кода

Merge branch 'master' of http://git.liuniu946.com/zhang/jingcai

zhang пре 1 година
родитељ
комит
9bf50e892a
6 измењених фајлова са 288 додато и 223 уклоњено
  1. 5 5
      components/footer/list.js
  2. 8 1
      libs/i18n/lang/cn.json
  3. 5 1
      libs/i18n/lang/en.json
  4. 6 1
      libs/i18n/lang/tw.json
  5. 85 69
      pages/index/index.vue
  6. 179 146
      pages/index/pledge.vue

+ 5 - 5
components/footer/list.js

@@ -1,32 +1,32 @@
 export function navList(that) {
   return [
     {
-      label: "base.d0",
+      label: "home.d0",
       tel: "index",
       icon: "static/tabBar/shouye.png",
       activeIcon: "static/tabBar/shouye-home.png",
     },
    
     {
-      label: "base.a3",
+      label: "home.d1",
       tel: "pledge",
       icon: "static/tabBar/baoya.png",
       activeIcon: "static/tabBar/baoya-home.png",
     },
 	{
-	  label: "exchange.a0",
+	  label: "home.d2",
 	  tel: "entertainment",
 	  icon: "static/tabBar/huyu.png",
 	  activeIcon: "static/tabBar/huyu-home.png",
 	},
     {
-      label: "exchange.a2",
+      label: "home.d3",
       tel: "information",
       icon: "static/tabBar/zixun.png",
       activeIcon: "static/tabBar/zixun-home.png",
     },
     {
-      label: "base.d2",
+      label: "home.d4",
       tel: "user",
       icon: "static/tabBar/my.png",
       activeIcon: "static/tabBar/my-home.png",

+ 8 - 1
libs/i18n/lang/cn.json

@@ -3,7 +3,14 @@
 		"k1": "最新价格",
 		"b0": "24H涨跌幅",
 		"b8": "名称",
-		"d0": "首页"
+		"d0": "首页",
+		"d1": "质押",
+		"d2": "互娱",
+		"d3": "资讯",
+		"d4": "我的"
+	},
+	"pledge":{
+		
 	},
 	"add": {
 		"kt": "Airdrop",

+ 5 - 1
libs/i18n/lang/en.json

@@ -3,7 +3,11 @@
 		"k1": "Latest Price",
 		"b0": "24H Rise and fall",
 		"b8": "Type",
-		"d0": "Home"
+		"d0": "Home",
+		"d1": "Pledge",
+		"d2": "Game",
+		"d3": "News",
+		"d4": "My"
 	},
 	"add": {
 		"kt": "Airdrop",

+ 6 - 1
libs/i18n/lang/tw.json

@@ -3,7 +3,12 @@
 		"k1": "最新價格",
 		"b0": "24H漲跌幅",
 		"b8": "名稱",
-		"d0": "首頁"
+		"d0": "首頁",
+		"d1": "質押",
+		"d2": "互娛",
+		"d3": "資訊",
+		"d4": "我的"
+		
 	},
 	"add": {
 		"ck": "存款",

+ 85 - 69
pages/index/index.vue

@@ -25,12 +25,12 @@
 
 		<!-- 轮播图 -->
 		<view class="uni-margin-wrap margin-b-10">
-			<swiper indicator-color='rgba(255,255,255,0.69)' indicator-active-color='#FFF' class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
-				:duration="duration">
+			<swiper indicator-color='rgba(255,255,255,0.69)' indicator-active-color='#FFF' class="swiper" circular
+				:indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
 				<swiper-item class="swiper-box">
 					<image class="swiper-item" src="../../static/shouye/shouye4.png" mode="scaleToFill"></image>
 				</swiper-item>
-				<swiper-item  class="swiper-box">
+				<swiper-item class="swiper-box">
 					<image class="swiper-item" src="../../static/shouye/shouye4.png" mode="scaleToFill"></image>
 				</swiper-item>
 			</swiper>
@@ -57,7 +57,7 @@
 				29385.97
 			</view>
 			<view class="list-item ">
-				<text class="button"  :class="{up:item.fl==1,dom:item.fl==0}">
+				<text class="button" :class="{up:item.fl==1,dom:item.fl==0}">
 					{{item.fl==1?'+':'-'}} {{item.bfb}}%
 				</text>
 			</view>
@@ -66,7 +66,10 @@
 	</view>
 </template>
 <script>
-	import { mapState, mapActions } from "vuex";
+	import {
+		mapState,
+		mapActions
+	} from "vuex";
 	import taber from "@/components/footer/footer.vue";
 	export default {
 		components: {
@@ -81,35 +84,35 @@
 				navList: {
 					loadingType: 'more',
 					orderList: [{
-						type:'TRX',
-						img:'../../static/shouye/shouye5.png',
-						money:2222,
-						fl:1,
-						bfb:0.25,
-					},{
-						type:'TRX',
-						img:'../../static/shouye/shouye6.png',
-						money:2222,
-						fl:0,
-						bfb:9.25,
-					},{
-						type:'TRX',
-						img:'../../static/shouye/shouye7.png',
-						money:2222,
-						fl:1,
-						bfb:0.25,
-					},{
-						type:'TRX',
-						img:'../../static/shouye/shouye8.png',
-						money:2222,
-						fl:1,
-						bfb:0.25,
-					},{
-						type:'TRX',
-						img:'../../static/shouye/shouye9.png',
-						money:2222,
-						fl:0,
-						bfb:0.25,
+						type: 'TRX',
+						img: '../../static/shouye/shouye5.png',
+						money: 2222,
+						fl: 1,
+						bfb: 0.25,
+					}, {
+						type: 'TRX',
+						img: '../../static/shouye/shouye6.png',
+						money: 2222,
+						fl: 0,
+						bfb: 9.25,
+					}, {
+						type: 'TRX',
+						img: '../../static/shouye/shouye7.png',
+						money: 2222,
+						fl: 1,
+						bfb: 0.25,
+					}, {
+						type: 'TRX',
+						img: '../../static/shouye/shouye8.png',
+						money: 2222,
+						fl: 1,
+						bfb: 0.25,
+					}, {
+						type: 'TRX',
+						img: '../../static/shouye/shouye9.png',
+						money: 2222,
+						fl: 0,
+						bfb: 0.25,
 					}],
 					page: 1, //当前页数
 					limit: 10 //每次信息条数
@@ -117,32 +120,32 @@
 			}
 		},
 		computed: {
-		  ...mapState({
-		    langList: "langList",
-		    lang: "lang",
-		  }),
-		  label() {
-			  const label = this.langList.find((item) =>{ 
-				  console.log(this.lang,item.value);
-				return  item.value == this.lang
+			...mapState({
+				langList: "langList",
+				lang: "lang",
+			}),
+			label() {
+				const label = this.langList.find((item) => {
+					console.log(this.lang, item.value);
+					return item.value == this.lang
 				}).label;
-		    return label
-		  }
+				return label
+			}
 		},
 		methods: {
-			  ...mapActions({
-			    setLang: "setLang",
-			  }),
-			  getCurrent(){
-			      let pages = getCurrentPages();
-			      let curPage = pages[pages.length - 1];
-			      return curPage
-			  },
-			  selectLang(value) {
-			    this.setLang(this.langList[value.detail.value].value);
-			    let path = '/'+this.getCurrent().route
-			  },
-			
+			...mapActions({
+				setLang: "setLang",
+			}),
+			getCurrent() {
+				let pages = getCurrentPages();
+				let curPage = pages[pages.length - 1];
+				return curPage
+			},
+			selectLang(value) {
+				this.setLang(this.langList[value.detail.value].value);
+				let path = '/' + this.getCurrent().route
+			},
+
 			loadData(source) {
 				//这里是将订单挂载到tab列表下
 				let navItem = this.navList;
@@ -173,14 +176,14 @@
 						} else {
 							//判断是否还有数据, 有改为 more, 没有改为noMore
 							navItem.loadingType = 'noMore';
-							if(navItem.orderList.length==0){
+							if (navItem.orderList.length == 0) {
 								uni.showModal({
 									title: '提示',
 									content: '您未申请证书是否立即申请',
 									success: res => {
-										if(res.confirm){
+										if (res.confirm) {
 											uni.navigateTo({
-												url:'/pages/certificate/apply'
+												url: '/pages/certificate/apply'
 											})
 										}
 									},
@@ -257,11 +260,14 @@
 
 	.uni-margin-wrap {
 		height: 394rpx;
+
 		.swiper {
 			height: 100%;
+
 			.swiper-box {
 				height: 100%;
 				text-align: center;
+
 				.swiper-item {
 					width: 100%;
 					height: 100%;
@@ -269,22 +275,27 @@
 			}
 		}
 	}
+
 	.tra {
 		height: 93rpx;
 		background: #2B2A26;
 		padding: 0 30rpx;
 		font-size: 24rpx;
 		color: #999999;
-		.tra-item{
+
+		.tra-item {
 			width: 33.3%;
 		}
-		.tra-item:nth-child(2){
+
+		.tra-item:nth-child(2) {
 			text-align: center;
 		}
-		.tra-item:nth-child(3){
+
+		.tra-item:nth-child(3) {
 			text-align: right;
 		}
 	}
+
 	.list {
 		font-weight: bold;
 		font-size: 30rpx;
@@ -292,33 +303,38 @@
 		padding: 20rpx 30rpx 20rpx 30rpx;
 		line-height: 1;
 		border-bottom: 1px solid #2B2A26;
-		.list-item:nth-child(2){
+
+		.list-item:nth-child(2) {
 			text-align: center;
 		}
-		.list-item:nth-child(3){
+
+		.list-item:nth-child(3) {
 			text-align: right;
 		}
+
 		.list-item {
 			width: 33.3%;
+
 			.img {
 				width: 60rpx;
 				height: 60rpx;
 			}
 
 			.button {
-				padding: 10rpx 20rpx; 
+				padding: 10rpx 20rpx;
 				border-radius: 10rpx;
 				min-width: 150rpx;
 				text-align: center;
 				display: inline-block;
-				&.up{
+
+				&.up {
 					background: #FB5E57;
 				}
-				&.dom{
+
+				&.dom {
 					background: #77DA90;
 				}
 			}
 		}
 	}
-
 </style>

+ 179 - 146
pages/index/pledge.vue

@@ -3,101 +3,39 @@
 		<view class="top">
 			<text>互娛共享</text>
 		</view>
-		<view class="img">
-			<image
-				src="../../static/img/zhiya2.png"
-				mode=""
-				style="width: 696rpx; height: 254rpx"></image>
-		</view>
-		<view @click="navigator"
-			class="my"
-			flex>
-			<image
-				src="../../static/img/zhiya3.png"
-				mode=""
-				style="
-					width: 40rpx;
-					height: 40rpx;
-					margin-left: 50rpx;
-					margin-top: 23rpx;
-					margin-bottom: 22rpx;
-				"></image>
-			<view>我的質押</view>
-			<image
-				class="right"
-				src="../../static/img/zhiya1.png"
-				style="width: 16rpx; height: 26rpx"
-				mode=""></image>
+		<image class="img" src="../../static/img/zhiya2.png" mode="scaleToFill" style=""></image>
+		<view @click="navigator" class="my flex">
+			<view class="flex">
+				<image class="titleTip margin-r-10" src="../../static/img/zhiya3.png" mode=""></image>
+				<view>我的質押</view>
+			</view>
+			<image class="right" src="../../static/img/zhiya1.png" style="" mode=""></image>
 		</view>
-		<view class="buttom" flex v-for="item in 12">
+		<view class="buttom flex" v-for="item in navList.orderList">
 			<view class="le" @click="nav">
-				<view
-					class="le1"
-					style="
-						height: 32rpx;
-						font-size: 33rpx;
-						font-weight: 800;
-						color: #ffffff;
-						line-height: 43rpx;
-					">
+				<view class="le1 title ">
 					質押投資一
 				</view>
-				<view
-					class="le1"
-					style="
-						height: 19rpx;
-						font-size: 20rpx;
-						font-family: PingFang SC;
-						font-weight: 800;
-						color: #feb041;
-						line-height: 43rpx;
-					">
+				<view class="le1 ">
 					20U起投 | 1天
 				</view>
-				<view
-					class="le1"
-					style="
-						height: 19rpx;
-						font-size: 20rpx;
-						font-family: PingFang SC;
-						font-weight: 800;
-						color: #feb041;
-						line-height: 43rpx;
-					">
+				<view class="le1 ">
 					總額:1234534.3456U
 				</view>
-				<view class="le2">
-					<button
-						style="
-							width: 308rpx;
-							height: 16rpx;
-							background: #ebebeb;
-							opacity: 0.38;
-							border-radius: 8rpx;
-							margin-top: 50rpx;
-						"></button>
-					<p style="">42.94%</p>
+				<view class="le2 flex font-color-gray">
+					<view class="line margin-r-10">
+						<view class="line-action" :style="{'margin-left': (-100+42.94)+'%'}">
+							
+						</view>
+					</view>
+					<view>42.94%</view>
 				</view>
 			</view>
 			<view class="ri">
-				<view class="r1"> 1.00% </view>
-				<view class="r2"> 日均收益率 </view>
-				<view class="r3">
-					<view style="background: #feb041; border-radius: 6rpx; width: 139rpx; height: 44rpx;">
-						<text
-							style="
-							padding-top: 23rpx;
-							margin-left: 20rpx;
-							    text-align: center;
-								width: 82rpx;
-								height: 20rpx;
-								font-size: 21rpx;
-								font-family: PingFang SC;
-								font-weight: 800;
-								color: #191a1f;
-							"
-							>立即加入</text>
-						</view>
+				<view class="r1 margin-b-20"> 1.00% </view>
+				<view class="r2 margin-b-30 font-color-gray"> 日均收益率 </view>
+				<view class="add-buttom">
+					立即加入
 				</view>
 			</view>
 		</view>
@@ -112,7 +50,44 @@
 			taber
 		},
 		data() {
-			return {};
+			return {
+				navList: {
+					loadingType: 'more',
+					orderList: [{
+						type: 'TRX',
+						img: '../../static/shouye/shouye5.png',
+						money: 2222,
+						fl: 1,
+						bfb: 0.25,
+					}, {
+						type: 'TRX',
+						img: '../../static/shouye/shouye6.png',
+						money: 2222,
+						fl: 0,
+						bfb: 9.25,
+					}, {
+						type: 'TRX',
+						img: '../../static/shouye/shouye7.png',
+						money: 2222,
+						fl: 1,
+						bfb: 0.25,
+					}, {
+						type: 'TRX',
+						img: '../../static/shouye/shouye8.png',
+						money: 2222,
+						fl: 1,
+						bfb: 0.25,
+					}, {
+						type: 'TRX',
+						img: '../../static/shouye/shouye9.png',
+						money: 2222,
+						fl: 0,
+						bfb: 0.25,
+					}],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				},
+			};
 		},
 		methods: {
 			navigator() {
@@ -124,7 +99,60 @@
 				uni.navigateTo({
 					url: '/pages/zyXingqing/zyXingqing'
 				})
-			}
+			},
+			loadData(source) {
+				//这里是将订单挂载到tab列表下
+				let navItem = this.navList;
+				if (source === 'tabChange' && navItem.loaded === true) {
+					//tab切换只有第一次需要加载数据
+					return;
+				}
+				if (navItem.loadingType === 'loading') {
+					//防止重复加载
+					return;
+				}
+				// 修改当前对象状态为加载中
+				navItem.loadingType = 'loading';
+				getCertList({
+						page: navItem.page,
+						limit: navItem.limit
+					})
+					.then(({
+						data
+					}) => {
+						let list = data.list.data;
+						navItem.orderList = navItem.orderList.concat(list);
+						navItem.page++;
+						if (navItem.limit == list.length) {
+							//判断是否还有数据, 有改为 more, 没有改为noMore
+							navItem.loadingType = 'more';
+							return;
+						} else {
+							//判断是否还有数据, 有改为 more, 没有改为noMore
+							navItem.loadingType = 'noMore';
+							if (navItem.orderList.length == 0) {
+								uni.showModal({
+									title: '提示',
+									content: '您未申请证书是否立即申请',
+									success: res => {
+										if (res.confirm) {
+											uni.navigateTo({
+												url: '/pages/certificate/apply'
+											})
+										}
+									},
+									fail: () => {},
+									complete: () => {}
+								});
+							}
+						}
+						uni.hideLoading();
+						this.$set(navItem, 'loaded', true);
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
 		}
 	};
 </script>
@@ -135,92 +163,97 @@
 		height: 100%;
 		background-color: #000000;
 	}
+
 	.top {
-		// margin-top: 77rpx;
 		padding-top: 40rpx;
-		margin-left: 305rpx;
-		height: 34rpx;
 		font-size: 36rpx;
-		font-family: PingFang SC;
 		font-weight: bold;
 		color: #ffffff;
-		line-height: 55rpx;
+		text-align: center;
 	}
 
 	.img {
-		margin-left: 27rpx;
-		margin-top: 58rpx;
+		width: 690rpx;
+		height: 250rpx;
+		margin: 20rpx 30rpx;
 	}
+
 	.my {
-		margin-top: 23rpx;
 		background-color: #191a1f;
+		margin: 0 30rpx;
 		display: flex;
+		color: #FFF;
+		padding: 20rpx 30rpx;
+		border-radius: 18rpx;
 
-		view {
-			flex-grow: 1;
-			font-size: 30rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #ffffff;
-			padding-left: 20rpx;
-			padding-top: 20rpx;
+		.titleTip {
+			width: 40rpx;
+			height: 40rpx;
 		}
 
 		.right {
 			width: 16rpx;
 			height: 26rpx;
-			margin-top: 26rpx;
 		}
 	}
 
 	.buttom {
-		display: flex;
-		justify-content: space-between;
-		width: 696rpx;
-		height: 252rpx;
-		background: #191a1f;
+		background-color: #191a1f;
 		border-radius: 18rpx;
-		margin-left: 28rpx;
-		margin-top: 20rpx;
-		margin-bottom: 8rpx;
-	}
-	.le1 {
-		margin-left: 28rpx;
-		margin-top: 24rpx;
-	}
-	.le2 {
-		margin-left: 25rpx;
+		margin: 30rpx;
+		padding: 30rpx;
+		line-height: 1;
+
+		.le {
+			font-size: 20rpx;
 
-		p {
-			height: 17rpx;
+			.le1 {
+				font-weight: 800;
+				color: #feb041;
+				margin-bottom: 20rpx;
+
+				&.title {
+					font-size: 33rpx;
+					color: #ffffff;
+				}
+			}
+
+			.le2 {
+				.line {
+					width: 308rpx;
+					height: 16rpx;
+					background-color: rgba(235, 235, 235, 0.38);
+					border-radius: 99rpx;
+					overflow: hidden;
+					.line-action{
+						height: 100%;
+						width: 100%;
+						border-radius: 99rpx;
+						background-color:#FEB041 ;
+					}
+				}
+			}
+		}
+
+		.r1 {
+			font-size: 47rpx;
+			font-weight: 800;
+			color: #FF0102;
+		}
+
+		.r2 {
 			font-size: 21rpx;
-			font-family: PingFang SC;
 			font-weight: 500;
 			color: #999999;
-			line-height: 43rpx;
+		}
+
+		.add-buttom {
+			background: #feb041;
+			border-radius: 6rpx;
+			font-size: 21rpx;
+			font-weight: 800;
+			color: #191a1f;
+			padding:10rpx 20rpx ;
 		}
 	}
-	
-	.r1 {
-		margin-top: 35rpx;
-		height: 36rpx;
-		font-size: 47rpx;
-		font-family: PingFang SC;
-		font-weight: 800;
-		color: #FF0102;
-		line-height: 43rpx;
-	}
-	.r2 {
-		margin-top: 25rpx;
-		height: 20rpx;
-		font-size: 21rpx;
-		font-family: PingFang SC;
-		font-weight: 500;
-		color: #999999;
-		line-height: 43rpx;
-	}
-	
-	.r3{
-		margin-top: 50rpx;
-	}
-</style>
+</style>