完善提现

This commit is contained in:
wangxiaowei 2024-07-04 18:04:12 +08:00
parent 54b4a2809b
commit 3854a5ec1b
8 changed files with 191 additions and 105 deletions

@ -323,5 +323,6 @@ export function getBillionsWithdrawConfig(data) {
// 百亿返补提现
export function applyBillionsWithdraw(data) {
return request.post('billions/balanceapply', data)
return request.post('billions/tsast', data)
}

@ -11,26 +11,26 @@
我的共享价值
</view>
<view class="exchange-money text-center nr">
¥0.00000000
¥{{widthDrawConfig.able_withdraw ? widthDrawConfig.able_withdraw : 0}}
</view>
<view>
<button class="primary-btn white flex row-center">立即提现</button>
<button class="primary-btn white flex row-center" @click="nowWithdrawal">立即提现</button>
</view>
<view style="color: #CECCCD;text-align: center;margin-top: 20rpx;">
<!-- <view style="color: #CECCCD;text-align: center;margin-top: 20rpx;">
我的共享价值=今日共享值价格 X 我的共享值数量
</view>
</view> -->
</view>
</view>
<view class="exchange-account exchange-item flex row-between">
<view class="exchange-account-record">
当前账户余额:<text class="bold lg">0.00</text> 元
当前账户余额:<text class="bold lg">{{my_balance}}</text> 元
</view>
<view class="exchange-account-value">
<!-- <view class="exchange-account-value">
兑换共享值
</view>
</view> -->
</view>
<view class="exchang-body exchange-item">
<!-- <view class="exchang-body exchange-item">
<view class="exchang-body-item">
<view class="text-center">
<view class="bold">¥1.888</view>
@ -40,7 +40,7 @@
<view class="text-center">
<view class="bold">¥1.888</view>
<view class="xs exchang-body-color">历史总涨幅(元/个)</view>
<!-- <view class="exchang-tips">xx21x</view> -->
<view class="exchang-tips">xx21x</view>
</view>
</view>
<view class="exchang-border"></view>
@ -48,19 +48,61 @@
<view class="text-center">
<view class="bold">1.888</view>
<view class="xs exchang-body-color">我的共享值数量(个)</view>
<!-- <view class="exchang-tips">xx31x</view> -->
<view class="exchang-tips">xx31x</view>
</view>
<view class="text-center">
<view class="bold">¥1.888</view>
<view class="xs exchang-body-color">昨日涨幅(元/个)</view>
<!-- <view class="exchang-tips">xx41x</view> -->
<view class="exchang-tips">xx41x</view>
</view>
</view>
</view>
</view> -->
</view>
</template>
<script>
import {
getBillionsWithdrawConfig
} from "@/api/user";
export default {
data() {
return {
widthDrawConfig: {},
my_balance: 0
}
},
onLoad(options) {
this.getBillionsWithdrawConfigFun();
},
methods: {
async getBillionsWithdrawConfigFun() {
const {
code,
data
} = await getBillionsWithdrawConfig()
if (code == 1) {
this.widthDrawConfig = data
this.tabsList = data.type
}
},
// 开始提现
nowWithdrawal() {
uni.navigateTo({
url: '/bundle_b/pages/subsidy_withdrawal/index'
})
}
},
watch: {
widthDrawConfig() {
if (this.widthDrawConfig.able_withdraw) {
this.my_balance = (parseInt(this.widthDrawConfig.able_withdraw * 100) / 100).toFixed(2)
}
}
}
}
</script>
<style lang="scss" scoped>

@ -1,44 +1,49 @@
<template>
<view class="exchang-order">
<view class="exchange-order-item">
<view class="bold md">
微信0.5元红包
<mescroll-uni ref="mescrollRef" top="80rpx" @init="mescrollInit" @down="downCallback" @up="upCallback"
:down="downOption" :up="upOption">
<view class="exchange-order-item">
<view class="bold md">
微信0.5元红包
</view>
<view class="nr exchange-order-color">
兑换积分:23积分
</view>
<view class="nr exchange-order-color">
兑换时间:2024-05-25
</view>
</view>
<view class="nr exchange-order-color">
兑换积分:23积分
<view class="exchange-order-item">
<view class="bold md">
微信0.5元红包
</view>
<view class="nr exchange-order-color">
兑换积分:23积分
</view>
<view class="nr exchange-order-color">
兑换时间:2024-05-25
</view>
</view>
<view class="nr exchange-order-color">
兑换时间:2024-05-25
<view class="exchange-order-item">
<view class="bold md">
微信0.5元红包
</view>
<view class="nr exchange-order-color">
兑换积分:23积分
</view>
<view class="nr exchange-order-color">
兑换时间:2024-05-25
</view>
</view>
</view>
<view class="exchange-order-item">
<view class="bold md">
微信0.5元红包
</view>
<view class="nr exchange-order-color">
兑换积分:23积分
</view>
<view class="nr exchange-order-color">
兑换时间:2024-05-25
</view>
</view>
<view class="exchange-order-item">
<view class="bold md">
微信0.5元红包
</view>
<view class="nr exchange-order-color">
兑换积分:23积分
</view>
<view class="nr exchange-order-color">
兑换时间:2024-05-25
</view>
</view>
</mescroll-uni>
</view>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import MescrollMoreItemMixin from "@/components/mescroll-uni/mixins/mescroll-more-item.js";
</script>
<style lang="scss" scoped>

@ -113,7 +113,7 @@
if (code == 1) {
setTimeout(() => {
uni.navigateTo({
url: '/bundle_b/pages/subsidy_withdrawal/index?subsidy_price=' + subsidy_price
url: '/bundle_b/pages/exchange/exchange'
})
}, 500)
}

@ -2,6 +2,17 @@
<view>
<mescroll-uni ref="mescrollRef" top="80rpx" @init="mescrollInit" @down="downCallback" @up="upCallback"
:down="downOption" :up="upOption">
<view class="my-withdrawal">
<navigator url="/bundle_b/pages/exchange/exchange" hover-class="none">
<!-- <image src="https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uniapp/icon_finger.png"></image> -->
<view class="flex go-exchange">
<view>去兑换</view>
<u-image :showLoading="true" src="https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uniapp/icon_finger.png" width="20px" height="20px"></u-image>
</view>
</navigator>
</view>
<view>
<view class="subsidy-shop-item" v-if="index == 0">
<view class="text-center">
@ -97,6 +108,20 @@
</script>
<style lang="scss" scoped>
.my-withdrawal {
text-align: right;
width: 100%;
padding: 20rpx 20rpx 0;
.go-exchange {
justify-content: flex-end;
view {
margin-right: 8rpx;
}
}
}
.subsidy-shop-item {
margin: 20rpx;
display: flex;

@ -9,33 +9,8 @@
</view>
<!-- 微信钱包 -->
<view v-if="currentValue == 3" class="withdraw-wechat m-t-20 bg-white">
<!-- Account -->
<u-field label-width="160" label="微信账号" v-model="form.account" placeholder="请输入微信账号" />
<!-- Name -->
<u-field label-width="160" label="真实姓名" v-model="form.real_name" placeholder="请输入真实姓名" />
<!-- Remark -->
<u-field label-width="160" label="备注" v-model="form.remark" placeholder="(选填)" />
<!-- 上传图片 -->
<view class="flex-col m-t-20">
<u-upload ref="uUpload" :header="{token: $store.getters.token}" :auto-upload="true"
:show-progress="false" max-count="1" width="142" height="142" :custom-btn="true" :action="action"
@on-success="onSuccess" @on-remove="onRemove">
<view slot="addBtn" class="flex-col col-center row-center">
<view class="upload-image flex-col col-center row-center">
<u-icon name="/bundle/static/icon_camera_line.png" width="54" />
</view>
<view class="xs m-t-10">微信收款码</view>
</view>
</u-upload>
</view>
</view>
<!-- 支付宝 -->
<view v-else-if="currentValue == 4" class="withdraw-alipay m-t-20 bg-white">
<view v-if="currentValue == 4" class="withdraw-alipay m-t-20 bg-white">
<!-- Account -->
<u-field label-width="160" label="支付宝账号" v-model="form.account" placeholder="请输入支付宝账号" />
<!-- Name -->
@ -81,13 +56,15 @@
<u-input v-model="form.money" placeholder="0.00" :custom-style="{
'font-size': '66rpx'
}" />
<!-- <input type="text" @input="" :value="inputValue" placeholder="0.00">
值:{{moneyValue}} -->
</view>
<view class="flex-col flex-1 text-right">
<text class="xs primary" @tap="form.money=widthDrawConfig.able_withdraw">全部提现</text>
<text class="xs muted m-t-10">可提现金额 ¥ {{widthDrawConfig.able_withdraw}}</text>
<text class="xs muted m-t-10">可提现金额 ¥ {{widthDrawConfig.able_withdraw ? widthDrawConfig.able_withdraw : 0}}</text>
</view>
</view>
<view class="muted xs m-t-30" v-if="widthDrawConfig.rule && currentValue != 1">
<view class="muted xs m-t-30" v-if="widthDrawConfig.rule">
{{widthDrawConfig.rule}}
提现手续费:{{widthDrawConfig.commission}}
</view>
@ -143,15 +120,11 @@
subbank: '', // 支行
remark: '', // 备注
},
inputValue: '',
widthDrawConfig: {}
}
},
onLoad(options) {
try {
if (options.subsidy_price) {
this.form.money = options.subsidy_price
}
} catch (e) {}
this.getBillionsWithdrawConfigFun();
this.onSubmit = trottle(this.onSubmit, 1000, this)
},
@ -163,7 +136,7 @@
changeTab(index) {
this.currentTab = index;
this.form = {
money: '',
price: '',
account: '',
real_name: '',
money_qr_code: '',
@ -197,13 +170,19 @@
return;
}
if (!uni.$u.test.amount(data.money)) {
this.$toast({
title: '提现金额格式错误'
});
return;
}
if (data.money < this.widthDrawConfig.min_withdraw) {
this.$toast({
title: '最小提现金额为¥' + this.widthDrawConfig.min_withdraw
});
return;
}
applyBillionsWithdraw(data).then(res => {
if (res.code == 1) {
this.$toast({
@ -230,6 +209,13 @@
} = this
return tabsList[currentTab] ? tabsList[currentTab].value : ''
}
},
watch: {
widthDrawConfig() {
if (this.widthDrawConfig.able_withdraw) {
this.widthDrawConfig.able_withdraw = (parseInt(this.widthDrawConfig.able_withdraw * 100) / 100).toFixed(2)
}
}
}
}
</script>

@ -6,6 +6,22 @@
<view class="order-goods">
<order-goods :list="item.goods" :total-amount="item.total_amount"></order-goods>
</view>
<view class="item col-top m-t-20 subsidy-block">
<view class="item flex row-between subsidt-text" @click="joinSubsidy(1)">
<view class="bold">百亿返补</view>
<view class="invoice col-top">
<u-checkbox :value="subsidy_type == 1" shape="circle"></u-checkbox>
</view>
</view>
<view class="item flex row-between subsidt-text" @click="joinSubsidy(2)">
<view class="bold">八折购买</view>
<view class="invoice col-top">
<u-checkbox :value="subsidy_type == 2" shape="circle"></u-checkbox>
</view>
</view>
</view>
<view class="item flex row-between" @tap="onShowCoupon" v-if="orderType == 0">
<view>店铺优惠券</view>
<view class="flex">
@ -43,14 +59,7 @@
:color="colorConfig.primary" :first-size="36" :second-size="36"
:price="item.total_amount || (item.goods && item.goods[0].team_price)"></price-format>
</view>
<view class="item flex row-between col-top m-t-20">
<view class="bold">是否参与百亿补贴</view>
<view class="invoice col-top" @click="joinBillions">
<u-checkbox v-model="billions" shape="circle">
</u-checkbox>
</view>
</view>
<u-modal v-model="showDelivery" title="请选择配送方式" showCancelButton @confirm="changeDeliveryType" :confirm-color="colorConfig.primary" :z-index="9999">
<view class="delivery nr" >
@ -129,7 +138,7 @@
isRequest: false,
couponId: '',
invoiceInfo: {},
billions: true
subsidy_type: 1
};
},
computed: {
@ -154,9 +163,16 @@
this.showCoupon = true
}
},
joinSubsidy(type) {
this.subsidy_type = type
this.$emit('joinSubsidy', type);
},
joinBillions() {
this.$emit('joinBillions', this.billions);
},
joinDiscount() {
this.$emit('joinDiscount', this.discount);
},
async getCoupon() {
const {
item: {
@ -237,11 +253,20 @@
.order-goods {
border-top: $-solid-border;
}
.subsidy-block {
height: 180rpx !important;
margin-top: 0;
.subsidt-text {
padding: 0;
}
}
.item {
height: 88rpx;
padding: 0 24rpx;
.invoice {
display: flex;
&--text {

@ -26,7 +26,7 @@
<order-shop :order-type="orderInfo.order_type" :item="item" :invoice="invoiceArr"
@changeremark="changeRemark" @changecoupon="changeCoupon($event,index)"
@changeDeliveryType="changeDeliveryType($event,item)" :teamId="teamId"
@joinBillions="joinBillions"
@joinSubsidy="joinSubsidy"
:bargainLaunchId="bargainLaunchId"></order-shop>
</view>
</block>
@ -35,7 +35,7 @@
<view class="goods contain">
<order-shop :order-type="orderInfo.order_type" :item="shopLists" :invoice="invoiceArr"
@changeremark="changeRemark" @changeDeliveryType="changeDeliveryType($event, shopLists)"
@joinBillions="joinBillions"
@joinSubsidy="joinSubsidy"
:teamId="teamId" :bargainLaunchId="bargainLaunchId"></order-shop>
</view>
</block>
@ -99,7 +99,7 @@
p_id: 0,
bargainLaunchId: -1,
invoiceArr: [],
billions: true
subsidy_type: 1
};
},
@ -146,10 +146,10 @@
methods: {
// 参与百亿补贴
joinBillions(data) {
this.billions = data
joinSubsidy(type) {
this.subsidy_type = type
},
changeRemark(e) {
let index = this.userRemark.findIndex((item) => item.shop_id == e.shop_id)
if (index == -1) {
@ -233,8 +233,13 @@
bargainLaunchId,
couponId
} = this;
goods[0].billions_type = this.billions
if (this.subsidy_type == 1) {
goods[0].billions_type = true
}else if(this.subsidy_type == 2) {
goods[0].discount_type = true
}
const submitObj = {
goods: JSON.stringify(goods),
address_id: this.addressId,
@ -243,8 +248,6 @@
bargain_launch_id: this.bargainLaunchId == -1 ? '' : this.bargainLaunchId,
};
submitObj.billions_type = this.billions
if (this.teamId && action == 'info') {
delete submitObj.goods;
submitObj.action = 'info';
@ -268,6 +271,7 @@
submitObj.remark = userRemark.length ? JSON.stringify(userRemark) : ''
submitObj.invoice = JSON.stringify(this.invoiceArr)
}
let {
data: orderData,
code: orderCode,
@ -281,7 +285,6 @@
}
if (orderCode !== 1) return this.showLoading = false
console.log('action=', action)
if (action == 'info') {
const {
shop,
@ -295,7 +298,6 @@
});
} else if (action == 'submit') {
this.showLoading = false
let order_id = ''
const type = orderData.type
@ -372,7 +374,7 @@
border-radius: 14rpx;
margin: 20rpx 20rpx 0;
background-color: #fff;
overflow: hidden;
overflow-y: auto;
}
.radio-group {