Commit 936a248d authored by 郭晓清's avatar 郭晓清
parents 21e5fc69 03cdef0b
const globalUrl = process.uniEnv || {} const globalUrl = process.uniEnv || {}
const ucenterApiUrl = globalUrl.ucenterUrl.apiUrl const ucenterApiUrl = globalUrl.ucenterUrl.apiUrl
const collegeApiUrl = globalUrl.ucenterUrl.xueUrl const collegeApiUrl = globalUrl.ucenterUrl.xueUrl
const sysApiUrl = globalUrl.systemUrl.apiUrl
let learnApiFun = function(vm){ let learnApiFun = function(vm){
/* 通知消息基本信息 */ /* 通知消息基本信息 */
...@@ -14,8 +15,11 @@ 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 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 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 = { const learnApi = {
getTrainingNoticeList,CourseList,ChapterDetails,CourseSection,updateLearnCourses getTrainingNoticeList,CourseList,ChapterDetails,CourseSection,updateLearnCourses,getExamResult
} }
return learnApi return learnApi
} }
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</template> </template>
<script> <script>
let now = Date.now() let now = new Date(new Date().toLocaleDateString()).getTime()
export default { export default {
props: { props: {
titleShow: { titleShow: {
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
return { return {
currentDay: 0, currentDay: 0,
currentTime: null, currentTime: null,
appointTime: Date.now(), appointTime: now,
appointRange: "", appointRange: "",
num: 0, num: 0,
hasLast: false hasLast: false
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
watch: { watch: {
title() { title() {
this.currentDay = 0 this.currentDay = 0
this.appointTime = Date.now() this.appointTime = now
this.currentTime = null this.currentTime = null
this.appointRange = "" this.appointRange = ""
} }
......
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
<view class="bottom-view"> <view class="bottom-view">
<view> <view>
<view v-if="showCountTime" class="bottom-left-view"> <view v-if="showCountTime" class="bottom-left-view">
<view :class="['bottom-tag-view', {'will': orderData.currentWillOverTime}]">{{tagText}}</view> <view :class="['bottom-tag-view', {'timeout': timeout}]"><text>{{tagText}}</text></view>
<u-count-down :timestamp="orderData.currentWillOverTime || orderData.currentOverTime" font-size="44" <u-count-down :timestamp="timestamp" font-size="44"
color="#FF930D" @change="handleChange" ref="order-count-down"></u-count-down> :color="timeout ? '#FA5A49' : '#FF930D'" @change="handleChange" ref="order-count-down"></u-count-down>
</view> </view>
<view v-else-if="showTime"> <view v-else-if="showTime">
<text>{{timeTitle}}</text> <text>{{timeTitle}}</text>
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
orderStatus: 0, // 工单状态 orderStatus: 0, // 工单状态
appointmentDatetime: '', // 预约时间 appointmentDatetime: '', // 预约时间
currentWillOverTime: 10000, // 剩余时间 currentWillOverTime: 10000, // 剩余时间
currentOverTime: 0, // 超过时间 currentOverTime: new Date().getTime() + 10000, // 超过时间点
auditDatetime: '2021.04.19 12:45:09', // 审核时间 auditDatetime: '2021.04.19 12:45:09', // 审核时间
submissionTime: '2021.04.19 16:24:48', // 提交时间 submissionTime: '2021.04.19 16:24:48', // 提交时间
auditResults: {}, // 审核结果 auditResults: {}, // 审核结果
...@@ -97,7 +97,8 @@ ...@@ -97,7 +97,8 @@
}, },
data() { data() {
return { return {
timeout: false,
timestamp: 0,
}; };
}, },
computed: { computed: {
...@@ -204,8 +205,8 @@ ...@@ -204,8 +205,8 @@
return this.orderData.orderServiceType == '安装' return this.orderData.orderServiceType == '安装'
}, },
tagText() { tagText() {
return this.orderData.currentWillOverTime ? '剩' : '超' return this.timeout ? '超' : '剩'
}, },
timeText() { timeText() {
return this.orderType == 4 ? this.orderData.submissionTime : this.orderData.auditDatetime return this.orderType == 4 ? this.orderData.submissionTime : this.orderData.auditDatetime
}, },
...@@ -232,6 +233,10 @@ ...@@ -232,6 +233,10 @@
orderType() { orderType() {
return this.types[this.type] 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: { methods: {
handleClick() { handleClick() {
...@@ -241,8 +246,15 @@ ...@@ -241,8 +246,15 @@
handleClickCell() { handleClickCell() {
this.$emit('click') this.$emit('click')
}, },
handleChange(timestamp) { handleChange(timestamp) {
if (this.orderData.currentOverTime) this.$refs['order-count-down'].seconds += 2 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) { getDistance(Latitud, Longitud) {
return this.distance(Latitud, Longitud, this.location[0], this.location[1]) return this.distance(Latitud, Longitud, this.location[0], this.location[1])
...@@ -389,18 +401,19 @@ ...@@ -389,18 +401,19 @@
align-items: center; align-items: center;
.bottom-tag-view { .bottom-tag-view {
text-align: center;
width: 52rpx; width: 52rpx;
height: 52rpx; height: 52rpx;
border-radius: 26rpx; border-radius: 26rpx;
line-height: 56rpx;
color: #FFFFFF; color: #FFFFFF;
font-size: 26rpx; font-size: 26rpx;
background-color: #FA5A49; background-color: #FF930D;
margin-right: 20rpx; margin-right: 20rpx;
display: flex;
justify-content: center;
align-items: center;
&.will { &.timeout {
background-color: #FF930D; background-color: #FA5A49;
} }
} }
} }
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
data() { data() {
return { return {
showType: 1, showType: 1,
standardShow: true, standardShow: false,
cameraInfo: { cameraInfo: {
devicePosition: 'back', devicePosition: 'back',
flash: 'auto' flash: 'auto'
...@@ -120,6 +120,7 @@ ...@@ -120,6 +120,7 @@
this.initData() this.initData()
photo.currentItem = this.currentItem photo.currentItem = this.currentItem
if (this.currentItem.images.length > 0) this.standardShow = true
}, },
computed: { computed: {
titleTxt() { titleTxt() {
......
This diff is collapsed.
...@@ -75,11 +75,16 @@ ...@@ -75,11 +75,16 @@
</view> </view>
<view v-if="orderRecords.length == 0" class="no-record-view">当前暂无履约记录</view> <view v-if="orderRecords.length == 0" class="no-record-view">当前暂无履约记录</view>
<view v-else> <view v-else>
<view class="order" v-for="(record,index) in shwoOrderRecords" :key="record.operationContent"> <view class="record-line-view">
<view class="order-cell between-cell"> <view class="order-cell between-cell" v-for="(record,index) in shwoOrderRecords" :key="record.operationContent">
<view class="node-view"></view>
<view class="line-view-left">
<text>{{$u.timeFormat(record.operationDatetime, 'yyyy.mm.dd hh:MM:ss')}} </text>
</view>
<view class="line-view-right">
<text style="color: red;">{{record.overTime?'(超时)':''}}{{record.exception?'(异常)':''}}</text>
<text>{{record.operationType}}</text> <text>{{record.operationType}}</text>
<text>{{$u.timeFormat(record.operationDatetime, 'yyyy-mm-dd hh:MM:ss')}} </text> </view>
<text style="color: red;">{{record.overTime?'超时 ':''}}{{record.exception?' 异常':''}}</text>
</view> </view>
</view> </view>
<view v-if="orderRecords.length > showLenght"> <view v-if="orderRecords.length > showLenght">
...@@ -783,6 +788,41 @@ ...@@ -783,6 +788,41 @@
color: #333333; color: #333333;
margin-top: 30rpx; margin-top: 30rpx;
} }
.record-line-view {
padding-left: 30rpx;
position: relative;
margin-left: 6rpx;
}
.line-view-left {
width: 270rpx;
flex-shrink: 0;
}
.line-view-right {
text-align: right;
}
.record-line-view ::before {
content: " ";
position: absolute;
left: 0;
top: 20rpx;
width: 1px;
bottom: 20rpx;
border-left: 1px dashed #2272FF;
transform-origin: 0 0;
transform: scaleX(0.5);
}
.node-view {
margin-top: 16rpx;
position: absolute;
left: -3px;
background-color: #2272FF;
border-radius: 7rpx;
width: 14rpx;
height: 14rpx;
z-index: 1;
}
.address-cell { .address-cell {
height: 24rpx; height: 24rpx;
...@@ -900,7 +940,6 @@ ...@@ -900,7 +940,6 @@
// 页面公用css // 页面公用css
.order-cell { .order-cell {
height: 48rpx;
font-size: 26rpx; font-size: 26rpx;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
...@@ -912,6 +951,6 @@ ...@@ -912,6 +951,6 @@
.between-cell { .between-cell {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: flex-start;
} }
</style> </style>
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</template> </template>
<script> <script>
let now = Date.now() let now = new Date(new Date().toLocaleDateString()).getTime()
import appointTime from '@/components/appoint/appoint-time.vue' import appointTime from '@/components/appoint/appoint-time.vue'
export default { export default {
data() { data() {
...@@ -132,7 +132,8 @@ ...@@ -132,7 +132,8 @@
nextTraceDatetime: '', // 下次跟踪时间 nextTraceDatetime: '', // 下次跟踪时间
remark: '', // 备注 remark: '', // 备注
}, },
appointTitle: "预约时间" appointTitle: "预约时间",
num: 0,
}; };
}, },
components:{ components:{
...@@ -162,7 +163,6 @@ ...@@ -162,7 +163,6 @@
}, },
}, },
async onLoad(e) { async onLoad(e) {
// this.$u.vuex('vuex_token', 'RTOKEN7493e6defc2f1a77782f105dc297a9366763fec5');
this.orderId = 1 this.orderId = 1
this.categoryId = 88 this.categoryId = 88
if(e) { if(e) {
...@@ -173,8 +173,6 @@ ...@@ -173,8 +173,6 @@
title: "数据加载中", title: "数据加载中",
mask: true mask: true
}) })
this.loadCalendar()
this.loadTimerange()
await this.initPageData() await this.initPageData()
}, },
methods: { methods: {
...@@ -182,7 +180,8 @@ ...@@ -182,7 +180,8 @@
async initPageData() { async initPageData() {
let self = this let self = this
let params = {categoryId: self.categoryId} let params = {categoryId: self.categoryId}
let res = await self.$u.api.feedbackConfig(params) let pse = await Promise.all([self.$u.api.feedbackConfig(params), self.loadCalendar(), self.loadTimerange()])
let res = pse[0]
if(res && res.code == 200) { if(res && res.code == 200) {
self.config = res.data self.config = res.data
self.initParams() self.initParams()
...@@ -219,7 +218,7 @@ ...@@ -219,7 +218,7 @@
self.appointTitle = '预约时间' self.appointTitle = '预约时间'
if(self.dateList && self.timeList) { if(self.dateList && self.timeList) {
self.timeList.map((item, index) => { self.timeList.map((item, index) => {
if(data.item.timeRange.indexOf(item.pkey) > -1) { if(self.dateList.indexOf(item.pkey) > -1) {
item.disabled = true item.disabled = true
} else { } else {
item.disabled = false item.disabled = false
...@@ -241,7 +240,7 @@ ...@@ -241,7 +240,7 @@
async loadCalendar() { async loadCalendar() {
let self = this let self = this
let params = { let params = {
num: 1 num: this.num
} }
let res = await this.$u.api.workerCalendar(params) let res = await this.$u.api.workerCalendar(params)
if(res && res.code == 200) { if(res && res.code == 200) {
...@@ -283,25 +282,11 @@ ...@@ -283,25 +282,11 @@
if (data && data.time) { if (data && data.time) {
let num = data.num let num = data.num
let time = data.time let time = data.time
this.num = num
if (num == 0) { if (num == 0) {
this.dateList = [ this.loadCalendar()
{day: time, timeRange: []},
{day: time + (1*86400000), timeRange: []},
{day: time + (2*86400000), timeRange: []},
{day: time + (3*86400000), timeRange: []},
{day: time + (4*86400000), timeRange: []},
{day: time + (5*86400000), timeRange: []},
{day: time + (6*86400000), timeRange: []},
]
} else { } else {
this.dateList = [ this.loadCalendar()
{day: time, timeRange: []},
{day: time + (1*86400000), timeRange: []},
{day: time + (2*86400000), timeRange: []},
{day: time + (3*86400000), timeRange: []},
{day: time + (4*86400000), timeRange: []},
{day: time + (5*86400000), timeRange: []},
]
} }
} }
...@@ -435,7 +420,7 @@ ...@@ -435,7 +420,7 @@
margin-right:-24rpx; margin-right:-24rpx;
.txt-item{ .txt-item{
border-radius: 12rpx; border-radius: 12rpx;
padding:24rpx 38rpx; padding:24rpx 24rpx;
width: 196rpx; width: 196rpx;
height: 72rpx; height: 72rpx;
text-align: center; 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