Kaynağa Gözat

优化消息页

LinWuTai 6 gün önce
ebeveyn
işleme
8d56c49a1e

+ 42 - 0
api/user.js

@@ -83,4 +83,46 @@ export function me() {
 		'method': 'get',
 		'data': null
 	})
+}
+
+/**
+ * 用户信息卡
+ */
+export function getCreditCard() {
+	return request({
+		'url': '/user/creditCard',
+		headers: {
+			isToken: true
+		},
+		'method': 'get',
+		'data': null
+	})
+}
+
+/**
+ * 中介证书
+ */
+export function getZhongjie() {
+	return request({
+		'url': '/user/zhongjie',
+		headers: {
+			isToken: true
+		},
+		'method': 'get',
+		'data': null
+	})
+}
+
+/**
+ * 按揭证书
+ */
+export function getAnjie() {
+	return request({
+		'url': '/user/anjie',
+		headers: {
+			isToken: true
+		},
+		'method': 'get',
+		'data': null
+	})
 }

+ 7 - 7
components/creditCard.vue

@@ -13,12 +13,12 @@
 				请登录后查看
 			</view>
 		</view>
-		<view class="desc-box" v-if="isLogin && !data.id" @click="onGuideClick()">
+		<view class="desc-box" v-if="isLogin && !data.creditNo" @click="onGuideClick()">
 			<view class="text">
 				用户暂未办理信用信息卡<br/>点击了解办理指引&gt;
 			</view>
 		</view>
-		<view class="image-box" v-if="isLogin && data.id">
+		<view class="image-box" v-if="isLogin && data.creditNo">
 			<view class="image-item-box">
 				<image class="photo" :src="data.photo"></image>
 			</view>
@@ -31,7 +31,7 @@
 				</view>
 			</view>
 		</view>
-		<view class="info-box" v-if="isLogin && data.id">
+		<view class="info-box" v-if="isLogin && data.creditNo">
 			<view class="info-item-box">
 				<view class="label">
 					<span style="letter-spacing: 2em;">姓</span><span>名:</span>
@@ -45,7 +45,7 @@
 					<span style="letter-spacing: 2em;">卡</span><span>号:</span>
 				</view>
 				<view class="text">
-					{{ data.number }}
+					{{ data.creditNo ?? '-' }}
 				</view>
 			</view>
 			<view class="info-item-box">
@@ -53,7 +53,7 @@
 					<span class="label-text">发卡时间:</span>
 				</view>
 				<view class="text">
-					{{ data.time }}
+					{{ data.date ?? '-' }}
 				</view>
 			</view>
 		</view>
