hwq 3 years ago
parent
commit
72ec4091a9
8 changed files with 796 additions and 378 deletions
  1. 24 0
      api/user.js
  2. 434 306
      pages/category/vip.vue
  3. 335 69
      pages/set/userinfo.vue
  4. 1 1
      pages/user/jindou.vue
  5. 2 2
      pages/user/user.vue
  6. BIN
      static/img/weixin.png
  7. BIN
      static/img/x.png
  8. BIN
      static/img/yue.png

+ 24 - 0
api/user.js

@@ -101,4 +101,28 @@ export function delcollect(data) {
 	});
 	});
 }
 }
 
 
+//用户修改信息
+export function edit(data) {
+        return request({
+                url: '/api/user/edit',
+                method: 'post',
+                data
+        });
+}
 
 
+//开通会员
+export function becomeVip(data) {
+	return request({
+		url: '/api/level/recharge',
+		method: 'post',
+		data
+	});
+}
+//获取会员
+export function getVip(data) {
+	return request({
+		url: '/api/level/lst',
+		method: 'get',
+		data
+	});
+}

+ 434 - 306
pages/category/vip.vue

@@ -11,16 +11,10 @@
 						<view class="tip" v-if="userInfo.level == 0">尚未开通会员</view>
 						<view class="tip" v-if="userInfo.level == 0">尚未开通会员</view>
 					</view>
 					</view>
 				</view>
 				</view>
-				<view class="now-wrap">
+				<view class="now-wrap">立即开通</view>
-					立即开通
-				</view>
 				<view class="card-info">
 				<view class="card-info">
-					<view class="info-tit">
+					<view class="info-tit">会员卡</view>
-						会员卡
+					<view class="info-val">¥{{ money }}/永久 终身{{name}}</view>
-					</view>
-					<view class="info-val">
-						100通证 终身付费会员
-					</view>
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
@@ -31,15 +25,15 @@
 					<view class="tool-img"><image src="../../static/icon/kt1.png" mode=""></image></view>
 					<view class="tool-img"><image src="../../static/icon/kt1.png" mode=""></image></view>
 					<view class="tool-name">佣金奖励</view>
 					<view class="tool-name">佣金奖励</view>
 				</view>
 				</view>
-				<view class="tool-item" >
+				<view class="tool-item">
 					<view class="tool-img"><image src="../../static/icon/kt2.png" mode=""></image></view>
 					<view class="tool-img"><image src="../../static/icon/kt2.png" mode=""></image></view>
 					<view class="tool-name">专属折扣</view>
 					<view class="tool-name">专属折扣</view>
 				</view>
 				</view>
-				<view class="tool-item" >
+				<view class="tool-item">
 					<view class="tool-img"><image src="../../static/icon/kt3.png" mode=""></image></view>
 					<view class="tool-img"><image src="../../static/icon/kt3.png" mode=""></image></view>
 					<view class="tool-name">专属服务</view>
 					<view class="tool-name">专属服务</view>
 				</view>
 				</view>
-				<view class="tool-item" >
+				<view class="tool-item">
 					<view class="tool-img"><image src="../../static/icon/kt4.png" mode=""></image></view>
 					<view class="tool-img"><image src="../../static/icon/kt4.png" mode=""></image></view>
 					<view class="tool-name">团队奖励</view>
 					<view class="tool-name">团队奖励</view>
 				</view>
 				</view>
@@ -53,359 +47,493 @@
 					<view class="tool-name bold">优惠价</view>
 					<view class="tool-name bold">优惠价</view>
 					<view class="tool-img"><image src="../../static/icon/kt5.png" mode=""></image></view>
 					<view class="tool-img"><image src="../../static/icon/kt5.png" mode=""></image></view>
 				</view>
 				</view>
-				<view class="tool-item1" >
+				<view class="tool-item1">
 					<view class="tool-name">会员专属</view>
 					<view class="tool-name">会员专属</view>
 					<view class="tool-name bold">专属服务包</view>
 					<view class="tool-name bold">专属服务包</view>
 					<view class="tool-img"><image src="../../static/icon/kt6.png" mode=""></image></view>
 					<view class="tool-img"><image src="../../static/icon/kt6.png" mode=""></image></view>
-					
 				</view>
 				</view>
-				<view class="tool-item1" >
+				<view class="tool-item1">
 					<view class="tool-name">推广得</view>
 					<view class="tool-name">推广得</view>
 					<view class="tool-name bold">更多佣金</view>
 					<view class="tool-name bold">更多佣金</view>
 					<view class="tool-img"><image src="../../static/icon/kt7.png" mode=""></image></view>
 					<view class="tool-img"><image src="../../static/icon/kt7.png" mode=""></image></view>
-					
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="bottom-btn">
 		<view class="bottom-btn">
-			<view class="btm-left">
+			<view class="btm-left">永久{{name}}¥{{ money }}</view>
-				永久付费会员100通证
+			<view class="btm-right" @click="readyPay()">马上开通</view>
-			</view>
-			<view class="btm-right" @click="readyPay()">
-				马上开通
-			</view>
 		</view>
 		</view>
