Compare commits
3 Commits
4d02138893
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| eda41d7e00 | |||
| 6595f445b4 | |||
| ee955f5799 |
BIN
static/image/usdtlogo.png
Normal file
BIN
static/image/usdtlogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.0 KiB |
2
static/js/buefy.min.js
vendored
Normal file
2
static/js/buefy.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
static/js/css/buefy.min.css
vendored
Normal file
1
static/js/css/buefy.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -330,18 +330,21 @@
|
||||
<p>主链:<strong>{{ rechargeData.blockChain }}</strong></p>
|
||||
<p>钱包地址: <strong>{{ rechargeData.receiveAddress }}</strong></p>
|
||||
<p>支付金额: <strong>{{ rechargeData.amount }} USDT</strong></p>
|
||||
<p>
|
||||
<div>
|
||||
<countdown :time="(rechargeData.expireUnix * 1000) - Date.now()"
|
||||
v-if="rechargeData.expireUnix && (rechargeData.expireUnix * 1000) > Date.now()" >
|
||||
v-if="rechargeData.status!==2&& rechargeData.expireUnix && (rechargeData.expireUnix * 1000) > Date.now()" >
|
||||
<template slot-scope="props">
|
||||
倒计时:
|
||||
<span v-if="props.minutes>0||props.hours>0||props.days>0">{{ props.minutes }} 分</span>
|
||||
<span v-if="props.seconds>0||props.minutes>0||props.hours>0||props.days>0">{{ props.seconds }} 秒</span>
|
||||
<span v-if="props.days==0&&props.hours==0&&props.minutes==0&&props.seconds==0">订单已过期,请勿支付!</span>
|
||||
<span style="color: red;" v-if="props.days==0&&props.hours==0&&props.minutes==0&&props.seconds==0">订单已过期,请勿支付!</span>
|
||||
</template>
|
||||
|
||||
</countdown>
|
||||
</p>
|
||||
<div v-else-if="rechargeData.status===2" style="color: green">
|
||||
充值成功,请勿重复支付!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -358,7 +361,6 @@
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-overlay-record" style="display: none">
|
||||
<div class="service-modal">
|
||||
@ -384,7 +386,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<style>
|
||||
|
||||
@ -576,12 +577,14 @@
|
||||
loadingQr:false,
|
||||
rechargeData:{
|
||||
platformId:null,
|
||||
orderNo:undefined,
|
||||
name:null,
|
||||
count:1,
|
||||
amount:null,
|
||||
receiveAddress:null,
|
||||
step:1,
|
||||
expireUnix:undefined
|
||||
expireUnix:undefined,
|
||||
status:undefined,
|
||||
},
|
||||
|
||||
// ECharts 图表数据
|
||||
@ -589,14 +592,14 @@
|
||||
xAxisData: [],
|
||||
seriesData: [],
|
||||
receiveAddress: "",
|
||||
rechargeList:[]
|
||||
rechargeList:[],
|
||||
checkOrderTimer: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
|
||||
console.log(this.$refs.myCountdown)
|
||||
let token = localStorage.getItem("token");
|
||||
if (token) {
|
||||
this.token = token;
|
||||
@ -693,7 +696,6 @@
|
||||
});
|
||||
},
|
||||
getUserInfo(token) {
|
||||
console.log("token", token);
|
||||
let that = this;
|
||||
axios
|
||||
.get("/getinfo", {
|
||||
@ -702,11 +704,8 @@
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
console.log(response.data);
|
||||
console.log("code", response.data.code);
|
||||
if (response.data.code === 200) {
|
||||
that.userInfo = response.data.data;
|
||||
console.log("userinfo", that.userInfo);
|
||||
} else {
|
||||
localStorage.removeItem("token");
|
||||
location.href = "login.html";
|
||||
@ -764,10 +763,12 @@
|
||||
amount:null,
|
||||
receiveAddress:null,
|
||||
step:1,
|
||||
expireUnix:undefined
|
||||
};
|
||||
expireUnix:undefined,
|
||||
status:undefined,
|
||||
};
|
||||
|
||||
this.cleanCheckOrderTimer();
|
||||
|
||||
console.log(this.rechargeData);
|
||||
},
|
||||
prevStep(){
|
||||
|
||||
@ -783,18 +784,20 @@
|
||||
|
||||
axios.post("/tm-member/recharge",this.rechargeData,{headers: { Authorization: `Bearer ${this.token}` }})
|
||||
.then(res => {
|
||||
console.log("sss",res);
|
||||
|
||||
if(res.data.code===200){
|
||||
this.rechargeData.step=2;
|
||||
this.rechargeData.amount=res.data.data.amount;
|
||||
this.rechargeData.receiveAddress=res.data.data.receiveAddress;
|
||||
this.rechargeData.blockChain=res.data.data.blockChain;
|
||||
this.rechargeData.expireUnix=res.data.data.expireUnix;
|
||||
this.rechargeData.orderNo=res.data.data.orderNo;
|
||||
let _that=this;
|
||||
|
||||
this.$nextTick(() => {
|
||||
_that.generateQRCode(_that.rechargeData.receiveAddress);
|
||||
})
|
||||
_that.createCheckOrderTimer();
|
||||
}else{
|
||||
layer.msg(res.data.msg);
|
||||
}
|
||||
@ -837,7 +840,7 @@
|
||||
.then((response) => {
|
||||
if (response.data.code === 200) {
|
||||
this.userInfo = response.data.data;
|
||||
console.log("userinfo", this.userInfo);
|
||||
|
||||
} else {
|
||||
location.href = "login.html";
|
||||
}
|
||||
@ -1070,7 +1073,46 @@
|
||||
// 如果输入为空,给出提示
|
||||
qrcodeContainer.innerHTML = ''; // 清空可能存在的旧二维码
|
||||
}
|
||||
}
|
||||
},
|
||||
getOrderStatus(orderNo){
|
||||
let that=this;
|
||||
let params={orderNo}
|
||||
|
||||
axios
|
||||
.get("/tm-member/order", {
|
||||
headers: {
|
||||
Authorization: `Bearer ${this.token}`,
|
||||
},
|
||||
params:{orderNo}
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.data.code === 200) {
|
||||
if(that.rechargeData.orderNo===response.data.data.orderNo && response.data.data.status===2){
|
||||
that.rechargeData.status=response.data.data.status;
|
||||
|
||||
that.cleanCheckOrderTimer();
|
||||
}
|
||||
} else {
|
||||
// location.href = "login.html";
|
||||
}
|
||||
});
|
||||
},
|
||||
//定时检查订单状态
|
||||
createCheckOrderTimer() {
|
||||
if (this.checkOrderTimer) {
|
||||
clearInterval(this.checkOrderTimer);
|
||||
}
|
||||
|
||||
console.log("createCheckOrderTimer")
|
||||
this.checkOrderTimer = setInterval(() => {
|
||||
this.getOrderStatus(this.rechargeData.orderNo);
|
||||
}, 10000);
|
||||
},
|
||||
cleanCheckOrderTimer() {
|
||||
if (this.checkOrderTimer) {
|
||||
clearInterval(this.checkOrderTimer);
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user