lhl 3 سال پیش
والد
کامیت
e5dcb8f4a7
10فایلهای تغییر یافته به همراه2356 افزوده شده و 17 حذف شده
  1. 102 0
      api/wallet.js
  2. 41 17
      pages.json
  3. 289 0
      pages/money/account.vue
  4. 416 0
      pages/money/pay.vue
  5. 376 0
      pages/money/pay1.vue
  6. 65 0
      pages/money/paySuccess.vue
  7. 396 0
      pages/money/recharge.vue
  8. 359 0
      pages/money/wallet.vue
  9. 312 0
      pages/money/withdrawal.vue
  10. BIN
      static/img/qbbg.png

+ 102 - 0
api/wallet.js

@@ -0,0 +1,102 @@
+import request from '@/utils/request'
+
+// 获取用户消费记录
+export function spreadCommission(data,state) {
+	return request({
+		url: '/api/spread/commission/'+state,
+		method: 'get',
+		data
+	});
+}
+
+// 获取账户余额
+export function userBalance(data) {
+	return request({
+		url: '/api/user/balance',
+		method: 'get',
+		data
+	});
+}
+
+// 提现
+export function extractCash(data) {
+	return request({
+		url: '/api/extract/cash',
+		method: 'post',
+		data
+	});
+}
+
+// 提现信息
+export function extractBank(data) {
+	return request({
+		url: '/api/extract/bank',
+		method: 'get',
+		data
+	});
+}
+// #ifdef H5
+// 公众号充值
+export function rechargeWechat(data) {
+	return request({
+		url: '/api/recharge/wechat',
+		method: 'post',
+		data
+	});
+}
+// #endif
+// #ifdef MP
+// 小程序充值
+export function rechargeRoutine(data) {
+	return request({
+		url: '/api/recharge/routine',
+		method: 'post',
+		data
+	});
+}
+// #endif
+// 获取提现支付宝账号
+export function aliInfo(data) {
+	return request({
+		url: '/api/ali/info',
+		method: 'get',
+		data
+	});
+}
+//获取默认银行卡账号
+export function bankInfo(data) {
+	return request({
+		url: '/api/bank/info',
+		method: 'get',
+		data
+	});
+}
+// 保存提现支付宝账号
+export function setAliInfo(data) {
+	return request({
+		url: '/api/ali/edit',
+		method: 'post',
+		data
+	});
+}
+//保存默认银行卡账号
+export function setBankInfo(data) {
+	return request({
+		url: '/api/bank/edit',
+		method: 'post',
+		data
+	});
+}
+
+
+// 账户余额
+export function balance(data) {
+	return request({
+		url: '/api/user/balance',
+		method: 'get',
+		data
+	});
+}
+
+
+

+ 41 - 17
pages.json

@@ -3,24 +3,7 @@
 			"path": "pages/index/index",
 			"style": {
 				"enablePullDownRefresh": true,
-
 				"navigationStyle": "custom",
-
-
-				// "app-plus": {
-				// 	"titleNView": {
-				// 		"type": "transparent",
-				// 		"searchInput": {
-				// 			"backgroundColor": "rgba(231, 231, 231,.7)",
-				// 			"borderRadius": "16px",
-				// 			"placeholder": "请输入关键字",
-				// 			"disabled": true,
-				// 			"placeholderColor": "#606266",
-				// 			"align": "left"
-				// 		}
-				// 	}
-				// },
-
 				"navigationBarTitleText": "商城首页"
 			}
 		},
@@ -262,6 +245,47 @@
 				"style": {
 					"navigationBarTitleText": "修改资料"
 				}
