USER-20230908AJ\Administrator 6 сар өмнө
parent
commit
598fdbf19c

+ 1 - 1
common/wallet/tokenpocket-wallet/tokenpocket-bnb.js

@@ -8,7 +8,7 @@ import web3 from "web3";
 let tokenpocketBnb = {}
 
 let contractArr=[
-    '0x15ef4d92595aad506885861668cf463c09d1063e',//token
+    '0x2d8bcd573bb87aff0b514bb41bb8f09e8e40d18d',//token
     '0x337610d27c682e347c9cd60bd4b3b107c9d34ddd',//usdt
 ];
 

+ 17 - 2
pages/home/home-index.vue

@@ -1,5 +1,6 @@
 <script>
 import tokenpocketBnb from "@/common/wallet/tokenpocket-wallet/tokenpocket-bnb";
+import {getTotalMoney} from "@/api/money";
 
 export default {
   name: "home-index",
@@ -17,12 +18,26 @@ export default {
   data() {
     return {
       coinNum:'',
+      pledgeTotal:'',
+      revenueTotal:'',
+      price:'',
     };
   },
   mounted() {
     this.getIconNum()
+    this.getTotalMoney()
   },
   methods: {
+    getTotalMoney(){
+      getTotalMoney().then(res=>{
+        if (res.code===1){
+          this.pledgeTotal=res.data.pledgeTotal
+          this.revenueTotal=res.data.revenueTotal
+          this.price=res.data.price
+
+        }
+      })
+    },
     async  getIconNum(){
       if(this.address===''){
         return
@@ -53,7 +68,7 @@ export default {
             DAO價格($)
           </view>
           <view class="fs-28 fw-b">
-            0.13
+            {{price}}
           </view>
         </view>
         <view class="flex-1 flex-direction-column align-items-center flex-justify-center">
@@ -69,7 +84,7 @@ export default {
             贡献总额
           </view>
           <view class="fs-28 fw-b">
-            0.13
+            {{pledgeTotal}}
           </view>
         </view>
       </view>

+ 55 - 17
pages/my/inner-page/all_profit.vue

@@ -1,12 +1,48 @@
 <script>
-	export default {
+import {getTotalMoney, getWaterList} from "@/api/money";
+  import tokenpocketBnb from "@/common/wallet/tokenpocket-wallet/tokenpocket-bnb";
+  import tools from "@/common/js/tools";
+  import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
+
+  export default {
 		name: "all-profit",
-		components: {},
+		components: {EnBlank},
 		data() {
-			return {};
+			return {
+        address:'',
+        revenueTotal:'',
+        list:[],
+        page:1
+      };
 		},
-		mounted() {},
+		mounted() {
+      this.getTotalMoney()
+      this.getWaterList()
+    },
 		methods: {
+      async getAccount(){
+        this.address= tokenpocketBnb.getMyAddress()
+
+      },
+      getWaterList(){
+        getWaterList({'page':this.page,water_key:[4,5]}).then(res=>{
+          if(res.code===1){
+            ++this.page
+            if(res.data.items.length>0){
+              this.list.push(...res.data.items)
+            }
+          }
+        })
+      },
+      getTotalMoney(){
+        getTotalMoney().then(res=>{
+          if (res.code===1){
+            this.pledgeTotal=res.data.pledgeTotal
+            this.revenueTotal=res.data.revenueTotal
+
+          }
+        })
+      },
 			returnBut() {
 				uni.navigateBack({
 					delta: 1
@@ -28,33 +64,35 @@
 				总收益
 			</view>
 			<view class="fs-18 fc-f fw-b mb-16">
-				100
-			</view>
-			<view class="fs-28 fc-f text-align-center tx-box b-rad-20">
-				提现
+				{{revenueTotal}}
 			</view>
+<!--			<view class="fs-28 fc-f text-align-center tx-box b-rad-20">-->
+<!--				提现-->
+<!--			</view>-->
 		</view>
 		<view class="fs-28 fw-b mb-10">
 			历史明细
 		</view>
 		<view class="scroll-view-css b-rad-20">
-			<view v-for="item in 18" :key="item.id"
+			<view v-for="item in list" :key="item.id"
 				class="p-20 box-sizing-border bgc-f b-rad-20 align-items-center flex-justify-space">
 				<view>
 					<view class="fs-28 fw-b mb-16">
-						静态释放
+						{{item.status_str}}
 					</view>
 					<view class="fs-12 fc-858585">
-						2023-12-11 20:44:10
+            {{item.created_date}}
 					</view>
 				</view>
-				<view class="fs-28 fw-b">
-					0.4
+				<view class="fs-28 fw-b" v-if="item.price>=0.001">
+          {{(item.price*1).toFixed(3)}}
 				</view>
+        <view class="fs-28 fw-b" v-else>
+          {{(item.price*1).toFixed(6)}}
+        </view>
 			</view>
-			<view class="fs-28 text-align-center pt-10">
-				~暂无记录
-			</view>
+      <en-blank v-if="list.length<=0" message="~暂无记录"></en-blank>
+
 		</view>
 	</view>
 </template>
@@ -85,4 +123,4 @@
 		padding: 60rpx 0;
 		background-image: linear-gradient(270deg, #ffc62c, #ffa954);
 	}
-</style>
+</style>

+ 54 - 43
pages/my/my-index.vue

@@ -19,6 +19,7 @@ export default {
   data() {
     return {
       coinNum:'',
+      coinText:'',
       pledgeTotal:'',
       revenueTotal:'',
       list:[],
@@ -31,11 +32,19 @@ export default {
     this.getTeamList()
   },
   methods: {
+    abbreviateString(str ){
+      let startLength=4;
+      let endLength=4;
+      if (str.length <= startLength + endLength + 1) {
+        return str; // 如果字符串长度不足以被截断,则返回原字符串
+      }
+      return str.slice(0, startLength) + '...' + str.slice(-endLength);
+    },
     getTeamList(){
       getTeamList({'page':this.page}).then(res=>{
         if(res.code===1){
           ++this.page
-          this.list.push(res.data.items)
+          this.list.push(...res.data.items)
         }
       })
     },
@@ -48,12 +57,14 @@ export default {
         }
       })
     },
-    async  getIconNum(){
+      getIconNum(){
+        this.address=tokenpocketBnb.getMyAddress()
       if(this.address===''){
         return
       }
-      this.coinNum= await tokenpocketBnb.getTokenBalance(this.address,0)
-      console.log(this.coinNum,"icon-num----------------------")
+       tokenpocketBnb.getTokenBalance(this.address,0).then(coinNum=>{
+        this.coinNum=coinNum
+      })
 
     },
     goUrl() {
@@ -66,50 +77,50 @@ export default {
 </script>
 
 <template>
-<div>
-  <div class="align-items-center mb-32">
-    <div class="h-80 b-rad-20 bg-one flex-1 flex-direction-column align-items-center flex-justify-center mr-20">
-      <div class="fs-28 fc-f">余额</div>
-      <div class="fs-30 fc-f fw-b">
+<view>
+  <view class="align-items-center mb-32">
+    <view class="h-80 b-rad-20 bg-one flex-1 flex-direction-column align-items-center flex-justify-center mr-20">
+      <view class="fs-28 fc-f">余额</view>
+      <view class="fs-30 fc-f fw-b">
         {{coinNum}}
-      </div>
-    </div>
-    <div class="h-80 b-rad-20 bg-two flex-1 flex-direction-column align-items-center flex-justify-center mr-20">
-      <div class="fs-28 fc-f">贡献</div>
-      <div class="fs-30 fc-f fw-b">
+      </view>
+    </view>
+    <view class="h-80 b-rad-20 bg-two flex-1 flex-direction-column align-items-center flex-justify-center mr-20">
+      <view class="fs-28 fc-f">贡献</view>
+      <view class="fs-30 fc-f fw-b">
         {{pledgeTotal}}
-      </div>
-    </div>
-    <div @click="goUrl" class="h-80 b-rad-20 bg-one flex-1 flex-direction-column align-items-center flex-justify-center">
-      <div class="fs-28 fc-f">总收益</div>
-      <div class="fs-30 fc-f fw-b">
+      </view>
+    </view>
+    <view @click="goUrl" class="h-80 b-rad-20 bg-one flex-1 flex-direction-column align-items-center flex-justify-center">
+      <view class="fs-28 fc-f">总收益</view>
+      <view class="fs-30 fc-f fw-b">
         {{revenueTotal}}
-      </div>
-    </div>
-  </div>
-  <div class="fs-34 fw-b mb-20">
+      </view>
+    </view>
+  </view>
+  <view class="fs-34 fw-b mb-20">
     我的团队
-  </div>
-  <div class="bgc-f p-10 box-sizing-border b-rad-20" v-for="item in list">
-    <div class="pb-10 border-bottom-e5e5e5 fs-28 mb-20">
-      {{item.address}}
-    </div>
-    <div class="align-items-start flex-justify-space pb-10">
-      <div class="flex-1 left-box">
-          <div class="fs-28 mb-4">注册时间: {{item.created_date}}</div>
-          <div class="fs-28 mb-4">团队人数:{{item.clanNum}}</div>
-          <div class="fs-28">直推人数:{{item.recomNum}}</div>
-      </div>
-<!--      <div class="flex-1 pl-20 box-sizing-border">-->
-<!--        <div class="fs-28 mb-4">自身业绩:10000</div>-->
-<!--        <div class="fs-28">团队业绩:10000</div>-->
-<!--      </div>-->
-    </div>
-  </div>
-  <div>
+  </view>
+  <view class="bgc-f p-10 box-sizing-border b-rad-20" v-for="item in list">
+    <view class="pb-10 border-bottom-e5e5e5 fs-28 mb-20">
+      {{abbreviateString(item.address,6)}}
+    </view>
+    <view class="align-items-start flex-justify-space pb-10">
+      <view class="flex-1 left-box">
+          <view class="fs-28 mb-4">注册时间: {{item.created_date}}</view>
+          <view class="fs-28 mb-4">团队人数:{{item.clanNum}}</view>
+          <view class="fs-28">直推人数:{{item.recomNum}}</view>
+      </view>
+<!--      <view class="flex-1 pl-20 box-sizing-border">-->
+<!--        <view class="fs-28 mb-4">自身业绩:10000</view>-->
+<!--        <view class="fs-28">团队业绩:10000</view>-->
+<!--      </view>-->
+    </view>
+  </view>
+  <view>
 
-  </div>
-</div>
+  </view>
+</view>
 </template>
 
 <style scoped lang="scss">