Browse Source

Signed-off-by: liuboyan <632697560@qq.com>
bug

liuboyan 4 years ago
parent
commit
34e83c6e53

+ 23 - 39
pages/login/index.vue

@@ -14,8 +14,8 @@
 				</u-cell-group>
 				<u-button type="warning" :ripple="true" :custom-style="{...customStyle, margin: '10px 0'}" @click="login()">登录</u-button>
 				<u-button type="warning" :ripple="true" :custom-style="{...customStyle, margin: '10px 0'}" @click="login1()">app微信授权登录</u-button>
-				<u-button type="warning" :ripple="true" :custom-style="{...customStyle, backgroundColor: '#07c160'}" open-type="getUserInfo"
-				 @getuserinfo="getUserinfoWechat" withCredentials="true">微信一键登录</u-button>
+				<u-button type="warning" :ripple="true" :custom-style="{...customStyle, backgroundColor: '#07c160'}" open-type="getPhoneNumber"
+				 @getphonenumber="getUserinfoWechat" withCredentials="true">微信一键登录</u-button>
 			</view>
 		</u-card>
 		<u-top-tips ref="uTips"></u-top-tips>
@@ -83,59 +83,43 @@
 					})
 				})
 			},
-			login1() {
+			loginApp() {
 				let that = this
 				uni.login({
 					provider: 'weixin',
-					success: function(loginRes) {
+					success: (loginRes) => {
 						uni.getUserInfo({
 							provider: 'weixin',
-							success: function(infoRes) {
-							}
+							success: (infoRes) => {}
 						});
 					}
 				});
 			},
 			getUserinfoWechat(data) {
-				uni.getProvider({
-					service: 'oauth',
+				uni.login({
+					provider: 'weixin',
 					success: (res) => {
-						if (~res.provider.indexOf('weixin')) {
-							uni.login({
-								provider: 'weixin',
-								success: (res2) => {
-									let wxLoginData = {
-										code: res2.code,
-										encryptedData: data.detail.encryptedData,
-										iv: data.detail.iv,
-										// shareParams: uni.getStorageSync('shareParams')
-									}
-									uni.setStorage({
-										key: 'wxLoginData',
-										data: wxLoginData
-									})
-									this.getUserInfo(wxLoginData)
-								},
-								fail: () => {
-									this.$refs.uTips.show({
-										title: '微信登录授权失败',
-										type: 'warning',
-									})
-								}
-							})
-						} else {
-							this.$refs.uTips.show({
-								title: '请先安装微信或升级版本',
-								type: 'warning',
-							})
+						let wxLoginData = {
+							code: res.code,
+							encryptedData: data.target.encryptedData,
+							iv: data.target.iv,
 						}
+						uni.setStorage({
+							key: 'wxLoginData',
+							data: wxLoginData
+						})
+						this.getUserInfo(wxLoginData)
+					},
+					fail: () => {
+						this.$refs.uTips.show({
+							title: '微信登录授权失败',
+							type: 'warning',
+						})
 					}
-				});
+				})
 			},
 			// 发请求获取个人数据
 			getUserInfo(wxLoginData) {
-				// console.log(wxLoginData)
-				// return
 				NET.request(API.wxLogin, wxLoginData, 'POST').then(res => {
 					uni.setStorage({
 						key: 'token',

+ 41 - 9
pagesClass/addClassForm.vue

@@ -4,6 +4,12 @@
 			<u-form-item label="班级名称" prop="name" required>
 				<u-input v-model="form.name" placeholder="请输入班级名称" />
 			</u-form-item>
+			<u-form-item label="课程周期结束时间" prop="endDate" right-icon="arrow-right" required @click.native="endDateShow = true">
+				<u-input v-model="form.endDate" placeholder="请选择课程周期结束时间" disabled @click="endDateShow = true" />
+			</u-form-item>
+			<u-form-item label="课程周期开始时间" prop="startDate" right-icon="arrow-right" required @click.native="startDateShow = true">
+				<u-input v-model="form.startDate" placeholder="请选择课程周期开始时间" disabled @click="startDateShow = true" />
+			</u-form-item>
 			<u-form-item label="上课时间" prop="timeReqList" required label-position="top"></u-form-item>
 			<u-swipe-action :index="index" v-for="(item, index) in form.timeReqList" :key="item.id" @click="deleteDate" :options="options">
 				<u-form-item label=" " right-icon="arrow-right" @click.native="toSetDate(index)" label-width="0px">
@@ -18,7 +24,7 @@
 			<u-form-item label="归属场馆" prop="venueName" right-icon="arrow-right" required @click.native="venueShow = true">
 				<u-input v-model="form.venueName" placeholder="请选择归属场馆" disabled @click="venueShow = true" />
 			</u-form-item>
-			<u-form-item label="地址" prop="address" required>
+			<u-form-item label="地址">
 				<u-input v-model="form.address" disabled placeholder="请输入地址" />
 			</u-form-item>
 			<u-form-item label="学生数量" prop="maxStudentCount" required>
@@ -45,6 +51,8 @@
 				<u-button type="warning" :ripple="true" :custom-style="{...customStyle, marginTop: '15px'}" @click="setDate()">确定</u-button>
 			</view>
 		</u-popup>
+		<u-picker mode="time" v-model="startDateShow" :params="cycleParams" @confirm="setStartDate"></u-picker>
+		<u-picker mode="time" v-model="endDateShow" :params="cycleParams" @confirm="setEndDate"></u-picker>
 		<u-picker mode="time" v-model="startTimeShow" :params="startTimeParams" @confirm="setStartTime"></u-picker>
 		<u-picker mode="selector" v-model="venueShow" :range="venueList" range-key="name" @confirm="setVenue"></u-picker>
 		<view class="handle-fix-box">
@@ -71,7 +79,8 @@
 			return {
 				form: {
 					name: '',
-					startTime: '',
+					startDate: '',
+					endDate: '',
 					address: '',
 					venueId: '',
 					venueName: '',
@@ -89,6 +98,16 @@
 						message: '请输入班级名称',
 						trigger: 'change'
 					}],
+					startDate: [{
+						required: true,
+						message: '请选择课程周期开始时间',
+						trigger: 'change'
+					}],
+					endDate: [{
+						required: true,
+						message: '请选择课程周期结束时间',
+						trigger: 'change'
+					}],
 					timeReqList: [{
 						type: 'array',
 						required: true,
@@ -100,11 +119,6 @@
 						message: '请选择归属场馆',
 						trigger: 'change'
 					}],
-					address: [{
-						required: true,
-						message: '请输入地址',
-						trigger: 'change'
-					}],
 					maxStudentCount: [{
 						required: true,
 						message: '请输入学生数量',
@@ -140,6 +154,16 @@
 						name: '周日'
 					},
 				],
+				startDateShow: false,
+				endDateShow: false,
+				cycleParams: {
+					year: true,
+					month: true,
+					day: true,
+					hour: false,
+					minute: false,
+					second: false
+				},
 				startTimeShow: false,
 				startTimeParams: {
 					year: false,
@@ -164,7 +188,7 @@
 				page: 1,
 				size: 10000,
 			}, 'POST').then(res => {
-				this.venueList = this.res.data.row
+				this.venueList = res.data.row
 			}).catch(error => {
 				this.$refs.uTips.show({
 					title: error.message,
@@ -201,6 +225,14 @@
 					endTime: '',
 				})
 			},
+			//  设置课程周期开始时间
+			setStartDate(date) {
+				this.form.startDate = date.year + '-' + date.month + '-' + date.day
+			},
+			//  设置课程周期结束时间
+			setEndDate(date) {
+				this.form.endDate = date.year + '-' + date.month + '-' + date.day
+			},
 			//  设置上课时间
 			setStartTime(date) {
 				if (this.timeType == 1) {
@@ -243,7 +275,7 @@
 							}, 1000)
 						}).catch(error => {
 							this.$refs.uTips.show({
-								title: '提交失败',
+								title: error.message,
 								type: 'warning',
 							})
 						})

+ 1 - 6
pagesMain/extraLessonsList.vue

@@ -4,7 +4,7 @@
 		 :refresher-triggered="triggered" :refresher-threshold="100" refresher-background="white" @refresherrefresh="onRefresh"
 		 @refresherrestore="onRestore">
 			<u-card :foot-border-top="false" padding="0" margin="10px" borderRadius="40" v-for="(item, index) in tableList" :key="index"
-			 class="card-container" @click="goToDetail(item)">
+			 class="card-container">
 				<view class="card-content" slot="head" style="display: flex;">
 					<view class="card-img">
 						<u-avatar :src="item.url" size="100"></u-avatar>
@@ -89,11 +89,6 @@
 						type: 'warning',
 					})
 				})
-			},
-			goToDetail(item) {
-				uni.navigateTo({
-					url: '/pagesMain/evaluateDetail?id=' + item.id
-				});
 			}
 		},
 	}

