Commit 13a3ac79 authored by youjie's avatar youjie

no message

parent 48d9406a
...@@ -23,6 +23,10 @@ ...@@ -23,6 +23,10 @@
<!-- <q-btn v-if="isPay" unelevated dense label="退款" :loading="checkLoading" color="primary" class="q-px-md" <!-- <q-btn v-if="isPay" unelevated dense label="退款" :loading="checkLoading" color="primary" class="q-px-md"
@click="GetAliPayReturn"></q-btn> --> @click="GetAliPayReturn"></q-btn> -->
<!-- <q-btn v-if="!isPay" unelevated dense label="支付" :loading="checkLoading" color="primary" class="q-px-md" @click="Gotopay"></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> </div>
<div class="q-ma-xl" v-if="!orderNo && !loading"> <div class="q-ma-xl" v-if="!orderNo && !loading">
...@@ -39,14 +43,22 @@ ...@@ -39,14 +43,22 @@
<script> <script>
import QrcodeVue from 'qrcode.vue' import QrcodeVue from 'qrcode.vue'
import { date } from 'quasar'
export default { export default {
data() { data() {
return { return {
TimeLoading:false,
KeepTimeTitle: '',
loading:true, loading:true,
showDialog:true, showDialog:true,
payUrl:'', payUrl:'',
checkLoading:false, checkLoading:false,
isPay: true isPay: true,
formattedString: null,
day:'',
hr:'',
min:'',
sec:''
} }
}, },
props:{ props:{
...@@ -67,22 +79,56 @@ export default { ...@@ -67,22 +79,56 @@ export default {
}, },
methods: { methods: {
getIfram(){ //倒计时
// var iframe = document.getElementById('aliIframe'); countdown () {
// var innerDoc = iframe.contentWindow.document.body.HTML; const end = Date.parse(new Date(this.formattedString))
// console.log(iframe,'000000') const now = Date.parse(new Date())
// console.log(innerDoc,'----') 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(){ Gotopay(){
this.OpenNewUrl(this.payUrl) this.OpenNewUrl(this.payUrl)
}, },
initPayInfo(){ initPayInfo(type){
if(type){
this.TimeLoading = true
}
this.apipost("GetAliPayByOrderNo_post",{OrderNo:this.orderNo},r=>{ this.apipost("GetAliPayByOrderNo_post",{OrderNo:this.orderNo},r=>{
if(r.data.resultCode==1){ 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.payUrl = r.data.data.QrCode
this.checkPaySatausHandler() this.checkPaySatausHandler()
} }
this.loading=false this.loading = false
setTimeout(()=>{
this.TimeLoading = false
},500)
}) })
}, },
checkPaySatausHandler(type){ 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