Browse Source

更改私钥

wkw 2 days ago
parent
commit
d13de85cf7
2 changed files with 7 additions and 36 deletions
  1. 1 31
      src/pages/home/index.vue
  2. 6 5
      src/pages/trade/index.vue

+ 1 - 31
src/pages/home/index.vue

@@ -12,7 +12,7 @@
       <view class="home-code">
         <view class="home-url">
           <view class="url">http://www.wgt.cool</view>
-          <view class="btn" @click="awardFun">分享链接</view>
+          <view class="btn">分享链接</view>
         </view>
         <view class="code-img">
           <image src="@/static/image/test/code-img.png" mode="scaleToFill" />
@@ -80,8 +80,6 @@
   <script setup>
 import { ref, onMounted, reactive } from "vue";
 import Header from "@/components/Header";
-import { getCoinList } from "@/api/currency";
-import { matchList } from "@/api/game";
 import { useCounterStore } from "@/stores/counter";
 const counter = useCounterStore();
 counter.count++;
@@ -92,34 +90,6 @@ counter.increment();
 const star = ref(3);
 const count = ref(0);
 const list5 = reactive([1, 2, 3]);
-
-
-
-
-
-
-import { WGTForToken,STTForToken,getBalance } from "@/utils/web.js";
-
-// 例子  存WGT或者STT
-const awardFun = async () => {
-  // const privateKey = window.android.getPrivateKey();//app
-  const privateKey = "0x4553077da5d773773dad0511c6e5d33142ae2c1bd05a3a8a4a7becbc0d23d9b5"; //h5
-  try {
-    const result = await WGTForToken(privateKey, 0.0012);
-    if (result.status === "success") {
-      console.log(result);
-    }else{
-      console.log(result);
-    }
-  } catch (error) {}
-
-  // try {
-  //   const balance = await getBalance(privateKey,'stt');
-  //   console.log(balance)
-  // }catch(error){
-
-  // }
-};
 </script>
   
   <style lang="scss" scoped>

+ 6 - 5
src/pages/trade/index.vue

@@ -282,7 +282,8 @@ const WGTbalance = ref(0);
 const STTbalance = ref(0);
 const entry_fee = ref(0);
 const wgt_price = ref(0);
-const privateKey = "0x4553077da5d773773dad0511c6e5d33142ae2c1bd05a3a8a4a7becbc0d23d9b5";
+const privateKey = window.android.getPrivateKey();//app
+// const privateKey = "0x4553077da5d773773dad0511c6e5d33142ae2c1bd05a3a8a4a7becbc0d23d9b5";//H5
 
 const bgClass = computed(() => {
   if (gameCheck.value === 0) return 'bg1';
@@ -392,7 +393,7 @@ const handleTokenSignUp = async (signUpFn, price) => {
       uni.showToast({
         title: result.message || "报名失败",
         icon: 'none',
-        duration: 1000
+        duration: 5000
       });
     }
   } catch (error) {
@@ -400,7 +401,7 @@ const handleTokenSignUp = async (signUpFn, price) => {
     uni.showToast({
       title: error.message || "报名失败",
       icon: 'none',
-      duration: 1000
+      duration: 5000
     });
   }
 };
@@ -449,7 +450,7 @@ const getsendSingleReward = async (prize_money) =>{
       uni.showToast({
         title: result.message || "领取失败",
         icon: 'none',
-        duration: 1000
+        duration: 5000
       });
     }
   } catch (error) {
@@ -457,7 +458,7 @@ const getsendSingleReward = async (prize_money) =>{
     uni.showToast({
       title: error.message || "领取失败",
       icon: 'none',
-      duration: 1000
+      duration: 5000
     });
   }
 }