+ 1 - 6
pagesMain/leaveLessonsList.vue

@@ -4,7 +4,7 @@
 		 :refresher-triggered="triggered" :refresher-threshold="100" refresher-background="white" @refresherrefresh="onRefresh"
 		 @refresherrestore="onRestore">
 			<u-card :foot-border-top="false" padding="0" margin="10px" borderRadius="40" v-for="(item, index) in tableList" :key="index"
-			 class="card-container" @click="goToDetail(item)">
+			 class="card-container">
 				<view class="card-content" slot="head" style="display: flex;">
 					<view class="card-img">
 						<u-avatar :src="item.url" size="100"></u-avatar>
@@ -89,11 +89,6 @@
 						type: 'warning',
 					})
 				})
-			},
-			goToDetail(item) {
-				uni.navigateTo({
-					url: '/pagesMain/evaluateDetail?id=' + item.id
-				});
 			}
 		},
 	}

+ 1 - 1
pagesMain/ratioRank.vue

@@ -16,7 +16,7 @@
 						<text class="rank-text" v-if="index1 == 1">签到人次:{{item.signCount}}人</text>
 					</view>
 					<u-card :head-border-bottom="false" :foot-border-top="false" padding="0px" margin="0" borderRadius="0" v-for="(site, index2) in item.tableList"