+			},
+			{
+				"path": "pages/money/pay",
+				"style": {
+					"navigationBarTitleText": "支付"
+				}
+			},
+			{
+				"path": "pages/money/paySuccess",
+				"style": {
+					"navigationBarTitleText": "支付成功"
+				}
+			},
+			{
+				"path": "pages/money/wallet",
+				"style": {
+					"navigationBarTitleText": "我的钱包",
+					"app-plus": {
+						"titleNView": {
+							"type": "transparent"
+						}
+					}
+				}
+			},
+			{
+				"path": "pages/money/account",
+				"style": {
+					"navigationBarTitleText": "提现账号"
+				}
+			},
+			{
+				"path": "pages/money/withdrawal",
+				"style": {
+					"navigationBarTitleText": "提现"
+				}
+			},
+			{
+				"path": "pages/money/recharge",
+				"style": {
+					"navigationBarTitleText": "充值"
+				}
 			}
 		],
 		"tabBar": {

+ 289 - 0
pages/money/account.vue

@@ -0,0 +1,289 @@
+<template>
+	<view class="content">
+		<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">
+				<view class="row b-b">
+					<text class="tit">姓名</text>
+					<input class="input" v-model="tabItem.orderList.name" type="text" placeholder="提款人姓名" placeholder-class="placeholder" />
+				</view>
+				<view class="row b-b">
+					<text class="tit">{{ tabIndex == 0 ? '账号' : '银行卡号' }}</text>
+					<input class="input" v-model="tabItem.orderList.code" type="text" placeholder="请输入账号" placeholder-class="placeholder" />
+				</view>
+				<view class="row b-b" v-if="tabIndex == 1">
+					<text class="tit">所属银行</text>
+					<input class="input" v-model="tabItem.orderList.bankName" type="text" placeholder="请输入账号" placeholder-class="placeholder" />
+				</view>
+			</swiper-item>
+		</swiper>
+
+		<button class="add-btn up" @click="confirm">提交申请</button>
+	</view>
+</template>
+
+<script>
+import { aliInfo, bankInfo, setAliInfo, setBankInfo } from '@/api/wallet.js';
+export default {
+	data() {
+		return {
+			tabCurrentIndex: 0,
+			navList: [
+				{
+					state: 0,
+					text: '支付宝',
+					loadingType: 'more',
+					orderList: {
+						name: '',
+						code: '',
+						id: ''
+					}
+				},
+				{
+					state: 1,
+					text: '银行卡',
+					loadingType: 'more',
+					orderList: {
+						name: '',
+						code: '',
+						bankName: '',
+						id: ''
+					}
+				}
+			]
+		};
+	},
+
+	onLoad(options) {
+		this.tabCurrentIndex = +options.state || 0;
+		// this.loadAli();
+		// this.loadBank();
+	},
+
+	methods: {
+		//加载数据
+		loadAli(source) {
+			aliInfo({}).then(({ data }) => {
+				let order = this.navList[0].orderList;
+				this.$set(order, 'name', data.fullname);
+				this.$set(order, 'code', data.alino);
+				this.$set(order, 'id', data.id);
+			});
+		},
+		loadBank() {
+			bankInfo({}).then(({ data }) => {
+				let order = this.navList[1].orderList;
+				this.$set(order, 'name', data.fullname);
+				this.$set(order, 'code', data.bankno);
+				this.$set(order, 'bankName', data.bank);
+				this.$set(order, 'id', data.id);
+			});
+		},
+		//swiper 切换
+		changeTab(e) {
+			this.tabCurrentIndex = e.target.current;
+		},
+		//顶部tab点击
+		tabClick(index) {
+			this.tabCurrentIndex = index;
+		},
+		// 提交保存
+		confirm() {
+			let obj = this;
+			let arr = obj.navList[obj.tabCurrentIndex].orderList;
+			let pages = getCurrentPages(); //获取所有页面栈实例列表
+			console.log(pages);
+			let nowPage = pages[pages.length - 1]; //当前页页面实例
+			let prevPage = pages[pages.length - 2]; //上一页页面实例
+			console.log(prevPage);
+			// prevPage.$vm.sh = 100;   //修改上一页data里面的sh参数值为100
+			if (obj.tabCurrentIndex == 1) {
+				if (!arr.name) {
+					return this.$api.msg('请输入提款人姓名');
+				}
+				if (!arr.bankName) {
+					return this.$api.msg('请输入所属银行');
+				}
+				if (!arr.code) {
+					return this.$api.msg('请输入银行卡号');
+				}
+				let data = {
+					fullname: arr.name,
+					bank: arr.bankName,
+					bankno: arr.code
+				};
+				// #ifdef H5
+				prevPage.$vm.bankData = data;
+				// #endif
+				// #ifdef MP
+				prevPage.setData({
+					bankData: data
+				});
+				// #endif
+				// obj.setBankInfo({
+				// 	fullname: arr.name,
+				// 	bank: arr.bankName,
+				// 	bankno: arr.code,
+				// 	id:arr.id
+				// });
+				uni.navigateBack({
+					delta: 1
+				});
+			}
+			if (obj.tabCurrentIndex == 0) {
+				if (!arr.name) {
+					return this.$api.msg('请输入提款人姓名');
+				}
+				if (!arr.code) {
+					return this.$api.msg('请输入支付宝账号');
+				}
+				let data = {
+					fullname: arr.name,
+					alino: arr.code
+				};
+				// #ifdef H5
+				prevPage.$vm.aliData = data;
+				// #endif
+
+				// #ifdef MP
+				prevPage.setData({
+					bankData: data
+				});
+				// #endif
+				// obj.setAliInfo({
+				// 	fullname: arr.name,
+				// 	alino: arr.code,
+				// 	id:arr.id
+				// });
+				uni.navigateBack({
+					delta: 1
+				});
+			}
+		},
+		/* 保存银行卡详细 */
+		setBankInfo(obj) {
+			setBankInfo(obj)
+				.then(e => {
+					uni.showToast({
+						title: '修改成功',
+						duration: 2000,
+						position: 'top'
+					});
+					this.$api.prePage().dataUp();
+					setTimeout(() => {
+						uni.navigateBack();
+					}, 1500);
+				})
+				.catch(e => {
+					console.log(e);
+				});
+		},
+		// 修改支付宝信息
+		setAliInfo(obj) {
+			setAliInfo(obj)
+				.then(e => {
+					uni.showToast({
+						title: '修改成功',
+						duration: 2000,
+						position: 'top'
+					});
+					this.$api.prePage().dataUp();
+					setTimeout(() => {
+						uni.navigateBack();
+					}, 1500);
+				})
+				.catch(e => {
+					console.log(e);
+				});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.row {
+	display: flex;
+	align-items: center;
+	position: relative;
+	padding: 0 30rpx;
+	height: 110rpx;
+	background: #fff;
+	.tit {
+		flex-shrink: 0;
+		width: 120rpx;
+		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;
+	}
+}
+page,
+.content {
+	background: $page-color-base;
+	height: 100%;
+}
+
+.swiper-box {
+	height: 750rpx;
+}
+
+.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: $base-color;
+			&:after {
+				content: '';
+				position: absolute;
+				left: 50%;
+				bottom: 0;
+				transform: translateX(-50%);
+				width: 44px;
+				height: 0;
+				border-bottom: 2px solid $base-color;
+			}
+		}
+	}
+}
+
+.add-btn {
+	&.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);
+}
+</style>

+ 416 - 0
pages/money/pay.vue

