xuhaolan há 3 anos atrás
pai
commit
c3467d8d4f

+ 62 - 0
api/finance.js

@@ -0,0 +1,62 @@
+import request from '@/utils/request'
+import {upFilse} from '@/utils/request'
+
+export function moneyLog(data,code){
+ return request({
+	 //地址
+	 url:'/api/money/log/'+code,
+	 //请求方式
+	 method:'get',
+	 //内容
+	 data
+ })
+}
+export function wallet(data){
+	return request({
+		url:'/api/wallet',
+		method:'get',
+		data
+	})
+}
+export function goPay(data) {
+	return request({
+		url: '/api/trade/go_pay',
+		method: 'POST',
+		data
+	});
+}
+export function recharge(data) {
+	return request({
+		url: '/api/recharge/money',
+		method: 'post',
+		data
+	});
+}
+export function shan(data) {
+	return request({
+		url: '/api/money/exchange',
+		method: 'POST',
+		data
+	});
+}
+export function cash(data) {
+	return request({
+		url: '/api/extract/cash',
+		method: 'POST',
+		data
+	});
+}
+export function cashmoney_type(data) {
+	return request({
+		url: '/api/cash/money_type',
+		method: 'get',
+		data
+	});
+}
+export function calculator(data) {
+	return request({
+		url: '/api/extract/calculator',
+		method: 'post',
+		data
+	});
+}

+ 51 - 3
pages.json

@@ -24,6 +24,22 @@
 				"navigationBarTitleText": "商城首页"
 			}
 		},
+		{
+			"path": "pages/user/yongjin",
+		
+			"style": {
+				"navigationBarTitleText": "我的佣金",
+				"navigationBarBackgroundColor": "transparent",
+				"navigationBarTextStyle": "white",
+				"app-plus": {
+					"titleNView": {
+						"type": "float",
+						"titleText": "我的佣金"
+					}
+				}
+			}
+		
+		},
 		{
 			"path": "pages/public/register",
 			"style": {
@@ -242,6 +258,12 @@
 				}
 			}
 		},
+		{
+			"path": "pages/user/integralTransforms",
+			"style": {
+				"navigationBarTitleText": "积分转账"
+			}
+		},
 		{
 			"path": "pages/user/withdrawal",
 			"style": {
@@ -255,6 +277,14 @@
 				"navigationBarTitleText": "收藏夹"
 			}
 		},
+		{
+			"path": "pages/collection/collection",
+			"style": {
+				"navigationBarTitleText": "收款方式",
+				"enablePullDownRefresh": false
+			}
+		
+		},
 		{
 			"path": "pages/order/order",
 			"style": {
@@ -263,6 +293,15 @@
 					"bounce": "none"
 				}
 			}