-					 :key="index2" class="class-card" @click="goToStudent(site)">
+					 :key="index2" class="class-card">
 						<view class="class-content" slot="body">
 							<view class="info-sort">
 								<u-image :src="index2 == 0 ? iconPath1 : (index2 == 1 ? iconPath2 : iconPath3)" mode="aspectFit" width="24px"

+ 7 - 5
pagesMain/studentInfo.vue

@@ -68,7 +68,7 @@
 		onShow() {
 			this.isOver = false
 			this.pageIndex = 1
-			// this.tableList = []
+			this.tableList = []
 			this.getTableList()
 		},
 		methods: {
@@ -77,7 +77,9 @@
 					id: this.id
 				}, 'POST').then(res => {
 					this.studentInfo = res.data
-					this.tableList = res.data.growList
+					if (this.type == 1) {
+						this.tableList = res.data.growList
+					}
 				}).catch(error => {
 					this.$refs.uTips.show({
 						title: error.message,
@@ -107,15 +109,15 @@
 			},
 			//  获取列表数据
 			getTableList() {
-				if(this.type != 1){
+				if (this.type != 1) {
 					NET.request(this.type == 2 ? API.getRenewCommunicateList : API.getSignCommunicateList, {
 						id: this.id,
 						page: this.pageIndex,
 						size: 10,
 					}, 'POST').then(res => {
 						this.triggered = false
-						this.tableList = this.tableList.concat(res.data.list)
-						this.isOver = res.data.list.length != 10
+						this.tableList = this.tableList.concat(res.data.row)
+						this.isOver = res.data.row.length != 10
 					}).catch(error => {
 						this.triggered = false
 						this.$refs.uTips.show({