Преглед на файлове

学习中心-进入学习

xuqiaoying преди 3 години
родител
ревизия
b6a8dfd440
променени са 4 файла, в които са добавени 239 реда и са изтрити 21 реда
  1. 8 1
      pages/index/index.vue
  2. 73 0
      pages/learn/index.scss
  3. 156 18
      pages/learn/index.vue
  4. 2 2
      pages/wd/index.vue

+ 8 - 1
pages/index/index.vue

@@ -162,7 +162,7 @@
 										<text class="sale">/限时优惠</text>
 									</view>
 									<view class="right">
-										<view class="regiser_row">立即报名</view>
+										<view class="regiser_row">立即购买</view>
 									</view>
 								</view>
 								<!-- <view class="c_title">{{item.goodsName}}</view> -->
@@ -265,6 +265,13 @@ export default {
 		}
 		
 		this.init()
+
+		wx.getSystemInfo({
+			success: function (res) {
+				let version = res.SDKVersion
+				console.log('该版本号为: ', version)
+			}
+		})
 	},
 	onShow() {
 		uni.removeStorageSync('goPath')

+ 73 - 0
pages/learn/index.scss

@@ -313,4 +313,77 @@
 		font-size: 30rpx;
 		text-align: center;
 	}
+}
+// 弹窗
+.popup_box {
+	height: 700rpx;
+	box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
+	border-radius: 32rpx 32rpx 0rpx 0rpx;
+
+	.line1 {
+		width: 80rpx;
+		height: 8rpx;
+		background: #999999;
+		border-radius: 4rpx;
+		margin: 0 auto;
+		margin-top: 15rpx;
+	}
+
+
+	.grade {
+		height: 23rpx;
+		font-size: 24rpx;
+		color: #999999;
+		margin: 0 auto;
+		margin-top: 15rpx;
+		text-align: center;
+	}
+
+	.confrim-btn {
+		height: 98rpx;
+		width: 100%;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+
+		.okBtn {
+			width: 200rpx;
+			height: 64rpx;
+			background: linear-gradient(0deg, #015EEA, #00C0FA);
+			border-radius: 32rpx;
+			color: #FFFFFF;
+			text-align: center;
+			line-height: 64rpx;
+		}
+	}
+}
+.slot-content {
+	padding: 0 20rpx;
+}
+
+.confirm-modal {
+	.slot-content {
+		padding:0 20rpx;
+		.content {
+			color:red;
+			
+			.msg-list {
+				.item {
+					padding:20rpx 0;
+						
+						&__left {
+							color:#666;
+							margin-right:20rpx;
+						}
+						
+						&__right {
+							color:#333;
+						}
+						
+					
+				}
+				
+			}
+		}
+	}
 }

+ 156 - 18
pages/learn/index.vue

@@ -190,6 +190,77 @@
 			</view>
 				
 		</view>
+
+		<u-popup v-model="selectClassModal" @close="gradeValue = -1" mode="bottom" border-radius="40">
+			<view class="popup_box">
+				<view style="margin-bottom: 20rpx;">
+					<view class="line1"></view>
+					<view class="grade">选择班级</view>
+				</view>
+				<u-line color="#D6D6DB" />
+				<view>
+					<scroll-view scroll-y="true" style="height: 500rpx;">
+						<view>
+							<u-radio-group v-model="gradeValue" @change="radioGroupChange">
+								<view v-for="(item, index) in gradeList" :key="index">
+									<view style="display: flex;align-items: center;padding: 20rpx;">
+										<view>
+											<u-radio shape="circle" :name="index"
+												:disabled="item.studentNum > 0 && item.studentNum == item.studentUpper">
+												<view :class="item.checked?'white-box blue-box':'white-box'">
+													<view>
+														<view class="blackTxt">{{item.className}}</view>
+														<view class="redTxt" v-if="item.classEndTime">
+															有效期至:{{$method.timestampToTime(item.classEndTime,true,true)}}
+														</view>
+														<view class="redTxt" v-if="item.classEndTime">
+															本班还剩{{$method.GetRTime(item.classEndTime)}}天将结束学习</view>
+													</view>
+												</view>
+											</u-radio>
+										</view>
+
+									</view>
+								</view>
+							</u-radio-group>
+						</view>
+					</scroll-view>
+				</view>
+				<view class="confrim-btn">
+					<view class="okBtn" @click="okPopup()">确定</view>
+				</view>
+			</view>
+		</u-popup>
+
+		<u-modal v-model="showUserConfirmInfo" @confirm="confirmUserConfirm"  ref="uModal" :async-close="true" 
+			@cancel="cancelUserConfirm" :confirm-text="'确认' + (confirmCount > 0 ? '('+confirmCount+')' : '')" 
+			:confirm-color="confirmCount > 0 ? '#999' : '#2979ff'" class="confirm-modal" title="实名验证确认" 
+			cancel="取消" :show-cancel-button="true">
+			<view class="slot-content">
+				<view class="content">
+					为避免个人信息不正确导致您的学习时长无效,请认真核对以下信息是否正确,如信息有误请取消当前操作,立刻联系020-38946666
+					
+					<view class="msg-list">
+						<view class="item">
+							<text class="item__left">姓名:</text>
+							<text class="item__right">{{userInfo.realname}}</text>
+						</view>
+						<view class="item">
+							<text class="item__left">手机号:</text>
+							<text class="item__right">{{userInfo.telphone}}</text>
+						</view>
+						<view class="item">
+							<text class="item__left">身份号:</text>
+							<text class="item__right">{{userInfo.idCard}}</text>
+						</view>
+						<view class="item">
+							<u-checkbox v-model="confirmChecked" :label-disabled="false">确认个人信息无误</u-checkbox>
+						</view>
+					</view>
+				</view>
+				
+			</view>
+		</u-modal>
     </view>
 </template>
 
@@ -214,14 +285,14 @@ export default {
 			gradeList: [],
 			gradeValue: -1,
 			sysTime: 0,
-			courseLists: [],
-			questionLists: [], // 题库
+			courseLists: [], // 课程列表
+			questionLists: [], // 题库列表
 			paramQ: {
 				pageNum: 1,
 				pageSize: 50
 			},
 			queitemIndex:'',
-			livingLists: [],
+			livingLists: [], // 直播列表
 			allLoading: false, // 加载样式
         }
     },
