bitcooo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

132 lines
3.2 KiB

<template>
<view class="maintoP">
<navigation :showBack="false" :bgnum="true" class="aaa">
<image src="../../../../static/tongyonh/Vector.png" mode="aspectFit" class="back" @click="back()" ></image>
<text class="big_title">
NFT collections
</text>
</navigation>
<view class="main">
<view class="main_con">
<view class="flex item">
<view class="imgcon flex2">
<image :src="wallet.coinList[0].icon" mode="aspectFit" class="img"></image>
<text class="tex1">{{wallet.coinList[0].name2}}</text>
</view>
<view class="text1">
{{wallet.address}}
<image src="../../../../static/tongyonh/chevron_right_24px.png" mode="aspectFit" class="lfetimg"></image>
</view>
</view>
<view class="item2">
<view class="title">
Contract address
</view>
<input type="text" v-model="caddress" value="" class="input" placeholder-style="color:#BEBEBE;fontSize:14px" placeholder="Please enter the contract address"/>
</view>
<view class="item2">
<view class="title">
Token ID
</view>
<input type="text" v-model="tid" value="" class="input" placeholder-style="color:#BEBEBE;fontSize:14px" placeholder="Please enter token ID"/>
</view>
<view class="btn" @click="Add">
Confirm
</view>
</view>
</view>
</view>
</template>
<script>
import cont from "@/components/navigation/navigation.vue"
import token from "@/utils/TokenUtil"
export default {
data() {
return {
caddress:'',
tid:'',
wallet:{},
nftIndex:0,
nftContrct:[[]],
walletInfo:{},
address:'',
proid:'',
}
},
onLoad() {
if(uni.getStorageSync('wallet')){
this.address=uni.getStorageSync('wallet').address
this.wallet=uni.getStorageSync('wallet')
this.wallet.address = this.wallet.address.substring(0, 6) + '...' + this.wallet.address
.substring(25, this.wallet.address.length);
}else{
this.wallet=uni.getStorageSync('walletInfo').BTC[0]
this.wallet.address = this.wallet.address.substring(0, 6) + '...' + this.wallet.address
console.log(this.wallet,111)
}
},
methods: {
back(){
uni.reLaunch({
url:'../collectionDetail/index'
})
},
Add(){
this.proid=uni.getStorageSync('proid')
uni.request({
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
url: 'http://wallet-api.weirui0755.com/api/nft/addNftCollection', //仅为示例,并非真实接口地址。
method: 'POST',
data: {
address:this.address,
contract:this.caddress,
tonkenId:this.tid,
nftProjectId:this.proid
},
dataType:'json',
success: (res) => {
if(res.data.code==200){
uni.showToast({
title: 'Successfully',
icon: 'success',
duration: 1500
})
setTimeout(()=>{
uni.navigateTo({
url:'../addCollection/index'
})
},1500)
}
}
});
},
}
};
</script>
<style scoped>
</style>
<style>
@import './index.css';
</style>