|
@@ -1,11 +1,9 @@
|
|
|
<template>
|
|
|
<!-- 公共组件 -->
|
|
|
<div class="info">
|
|
|
- <div class="head">
|
|
|
- <img :src="require('@/assets/svg/icon-back.svg')" alt="" class="back">
|
|
|
- <div class="title">Top Up</div>
|
|
|
- <img :src="require('@/assets/svg/icon-more-l.svg')" alt="" class="more">
|
|
|
- </div>
|
|
|
+
|
|
|
+ <v-head :title="'Top Up'"></v-head>
|
|
|
+
|
|
|
<!-- 内容 -->
|
|
|
<div class="content">
|
|
|
<div class="area-input-1">
|
|
@@ -22,14 +20,13 @@
|
|
|
<div class="box">
|
|
|
<img src="" alt="">
|
|
|
<span>BNB Chain</span>
|
|
|
- <img :src="require('@/assets/svg/icon-botton-up.svg')" alt="" class="up">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="info">
|
|
|
- <img src="" alt="">
|
|
|
+ <canvas id="canvas"></canvas>
|
|
|
<div class="txt">TJGkVQQ8e3HQSghPQkkYYE9AZf5Pmvc3vG</div>
|
|
|
- <div class="btn">Copy</div>
|
|
|
+ <div class="copy-btn" :data-clipboard-text="'TJGkVQQ8e3HQSghPQkkYYE9AZf5Pmvc3vG'">Copy</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="tips">
|
|
@@ -50,6 +47,63 @@
|
|
|
<script setup>
|
|
|
/* eslint-disable */
|
|
|
import { onMounted, ref } from "vue";
|
|
|
+import VHead from '@/view/popup/components/head.vue'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
+
|
|
|
+var QRCode = require('qrcode')
|
|
|
+var ClipboardJS = require('clipboard')
|
|
|
+
|
|
|
+
|
|
|
+function createQRCode() {
|
|
|
+ var canvas = document.getElementById('canvas')
|
|
|
+ QRCode.toCanvas(canvas, 'TJGkVQQ8e3HQSghPQkkYYE9AZf5Pmvc3vG', {
|
|
|
+ width: 150,
|
|
|
+ height: 150,
|
|
|
+ scale: 10, color: {
|
|
|
+ dark: '#000', // 二维码前景颜色
|
|
|
+ light: '#F7F7F7' // 二维码背景颜色
|
|
|
+ }
|
|
|
+
|
|
|
+ }, function (error) {
|
|
|
+ if (error) console.error(error)
|
|
|
+ console.log('success!');
|
|
|
+ })
|
|
|
+}
|
|
|
+function copyToken() {
|
|
|
+ var clipboard = new ClipboardJS('.copy-btn');
|
|
|
+ clipboard.on('success', function (e) {
|
|
|
+ ElMessage({
|
|
|
+ message: 'copy success',
|
|
|
+ grouping: true,
|
|
|
+ type: 'success',
|
|
|
+ offset: 5
|
|
|
+ })
|
|
|
+ console.info('Action:', e.action);
|
|
|
+ console.info('Text:', e.text);
|
|
|
+ console.info('Trigger:', e.trigger);
|
|
|
+
|
|
|
+ e.clearSelection();
|
|
|
+ });
|
|
|
+
|
|
|
+ clipboard.on('error', function (e) {
|
|
|
+
|
|
|
+ ElMessage({
|
|
|
+ message: 'copy error',
|
|
|
+ grouping: true,
|
|
|
+ type: 'error',
|
|
|
+ offset: 5
|
|
|
+ })
|
|
|
+ console.error('Action:', e.action);
|
|
|
+ console.error('Trigger:', e.trigger);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ createQRCode()
|
|
|
+ copyToken()
|
|
|
+})
|
|
|
+
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
|
|
@@ -58,30 +112,6 @@ import { onMounted, ref } from "vue";
|
|
|
position: relative;
|
|
|
height: 100%;
|
|
|
|
|
|
- .head {
|
|
|
- height: 48px;
|
|
|
- display: flex;
|
|
|
- flex-wrap: nowrap;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- padding: 0 12px;
|
|
|
-
|
|
|
- .back,
|
|
|
- .more {
|
|
|
- width: 24px;
|
|
|
- height: 24px;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
-
|
|
|
- .title {
|
|
|
- padding-left: 16px;
|
|
|
- flex: 1;
|
|
|
- color: #000000;
|
|
|
- font-size: 16px;
|
|
|
- font-weight: 500;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
.content {
|
|
|
padding: 16px 16px 0 16px;
|
|
|
|
|
@@ -142,10 +172,8 @@ import { onMounted, ref } from "vue";
|
|
|
padding-bottom: 20px;
|
|
|
margin-top: 20px;
|
|
|
|
|
|
- img {
|
|
|
+ canvas {
|
|
|
margin-top: 17px;
|
|
|
- width: 150px;
|
|
|
- height: 150px;
|
|
|
}
|
|
|
|
|
|
.txt {
|
|
@@ -154,12 +182,16 @@ import { onMounted, ref } from "vue";
|
|
|
font-size: 15px;
|
|
|
}
|
|
|
|
|
|
- .btn {
|
|
|
+ .copy-btn {
|
|
|
+ cursor: pointer;
|
|
|
margin-top: 22px;
|
|
|
width: 160px;
|
|
|
height: 40px;
|
|
|
line-height: 40px;
|
|
|
text-align: center;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #389AFF;
|
|
|
+
|
|
|
border: 1px solid #389AFF;
|
|
|
border-radius: 100px;
|
|
|
|
|
@@ -173,9 +205,11 @@ import { onMounted, ref } from "vue";
|
|
|
.tip-title {
|
|
|
color: #000000;
|
|
|
}
|
|
|
- .tip-content{
|
|
|
+
|
|
|
+ .tip-content {
|
|
|
color: red;
|
|
|
}
|
|
|
+
|
|
|
.tip-content {
|
|
|
color: #000000;
|
|
|
}
|