Browse Source

Merge branch 'master' of http://git.liuniu946.com/xiemingyang/zhengyi

lhl 3 years ago
parent
commit
9120b76f6c
2 changed files with 315 additions and 273 deletions
  1. 17 5
      pages/public/register.vue
  2. 298 268
      pages/user/jiedian.vue

+ 17 - 5
pages/public/register.vue

@@ -11,7 +11,7 @@
 			</view>
 			<view class="login_input flex">
 				<view class="login_img"><image src="/static/icon/pread.png"></image></view>
-				<view class="login_name"><input class="uni-input" type="text" v-model="invitation" focus placeholder="请输入接点人id" /></view>
+				<view class="login_name"><input class="uni-input" type="text" v-model="invitation" focus placeholder="请输入接点人id" :disabled="isinvitation" /></view>
 			</view>
 			<view class="login_input flex">
 				<view class="login_img"><image src="/static/icon/psw.png"></image></view>
@@ -30,10 +30,11 @@
 			</view>
 			<view class="login_input flex">
 				<view class="login_img"><image src="/static/icon/dw.png"></image></view>
-				<picker @change="bindParentArea" :value="parent_area" :range="parent_areas" class="uni-input">
+				<picker v-if="!isparent_area" @change="bindParentArea" :value="parent_area" :range="parent_areas" class="uni-input">
 					<view class="placeholder" v-if="parent_area === ''">请选择区域</view>
 					<text>{{ parent_area }}</text>
 				</picker>
+				<view class="login_name" v-else><input class="uni-input" type="text" v-model="parent_area" focus disabled /></view>
 			</view>
 			<view class="login_input flex">
 				<view class="login_img"><image src="/static/icon/dw.png"></image></view>
@@ -70,12 +71,23 @@ export default {
 			parent_areas: ['A','B','C'],//区域列表
 			pay_type: '',
 			pay_types: ['微信','余额','佣金'],
-			isSelsect: false,
+			isSelsect: false,
+			isinvitation: false,
+			isparent_area: false,
 		};
 	},
