Commit 03cdef0b authored by Damon's avatar Damon
parents 534d6fe9 8d78ae70
const globalUrl = process.uniEnv || {}
const ucenterApiUrl = globalUrl.ucenterUrl.apiUrl
const collegeApiUrl = globalUrl.ucenterUrl.xueUrl
const sysApiUrl = globalUrl.systemUrl.apiUrl
let learnApiFun = function(vm){
/* 通知消息基本信息 */
......@@ -14,8 +15,11 @@ let learnApiFun = function(vm){
let CourseSection = async (params = {}) => await vm.$u.get(collegeApiUrl+'/v1/section-details',params);
/* 更新学习情况*/
let updateLearnCourses = async (params = {}) => await vm.$u.post(collegeApiUrl+'/v1/update-learn-courses',params);
/* 获取考试结果 */
let getExamResult = async (examId, params = {}) => await vm.$u.post(sysApiUrl + '/wxh-worker-rest/rest/exam/serviceRule/userExamInfo/' + vm.vuex_token + '?examId=' + examId, params);
const learnApi = {
getTrainingNoticeList,CourseList,ChapterDetails,CourseSection,updateLearnCourses
getTrainingNoticeList,CourseList,ChapterDetails,CourseSection,updateLearnCourses,getExamResult
}
return learnApi
}
......
......@@ -32,9 +32,9 @@
<view class="bottom-view">
<view>
<view v-if="showCountTime" class="bottom-left-view">
<view :class="['bottom-tag-view', {'will': orderData.currentWillOverTime}]">{{tagText}}</view>
<u-count-down :timestamp="orderData.currentWillOverTime || orderData.currentOverTime" font-size="44"
color="#FF930D" @change="handleChange" ref="order-count-down"></u-count-down>
<view :class="['bottom-tag-view', {'timeout': timeout}]"><text>{{tagText}}</text></view>
<u-count-down :timestamp="timestamp" font-size="44"
:color="timeout ? '#FA5A49' : '#FF930D'" @change="handleChange" ref="order-count-down"></u-count-down>
</view>
<view v-else-if="showTime">
<text>{{timeTitle}}</text>
......@@ -69,7 +69,7 @@
orderStatus: 0, // 工单状态
appointmentDatetime: '', // 预约时间
currentWillOverTime: 10000, // 剩余时间
currentOverTime: 0, // 超过时间
currentOverTime: new Date().getTime() + 10000, // 超过时间点
auditDatetime: '2021.04.19 12:45:09', // 审核时间
submissionTime: '2021.04.19 16:24:48', // 提交时间
auditResults: {}, // 审核结果
......@@ -97,7 +97,8 @@
},
data() {
return {
timeout: false,
timestamp: 0,
};
},
computed: {
......@@ -204,8 +205,8 @@
return this.orderData.orderServiceType == '安装'
},
tagText() {
return this.orderData.currentWillOverTime ? '剩' : '超'
},
return this.timeout ? '超' : '剩'
},
timeText() {
return this.orderType == 4 ? this.orderData.submissionTime : this.orderData.auditDatetime
},
......@@ -232,6 +233,10 @@
orderType() {
return this.types[this.type]
}
},
created() {
this.timeout = this.orderData.currentOverTime < new Date().getTime()
this.timestamp = Math.round(Math.abs(this.orderData.currentOverTime - new Date().getTime()) / 1000)
},
methods: {
handleClick() {
......@@ -241,8 +246,15 @@
handleClickCell() {
this.$emit('click')
},
handleChange(timestamp) {
if (this.orderData.currentOverTime) this.$refs['order-count-down'].seconds += 2
handleChange(timestamp) {
console.log(timestamp)
if (this.timeout) this.$refs['order-count-down'].seconds += 2
if (timestamp == 0 && !this.timeout) {
setTimeout(()=> {
this.timestamp = 1
this.timeout = true
}, 1000)
}
},
getDistance(Latitud, Longitud) {
return this.distance(Latitud, Longitud, this.location[0], this.location[1])
......@@ -389,18 +401,19 @@
align-items: center;
.bottom-tag-view {
text-align: center;
width: 52rpx;
height: 52rpx;
border-radius: 26rpx;
line-height: 56rpx;
color: #FFFFFF;
font-size: 26rpx;
background-color: #FA5A49;
margin-right: 20rpx;
background-color: #FF930D;
margin-right: 20rpx;
display: flex;
justify-content: center;
align-items: center;
&.will {
background-color: #FF930D;
&.timeout {
background-color: #FA5A49;
}
}
}
......
This diff is collapsed.
......@@ -420,7 +420,7 @@
margin-right:-24rpx;
.txt-item{
border-radius: 12rpx;
padding:24rpx 38rpx;
padding:24rpx 24rpx;
width: 196rpx;
height: 72rpx;
text-align: center;
......
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