@@ -0,0 +1,416 @@
+<template>
+	<view class="app">
+		<view class="price-box">
+			<text>支付金额</text>
+			<text class="price">{{ money }}</text>
+		</view>
+		<view class="pay-type-list">
+			<!-- #ifndef APP-PLUS -->
+			<view class="type-item b-b" @click="changePayType(1)">
+				<text class="icon iconfont iconweixin"></text>
+				<view class="con">
+					<text class="tit">微信支付</text>
+					<text>推荐使用微信支付</text>
+				</view>
+				<label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 1"></radio></label>
+			</view>
+			<!-- #endif -->
+			<!-- #ifdef APP-PLUS -->
+			<view class="type-item b-b" @click="changePayType(2)">
+				<text class="icon iconfont iconzhifubao"></text>
+				<view class="con"><text class="tit">支付宝支付</text></view>
+				<label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 2"></radio></label>
+			</view>
+			<!-- #endif -->
+			<view class="type-item" @click="changePayType(3)">
+				<text class="icon iconfont iconyue"></text>
+				<view class="con">
+					<text class="tit">余额支付</text>
+					<text>可用余额 ¥{{ now_money }}</text>
+				</view>
+				<label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 3"></radio></label>
+			</view>
+		</view>
+		<text class="mix-btn" :class="{ clickbg: payLoding }" @click="!payLoding ? confirm() : ''">确认支付</text>
+	</view>
+</template>
+
+<script>
+import { balance } from '@/api/wallet.js';
+import { createOrderkey, computedOrderkey, orderPay } from '@/api/order.js';
+import { getUserInfo } from '@/api/user.js';
+
+// #ifdef H5
+
+import weixinObj from '@/plugin/jweixin-module/index.js';
+// #endif
+import { mapState, mapMutations } from 'vuex';
+export default {
+	data() {
+		return {
+			
+			// #ifdef H5
+			payName: 'weixin',
+			payType: 1, //支付类型
+			// #endif
+			// #ifdef MP-WEIXIN
+			payName: 'weixin',
+			payType: 1, //支付类型
+			// #endif
+			// #ifdef APP-PLUS
+			payType: 3,
+			payName: 'yue',
+			// #endif
+			orderInfo: {},
+			money: 0.0, //订单金额
+			now_money: 0.0, //余额
+			orderKey: '',
+			orderId: '', //保存订单id
+			payLoding: false, //判断是否支付中
+			type: '', //判断是否从订单中进入
+			// #ifdef H5
+			froms: '', //保存h5中数据来源对象
+			// #endif
+			pinkid: '', //保存拼团商品id
+			checkedAuto: 0, //判断是否为自动拼团
+			topify: '',
+			is_drop: '',
+		};
+	},
+	computed: {
+		// #ifdef H5
+		...mapState(['weichatObj']),
+		// #endif
+		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+	},
+	onLoad(options) {
+		if(options.isdrop) {
+			this.is_drop = options.isdrop
+		}
+ 		this.checkedAuto = options.checked || 0;
+		this.topify = options.topify || 0;
+		if (options.type == 1) {
+			this.type = 1;
+			this.orderId = options.ordid;
+			this.money = options.money;
+		} else {
+			this.orderKey = options.key;
+			let prepage = this.$api.prePage();
+			computedOrderkey({
+				orderkey: this.orderKey,
+				couponId: prepage.couponChecked.id, //优惠券编号
+				addressId: prepage.addressData.id, //地址编号
+				useIntegral: prepage.checkedPoints ? 1 : 0,
+				is_drop: this.is_drop
+			}).then(({ data }) => {
+				// 获取支付金额
+				this.money = data.result.pay_price;
+			});
+		}
+		// 保存pinkid
+		if (options.pinkid) {
+			this.pinkid = options.pinkid;
+		}
+		// 载入余额
+		if ('now_money' in this.userInfo) {
+			this.now_money = this.userInfo.now_money;
+		} else {
+			balance({}).then(({ data }) => {
+				// 获取余额
+				this.now_money = data.now_money;
+			});
+		}
+	},
+	methods: {
+		...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
+		//选择支付方式
+		changePayType(type) {
+			this.payType = type;
+			if (this.payType == 1) {
+				this.payName = 'weixin';
+			}
+			if (this.payType == 2) {
+				this.payName = 'ali';
+			}
+			if (this.payType == 3) {
+				this.payName = 'yue';
+			}
+			// if (this.payType == 4) {
+			// 	this.payName = 'consumer';
+			// }
+		},
+		// 支付金额
+		orderMoneyPay() {
+			let obj = this;
+			orderPay({
+				uni: obj.orderId,
+				// #ifdef H5
+				from: obj.froms ? 'weixin' : 'H5', //来源
+				// #endif
+				// #ifdef MP-WEIXIN
+				from: 'routine', //来源
+				// #endif
+				// #ifdef APP-PLUS
+				from: 'app', //来源
+				// #endif
+				paytype: obj.payName ,//支付类型  weixin-微信 yue-余额
+				is_drop: obj.is_drop
+			})
+				.then(e => {
+					console.log(e,'zhifu+++++++++')
+					// 判断是否为余额支付
+					if (obj.payName == 'yue' && e.data.status == 'SUCCESS') {
+						if (e.status == 200) {
+							obj.paySuccessTo();
+						} else {
+							obj.$api.msg(msg);
+						}
+					}
+					if (obj.payName == 'weixin' || obj.payName == 'routine') {
+						let da = e.data.result.jsConfig;
+						let data = {
+							// #ifdef H5
+							timestamp: da.timestamp,
+							// #endif
+							// #ifdef MP
+							timeStamp: da.timestamp,
+							// #endif
+							nonceStr: da.nonceStr,
+							package: da.package,
+							signType: da.signType,
+							paySign: da.paySign,
+							success: function(res) {
+								obj.paySuccessTo();
+							},
+							fail: () => {
+								uni.navigateTo({
+									url: '/pages/order/order?state=0'
+								});
+							}
+						};
+						// #ifdef H5
+						if (obj.payName == 'weixin') {
+							weixinObj.chooseWXPay(data);
+						}
+						// #endif
+						// #ifdef MP-WEIXIN
+						if (obj.payName == 'routine') {
+							wx.requestPayment(data);
+						}
+						// #endif
+					}
+					uni.hideLoading();
+					obj.payLoding = false;
+				})
+				.catch(e => {
+					// 支付完成
+					uni.hideLoading();
+					obj.payLoding = false;
+					console.log(e);
+				});
+		},
+		// 支付成功跳转
+		paySuccessTo() {
+			getUserInfo({})
+				.then(({ data }) => {
+					console.log(data,"data")
+					this.setUserInfo(data);
+				})
+				.catch(e => {
+					console.log(e);
+				});
+			uni.hideLoading();
+			uni.redirectTo({
+				url: '/pages/money/paySuccess?orderid=' + this.orderId
+			});
+		},
+		//确认支付
+		confirm: async function() {
+			let obj = this;
+			uni.showLoading({
+				title: '支付中',
+				mask: true
+			});
+			// 判断是否余额不足
+			if (obj.payName == 'yue' && +obj.now_money < obj.money) {
+				uni.hideLoading();
+				uni.showModal({
+					title: '提示',
+					content: '账户余额不足!',
+					showCancel: false,
+					success: res => {},
+					fail: () => {},
+					complete: () => {}
+				});
+				return;
+			}
+			// 支付中
+			obj.payLoding = true;
+			// #ifdef H5
+			// 获取当前是否为微信浏览器
+			obj.froms = uni.getStorageSync('weichatBrowser') || '';
+			// #endif
+			// 判断是否为未支付订单中跳转进入
+			if (obj.type != 1) {
+				// 初次生成订单
+				obj.firstCreateOrder();
+			} else {
+				// 已经生成订单未支付
+				obj.orderMoneyPay();
+			}
+		},
+		// 初次订单创建
+		firstCreateOrder() {
+			let obj = this;
+			// 获取下单页面数据
+			let prepage = obj.$api.prePage();
+
+			let data = {
+				real_name: prepage.addressData.real_name, //联系人名称
+				phone: prepage.addressData.phone, //联系人号码
+				couponId: prepage.couponChecked.id, //优惠券编号
+				addressId: prepage.addressData.id, //支付地址id
+				useIntegral: prepage.checkedPoints ? 1 : 0, //是否积分抵扣1为是0为否
+				payType: obj.payName, //支付类型  weixin-微信 yue-余额
+				mark: prepage.desc, //备注
+				// #ifdef H5
+				from: obj.froms ? 'weixin' : 'H5', //来源
+				// #endif
+				// #ifdef MP-WEIXIN
+				from: 'routine', //来源
+				// #endif
+				// #ifdef APP-PLUS
+				from: 'app', //来源
+				// #endif
+				shipping_type: 1, //提货方式 1 快递 2自提
+				automatic: obj.checkedAuto,
+				topify: this.topify,
+				is_drop: obj.is_drop
+			};
+			// 判断是否拼团商品
+			if (obj.pinkid) {
+				data.pinkId = obj.pinkid;
+			}
+			// 生成订单
+			createOrderkey(data, obj.orderKey)
+				.then(({ data, status, msg }) => {
+					// 判断是否支付失败
+					if (data.status == 'ORDER_EXIST') {
+						uni.showModal({
+							title: '提示',
+							content: msg,
+							showCancel: false
+						});
+						uni.hideLoading();
+						obj.payLoding = false;
+						return;
+					}
+					// 保存订单号
+					obj.orderId = data.result.orderId;
+					// 判断是否为余额支付
+					if (obj.payName == 'yue') {
+						if (status == 200 && data.status == 'SUCCESS') {
+							obj.paySuccessTo();
+						} else {
+							obj.$api.msg(msg);
+						}
+					} else {
+						// 立即支付
+						obj.orderMoneyPay();
+					}
+				})
+				.catch(e => {
+					uni.hideLoading();
+					obj.payLoding = false;
+					console.log(e);
+				});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.app {
+	width: 100%;
+}
+
+.price-box {
+	background-color: #fff;
+	height: 265upx;
+	display: flex;
+	flex-direction: column;
+	justify-content: center;
+	align-items: center;
+	font-size: 28upx;
+	color: #909399;
+
+	.price {
+		font-size: 50upx;
+		color: #303133;
+		margin-top: 12upx;
+		&:before {
+			content: '¥';
+			font-size: 40upx;
+		}
+	}
+}
+
+.pay-type-list {
+	margin-top: 20upx;
+	background-color: #fff;
+	padding-left: 60upx;
+	.type-item {
+		height: 120upx;
+		padding: 20upx 0;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding-right: 60upx;
+		font-size: 30upx;
+		position: relative;
+	}
+
+	.icon {
+		width: 100upx;
+		font-size: 52upx;
+	}
+	.iconyue {
+		color: #fe8e2e;
+	}
+	.iconweixin {
+		color: #36cb59;
+	}
+	.iconzhifubao {
+		color: #01aaef;
+	}
+	.tit {
+		font-size: $font-lg;
+		color: $font-color-dark;
+		margin-bottom: 4upx;
+	}
+	.con {
+		flex: 1;
+		display: flex;
+		flex-direction: column;
+		font-size: $font-sm;
+		color: $font-color-light;
+	}
+}
+.mix-btn {
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 630upx;
+	height: 80upx;
+	margin: 80upx auto 30upx;
+	font-size: $font-lg;
+	color: #fff;
+	background-color: $base-color;
+	border-radius: 10upx;
+	/* box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4); */
+}
+
+.clickbg {
+	background-color: $color-gray !important;
+}
+</style>

+ 376 - 0
pages/money/pay1.vue

@@ -0,0 +1,376 @@
+<template>
+	<view class="app">
+		<view class="price-box">
+			<text>支付金额</text>
+			<text class="price">{{ money }}</text>
+		</view>
+		<view class="pay-type-list">
+			<view class="type-item b-b" @click="changePayType(1)">
+				<text class="icon iconfont iconweixin"></text>
+				<view class="con">
+					<text class="tit">微信支付</text>
+					<text>推荐使用微信支付</text>
+				</view>
+				<label class="radio"><radio value="" color="#ff4c4c" :checked="payType == 1"></radio></label>
+			</view>
+			<!-- #ifdef APP-PLUS -->
+			<view class="type-item b-b" @click="changePayType(2)">
+				<text class="icon iconfont iconzhifubao"></text>
+				<view class="con"><text class="tit">支付宝支付</text></view>
+				<label class="radio"><radio value="" color="#ff4c4c" :checked="payType == 2"></radio></label>
+			</view>
+			<!-- #endif -->
+			<view class="type-item" @click="changePayType(3)">
+				<text class="icon iconfont iconyue"></text>
+				<view class="con">
+					<text class="tit">余额支付</text>
+					<text>可用余额 ¥{{ now_money }}</text>
+				</view>
+				<label class="radio"><radio value="" color="#ff4c4c" :checked="payType == 3"></radio></label>
+			</view>
+		</view>
+		<text class="mix-btn" :class="{ clickbg: payLoding }" @click="!payLoding ? confirm() : ''">确认支付</text>
+	</view>
+</template>
+
+<script>
+import { balance } from '@/api/wallet.js';
+import { createOrderkey,computedOrderkey,orderPay } from '@/api/order.js';
+import { mapState } from 'vuex';
+export default {
+	data() {
+		return {
+			payType: 1, //支付类型
+			// #ifdef H5
+			payName: 'weixin',
+			// #endif
+			// #ifdef MP-WEIXIN
+			payName: 'weixin',
+			// #endif
+			orderInfo: {},
+			money: 0.0, //订单金额
+			now_money: 0.0, //余额
+			orderKey: '',
+			orderId: '', //保存订单id
+			payLoding: false, //判断是否支付中
+			type: '', //判断是否从订单中进入
+			// #ifdef H5
+			froms: '', //保存h5中数据来源对象
+			// #endif
+			pinkid: '', //保存拼团商品id
+			isdrop: 0
+		};
+	},
+	computed: {
+		// #ifdef H5
+		...mapState(['weichatObj'])
+		// #endif
+	},
+	onLoad(options) {
+		if(options.isdrop) {
+			this.isdrop = options.isdrop*1
+		}
+		if (options.type == 1) {
+			this.type = 1;
+			this.orderId = options.ordid;
+			this.money = options.money;
+		} else {
+			this.orderKey = options.key;
+			let prepage = this.$api.prePage();
+			computedOrderkey({
+				orderkey: this.orderKey,
+				couponId: prepage.couponChecked.id, //优惠券编号
+				addressId: prepage.addressData.id, //地址编号
+				useIntegral: prepage.checkedPoints ? 1 : 0,
+				is_drop: this.isdrop
+			}).then(({ data }) => {
+				// 获取支付金额
+				this.money = data.result.pay_price;
+			});
+		}
+		// 保存pinkid
+		if (options.pinkid) {
+			this.pinkid = options.pinkid;
+		}
+		// 载入余额
+		balance({}).then(({ data }) => {
+			// 获取余额
+			this.now_money = data.now_money;
+		});
+	},
+	methods: {
+		//选择支付方式
+		changePayType(type) {
+			this.payType = type;
+			if (this.payType == 1) {
+				this.payName = 'weixin';
+			}
+			if (this.payType == 2) {
+				this.payName = 'ali';
+			}
+			if (this.payType == 3) {
+				this.payName = 'yue';
+			}
+		},
+		// 支付金额
+		orderMoneyPay() {
+			let obj = this;
+			orderPay({
+				uni: obj.orderId,
+				// #ifdef H5
+				from: obj.froms ? 'weixin' : 'H5', //来源
+				// #endif
+				// #ifdef MP-WEIXIN
+				from: 'routine', //来源
+				// #endif
+				// #ifdef APP-PLUS
+				from: 'app', //来源
+				// #endif
+				paytype: obj.payName //支付类型  weixin-微信 yue-余额
+			})
+				.then(e => {
+					// 判断是否为余额支付
+					if (obj.payName == 'yue' && e.data.status == 'SUCCESS') {
+						if (e.status == 200) {
+							obj.paySuccessTo();
+						} else {
+							obj.$api.msg(msg);
+						}
+					}
+					if (obj.payName == 'weixin' || obj.payName == 'routine') {
+						let da = e.data.result.jsConfig;
+						let data = {
+							// #ifdef H5
+							timestamp: da.timestamp,
+							// #endif
+							// #ifdef MP
+							timeStamp: da.timestamp,
+							// #endif
+							nonceStr: da.nonceStr,
+							package: da.package,
+							signType: da.signType,
+							paySign: da.paySign,
+							success: function(res) {
+								obj.paySuccessTo();
+							},
+							fail: () => {
+								uni.navigateTo({
+									url: '/pages/order/order?state=0'
+								});
+							}
+						};
+						// #ifdef H5
+						if(obj.payName == 'weixin'){
+						obj.weichatObj.chooseWXPay(data);
+						}
+						// #endif
+						// #ifdef MP-WEIXIN
+						if(obj.payName == 'routine'){
+							wx.requestPayment(data);
+						}
+						// #endif
+					}
+					uni.hideLoading();
+					obj.payLoding = false;
+				})
+				.catch(e => {
+					// 支付完成
+					uni.hideLoading();
+					obj.payLoding = false;
+					console.log(e);
+				});
+		},
+		// 支付成功跳转
+		paySuccessTo() {
+			uni.hideLoading();
+			uni.redirectTo({
+				url: '/pages/money/paySuccess?orderid=' + this.orderId
+			});
+		},
+		//确认支付
+		confirm: async function() {
+			let obj = this;
+			uni.showLoading({
+				title: '支付中',
+				mask: true
+			})
+			// 判断是否余额不足
+			if (obj.payName == 'yue' && +obj.now_money < obj.money) {
+				uni.showModal({
+					title: '提示',
+					content: '账户余额不足!',
+					showCancel: false,
+					success: res => {},
+					fail: () => {},
+					complete: () => {}
+				});
+				return;
+			}
+			// 支付中
+			obj.payLoding = true;
+			// #ifdef H5
+			// 获取当前是否为微信浏览器
+			obj.froms = uni.getStorageSync('weichatBrowser') || '';
+			// #endif
+			// 判断是否为未支付订单中跳转进入
+			if (obj.type != 1) {
+				// 初次生成订单
+				obj.firstCreateOrder();
+			} else {
+				// 已经生成订单未支付
+				obj.orderMoneyPay();
+			}
+		},
+		// 初次订单创建
+		firstCreateOrder() {
+			let obj = this;
+			// 获取下单页面数据
+			let prepage = obj.$api.prePage();
+
+			let data = {
+				real_name: prepage.addressData.real_name, //联系人名称
+				phone: prepage.addressData.phone, //联系人号码
+				couponId: prepage.couponChecked.id, //优惠券编号
+				addressId: prepage.addressData.id, //支付地址id
+				useIntegral: prepage.checkedPoints ? 1 : 0, //是否积分抵扣1为是0为否
+				payType: obj.payName, //支付类型  weixin-微信 yue-余额
+				mark: prepage.desc, //备注
+				// #ifdef H5
+				from: obj.froms ? 'weixin' : 'H5', //来源
+				// #endif
+				// #ifdef MP-WEIXIN
+				from: 'routine', //来源
+				// #endif
+				// #ifdef APP-PLUS
+				from: 'app', //来源
+				// #endif
+				shipping_type: 1, //提货方式 1 快递 2自提
+				is_drop: this.isdrop//是否上门安装
+			};
+			// 判断是否拼团商品
+			if (obj.pinkid) {
+				data.pinkId = obj.pinkid;
+			}
+			// 生成订单
+			createOrderkey(data, obj.orderKey)
+				.then(({ data, status, msg }) => {
+					// 判断是否支付失败
+					if (data.status == 'ORDER_EXIST') {
+						uni.showModal({
+							title: '提示',
+							content: msg,
+							showCancel: false
+						});
+						uni.hideLoading();
+						obj.payLoding = false;
+						return;
+					}
+					// 保存订单号
+					obj.orderId = data.result.orderId;
+					// 判断是否为余额支付
+					if (obj.payName == 'yue') {
+						if (status == 200 && data.status == 'SUCCESS') {
+							obj.paySuccessTo();
+						} else {
+							obj.$api.msg(msg);
+						}
+					} else {
+						// 立即支付
+						obj.orderMoneyPay();
+					}
+				})
+				.catch(e => {
+					uni.hideLoading();
+					obj.payLoding = false;
+					console.log(e);
+				});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.app {
+	width: 100%;
+}
+
+.price-box {
+	background-color: #fff;
+	height: 265upx;
+	display: flex;
+	flex-direction: column;
+	justify-content: center;
+	align-items: center;
+	font-size: 28upx;
+	color: #909399;
+
+	.price {
+		font-size: 50upx;
+		color: #303133;
+		margin-top: 12upx;
+		&:before {
+			content: '¥';
+			font-size: 40upx;
+		}
+	}
+}
+
+.pay-type-list {
+	margin-top: 20upx;
+	background-color: #fff;
+	padding-left: 60upx;
+	.type-item {
+		height: 120upx;
+		padding: 20upx 0;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding-right: 60upx;
+		font-size: 30upx;
+		position: relative;
+	}
+
+	.icon {
+		width: 100upx;
+		font-size: 52upx;
+	}
+	.iconyue {
+		color: #fe8e2e;
+	}
+	.iconweixin {
+		color: #36cb59;
+	}
+	.iconzhifubao {
+		color: #01aaef;
+	}
+	.tit {
+		font-size: $font-lg;
+		color: $font-color-dark;
+		margin-bottom: 4upx;
+	}
+	.con {
+		flex: 1;
+		display: flex;
+		flex-direction: column;
+		font-size: $font-sm;
+		color: $font-color-light;
+	}
+}
+.mix-btn {
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 630upx;
+	height: 80upx;
+	margin: 80upx auto 30upx;
+	font-size: $font-lg;
+	color: #fff;
+	background-color: $base-color;
+	border-radius: 10upx;
+	/* box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4); */
+}
+
+.clickbg {
+	background-color: $color-gray !important;
+}
+</style>

+ 65 - 0
pages/money/paySuccess.vue

@@ -0,0 +1,65 @@
+<template>
+	<view class="content">
+		<text class="success-icon iconfont iconroundcheck"></text>
+		<text class="tit">支付成功</text>
+		<view class="btn-group">
+			<navigator :url="'/pages/order/orderDetail?id='+orderId" open-type="redirect" class="mix-btn">查看订单</navigator>
+			<navigator url="/pages/index/index" open-type="switchTab" class="mix-btn hollow">返回首页</navigator>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				orderId:''
+			}
+		},
+		onLoad(opt) {
+			// 保存订单号
+			this.orderId = opt.orderid;
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style lang='scss'>
+	.content{
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+	}
+	.success-icon{
+		font-size: 160upx;
+		color: #5dbc7c;
+		margin-top: 100upx;
+	}
+	.tit{
+		font-size: 38upx;
+		color: #303133;
+	}
+	.btn-group{
+		padding-top: 100upx;
+	}
+	.mix-btn {
+		margin-top: 30upx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		width: 600upx;
+		height: 80upx;
+		font-size: $font-lg;
+		color: #fff;
+		background-color: $base-color;
+		border-radius: 10upx;
+		&.hollow{
+			background: #fff;
+			color: #303133;
+			border: 1px solid #ccc;
+		}
+	}
+</style>

+ 396 - 0
pages/money/recharge.vue

@@ -0,0 +1,396 @@
+<template>
+	<view class="content">
+		<view class="yue">
+			<view class="font">
+				当前余额
+			</view>
+			<view class="money">
+				{{ nowmoney | getMoneyStyle }}
+			</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 class="xian"></view>
+			<view class="moneyBtn-box">
+				<view class="moneyBtn" v-for="(item,index) in moneyList" :class="{'current' : choose == index}" :key="index" @click="changemoney(item,index)">
+					{{ item }}元
+				</view>
+			</view>
+		</view>
+
+		<view class="list">
+			<radio-group @change="tabRadio">
+				<!-- #ifndef APP-PLUS -->
+				<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="#FF4343" :checked="type == 'weixin'" /></view>
+					</view>
+				</label>
+				<!-- #endif -->
+				<!-- <label>
+					<view class="box">
+						<view class="icon iconfont"><image class="yongjing" src="http://xmpt.liuniu946.com/img/yongjing.png"></image></view>
+						<view class="title-box">
+							<view class="title"><text>佣金充值</text></view>
+							<view class="node">可用佣金¥{{ yongMoney }}</view>
+							
+						</view>
+						<view class="right"><radio value="yongjing" color=" #5dbc7c" :checked="type == 'yongjing'" /></view>
+					</view>
+				</label> -->
+				
+			</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';
+import { userBalance,extractBank } from '@/api/wallet.js'
+// #ifdef H5
+import { rechargeWechat } from '@/api/wallet.js';
+// #endif
+// #ifdef MP
+import { rechargeRoutine } from '@/api/wallet.js';
+// #endif
+import { mapState } from 'vuex';
+// #ifdef H5
+
+import weixinObj from '@/plugin/jweixin-module/index.js';
+// #endif
+export default {
+	filters: {
+		getMoneyStyle
+	},
+	data() {
+		return {
+			// #ifndef APP-PLUS
+			typeText: 0,
+			type: 'weixin',
+			// #endif
+			// #ifdef APP-PLUS
+			typeText: 1,
+			type: 'yongjing',
+			// #endif
+			money: '', //充值金额
+			payLoding: false, //是否加载中
+			moneyList: [300,200,150,100,50],
+			nowmoney: '',
+			choose: -1,
+			yongMoney:'',
+		};
+	},
+	onLoad(options) {
+		const obj = this;
+		if(options.type == '1'){
+			obj.type = 'yongjing',
+			obj.typeText = 1
+		}
+	},
+	onShow() {
+		userBalance({}).then(({ data }) => {
+			console.log(data)
+			this.nowmoney = data.now_money;
+		});
+		extractBank({}).then(({ data }) => {
+			this.yongMoney = (data.commissionCount*1).toFixed(2);//累积佣金
+		});
+	},
+	computed: {
+		// #ifdef H5
+		...mapState(['weichatObj'])
+		// #endif
+	},
+	methods: {
+		// 跳转
+		navTo(url) {
+			uni.navigateTo({
+				url: url
+			});
+		},
+		// 切换选中对象
+		tabRadio(e) {
+			console.log(e)
+			if ( e.detail.value == 'weixin' ) {
+				this.typeText = 0
+			} 
+			else {
+				this.typeText = 1
+			}
+			this.type = e;
+			console.log(this.typeText);
+		},
+		// 提交
+		confirm() {
+			let obj = this;
+			obj.payLoding = true;
+			if( obj.money == ''){
+				obj.$api.msg('请输入充值金额');
+				obj.payLoding = false;
+				return;
+			}
+			if( obj.type == 'yongjin' && obj.money > parseInt(obj.yongMoney) ) {
+				obj.$api.msg('佣金不足');
+				obj.payLoding = false;
+				return;
+			}
+			// #ifdef H5
+			// rechargeWechat({ price: this.money, from: this.type })
+			rechargeWechat({ price: this.money, from: 'weixin',
+			 type: this.typeText})
+				.then(e => {
+					console.log(e)
+					if ( obj.type == 'weixin' ){
+						let da = e.data.data;
+						console.log(weixinObj,"weixin")
+						weixinObj.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;
+					}else {
+						uni.navigateTo({
+							url: '/pages/money/rechargeSuccess'
+						})
+						obj.payLoding = false;
+						console.log(e, '佣金');
+					}
+				})
+				.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);
+		},
+		changemoney(item,index){
+			this.choose = index;
+			this.money = item
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	height: 100%;
+}
+
+.add-btn {
+	&.modified {
+		color: $base-color;
+	}
+	&.up {
+		background: linear-gradient(-35deg, #FF4343, #FF4343);
+		color: #fff;
+	}
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 604rpx;
+	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 0rpx 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;
+		}
+	}
+	.xian {
+		width: 700rpx;
+		height: 1rpx;
+		background: #E6E6E6;
+		margin-bottom: 16rpx;
+	}
+	.moneyBtn-box {
+		display: flex;
+		justify-content: flex-start;
+		flex-wrap: wrap;
+		.moneyBtn {
+			margin-right: 30rpx;
+			width: 210rpx;
+			height: 70rpx;
+			background: #F0F0F0;
+			border-radius: 4px;
+			margin-top: 30rpx;
+			text-align: center;
+			line-height: 70rpx;
+		}
+	}
+}
+.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;
+		}
+		.yongjing {
+			width: 48rpx;
+			height: 48rpx;
+			
+		}
+		.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;
+}
+.yue {
+	display: flex;
+	justify-content: space-between;
+	padding: 30rpx 48rpx 30rpx 26rpx;
+	background: #FFFFFF;
+	.font{
+		font-size: 28rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #333333;
+	}
+	.money{
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #EF041F;
+	}
+}
+.current {
+	background: linear-gradient(-35deg, #F8DD4F, #FBEB77) !important;
+}
+</style>

+ 359 - 0
pages/money/wallet.vue

@@ -0,0 +1,359 @@
+<template>
+	<view class="content">
+		<view class="content-money">
+			<view class="money-box">
+				<image src="../../static/img/qbbg.png" mode=""></image>
+				<view class="money"><text class="money-icon">¥</text>{{ userInfo.now_money | getMoneyStyle }}</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)" v-if="item.text!=='全部'">{{ item.text }}</view>
+		</view>
+		<swiper :current="tabCurrentIndex" :style="{'height':maxheight+'px'}" 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 class="jg"></view>
+					</view>
+					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
+				</scroll-view>
+			</swiper-item>
+		</swiper>
+		<view class="add-btn" @click="addmoney">立刻充值</view>
+	</view>
+</template>
+
+<script>
+import { mapState, mapMutations } from 'vuex';
+import { spreadCommission, userBalance } from '@/api/wallet.js';
+import { getMoneyStyle } from '@/utils/rocessor.js';
+import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+import empty from '@/components/empty';
+export default {
+	filters: {
+		getMoneyStyle
+	},
+	components: {
+		empty,
+		uniLoadMore
+	},
+	onReady() {
+		// 初始化获取页面宽度
+		uni.createSelectorQuery()
+			.select('.content')
+			.fields(
+				{
+					size: true
+				},
+				data => {
+					console.log(data);
+					console.log(Math.floor((data.width / 750) * 300));
+					// 保存头部高度
+					this.maxheight =data.height - Math.floor((data.width / 750) * 570);
+					console.log(this.maxheight);
+				}
+			)
+			.exec();
+	},
+	data() {
+		return {
+			// 头部图高度
+			maxheight:'',
+			tabCurrentIndex: 0,
+			navList: [
+				{
+					state: 2,
+					text: '收入',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				},
+				{
+					state: 1,
+					text: '支出',
+					loadingType: 'more',
+					orderList: [
+					],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				},
+				
+			],
+			money: ''
+		};
+	},
+	computed: {
+		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+	},
+	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;
+			}
+			// 修改当前对象状态为加载中
+			navItem.loadingType = 'loading';
+
+			spreadCommission(
+				{
+					page: navItem.page,
+					limit: navItem.limit
+				},
+				state
+			)
+				.then(({ data }) => {
+					console.log(data);
+					// if (data.count > 0) {
+					// 	navItem.orderList = navItem.orderList.concat(data.list);
+					// 	console.log(navItem.orderList);
+					// 	navItem.page++;
+					// }
+					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) {
+			this.tabCurrentIndex = e.target.current;
+			this.loadData('tabChange');
+		},
+		//顶部tab点击
+		tabClick(index) {
+			this.tabCurrentIndex = index;
+		},
+		addmoney() {
+			uni.navigateTo({
+				url: '/pages/money/recharge'
+			})
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background: #ffffff;
+	height: 100%;
+}
+.content-money {
+	padding-bottom: 30rpx;
+	background: $page-color-base;
+	.moneyTx {
+		position: absolute;
+		top: 150rpx;
+		right: 0rpx;
+		width: 150rpx;
+		padding: 10rpx 30rpx;
+		border: 2px solid #ffffff;
+		border-top-left-radius: 99rpx;
+		border-bottom-left-radius: 99rpx;
+		color: #ffffff;
+		line-height: 1;
+		font-size: $font-base;
+	}
+	.buttom-box {
+		background-color: #ffffff;
+		text-align: center;
+		margin: 0 30rpx;
+		padding: 20rpx 0;
+		border-radius: $border-radius-sm;
+		margin-top: -60rpx;
+		.buttom {
+			font-size: $font-lg;
+			flex-grow: 1;
+		}
+		.interval {
+			width: 2px;
+			height: 60rpx;
+			background-color: #eeeeee;
+		}
+		.icon {
+			height: 50rpx;
+			width: 48rpx;
+			margin: 0 auto;
+			.icon-img {
+				width: 100%;
+				height: 100%;
+			}
+		}
+	}
+}
+.money-box {
+	// background-color: $base-color;
+	// padding-top: var(--status-bar-height);
+	height: 400rpx;
+	color: #FF4C4C;
+	text-align: center;
+	position: relative;
+	image {
+		position: absolute;
+		top: 0;
+		right: 0;
+		height: 100%;
+		width: 100%;
+		// z-index: 1;
+	}
+	.text {
+		padding-top: 147rpx;
+		font-size: $font-sm;
+		position: relative;
+	}
+	.money {
+		padding-top: 175rpx;
+		// margin: auto 0;
+		font-size: 56rpx;
+		font-weight: bold;
+		color: #FF4C4C;
+		position: relative;
+		.money-icon {
+			font-size: 38rpx;
+			font-weight: bold;
+			color: #FF4C4C;
+		}
+	}
+}
+
+.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: #999999;
+		position: relative;
+		&.current {
+			color: $base-color;
+			&:after {
+				content: '';
+				position: absolute;
+				left: 50%;
+				bottom: 0;
+				transform: translateX(-50%);
+				width: 44px;
+				height: 0;
+				border-bottom: 2px solid $base-color;
+			}
+		}
+	}
+}
+// 列表
+
+.swiper-box {
+	padding-top: 10rpx;
+	.order-item {
+		padding: 20rpx 30rpx;
+		line-height: 1.5;
+		position: relative;
+		// border-bottom: 1rpx black solid;
+		.title-box {
+			.title {
+				font-size: $font-lg;
+				color: $font-color-base;
+			}
+			.time {
+				font-size: $font-base;
+				color: $font-color-light;
+			}
+		}
+		.money {
+			// color: #fd5b23;
+			color: #901B21;
+			font-size: $font-lg;
+		}
+		.jg {
+			width: 701rpx;
+			height: 2rpx;
+			background: #F0F4F8;
+			margin: 0 auto;
+			position: absolute;
+			bottom: 0;
+		}
+	}
+}
+.list-scroll-content {
+	height: 100%;
+}
+.content {
+	height: 100%;
+	.empty-content {
+		background-color: #ffffff;
+	}
+}
+.add-btn {
+	position: fixed;
+	bottom: 51rpx;
+	right: 39rpx;
+	width: 674rpx;
+	height: 88rpx;
+	background: $base-color;
+	border-radius: 44rpx;
+	color: #fff;
+	text-align: center;
+	line-height: 88rpx;
+	font-size: 34rpx;
+}
+</style>

+ 312 - 0
pages/money/withdrawal.vue

@@ -0,0 +1,312 @@
+<template>
+	<view class="content">
+		<uni-notice-bar single="true" text="每月25号到月底可提现上月结算余额"></uni-notice-bar>
+		<view class="content-money">
+			<view class="flex ">
+				<view class="buttom">
+					<view class="icon">{{ money | getMoneyStyle }}</view>
+					<text class="text">可提现金额</text>
+				</view>
+				<view class="interval"></view>
+				<view class="buttom">
+					<view class=" icon">{{ freeze | getMoneyStyle }}</view>
+					<text class="text">待审核提现金额</text>
+				</view>
+			</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="'最低提现金额' + minPrice + '元'" placeholder-class="placeholder" />
+				<view class="buttom" @click="withdrawal = money">全部提现</view>
+			</view>
+		</view>
+		<!-- #ifndef MP-WEIXIN -->
+		<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">提现至支付宝</text>
+								<text v-else>请创建支付宝账号</text>
+							</view>
+							<view class="node">
+								<text v-if="aliData.fullname">真实姓名({{ aliData.fullname }})</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"><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">{{ bankData.bank + ' ' + bankData.bankno }}</text>
+								<text v-else>请创建银行账号</text>
+							</view>
+							<view class="node">
+								<text v-if="bankData.fullname">真实姓名({{ bankData.fullname }})</text>
+							</view>
+						</view>
+						<view class="right"><radio value="bank" color="#5dbc7c" :checked="type == 'bank'" /></view>
+					</view>
+				</label>
+			</radio-group>
+		</view>
+		<!-- #endif -->
+		<button class="add-btn up" @click="confirm">提交申请</button>
+		<button class="add-btn modified" v-if="!weichatBsrowser" @click="navTo('/pages/money/account')">账号管理</button>
+	</view>
+</template>
+
+<script>
+import { getMoneyStyle } from '@/utils/rocessor.js';
+import { extractCash, extractBank, aliInfo, bankInfo } from '@/api/wallet.js';
+import uniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar.vue';
+export default {
+	filters: {
+		getMoneyStyle
+	},
+	components: {
+		uniNoticeBar
+	},
+	data() {
+		return {
+			type: 'weixin', //提现方式
+			money: '0.00', //可提现金额
+			freeze: '0.0', //冻结金额
+			withdrawal: '', //提现金额
+			minPrice: '', //最少提现金额
+			aliData: {},
+			bankData: {},
+			// #ifdef H5
+			weichatBsrowser: false
+			// #endif
+		};
+	},
+	onLoad(options) {
+		// #ifdef H5
+		this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
+		// #endif
+		//加载提现信息
+		this.loadData();
+		// 加载提款账号信息
+		this.loadAli();
+		this.loadBank();
+	},
+	methods: {
+		// 更新数据
+		dataUp(){
+			this.loadAli();
+			this.loadBank();
+		},
+		//加载数据
+		async loadAli(source) {
+			aliInfo({}).then(e => {
+				this.aliData = e.data;
+			});
+		},
+		// 加载银行卡信息
+		async loadBank() {
+			bankInfo({}).then(e => {
+				this.bankData = e.data;
+			});
+		},
+		// 加载余额信息
+		async loadData() {
+			extractBank({}).then(({ data }) => {
+				this.money = data.moneyCount;//可提现余额
+				this.minPrice = data.minPrice;//最小提现
+				this.freeze =data.inmoneyCount//提现中的余额
+			});
+		},
+		// 跳转
+		navTo(url) {
+			uni.navigateTo({
+				url: url
+			});
+		},
+		// 切换选中对象
+		tabRadio(e) {
+			this.type = e.detail.value;
+		},
+		// 提交
+		confirm() {
+			let data = {
+				extract_type: this.type, //bank -银行卡 alipay-支付宝 weixin-微信
+				money: this.withdrawal, //金额
+				money_type: 1//0佣金1余额
+			}
+			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 => {
+					uni.showToast({
+						title: '提交成功',
+						duration: 2000,
+						position: 'top'
+					});
+				})
+				.catch(e => {
+					console.log();
+				});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	height: 100%;
+}
+.content-money {
+	padding: 30rpx 0;
+	background: #ffffff;
+}
+.flex {
+	background-color: #ffffff;
+	text-align: center;
+	margin: 0 30rpx;
+	border-radius: $border-radius-sm;
+	.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: $font-color-spec;
+			font-size: $font-base;
+		}
+	}
+}
+.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);
+}
+
+.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;
+			}
+		}
+	}
+}
+/deep/ .uni-radio-input {
+	width: 45rpx;
+	height: 45rpx;
+}
+</style>

BIN
static/img/qbbg.png