Commit ef8c1142 authored by 刘用法's avatar 刘用法

超时控件

parent 1acc779b
......@@ -34,7 +34,7 @@
<view v-if="showCountTime" class="bottom-left-view">
<view :class="['bottom-tag-view', {'timeout': timeout}]"><text>{{tagText}}</text></view>
<u-count-down :timestamp="timestamp" font-size="40" show-days separator="zh"
:color="timeout ? '#FA5A49' : '#FF930D'" @change="handleChange" ref="order-count-down"></u-count-down>
:color="timeout ? '#FA5A49' : '#FF930D'" @change="handleChange"separator-color="#333333" ref="order-count-down"></u-count-down>
</view>
<view v-else-if="showTime">
<text>{{timeTitle}}</text>
......@@ -408,7 +408,7 @@
color: #FFFFFF;
font-size: 26rpx;
background-color: #FF930D;
margin-right: 20rpx;
margin-right: 16rpx;
display: flex;
justify-content: center;
align-items: center;
......
......@@ -118,8 +118,8 @@
</view>
<view v-if="showCenterBtn" @click="handleBtn" class="button" :class="['center-button-view', btnClass]">
<text>{{ centerButtonText }}</text>
<view v-if="order.currentOverTime > 0" class="time-view">
<text style="margin-right: 8rpx;">{{order.currentOverTime * 1000 > new Date().getTime()?'剩':'超'}}</text>
<view v-if="order.currentOverTime" class="time-view">
<text>{{order.currentOverTime > new Date().getTime()?'剩':'超'}}</text>
<u-count-down
:timestamp="timestampDiff(order.currentOverTime)"
font-size="20"
......@@ -128,7 +128,6 @@
separator-color="#FFFFFF"
separator-size="20"
:ref="'uCountDown'"
height="20"
:show-days="threeDays()"
:show-minutes="!threeDays()"
:show-seconds="!threeDays()"
......@@ -614,13 +613,7 @@
if(!currentOverTime){
return 0
}
var nowTime = new Date(); // 当前时间
if(nowTime.getTime() > currentOverTime*1000){
var diff = nowTime.getTime() - (currentOverTime*1000);
}else{
var diff = (currentOverTime*1000) - nowTime.getTime();
}
return diff;
return Math.round(Math.abs(currentOverTime - new Date().getTime()) / 1000)
},
timeOutChange(currentOverTime){
let self = this
......@@ -638,7 +631,7 @@
})
},
threeDays() {
return this.timestampDiff(order.currentOverTime) > 3600 * 24 * 3
return this.timestampDiff(this.order.currentOverTime) > 3600 * 24 * 3
}
}
};
......
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