123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282 |
- <template>
- <!-- 公共组件 -->
- <div class="confirm">
- <v-head :title="'Withdraw'" :show_more="true"></v-head>
- <!-- 内容 -->
- <div class="content">
- <div class="order">
- <div class="txt">Confirm order</div>
- <div class="money">{{ withdraw_info.data.amount }} {{ withdraw_info.data.currency_code }}</div>
- <div class="txt">≈$6.67</div>
- </div>
- <div class="info">
- <div class="item">
- <div class="key">Address</div>
- <div class="val">{{ withdraw_info.data.input_address }}</div>
- </div>
- <div class="item">
- <div class="key">Network</div>
- <div class="val">{{ withdraw_info.token_chain }}</div>
- </div>
- <div class="info-warn">
- Ensure the network is correct
- </div>
- <div class="item">
- <div class="key">Amout</div>
- <div class="val">{{ withdraw_info.data.amount }} {{ withdraw_info.data.currency_code }}</div>
- </div>
- <div class="item">
- <div class="key">Network fee</div>
- <div class="val">{{ withdraw_info.data.fee_amount }} {{ withdraw_info.data.currency_code }}</div>
- </div>
- </div>
- <div class="tips">
- <div class="tip-title">TIPS</div>
- <div class="tip-content">asdasdasdasd</div>
- </div>
- </div>
- <!-- 底部 -->
- <div class="footer">
- <div class="left">
- <img :src="require('@/assets/svg/icon-enter-ed.svg')" alt="" v-if="state.img_enter_state"
- @click="clickEnter">
- <img :src="require('@/assets/svg/icon-enter.svg')" alt="" v-else @click="clickEnter">
- <span @click="clickEnter">同意</span>
- <span class="agreement" @click="clickRisk">用户协议</span>
- </div>
- <div class="right">
- <div class="btn" @click="clickBtn" :class="{ enter: state.img_enter_state }">Confirm</div>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- import { reactive, inject } from 'vue'
- import VHead from '@/view/popup/components/head.vue'
- import { withdrawRequest } from "@/http/account";
- import router from "@/router/popup.js";
- import { message } from "ant-design-vue";
- let withdraw_info = inject('withdraw_info')
- withdraw_info.source = 'confirm'
- withdraw_info.state_page = {}
- let state = reactive({
- img_enter_state: false
- })
- const clickBtn = () => {
- if (!state.img_enter_state) {
- return
- }
- withdrawRequest({
- params: {
- "amountValue": withdraw_info.data.input_amount,
- "currencyCode": withdraw_info.currency_code,
- "withdrawNetwork": withdraw_info.token_chain,
- "withdrawReceiveAccount": withdraw_info.data.input_address
- }
- }).then((res) => {
- switch (res.code.toString()) {
- case '0':
- withdraw_info.state_page.txt = ['123123']
- router.push('/withdraw/success')
- break
- case '4002':
- message.error(res.msg);
- break
- default:
- message.error(res.code);
- }
- })
- }
- const clickRisk = () => {
- router.push('/withdraw/risk')
- }
- const clickEnter = () => {
- state.img_enter_state = !state.img_enter_state
- }
- </script>
- <style lang='scss' scoped>
- .confirm {
- position: relative;
- height: 100%;
- .head {
- height: 48px;
- display: flex;
- flex-wrap: nowrap;
- justify-content: space-between;
- align-items: center;
- padding: 0 12px;
- border-bottom: 1px solid #DBDBDB;
- .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;
- .order {
- text-align: center;
- .txt {
- font-weight: 500;
- font-size: 15px;
- color: #000000;
- }
- .txt:first-child {
- margin-bottom: 9px;
- }
- .txt:last-child {
- margin-top: 5px;
- }
- .money {
- font-weight: 600;
- font-size: 24px;
- color: #000000;
- }
- }
- .info {
- text-align: right;
- background: #F7F7F7;
- border-radius: 18px;
- padding: 0 16px 20px 16px;
- margin-top: 20px;
- .item {
- display: flex;
- padding-top: 20px;
- .key {
- text-align: left;
- width: 100px;
- color: #8B8B8B;
- font-weight: 500;
- font-size: 14px;
- }
- .val {
- word-break: break-all;
- flex: 1;
- font-weight: 500;
- font-size: 14px;
- text-align: right;
- letter-spacing: 0.5px;
- }
- }
- .info-warn {
- margin-top: 7px;
- background: #F4EEE1;
- border-radius: 5px;
- height: 30px;
- line-height: 30px;
- text-align: center;
- display: inline-block;
- padding: 0 8px;
- color: #AD8226;
- }
- }
- .tips {
- margin-top: 30px;
- font-size: 13px;
- .tip-title {
- color: #000000;
- }
- .tip-content {
- color: #000000;
- }
- }
- }
- .footer {
- border-top: 1px solid #DBDBDB;
- bottom: 0;
- height: 80px;
- display: flex;
- position: absolute;
- justify-content: space-between;
- width: 100%;
- bottom: 0;
- align-items: center;
- .left {
- cursor: pointer;
- margin-left: 16px;
- display: flex;
- align-items: center;
- img {
- width: 24px;
- height: 24px;
- margin-right: 10px;
- }
- span {
- font-size: 14px;
- }
- .agreement {
- text-decoration: underline;
- color: #389AFF;
- }
- }
- .right {
- margin-right: 16px;
- .btn {
- cursor: pointer;
- width: 140px;
- height: 46px;
- line-height: 46px;
- text-align: center;
- font-weight: 600;
- font-size: 18px;
- color: #FFFFFF;
- background: #D2D2D2;
- border-radius: 100px;
- }
- .enter {
- background: #389AFF;
- }
- }
- }
- }
- </style>
|