2312970463@qq.com 4 éve
szülő
commit
9116faceed
9 módosított fájl, 746 hozzáadás és 539 törlés
  1. 8 0
      api/calculation.js
  2. 18 0
      api/set.js
  3. 2 2
      manifest.json
  4. 1 1
      pages.json
  5. 72 8
      pages/calculation/myCalculation.vue
  6. 1 1
      pages/user/myTeam.vue
  7. 335 253
      pages/user/rake.vue
  8. 304 269
      pages/user/revenue.vue
  9. 5 5
      pages/user/user.vue

+ 8 - 0
api/calculation.js

@@ -43,4 +43,12 @@ export function miningDateils(data,id) {
 		method: 'get',
 		data
 	});
+}
+
+export function myMiningGet(data,id) {
+	return request({
+		url: '/api/my_mining_get',
+		method: 'get',
+		data
+	});
 }

+ 18 - 0
api/set.js

@@ -56,4 +56,22 @@ export function mymsg(data) {
 		method: 'post',
 		data
 	});
+}
+
+//设置下级服务费比例
+export function setServiceRatio(uid,data) {
+	return request({
+		url: '/api/spread/service/'+uid,
+		method: 'post',
+		data
+	})
+}
+
+//设置下级佣金比例
+export function setRatio(uid,data) {
+	return request({
+		url: '/api/spread/ratio/'+uid,
+		method: 'post',
+		data
+	})
 }

+ 2 - 2
manifest.json

@@ -4,8 +4,8 @@
     // __UNI__6FC8B70
     // "appid" : "__UNI__6FC8B70",
     "description" : "",
