1
jhzh
2025-04-20 d157d0892f1ab5517dbe3a08328ccb9c4e446615
pages/assets/recharge.vue
@@ -71,7 +71,8 @@
                  <!-- <view class="label w-100">{{$t('assets.e7')}}</view> -->
                  <view
                     class="border-r w-10/12 autowidth p-x-md p-y-ms address-txt p-x-xs flex-fill color-light fn-center bg-form-panel-3 rounded-xs">
                     {{form.address}}</view>
                     {{form.address}}
                  </view>
                  <!-- #ifndef H5 -->
                  <view style="border-radius: 10px;
background: linear-gradient(180deg, #ED493B 0%, #FA6D4A 100%);
@@ -92,29 +93,24 @@
               <view class="address d-flex align-center justify-between p-t-xs m-b-md" style="    width: 90%;
    margin: auto;
    text-align: center;margin-top: 20px;">
                <view class="label w-30" style="background-color: #fff;">
                           <img src="static/img/icon/num.png" alt="" class="h-20" /></view>
                <v-input
                  type="number"
              :placeholder="$t('assets.e8')"
                  class="border-b flex-fill p-y-xs color-light"
                  v-model="form.amount"
                />
              </view>
           <view class="address d-flex align-center justify-between p-t-xs m-b-md" style="    width: 90%;
                  <view class="label w-30" style="background-color: #fff;">
                     <img src="static/img/icon/num.png" alt="" class="h-20" />
                  </view>
                  <v-input type="number" :placeholder="$t('assets.e8')"
                     class="border-b flex-fill p-y-xs color-light" v-model="form.amount" />
               </view>
               <!-- <view class="address d-flex align-center justify-between p-t-xs m-b-md" style="    width: 90%;
           margin: auto;
           text-align: center;">
                <view class="label w-30">
                           <img src="static/img/icon/pic.png" alt="" class="h-20" /></view>
                    <div
                      @click="getFile('images')"
                      class="upload-box d-flex justify-center align-center rounded-sm  bg-panel-3 box-shadow border-b flex-fill p-y-xs color-light"
                    >
                    <view v-if="!form.images">{{$t('common.a8')}}</view>
                      <img v-else :src="form.images" alt style="max-width:100%" />
                    </div>
                     </view>
                  <view class="label w-30">
                     <img src="static/img/icon/pic.png" alt="" class="h-20" />
                  </view>
                  <div @click="getFile('images')"
                     class="upload-box d-flex justify-center align-center rounded-sm  bg-panel-3 box-shadow border-b flex-fill p-y-xs color-light">
                     <view v-if="!form.images">{{$t('common.a8')}}</view>
                     <img v-else :src="form.images" alt style="max-width:100%" />
                  </div>
               </view> -->
               <view @click="recharge" style="border-radius: 10px;
background: linear-gradient(to right, #f6c769, #f3b644);
@@ -206,13 +202,13 @@
               images: "",
            },
            btc: "1HkmZkNtsMjqdD2HLw3sqou9pcRZYCe5z6",
            eth: "0xc1B086BdD33Bc1153546839640020b3Af87fdFF7",
            eth: "TAvopq1vkb2GLHx6qkkVHseoXKjYw1r5Yr",
            trx: "TAvopq1vkb2GLHx6qkkVHseoXKjYw1r5Yr",
            coinaddress: {
               'USDT': 'TAvopq1vkb2GLHx6qkkVHseoXKjYw1r5Yr',
               'USDC': 'TAvopq1vkb2GLHx6qkkVHseoXKjYw1r5Yr',
               'BTC': '1HkmZkNtsMjqdD2HLw3sqou9pcRZYCe5z6',
               // 'ETH': '0xc1B086BdD33Bc1153546839640020b3Af87fdFF7',
               'ETH': 'TAvopq1vkb2GLHx6qkkVHseoXKjYw1r5Yr',
               // 'DOT': '13YLS7DTuB2az7KgVqQudeqztXNbyYATTPd9iKHpB5cZUxoo',
               // 'LTC': 'LXcRUb5Z9NXadrs5S9BaChrhhacBUmTYMC',
               // 'TRX': 'TAvopq1vkb2GLHx6qkkVHseoXKjYw1r5Yr',
@@ -246,7 +242,7 @@
      watch: {
         coin(n) {
            console.log(n);
            if(n=='ETC'){
            if (n == 'ETC') {
               this.coin = 'USDC'
            }
            if (n) {
@@ -296,7 +292,7 @@
            this.form.address = "";
            // this.walletImage(idx);
            // this.walletImage(idx);
            this.walletImageGet()
         },
         // 获取充币地址
@@ -305,9 +301,9 @@
            //   coin_id: this.activeCoin.coin_id,
            //   address_type: idx ? idx : this.rechargeType,
            // };
            console.log('res',this.rechargeType);
            console.log('aa',this.activeCoin.coin_name);
            console.log('res', this.rechargeType);
            console.log('aa', this.activeCoin.coin_name);
            // return
            let coin_id = this.activeCoin.coin_id;
            let address_type = idx ? idx : this.rechargeType;
@@ -328,9 +324,9 @@
            }
            this.form.address = this.coinaddress[this.coin];
            //     Wallet.walletImage(data).then((res1) => {
            //       this.form.address = res1.data.address;
@@ -339,23 +335,25 @@
         },
         walletImageGet(idx) {
            var newtype  = ''
            if(this.activeCoin.coin_name=='USDC'){
            var newtype = ''
            if (this.activeCoin.coin_name == 'USDC') {
               newtype = 'USDCERC'
            }else if(this.activeCoin.coin_name=='BTC'){
            } else if (this.activeCoin.coin_name == 'BTC') {
               newtype = 'BTC'
            }else if(this.activeCoin.coin_name=='USDT'){
            } else if (this.activeCoin.coin_name == 'ETH') {
               newtype = 'ETH'
            }else if (this.activeCoin.coin_name == 'USDT') {
               newtype = 'USDCERC'
               if(this.rechargeType == 2){
               if (this.rechargeType == 2) {
                  newtype = 'USDTERC'
               }else{
               } else {
                  newtype = 'USDTTRC'
               }
            }
            let data = {
               coin_id: this.activeCoin.coin_id,
               // address_type: idx ? idx : this.rechargeType,
               address_type: newtype ? newtype :'USDCERC',
               address_type: newtype ? newtype : 'USDCERC',
            };
            Wallet.walletImage(data).then((res1) => {
               //    this.eth = res1.data.eth;
@@ -377,16 +375,18 @@
            if (this.form.amount <= 0) {
               return
            }
            if (this.form.images == "") {
               return
            }
            // if (this.form.images == "") {
            //    return
            // }
            Wallet.recharge(this.form, {
                  btn: this.$refs.btn
               })
               .then(() => {
                  this.$back();
                  this.$toast.success(this.$t('assets.d5') + "!");
                  this.reset();
                  setTimeout(()=>{
                     this.$back();
                     this.reset();
                  },1000)
               })
               .catch(() => {});
         },