Ver código fonte

修复bug:1.点击通知等不用登录;2.logo图片大小兼容性问题;3.登陆页面默认账号清除;4.注册;5.研究报告搜索

littleblue55 14 horas atrás
pai
commit
dbf68cc3cc

+ 43 - 27
pages/index/index.vue

@@ -2,8 +2,7 @@
 	<view class="container" :style="{backgroundColor: `${backgroundColor}`}">
 		<u-navbar :is-back="false" title="" :style="{backgroundColor: `${backgroundColor}`}" :border-bottom="false">
 			<view class="slot-wrap">
-				<image :src="`${FILE_URL}/login-icon.png`"
-					mode="aspectFit" style="width: 300rpx;"></image>
+				<image :src="`${FILE_URL}/login-icon.png`" mode="aspectFit" style="width: 300rpx;"></image>
 			</view>
 		</u-navbar>
 		<view class="page-content">
@@ -25,20 +24,20 @@
 			<u-card padding="20" margin="0rpx 0rpx 30rpx" border-radius="20"
 				box-shadow="0px 2px 5px rgba(0, 0, 0, 0.1)">
 				<template v-slot:head>
-					<u-section title="课程预告" sub-title="查看更多" sub-color="#000000" @click="toPage('/pages/goOnEdu/index')"></u-section>
+					<u-section title="课程预告" sub-title="查看更多" sub-color="#000000"
+						@click="toPage('/pages/goOnEdu/index')"></u-section>
 				</template>
 				<template v-slot:body>
-					<lg-swiper v-if="courseList.length!=0"
-					:sildeItems="courseList"
-					@swiperClick="swiperClick"
-					image="courseImg" title="courseName"></lg-swiper>
+					<lg-swiper v-if="courseList.length!=0" :sildeItems="courseList" @swiperClick="swiperClick"
+						image="courseImg" title="courseName"></lg-swiper>
 					<u-empty text="暂无内容" mode="data" v-else></u-empty>
 				</template>
 			</u-card>
 			<u-card padding="30" margin="0rpx 0rpx 30rpx" border-radius="20"
 				box-shadow="0px 2px 5px rgba(0, 0, 0, 0.1)">
 				<template v-slot:head>
-					<u-section title="研究报告" sub-title="查看更多" sub-color="#000000" @click="toPage('/pages/researchReport/reportHome/reportHome')"></u-section>
+					<u-section title="研究报告" sub-title="查看更多" sub-color="#000000"
+						@click="toPage('/pages/researchReport/reportHome/reportHome')"></u-section>
 				</template>
 				<template v-slot:body>
 					<view v-if="reportList.length!=0">
@@ -51,8 +50,9 @@
 									<text class="item-content-type">{{data.type}}</text>
 								</view>
 								<view class="item-button">
-									<view v-if="data.viewMode==='1'" class="func-box" style="justify-content: flex-end;">
-										<view class="button free" >免费</view>
+									<view v-if="data.viewMode==='1'" class="func-box"
+										style="justify-content: flex-end;">
+										<view class="button free">免费</view>
 									</view>
 									<view v-else-if="data.viewMode==='2' && isMember" class="func-box">
 										<view class="price">¥{{ data.price }}元</view>
@@ -71,13 +71,15 @@
 											{{data.hasBuy ? '已购买' : '立即购买'}}
 										</view>
 									</view>
-									<view v-else-if="data.viewMode==='3' && data.price===data.priceMember" class="func-box">
+									<view v-else-if="data.viewMode==='3' && data.price===data.priceMember"
+										class="func-box">
 										<view class="price">¥{{ data.price }}元</view>
 										<view :class="['button', data.hasBuy ? 'free' : 'buy']">
 											{{data.hasBuy ? '已购买' : '立即购买'}}
 										</view>
 									</view>
-									<view v-else-if="data.viewMode==='3' && data.price!==data.priceMember" class="func-box">
+									<view v-else-if="data.viewMode==='3' && data.price!==data.priceMember"
+										class="func-box">
 										<view style="flex: 0 0 auto;display: flex;align-items: center;">
 											<view class="member-free">
 												{{`会员:${data.priceMember}元`}}
