Bladeren bron

吉农宝

hanfucheng 1 jaar geleden
bovenliggende
commit
43d8ba9b62

+ 10 - 0
api/asking/asking.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+// 获取类型列表
+export function getTypeList(query) {
+  return request({
+    url: '/JnbQuestionType/type/typeList',
+    method: 'get',
+    params: query
+  })
+}

+ 10 - 0
api/me/nameAuthentication.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+// 提交实名认证
+export function appletAdd(query) {
+  return request({
+    url: '/nameAuthentication/appletAdd',
+    method: 'post',
+    data: query
+  })
+}

+ 10 - 0
api/me/officialAuthentication.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+// 提交官方认证
+export function appletAdd(query) {
+  return request({
+    url: '/officialAuthentication/appletAdd',
+    method: 'post',
+    data: query
+  })
+}

+ 30 - 0
pages.json

@@ -210,6 +210,36 @@
 			}
 		},
 		{
+			"path": "pages/asking/asking",
+			"style": {
+				"usingComponents": {},
+				"navigationBarBackgroundColor": "#07c160",
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "问吧"
+
+			}
+		},
+		{
+			"path": "pages/me/nameAuthentication",
+			"style": {
+				"usingComponents": {},
+				"navigationBarBackgroundColor": "#07c160",
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "实名认证"
+
+			}
+		},
+		{
+			"path": "pages/me/officialAuthentication",
+			"style": {
+				"usingComponents": {},
+				"navigationBarBackgroundColor": "#07c160",
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "官方认证"
+
+			}
+		},
+		{
 			"path" : "pages/liveBroadcast/liveBroadcast",
 			"style" :
 			{

+ 103 - 0
pages/asking/asking.css

@@ -0,0 +1,103 @@
+/* pages/wenda/wenda.wxss */
+.wendaFL {
+    width: 100%;
+    display: flex;
+    justify-content: space-between;
+    margin: 30rpx 0 0 0;
+}
+.wendaFL li {
+    width: 48%;
+    height: 168rpx;
+    position: relative;
+}
+.lbBj {
+    position: absolute;
+    left: 0;
+    top: 0;
+    z-index: 0;
+    width: 100%;
+    height: 100%;
+}
+.wendaFL li h2 {
+    font-size: 36rpx;
+    position: absolute;
+    left: 30rpx;
+    top: 40rpx;
+    z-index: 1;
+    font-weight: bold;
+}
+.wendaFL li span {
+    font-size: 30rpx;
+    position: absolute;
+    left: 30rpx;
+    top: 88rpx;
+    z-index: 1;
+}
+.wendaFL li.sanNong {
+    color: #0d9970;
+}
+.wendaFL li.jiuYe {
+    color: #1e8fb4;
+}
+.wendaFL li.faLv {
+    color: #1e5dab;
+}
+.wendaFL li.jiuZhen {
+    color: #4a700d;
+}
+/* 列表 */
+.rnwdList {
+    width: 100%;
+    display: flex;
+    justify-content: space-between;
+    margin: 20rpx 0;
+}
+.list {
+    width: 79%;
+}
+.lb {
+    background: #0d9970;
+    color: #fff;
+    font-size: 24rpx;
+    width: 12%;
+    text-align: center;
+    padding: 2rpx 0;
+    line-height: 40rpx;
+    height: 40rpx;
+    border-radius: 10rpx;
+}
+.listTitle {
+    font-size: 32rpx;
+    color: #333;
+    line-height: 40rpx;
+}
+.jlSj {
+    height: 40rpx;
+    display: flex;
+    justify-content: space-between;
+    font-size: 24rpx;
+    margin: 20rpx 0 0 0;
+}
+.jf {
+    color: #07c160;
+}
+.icon-jifen {
+    font-size: 28rpx;
+    color: #07c160;
+    margin: 0 0 0 6rpx;
+}
+.ck {
+    color: #c4c4c4;
+}
+.icon-pinglun,
+.icon-chakan,
+.icon-shoucang {
+    font-size: 28rpx;
+    margin: 0 6rpx 0 20rpx;
+    color: #c4c4c4;
+}
+.icon-xiangyoujiantou {
+    font-size: 30rpx;
+    color: #c4c4c4;
+    line-height: 60rpx;
+}

+ 78 - 0
pages/asking/asking.vue

@@ -0,0 +1,78 @@
+<template>
+    <!-- pages/fuwu/fuwu.wxml -->
+    <view class="container">
+        <!-- 问答类别 -->
+
+        <view class="wendaFL" @tap="" v-for="(obj, index) in typeList" :key="index">
+            <ul class="wendaFL">
+                <li class="sanNong">
+                    <image :src="'http://127.0.0.1:8080'+obj.path" class="lbBj"></image>
+                    <h2>{{obj.type}}</h2>
+                    <span>1566</span>
+                </li>
+            </ul>
+        </view>
+    </view>
+</template>
+
+<script>
+import upload from '../../components/upload/index.vue'
+import {getTypeList} from '@/api/asking/asking.js'
+export default {
+	components: {
+		upload
+	},
+    data() {
+        return {
+			imageList:[
+				'/profile/upload/2024/03/02/D5hjxYkldNxIef093ae65b2128b1293b86a7b537ed98_20240302170757A001.png',
+				'/profile/upload/2024/03/02/D5hjxYkldNxIef093ae65b2128b1293b86a7b537ed98_20240302170757A001.png'
+			],
+            typeList: [
+                {
+                    type: null,
+					path: null
+                }
+            ],
+			// 查询参数
+		  queryParams: {
+			pageNum: 1,
+			pageSize: 6,
+		  },
+        };
+    }
+    /**
+     * 生命周期函数--监听页面加载
+     */,
+    onLoad(options) {
+        this.getTypeList();
+    },
+    methods: {
+         //获取类型列表
+        getTypeList(){
+            getTypeList(this.queryParams).then(res =>{
+                this.typeList = res.rows
+            })
+        },
+
+        goSanNong() {
+            uni.navigateTo({
+                url: '/pages/sannong/sannong'
+            });
+        },
+
+        goDetails() {
+            uni.navigateTo({
+                url: '/pages/wenbaxiangqing/wenbaxiangqing'
+            });
+        },
+
+		updateImg(imgList){
+			this.imageList = imgList;
+		}
+    }
+};
+</script>
+<style>
+@import './asking.css';
+</style>

+ 1 - 1
pages/index/index.vue

@@ -351,7 +351,7 @@ export default {
 		},
         goWenBa() {
             uni.navigateTo({
-                url: '/pages/wenba/wenba'
+                url: '/pages/asking/asking'
             });
         },
       goHangQing() {

+ 10 - 0
pages/me/me.vue

@@ -38,6 +38,16 @@ export default {
 					id: 'wenba/wenba',
 					name: '我的问答',
 					open: false,
+				},
+				{
+					id: 'me/nameAuthentication',
+					name: '实名认证',
+					open: false,
+				},
+				{
+					id: 'me/officialAuthentication',
+					name: '官方认证',
+					open: false,
 				}
 			]
 		};

+ 0 - 0
pages/me/nameAuthentication.css


+ 82 - 0
pages/me/nameAuthentication.vue

@@ -0,0 +1,82 @@
+<template>
+	<uni-section title="自定义校验规则" type="line">
+			<view class="example">
+				<!-- 自定义表单校验 -->
+				<uni-forms ref="customForm" :rules="customRules" :modelValue="form">
+					<uni-forms-item label="姓名" required name="name">
+						<uni-easyinput v-model="form.name" placeholder="请输入姓名" />
+					</uni-forms-item>
+					<uni-forms-item label="电话" required name="phone">
+						<uni-easyinput v-model="form.phone" placeholder="请输入电话" />
+					</uni-forms-item>
+					<uni-forms-item label="身份证号" required name="idCard">
+						<uni-easyinput v-model="form.idCard" placeholder="请输入身份证号" />
+					</uni-forms-item>
+					<uni-forms-item label="身份证正反面" required name="path">
+						<upload :imgArr="imageList" name="path" v-model="form.path" :fileSize="1" :limit="2" @updateImg="updateImg"></upload>
+					</uni-forms-item>
+				</uni-forms>
+				<button type="primary" @click="submitForm('customForm')">提交</button>
+			</view>
+		</uni-section>
+</template>
+
+<script>
+import upload from '../../components/upload/index.vue'
+import {appletAdd} from '@/api/me/nameAuthentication.js'
+export default {
+	components: {
+		upload
+	},
+	onReady() {
+		// 设置自定义表单校验规则,必须在节点渲染完毕后执行
+		this.$refs.customForm.setRules(this.customRules)
+	},
+	data() {
+		return{
+			form:{
+				
+			},
+			// 表单校验
+			customRules: {
+				name: {
+					rules: [{
+						required: true,
+						errorMessage: '姓名不能为空'
+					}]
+				},
+			},
+			imageList:[]
+		}
+	},
+	methods: {
+	    // 取消按钮
+	    cancel() {
+	      this.open = false;
+	      this.reset();
+	    },
+	    /** 提交按钮 */
+	    submitForm(e) {
+			console.log("11111")
+			this.$refs[e].validate().then(res => {
+				console.log('success', res);
+				uni.showToast({
+				  title: `校验通过`
+				})
+			  }).catch(err => {
+				console.log('err', err);
+			})
+			let path = this.imageList.join(',');
+			console.log(path)
+			this.form.path = path
+			appletAdd(this.form).then(res =>{})
+	    },
+		updateImg(imgList){
+			this.imageList = imgList;
+		}
+	}
+};
+</script>
+
+<style>
+</style>

+ 0 - 0
pages/me/officialAuthentication.css


+ 81 - 0
pages/me/officialAuthentication.vue

@@ -0,0 +1,81 @@
+<template>
+	<uni-section title="自定义校验规则" type="line">
+			<view class="example">
+				<!-- 自定义表单校验 -->
+				<uni-forms ref="customForm" :rules="customRules" :modelValue="form">
+					<uni-forms-item label="企业名称" required name="enterpriseName">
+						<uni-easyinput v-model="form.enterpriseName" placeholder="请输入企业名称" />
+					</uni-forms-item>
+					<uni-forms-item label="法人姓名" required name="legalName">
+						<uni-easyinput v-model="form.legalName" placeholder="请输入法人姓名" />
+					</uni-forms-item>
+					<uni-forms-item label="联系电话" required name="phone">
+						<uni-easyinput v-model="form.phone" placeholder="请输入联系电话" />
+					</uni-forms-item>
+					<uni-forms-item label="证照信息" required name="path">
+						<upload :imgArr="imageList" name="path" v-model="form.path" :fileSize="1" :limit="3" @updateImg="updateImg"></upload>
+					</uni-forms-item>
+				</uni-forms>
+				<button type="primary" @click="submitForm('customForm')">提交</button>
+			</view>
+		</uni-section>
+</template>
+
+<script>
+import upload from '../../components/upload/index.vue'
+import {appletAdd} from '@/api/me/officialAuthentication.js'
+export default {
+	components: {
+		upload
+	},
+	onReady() {
+		// 设置自定义表单校验规则,必须在节点渲染完毕后执行
+		this.$refs.customForm.setRules(this.customRules)
+	},
+	data() {
+		return{
+			form:{
+				
+			},
+			// 表单校验
+			customRules: {
+				name: {
+					rules: [{
+						required: true,
+						errorMessage: '姓名不能为空'
+					}]
+				},
+			},
+			imageList:[]
+		}
+	},
+	methods: {
+	    // 取消按钮
+	    cancel() {
+	      this.open = false;
+	      this.reset();
+	    },
+	    /** 提交按钮 */
+	    submitForm(e) {
+			console.log("11111")
+			this.$refs[e].validate().then(res => {
+				console.log('success', res);
+				uni.showToast({
+				  title: `校验通过`
+				})
+			  }).catch(err => {
+				console.log('err', err);
+			})
+			let path = this.imageList.join(',');
+			this.form.path = path
+			appletAdd(this.form).then(res =>{})
+	    },
+		updateImg(imgList){
+			this.imageList = imgList;
+		}
+	}
+};
+</script>
+
+<style>
+</style>