Commit 13a3ac79 authored by youjie's avatar youjie

no message

parent 48d9406a
......@@ -23,6 +23,10 @@
<!-- <q-btn v-if="isPay" unelevated dense label="退款" :loading="checkLoading" color="primary" class="q-px-md"
@click="GetAliPayReturn"></q-btn> -->
<!-- <q-btn v-if="!isPay" unelevated dense label="支付" :loading="checkLoading" color="primary" class="q-px-md" @click="Gotopay"></q-btn> -->
<!-- {{min&&sec?min+'分'+sec+'秒':min==0&&sec?sec+'秒':'支付'}} -->
<q-btn unelevated dense :label="KeepTimeTitle" :loading="TimeLoading"
:disable="!TimeLoading"
color="primary" class="q-px-md" @click="KeepTimeTitle=='刷新二维码'?initPayInfo(1):''"></q-btn>
</div>
</div>
<div class="q-ma-xl" v-if="!orderNo && !loading">
......@@ -39,14 +43,22 @@
<script>
import QrcodeVue from 'qrcode.vue'
import { date } from 'quasar'
export default {
data() {
return {
TimeLoading:false,
KeepTimeTitle: '',
loading:true,
showDialog:true,
payUrl:'',
checkLoading:false,
isPay: true
isPay: true,
formattedString: null,
day:'',
hr:'',
min:'',
sec:''
}
},
props:{
......@@ -67,22 +79,56 @@ export default {
},
methods: {
getIfram(){
// var iframe = document.getElementById('aliIframe');
// var innerDoc = iframe.contentWindow.document.body.HTML;
// console.log(iframe,'000000')
// console.log(innerDoc,'----')
},
//倒计时
countdown () {
const end = Date.parse(new Date(this.formattedString))
const now = Date.parse(new Date())
const msec = end - now
if(msec<0) return;
let day = parseInt(msec / 1000 / 60 / 60 / 24)
let hr = parseInt(msec / 1000 / 60 / 60 % 24)
let min = parseInt(msec / 1000 / 60 % 60)
let sec = parseInt(msec / 1000 % 60)
this.day = day
this.hr = hr > 9 ? hr : '0' + hr
this.min = min > 9 ? min : '0' + min
this.sec = sec > 9 ? sec : '0' + sec
this.KeepTimeTitle = '60秒'
const that = this
if(min>=0 && sec>=0){
//倒计时结束关闭订单
if(min==0){
this.KeepTimeTitle = this.sec+'秒'
}
if(min==0 && sec==0){
this.KeepTimeTitle = '刷新二维码'
return
}
setTimeout(function () {
that.countdown()
}, 1000)
}
},
Gotopay(){
this.OpenNewUrl(this.payUrl)
},
initPayInfo(){
initPayInfo(type){
if(type){
this.TimeLoading = true
}
this.apipost("GetAliPayByOrderNo_post",{OrderNo:this.orderNo},r=>{
if(r.data.resultCode==1){
let timeStamp = Date.now()
timeStamp = timeStamp+(1*1000*60)
this.formattedString = date.formatDate(timeStamp, 'YYYY-MM-DD HH:mm:ss')
this.countdown()
this.payUrl = r.data.data.QrCode
this.checkPaySatausHandler()
}
this.loading=false
this.loading = false
setTimeout(()=>{
this.TimeLoading = false
},500)
})
},
checkPaySatausHandler(type){
......
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