Procházet zdrojové kódy

模考活动预约考试

xuqiaoying před 3 roky
rodič
revize
628a0dbe7f

+ 7 - 1
common/methodTool.js

@@ -70,7 +70,10 @@ export default {
 	 * @param timestamp
 	 * @returns {*}
 	 */
-	timestampToTime(timestamp, isDay = true,hasChinese) {
+	timestampToTime(timestamp, isDay = true,hasChinese, line ) {
+		if (!timestamp) {
+			return ''
+		}
 		var date = new Date(timestamp * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
 		var Y = date.getFullYear() + (hasChinese ? '' : '-');
 		var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + (hasChinese ? '' : '-');
@@ -87,6 +90,9 @@ export default {
 			}
 			
 		}
+		if (line) {
+			return h + m + s
+		}
 		
 		if(hasChinese) {
 			return Y +'年'+ M +'月'+ D + '日' + h + m + s;

+ 2 - 2
common/request.js

@@ -5,12 +5,12 @@ import api from './api.js'
 var num = 1
 //接口api   
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
-export const BASE_URL = 'https://test.xyyxt.net'   //预发布
+// export const BASE_URL = 'https://test.xyyxt.net'   //预发布
 // export const BASE_URL = 'http://120.79.166.78:19012' // 测试环境
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test(后端本地)
 // export const BASE_URL = 'http://192.168.1.222:5055'    //后端本地更新到222
 // export const BASE_URL = 'http://192.168.1.24:5055'    //后端本地
-// export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
+export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
 
  //图片上传api
 // export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release

+ 6 - 6
pages3/polyv/detail.vue

@@ -1961,12 +1961,12 @@ export default {
       let self = this;
       return new Promise((resolve) => {
         let data = {
-          gradeId: Number(self.gradeId),
-          goodsId: Number(self.goodsId),
-          sectionId: Number(self.playSectionId),
-          courseId: Number(self.courseId),
-          chapterId: parseInt(self.chapterId),
-          moduleId: parseInt(self.moduleId),
+          gradeId: this.gradeId || this.gradeId == 0 ? Number(this.gradeId) : null,
+          goodsId: this.goodsId || this.goodsId == 0 ? Number(this.goodsId) : null,
+          sectionId: this.playSectionId || this.playSectionId == 0 ? Number(this.playSectionId) : null,
+          courseId: this.courseId || this.courseId == 0 ? Number(this.courseId) : null,
+          chapterId: this.chapterId || this.chapterId == 0 ? parseInt(this.chapterId) : null,
+          moduleId: this.moduleId || this.moduleId == 0 ? parseInt(this.moduleId) : null,
 					orderGoodsId: this.orderGoodsId,
         };
         self.$api.recordLast(data).then((res) => {

+ 2 - 1
pages5/examCount/index.vue

@@ -36,6 +36,7 @@ export default {
 		};
 	},
 	onLoad(option){
+		console.log('option', option)
 		this.examEndTime = option.examEndTime;
 		this.mockName = option.mockName || ''
 		this.subscribeId = option.subscribeId
@@ -61,11 +62,11 @@ export default {
 		getDuring() {
 			this.nowTime = +this.$method.timest();
 			let during = this.start - this.nowTime;
+			console.log('during', during)
 			this.percent = during <= 0 ? 100 : during >= 600 ? 0 :  (600 - during) / 600 * 100;
 			if(during <= 0) {
 				return '00:00'
 			}
-			
 			let minutes = parseInt(during/60) >= 10 ? '0'+ parseInt(during/60) : parseInt(during/60);
 			let seconds = during % 60 >= 10 ? during % 60 :'0'+ during % 60;
 			

+ 16 - 2
pages5/examList/index.vue

@@ -35,16 +35,20 @@
 						</view>
 						<view class="item">
 							<view class="left">考试时间</view>
-							<view class="right">
+							<view v-if="item.mockActivity == 0" class="right">
 								{{ $method.timestampToTime(item.applySiteExamTime) }}
 								{{ item.applySiteStartTime }} - {{ item.applySiteEndTime }}
 							</view>
 						</view>
 						<view class="btn-wrap">
 							<view class="btn-line">
+								<!-- mockActivity 1是活动模考,0否 -->
+								<view v-if="item.mockActivity == 1" class="btn" @click="goExamCount(item,index)">去考试</view>
+								<view v-else>
 								<view class="btn test-disabled" v-if="goTest(item)" @click="goExamCount(item,index)">去考试</view>
 								<view class="btn test-disabled"  v-else-if="item.handStatus">已考试</view>
 								<view class="btn" v-else @click="goExamCount(item,index)">去考试</view>
+								</view>
 							</view>
 						</view>
 					</view>
@@ -270,6 +274,9 @@ export default {
 			})
 		},
 		goTest(item) {
+			if (item.mockActivity && item.mockActivity == 1) {
+				return false
+			}
 			let startTime = this.$method.TimeTotimestamp(this.$method.timestampToTime(item.applySiteExamTime) + ' ' + item.applySiteStartTime)
 			let canGo = (startTime-this.nowTime) <= (600) && (startTime-this.nowTime) >= (-(item.timeLimit * 60)  || 0)
 			
@@ -325,8 +332,15 @@ export default {
 				url:`../../pages/webview/index?url=`+encode
 			})
 		},
-		
 		goExamCount(item,index) {
+			console.log('item', item)
+			if (item.mockActivity && item.mockActivity == 1) {
+				item.applySiteExamTime = parseInt(new Date().getTime()/1000) // 当前时间的时间戳
+				item.applySiteStartTime = this.$method.timestampToTime(new Date().getTime()/1000, false, false, true)
+				let min = item.duration * 60 *1000 + new Date().getTime()
+				item.applySiteEndTime = this.$method.timestampToTime(min/1000, false, false, true)
+			}
+			
 			if(this.goTest(item)) {
 				uni.showToast({
 					icon:'none',

+ 1 - 1
pages5/mockExam/registrationSuccess.vue

@@ -60,7 +60,7 @@
 				</u-count-down>
                 <text v-else>0天</text>
             </view>
-            <view class="time_item">活动咨询电话:020-87085982/87085982</view>
+            <view class="time_item">活动详情请咨询业务人员或致电020-87085982/87085983</view>
         </view>
         <view class="exam_entry">
             <text class="entrys">考试入口:</text>请进入祥粤云学堂小程序或者网站, 在个人中心找到模考功能进行考试。