Преглед изворни кода

完善微信登陆后完善泳欣信息部分

littleblue55 пре 1 месец
родитељ
комит
577453fb2f
2 измењених фајлова са 89 додато и 171 уклоњено
  1. 9 4
      pages/register/register.vue
  2. 80 167
      pages/researchReport/reportHome/reportHome.vue

+ 9 - 4
pages/register/register.vue

@@ -20,8 +20,7 @@
 			</u-form-item>
 			<u-form-item label="手机号码" prop="phone" required :border-bottom="false" v-else>
 				<u-input height="80" placeholder="请输入手机号" border-color="#d0d0d0" v-model="registerForm.phone"
-					:border="true" class="form-item-input" type="number" />
-					11111
+					:border="true" class="form-item-input" type="number" disabled/>
 			</u-form-item>
 			<u-form-item label="身份证" prop="userCode" :border-bottom="false">
 				<u-input height="80" placeholder="请输入身份证" border-color="#d0d0d0" v-model="registerForm.userCode"
@@ -36,9 +35,9 @@
 				</u-radio-group>
 			</u-form-item>
 			<view class="form-button" @click="submit">
-				注册
+				{{ mode === 'register' ? "注册" : "确认"}}
 			</view>
-			<view class="form-tip" @click="back">已有账号,立即登录</view>
+			<view class="form-tip" @click="back" v-if="mode === 'register'">已有账号,立即登录</view>
 		</u-form>
 	</view>
 </template>
@@ -179,9 +178,15 @@
 				mode
 			} = option;
 			if (mode === "refine") {
+				uni.setNavigationBarTitle({
+					title: "完善信息"
+				})
 				this.mode = mode;
 				this.registerForm.phone = this.useAuthStore.phone;
 			}else{
+				uni.setNavigationBarTitle({
+					title: "账号注册"
+				})
 				this.mode = 'register'
 			}
 		},

+ 80 - 167
pages/researchReport/reportHome/reportHome.vue

@@ -2,9 +2,9 @@
 	<view class="container">
 		<view v-show="menuCurrent === 0">
 			<view class="menus-box">
-				<view class="menus-item-box" 
-				@click="toReportList(key, data.value)" 
-				v-for="(data,key) in categoryList" 
+				<view class="menus-item-box"
+				@click="toReportList(key, data.value)"
+				v-for="(data,key) in categoryList"
 				:key="key">
 					<view class="icon-box">
 						<view class="iconfont icon-hetong"></view>
@@ -48,13 +48,15 @@
 						bg-color="#E5E5E5"
 						:input-style="searchInputStyle"
 						placeholder="搜索您想要的内容"
+						@search="searchHistory(searchForm.keyword, 1)"
+						@custom="searchHistory(searchForm.keyword, 1)"
 					></u-search>
 				</view>
 			</view>
 			<view class="list-box">
 				<view class="list-item-box" v-for="item in list" :key="item.id" @click="onClickReport(item)">
 					<view class="image-box">
-						<image :src="item.image" mode="aspectFill"></image>
+						<image :src="item.imgUrl" mode="aspectFill"></image>
 					</view>
 					<view class="info-box">
 						<view class="title">
@@ -72,7 +74,7 @@
 					</view>
 				</view>
 			</view>
-			<u-loadmore :status="status" margin-top="20" margin-bottom="20" @loadmore="loadmore"/>
+			<!-- <u-loadmore :status="status" margin-top="20" margin-bottom="20"/> -->
 		</view>
 		<view v-show="menuCurrent === 2">
 			<view class="header-box">
@@ -83,13 +85,15 @@
 						bg-color="#E5E5E5"
 						:input-style="searchInputStyle"
 						placeholder="搜索您想要的内容"
+						@search="searchMy(searchForm.keyword, 1)"
+						@custom="searchMy(searchForm.keyword, 1)"
 					></u-search>
 				</view>
 			</view>
 			<view class="list-box">
 				<view class="list-item-box" v-for="item in list2" :key="item.id" @click="onClickReport(item)">
 					<view class="image-box">
-						<image :src="item.image" mode="aspectFill"></image>
+						<image :src="item.imgUrl" mode="aspectFill"></image>
 					</view>
 					<view class="info-box">
 						<view class="title">
@@ -104,8 +108,8 @@
 					</view>
 				</view>
 			</view>
