wkyy 2 lat temu
rodzic
commit
d4e42aa98f
3 zmienionych plików z 18 dodań i 34 usunięć
  1. 2 1
      config/.env.dev.js
  2. 1 1
      config/.env.prod.js
  3. 15 32
      pages/parents/course/courseDetails.vue

+ 2 - 1
config/.env.dev.js

@@ -1,6 +1,7 @@
 const UNI_APP = {  
 	ProjectName :"51充电联盟",
-	BASE_URL: 'http://47.98.231.198:9090/qsng-server/',
+	BASE_URL: 'http://47.98.231.198:9090/qsng-server/',
+	// BASE_URL: 'http://192.168.33.220:8086/education-training-server/',
 	// BASE_URL: 'http://192.168.77.162:8086/education-training-server/',
 	//BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
 	//BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,

+ 1 - 1
config/.env.prod.js

@@ -1,6 +1,6 @@
 const UNI_APP = {  	
 		ProjectName :"51充电联盟",
-    BASE_URL: 'http://47.98.231.198:9090/qsng-server/',
+    BASE_URL: 'http://114.55.55.123/qsng-server/',
 	PARK_URL: 'https://51team.xiaoxinda.com/charging-parking/' ,
 	
 	NODE_ENV :"prod",

+ 15 - 32
pages/parents/course/courseDetails.vue

@@ -188,8 +188,9 @@
 									报名班级
 								</view>
 								<view class="options">
-									<view class="item" >
-										初级班
+									<view class="item" v-for="(item,index) in tclassList" :key="index"
+										:class="activeClass==index ? '' : 'item-state2'" @click="choseClass(item,index)">
+										{{item.className}}
 									</view>
 								</view>
 							</view>
@@ -199,17 +200,9 @@
 									选择套餐
 								</view>
 								<view class="options">
-									<view class="item" v-for="item in 9">
-										暑期班 24课时
-									</view>
-									<view class="item item-state2">
-										春季 36课时
-									</view>
-									<view class="item item-state2">
-										秋季 36课时
-									</view>
-									<view class="item item-state2">
-										全年 96课时
+									<view class="item" v-for="(item,index) in coursePackageList" :key="index"
+										:class="activePackage==index ? '' : 'item-state2'" @click="chosePackage(item,index)">
+										{{item.packageName}}班 {{item.courseAmount}}课时
 									</view>
 								</view>
 							</view>
@@ -290,16 +283,15 @@
 				courseBase: {},
 				coursePackageList: [],
 				tclassList: [],
-				packageList: [],
-				classList: [],
 				classDetail: {},
 				packageDetail: {},
 				studentId: '',
 				stuDetail: {},
 				show: false,
-				list: [],
 				studentList: [],
-				popShow:false
+				popShow:false,
+				activeClass: 0,
+				activePackage: 0
 			}
 		},
 		onLoad(op) {
@@ -310,6 +302,12 @@
 			}
 		},
 		methods: {
+			choseClass(item,index) {
+				this.activeClass = index;
+			},
+			chosePackage(item,index) {
+				this.activePackage = index;
+			},
 			getCourseDetail() {
 				uni.showLoading({
 					title: "加载中",
@@ -322,27 +320,12 @@
 					this.courseBase = res.data.courseBase;
 					this.coursePackageList = res.data.coursePackageList;
 					this.tclassList = res.data.tclassList;
-					var list1 = [];
-					var list2 = [];
-					for (var i = 0; i < this.coursePackageList.length; i++) {
-						list1.push({
-							value: this.coursePackageList[i].packageId,
-							label: this.coursePackageList[i].packageName
-						})
-					}
-					this.packageList = list1;
 					
 					for (var j = 0; j < this.tclassList.length; j++) {
-						list2.push({
-							value: this.tclassList[j].classId,
-							label: this.tclassList[j].className
-						})
-						
 						if(this.tclassList[j].classId == this.classId) {
 							this.classDetail = this.tclassList[j];
 						}
 					}
-					this.classList = list2;
 				}).catch(error => {
 					uni.showToast({
 						title: error,