Browse Source

Merge remote-tracking branch 'origin/master'

刘浩男 1 year ago
parent
commit
b13fb798f8

+ 11 - 2
api/cooperative/cooperative.js

@@ -1,6 +1,15 @@
 import request from '@/utils/request'
 
-// 查询合作社列表
+// 新增供销合作社
+export function addCooperative(data) {
+  return request({
+    url: '/high/server/cooperative',
+    method: 'post',
+    data: data
+  })
+}
+
+// 查询供销合作社列表
 export function getList(query) {
   return request({
     url: '/high/server/cooperative/list',
@@ -9,7 +18,7 @@ export function getList(query) {
   })
 }
 
-// 查询合作社详情
+// 查询供销合作社详情
 export function getDetails(id) {
   return request({
     url: '/high/server/cooperative/' + id,

+ 8 - 1
api/handleAffairs/gridType.js

@@ -25,7 +25,14 @@ export function addGridType(data) {
     data: data
   })
 }
-
+// 查询主题事项列表
+export function listMatters(query) {
+  return request({
+    url: '/system/matter/list',
+    method: 'get',
+    params: query
+  })
+}
 // 修改网格类型配置
 export function updateGridType(data) {
   return request({

+ 26 - 16
api/handleAffairs/matter.js

@@ -9,14 +9,6 @@ export function listDept(query) {
   })
 }
 // 查询事项列表
-export function listMatters(query) {
-  return request({
-    url: '/system/matter/list',
-    method: 'get',
-    params: query
-  })
-}
-// 查询事项列表
 export function getMattersAll(query) {
   return request({
     url: '/system/matter/listAll',
@@ -40,6 +32,23 @@ export function addsc(data) {
   })
 }
 
+// 查询事项列表
+export function listMatters(query) {
+  return request({
+    url: '/system/matter/list',
+    method: 'get',
+    params: query
+  })
+}
+// 收藏事项
+export function scadd(data) {
+  return request({
+    url: '/system/collect/add',
+    method: 'post',
+    data: data
+  })
+}
+
 // 查询事项收藏详细
 export function collectlist(id) {
   return request({
@@ -48,18 +57,19 @@ export function collectlist(id) {
   })
 }
 
-// 查询事项详细
-export function getsc(id) {
+export function getsc(query) {
   return request({
-    url: '/system/collect/lists/' + id,
-    method: 'get'
-  })
+    url: '/system/collect/lists',
+    method: 'get',
+    params: query
+    
+  });
 }
 
-// 删除事项
+
+// 取消收藏事项
 export function delDept(id) {
   return request({
     url: '/system/collect/delete/' + id,
     method: 'delete'
-  })}
-
+  })}

+ 8 - 0
api/me/nameAuthentication.js

@@ -8,3 +8,11 @@ export function appletAdd(query) {
     data: query
   })
 }
+
+//按用户id查询实名认证信息
+export function getUserInfo(userId) {
+  return request({
+    url: '/nameAuthentication/getNameInfo/'+ userId,
+    method: 'get',
+  })
+}

+ 9 - 0
api/me/officialAuthentication.js

@@ -8,3 +8,12 @@ export function appletAdd(query) {
     data: query
   })
 }
+
+
+//按用户id查询实名认证信息
+export function getUserInfo(userId) {
+  return request({
+    url: '/officialAuthentication/getOfficialInfo/'+ userId,
+    method: 'get',
+  })
+}

+ 9 - 0
pages.json

