lhl 2 tahun lalu
induk
melakukan
aa5627c70e
7 mengubah file dengan 863 tambahan dan 10 penghapusan
  1. 9 0
      api/user.js
  2. 15 2
      api/wallet.js
  3. 14 0
      pages.json
  4. 7 7
      pages/user/award.vue
  5. 6 1
      pages/user/user.vue
  6. 374 0
      pages/user/xfjfzz.vue
  7. 438 0
      pages/user/yue.vue

+ 9 - 0
api/user.js

@@ -192,3 +192,12 @@ export function user_product(data) {
 		data
 	});
 }
+
+
+export function jfzz(data) {
+	return request({
+		url: '/api/user/accounts',
+		method: 'post',
+		data
+	});
+}

+ 15 - 2
api/wallet.js

@@ -106,5 +106,18 @@ export function zhuanList(data) {
 		data
 	});
 }
-
-
+//
+export function yue(data) {
+	return request({
+		url: '/api/now_money/list',
+		method: 'get',
+		data
+	});
+}
+export function yj(data) {
+	return request({
+		url: '/api/brokerage/list',
+		method: 'get',
+		data
+	});
+}

+ 14 - 0
pages.json

@@ -450,6 +450,20 @@
 				"navigationBarTitleText": "我的团队",
 				"navigationStyle": "custom"
 			}
