confirm.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <!-- 公共组件 -->
  3. <div class="confirm">
  4. <v-head :title="'Withdraw'" :show_more="true"></v-head>
  5. <!-- 内容 -->
  6. <div class="content">
  7. <div class="order">
  8. <div class="txt">Confirm order</div>
  9. <div class="money">{{ withdraw_info.data.amount }} {{ withdraw_info.data.currency_code }}</div>
  10. <div class="txt">≈$6.67</div>
  11. </div>
  12. <div class="info">
  13. <div class="item">
  14. <div class="key">Address</div>
  15. <div class="val">{{ withdraw_info.data.input_address }}</div>
  16. </div>
  17. <div class="item">
  18. <div class="key">Network</div>
  19. <div class="val">{{ withdraw_info.token_chain }}</div>
  20. </div>
  21. <div class="info-warn">
  22. Ensure the network is correct
  23. </div>
  24. <div class="item">
  25. <div class="key">Amout</div>
  26. <div class="val">{{ withdraw_info.data.amount }} {{ withdraw_info.data.currency_code }}</div>
  27. </div>
  28. <div class="item">
  29. <div class="key">Network fee</div>
  30. <div class="val">{{ withdraw_info.data.fee_amount }} {{ withdraw_info.data.currency_code }}</div>
  31. </div>
  32. </div>
  33. <div class="tips">
  34. <div class="tip-title">TIPS</div>
  35. <div class="tip-content">asdasdasdasd</div>
  36. </div>
  37. </div>
  38. <!-- 底部 -->
  39. <div class="footer">
  40. <div class="left">
  41. <img :src="require('@/assets/svg/icon-enter-ed.svg')" alt="" v-if="state.img_enter_state"
  42. @click="clickEnter">
  43. <img :src="require('@/assets/svg/icon-enter.svg')" alt="" v-else @click="clickEnter">
  44. <span @click="clickEnter">同意</span> &nbsp;
  45. <span class="agreement" @click="clickRisk">用户协议</span>
  46. </div>
  47. <div class="right">
  48. <div class="btn" @click="clickBtn" :class="{ enter: state.img_enter_state }">Confirm</div>
  49. </div>
  50. </div>
  51. </div>
  52. </template>
  53. <script setup>
  54. import { reactive, inject } from 'vue'
  55. import VHead from '@/view/popup/components/head.vue'
  56. import { withdrawRequest } from "@/http/account";
  57. import router from "@/router/popup.js";
  58. import { message } from "ant-design-vue";
  59. let withdraw_info = inject('withdraw_info')
  60. withdraw_info.source = 'confirm'
  61. withdraw_info.state_page = {}
  62. let state = reactive({
  63. img_enter_state: false
  64. })
  65. const clickBtn = () => {
  66. if (!state.img_enter_state) {
  67. return
  68. }
  69. withdrawRequest({
  70. params: {
  71. "amountValue": withdraw_info.data.input_amount,
  72. "currencyCode": withdraw_info.currency_code,
  73. "withdrawNetwork": withdraw_info.token_chain,
  74. "withdrawReceiveAccount": withdraw_info.data.input_address
  75. }
  76. }).then((res) => {
  77. switch (res.code.toString()) {
  78. case '0':
  79. withdraw_info.state_page.txt = ['123123']
  80. router.push('/withdraw/success')
  81. break
  82. case '4002':
  83. message.error(res.msg);
  84. break
  85. default:
  86. message.error(res.code);
  87. }
  88. })
  89. }
  90. const clickRisk = () => {
  91. router.push('/withdraw/risk')
  92. }
  93. const clickEnter = () => {
  94. state.img_enter_state = !state.img_enter_state
  95. }
  96. </script>
  97. <style lang='scss' scoped>
  98. .confirm {
  99. position: relative;
  100. height: 100%;
  101. .head {
  102. height: 48px;
  103. display: flex;
  104. flex-wrap: nowrap;
  105. justify-content: space-between;
  106. align-items: center;
  107. padding: 0 12px;
  108. border-bottom: 1px solid #DBDBDB;
  109. .back,
  110. .more {
  111. width: 24px;
  112. height: 24px;
  113. cursor: pointer;
  114. }
  115. .title {
  116. padding-left: 16px;
  117. flex: 1;
  118. color: #000000;
  119. font-size: 16px;
  120. font-weight: 500;
  121. }
  122. }
  123. .content {
  124. padding: 16px 16px 0 16px;
  125. .order {
  126. text-align: center;
  127. .txt {
  128. font-weight: 500;
  129. font-size: 15px;
  130. color: #000000;
  131. }
  132. .txt:first-child {
  133. margin-bottom: 9px;
  134. }
  135. .txt:last-child {
  136. margin-top: 5px;
  137. }
  138. .money {
  139. font-weight: 600;
  140. font-size: 24px;
  141. color: #000000;
  142. }
  143. }
  144. .info {
  145. text-align: right;
  146. background: #F7F7F7;
  147. border-radius: 18px;
  148. padding: 0 16px 20px 16px;
  149. margin-top: 20px;
  150. .item {
  151. display: flex;
  152. padding-top: 20px;
  153. .key {
  154. text-align: left;
  155. width: 100px;
  156. color: #8B8B8B;
  157. font-weight: 500;
  158. font-size: 14px;
  159. }
  160. .val {
  161. word-break: break-all;
  162. flex: 1;
  163. font-weight: 500;
  164. font-size: 14px;
  165. text-align: right;
  166. letter-spacing: 0.5px;
  167. }
  168. }
  169. .info-warn {
  170. margin-top: 7px;
  171. background: #F4EEE1;
  172. border-radius: 5px;
  173. height: 30px;
  174. line-height: 30px;
  175. text-align: center;
  176. display: inline-block;
  177. padding: 0 8px;
  178. color: #AD8226;
  179. }
  180. }
  181. .tips {
  182. margin-top: 30px;
  183. font-size: 13px;
  184. .tip-title {
  185. color: #000000;
  186. }
  187. .tip-content {
  188. color: #000000;
  189. }
  190. }
  191. }
  192. .footer {
  193. border-top: 1px solid #DBDBDB;
  194. bottom: 0;
  195. height: 80px;
  196. display: flex;
  197. position: absolute;
  198. justify-content: space-between;
  199. width: 100%;
  200. bottom: 0;
  201. align-items: center;
  202. .left {
  203. cursor: pointer;
  204. margin-left: 16px;
  205. display: flex;
  206. align-items: center;
  207. img {
  208. width: 24px;
  209. height: 24px;
  210. margin-right: 10px;
  211. }
  212. span {
  213. font-size: 14px;
  214. }
  215. .agreement {
  216. text-decoration: underline;
  217. color: #389AFF;
  218. }
  219. }
  220. .right {
  221. margin-right: 16px;
  222. .btn {
  223. cursor: pointer;
  224. width: 140px;
  225. height: 46px;
  226. line-height: 46px;
  227. text-align: center;
  228. font-weight: 600;
  229. font-size: 18px;
  230. color: #FFFFFF;
  231. background: #D2D2D2;
  232. border-radius: 100px;
  233. }
  234. .enter {
  235. background: #389AFF;
  236. }
  237. }
  238. }
  239. }
  240. </style>