+		},
+		{
+			"path": "pages/money/withdraw",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
+		
+		
 		},
 		{
 			"path": "pages/order/expressInfo",
@@ -338,7 +377,16 @@
 		{
 			"path": "pages/category/category",
 			"style": {
-				"navigationBarTitleText": "品牌故事"
+				"navigationBarTitleText": "梦乡水"
+			}
+		},
+		{
+			"path": "pages/user/extension",
+			"style": {
+				"navigationBarTitleText": "我的推广",
+				"app-plus": {
+					"titleNView": false
+				}
 			}
 		},
 		{
@@ -365,7 +413,7 @@
 	},
 	"tabBar": {
 		"color": "#C0C4CC",
-		"selectedColor": "#5ad5eb",
+		"selectedColor": "#4388EB",
 		"borderStyle": "black",
 		"backgroundColor": "#ffffff",
 		"list": [{
@@ -378,7 +426,7 @@
 				"pagePath": "pages/category/category",
 				"iconPath": "static/tabBar/tab-cate.png",
 				"selectedIconPath": "static/tabBar/tab-cate-current.png",
-				"text": "品牌故事"
+				"text": "梦乡水"
 			},
 			{
 				"pagePath": "pages/cart/cart",

+ 1 - 1
pages/cart/cart.vue

@@ -418,7 +418,7 @@ export default {
 		height: 76rpx;
 		line-height: 76rpx;
 		font-size: $font-base + 2rpx;
-		background: $base-color;
+		background: linear-gradient(90deg, #3C82E6, #5395F5);
 	}
 }
 /* 复选框选中状态 */

+ 164 - 0
pages/collection/collection.vue

@@ -0,0 +1,164 @@
+<template>
+	<view class="content">
+		<view class="collection-box">
+			<view class="collection-item" @click="navTo('/pages/collection/bank')">
+				<view class="left">
+					<view class="img">
+						<image src="../../static/user/bank.png" mode=""></image>
+					</view>
+					<view class="bank">
+						银行卡
+					</view>
+				</view>
+				<view class="gg">
+					<view class="status" v-if="bankData.fullname!= null">
+						{{bankData.fullname}}
+					</view>
+					<view class="status" v-else>
+						未添加
+					</view>
+					
+					<view class="img1" >
+						<image src="../../static/user/right.png" mode=""></image>
+					</view>
+				</view>
+			</view>
+			<view class="collection-item" @click="navTo('/pages/collection/zfb')">
+				<view class="left">
+					<view class="img">
+						<image src="../../static/user/zfb.png" mode=""></image>
+					</view>
+					
+					<view class="bank" >
+						支付宝
+					</view>
+					
+				</view>
+				<view class="gg">
+					<view class="status" v-if="aliData.fullname !=null">{{aliData.fullname}}
+						
+					</view>
+					<view class="status" v-else>
+						未添加
+					</view>
+					<view class="img1">
+						<image src="../../static/user/right.png" mode=""></image>
+					</view>
+				</view>
+			</view>
+			<!-- <view class="collection-item" @click="navTo('/pages/collection/wx')">
+				<view class="left">
+					<view class="img">
+						<image src="../../static/user/wx.png" mode=""></image>
+					</view>
+					<view class="bank">
+						微信
+					</view>
+				</view>
+				<view class="gg">
+					<view class="status">
+						未添加
+					</view>
+					<view class="img1">
+						<image src="../../static/user/right.png" mode=""></image>
+					</view>
+				</view>
+			</view> -->
+		</view>
+	</view>
+</template>
+
+<script>
+	import { mapState, mapMutations } from 'vuex';
+	export default {
+		data() {
+			return {
+				bankData:{fullname:'',bank:'',bankno:''},
+				aliData:{fullname:'',alino:''},
+				wxData:{wxname:'',wxImg:''}
+		}},
+		computed:{
+			...mapState('user',['userInfo','orderInfo','hasLogin'])
+		},
+		onShow(){
+			console.log(this.userInfo)
+			this.bankData.fullname = this.userInfo.bank_user_name;
+			this.aliData.fullname = this.userInfo.alipay_name
+		},
+		methods:{
+			navTo(url){
+				console.log(url);
+				uni.navigateTo({
+					url
+				})
+			}
+		}
+	}
+</script>
+<style lang="scss">
+	page,
+	.content {
+		height: 100%;
+		margin: 0;
+		height: 0;
+	}
+
+	.collection-box {
+		background: #FFFFFF;
+		margin: 50rpx 20rpx;
+		width: 710rpx;
+		display: flex;
+		flex-direction: column;
+
+		.collection-item {
+			margin: 35rpx 30rpx;
+			display: flex;
+			justify-content: space-between;
+
+			.left {
+				display: flex;
+
+				.img {
+					height: 40rpx;
+					width: 40rpx;
+
+					image {
+						height: 100%;
+						width: 100%;
+					}
+				}
+
+				.bank {
+					margin-left: 25rpx;
+					font-size: 26rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #333333;
+				}
+			}
+
+			.gg {
+				display: flex;
+
+				.status {
+					font-size: 26rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #999999;
+					margin-right: 20rpx;
+				}
+
+				.img1 {
+					width: 15rpx;
+					height: 25rpx;
+
+					image {
+						width: 100%;
+						height: 100%;
+
+					}
+				}
+			}
+		}
+	}
+</style>

+ 6 - 5
pages/index/index.vue

@@ -23,19 +23,19 @@
 		</view>
 		<view class="cate-section">
 			<view class="cate-item" @click="nav('/pages/category/category')">
-				<image src="/static/icon/c3.png"></image>
+				<image src="/static/icon/index01.png"></image>
 				<view class="cate-font">品牌介绍</view>
 			</view>
 			<view class="cate-item" @click="nav('/pages/category/articleList')">
-				<image src="/static/icon/c5.png"></image>
+				<image src="/static/icon/index02.png"></image>
 				<view class="cate-font">产品百科</view>
 			</view>
 			<view class="cate-item" @click="showPopup()">
-				<image src="/static/icon/c7.png"></image>
+				<image src="/static/icon/index03.png"></image>
 				<view class="cate-font">免费咨询</view>
 			</view>
 			<view class="cate-item">
-				<image src="/static/icon/c8.png"  @click="nav('/pages/user/shareQrCode')"></image>
+				<image src="/static/icon/index04.png"  @click="nav('/pages/user/shareQrCode')"></image>
 				<view class="cate-font">邀请有礼</view>
 			</view>
 		</view>
@@ -269,6 +269,7 @@ page,
 
 	.input-content {
 		border-radius: 99rpx;
+		
 		flex-grow: 1;
 		padding: 5rpx 30rpx;
 		// background-color: rgba(231, 231, 231, 0.7);
@@ -294,7 +295,7 @@ page,
 .top {
 	width: 1000rpx;
 	height: 282rpx;
-	background: linear-gradient(180deg, #08c4e6, #50ead2);
+	background:#3C82E6;
 	overflow: hidden;
 	text-align: center;
 	border-bottom-left-radius: 50%;

+ 448 - 0
pages/money/withdraw.vue

@@ -0,0 +1,448 @@
+<template>
+	<view class="exchangeIntegral">
+		<view class="integral">
+			<view class="">
+				可提现金额
+			</view>
+			<view class="num">
+				{{integral}}
+			</view>
+		</view>
+		<view class="applyIntegral flex">
+			<view class="">
+				申请提现金额
+			</view>
+
+			<input type="number" class="num" v-model="num" />
+		</view>
+		<view class="all" @click="all"> <text>满{{minPrice}}可提现</text><text>全部转换</text></view>
+		<view class="between">
+
+		</view>
+		<view class="list" v-if="!weichatBsrowser">
+			<radio-group @change="tabRadio">
+				<!-- <label>
+					<view class="box">
+						<view class="icon iconfont iconweixin1"></view>
+						<view class="title-box">
+							<view class="title"><text>提现至微信</text></view>
+						</view>
+						<view class="right"><radio value="weixin" color="#5dbc7c" :checked="type == 'weixin'" /></view>
+					</view>
+				</label> -->
+				<label>
+					<view class="box">
+						<view class="icon iconfont iconzhifubao"></view>
+						<view class="title-box">
+							<view class="title">
+								<text v-if="aliData.fullname != null">提现至支付宝</text>
+								<text v-else>请创建支付宝账号</text>
+							</view>
+							<view class="node">
+								<text v-if="aliData.fullname != null">真实姓名({{ aliData.fullname }})</text>
+							</view>
+						</view>
+						<view class="right">
+							<radio value="alipay" style="transform:scale(0.7)" color="#5395F5"
+								:checked="type == 'alipay'" />
+						</view>
+					</view>
+				</label>
+				<label>
+					<view class="box">
+						<view class="icon iconfont">
+							<image class="icon-img" src="/static/icon/i8.png" mode="aspectFit"></image>
+						</view>
+						<view class="title-box">
+							<view class="title">
+								<text v-if="bankData.bankno != null">{{ bankData.bank + ' ' + bankData.bankno }}</text>
+								<text v-else>请创建银行账号</text>
+							</view>
+							<view class="node">
+								<text v-if="bankData.fullname != null">真实姓名({{ bankData.fullname}})</text>
+							</view>
+						</view>
+						<view class="right">
+							<radio value="bank" color="#5395F5" style="transform:scale(0.7)"
+								:checked="type == 'bank'" />
+						</view>
+					</view>
+				</label>
+			</radio-group>
+		</view>
+		<!-- <view class="bottom">
+			<view class="box">
+				<view class="title">
+					提现到
+				</view>
+				<radio-group name="">
+					
+				
+				<view class="box-content">
+					<view class="box-left">
+						<view class="img">
+							<image src="../../static/user/wx.png" mode=""></image>
+						</view>
+						<text>微信支付</text>
+					</view>
+					<label class="radio">
+						<radio value="" style="transform:scale(0.7)" />
+					</label>
+				</view>
+				<view class="box-content">
+					<view class="box-left">
+						<view class="img1 img">
+							<image src="../../static/user/bank.png" mode=""></image>
+						</view>
+						<text>银行账户</text>
+					</view>
+					<label class="radio">
+						<radio value="" style="transform:scale(0.7)" />
+					</label>
+				</view>
+				</radio-group>
+			</view>
+			<view class="button" @click="submit">提交申请</view>
+		</view> -->
+		<button class="add-btn up" @click="confirm">提交申请</button>
+		<button class="add-btn modified" v-if="!weichatBsrowser"
+			@click="navTo('/pages/collection/collection')">账号管理</button>
+	</view>
+</template>
+
+<script>
+	import {
+		getMoneyStyle
+	} from '@/utils/rocessor.js';
+	import {
+		extractCash,
+		extractBank,
+		aliInfo,
+		bankInfo
+	} from '@/api/wallet.js';
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	export default {
+		computed: {
+			...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+		},
+		data() {
+			return {
+				type: 'alipay', //提现方式
+				integral: '', //可提现金额
+				num: '', //提现金额
+				withdrawal: '', //提现金额
+				minPrice: 1000, //最少提现金额
+				aliData: {
+					fullname: '',
+					alino: ''
+				},
+				bankData: {
+					fullname: '',
+					bank: '',
+					bankno: ''
+				},
+				// #ifdef H5
+				weichatBsrowser: false
+				// #endif
+			}
+		},
+		onShow() {
+			this.weichatBsrowser = uni.getStorageSync('weichatBsrowser')
+			//加载提现金额信息
+			this.loadData();
+			//拿到用户的提现方式信息
+			this.aliData.fullname = this.userInfo.alipay_name;
+			console.log(this.userInfo);
+			this.aliData.alino = this.userInfo.alipay_code;
+			this.bankData.fullname = this.userInfo.bank_user_name;
+			this.bankData.bank = this.userInfo.bank_name;
+			this.bankData.bankno = this.userInfo.bank_code;
+		
+	},
+	methods: {
+		//提交带提现接口
+		confirm(){
+			//需要给到提现接口的信息
+			let data = {
+				extract_type: this.type, //bank -银行卡 alipay-支付宝 weixin-微信
+				money: this.withdrawal, //金额
+				money_type: "brokerage" //0佣金1余额
+			}
+			console.log(data);
+			if(this.type == 'alipay'){
+				data.name = this.aliData.fullName;
+				data.alipay_code = this.aliData.alino;
+			}
+			if (this.type == 'bank') {
+				data.name = this.bankData.fullname;
+				data.bankname = this.bankData.bank;
+				data.cardnum = this.bankData.bankno;
+			}
+			extractCash(data).then(
+			e=>{
+				console.log(data,'111111111')
+				uni.navigateTo({
+					url:'/pages/money/success?type=1'
+				})
+			}).catch(e=>{
+				console.log()
+			})
+		},
+			//加载余额信息
+			async loadData() {
+				extractBank({}).then(({
+					data
+				}) => {
+					console.log(data, '余额');
+					this.integral = data.brokerage_price //可提现金额
+					this.minPrice = data.minPrice //最小提现金额
+					this.num = data.commissionCount //提现金额
+				})
+
+			},
+			navTo(url) {
+				uni.navigateTo({
+					url
+				})
+			},
+			all() {
+				this.num = this.integral
+			},
+			//切换选中对象
+			tabRadio(e) {
+				console.log(e, '选中方式')
+				//type 提现方式  
+				this.type = e.detail.value
+			}
+			// submit() {
+			// 	if(this.integral < this.num) {
+			// 		this.all()
+			// 	}
+			// }
+		},
+		// watch: {
+		// 	num() {
+		// 		if(this.integral < this.num) {
+		// 			this.all()
+		// 		}
+		// 	}
+		// }
+	}
+</script>
+
+<style lang="scss" scoped>
+	page,
+	.exchangeIntegral {
+		background-color: #FFFFFF;
+		height: 100%;
+
+		.integral,
+		.applyIntegral {
+			display: flex;
+			justify-content: space-between;
+			padding: 30rpx;
+			background-color: #FFFFFF;
+			margin-bottom: 5rpx;
+			font-size: 30rpx;
+
+			.num {
+				font-size: 40rpx;
+				text-align: right;
+				max-width: 400rpx;
+			}
+		}
+
+		.between {
+			width: 100%;
+			height: 20rpx;
+			background-color: #F7F7F7
+		}
+
+		.all {
+			display: flex;
+			justify-content: space-between;
+			width: 100%;
+			height: 80rpx;
+			line-height: 80rpx;
+			margin-top: 2rpx;
+			background-color: #fff;
+			padding: 0 30rpx;
+			margin-bottom: 20rpx;
+
+			text:nth-child(1) {
+
+				font-size: 24rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #999999;
+
+			}
+
+			text:nth-child(2) {
+				font-size: 26rpx;
+				font-family: SourceHanSansCN;
+				font-weight: 400;
+				color: #438BED;
+
+			}
+		}
+
+		.bottom {
+			width: 750rpx;
+
+
+			background: #FFFFFF;
+			padding: 20rpx;
+
+			.box {
+				margin-bottom: 120rpx;
+				display: flex;
+				flex-direction: column;
+
+				.title {
+					display: flex;
+					margin-bottom: 10rpx;
+					font-size: 30rpx;
+					font-family: SourceHanSansCN;
+					font-weight: 400;
+					color: #333333;
+				}
+
+				.box-content {
+					padding: 20rpx;
+					border-bottom: 1rpx solid #E6E6E6;
+
+					display: flex;
+					justify-content: space-between;
+
+					.box-left {
+						display: flex;
+
+						.img {
+
+							width: 40rpx;
+							height: 40rpx;
+
+							image {
+								width: 100%;
+								height: 100%;
+							}
+						}
+
+						text {
+							margin-left: 30rpx;
+							font-size: 26rpx;
+							font-family: SourceHanSansCN;
+							font-weight: 400;
+							color: #515151;
+						}
+					}
+
+					.radio {
+						width: 20rpx;
+						height: 20rpx;
+
+						radio {
+
+							width: 20rpx;
+							height: 20rpx;
+						}
+
+					}
+				}
+			}
+		}
+
+		// .img1{
+		// 	width: 40rpx;
+		// 	height: 30rpx;
+		// 	image{
+		// 		width: 100%;
+		// 		height: 100%;
+		// 	}
+		// }
+		.button {
+
+			background: linear-gradient(90deg, #3C82E6, #5395F5);
+			color: #fff;
+			width: 670rpx;
+			padding: 20rpx;
+			font-size: 30rpx;
+			border-radius: 10rpx;
+			text-align: center;
+			margin: 0 auto;
+		}
+	}
+
+	.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;
+				}
+			}
+		}
+	}
+
+	.add-btn {
+		&.modified {
+			color:  #5395F5;
+		}
+
+		&.up {
+			background: linear-gradient(90deg, #3C82E6, #5395F5);
+			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);
+	}
+</style>

+ 1 - 1
pages/set/address.vue

@@ -202,7 +202,7 @@ page {
 	height: 80rpx;
 	font-size: $font-lg;
 	color: #fff;
-	background: linear-gradient(90deg, #08C4E6, #50EAD2);
+	background: linear-gradient(90deg, #3C82E6, #5395F5);
 	border-radius: 10rpx;
 }
 </style>

+ 21 - 2
pages/user/award.vue

@@ -3,8 +3,11 @@
 		<view class="content-money">
 			<view class="money-box">
 				<view class="goback-box" @click="toBack"><image class="goback" src="../../static/img/fanhui.png" mode=""></image></view>
+				<view class="yue" @click="navto('/pages/user/integralTransforms')">
+					余额转账
+				</view>
 				<view class="header">我的余额</view>
-				<image class="money_bg" src="../../static/img/anchor11.png"></image>
+				<image class="money_bg" src="../../static/user/yue1.png"></image>
 				<view class="money">{{ money | getMoneyStyle }}</view>
 			</view>
 
@@ -234,6 +237,22 @@ page {
 	text-align: center;
 	position: relative;
 	background-color: pink;
+	.yue{
+		position: absolute;
+		right: 0;
+		z-index: 9999;
+		text-align: center;
+		line-height: 50rpx;
+		top: 100rpx;
+		width: 142rpx;
+		height: 50rpx;
+		background: #FFFFFF;
+		border-radius: 7rpx;
+		font-size: 26rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #458AEC;
+	}
 	.header {
 		// margin-top: var(--status-bar-height);
 		// background-color: pink;
@@ -379,7 +398,7 @@ page {
 .wallet-btn {
 	width: 674rpx;
 	height: 88rpx;
-	background: linear-gradient(90deg, #08c4e6, #50ead2);
+	background: linear-gradient(90deg, #3C82E6, #5395F5);
 	border-radius: 44rpx;
 	font-size: $font-lg;
 	font-family: PingFang SC;

+ 439 - 0
pages/user/extension.vue

@@ -0,0 +1,439 @@
+<template>
+	<view class="content">
+		<view class="content-money">
+			<view class="status_bar"><!-- 这里是状态栏 --></view>
+				<image class="tuiguang_bg" src="../../static/img/share-bg.png"></image>
+			<view class="money-box">
+				<view class="goback-box" @click="toBack"><image class="goback" src="../../static/img/fanhui.png" mode=""></image></view>
+				<view class="header">我的团队</view>
+				<view class="money-frame">
+					<!-- <view class="money_name">我的推广</view> -->
+					<view class="money_num">
+						<text class="money_ren">共</text>
+						{{ all || '0' }}
+						<text class="money_ren">人</text>
+					</view>
+				</view>
+			</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 class="list-scroll-content" scroll-y @scrolltolower="loadData">
+					<!-- 空白页 -->
+					<!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
+
+					<!-- 订单列表 -->
+					<view v-for="(item, index) in tabItem.orderList" :key="index" class="order-item flex">
+						<view class="title-box flex_item">
+							<view class="title-avatar"><image :src="item.avatar"></image></view>
+							<view class="list_tpl">
+								<view class="title">
+									<view class="title-name clamp">{{ item.nickname }}</view>
+								</view>
+								<view class="time">
+									<text>{{ item.time }}</text>
+								</view>
+							</view>
+						</view>
+					</view>
+					<!-- <uni-load-more :status="tabItem.loadingType"></uni-load-more> -->
+				</scroll-view>
+			</swiper-item>
+		</swiper>
+	</view>
+</template>
+<script>
+import { spread } from '@/api/user.js';
+import { mapState, mapMutations } from 'vuex';
+export default {
+	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,
+			navList: [
+				{
+					state: 0,
+					text: '直接推荐',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				}
+			],
+			all: '',
+			list: ''
+		};
+	},
+	onLoad(options) {},
+	onShow() {
+		this.loadData();
+	},
+	methods: {
+		// 页面跳转
+		navto(e) {
+			uni.navigateTo({
+				url: e
+			});
+		},
+		//获取收入支出信息
+		async loadData(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;
+			}
+			if (navItem.loadingType === 'noMore') {
+				//防止重复加载
+				return;
+			}
+			// 修改当前对象状态为加载中
+			navItem.loadingType = 'loading';
+			spread({
+				page: navItem.page,
+				limit: navItem.limit
+			})
+				.then(({ data }) => {
+					this.total = data.total;
+					this.totalLevel = data.totalLevel;
+					this.all = this.total + this.totalLevel;
+					if (data.list.length > 0) {
+						this.list = data.list;
+						navItem.orderList = navItem.orderList.concat(data.list);
+						navItem.page++;
+					}
+					this.$nextTick(function() {
+						if (navItem.limit == data.list.length) {
+							//判断是否还有数据, 有改为 more, 没有改为noMore
+							navItem.loadingType = 'more';
+							return;
+						} else {
+							//判断是否还有数据, 有改为 more, 没有改为noMore
+							navItem.loadingType = 'noMore';
+						}
+					});
+					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.switchTab({
+				url: '/pages/user/user'
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.status_bar {
+	height: var(--status-bar-height);
+	width: 100%;
+}
+page {
+	background: #f8f8f8;
+	height: 100%;
+}
+
+.content-money {
+	background: $page-color-base;
+	position: relative;
+	.tuiguang_bg {
+		width: 750rpx;
+		height: 484rpx;
+		position: absolute;
+		top: 0;
+		left: 0;
+		right: 0;
+	}
+	.buttom-box {
+		position: relative;
+		background-color: #ffffff;
+		text-align: center;
+		margin: 0 30rpx;
+		padding: 30rpx 0;
+		border-radius: $border-radius-sm;
+		margin-top: -80rpx;
+
+		.buttom {
+			font-size: $font-lg;
+			flex-grow: 1;
+
+			.money {
+				font-weight: bold;
+				font-size: 32rpx;
+				color: #ff0000;
+			}
+		}
+
+		.text {
+			color: #666666;
+		}
+
+		.interval {
+			width: 2rpx;
+			height: 60rpx;
+			background-color: #eeeeee;
+		}
+
+		.icon {
+			height: 50rpx;
+			width: 48rpx;
+			margin: 0 auto;
+
+			.icon-img {
+				width: 100%;
+				height: 100%;
+			}
+		}
+	}
+}
+
+.money-box {
+	// background: $base-color;
+	height: 484rpx;
+	color: #ffffff;
+	text-align: center;
+	font-size: 35rpx;
+	position: relative;
+
+	// padding-top: 60rpx;
+	.header {
+		position: absolute;
+		left: 0;
+		top: 0;
+		width: 100%;
+		height: 80rpx;
+		font-size: 32rpx;
+		font-weight: 700;
+		z-index: 99;
+		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;
+	}
+	.right {
+		position: absolute;
+		top: 140rpx;
+		right: 40rpx;
+		text-align: right;
+		line-height: 1;
+		.right-num {
+			font-size: 50rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+
+			color: #ffffff;
+		}
+		.right-font {
+			margin-top: 10rpx;
+			font-size: 24rpx;
+			font-family: PingFang SC;
+			font-weight: 400;
+			color: #ffffff;
+		}
+		.time {
+			font-size: 26rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #ffffff;
+			line-height: 35px;
+		}
+	}
+	.user {
+		position: absolute;
+		top: 140rpx;
+		left: 34rpx;
+		display: flex;
+		justify-content: flex-start;
+		align-items: center;
+		z-index: 10;
+		.avtor {
+			width: 102rpx;
+			height: 102rpx;
+			border-radius: 50%;
+			position: relative;
+			.portrait {
+				width: 100%;
+				height: 100%;
+				border-radius: 50%;
+			}
+			.he {
+				position: absolute;
+				height: 30rpx;
+				bottom: -4rpx;
+				left: 0;
+				.image {
+					width: 102rpx;
+					height: 30rpx;
+				}
+			}
+		}
+		.name {
+			margin-left: 30rpx;
+			font-size: 36rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #ffffff;
+			display: flex;
+			justify-content: start;
+			.name-left {
+				width: 220rpx;
+			}
+			.name-right {
+				margin-left: 20rpx;
+				width: 50rpx;
+				height: 60rpx;
+				position: relative;
+				image {
+					width: 100%;
+					height: 100%;
+				}
+				.level {
+					position: absolute;
+					top: 35%;
+					left: 50%;
+					margin-left: -12rpx;
+					font-size: 20rpx;
+				}
+			}
+		}
+		.id {
+			margin-left: 30rpx;
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #ffffff;
+		}
+	}
+
+	.money_img {
+		width: 100%;
+		height: 120rpx;
+		text-align: center;
+		padding-top: 50rpx;
+		padding-bottom: 135rpx;
+
+		image {
+			width: 120rpx;
+			height: 120rpx;
+			border: 4rpx solid #fd5f6f;
+			border-radius: 50%;
+		}
+	}
+
+	.money-frame {
+		position: absolute;
+		top: 0;
+		width: 100%;
+		padding-top: 200rpx;
+	}
+	.money_num {
+		font-size: 72rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #ffffff;
+
+		.money_ren {
+			font-size: 36rpx;
+		}
+	}
+}
+
+.order-item {
+	padding: 20rpx 30rpx;
+	line-height: 1.5;
+
+	.title-box {
+		width: 100%;
+
+		.title-avatar {
+			width: 100rpx;
+			height: 100rpx;
+			margin-right: 25rpx;
+			border-radius: 100%;
+			image {
+				width: 100%;
+				height: 100%;
+				border-radius: 100%;
+			}
+		}
+
+		.list_tpl {
+			width: 85%;
+
+			.title {
+				display: flex;
+				justify-content: flex-start;
+				font-size: $font-lg;
+				color: #000000;
+				overflow: hidden; //超出的文本隐藏
+				text-overflow: ellipsis; //溢出用省略号显示
+				white-space: nowrap;
+				line-height: 1;
+				text-align: center;
+				.title-name {
+					max-width: 100%;
+				}
+			}
+
+			.time {
+				font-size: $font-base;
+				color: $font-color-light;
+			}
+		}
+	}
+
+	.money {
+		color: #db1935;
+		font-size: $font-lg;
+	}
+}
+</style>

+ 169 - 0
pages/user/integralTransforms.vue

@@ -0,0 +1,169 @@
+<template>
+	<view class="integralTransforms">
+		<view class="header">
+			<text class="title">{{ jifen || '0.00' }}</text><br>
+			<text>可转换余额</text>
+		</view>
+		<view class="account">
+			<text class="title">收款人账户</text>
+			<input type="number" placeholder="请输入收款人账户" v-model="account" />
+		</view>
+		<view class="num">
+			<text class="title">转账数量</text>
+			<view class="">
+				<text class="ti">¥</text>
+				<input type="number" v-model.number="num" placeholder="请输入转账数量" />
+			</view>
+		</view>
+		<view class="num">
+			<text class="title">交易密码</text>
+			<view class="">
+				<text class="ti">¥</text>
+				<input type="password" v-model.number="password" placeholder="请输入交易密码" />
+			</view>
+		</view>
+		<view class="button" @click="submit">
+			提交申请
+		</view>
+	</view>
+</template>
+
+<script>
+import { goPay,moneyLog, recharge, wallet } from '@/api/finance.js';
+import { mapState, mapMutations } from 'vuex';
+	
+	export default {
+		data() {
+			return {
+				password:'',//交易密码
+				jifen:'',//可转积分
+				num: '', //转账数量
+				account: '', //收款人账户
+				type:''
+			}
+		},
+		methods: {
+			
+			submit() {
+				let obj = this
+				if(obj.account == ''){
+					obj.$api.msg('请输入对方账号ID')
+					return
+				}
+				if(obj.num ==''){
+					obj.$api.msg('请输入转账数量')
+					return
+				}
+				if(obj.password == ''){
+					obj.$api.msg("请输入交易密码")
+				}
+				if(obj.account == this.userInfo.uid){
+					obj.$api.msg('请勿转账给自己')
+					return
+				}
+				goPay({
+					
+					type: 'SCJF',
+					num: obj.num,
+					to_uid: obj.account,
+					trade_psw: obj.password,
+					// to_user_account: obj.account
+				}).then(data =>{
+					console.log(data,'转账')
+					obj.num = ''
+					obj.account = ''
+					obj.password = ''
+					uni.navigateTo({
+						url:'/pages/money/success'
+					})
+				})
+				
+				
+			}
+		},
+		computed: {
+
+			//积分
+			// integral() {
+			// 	return this.$store.state.user.userInfo.integral
+			// 	console.log(UserInfo)
+			// },
+			...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+		},
+		onLoad(option) {
+		
+			console.log(this.userInfo)
+			wallet({}).then(({data}) => {
+				const obj = this
+				const arr = Object.keys(data.back)
+				console.log(data.back)
+				arr.forEach(e => {
+					if(e =='SCJF'){
+						obj.jifen = (data.back[e].money.money * 1)
+						console.log(obj.jifen)
+					}
+					
+				})
+			})
+		},
+		watch: {
+			num() {
+				if (this.num > this.jifen) {
+					this.num = this.jifen
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.integralTransforms {
+
+		.header,
+		.account,
+		.num {
+			background-color: #fff;
+			margin: 20rpx 0;
+			padding: 30rpx;
+
+			input {
+				margin-top: 10rpx;
+			}
+
+			.title {
+				font-size: 30rpx;
+				color: #333333;
+				font-family: PingFang-SC-Regular;
+			}
+		}
+
+		.header {
+			text-align: center;
+
+			text:nth-child(1) {
+				font-size: 45rpx;
+			}
+
+			text:nth-child(3) {
+				font-size: 30rpx;
+				color: #666666;
+			}
+		}
+
+		.num {
+			.ti {
+				float: left;
+			}
+		}
+
+		.button {
+			width: 520rpx;
+			margin: 60rpx auto;
+			padding: 20rpx;
+			text-align: center;
+			border-radius: 10rpx;
+			background: linear-gradient(90deg, #438BED 0%, #44BFEC 100%);
+			color: #fff;
+		}
+	}
+</style>

+ 268 - 243
pages/user/shareQrCode.vue

@@ -1,282 +1,307 @@
 <template>
-	<view class="content">
-		<!-- <view class="qrimg">
-			<tki-qrcode
-				:cid="cid"
-				ref="qrcode"
-				:val="val"
-				:size="size"
-				:unit="unit"
-				:background="background"
-				:foreground="foreground"
-				:pdground="pdground"
-				:icon="icon"
-				:iconSize="iconSize"
-				:lv="lv"
-				:onval="onval"
-				:loadMake="loadMake"
-				:usingComponents="usingComponents"
-				@result="qrR"
-			/>
-		</view> -->
-		<!-- #ifndef MP-ALIPAY -->
-		<canvas :class="{ qrimg: !loading }" @longtap="alertCanv" id="qrShareBox" canvas-id="qrShareBox" class="tki-qrcode-canvas" />
+	<view class="andr-shQ-padL30 andr-shQ-padR30 andr-shQ-Flex andr-shQ-FlexDirC">
+		<view class="andr-shQ-w100B andr-shQ-Flex andr-shQ-JusCC">
+			<swiper class="imgw750h375 matop"  :indicator-dots="false" :current="current" @change="currentChange" >
+				<swiper-item v-for="(item, index) in rwmListArr" :key="index"><image :src="item.wap_poster" mode="aspectFit" class="imgw750h375" /></swiper-item>
+			</swiper>
+		</view>
+		<view class="baocun" @click="comfirm(userInfo.uid+'')">复制邀请码</view>
+		<!-- #ifdef H5 -->
+		<!-- <view class="baocun">长按二维码保存图片</view> -->
+		
 		<!-- #endif -->
-		<!-- #ifdef MP-ALIPAY -->
-		<canvas :class="{ qrimg: !loading }" @longtap="alertCanv" id="qrShareBox" class="tki-qrcode-canvas" />
+		<!-- #ifdef MP-WEIXIN -->
+		<view class="baocun" @click="seav">保存图片并转发</view>
+		<!-- <button open-type="share" class="baocun btn" v-if="scLoading == 2">分享到微信</button> -->
 		<!-- #endif -->
-		<view :style="{ display: loading ? 'none' : 'block' }" class="tki-qrcode-canvas"><image :src="ctxSrc" mode="scaleToFill" class="tki-qrcode-canvas"></image></view>
-		<view class="share-bottom flex" :class="{ 'action-share-bottom': !loading }" @click="loading ? showImg() : ''">
-			<text>{{ loading ? '点击生成图片' : '长按二维码下载' }}</text>
-		</view>
 	</view>
 </template>
-
 <script>
-// import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
+import { mapState } from 'vuex';
 import { spreadBanner } from '@/api/user.js';
+import { interceptor, saveUrl } from '@/utils/loginUtils';
+// #ifdef H5
+import { weixindata } from '@/utils/wxAuthorized';
+// #endif
 export default {
-	// components: { tkiQrcode },
 	data() {
 		return {
-			cid: 'tki-qrcode-canvas', //canvasId,页面存在多个二维码组件时需设置不同的ID
-			size: 180, //生成的二维码大小
-			unit: 'upx', //大小单位尺寸
-			// show: true,//默认使用组件中的image标签显示二维码
-			val: '', //要生成的内容
-			background: '#ffffff', //二维码背景色
-			foreground: '#333333', //二维码前景色
-			pdground: '#333333', //二维码角标色
-			icon: '', //二维码图标URL(必须是本地图片,网络图需要先下载至本地)
-			iconSize: 40, //二维码图标大小
-			lv: 3, //容错级别
-			onval: false, //监听val值变化自动重新生成二维码
-			loadMake: false, //组件初始化完成后自动生成二维码,val需要有值
-			usingComponents: false, //是否使用了自定义组件模式(主要是为了修复非自定义组件模式时 v-if 无法生成二维码的问题)
-			showLoading: false, //是否显示loading
-			loadingText: '二维码生成中', //loading文字
-			src: '', // 二维码生成后的图片地址或base64
-			ratio: 1, //页面比例用于计算
-			ctxSrc: '', //要显示的图片
-			loading: true,//是否载入图片中
-			canHeight: '',//画布高度
-			canWeidth: ''//画布宽度
+			rwmListArr: [],
+			current: 0,
+			imgSrc: ''
 		};
 	},
-	onLoad() {
-		this.loadCodeList()
+	onLoad(option) {
+		uni.showLoading({
+			title: '邀请图生成中',
+			mask: true
+		});
+		// 判断是否强制登录
+		this.loadCodeList();
+		// #ifdef MP-WEIXIN
+		uni.authorize({
+			scope: 'scope.writePhotosAlbum',
+			complete() {}
+		});
+		// #endif
 	},
-	onReady() {
-		let obj = this;
-		let query = uni.createSelectorQuery();
-		// 获取页面比例
-		query
-			.select('.content')
-			.fields(
-				{
-					size: true
-				},
-				e => {
-					// 保存比例
-					this.ratio = e.width / 750;
-				}
-			)
-			.exec();
-		// 获取画布宽高信息
-		query
-			.select('#qrShareBox')
-			.fields(
-				{
-					size: true
-				},
-				e => {
-					// 保存画布宽高信息
-					obj.canHeight = e.height;
-					obj.canWeidth = e.width;
-				}
-			)
-			.exec();
+	onShow() {
+		if (this.loginInterceptor && !this.hasLogin) {
+			saveUrl();
+			// 登录拦截
+			interceptor();
+		}
+	},
+    //下拉刷新
+    onPullDownRefresh() {
+    	let obj = this;
+    	//监听下拉刷新动作的执行方法,每次手动下拉刷新都会执行一次
+    	setTimeout(function() {
+    		obj.loadCodeList();
+    		uni.stopPullDownRefresh(); //停止下拉刷新动画
+    	}, 1000);
+    },
+	computed: {
+		...mapState(['weichatObj', 'baseURL', 'urlFile']),
+		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
 	},
 	methods: {
+		comfirm(text) {
+			// let text = this.userInfo.uid
+			console.log(text);
+			const result = this.uniCopy(text);
+			if (result === false) {
+				uni.showToast({
+					title: '不支持'
+				});
+			} else {
+				uni.showToast({
+					title: '复制成功',
+					icon: 'none'
+				});
+			}
+			// this.$refs.popup.close();
+		},
+		uniCopy(content) {
+			/**
+			 * 小程序端 和 app端的复制逻辑
+			 */
+			//#ifndef H5
+			uni.setClipboardData({
+				data: content,
+				success: function() {
+					console.log('success');
+					return true;
+				}
+			});
+			//#endif
+		
+			/**
+			 * H5端的复制逻辑
+			 */
+			// #ifdef H5
+			if (!document.queryCommandSupported('copy')) {
+				//为了兼容有些浏览器 queryCommandSupported 的判断
+				// 不支持
+				return false;
+			}
+			let textarea = document.createElement('textarea');
+			textarea.value = content;
+			textarea.readOnly = 'readOnly';
+			document.body.appendChild(textarea);
+			textarea.select(); // 选择对象
+			textarea.setSelectionRange(0, content.length); //核心
+			let result = document.execCommand('copy'); // 执行浏览器复制命令
+			textarea.remove();
+			return result;
+			// #endif
+		},
 		loadCodeList() {
+			let self = this;
 			// 加载二维码信息
+			// let andrUid = uni.getStorageSync('andrUid')||'';
 			spreadBanner({
 				// #ifdef H5
 				type: 2,
 				// #endif
 				// #ifdef MP
-				type: 1
+				type: 1,
 				// #endif
 			}).then(e => {
-				// #ifdef MP
-				// 保存二维码图片
-				uni.downloadFile({
-					url: e.data[0].wap_posterQr,
-					success(res) {
-						if (res.errMsg == 'downloadFile:ok') {
-							obj.src = res.tempFilePath;
-							// 生成画布
-							obj.loadImg(obj.src);
-							uni.hideLoading();
-						}
-						console.log(res);
-					},
-					fail(e) {
-						console.log(e);
-					}
-				})
-				// #endif
-				// #ifdef H5
-					// 保存二维码图片
-					this.src =  e.data[0].wap_posterQr;
-					// 生成画布
-					this.loadImg(e.data[0].wap_posterQr);
-				// #endif
-				
-			}).catch((e) => {
-					uni.showModal({
-						title: '生成失败请刷新页面',
-						showCancel: false
-					});
-					uni.hideLoading();
-				});;
-		},
-		// 长按画布事件
-		alertCanv() {
-			uni.showModal({
-				title: '请先点击生成图片再下载',
-				showCancel: false
-			});
-		},
-		// 生成图片
-		showImg() {
-			uni.showLoading({
-				title: '图片生成中',
-				mask: true
+				if (e.status == 200) {
+					console.log(e.data)
+					self.rwmListArr = e.data;
+					// #ifdef H5
+					self.imgSrc = self.rwmListArr[0].wap_poster;
+					// #endif
+					// #ifdef MP-WEIXIN
+					self.imgSrc = self.rwmListArr[0].poster;
+					// #endif
+				}
+				uni.hideLoading();
 			});
-			let obj = this;
-			//因为和uni.showLoading载入效果冲突需要延迟执行生成图片方法
-			setTimeout(function() {
-				uni.canvasToTempFilePath({
-					x: 0,
-					y: 0,
-					width: obj.canWeidth,
-					height: obj.canHeight,
-					destWidth: obj.canWeidth,
-					destHeight: obj.canHeight,
-					fileType: 'jpg',
-					quality: 1,
-					canvasId: 'qrShareBox',
-					success: res => {
-						uni.hideLoading();
-						uni.showModal({
-							title: '创建成功,长按二维码下载图片',
-							showCancel: false
-						});
-						// 显示生成的图片
-						obj.loading = false;
-						// 保存图片base64
-						obj.ctxSrc = res.tempFilePath;
-					},
-					fail(e) {
-						console.log(e);
-					}
-				});
-			}, 50);
-		},
-		// 开始渲染画布
-		loadImg(src) {
-			const obj = this;
-			const cavWidth=523;//画布宽度
-			const cavHeight=700;//画布高度
-			const ratio = obj.ratio;//获取页面比例
-			const ctxBg = '/static/img/img14.jpg'; //画布背景
-			let context = uni.createCanvasContext('qrShareBox');
-			const codeSize = obj.size * ratio; //计算二维码大小
-			const codeX = ((cavWidth - obj.size) * ratio) / 2; //二维码所在x轴位置
-			const codeY = cavHeight * ratio; //二维码所在y轴位置
-			const codeBoxColor = '#FFFFFF'; //包裹框颜色
-			const codeBoxWidht = 0; //包裹边框宽度
-			const codeBoxSize = (codeBoxWidht / 2) * ratio; //计算二维码白色包裹框大小
-			const codeBoxX = codeX - codeBoxSize; //包裹框初始X轴
-			const codeBoxY = codeY - codeBoxSize; //包裹框初始Y轴
-			const codeBoxEnd = codeSize + codeBoxWidht * ratio; //计算包裹框大小
-			const fontTop = codeY + codeBoxEnd + (codeBoxWidht + 20) * this.ratio; //文字距离上边距高度
-			const fontSize = 24 * ratio; //文字大小
-			const fontText = ''; //文字内容
-			const fontLeft = (codeSize - fontSize * fontText.length) / 2 + codeX; //文字左侧距离
-			// 插入背景图片
-			context.drawImage(ctxBg, 0, 0, obj.canWeidth, obj.canHeight);
-			// // 插入文字
-			context.setFontSize(fontSize);
-			context.fillText(fontText, fontLeft, fontTop);
-			// 插入边框
-			context.beginPath();//开始画线
-			context.setLineJoin('round'); //边框类型
-			context.setLineWidth(codeBoxWidht * ratio);
-			context.setStrokeStyle(codeBoxColor); //设置包裹框颜色
-			context.strokeRect(codeBoxX, codeBoxY, codeBoxEnd, codeBoxEnd);
-			context.stroke();//渲染线条
-			// 插入二维码
-			context.drawImage(src, codeX, codeY, codeSize, codeSize);
-			// 开始渲染
-			context.draw();
-		},
-		// 創建二维码
-		creatQrcode() {
-			this.$refs.qrcode._makeCode();
-		},
-		// 保存二维码到图库
-		saveQrcode() {
-			this.$refs.qrcode._saveCode();
 		},
-		// 生成二维码后返回base64
-		qrR(res) {
-			this.src = res;
+		currentChange(e) {
+			this.current = e.detail.current;
 		},
-		//清空二维码(清空二维码会触发result回调 返回值为空)
-		clearQrcode(e) {
-			this.$refs.qrcode._clearCode();
-			this.val = '';
+		// onShareAppMessage(options){
+		// 	console.log(options,'options')
+		// 	let userInfo = uni.getStorageSync('userInfo');
+		// 	console.log(userInfo)
+		//   let obj = this;
+		//   // 设置菜单中的转发按钮触发转发事件时的转发内容
+		//   let shareObj = {
+		//     title: "邀请好友领券",        // 默认是小程序的名称(可以写slogan等)
+		//     path: '/pages/index/index?spread='+userInfo.uid,        // 默认是当前页面,必须是以‘/’开头的完整路径
+		//     imageUrl: obj.imgSrc,
+		//     success: function(res){
+		//       // 转发成功之后的回调
+		//       if(res.errMsg == 'shareAppMessage:ok'){
+		//       }
+		//     },
+		//     fail: function(){
+		//       // 转发失败之后的回调
+		//       if(res.errMsg == 'shareAppMessage:fail cancel'){
+		//         // 用户取消转发
+		//       }else if(res.errMsg == 'shareAppMessage:fail'){
+		//         // 转发失败,其中 detail message 为详细失败信息
+		//       }
+		//     }
+		//   };
+		//   // 来自页面内的按钮的转发
+		//   if( options.from == 'button' ){
+		//     // 此处可以修改 shareObj 中的内容
+		//     shareObj.path = '/pages/index/index?spread='+userInfo.uid;
+		//         console.log(shareObj.path,'shareObj.path')
+		//   }
+		//   // 返回shareObj
+		//   return shareObj;
+		// },
+		// scClick() {
+		// 	let self = this;
+		// 	// #ifdef H5
+		// 	self.imgSrc = self.rwmListArr[self.current].wap_poster;
+		// 	// #endif
+		// 	// #ifdef MP-WEIXIN
+		// 	self.imgSrc = self.rwmListArr[self.current].poster;
+		// 	// #endif
+		// },
+		// #ifdef MP-WEIXIN
+		seav() {
+			uni.getImageInfo({
+				src: this.imgSrc,
+				complete: function (result) {
+					let path = result.path;
+					uni.getSetting({
+						success(res) {
+							console.log(res)
+							if (!res.authSetting['scope.writePhotosAlbum']) {
+								uni.authorize({
+									scope:'scope.writePhotosAlbum',
+									success(res) {
+										uni.saveImageToPhotosAlbum({
+											filePath:path,
+											complete(result) {
+											}
+										});
+									},
+									complete(result) {
+									    uni.showToast({
+									         title: '请先授权保存图片',
+									         duration: 2000,
+											 icon:'none'
+									    });
+										obj.seav();
+									}
+								})
+							}else{
+								uni.saveImageToPhotosAlbum({
+									filePath:path,
+									complete(result) {
+									     uni.showToast({
+									         title: '保存图片成功!',
+									         duration: 2000,
+											 icon:'none'
+									     });
+									}
+								});
+							}
+						}
+					});
+				}
+			});
 		}
+		// #endif
 	}
 };
 </script>
 
 <style lang="scss">
-.content {
-	padding-top: 30rpx;
+.imgw750h375 {
+	width: 700rpx;
+	height: 958rpx;
 }
-// #qrShareBox {
-// 	position: absolute;
-// 	left: -9999rpx;
-// 	top: -9999rpx;
-// }
-
-.qrimg {
-	position: absolute;
-	left: -9999rpx;
-	top: -9999rpx;
+.matop{
+	margin-top: 40rpx;
 }
-.tki-qrcode-canvas {
-	// width: 700rpx;
-	// height: 1245rpx;
-	width: 532rpx;
-	height: 945rpx;
-	margin: 0 auto;
+.andr-shQ-padL30 {
+	padding-left: 30rpx;
 }
-.share-bottom {
-	width: 560rpx;
-	height: 80rpx;
-	color: #ffffff;
-	background-color: $base-color;
-	margin: 0 auto;
-	font-size: $font-lg - 2rpx;
-	margin-top: 30rpx;
-	border-radius: 99rpx;
+.andr-shQ-padR30 {
+	padding-right: 30rpx;
+}
+.andr-shQ-Flex {
+	display: flex;
+}
+.andr-shQ-FlexDirC {
+	flex-direction: column;
+}
+.andr-shQ-w100B {
+	width: 100%;
+}
+.andr-shQ-JusCC {
 	justify-content: center;
-	&.action-share-bottom {
-		background-color: $color-gray;
-	}
 }
+.andr-shQ-marginT30 {
+	margin-top: 30rpx;
+}
+.andr-shQ-bgc06B163 {
+	background-color: $base-color;
+}
+.andr-shQ-cFFF {
+	color: #ffffff;
+}
+.andr-shQ-bdR50 {
+	border-radius: 50rpx;
+}
+.andr-shQ-h86 {
+	height: 86rpx;
+}
+.andr-shQ-AIC {
+	align-items: center;
+}
+.baocun {
+	color: #ffffff;
+	background: $base-color;
+	text-align: center;
+	width: 80%;
+	margin: 50rpx auto;
+	font-size: 28rpx;
+	padding: 25rpx 0rpx;
+	border-radius: 50rpx;
+}
+.btn{
+	padding: 0rpx 0rpx !important;
+	margin: 0rpx auto;
+	margin-bottom: 100rpx;
+}
+/* #ifdef H5 */
+.cbnagan {
+	width: 80%;
+	background: $base-color;
+	margin: 50rpx auto;
+	font-size: 28rpx;
+	text-align: center;
+}
+/* #endif */
 </style>

+ 69 - 46
pages/user/user.vue

@@ -11,32 +11,37 @@
 						<view class="portrait-box" @click="navTo('/pages/set/userinfo')">
 							<image class="portrait" :src="userInfo.avatar || '/static/error/missing-face.png'"></image>
 						</view>
-						<view class="info-box" v-if="userInfo.level != 3">
-							<view class="username">{{ userInfo.nickname || '游客' }}</view>
-							<!-- <view class="font-size-sm" v-if="userInfo.spread_uid">邀请码:{{ userInfo.spread_uid }}</view> -->
-							<!-- <view class="user-lv">
-								<view class="lv-1" v-if="userInfo.level == 1">普通会员</view>
-								<view class="lv-2" v-if="userInfo.level == 2">
-									<image src="../../static/img/lv02.png" mode=""></image>
+						<view class="left">
+							<view class="info-box" v-if="userInfo.level != 3">
+								<view class="username">{{ userInfo.nickname || '游客' }}</view>
+								<!-- <view class="font-size-sm" v-if="userInfo.spread_uid">邀请码:{{ userInfo.spread_uid }}</view> --> 
+								<view class="user-lv">
+									<view class="lv-1" v-if="userInfo.level == 1">普通会员</view>
+									<view class="lv-2" v-if="userInfo.level == 2">
+										<image src="../../static/img/img009.png" mode=""></image>
+									</view>
+									<view class="lv-3" v-if="userInfo.level == 3">
+										<image src="../../static/img/img009.png" mode=""></image>
+									</view>
+									<view class="lv-3" v-if="userInfo.level == 4">
+										<image src="../../static/img/img009.png" mode=""></image>
+									</view>
 								</view>
-								<view class="lv-3" v-if="userInfo.level == 3">
-									<image src="../../static/img/lv03.png" mode=""></image>
-								</view>
-								<view class="lv-3" v-if="userInfo.level == 4">
-									<image src="../../static/img/lv04.png" mode=""></image>
+							</view>
+							<view class="info-box" v-else>
+								<view class="username-t">{{ userInfo.nickname || '游客' }}
+									<image  mode=""></image>
 								</view>
-							</view> -->
-						</view>
-						<view class="info-box" v-else>
-							<view class="username-t">{{ userInfo.nickname || '游客' }}
-								<image  mode=""></image>
+							</view>
+							<view class="phone">
+								<text>18252757278</text>
 							</view>
 						</view>
-
+						
 					</view>
 					<view class="my-info flex" @click="navTo('/pages/set/userinfo')" v-if="hasLogin">
-						<image src="../../static/icon/i6.png" mode=""></image>
-						<view class="title">我的资料</view>
+						<image src="../../static/user/set.png" mode=""></image>
+						<view class="title">设置</view>
 					</view>
 				</view>
 			</view>
@@ -90,19 +95,19 @@
 			<view>
 				<view class="item-box item-box-a">
 					<view class="order-section">
-						<view class="order-item" @click="navTo('/pages/money/wallet')" hover-class="common-hover"
+						<view class="order-item" @click="navTo('/pages/user/award')" hover-class="common-hover"
 							:hover-stay-time="50">
 							<view class="icon icon-b">
 								<image class="icon-img" src="/static/user/yue.png" mode="aspectFit"></image>
 							</view>
-							<text>收益中心</text>
+							<text>我的余额</text>
 						</view>
-						<view class="order-item" @click="navTo('/pages/user/award')" hover-class="common-hover"
+						<view class="order-item" @click="navTo('/pages/user/yongjin')" hover-class="common-hover"
 							:hover-stay-time="50">
 							<view class="icon icon-b">
 								<image class="icon-img" src="/static/user/yongjin.png" mode="aspectFit"></image>
 							</view>
-							<text>我的钱包</text>
+							<text>我的佣金</text>
 						</view>
 						<view class="order-item" @click="navTo('/pages/user/shareQrCode')" hover-class="common-hover"
 							:hover-stay-time="50" >
@@ -122,7 +127,7 @@
 				</view>
 				<view class="history-section icon">
 					<uni-list>
-						<uni-list-item title="我的推广" @click="navTo('/pages/user/team')"
+						<uni-list-item title="我的收藏" @click="navTo('/pages/user/favorites')"
 							thumb="/static/user/shoucang.png" ></uni-list-item>
 						<uni-list-item title="收货地址" @click="navTo('/pages/set/address')" thumb="/static/user/dizhi.png">
 						</uni-list-item>
@@ -454,7 +459,7 @@
 			top: 0;
 			width: 100%;
 			height: 100%;
-			background: linear-gradient(180deg, #08C4E6, #50EAD2);
+			background: linear-gradient(180deg, #3C82E6, #5395F5);
 			// z-index: 1;
 			// background-color: $base-color;
 			image {
@@ -486,28 +491,40 @@
 					border-radius: 50%;
 				}
 			}
-
-			.info-box {
+			.left{
 				margin-left: 20rpx;
 				line-height: 1.5;
+				padding: 20rpx 0;
+				height: 180rpx;
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				
+			.info-box {
 
+				
+				display: flex;
+				justify-content: center;
+				align-items: center;
+			
 				.username {
 					font-size: $font-lg + 6rpx;
 					height: 100%;
-
+			
 					image {
 						display: inline-block;
 						width: 147rpx;
 						height: 32rpx;
 					}
 				}
-
+				
+			
 				.username-t {
 					font-size: $font-lg + 6rpx;
 					// height: 32rpx;
 					display: flex;
 					align-items: center;
-
+			
 					image {
 						display: inline-block;
 						margin-left: 10rpx;
@@ -515,18 +532,18 @@
 						height: 32rpx;
 					}
 				}
-
+			
 				.user-get {
 					font-size: $font-lg;
-
+			
 					text {
 						font-size: $font-lg + 6rpx;
 					}
 				}
-
+			
 				.user-lv {
 					display: flex;
-
+			
 					.lv-1 {
 						text-align: center;
 						width: 150rpx;
@@ -538,19 +555,22 @@
 						font-weight: 400;
 						color: #ffffff;
 					}
-
+			
 					.lv-2,
 					.lv-3 {
 						width: 147rpx;
 						height: 32rpx;
-
+			
 						image {
 							height: 100%;
 							width: 100%;
 						}
 					}
 				}
+			}	
 			}
+
+			
 		}
 
 		.config {
@@ -563,23 +583,26 @@
 		}
 
 		.my-info {
-			width: 194rpx;
-			height: 64rpx;
-			background: #ffffff;
-			border-radius: 32rpx 0rpx 0rpx 32rpx;
+			margin-right: 30rpx;
+			width: 130rpx;
+			height: 51rpx;
+			border: 1rpx solid #FFFFFF;
+			border-radius: 26rpx;
+			background: linear-gradient(180deg, #3C82E6);
+			
 			justify-content: center;
 
 			image {
-				width: 30rpx;
-				height: 30rpx;
+				width: 28rpx;
+				height: 27rpx;
 			}
 
 			.title {
 				padding-left: 9rpx;
-				font-size: 28rpx;
+				font-size: 24rpx;
 				font-family: PingFang SC;
 				font-weight: 500;
-				color: #ff4c4c;
+				color: #fff;
 			}
 		}
 	}
@@ -733,7 +756,7 @@
 			.icon {
 				height: 50rpx;
 				width: 48rpx;
-				margin-bottom: 18rpx;
+				margin-bottom: 14rpx;
 				background-size: 100%;
 				background-repeat: no-repeat;
 				background-position: center;

+ 278 - 0
pages/user/yongjin.vue

@@ -0,0 +1,278 @@
+<template>
+	<view class="content">
+		<view class="header">
+			<image src="../../static/user/yongjin1.png" mode=""></image>
+			<view class="integral">{{ userInfo.brokerage_price || '0.00' }}</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" class="swiper-box" duration="300" @change="changeTab">
+			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
+				<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
+					<!-- 空白页 -->
+					<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
+
+					<!-- 订单列表 -->
+					<view v-for="(item, index) in tabItem.orderList" :key="index" class="order-item flex">
+						<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">
+							<text>{{ (item.pm == 0 ? '-' : '+') + item.number }}</text>
+						</view>
+					</view>
+					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
+				</scroll-view>
+			</swiper-item>
+		</swiper>
+		<!-- <view class="button">
+			<navigator url="/pages/user/integralTransforms" class="b-left">积分转账</navigator>
+			<navigator url="/pages/user/exchangeIntegral" class="b-right">转换购物积分</navigator>
+		</view> -->
+		<button type="default" class="button" @click="navto('/pages/money/withdraw')">立即提现</button>
+	</view>
+</template>
+
+<script>
+import { spreadCommission, userBalance } from '@/api/wallet.js';
+import { mapState, mapMutations } from 'vuex';
+import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+import empty from '@/components/empty';
+export default {
+	components: {
+		empty,
+		uniLoadMore
+	},
+	onReady() {
+
+	},
+	data() {
+		return {
+			tabCurrentIndex: 0,
+			navList: [
+				{
+					state: 3,
+					text: '收入',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				},
+				{
+					state: 4,
+					text: '支出',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				},
+			],
+		};
+	},
+	onShow() {
+		// 载入积分数据
+		this.loadData();
+	},
+	computed: {
+		//积分
+		...mapState('user',['userInfo'])
+	},
+	methods: {
+		// 页面跳转
+		navto(e) {
+			uni.navigateTo({
+				url: e
+			});
+		},
+		//获取收入支出信息
+		async loadData(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';
+		
+			spreadCommission(
+				{
+					page: navItem.page,
+					limit: navItem.limit
+				},
+				state
+			)
+				.then(({ data }) => {
+					if (data.length > 0) {
+						navItem.orderList = navItem.orderList.concat(data[0].list);
+						console.log(navItem.orderList);
+						navItem.page++;
+					}
+					if (navItem.limit == data.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) {
+			console.log(e, '1111')
+			this.tabCurrentIndex = e.target.current;
+			this.loadData('tabChange');
+		},
+		//顶部tab点击
+		tabClick(index) {
+			this.tabCurrentIndex = index;
+		}
+	},
+}
+</script>
+
+<style lang="scss">
+page {
+	background: #ffffff;
+	height: 100%;
+}
+
+.header {
+	image {
+		width: 100%;
+		height: 400rpx;
+	}
+
+	.integral {
+		width: 100%;
+		text-align: center;
+		position: absolute;
+		top: 160rpx;
+		color: #fff;
+		font-size: 80rpx;
+		font-weight: bold;
+	}
+
+	.right {
+		position: absolute;
+		top: 120rpx;
+		right: 0;
+		background-color: #fff;
+		border-radius: 10rpx 0 0 10rpx;
+		color: #438bed;
+		padding: 5rpx 15rpx;
+		font-size: 28rpx;
+	}
+}
+
+.navbar {
+	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: #438bed;
+
+			&:after {
+				content: '';
+				position: absolute;
+				left: 50%;
+				bottom: 0;
+				transform: translateX(-50%);
+				width: 44px;
+				height: 0;
+				border-bottom: 2px solid #438bed;
+			}
+		}
+	}
+}
+
+// 列表
+
+.swiper-box {
+	height: calc(100% - 180rpx - 400rpx);
+	padding-top: 10rpx;
+
+	.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: #ef3a55;
+			font-size: $font-lg;
+		}
+	}
+}
+
+.list-scroll-content {
+	height: 100%;
+}
+
+.content {
+	height: 100%;
+
+	.empty-content {
+		height: 100%;
+		background-color: #ffffff;
+	}
+}
+
+.button {
+	position: relative;
+	bottom: 0;
+	bottom: 50rpx;
+	width: 674rpx;
+	height: 88rpx;
+	background: linear-gradient(90deg, #3C82E6, #5395F5);
+	border-radius: 44rpx;
+	font-size: 36rpx;
+	font-family: PingFang SC;
+	font-weight: 500;
+	color: #ffffff;
+}
+</style>

BIN
static/icon/index01.png


BIN
static/icon/index02.png


BIN
static/icon/index03.png


BIN
static/icon/index04.png


BIN
static/icon/set.png


BIN
static/img/share-bg.png


BIN
static/tabBar/tab-cart-current.png


BIN
static/tabBar/tab-cate-current.png


BIN
static/tabBar/tab-home-current.png


BIN
static/tabBar/tab-my-current.png


BIN
static/user/bank.png


BIN
static/user/right.png


BIN
static/user/yongjin1.png


BIN
static/user/yue1.png


BIN
static/user/zfb.png