@@ -105,10 +107,8 @@
 			</view>
 		</u-modal>
 		<!-- 与包裹页面所有内容的元素u-page同级,且在它的下方 -->
-		<u-tabbar v-model="tabbarCurrentIndex"
-		:list="tabbarList" icon-size="50"
-		:active-color="tabbarActiveColor"
-		:inactive-color="tabbarInactiveColor"></u-tabbar>
+		<u-tabbar v-model="tabbarCurrentIndex" :list="tabbarList" icon-size="50" :active-color="tabbarActiveColor"
+			:inactive-color="tabbarInactiveColor"></u-tabbar>
 	</view>
 </template>
 
@@ -141,7 +141,9 @@
 	} from '@/api/user.js'
 	import configService from '@/utils/baseurl.js'
 	const FILE_URL = configService.FILE_URL;
-	import { useTabbarStore } from '@/store/tabbarStore.js'
+	import {
+		useTabbarStore
+	} from '@/store/tabbarStore.js'
 	const tabbarStore = useTabbarStore()
 	// 底部导航栏数据
 	const tabbarList = computed(() => {
@@ -211,6 +213,7 @@
 	// 首页-导航栏
 	const navList = ref([{
 			id: 'notice',
+			isLogin: false,
 			title: '通知公告',
 			icon: 'icon-xiaoxitongzhi',
 			url: '/pages/notice/notice/notice',
@@ -220,6 +223,7 @@
 		{
 			id: 'dynamic',
 			title: '协会动态',
+			isLogin: false,
 			icon: 'icon-xinxisousuo-01',
 			url: '/pages/dynamic/dynamic/dynamic',
 			toOtherApp: false,
@@ -228,6 +232,7 @@
 		{
 			id: 'guide',
 			title: '办事指引',
+			isLogin: false,
 			icon: 'icon-caidanguanli',
 			url: '/pages/guide/guide/guide',
 			toOtherApp: false,
@@ -236,6 +241,7 @@
 		{
 			id: 'edu',
 			title: '继续教育',
+			isLogin: true,
 			icon: 'icon-xueshimao1',
 			url: '/pages/goOnEdu/index',
 			toOtherApp: false,
@@ -243,6 +249,7 @@
 		},
 		{
 			id: 'level',
+			isLogin: true,
 			title: '水平认证',
 			icon: 'icon-zhengshu-copy',
 			url: '跳转页面的路径',
@@ -252,6 +259,7 @@
 		{
 			id: 'report',
 			title: '研究报告',
+			isLogin: true,
 			icon: 'icon-circular',
 			url: '/pages/researchReport/reportHome/reportHome',
 			toOtherApp: false,
@@ -259,6 +267,7 @@
 		},
 		{
 			id: 'index',
+			isLogin: true,
 			title: '经理人指数',
 			icon: 'icon-zhishu',
 			url: '跳转页面的路径',
@@ -267,6 +276,7 @@
 		},
 		{
 			id: 'pay',
+			isLogin: true,
 			title: '会费缴交',
 			icon: 'icon-jinqian-jiage',
 			url: '跳转页面的路径',
@@ -284,10 +294,13 @@
 			console.log("跳转至其他小程序", data.otherAppId)
 			return
 		}
-		if (!authStore.isAuthenticated) {
-			loginModal.value = true
-			return
+		if (data.isLogin) {
+			if (!authStore.isAuthenticated) {
+				loginModal.value = true
+				return
+			}
 		}
+
 		uni.navigateTo({
 			url: data.url
 		})
@@ -307,8 +320,9 @@
 			url: url
 		})
 	}
-	const itemClick = (data) =>{
+	const itemClick = (data) => {
 		// console.log("轮播图swiper", data)
+
 		if (!authStore.isAuthenticated) {
 			loginModal.value = true
 			return
@@ -371,13 +385,13 @@
 		})
 	}
 
-	function toReport(id, title){
+	function toReport(id, title) {
 		if (!authStore.isAuthenticated) {
 			loginModal.value = true
 			return
 		}
 		uni.navigateTo({
-			url:"/pages/reportDetail/reportDetail?id="+id+"&title="+title
+			url: "/pages/reportDetail/reportDetail?id=" + id + "&title=" + title
 		})
 	}
 
@@ -407,7 +421,7 @@
 			if (!isUserInfo) {
 				initUser();
 			} else {
-				isMember.value = authStore.userInfo.isMember==='0'?false:true;
+				isMember.value = authStore.userInfo.isMember === '0' ? false : true;
 			}
 		}
 
@@ -424,11 +438,13 @@
 	.slot-wrap {
 		padding-left: 20rpx;
 	}
-	.menu-item{
-		.iconfont{
+
+	.menu-item {
+		.iconfont {
 			font-size: 60rpx;
 		}
 	}
+
 	.grid-text {
 		font-size: 28rpx;
 		margin-top: 4rpx;
@@ -643,4 +659,4 @@
 			color: $uni-text-color;
 		}
 	}
-</style>
+</style>

+ 5 - 1
pages/initial/initial.vue

@@ -3,7 +3,7 @@
 		<view class="app-login">
 			<view class="app-icon u-m-b-30 ">
 				<image src="http://www.gzrea.org.cn:8543/icon/wxmp/login-icon.png"
-					mode="aspectFit" style="height: 40px;"></image>
+					mode="aspectFit" style="height: 80rpx;"></image>
 			</view>
 			<view class="app-title u-m-b-60">
 				欢迎使用会员中心系统小程序
@@ -168,6 +168,10 @@
 	}
 
 	.app-icon {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		height: 90rpx;
 		text-align: center;
 	}
 

+ 9 - 4
pages/login/login.vue

@@ -3,7 +3,7 @@
 		<view class="app-login">
 			<view class="app-icon mb-30">
 				<image :src="`${FILE_URL}/login-icon.png`"
-					mode="aspectFit" style="height: 40px;"></image>
+					mode="aspectFit" style="height: 80rpx;"></image>
 			</view>
 			<view class="app-title mb-30">
 				欢迎使用会员中心系统小程序
@@ -152,13 +152,13 @@
 				// ----验证码 end -----
 				loginType: "phone",
 				phoneForm: {
-					phone: '18320082803',
+					phone: '',
 					captcha: '',
 					captchaUuid: ''
 				},
 				userNameForm: {
-					username: "纪学卫",
-					password: "123456"
+					username: "",
+					password: ""
 				},
 				userBook: false, //协议
 				redirect: null
@@ -552,6 +552,11 @@
 	}
 
 	.app-icon {
+		// text-align: center;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		height: 90rpx;
 		text-align: center;
 	}
 

+ 6 - 6
pages/register/register.vue

@@ -147,12 +147,12 @@
 					form.password = encryptAESCBC(form.password);
 					form.checkPwd = encryptAESCBC(form.checkPwd);
 					register(form).then(res => {
-						if (res?.token) {
-							this.useAuthStore.setAuthToken(res.token);
-							this.useAuthStore.setUserInfo({
-								userId,
-								zhangHao
-							})
+						if (res?.data) {
+							this.useAuthStore.setAuthToken(res.data.token);
+							// this.useAuthStore.setUserInfo({
+							// 	userId,
+							// 	zhangHao
+							// })
 							msgSuccess("注册成功");
 							this.initUser()
 							// setTimeout(() => {

+ 1 - 1
pages/researchReport/reportList/reportList.vue

@@ -3,7 +3,7 @@
 		<view class="header-box">
 			<view class="search-box">
 				<u-search v-model="searchForm.keyword" :clearabled="true" bg-color="#E5E5E5"
-					:input-style="searchInputStyle" placeholder="搜索您想要的内容" @search="toSearch"></u-search>
+					:input-style="searchInputStyle" placeholder="搜索您想要的内容" @search="toSearch" @custom="toSearch"></u-search>
 			</view>
 			<view class="tab-box">
 				<u-tabs name="label" :list="searchType" :is-scroll="true" v-model="searchForm.type"

+ 1 - 1
utils/request.js

@@ -39,7 +39,7 @@ const request = config => {
 					showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
 						if (res.confirm) {
 							uni.reLaunch({
-								url: '/pages/initial/initial'
+								url: '/pages/login/login'
 							});
 						}
 					});