-    "versionName" : "1.2.7",
-    "versionCode" : 127,
+    "versionName" : "1.2.8",
+    "versionCode" : 128,
     "transformPx" : false,
     "app-plus" : {
         /* 5+App特有相关 */

+ 1 - 1
pages.json

@@ -84,7 +84,7 @@
 		{
 			"path": "pages/calculation/myCalculation",
 			"style": {
-				"navigationBarTitleText": "我的算力"
+				"navigationBarTitleText": "订单详情"
 			}
 		},
 		{

+ 72 - 8
pages/calculation/myCalculation.vue

@@ -1,6 +1,45 @@
 <template>
 	<view class="container">
-		<view class="list-cell" v-if="list.length > 0" v-for="(ls,index) in list" :key='index'>
+		<view class="item-wrapper" v-if="list.length > 0" v-for="(ls,index) in list" :key='index'>
+			<view class="item">
+				<view class="item-name">设备名称</view>
+				<view class="item-val">{{ls.machine.name}}</view>
+			</view>
+			<view class="item">
+				<view class="item-name">状态</view>
+				<view class="item-val blue">{{ls.status == 0 ? '准备中' : ls.status ==  1 ? '挖矿中' : '已到期'}}</view>
+			</view>
+			<view class="item">
+				<view class="item-name">合约期限</view>
+				<view class="item-val blue">{{ls.machine.first_step_time + ls.machine.second_step_time }}天 + {{ ls.machine.third_step_time}}天</view>
+			</view>
+			<view class="item">
+				<view class="item-name">购买容量</view>
+				<view class="item-val blue">{{+ls.num}} {{ls.get_money_type === 'FIL'? 'FIL':ls.get_money_type==='BZZ'?'节点':'T'}}</view>
+			</view>
+			<view class="item">
+				<view class="item-name">管理费</view>
+				<view class="item-val">{{ls.user_service_ratio}}%</view>
+			</view>
+			<view class="item">
+				<view class="item-name">单价</view>
+				<view class="item-val">{{ls.machine.cost_money * 1}} {{ls.machine.cost_money_type}}/{{ls.get_money_type === 'FIL'? 'FIL':ls.get_money_type==='BZZ'?'节点':'T'}}</view>
+			</view>
+			<view class="item">
+				<view class="item-name">购买份数</view>
+				<view class="item-val">{{+ls.num}}</view>
+			</view>
+			<view class="item">
+				<view class="item-name">总价</view>
+				<view class="item-val">{{ls._cost_money}}</view>
+			</view>
+			<view class="item">
+				<view class="item-name">购买时间</view>
+				<view class="item-val">{{ls._pay_time}}</view>
+			</view>
+		</view>
+		<view class="jg" v-if="list.length !== 0"></view>
+		<!-- <view class="list-cell" v-if="list.length > 0" v-for="(ls,index) in list" :key='index'>
 			<view class="cell-title flex">
 				<view class="cellTpl flex_item">
 					<image :src="ls.machine.logo"></image>
@@ -43,13 +82,7 @@
 								@timeover="isTime"
 							></uni-countdown></view>
 			</view>
-			<!-- <view class="cell-info flex">
-				<view class="tip">正式挖矿时间:{{ls.mining_start_time}}</view>
-			</view> -->
-<!-- 			<view class="list-tip">
-				<rich-text :nodes="ls.machine.detail"></rich-text>
-			</view> -->
-		</view>
+		</view> -->
 		<view class="empty-box" v-show="list.length === 0"><empty></empty></view>
 	</view>
 </template>
@@ -202,4 +235,35 @@ page {
 		width: 100%;
 		height: 500rpx;
 	}
+	.item-wrapper {
+		padding: 0 35rpx;
+		width: 690rpx;
+		height: 748rpx;
+		background: #F7F6FB;
+		border: 1rpx solid #5771DF;
+		border-radius: 20rpx;
+		margin: 20rpx auto;
+		font-size: 28rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #333333;
+		line-height: 1;
+		display: flex;
+		flex-direction: column;
+		justify-content: space-around;
+		.item {
+			display: flex;
+			justify-content: space-between;
+			.item-val {
+				font-weight: bold;
+			}
+		}
+		.blue {
+			color: #5771DF;
+			
+		}
+	}
+	.jg {
+		height: 20rpx;
+	}
 </style>

+ 1 - 1
pages/user/myTeam.vue

@@ -45,7 +45,7 @@
 						<view class="title">等级</view>
 					</view>
 				</view>
-				<view class="cell-box flex" v-for="(ls,index) in list" :key='index' @click="nav('/pages/user/rake')">
+				<view class="cell-box flex" v-for="(ls,index) in list" :key='index' @click="nav('/pages/user/rake?uid='+ls.uid)">
 					<view class="cell-tit flex_item">
 						<image :src="ls.avatar"></image>
 						<view class="tit-box">

+ 335 - 253
pages/user/rake.vue

@@ -1,275 +1,357 @@
-<template>
-	<view class="rake">
-		<scroll-view scroll-y="true" id="item-wrapper" class="list-cell" :style="{ height: height }">
-			<!-- <empty v-if="list.length === 0"></empty> -->
-			<view class="item">
-				<view class="top">
-					<view class="info-title">
-						<image src="../../static/img/img11.png" mode=""></image>
-						<view class="">
-							六牛云有有有意义意义六牛云有有有意义
-						</view>
-					</view>
-					<view class="tags">
-						<view class="tag">540天矿机</view>
-						<view class="tag">540天矿机</view>
-						<view class="tag">540天矿机</view>
-						<view class="tag">540天矿机</view>
-						
-					</view>
-					<view class="base-info">
-						<view class="info-item">
-							<view class="tit">单价</view>
-							<view class="val">25.00FIL/T</view>
-						</view>
-						<view class="info-item">
-							<view class="tit">有效算力</view>
-							<view class="val">1T/台</view>
-						</view>
-						<view class="info-item">
-							<view class="tit">周期</view>
-							<view class="val">540天 + 180天</view>
-						</view>
-					</view>
-					<view class="end-time">
-						到期时间:2021年9月20日
-					</view>
+<template>
+	<view class="rake">
+		<view class="item" v-for="(ls,index) in list">
+			<view class="top">
+				<view class="info-title">
+					<image :src="ls.logo" mode=""></image>
+					<view class="">{{ ls.name }}</view>
+				</view>
+				<view class="tags">
+					<view class="tag" v-for="it in ls.tags" :key="it">{{ it }}</view>
+				</view>
+				<view class="base-info">
+					<view class="info-item">
+						<view class="tit">单价</view>
+						<view class="val">{{ +ls.cost_money }}/{{ ls.get_money_type === 'FIL' ? 'FIL' : ls.get_money_type === 'BZZ' ? '节点' : 'T' }}</view>
+					</view>
+					<view class="info-item">
+						<view class="tit">有效算力</view>
+						<view class="val">{{ ls.step }} {{ ls.get_money_type === 'FIL' ? 'T' : ls.get_money_type === 'BZZ' ? '节点' : 'T' }}</view>
+					</view>
+					<view class="info-item">
+						<view class="tit">周期</view>
+						<view class="val">{{ ls.first_step_time + ls.second_step_time }}天 + {{ ls.third_step_time }}天</view>
+					</view>
+				</view>
+			</view>
+			<view class="btn-wrapper">
+				<view class="btn">
+					服务费:{{ls.user_service_ratio*1}}%
+					<text @click="+ls.lower_service_ratio<= +mList[index].user_service_ratio ? '': set(index,ls,0)" :class="{'black':+ls.lower_service_ratio<= +mList[index].user_service_ratio }">设置</text>
+					
 				</view>
-				
-				<view class="btn-wrapper">
-					<view class="btn">
-						服务费:10%<text @click="set(1)">设置</text>
-					</view>
-					<view class="btn">
-						佣金比例:10%<text @click="set(2)">设置</text>
-					</view>
-				</view>
-			</view>
-			
-		</scroll-view>
+				<view class="btn">
+					佣金:{{ls.award_ratio*1}}%
+					<text @click="ls.lower_award_ratio*1 < mList[index].award_ratio*1 ? set(index,ls,1):''" :class="{'black':+ls.lower_award_ratio >= +mList[index].award_ratio }">设置</text>
+				</view>
+			</view>
+			
+		</view>
+		<view class="jg" v-if="list.length !== 0"></view>
+		<empty v-if="list.length == 0"></empty>
 		<uni-popup ref="popup" type="center">
 			<view class="wrapper">
 				<view class="title">
-					设置{{setType === 0? '服务费':'佣金比例'}}
+					设置{{setType === 0? '服务费比例':'佣金比例'}}
 				</view>
-				<input type="text" v-model="setVal" :placeholder="placeTitle" class="inp"/>
+				<input type="number" v-model="setVal" :placeholder="placeTitle" class="inp" />
 				<view class="btn-wrapper">
-					<view class="cansel" @click="close()">
-						取消
-					</view>
-					<view class="qr" @click="sub()">
-						确定
-					</view>
+					<view class="cansel" @click="close()">取消</view>
+					<view class="qr" @click="sub()">确定</view>
 				</view>
 			</view>
-		</uni-popup>
+		</uni-popup>
 	</view>
 </template>
 
-<script>
-	import empty from '../../components/empty.vue'
-	export default {
-		components: {
-			empty
-		},
-		data() {
-			return {
-				height: 0,
-				setType: 0,
-				setVal: null,
-				list: []
+<script>
+import { mining, buyMining } from '@/api/calculation.js';
+import {setServiceRatio ,setRatio} from '../../api/set.js'
+import empty from '../../components/empty.vue';
+export default {
+	components: {
+		empty
+	},
+	data() {
+		return {
+			height: 0,
+			setType: 0,
+			setVal: null,
+			list: [],
+			mList: [],
+			m_service_ratio: 0,
+			uid:0,
+			max_ratio: 0,
+			min_ratio: 0,
+			item: {}
+		};
+	},
+	computed: {
+		placeTitle() {
+			return `可设置比例为${this.min_ratio}%~${this.max_ratio}%`;
+		}
+	},
+	onReady(res) {
+		// var _this = this;
+		// uni.getSystemInfo({
+		// 	success: resu => {
+		// 		const query = uni.createSelectorQuery();
+		// 		query.select('.list-cell').boundingClientRect();
+		// 		query.exec(function(res) {
+		// 			console.log(res, 'ddddddddddddd');
+		// 			_this.height = resu.windowHeight - res[0].top + 'px';
+		// 			console.log('打印页面的剩余高度', _this.height);
+		// 		});
+		// 	},
+		// 	fail: res => {}
+		// });
+	},
+	onLoad(opt) {
+		if(opt) {
+			this.uid = opt.uid
+		}
+		// uni.showLoading({
+		// 	title: '加载中'
+		// })
+		this.loadMlist()
+		
+	},
+	methods: {
+		set(index,ls,num) {
+			console.log(index)
+			this.setType = num
+			this.item = ls
+			if(this.setType === 0) {
+				this.min_ratio = +this.mList[index].user_service_ratio
+				this.max_ratio = +this.list[index].lower_service_ratio
+				console.log(this.min_ratio,this.max_ratio,'5555555555555555555555555')
+				if(this.min_ratio  === this.max_ratio) {
+					this.$api.msg('当前无法设置')
+				}else {
+					this.$refs.popup.open();
+				}
+				
+				console.log(this.min_ratio,this.max_ratio)
+			}else {
+				this.min_ratio = +this.list[index].lower_award_ratio
+				this.max_ratio = +this.mList[index].award_ratio
+				console.log(this.min_ratio,this.max_ratio,'5555555555555555555555555')
+				if(this.min_ratio  === this.max_ratio) {
+					this.$api.msg('当前无法设置')
+				}else {
+					this.$refs.popup.open();
+				}
 			}
-		},
-		computed: {
-			placeTitle() {
-				return this.setType === 0 ? '设置比例为10%~10%': '设置比例为10%~10%'
+			
+			
+		},
+		close() {
+			this.$refs.popup.close();
+			this.setVal = null;
+		},
+		sub() {
+			console.log();
+			this.$refs.popup.close();
+			if(this.setType === 0){
+				setServiceRatio(this.uid,{
+					ratio: this.setVal,
+					mid: this.item.id
+				}).then(res => {
+					this.$api.msg(res.msg)
+					this.loadData()
+				})
+			}else {
+				setRatio(this.uid,{
+					ratio: this.setVal,
+					mid: this.item.id
+				}).then(res => {
+					this.$api.msg(res.msg)
+					this.loadData()
+				})
 			}
+
+			this.setVal = null
+			
+			
+			
+		},
+		loadData() {
+			mining({
+				uid: this.uid,
+				page: 1,
+				limit: 1000
+			}).then(({ data }) => {
+				this.list = data.data;
+				// uni.hideLoading()
+				console.log(this.list, '88888888888888');
+			});
 		},
-		onReady(res) {
-			var _this = this;
-			uni.getSystemInfo({
-				success: resu => {
-					const query = uni.createSelectorQuery();
-					query.select('.list-cell').boundingClientRect();
-					query.exec(function(res) {
-						console.log(res, 'ddddddddddddd');
-						_this.height = resu.windowHeight - res[0].top + 'px';
-						console.log('打印页面的剩余高度', _this.height);
-					});
-				},
-				fail: res => {}
+		loadMlist() {
+			mining({
+				// uid: this.uid,
+				page: 1,
+				limit: 1000
+			}).then(({ data }) => {
+				this.mList = data.data;
+				console.log(this.mList, '999999999999999999999999999999999999');
+				this.loadData();
 			});
-		},
-		methods: {
-			set(index) {
-				this.setType = index
-				this.$refs.popup.open()
-			},
-			close() {
-				this.$refs.popup.close()
-				this.setVal = null
-			},
-			sub() {
-				console.log()
-				this.$refs.popup.close()
-			}
 		}
+		
 	}
+};
 </script>
 
-<style lang="scss" scoped>
-	page {
-		
-		height: 100%;
-		// padding-top: 20rpx;
-	}
-	.rake {
-		// padding-top: 30rpx;
-	}
-	.item {
-		
-		margin: 20rpx auto;
-		width: 670rpx;
-		// height: 438rpx;
-		background: #F7F6FB;
-		border-radius: 10rpx;
-		box-shadow:0 0 20rpx rgba(0,0,0,0.2);
-		.top {
-			// height: 347rpx;
-			width: 100%;
-			padding: 40rpx 30rpx 0;
-			.info-title {
-				display: flex;
-				
-				image {
-					display: inline-block;
-					width: 38rpx;
-					height: 38rpx;
-					margin-left: 10rpx;
-					flex-shrink: 0;
-				}
-				view {
-					padding-left: 12rpx;
-					font-size: 30rpx;
-					font-family: PingFang SC;
-					font-weight: bold;
-					color: #333333;
-				}
-			}
-			.tags {
-				padding-top: 20rpx;
-				display: flex;
-				flex-wrap: wrap;
-				.tag {
-					display: inline-block;
-					padding: 0 20rpx;
-					text-align: center;
-					line-height: 43rpx;
-					background: #E3F6FA;
-					border-radius: 22rpx;
-					margin:10rpx 10rpx 0 ;
-					font-size: 24rpx;
-					font-family: PingFang SC;
-					font-weight: bold;
-					color: #0EC1A1;
-
-				}	
-			}
-			.base-info {
-				padding-top: 30rpx;
-				display: flex;
-				justify-content: space-between;
-				// text-align: center;
-				font-size: 24rpx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #333333;
-				padding-bottom: 30rpx;
-			}
-			.end-time {
-				font-size: 30rpx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #5771DF;
-				padding-bottom: 24rpx;
-			}
-		}
-		.btn-wrapper {
-			width: 670rpx;
-			height: 95rpx;
-			background: #FFFFFF;
-			border-radius: 0px 0px 10rpx 10rpx;
-			display: flex;
-			justify-content: space-around;
-			align-items: center;
-			.btn {
-				
-				text {
-					display: inline-block;
-					width: 108rpx;
-					height: 39rpx;
-					background: #5771DF;
-					border: 1rpx solid #5771DF;
-					box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.1);
-					border-radius: 20rpx;
-					text-align: center;
-					line-height: 35rpx;
-					margin-left: 11rpx;
-					font-size: 24rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #FFFFFF;
-				}
-			}
-		}
-	}
-	.list-cell {
-		width: 100%;
-		height: 100%;
-		background-color: #f8f8f8;
-	}
-	.wrapper {
-		width: 549rpx;
-		height: 344rpx;
-		background: #FFFFFF;
-		border-radius: 14rpx;
-		.title {
-			text-align: center;
-			padding-top: 40rpx;
-			font-size: 37rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #333333;
-		}
-		.inp {
-			display: block;
-			margin: 60rpx auto;
-			width: 439rpx;
-			height: 68rpx;
-			background: #F6F6F6;
-			border-radius: 10rpx;
-			padding-left: 13rpx;
-		}
-		.btn-wrapper {
-			display: flex;
-			view {
-				width: 50%;
-				text-align: center;
-			}
-			.cansel {
-				
-				font-size: 37rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #333333;
-			}
-			.qr {
-				font-size: 37rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #5771DF;
+<style lang="scss" scoped>
+page {
+	height: 100%;
+	// padding-top: 20rpx;
+}
+.rake {
+	height: 100%;
+	// padding-top: 30rpx;
+}
+.item {
+	margin: 20rpx auto;
+	width: 670rpx;
+	// height: 438rpx;
+	background: #f7f6fb;
+	border-radius: 10rpx;
+	box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.2);
+	.top {
+		// height: 347rpx;
+		width: 100%;
+		padding: 40rpx 30rpx 0;
+		.info-title {
+			display: flex;
+
+			image {
+				display: inline-block;
+				width: 38rpx;
+				height: 38rpx;
+				margin-left: 10rpx;
+				flex-shrink: 0;
+			}
+			view {
+				padding-left: 12rpx;
+				font-size: 30rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #333333;
+			}
+		}
+		.tags {
+			padding-top: 20rpx;
+			display: flex;
+			flex-wrap: wrap;
+			.tag {
+				display: inline-block;
+				padding: 0 20rpx;
+				text-align: center;
+				line-height: 43rpx;
+				background: #e3f6fa;
+				border-radius: 22rpx;
+				margin: 10rpx 10rpx 0;
+				font-size: 24rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #0ec1a1;
+			}
+		}
+		.base-info {
+			padding-top: 30rpx;
+			display: flex;
+			justify-content: space-between;
+			// text-align: center;
+			font-size: 24rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #333333;
+			padding-bottom: 30rpx;
+		}
+		.end-time {
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #5771df;
+			padding-bottom: 24rpx;
+		}
+	}
+	.btn-wrapper {
+		// width: 670rpx;
+		height: 95rpx;
+		background: #ffffff;
+		border-radius: 0px 0px 10rpx 10rpx;
+		display: flex;
+		// justify-content: flex-end;
+		justify-content: space-between;
+		align-items: center;
+		padding-right: 20rpx;
+		.btn {
+			// display: flex;
+			
+			text {
+				display: inline-block;
+				width: 108rpx;
+				height: 39rpx;
+				background: #5771df;
+				border: 1rpx solid #5771df;
+				box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.1);
+				border-radius: 20rpx;
+				text-align: center;
+				line-height: 35rpx;
+				margin-left: 11rpx;
+				font-size: 24rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #ffffff;
 			}
-		}
-		
+			.black {
+				background-color: #999;
+				border-color: #999;
+			}
+		}
+	}
+}
+.list-cell {
+	width: 100%;
+	height: 100%;
+	background-color: #f8f8f8;
+}
+.wrapper {
+	width: 549rpx;
+	height: 344rpx;
+	background: #ffffff;
+	border-radius: 14rpx;
+	.title {
+		text-align: center;
+		padding-top: 40rpx;
+		font-size: 37rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #333333;
+	}
+	.inp {
+		display: block;
+		margin: 60rpx auto;
+		width: 439rpx;
+		height: 68rpx;
+		background: #f6f6f6;
+		border-radius: 10rpx;
+		padding-left: 13rpx;
+	}
+	.btn-wrapper {
+		display: flex;
+	
+		view {
+			width: 50%;
+			text-align: center;
+		}
+		.cansel {
+			font-size: 37rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #333333;
+		}
+		.qr {
+			font-size: 37rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #5771df;
+		}
 	}
+}
+.jg {
+	height: 20rpx;
+}
 </style>

+ 304 - 269
pages/user/revenue.vue

@@ -1,127 +1,135 @@
-<template>
-	<view class="revenue">
-		
-		
-		<view class="top-jg">
-			
-		</view>
-		<view class="nav-wrapper">
-			<view class="nav-item" v-for="(item, index) in navList" :key="index" :class="{ active: currentIndex === index }" @click="navClick(index)">{{ item.title }}</view>
-		</view>
-		<view class="list">
-			<view class="list-item flex">
-				<view class="item-tpl">
-					<view class="tpl name">有效算力</view>
-					<view class="tpl num">{{list.doing}}{{navList[currentIndex].slUnit}}</view>
-				</view>
-				<view class="item-tpl">
-					<view class="tpl name">待生效算力</view>
-					<view class="tpl num">{{list.stand}}{{navList[currentIndex].slUnit}}</view>
-				</view>
-			</view>
-			<view class="list-item">
-				<view class="item-tpl tols">
-					<view class="tpl name">累计挖币</view>
-					<view class="tpl num">{{list.all_mining}}{{navList[currentIndex].unit}}</view>
-				</view>
-				<!-- <view class="item-tpl">
-					<view class="tpl name">当前锁仓</view>
-					<view class="tpl num">{{list.all_lock}}FIL</view>
-				</view> -->
-			</view>
-		</view>
-		<view class="all-num">
-			<view class="">
-				<view class="title">总收益</view>
-				<view class="num">{{allIncome}}{{navList[currentIndex].unit}}</view>
-			</view>
-			<view class="">
-				<view class="title">累计释放</view>
-				<view class="num">{{ljIncome}}{{navList[currentIndex].unit}}</view>
-			</view>
-			<view class="">
-				<view class="title">待释放</view>
-				<view class="num">{{wait}}{{navList[currentIndex].unit}}</view>
-			</view>
-		</view>
-		
-		<view class="tip">
-			<view class="line"></view>
-			<view class="title">每日收益记录</view>
-			<view class="line"></view>
-		</view>
-		<scroll-view :style="{ height: height }" class="days" scroll-y>
-			<empty v-if="navList[currentIndex].loaded === true && navList[currentIndex].list.length === 0"></empty>
-			<view class="day-item" v-for="(item,index) in navList[currentIndex].list" :key="index">
-				<view class="item">
-					<view class="item-title">结算日期:</view>
-					<view class="item-value">2021-07-04</view>
-				</view>
-				<view class="item">
-					<view class="item-title">今日可用<text>25%</text></view>
-					<view class="item-value">0.09{{navList[currentIndex].unit}}</view>
-				</view>
-				<view class="item">
-					<view class="item-title">今日冻结<text>25%</text></view>
-					<view class="item-value">0.09{{navList[currentIndex].unit}}</view>
-				</view>
-				<view class="item">
-					<view class="item-title">今日释放<text>1/150</text></view>
-					<view class="item-value">0.09{{navList[currentIndex].unit}}</view>
-				</view>
-				<uni-load-more :status="item.loadingType"></uni-load-more>
+<template>
+	<view class="revenue">
+		<view class="top-jg"></view>
+		<view class="nav-wrapper">
+			<view class="nav-item" v-for="(item, index) in navList" :key="index" :class="{ active: currentIndex === index }" @click="navClick(index)">{{ item.title }}</view>
+		</view>
+		<view class="list">
+			<view class="list-item flex">
+				<view class="item-tpl">
+					<view class="tpl name">有效算力</view>
+					<view class="tpl num">{{ list.doing }}{{ navList[currentIndex].slUnit }}</view>
+				</view>
+				<view class="item-tpl">
+					<view class="tpl name">待生效算力</view>
+					<view class="tpl num">{{ list.stand }}{{ navList[currentIndex].slUnit }}</view>
+				</view>
+			</view>
+			<view class="list-item">
+				<view class="item-tpl tols">
+					<view class="tpl name">累计挖币</view>
+					<view class="tpl num">{{ list.all_mining }}{{ navList[currentIndex].unit }}</view>
+				</view>
+				<!-- <view class="item-tpl">
+					<view class="tpl name">当前锁仓</view>
+					<view class="tpl num">{{list.all_lock}}FIL</view>
+				</view> -->
+			</view>
+		</view>
+		<view class="all-num">
+			<view class="num-item">
+				<view class="title">总收益</view>
+				<view class="num">{{ all_get }}{{ navList[currentIndex].unit }}</view>
+			</view>
+			<view class="num-item">
+				<view class="title">累计释放</view>
+				<view class="num">{{ all_unlock }}{{ navList[currentIndex].unit }}</view>
+			</view>
+			<view class="num-item">
+				<view class="title">待释放</view>
+				<view class="num">{{ all_lock }}{{ navList[currentIndex].unit }}</view>
+			</view>
+		</view>
+
+		<view class="tip">
+			<view class="line"></view>
+			<view class="title">每日收益记录</view>
+			<view class="line"></view>
+		</view>
+		<scroll-view :style="{ height: height }" class="days" scroll-y @scrolltolower="loadData()">
+			<empty v-if="navList[currentIndex].loaded === true && navList[currentIndex].list.length === 0"></empty>
+			<view class="day-item" v-for="(item, index) in navList[currentIndex].list" :key="index">
+				<view class="item">
+					<view class="item-title">结算日期:</view>
+					<view class="item-value">{{item.add_date}}</view>
+				</view>
+				<view class="item">
+					<view class="item-title">
+						今日可用
+						<text>{{item.machine.second_step_get_ratio*1}}%</text>
+					</view>
+					<view class="item-value">{{item.unlock}}{{item.get_money_type}}</view>
+				</view>
+				<view class="item">
+					<view class="item-title">
+						今日冻结
+						<text>{{100-item.machine.second_step_get_ratio*1}}%</text>
+					</view>
+					<view class="item-value">{{item.all_lock}}{{item.get_money_type}}</view>
+				</view>
+				<view class="item">
+					<view class="item-title">
+						今日释放
+						<text>1/{{item.machine.third_step_time}}</text>
+					</view>
+					<view class="item-value">{{item.unstand}}{{item.get_money_type}}</view>
+				</view>
+				
 			</view>
-			
-		</scroll-view>
-	</view>
-</template>
-
-<script>
-import empty from '@/components/empty';
-import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
-import { mining,miningIndex } from '@/api/calculation.js';
-export default {
-	components:{
-		empty,
-		uniLoadMore
+			<uni-load-more :status="navList[currentIndex].loadingType"></uni-load-more>
+		</scroll-view>
+	</view>
+</template>
+
+<script>
+import empty from '@/components/empty';
+import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+import { mining, miningIndex, myMiningGet } from '@/api/calculation.js';
+export default {
+	components: {
+		empty,
+		uniLoadMore
 	},
 	data() {
-		return {
+		return {
 			list: '',
 			navList: [
 				{
-					title: 'Fil',
-					unit: 'FIL',
-					slUnit:'T',
+					title: 'Fil',
+					unit: 'FIL',
+					slUnit: 'T',
 					list: [],
-					page: 1,
-					limit: 10,
-					loadingType: 'more',
+					page: 1,
+					limit: 10,
+					loadingType: 'more'
 				},
 				{
-					title: 'Chia',
-					unit: 'XCH',
-					slUnit:'T',
+					title: 'Chia',
+					unit: 'XCH',
+					slUnit: 'T',
 					list: [],
-					page: 1,
-					limit: 10,
-					loadingType: 'more',
+					page: 1,
+					limit: 10,
+					loadingType: 'more'
 				},
 				{
-					title: 'Bzz',
-					unit: 'BZZ',
-					slUnit:'节点',
+					title: 'Bzz',
+					unit: 'BZZ',
+					slUnit: '节点',
 					list: [],
-					page: 1,
-					limit: 10,
-					loadingType: 'more',
+					page: 1,
+					limit: 10,
+					loadingType: 'more'
 				}
 			],
 			currentIndex: 0,
-			height: 0,
-			allIncome: 0,//总收益
-			ljIncome: 0,//累计收益
-			wait: 0//待释放
+			height: 0,
+			allIncome: 0, //总收益
+			ljIncome: 0, //累计收益
+			wait: 0, //待释放,
+			all_lock: 0, //待释放
+			all_get: 0, //总收益
+			all_unlock: 0 //累计释放
 		};
 	},
 	onReady(res) {
@@ -138,37 +146,37 @@ export default {
 			},
 			fail: res => {}
 		});
-	},
-	onLoad() {
-		let userInfo = uni.getStorageSync('userInfo') || '';
-		this.level = userInfo.level;
-		this.loadData();
-		this.loadTopDate('FIL')
 	},
-	methods: {
-		async loadTopDate(type) {
-			uni.showLoading({
-				title: '加载中...'
-			})
-			let obj = this;
-			miningIndex({
-				type: type
-			}).then(({ data }) => {
-				obj.list = data;
-				uni.hideLoading()
-				console.log(obj.list)
-			});
+	onLoad() {
+		let userInfo = uni.getStorageSync('userInfo') || '';
+		this.level = userInfo.level;
+		this.loadData();
+		this.loadTopDate('FIL');
+	},
+	methods: {
+		async loadTopDate(type) {
+			uni.showLoading({
+				title: '加载中...'
+			});
+			let obj = this;
+			miningIndex({
+				type: type
+			}).then(({ data }) => {
+				obj.list = data;
+				uni.hideLoading();
+				console.log(obj.list);
+			});
 		},
 		//切换币种
-		navClick(index) {
-			if(index !== this.currentIndex ){
-				this.currentIndex = index;
-				this.loadTopDate(this.navList[index].unit)
-				this.loadData('tabChange')
+		navClick(index) {
+			if (index !== this.currentIndex) {
+				this.currentIndex = index;
+				this.loadTopDate(this.navList[index].unit);
+				this.loadData('tabChange');
 			}
-			
 		},
-		loadData(source) {
+		loadData(source) {
+			console.log('loadnoe')
 			//这里是将list挂载到nav列表下
 			let index = this.currentIndex;
 			let navItem = this.navList[index];
@@ -187,7 +195,34 @@ export default {
 			}
 			// 修改当前对象状态为加载中
 			navItem.loadingType = 'loading';
-
+			myMiningGet({
+				type: navItem.unit,
+				page: navItem.page,
+				limit: navItem.limit
+			}).then(({ data }) => {
+				console.log(data, '888888888888888888888');
+				this.all_lock = data.all_lock;
+				this.all_get = data.all_get;
+				let arr = data.list.data.map(e => {
+					return e;
+				});
+				navItem.list = navItem.list.concat(arr);
+				console.log(arr)
+				navItem.page++;
+				if (navItem.limit == data.list.data.length) {
+					//判断是否还有数据, 有改为 more, 没有改为noMore
+					navItem.loadingType = 'more';
+					console.log('more')
+					return;
+				} else {
+					//判断是否还有数据, 有改为 more, 没有改为noMore
+					navItem.loadingType = 'noMore';
+					console.log('noMore')
+				}
+				this.$set(navItem, 'loaded', true);
+			}).catch( e => {
+				console.log(e)
+			})
 			// orderList({
 			// 	type: state,
 			// 	page: navItem.page,
@@ -212,140 +247,140 @@ export default {
 			// 	})
 			// 	.catch(e => {
 			// 		console.log(e);
-			// 	});
-			//假数据
-			let arr = []
-			navItem.list = navItem.list.concat(arr)
-			navItem.page++
-			navItem.loadingType = 'noMore'
-			this.$set(navItem, 'loaded', true)
-			console.log(this.navList)
+			// 	});
+			//假数据
+			// let arr = []
+			// navItem.list = navItem.list.concat(arr)
+			// navItem.page++
+			// navItem.loadingType = 'noMore'
+			// this.$set(navItem, 'loaded', true)
+			// console.log(this.navList)
 		}
 	}
-};
-</script>
-
-<style lang="scss" scoped>
-page {
-	width: 100%;
-}
-.top-jg {
-	height: 55rpx;
-}
-.nav-wrapper {
-	margin: 0rpx auto 10rpx;
-	width: 627rpx;
-	height: 60rpx;
-	border: 2px solid #5771df;
-	border-radius: 5rpx;
-	display: flex;
-	.nav-item {
-		width: 209rpx;
-		text-align: center;
-		line-height: 60rpx;
-		font-size: 28rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #5771df;
-	}
-	.active {
-		background: #5771df;
-		color: #fff;
-	}
-}
-.all-num {
-	width: 627rpx;
-	margin: 0 auto;
-	display: flex;
-	justify-content: space-between;
-	font-size: 30rpx;
-	font-family: PingFang SC;
-	font-weight: bold;
-	color: #333333;
-	view {
-		display: flex;
-		flex-direction: column;
-		justify-content: center;
-		align-items: center;
-		.title {
-			padding-bottom: 20rpx;
-		}
-		.num {
-			font-weight: 500;
-		}
-	}
-}
-.tip {
-	width: 627rpx;
-	margin: 80rpx auto 70rpx;
-	display: flex;
-	justify-content: space-between;
-	align-items: center;
-	.line {
-		width: 193rpx;
-		height: 2rpx;
-		background: #5771df;
-	}
-	.title {
-		font-size: 28rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #5771df;
-	}
-}
-.days {
-	// background-color: red;
-	padding: 0 65rpx;
-	.day-item {
-		height: 230rpx;
-		border-bottom: 1px solid #F3F4F6;
-		background-color: #fff;
-		font-size: 24rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #333333;
-		display: flex;
-		flex-direction: column;
-		justify-content: space-around;
-		padding: 20rpx 0;
-		.item {
-			display: flex;
-			justify-content: space-between;
-			text {
-				display: inline-block;
-				margin-left: 10rpx;
-			}
-		}
-	}
-}
-.list {
-	padding:10rpx 65rpx 0;
-	.list-item{
-			// padding: 90rpx 118rpx 0 118rpx;
-			
-			margin-bottom: 15rpx;
-			.item-tpl{
-				background-color: #f7f6fb;
-				text-align: center;
-				// background-color: #FFFFFF;
-				padding: 41rpx 0;
-				width: 48%;
-				.name{
-					color: #666666;
-					font-size: 24rpx;
-				}
-				.num{
-					font-size: 32rpx;
-					color: #333333;
-					font-weight: bold;
-					padding-top: 10rpx;
-				}
-			}
-		}
-		.tols{
-			width: 100% !important;
-			
-		}
-}
-
+};
+</script>
+
+<style lang="scss" scoped>
+page {
+	width: 100%;
+}
+.top-jg {
+	height: 55rpx;
+}
+.nav-wrapper {
+	margin: 0rpx auto 10rpx;
+	width: 627rpx;
+	height: 60rpx;
+	border: 2px solid #5771df;
+	border-radius: 5rpx;
+	display: flex;
+	.nav-item {
+		width: 209rpx;
+		text-align: center;
+		line-height: 60rpx;
+		font-size: 28rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #5771df;
+	}
+	.active {
+		background: #5771df;
+		color: #fff;
+	}
+}
+.all-num {
+	width: 627rpx;
+	margin: 0 auto;
+	display: flex;
+	justify-content: space-between;
+	font-size: 30rpx;
+	font-family: PingFang SC;
+	font-weight: bold;
+	color: #333333;
+	.num-item {
+		width: 33.3%;
+		flex-shrink: 0;
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		.title {
+			padding-bottom: 20rpx;
+		}
+		.num {
+			font-weight: 500;
+		}
+	}
+}
+.tip {
+	width: 627rpx;
+	margin: 80rpx auto 70rpx;
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	.line {
+		width: 193rpx;
+		height: 2rpx;
+		background: #5771df;
+	}
+	.title {
+		font-size: 28rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #5771df;
+	}
+}
+.days {
+	// background-color: red;
+	padding: 0 65rpx;
+	.day-item {
+		// height: 230rpx;
+		border-bottom: 1px solid #f3f4f6;
+		background-color: #fff;
+		font-size: 24rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #333333;
+		display: flex;
+		flex-direction: column;
+		justify-content: space-around;
+		padding: 20rpx 0;
+		.item {
+			display: flex;
+			justify-content: space-between;
+			text {
+				display: inline-block;
+				margin-left: 10rpx;
+			}
+		}
+	}
+}
+.list {
+	padding: 10rpx 65rpx 0;
+	.list-item {
+		// padding: 90rpx 118rpx 0 118rpx;
+
+		margin-bottom: 15rpx;
+		.item-tpl {
+			background-color: #f7f6fb;
+			text-align: center;
+			// background-color: #FFFFFF;
+			padding: 41rpx 0;
+			width: 48%;
+			.name {
+				color: #666666;
+				font-size: 24rpx;
+			}
+			.num {
+				font-size: 32rpx;
+				color: #333333;
+				font-weight: bold;
+				padding-top: 10rpx;
+			}
+		}
+	}
+	.tols {
+		width: 100% !important;
+	}
+}
 </style>

+ 5 - 5
pages/user/user.vue

@@ -14,13 +14,13 @@
 		</view>
 		<view class="list-box">
 			<view class="list-title">我的工具</view>
-			<!-- <view class="list-cell flex" @click="navTo('/pages/calculation/index')">
+			<view class="list-cell flex" @click="navTo('/pages/calculation/myCalculation')">
 				<view class="cell-info flex_item">
 					<image src="../../static/tabBar/tab-calculation-current.png" style="width: 40rpx; height: 40rpx;"></image>
-					<view class="cell-name">我的算力</view>
+					<view class="cell-name">我的订单</view>
 				</view>
 				<image src="../../static/img/img23.png"></image>
-			</view> -->
+			</view>
 			<view class="list-cell flex" @click="navTo('/pages/user/revenue')">
 				<view class="cell-info flex_item">
 					<image src="../../static/img/img54.png" style="width: 40rpx; height: 40rpx;"></image>
@@ -28,13 +28,13 @@
 				</view>
 				<image src="../../static/img/img23.png"></image>
 			</view>
-			<view class="list-cell flex" @click="navTo('/pages/user/sharerevenue')">
+<!-- 			<view class="list-cell flex" @click="navTo('/pages/user/sharerevenue')">
 				<view class="cell-info flex_item">
 					<image src="../../static/img/img53.png" style="width: 40rpx; height: 40rpx;"></image>
 					<view class="cell-name">邀请收益</view>
 				</view>
 				<image src="../../static/img/img23.png"></image>
-			</view>
+			</view> -->
 			<view class="list-cell flex" @click="navTo('/pages/user/myTeam')">
 				<view class="cell-info flex_item">
 					<image src="../../static/img/img17.png"></image>