This commit is contained in:
曹辉 2023-04-27 09:40:13 +08:00
parent dc482e65a3
commit ab7bca88b9

View File

@ -43,38 +43,50 @@
trainingItemOrder,
appletTrainingOrderPay
} from '@/api/learning/index.js'
import {
handCloseOrder
} from '@/api/Orderdetails/index.js'
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
baseurl: undefined,
trainingOrderNo: undefined,
list: undefined,
timestamp: 0,
timestamp2: 0,
timer: null,
timecount: 0,
Timer: null,
};
},
onUnload() {
clearInterval(this.Timer); //
},
watch: {
timestamp2() {
if (this.timestamp2 <= 0) {}
timecount() {
if (this.timecount <= 0) {
handCloseOrder().then(res => {
clearInterval(this.Timer); //
})
}
}
},
onLoad(options) {
this.trainingOrderNo = options.trainingOrderNo
this.baseurl = baseurl
this.list = JSON.parse(options.list)
var ordertimes = this.list.trainingOrderTime.replaceAll(/\-/gi, "/")
var time = new Date(this.list.trainingOrderTime).getTime() / 1000 + (60 * 60 * 2)
var times = new Date().getTime() / 1000
this.timestamp = time - times
this.timestamp2 = this.timestamp
this.timer = setInterval(() => {
this.timestamp2--;
this.timecount = this.timestamp
this.Timer = setInterval(() => {
this.timecount--;
}, 1000)
},
methods: {
info() {
},
//
tobuy() {
var that = this