李书文 1 rok temu
rodzic
commit
4669923c80
4 zmienionych plików z 115 dodań i 74 usunięć
  1. 12 8
      main.js
  2. 58 43
      pages/authentication/index.vue
  3. 29 17
      pages/authentication/info.vue
  4. 16 6
      pages/personal/personal.vue

+ 12 - 8
main.js

@@ -16,8 +16,10 @@ Vue.prototype.getUser = function() {
 	return uni.getStorageSync('info');
 }
 
-Vue.prototype.hasLogin = () => {
-	if (uni.getStorageSync('info') === '' || uni.getStorageSync('info') === null) {
+Vue.prototype.hasAuth = () => {
+	let user = uni.getStorageSync('info');
+	console.log("asd:"+user.auth);
+	if (user.auth == '0') {
 		return false
 	} else {
 		return true
@@ -25,17 +27,19 @@ Vue.prototype.hasLogin = () => {
 }
 
 const app = new Vue({
-    ...App
+	...App
 })
 app.$mount()
 // #endif
 
 // #ifdef VUE3
-import { createSSRApp } from 'vue'
+import {
+	createSSRApp
+} from 'vue'
 export function createApp() {
-  const app = createSSRApp(App)
-  return {
-    app
-  }
+	const app = createSSRApp(App)
+	return {
+		app
+	}
 }
 // #endif

+ 58 - 43
pages/authentication/index.vue

@@ -1,14 +1,29 @@
 <template>
 	<view class="cmain">
-		<view class="item">
-			<card v-model="item.pic" pic="../../static/images/sfz1.png"></card>
+		<view v-if="item.id">
+			<view v-if="item.judgeStatus == 0">
+				<view class="icon">&#xe64d;</view>
+				<view class="title">您的资料已经提交审核</view>
+				<view class="desc">请耐心等待。</view>
+				<button class="btn" @click="go()">重新编辑</button>
+			</view>
+			<view v-if="item.judgeStatus == 1">
+				<view class="icon">&#xe631;</view>
+				<view class="title">审核通过</view>
+				<button class="btn" @click="go()">我的认证信息</button>
+			</view>
+			<view v-if="item.judgeStatus == 2">
+				<view class="icon" style="color: #f44336">&#xe61a;</view>
+				<view class="title">审核不通过</view>
+				<view class="message _error">{{ item.judgeContent }}</view>
+				<button class="btn" @click="go()">重新认证</button>
+			</view>
 		</view>
-		<view class="title">上传您的身份证头像面</view>
-		<view class="item">
-			<card v-model="item.pic" pic="../../static/images/sfz2.png"></card>
+		<view v-else>
+			<view class="icon">&#xe64e;</view>
+			<view class="title">你还未实名认证</view>
+			<button class="btn" @click="go()">去认证</button>
 		</view>
-		<view class="title">上传您的身份证国徽面</view>
-		<button class="btn">人脸认证</button>
 	</view>
 </template>
 
@@ -19,54 +34,54 @@ export default {
 			item: {}
 		};
 	},
-	onLoad(e) {},
+	onLoad() {
+		this.getData();
+		uni.$on('authentication', res => {
+			this.getData();
+		});
+	},
 	methods: {
-		save() {
-			let rule = [
-				{ name: 'typeCode', checkType: 'notnull', errorMsg: '请输入编码' },
-				{ name: 'typeName', checkType: 'notnull', errorMsg: '请输入名称' },
-				{ name: 'status', checkType: 'notnull', errorMsg: '请选择状态' }
-			];
-			if (!this.verify.check(this.item, rule)) {
-				uni.showModal({ content: this.verify.error, showCancel: false });
-				return false;
-			}
+		getData() {
 			this.http.request({
-				url: '/project/projectType',
-				method: this.item.id ? 'PUT' : 'POST',
-				data: this.item,
+				url: '/level-one-server/app/TbEnterprise/getInfo',
 				success: res => {
-					uni.showToast({ title: '操作成功' });
-					setTimeout(() => {
-						uni.$emit('ctype');
-						uni.navigateBack();
-					}, 1000);
+					if (res.data.data) {
+						this.item = res.data.data;
+					}
 				}
 			});
+		},
+		go() {
+			uni.navigateTo({
+				url: '/pages/authentication/info'
+			});
 		}
 	}
 };
 </script>
 
 <style lang="scss">
-.item {
-	text-align: center;
-	padding: 20px;
-	background-color: #f7f8fa;
-	border-radius: 15px;
-	image {
-		width: 100%;
-		border-radius: 5px;
-	}
-}
-.title {
-	padding: 20px;
+.cmain {
 	text-align: center;
-	font-weight: bold;
+	padding: 40px;
 	color: $font-c;
-	font-size: 17px;
-}
-.btn{
-	margin-top: 20px;
+	.icon {
+		font-size: 150px;
+		color: $main-color;
+	}
+	.title {
+		margin-top: 10px;
+		margin-bottom: 7px;
+	}
+	.message {
+		margin-top: 15px;
+		text-align: left;
+	}
+	.desc {
+		margin-top: -5px;
+	}
+	.btn {
+		margin-top: 30px;
+	}
 }
 </style>

+ 29 - 17
pages/authentication/info.vue

@@ -1,38 +1,38 @@
 <template>
 	<view class="cmain">
 		<view class="form_group">
-			<view class="lable re">名称</view>
-			<input type="text" placeholder="请输入" v-model="item.typeCode" />
+			<view class="lable re">企业名称</view>
+			<input type="text" placeholder="请输入" v-model="item.name" />
 		</view>
 		<view class="form_group">
 			<view class="lable re">税号</view>
-			<input type="text" placeholder="请输入" v-model="item.typeCode" />
+			<input type="text" placeholder="请输入" v-model="item.dutyParagraph" />
 		</view>
 		<view class="form_group">
 			<view class="lable re">法人姓名</view>
-			<input type="text" placeholder="请输入" v-model="item.typeCode" />
+			<input type="text" placeholder="请输入" v-model="item.legalPerson" />
 		</view>
 		<view class="form_group">
 			<view class="lable re">法人身份证</view>
-			<input type="text" placeholder="请输入" v-model="item.typeCode" />
+			<input type="text" placeholder="请输入" v-model="item.idCard" />
 		</view>
 		<view class="form_group">
 			<view class="lable re">联系号码</view>
-			<input type="text" placeholder="请输入" v-model="item.typeCode" />
+			<input type="text" placeholder="请输入" v-model="item.contact" />
 		</view>
 		<view class="form_group">
 			<view class="lable re">开户行</view>
-			<input type="text" placeholder="请输入" v-model="item.typeCode" />
+			<input type="text" placeholder="请输入" v-model="item.bankName" />
 		</view>
 		<view class="form_group">
 			<view class="lable re">银行账号</view>
-			<input type="text" placeholder="请输入" v-model="item.typeCode" />
+			<input type="text" placeholder="请输入" v-model="item.bankAccount" />
 		</view>
 		<view class="form_group">
 			<view class="lable re">营业执照</view>
 			<card v-model="item.pic" pic="../../static/images/yyzz.png"></card>
 		</view>
-		<button class="btn" @click="save()">提交审核</button>
+		<button class="btn" @click="save()" v-if="item.judgeStatus != 1">提交审核</button>
 	</view>
 </template>
 
@@ -43,26 +43,38 @@ export default {
 			item: {}
 		};
 	},
-	onLoad(e) {},
+	onLoad(e) {
+		this.http.request({
+			url: '/level-one-server/app/TbEnterprise/getInfo',
+			success: res => {
+				if (res.data.data) {
+					this.item = res.data.data;
+					uni.setNavigationBarTitle({ title: '我的认证资料' });
+				} else {
+					uni.setNavigationBarTitle({ title: '填写认证资料' });
+				}
+			}
+		});
+	},
 	methods: {
 		save() {
 			let rule = [
-				{ name: 'typeCode', checkType: 'notnull', errorMsg: '请输入编码' },
-				{ name: 'typeName', checkType: 'notnull', errorMsg: '请输入名称' },
-				{ name: 'status', checkType: 'notnull', errorMsg: '请选择状态' }
+				{ name: 'name', checkType: 'notnull', errorMsg: '请输入企业名称' },
+				{ name: 'dutyParagraph', checkType: 'notnull', errorMsg: '请输入税号' },
+				{ name: 'legalPerson', checkType: 'notnull', errorMsg: '请法人姓名' }
 			];
 			if (!this.verify.check(this.item, rule)) {
 				uni.showModal({ content: this.verify.error, showCancel: false });
 				return false;
 			}
 			this.http.request({
-				url: '/project/projectType',
-				method:'POST',
+				url: '/level-one-server/app/TbEnterprise/identification',
+				method: 'POST',
 				data: this.item,
 				success: res => {
-					uni.showToast({ title: '操作成功' });
+					uni.showToast({ title: '提交成功' });
 					setTimeout(() => {
-						uni.$emit('ctype');
+						uni.$emit('authentication');
 						uni.navigateBack();
 					}, 1000);
 				}

+ 16 - 6
pages/personal/personal.vue

@@ -6,6 +6,12 @@
 			<image src="../../static/images/top-bg.png" class="bg"></image>
 		</view>
 		<view class="list animated fadeInDown">
+			<!--只有外籍商户和收购商才需要手动认证-->
+			<view class="message _error" @click="go('/pages/authentication/index')" v-if="(user.userType == 3 || user.userType == 5) && user.auth == 0">
+				<text class="icon">&#xe64e;</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>
@@ -107,7 +113,7 @@
 					<view class="out">
 						<view class="int">
 							<view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
-							<view class="tit">认证</view>
+							<view class="tit">我的认证</view>
 						</view>
 					</view>
 				</view>
@@ -147,14 +153,14 @@ export default {
 		};
 	},
 	onShow() {
-		if (this.hasLogin()) {
-			this.user = this.getUser();
-		} else {
-			uni.redirectTo({ url: '/pages/login/login' });
-		}
+		this.user = this.getUser();
 	},
 	methods: {
 		order() {
+			if (!this.hasAuth()) {
+				uni.navigateTo({ url: '/pages/authentication/index' });
+				return;
+			}
 			//组长
 			if (this.user.userType == 2) {
 				uni.navigateTo({ url: 'user' });
@@ -169,6 +175,10 @@ export default {
 			}
 		},
 		go(url) {
+			if (!this.hasAuth()) {
+				uni.navigateTo({ url: '/pages/authentication/index' });
+				return;
+			}
 			uni.navigateTo({ url: url });
 		},
 		exitLogin() {