1充值到账修改
This commit is contained in:
		| @ -330,9 +330,9 @@ | |||||||
|                     <p>主链:<strong>{{ rechargeData.blockChain }}</strong></p> |                     <p>主链:<strong>{{ rechargeData.blockChain }}</strong></p> | ||||||
|                     <p>钱包地址: <strong>{{ rechargeData.receiveAddress }}</strong></p> |                     <p>钱包地址: <strong>{{ rechargeData.receiveAddress }}</strong></p> | ||||||
|                     <p>支付金额: <strong>{{ rechargeData.amount }} USDT</strong></p> |                     <p>支付金额: <strong>{{ rechargeData.amount }} USDT</strong></p> | ||||||
|                     <p> |                     <div> | ||||||
|                       <countdown  :time="(rechargeData.expireUnix * 1000) - Date.now()" |                       <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"> |                         <template slot-scope="props"> | ||||||
|                           倒计时: |                           倒计时: | ||||||
|                           <span v-if="props.minutes>0||props.hours>0||props.days>0">{{ props.minutes }} 分</span> |                           <span v-if="props.minutes>0||props.hours>0||props.days>0">{{ props.minutes }} 分</span> | ||||||
| @ -341,7 +341,10 @@ | |||||||
|                         </template> |                         </template> | ||||||
|                            |                            | ||||||
|                         </countdown> |                         </countdown> | ||||||
|                     </p> |                        <div v-else-if="rechargeData.status===2" style="color: green"> | ||||||
|  |                         充值成功,请勿重复支付! | ||||||
|  |                       </div> | ||||||
|  |                     </div> | ||||||
|                   </div> |                   </div> | ||||||
|                 </div> |                 </div> | ||||||
|  |  | ||||||
| @ -574,12 +577,14 @@ | |||||||
|             loadingQr:false, |             loadingQr:false, | ||||||
|             rechargeData:{ |             rechargeData:{ | ||||||
|               platformId:null, |               platformId:null, | ||||||
|  |               orderNo:undefined, | ||||||
|               name:null, |               name:null, | ||||||
|               count:1, |               count:1, | ||||||
|               amount:null, |               amount:null, | ||||||
|               receiveAddress:null, |               receiveAddress:null, | ||||||
|               step:1, |               step:1, | ||||||
|               expireUnix:undefined |               expireUnix:undefined, | ||||||
|  |               status:undefined, | ||||||
|             }, |             }, | ||||||
|  |  | ||||||
|             // ECharts 图表数据 |             // ECharts 图表数据 | ||||||
| @ -587,14 +592,14 @@ | |||||||
|             xAxisData: [], |             xAxisData: [], | ||||||
|             seriesData: [], |             seriesData: [], | ||||||
|             receiveAddress: "", |             receiveAddress: "", | ||||||
|             rechargeList:[] |             rechargeList:[], | ||||||
|  |             checkOrderTimer: null, | ||||||
|           }; |           }; | ||||||
|         }, |         }, | ||||||
|         created() { |         created() { | ||||||
|         }, |         }, | ||||||
|         mounted() { |         mounted() { | ||||||
|            |            | ||||||
|           console.log(this.$refs.myCountdown) |  | ||||||
|           let token = localStorage.getItem("token"); |           let token = localStorage.getItem("token"); | ||||||
|           if (token) { |           if (token) { | ||||||
|             this.token = token; |             this.token = token; | ||||||
| @ -691,7 +696,6 @@ | |||||||
|               }); |               }); | ||||||
|           }, |           }, | ||||||
|           getUserInfo(token) { |           getUserInfo(token) { | ||||||
|             console.log("token", token); |  | ||||||
|             let that = this; |             let that = this; | ||||||
|             axios |             axios | ||||||
|               .get("/getinfo", { |               .get("/getinfo", { | ||||||
| @ -700,11 +704,8 @@ | |||||||
|                 }, |                 }, | ||||||
|               }) |               }) | ||||||
|               .then((response) => { |               .then((response) => { | ||||||
|                 console.log(response.data); |  | ||||||
|                 console.log("code", response.data.code); |  | ||||||
|                 if (response.data.code === 200) { |                 if (response.data.code === 200) { | ||||||
|                   that.userInfo = response.data.data; |                   that.userInfo = response.data.data; | ||||||
|                   console.log("userinfo", that.userInfo); |  | ||||||
|                 } else { |                 } else { | ||||||
|                   localStorage.removeItem("token"); |                   localStorage.removeItem("token"); | ||||||
|                   location.href = "login.html"; |                   location.href = "login.html"; | ||||||
| @ -762,10 +763,12 @@ | |||||||
|               amount:null, |               amount:null, | ||||||
|               receiveAddress:null, |               receiveAddress:null, | ||||||
|               step:1, |               step:1, | ||||||
|               expireUnix:undefined |               expireUnix:undefined, | ||||||
|           }; |               status:undefined, | ||||||
|  |             }; | ||||||
|  |  | ||||||
|           console.log(this.rechargeData); |             this.cleanCheckOrderTimer(); | ||||||
|  |              | ||||||
|           }, |           }, | ||||||
|           prevStep(){ |           prevStep(){ | ||||||
|       |       | ||||||
| @ -781,18 +784,20 @@ | |||||||
|  |  | ||||||
|             axios.post("/tm-member/recharge",this.rechargeData,{headers: { Authorization: `Bearer ${this.token}` }}) |             axios.post("/tm-member/recharge",this.rechargeData,{headers: { Authorization: `Bearer ${this.token}` }}) | ||||||
|             .then(res => { |             .then(res => { | ||||||
|               console.log("sss",res); |                | ||||||
|               if(res.data.code===200){ |               if(res.data.code===200){ | ||||||
|                 this.rechargeData.step=2; |                 this.rechargeData.step=2; | ||||||
|                 this.rechargeData.amount=res.data.data.amount; |                 this.rechargeData.amount=res.data.data.amount; | ||||||
|                 this.rechargeData.receiveAddress=res.data.data.receiveAddress; |                 this.rechargeData.receiveAddress=res.data.data.receiveAddress; | ||||||
|                 this.rechargeData.blockChain=res.data.data.blockChain; |                 this.rechargeData.blockChain=res.data.data.blockChain; | ||||||
|                 this.rechargeData.expireUnix=res.data.data.expireUnix; |                 this.rechargeData.expireUnix=res.data.data.expireUnix; | ||||||
|  |                 this.rechargeData.orderNo=res.data.data.orderNo; | ||||||
|                 let _that=this; |                 let _that=this; | ||||||
|  |  | ||||||
|                 this.$nextTick(() => { |                 this.$nextTick(() => { | ||||||
|                   _that.generateQRCode(_that.rechargeData.receiveAddress); |                   _that.generateQRCode(_that.rechargeData.receiveAddress); | ||||||
|                 }) |                 }) | ||||||
|  |                 _that.createCheckOrderTimer(); | ||||||
|               }else{ |               }else{ | ||||||
|                 layer.msg(res.data.msg); |                 layer.msg(res.data.msg); | ||||||
|               } |               } | ||||||
| @ -835,7 +840,7 @@ | |||||||
|               .then((response) => { |               .then((response) => { | ||||||
|                 if (response.data.code === 200) { |                 if (response.data.code === 200) { | ||||||
|                   this.userInfo = response.data.data; |                   this.userInfo = response.data.data; | ||||||
|                   console.log("userinfo", this.userInfo); |                    | ||||||
|                 } else { |                 } else { | ||||||
|                   location.href = "login.html"; |                   location.href = "login.html"; | ||||||
|                 } |                 } | ||||||
| @ -1068,7 +1073,46 @@ | |||||||
|               // 如果输入为空,给出提示 |               // 如果输入为空,给出提示 | ||||||
|               qrcodeContainer.innerHTML = ''; // 清空可能存在的旧二维码 |               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