lhl 2 years ago
parent
commit
22f9a3321c
5 changed files with 983 additions and 266 deletions
  1. 11 0
      pages.json
  2. 548 263
      pages/money/recharge.vue
  3. 421 0
      pages/user/myyue.vue
  4. 3 3
      pages/user/user.vue
  5. BIN
      static/icon/btncz.png

+ 11 - 0
pages.json

@@ -328,6 +328,17 @@
 			"style": {
 				"navigationBarTitleText": "我的粉丝"
 			}
+		},
+		{
+			"path": "pages/user/myyue",
+			"style": {
+				"navigationBarTitleText": "我的余额",
+				"app-plus": {
+					"titleNView": {
+						"type": "transparent"
+					}
+				}
+			}
 		},
 		{
 			"path": "pages/user/withdrawal",

+ 548 - 263
pages/money/recharge.vue

@@ -1,264 +1,549 @@
-<template>
-	<view class="content">
-		<view class="row-box">
-			<view class="title">充值金额</view>
-			<view class="row">
-				<text class="tit">¥</text>
-				<input class="input" type="number" v-model="money" placeholder="请输入充值金额" placeholder-class="placeholder" />
-			</view>
-		</view>
-
-		<view class="list">
-			<radio-group @change="tabRadio">
-				<!-- #ifdef APP-PLUS -->
-				<label>
-					<view class="box">
-						<view class="icon iconfont iconzhifubao"></view>
-						<view class="title-box">
-							<view class="title"><text>支付宝充值</text></view>
-						</view>
-						<view class="right"><radio value="alipay" color="#5dbc7c" :checked="type == 'alipay'" /></view>
-					</view>
-				</label>
-				<label>
-					<view class="box">
-						<view class="icon iconfont iconweixin1"></view>
-						<view class="title-box">
-							<view class="title"><text>微信充值</text></view>
-							<view class="node"><text>真实姓名(代勇明)</text></view>
-						</view>
-						<view class="right"><radio value="weixin" color=" #5dbc7c" :checked="type == 'weixin'" /></view>
-					</view>
-				</label>
-				<!-- #endif -->
-			</radio-group>
-		</view>
-		<button class="add-btn up" :class="{ 'active-bg': payLoding }" @click="!payLoding ? confirm() : ''">确认充值</button>
-	</view>
-</template>
-
-<script>
-import { getMoneyStyle } from '@/utils/rocessor.js';
-// #ifdef H5
-import { rechargeWechat } from '@/api/wallet.js';
-// #endif
-// #ifdef MP
-import { rechargeRoutine } from '@/api/wallet.js';
-// #endif
-import { mapState } from 'vuex';
-export default {
-	filters: {
-		getMoneyStyle
-	},
-	data() {
-		return {
-			type: 'weixin',
-			money: '', //充值金额
-			payLoding: false //是否加载中
-		};
-	},
-	onLoad(options) {},
-	computed: {
-		// #ifdef H5
-		...mapState(['weichatObj'])
-		// #endif
-	},
-	methods: {
-		// 跳转
-		navTo(url) {
-			uni.navigateTo({
-				url: url
-			});
-		},
-		// 切换选中对象
-		tabRadio(e) {
-			this.type = e;
-		},
-		// 提交
-		confirm() {
-			let obj = this;
-			obj.payLoding = true;
-			// #ifdef H5
-			rechargeWechat({ price: this.money, from: this.type })
-				.then(e => {
-					let da = e.data.data;
-					obj.weichatObj.chooseWXPay({
-						timestamp: da.timestamp,
-						nonceStr: da.nonceStr,
-						package: da.package,
-						signType: da.signType,
-						paySign: da.paySign,
-						success: function(res) {
-							uni.showToast({
-								title: '充值成功',
-								duration: 2000,
-								position: 'top'
-							});
-						}
-					});
-					obj.payLoding = false;
-				})
-				.catch(e => {
-					obj.payLoding = false;
-					console.log(e);
-				});
-			// #endif
-			// #ifdef MP
-			rechargeRoutine({ price: this.money})
-				.then(e => {
-					let da = e.data;
-						wx.requestPayment({
-								timeStamp: da.timestamp,
-								nonceStr: da.nonceStr,
-								package: da.package,
-								signType: da.signType,
-								paySign: da.paySign,
-								success: function(res) {
-									uni.redirectTo({
-										url: '/pages/money/paySuccess'
-									});
-								},
-								
-							})
-					
-					obj.payLoding = false;
-				})
-				.catch(e => {
-					obj.payLoding = false;
-					console.log(e);
-				});
-			// #endif
-		},
-		//获取订单列表
-		loadData(source) {
-			console.log(source);
-			//这里是将订单挂载到tab列表下
-			let index = this.tabCurrentIndex;
-			let navItem = this.navList[index];
-			let state = navItem.state;
-			if (source === 'tabChange' && navItem.loaded === true) {
-				//tab切换只有第一次需要加载数据
-				return;
-			}
-			if (navItem.loadingType === 'loading') {
-				//防止重复加载
-				return;
-			}
-			navItem.loadingType = 'loading';
-			setTimeout(() => {
-				let orderList = [];
-				orderList.forEach(item => {
-					navItem.orderList.push(item);
-				});
-				//loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
-				this.$set(navItem, 'loaded', true);
-				//判断是否还有数据, 有改为 more, 没有改为noMore
-				navItem.loadingType = 'more';
-			}, 600);
-		}
-	}
-};
-</script>
-
-<style lang="scss">
-page {
-	height: 100%;
-}
-
-.add-btn {
-	&.modified {
-		color: $base-color;
-	}
-	&.up {
-		background-color: $base-color;
-		color: #fff;
-	}
-	display: flex;
-	align-items: center;
-	justify-content: center;
-	width: 690rpx;
-	height: 80rpx;
-	margin: 0 auto;
-	margin-top: 30rpx;
-	font-size: $font-lg;
-	border-radius: 10rpx;
-	// box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
-}
-.row-box {
-	margin-top: 30rpx;
-	padding: 20rpx 30rpx;
-	background: #fff;
-	.title {
-		font-size: $font-base + 2rpx;
-		color: $font-color-dark;
-	}
-	.row {
-		display: flex;
-		align-items: center;
-		position: relative;
-		height: 80rpx;
-		.tit {
-			flex-shrink: 0;
-			width: 40rpx;
-			font-size: 30rpx;
-			color: $font-color-dark;
-		}
-		.input {
-			flex: 1;
-			font-size: 30rpx;
-			color: $font-color-dark;
-		}
-		.iconlocation {
-			font-size: 36rpx;
-			color: $font-color-light;
-		}
-
-		.buttom {
-			color: $font-color;
-			font-size: $font-base;
-		}
-	}
-}
-.list {
-	padding-left: 30rpx;
-	margin-top: 30rpx;
-	background-color: #ffffff;
-	.box {
-		display: flex;
-		align-items: center;
-		width: 100%;
-		height: 120rpx;
-		border-bottom: 1px solid $border-color-light;
-		.icon {
-			font-size: 48rpx;
-			padding-right: 20rpx;
-		}
-		.iconweixin1 {
-			color: #18bf16;
-		}
-		.iconzhifubao {
-			color: #08aaec;
-		}
-		.title-box {
-			flex-grow: 1;
-			text-align: left;
-			.title {
-				font-size: $font-base + 2rpx;
-				color: $font-color-base;
-			}
-			.node {
-				font-size: $font-sm;
-				color: $font-color-light;
-			}
-		}
-	}
-}
-/deep/ .uni-radio-input {
-	width: 45rpx;
-	height: 45rpx;
-}
-
-.active-bg {
-	background-color: $color-gray !important;
-}
+<template>
+	<view class="content">
+		<view class="now" v-if="status == 0">
+			<view>当前余额:</view>
+			<view class="now-money">¥{{new_money}}</view>
+		</view>
+		<view class="now" v-if="status == 2">
+			<view>当前预约券:</view>
+			<view class="now-money">¥{{userInfo.anticipate}}</view>
+		</view>
+		<view class="main-jg"></view>
+		<view class="add-wrapper">
+			<view class="add-box">
+				<view class="add-log">¥</view>
+				<input type="text" v-model="money" placeholder="请输入充值金额" placeholder-class="place"
+					@keyup="clearNoNum()" />
+			</view>
+			<view class="jg" style="height: 1px; background-color: #E6E6E6;"></view>
+			<view class="add-tags">
+				<view class="tag" v-for="(item, index) in addTags" :key="item" @click="tagClick(index)"
+					:class="{ action: currentIndex === index && money == addTags[index] }">
+					<text>{{ item }}</text>
+					元
+				</view>
+			</view>
+		</view>
+		<view class="main-jg"></view>
+		<view class="btn-wrapper">
+			<view class="icon iconfont iconweixin1">
+				<view>微信充值</view>
+			</view>
+			<view class="btn" @click="btnClick" :class="{'actiont': isSect}">
+				<image src="../../static/icon/btncz.png" mode="" :class="{'action':!isSect}"></image>
+			</view>
+		</view>
+		<!-- <view class="row-box">
+			<view class="title">充值金额</view>
+			<view class="row">
+				<text class="tit">¥</text>
+				<input class="input" type="number" v-model="money" placeholder="请输入充值金额" placeholder-class="placeholder" />
+			</view>
+		</view> -->
+		<view class="list">
+			<radio-group @change="tabRadio">
+				<!-- #ifdef APP-PLUS -->
+				<!-- <label>
+					<view class="box">
+						<view class="icon iconfont iconzhifubao"></view>
+						<view class="title-box">
+							<view class="title"><text>支付宝充值</text></view>
+						</view>
+						<view class="right"><radio value="alipay" color="#5dbc7c" :checked="type == 'alipay'" /></view>
+					</view>
+				</label> -->
+				<label>
+					<view class="box">
+						<view class="icon iconfont iconweixin1"></view>
+						<view class="title-box">
+							<view class="title"><text>微信充值</text></view>
+							<view class="node"><text>真实姓名(代勇明)</text></view>
+						</view>
+						<view class="right">
+							<radio value="weixin" color=" #5dbc7c" :checked="type == 'weixin'" />
+						</view>
+					</view>
+				</label>
+				<!-- #endif -->
+			</radio-group>
+		</view>
+		<button class="add-btn up" :class="{ 'active-bg': payLoding }"
+			@click="!payLoding ? confirm() : ''">立即充值</button>
+
+	</view>
+</template>
+
+<script>
+	import {
+		getMoneyStyle
+	} from '@/utils/rocessor.js';
+	// #ifdef H5
+	import {
+		rechargeWechat,
+		userBalance
+	} from '@/api/wallet.js';
+	// #endif
+	// #ifdef MP
+	import {
+		rechargeRoutine,
+		userBalance
+	} from '@/api/wallet.js';
+	// #endif
+	import {
+		mapState
+	} from 'vuex';
+	import {
+		orderData,
+		getUserInfo
+	} from '@/api/user.js';
+	export default {
+		filters: {
+			getMoneyStyle
+		},
+		data() {
+			return {
+				type: 'weixin',
+				money: '', //充值金额
+				payLoding: false, //是否加载中
+				addTags: [300, 200, 150, 100, 50],
+				currentIndex: 0,
+				addMoney: 0,
+				isSect: false, //是否选择微信充值
+				new_money: 0,
+				status: 0, //0->余额 2->兑换券
+			};
+		},
+		onLoad(options) {
+			this.userBalance()
+			if (options.status) {
+				this.status = options.status
+			}
+		},
+		computed: {
+			// #ifdef H5
+			...mapState(['weichatObj']),
+			// #endif
+			...mapState('user', ['userInfo'])
+		},
+		methods: {
+			// 跳转
+			navTo(url) {
+				uni.navigateTo({
+					url: url
+				});
+			},
+			// 切换选中对象
+			tabRadio(e) {
+				this.type = e;
+			},
+			// 提交
+			confirm() {
+				let obj = this;
+				if (obj.money == 0) {
+					return obj.$api.msg('请输入充值金额');
+				}
+				if (!obj.isSect) {
+					return obj.$api.msg('请选择支付方式');
+				}
+
+
+				obj.payLoding = true;
+				// #ifdef H5
+				let datao = {}
+				if (obj.status == 0) {
+					datao = {
+						price: obj.money,
+						from: obj.type,
+					}
+				}
+				if (obj.status == 2) {
+					datao = {
+						price: obj.money,
+						from: obj.type,
+						type: 2
+					}
+				}
+				rechargeWechat(datao)
+					.then(e => {
+						let da = e.data.data;
+						obj.weichatObj.chooseWXPay({
+							timestamp: da.timestamp,
+							nonceStr: da.nonceStr,
+							package: da.package,
+							signType: da.signType,
+							paySign: da.paySign,
+							success: function(res) {
+								uni.showToast({
+									title: '充值成功',
+									duration: 2000,
+									position: 'top'
+			 				});
+							}
+						});
+						obj.payLoding = false;
+					})
+					.catch(e => {
+						obj.payLoding = false;
+						console.log(e);
+					});
+				// #endif
+				// #ifdef MP
+				rechargeRoutine({
+						price: this.money
+					})
+					.then(e => {
+						let da = e.data;
+						wx.requestPayment({
+							timeStamp: da.timestamp,
+							nonceStr: da.nonceStr,
+							package: da.package,
+							signType: da.signType,
+							paySign: da.paySign,
+							success: function(res) {
+								uni.redirectTo({
+									url: '/pages/money/paySuccess?isshow=false'
+								});
+							}
+						});
+
+						obj.payLoding = false;
+					})
+					.catch(e => {
+						obj.payLoding = false;
+						console.log(e);
+					});
+				// #endif
+			},
+			//获取订单列表
+			loadData(source) {
+				console.log(source);
+				//这里是将订单挂载到tab列表下
+				let index = this.tabCurrentIndex;
+				let navItem = this.navList[index];
+				let state = navItem.state;
+				if (source === 'tabChange' && navItem.loaded === true) {
+					//tab切换只有第一次需要加载数据
+					return;
+				}
+				if (navItem.loadingType === 'loading') {
+					//防止重复加载
+					return;
+				}
+				navItem.loadingType = 'loading';
+				setTimeout(() => {
+					let orderList = [];
+					orderList.forEach(item => {
+						navItem.orderList.push(item);
+					});
+					//loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
+					this.$set(navItem, 'loaded', true);
+					//判断是否还有数据, 有改为 more, 没有改为noMore
+					navItem.loadingType = 'more';
+				}, 600);
+			},
+			tagClick(index) {
+				this.currentIndex = index;
+				this.money = this.addTags[index];
+			},
+			clearNoNum() {
+				this.money = this.money.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
+				switch (this.money) {
+					case '300':
+						this.currentIndex = 0;
+						break;
+					case '200':
+						this.currentIndex = 1;
+						break;
+					case '150':
+						this.currentIndex = 2;
+						break;
+					case '100':
+						this.currentIndex = 3;
+						break;
+					case '50':
+						this.currentIndex = 4;
+						break;
+				}
+			},
+			btnClick() {
+				this.isSect = !this.isSect
+			},
+			userBalance() {
+				userBalance().then(res => {
+					this.new_money = res.data.now_money
+					console.log(res)
+				})
+			}
+		}
+	};
+</script>
+
+<style lang="scss">
+	page {
+		height: 100%;
+		background-color: #fff;
+	}
+
+	.add-btn {
+		&.modified {
+			color: $base-color;
+		}
+
+		&.up {
+			background-color: $base-color;
+			color: #fff;
+		}
+
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		width: 604rpx;
+		height: 90rpx;
+		margin: 0 auto;
+		margin-top: 30rpx;
+		font-size: $font-lg;
+		border-radius: 10rpx;
+		// box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
+	}
+
+	.row-box {
+		margin-top: 30rpx;
+		padding: 20rpx 30rpx;
+		background: #fff;
+
+		.title {
+			font-size: $font-base + 2rpx;
+			color: $font-color-dark;
+		}
+
+		.row {
+			display: flex;
+			align-items: center;
+			position: relative;
+			height: 80rpx;
+
+			.tit {
+				flex-shrink: 0;
+				width: 40rpx;
+				font-size: 30rpx;
+				color: $font-color-dark;
+			}
+
+			.input {
+				flex: 1;
+				font-size: 30rpx;
+				color: $font-color-dark;
+			}
+
+			.iconlocation {
+				font-size: 36rpx;
+				color: $font-color-light;
+			}
+
+			.buttom {
+				color: $font-color;
+				font-size: $font-base;
+			}
+		}
+	}
+
+	.list {
+		padding-left: 30rpx;
+		margin-top: 30rpx;
+		background-color: #ffffff;
+
+		.box {
+			display: flex;
+			align-items: center;
+			width: 100%;
+			height: 120rpx;
+			border-bottom: 1px solid $border-color-light;
+
+			.icon {
+				font-size: 48rpx;
+				padding-right: 20rpx;
+			}
+
+			.iconweixin1 {
+				color: #18bf16;
+			}
+
+			.iconzhifubao {
+				color: #08aaec;
+			}
+
+			.title-box {
+				flex-grow: 1;
+				text-align: left;
+
+				.title {
+					font-size: $font-base + 2rpx;
+					color: $font-color-base;
+				}
+
+				.node {
+					font-size: $font-sm;
+					color: $font-color-light;
+				}
+			}
+		}
+	}
+
+	/deep/ .uni-radio-input {
+		width: 45rpx;
+		height: 45rpx;
+	}
+
+	.active-bg {
+		background-color: $color-gray !important;
+	}
+
+	.now {
+		width: 100%;
+		height: 86rpx;
+		padding: 0 26rpx 0 47rpx;
+		display: flex;
+		justify-content: space-between;
+		line-height: 86rpx;
+		background-color: #fff;
+		// margin-bottom: 21rpx;
+
+		view {
+			font-size: 28rpx;
+			font-weight: 500;
+			color: #333333;
+		}
+
+		.now-money {
+			font-size: 32rpx;
+			font-weight: bold;
+			color: #e1262b;
+		}
+	}
+
+	.add-wrapper {
+		width: 750rpx;
+		height: 338rpx;
+		padding-left: 30rpx;
+		background: #ffffff;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+	
+	// margin-bottom: 22rpx;
+		.add-box {
+			width: 100%;
+			height: 103rpx;
+			display: flex;
+			flex-direction: row;
+			justify-content: space-between;
+			padding: 0 39rpx 0 10rpx;
+			align-items: center;
+
+			.add-log {
+				font-size: 37rpx;
+				font-weight: bold;
+			}
+
+			input {
+				width: 218rpx;
+				height: 30rpx;
+				font-size: 32rpx;
+				font-weight: 500;
+				color: #000;
+				line-height: 40px;
+				text-align: right;
+
+				.place {
+					color: #bfbfbf;
+				}
+			}
+		}
+
+		.jg {
+			width: 100%;
+		}
+
+		.add-tags {
+			height: 234rpx;
+			padding-top: 47rpx;
+			padding-bottom: 17rpx;
+			display: flex;
+			flex-direction: row;
+			flex-wrap: wrap;
+
+			// justify-content: space-between;
+			.tag {
+				width: 210rpx;
+				height: 70rpx;
+				background-color: #f0f0f0;
+				border-radius: 4rpx;
+				margin: 0 30rpx 30rpx 0;
+				text-align: center;
+				line-height: 70rpx;
+				font-size: 22rpx;
+
+				text {
+					font-size: 32rpx;
+					font-weight: 500;
+				}
+			}
+
+			.action {
+				color: #fff;
+				background-color: #e1262b;
+			}
+		}
+	}
+
+	.btn-wrapper {
+		padding: 49rpx 32rpx 0 40rpx;
+		height: 183rpx;
+		display: flex;
+		justify-content: space-between;
+		background-color: #fff;
+
+		.iconweixin1 {
+			color: #18bf16;
+			font-size: 48rpx;
+			display: flex;
+
+			view {
+				// display: inline-block;
+				height: 48rpx;
+				text-align: 48rpx;
+				padding-left: 20rpx;
+				// padding-top: 10rpx;
+				color: #000000;
+				font-size: 30rpx;
+			}
+		}
+
+		.btn {
+			width: 36rpx;
+			height: 36rpx;
+			border: 4rpx #e1262b solid;
+			border-radius: 8rpx 8rpx;
+
+			image {
+				// display: none;
+				width: 100%;
+				height: 100%;
+			}
+
+			.action {
+				display: none;
+			}
+		}
+
+		.actiont {
+			border: none;
+		}
+	}
+
+	.main-jg {
+		width: 100%;
+		height: 21rpx;
+		background-color: #f8f6f6;
+	}
 </style>

+ 421 - 0
pages/user/myyue.vue

@@ -0,0 +1,421 @@
+<template>
+	<view class="content">
+		<view class="content-money">
+			<view class="status_bar"><!-- 这里是状态栏 --></view>
+			<view class="body-title">
+				<view class="goback-box" @click="toBack"><image class="goback" src="../../static/icon/fanhui.png" mode=""></image></view>
+				<view class="header">我的余额</view>
+			</view>
+			<view class="content-bg"><image src="../../static/img/jifen.png" mode=""></image></view>
+			<view class="money-box">
+				<view class="money">{{ userInfo.brokerage_price }}</view>
+				<view>我的余额</view>
+			</view>
+			<view class="money-btn" @click="navto('/pages/money/recharge')">
+				充值
+				<text>></text>
+			</view>
+		</view>
+		<view class="info-box flex">
+			<view class="info-item">
+				<view class="info-font">累计收入</view>
+				<view class="info-num">{{recharge}}</view>
+			</view>
+			<view class="shu"></view>
+			<view class="info-item">
+				<view class="info-font">累计支出</view>
+				<view class="info-num">{{orderStatusSum}}</view>
+			</view>
+		</view>
+		<view class="navbar">
+			<view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
+		</view>
+		<swiper :current="tabCurrentIndex" :style="{ height: maxheight }" class="swiper-box" duration="300" @change="changeTab">
+			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
+				<scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
+					<!-- 空白页 -->
+					<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
+
+					<!-- 订单列表 -->
+					<view>
+						<view class="order-item flex" v-for="(item, index) in tabItem.orderList" :key="index">
+							<view class="title-box">
+								<view class="title">
+									<text>{{ item.title }}</text>
+								</view>
+								<view class="time">
+									<text>{{ item.add_time }}</text>
+								</view>
+							</view>
+							<view class="money">
+								<view>{{ (item.pm == 0 ? '-' : '+') + item.number }}</view>
+								<view v-if="item.status == 0" class="status">待发放</view>
+							</view>
+						</view>
+					</view>
+					<uni-load-more :status="tabItem.loadingType" v-if="!(tabItem.orderList.length == 0 && tabItem.loaded)"></uni-load-more>
+				</scroll-view>
+			</swiper-item>
+		</swiper>
+	</view>
+</template>
+
+<script>
+import { spreadCommission, userBalance } from '@/api/wallet.js';
+import { getMoneyStyle } from '@/utils/rocessor.js';
+import { mapState, mapMutations } from 'vuex';
+import uniLoadMore from '@/uview-ui/components/u-loadmore/u-loadmore.vue';
+import empty from '@/uview-ui/components/u-empty/u-empty.vue';
+export default {
+	filters: {
+		getMoneyStyle
+	},
+	computed: {
+		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+	},
+	components: {
+		empty,
+		uniLoadMore
+	},
+	onReady(res) {
+		var _this = this;
+		uni.getSystemInfo({
+			success: resu => {
+				const query = uni.createSelectorQuery();
+				query.select('.swiper-box').boundingClientRect();
+				query.exec(function(res) {
+					_this.maxheight = resu.windowHeight - res[0].top + 'px';
+					console.log('打印页面的剩余高度', _this.height);
+				});
+			},
+			fail: res => {}
+		});
+	},
+	data() {
+		return {
+			// 头部图高度
+			maxheight: '',
+			tabCurrentIndex: 0,
+			orderStatusSum: 0,
+			recharge: 0,
+			navList: [
+				{
+					state: 2,
+					text: '收入',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 ,//每次信息条数
+					loaded: false
+				},
+				{
+					state: 1,
+					text: '支出',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 ,//每次信息条数
+					loaded: false
+				}
+			],
+			money: ''
+		};
+	},
+	onLoad(options) {},
+	onShow() {
+		this.loadData();
+	},
+	methods: {
+		// 页面跳转
+		navto(e) {
+			uni.navigateTo({
+				url: e
+			});
+		},
+		// 点击返回 我的页面
+		toBack() {
+			uni.navigateBack({});
+		},
+		//获取收入支出信息
+		async loadData(source) {
+			let obj = this;
+			//这里是将订单挂载到tab列表下
+			let index = this.tabCurrentIndex;
+			let navItem = this.navList[index];
+			let state = navItem.state;
+			if (source === 'tabChange' && navItem.loaded === true) {
+				//tab切换只有第一次需要加载数据
+				return;
+			}
+			if (navItem.loadingType === 'loading') {
+				//防止重复加载
+				return;
+			}
+			// 修改当前对象状态为加载中
+			navItem.loadingType = 'loading';
+
+			spreadCommission(
+				{
+					page: navItem.page,
+					limit: navItem.limit
+				},
+				state
+			)
+				.then(({ data }) => {
+					console.log(data);
+					// obj.recharge = data.income;
+					// obj.orderStatusSum = data.expend;
+					if (data.length > 0) {
+						navItem.orderList = navItem.orderList.concat(data[0].list);
+						console.log(navItem.orderList);
+						navItem.page++;
+					}else {
+						navItem.loadingType = 'noMore';
+					}
+					if (navItem.limit == data[0].list.length) {
+						//判断是否还有数据, 有改为 more, 没有改为noMore
+						navItem.loadingType = 'more';
+						return;
+					} else {
+						//判断是否还有数据, 有改为 more, 没有改为noMore
+						navItem.loadingType = 'noMore';
+					}
+					uni.hideLoading();
+					this.$set(navItem, 'loaded', true);
+				})
+				.catch(e => {
+					console.log(e);
+				});
+		},
+
+		//swiper 切换
+		changeTab(e) {
+			this.tabCurrentIndex = e.target.current;
+			this.loadData('tabChange');
+		},
+		//顶部tab点击
+		tabClick(index) {
+			this.tabCurrentIndex = index;
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background: #f1f1f1;
+	height: 100%;
+}
+.status_bar {
+	height: var(--status-bar-height);
+	width: 100%;
+}
+.content-money {
+	position: relative;
+	height: 480rpx;
+	.content-bg {
+		position: absolute;
+		top: 0;
+		left: 0;
+		right: 0;
+		width: 750rpx;
+		height: 480rpx;
+		image {
+			width: 100%;
+			height: 100%;
+		}
+	}
+	.body-title {
+		height: 80rpx;
+		text-align: center;
+		font-size: 35rpx;
+		position: relative;
+		.header {
+			position: absolute;
+			left: 0;
+			top: 0;
+			width: 100%;
+			font-size: 36rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #fffeff;
+			height: 80rpx;
+			font-size: 36rpx;
+			font-weight: 700;
+			z-index: 9;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+		}
+		.goback-box {
+			position: absolute;
+			left: 18rpx;
+			top: 0;
+			height: 80rpx;
+			display: flex;
+			align-items: center;
+		}
+
+		.goback {
+			z-index: 100;
+			width: 34rpx;
+			height: 34rpx;
+		}
+	}
+}
+.info-box {
+	width: 670rpx;
+	height: 186rpx;
+	background: #ffffff;
+	box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
+	border-radius: 20rpx;
+	margin: -100rpx auto 0;
+	position: relative;
+	z-index: 2;
+	.info-item {
+		width: 50%;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		line-height: 1;
+		.info-font {
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #999999;
+		}
+		.info-num {
+			margin-top: 30rpx;
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #181818;
+		}
+	}
+	.shu {
+		width: 2rpx;
+		height: 74rpx;
+		background: #dcdfe6;
+	}
+}
+.money-box {
+	position: relative;
+	z-index: 2;
+	padding-top: 90rpx;
+	color: #ffffff;
+	text-align: center;
+	.money {
+		font-size: 72rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #ffffff;
+	}
+	.text {
+		font-size: 30rpx;
+	}
+}
+.money-btn {
+	position: relative;
+	z-index: 2;
+	color: #ffffff;
+	padding-right: 50rpx;
+	text-align: right;
+	font-size: 30rpx;
+	font-family: PingFang SC;
+	font-weight: bold;
+	color: #FFFFFF;
+	text {
+		display: inline-block;
+		padding-left: 10rpx;
+	}
+}
+
+.navbar {
+	margin-top: 20rpx;
+	display: flex;
+	height: 88rpx;
+	padding: 0 5px;
+	background: #fff;
+	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
+	position: relative;
+	z-index: 10;
+	.nav-item {
+		flex: 1;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		height: 100%;
+		font-size: 15px;
+		color: #999999;
+		position: relative;
+		&.current {
+			color: #000;
+			&:after {
+				content: '';
+				position: absolute;
+				left: 50%;
+				bottom: 0;
+				transform: translateX(-50%);
+				width: 44px;
+				height: 0;
+				border-bottom: 2px solid #fe5b38;
+			}
+		}
+	}
+}
+//列表
+.swiper-box {
+	.order-item:last-child {
+		margin-bottom: 60rpx;
+	}
+	.order-item {
+		padding: 20rpx 30rpx;
+		line-height: 1.5;
+		.title-box {
+			.title {
+				font-size: $font-lg;
+				color: $font-color-base;
+			}
+			.time {
+				font-size: $font-base;
+				color: $font-color-light;
+			}
+		}
+		.money {
+			color: #fd5b23;
+			font-size: $font-lg;
+			text-align: right;
+			.status {
+				color: $font-color-light;
+			}
+		}
+	}
+}
+.list-scroll-content {
+	background: #ffffff;
+	height: 100%;
+}
+.content {
+	height: 100%;
+	.empty-content {
+		background-color: #ffffff;
+	}
+}
+.btn-box {
+	width: 674rpx;
+	height: 88rpx;
+	background: linear-gradient(0deg, #2e58ff, #32c6ff);
+	border-radius: 44rpx;
+	font-size: 36rpx;
+	font-family: PingFang SC;
+	font-weight: 500;
+	color: #ffffff;
+	text-align: center;
+	line-height: 88rpx;
+	position: fixed;
+	bottom: 48rpx;
+	left: 0;
+	right: 0;
+	margin: 0 auto;
+}
+</style>

+ 3 - 3
pages/user/user.vue

@@ -22,12 +22,12 @@
 					</view>
 				</view>
 				<view class="jg"></view>
-				<view class="sy-item" @click="navTo('/pages/user/award')">
+				<view class="sy-item" @click="navTo('/pages/user/myyue')">
 					<view class="sy-item-val">
-						{{ userInfo.brokerage_price }}
+						<!-- {{ userInfo.brokerage_price }} -->{{userInfo.now_money}}
 					</view>
 					<view class="sy-item-name">
-						我的佣金
+						我的余额
 					</view>
 				</view>
 			</view>

BIN
static/icon/btncz.png