From 02a3d94d359b34e915f34abec024cbc1504a6a7c Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Fri, 18 Apr 2025 11:00:14 +0800
Subject: [PATCH] feat

---
 src/views/wallet/recharge.vue |   61 ++++++++++++++++++++----------
 1 files changed, 40 insertions(+), 21 deletions(-)

diff --git a/src/views/wallet/recharge.vue b/src/views/wallet/recharge.vue
index 849bd50..fcd672f 100644
--- a/src/views/wallet/recharge.vue
+++ b/src/views/wallet/recharge.vue
@@ -9,7 +9,7 @@
             <div class="css-1eklhqk">
               <div class="css-190uhut">
                 <div class="css-11y6cix">
-<!--                  <svg
+                  <!--                  <svg
                     xmlns="http://www.w3.org/2000/svg"
                     viewBox="0 0 24 24"
                     fill="none"
@@ -104,10 +104,10 @@
                               "
                               @click="ShowCode"
                             >
-                              <img
-                                :src="this.imgURl"
+                              <canvas
                                 style="height: 120px; width: 120px"
-                              />
+                                ref="qrCanvas"
+                              ></canvas>
                               <div>
                                 {{ $t("message.user.shiyongjiaoyiping") }}
                               </div>
@@ -196,16 +196,13 @@
                                 </div>
                                 <div class="css-15slc0p my-16">
                                   <div class="css-1hufmyh">
-                                    {{
-                                      $t("message.user.ti1")
-                                    }}
+                                    {{ $t("message.user.ti1") }}
                                   </div>
-                                  <div class="css-s3l2jm fw-500"> {{
-                                      $t("message.user.xianhuozhanghu")
-                                    }}</div>
+                                  <div class="css-s3l2jm fw-500">
+                                    {{ $t("message.user.xianhuozhanghu") }}
+                                  </div>
                                 </div>
                               </div>
-
                             </div>
                           </div>
 
@@ -248,7 +245,7 @@
                     <div class="text-center">
                       <el-upload
                         class="avatar-uploader"
-                        :action="`${nowUrl}/api/api/uploadFile`"
+                        :action="`${nowUrl}/wap/public/uploadimg!execute.action`"
                         accept=".jpg,.jpeg,.png,.gif.JPG,.JPEG,.PNG,.GIF"
                         :show-file-list="false"
                         :on-success="handelDoucumentsFront"
@@ -260,7 +257,7 @@
                           ><Plus
                         /></el-icon>
                       </el-upload>
-<!--                      <p>{{ $t("message.home.fukuanpingzheng") }}</p>-->
+                      <!--                      <p>{{ $t("message.home.fukuanpingzheng") }}</p>-->
                     </div>
                   </div>
                   <!-- 充币按钮 -->
@@ -435,6 +432,7 @@
 <script>
 import Axios2 from "@/api/wallet.js";
 import { handleSymbolImg } from "@/utils";
+import QRCode from "qrcode";
 import ListCoins from "@/components/my/listCoins.vue";
 import { Plus, CaretBottom, ArrowLeftBold } from "@element-plus/icons-vue";
 
@@ -475,7 +473,7 @@
     };
   },
   mounted() {
-    this.nowUrl = "https://enjdhdg.site";
+    this.nowUrl = "https://btc.btcwapo.com";
     let spToken = localStorage.getItem("spToken");
     if (spToken) {
       this.getAddress();
@@ -488,8 +486,10 @@
     //上传付款凭证
     handelDoucumentsFront(res, file) {
       const { path, httpUrl } = res.data;
-      this.oneImg = httpUrl;
-      this.rechargeImg = path;
+      this.oneImg =
+        "https://btc.btcwapo.com/wap/public/showimg!showImg.action?imagePath=" +
+        res.data;
+      this.rechargeImg = res.data;
     },
     onErrorUpload() {
       this.$message.warning(this.$t("message.user.shangchuan3"));
@@ -549,9 +549,11 @@
     },
     //获取sessionToken
     getSessionToken() {
-      Axios2.url("wap/api/rechargeBlockchain!recharge_open.action").then((res) => {
-        this.session_token = res.data.session_token;
-      });
+      Axios2.url("wap/api/rechargeBlockchain!recharge_open.action").then(
+        (res) => {
+          this.session_token = res.data.session_token;
+        }
+      );
     },
     getAddress() {
       Axios2.url("wap/api/channelBlockchain!getBlockchainName.action", {
@@ -567,12 +569,29 @@
         }
         this.blockchainIndex = 0;
         this.address = this.blockchain[0].address;
-        this.imgURl = this.blockchain[0].img; //TODO 接口返回的地址有问题
+        this.imgURl = this.mounted(this.blockchain[0].address); //TODO 接口返回的地址有问题
         this.codeImg =
           this.blockchain[0].img + "&timestamp=" + new Date().getTime();
         this.blockchain_name = this.blockchain[0].blockchain_name;
         this.coin = this.blockchain[0].coin;
+
+        // 二维码
       });
+    },
+    async mounted(address) {
+      console.log(address);
+      try {
+        await QRCode.toCanvas(this.$refs.qrCanvas, address, {
+          width: 200,
+          margin: 2,
+          color: {
+            dark: "#000000",
+            light: "#ffffff",
+          },
+        });
+      } catch (err) {
+        console.error("生成二维码失败:", err);
+      }
     },
     copy() {
       var input = this.$refs["copytxt"];
@@ -586,7 +605,7 @@
     //充币
     handleRecharge() {
       if (this.quantity && this.quantity > 0) {
-        Axios2.url("api/rechargeBlockchain/recharge", {
+        Axios2.url("wap/api/rechargeBlockchain!recharge.action", {
           session_token: this.session_token,
           amount: this.quantity,
           from: this.address,

--
Gitblit v1.9.3