@@ -7,6 +7,15 @@
 			}
 		},
 		{
+			"path": "pages/cooperative/addCooperative",
+			"style": {
+				"usingComponents": {},
+				"navigationBarBackgroundColor": "#07c160",
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "新增供销社信息"
+			}
+		},
+		{
 			"path": "pages/cooperative/cooperative",
 			"style": {
 				"usingComponents": {},

+ 156 - 0
pages/cooperative/addCooperative.vue

@@ -0,0 +1,156 @@
+<template>
+  <uni-section title="提交前请仔细核对信息,提交后不可修改!" type="line">
+    <view class="example">
+      <!-- 自定义表单校验 -->
+      <uni-forms ref="customForm" :rules="rules" :modelValue="customFormData" label-align="center">
+        <uni-forms-item label="名 称" required name="name" label-width="125" label-align="center" >
+          <uni-easyinput v-model="customFormData.name" placeholder="请输入供销社名称" />
+        </uni-forms-item>
+        <uni-forms-item label="地 址" required name="address" label-width="95" label-align="center" >
+          <uni-easyinput v-model="customFormData.address" placeholder="请输入供销社地址" />
+        </uni-forms-item>
+        <uni-forms-item label="电 话" required name="chargePhone" label-width="95" label-align="center" >
+          <uni-easyinput v-model="customFormData.chargePhone" placeholder="请输入负责人电话" />
+        </uni-forms-item>
+        <uni-forms-item label="负责人" required name="chargePeople" label-width="95" label-align="center" >
+          <uni-easyinput v-model="customFormData.chargePeople" placeholder="请输入负责人姓名" />
+        </uni-forms-item>
+        <uni-forms-item label="图 片" required name="url" label-width="95">
+          <upload :imgArr="imageList" :fileSize="1" :limit="3" @updateImg="updateImg"/>
+        </uni-forms-item>
+      </uni-forms>
+      <button type="primary" @click="submit('customForm')">提交</button>
+    </view>
+  </uni-section>
+</template>
+
+<script>
+import { addCooperative } from "@/api/cooperative/cooperative";
+import upload from '../../components/upload/index.vue'
+export default {
+  components: {
+    upload
+  },
+  data() {
+    return {
+      // 基础表单数据
+      baseFormData: {
+        name: '',
+        address:'',
+        chargePeople:'',
+        chargePhone:'',
+        imgUrl:'',
+      },
+      // 校验规则
+      rules: {
+        name: {
+          rules: [{
+            required: true,
+            errorMessage: '供销社名称不能为空'
+          }]
+        },
+        address: {
+          rules: [{
+            required: true,
+            errorMessage: '供销社地址不能为空'
+          }]
+        },
+        chargePeople: {
+          rules: [{
+            required: true,
+            errorMessage: '负责人姓名不能为空'
+          }]
+        },
+        chargePhone: {
+          rules: [
+            {
+              required: true,
+              errorMessage: '负责人电话不能为空'
+            },
+            {
+              pattern:'^1[3456789]\\d{9}$',
+              errorMessage: '负责人电话不合法'
+            }
+          ]
+        },
+        imgUrlList: {
+          rules: [{
+            required: true,
+            errorMessage: '图片不能为空'
+          }]
+        },
+      },
+      imageList: [],
+      customFormData:{}
+    }
+  },
+  onLoad() {},
+  onReady() {
+    // 设置自定义表单校验规则,必须在节点渲染完毕后执行
+    this.$refs.customForm.setRules(this.rules)
+  },
+  created() {
+
+  },
+  methods: {
+    //转换为下拉选列表
+    formatOptions(data) {
+      return data.map(item => ({
+        value: item.id,
+        text: item.productName,
+        children: item.children ? this.formatOptions(item.children) : null,
+      }));
+    },
+    submit(ref) {
+      this.$refs[ref].validate().then(res => {
+        if (res) {
+          this.customFormData.imgUrl = this.imageList.join(',')
+          addCooperative(this.customFormData).then(response => {
+            this.$modal.msgSuccess('提交成功');
+            this.customFormData = {...this.baseFormData};
+            uni.navigateTo({
+              url: '../cooperative/cooperative'
+            });
+          }).catch(err => {
+            console.log('err', err);
+          })
+        }
+      })
+    },
+    updateImg(imgList) {
+      this.imageList = imgList;
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+
+.example {
+  padding: 15px;
+  background-color: #fff;
+}
+
+.segmented-control {
+  margin-bottom: 15px;
+}
+
+.button-group {
+  margin-top: 15px;
+  display: flex;
+  justify-content: space-around;
+}
+
+.form-item {
+  display: flex;
+  align-items: center;
+}
+
+.button {
+  display: flex;
+  align-items: center;
+  height: 35px;
+  margin-left: 10px;
+}
+</style>
+

+ 55 - 1
pages/cooperative/cooperative.vue

@@ -18,6 +18,9 @@
             </view>
             <em class="iconfont icon-xiangyoujiantou"></em>
         </view>
+        <uni-load-more :status="status" :content-text="contentText"/>
+        <uni-fab ref="fab" horizontal="right" vertical="bottom"
+                 @fabClick="handleAdd()"/>
     </view>
 </template>
 
@@ -26,6 +29,21 @@ import { getList, getDetails } from '@/api/cooperative/cooperative';
 export default {
     data() {
         return {
+            // 查询参数
+            queryParams: {
+                pageNum: 1,
+                pageSize: 15,
+                id: null,
+                status:"1",
+            },
+            // 加载更多
+            status: 'more',
+            contentText: {
+                contentdown: '查看更多',
+                contentrefresh: '加载中',
+                contentnomore: '------------------我是有底线的------------------'
+            },
+            // 列表数据
             list: [
                 {
                     name:"-",
@@ -36,6 +54,26 @@ export default {
                 }
             ],
         };
+    },
+    onPullDownRefresh() {
+        this.queryParams.pageNum = 1;
+        this.list = [];
+        this.getList()
+    },
+    //上拉加载
+    onReachBottom(){
+        let pageNum = this.queryParams.pageNum;
+        let pageSize = this.queryParams.pageSize;
+        let total = this.total;
+        if(pageNum*pageSize >= total){
+            uni.showToast({
+                title:'暂无更多数据'
+            });
+            return;
+        } else {
+            this.queryParams.pageNum += 1;
+            this.getList()
+        }
     }
     /**
      * 生命周期函数--监听页面加载
@@ -44,11 +82,27 @@ export default {
         this.getList();
     },
     methods: {
+        /** 新增按钮操作 */
+        handleAdd(){
+            uni.navigateTo({
+                url: '../cooperative/addCooperative'
+            });
+        },
         /** 查询列表 */
         getList(type) {
             this.loading = true;
             getList().then(response => {
-                this.list = response.rows;
+                if (this.queryParams.pageNum === 1) {
+                    this.list = response.rows;
+                } else {
+                    this.list = this.list.concat(response.rows);
+                }
+                // 判断是否还有更多数据
+                if (response.rows.length < this.queryParams.pageSize) {
+                    this.status = 'noMore'; // 没有更多数据
+                } else {
+                    this.status = 'more'; // 还有更多数据
+                }
             });
         },
         /** 查询详情 */

+ 1 - 1
pages/gridQuery/gridQuery.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 			<view >
-				<uni-title type="h3" :title="data.name+'职责:'"></uni-title><br/><br/>
+				<uni-title type="h5" :title="data.name+'职责:'" color="#666"></uni-title><br/><br/>
 			</view>
 
 			<view>

+ 11 - 15
pages/gridQuery/mattercontent.vue

@@ -2,18 +2,14 @@
 
 	<view>
 		<view class="rnwdList">
-
-
 			<ul >
 				<li >
-
 					<h3>{{matterlist.title }}</h3>
 				    <p>{{ matterlist.content }}</p>
+					<image class="uni-header-image" :src="'http://127.0.0.1:8080'+matterlist.picture"></image>
 					   <button @click="toggleFavorite">{{ isFavorite ? '❤️' : '🤍' }}</button>
 				</li>
 				</ul>
-
-
 		</view>
 	</view>
 
@@ -22,7 +18,7 @@
 
 <script>
 	import {
-		 getDept, addsc, delDept, getsc
+		 getDept, scadd, delDept, getsc
 	} from '@/api/handleAffairs/matter.js';
 
 	export default {
@@ -37,11 +33,11 @@
 
 		},
 
-
 		methods: {
 		      getList(){
 		        const _that = this;
 		        const id = uni.getStorageSync('id');
+
 		        getDept(id).then(res =>{
 		          _that.matterlist = res.data
 					this.checkFavorite();
@@ -56,19 +52,19 @@
 		        } else {
 					const userId = getApp().globalData.userId
 					const matterId = this.matterlist.id
-		         addsc({ matterId:this.matterlist.id , userId }).then(() => {
+		         scadd({ matterId:this.matterlist.id , userId }).then(() => {
 		             this.isFavorite = true;
 		         });
 		        }
 		      },
 
-		    checkFavorite() {
-				const userId = getApp().globalData.userId
-		      getsc(userId).then(res => {
-		        this.isFavorite = res.data;
-		      });
-		    },
-
+		   checkFavorite() {
+		   	const userId = getApp().globalData.userId
+		   	const matterId = this.matterlist.id
+		     getsc({ matterId , userId }).then(res => {
+		       this.isFavorite = res.data;
+		     });
+		   },
 	},
 	}
 </script>

+ 139 - 42
pages/handleAffairs/handleAffairs.vue

@@ -1,32 +1,26 @@
 <template>
 
-	<view>
+	<view style="background-color:#fff ;">
 		<!-- 搜索栏 -->
-		<view class="input-view">
-			<uni-icons type="search" size="20" class="search-icon" @tap="confirm"></uni-icons>
-			<input confirm-type="search" class="nav-bar-input" type="text" placeholder="输入搜索关键词" @confirm="confirm" v-model="title"/>
+		<view class="input-view_contain data-v-53a1f34c">
+			<view class="input-view">
+				<input confirm-type="search" class="nav-bar-input" type="text" placeholder="输入搜索内容" @confirm="confirm" v-model="title"/>
+				<uni-icons type="search" size="20" class="search-icon" @tap="confirm"></uni-icons>
+			</view>
 		</view>
+		<view class="spacing"></view>
 		<!-- 网格配置列表滑动 -->
-		<view>
+		<view class="image-hei">
 			<uni-swiper-dot :info="info" :current="current" field="content" :mode="mode">
-				<swiper class="swiper-box">
+				<swiper class="swiper-box" style="height: 160rpx;">
 					<swiper-item v-for="(item ,index) in gridtType" :key="index">
-
-						<!-- <ul class="mainNav" >
-							<li v-for="(dataitem,dataindex) in item.dataList" :key="dataitem.id">
-								<image class="uni-header-image" :src="'http://127.0.0.1:8080'+dataitem.fileUrl"
-									@click="querygrid(dataitem)"></image>
-								<text>{{dataitem.name}}</text>
-							</li>
-						</ul> -->
 						<uni-grid :column="5" :highlight="true" :showBorder="false">
 							<uni-grid-item v-for="(dataitem,dataindex) in item" :key="dataitem.id">
 								<view>
-									<image class="uni-header-image" :src="'http://127.0.0.1:8080'+dataitem.fileUrl"
+									<image class="uni-header-image" :src="loadImgSrcLocalhost(dataitem.fileUrl)"
 										@click="querygrid(dataitem)"></image>
 									<uni-title type="h5" :title="dataitem.name" align="center"></uni-title>
 								</view>
-
 							</uni-grid-item>
 						</uni-grid>
 					</swiper-item>
@@ -35,15 +29,10 @@
 		</view>
 
 		<view>
-			<uni-row class="demo-uni-row" :width="nvueWidth">
-				<uni-col :span="12">
-					<button align="center" @click="topic">主题导航</button>
-				</uni-col>
-
-				<uni-col :span="12">
-					<button align="center" @click="dept">部门导航</button>
-				</uni-col>
-			</uni-row>
+			<view class="demo-uni-row">
+				<button align="center" @click="topic">主题导航</button>
+				<button align="center" @click="dept">部门导航</button>
+			</view>
 		</view>
 
 		<!-- ------------------------------------------------------------------------------------------------------------------------------------------ -->
@@ -51,8 +40,17 @@
 		<view>
 		    <!-- 使用分段器来切换推荐和收藏列表 -->
 		    <view class="segmented-control">
-		        <view class="segmented-control-item" :class="{ active: activeTab === 'recommend' }" @click="changeTab('recommend')">推荐</view>
-		        <view class="segmented-control-item" :class="{ active: activeTab === 'favorite' }" @click="changeTab('favorite')">收藏</view>
+		        <!-- <view class="segmented-control-item" :class="{ active: activeTab === 'recommend' }" @click="changeTab('recommend')">常办事项</view>
+		        <view class="segmented-control-item" :class="{ active: activeTab === 'favorite' }" @click="changeTab('favorite')">我的事</view> -->
+				<view
+					class="segmented-control-item"
+					:class="activeTab == e.label ? 'highlight' : 'not-highlight' "
+					@click="changeTab(e.label)"
+					v-for="(e,idx) in switchOption"
+					:key="idx"
+					>
+					{{ e.value }}
+				</view>
 		    </view>
 
 		    <!-- 根据选中的标签显示对应的列表 -->
@@ -63,7 +61,7 @@
 		                    <p @click="getmatter(item)">{{ item.title }}</p>
 		                </li> -->
 						<uni-list>
-							<uni-list-item  :title="item.title" v-for="(item,index) in recommendList" @click="getmatter(item)" clickable="true" ></uni-list-item>
+							<uni-list-item  class="list-item":title="item.title" v-for="(item,index) in recommendList" @click="getmatter(item)" clickable="true" link></uni-list-item>
 						</uni-list>
 		            </ul>
 		        </view>
@@ -75,16 +73,21 @@
 		                    <p @click="getmatter(item)">{{ item.title }}</p>
 		                </li> -->
 						<uni-list>
-							<uni-list-item  :title="item.title" v-for="(item,index) in favoriteList" @click="getmatter(item)" clickable="true" ></uni-list-item>
+							<uni-list-item class="list-item" :title="item.title" v-for="(item,index) in favoriteList" @click="getmatter(item)" clickable="true" link></uni-list-item>
 						</uni-list>
 		            </ul>
 		        </view>
 		    </view>
-
+			<uni-fab ref="fab" :horizontal="right" :vertical="bottom"
+			         @fabClick="goToMatterAllPage()"/>
+			<!-- <view class="add-button" @click="goToMatterAllPage">
+					<text>+</text>
+				</view> -->
 		</view>
 
 
 	</view>
+
 </template>
 
 <script>
@@ -101,7 +104,23 @@ import { listDept,collectlist } from '@/api/handleAffairs/matter.js';
 				activeTab: 'recommend', // 默认选中推荐列表
 				recommendList: [], // 推荐列表数据
 				favoriteList: [], // 收藏列表数据
+			    userList: [], // 收藏列表数据
+			    switchOption:[
+				    {
+					    value:'常办事项',
+					    label:'recommend'
+				    },
+				    {
+					    value:'我的事',
+					    label:'favorite'
+				    }
+			    ],
 				  userList: [], // 收藏列表数据
+				  //悬浮按钮右对齐
+				  right: 'right',
+				  //悬浮按钮下对齐
+				  bottom: 'bottom',
+				  color:'#8FBC8F '
 			};
 		},
 		created() {
@@ -110,6 +129,12 @@ import { listDept,collectlist } from '@/api/handleAffairs/matter.js';
 			this.getListscolle();
 		},
 		methods: {
+			  goToMatterAllPage() {
+			        // 使用 uni-app 的路由跳转方法跳转到 matterAll 页面
+			        uni.navigateTo({
+			            url: '/pages/mattersAdd/mattersAdd'
+			        });
+			    },
 			confirm(){
 				if (!this.title.trim()) {//去除前后空格,在判断是否为空
 					return
@@ -200,23 +225,71 @@ import { listDept,collectlist } from '@/api/handleAffairs/matter.js';
 		}
 	}
 </script>
-<style scoped>
+<style scoped lang="scss">
+	.not-highlight{
+		color:#ABB7C7;
+		background-color:#fff
+	}
+	.highlight{
+		color:#0CC689;
+		background-color:#fff;
+		border-bottom: 2px solid #0CC689;
+	}
 	.uni-header-image {
-
-		width: 30px;
-		height: 30px;
+		width: 40px;
+		height: 40px;
 		display: block;
 		margin: 0 auto;
+		border-radius: 50%;
+	}
+	.demo-uni-row{
+		position: relative;
+		display: flex;
+		width: 92%;
+		height: 8vh;
+		margin: auto;
+		border-radius: 10px;
+		border: 1px solid #19C56B;
+	}
+	.demo-uni-row button{
+		width: 45%;
+		color: #27C874;
+		height: 100%;
+		line-height: 200%;
+		text-indent: 9%;
+		background-color: #F1F1F1;
+		border: none !important;
+		background-color:#fff
+	}
+	.demo-uni-row button:after{
+		border: none;
+	}
+	.demo-uni-row::after{
+		content: '';
+		position: absolute;
+		width: 4rpx;
+		height: 46%;
+		left: 50%;
+		top: 33%;
+		z-index: 10;
+		margin: auto;
+		background-color: #E1E1E1;
 	}
-
 	/* 主导航 */
 	.mainNav {
 		width: 100%;
 		background: #fff;
 
 	}
-
+	.input-view_contain{
+		height: 50px;
+		width: 100%;
+		background-color: #07C160;
+	}
 	.input-view {
+		
+		justify-content: space-between;
+		align-items: center;
 		/* #ifndef APP-PLUS-NVUE */
 		display: flex;
 		/* #endif */
@@ -224,25 +297,49 @@ import { listDept,collectlist } from '@/api/handleAffairs/matter.js';
 		// width: 500rpx;
 		flex: 1;
 		background-color: #f8f8f8;
-		height: $nav-height;
-		border-radius: 15px;
+		height: 80%;
+		border-radius: 5px;
 		padding: 0 15px;
 		flex-wrap: nowrap;
-		margin: 7px 0;
-		line-height: $nav-height;
+		margin: auto;
+		line-height: 5vh;
+		width: 96%;
+		.nav-bar-input{
+			margin: auto 0;
+			font-size: 15px;
+		}
 	}
 	.segmented-control {
+		width: 100%;
+		height: 8vh;
 	    display: flex;
 	    justify-content: space-around;
 	    background-color: #f0f0f0;
 	}
-
+	.rnwdList{
+		min-height: 63vh;
+		background-color: #fff;
+	}
 	.segmented-control-item {
+		width: 50%;
+		height: 100%;
+		line-height: 250%;
+		text-align: center;
 	    padding: 10px;
-	    cursor: pointer;
+		font-size: 34rpx;
 	}
 
 	.segmented-control-item.active {
 	    color: #007aff;
 	}
+	.spacing {
+		height: 40rpx;
+	}
+	.image-hei{
+		height:80px
+	}
+	.list-item {
+	   border-bottom: 1px dotted #ccc;
+	   height:35px
+	}
 </style>

+ 1 - 1
pages/matterAll/matterAll.vue

@@ -76,7 +76,7 @@
 				listMatters(_that.queryForm).then(res => {
 					_that.dataList = res.rows
 					_that.total = res.total
-					console.log(res)
+
 				})
 			}
 		}

+ 22 - 4
pages/me/nameAuthentication.vue

@@ -12,19 +12,23 @@
                 <uni-forms-item label="身份证号" required name="idCard">
                     <uni-easyinput v-model="form.idCard" placeholder="请输入身份证号" maxlength="18"/>
                 </uni-forms-item>
-                <uni-forms-item label="身份证正反面" required name="path">
+				<uni-forms-item label="身份证正反面" required class="onePic" v-if="form.id != null">
+					<image :src="loadImgSrc(item)" v-for="(item, index1) in imageList" :key="index1">
+					</image>
+				</uni-forms-item>
+                <uni-forms-item label="身份证正反面" required name="path" v-if="form.id == null">
                     <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>
+            <button type="primary" @click="submitForm('customForm')" v-if="form.id==null">提交</button>
         </view>
     </uni-section>
 </template>
 
 <script>
     import upload from '../../components/upload/index.vue'
-    import {appletAdd} from '@/api/me/nameAuthentication.js'
+    import {appletAdd,getUserInfo} from '@/api/me/nameAuthentication.js'
 
     export default {
         components: {
@@ -33,6 +37,8 @@
         onReady() {
             // 设置自定义表单校验规则,必须在节点渲染完毕后执行
             this.$refs.customForm.setRules(this.customRules)
+			this.userId = getApp().globalData.userId
+			this.getUserInfoByUserId(this.userId)
         },
         data() {
             return {
@@ -97,10 +103,22 @@
 				})
             },
 
+			//图片上传
             updateImg(imgList) {
                 this.imageList = imgList;
                 this.form.path = this.imageList.join(',');
-            }
+            },
+			
+			//按userId查询实名认证信息
+			getUserInfoByUserId(userId){
+				getUserInfo(userId).then(res =>{
+					if(res.data!=null){
+						this.form = res.data;
+						this.imageList = res.data.path.split(",")
+					}
+					
+				})
+			}
         }
     };
 </script>

+ 22 - 6
pages/me/officialAuthentication.vue

@@ -12,19 +12,23 @@
                 <uni-forms-item label="联系电话" required name="phone">
                     <uni-easyinput v-model="form.phone" placeholder="请输入联系电话" maxlength="13"/>
                 </uni-forms-item>
-                <uni-forms-item label="证照信息" required name="path">
+				<uni-forms-item label="证照信息" required class="onePic" v-if="form.id != null">
+					<image :src="loadImgSrc(item)" v-for="(item, index1) in imageList" :key="index1">
+					</image>
+				</uni-forms-item>
+                <uni-forms-item label="证照信息" required name="path" v-if="form.id == null">
                     <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>
+            <button type="primary" @click="submitForm('customForm')" v-if="form.id==null">提交</button>
         </view>
     </uni-section>
 </template>
 
 <script>
     import upload from '../../components/upload/index.vue'
-    import {appletAdd} from '@/api/me/officialAuthentication.js'
+    import {appletAdd,getUserInfo} from '@/api/me/officialAuthentication.js'
 
     export default {
         components: {
@@ -33,6 +37,8 @@
         onReady() {
             // 设置自定义表单校验规则,必须在节点渲染完毕后执行
             this.$refs.customForm.setRules(this.customRules)
+			this.userId = getApp().globalData.userId
+			this.getUserInfoByUserId(this.userId)
         },
         data() {
             return {
@@ -87,18 +93,28 @@
 						})
 					}else{
 						appletAdd(this.form).then(res => {
-							console.log("1111111111")
 							uni.navigateBack();
-							console.log("2222222222222")
 						});
 					}
 				})
             },
 			
+			//图片上传
             updateImg(imgList) {
                 this.imageList = imgList;
                 this.form.path = this.imageList.join(',');
-            }
+            },
+			
+			//按userId查询实名认证信息
+			getUserInfoByUserId(userId){
+				getUserInfo(userId).then(res =>{
+					if(res.data!=null){
+						this.form = res.data;
+						this.imageList = res.data.path.split(",")
+					}
+					
+				})
+			}
         }
     };
 </script>