-			<u-loadmore :status="status" margin-top="20" margin-bottom="20" @loadmore="loadmore"/>
 		</view>
+		<u-loadmore v-if="menuCurrent !== 0" :status="status" margin-top="20" margin-bottom="20"  @loadmore="loadMore"/>
 		<view class="bottom-block"></view>
 		<view class="bottom-box">
 			<view class="menu-box">
@@ -134,15 +138,19 @@
 		loadReportHistory,
 		loadMyReport
 	} from '@/api/report.js'
-	
+
 	import { useReportStore } from '@/store/reportStore.js'
-	
+
 	const reportStore = useReportStore();
-	
+
 	const categoryList = ref({});
 	const pageNum = ref(1);
-	const status = ref('loadmore');
-	
+	const status = ref('nomore');
+	const list = ref([]);
+	const list2 = ref([]);
+	const listCount = ref(0);
+	const listCount2 = ref(0);
+
 	const customButtonStyle = {
 		height: '40rpx',
 		lineHeight: '40rpx',
@@ -155,8 +163,9 @@
 		keyword: '',
 		type: 0
 	})
-	
+
 	const menuCurrent = ref(0)
+
 	function onMenuClick(index) {
 		menuCurrent.value = index;
 		searchForm.value.keyword = ""
@@ -169,34 +178,62 @@
 			searchMy("", 1)
 		}
 	}
