|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <el-dialog center title="赠送" :visible.sync="show" width="680px">
|
|
|
+ <el-dialog center title="赠送" :visible.sync="show" width="680px" :before-close="handleClose">
|
|
|
<div class="page" v-loading="loading">
|
|
|
<div class="top-tips">通过手机号码检索用户信息,<span>赠送后该加密作品将会被转移</span></div>
|
|
|
<div class="user">
|
|
|
@@ -115,6 +115,7 @@ export default {
|
|
|
payMethods: 'WEIXIN',
|
|
|
show: false,
|
|
|
info: [],
|
|
|
+ payTimeout: undefined,
|
|
|
checked: true,
|
|
|
id: 103,
|
|
|
idOrder: 0,
|
|
|
@@ -172,6 +173,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleClose() {
|
|
|
+ this.show = false;
|
|
|
+ if (this.payTimeout) {
|
|
|
+ clearInterval(this.payTimeout);
|
|
|
+ }
|
|
|
+ },
|
|
|
init() {
|
|
|
this.status = 'Unpaid';
|
|
|
},
|
|
|
@@ -223,19 +230,30 @@ export default {
|
|
|
}, 1000);
|
|
|
}
|
|
|
},
|
|
|
- // payWatch() {
|
|
|
- // //监控支付状态
|
|
|
- // this.payTimeout = setInterval(() => {
|
|
|
- // this.$http.get('/order/gift/get/' + this.idOrder).then(res => {
|
|
|
- // console.log(res);
|
|
|
- // if (res.status === 'FINISH') {
|
|
|
- // clearInterval(this.payTimeout);
|
|
|
- // // this.status = res.status;
|
|
|
- // this.show = false;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }, 1000);
|
|
|
- // },
|
|
|
+ init2() {
|
|
|
+ this.$confirm('赠送成功,加密作品将会被转移', '赠送成功', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ customClass: 'myClass',
|
|
|
+ center: true
|
|
|
+ }).then(() => {});
|
|
|
+ },
|
|
|
+ payWatch() {
|
|
|
+ //监控支付状态
|
|
|
+ this.payTimeout = setInterval(() => {
|
|
|
+ this.$http.get('/asset/get/' + this.$route.query.id).then(res => {
|
|
|
+ console.log(res);
|
|
|
+ if (res.status === 'GIFTED') {
|
|
|
+ clearInterval(this.payTimeout);
|
|
|
+ // this.status = res.status;
|
|
|
+ this.show = false;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.init2();
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }, 1000);
|
|
|
+ },
|
|
|
submit() {
|
|
|
// if (this.payMethods === 'DCEP') {
|
|
|
// this.wait();
|
|
|
@@ -254,7 +272,7 @@ export default {
|
|
|
this.initTime(res.id, res.createdAt);
|
|
|
this.status = res.status;
|
|
|
this.idOrder = res.id;
|
|
|
- // this.payWatch();
|
|
|
+ this.payWatch();
|
|
|
// console.log(res);
|
|
|
})
|
|
|
.catch(e => {
|
|
|
@@ -300,7 +318,21 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
-
|
|
|
+<style lang="less">
|
|
|
+.myClass {
|
|
|
+ width: 340px;
|
|
|
+ .el-button {
|
|
|
+ background: linear-gradient(133deg, @prim 0%, @warn 100%);
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 0;
|
|
|
+ }
|
|
|
+ .el-button:nth-last-child(2) {
|
|
|
+ background: #c4c7cc;
|
|
|
+ color: #ffffff;
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
<style lang="less" scoped>
|
|
|
/deep/ .el-checkbox__inner {
|
|
|
// width: 24px;
|