Commit 48e03072 authored by wykolor's avatar wykolor

feat: 提现界面完成

parent 657415dd
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve --open", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="stylesheet" href="//at.alicdn.com/t/font_2425189_wpm8fbaoef8.css"> <link rel="stylesheet" href="//at.alicdn.com/t/font_2425189_lvk0clvlo2.css">
<title><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
<script src="https://ssl.captcha.qq.com/TCaptcha.js"></script> <script src="https://ssl.captcha.qq.com/TCaptcha.js"></script>
</head> </head>
......
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15;
/* 1 */
-webkit-text-size-adjust: 100%;
/* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box;
/* 1 */
height: 0;
/* 1 */
overflow: visible;
/* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none;
/* 1 */
text-decoration: underline;
/* 2 */
text-decoration: underline dotted;
/* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
/* 1 */
font-size: 100%;
/* 1 */
line-height: 1.15;
/* 1 */
margin: 0;
/* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input {
/* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select {
/* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box;
/* 1 */
color: inherit;
/* 2 */
display: table;
/* 1 */
max-width: 100%;
/* 1 */
padding: 0;
/* 3 */
white-space: normal;
/* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box;
/* 1 */
padding: 0;
/* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield;
/* 1 */
outline-offset: -2px;
/* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button;
/* 1 */
font: inherit;
/* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}
\ No newline at end of file
// Color Palette
@black: #000;
@white: #fff;
@gray-1: #f7f8fa;
@gray-2: #f2f3f5;
@gray-3: #ebedf0;
@gray-4: #dcdee0;
@gray-5: #c8c9cc;
@gray-6: #969799;
@gray-7: #646566;
@gray-8: #323233;
@red: #ee0a24;
@blue: #1989fa;
@orange: #ff976a;
@orange-dark: #ed6a0c;
@orange-light: #fffbe8;
@green: #07c160;
// Gradient Colors
@gradient-red: linear-gradient(to right, #ff6034, #ee0a24);
@gradient-orange: linear-gradient(to right, #ffd01e, #ff8917);
// Component Colors
@text-color: @gray-8;
@active-color: @gray-2;
@active-opacity: 0.7;
@disabled-opacity: 0.5;
@background-color: @gray-1;
@background-color-light: #fafafa;
@text-link-color: #576b95;
// Padding
@padding-base: 4px;
@padding-xs: @padding-base * 2;
@padding-sm: @padding-base * 3;
@padding-md: @padding-base * 4;
@padding-lg: @padding-base * 6;
@padding-xl: @padding-base * 8;
// Font
@font-size-xs: 10px;
@font-size-sm: 12px;
@font-size-md: 14px;
@font-size-lg: 16px;
@font-weight-bold: 500;
@line-height-xs: 14px;
@line-height-sm: 18px;
@line-height-md: 20px;
@line-height-lg: 22px;
@base-font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB',
'Microsoft Yahei', sans-serif;
@price-integer-font-family: Avenir-Heavy, PingFang SC, Helvetica Neue, Arial,
sans-serif;
// Animation
@animation-duration-base: 0.3s;
@animation-duration-fast: 0.2s;
@animation-timing-function-enter: ease-out;
@animation-timing-function-leave: ease-in;
// Border
@border-color: @gray-3;
@border-width-base: 1px;
@border-radius-sm: 2px;
@border-radius-md: 4px;
@border-radius-lg: 8px;
@border-radius-max: 999px;
\ No newline at end of file
...@@ -2,6 +2,7 @@ import { createApp } from "vue"; ...@@ -2,6 +2,7 @@ import { createApp } from "vue";
import App from "./App.vue"; import App from "./App.vue";
import router from "./router"; import router from "./router";
import store from "./store"; import store from "./store";
import './assets/style/normalize.css';
import 'vant/lib/index.css'; import 'vant/lib/index.css';
import 'amfe-flexible'; import 'amfe-flexible';
createApp(App) createApp(App)
......
...@@ -9,12 +9,12 @@ const routes: Array<RouteRecordRaw> = [ ...@@ -9,12 +9,12 @@ const routes: Array<RouteRecordRaw> = [
{ {
path: "/bonusDetail", path: "/bonusDetail",
name: "bonusDetail", name: "bonusDetail",
component: () => import("../views/bonus-detail/index.vue") component: () => import("../views/bonus/bonus-detail/index.vue")
}, },
{ {
path: "/withdraw", path: "/withdraw",
name: "withdraw", name: "withdraw",
component: () => import("../views/withdraw/index.vue") component: () => import("../views/bonus/withdraw/index.vue")
} }
]; ];
......
import axios, { AxiosRequestConfig } from 'axios' import axios, { AxiosRequestConfig } from 'axios'
import baseUrl from "./env"; import baseUrl from "./env";
import {Toast} from 'vant'
const instance = axios.create({ const instance = axios.create({
// headers: { // headers: {
// 'content-type': 'application/json;charset=UTF-8', // 'content-type': 'application/json;charset=UTF-8',
...@@ -12,10 +13,15 @@ const instance = axios.create({ ...@@ -12,10 +13,15 @@ const instance = axios.create({
function startLoading() { function startLoading() {
Toast.loading({
message: '加载中...',
forbidClick: true,
duration: 0
});
} }
function endLoading() { function endLoading() {
Toast.clear();
} }
// 声明一个对象用于存储请求个数 // 声明一个对象用于存储请求个数
......
...@@ -9,86 +9,78 @@ ...@@ -9,86 +9,78 @@
v-model:active="active" v-model:active="active"
> >
<van-tab title="支出" class="bonus-detail-pay-list"> <van-tab title="支出" class="bonus-detail-pay-list">
<div <template v-if="payList.length">
v-for="item in payList" <div v-for="item in payList" :key="item.id" class="bonus-detail-pay-item">
:key="item.id" <ul>
class="bonus-detail-pay-item" <li style="color: #000">{{ item.title }}</li>
> <li class="flex gray">
<ul> <span>{{ item.handleTime }}</span>
<li style="color: #000">{{ item.title }}</li> <label
<li class="flex gray"> >{{ item.status === 0 ? "流水号:" : "订单号:" }}{{ item.handleNumber }}</label
<span>{{ item.handleTime }}</span> >
<label </li>
>{{ item.status === 0 ? "流水号:" : "订单号:" </ul>
}}{{ item.handleNumber }}</label <ul class="bonus-detail-pay-item-desc">
> <li v-if="item.status === 0">申请时间:{{ item.applyTime }}</li>
</li> <li v-if="item.status === 0" class="bonus-detail-pay-item-desc-money flex">
</ul> <span>到账时间: {{ item.arrivalTime }}</span>
<ul class="bonus-detail-pay-item-desc"> <label>¥{{ item.money }}</label>
<li v-if="item.status === 0">申请时间:{{ item.applyTime }}</li> </li>
<li <li v-if="item.status === 1">{{ item.className }}</li>
v-if="item.status === 0" <li v-if="item.status === 1" class="bonus-detail-pay-item-desc-money flex">
class="bonus-detail-pay-item-desc-money flex" <span>{{ item.schoolName }}</span
> ><label>¥{{ item.money }}</label>
<span>到账时间: {{ item.arrivalTime }}</span> </li>
<label>¥{{ item.money }}</label> </ul>
</li> </div>
<li v-if="item.status === 1">{{ item.className }}</li> </template>
<li
v-if="item.status === 1" <van-empty description="暂无数据~" v-else />
class="bonus-detail-pay-item-desc-money flex"
>
<span>{{ item.schoolName }}</span
><label>¥{{ item.money }}</label>
</li>
</ul>
</div>
</van-tab> </van-tab>
<van-tab title="收入" class="bonus-detail-income-list"> <van-tab title="收入" class="bonus-detail-income-list">
<div <template v-if="incomeList.length">
class="bonus-detail-income-item" <div class="bonus-detail-income-item" v-for="item in incomeList" :key="item.id">
v-for="item in incomeList" <ul>
:key="item.id" <li>{{ item.title }}</li>
> <li class="flex bonus-detail-pay-item-desc-money">
<ul> <span class="gray">{{ item.handleTime }}</span>
<li>{{ item.title }}</li> <label>¥{{ item.money }}</label>
<li class="flex bonus-detail-pay-item-desc-money"> </li>
<span class="gray">{{ item.handleTime }}</span> </ul>
<label>¥{{ item.money }}</label> </div>
</li> </template>
</ul> <van-empty description="暂无数据~" v-else />
</div>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { NavBar, Tab, Tabs, Cell } from "vant"; import { NavBar, Tab, Tabs, Cell, Empty } from "vant";
import { defineComponent } from "vue"; import { defineComponent } from "vue";
const BonusDetail = defineComponent({ const BonusDetail = defineComponent({
data() { data() {
return { return {
active: 0, active: 0,
incomeList: [ incomeList: [
{ // {
title: "转介绍转入", // title: "转介绍转入",
money: 3000.06, // money: 3000.06,
handleTime: "2020.10.12 12:10", // handleTime: "2020.10.12 12:10",
status: 0 // status: 0
}, // },
{ // {
title: "被介绍转入", // title: "被介绍转入",
money: 3000.05, // money: 3000.05,
handleTime: "2020.10.12 12:10", // handleTime: "2020.10.12 12:10",
status: 1 // status: 1
}, // },
{ // {
title: "订单返回", // title: "订单返回",
money: 3000.05, // money: 3000.05,
handleTime: "2020.10.12 12:10", // handleTime: "2020.10.12 12:10",
status: 2 // status: 2
} // }
], ],
payList: [ payList: [
{ {
...@@ -178,7 +170,8 @@ const BonusDetail = defineComponent({ ...@@ -178,7 +170,8 @@ const BonusDetail = defineComponent({
[NavBar.name]: NavBar, [NavBar.name]: NavBar,
[Tab.name]: Tab, [Tab.name]: Tab,
[Tabs.name]: Tabs, [Tabs.name]: Tabs,
[Cell.name]: Cell [Cell.name]: Cell,
[Empty.name]: Empty
}, },
methods: { methods: {
onClickLeft() { onClickLeft() {
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
<div class="bonus-account"> <div class="bonus-account">
<van-row align="center" class="bonus-account-title"> <van-row align="center" class="bonus-account-title">
<van-col span="12" style="opacity: 0.5;" <van-col span="12" style="opacity: 0.5;"
><i class="iconfont icon-qiandai">&nbsp;</i ><i class="iconfont icon-qiandai">&nbsp;</i><span>账户余额(元)</span></van-col
><span>账户余额(元)</span></van-col
> >
<van-col span="12" style="text-align: right" @click="withdrawRule" <van-col span="12" style="text-align: right" @click="withdrawRule"
><span>提现规则</span>&nbsp;<i class="iconfont icon-tishi"></i ><span>提现规则</span>&nbsp;<i class="iconfont icon-tishi"></i
...@@ -46,12 +45,7 @@ ...@@ -46,12 +45,7 @@
style="border-radius: 0.3rem;" style="border-radius: 0.3rem;"
:border="false" :border="false"
> >
<van-button <van-button color="#F1551E" round size="small" @click="withdraw" style="width: 50%"
color="#F1551E"
round
size="small"
@click="withdraw"
style="width: 50%"
>提现</van-button >提现</van-button
> >
</van-cell> </van-cell>
...@@ -59,10 +53,7 @@ ...@@ -59,10 +53,7 @@
<div class="bouns-record"> <div class="bouns-record">
<van-row> <van-row>
<van-col span="12" class="tip">&emsp;奖励金提现金额</van-col> <van-col span="12" class="tip">&emsp;奖励金提现金额</van-col>
<van-col <van-col span="12" class="tip-money" style="text-align: right; font-weight: 550"
span="12"
class="tip-money"
style="text-align: right; font-weight: 550"
>总计:570.00元&nbsp;</van-col >总计:570.00元&nbsp;</van-col
> >
</van-row> </van-row>
...@@ -73,11 +64,7 @@ ...@@ -73,11 +64,7 @@
finished-text="我是有底线的" finished-text="我是有底线的"
@load="onLoad" @load="onLoad"
> >
<div <div class="bonus-record-item" v-for="item in state.bonusRecordList" :key="item.id">
class="bonus-record-item"
v-for="item in state.bonusRecordList"
:key="item.id"
>
<div class="bonus-record-item-header"> <div class="bonus-record-item-header">
<div class="bonus-record-item-header-status"> <div class="bonus-record-item-header-status">
<i <i
...@@ -90,20 +77,11 @@ ...@@ -90,20 +77,11 @@
: 'icon-xiazaishibai' : 'icon-xiazaishibai'
" "
:style="{ :style="{
color: color: item.status === 0 ? '#46BB36' : item.status === 1 ? '#027AFF' : '#F1551E'
item.status === 0
? '#46BB36'
: item.status === 1
? '#027AFF'
: '#F1551E'
}" }"
></i> ></i>
<span>{{ <span>{{
item.status === 0 item.status === 0 ? "提现中" : item.status === 1 ? "提现成功" : "提现失败"
? "提现中"
: item.status === 1
? "提现成功"
: "提现失败"
}}</span> }}</span>
<label v-if="item.status === 0">请耐心等候~</label> <label v-if="item.status === 0">请耐心等候~</label>
</div> </div>
...@@ -138,11 +116,8 @@ ...@@ -138,11 +116,8 @@
<li>6.如需帮助请联系:400—8777389!</li> <li>6.如需帮助请联系:400—8777389!</li>
</ul> </ul>
<div class="dialog-handle-btns"> <div class="dialog-handle-btns">
<van-button type="default" round @click="showDialog = false" <van-button type="default" round @click="showDialog = false">电话咨询</van-button
>电话咨询</van-button ><van-button type="primary" round @click="showDialog = false">我知道了</van-button>
><van-button type="primary" round @click="showDialog = false"
>我知道了</van-button
>
</div> </div>
</van-dialog> </van-dialog>
<van-dialog <van-dialog
...@@ -152,11 +127,8 @@ ...@@ -152,11 +127,8 @@
title="绑定微信后,才可以进行提现!" title="绑定微信后,才可以进行提现!"
> >
<div class="dialog-handle-btns"> <div class="dialog-handle-btns">
<van-button type="default" round @click="showBindWx = false" <van-button type="default" round @click="showBindWx = false">取消</van-button
>取消</van-button ><van-button type="primary" round @click="showBindWx = false">绑定微信</van-button>
><van-button type="primary" round @click="showBindWx = false"
>绑定微信</van-button
>
</div> </div>
</van-dialog> </van-dialog>
<van-dialog <van-dialog
...@@ -168,11 +140,8 @@ ...@@ -168,11 +140,8 @@
当前账号存在风险,无法进行提现操作! 如需帮助请联系:400-8777389 当前账号存在风险,无法进行提现操作! 如需帮助请联系:400-8777389
</p> </p>
<div class="dialog-handle-btns"> <div class="dialog-handle-btns">
<van-button type="default" round @click="showDangerous = false" <van-button type="default" round @click="showDangerous = false">确定</van-button
>确定</van-button ><van-button type="primary" round @click="showDangerous = false">电话咨询</van-button>
><van-button type="primary" round @click="showDangerous = false"
>电话咨询</van-button
>
</div> </div>
</van-dialog> </van-dialog>
</div> </div>
...@@ -180,18 +149,9 @@ ...@@ -180,18 +149,9 @@
<script lang="ts"> <script lang="ts">
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
declare const TencentCaptcha: any;
import { defineComponent, reactive } from "vue"; import { defineComponent, reactive } from "vue";
import { Dialog, Button, Col, Row, Cell, List } from "vant"; import { Dialog, Button, Col, Row, Cell, List } from "vant";
import { countDown } from "../../util/timer";
interface TencentCaptchaResponse {
ret: number;
ticket: string;
appid: string;
bizState: unknown;
randstr: string;
}
const Bonus = defineComponent({ const Bonus = defineComponent({
setup() { setup() {
const state = reactive({ const state = reactive({
...@@ -271,29 +231,9 @@ const Bonus = defineComponent({ ...@@ -271,29 +231,9 @@ const Bonus = defineComponent({
this.showDialog = true; this.showDialog = true;
}, },
getVerificationCode() {
//方法1: 直接生成一个验证码对象。
const captcha1 = new TencentCaptcha(
"2087826974",
(res: TencentCaptchaResponse) => {
const { ret } = res;
if (ret === 0) {
countDown(60, 1000, (time: number) => {
time === 0
? (this.showTime = `获取验证码`)
: (this.showTime = `${time} 后再获取`);
});
}
},
{
needFeedBack: false
}
);
captcha1.show();
},
withdraw() { withdraw() {
this.showDangerous = true; // this.showDangerous = true;
this.$router.push("withdraw");
} }
} }
}); });
...@@ -306,7 +246,7 @@ export default Bonus; ...@@ -306,7 +246,7 @@ export default Bonus;
.bonus-account { .bonus-account {
padding: 30px; padding: 30px;
color: #fff; color: #fff;
background: url("../../assets/images/account-bg.png") no-repeat; background: url("../../assets/images/bonus/account-bg.png") no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
margin-bottom: 30px; margin-bottom: 30px;
.bonus-account-money { .bonus-account-money {
......
<template>
<div class="bonus-withdraw">
<div class="bonus-withdraw-input">
<van-field
class="bonus-withdraw-input-field"
v-model="money"
center
clearable
label="¥"
type="number"
format-trigger="onBlur"
:formatter="formatter"
placeholder="请输入金额"
label-width="3.2em"
label-class="label-money-symbol"
>
<template #button>
<van-button
class="all"
size="small"
type="primary"
round
color="#F1551E"
@click="money = maxMoney"
>全部</van-button
>
</template>
</van-field>
<p class="bonus-withdraw-input-valid">今日可提现金额¥{{ maxMoney }}元</p>
<p class="bonus-withdraw-input-tip">
<i class="iconfont icon-wenhao"></i>
<span>单日累计提现不超过500元!</span>
</p>
</div>
<van-cell class="van-cell-tip" title="提现至" size="large" :border="false">
<div class="slot-value">
<img class="wechat" src="../../../assets/images/bonus/wechat.png" alt="微信图片" />
<span class="van-ellipsis">微信名字k~k~kolor</span>
</div>
</van-cell>
<div class="handle-btn">
<van-button round type="primary" size="large" color="#F1551E" block @click="withdrawSubmit">
<span class="withdraw-title">确认提现</span>
<label class="withdraw-tips">预计24小时内到账</label>
</van-button>
</div>
<!-- -->
<van-dialog
v-model:show="showWithdraw"
:show-cancel-button="false"
:show-confirm-button="false"
class="withdraw-dialog"
>
<ul class="withdraw-dialog-header">
<li>提现至微信账户:k~k~kolor</li>
<li class="withdraw-dialog-header-money">¥{{ money }}</li>
</ul>
<ul class="withdraw-dialog-field">
<li>
<van-field v-model="sms" type="digit" label-width="0" placeholder="请输入验证码">
<template #button>
<van-button
type="primary"
color="#027AFF"
@click="getSms"
:disabled="showTime != '获取验证码'"
>{{ showTime }}</van-button
>
</template>
</van-field>
</li>
<li class="withdraw-dialog-field-tip">今日可提现已将验证码发送至191****1273</li>
</ul>
<div class="handle-btns">
<van-button round type="primary" size="large" block color="#027AFF;" @click="withdrawReal"
>确定</van-button
>
<van-button
plain
round
type="primary"
size="large"
block
color="#027AFF;"
style="border: none"
@click="showWithdraw = false"
>关闭</van-button
>
</div>
</van-dialog>
<!-- 提现成功 -->
<van-dialog
v-model:show="showWithdrawSuccess"
:show-cancel-button="false"
:show-confirm-button="false"
class="withdraw-success-dialog"
>
<ul class="withdraw-success-dialog-text">
<li>提现申请成功!</li>
<li>提现金额:</li>
<li>¥1345.00</li>
<li>提现至微信</li>
<li>k~k~kololr</li>
<li>预计到账时间</li>
<li>2021/3/7 12:12:12</li>
</ul>
<div class="withdraw-success-dialog-btns">
<van-button
round
type="primary"
color="linear-gradient(to bottom, #FFEB8C, #FE9F56)"
block
size="large"
to="/"
replace
>确定</van-button
>
</div>
</van-dialog>
</div>
</template>
<script lang="ts">
// eslint-disable-next-line @typescript-eslint/no-explicit-any
declare const TencentCaptcha: any;
import { defineComponent, reactive, toRefs } from "vue";
import { Button, Cell, Dialog, Field, Toast } from "vant";
import { countDown } from "../../../util/timer";
interface TencentCaptchaResponse {
ret: number;
ticket: string;
appid: string;
bizState: unknown;
randstr: string;
}
const Withdraw = defineComponent({
components: {
[Button.name]: Button,
[Cell.name]: Cell,
[Field.name]: Field,
[Dialog.Component.name]: Dialog.Component
},
setup() {
const state = reactive({
money: "",
sms: "",
maxMoney: 500.32,
showTime: "获取验证码",
showWithdraw: false,
showWithdrawSuccess: false
});
const formatter = value => {
if (value > state.maxMoney) {
return state.maxMoney;
}
return value && Number(value).toFixed(2);
};
// 确认提现
const withdrawSubmit = () => {
if (!state.money) {
Toast("请输入提现金额");
return false;
}
if (Number(state.money) < 1) {
Toast("金额必须大于等于1元");
return false;
}
state.showWithdraw = true;
};
const getSms = () => {
const captcha1 = new TencentCaptcha(
"2087826974",
(res: TencentCaptchaResponse) => {
const { ret } = res;
if (ret === 0) {
countDown(60, 1000, (time: number) => {
time === 0 ? (state.showTime = `获取验证码`) : (state.showTime = `${time} 后再获取`);
});
}
},
{
needFeedBack: false
}
);
captcha1.show();
};
const withdrawReal = () => {
if (!state.sms) {
Toast("请输入验证码");
return;
}
state.showWithdrawSuccess = true;
};
return {
...toRefs(state),
formatter,
getSms,
withdrawSubmit,
withdrawReal
};
}
});
export default Withdraw;
</script>
<style lang="scss" scoped>
.bonus-withdraw {
padding: 146px 32px 0;
background: #fff;
min-height: 100vh;
.bonus-withdraw-input {
padding-left: 50px;
text-align: center;
.all {
width: 107px;
}
.bonus-withdraw-input-valid {
font-size: 24px;
color: #000000;
}
::v-deep .label-money-symbol {
font-size: 60px;
font-weight: 600;
}
.bonus-withdraw-input-tip {
display: inline-block;
align-items: center;
background: #dddddd;
font-size: 22px;
border-radius: 18px;
opacity: 0.3;
padding: 1px 10px;
vertical-align: middle;
}
}
.van-cell.van-cell-tip {
padding-left: 2px;
padding-right: 2px;
border-top: 1px solid #ececec;
border-bottom: 1px solid #ececec;
margin-top: 100px;
.slot-value {
display: flex;
align-items: center;
.wechat {
width: 52px;
height: 52px;
margin-right: 3px;
}
}
}
.handle-btn {
padding: 0 72px;
margin-top: 75px;
.withdraw-title {
font-size: 36px;
display: block;
}
.withdraw-tips {
opacity: 0.5;
}
}
::v-deep .withdraw-dialog {
padding: 48px;
color: #fff;
.withdraw-dialog-header {
background: url("../../../assets/images/bonus/withdraw-bg.png") no-repeat;
background-size: 100%;
padding: 32px 30px;
.withdraw-dialog-header-money {
font-size: 60px;
font-weight: 600;
margin: 40px 0 47px;
}
}
.withdraw-dialog-field {
margin-top: 80px;
.withdraw-dialog-field-tip {
text-align: center;
color: #484c4f;
font-size: 24px;
margin-top: 30px;
}
.van-cell {
padding: 0;
.van-field__control {
padding: 22px 0 22px 45px;
border: 2px solid #dcdee0;
border-right: none;
border-radius: 8px 0px 0px 8px;
}
.van-field__button {
padding-left: 0;
border: 4px solid #027aff;
border-left: none;
border-radius: 0px 8px 8px 0px;
background: #027aff;
}
}
}
.handle-btns {
margin-top: 80px;
}
}
::v-deep .withdraw-success-dialog {
padding: 60px 51px 35px;
background: url("../../../assets/images/bonus/withdraw-success.png") no-repeat;
background-size: 100% 100%;
height: 785px;
box-sizing: border-box;
font-size: 26px;
.withdraw-success-dialog-text {
line-height: 50px;
text-align: center;
li {
&:nth-of-type(1) {
font-size: 55px;
background: linear-gradient(360deg, #ef1237 0%, #fd7940 100%);
-webkit-background-clip: text;
color: transparent;
font-style: italic;
position: relative;
font-weight: bold;
&::after,
&::before {
content: "";
display: inline-block;
width: 63px;
height: 5px;
background: linear-gradient(270deg, #fdbd99 0%, rgba(255, 255, 255, 0) 100%);
position: absolute;
top: 50%;
}
&::before {
left: 0;
}
&::after {
background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, #fdbd99 100%);
right: 0;
}
}
&:nth-of-type(2) {
font-size: 32px;
font-weight: 500;
margin: 16px 0;
}
&:nth-of-type(3) {
font-size: 64px;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
color: #1a1a1a;
line-height: 63px;
background: linear-gradient(360deg, #ef1237 0%, #fd7940 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-bottom: 39px;
}
&:nth-of-type(4),
&:nth-of-type(6) {
font-size: 28px;
}
&:nth-of-type(5),
&:nth-of-type(7) {
opacity: 0.8;
}
}
}
.withdraw-success-dialog-btns {
margin-top: 130px;
padding: 0 100px;
}
}
}
</style>
<template>
<div>
<van-nav-bar title="提现" left-arrow @click-left="onClickLeft" />
<h1>提现</h1>
</div>
</template>
<script lang="ts">
import { defineComponent } from "vue";
import { NavBar } from "vant";
const Withdraw = defineComponent({
components: {
[NavBar.name]: NavBar
},
methods: {
onClickLeft() {
this.$router.back();
}
}
});
export default Withdraw;
</script>
<style lang="scss" scoped></style>
module.exports.theme = {
// Color variables
"@black": "#000",
"@white": "#fff",
"@red": "#f44",
"@blue": "#1989fa",
"@orange": "#ff976a",
"@orange-dark": "#ed6a0c",
"@orange-light": "#fffbe8",
"@green": "#20C3D7",
"@gray": "#c8c9cc",
"@gray-light": "#e5e5e5",
"@gray-darker": "#7d7e80",
"@gray-dark": "#969799",
// Default colors
"@text-color": "#323233",
"@border-color": "#ebedf0",
"@active-color": "#f2f3f5",
"@background-color": "#f8f8f8",
"@background-color-light": "#fafafa",
// ActionSheet
"@action-sheet-max-height": "90%",
"@action-sheet-header-height": "44px",
"@action-sheet-header-font-size": "16px",
"@action-sheet-item-height": "50px",
"@action-sheet-item-background": "@white",
"@action-sheet-item-font-size": "16px",
"@action-sheet-item-text-color": "@text-color",
"@action-sheet-subname-color": "@gray-darker",
"@action-sheet-subname-font-size": "12px",
"@action-sheet-close-icon-size": "18px",
"@action-sheet-close-icon-color": "@gray-dark",
// Badge
"@badge-font-size": "14px",
"@badge-line-height": "1.4",
"@badge-text-color": "@gray-darker",
"@badge-padding": "20px 12px 20px 9px",
"@badge-active-color": "@active-color",
"@badge-background-color": "@background-color",
"@badge-selected-font-weight": "500",
"@badge-selected-text-color": "@text-color",
"@badge-selected-border-color": "@red",
"@badge-selected-background-color": "@white",
// BadgeGroup
"@badge-group-width": "85px",
// Button
"@button-mini-height": "22px",
"@button-mini-min-width": "50px",
"@button-mini-font-size": "10px",
"@button-mini-line-height": "20px",
"@button-small-height": "30px",
"@button-small-font-size": "12px",
"@button-small-min-width": "60px",
"@button-small-line-height": "28px",
"@button-normal-font-size": "14px",
"@button-large-height": "50px",
"@button-large-line-height": "48px",
"@button-default-height": "44px",
"@button-default-line-height": "42px",
"@button-default-font-size": "16px",
"@button-default-color": "@text-color",
"@button-default-background-color": "@white",
"@button-default-border-color": "@border-color",
"@button-primary-color": "@white",
"@button-primary-background-color": "@green",
"@button-primary-border-color": "@green",
"@button-info-color": "@white",
"@button-info-background-color": "@blue",
"@button-info-border-color": "@blue",
"@button-danger-color": "@white",
"@button-danger-background-color": "@red",
"@button-danger-border-color": "@red",
"@button-warning-color": "@white",
"@button-warning-background-color": "@orange",
"@button-warning-border-color": "@orange",
"@button-bottom-action-default-color": "@white",
"@button-bottom-action-default-background-color": "@orange",
"@button-bottom-action-primary-color": "@white",
"@button-bottom-action-primary-background-color": "@red",
"@button-border-width": "1px",
"@button-border-radius": "2px",
"@button-round-border-radius": "10em",
"@button-plain-background-color": "@white",
"@button-disabled-opacity": ".5",
// Cell
"@cell-font-size": "14px",
"@cell-line-height": "24px",
"@cell-vertical-padding": "10px",
"@cell-horizontal-padding": "15px",
"@cell-text-color": "@text-color",
"@cell-background-color": "@white",
"@cell-border-color": "@border-color",
"@cell-active-color": "@active-color",
"@cell-required-color": "@red",
"@cell-label-color": "@gray-dark",
"@cell-label-font-size": "12px",
"@cell-label-line-height": "18px",
"@cell-label-margin-top": "3px",
"@cell-value-color": "@gray-dark",
"@cell-icon-size": "16px",
"@cell-right-icon-color": "@gray-dark",
"@cell-large-vertical-padding": "12px",
"@cell-large-title-font-size": "16px",
"@cell-large-label-font-size": "14px",
// CellGroup
"@cell-group-background-color": "@white",
"@cell-group-title-color": "@gray-dark",
"@cell-group-title-padding": "15px 15px 5px",
"@cell-group-title-font-size": "14px",
"@cell-group-title-line-height": "16px",
// Checkbox
"@checkbox-size": "20px",
"@checkbox-border-color": "@gray-light",
"@checkbox-transition-duration": ".2s",
"@checkbox-label-margin": "10px",
"@checkbox-label-color": "@text-color",
"@checkbox-checked-icon-color": "@blue",
"@checkbox-disabled-icon-color": "@gray",
"@checkbox-disabled-label-color": "@gray",
"@checkbox-disabled-background-color": "@border-color",
// Collapse
"@collapse-item-transition-duration": ".3s",
"@collapse-item-content-padding": "15px",
"@collapse-item-content-font-size": "13px",
"@collapse-item-content-line-height": "1.5",
"@collapse-item-content-text-color": "@gray-dark",
"@collapse-item-content-background-color": "@white",
"@collapse-item-title-disabled-color": "@gray",
// Dialog
"@dialog-width": "85%",
"@dialog-font-size": "16px",
"@dialog-transition": ".3s",
"@dialog-border-radius": "4px",
"@dialog-background-color": "@white",
"@dialog-header-font-weight": "500",
"@dialog-header-padding-top": "25px",
"@dialog-header-isolated-padding": "25px 0",
"@dialog-message-padding": "25px",
"@dialog-message-font-size": "14px",
"@dialog-message-line-height": "1.5",
"@dialog-message-max-height": "60vh",
"@dialog-has-title-message-text-color": "@gray-darker",
"@dialog-has-title-message-padding-top": "12px",
"@dialog-confirm-button-text-color": "@blue",
// Info
"@info-size": "16px",
"@info-color": "@white",
"@info-padding": "0 3px",
"@info-font-size": "12px",
"@info-font-weight": "500",
"@info-border-width": "1px",
"@info-background-color": "@red",
"@info-font-family": "PingFang SC, Helvetica Neue, Arial, sans-serif",
// List
"@list-icon-size": "16px",
"@list-icon-margin-right": "5px",
"@list-text-color": "@gray-dark",
"@list-text-font-size": "13px",
"@list-text-line-height": "50px",
// NavBar
"@nav-bar-height": "46px",
"@nav-bar-background-color": "@white",
"@nav-bar-arrow-size": "16px",
"@nav-bar-icon-color": "@blue",
"@nav-bar-text-color": "@blue",
"@nav-bar-title-font-size": "16px",
"@nav-bar-title-text-color": "@text-color",
// Notify
"@notify-padding": "6px 15px",
"@notify-font-size": "14px",
"@notify-line-height": "20px",
// NumberKeyboard
"@number-keyboard-key-height": "54px",
"@number-keyboard-key-background": "#ebedf0",
// Overlay
"@overlay-background-color": "rgba(0, 0, 0, 0.7)",
// Panel
"@panel-background-color": "@white",
"@panel-header-value-color": "@red",
"@panel-footer-padding": "10px 15px",
// Radio
"@radio-size": "20px",
"@radio-border-color": "@gray-light",
"@radio-transition-duration": ".2s",
"@radio-label-margin": "10px",
"@radio-label-color": "@text-color",
"@radio-checked-icon-color": "@blue",
"@radio-disabled-icon-color": "@gray",
"@radio-disabled-label-color": "@gray",
"@radio-disabled-background-color": "@border-color",
// Rate
"@rate-horizontal-padding": "2px",
// Slider
"@slider-active-background-color": "@blue",
"@slider-inactive-background-color": "@gray-light",
"@slider-disabled-opacity": ".3",
"@slider-button-width": "20px",
"@slider-button-height": "20px",
"@slider-button-border-radius": "50%",
"@slider-button-background-color": "@white",
"@slider-button-box-shadow": "0 1px 2px rgba(0, 0, 0, .5)",
// Swipe
"@swipe-indicator": "6px",
// Switch
"@switch-width": "2em",
"@switch-height": "1em",
"@switch-node-size": "1em",
"@switch-node-z-index": "1",
"@switch-node-background-color": "@white",
"@switch-node-box-shadow":
"0 3px 1px 0 rgba(0, 0, 0, .05), 0 2px 2px 0 rgba(0, 0, 0, .1), 0 3px 3px 0 rgba(0, 0, 0, .05)",
"@switch-background-color": "@white",
"@switch-on-background-color": "@blue",
"@switch-transition-duration": ".3s",
"@switch-disabled-opacity": ".4",
"@switch-border": "1px solid rgba(0, 0, 0, .1)",
// SwitchCell
"@switch-cell-padding-top": "9px",
"@switch-cell-padding-bottom": "9px",
// Tab
"@tabs-line-height": "44px",
"@tabs-card-height": "30px",
// Tabbar
"@tabbar-height": "50px",
"@tabbar-background-color": "@white",
// TabbarItem
"@tabbar-item-font-size": "12px",
"@tabbar-item-text-color": "@gray-darker",
"@tabbar-item-active-color": "@blue",
"@tabbar-item-line-height": "1",
"@tabbar-item-icon-size": "18px",
"@tabbar-item-margin-bottom": "5px",
// Tag
"@tag-padding": ".2em .5em",
"@tag-font-size": "10px",
"@tag-medium-font-size": "12px",
"@tag-large-font-size": "14px",
"@tag-text-color": "@white",
"@tag-border-radius": ".2em",
"@tag-round-border-radius": ".8em",
// Toast
"@toast-max-width": "70%",
"@toast-font-size": "14px",
"@toast-text-color": "@white",
"@toast-line-height": "20px",
"@toast-border-radius": "4px",
"@toast-background-color": "rgba(@text-color, .88)",
"@toast-icon-size": "48px",
"@toast-text-min-width": "96px",
"@toast-text-padding": "8px 12px",
"@toast-default-padding": "15px",
"@toast-default-width": "90px",
"@toast-default-min-height": "90px",
"@toast-position-top-distance": "50px",
"@toast-position-bottom-distance": "50px",
// Search
"@search-background-color": "#f7f8fA",
// Stepper
"@stepper-active-color": "#e8e8e8",
"@stepper-background-color": "@active-color",
"@stepper-button-disabled-color": "#f7f8fa",
"@stepper-input-disabled-color": "@active-color",
"@stepper-border-radius": "4px"
};
...@@ -11,7 +11,7 @@ module.exports = { ...@@ -11,7 +11,7 @@ module.exports = {
proxy: { proxy: {
//配置跨域 //配置跨域
"/api": { "/api": {
target: "http://localhost:5001/api/", //这里后台的地址模拟的;应该填写你们真实的后台接口 target: "http://localhost:5001/api/", // 这里后台的地址模拟的;应该填写你们真实的后台接口
ws: true, ws: true,
changOrigin: true, //允许跨域 changOrigin: true, //允许跨域
pathRewrite: { pathRewrite: {
...@@ -29,8 +29,9 @@ module.exports = { ...@@ -29,8 +29,9 @@ module.exports = {
propList: ["*"], propList: ["*"],
replace: true, replace: true,
mediaQuery: false, mediaQuery: false,
minPixelValue: 0, minPixelValue: 2,
exclude: /(node_module)/ exclude: /(node_module)/i,
selectorBlackList: ["tc-", "t"]
}) })
] ]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment