py hace 6 meses
padre
commit
0279493c94
Se han modificado 5 ficheros con 574 adiciones y 506 borrados
  1. 42 3
      pages.json
  2. 241 235
      pages/convert/convert-index.vue
  3. 226 215
      pages/home/home-index.vue
  4. 12 11
      pages/index/index.vue
  5. 53 42
      pages/my/my-index.vue

+ 42 - 3
pages.json

@@ -1,10 +1,49 @@
-{
-
+{	
+	"tabBar": {
+		"backgroundColor": "#fff",
+		"selectedColor": "#f78820",
+		"color": "#666",
+		"borderStyle": "white",
+		"fontSize": "20rpx",
+		"iconWidth": "48rpx",
+		"height": "138rpx",
+		"list": [{
+				"pagePath": "pages/index/index",
+				"iconPath": "static/img/tab/index-two.svg",
+				"selectedIconPath": "static/img/tab/index.svg",
+				"text": "首页"
+			},
+			{
+				"pagePath": "pages/convert/convert-index",
+				"iconPath": "static/img/tab/jh.svg",
+				"selectedIconPath": "static/img/tab/jh.svg",
+				"text": "兑换"
+			},
+			{
+				"pagePath": "pages/my/my-index",
+				"iconPath": "static/img/tab/my.svg",
+				"selectedIconPath": "static/img/tab/my-two.svg",
+				"text": "我的"
+			}
+		]
+	},
 	"pages": [
 		{
 			"path": "pages/index/index",
 			"style": {
-				"navigationBarTitleText": "BNBDAO"
+				"navigationBarTitleText": "首页"
+			}
+		},
+		{
+			"path": "pages/convert/convert-index",
+			"style": {
+				"navigationBarTitleText": "兑换"
+			}
+		},
+		{
+			"path": "pages/my/my-index",
+			"style": {
+				"navigationBarTitleText": "我的"
 			}
 		},
 		{

+ 241 - 235
pages/convert/convert-index.vue

@@ -1,248 +1,254 @@
 <script>
-import tokenpocketBnb from "@/common/wallet/tokenpocket-wallet/tokenpocket-bnb";
-import {getTotalMoney} from "@/api/money";
-import {addDeal, getAddress} from "@/api/deal";
-import tools from "@/common/js/tools";
-import web3 from "web3";
-import {ethers} from "ethers";
+	import tokenpocketBnb from "@/common/wallet/tokenpocket-wallet/tokenpocket-bnb";
+	import {
+		getTotalMoney
+	} from "@/api/money";
+	import {
+		addDeal,
+		getAddress
+	} from "@/api/deal";
+	import tools from "@/common/js/tools";
+	import web3 from "web3";
+	import {
+		ethers
+	} from "ethers";
 
-export default {
-  name: "convert-index",
-  components: {},
-  data() {
-    return {
-      usdtNum:'',
-      iconNum:'',
-      type:1,
-      toNum:'',
-      formNUm:'',
-      price:'',
-      address:'',
-      dealAddress:'',
-      change_num:0,
-    };
-  },
-  watch:{
-    'formNUm':function () {
-      if(this.formNUm===''){
-        this.toNum=''
-      }else {
-        if(this.type===1){
-          this.toNum=this.formNUm*this.price
-        }else {
-          this.toNum=(this.formNUm/this.price).toFixed(6)
-        }
+	export default {
+		name: "convert-index",
+		components: {},
+		data() {
+			return {
+				usdtNum: '',
+				iconNum: '',
+				type: 1,
+				toNum: '',
+				formNUm: '',
+				price: '',
+				address: '',
+				dealAddress: '',
+				change_num: 0,
+			};
+		},
+		watch: {
+			'formNUm': function() {
+				if (this.formNUm === '') {
+					this.toNum = ''
+				} else {
+					if (this.type === 1) {
+						this.toNum = this.formNUm * this.price
+					} else {
+						this.toNum = (this.formNUm / this.price).toFixed(6)
+					}
 
-      }
-    }
-  },
-  mounted() {
-    this.getIconNum()
-    this.getTotalMoney()
-    this.getAddress()
-  },
-  methods: {
-    getAddress(){
-      getAddress().then(res=>{
-        if(res.code===1){
-          this.dealAddress=res.data.address
-          this.change_num=res.data.change_num
-        }
-      })
-    },
-    async addDeal(){
-      if(this.toNum ==='' || this.formNUm===''){
-        tools.error("兑换数量异常")
-        return
-      }
-      let data=''
-      let transactionData=''
-      let formHex=web3.utils.numberToHex(ethers.utils.parseEther(this.formNUm.toString()).toString());
-      if(this.type===1){
-        if(this.change_num>10){
-          tools.error('交易已锁定')
-          return
-        }
-        data='0xa9059cbb'
-        data=data+tools.replenishZero(this.dealAddress)+tools.replenishZero(formHex)
-        transactionData=await tokenpocketBnb.getContractTransaction(data, 1);
-      }else {
-        data='0xa9059cbb'
-        // data='0x7472616e73666572'
-        data=data+tools.replenishZero(this.dealAddress)+tools.replenishZero(formHex)
-         transactionData=await tokenpocketBnb.getContractTransaction(data, 0);
-      }
-      console.log(transactionData)
-      // data='0x5e9a0c48000000000000000000000000b7f1c21c51a0f85704a13b981aa9075d9b102962';
-      tokenpocketBnb.sendTransaction(transactionData).then(res=>{
-        console.log(res)
-        if(res){
-          addDeal({
-            'type':this.type,
-            'money':this.toNum,
-            'hash':res
-          }).then(res=>{
-            if (res.code===1){
-              tools.success(res.msg)
-              this.toNum=''
-              this.getTotalMoney()
-              this.getIconNum()
-            }else {
-              tools.error(res.msg)
-            }
-          })
-        }
-      })
-    },
-    setMax(){
-      if(this.type===1){
-        this.formNUm=this.usdtNum
-      }else {
-        this.formNUm=this.iconNum
-      }
-    },
-    getTotalMoney(){
-      getTotalMoney().then(res=>{
-        if (res.code===1){
-          this.price=res.data.price
+				}
+			}
+		},
+		mounted() {
+			this.getIconNum()
+			this.getTotalMoney()
+			this.getAddress()
+		},
+		methods: {
+			getAddress() {
+				getAddress().then(res => {
+					if (res.code === 1) {
+						this.dealAddress = res.data.address
+						this.change_num = res.data.change_num
+					}
+				})
+			},
+			async addDeal() {
+				if (this.toNum === '' || this.formNUm === '') {
+					tools.error("兑换数量异常")
+					return
+				}
+				let data = ''
+				let transactionData = ''
+				let formHex = web3.utils.numberToHex(ethers.utils.parseEther(this.formNUm.toString()).toString());
+				if (this.type === 1) {
+					if (this.change_num > 10) {
+						tools.error('交易已锁定')
+						return
+					}
+					data = '0xa9059cbb'
+					data = data + tools.replenishZero(this.dealAddress) + tools.replenishZero(formHex)
+					transactionData = await tokenpocketBnb.getContractTransaction(data, 1);
+				} else {
+					data = '0xa9059cbb'
+					// data='0x7472616e73666572'
+					data = data + tools.replenishZero(this.dealAddress) + tools.replenishZero(formHex)
+					transactionData = await tokenpocketBnb.getContractTransaction(data, 0);
+				}
+				console.log(transactionData)
+				// data='0x5e9a0c48000000000000000000000000b7f1c21c51a0f85704a13b981aa9075d9b102962';
+				tokenpocketBnb.sendTransaction(transactionData).then(res => {
+					console.log(res)
+					if (res) {
+						addDeal({
+							'type': this.type,
+							'money': this.toNum,
+							'hash': res
+						}).then(res => {
+							if (res.code === 1) {
+								tools.success(res.msg)
+								this.toNum = ''
+								this.getTotalMoney()
+								this.getIconNum()
+							} else {
+								tools.error(res.msg)
+							}
+						})
+					}
+				})
+			},
+			setMax() {
+				if (this.type === 1) {
+					this.formNUm = this.usdtNum
+				} else {
+					this.formNUm = this.iconNum
+				}
+			},
+			getTotalMoney() {
+				getTotalMoney().then(res => {
+					if (res.code === 1) {
+						this.price = res.data.price
 
-        }
-      })
-    },
-    async  getIconNum(){
-      this.address=tokenpocketBnb.getMyAddress()
-      if(this.address===''){
-        return
-      }
-      setTimeout(async ()=>{
-        this.iconNum= await tokenpocketBnb.getTokenBalance(this.address,0)
-        this.usdtNum= await tokenpocketBnb.getTokenBalance(this.address,1)
-      },100)
+					}
+				})
+			},
+			async getIconNum() {
+				this.address = tokenpocketBnb.getMyAddress()
+				if (this.address === '') {
+					return
+				}
+				setTimeout(async () => {
+					this.iconNum = await tokenpocketBnb.getTokenBalance(this.address, 0)
+					this.usdtNum = await tokenpocketBnb.getTokenBalance(this.address, 1)
+				}, 100)
 
-    },
-    setType(){
-      this.type=(this.type===1?2:1)
-      this.formNUm=''
-    }
-  },
-}
+			},
+			setType() {
+				this.type = (this.type === 1 ? 2 : 1)
+				this.formNUm = ''
+			}
+		},
+	}
 </script>
 
 <template>
-  <view class="bgc-f p-40 box-sizing-border b-rad-20">
-    <view>
-      <view class="bgc-F6F7FA b-rad-20 mb-20 p-20 box-sizing-border mb-20" v-if="type===1">
-        <view class="align-items-start flex-justify-space mb-20">
-          <view class="align-items-center">
-            <image
-                class="t-img mr-8"
-                :src="require('@/static/img/index/index/usdt.png')"
-            ></image>
-            <view class="fs-28">USDT</view>
-          </view>
-          <view class="max-box b-rad-20 fs-28" @click="setMax">
-            Max {{usdtNum}}
-          </view>
-        </view>
-        <view>
-          <input v-model="formNUm" placeholder="输入要兑换的USDT数量" placeholder-class="fs-28"></input>
-        </view>
-      </view>
-      <view class="bgc-F6F7FA b-rad-20 mb-20 p-20 box-sizing-border mb-20" v-else>
-        <view class="align-items-start flex-justify-space mb-20">
-          <view class="align-items-center">
-            <image
-                class="t-img mr-8"
-                :src="require('@/static/img/logo/logo.png')"
-            ></image>
-            <view class="fs-28">DAO</view>
-          </view>
-          <view class="max-box b-rad-20 fs-28" @click="setMax">
-            Max {{iconNum}}
-          </view>
-        </view>
-        <view>
-          <input v-model="formNUm" placeholder="输入要兑换的DAO数量" placeholder-class="fs-28"></input>
-        </view>
-      </view>
-    </view>
+	<view class="flex-common-box p-20 box-sizing-border">
+		<view class="bgc-f p-40 box-sizing-border b-rad-20">
+			<view>
+				<view class="bgc-F6F7FA b-rad-20 mb-20 p-20 box-sizing-border mb-20" v-if="type===1">
+					<view class="align-items-start flex-justify-space mb-20">
+						<view class="align-items-center">
+							<image class="t-img mr-8" :src="require('@/static/img/index/index/usdt.png')"></image>
+							<view class="fs-28">USDT</view>
+						</view>
+						<view class="max-box b-rad-20 fs-28" @click="setMax">
+							Max {{usdtNum}}
+						</view>
+					</view>
+					<view>
+						<input v-model="formNUm" placeholder="输入要兑换的USDT数量" placeholder-class="fs-28"></input>
+					</view>
+				</view>
+				<view class="bgc-F6F7FA b-rad-20 mb-20 p-20 box-sizing-border mb-20" v-else>
+					<view class="align-items-start flex-justify-space mb-20">
+						<view class="align-items-center">
+							<image class="t-img mr-8" :src="require('@/static/img/logo/logo.png')"></image>
+							<view class="fs-28">DAO</view>
+						</view>
+						<view class="max-box b-rad-20 fs-28" @click="setMax">
+							Max {{iconNum}}
+						</view>
+					</view>
+					<view>
+						<input v-model="formNUm" placeholder="输入要兑换的DAO数量" placeholder-class="fs-28"></input>
+					</view>
+				</view>
+			</view>
 
-    <view class="flex-direction-column align-items-center flex-justify-center mb-20" @click="setType">
-      <view class="fs-28">
-        FORM
-      </view>
-      <image
-          class="jh-img"
-          :src="require('@/static/img/index/index/jiaohuan.png')"
-          ></image>
-      <view class="fs-28">
-        TO
-      </view>
-    </view>
-    <view>
-      <view class="bgc-F6F7FA b-rad-20 mb-20 p-20 box-sizing-border mb-50" v-if="type===1">
-        <view class="align-items-start flex-justify-space mb-20">
-          <view class="align-items-center">
-            <image
-                class="logo-img mr-8"
-                :src="require('@/static/img/logo/logo.png')"
-            ></image>
-            <view class="fs-28">DAO</view>
-          </view>
-        </view>
-        <view class="fs-28" :class="toNum?'':'fc-808080'">
-         {{toNum?toNum:'请输入需要兑换的USDT数量'}}
-        </view>
-      </view>
-      <view class="bgc-F6F7FA b-rad-20 mb-20 p-20 box-sizing-border mb-50" v-else>
-        <view class="align-items-start flex-justify-space mb-20">
-          <view class="align-items-center">
-            <image
-                class="logo-img mr-8"
-                :src="require('@/static/img/index/index/usdt.png')"
-            ></image>
-            <view class="fs-28">USDT</view>
-          </view>
-        </view>
-        <view class="fs-28" :class="toNum?'':'fc-808080'">
-          {{toNum?toNum:'请输入需要兑换的DAO数量'}}
-        </view>
-      </view>
-    </view>
+			<view class="flex-direction-column align-items-center flex-justify-center mb-20" @click="setType">
+				<view class="fs-28">
+					FORM
+				</view>
+				<image class="jh-img" :src="require('@/static/img/index/index/jiaohuan.png')"></image>
+				<view class="fs-28">
+					TO
+				</view>
+			</view>
+			<view>
+				<view class="bgc-F6F7FA b-rad-20 mb-20 p-20 box-sizing-border mb-50" v-if="type===1">
+					<view class="align-items-start flex-justify-space mb-20">
+						<view class="align-items-center">
+							<image class="logo-img mr-8" :src="require('@/static/img/logo/logo.png')"></image>
+							<view class="fs-28">DAO</view>
+						</view>
+					</view>
+					<view class="fs-28" :class="toNum?'':'fc-808080'">
+						{{toNum?toNum:'请输入需要兑换的USDT数量'}}
+					</view>
+				</view>
+				<view class="bgc-F6F7FA b-rad-20 mb-20 p-20 box-sizing-border mb-50" v-else>
+					<view class="align-items-start flex-justify-space mb-20">
+						<view class="align-items-center">
+							<image class="logo-img mr-8" :src="require('@/static/img/index/index/usdt.png')"></image>
+							<view class="fs-28">USDT</view>
+						</view>
+					</view>
+					<view class="fs-28" :class="toNum?'':'fc-808080'">
+						{{toNum?toNum:'请输入需要兑换的DAO数量'}}
+					</view>
+				</view>
+			</view>
+
+			<view class="convent-but b-rad-20 text-align-center fs-28 fc-f" @click="addDeal">
+				兑换
+			</view>
+		</view>
+	</view>
 
-    <view class="convent-but b-rad-20 text-align-center fs-28 fc-f" @click="addDeal">
-      兑换
-    </view>
-  </view>
 </template>
 
 <style scoped lang="scss">
-.t-img{
-  width: 70rpx;
-  height: 60rpx;
-}
-.max-box{
-  color: #0d81cf;
-  border: 2rpx solid #0d81cf;
-  padding: 6rpx 20rpx;
-}
-::v-deep .el-input__inner{
-  background-color: transparent;
-  border: none;
-  padding: 0;
-}
-.jh-img{
-  width: 60rpx;
-  height: 60rpx;
-}
-.logo-img{
-  width: 66rpx;
-  height: 50rpx;
-}
-.convent-but{
-  height: 80rpx;
-  background: #0d81cf;
-  color: #fff;
-  line-height: 80rpx;
-}
-</style>
+	.flex-common-box {
+		width: 100%;
+		height: calc(100vh - 138rpx);
+		display: flex;
+		flex-direction: column;
+	}
+	.t-img {
+		width: 70rpx;
+		height: 60rpx;
+	}
+
+	.max-box {
+		color: #0d81cf;
+		border: 2rpx solid #0d81cf;
+		padding: 6rpx 20rpx;
+	}
+
+	::v-deep .el-input__inner {
+		background-color: transparent;
+		border: none;
+		padding: 0;
+	}
+
+	.jh-img {
+		width: 60rpx;
+		height: 60rpx;
+	}
+
+	.logo-img {
+		width: 66rpx;
+		height: 50rpx;
+	}
+
+	.convent-but {
+		height: 80rpx;
+		background: #0d81cf;
+		color: #fff;
+		line-height: 80rpx;
+	}
+</style>

+ 226 - 215
pages/home/home-index.vue

@@ -3,14 +3,18 @@
 	import {
 		getTotalMoney
 	} from "@/api/money";
-  import {
-    addPledge,
-    getDividendList, getPledgeConfig, getPledgeList
-  } from "@/api/pledge";
+	import {
+		addPledge,
+		getDividendList,
+		getPledgeConfig,
+		getPledgeList
+	} from "@/api/pledge";
 	import blank from "@/components/en-utils/en-blank/en-blank.vue"
-  import web3 from "web3";
-  import {ethers} from "ethers";
-  import tools from "@/common/js/tools";
+	import web3 from "web3";
+	import {
+		ethers
+	} from "ethers";
+	import tools from "@/common/js/tools";
 	export default {
 		name: "home-index",
 		props: {
@@ -25,34 +29,34 @@
 			'address': function() {
 				this.getIconNum()
 			},
-      'pledgeNUm':function () {
-        console.log(this.pledgeNUm)
-        if(this.pledgeNUm===''){
-          return
-        }
-        if(this.listTab===1){
-          if(this.coinNum<this.pledgeNUm){
-            this.pledgeNUm=this.coinNum
-          }
-        }else {
-          if(this.pledgeTotal<this.pledgeNUm){
-            this.pledgeNUm=this.pledgeTotal
-          }
-        }
-      }
+			'pledgeNUm': function() {
+				console.log(this.pledgeNUm)
+				if (this.pledgeNUm === '') {
+					return
+				}
+				if (this.listTab === 1) {
+					if (this.coinNum < this.pledgeNUm) {
+						this.pledgeNUm = this.coinNum
+					}
+				} else {
+					if (this.pledgeTotal < this.pledgeNUm) {
+						this.pledgeNUm = this.pledgeTotal
+					}
+				}
+			}
 		},
 		data() {
 			return {
-        listTab:1,
+				listTab: 1,
 				coinNum: '',
 				pledgeTotal: '',
 				revenueTotal: '',
 				price: '',
 				page: 1,
 				total: '',
-        pledgeNUm: '',
-        bnb_num: '',
-        pledgeAddress: '',
+				pledgeNUm: '',
+				bnb_num: '',
+				pledgeAddress: '',
 				list: []
 			};
 		},
@@ -64,22 +68,22 @@
 			this.getPledgeConfig()
 		},
 		methods: {
-      getPledgeConfig(){
-        getPledgeConfig().then(res=>{
-          if(res.code===1){
-            this.bnb_num=res.data.bnb_num
-            this.pledgeAddress=res.data.address
-          }
-        })
-      },
-      setListTab(listTab) {
-        if (this.listTab !== listTab) {
-          this.listTab = listTab
-          this.pledgeNUm=''
-        }
-      },
-      getPledgeList() {
-        getPledgeList({
+			getPledgeConfig() {
+				getPledgeConfig().then(res => {
+					if (res.code === 1) {
+						this.bnb_num = res.data.bnb_num
+						this.pledgeAddress = res.data.address
+					}
+				})
+			},
+			setListTab(listTab) {
+				if (this.listTab !== listTab) {
+					this.listTab = listTab
+					this.pledgeNUm = ''
+				}
+			},
+			getPledgeList() {
+				getPledgeList({
 					'page': this.page
 				}).then(res => {
 					if (res.code === 1) {
@@ -88,53 +92,58 @@
 					}
 				})
 			},
-      async addPledge(){
-        if(this.listTab===1){
-          if(this.coinNum<this.pledgeNUm){
-            tools.error('DAO不足')
-            return
-          }
-        }else {
-          if(this.pledgeTotal<this.pledgeNUm){
-            tools.error('贡献不足')
-            return
-          }
-          let bnbNUm=tokenpocketBnb.getBalance(this.address)
-          if (bnbNUm<this.bnb_num){
-            tools.error('BNB不足')
-            return
-          }
-        }
-        let data=''
-        let transactionData
-        if(this.listTab===1){
-          data='0xa9059cbb'
-          //icon转账
-          let formHex=web3.utils.numberToHex(ethers.utils.parseEther(this.pledgeNUm.toString()).toString());
-          data=data+tools.replenishZero(this.pledgeAddress)+tools.replenishZero(formHex)
-           transactionData=await tokenpocketBnb.getContractTransaction(data, 0);
-        }else {
-          //bnb转账
-          transactionData=await tokenpocketBnb.getTransactionData(this.pledgeAddress, this.bnb_num);
-        }
-        tokenpocketBnb.sendTransaction(transactionData).then(res=>{
-          if(res){
-            addPledge({'type':this.listTab,'money':this.pledgeNUm,'hash':res}).then(res=>{
-              if(res.code===0){
-                this.pledgeNUm=''
-                tools.success(res.msg)
-                this.getTotalMoney()
-              }else {
-                tools.error(res.msg)
-              }
-            })
-          }else {
-            tools.error('发起失败')
-          }
-          console.log(res)
-        })
+			async addPledge() {
+				if (this.listTab === 1) {
+					if (this.coinNum < this.pledgeNUm) {
+						tools.error('DAO不足')
+						return
+					}
+				} else {
+					if (this.pledgeTotal < this.pledgeNUm) {
+						tools.error('贡献不足')
+						return
+					}
+					let bnbNUm = tokenpocketBnb.getBalance(this.address)
+					if (bnbNUm < this.bnb_num) {
+						tools.error('BNB不足')
+						return
+					}
+				}
+				let data = ''
+				let transactionData
+				if (this.listTab === 1) {
+					data = '0xa9059cbb'
+					//icon转账
+					let formHex = web3.utils.numberToHex(ethers.utils.parseEther(this.pledgeNUm.toString())
+				.toString());
+					data = data + tools.replenishZero(this.pledgeAddress) + tools.replenishZero(formHex)
+					transactionData = await tokenpocketBnb.getContractTransaction(data, 0);
+				} else {
+					//bnb转账
+					transactionData = await tokenpocketBnb.getTransactionData(this.pledgeAddress, this.bnb_num);
+				}
+				tokenpocketBnb.sendTransaction(transactionData).then(res => {
+					if (res) {
+						addPledge({
+							'type': this.listTab,
+							'money': this.pledgeNUm,
+							'hash': res
+						}).then(res => {
+							if (res.code === 0) {
+								this.pledgeNUm = ''
+								tools.success(res.msg)
+								this.getTotalMoney()
+							} else {
+								tools.error(res.msg)
+							}
+						})
+					} else {
+						tools.error('发起失败')
+					}
+					console.log(res)
+				})
 
-      },
+			},
 			scrolltolower() {
 				if (this.list.length < this.total) {
 					++this.page
@@ -162,13 +171,13 @@
 				}, 100)
 
 			},
-      setMax(){
-        if(this.listTab===1){
-          this.pledgeNUm=this.coinNum
-        }else {
-          this.pledgeNUm=this.pledgeTotal
-        }
-      },
+			setMax() {
+				if (this.listTab === 1) {
+					this.pledgeNUm = this.coinNum
+				} else {
+					this.pledgeNUm = this.pledgeTotal
+				}
+			},
 		},
 	}
 </script>
@@ -206,68 +215,66 @@
 				</view>
 			</view>
 		</view>
-    <view class="list-tab">
-      <view class="tab-items">
-        <view class="tab-item" @click="setListTab(1)" :class="{'option-tab':listTab===1}">
-          质押
-        </view>
-        <view class="tab-item" @click="setListTab(2)" :class="{'option-tab':listTab===2}">
-          解压
-        </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 class="bgc-f p-40">
-        <view class="bgc-F6F7FA b-rad-20 mb-20 p-20 box-sizing-border mb-20" >
-          <view class="align-items-start flex-justify-space mb-20">
-            <view class="align-items-center">
-              <image
-                  class="t-img mr-8"
-                  :src="require('@/static/img/logo/logo.png')"
-              ></image>
-              <view class="fs-28">DAO</view>
-            </view>
-            <view class="max-box b-rad-20 fs-28" @click="setMax">
-              Max {{listTab===1 ?coinNum:pledgeTotal}}
-            </view>
-          </view>
-          <view>
-            <input v-model="pledgeNUm"  :placeholder="'输入要'+(listTab===1 ?'质押':'解压')+'的DAO数量'" placeholder-class="fs-28"></input>
-          </view>
-        </view>
-        <view class="convent-but b-rad-20 text-align-center fs-28 fc-f" @click="addPledge">
-          确定
-        </view>
-      </view>
+		<view class="list-tab">
+			<view class="tab-items">
+				<view class="tab-item" @click="setListTab(1)" :class="{'option-tab':listTab===1}">
+					质押
+				</view>
+				<view class="tab-item" @click="setListTab(2)" :class="{'option-tab':listTab===2}">
+					解压
+				</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 class="bgc-f p-40">
+				<view class="bgc-F6F7FA b-rad-20 mb-20 p-20 box-sizing-border mb-20">
+					<view class="align-items-start flex-justify-space mb-20">
+						<view class="align-items-center">
+							<image class="t-img mr-8" :src="require('@/static/img/logo/logo.png')"></image>
+							<view class="fs-28">DAO</view>
+						</view>
+						<view class="max-box b-rad-20 fs-28" @click="setMax">
+							Max {{listTab===1 ?coinNum:pledgeTotal}}
+						</view>
+					</view>
+					<view>
+						<input v-model="pledgeNUm" :placeholder="'输入要'+(listTab===1 ?'质押':'解压')+'的DAO数量'"
+							placeholder-class="fs-28"></input>
+					</view>
+				</view>
+				<view class="convent-but b-rad-20 text-align-center fs-28 fc-f" @click="addPledge">
+					确定
+				</view>
+			</view>
 
-    </view>
+		</view>
 
-    <view class="bgc-f p-20 box-sizing-border b-rad-20" >
-      <view class="fs-28 pt-5 mb-8">
-        质押记录
-      </view>
-      <view v-if="list.length<=0" class="blank-box align-items-center flex-justify-center">
-        <blank :showBlank="list.length<=0?true:false" message="暂无数据"></blank>
-      </view>
-      <view class="bgc-F6F7FA" v-else>
-        <view class="item-box align-items-center flex-justify-space" v-for="item in list" :key="item.id">
-          <view>
-            <view class="mb-8 fs-28 fw-b">{{item.type===1?'质押':'解压'}}</view>
-            <view class="fs-24">{{item.created_date}}</view>
-          </view>
-          <view class="">
-            <view class="fs-24" v-if="item.status===1">执行中</view>
-            <view class="fs-24" v-else-if="item.status===2">已完成</view>
-            <view class="fs-24" v-else>已作废</view>
-            <view class="fs-28 ">数量:<text class="fc-ED301D">{{item.money}}</text></view>
-          </view>
-        </view>
+		<view class="bgc-f p-20 box-sizing-border b-rad-20">
+			<view class="fs-28 pt-5 mb-8">
+				质押记录
+			</view>
+			<view v-if="list.length<=0" class="blank-box align-items-center flex-justify-center">
+				<blank :showBlank="list.length<=0?true:false" message="暂无数据"></blank>
+			</view>
+			<view class="bgc-F6F7FA" v-else>
+				<view class="item-box align-items-center flex-justify-space" v-for="item in list" :key="item.id">
+					<view>
+						<view class="mb-8 fs-28 fw-b">{{item.type===1?'质押':'解压'}}</view>
+						<view class="fs-24">{{item.created_date}}</view>
+					</view>
+					<view class="">
+						<view class="fs-24" v-if="item.status===1">执行中</view>
+						<view class="fs-24" v-else-if="item.status===2">已完成</view>
+						<view class="fs-24" v-else>已作废</view>
+						<view class="fs-28 ">数量:<text class="fc-ED301D">{{item.money}}</text></view>
+					</view>
+				</view>
 
-      </view>
-    </view>
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -297,73 +304,77 @@
 	.item-box:first-child {
 		border-top: none;
 	}
-  .list-tab {
-    width: 100%;
-    height: 100%;
-    background: #eaf2ff;
-    border-radius: 10rpx;
-    cursor: pointer;
-    position: relative;
-    margin: 20rpx 0 ;
 
-    .tab-items {
-      z-index: 10;
-      display: flex;
-      justify-content: space-between;
-      border-radius: 10rpx;
+	.list-tab {
+		width: 100%;
+		height: 100%;
+		background: #eaf2ff;
+		border-radius: 10rpx;
+		cursor: pointer;
+		position: relative;
+		margin: 20rpx 0;
+
+		.tab-items {
+			z-index: 10;
+			display: flex;
+			justify-content: space-between;
+			border-radius: 10rpx;
+
+			.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: 10rpx 10rpx 0 0;
+			background: #fff;
+			transition: .5s ease;
+			height: 32px;
+			width: calc(100% / 2);
+			top: 0;
+		}
 
-      .tab-item {
-        z-index: 10;
-        width: calc(100% / 2);
-        font-size: 13px;
-        color: #adbad0;
-        display: block;
-        height: 32px;
-        line-height: 32px;
-        text-align: center;
-      }
+		.bg-location-1 {
+			left: 0;
+			transition: .5s ease;
+		}
 
-      .option-tab {
-        color: #292929;
-      }
-    }
+		.bg-location-2 {
+			left: 50%;
+			transition: .5s ease;
+		}
 
-    .tab-item-bg {
-      position: absolute;
-      border-radius: 10rpx 10rpx 0 0;
-      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;
-    }
+	}
 
+	.t-img {
+		width: 70rpx;
+		height: 60rpx;
+	}
 
+	.max-box {
+		color: #0d81cf;
+		border: 2rpx solid #0d81cf;
+		padding: 6rpx 20rpx;
+	}
 
-  }
-  .t-img{
-    width: 70rpx;
-    height: 60rpx;
-  }
-  .max-box{
-    color: #0d81cf;
-    border: 2rpx solid #0d81cf;
-    padding: 6rpx 20rpx;
-  }
-  .convent-but{
-    height: 80rpx;
-    background: #0d81cf;
-    color: #fff;
-    line-height: 80rpx;
-  }
-</style>
+	.convent-but {
+		height: 80rpx;
+		background: #0d81cf;
+		color: #fff;
+		line-height: 80rpx;
+	}
+</style>

+ 12 - 11
pages/index/index.vue

@@ -68,18 +68,14 @@
 				}
 			},
 			scrolltolower() {
-				if(this.tab_index === 1) {
-					this.$refs.homeIndexRef.scrolltolower()
-				} else if(this.tab_index === 3) {
-					this.$refs.myIndexRef.scrolltolower()
-				}
+				this.$refs.homeIndexRef.scrolltolower()
 			}
 		},
 	}
 </script>
 
 <template>
-	<view class="flex-common-css">
+	<view class="flex-common-box">
 		<view class="top-b bgc-f plr-20 box-sizing-border align-items-center flex-justify-space">
 			<image class="img-box" src="@/static/img/logo/logo.png"></image>
 			<view class="fs-30">
@@ -88,12 +84,10 @@
 		</view>
 		<scroll-view :scroll-y="true" class="scroll-view-css" @scrolltolower="scrolltolower">
 			<view class="p-20 box-sizing-border">
-				<homeIndex ref="homeIndexRef" v-if="tab_index === 1" :address="address"></homeIndex>
-				<convertIndex v-else-if="tab_index === 2"></convertIndex>
-				<myIndex ref="myIndexRef" v-else></myIndex>
+				<homeIndex ref="homeIndexRef" :address="address"></homeIndex>
 			</view>
 		</scroll-view>
-		<view class="tab-box box-sizing-border">
+		<!-- 		<view class="tab-box box-sizing-border">
 			<view class="tab-b align-items-center flex-justify-space b-rad-10 bgc-f">
 				<view @click="tabClick(1)" class="flex-1 flex-direction-column align-items-center flex-justify-center">
 					<image class="tab-img mb-4" v-if="tab_index === 1" :src="require('@/static/img/tab/index.svg')">
@@ -112,11 +106,18 @@
 					<view class="fs-28" :class="tab_index === 3?'fc-f78820':''">我的</view>
 				</view>
 			</view>
-		</view>
+		</view> -->
 	</view>
 </template>
 
 <style scoped lang="scss">
+	.flex-common-box {
+		width: 100%;
+		height: calc(100vh - 138rpx);
+		display: flex;
+		flex-direction: column;
+	}
+
 	.content-b {
 		width: 100%;
 		height: calc(100vh - 98rpx);

+ 53 - 42
pages/my/my-index.vue

@@ -15,7 +15,9 @@
 				default: ''
 			}
 		},
