Browse Source

提交修改的代码

zhangli 2 years ago
parent
commit
c0f8f85af6
5 changed files with 50 additions and 19 deletions
  1. 4 3
      config/api.js
  2. 31 12
      pagesClass/classDetail.vue
  3. 6 2
      pagesClass/signForm.vue
  4. 4 1
      pagesClass/signStudentList.vue
  5. 5 1
      pagesMain/evaluateList.vue

+ 4 - 3
config/api.js

@@ -3,10 +3,11 @@
 //const API_BASE = 'http://192.168.1.126:30000'
 //const API_BASE = 'http://www.jihengcc.cn:17080/newApi'
 
-// const API_BASE = 'http://192.168.1.117:8089'
-
+//const API_BASE = 'http://192.168.1.117:8089'
+const API_BASE = 'http://192.168.1.109/newApi'
+//const API_BASE = 'http://192.168.1.145/newApi'
 // const API_BASE = 'http://192.168.1.126:30000'
-const API_BASE = 'http://192.168.1.117:8089'
+//const API_BASE = 'http://192.168.1.117:8089'
 
 module.exports = {
 	//  微信授权登录

+ 31 - 12
pagesClass/classDetail.vue

@@ -31,7 +31,7 @@
 				</u-grid-item>
 			</u-grid>
 		</u-card>
-		<u-card margin="0px 0px 10px 0px" :head-style="cardStyle" :show-head="false"  @click="handleScanClick">
+		<u-card margin="0px 0px 10px 0px" :head-style="cardStyle" :show-head="false"  @click="handleScanClick" v-if="classInfo.useLessonsType==1">
 			<view slot="body" style="display: flex;justify-content: space-between;">
 				<view style="font-size: 32rpx;font-weight: bold;color:#000000;">扫码</view>
 				<u-icon name="scan" size="32"></u-icon>
@@ -52,7 +52,7 @@
 				<u-grid-item v-for="(item, index) in classInfo.studentLeaveList" :key="index" :custom-style="gridCustomStyle">
 						<view class="class-student-col" @click="handleOtherClick(item)">
 						{{item.name}}
-						<u-icon :name="item.agreeType == 1 ?  'bookmark-fill' : 'bookmark'" :color="mainColor" size="48"></u-icon>
+						<u-icon name="'bookmark" :color="mainColor" size="48"></u-icon>
 					</view>
 				</u-grid-item>
 			</u-grid>
@@ -113,9 +113,9 @@
 		<u-popup v-model="vtCardShow" mode="center" border-radius="30" width="600rpx">
 			<view class="common-title">续费卡</view>
 			<view class="menber-box">
-				<u-radio-group v-model="vtCardValue" @change="handleRadioChange">
-					<u-radio  class="menber-col" v-for="(item,index) in vtCardList" :key="index" :name="item.cardName">
-						<view class="menber-label">卡名:{{ item.cardName }}</view>
+				<u-radio-group v-model="orderId">
+					<u-radio  class="menber-col" v-for="(item,index) in vtCardList" :key="index" :name="item.orderId">
+						<view class="menber-label" >卡名:{{ item.cardName }}</view>
 						<!-- <view class="menber-label">售价: ¥ 1111</view> -->
 						<!-- <view class="menber-label">使用时间: 11111</view> -->
 						<!-- <u-checkbox v-model="true" active-color="#ff6e3e">选择</u-checkbox> -->
@@ -184,6 +184,8 @@
 				vtCardShow: false,
 				vtCardId: '',
 				vtCardValue: '',
+				orderId:'',
+				cardId:'',
 				vtCardList: [],
 			}
 		},
