Browse Source

no message

BF-202210271038\Administrator 2 years ago
parent
commit
4477ce5b7c

+ 2 - 0
api/member.js

@@ -6,3 +6,5 @@ export const login = (data) => request(newsUrl + 'login', 'post', { ...data },fa
 export const register = (data) => request(newsUrl + 'register', 'post', { ...data },false)
 export const getIconList = (data) => request(newsUrl + 'coin-list', 'post', { ...data },false)
 export const getMemberInfo = (data) => request(newsUrl + 'info', 'post', { ...data },false)
+export const getTeamInfo = (data) => request(newsUrl + 'team_info', 'post', { ...data },false)
+export const getTeamList = (data) => request(newsUrl + 'team_list', 'post', { ...data },false)

+ 3 - 0
common/js/tools.js

@@ -249,6 +249,9 @@ tools.getShowAddress=function (address){
     return (address.substr(0,8)+'...'+address.substr(address.length-4))
 }
 
+tools.getAddress=function (address){
+    return address.substr(0,4)+'...'+address.substr(-4);
+}
 
 tools.isDevelopment=function () {
     return true

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

@@ -5,7 +5,6 @@
 import tools from "@/common/js/tools";
 import {ethers} from "ethers";
 import web3 from "web3";
-import {log} from "uni-simple-router/src/helpers/warn";
 let tokenpocketBnb = {}
 
 
@@ -16,6 +15,8 @@ let provider;
  * @returns {*}
  */
 tokenpocketBnb.getProvider= function (){
+    console.log(window.ethereum)
+    console.log(window.ethereum.isTokenPocket)
     if (!window.ethereum || typeof window.ethereum.isTokenPocket === 'undefined') {
         return false
     }
@@ -23,8 +24,10 @@ tokenpocketBnb.getProvider= function (){
         provider = window.ethereum;
     }
     // alert(provider.isConnected())
+    console.log(chainId)
     if(!chainId){
         provider.request({method:'eth_chainId'}).then((ethChainId)=>{
+            console.log(ethChainId)
             if(ethChainId!=='0x38'){
                 uni.$emit('noBan',false)
             }else {

+ 5 - 0
locale/en.json

@@ -24,12 +24,17 @@
   "index.index.top.five": "The platform is running stably",
   "index.index.top.six": "View Details!",
   "index.index.list.title": "My income and expenditure",
+  "index.index.list.title-two": "My public steak",
   "index.index.list.item.title": "Separation",
   "index.index.list.item.integral": "Integral",
   "index.index.list.item.service": "Service",
   "index.index.list.item.date": "time",
   "index.index.list.item.status": "state",
 
+  "index.index.list.common.title": "Amount of declaration",
+  "index.index.list.common.num": "Common order",
+  "index.index.list.common.end": "Out of the running",
+
   "index.contract.list.title": "Record of declaration",
   "index.contract.num": "number",
   "index.contract.money": "Balance",

+ 5 - 0
locale/ko.json

@@ -24,12 +24,17 @@
   "index.index.top.five": "플랫폼은 이미 안정적으로 운영되고 있다",
   "index.index.top.six": "상세한 상황을 조사하다.!",
   "index.index.list.title": "나의 수입과 지출 내역",
+  "index.index.list.title-two": "나의 장교",
   "index.index.list.item.title": "플랫폼 수익",
   "index.index.list.item.integral": "포인트",
   "index.index.list.item.service": "수수료",
   "index.index.list.item.date": "시간",
   "index.index.list.item.status": "상태",
 
+  "index.index.list.common.title": "청구서 금액",
+  "index.index.list.common.num": "공통 순위",
+  "index.index.list.common.end": "이미 아웃되다",
+
   "index.contract.list.title": "신고서 기록",
   "index.contract.num": "수량",
   "index.contract.money": "사용가능잔고",

+ 14 - 1
locale/zh-Hans.json

@@ -23,13 +23,26 @@
 	"index.index.top.cp": "点击复制邀请链接",
 	"index.index.top.five": "平台已稳定运行",
 	"index.index.top.six": "运行机制!",
-	"index.index.list.title": "我的收支明细",
+	"index.index.list.title": "我的收支",
+	"index.index.list.title-two": "我的共排",
 	"index.index.list.item.title": "平台分润",
 	"index.index.list.item.integral": "积分",
 	"index.index.list.item.service": "手续费",
 	"index.index.list.item.date": "时间",
 	"index.index.list.item.status": "状态",
 
+	"index.index.list.common.title": "报单金额",
+	"index.index.list.common.num": "共排顺序",
+	"index.index.list.common.end": "已出局",
+
+	"index.index.tds": "我的团队",
+	"index.team.r": "人",
+	"index.team.c": "层",
+	"index.team.w": "无",
+	"index.team.tdyj": "团队业绩",
+	"index.team.ztlb": "团队列表",
+	"index.team.rtsj": "入团时间",
+
 	"index.contract.list.title": "报单记录",
 	"index.contract.num": "数量",
 	"index.contract.money": "可用余额",

+ 1 - 1
manifest.json

@@ -75,7 +75,7 @@
             "disableHostCheck" : true,
             "proxy" : {
                 "/api" : {
-                    "target" : "http://bab-icon-api.localhost.com",
+                    "target" : "http://api.bnbdao1.com",
                     "changeOrigin" : true,
                     "secure" : false
                 }

+ 6 - 0
pages.json

@@ -19,6 +19,12 @@
 				"navigationBarTitleText": "BNBDAO"
 			}
 		},
+		{
+			"path": "pages/index/team",
+			"style": {
+				"navigationBarTitleText": "BNBDAO"
+			}
+		},
 		{
 			"path": "pages/login/index",
 			"style": {

+ 150 - 0
pages/index/components/common-list.vue

@@ -0,0 +1,150 @@
+<template>
+  <view class="earning-box">
+    <en-list ref="contractObj" @getList="getList">
+      <template v-slot:listInfo="{pagingData}">
+        <view class="earning-list">
+          <view v-for="item in pagingData" class="item">
+            <view class="list-item">
+              <view class="item-line" >
+                <view class="item-text">{{$t('index.index.list.common.title')}}</view>
+                <view class="item-text text-two">
+                  <view class="text-img">
+                    <image src="@/static/img/index/bnb2.png"></image>
+                  </view>
+                  <view class="text">{{(item.money).toFixed(6)*1}}</view>
+                </view>
+              </view>
+
+              <view class="item-line" v-if="item.hash">
+                <view class="item-text">Hash</view>
+                <view class="item-text text-hash" @click="goToUrl(item.hash)">
+                  {{item.hash}}
+                </view>
+              </view>
+              <view class="item-line">
+                <view class="item-text">{{$t('index.index.list.common.num')}}</view>
+                <view class="item-text">{{item.out_num>0?item.out_num:$t('index.index.list.common.end')}}</view>
+              </view>
+
+
+              <view class="item-line">
+                <view class="item-text">{{$t('index.index.list.item.date')}}</view>
+                <view class="item-text">{{item.created_at}}</view>
+              </view>
+            </view>
+            <division class="division-item"></division>
+          </view>
+        </view>
+      </template>
+    </en-list>
+  </view>
+</template>
+
+<script>
+import EnList from "@/components/en-list/en-list";
+import {getContractList} from "@/api/contract";
+import Division from "@/pages/index/components/division";
+
+export default {
+  name: "common-list",
+  components: {Division, EnList},
+  props: {},
+  data() {
+    return {}
+  },
+  watch: {},
+  mounted() {
+
+  },
+  methods: {
+    goToUrl(tx){
+      window.location.href='https://bscscan.com/tx/'+tx
+    },
+    getList(page) {
+      let token=uni.getStorageSync('token')
+      if(token){
+        getContractList({'page': page}).then((res) => {
+          if (res.code === 1) {
+            this.$refs.contractObj.setList(res.data.items, res.data.total)
+            this.$emit('setTotal',res.data.total)
+          }
+        })
+
+      }else {
+        this.$refs.contractObj.setList([], 0)
+        this.$emit('setTotal',0)
+      }
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.earning-box {
+  .earning-list {
+    .list-item {
+      margin-top: 20rpx;
+
+      .item-line {
+        margin-bottom: 20rpx;
+        display: flex;
+        justify-content: space-between;
+
+        .item-text {
+          font-size: 26rpx;
+          color: rgb(177, 177, 177);
+          line-height: 42rpx;
+          height: 42rpx;
+        }
+        .text-hash{
+          max-width: 200rpx;
+          overflow-x:hidden;
+          text-overflow: ellipsis;
+        }
+
+        .text-two {
+          display: flex;
+          justify-content: right;
+
+          .text-img {
+            display: inline-block;
+            padding: 6rpx;
+            background: rgb(0, 87, 255);
+            border-radius: 50%;
+            height: 42rpx;
+            width: 42rpx;
+            box-sizing: border-box;
+
+            image {
+              width: 30rpx;
+              height: 30rpx;
+              z-index: 100;
+            }
+          }
+
+          .text {
+            margin-left: 10rpx;
+            font-size: 30rpx;
+          }
+        }
+      }
+
+      .line-text {
+        margin-bottom: 40rpx;
+
+        .item-text {
+          font-weight: bold;
+          font-size: 26rpx;
+          color: #222;
+        }
+      }
+    }
+    .item:last-child {
+      .division-item {
+        display: none;
+      }
+    }
+  }
+}
+
+</style>

+ 110 - 10
pages/index/index.vue

@@ -22,15 +22,37 @@
         <text class="bottom-text" @click="goToUrl(2)">{{ $t('index.index.top.six') }}</text>
       </view>
     </view>
-    <view class="index-list">
-      <view class="list-title">
-        <view class="title-img">
-          <image src="@/static/img/index/bnb2.png" mode="aspectFill"></image>
+    <view class="list-tab">
+      <view class="tab-items">
+        <view class="tab-item" @click="setListTab(1)" :class="{'option-tab':listTab===1}">
+          {{ $t('index.index.list.title') }}
+        </view>
+        <view class="tab-item" @click="setListTab(2)" :class="{'option-tab':listTab===2}">
+          {{ $t('index.index.list.title-two') }}
         </view>
-        <view class="title-text">{{ $t('index.index.list.title') }}({{ total }})</view>
+        <!--          <view class="tab-item" @click="setListTab(3)" :class="{'option-tab':listTab===3}">-->
+        <!--            {{ $t('index.index.code') }}-->
+        <!--          </view>-->
+      </view>
+      <view class="tab-item-bg"
+            :class="{'bg-location-1':listTab===1,'bg-location-2':listTab===2,'bg-location-3':listTab===3}"></view>
+    </view>
+    <view class="team-but" @click="goToUrl(4)">{{ $t('index.index.tds') }}》</view>
+    <view class="index-list">
+
+<!--      <view class="list-title">-->
+<!--        <view class="title-img">-->
+<!--          <image src="@/static/img/index/bnb2.png" mode="aspectFill"></image>-->
+<!--        </view>-->
+<!--        <view class="title-text">{{ $t('index.index.list.title') }}({{ total }})</view>-->
+<!--      </view>-->
+<!--      <division></division>-->
+      <view v-if="listTab===1">
+        <earning-list @setTotal="setTotal"></earning-list>
+      </view>
+      <view v-else>
+        <common-list @setTotal="setTotal"></common-list>
       </view>
-      <division></division>
-      <earning-list @setTotal="setTotal"></earning-list>
 
     </view>
     <view class="index-bottom"></view>
@@ -42,11 +64,13 @@ import {getMemberInfo} from "@/api/member";
 import Division from "@/pages/index/components/division";
 import TopHead from "@/pages/index/components/top-head";
 import EarningList from "@/pages/index/components/earning-list";
+import CommonList from "@/pages/index/components/common-list";
 
 export default {
-  components: {EarningList, TopHead, Division},
+  components: {CommonList, EarningList, TopHead, Division},
   data() {
     return {
+      listTab:1,
       applicationLocale: '',
       systemLocale: '',
       showLang: false,
@@ -129,12 +153,21 @@ export default {
             'url': 'pages/index/contract'
           })
           break
+        case 4:
+          uni.navigateTo({
+            'url': 'pages/index/team'
+          })
+          break
       }
     },
     setShowLang() {
       this.showLang = !this.showLang
     },
-
+    setListTab(listTab) {
+      if (this.listTab !== listTab) {
+        this.listTab = listTab
+      }
+    },
 
     getMyData() {
       let token = uni.getStorageSync('token')
@@ -280,11 +313,78 @@ export default {
       padding: 40rpx 40rpx 0 40rpx;
     }
   }
+  .list-tab {
+    width: 90%;
+    height: 100%;
+    background: #eaf2ff;
+    border-radius: 36px;
+    cursor: pointer;
+    position: relative;
+    margin: 20rpx auto;
+
+    .tab-items {
+      z-index: 10;
+      display: flex;
+      justify-content: space-between;
+      border-radius: 36px;
+
+      .tab-item {
+        z-index: 10;
+        width: calc(100% / 2);
+        font-size: 13px;
+        color: #adbad0;
+        display: block;
+        height: 32px;
+        line-height: 32px;
+        text-align: center;
+      }
+
+      .option-tab {
+        color: #292929;
+      }
+    }
+
+    .tab-item-bg {
+      position: absolute;
+      border-radius: 36px;
+      background: #fff;
+      transition: .5s ease;
+      height: 32px;
+      width: calc(100% / 2);
+      top: 0;
+    }
+
+    .bg-location-1 {
+      left: 0;
+      transition: .5s ease;
+    }
+
+    .bg-location-2 {
+      left: 50%;
+      transition: .5s ease;
+    }
+
+    .bg-location-3 {
+      left: 66.66%;
+      transition: .5s ease;
+    }
+
+  }
+
+  .team-but{
+    width: 90%;
+    margin: auto;
+    font-size: 13px;
+    color: #adbad0;
+    text-align: right;
+    //height: 32px;
+    //line-height: 32px;
+  }
 
   .index-list {
     background: #fff;
     width: 90%;
-    margin: 40rpx auto;
+    margin: 20rpx auto;
     border-radius: 10px;
     padding: 20px 10px;
     overflow: hidden;

+ 270 - 0
pages/index/team.vue

@@ -0,0 +1,270 @@
+<template>
+  <view class="team-box">
+<!--    <top :show-img="false"></top>-->
+    <en-nav v-show="false" :title="$t('index.index.tds')"></en-nav>
+    <view class="box-list">
+      <view class="team-data">
+        <view class="user-data">
+          <view class="user-img">
+            <image src="@/static/img/my/user.png" ></image>
+            <view class="user-level">V{{member.level_id}}</view>
+          </view>
+          <view class="user-address">{{member.address}}</view>
+
+        </view>
+
+      </view>
+      <view class="team-title">
+        <view class="title-text">{{ $t('index.team.ztlb') }}</view>
+        <view class="title-wire"></view>
+      </view>
+      <view class="team-list">
+
+        <view class="item"  v-for="(item,itemIndex) in list">
+          <view class="team-item" :class="{'item-one':itemIndex===0}">
+            <view class="item-left">
+              <view class="left-img"> <image src="@/static/img/my/user.png" ></image></view>
+              <view class="left-text">
+                <view class="text-name">{{getAddress(item.address)}}</view>
+                <view class="text-time">{{ $t('index.team.rtsj') }}:{{item.created_at}}</view>
+              </view>
+            </view>
+            <view class="item-right">V{{item.level_id}}</view>
+          </view>
+        </view>
+        <en-blank v-if="list.length<=0"></en-blank>
+      </view>
+
+
+    </view>
+  </view>
+</template>
+
+<script>
+// import Top from "@/pages/index/model/top";
+import EnBlank from "@/components/en-utils/en-blank/en-blank";
+
+import tools from "@/common/js/tools";
+import {getTeamInfo, getTeamList} from "@/api/member";
+import EnNav from "@/components/en-utils/en-nav/en-nav";
+export default {
+  name: "team",
+  components: {EnNav, EnBlank},
+  props: {},
+  data() {
+    return {
+      member:{
+        "address": "",
+        "level_id": 0,
+        "recom_num": 0,
+        "performance": 0,
+      },
+      'list':[],
+      page:1,
+      isEnd:false
+    }
+  },
+  watch: {},
+  onReachBottom(){
+    this.getTeamList()
+  },
+  mounted() {
+    this.getTeamInfo()
+    this.getTeamList()
+  },
+  methods: {
+    getAddress(address){
+      return tools.getAddress(address)
+    },
+    getTeamInfo(){
+      getTeamInfo().then((res)=>{
+        if(res.code===1){
+          res.data.address=tools.getAddress(res.data.address)
+          this.member=res.data
+          console.log( this.member.address)
+        }
+      })
+    },
+    getTeamList(){
+      if(this.isEnd){
+        return
+      }
+      getTeamList().then((res)=>{
+        if(res.code===1){
+          if(res.data.items.length<=0){
+            this.isEnd=true
+          }
+          this.list.push(...res.data.items)
+          ++this.page
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.box-list{
+  padding: 6px 16px;
+  .team-data{
+    background: #fff;
+    margin-top: 20rpx;
+    padding: 20rpx;
+    border-radius: 10rpx;
+    .user-data{
+      .user-img{
+        margin:24rpx auto;
+        width: 140rpx;
+        height: 140rpx;
+        position: relative;
+        image{
+          border-radius: 50%;
+          width: 140rpx;
+          height: 140rpx;
+        }
+        .user-level{
+          position: absolute;
+          bottom: 0;
+          left: 30rpx;
+          width: 80rpx;
+          background: #277ffa;
+          border-radius: 20rpx;
+          text-align: center;
+          color: #fff;
+          font-size: 22rpx;
+        }
+      }
+      .user-address{
+        margin: 0 auto;
+        width: 240rpx;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        text-align: center;
+      }
+      padding-bottom: 20rpx;
+      border-bottom: 2rpx solid #EAEAEA;
+    }
+    .team-info{
+      margin-top: 20rpx;
+      display: flex;
+      justify-content: space-between;
+      .team-item{
+        width: 50%;
+        .user-img{
+          margin:0 auto;
+          width: 100rpx;
+          height: 100rpx;
+          position: relative;
+          image{
+            border-radius: 50%;
+            width: 100rpx;
+            height: 100rpx;
+          }
+          .user-level{
+            position: absolute;
+            bottom: 0;
+            left: 18rpx;
+            width: 70rpx;
+            background: #277ffa;
+            //height: 20rpx;
+            border-radius: 20rpx;
+            text-align: center;
+            color: #fff;
+            font-size: 16rpx !important;
+          }
+        }
+        .item{
+          text-align: center;
+        }
+        .item-num{
+          color: #333;
+          font-size: 34rpx;
+          font-weight: 600;
+        }
+        .item-text{
+          margin: 6rpx auto 0;
+          color: #999999;
+          font-size: 28rpx;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          width: 240rpx;
+          text-align: center;
+        }
+      }
+    }
+  }
+  .team-title{
+    margin: 30rpx 0;
+    .title-text{
+      color: #277ffa;
+      font-size: 28rpx;
+      font-weight: 600;
+    }
+    .title-wire{
+      background: #277ffa;
+      width: 60rpx;
+      height: 4rpx;
+      margin-left: 24rpx;
+    }
+  }
+  .team-list{
+    background: #fff;
+    padding: 24rpx 21rpx;
+    min-height: 600rpx;
+    border-radius: 20rpx;
+    .team-child{
+      padding-left: 30rpx;
+    }
+    .team-item{
+      padding: 24rpx 0;
+      display: flex;
+      justify-content: space-between;
+      border-bottom: 2rpx solid #EDEDED;
+      .item-left{
+        display: flex;
+        justify-content: left;
+        .left-img{
+          width: 88rpx;
+          image{
+            height: 88rpx;
+            width: 88rpx;
+            border-radius: 50%;
+          }
+        }
+        .left-text{
+          margin-left: 16rpx;
+          .text-name{
+            color: #333333;
+            font-size: 28rpx;
+            width: 240rpx;
+            overflow: hidden;
+            text-overflow: ellipsis;
+          }
+          .text-time{
+            margin-top: 20rpx;
+            color: #999999;
+            font-size: 20rpx;
+          }
+        }
+
+      }
+      .item-right{
+        width: 72rpx;
+        height: 34rpx;
+        background:  #277ffa;
+        color: #fff;
+        text-align: center;
+        line-height: 34rpx;
+        border-radius: 20rpx;
+        margin-top: 30rpx;
+        font-size: 20rpx;
+      }
+
+    }
+    .item-one{
+      padding-top: 0;
+    }
+
+  }
+}
+</style>

+ 3 - 1
pages/login/index.vue

@@ -25,14 +25,16 @@
     },
     methods: {
       async getAccount(){
+        console.log('---------------------------------')
         tokenpocketBnb.getAccounts().then(async (Address) => {
-
+          console.log(Address)
           if (Address) {
             this.login(Address)
           } else {
             tools.goToError(2)
           }
         }).catch((e)=>{
+          console.log(e)
           tools.goToError(2)
         })
       },

BIN
static/img/my/user.png