Commit 61b7a5d8 authored by wangjiankun's avatar wangjiankun

Merge remote-tracking branch 'origin/master'

parents 45f9a47f bd778e23
...@@ -7,8 +7,8 @@ VUE_APP_BASE_API2 = 'http://192.168.5.47' ...@@ -7,8 +7,8 @@ VUE_APP_BASE_API2 = 'http://192.168.5.47'
# 考试系统地址 # 考试系统地址
VUE_APP_BASE_API3 = 'http://192.168.5.201:8084' VUE_APP_BASE_API3 = 'http://192.168.5.201:8084'
# 手机端前台地址 # 手机端前台地址
VUE_APP_BASE_API4 = 'http://192.168.9.39:8001' VUE_APP_BASE_API4 = 'http://192.168.6.34:8001'
# 不走网关的后台地址 # 不走网关的后台地址
VUE_APP_BASE_API5 = 'http://192.168.5.201:8081' VUE_APP_BASE_API5 = 'http://192.168.5.201:8081'
# 客户端前端地址 # 客户端前端地址
VUE_APP_BASE_API6 = 'http://192.168.9.39:8080' VUE_APP_BASE_API6 = 'http://192.168.6.34:8080'
...@@ -505,6 +505,35 @@ export default { ...@@ -505,6 +505,35 @@ export default {
}) })
}, },
methods: { methods: {
// 如果不是当前触摸点不在input上,那么都失去焦点
objBlurFun(sDom, times) {
const time = times || 300,
isIPHONE = navigator.userAgent.toUpperCase().indexOf('IPHONE') !== -1 // 判断是否为苹果
if (isIPHONE) {
const obj = document.querySelectorAll(sDom)
for (let i = 0; i < obj.length; i++) {
this.objBlur(obj[i], time)
}
}
},
// 元素失去焦点隐藏iphone的软键盘
objBlur(sdom, time) {
const docTouchend = function(event) {
if (event.target !== sdom) {
setTimeout(function() {
sdom.blur()
document.removeEventListener('touchend', docTouchend, false)
}, time)
}
}
if (sdom) {
sdom.addEventListener('focus', function() {
document.addEventListener('touchend', docTouchend, false)
}, false)
} else {
throw new Error('objBlur()没有找到元素')
}
},
// 点击保存保存至我的资料 // 点击保存保存至我的资料
async saveChapter() { async saveChapter() {
const currentContent = this.chapterList[this.unitIndex].childList[this.unitPartIndex], const currentContent = this.chapterList[this.unitIndex].childList[this.unitPartIndex],
...@@ -807,6 +836,12 @@ export default { ...@@ -807,6 +836,12 @@ export default {
}, },
tagClick(tag) { tagClick(tag) {
this.currentTag = tag this.currentTag = tag
if (tag === '评论') {
const that = this
setTimeout(function() {
that.objBlurFun('#discussInput')
}, 1300)
}
}, },
/** /**
* @param section 点击的当前节信息对象 (Object) * @param section 点击的当前节信息对象 (Object)
......
...@@ -644,7 +644,6 @@ export default { ...@@ -644,7 +644,6 @@ export default {
// 判断当前题目是否已答 // 判断当前题目是否已答
for (let i = 0; i < this.fillEmpytList.length - 1; i++) { for (let i = 0; i < this.fillEmpytList.length - 1; i++) {
if (this.fillEmpytList[i].fillEmpty.trim() === '') { if (this.fillEmpytList[i].fillEmpty.trim() === '') {
debugger
this.subjectList[this.nameIndex].questions[this.subjectIndex].isOk = false this.subjectList[this.nameIndex].questions[this.subjectIndex].isOk = false
this.Answer[this.nameIndex].questions[this.subjectIndex].isOk = false this.Answer[this.nameIndex].questions[this.subjectIndex].isOk = false
return return
...@@ -815,7 +814,6 @@ export default { ...@@ -815,7 +814,6 @@ export default {
// 判断是否到试卷结束时间 // 判断是否到试卷结束时间
stopExamination() { stopExamination() {
this.oldDate = new Date(this.item.p_endtime_mobile).getTime() // 考试结束时间 毫秒数 this.oldDate = new Date(this.item.p_endtime_mobile).getTime() // 考试结束时间 毫秒数
debugger
if (this.newDate > this.oldDate) { if (this.newDate > this.oldDate) {
this.submitPaper() this.submitPaper()
} else { } else {
......
...@@ -823,6 +823,35 @@ export default { ...@@ -823,6 +823,35 @@ export default {
}) })
}, },
methods: { methods: {
// 如果不是当前触摸点不在input上,那么都失去焦点
objBlurFun(sDom, times) {
const time = times || 300,
isIPHONE = navigator.userAgent.toUpperCase().indexOf('IPHONE') !== -1 // 判断是否为苹果
if (isIPHONE) {
const obj = document.querySelectorAll(sDom)
for (let i = 0; i < obj.length; i++) {
this.objBlur(obj[i], time)
}
}
},
// 元素失去焦点隐藏iphone的软键盘
objBlur(sdom, time) {
const docTouchend = function(event) {
if (event.target !== sdom) {
setTimeout(function() {
sdom.blur()
document.removeEventListener('touchend', docTouchend, false)
}, time)
}
}
if (sdom) {
sdom.addEventListener('focus', function() {
document.addEventListener('touchend', docTouchend, false)
}, false)
} else {
throw new Error('objBlur()没有找到元素')
}
},
// 点击保存保存至我的资料 // 点击保存保存至我的资料
async saveTrain(itemMessage) { async saveTrain(itemMessage) {
const res = await post.postAdd({ const res = await post.postAdd({
...@@ -1323,11 +1352,12 @@ export default { ...@@ -1323,11 +1352,12 @@ export default {
if (tag === '简介') { if (tag === '简介') {
document.getElementById('navList').classList.remove('fixedList') document.getElementById('navList').classList.remove('fixedList')
} }
// if (tag === '评论') { if (tag === '评论') {
// document.getElementById('trainCard').style.display = 'none' const that = this
// } else { setTimeout(function() {
// document.getElementById('trainCard').style.display = 'block' that.objBlurFun('#discussInput')
// } }, 1300)
}
}, },
// 讲师信息 // 讲师信息
getCourseAndTeacher() { getCourseAndTeacher() {
......
...@@ -467,7 +467,7 @@ export default { ...@@ -467,7 +467,7 @@ export default {
}, },
data() { data() {
return { return {
title: '编辑培训', title: '新建培训',
fromName: 'IReleasedTrain', fromName: 'IReleasedTrain',
slId: '', // 培训ID slId: '', // 培训ID
formData: { formData: {
...@@ -484,7 +484,7 @@ export default { ...@@ -484,7 +484,7 @@ export default {
trainOverDate: '', // 培训结束时间 trainOverDate: '', // 培训结束时间
trainAddress: '', // 培训地址 trainAddress: '', // 培训地址
maxApplyPerson: 0, // 最大报名人数 maxApplyPerson: 0, // 最大报名人数
trainSignTime: '', // 培训签到时间(培训开始前 分钟数) trainSignTime: '30', // 培训签到时间(培训开始前 分钟数)
viewRangePerson: '', // 可见范围 viewRangePerson: '', // 可见范围
valueGain: 0, // 获得积分 valueGain: 0, // 获得积分
trainFileList: [] // 文件类型 2PPT 3PDF 4word 5txt 6zip 7png 8xlsx trainFileList: [] // 文件类型 2PPT 3PDF 4word 5txt 6zip 7png 8xlsx
...@@ -716,7 +716,8 @@ export default { ...@@ -716,7 +716,8 @@ export default {
trainSignTime: that.formData.trainSignTime, trainSignTime: that.formData.trainSignTime,
trainFileJson: JSON.stringify(this.formData.trainFileList), trainFileJson: JSON.stringify(this.formData.trainFileList),
isClient: '1', isClient: '1',
viewRangePerson: this.formData.viewRangePerson viewRangePerson: this.formData.viewRangePerson,
isAccountId: '1' // 可见范围人传入的是 accountId
} }
if (that.slId === '' || that.slId === undefined) { if (that.slId === '' || that.slId === undefined) {
delete tempForm['businessId'] delete tempForm['businessId']
...@@ -1132,12 +1133,25 @@ export default { ...@@ -1132,12 +1133,25 @@ export default {
this.maxDate = applyOverDate this.maxDate = applyOverDate
// this.currentDate = new Date(this.formData.applyStartDate) // this.currentDate = new Date(this.formData.applyStartDate)
} }
// 判断报名开始时间不得晚于培训结束时间
if (this.formData.trainOverDate !== '') {
this.maxDate = trainOverDate
// this.currentDate = new Date(this.formData.applyStartDate)
}
if (this.formData.trainOverDate !== '' && this.formData.applyOverDate !== '') {
this.maxDate = trainOverDate.getTime() > applyOverDate.getTime() ? applyOverDate : trainOverDate
// this.currentDate = new Date(this.formData.applyStartDate)
}
break break
// 判断报名结束时间不得早于报名开始时间 // 判断报名结束时间不得早于报名开始时间
case 'applyOverDate': case 'applyOverDate':
if (this.formData.applyStartDate !== '') { if (this.formData.applyStartDate !== '') {
this.minDate = applyStartDate this.minDate = applyStartDate
} }
// 判断报名结束时间不得大于培训结束时间
if (this.formData.trainOverDate !== '') {
this.maxDate = trainOverDate
}
break break
// 判断培训开始时间不得晚于培训结束时间 // 判断培训开始时间不得晚于培训结束时间
case 'trainStartDate': case 'trainStartDate':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment