|
@@ -3,10 +3,10 @@
|
|
|
<div class="content">
|
|
|
<div class="card-box">
|
|
|
<div class="card-title">选择网络</div>
|
|
|
- <div class="card-input" style="justify-content: space-between;">
|
|
|
+ <div class="card-input" style="justify-content: space-between;" @click="showWallet = true">
|
|
|
<div class="card-input-lf">
|
|
|
- <svg-icon style="width: 30px; height: 30px;" name="acc" />
|
|
|
- <div class="card-text">STT</div>
|
|
|
+ <van-image width="30px" height="30px" round :src="selectTokenInfo.logo"/>
|
|
|
+ <div class="card-text">{{selectTokenInfo.name}}</div>
|
|
|
</div>
|
|
|
<svg-icon style="width: 16px; height: 16px;" name="right1" />
|
|
|
</div>
|
|
@@ -23,7 +23,7 @@
|
|
|
<van-field
|
|
|
type="textarea"
|
|
|
v-model="walletAddress"
|
|
|
- placeholder="请输入收货地址"
|
|
|
+ placeholder="请输入地址"
|
|
|
rows="1"
|
|
|
:autosize="true"
|
|
|
>
|
|
@@ -34,15 +34,49 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <van-button class="footer-btn" type="primary" size="large">确认</van-button>
|
|
|
+ <van-button class="footer-btn" type="primary" size="large" :disabled="isConfirm" @click="confirm">确认</van-button>
|
|
|
+ <van-popup v-model:show="showWallet" position="bottom" round style="height:400px">
|
|
|
+ <div class="pop-content" style="height:400px">
|
|
|
+ <div class="pop-title">
|
|
|
+ <svg-icon style="width: 24px; height: 24px;" name="left-arrow" @click="showWallet = false"/>
|
|
|
+ <div class="title">选择网络</div>
|
|
|
+ </div>
|
|
|
+ <div class="list-ul">
|
|
|
+ <div class="list-li" v-for="item in hotTokensList" @click="changeList(item)" :key="item.name">
|
|
|
+ <div class="list-li-lf">
|
|
|
+ <van-image width="42px" height="42px" round :src="item.logo"/>
|
|
|
+ <div style="margin-left: 12px;">{{item.name}}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-popup>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { useRouter } from 'vue-router'
|
|
|
-const router = useRouter();
|
|
|
+import { showToast } from 'vant';
|
|
|
+import { useWalletStore } from "@/stores/modules/walletStore";
|
|
|
+const walletStore = useWalletStore();
|
|
|
+
|
|
|
+let hotTokensList = walletStore.tokenList;
|
|
|
+let selectTokenInfo = ref(walletStore.tokenList[0]);
|
|
|
+const showWallet = ref(false);
|
|
|
const addressName = ref('')
|
|
|
const walletAddress = ref('')
|
|
|
+
|
|
|
+const isConfirm = computed(()=>{
|
|
|
+ return !(addressName.value.trim() && walletAddress.value.trim());
|
|
|
+})
|
|
|
+// 切换网络
|
|
|
+const changeList = (item) => {
|
|
|
+ showWallet.value = false;
|
|
|
+ selectTokenInfo.value = item;
|
|
|
+}
|
|
|
+// 确认
|
|
|
+const confirm = () => {
|
|
|
+
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
@@ -112,6 +146,52 @@ const walletAddress = ref('')
|
|
|
box-sizing: border-box;
|
|
|
color: #fff;
|
|
|
}
|
|
|
+ .pop-content{
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ .pop-title{
|
|
|
+ padding: 17px;
|
|
|
+ border-bottom: 1px solid #F2F2F2;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-family: PingFang SC, PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 17px;
|
|
|
+ color: #000000;
|
|
|
+ .title{
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .list-ul{
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ overflow: auto;
|
|
|
+ margin: 16px;
|
|
|
+ .list-li{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-family: PingFang SC, PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ margin-bottom: 16px;
|
|
|
+ .list-li-lf{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 15px;
|
|
|
+ color: #000000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .list-li:last-child{
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .list-ul::-webkit-scrollbar{
|
|
|
+ width: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
:deep(.van-button--primary){
|
|
|
border: none !important;
|