@@ -205,6 +207,7 @@
 					id: this.classId
 				}, 'POST').then(res => {
 					this.classInfo = res.data
+					console.log(this.classInfo.venueId)
 					uni.stopPullDownRefresh();
 				}).catch(error => {
 					this.$refs.uTips.show({
@@ -220,13 +223,22 @@
 					uni.scanCode({
 						onlyFromCamera: true,
 						success: function (res) {
+							console.log(res)
 							// const studentId = parseInt(res.result)
-							const studentId = 8999
+							if(res.result.indexOf("xinghuoclass66889955224477")==-1){
+								that.$refs.uTips.show({
+									title: "二维码错误",
+									type: 'success',
+								})
+								return false;
+							}
+							const studentId = res.result.replace("xinghuoclass66889955224477",'')
 							const classId = parseInt(that.classId)
 							NET.request(API.classCourseWriteOff, {
 								studentId,classId
 							}, 'POST').then(res => {
 								if(res.status == 10000) {
+									that.initialize()
 									that.$refs.uTips.show({
 										title: res.message,
 										type: 'success',
@@ -237,6 +249,11 @@
 										type: 'warning',
 									})
 								}
+							}).catch(error => {
+								that.$refs.uTips.show({
+									title: error.message,
+									type: 'warning',
+								})
 							})
 						},
 						fail: function (res) {
@@ -373,16 +390,18 @@
 					})
 			},
 			//  续费卡切换
-			handleRadioChange(cardName) {
-				this.vtCardId = this.vtCardList.find( item => item.cardName = cardName).id
-				this.vtCardValue = cardName
+			handleRadioChange(orderId) {
+				this.vtCardId = this.vtCardList.find( item => item.orderId = orderId).cardId
+				this.vtCardValue = this.vtCardList.find( item => item.orderId = orderId).cardName
+				this.orderId=orderId
 			},
 			//  续费卡确认
 			handleAffirmClick() {
 				const data = {
-					cardId: parseInt(this.vtCardId),
+					cardId: this.vtCardList.find( item => item.orderId = this.orderId).cardId,
 					studentId: parseInt(this.studentId),
-					classId: parseInt(this.classId)
+					classId: parseInt(this.classId),
+					orderId:parseInt(this.orderId)
 				}
 				NET.request(API.openRenewalCard, data,'POST').then(res=> {
 					if(res.status == 10000) {
@@ -499,7 +518,7 @@
 			goToSignForm() {
 				uni.removeStorageSync('signUserList')
 				uni.navigateTo({
-					url: '/pagesClass/signForm?id=' + this.classId + '&status=' + this.classInfo.signStatus
+					url: '/pagesClass/signForm?id=' + this.classId + '&status=' + this.classInfo.signStatus+'&venueId=' + this.classInfo.venueId
 				});
 			},
 			// 跳转续费卡详情

+ 6 - 2
pagesClass/signForm.vue

@@ -49,6 +49,7 @@
 		data() {
 			return {
 				classId: '',
+				venueId:'',
 				status: '',
 				uploadUrl: API.uploadFile,
 				uploadHeader: {
@@ -66,6 +67,8 @@
 		onLoad(options) {
 			this.classId = options.id
 			this.status = options.status
+			this.venueId = options.venueId
+			
 		},
 		onShow() {
 			this.initialize()
@@ -130,7 +133,7 @@
 			//  跳转选择学生页面
 			goToSelectStudent() {
 				uni.navigateTo({
-					url: '/pagesClass/signStudentList'
+					url: '/pagesClass/signStudentList?venueId='+this.venueId
 				});
 			},
 			//  跳转签到表单
@@ -141,9 +144,10 @@
 			},
 			//  提交表单
 			submitForm() {
+				console.log(this.studentList)
 				NET.request(API.submitSignForm, {
 					classId: this.classId,
-					signStudentIdList: this.studentList.filter(site => site.state == 1 || site.checked).map(site => {
+					signStudentIdList: this.studentList.filter(site => site.state == 0 && site.checked).map(site => {
 						if (site.fileId) {
 							return {
 								id: site.id,

+ 4 - 1
pagesClass/signStudentList.vue

@@ -42,6 +42,7 @@
 		},
 		data() {
 			return {
+				venueId:'',
 				filterText: '',
 				triggered: false,
 				isOver: false,
@@ -50,7 +51,8 @@
 				checkedList: uni.getStorageSync('signUserList').length ? uni.getStorageSync('signUserList') : []
 			}
 		},
-		onLoad() {
+		onLoad(options) {
+			this.venueId = options.venueId
 			this.getTableList()
 		},
 		onReady() {
@@ -87,6 +89,7 @@
 					name: this.filterText,
 					page: this.pageIndex,
 					size: 10,
+					venueId: this.venueId,
 				}, 'POST').then(res => {
 					this.triggered = false
 					res.data.row.forEach(site => site.checked = false)

+ 5 - 1
pagesMain/evaluateList.vue

@@ -23,7 +23,11 @@
 					</view>
 					<view class="class-info-text">
 						<u-icon name="tags"></u-icon>
-						教练评价:<text>{{item.totalCount}}</text>条
+						教练回复:<text>{{item.coachTotalCount}}</text>条
+					</view>
+					<view class="class-info-text">
+						<u-icon name="tags"></u-icon>
+						学生评价:<text>{{item.stuTotalCount}}</text>条
 					</view>
 				</view>
 			</u-card>