123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <template>
- <view class="withdrawal-main">
- <view class="withdrawal-item">
- <label class="withdrawal-label">提现到账</label>
- <view class="withdrawal-item-right" @click="openSheet">
- <view class="withdrawal-text">微信零钱</view>
- <up-icon name="arrow-right"></up-icon>
- </view>
- </view>
- <view class="withdrawal-item" >
- <label class="withdrawal-label">提现金额</label>
- </view>
- <view class="price-box">
- <up-icon name="rmb" size="28" color="rgba(0, 0, 0, 1)"></up-icon>
- <input class="price-input" placeholder="请输入提现金额" border="none" v-model="priceValue" @change="change" />
- </view>
- <view class="withdrawal-item">
- <label class="withdrawal-label">可提现余额 <up-icon name="rmb"></up-icon>{{ maxPrice }}</label>
- <view class="withdrawal-item-right" @click="onMaxChange">
- <view class="withdrawal-text">全部提现</view>
- </view>
- </view>
- <view style="margin-top: 45px;">
- <up-button type="primary" text="确定提现" @click="onSubmit" ></up-button>
- </view>
- <up-action-sheet
- :show="show"
- @close="close"
- @select="select"
- :actions="actions"
- >
- </up-action-sheet>
- </view>
- </template>
- <script setup>
- import { ref } from 'vue';
- const actions = [
- {
- name: '微信零钱',
- }
- ]
- const show = ref(false);
- const maxPrice = ref(1200);
- const priceValue = ref('');
- const change = (e) => {
- console.log('change', e);
- const regex = /^\d*\.?\d*$/;
- if (!regex.test(e.detail.value)) {
- priceValue.value = priceValue.value.replace(/[^\d.]/g, '');
- }
- };
- const openSheet = (index) => {
- show.value = true;
- }
- const close = () => {
- show.value = false;
- }
- const select = (index) => {
- console.log('select', index);
- }
- const onSubmit = () => {
- uni.showToast({
- title: '提交成功',
- icon: 'none'
- })
- }
- const onMaxChange = () => {
- priceValue.value = maxPrice.value;
- }
- </script>
- <style lang="scss" scoped>
- .withdrawal-main {
- position: fixed;
- top: 0px;
- left: 0px;
- right: 0px;
- bottom: 0px;
- background-color: #fff;
- padding: 0 12px;
- .withdrawal-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 12px 0;
- .withdrawal-label {
- font-size: 14px;
- font-weight: 500;
- line-height: 20.27px;
- color: rgba(153, 153, 153, 1);
- display: flex;
- align-items: center;
- }
- .withdrawal-item-right {
- display: flex;
- align-items: center;
- .withdrawal-text {
- font-size: 16px;
- font-weight: 700;
- line-height: 23.17px;
- color: rgba(0, 0, 0, 1);
- margin-right: 6px;
- }
- }
- }
- .price-box {
- display: flex;
- .price-input {
- flex: 1;
- height: 58px;
- padding: 0 12px;
- font-size: 28px;
- }
- }
- }
- </style>
|