@@ -77,9 +77,9 @@
 			type: Object,
 			default: {
 				id: null,
-				number: null,
+				creditNo: null,
 				name: null,
-				time: null,
+				date: null,
 				publisher: null,
 				photo: null,
 				qrCode: null

+ 31 - 17
pages/certificateDetail/certificateDetail.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<view class="photo-box">
-			<cover-image class="photo" :src="info.photo"></cover-image>
+			<cover-image class="photo" src="https://ok.166.net/reunionpub/1_20210628_17a5105e667995566.jpeg"></cover-image>
 		</view>
 		<view class="info-box">
 			<view class="info-item-box">
@@ -9,7 +9,7 @@
 					<span>证书编号:</span>
 				</view>
 				<view class="text">
-					{{ info.number }}
+					{{ info.zsbh }}
 				</view>
 			</view>
 			<view class="info-item-box">
@@ -17,7 +17,7 @@
 					<span>发证部门:</span>
 				</view>
 				<view class="text">
-					{{ info.dept }}
+					{{ info.fzbm }}
 				</view>
 			</view>
 			<view class="info-item-box">
@@ -25,7 +25,7 @@
 					<span>发证日期:</span>
 				</view>
 				<view class="text">
-					{{ info.time }}
+					{{ info.fzrq }}
 				</view>
 			</view>
 			<view class="info-item-box">
@@ -34,7 +34,7 @@
 					<span>名:</span>
 				</view>
 				<view class="text">
-					{{ info.name }}
+					{{ info.xm }}
 				</view>
 			</view>
 			<view class="info-item-box">
@@ -43,7 +43,7 @@
 					<span>别:</span>
 				</view>
 				<view class="text">
-					{{ info.gender }}
+					{{ info.xb }}
 				</view>
 			</view>
 			<view class="info-item-box">
@@ -51,7 +51,7 @@
 					<span>身份证号:</span>
 				</view>
 				<view class="text">
-					{{ info.idCard }}
+					{{ info.sfzh }}
 				</view>
 			</view>
 			<view class="info-item-box">
@@ -59,7 +59,7 @@
 					<span>文化程度:</span>
 				</view>
 				<view class="text">
-					{{ info.culture }}
+					{{ info.whcd }}
 				</view>
 			</view>
 		</view>
@@ -70,19 +70,19 @@
 	import { ref } from 'vue'
 	import { onLoad } from '@dcloudio/uni-app'
 	
+	import { getZhongjie, getAnjie } from '@/api/user.js'
+	
 	const certificateType = ref()
 	const certificateTitle = ref()
 	
 	const info = ref({
-		id: '1',
-		number: 'ZS20250101001',
-		dept: '广州市房地产中介协会',
-		time: '2025年01月13日',
-		name: '彭于晏',
-		gender: '男',
-		idCard: '123456789012345679',
-		culture: '大学',
-		photo: 'https://ok.166.net/reunionpub/1_20210628_17a5105e667995566.jpeg'
+		zsbh: null,
+		fzbm: null,
+		fzrq: null,
+		xm: null,
+		xb: null,
+		sfzh: null,
+		whcd: null
 	})
 	
 	onLoad((load) => {
@@ -91,6 +91,20 @@
 		uni.setNavigationBarTitle({
 			title: certificateTitle.value
 		})
+		
+		if (certificateType.value === 'zhongjie') {
+			getZhongjie().then(res => {
+				if (res && res.message === 'success') {
+					info.value = res.data
+				}
+			})
+		} else if (certificateType.value === 'anjie') {
+			getAnjie().then(res => {
+				if (res && res.message === 'success') {
+					info.value = res.data
+				}
+			})
+		}
 	})
 </script>
 

+ 17 - 1
pages/chat/chat.vue

@@ -7,6 +7,9 @@
 				bg-color="#E5E5E5"
 				:input-style="searchInputStyle"
 				placeholder="请输入搜索内容"
+				@search="onSearchConfirm"
+				@custom="onSearchConfirm"
+				@clear="onSearchClear"
 			></u-search>
 		</view>
 		<u-empty
@@ -31,7 +34,7 @@
 						<view class="text">
 							{{item.content}}
 						</view>
-						<view class="tag" v-show="item.read"></view>
+						<view class="tag" v-show="!item.read"></view>
 					</view>
 					<view class="other-box">
 						<view class="date">
@@ -100,6 +103,19 @@
 		},
 	])
 	
