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

View File

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