Bladeren bron

修改文本框不能提交百分号的问题

yuanyiming 1 jaar geleden
bovenliggende
commit
3f828f1849

+ 1 - 1
pages/activityDetailNew/activityDetailNew.vue

@@ -497,7 +497,7 @@
 					lim: 6 //一次获取多少数据
 				}
 				this.$request('/selectApplyUser', 'POST', data).then(res => {
-					console.log('获取报名用户列表', res[0]);
+					// console.log('获取报名用户列表', res[0]);
 					this.stuNum = res[0].length
 					this.applyUserlist = []
 					let arr = res[0]

+ 2 - 2
pages/activityPageNew/activityPageNew.vue

@@ -182,7 +182,7 @@
 				}
 				// return console.log(data);
 				this.$request('/selectSearchdata', "get", data).then(res => {
-					console.log('常规', res);
+					// console.log('常规', res);
 					if (this.current == 0) {
 						this.pulist = res[0]
 					} else if (this.current == 1) {
@@ -295,7 +295,7 @@
 				}
 				// return console.log('获取常规', data);
 				this.$request('/selectActivity', "POST", data).then(res => {
-					console.log('常规', res[0]);
+					// console.log('常规', res[0]);
 					// this.pulist = res[0]
 					if (!res[0].length) {
 						this.puLoading = 2

+ 3 - 3
pages/index/index.vue

@@ -103,7 +103,7 @@
 		},
 		methods: {
 			gotoTab(e) {
-				console.log(e.currentTarget.dataset.index.tit);
+				// console.log(e.currentTarget.dataset.index.tit);
 				let aaa = e.currentTarget.dataset.index.tit
 				if (aaa == '活动专区') {
 					return uni.switchTab({
@@ -149,7 +149,7 @@
 
 			// 顶部大图跳转外部链接
 			gotoHome() {
-				console.log(this.adv);
+				// console.log(this.adv);
 				// const web = this.classList[this.current];
 				const url = this.adv.href
 				uni.navigateTo({
@@ -183,7 +183,7 @@
 				this.$request('/selectAdvertisement', "get", {
 					typ: 0
 				}).then(res => {
-					console.log(res);
+					// console.log(res);
 					this.adv=res[0][0]
 				})
 			}

+ 23 - 13
pages/login_Wechat/login_Wechat.vue

@@ -260,7 +260,7 @@
 						txt: val
 					}
 					this.$request('/selectLikeMajors', "get", data).then(res => {
-						console.log('模糊搜索专业', res);
+						// console.log('模糊搜索专业', res);
 						this.majorList = res[0]
 					})
 					// this.selectMajor(val)
@@ -272,7 +272,7 @@
 					this.$request('/selectLikeColleges', "get", {
 						txt: val
 					}).then(res => {
-						console.log(res);
+						// console.log(res);
 						this.colleges = res[0]
 					})
 					// this.selectMajor(val)
@@ -280,7 +280,7 @@
 			},
 			inpTxt: {
 				handler(val) {
-					console.log('val', val);
+					// console.log('val', val);
 					this.selectMajor(val)
 				}
 			}
@@ -403,12 +403,12 @@
 			},
 			// 根据选择的学校来进行显示专业
 			selectMajor(e) {
-				console.log('根据选择的学院来进行显示专业', e);
+				// console.log('根据选择的学院来进行显示专业', e);
 				let data = {
 					mid: e
 				}
 				this.$request('/selectMajors', "get", data).then(res => {
-					console.log('显示专业列表', res);
+					// console.log('显示专业列表', res);
 					// if (res[0].length === 0) {
 					// 	this.majorList[0] = {
 					// 		name: '此学校没有专业分类哦'
@@ -427,7 +427,7 @@
 				} = e.target
 				// console.log(value);
 				const newValue = value.replace(/\s*/g, '') // 只允许输入数字
-				console.log(newValue);
+				// console.log(newValue);
 
 				// if (newValue.length <= 11) {
 				this.userData.tel = newValue
@@ -442,7 +442,7 @@
 					txt: this.judgeNumber
 				}
 				this.$request('/selectStudentNumber', "Get", data).then(res => {
-					console.log('失去焦点查询学号工号', res);
+					// console.log('失去焦点查询学号工号', res);
 					if (res[0].length) {
 						let aaa = res[0][0]
 						if (aaa.cid !== null) {
@@ -613,14 +613,24 @@
 				// 	title: '请选择专业',
 				// 	icon: 'none'
 				// });
+				// var reg = /^1[3|4|5|6|7|8|9][0-9]{9}$/;
+				// if(!reg.test(this.userData.tel)){
+				// 	uni.showToast({
+				// 		title: '请输入正确的手机号格式',
+				// 		icon: 'none'
+				// 	});
+				// 	return
+				// }
+				// return
 				if (this.userData.tel.length != 11) return uni.showToast({
 					title: '号码不足11位,请检查',
 					icon: 'none'
 				});
 				this.userData.inpTxt = this.inpTxt
 				this.userData.majorInpTxt = this.majorInpTxt
-				this.userData.schName = this.stuName
-				this.userData.jorName = this.majorName
+				this.userData.username=encodeURIComponent(this.userData.username)
+				this.userData.schName = encodeURIComponent(this.stuName)
+				this.userData.jorName = encodeURIComponent(this.majorName)
 
 				// return console.log(this.userData);
 				let oId = uni.getStorageSync('oId')
@@ -667,7 +677,7 @@
 				uni.getUserProfile({
 					desc: "获取你的昵称、头像、地区及性别",
 					success: (res) => {
-						console.log("所有", res);
+						// console.log("所有", res);
 						this.avatarUrl = res.userInfo.avatarUrl; //获取微信头像
 
 					},
@@ -678,9 +688,9 @@
 				this.$request('/selectUserInfo', "POST", {
 					openid: uni.getStorageSync('oId')
 				}).then(res => {
-					console.log('获取渲染数据', res[0][0]);
+					// console.log('获取渲染数据', res[0][0]);
 					let data = res[0][0]
-					console.log(data);
+					// console.log(data);
 					if (!data) {
 						return
 					} else {
@@ -692,7 +702,7 @@
 
 				// 获取学院
 				this.$request('/selectColleges', "get", {}).then(res => {
-					console.log(res);
+					// console.log(res);
 					this.colleges = res[0]
 				})
 			}

+ 10 - 8
pages/mineEdit/mineEdit.vue

@@ -500,7 +500,7 @@
 					openid: this.$store.state.user.openid
 				}).then(res => {
 					// 假如简介为null
-					console.log('res[0][0].brief', res);
+					// console.log('res[0][0].brief', res);
 					if (!res[0][0].brief) {
 						res[0][0].brief = ''
 					}
@@ -516,7 +516,7 @@
 				})
 				// 获取学院
 				this.$request('/selectColleges', "get", {}).then(res => {
-					console.log(res);
+					// console.log(res);
 					this.colleges = res[0]
 				})
 			},
@@ -530,10 +530,12 @@
 				// console.log(' this.userData', this.userData);
 				this.userData.school = this.inpTxt
 				this.userData.spe = this.majorInpTxt
-				// delete this.userData.stuName;
-				// delete this.userData.majorName;
-				// this.userData.stuName=this.searchStudent
-				// this.userData.majorName=this.searchMajor
+				this.userData.username=encodeURIComponent(this.userData.username)
+				this.userData.stuName=encodeURIComponent(this.userData.stuName)
+				this.userData.majorName=encodeURIComponent(this.userData.majorName)
+				this.userData.brief=encodeURIComponent(this.userData.brief)
+				
+				
 				// return console.log('提交修改', this.userData);
 				this.$request('/updateUserInfo', "POST", this.userData).then(res => {
 					this.showPopupConfirm = true
@@ -541,7 +543,7 @@
 					this.$request('/selectUser', 'POST', {
 						oId: this.$store.state.user.openid
 					}).then(res => {
-						console.log('获取caozuo', res[0][0]);
+						// console.log('获取caozuo', res[0][0]);
 						this.$store.dispatch('asyncUpdateUser', res[0][0])
 					})
 					setTimeout(() => {
@@ -552,7 +554,7 @@
 			},
 			// 点击保存修改
 			saveInfo() {
-				console.log('点击保存修改', this.userData);
+				// console.log('点击保存修改', this.userData);
 				const value = this.$store.state.user.openid;
 				if (value == '') return uni.showToast({
 					title: '未登录',

+ 20 - 8
pages/msg/msg.vue

@@ -157,7 +157,7 @@
 				syslist: [],
 
 				showPopup: false,
-
+				adv: {},
 
 				current: 0, //消息页面切换
 				info1: "info1", //类名
@@ -175,9 +175,11 @@
 		methods: {
 			// 获取消息通知数据
 			gotoHome() {
-				const url = "https://mp.weixin.qq.com/s/QZEGcvBn3aW7aHirMFLBQA";
+				// const url = "https://mp.weixin.qq.com/s/QZEGcvBn3aW7aHirMFLBQA";
+				const url = this.adv.href
 				uni.navigateTo({
-					url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
+					url: "/pages/skipone/skipone?item=" + encodeURIComponent(JSON.stringify(url))
+					// url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
 				});
 				// uni.switchTab({
 				// 	url:'/pages/index/index'
@@ -191,7 +193,7 @@
 					lim: 15
 				}
 				this.$request('/selectMessage', "POST", data).then(res => {
-					console.log('获取消息通知数据', res);
+					// console.log('获取消息通知数据', res);
 					if (!res[0].length) {
 						this.clLoading = 2
 					} else {
@@ -210,7 +212,7 @@
 					lim: 15
 				}
 				this.$request('/selectMessage', "POST", data).then(res => {
-					console.log('获取系统通知数据', res);
+					// console.log('获取系统通知数据', res);
 					if (!res[0].length) {
 						this.sysLoading = 2
 					} else {
@@ -223,7 +225,7 @@
 			// 点击单个已读
 			readOneMsg(e) {
 				const data = e.currentTarget.dataset.id
-				console.log(data);
+				// console.log(data);
 
 				let a = {
 					openid: this.$store.state.user.openid, //用户id
@@ -232,7 +234,7 @@
 
 				if (data.isread == 0) {
 					this.$request('/updateOneIsRead', "POST", a).then(res => {
-						console.log(res);
+						// console.log(res);
 						this.getMag()
 						// 去除信息列表右上未读红点,current判断所在哪个消息列表
 						if (this.current == 0) {
@@ -318,7 +320,7 @@
 				this.$request('/selectUnreadMsg', "POST", {
 					oid: this.$store.state.user.openid
 				}).then(res => {
-					console.log('获取未读信息', res);
+					// console.log('获取未读信息', res);
 					// 未读提示红点重置为0,在后面赋值
 					this.msgn = 0
 					this.msgn2 = 0
@@ -348,8 +350,18 @@
 			swipeIndex(index) {
 				this.current = index.detail.current;
 			},
+			// 获取顶部大图
+			getAdv() {
+				this.$request('/selectAdvertisement', "get", {
+					typ: 0
+				}).then(res => {
+					// console.log(res);
+					this.adv = res[0][0]
+				})
+			}
 		},
 		onShow() {
+			this.getAdv()
 			// 消息通知
 			this.Msglist = []
 			//系统通知

+ 2 - 2
pages/ranking/ranking.vue

@@ -82,7 +82,7 @@
 			},
 			show(e) {
 				let data = e.currentTarget.dataset.e
-				console.log(data);
+				// console.log(data);
 				uni.showToast({
 					title: data,
 					icon: 'none'
@@ -121,7 +121,7 @@
 				this.$request('/selectAdvertisement', "get", {
 					typ: 1
 				}).then(res => {
-					console.log(res);
+					// console.log(res);
 					this.adv = res[0][0]
 				})
 			}

+ 3 - 3
pages/resource/resource.vue

@@ -167,7 +167,7 @@
 				}
 				// return console.log(data);
 				this.$request('/selectActSearch', "get", data).then(res => {
-					console.log('常规', res);
+					// console.log('常规', res);
 					if (this.current == 0) {
 						this.classList = res[0]
 					} else if (this.current == 1) {
@@ -233,7 +233,7 @@
 					lim: 30
 				}
 				this.$request('/selectResource', "POST", data).then(res => {
-					console.log('获取资源库', res);
+					// console.log('获取资源库', res);
 					if (!res[0].length) {
 						this.reLoading = 2
 					} else {
@@ -253,7 +253,7 @@
 					lim: 30
 				}
 				this.$request('/selectResource', "POST", data).then(res => {
-					console.log('获取精品慕课', res);
+					// console.log('获取精品慕课', res);
 					if (!res[0].length) {
 						this.teaLoading = 2
 					} else {

+ 1 - 1
pages/teachingList/teachingList.vue

@@ -73,7 +73,7 @@
 					lim: 15 //一次获取多少数据
 				}
 				this.$request('/selectActivity', "POST", data).then(res => {
-					console.log('获取数据', res[0]);
+					// console.log('获取数据', res[0]);
 					
 					if (!res[0].length) {
 						this.Loading = 2