This commit is contained in:
HongRun Liu
2026-05-26 15:52:30 +08:00
commit b0744c8ab6
849 changed files with 130587 additions and 0 deletions
+233
View File
@@ -0,0 +1,233 @@
<template>
<s-pages :bgStyle="{ color: 'var(--color1)' }" :title="dataObj.title">
<view class="pages p-t-28 p-x-40">
<view class="radius12 pagesTop p-y-30 p-x-28 bg24">
<view class="c0">{{ dataObj.text0 }}</view>
<view class="m-b-28 border-bottom"
><uni-easyinput
v-model="num"
type="number"
placeholder=""
placeholder-style="font-size: 92rpx;"
@confirm="submit"
:inputBorder="false"
:min="0"
@blur="blur"
:clearSize="50"
/></view>
<view class="m-b-12 line48" v-if="dataObj.text">
{{ dataObj.text }}<span>{{ point }}</span
>{{ dataObj.text1 }},
<span class="c32" @click="num = point">全部{{ dataObj.title }}</span>
</view>
<view class="size24 infotext flex-center ju-flex-start c34">
<uni-icons class="m-l-16 m-r-6" type="info" color="" />
{{ dataObj.text2 }}
</view>
<view></view>
</view>
<view class="submit-btn m-t-66" @click="submit">{{ dataObj.title }}</view>
</view>
</s-pages>
</template>
<script setup>
import { ref, getCurrentInstance } from 'vue';
import { onShow, onLoad } from '@dcloudio/uni-app';
import sheep from '@/sheep';
import * as api from '@/sheep/api/home/pay';
import * as incrementApi from '@/sheep/api/increment/index';
import * as userApi from '@/sheep/api/member/user';
const { proxy } = getCurrentInstance();
let num = ref(0);
let point = ref(0);
let type = ref(0);
let dataObj = ref({
title: '兑换',
text0: '金种子数量',
text: '',
text1: '金种子',
text2: '兑换比例:100积分=1金种子',
num: 'point',
subUrl: api.exchangeGoldSeed,
upName: 'goldSeedAmount',
});
const submit = () => {
if (!num.value) {
sheep.$helper.toast('请输入兑换数量');
return;
}
let obj = {};
let upName = dataObj.value.upName;
// obj[upName] = num.value;
switch (type.value) {
case 0: //绿色积分兑换金种子
obj[upName] = num.value;
break;
case 1: //交易所积分兑换金种子
obj[upName] = num.value * 100;
break;
case 2: //配票 向上取整
obj[upName] = Math.ceil(num.value / 0.85);
break;
case 3: //兑换原始积分
obj[upName] = num.value;
break;
default:
break;
}
dataObj.value.subUrl(obj).then((res) => {
if (res.code === 0) {
num.value = 0;
getInfo();
}
console.log(res);
});
};
const blur = () => {
if (num.value < 0) {
sheep.$helper.toast('兑换数量不能小于0');
num.value = 0;
return;
}
if (num.value > point.value) {
sheep.$helper.toast('兑换数量不能大于可兑换数量');
num.value = point.value;
return;
}
};
const getInfo = () => {
dataObj.value.info().then((res) => {
console.log(res);
if (res.code === 0) {
let num = res.data[dataObj.value.num];
// dataObj.value.text = `当前积分${num}, 可兑换`
// point.value = type.value === 0 || type.value === 1 ? Math.floor(num / 100) : num;
switch (type.value) {
case 0: //绿色积分兑换金种子
point.value = Math.floor(num / 100);
break;
case 1: //交易所积分兑换金种子
point.value = Math.floor(num / 100);
break;
case 2: //配票 向下取整
point.value = Math.floor(num * 0.85);
break;
case 3: //兑换原始积分
point.value = num;
break;
default:
break;
}
}
});
};
onLoad((e) => {
// type: 0 绿色积分 1增量积分
type.value = parseInt(e.type) || 0;
switch (type.value) {
case 0: //绿色积分兑换金种子
dataObj.value = {
title: '兑换',
text0: '金种子数量',
text: '当前可兑换',
text1: '金种子',
text2: '兑换比例:100积分=1金种子',
num: 'point',
subUrl: api.exchangeGoldSeed,
info: userApi.default.getUserInfo,
upName: 'goldSeedAmount',
};
break;
case 1: //交易所积分兑换金种子
dataObj.value = {
title: '兑换',
text0: '金种子数量',
text: '当前可兑换',
text1: '金种子',
text2: '兑换比例:100积分=1金种子',
num: 'exchangePoint',
subUrl: incrementApi.exPointChangeGoldSeed,
info: incrementApi.getUserGroupInfo,
upName: 'amount',
};
break;
case 2: //配票
dataObj.value = {
title: '配票',
text0: '增量积分',
text: '当前可配票',
text1: '积分',
text2: '需要核销15%的积分',
num: 'incrementPoint',
subUrl: incrementApi.incrPointChangeIncPoint,
info: incrementApi.getUserGroupInfo,
upName: 'amount',
};
break;
case 3: //兑换
dataObj.value = {
title: '兑换积分',
text0: '增量积分',
text: '当前可兑换',
text1: '积分',
text2: '兑换比例:1增量积分=1绿色积分',
num: 'incrementPoint',
subUrl: incrementApi.incrPointChangeExPoint,
info: incrementApi.getUserGroupInfo,
upName: 'amount',
};
break;
}
getInfo();
});
onShow(() => {
// getInfo();
});
</script>
<style scoped lang="scss">
:deep(.uni-icons) {
font-size: 24rpx !important;
}
:deep(.uni-easyinput__content) {
height: 108rpx;
font-size: 92rpx;
border-color: #4c505b;
}
:deep(.uni-easyinput__content-input) {
height: 108rpx;
font-size: 92rpx;
}
:deep(.uni-easyinput__placeholder-class) {
font-size: 92rpx;
}
:deep(.uni-input-input) {
// color: #ffffff;
}
.pagesTop {
background-color: #fff;
}
.infotext {
height: 62rpx;
background: #f2f2f2;
border-radius: 12rpx;
}
.c_FA7E31 {
color: #fa7e31;
}
:deep(.uniui-left) {
font-size: 44rpx !important;
}
:deep(.uni-icons) {
font-size: 44rpx !important;
}
</style>
+463
View File
@@ -0,0 +1,463 @@
<template>
<s-pages title="提现">
<view class="pages p-y-28 p-x-40 c0">
<!-- <view class="m-b-20 tab-header">
<text class="tab-item" :class="{ active: type === 'yougou' }" @click="changeType('yougou')">优购提现</text>
<text class="tab-item m-l-20" :class="{ active: type === 'huamao' }"
@click="changeType('huamao')">华贸提现</text>
</view> -->
<view v-if="type === 'yougou'">
<view class="bg24 radius12 m-b-32 p-y-30 p-x-28">
<view class="flex-center ju-between">
<view class="title c0">收款人</view>
<view class="c33 flex-center" @click="select"><span style="color: #333">选择</span>
<uni-icons class="m-l-10" type="right" color="#333" size="16" />
</view>
</view>
<view class="flex-center border-bottom" style="height: 100rpx" v-for="(v, i) in list" :key="i">
<view class="c0">{{ v.title }}</view>
<uni-easyinput style="text-align: right" class="flex1" v-model="dataObj[v.value]"
:type="v.type || 'text'" :placeholder="v.placeholder" :inputBorder="false"
@input="(e) => inputChange(e, v)" />
</view>
</view>
</view>
<view class="bg24 radius12 p-y-30 p-x-28 card2 pay">
<view class="weight500 c0">提现金额</view>
<view class="m-b-26 flex-row border-bottom">
<span class="size92 c0 m-r-32">¥</span>
<uni-easyinput class="flex1" v-model="dataObj.price" type="number" placeholder=""
placeholder-style="font-size: 92rpx;" @confirm="onSubmit" :inputBorder="false" :min="0"
:clearSize="50" />
<!-- @blur="blur" -->
</view>
<view class="m-b-12 c0">
当前可提现<span>{{ point }}</span>元, <span class="c3" @click="dataObj.price = point">全部提现</span>
</view>
<view></view>
</view>
<view class="size24 m-t-36 m-b-74 line46">
<view class="c0">
<view>
<span class="c_FF2D2D">*</span>
{{
`提现费率为${config.brokerageWithdrawFeePercent}%,最低提现金额为${config.brokerageWithdrawMinPrice}元`
}}
</view>
<view>
<span class="c_FF2D2D">*</span>
{{ `提现时间为${config.brokerageWithdrawTime}` }}
</view>
</view>
</view>
<view class="submit-btn" @click="onSubmit">提现</view>
<view class="c2 record"><span @click="goUrl">提现记录</span></view>
<uni-popup ref="popupRef" type="center" border-radius="12rpx" background-color="#fff">
<view class="pop-bar">
<view class="close" @click="popClose()"> × </view>
<view class="img-box">
<image :src="$ygUrl + 'realname_icon.png'" />
</view>
<view class="size40 line56"> 请您补全您的实名信息 </view>
<view class="txt2 size32 line44 m-t-16">
为了保障您的账户安全,请尽快 <br />
补全您的实名身份信息
</view>
<view class="btn m-t-50" @click="goReal()"> 去认证 </view>
</view>
</uni-popup>
</view>
</s-pages>
</template>
<script setup>
import {
ref,
getCurrentInstance
} from 'vue';
import {
onLoad,
onShow
} from '@dcloudio/uni-app';
import * as api from '@/sheep/api/home/pay';
import TradeConfigApi from '@/sheep/api/trade/config';
import sheep from '@/sheep';
import popup from '@/uni_modules/uni-popup/components/uni-popup/popup';
import UserApi from '@/sheep/api/member/user';
let realStatus = ref(0); //是否已经实名认证
const popupRef = ref();
const type = ref('yougou');
const goUrl = () => {
uni.navigateTo({
url: '/pages/home/pay/withdrawRecord',
});
};
const changeType = (t) => {
type.value = t;
};
const {
proxy
} = getCurrentInstance();
let list = ref([{
title: '姓名',
value: 'userName',
placeholder: '请输入姓名',
},
{
title: '账号',
value: 'userAccount',
type: 'number',
placeholder: '请输入银行账号',
},
{
title: '银行',
value: 'bankName',
placeholder: '请输入银行名称',
},
{
title: '支行',
value: 'bankAddress',
placeholder: '请输入支行名称',
},
]);
let dataObj = ref({
type: 1,
transferChannelCode: 'wx_lite',
price: 0,
});
let point = ref(0);
const getData = () => {
UserApi.getUserInfo().then((res) => {
realStatus.value = res.data.realStatus;
// console.log(realStatus.value);
});
api.getWallet().then((res) => {
if (res.code === 0) {
point.value = proxy.$fen2yuan(res.data.withdrawAmount);
}
});
};
const goReal = () => {
uni.redirectTo({
url: '/pages/public/realname?status=' + realStatus.value,
// query: obj,
});
popupRef.value.close();
};
const popClose = () => {
popupRef.value.close();
};
const onSubmit = () => {
if (type.value === 'yougou') {
submit();
} else {
submit2();
}
};
// 提现
const submit = () => {
//未实名不能去提现
if (realStatus.value === 0) {
popupRef.value.open('center');
return;
}
let monney = Number(dataObj.value.price);//输入框提现金额
let minMoney = config.value.brokerageWithdrawMinPrice;// 提现最小金额
// console.log(monney,minMoney);
if (monney < minMoney) {
sheep.$helper.toast(`提现金额不能小于${minMoney}元`);
return;
}
if (monney > Number(point.value)) {
sheep.$helper.toast('提现金额不能大于可提现金额');
dataObj.value.price = point.value;
return;
}
if (!dataObj.value.userName) {
sheep.$helper.toast('请输入姓名');
return;
}
if (!dataObj.value.userAccount) {
sheep.$helper.toast('请输入账号账号');
return;
}
if (!dataObj.value.bankName) {
sheep.$helper.toast('请输入银行名称');
return;
}
if (!dataObj.value.bankAddress) {
sheep.$helper.toast('请输入支行名称');
return;
}
if (!dataObj.value.price) {
sheep.$helper.toast('请输入提现金额');
return;
}
let obj = JSON.parse(JSON.stringify(dataObj.value));
obj.price = obj.price * 100;
api.createBrokerageWithdraw(obj).then((res) => {
if (res.code === 0) {
dataObj.value = {
type: 2,
transferChannelCode: 'wx_lite',
price: 0,
};
getData();
}
// console.log(res);
});
};
//huamao提现
function submit2() {
let monney = Number(dataObj.value.price);//输入框提现金额
let minMoney = config.value.brokerageWithdrawMinPrice;// Huamao提现最小金额
// console.log(monney,minMoney);
if (monney < minMoney) {
sheep.$helper.toast(`提现金额不能小于${minMoney}元`);
return;
}
if (monney > Number(point.value)) {
sheep.$helper.toast('提现金额不能大于可提现金额');
dataObj.value.price = point.value;
return;
}
api.hmPayExpenditure({
price: monney * 100,
}).then((res) => {
if (res.code === 0) {
dataObj.value = {
type: 2,
transferChannelCode: 'wx_lite',
price: 0,
};
getData();
}
// console.log(res);
});
}
const blur = () => {
// console.log(config.value.brokerageWithdrawMinPrice);
if (Number(dataObj.value.price) < 0) {
sheep.$helper.toast('提现金额不能小于0');
dataObj.value.price = 0;
return;
}
if (Number(dataObj.value.price) < proxy.$fen2yuan(config.value.brokerageWithdrawMinPrice)) {
sheep.$helper.toast(`提现金额不能小于${proxy.$fen2yuan(config.value.brokerageWithdrawMinPrice)}元`);
return;
}
if (Number(dataObj.value.price) > Number(point.value)) {
sheep.$helper.toast('提现金额不能大于可提现金额');
dataObj.value.price = point.value;
return;
}
};
const inputChange = (e, v) => {
let obj = {
bankNo: e.detail.value,
};
if (v.value == 'userAccount') {
api.getBank(obj).then((res) => {
if (res.code === 0) {
console.log(res);
dataObj.value.bankName = res.data;
}
});
}
};
let bankList = ref([]);
let bankText = ref([]);
const getBankList = () => {
api.getBankList({}).then((res) => {
if (res.code === 0) {
res.data.forEach((item) => {
// 取银行卡后四位
item.text = `${item.bankName}(${item.cardNumber.slice(-4)})`;
bankText.value.push(item.text);
});
bankList.value = res.data;
if (res?.data?.length) {
let obj = res.data[0];
dataObj.value = {
...dataObj.value,
userName: obj.trueName,
userAccount: obj.cardNumber,
bankName: obj.bankName,
bankAddress: obj.bankAddress,
};
}
}
});
};
const select = () => {
uni.showActionSheet({
itemList: bankText.value,
success: ({
tapIndex
}) => {
let obj = bankList.value[tapIndex];
dataObj.value = {
...dataObj.value,
userName: obj.trueName,
userAccount: obj.cardNumber,
bankName: obj.bankName,
};
},
fail: (error) => { },
});
};
let config = ref({
brokerageWithdrawMinPrice: 0,
brokerageWithdrawFeePercent: 0,
brokerageWithdrawTime: '',
});
onLoad(() => {
getBankList();
});
onShow(async () => {
getData();
getBankList();
let {
code,
data
} = await TradeConfigApi.getTradeConfig();
if (code === 0) {
config.value.brokerageWithdrawMinPrice = Number(proxy.$fen2yuan(data.brokerageWithdrawMinPrice));
config.value.brokerageWithdrawFeePercent = data.brokerageWithdrawFeePercent;
config.value.brokerageWithdrawTime = data.brokerageWithdrawTime;
console.log(config.value);
}
});
</script>
<style scoped lang="scss">
.pop-bar {
padding: 46rpx 28rpx;
position: relative;
.close {
width: 56rpx;
height: 56rpx;
line-height: 56rpx;
background: #dddddd;
border-radius: 50%;
color: #000;
position: absolute;
right: -24rpx;
top: -24rpx;
}
.img-box {
width: 372rpx;
height: 380rpx;
margin: 0 auto;
image {
width: 100%;
height: 100%;
}
}
.txt2 {
color: #676767;
}
.btn {
width: 608rpx;
height: 82rpx;
line-height: 82rpx;
text-align: center;
background: linear-gradient(130deg, #fa8735 0%, #fe3b48 100%);
border-radius: 12rpx;
color: #fff;
}
}
.record {
text-align: center;
padding: 36rpx 0;
font-size: 26rpx;
}
.bc_white {
background-color: #fff;
}
:deep(.uni-icons) {
font-size: 24rpx !important;
}
.pay {
:deep(.uni-easyinput__content) {
height: 108rpx;
font-size: 92rpx;
}
:deep(.uni-easyinput__content-input) {
height: 108rpx;
font-size: 92rpx;
}
:deep(.uni-easyinput__placeholder-class) {
font-size: 92rpx;
}
}
:deep(.uni-input-input) {
// color: #ffffff;
}
.infotext {
height: 62rpx;
background: #f2f2f2;
border-radius: 12rpx;
}
.c_FA7E31 {
color: #fa7e31;
}
.c_FF2D2D {
color: #ff2d2d;
}
.c_666 {
color: #666;
}
.size92 {
font-size: 92rpx;
}
:deep(.uniui-left) {
font-size: 44rpx !important;
}
:deep(.uni-icons) {
font-size: 44rpx !important;
}
.tab-header {
display: flex;
}
.tab-item {
font-size: 30rpx;
padding-bottom: 10rpx;
}
.active {
color: #ff5040;
border-bottom: 4rpx solid #ff5040;
}
</style>
+193
View File
@@ -0,0 +1,193 @@
<template>
<s-layout :bgStyle="{ color: 'var(--color1)' }" title="提现">
<view class="pages p-y-28 p-x-40 c0">
<view class="bg24 radius12 m-b-32 p-y-30 p-x-28">
<view class="title c0">收款人</view>
<view
class="flex-center border-bottom"
style="height: 100rpx"
v-for="(v, i) in list"
:key="i"
>
<view class="c0">{{ v.title }}</view>
<uni-easyinput
style="text-align: right"
class="flex1"
v-model="dataObj[v.value]"
:type="v.type || 'text'"
:placeholder="v.placeholder"
:inputBorder="false"
/>
</view>
</view>
<view class="bg24 radius12 p-y-30 p-x-28 card2 pay">
<view class="weight500 c0">提现金额</view>
<view class="m-b-26 flex-row border-bottom"
><span class="size92 m-r-32">¥</span
><uni-easyinput
class="flex1"
v-model="dataObj.price"
type="number"
placeholder=""
placeholder-style="font-size: 92rpx;"
@confirm="submit"
:inputBorder="false"
:min="0"
@blur="blur"
:clearSize="50"
/></view>
<view class="m-b-12 c0">
当前可提现<span>{{ point }}</span
>元, <span class="c3" @click="dataObj.price = point">全部提现</span>
</view>
<view></view>
</view>
<view class="size24 m-t-36 m-b-74">
<view class="m-b-24"> <span class="c_FF2D2D">*</span>最低提现金额为0元 </view>
<view class="c0">
<span class="c_FF2D2D">*</span>提现费率为0%,最低收取0元,最高收取0元
</view>
</view>
<view class="submit-btn" @click="submit">提现</view>
</view>
</s-layout>
</template>
<script setup>
import { ref, getCurrentInstance } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import * as api from '@/sheep/api/home/pay';
import sheep from '@/sheep';
const { proxy } = getCurrentInstance();
let list = ref([
{
title: '姓名',
value: 'userName',
placeholder: '请输入姓名',
},
{
title: '账号',
value: 'userAccount',
type: 'number',
placeholder: '请输入银行账号',
},
{
title: '银行',
value: 'bankName',
placeholder: '请输入银行名称',
},
]);
let dataObj = ref({
type: 1,
transferChannelCode: 'wx_lite',
price: 0,
});
let point = ref(0);
const getData = () => {
api.getWallet().then((res) => {
if (res.code === 0) {
point.value = proxy.$fen2yuan(res.data.balance);
}
});
};
const submit = () => {
if (dataObj.value.price > point.value) {
sheep.$helper.toast('提现金额不能大于可提现金额');
dataObj.value.price = point.value;
return;
}
if (!dataObj.value.userName) {
sheep.$helper.toast('请输入姓名');
return;
}
if (!dataObj.value.userAccount) {
sheep.$helper.toast('请输入账号账号');
return;
}
if (!dataObj.value.bankName) {
sheep.$helper.toast('请输入银行名称');
return;
}
if (!dataObj.value.price) {
sheep.$helper.toast('请输入提现金额');
return;
}
let obj = JSON.parse(JSON.stringify(dataObj.value));
obj.price = obj.price * 100;
api.createBrokerageWithdraw(obj).then((res) => {
if (res.code === 0) {
dataObj.value = {
type: 2,
transferChannelCode: 'wx_lite',
price: 0,
};
getData();
}
console.log(res);
});
};
const blur = () => {
if (dataObj.value.price < 0) {
sheep.$helper.toast('提现金额不能小于0');
dataObj.value.price = 0;
return;
}
if (dataObj.value.price > point.value) {
sheep.$helper.toast('提现金额不能大于可提现金额');
dataObj.value.price = point.value;
return;
}
};
onShow(() => {
getData();
});
</script>
<style scoped lang="scss">
.bc_white {
background-color: #fff;
}
:deep(.uni-icons) {
font-size: 24rpx !important;
}
.pay {
:deep(.uni-easyinput__content) {
height: 108rpx;
font-size: 92rpx;
}
:deep(.uni-easyinput__content-input) {
height: 108rpx;
font-size: 92rpx;
}
:deep(.uni-easyinput__placeholder-class) {
font-size: 92rpx;
}
}
:deep(.uni-input-input) {
color: #ffffff;
}
.infotext {
height: 62rpx;
background: #f2f2f2;
border-radius: 12rpx;
}
.c_FA7E31 {
color: #fa7e31;
}
.c_FF2D2D {
color: #ff2d2d;
}
.c_666 {
color: #666;
}
.size92 {
font-size: 92rpx;
}
:deep(.uniui-left) {
font-size: 44rpx !important;
}
:deep(.uni-icons) {
font-size: 44rpx !important;
}
</style>
+79
View File
@@ -0,0 +1,79 @@
<template>
<s-pages title="提现记录">
<card_mescroll ref="cardPages" @upCallback="getList" :height="height">
<view class="bg24 radius12 m-x-42 p-y-28 p-x-40" v-if="detailList.length">
<view
class="flex-between border-bottom"
style="height: 150rpx"
v-for="(v, i) in detailList"
:key="i"
>
<view class="c0">
<view class="size28"> {{ v.typeName }}-提现到银行卡 </view>
<view class="c_999 size24 m-t-10">
{{ sheep.$helper.timeFormat(v.createTime, 'yyyy-mm-dd hh:MM:ss') }}
</view>
</view>
<view class="c0">
<view class="size28 price">
{{ fen2yuan(v.price) }}
</view>
<view class="status size24 m-t-10">
{{ v.statusName }}
</view>
</view>
</view>
</view>
</card_mescroll>
</s-pages>
</template>
<script setup>
import sheep from '@/sheep';
import { ref } from 'vue';
import * as api from '@/sheep/api/home/pay';
import { onLoad } from '@dcloudio/uni-app';
import card_mescroll from '@/components/card_pages/card_mescroll.vue';
import { fen2yuan } from '@/sheep/hooks/useGoods';
let detailList = ref([]);
let height = ref('100%');
let sysInfo = uni.getSystemInfoSync();
height.value = sysInfo.windowHeight - sysInfo.statusBarHeight - uni.upx2px(88) + 'px';
let cardPages = ref(null);
const getList = async (mescroll) => {
let res = await api.withdrawRecord({
pageNo: mescroll.num,
pageSize: mescroll.size,
});
if (res.code === 0) {
let data = res.data.list || [];
if (mescroll.num == 1) detailList.value = [];
detailList.value = detailList.value.concat(data);
cardPages.value.getState(true, data.length);
} else {
cardPages.value.getState(false);
}
// api.withdrawRecord().then((e) => {
// if (e.code === 0) {
// detailList.value = e.data.list;
// console.log(e.data.list);
// list.value = e.data.list;
// }
// });
};
</script>
<style scoped lang="scss">
.price {
text-align: right;
}
.status {
text-align: right;
color: #366eee;
}
.nomore {
text-align: center;
}
</style>