-	
-	function searchHistory(keyword, pageNum, pageSize){
+
+	function searchHistory(keyword, pageNumber, pageSize){
+		status.value = 'loading'
 		loadReportHistory({
 			keyword,
-			pageNumber: pageNum,
+			pageNumber: pageNumber,
 			pageSize: pageSize?pageSize:10
 		}).then(res=>{
-			console.log(res, "历史记录")
+			if(res.code===0){
+				if(pageNumber===1){
+					list.value = res.data
+				}else{
+					list.value = [...list.value, ...res.data]
+				}
+				listCount.value = res.count
+				if(list.value.length === res.count){
+					status.value = 'nomore'
+				}else{
+					status.value = 'loadmore'
+				}
+				pageNum.value = pageNumber + 1;
+			}
 		})
 	}
-	
-	function searchMy(keyword, pageNum, pageSize){
+
+	function searchMy(keyword, pageNumber, pageSize){
+		status.value = 'loading'
 		loadMyReport({
 			keyword,
-			pageNumber: pageNum,
+			pageNumber: pageNumber,
 			pageSize: pageSize?pageSize:10
 		}).then(res=>{
-			console.log(res, "我的报告")
+			if(res.code===0){
+				if(pageNumber===1){
+					list2.value = res.data
+				}else{
+					list2.value = [...list2.value, ...res.data]
+				}
+				listCount2.value = res.count
+				if(list2.value.length === res.count){
+					status.value = 'nomore'
+				}else{
+					status.value = 'loadmore'
+				}
+				pageNum.value = pageNumber + 1;
+			}
 		})
 	}
-	
+
 	function toReportList(model, val) {
 		uni.setStorageSync("reportCate", categoryList.value[model].child);
 		uni.navigateTo({
 			url: `/pages/researchReport/reportList/reportList?model=${model}&value=${val}`
 		})
 	}
-	
+
 	async function init(){
 		const cateRes = await getReportCate();
 		if (cateRes.code === 0) {
@@ -220,148 +257,24 @@
 			reportStore.setReportCate(result);
 		}
 	}
-	
-	
-	const list = [
-		{
-			id: '01',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://img.shetu66.com/2023/10/21/1697901453723364.png',
-			free: 0, // 是否免费
-			memberFree: 0, // 是否会员免费
-			status: 0, // 是否购买
-		},
-		{
-			id: '02',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://img.shetu66.com/2023/12/13/1702403646894275.png',
-			free: 0, // 是否免费
-			memberFree: 0, // 是否会员免费
-			status: 1, // 是否购买
-		},
-		{
-			id: '03',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://img.shetu66.com/2023/10/16/1697397333933789.png',
-			free: 1, // 是否免费
-			memberFree: 0, // 是否会员免费
-			status: 0, // 是否购买
-		},
-		{
-			id: '04',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://img.shetu66.com/2023/10/24/1698106006242859.png',
-			free: 0, // 是否免费
-			memberFree: 1, // 是否会员免费
-			status: 0, // 是否购买
-		},
-		{
-			id: '05',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://static.fxbaogao.com/subject/cover/prod/361.jpg',
-			free: 0, // 是否免费
-			memberFree: 1, // 是否会员免费
-			status: 0, // 是否购买
-		},
-		{
-			id: '06',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://img.shetu66.com/2023/10/16/1697387221220874.png',
-			free: 0, // 是否免费
-			memberFree: 1, // 是否会员免费
-			status: 1, // 是否购买
-		},
-		{
-			id: '07',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://img.shetu66.com/2023/10/21/1697901453723364.png',
-			free: 0, // 是否免费
-			memberFree: 0, // 是否会员免费
-			status: 0, // 是否购买
-		},
-		{
-			id: '08',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://img.shetu66.com/2023/12/13/1702403646894275.png',
-			free: 0, // 是否免费
-			memberFree: 0, // 是否会员免费
-			status: 0, // 是否购买
-		},
-	]
-	
-	const list2 = [
-		{
-			id: '01',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://img.shetu66.com/2023/10/21/1697901453723364.png',
-			price: '9.9'
-		},
-		{
-			id: '02',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://img.shetu66.com/2023/12/13/1702403646894275.png',
-			price: '9.9'
-		},
-		{
-			id: '03',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://img.shetu66.com/2023/10/16/1697397333933789.png',
-			price: '9.9'
-		},
-		{
-			id: '04',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://img.shetu66.com/2023/10/24/1698106006242859.png',
-			price: '9.9'
-		},
-		{
-			id: '05',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://static.fxbaogao.com/subject/cover/prod/361.jpg',
-			price: '9.9'
-		},
-		{
-			id: '06',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://img.shetu66.com/2023/10/16/1697387221220874.png',
-			price: '9.9'
-		},
-		{
-			id: '07',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://img.shetu66.com/2023/10/21/1697901453723364.png',
-			price: '9.9'
-		},
-		{
-			id: '08',
-			title: '2024年11月广州市中介促成二手住宅市场交易简报',
-			time: '2023年8月8日',
-			image: 'https://img.shetu66.com/2023/12/13/1702403646894275.png',
-			price: '9.9'
-		},
-	]
-	
+
+
+
+
 	function onClickReport(report) {
 		uni.navigateTo({
 			url: `/pages/reportDetail/reportDetail?id=${report.id}&title=${report.title}`
 		})
 	}
 	
+	function loadMore(){
+		if(menuCurrent.value === 1){
+			searchHistory(searchForm.value.keyword, pageNum.value)
+		}else{
+			searchMy(searchForm.value.keyword, pageNum.value)
+		}
+	}
+
 	onLoad((load) => {
 		// console.log(load,"reporthome")
 		if (load.menuCurrent) {
@@ -374,24 +287,24 @@
 
 <style lang="scss" scoped>
 	$image-width: 230rpx;
-	
+
 	.container {
 		height: 100vh;
 		width: 100vw;
 		background-color: $uni-text-color-inverse;
-		
+
 		.header-box {
 			padding: 0 20rpx;
 			background-color: $uni-text-color-inverse;
 			@include topMagnet();
 		}
-		
+
 		.search-box {
 			margin-bottom: 20rpx;
 			::v-deep(.u-search) {
 				background-color: #e5e5e5;
 				border-radius: 50rpx;
-				
+
 				.u-action {
 					width: 18%;
 					background-color: $uni-color-primary;
@@ -405,7 +318,7 @@
 				}
 			}
 		}
-		
+
 		.list-box {
 			padding: 0 20rpx;
 			.list-item-box {
@@ -476,7 +389,7 @@
 				}
 			}
 		}
-		
+
 		.menus-box {
 			padding: 0 20rpx;
 			.menus-item-box {
@@ -513,7 +426,7 @@
 				}
 			}
 		}
-		
+
 		.bottom-block {
 			// height: 112rpx;
 			height: calc(112rpx + env(safe-area-inset-bottom, 0));
@@ -524,7 +437,7 @@
 			border: 1rpx solid #E9E9E9;
 			padding-bottom: calc(5rpx + env(safe-area-inset-bottom, 0));
 			@include bottomMagnet();
-			
+
 			.menu-box {
 				height: 100rpx;
 				display: flex;