Bladeren bron

修改一下

yuanyiming 1 jaar geleden
bovenliggende
commit
01fe3b0e73

+ 2 - 5
components/statusBar/statusBar.vue

@@ -10,17 +10,14 @@
 				</view>
 			</view>
 			<!-- app端 -->
-			<view class="nav" v-else :style="{height:customBar +'px'}">
+			<!-- <view class="nav" v-else :style="{height:customBar +'px'}">
 					<view v-if="item.btn" class="backBtnSty" style="position: fixed;transform: translate(0,-50%);" :style="{width:'30px',marginTop:appAllHeight/2 +'px'}">
-						<!-- <image @click="backIndex" src="../../static/img/back.png"  mode="aspectFill"></image> -->
 						<uni-icons @click="backIndex" type="back" size="20"></uni-icons>
 					</view>
-					<!-- 导航栏文字开始 -->
 					<view class="navTit" :style="{lineHeight:customBar+'px'}">
 						<view class="postTit">{{item.title}} </view>
 					</view>
-					<!-- 导航栏文字结束 -->
-			</view>
+			</view> -->
 	</view>
 	
 </template>

+ 2 - 1
manifest.json

@@ -63,7 +63,8 @@
         "setting" : {
             "urlCheck" : false
         },
-        "usingComponents" : true
+        "usingComponents" : true,
+        "__usePrivacyCheck__" : true
     },
     "mp-alipay" : {
         "usingComponents" : true

+ 41 - 8
pages/activityDetailNew/activityDetailNew.vue

@@ -28,8 +28,7 @@
 				<view class="ava" @click="gotoMorePer">
 					<u-avatar-group :urls="applyUserlist" maxCount='6' showMore size="35" :extraValue='stuNum'
 						gap="0.4"></u-avatar-group>
-					<view
-						style="font-size: 24rpx;
+					<view style="font-size: 24rpx;
 						font-weight: 400;
 						width: 200rpx;
 						color:rgba(0, 0, 0, 0.6);
@@ -218,7 +217,7 @@
 				provider: "weixin",
 				scene: "WXSceneSession",
 				type: 1,
-				summary: "我正在使用HBuilderX开发uni-app,赶紧跟我一起来体验!",
+				summary: "我正在使用丽湖双创小程序,赶紧跟我一起来体验!",
 				success: function(res) {
 					console.log("success:" + JSON.stringify(res));
 				},
@@ -268,6 +267,17 @@
 
 			// 申请加入弹窗
 			applyAdd() {
+				const value = this.$store.state.user.openid;
+				if (!value) {
+					uni.showToast({
+						title: '未登录,请登录',
+						icon: 'none'
+					})
+					setTimeout(() => {
+						this.goLog()
+					}, 1000)
+					return
+				}
 				// console.log('报名');
 				this.isAdd = 0
 				this.showPopup = true
@@ -304,6 +314,7 @@
 
 			// 确认报名操作
 			conf() {
+
 				this.showPopup = false
 				let data = {
 					oid: this.$store.state.user.openid, //用户id
@@ -388,7 +399,11 @@
 				})
 			},
 
-
+			goLog() {
+				uni.navigateTo({
+					url: "/pages/login_Wechat/login_Wechat",
+				});
+			},
 			//获取是否报名
 			btnEnroll() {
 				let data = {
@@ -403,6 +418,17 @@
 			},
 			// 收藏事件
 			coll() {
+				const value = this.$store.state.user.openid;
+				if (!value) {
+					uni.showToast({
+						title: '未登录,请登录',
+						icon: 'none'
+					})
+					setTimeout(() => {
+						this.goLog()
+					}, 1000)
+					return
+				}
 				// this.stopTimer=0
 				if (this.stopTimer) return uni.showToast({
 					icon: 'none',
@@ -484,8 +510,8 @@
 					console.log('获取报名用户列表', res[0]);
 					this.stuNum = res[0].length
 					this.applyUserlist = []
-					let arr=res[0]
-					arr=arr.slice(0,6)
+					let arr = res[0]
+					arr = arr.slice(0, 6)
 					arr.forEach(e => {
 						this.applyUserlist.push(e.avatar)
 					})
@@ -502,7 +528,6 @@
 			// 获取是否报名
 			this.btnEnroll()
 
-			// WebviewObject plus.webview.create( url, id, styles, extras );
 
 			// this.getActivity()
 			// 获取页面数据
@@ -512,8 +537,16 @@
 			// 获取是否订阅
 			// this.getSub()
 
-			// 获取报名人名单
+			// 获取报名人名单 
 			this.getUsers()
+			let curRoute = this.$mp.page.route //获取当前页面的路由信息
+			let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
+			console.log('routes', routes);
+			if (routes.length == 1) {
+				this.navbar.btn = 2
+			} else {
+				this.navbar.btn = 1
+			}
 		}
 	}
 </script>

+ 19 - 2
pages/activityPageNew/activityPageNew.vue

@@ -35,7 +35,8 @@
 			</view> -->
 		</view>
 
-		<swiper class="scroll-view-height" @change="swipeIndex" @transition='cutS' @animationfinish='ani'
+		<!-- <swiper class="scroll-view-height" @change="swipeIndex" @transition='cutS' @animationfinish='ani' -->
+		<swiper class="scroll-view-height" @change="swipeIndex"
 			:current="current" :duration="300">
 
 			<!-- 常规教研 -->
@@ -332,6 +333,22 @@
 				this.current = 2;
 			}
 		},
+		// 分享
+		onShareAppMessage() {
+		
+			uni.share({
+				provider: "weixin",
+				scene: "WXSceneSession",
+				type: 1,
+				summary: "我正在使用丽湖双创小程序,赶紧跟我一起来体验!",
+				success: function(res) {
+					console.log("success:" + JSON.stringify(res));
+				},
+				fail: function(err) {
+					console.log("fail:" + JSON.stringify(err));
+				}
+			});
+		},
 		onLoad() {
 
 		},
@@ -455,7 +472,7 @@
 				width: 136rpx;
 				height: 48rpx;
 				text-align: center;
-				font-family: 微软雅黑;
+				// font-family: 微软雅黑;
 			}
 		}
 