@@ -238,7 +309,7 @@ export default {
 	},
 	computed: {
 		allCourse() {
-			return this.courseLists.length || this.gradeList.length || this.livingLists.length ? true : false
+			return this.courseLists.length || this.questionLists.length || this.livingLists.length ? true : false
 		}
 	},
 	onLoad() {
@@ -324,21 +395,21 @@ export default {
 			})
 		},
 		// 查询用户拥有的商品/课程列表/course/goodsList
-		getcourseList() {
-			this.$api.courseGoodsList(this.paramC).then(res => {
-				if (res.data.code == 200) {
-					this.courseLists = res.data.rows || []
-				}
-			})
-		},
+		// getcourseList() {
+		// 	this.$api.courseGoodsList(this.paramC).then(res => {
+		// 		if (res.data.code == 200) {
+		// 			this.courseLists = res.data.rows || []
+		// 		}
+		// 	})
+		// },
 		// 题库列表
-		getlistQuestion() {
-			this.$api.listGoodsUserQuestion(this.paramQ).then(res => {
-				if (res.data.code == 200) {
-					this.questionLists = res.data.rows || []
-				}
-			})
-		},
+		// getlistQuestion() {
+		// 	this.$api.listGoodsUserQuestion(this.paramQ).then(res => {
+		// 		if (res.data.code == 200) {
+		// 			this.questionLists = res.data.rows || []
+		// 		}
+		// 	})
+		// },
 		commonSystemTime() {
 			return new Promise(resolve => {
 				this.$api.commonSystemTime().then(res => {
@@ -408,6 +479,25 @@ export default {
 				return;
 			}
 
+			var confirmDetail = true;
+			if (item.educationName == '继续教育') { 
+				if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') { 
+					confirmDetail = await this.userConfirmInfoDetail()
+				}
+			}
+			
+			if(!confirmDetail) {
+				return;
+			}
+
+			this.itemIndex = index
+			if (item.gradeStatus == 1 && item.status == 1 && (item.serviceEndTime > this.sysTime) && (item
+					.classEndTime && (item.classEndTime < this.sysTime)) && (item.periodStatus == 0 || item
+					.periodStatus == -1) && item.studyCount > 0) {
+				this.selectClass(item, index)
+				return
+			}
+
 			// /course/goodsRebuildStatus查询用户商品重修状态
 			let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId, item.gradeId)
 
@@ -555,6 +645,54 @@ export default {
 				url:'/pages2/bank/question_detail?id='+item.goodsId+'&orderGoodsId='+item.orderGoodsId
 			})
 		},
+		radioGroupChange(e) {
+			console.log(e)
+		},
+		okPopup() {
+			if (this.gradeValue == -1) {
+				uni.showToast({
+					icon: 'none',
+					title: '请选择班级'
+				})
+				return;
+			}
+			this.$api.changeGrade({
+				goodsId: this.selectItem.goodsId,
+				gradeId: this.gradeValue,
+				oldGradeId: this.selectItem.gradeId,
+				orderGoodsId: this.selectItem.orderGoodsId,
+				userId: this.selectItem.userId
+			}).then(res => {
+				if (res.data.code == 200) {
+					if (this.itemIndex !== '') {
+						this.refreshByIndex();
+					}
+					this.selectClassModal = false;
+					uni.showToast({
+						title: '选班成功'
+					})
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: res.data.msg
+					})
+				}
+			})
+		},
+		/**
+		 * 返回刷新之前进入的课程数据
+		 */
+		refreshByIndex() {
+			let self = this;
+			this.$api.courseGoodsList({
+				pageNum: this.itemIndex + 1,
+				pageSize: 1
+			}).then(res => {
+				if (res.data.code == 200) {
+					this.$set(this.goodsList, this.itemIndex, res.data.rows[0])
+				}
+			});
+		},
 	}
 }
 </script>

+ 2 - 2
pages/wd/index.vue

@@ -43,7 +43,7 @@
 						个学习任务
 					</view>
 				</navigator> -->
-				<!-- <view class="two_menu">
+				<view class="two_menu">
 					<navigator  hover-class="none" url="/pages2/wd/class" class="small_menu">
 						<image src="/static/icon/my_icon3.png" class="my_icon"></image>
 						<view>我的网课</view>
@@ -52,7 +52,7 @@
 						<image src="/static/icon/my_icon4.png" class="my_icon"></image>
 						<view>我的题库通</view>
 					</view>
-				</view> -->
+				</view>
 				<!-- <navigator  hover-class="none" url="/pages5/liveDetail/list" class="menu_box" >
 					<view class="box_left">
 						<image src="/static/icon/my_icon12.png" class="my_icon"></image>