-		components: {blank},
+		components: {
+			blank
+		},
 		watch: {
 			'address': function() {
 				this.getIconNum()
@@ -92,59 +94,68 @@
 </script>
 
 <template>
-	<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}}
+	<view class="flex-common-box p-20 box-sizing-border">
+		<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}}
+					</view>
 				</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}}
+				<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}}
+					</view>
 				</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}}
+				<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}}
+					</view>
 				</view>
 			</view>
-		</view>
-		<view class="fs-34 fw-b mb-20">
-			我的团队
-		</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 class="fs-34 fw-b mb-20">
+				我的团队
 			</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>
+			<scroll-view :scroll-y="true" class="scroll-view-css" @scrolltolower="scrolltolower">
+				<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 class="flex-1 pl-20 box-sizing-border">-->
-				<!--        <view class="fs-28 mb-4">自身业绩:10000</view>-->
-				<!--        <view class="fs-28">团队业绩:10000</view>-->
-				<!--      </view>-->
+			</scroll-view>
+			<view v-if="list.length<=0" class="blank-box align-items-center flex-justify-center">
+				<blank :showBlank="list.length<=0?true:false" message="暂无数据"></blank>
 			</view>
 		</view>
-		<view v-if="list.length<=0" class="blank-box align-items-center flex-justify-center">
-			<blank :showBlank="list.length<=0?true:false" message="暂无数据"></blank>
-		</view>
-		<view>
-
-		</view>
 	</view>
+
 </template>
 
 <style scoped lang="scss">
+	.flex-common-box {
+		width: 100%;
+		height: calc(100vh - 138rpx);
+		display: flex;
+		flex-direction: column;
+	}
+
 	.bg-one {
 		background-image: linear-gradient(270deg, #2353db, #54c8ff);
 	}