瀏覽代碼

边民加入互助组

qzy 6 月之前
父節點
當前提交
c3290c1ec3
共有 3 個文件被更改,包括 228 次插入142 次删除
  1. 10 1
      pages.json
  2. 35 13
      pages/personal/bankInfo.vue
  3. 183 128
      pages/personal/personal.vue

+ 10 - 1
pages.json

@@ -105,7 +105,8 @@
 				"enablePullDownRefresh": true
 			}
 
-		}, {
+		}, 
+		{
 			"path": "pages/news/detail",
 			"style": {
 				"navigationBarTitleText": "资讯详情",
@@ -114,6 +115,14 @@
 
 		},
 		{
+			"path": "pages/personal/group",
+			"style": {
+				"navigationBarTitleText": "申请入组",
+				"enablePullDownRefresh": false
+			}
+		
+		},
+		{
 			"path": "pages/market/two/purchaser/buy/list",
 			"style": {
 				"navigationBarTitleText": "采购需求管理",

+ 35 - 13
pages/personal/bankInfo.vue

@@ -2,7 +2,7 @@
 	<view class="cmain">
 		<view class="form_group">
 			<view class="lable re">开户行</view>
-			<input type="text" placeholder="请输入开户行" v-model="item.bankName" />
+			<input type="text" placeholder="请输入开户行" v-model="item.bankName" readonly disabled />
 		</view>
 		<view class="form_group">
 			<view class="lable re">银行账号</view>
@@ -10,6 +10,7 @@
 		</view>
 		</br></br></br>
 		<button class="btn" @click="save()">提交</button>
+		<button class="btn back" @click="back()">返回</button>
 	</view>
 </template>
 
@@ -17,34 +18,52 @@
 	export default {
 		data() {
 			return {
-				item: {bankName:'',bankAccount:''},
+				item: {
+					bankName: '',
+					bankAccount: ''
+				},
 			}
 		},
 		onLoad() {
 			this.http.request({
 				url: '/sp-admin/app/AppUser/getBankInfo',
 				success: res => {
-					console.log("res",res)
-					this.item.bankName = res.data.data.bankName;
+					console.log("res", res)
+					this.item.bankName = '云南麻栗坡农村商业银行股份有限公司';
 					this.item.bankAccount = res.data.data.bankAccount;
 				}
 			})
 		},
 		methods: {
+			back() {
+				uni.navigateBack()
+			},
 			save() {
-				let rule = [
-					{ name: 'bankAccount', checkType: 'bank', errorMsg: '银行账号格式不正确' }
-				];
+				let rule = [{
+					name: 'bankAccount',
+					checkType: 'bank',
+					errorMsg: '银行账号格式不正确'
+				}];
 				if (!this.verify.check(this.item, rule)) {
-					uni.showModal({ content: this.verify.error, showCancel: false });
+					uni.showModal({
+						content: this.verify.error,
+						showCancel: false
+					});
 					return false;
 				}
 				this.http.request({
 					url: '/sp-admin/app/AppUser/saveBankInfo',
-					data: { bankName:this.item.bankName, bankAccount:this.item.bankAccount },
+					data: {
+						bankName: this.item.bankName,
+						bankAccount: this.item.bankAccount
+					},
 					success: res => {
-						uni.showToast({title:"提交成功"})
-						uni.switchTab({ url: '/pages/personal/personal' });
+						uni.showToast({
+							title: "提交成功"
+						})
+						uni.switchTab({
+							url: '/pages/personal/personal'
+						});
 					}
 				})
 			}
@@ -53,5 +72,8 @@
 </script>
 
 <style>
-
-</style>
+	.back {
+		background: cadetblue;
+		margin-top: 15px;
+	}
+</style>

+ 183 - 128
pages/personal/personal.vue

@@ -7,35 +7,42 @@
 		</view>
 		<view class="list animated fadeInDown">
 			<!--只有外籍商户和收购商才需要手动认证-->
-			<view class="message _error" @click="go('/pages/authentication/index')" v-if="user.userType == 5 && user.auth == 0">
+			<view class="message _error" @click="go('/pages/authentication/index')"
+				v-if="user.userType == 5 && user.auth == 0">
 				<text class="icon">&#xe64e;</text>
 				<text>你还未认证,请先认证</text>
 				<text class="icon" style="float: right">&#xe8f2;</text>
 			</view>
-			<view class="message _error" @click="go('/pages/authentication/purchaser/index')" v-if="user.userType == 3 && user.auth == 0">
+			<view class="message _error" @click="go('/pages/authentication/purchaser/index')"
+				v-if="user.userType == 3 && user.auth == 0">
 				<text class="icon">&#xe64e;</text>
 				<text>你还未认证,请先认证</text>
 				<text class="icon" style="float: right">&#xe8f2;</text>
 			</view>
-			<view class="message _info" @click="go('/pages/face/faceRegister')" v-if="(user.userType == 1 || user.userType == 2) && user.face == 0">
+			<view class="message _info" @click="go('/pages/face/faceRegister')"
+				v-if="(user.userType == 1 || user.userType == 2) && user.face == 0">
 				<text class="icon">&#xe78d;</text>
 				<text>你还未人脸认证,请先人脸认证</text>
 				<text class="icon" style="float: right">&#xe8f2;</text>
-				
+
 			</view>
 			<!--用户信息-->
 			<view class="user">
 				<image src="../../static/icon/user.png" mode="widthFix" class="head"></image>
 				<view class="con">
-					<view class="nickName omit">{{ user.phone }}</view>
-					<view class="tag" v-if="user.userType == 1">普通边民</view>
-					<view class="tag" v-if="user.userType == 2">互市组长</view>
+					<view class="nickName omit">{{user.name}}({{ user.phone }})</view>
+					<view class="tag" v-if="user.userType == 1">边民</view>
+					<view class="tag" v-if="user.userType == 2">组长</view>
 					<view class="tag" v-if="user.userType == 3">采购商</view>
 					<view class="tag" v-if="user.userType == 4">司机</view>
 					<view class="tag" v-if="user.userType == 5">商户</view>
 					<view class="tag" v-if="user.userType == 6">合作社</view>
+					<view class="tag" v-if="user.userType==1" style="margin-left: 10px;">
+						<text v-if="user.groupName">{{user.groupName}}</text>
+					</view>
+
 				</view>
-				<text class="icon edit" @click="go('/pages/personal/my')">&#xe645;</text>
+				<text class="icon edit" @click="go('/pages/personal/my')">&#xe8b7;</text>
 				<view class="clear"></view>
 			</view>
 			<!--边民菜单-->
@@ -188,6 +195,11 @@
 					<text class="title">修改密码</text>
 					<text class="icon arrow">&#xe8f2;</text>
 				</view>
+				<view class="s_item " @click="go('/pages/personal/group')" v-if="user.userType==1&&!user.groupName">
+					<text class="icon ic">&#xe686;</text>
+					<text class="title" style="color: firebrick;;font-weight: bold;">加入互助组</text>
+					<text class="icon arrow">&#xe8f2;</text>
+				</view>
 			</view>
 			<button class="btn exit" @click="exitLogin()">退出登录</button>
 		</view>
@@ -195,139 +207,182 @@
 </template>
 
 <script>
-export default {
-	data() {
-		return {
-			user: {}
-		};
-	},
-	onLoad() {
-		
-	},
-	onShow() {
-		this.user = this.getUser();
-		if (!this.hasAuth()) {
-			this.http.request({
-				url: '/sp-admin/app/AppUser/getAuth',
-				success: res => {
-					this.user.auth = res.data.data.auth;
-					this.user.face=res.data.data.face;
-					uni.setStorageSync('info', this.user);
-				}
-			});
-		}
-	},
-	methods: {
-		order() {
-			if (!this.hasAuth()) {
-				uni.navigateTo({ url: '/pages/authentication/index' });
-				return;
-			}
-			//组长
-			if (this.user.userType == 2) {
-				uni.navigateTo({ url: 'user' });
-			}
-			//外籍商户
-			if (this.user.userType == 5) {
-				uni.navigateTo({ url: '/pages/market/one/merchant/order/list' });
-			}
-			//收购商
-			if (this.user.userType == 3) {
-				uni.navigateTo({ url: '/pages/market/two/purchaser/order/list' });
-			}
-		},
-		go(url) {
-			if (!this.hasAuth() && this.user.userType == 5) {
-				uni.navigateTo({ url: '/pages/authentication/index' });
-				return;
-			}
-			if (!this.hasAuth() && this.user.userType == 3) {
-				uni.navigateTo({ url: '/pages/authentication/purchaser/index' });
-				return;
-			}
-			uni.navigateTo({ url: url });
-		},
-		exitLogin() {
-			let param = {
-				appUserId: this.getUser().id
+	export default {
+		data() {
+			return {
+				user: {}
 			};
-			uni.showModal({
-				title: '提示',
-				content: '确定注销登录?',
-				success: res => {
-					if (res.confirm) {
-						uni.removeStorageSync('token');
-						uni.removeStorageSync('info');
-						uni.removeStorageSync('menu');
-						uni.redirectTo({ url: '/pages/login/login' });
-						this.http.request({
-							url: '/sp-admin/app/AppUser/logout',
-							data: param,
-							success: res => {
+		},
+		onLoad() {
 
+		},
+		onShow() {
+			this.user = this.getUser();
+			if (!this.hasAuth()) {
+				this.http.request({
+					url: '/sp-admin/app/AppUser/getAuth',
+					success: res => {
+						this.user.auth = res.data.data.auth;
+						this.user.face = res.data.data.face;
+						if (this.user.userType == 1) {
+							this.user.groupName = res.data.data.groupName;
+							this.user.groupId = res.data.data.groupId;
+							if (!this.user.groupName) {
+								this.$refs.uNotify.show({
+									top: 10,
+									type: 'error',
+									color: '#ffffff',
+									bgColor: '#ff5500',
+									message: '未加入互助组,请先加入互助组',
+									duration: 1000 * 20,
+									fontSize: 20,
+									safeAreaInsetTop: true
+								})
+								return;
 							}
-						});
+						}
+						uni.setStorageSync('info', this.user);
 					}
+				});
+			}
+		},
+		methods: {
+			order() {
+				if (!this.hasAuth()) {
+					uni.navigateTo({
+						url: '/pages/authentication/index'
+					});
+					return;
+				}
+				//组长
+				if (this.user.userType == 2) {
+					uni.navigateTo({
+						url: 'user'
+					});
+				}
+				//外籍商户
+				if (this.user.userType == 5) {
+					uni.navigateTo({
+						url: '/pages/market/one/merchant/order/list'
+					});
+				}
+				//收购商
+				if (this.user.userType == 3) {
+					uni.navigateTo({
+						url: '/pages/market/two/purchaser/order/list'
+					});
+				}
+			},
+			go(url) {
+				if (!this.hasAuth() && this.user.userType == 5) {
+					uni.navigateTo({
+						url: '/pages/authentication/index'
+					});
+					return;
 				}
-			});
+				if (!this.hasAuth() && this.user.userType == 3) {
+					uni.navigateTo({
+						url: '/pages/authentication/purchaser/index'
+					});
+					return;
+				}
+				uni.navigateTo({
+					url: url
+				});
+			},
+			exitLogin() {
+				let param = {
+					appUserId: this.getUser().id
+				};
+				uni.showModal({
+					title: '提示',
+					content: '确定注销登录?',
+					success: res => {
+						if (res.confirm) {
+							uni.removeStorageSync('token');
+							uni.removeStorageSync('info');
+							uni.removeStorageSync('menu');
+							uni.redirectTo({
+								url: '/pages/login/login'
+							});
+							this.http.request({
+								url: '/sp-admin/app/AppUser/logout',
+								data: param,
+								success: res => {
+
+								}
+							});
+						}
+					}
+				});
+			}
 		}
-	}
-};
+	};
 </script>
 
 <style lang="scss">
-page {
-	background-color: #f5f5f5;
-}
-.my_top {
-	position: relative;
-	overflow: hidden;
-	image {
-		width: 100%;
+	page {
+		background-color: #f5f5f5;
 	}
-}
-.list {
-	position: relative;
-	padding: 0px 20px 10px 20px;
-	margin-top: -196px;
-	.user {
-		background-color: white;
-		padding: 20px;
-		border-radius: 8px;
-		color: $font-c;
-		.head {
-			float: left;
-			width: 55px;
-			height: 55px;
+
+	.my_top {
+		position: relative;
+		overflow: hidden;
+
+		image {
+			width: 100%;
 		}
-		.con {
-			float: left;
-			padding-left: 15px;
-			width: 60%;
-			.nickName {
-				font-size: 17px;
-				font-weight: bold;
+	}
+
+	.list {
+		position: relative;
+		padding: 0px 20px 10px 20px;
+		margin-top: -196px;
+
+		.user {
+			background-color: white;
+			padding: 20px;
+			border-radius: 8px;
+			color: $font-c;
+
+			.head {
+				float: left;
+				width: 55px;
+				height: 55px;
 			}
-			.tag {
-				background-color: #6799ad;
-				color: white;
+
+			.con {
 				float: left;
-				font-size: 13px;
-				padding: 2px 6px;
-				border-radius: 5px;
-				margin-top: 6px;
+				padding-left: 15px;
+				width: 60%;
+
+				.nickName {
+					font-size: 17px;
+					font-weight: bold;
+				}
+
+				.tag {
+					background-color: #6799ad;
+					color: white;
+					float: left;
+					font-size: 13px;
+					padding: 2px 6px;
+					border-radius: 5px;
+					margin-top: 6px;
+				}
+			}
+
+			.edit {
+				float: right;
+				font-size: 20px;
+				margin-top: 17px;
 			}
 		}
-		.edit {
-			float: right;
-			font-size: 20px;
-			margin-top: 17px;
-		}
 	}
-}
-.exit {
-	margin-top: 20px;
-	background-color: white;
-	color: #f44336;
-}
-</style>
+
+	.exit {
+		margin-top: 20px;
+		background-color: white;
+		color: #f44336;
+	}
+</style>