+		<uni-popup ref="popupPay" type="bottom">
+			<view class="popup-box">
+				<view class="popup-pay">
+					<view class="paybox-top flex">
+						<view class="type">选择支付方式</view>
+						<view class="image" @click="close"><image src="../../static/img/x.png" mode="aspectFill"></image></view>
+					</view>
+					<view class="paybox-main flex">
+						<view class="zftype flex">
+							<image src="../../static/img/weixin.png" mode="aspectFill"></image>
+							<view class="zf">微信支付</view>
+						</view>
+						<label class="radio1" @click="changePayType(1)"><radio style="transform:scale(0.7)" value="" :checked="payType == 1" color="#FE4141"></radio></label>
+					</view>
+					<view class="paybox-main flex">
+						<view class="zftype flex">
+							<image src="../../static/img/yue.png" mode="aspectFill"></image>
+							<view class="zf">余额支付</view>
+						</view>
+						<label class="radio" @click="changePayType(2)">
+							<radio style="transform:scale(0.7)" class="rad" value="" :checked="payType == 2" color="#FE4141"></radio>
+						</label>
+					</view>
+				</view>
+				<view class="buttom flex">
+					<view class="heji">
+						合计:
+						<text>
+							¥
+							<text class="money">{{ money }}</text>
+						</text>
+					</view>
+					<view class="zhifu" @click="pay()">立即支付</view>
+				</view>
+			</view>
+		</uni-popup>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
-	import { becomeVip, getVip, setUserRed, claseauto } from '@/api/user.js';
+import { becomeVip, getVip } from '@/api/user.js';
-	import { mapState, mapMutations } from 'vuex';
+import { mapState, mapMutations } from 'vuex';
-	import { getUserInfo } from '@/api/user.js';
+import uniPopup from '@/components/uni-popup/uni-popup.vue';
-	export default {
+import { getUserInfo } from '@/api/user.js';
-		computed: {
+// #ifdef H5
-			...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+import weixinObj from '@/plugin/jweixin-module/index.js';
+// #endif
+export default {
+	components: {
+		uniPopup
+	},
+	computed: {
+		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+	},
+	data() {
+		return {
+			money: '',
+			name:'',
+			level_id:'',
+			payType: 2,
+			payName: 'yue',
+			now_money: '', // 当前余额
+			payLoding: false, //判断是否支付中
+		};
+	},
+	onLoad() {
+		this.getVip();
+	},
+	methods: {
+		...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
+		getUserInfoB() {
+			getUserInfo({})
+				.then(({ data }) => {
+					this.setUserInfo(data);
+					if (data.wx_qr) {
+						uni.navigateTo({
+							url: '/pages/vip/success'
+						});
+					} else {
+						this.$api.msg('请完善会员信息');
+						setTimeout(() => {
+							uni.navigateTo({
+								url: '/pages/set/userdata'
+							});
+						}, 1000);
+					}
+				})
+				.catch(e => {
+					console.log(e);
+				});
 		},
 		},
-		data() {
+		// 获取vip等级
-			return {
+		getVip() {
-				
+			getVip({}).then(({ data }) => {
-			}
+				console.log(data)
+				this.money = data[0].money
+				this.name = data[0].name
+				this.level_id = data[0].id
+			});
 		},
 		},
-		onLoad() {
+		// 开通会员
-			
+		readyPay() {
+			this.$refs.popupPay.open();
 		},
 		},
-		methods:{
+		close() {
-			...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
+			this.$refs.popupPay.close();
-			getUserInfoA() {
+		},
-				
+		changePayType(type) {
-			},
+			this.payType = type;
-			getUserInfoB() {
+			console.log('this.payType', this.payType);
-				getUserInfo({})
+			if (this.payType == 1) {
-					.then(({ data }) => {
+				this.payName = 'weixin';
-						this.setUserInfo(data);
+				console.log('weixin', this.payName);
-						if(data.wx_qr) {
+			}
-							uni.navigateTo({
+			if (this.payType == 2) {
-								url: '/pages/vip/success'
+				this.payName = 'yue';
-							});
+				console.log('yue', this.payName);
-						}else {
+			}
-							this.$api.msg('请完善会员信息')
+			if (this.payType == 3) {
-							setTimeout(()=> {
+				this.payName = 'ali';
-								uni.navigateTo({
+				console.log('ali', this.payName);
-									url:'/pages/set/userdata'
+			}
-								});
+		},
-							}, 1000);
+		pay() {
-						}
+			let obj = this;
-						
+			console.log('点击');
-					})
+			try {
-					.catch(e => {
-						console.log(e);
-					});
-			},
-			// 开通会员
-			readyPay() {
 				let obj = this;
 				let obj = this;
-				if(obj.userInfo.level > 0) {
+				obj.payLoding = true;
-					return obj.$api.msg('您已开通会员')
+				// #ifdef H5
-				}
+				// 获取当前是否为微信浏览器
-				getUserInfo()
+				obj.froms = uni.getStorageSync('weichatBrowser') || '';
-					.then(({ data }) => {
+				// #endif
-						
+				uni.showLoading({
-						this.setUserInfo(data);
+					title: '支付中',
-						if(data.now_money*1 < 100) {
+					mask: true
-							return obj.$api.msg('您的通证不足100')
+				});
-						}
+				let data = {
-					})
+					pay_type: this.payName,
-				
+					level_id: obj.level_id,
-				console.log('点击');
-				try {
-					let obj = this;
-					obj.payLoding = true;
 					// #ifdef H5
 					// #ifdef H5
-					// 获取当前是否为微信浏览器
+					from: obj.froms ? 'weixin' : 'H5', //来源
-					obj.froms = uni.getStorageSync('weichatBrowser') || '';
 					// #endif
 					// #endif
-					uni.showLoading({
+					// #ifdef MP-WEIXIN
-						title: '支付中',
+					from: 'routine', //来源
-						mask: true
+					// #endif
-					});
+					// #ifdef APP-PLUS
-					let data = {
+					from: 'app' //来源
-						pay_type: 'yue',
+					// #endif
-						level_id: 1,
+				};
-						// #ifdef H5
+				console.log(data, '传值');
-						from: obj.froms ? 'weixin' : 'H5', //来源
+				becomeVip(data).then(({ data }) => {
-						// #endif
+					console.log('fufei', data);
-						// #ifdef MP-WEIXIN
+					uni.hideLoading();
-						from: 'routine', //来源
+					if (data.status == 'PAY_ERROR') {
-						// #endif
+						console.log(data);
-						// #ifdef APP-PLUS
+					}
-						from: 'app' //来源
+					if (data.status == 'SUCCESS') {
-						// #endif
+						obj.$refs.popupPay.close();
-					};
+						obj.getUserInfoB();
-					console.log(data, '传值');
+					}
-					becomeVip(data).then(({ data }) => {
+					let da = data.result.jsConfig;
-						console.log('fufei', data);
+					if (obj.payName == 'weixin' || obj.payName == 'routine') {
-						uni.hideLoading();
+						// let da = data.result.jsConfig;
-						
+						console.log('--da--', da);
-						if (data.status == 'PAY_ERROR') {
+						let data = {
-							console.log(data);
+							// #ifdef H5
-						}
+							timestamp: da.timestamp,
-						if (data.status == 'SUCCESS') {
+							// #endif
-							
-							obj.getUserInfoB();
-						}
-						console.log('-----', data);
-						let da = data.result.jsConfig;
-						if (obj.payName == 'weixin' || obj.payName == 'routine') {
-							// let da = data.result.jsConfig;
-							console.log('--da--', da);
-							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) {
-									console.log(res);
-									obj.getUserInfoB();
-								},
-								fail: e => {
-									console.log(e);
-								}
-							};
-							console.log('--data--', data);
 							// #ifdef MP
 							// #ifdef MP
-							wx.requestPayment(data);
+							timeStamp: da.timestamp,
 							// #endif
 							// #endif
-							// #ifdef H5
+							nonceStr: da.nonceStr,
-							if (obj.payName == 'weixin') {
+							package: da.package,
-								weixinObj.chooseWXPay(data);
+							signType: da.signType,
+							paySign: da.paySign,
+							success: function(res) {
+								console.log(res);
+								obj.getUserInfoB();
+							},
+							fail: e => {
+								console.log(e);
 							}
 							}
-							// #endif
+						};
-						}
+						console.log('--data--', data);
-				
+						// #ifdef MP
-						uni.hideLoading();
+						wx.requestPayment(data);
+						// #endif
 						// #ifdef H5
 						// #ifdef H5
-						if (data.status == 'PAY_ERROR') {
+						if (obj.payName == 'weixin') {
-							console.log(data);
+							weixinObj.chooseWXPay(data);
-						}
-						if (data.status == 'SUCCESS') {
-							
-							obj.getUserInfoB();
 						}
 						}
 						// #endif
 						// #endif
-					});
+					}
-				} catch (e) {
+		
-					console.log('fufiecw', e);
+					uni.hideLoading();
-					//TODO handle the exception
+					// #ifdef H5
-				}
+					if (data.status == 'PAY_ERROR') {
+						console.log(data);
+					}
+					if (data.status == 'SUCCESS') {
+						obj.$refs.popupPay.close();
+						obj.getUserInfoB();
+					}
+					// #endif
+				});
+			} catch (e) {
+				console.log('fufiecw', e);
 			}
 			}
 		}
 		}
 	}
 	}