+		},
+		{
+			"path": "pages/user/yue",
+			"style": {
+				"navigationBarTitleText": "我的余额",
+				"navigationStyle": "custom"
+			}
+		},
+		{
+			"path": "pages/user/xfjfzz",
+			"style": {
+				"navigationBarTitleText": "",
+				"navigationStyle": "custom"
+			}
 		}
 	],
 	"subPackages": [{

+ 7 - 7
pages/user/award.vue

@@ -66,7 +66,7 @@
 </template>
 
 <script>
-import { spreadCommission, userBalance } from '@/api/wallet.js';
+import { spreadCommission, userBalance,yj } from '@/api/wallet.js';
 import { mapState, mapMutations } from 'vuex';
 import { getMoneyStyle } from '@/utils/rocessor.js';
 import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
@@ -106,7 +106,7 @@ export default {
 			zc: '',
 			navList: [
 				{
-					state: 0,
+					state: 1,
 					text: '收入',
 					loadingType: 'more',
 					orderList: [],
@@ -114,7 +114,7 @@ export default {
 					limit: 10 //每次信息条数
 				},
 				{
-					state: 1,
+					state: 0,
 					text: '支出',
 					loadingType: 'more',
 					orderList: [],
@@ -163,12 +163,12 @@ export default {
 			//修改当前对象状态为加载中
 			navItem.loadingType = 'loading';
 
-			spreadCommission(
+			yj(
 				{
 					page: navItem.page,
-					limit: navItem.limit
-				},
-				state
+					limit: navItem.limit,
+					pm: navItem.state
+				}
 			)
 				.then(({ data }) => {
 					console.log(data, '123456');

+ 6 - 1
pages/user/user.vue

@@ -26,7 +26,12 @@
 					<view class="user-shopname">团长</view>
 				</view>
 			</view>
-			<view class="user-money flex">
+			<view class="user-money flex">
+				<view class="user-money-item" @click="navTo('/pages/user/yue')">
+					<view class="user-money-num">{{ userInfo.now_money || 0 }}</view>
+					<view class="user-money-font">我的余额</view>
+				</view>
+				<view class="user-xian"></view>
 				<view class="user-money-item" @click="navTo('/pages/user/award')">
 					<view class="user-money-num">{{ userInfo.brokerage_price || 0 }}</view>
 					<view class="user-money-font">我的收益</view>

+ 374 - 0
pages/user/xfjfzz.vue

@@ -0,0 +1,374 @@
+<template>
+	<view class="content">
+		<view class="content-money">
+			<view class="flex">
+				<view class="buttom">
+					<view class="icon" v-if="type== 1">{{ userInfo.integral | getMoneyStyle }}</view>
+					<view class="icon" v-if="type== 2">{{ userInfo.dynamic_integral | getMoneyStyle }}</view>
+					<view class="icon" v-if="type== 3">{{ userInfo.now_money | getMoneyStyle }}</view>
+					<text class="text">可转账余额</text>
+				</view>
+			</view>
+		</view>
+		<view class="row-box">
+			<view class="title">收款人UID</view>
+			<view class="row"><input class="input" type="number" v-model="card" placeholder="请输入收款人UID"
+					placeholder-class="placeholder" /></view>
+		</view>
+		<view class="row-box">
+			<view class="title">转账金额</view>
+			<view class="row">
+				<!-- <text class="tit">¥</text> -->
+				<input class="input" type="number" v-model="withdrawal" placeholder="转入金额"
+					placeholder-class="placeholder" />
+				<view class="buttom" @click="withdrawal = userInfo.integral" v-if="type== 1">全部转账</view>
+				<view class="buttom" @click="withdrawal = userInfo.dynamic_integral" v-if="type== 2">全部转账</view>
+			</view>
+		</view>
+		<button class="add-btn up" :class="{ action: loding }" @click="!loding ? confirm() : ''">转账</button>
+	</view>
+</template>
+
+<script>
+	import {
+		getMoneyStyle
+	} from '@/utils/rocessor.js';
+	import {
+		getUserInfo,
+		jfzz
+	} from '@/api/user.js';
+	import {
+		mapMutations,
+		mapState
+	} from 'vuex';
+	export default {
+		filters: {
+			getMoneyStyle
+		},
+		data() {
+			return {
+				money: '0.00', //可提现金额
+				withdrawal: '', //提现金额
+				password: '', //支付密码
+				card: '', //转账卡号
+				name: '',
+				// #ifdef H5
+				weichatBsrowser: false,
+				// #endif
+				loding: false,
+				type: 0
+			};
+		},
+		onLoad(options) {
+			// #ifdef H5
+			this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
+			// #endif
+			this.dataUp();
+			if (options.type) {
+				this.type = options.type;
+				console.log(this.type);
+				if(this.type == 1) {
+					uni.setNavigationBarTitle({
+						title:'静态积分转账'
+					})
+				}else if(this.type == 2){
+					uni.setNavigationBarTitle({
+						title:'动态积分转账'
+					})
+				}else if(this.type == 3){
+					uni.setNavigationBarTitle({
+						title:'余额转账'
+					})
+				}
+			}
+		},
+		computed: {
+			...mapState('user', ['userInfo'])
+		},
+		methods: {
+			...mapMutations('user', ['setUserInfo', 'login']),
+			// 更新数据
+			dataUp() {
+				let obj = this;
+				getUserInfo({})
+					.then(e => {
+						obj.login();
+						// 保存返回用户数据
+						obj.setUserInfo(e.data);
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
+			// 切换选中对象
+			tabRadio(e) {
+				this.type = e.detail.value;
+			},
+			// 提交
+			confirm() {
+				let obj = this;
+				obj.loding = true;
+				if (obj.withdrawal == 0) {
+					obj.loding = false;
+					uni.showModal({
+						title: '提示',
+						content: '转账金额不要为0'
+					});
+					return;
+				}
+				if (obj.card == obj.userInfo.uid) {
+					obj.loding = false;
+					uni.showModal({
+						title: '提示',
+						content: '不要输入自己的用户账号'
+					});
+					return
+				}
+				let data = {
+					uid: obj.card, //编号
+					price: obj.withdrawal ,//金额
+					type: obj.type
+				};
+				jfzz(data)
+					.then(e => {
+				
+						// 允许按钮点击
+						obj.loding = false;
+						// 初始化提现金额
+						obj.withdrawal = '';
+						uni.showToast({
+							title: '转账成功',
+							duration: 2000,
+							position: 'top'
+						});
+						obj.dataUp();
+						obj.cancel()
+					})
+					.catch(e => {
+						obj.$api.msg(e.msg);
+						obj.loding = false;
+						console.log();
+					});
+			},
+			boblack() {
+				uni.navigateBack({
+					fail() {
+						uni.switchTab({
+							url: '/pages/index/index'
+						})
+					}
+				})
+			},
+		}
+	};
+</script>
+
+<style lang="scss">
+	page {
+		height: 100%;
+	}
+
+	.content-money {
+		padding: 30rpx 0;
+		background: #ffffff;
+	}
+
+	.item {
+		padding: 0 $page-row-spacing;
+		background-color: #ffffff;
+	}
+
+	.flex {
+		background-color: #ffffff;
+		text-align: center;
+		margin: 0 30rpx;
+		border-radius: $border-radius-sm;
+		justify-content: center;
+
+		.buttom {
+			font-size: $font-lg;
+			width: 50%;
+		}
+
+		.interval {
+			width: 2px;
+			height: 60rpx;
+			background-color: #eeeeee;
+		}
+
+		.icon {
+			background-size: 100%;
+			font-size: 42rpx;
+			color: $font-color-dark;
+			font-weight: bold;
+			background-repeat: no-repeat;
+			background-position: center;
+		}
+
+		.text {
+			color: $font-color-light;
+		}
+	}
+
+	.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: #f21f5d;
+				font-size: $font-base;
+			}
+		}
+	}
+
+	.add-btn {
+		width: 520rpx;
+		height: 80rpx;
+		border-radius: 20rpx;
+		margin: 140rpx auto 0;
+		font-size: 36rpx;
+		font-weight: bold;
+		color: #a67452;
+		background-color: #e5c498;
+	}
+
+	.back-btn {
+		width: 520rpx;
+		height: 80rpx;
+		border-radius: 20rpx;
+		margin: 40rpx auto;
+		font-size: 36rpx;
+		font-weight: bold;
+		color: #303030;
+		background-color: #F8DABA;
+	}
+
+	.name {
+		background: #fff;
+		padding: 30rpx;
+	}
+
+	.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;
+
+				.icon-img {
+					height: 50rpx;
+					width: 50rpx;
+				}
+			}
+
+			.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;
+				}
+			}
+		}
+	}
+
+	.tip {
+		padding: 20rpx;
+		color: #ff0000;
+	}
+
+	/deep/ .uni-radio-input {
+		width: 45rpx;
+		height: 45rpx;
+	}
+
+	.psw-wrapper {
+		width: 548rpx;
+		height: 344rpx;
+		background-color: #FFFFFF;
+		border-radius: 15rpx 15rpx;
+
+		.psw-title {
+			width: 100%;
+			font-size: 35rpx;
+			padding: 43rpx 0 49rpx;
+			text-align: center;
+			font-weight: 800;
+		}
+
+		.psw-ipt {
+			display: block;
+			background-color: #dce3ed;
+			height: 90rpx;
+			width: 464rpx;
+			padding-left: 30rpx;
+			margin: 0 auto;
+			font-size: 80rpx;
+		}
+
+		.psw-btn text {
+			display: inline-block;
+			text-align: center;
+			width: 50%;
+			padding-top: 29rpx;
+			font-size: 35rpx;
+		}
+
+		.psw-qd {
+			color: #5771DF;
+		}
+	}
+</style>

+ 438 - 0
pages/user/yue.vue

@@ -0,0 +1,438 @@
+<template>
+	<view class="content">
+		<view class="content-money">
+			<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/jfbg.png" mode=""></image></view>
+				<view class="money-box">
+					<view class="money">{{ userInfo.now_money | getMoneyStyle }}</view>
+					<view>余额</view>
+				</view>
+				<view class="moneybtn-box">
+					<!-- <view class="money-btn" style="text-decoration: underline;" @click="navto('/pages/money/freeze')">冻结记录</view> -->
+					<view class="money-btn" style="text-decoration: underline;"></view>
+					<view class="money-btn" @click="navto('/pages/user/xfjfzz?type=3')">余额互转</view>
+				</view>
+			</view>
+		</view>
+		<view class="info-box flex">
+			<!-- <view class="info-item">
+				<view class="info-font">冻结中</view>
+				<view class="info-num">111</view>
+			</view> -->
+			<view class="shu"></view>
+			<view class="info-item">
+				<view class="info-font">累计收入</view>
+				<view class="info-num">{{ sr }}</view>
+			</view>
+			<view class="shu"></view>
+			<view class="info-item">
+				<view class="info-font">累计支出</view>
+				<view class="info-num">{{ zc }}</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 class="order-item flex" v-for="(item, index) in tabItem.orderList" :key="index">
+						<view class="title-box">
+							<view class="title">
+								<text>{{ item.mark }}</text>
+							</view>
+							<view class="time">
+								<text>{{ item.add_time }}</text>
+							</view>
+						</view>
+						<view class="money">
+							<text>{{ (item.pm == 0 ? '-' : '+') + item.number }}</text>
+						</view>
+					</view>
+					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
+				</scroll-view>
+			</swiper-item>
+		</swiper>
+	</view>
+</template>
+
+<script>
+import { spreadCommission, userBalance, yue } from '@/api/wallet.js';
+import { mapState, mapMutations } from 'vuex';
+import { getMoneyStyle } from '@/utils/rocessor.js';
+import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+import empty from '@/components/empty';
+import { getUserInfo } from '@/api/user.js';
+export default {
+	filters: {
+		getMoneyStyle
+	},
+	computed: {
+		...mapState('user', ['userInfo'])
+	},
+	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.maxheight);
+				});
+			},
+			fail: res => {}
+		});
+	},
+	data() {
+		return {
+			// 头部图高度
+			maxheight: '',
+			tabCurrentIndex: 0,
+			sr: '',
+			zc: '',
+			navList: [
+				{
+					state: 1,
+					text: '收入',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页面
+					limit: 10 //每次信息条数
+				},
+				{
+					state: 0,
+					text: '支出',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页面
+					limit: 10 //每次信息条数
+				}
+			],
+			money: ''
+		};
+	},
+	onLoad(options) {},
+	onShow() {
+		this.getUserInfo();
+		this.loadData();
+		//获取用户余额
+		// userBalance({}).then(({ data }) => {
+		// 	this.money = data.commissionCount;
+		// });
+	},
+	methods: {
+		...mapMutations('user', ['setUserInfo']),
+		navto(e) {
+			uni.navigateTo({
+				url: e
+			});
+		},
+		getUserInfo() {
+			getUserInfo({}).then(({ data }) => {
+				this.setUserInfo(data);
+			});
+		},
+		async loadData(source) {
+			const 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';
+
+			yue(
+				{
+					page: navItem.page,
+					limit: navItem.limit,
+					pm: navItem.state
+				}
+			)
+				.then(({ data }) => {
+					console.log(data, '123456');
+					obj.sr = data.sr;
+					obj.zc = data.zc;
+					if (data.list.length > 0) {
+						navItem.orderList = navItem.orderList.concat(data.list);
+						console.log(navItem.orderList);
+						navItem.page++;
+					}
+					//判断是否还有数据, 有改为more, 没有改为noMore
+					if (navItem.limit == data.list.length) {
+						navItem.loadingType = 'more';
+						return;
+					} else {
+						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;
+		},
+		toBack() {
+			uni.navigateBack();
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background: #f2f5f4;
+	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;
+		}
+	}
+}
+
+.money-box {
+	position: relative;
+	z-index: 2;
+	padding-top: 70rpx;
+	color: #ffffff;
+	text-align: center;
+	.money {
+		font-size: 72rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #ffffff;
+	}
+	.text {
+		font-size: 30rpx;
+	}
+}
+.moneybtn-box {
+	display: flex;
+	justify-content: space-between;
+	position: relative;
+	z-index: 2;
+	color: #ffffff;
+	padding: 20rpx 50rpx;
+	font-size: 30rpx;
+	font-family: PingFang SC;
+	font-weight: bold;
+	color: #ffffff;
+}
+
+.navbar {
+	margin-top: 25rpx;
+	display: flex;
+	height: 40px;
+	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: $font-color-dark;
+		position: relative;
+
+		&.current {
+			color: #000;
+			font-weight: bold;
+
+			&:after {
+				content: '';
+				position: absolute;
+				left: 50%;
+				bottom: 0;
+				transform: translateX(-50%);
+				width: 44px;
+				height: 0;
+				border-bottom: 2px solid rgba(154, 94, 25, 1);
+			}
+		}
+	}
+}
+
+//列表
+
+.swiper-box {
+	.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: rgba(239, 58, 85, 1);
+			font-size: $font-lg;
+		}
+	}
+}
+.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;
+	}
+}
+
+.list-scroll-content {
+	background-color: #ffffff;
+	height: 100%;
+}
+
+.content {
+	height: 100%;
+
+	.empty-content {
+		background-color: #ffffff;
+	}
+}
+
+.btm-wrap {
+	height: 140rpx;
+	width: 750rpx;
+	position: fixed;
+	bottom: 0;
+	left: 0;
+	background-color: #fff;
+
+	.btn {
+		width: 674rpx;
+		height: 88rpx;
+		line-height: 88rpx;
+		margin: auto;
+		background: linear-gradient(-22deg, #9a5e19, #9a5e19);
+		border-radius: 44rpx;
+		text-align: center;
+		font-size: 36rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #ffffff;
+	}
+}
+</style>