-	onLoad() {
+	onLoad(option) {
+		if(option.id){
+			this.invitation = option.id
+			console.log(this.invitation)
+			this.isinvitation = true;
+		}
+		if(option.area){
+			this.parent_area = option.area
+			this.isparent_area = true
+		}
 		// 获取扫码邀请人id
-		this.invitation = uni.getStorageSync('spread')||'';
+		// this.invitation = uni.getStorageSync('spread')||'';
 	},
 	watch: {
 		// 监听倒计时

+ 298 - 268
pages/user/jiedian.vue

@@ -1,245 +1,262 @@
 <template>
 	<view class="content">
 		<!-- 头部 -->
-		
+
 		<view class="container">
-			<view class="jiedianbackground">
-				<image src="../../static/image/jiedian.png" mode=""></image>
-			</view>
+			<view class="jiedianbackground"><image src="../../static/image/jiedian.png" mode=""></image></view>
 			<view class="number-box">
 				<view class="number">
-					<text>{{userInfo.A_count + userInfo.B_count + userInfo.C_count}}</text>人
-				</view>
-				<view class="renshu">
-					我的接点人数
+					<text>{{ userInfo.A_count + userInfo.B_count + userInfo.C_count }}</text>
+					人
 				</view>
+				<view class="renshu">我的接点人数</view>
 			</view>
 		</view>
 		<view class="message">
 			<view class="yeji">
 				<view class="yeji-a">
-					<view class="yeji-top">
-						A区业绩
-					</view>
-					<view class="yeji-buttom">¥{{userInfo.A_achievement}}</view>
+					<view class="yeji-top">A区业绩</view>
+					<view class="yeji-buttom">¥{{ userInfo.A_achievement }}</view>
 				</view>
 				<view class="border"></view>
 				<view class="yeji-a">
-					<view class="yeji-top">
-						B区业绩
-					</view>
-					<view class="yeji-buttom">¥{{userInfo.B_achievement}}</view>
+					<view class="yeji-top">B区业绩</view>
+					<view class="yeji-buttom">¥{{ userInfo.B_achievement }}</view>
 				</view>
 				<view class="border"></view>
 				<view class="yeji-a">
-					<view class="yeji-top">
-						C区业绩
-					</view>
-					<view class="yeji-buttom">¥{{userInfo.C_achievement}}</view>
+					<view class="yeji-top">C区业绩</view>
+					<view class="yeji-buttom">¥{{ userInfo.C_achievement }}</view>
 				</view>
 			</view>
 			<view class="relation-box">
 				<view class="relation">
 					<view class="headbox">
 						<view class="head">
-							<view class="photo">
-								<image :src=" avatar || '../../static/error/missing-face.png' "></image>
-							</view>
-						</view>
-						<view class="head-title">
-							<image src="../../static/image/jiedian1.png" mode=""></image>
+							<view class="photo"><image :src="avatar || '../../static/error/missing-face.png'"></image></view>
 						</view>
+						<view class="head-title"><image src="../../static/image/jiedian1.png" mode=""></image></view>
 					</view>
 					<view class="information">
-						<view class="name clamp">
-							{{name}}
-						</view>
-						<view class="cell clamp">
-							{{phone}}
-						</view>
+						<view class="name clamp">{{ name }}</view>
+						<view class="cell clamp">{{ phone }}</view>
 					</view>
 				</view>
-				<view class="sanchaji">
-					<image src="../../static/image/sanchaji.png" mode=""></image>
-				</view>
+				<view class="sanchaji"><image src="../../static/image/sanchaji.png" mode=""></image></view>
 				<view class="subordinate">
-					<view class="headbox" >
+					<view class="headbox" v-if="listA != ''" @click="nav('a')">
 						<view class="head">
-							<view class="photo">
-								<image src="../../static/image/photo.jpg" mode=""></image>
-							</view>
-						</view>
-						<view class="head-title">
-							<image src="../../static/image/jiedian1.png" mode=""></image>
+							<view class="photo"><image :src="listA.avatar" mode=""></image></view>
 						</view>
+						<view class="head-title"><image src="../../static/image/jiedian1.png" mode=""></image></view>
 					</view>
-					<view class="headbox" >
+					<view class="zhuce" v-if="listA == ''" @click="navto('a')">注册接点A</view>
+					<view class="headbox" v-if="listB != ''" @click="nav('b')">
 						<view class="head">
-							<view class="photo">
-								<image src="../../static/image/photo.jpg" mode=""></image>
-							</view>
-						</view>
-						<view class="head-title">
-							<image src="../../static/image/jiedian1.png" mode=""></image>
+							<view class="photo"><image :src="listB.avatar" mode=""></image></view>
 						</view>
+						<view class="head-title"><image src="../../static/image/jiedian1.png" mode=""></image></view>
 					</view>
-					<view class="headbox" >
+					<view class="zhuce" v-if="listB == ''" @click="navto('b')">注册接点B</view>
+					<view class="headbox" v-if="listC != ''" @click="nav('c')">
 						<view class="head">
-							<view class="photo">
-								<image src="../../static/image/photo.jpg" mode=""></image>
-							</view>
-						</view>
-						<view class="head-title">
-							<image src="../../static/image/jiedian1.png" mode=""></image>
+							<view class="photo"><image :src="listC.avatar" mode=""></image></view>
 						</view>
+						<view class="head-title"><image src="../../static/image/jiedian1.png" mode=""></image></view>
 					</view>
+					<view class="zhuce" v-if="listC == ''" @click="navto('c')">注册接点C</view>
 				</view>
 			</view>
-
 		</view>
 	</view>
 </template>
 
 <script>
-	import { getjiedian } from '@/api/user.js'
-	import { mapState, mapMutations } from 'vuex';
-	export default {
-		data() {
-			return {
-				a: 1,
-				b: 2,
-				c: 3,
-				people: 255,
-				listA:'',
-				listB:'',
-				listC:'',
-				name:'',
-				phone:'',
-				avatar:'',
-				id:''
-			}
-		},
-		computed: {
-			...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+import { getjiedian } from '@/api/user.js';
+import { mapState, mapMutations } from 'vuex';
+export default {
+	data() {
+		return {
+			a: 1,
+			b: 2,
+			c: 3,
+			people: 255,
+			listA: '',
+			listB: '',
+			listC: '',
+			name: '',
+			phone: '',
+			avatar: '',
+			id: ''
+		};
+	},
+	computed: {
+		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+	},
+	onLoad() {
+		this.name = this.userInfo.nickname;
+		this.phone = this.userInfo.phone;
+		this.avatar = this.userInfo.avatar;
+		this.id = this.userInfo.uid;
+		this.loadData();
+	},
+	methods: {
+		loadData() {
+			const obj = this;
+			getjiedian({}, this.id).then(({ data }) => {
+				if (data.list.length != 0) {
+					data.list.forEach(e => {
+						console.log('e', e);
+						if (e.parent_area == 'A') {
+							this.listA = e;
+						} else if (e.parent_area == 'B') {
+							this.listB = e;
+						} else if (e.parent_area == 'C') {
+							this.listC = e;
+						}
+					});
+				} else {
+					return;
+				}
+			});
 		},
-		onLoad() {
-			this.name = this.userInfo.nickname;
-			this.phone = this.userInfo.phone;
-			this.avatar = this.userInfo.avatar
-			this.id = this.userInfo.uid
-			this.loadData()
+		nav(type) {
+			if (type == 'a') {
+				this.name = this.listA.nickname;
+				this.phone = this.listA.phone;
+				this.avatar = this.listA.avatar;
+				this.id = this.listA.uid;
+				this.listA = '';
+				this.listB = '';
+				this.listC = '';
+				this.loadData();
+			} else if (type == 'b') {
+				this.name = this.listB.nickname;
+				this.phone = this.listB.phone;
+				this.avatar = this.listB.avatar;
+				this.id = this.listB.uid;
+				this.listA = '';
+				this.listB = '';
+				this.listC = '';
+				this.loadData();
+			} else if (type == 'c') {
+				this.name = this.listC.nickname;
+				this.phone = this.listC.phone;
+				this.avatar = this.listC.avatar;
+				this.id = this.listC.uid;
+				this.listA = '';
+				this.listB = '';
+				this.listC = '';
+				this.loadData();
+			}
 		},
-		methods: {
-			loadData(){
-				const obj = this
-				getjiedian({},this.id).then(({data}) => {
-					console.log(data)
-				})
+		navto(type) {
+			if (type == 'a') {
+				uni.navigateTo({
+					url: '/pages/public/register?id=' + this.id + '&area=A'
+				});
+			} else if (type == 'b') {
+				uni.navigateTo({
+					url: '/pages/public/register?id=' + this.id + '&area=B'
+				});
+			} else if (type == 'c') {
+				if (this.listA == '' || this.listB == '') {
+					this.$api.msg('请先注册完接点A和接点B');
+				} else {
+					uni.navigateTo({
+						url: '/pages/public/register?id=' + this.id + '&area=C'
+					});
+				}
 			}
 		}
 	}
+};
 </script>
 
 <style lang="scss">
-	page {
-		padding: 0;
-		margin: 0;
-		height: 100%;
-		background-color: #FFFFFF;
-	}
-	.container {
+page {
+	padding: 0;
+	margin: 0;
+	height: 100%;
+	background-color: #ffffff;
+}
+.container {
+	width: 750rpx;
+	height: 400rpx;
+	position: relative;
+
+	.jiedianbackground {
+		position: absolute;
 		width: 750rpx;
 		height: 400rpx;
-		position: relative;
-
-		.jiedianbackground {
-			position: absolute;
-			width: 750rpx;
-			height: 400rpx;
 
-			image {
-				width: 100%;
-				height: 100%;
-			}
+		image {
+			width: 100%;
+			height: 100%;
 		}
+	}
 
-		.number-box {
-			width: 750rpx;
-			height: 400rpx;
-			position: absolute;
-			display: flex;
-			justify-content: center;
-			flex-direction: column;
-			align-items: center;
-
-			.number {
-				font-size: 30rpx;
+	.number-box {
+		width: 750rpx;
+		height: 400rpx;
+		position: absolute;
+		display: flex;
+		justify-content: center;
+		flex-direction: column;
+		align-items: center;
+
+		.number {
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #3f7c1f;
+
+			text {
+				font-size: 72rpx;
 				font-family: PingFang SC;
-				font-weight: 500;
-				color: #3F7C1F;
-
-				text {
-					font-size: 72rpx;
-					font-family: PingFang SC;
-					font-weight: bold;
-					color: #3F7C1F;
-					line-height: 86rpx;
-				}
+				font-weight: bold;
+				color: #3f7c1f;
+				line-height: 86rpx;
 			}
+		}
 
-			.renshu {
-				font-size: 30rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #3F7C1F;
-			}
+		.renshu {
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #3f7c1f;
 		}
 	}
+}
+
+.message {
+	padding: 0 30rpx;
 
-	.message {
-		padding: 0 30rpx;
+	.relation-box {
+		margin-top: 100rpx;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
 
-		.relation-box {
-			margin-top: 100rpx;
+		.relation {
+			position: relative;
 			display: flex;
-			flex-direction: column;
 			align-items: center;
-
-			.relation {
-				position: relative;
-				display: flex;
-				align-items: center;
-				
-
-				.headbox {
-
-					position: absolute;
+			.headbox {
+				position: absolute;
+				width: 154rpx;
+				height: 154rpx;
+				.head {
 					width: 154rpx;
 					height: 154rpx;
+					background: #ef9e20;
+					box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
+					border-radius: 50%;
+					overflow: hidden;
 
-					.head {
+					.photo {
 						width: 154rpx;
 						height: 154rpx;
-						background: #EF9E20;
-						box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
-						border-radius: 50%;
-						overflow: hidden;
-
-						.photo {
-							width: 154rpx;
-							height: 154rpx;
-
-							image {
-								width: 100%;
-								height: 100%;
-							}
-						}
-					}
-
-					.head-title {
-						margin: -30rpx 30rpx 0 30rpx;
-						width: 94rpx;
-						height: 32rpx;
 
 						image {
 							width: 100%;
@@ -248,132 +265,145 @@
 					}
 				}
 
-				.information {
-					margin-left: 77rpx;
-					display: flex;
-					padding: 20rpx 10rpx;
-					flex-direction: column;
-					width: 297rpx;
-					height: 137rpx;
-					background: #FFFFFF;
-					border: 4rpx solid #6EAB4E;
-					border-radius: 10rpx;
-					.name {
-						text-align: left;
-						margin-left: 70rpx;
-						font-size: 32rpx;
-						font-family: PingFang SC;
-						font-weight: bold;
-						color: #3F7C1F;
-					}
+				.head-title {
+					margin: -30rpx 30rpx 0 30rpx;
+					width: 94rpx;
+					height: 32rpx;
 
-					.cell {
-						text-align: left;
-						margin-left: 70rpx;
-						font-size: 26rpx;
-						font-family: PingFang SC;
-						font-weight: 500;
-						color: #ABD56F;
+					image {
+						width: 100%;
+						height: 100%;
 					}
 				}
+			}
 
+			.information {
+				margin-left: 77rpx;
+				display: flex;
+				padding: 20rpx 10rpx;
+				flex-direction: column;
+				width: 297rpx;
+				height: 137rpx;
+				background: #ffffff;
+				border: 4rpx solid #6eab4e;
+				border-radius: 10rpx;
+				.name {
+					text-align: left;
+					margin-left: 70rpx;
+					font-size: 32rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #3f7c1f;
+				}
 
+				.cell {
+					text-align: left;
+					margin-left: 70rpx;
+					font-size: 26rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #abd56f;
+				}
 			}
+		}
 
-			.sanchaji {
-				margin: 30rpx 0;
-				width: 530rpx;
-				height: 91rpx;
+		.sanchaji {
+			margin: 30rpx 0;
+			width: 530rpx;
+			height: 91rpx;
 
-				image {
-					width: 100%;
-					height: 100%;
-				}
+			image {
+				width: 100%;
+				height: 100%;
 			}
+		}
 
-			.subordinate {
-				width: 750rpx;
-				display: flex;
-				justify-content: space-around;
-					.headbox {
-						
-						width: 154rpx;
-						height: 154rpx;
+		.subordinate {
+			width: 750rpx;
+			display: flex;
+			justify-content: space-around;
+			.zhuce {
+				padding: 10rpx;
+				background: #abd56f;
+				color: #fff;
+			}
+			.headbox {
+				width: 154rpx;
+				height: 154rpx;
 
-						.head {
-							width: 154rpx;
-							height: 154rpx;
-							background: #EF9E20;
-							box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
-							border-radius: 50%;
-							overflow: hidden;
+				.head {
+					width: 154rpx;
+					height: 154rpx;
+					background: #ef9e20;
+					box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
+					border-radius: 50%;
+					overflow: hidden;
 
-							.photo {
-								width: 154rpx;
-								height: 154rpx;
+					.photo {
+						width: 154rpx;
+						height: 154rpx;
 
-								image {
-									width: 100%;
-									height: 100%;
-								}
-							}
+						image {
+							width: 100%;
+							height: 100%;
 						}
+					}
+				}
 
-						.head-title {
-							margin: -30rpx 30rpx 0 30rpx;
-							width: 94rpx;
-							height: 32rpx;
+				.head-title {
+					margin: -30rpx 30rpx 0 30rpx;
+					width: 94rpx;
+					height: 32rpx;
 
-							image {
-								width: 100%;
-								height: 100%;
-							}
-						}
-					
+					image {
+						width: 100%;
+						height: 100%;
+					}
 				}
 			}
 		}
+	}
 
-		.yeji {
-			position: relative;
-			margin-top: -72rpx;
-			width: 690rpx;
-			height: 143rpx;
-			background: #FFFFFF;
-			box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
-			border-radius: 10rpx;
+	.yeji {
+		position: relative;
+		margin-top: -72rpx;
+		width: 690rpx;
+		height: 143rpx;
+		background: #ffffff;
+		box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
+		border-radius: 10rpx;
+		display: flex;
+		justify-content: space-around;
+		align-items: center;
+
+		.yeji-a {
 			display: flex;
+			flex-direction: column;
 			justify-content: space-around;
 			align-items: center;
 
-			.yeji-a {
-				display: flex;
-				flex-direction: column;
-				justify-content: space-around;
-				align-items: center;
-
-				.yeji-top {
-					font-size: 24rpx;
-					font-family: PingFang SC;
-					font-weight: bold;
-					color: #333333;
-					line-height: 35px;
-				}
-
-				.yeji-buttom {
-					font-size: 34rpx;
-					font-family: PingFang SC;
-					font-weight: bold;
-					color: #333333;
-					line-height: 35px;
-				}
+			.yeji-top {
+				font-size: 24rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #333333;
+				line-height: 35px;
 			}
 
-			.border {
-				width: 1rpx;
-				height: 51rpx;
-				background: #DDDDDD;
+			.yeji-buttom {
+				font-size: 34rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #333333;
+				line-height: 35px;
 			}
 		}
+
+		.border {
+			width: 1rpx;
+			height: 51rpx;
+			background: #dddddd;
+		}
 	}
+}
 </style>