修改
This commit is contained in:
parent
dc482e65a3
commit
ab7bca88b9
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user