+ 16 - 0
pages/index/index.vue

@@ -154,6 +154,22 @@
 					url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
 				});
 			},
+			// 分享
+			onShareAppMessage() {
+			
+				uni.share({
+					provider: "weixin",
+					scene: "WXSceneSession",
+					type: 1,
+					summary: "我正在使用丽湖双创小程序,赶紧跟我一起来体验!",
+					success: function(res) {
+						console.log("success:" + JSON.stringify(res));
+					},
+					fail: function(err) {
+						console.log("fail:" + JSON.stringify(err));
+					}
+				});
+			},
 			goLog() {
 				uni.navigateTo({
 					url: "/pages/login_Wechat/login_Wechat",

+ 112 - 26
pages/login_Wechat/login_Wechat.vue

@@ -3,10 +3,20 @@
 		<statusBar :item='navBarData'></statusBar>
 		<view class="block">
 			<button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
-				<image class="avatar" :src="avatarUrl"></image>
+			<!-- <button class="avatar-wrapper" @click="getImg"> -->
+				<image class="avatar" :src="avatarUrl" ></image>
 			</button>
 		</view>
 
+		<view class="collpopul" v-if="popmsg">
+			<view class="contxt">
+				<!-- <image :src="i.collAoff?img1:img2" mode="aspectFill" style="width: 30rpx;height: 30rpx;">
+				</image> -->
+				登录成功
+				<!-- 收藏成功 -->
+			</view>
+		</view>
+
 		<!-- <view class="inp">
 			<view class="nc">昵称:</view>
 			<input type="nickname" class="weui-input" :value="nickname" @blur="inpvalue" placeholder="请输入昵称" />
@@ -65,17 +75,17 @@
 					</view>
 					<view class="txtcell">
 						<view class="" style="width: 100rpx;">
-							<text class="dian">*</text><text class="celTit">学</text>
+							<text class="dian">*</text><text class="celTit">学</text>
 						</view>
 						<view class="pickerBlock" @click="show">
 							<view class="" style="position: relative;">
 								<view class="">
-									{{ !stuName?'请选择学':stuName }}
+									{{ !stuName?'请选择学':stuName }}
 								</view>
 
 								<view class="stuListSty" v-if="isshow">
 									<view class="Usearch">
-										<u-search placeholder="搜索学" :showAction="false" shape="square"
+										<u-search placeholder="搜索学" :showAction="false" shape="square"
 											v-model="searchStudent"></u-search>
 										<view class="UsearchBtn" @click.stop="typeIn(0)">
 											手动录入
@@ -111,7 +121,7 @@
 									</view>
 									<scroll-view scroll-y="true" show-scrollbar="true" class="list">
 										<view class="listcon" v-if="!majorList.length">
-											此学暂时没有专业分类哦
+											此学暂时没有专业分类哦
 										</view>
 										<view id="demo1" class="listcon" @click.stop="addmajor" :data-jor="i"
 											v-for="(i,index) in majorList" :key="index">{{i.name}}</view>
@@ -149,7 +159,7 @@
 			<view style="width: 600rpx;box-sizing: border-box;padding: 40px 20rpx; padding-bottom: 30px;">
 				<view class="" style="display: flex;align-items: center;">
 					<!-- <text>{{ typyInall?'专业':'学校' }} :</text> -->
-					<u--input :placeholder="typyInall?'请输入专业':'请输入学'" border="surround" v-model="typyInCon"></u--input>
+					<u--input :placeholder="typyInall?'请输入专业':'请输入学'" border="surround" v-model="typyInCon"></u--input>
 				</view>
 				<view style="display: flex;width: 100%;justify-content: space-around;margin-top: 20rpx;">
 					<view class="typyInbtn" @click="popupclose">
@@ -175,7 +185,7 @@
 
 				searchStudent: '', //学校搜索栏
 				searchMajor: '', //专业搜索栏
-
+				popmsg: false,
 
 
 				logbtn: 'logbtn',
@@ -205,7 +215,7 @@
 
 				navBarData: {
 					title: '登录',
-					btn: 1 //判断是否显示返回按钮
+					btn: 2 //判断是否显示返回按钮
 				},
 
 				btnCol: [],
@@ -283,8 +293,8 @@
 			popupaffirm() {
 				if (!this.typyInall) {
 					if (!this.typyInCon) return uni.showToast({
-						title:'请输入学校',
-						icon:'none',
+						title: '请输入学院',
+						icon: 'none',
 					})
 
 					this.stuName = this.typyInCon
@@ -298,8 +308,8 @@
 					this.typyInCon = ''
 				} else {
 					if (!this.typyInCon) return uni.showToast({
-						title:'请输入专业',
-						icon:'none',
+						title: '请输入专业',
+						icon: 'none',
 					})
 
 					this.majorName = this.typyInCon
@@ -370,7 +380,7 @@
 				// 学校未选择则提示
 				if (!this.stuName) {
 					uni.showToast({
-						title: '请先选择学',
+						title: '请先选择学',
 						icon: 'none',
 						duration: 1000
 					});
@@ -392,7 +402,7 @@
 			},
 			// 根据选择的学校来进行显示专业
 			selectMajor(e) {
-				console.log('根据选择的学来进行显示专业', e);
+				console.log('根据选择的学来进行显示专业', e);
 				let data = {
 					mid: e
 				}
@@ -425,7 +435,7 @@
 			},
 			// 失去焦点查询学号工号
 			judgeNum() {
-				if(!this.judgeNumber) return
+				if (!this.judgeNumber) return
 				let opid = uni.getStorageSync('oId')
 				let data = {
 					txt: this.judgeNumber
@@ -476,10 +486,11 @@
 				const {
 					avatarUrl
 				} = e.detail
-
+				// this.avatarUrl = avatarUrl
+				// console.log(avatarUrl)
 				let that = this
 				const uploadTask = uni.uploadFile({
-					url: 'http://139.159.246.165:7006/img', // post请求地址
+					url: 'http://127.0.0.1:7334/img', // post请求地址
 					// url: 'https://cxcy.ssti.net.cn/api/UploadFirmFile', // post请求地址
 					// filePath: tempFilePaths,
 					filePath: avatarUrl,
@@ -489,8 +500,9 @@
 						// 'Content-Type': 'multipart/form-data',
 					},
 					success: function(res) {
-						console.log('上传图片', res);
-						that.avatarUrl = res.data
+						let img = JSON.parse(res.data)
+						console.log('上传图片', img);
+						that.avatarUrl = img.fileUrl
 					},
 					fail: function(uploadFileFail) {
 						console.log('Error:', uploadFileFail.data);
@@ -537,9 +549,13 @@
 						}).then(res => {
 							console.log('已注册过直接登录', res[0]);
 							this.$store.dispatch('asyncUpdateUser', res[0][0])
-							uni.switchTab({
-								url: '/pages/index/index'
-							})
+							this.popmsg = true
+							setTimeout(() => {
+								uni.switchTab({
+									url: '/pages/index/index'
+								})
+							}, 1000)
+
 						})
 					})
 				} else {
@@ -565,7 +581,7 @@
 					icon: 'none'
 				});
 				if (!this.stuName) return uni.showToast({
-					title: '请选择学',
+					title: '请选择学',
 					icon: 'none'
 				});
 				// if (this.majorInpTxt == '') return uni.showToast({
@@ -621,6 +637,18 @@
 			isDui() {
 				this.isShow = !this.isShow
 			},
+			//获取用户信息(授权)
+			getImg() {
+				uni.getUserProfile({
+					desc: "获取你的昵称、头像、地区及性别",
+					success: (res) => {
+						console.log("所有", res);
+						this.avatarUrl = res.userInfo.avatarUrl; //获取微信头像
+
+					},
+					fail() {}
+				})
+			},
 			getdata() {
 				this.$request('/selectUserInfo', "POST", {
 					openid: uni.getStorageSync('oId')
@@ -632,7 +660,7 @@
 						return
 					} else {
 						this.isLogin = true
-						this.avatarUrl = data.avatar
+						// this.avatarUrl = data.avatar
 						this.nickname = data.username
 					}
 				})
@@ -658,10 +686,68 @@
 		height: 100vh;
 		background-color: #ffffff;
 	}
-	::v-deep .u-safe-bottom{
+
+	::v-deep .u-safe-bottom {
 		display: none;
 	}
 
+	.collpopul {
+		position: absolute;
+		padding: 0 30rpx;
+		background-color: #fff;
+		top: 10%;
+		box-shadow: 0rpx 10rpx 10rpx 5rpx rgba(0, 0, 0, .1);
+		z-index: 100;
+		width: 650rpx;
+		height: 90rpx;
+		left: 50%;
+		transform: translate(-50%, 0);
+		border-radius: 30rpx;
+		display: flex;
+		align-items: center;
+		// animation: collpopul 1s cubic-bezier(0,0,0.25,1) forwards;
+
+		.contxt {
+			flex: 1;
+			font-weight: 580;
+			font-size: 30rpx;
+			display: flex;
+			align-items: center;
+
+			image {
+				padding-right: 10rpx;
+			}
+		}
+
+		.goMore {
+			// width: 120rpx;
+			display: flex;
+			// height: 35rpx;
+			height: 100%;
+			line-height: 30rpx;
+			align-items: center;
+			color: #F44265;
+			font-size: 30rpx;
+			font-weight: bold;
+		}
+	}
+
+	@keyframes collpopul {
+		0% {
+			// background: red;
+			top: 0;
+		}
+
+		100% {
+			// background: red;
+			top: 15%;
+		}
+
+		// 100%{
+		// 	opacity: 0;
+		// }
+	}
+
 	.typyInbtn {
 		box-sizing: border-box;
 		padding: 10rpx 60rpx;
@@ -681,7 +767,7 @@
 		color: #E7E7E7;
 		margin-right: 20px;
 	}
-	
+
 
 	.shade {
 		position: absolute;

+ 16 - 0
pages/mine/mine.vue

@@ -255,6 +255,22 @@
 			},
 
 		},
+		// 分享
+		onShareAppMessage() {
+		
+			uni.share({
+				provider: "weixin",
+				scene: "WXSceneSession",
+				type: 1,
+				summary: "我正在使用丽湖双创小程序,赶紧跟我一起来体验!",
+				success: function(res) {
+					console.log("success:" + JSON.stringify(res));
+				},
+				fail: function(err) {
+					console.log("fail:" + JSON.stringify(err));
+				}
+			});
+		},
 		onShow() {
 			// if (!this.$store.state.user.openid) {
 			this.getMag() // 调用app.js中的方法

+ 1 - 1
pages/mineCollNew/mineCollNew.vue

@@ -424,7 +424,7 @@
 				width: 136rpx;
 				height: 48rpx;
 				text-align: center;
-				font-family: 微软雅黑;
+				// font-family: 微软雅黑;
 			}
 		}
 

+ 34 - 34
pages/mineEdit/mineEdit.vue

@@ -47,16 +47,16 @@
 			<view class="setPicker">
 				<!-- <view class="content"> -->
 				<view class="edit_title">
-					<text>学</text>
+					<text>学</text>
 				</view>
 				<view class="InpLeft" @click="show">
 					<view class="" style="position: relative;">
 						<view class="">
-							{{ !userData.stuName?'请选择学':userData.stuName }}
+							{{ !userData.stuName?'请选择学':userData.stuName }}
 						</view>
 						<view class="stuListSty" v-if="isshow">
 							<view class="Usearch">
-								<u-search placeholder="搜索学" :showAction="false" shape="square"
+								<u-search placeholder="搜索学" :showAction="false" shape="square"
 									v-model="searchStudent"></u-search>
 								<view class="UsearchBtn" @click.stop="typeIn(0)">
 									手动录入
@@ -93,7 +93,7 @@
 							</view>
 							<scroll-view scroll-y="true" show-scrollbar="true" class="list">
 								<view class="listcon" v-if="!majorList.length">
-									此学暂时没有专业分类哦
+									此学暂时没有专业分类哦
 								</view>
 								<view id="demo1" class="listcon" @click.stop="addmajor" :data-jor="i"
 									v-for="(i,index) in majorList" :key="i">{{i.name}}</view>
@@ -191,7 +191,7 @@
 			<view style="width: 600rpx;box-sizing: border-box;padding: 40px 20rpx; padding-bottom: 30px;">
 				<view class="" style="display: flex;align-items: center;">
 					<!-- <text>{{ typyInall?'专业':'学校' }} :</text> -->
-					<u--input :placeholder="typyInall?'请输入专业':'请输入学'" border="surround" v-model="typyInCon"></u--input>
+					<u--input :placeholder="typyInall?'请输入专业':'请输入学'" border="surround" v-model="typyInCon"></u--input>
 				</view>
 				<view style="display: flex;width: 100%;justify-content: space-around;margin-top: 20rpx;">
 					<view class="typyInbtn" @click="popupclose">
@@ -331,7 +331,7 @@
 			popupaffirm() {
 				if (!this.typyInall) {
 					if (!this.typyInCon) return uni.showToast({
-						title: '请输入学',
+						title: '请输入学',
 						icon: 'none',
 					})
 
@@ -389,7 +389,7 @@
 				// console.log('专业list显示与隐藏',this.inpTxt);
 				if (!this.userData.stuName) {
 					uni.showToast({
-						title: '请先选择学',
+						title: '请先选择学',
 						icon: 'none',
 						duration: 1000
 					});
@@ -460,32 +460,32 @@
 					sourceType: ['album', 'camera'], //从相册选择或者拍照
 					success: (res) => {
 						const tempFilePaths = res.tempFilePaths[0];
-
-						const uploadTask = uni.uploadFile({
-							url: 'http://139.159.246.165:7006/img', // post请求地址
-							filePath: tempFilePaths,
-							name: 'file', // 待确认
-							header: {
-								// 不要写这个不然报错
-								// 'Content-Type': 'multipart/form-data',
-							},
-							formData: {
-								// 携带的用户数据
-								// userId: that.$store.getters.getUser._id, // 用户ID
-							},
-							success: function(res) {
-								// console.log(res);
-								that.userData.avatar = res.data
-
-							},
-							fail: function(uploadFileFail) {
-								console.log('Error:', uploadFileFail.data);
-							},
-							complete: () => {
-								// 接口调用结束的回调函数(调用成功、失败都会执行)
-								// console.log('Complete:');
-							}
-						});
+						that.userData.avatar = tempFilePaths
+						// const uploadTask = uni.uploadFile({
+						// 	url: 'http://139.159.246.165:7006/img', // post请求地址
+						// 	filePath: tempFilePaths,
+						// 	name: 'file', // 待确认
+						// 	header: {
+						// 		// 不要写这个不然报错
+						// 		// 'Content-Type': 'multipart/form-data',
+						// 	},
+						// 	formData: {
+						// 		// 携带的用户数据
+						// 		// userId: that.$store.getters.getUser._id, // 用户ID
+						// 	},
+						// 	success: function(res) {
+						// 		// console.log(res);
+						// 		that.userData.avatar = res.data
+
+						// 	},
+						// 	fail: function(uploadFileFail) {
+						// 		console.log('Error:', uploadFileFail.data);
+						// 	},
+						// 	complete: () => {
+						// 		// 接口调用结束的回调函数(调用成功、失败都会执行)
+						// 		// console.log('Complete:');
+						// 	}
+						// });
 
 
 					}
@@ -568,7 +568,7 @@
 
 				if (!this.userData.stuName) {
 					return uni.showToast({
-						title: '学不能为空',
+						title: '学不能为空',
 						icon: 'none'
 					})
 				}

+ 1 - 1
pages/msg/msg.vue

@@ -454,7 +454,7 @@
 				width: 136rpx;
 				height: 48rpx;
 				text-align: center;
-				font-family: 微软雅黑;
+				// font-family: 微软雅黑;
 			}
 		}
 

+ 11 - 8
pages/resource/resource.vue

@@ -32,7 +32,8 @@
 			</view> -->
 		</view>
 
-		<swiper class="scroll-view-height" @change="swipeIndex" @transition='cutS' @animationfinish='ani'
+		<!-- <swiper class="scroll-view-height" @change="swipeIndex" @transition='cutS' @animationfinish='ani' -->
+		<swiper class="scroll-view-height" @change="swipeIndex"
 			:current="current" :duration="300">
 			<swiper-item>
 				<scroll-view scroll-y="true" :refresher-enabled='refevent' :refresher-triggered="trigger"
@@ -83,7 +84,6 @@
 					btn: 0,
 				},
 
-
 				indexId: 1,
 				current: 0, //页面切换
 				info1: "info1", //类名
@@ -160,7 +160,7 @@
 
 				let data = {
 					openid: uni.getStorageSync('oId'),
-					txt: this.searchText,
+					txt: encodeURIComponent(this.searchText),
 					ty: this.current,
 					// page: this.Searchpage,
 					// lim: 15
@@ -192,9 +192,9 @@
 					this.classList2 = []
 					this.teaLoading = 0 //0默认值  1加载中 2没有更多了
 					this.teacurrentPage = 1
+					this.searchText = ''
 					this.getteaList()
 				}
-				this.searchText = ''
 
 
 				this.getreList()
@@ -212,13 +212,15 @@
 				this.classList2 = []
 				this.teaLoading = 0 //0默认值  1加载中 2没有更多了
 				this.teacurrentPage = 1
+				
 				if (this.searchText !== '') {
 					this.classList = []
 					this.reLoading = 0 //0默认值  1加载中 2没有更多了
 					this.recurrentPage = 1 //页数
+					this.searchText = ''
 					this.getreList()
 				}
-				this.searchText = ''
+				
 				this.getteaList()
 
 			},
@@ -228,7 +230,7 @@
 					openid: uni.getStorageSync('oId'),
 					ty: 0,
 					page: this.recurrentPage,
-					lim: 15
+					lim: 30
 				}
 				this.$request('/selectResource', "POST", data).then(res => {
 					console.log('获取资源库', res);
@@ -248,7 +250,7 @@
 					openid: uni.getStorageSync('oId'),
 					ty: 1,
 					page: this.teacurrentPage,
-					lim: 15
+					lim: 30
 				}
 				this.$request('/selectResource', "POST", data).then(res => {
 					console.log('获取精品慕课', res);
@@ -284,6 +286,7 @@
 			},
 
 			swipeIndex(index) {
+				
 				this.current = index.detail.current;
 				if (this.searchText !== '') {
 					this.selectSearchdata()
@@ -385,7 +388,7 @@
 				width: 136rpx;
 				height: 48rpx;
 				text-align: center;
-				font-family: 微软雅黑;
+				// font-family: 微软雅黑;
 			}
 		}