+	function onSearchConfirm() {
+		searchForm.value.pageNumber = 1
+		pageNum.value = 1
+		onSearch()
+	}
+	
+	function onSearchClear() {
+		searchForm.value.keyword = null
+		searchForm.value.pageNumber = 1
+		pageNum.value = 1
+		onSearch()
+	}
+	
 	function onSearch() {
 		loadMoreStatus.value = 'more'
 		query(searchForm.value).then(res => {

+ 48 - 11
pages/personalCenter/personalCenter.vue

@@ -8,7 +8,7 @@
 				<view class="name-box">
 					<view class="name" v-if="isLogin">
 						<view class="text">
-							{{user.username}}
+							{{user.name}}
 						</view>
 						<view class="iconfont icon-xiugai"></view>
 					</view>
@@ -28,7 +28,7 @@
 						任职机构:
 					</view>
 					<view class="text">
-						{{isLogin ? user.corpName : ''}}
+						{{isLogin ? user.corpName ?? '无' : ''}}
 					</view>
 				</view>
 				<view class="info-item-box">
@@ -36,7 +36,7 @@
 						机构备案证号:
 					</view>
 					<view class="text">
-						{{isLogin ? user.corpRegNo : ''}}
+						{{isLogin ? user.corpRegNo ?? '无' : ''}}
 					</view>
 				</view>
 			</view>
@@ -49,9 +49,9 @@
 				<view class="list-item-box" @click="onShowCreditCard(creditCard.id)">
 					<CreditCard :isLogin="isLogin" :data="creditCard" @guide="onCreditCardGuideClick()"></CreditCard>
 				</view>
-				<view class="list-item-box" :class="[isLogin ? (user.zhongjierenzheng ? 'zhongjie-back' : 'zhongjie-back-zhiyin') : 'zhongjie-back-login']" @click="onZhongJieRenZhengClick(user.zhongjierenzheng)">
+				<view class="list-item-box" :class="[isLogin ? (zhongjie.zsbh ? 'zhongjie-back' : 'zhongjie-back-zhiyin') : 'zhongjie-back-login']" @click="onZhongJieRenZhengClick(zhongjie.zsbh)">
 				</view>
-				<view class="list-item-box" :class="[isLogin ? (user.anjierenzheng ? 'anjie-back' : 'anjie-back-zhiyin') : 'anjie-back-login']" @click="onAnJieRenZhengClick(user.anjierenzheng)">
+				<view class="list-item-box" :class="[isLogin ? (anjie.zsbh ? 'anjie-back' : 'anjie-back-zhiyin') : 'anjie-back-login']" @click="onAnJieRenZhengClick(anjie.zsbh)">
 				</view>
 			</view>
 		</view>
@@ -160,12 +160,12 @@
 	import { onLoad } from '@dcloudio/uni-app'
 	import { getToken, removeToken } from '@/utils/auth.js'
 	
-	import { me } from '@/api/user.js'
+	import { me, getCreditCard, getZhongjie, getAnjie } from '@/api/user.js'
 	
 	// 用户信息
 	const user = ref({
 		userIcon: '1',
-		username: '某某某',
+		name: '某某某',
 		corpName: '广州市xx地产有限公司',
 		corpRegNo: '123xxxx',
 		zhongjierenzheng: true, // 中介认证
@@ -176,10 +176,9 @@
 	const showCreditCard = ref(false)
 	// 信用信息卡
 	const creditCard = ref({
-		id: '1',
-		number: 'GZ2028000001',
+		creditNo: 'GZ2028000001',
 		name: '彭于晏',
-		time: '2018年6月22日',
+		date: '2018年6月22日',
 		publisher: '广州市住房和城乡建设委员会',
 		photo: 'https://ok.166.net/reunionpub/1_20210628_17a5105e667995566.jpeg',
 		qrCode: 'https://sylwt.top/api/visitor/resources/image?name=/ydl/menber-center/zhengshu/qrCode.png'
@@ -217,9 +216,27 @@
 				url: '/pages/certificateDetail/certificateDetail?type=anjie&title=广州市房地产按揭从业人员水平认证证书'
 			})
 		} else {
-			
+			console.log('跳转按揭认证报名指引');
 		}
 	}
+	const zhongjie = ref({
+		zsbh: null,
+		fzbm: null,
+		fzrq: null,
+		xm: null,
+		xb: null,
+		sfzh: null,
+		whcd: null
+	})
+	const anjie = ref({
+		zsbh: null,
+		fzbm: null,
+		fzrq: null,
+		xm: null,
+		xb: null,
+		sfzh: null,
+		whcd: null
+	})
 	
 	// 点击-会费缴交
 	function onHuiFeiJiaoJiao() {
@@ -260,6 +277,26 @@
 	})
 	
 	onLoad(() => {
+		me().then(res => {
+			if (res && res.message === 'success') {
+				user.value = res.data
+			}
+		})
+		getCreditCard().then(res => {
+			if (res && res.message === 'success') {
+				creditCard.value = res.data
+			}
+		})
+		getZhongjie().then(res => {
+			if (res && res.message === 'success') {
+				zhongjie.value = res.data ?? {zsbh: null}
+			}
+		})
+		getAnjie().then(res => {
+			if (res && res.message === 'success') {
+				anjie.value = res.data ?? {zsbh: null}
+			}
+		})
 	})
 </script>