+};
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-	.card {
+.card {
-		position: relative;
+	position: relative;
-		margin: auto;
+	margin: auto;
-		z-index: 10;
+	z-index: 10;
-		width: 655rpx;
+	width: 655rpx;
-		height: 324rpx;
+	height: 324rpx;
-		background: linear-gradient(225deg, #ffeed2 0%, #fed591 100%);
+	background: linear-gradient(225deg, #ffeed2 0%, #fed591 100%);
-		border-radius: 24rpx;
+	border-radius: 24rpx;
-		padding: 28rpx 25rpx 30rpx 36rpx;
+	padding: 28rpx 25rpx 30rpx 36rpx;
-		.now-wrap {
+	.now-wrap {
-			width: 190rpx;
+		width: 190rpx;
-			line-height: 69rpx;
+		line-height: 69rpx;
-			background: #C09852;
+		background: #c09852;
-			border-radius: 35rpx;
+		border-radius: 35rpx;
-			position: absolute;
+		position: absolute;
-			top:39rpx;
+		top: 39rpx;
-			right: 25rpx;
+		right: 25rpx;
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #f6dca9;
+		text-align: center;
+	}
+	.card-top {
+		justify-content: flex-start;
+		.avtur {
+			width: 90rpx;
+			height: 90rpx;
+			border-radius: 50%;
+			margin-right: 10rpx;
+			image {
+				width: 100%;
+				height: 100%;
+				border-radius: 50%;
+			}
+		}
+		.name {
 			font-size: 30rpx;
 			font-size: 30rpx;
 			font-family: PingFang SC;
 			font-family: PingFang SC;
 			font-weight: 500;
 			font-weight: 500;
-			color: #F6DCA9;
+			color: #333333;
-			text-align: center;
-			
 		}
 		}
-		.card-top {
+		.tip {
-			justify-content: flex-start;
+			font-size: 20rpx;
-			.avtur {
+			font-family: PingFang SC;
-				width: 90rpx;
+			font-weight: 500;
-				height: 90rpx;
+			color: #333333;
-				border-radius: 50%;
+			opacity: 0.52;
-				margin-right: 10rpx;
+		}
-				image {
+	}
-					width: 100%;
+	.btn {
-					height: 100%;
+		position: absolute;
-					border-radius: 50%;
+		top: 40rpx;
-				}
+		right: 24rpx;
-			}
+		width: 190rpx;
-			.name {
+		height: 69rpx;
-				font-size: 30rpx;
+		background: #3a3a3b;
-				font-family: PingFang SC;
+		border-radius: 35rpx;
-				font-weight: 500;
+		font-size: 30rpx;
-				color: #333333;
+		font-family: PingFang SC;
-			}
+		font-weight: 500;
-			.tip {
+		color: #ffffff;
-				font-size: 20rpx;
+		line-height: 69rpx;
-				font-family: PingFang SC;
+		text-align: center;
-				font-weight: 500;
+	}
-				color: #333333;
+	.card-info {
-				opacity: 0.52;
+		height: 120rpx;
+		position: absolute;
+		bottom: 30rpx;
+		left: 43rpx;
+		.info-tit {
+			line-height: 70rpx;
+			font-size: 40rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #333333;
+		}
+		.info-val {
+			font-size: 28rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #343434;
+		}
+	}
+}
+.hyjl {
+	background-color: #fff;
+	padding: 30rpx 30rpx 0;
+	margin-bottom: 20rpx;
+	.jl-tit {
+		font-size: 36rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #000000;
+	}
+}
+.tool {
+	flex-wrap: wrap;
+	justify-content: flex-start;
+	align-items: center;
+	.tool-item {
+		width: 25%;
+		height: 160rpx;
+		display: flex;
+		align-items: center;
+		flex-direction: column;
+		justify-content: center;
+		.tool-img {
+			width: 45rpx;
+			height: 45rpx;
+			image {
+				width: 100%;
+				height: 100%;
 			}
 			}
 		}
 		}
-		.btn {
+		.tool-name {
-			position: absolute;
+			padding-top: 20rpx;
-			top: 40rpx;
+			font-size: 28rpx;
-			right: 24rpx;
+			font-family: PingFang SC;
-			width: 190rpx;
+			font-weight: 400;
-			height: 69rpx;
+			color: #505050;
-			background: #3a3a3b;
+		}
-			border-radius: 35rpx;
+	}
+	.tool-item1 {
+		background: #fafbff;
+		display: flex;
+		align-items: center;
+		flex-direction: column;
+		justify-content: center;
+		width: 222rpx;
+		height: 298rpx;
+		background: #fafbff;
+		border-radius: 10rpx;
+		.tool-name {
 			font-size: 30rpx;
 			font-size: 30rpx;
 			font-family: PingFang SC;
 			font-family: PingFang SC;
 			font-weight: 500;
 			font-weight: 500;
-			color: #ffffff;
+			color: #7b7b7b;
-			line-height: 69rpx;
-			text-align: center;
 		}
 		}
-		.card-info {
+		.bold {
-			height: 120rpx;
+			font-weight: bold;
-			position: absolute;
+			color: #000;
-			bottom: 30rpx;
+		}
-			left: 43rpx;
+		.tool-img {
-			.info-tit {
+			width: 157rpx;
-				line-height: 70rpx;
+			height: 112rpx;
-				font-size: 40rpx;
+			margin-top: 37rpx;
-				font-family: PingFang SC;
+			image {
-				font-weight: bold;
+				width: 100%;
-				color: #333333;
+				height: 100%;
-			}
-			.info-val {
-				font-size: 28rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #343434;
 			}
 			}
 		}
 		}
 	}
 	}
-	.hyjl {
+}
-		background-color: #fff;
+.bottom-btn {
-		padding:30rpx 30rpx 0;
+	display: flex;
-		margin-bottom: 20rpx;
+	align-items: flex-end;
-		.jl-tit {
+	position: fixed;
-			font-size: 36rpx;
+	bottom: 0;
+	text-align: center;
+	.btm-left {
+		width: 750rpx - 280rpx;
+		line-height: 100rpx;
+		background-color: #34332f;
+		color: #fff;
+	}
+	.btm-right {
+		width: 280rpx;
+		line-height: 108rpx;
+
+		background: #efd4a1;
+		font-size: 36rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #5a5a5a;
+	}
+}
+.popup-box {
+	width: 100%;
+	background: #ffffff;
+}
+.popup-pay {
+	position: relative;
+	justify-content: space-between;
+	padding: 0rpx 25rpx 32rpx 25rpx;
+	.paybox-top {
+		padding-top: 38rpx;
+		width: 100%;
+		.type {
+			font-size: 28rpx;
 			font-family: PingFang SC;
 			font-family: PingFang SC;
-			font-weight: 500;
+			font-weight: bold;
-			color: #000000;
+			color: #333333;
+		}
+		.image {
+			padding-right: 24rpx;
+			padding-bottom: 10rpx;
+			image {
+				width: 16rpx;
+				height: 16rpx;
+			}
 		}
 		}
 	}
 	}
-	.tool {
+	.paybox-main {
-		flex-wrap: wrap;
+		width: 100%;
-		justify-content: flex-start;
+		margin-top: 54rpx;
-		align-items: center;
+		.zftype {
-		.tool-item {
+			padding-left: 5rpx;
-			width: 25%;
+			image {
-			height: 160rpx;
+				width: 38rpx;
-			display: flex;
+				height: 40rpx;
-			align-items: center;
-			flex-direction: column;
-			justify-content: center;
-			.tool-img {
-				width: 45rpx;
-				height: 45rpx;
-				image {
-					width: 100%;
-					height: 100%;
-				}
 			}
 			}
-			.tool-name {
+			.zf {
-				padding-top: 20rpx;
+				padding-left: 18rpx;
 				font-size: 28rpx;
 				font-size: 28rpx;
 				font-family: PingFang SC;
 				font-family: PingFang SC;
 				font-weight: 400;
 				font-weight: 400;
-				color: #505050;
+				color: #3f454b;
 			}
 			}
 		}
 		}
-		.tool-item1 {
-			background: #FAFBFF;
-			display: flex;
-			align-items: center;
-			flex-direction: column;
-			justify-content: center;
-			width: 222rpx;
-			height: 298rpx;
-			background: #FAFBFF;
-			border-radius: 10rpx;
-			.tool-name {
-				font-size: 30rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #7B7B7B;
-			}
-			.bold {
-				font-weight: bold;
-				color: #000;
-			}
-			.tool-img {
-				width: 157rpx;
-				height: 112rpx;
-				margin-top: 37rpx;
-				image {
-					width: 100%;
-					height: 100%;
-				}
-			}
-		}
-		
 	}
 	}
-	.bottom-btn {
+}
-		display: flex;
+.buttom {
-		align-items: flex-end;
+	width: 100%;
-		position: fixed;
+	height: 113rpx;
-		bottom: 0;
+	padding-top: 20rpx;
-		text-align: center;
+	align-items: center;
-		.btm-left {
+	.heji {
-			width: 750rpx - 280rpx;
+		height: 100%;
-			line-height: 100rpx;
+		width: 50%;
-			background-color: #34332F;
+		padding-left: 23rpx;
-			color: #fff;
+		padding-top: 20rpx;
-		}
+		font-size: 28rpx;
-		.btm-right {
+		font-family: PingFang SC;
-			width: 280rpx;
+		font-weight: 400;
-			line-height: 108rpx;
+		color: #3f454b;
-			
+		text {
-			background: #EFD4A1;
+			font-size: 24rpx;
-			font-size: 36rpx;
 			font-family: PingFang SC;
 			font-family: PingFang SC;
 			font-weight: bold;
 			font-weight: bold;
-			color: #5A5A5A;
+			color: #ff0000;
+			.money {
+				font-size: 36rpx;
+			}
 		}
 		}
 	}
 	}
+	.zhifu {
+		width: 50%;
+		height: 92rpx;
+		background: linear-gradient(180deg, #fd4646, #ff3535);
+		text-align: center;
+		line-height: 92rpx;
+		font-size: 32rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #ffffff;
+	}
+}
 </style>
 </style>

+ 335 - 69
pages/set/userinfo.vue

@@ -1,93 +1,359 @@
 <template>
 <template>
 	<view class="content">
 	<view class="content">
-		<view class="row b-b">
+		<view class="tit">
-			<text class="tit">昵称</text>
+			上传微信收款码
-			<input class="input" type="text" v-model="name" placeholder="修改昵称" placeholder-class="placeholder" />
+		</view>
+		<view class="up-wrap" @click="imgsub('upimg')">
+			<image :src="upimg" mode="" v-if="upimg"></image>
+			<image v-else src="../../static/img/upimg.png" mode=""></image>
+		</view>
+		<view class="tit">
+			基本信息
+		</view>
+		<view class="base-info">
+			<view class="base-item" style="padding-bottom: 20rpx;">
+				<view class="item-name">头像</view>
+				<view class="avatar" @click="imgsub('avatar')">
+					<image :src="avatar || '../../static/error/missing-face.png'" mode="" ></image>
+				</view>
+			</view>
+			<view class="base-item flex">
+				<view class="item-name">昵称</view>
+				<input type="text" value="" class="item-val" placeholder="输入您的昵称" v-model="nickname" />
+			</view>
+			<view class="base-item flex">
+				<view class="item-name">ID</view>
+				<input type="text" value="" class="item-val" placeholder="输入您的昵称" v-model="uid" disabled/>
+			</view>
+			<view class="base-item flex">
+				<view class="item-name">手机号</view>
+				<input type="text" value="" class="item-val" placeholder="输入您的手机号" v-model="phone" />
+			</view>
+			<view class="base-item flex">
+				<view class="item-name">姓名</view>
+				<input type="text" value="" class="item-val" placeholder="输入您的姓名" v-model="real_name" />
+			</view>
+			<view class="base-item flex">
+				<view class="item-name">微信号</view>
+				<input type="text" value="" class="item-val" placeholder="输入您的微信号" v-model="wx_no" />
+			</view>
+			<view class="base-item flex">
+				<view class="item-name">支付宝姓名</view>
+				<input type="text" value="" class="item-val" placeholder="输入您的支付宝姓名" v-model="alipay_name" />
+			</view>
+			<view class="base-item flex">
+				<view class="item-name">支付宝账号</view>
+				<input type="text" value="" class="item-val" placeholder="输入您的支付宝账号" v-model="alipay_no" />
+			</view>
+			<view class="base-item flex">
+				<view class="item-name">开户行</view>
+				<input type="text" value="" class="item-val" placeholder="输入您的开户行" v-model="account_Bank" />
+			</view>
+			<view class="base-item flex">
+				<view class="item-name">所属支行</view>
+				<input type="text" value="" class="item-val" placeholder="输入所属支行" v-model="bank_branch" />
+			</view>
+			<view class="base-item flex">
+				<view class="item-name">开户行姓名</view>
+				<input type="text" value="" class="item-val" placeholder="输入您的开户行姓名" v-model="bank_name" />
+			</view>
+			<view class="base-item flex">
+				<view class="item-name">银行卡账号</view>
+				<input type="text" value="" class="item-val" placeholder="输入您的银行卡账号" v-model="bank_card" />
+			</view>
+		</view>
+		<view class="btn" @click="subInfo">提交保存</view>
+		<view class="btn1" @click="toLogout">退出登录</view>
+		<view class="jg" style="height: 70rpx;">
+
 		</view>
 		</view>
-		<button class="add-btn" @click="confirm">提交</button>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
-import { mapState } from 'vuex';
+	import { mapState, mapMutations } from 'vuex';
-import { userEdit } from '@/api/set.js';
+	import { getUserInfo } from '@/api/user.js';
-export default {
+	import { edit } from '@/api/user.js';
-	data() {
+	import { upload } from '@/api/order.js';
-		return {
+	  import { logout } from '@/api/set.js';
-			name: ''
+	export default {
-		};
+		computed: {
-	},
+			...mapState('user',['userInfo'])
-
-	computed: {
-		...mapState('user', ['userInfo'])
-	},
-	onShow(option) {
-		this.name = this.userInfo.nickname + '';
-	},
-	methods: {
-		switchChange(e) {
-			this.addressData.default = e.value;
 		},
 		},
-		confirm() {
+		data() {
-			userEdit({ nickname: this.name, avatar: this.userInfo.avatar })
+			return {
-				.then(e => {
+				avatar: '',
-					this.$api.msg('修改成功');
+				upimg: '',
+				real_name: '',
+				nickname: '',
+				phone: '',
+				wx_no: '',
+				alipay_name: '',
+				alipay_no: '',
+				account_Bank: '',
+				bank_branch: '',
+				bank_card: '',
+				bank_name: '',
+				// birthday: '',
+				city: '',
+				card_id: '',//身份证
+				uid: '',
+				vip_name: ''
+			}
+		},
+		onLoad() {
+			let obj = this
+			obj.avatar = obj.userInfo.avatar || ''
+			obj.alipay_name = obj.userInfo.alipay_name || ''
+			obj.alipay_no = obj.userInfo.alipay_no || '',
+			obj.bank_branch = obj.userInfo.bank_branch || ''
+			obj.account_Bank = obj.userInfo.account_Bank || ''
+			obj.bank_card = obj.userInfo.bank_card || ''
+			obj.uid = obj.userInfo.uid
+			obj.bank_name = obj.userInfo.bank_name || ''
+			// obj.birthday = obj.userInfo.birthday || ''
+			// obj.card_id: obj.userInfo.card_id  || ''
+			obj.upimg = obj.userInfo.wx_qr || ''
+			obj.wx_no = obj.userInfo.wx_no || ''
+			obj.phone = obj.userInfo.phone || ''
+			obj.real_name = obj.userInfo.real_name || ''
+			obj.nickname = obj.userInfo.nickname || ''
+			console.log(obj.userInfo.vip_name,'obj.userInfo.vip_name')
+			// obj.vip_name = obj.userInfo.vip_name || '暂无'
+		},
+		methods: {
+			...mapMutations('user', ['setUserInfo', 'setOrderInfo','logout']),
+			//退出登录
+			toLogout() {
+				let obj = this;
+				uni.showModal({
+					content: '确定要退出登录么',
+					success: e => {
+						if (e.confirm) {
+							logout({}).then(e => {
+								obj.logout();
+								uni.navigateTo({
+									url:'/pages/public/login'
+								})
+							})
+							.catch(e => {
+								console.log(e);
+							});
+						}
+					}
+				});
+			},
+			imgsub(text) {
+				console.log('imgsub');
+				upload({
+					filename: ''
+				}).then(data => {
+					// this.upimg = data[0].url;
+					this.$set(this,text,data[0].url)
+				});
+			},
+			getUserInfo() {
+				getUserInfo({})
+					.then(({ data }) => {
+						this.setUserInfo(data);
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
+			bindDateChange(e) {
+				this.birthday = e.detail.value
+			},
+			subInfo() {
+				let obj = this
+				if(obj.upimg == '') {
+					obj.$api.msg('请上传收款码')
+					return
+				}
+				if(obj.avatar == '') {
+					obj.$api.msg('请上传头像')
+					return
+				}
+				if(obj.nickname == '') {
+					obj.$api.msg('请输入昵称')
+					return
+				}
+				if(obj.phone == '') {
+					obj.$api.msg('请输入手机号')
+					return
+				}
+				const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
+				if (!reg.test(obj.phone)) {
+					obj.$api.msg('请填写正确的手机号码');
+					return;
+				}
+				if(obj.real_name == '') {
+					obj.$api.msg('请输入姓名')
+					return
+				}
+				if(obj.wx_no == '') {
+					obj.$api.msg('请输入微信号')
+					return
+				}
+				if(obj.alipay_name == '') {
+					obj.$api.msg('请输入支付宝姓名')
+					return
+				}
+				if(obj.alipay_no == '') {
+					obj.$api.msg('请输入支付宝账号')
+					return
+				}
+				if(obj.account_Bank == '') {
+					obj.$api.msg('请输入开户行')
+					return
+				}
+				if(obj.bank_branch == '') {
+					obj.$api.msg('请输入所属支行')
+					return
+				}
+				if(obj.bank_name == '') {
+					obj.$api.msg('请输入开户姓名')
+					return
+				}
+				if(obj.bank_card == '') {
+					obj.$api.msg('请输入银行卡账号')
+					return
+				}
+				// if(obj.birthday == '') {
+				// 	obj.$api.msg('请输入出生日期')
+				// 	return
+				// }
+				
+				uni.showLoading({
+					title: '提交中...',
+					mask:true
+				})
+				edit({
+					avatar: obj.avatar,
+					alipay_name: obj.alipay_name,
+					alipay_no: obj.alipay_no,
+					account_Bank: obj.account_Bank,
+					bank_branch: obj.bank_branch,
+					bank_card: obj.bank_card,
+					bank_name: obj.bank_name,
+					// birthday: obj.birthday,
+					// card_id: obj.card_id,
+					wx_no: obj.wx_no,
+					phone: obj.phone,
+					real_name: obj.real_name,
+					nickname: obj.nickname,
+					wx_qr: obj.upimg
+					
+				}).then( res => {
+					obj.getUserInfo()
+					
+					obj.$api.msg('修改成功');
 					setTimeout(()=> {
 					setTimeout(()=> {
 						uni.switchTab({
 						uni.switchTab({
 							url:'/pages/user/user'
 							url:'/pages/user/user'
 						});
 						});
 					}, 1000);
 					}, 1000);
-					console.log(e);
+					
+				}).catch( err => {
+					console.log(err)
 				})
 				})
-				.catch(e => {
+			}
-					console.log(e);
-				});
 		}
 		}
 	}
 	}
-};
 </script>
 </script>
 
 
-<style lang="scss">
+<style lang="scss" scoped>
-page {
+	.tit {
-	background: $page-color-base;
+		padding: 30rpx 25rpx;
-	padding-top: 16upx;
+		font-size: 32rpx;
-}
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #101010;
+	}
 
 
-.row {
+	.up-wrap {
-	display: flex;
+		margin-left: 30rpx;
-	align-items: center;
+		width: 225rpx;
-	position: relative;
+		height: 225rpx;
-	padding: 0 30upx;
+		background: #FFFFFF;
-	height: 110upx;
+		border-radius: 10rpx;
-	background: #fff;
 
 
-	.tit {
+		image {
-		flex-shrink: 0;
+			width: 225rpx;
-		width: 120upx;
+			height: 225rpx;
-		font-size: 30upx;
+			border-radius: 10rpx;
-		color: $font-color-dark;
+		}
 	}
 	}
-	.input {
+
-		flex: 1;
+	.base-info {
-		font-size: 30upx;
+		margin: auto;
-		color: $font-color-dark;
+		width: 702rpx;
+		// height: 1106px;
+		background: #FFFFFF;
+		box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
+		border-radius: 20rpx;
+
+		.base-item {
+			border: 1px solid #eee;
+			line-height: 100rpx;
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #333333;
+			padding-left: 25rpx;
+			
+			.avatar {
+				margin: auto;
+				width: 200rpx;
+				height: 200rpx;
+				border-radius: 50%;
+				// background-color: #aaa;
+				image {
+					width: 200rpx;
+					height: 200rpx;
+					border-radius: 50%;
+				}
+			}
+			.item-name {
+				font-weight: bold;
+			}
+			.item-val {
+				display: block;
+				line-height: 100rpx;
+				height: 100rpx;
+				width: 478rpx;
+				font-size: 28rpx;
+				font-family: PingFang SC;
+				font-weight: 400;
+				color: #000;
+			}
+		}
+
+	}
+
+	.btn {
+		margin: 70rpx auto 0;
+		width: 702rpx;
+		line-height: 84rpx;
+		background: linear-gradient(30deg, #FF4C4C, #FE6238);
+		border-radius: 10rpx;
+		font-size: 32rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #FFFFFF;
+		text-align: center;
 	}
 	}
-	.iconlocation {
+	.btn1 {
-		font-size: 36upx;
+		margin: 30rpx auto 0;
-		color: $font-color-light;
+		width: 702rpx;
+		line-height: 84rpx;
+		color: #FF4C4C;
+		border: 1px solid #FF4C4C;
+		background-color: #fff;
+		border-radius: 10rpx;
+		font-size: 32rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		text-align: center;
 	}
 	}
-}
-.add-btn {
-	display: flex;
-	align-items: center;
-	justify-content: center;
-	width: 690upx;
-	height: 80upx;
-	margin: 60upx auto;
-	font-size: $font-lg;
-	color: #fff;
-	background-color: $base-color;
-	border-radius: 10upx;
-	// box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
-}
 </style>
 </style>

+ 1 - 1
pages/user/jindou.vue

@@ -5,7 +5,7 @@
 				<view class="goback-box" @click="toBack"><image class="goback" src="../../static/img/fanhui.png" mode=""></image></view>
 				<view class="goback-box" @click="toBack"><image class="goback" src="../../static/img/fanhui.png" mode=""></image></view>
 				<view class="header">我的金豆</view>
 				<view class="header">我的金豆</view>
 				<image class="money_bg" src="../../static/img/anchor10.png"></image>
 				<image class="money_bg" src="../../static/img/anchor10.png"></image>
-				<view class="money">{{ userInfo.brokerage_price | getMoneyStyle }}</view>
+				<view class="money">{{ userInfo.integral | getMoneyStyle }}</view>
 			</view>
 			</view>
 
 
 		</view>
 		</view>

+ 2 - 2
pages/user/user.vue

@@ -105,7 +105,7 @@
 import { mapState, mapMutations } from 'vuex';
 import { mapState, mapMutations } from 'vuex';
 import uniList from '@/components/uni-list/uni-list.vue';
 import uniList from '@/components/uni-list/uni-list.vue';
 import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
 import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
-import { orderData, userinfo } from '@/api/user.js';
+import { orderData, getUserInfo } from '@/api/user.js';
 import { saveUrl, interceptor } from '@/utils/loginUtils.js';
 import { saveUrl, interceptor } from '@/utils/loginUtils.js';
 let startY = 0,
 let startY = 0,
 	moveY = 0,
 	moveY = 0,
@@ -148,7 +148,7 @@ export default {
 		...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
 		...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
 		// 加载初始数据
 		// 加载初始数据
 		loadBaseData() {
 		loadBaseData() {
-			userinfo({})
+			getUserInfo({})
 				.then(({ data }) => {
 				.then(({ data }) => {
 					this.setUserInfo(data);
 					this.setUserInfo(data);
 					// 获取用户数据完毕后在获取订单数据防止多次跳转到登录页
 					// 获取用户数据完毕后在获取订单数据防止多次跳转到登录页

BIN
static/img/weixin.png


BIN
static/img/x.png


BIN
static/img/yue.png