+ 1 - 1
pages/quotations/quotations.vue

@@ -190,4 +190,4 @@ export default {
 }
 
 
-</style>
+</style>

+ 48 - 9
pages/topic/dept.vue

@@ -1,9 +1,18 @@
 <template>
 	<view>
-		<view style="height: 20%;">
-			<button v-for="(item,index) in userType" @click="onclick(item)">{{item.dictLabel}}
-			</button>
-		</view>
+		
+			<view class="btnContain">
+				<button 
+					v-for="(item,idx) in userType" 
+					@click="onclick(item,idx)"
+					:class="idx == currentIdx ? 'highlight' : 'not-highlight'"
+					:style="idx == 0 ? 'text-align:left' : 'text-align:right'"
+					>
+					{{item.dictLabel}}
+				</button>
+			</view>
+		
+		
 		<view>
 			<uni-grid :column="2" :square="false" :highlight="false">
 				<uni-grid-item v-for="(item, index) in dataList" :index="index" :key="index">
@@ -31,7 +40,7 @@
 			return {
 				userType: [], // 初始化用户类型为空
 				dataList: [],
-
+				currentIdx:0,
 			}
 		},
 		created() {
@@ -59,8 +68,8 @@
 				})
 				
 			},
-			onclick(row) {
-				
+			onclick(row,idx) {
+				this.currentIdx = idx
 				let data = {
 					application: row.dictValue,
 					shows: "0"
@@ -89,9 +98,38 @@
 		justify-content: center;
 		height: 100vh;
 	} */
-
+	.not-highlight{
+		color:#000;
+	}
+	.highlight{
+		color:#FF673D;
+	}
+	.btnContain{
+		position: relative;
+		width: 100%;
+		display: flex;
+		height: 20%;
+		background-color: #fff;
+		justify-content: space-between;
+	}
+	.btnContain::after{
+		content: '';
+		position: absolute;
+		width: 4rpx;
+		height: 40%;
+		left: 50%;
+		top: 30%;
+		z-index: 10;
+		margin: auto;
+		background-color: #E1E1E1;
+	}
 	button {
-		margin-bottom: 10px;
+		width: 30%;
+		border: none;
+		background-color: #fff;
+	}
+	button:after{
+		border: none;
 	}
 
 	.selected {
@@ -122,4 +160,5 @@
 		justify-content: center;
 		padding: 15px 0;
 	}
+	
 </style>

+ 44 - 7
pages/topic/topic.vue

@@ -1,7 +1,13 @@
 <template>
 	<view>
-		<view style="height: 20%;">
-			<button v-for="(item,index) in userType" @click="onclick(item)">{{item.dictLabel}}
+		<view class="btnContain">
+			<button 
+				v-for="(item,idx) in userType" 
+				@click="onclick(item,idx)"
+				:class="idx == currentIdx ? 'highlight' : 'not-highlight'"
+				:style="idx == 0 ? 'text-align:left' : 'text-align:right'"
+				>
+				{{item.dictLabel}}
 			</button>
 		</view>
 		<view>
@@ -30,7 +36,7 @@
 			return {
 				userType: [], // 初始化用户类型为空
 				dataList: [],
-
+				currentIdx:0,
 			}
 		},
 		created() {
@@ -57,8 +63,8 @@
 				})
 				console.log(_that.dataList)
 			},
-			onclick(row) {
-				
+			onclick(row,idx) {
+				this.currentIdx = idx
 				let data = {
 					objectOfHandling: row.dictValue,
 					yesOrNoShow: "0"
@@ -87,10 +93,41 @@
 		justify-content: center;
 		height: 100vh;
 	} */
-
+	.not-highlight{
+		color:#000;
+	}
+	.highlight{
+		color:#FF673D;
+	}
+	
+	.btnContain{
+		position: relative;
+		width: 100%;
+		display: flex;
+		height: 20%;
+		background-color: #fff;
+		justify-content: space-between;
+	}
+	.btnContain::after{
+		content: '';
+		position: absolute;
+		width: 4rpx;
+		height: 40%;
+		left: 50%;
+		top: 30%;
+		z-index: 10;
+		margin: auto;
+		background-color: #E1E1E1;
+	}
 	button {
-		margin-bottom: 10px;
+		width: 30%;
+		border: none;
+		background-color: #fff;
 	}
+	button:after{
+		border: none;
+	}
+
 
 	.selected {
 		background-color: #007bff;