|
@@ -10,7 +10,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="head-item head-right">
|
|
<view class="head-item head-right">
|
|
|
<view class="right-img" @click.stop="setShowLang"><image src="@/static/img/index/lang-img.png" mode="aspectFill"></image></view>
|
|
<view class="right-img" @click.stop="setShowLang"><image src="@/static/img/index/lang-img.png" mode="aspectFill"></image></view>
|
|
|
- <view class="right-text">0x848da9...cfa9</view>
|
|
|
|
|
|
|
+ <view class="right-text">{{getShowAddress()}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="top-lang" :class="{'show-lang':showLang}">
|
|
<view class="top-lang" :class="{'show-lang':showLang}">
|
|
@@ -36,14 +36,14 @@
|
|
|
<view class="data-item">{{$t('index.index.data.text')}}</view>
|
|
<view class="data-item">{{$t('index.index.data.text')}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="content-item">
|
|
<view class="content-item">
|
|
|
- <view class="item-value">{{$t('index.index.item.one')}}</view>
|
|
|
|
|
- <view class="item-value">ID:</view>
|
|
|
|
|
|
|
+ <view class="item-value">{{$t('index.index.item.one')}} : {{memberData.levelName}}</view>
|
|
|
|
|
+ <view class="item-value">ID : {{memberData.invite_code}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="content-item">
|
|
<view class="content-item">
|
|
|
- <view class="item-value">{{$t('index.index.item.two')}}</view><view class="item-value"></view>
|
|
|
|
|
|
|
+ <view class="item-value">{{$t('index.index.item.two')}} : {{memberData.recommendNum}}</view><view class="item-value"></view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="content-item">
|
|
<view class="content-item">
|
|
|
- <view class="item-value">{{$t('index.index.item.three')}}</view><view class="item-value"></view>
|
|
|
|
|
|
|
+ <view class="item-value">{{$t('index.index.item.three')}} : {{memberData.teamNum}}</view><view class="item-value"></view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="content-share">
|
|
<view class="content-share">
|
|
|
<view class="share-title">{{$t('index.index.share.one')}}</view>
|
|
<view class="share-title">{{$t('index.index.share.one')}}</view>
|
|
@@ -108,8 +108,10 @@
|
|
|
|
|
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import {getInvestData} from "@/api/contract";
|
|
|
|
|
|
|
+import {getInvestData, setInvest} from "@/api/contract";
|
|
|
import tools from "@/common/js/tools";
|
|
import tools from "@/common/js/tools";
|
|
|
|
|
+import tokenpocketBnb from "@/common/wallet/tokenpocket-wallet/tokenpocket-bnb";
|
|
|
|
|
+import {getMemberInfo} from "@/api/member";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {},
|
|
components: {},
|
|
@@ -122,8 +124,22 @@ export default {
|
|
|
langList:[{'name':'zh-Hans','value':'简体中文'},{'name':'en','value':'English'},{'name':'ja','value':'日本語'},{'name':'ko','value':'한국어'}],
|
|
langList:[{'name':'zh-Hans','value':'简体中文'},{'name':'en','value':'English'},{'name':'ja','value':'日本語'},{'name':'ko','value':'한국어'}],
|
|
|
tabNum:0,
|
|
tabNum:0,
|
|
|
investData:{
|
|
investData:{
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ id: 1,
|
|
|
|
|
+ invest_money: '',
|
|
|
|
|
+ sysAddress: "",
|
|
|
|
|
+ sendNum: "",
|
|
|
|
|
+ },
|
|
|
|
|
+ memberData:{
|
|
|
|
|
+ "id": 30,
|
|
|
|
|
+ "address": "",
|
|
|
|
|
+ "invite_code": "72592982",
|
|
|
|
|
+ "level_id": 0,
|
|
|
|
|
+ "levelName": "V0",
|
|
|
|
|
+ "recommendNum": 0,
|
|
|
|
|
+ "teamNum": 0
|
|
|
|
|
+ },
|
|
|
|
|
+ bnbNum:0,
|
|
|
|
|
+ babAddress:''
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -132,12 +148,16 @@ export default {
|
|
|
async onLoad(query) {
|
|
async onLoad(query) {
|
|
|
this.applicationLocale = uni.getLocale();
|
|
this.applicationLocale = uni.getLocale();
|
|
|
this.getInvestData()
|
|
this.getInvestData()
|
|
|
- // this.usdtNum = await bitkeepTron.getTokenBalance('', 0);
|
|
|
|
|
|
|
+ this.bnbNum = await tokenpocketBnb.getBalance();
|
|
|
|
|
+ this.getMyData()
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ getShowAddress(){
|
|
|
|
|
+ return tools.getShowAddress(this.babAddress)
|
|
|
|
|
+ },
|
|
|
setShowLang() {
|
|
setShowLang() {
|
|
|
this.showLang = !this.showLang
|
|
this.showLang = !this.showLang
|
|
|
},
|
|
},
|
|
@@ -152,6 +172,14 @@ export default {
|
|
|
this.tabNum=tabNum
|
|
this.tabNum=tabNum
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ getMyData(){
|
|
|
|
|
+ this.babAddress= tokenpocketBnb.getMyAddress()
|
|
|
|
|
+ getMemberInfo().then((res)=>{
|
|
|
|
|
+ if(res.code===1){
|
|
|
|
|
+ this.memberData=res.data
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
getInvestData() {
|
|
getInvestData() {
|
|
|
getInvestData().then((res) => {
|
|
getInvestData().then((res) => {
|
|
|
if (res.code === 1) {
|
|
if (res.code === 1) {
|
|
@@ -163,6 +191,33 @@ export default {
|
|
|
tools.goToError(4)
|
|
tools.goToError(4)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ async setInvest() {
|
|
|
|
|
+ if (this.bnbNum < this.investData.invest_money && !tools.isDevelopment()) {
|
|
|
|
|
+ tools.error(this.$t('index.index.invest.no_usdt'))
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.isAjax) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.isAjax = true
|
|
|
|
|
+ let data = tokenpocketBnb.getTransactionData(this.investData.sysAddress, this.investData.invest_money)
|
|
|
|
|
+ tokenpocketBnb.sendTransaction(data).then((res)=>{
|
|
|
|
|
+ this.sendSetInvest(res)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ sendSetInvest(hashRes){
|
|
|
|
|
+ setInvest({'txid':hashRes,'id':this.investData.id}).then((res)=>{
|
|
|
|
|
+ if(res.code===1){
|
|
|
|
|
+ tools.success(res.msg)
|
|
|
|
|
+ // setTimeout(()=>{
|
|
|
|
|
+ // tools.leftClick()
|
|
|
|
|
+ // },1500)
|
|
|
|
|
+ }else {
|
|
|
|
|
+ this.isAjax = false
|
|
|
|
|
+ tools.error(res.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
},
|