he2802 3 rokov pred
rodič
commit
2498b23c62

+ 7 - 0
common/httpList/course.js

@@ -25,6 +25,13 @@ export default {
 			data: data,
 			noToken: true
 		})
+	},
+	courseGoodsList(data) {
+		return myRequest({
+			url: '/course/goodsList',
+			method: 'get',
+			data: data
+		})
 	}
 	
 }

+ 60 - 6
pages/shopping/shoppingCart.vue

@@ -196,7 +196,10 @@
 				applyObj:{
 					applyAreasJson:null,
 					examDateJson:null
-				}
+				},
+				pAreaIndex:0,
+				cAreaIndex:0,
+				examIndex:0,
 			}
 		},
 		onLoad(option) {
@@ -215,6 +218,21 @@
 			
 		},
 		methods: {
+			bindChangeE(e){
+				console.log(e.detail.value)
+				this.examIndex = e.detail.value[0]
+			},
+			bindChange(e) {
+				const val = e.detail.value
+				if(this.pAreaIndex!=e.detail.value[0]){
+					this.pAreaIndex = e.detail.value[0]
+					this.getCityList(this.provinceList[this.pAreaIndex].areaId)
+				}
+				if(this.cAreaIndex!=e.detail.value[1]){
+					this.cAreaIndex = e.detail.value[1]
+				}
+				
+			},
 			checkAreaData(){
 				if(this.examine.length==0){
 					uni.showModal({
@@ -280,6 +298,7 @@
 						return
 					}
 					this.gradeIndex = this.gradeValue
+					this.list[this.detailIndex].gradObj = this.gradeList[this.gradeIndex] //商品赋值选中班级
 					this.show = false
 				}else{
 					if(!this.checkAreaData()){
@@ -289,8 +308,10 @@
 					let pData = this.provinceList[this.pAreaIndex]
 					let cData = this.cityList[this.cAreaIndex]
 					this.applyAreas = {areaName:pData.areaName,areaId:pData.areaId,cityId:cData.areaId,cityName:cData.areaName}
-					this.applyObj.applyAreasJson = JSON.stringify(this.applyAreas)
-					this.applyObj.examDateJson = JSON.stringify(this.examDate)
+				//	this.applyObj.applyAreasJson = JSON.stringify(this.applyAreas)
+				//	this.applyObj.examDateJson = JSON.stringify(this.examDate)
+					this.list[this.detailIndex].examDate = this.examDate //商品赋值选中考期地区
+					this.list[this.detailIndex].applyAreas = this.applyAreas //商品赋值选中考期地区
 					this.show1 = false
 				}
 			},
@@ -352,9 +373,12 @@
 						applyAreasJson:null,
 						examDateJson:null
 					}
+					this.pAreaIndex=0,
+					this.cAreaIndex=0,
+					this.examIndex=0,
 					this.show1 = true
 					this.getProvinceList()
-					self.getExamine(item.projectId)
+					this.getExamine(item.projectId)
 				}
 				
 			},
@@ -407,8 +431,38 @@
 				item.show = e;
 			},
 			goBuy(){
-				console.log(this.checkboxList,66)
-				return
+				if(this.checkboxList.length==0){
+					uni.showModal({
+						title: "提示",
+						content: '请选择商品',
+						showCancel: false
+					})
+					return 
+				}
+				for(let i =0;i<this.checkboxList.length;i++){
+					let index = this.checkboxList[i]
+					let item = this.list[index]
+					if(item.templateType=='class'){
+						if(!item.gradObj.className){
+							uni.showModal({
+								title: "提示",
+								content: '请选择班级',
+								showCancel: false
+							})
+							return false
+						}
+					}
+					if(item.templateType=='apply'){
+						if(!item.applyAreas.areaName){
+							uni.showModal({
+								title: "提示",
+								content: '请选择报考地区',
+								showCancel: false
+							})
+							return false
+						}
+					}
+				}
 				this.$navTo.togo('/pages2/order/confirm_pay');
 			},
 			checkboxChange(n) {

+ 1 - 1
pages/wd/index.vue

@@ -13,7 +13,7 @@
 		<view  v-if="isLogin" class="loginBox">
 			<view style="width: 100%;height: 40px;background-color: #F0F1F5;position: fixed;top: 150px;z-index: 100;"></view>
 			<view style="display: flex;height: 160rpx;align-items: center; position: fixed;z-index: 999;top: 110px;" v-if="isLogin">
-				<image  :src="$method.splitImgHost(userInfo.avatar, true)" class="avatar"></image>
+				<image  :src="userInfo?$method.splitImgHost(userInfo.avatar, true):''" class="avatar"></image>
 				<view style="margin-left: 20rpx;z-index: 999;">
 					<view style="color: #FFFFFF;font-size: 36rpx;padding: 10rpx;">{{userInfo.realname}}</view>
 					<view style="color: #333333;font-size: 36rpx;padding: 10rpx;">{{userInfo.telphone}}</view>

+ 14 - 5
pages2/wd/class.vue

@@ -1,8 +1,8 @@
 <template>
 	<view style="padding: 30rpx;">
-		<navigator url="/pages2/class/detail" v-for="(item, index) in list" :key="index" style="margin-bottom: 30rpx;">
+		<navigator url="/pages2/class/detail" v-for="(item, index) in goodsList" :key="index" style="margin-bottom: 30rpx;">
 			<view class="class_item">
-				<image src="/static/login_bg.jpg" style="height: 316rpx;width: 100%;border-radius: 24rpx;"></image>
+				<image :src="$method.splitImgHost(item.coverUrl, true)" style="height: 316rpx;width: 100%;border-radius: 24rpx;"></image>
 				<view style="color: #333333;font-weight: bold;font-size: 32rpx;">
 					2020年二建建筑工程管理与实务(实务专题
 					班)
@@ -38,7 +38,7 @@
 						<u-button :plain="true" type="primary" size="mini" @click.stop="appointment">预约考试</u-button>
 					</view>
 				</view>
-				<view class="box_progress">
+				<view class="box_progress" v-if="false">
 					<view style="width: 60%;">
 						<text style="color: #2979ff;white-space: nowrap;text-overflow: ellipsis;">【机电全科】2021年一建黄金A</text>
 					</view>
@@ -58,17 +58,26 @@
 			return {
 				list:[
 					1,2,3
-				]
+				],
+				goodsList:[]
 				
 			}
 		},
 		onLoad(option) {
-			// this.getDict()
+			 this.courseGoodsList()
 		},
 		onShow(){
 			
 		},
 		methods: {
+			courseGoodsList() {
+				let self = this
+				this.$api.courseGoodsList().then(res => {
+					if(res.data.code==200){
+						self.goodsList = res.data.rows
+					}
+				});
+			},
 			studyIn(){
 				this.$navTo.togo('/pages2/verify/input');
 			},