zhangwei 3 lat temu
rodzic
commit
9e5fb481bf
2 zmienionych plików z 34 dodań i 24 usunięć
  1. 11 6
      src/view/popup/withdraw/info.vue
  2. 23 18
      src/view/red-packet.vue

+ 11 - 6
src/view/popup/withdraw/info.vue

@@ -6,7 +6,7 @@
     <div class="content">
       <div class="area-input-1">
         <div class="token">
-          <div class="title">Token</div>
+          <div class="title">Crypto</div>
           <div class="box">
             <img :src="withdraw_info.icon_token" alt="">
             <span>{{ withdraw_info.token_symbol }}</span>
@@ -14,7 +14,7 @@
         </div>
 
         <div class="net">
-          <div class="title">NetWork</div>
+          <div class="title">Withdrawal Network</div>
           <div class="box">
             <img :src="withdraw_info.icon_net" alt="">
             <!-- <span>{{ withdraw_info.token_chain }}</span> -->
@@ -48,10 +48,9 @@
           <img :src="require('@/assets/svg/icon-top-up-tips-warning.svg')" alt="">
         </div>
         <div class="tips-content">
-          <p>1.Make sure you also selected </p>
-          <p style="color: red;">BNB Smart Chain (BEP20) </p>
-          <p>on the platform where you are depositing funds to. Otherwise, you'll lose your assets.</p>
-          <p>2.As the withdrawal is transferred out, you can check the transaction history. </p>
+          <p>Select the same network on the platform where you are depositing funds to. Otherwise, you'll lose your
+            assets.</p>
+          <p>As the withdrawal is transferred out, you can check the transaction history.</p>
         </div>
       </div>
     </div>
@@ -119,6 +118,12 @@ const inputText = () => {
     state.is_enter_state = false
     return
   }
+
+  if (state.input_address.trim().length != 42 || state.input_address.trim().substring(0, 2).toLowerCase() != '0x') {
+    state.error_msg = 'Incorrect wallet address input'
+    state.is_enter_state = false
+    return
+  }
   if (Number(state.input_amount) > Number(state.balance)) {
     state.error_msg = `Insufficient ${withdraw_info.token_symbol} balance`
     state.is_enter_state = false

+ 23 - 18
src/view/red-packet.vue

@@ -95,7 +95,7 @@
         </div>
         <div class="done" @click="clickDone">
           <img :src="require('@/assets/subject/001-icon-done.svg')" alt class="icon-done" />
-          <span>Giveaways transferred to Wallet</span>
+          <span>View Rewards In Wallet</span>
           <img :src="require('@/assets/svg/icon-right.svg')" alt class="icon-right" />
         </div>
       </div>
@@ -304,25 +304,28 @@ function handleScroll(e) {
   if ((e.clientHeight + e.scrollTop) / e.scrollHeight > .8) {
     data.luck_list_end = true
     data.page_index++
-    getReceivedList({
-      params: {
-        pageNum: data.page_index,
-        pageSize: data.page_size,
-        postId: data.postId
-      }
-    }).then((res) => {
-      if (res.code == 0) {
-        if (res.data.length > 0) {
-          data.detail.allReceived = data.detail.allReceived.concat(res.data)
-          data.luck_list_end = false
-        } else {
-          data.luck_list_end = true
-        }
+    handleReceivedList()
+  }
+}
+function handleReceivedList() {
+  getReceivedList({
+    params: {
+      pageNum: data.page_index,
+      pageSize: data.page_size,
+      postId: data.postId
+    }
+  }).then((res) => {
+    if (res.code == 0) {
+      if (res.data.length > 0) {
+        data.detail.allReceived = data.detail.allReceived.concat(res.data)
+        data.luck_list_end = false
       } else {
-        console.log('getReceivedList', res)
+        data.luck_list_end = true
       }
-    })
-  }
+    } else {
+      console.log('getReceivedList', res)
+    }
+  })
 }
 
 
@@ -715,11 +718,13 @@ function handleErrorCode(res) {
     case '2007':
       data.status = 'close'
       data.close_text = ['All the rewards have', 'been taken out, come', 'earlier next time! ']
+      init()
       break
     // 红包个数已经被领取完了
     case '2008':
       data.status = 'close'
       data.close_text = ['All the rewards have', 'been taken out, come', 'earlier next time! ']
+      init()
       break
     // 该用户不满足领取条件
     case '2009':