feat:归集

This commit is contained in:
2026-05-21 15:38:19 +08:00
parent e812029064
commit 2a92567835
10 changed files with 299 additions and 63 deletions
+8
View File
@@ -256,3 +256,11 @@ export function getProfitSharingData(data) {
data data
}); });
} }
// 归集
export function collectQuery(data) {
return request({
url: "/finance/collectVcoin",
method: "post",
data,
});
}
+2 -2
View File
@@ -2,8 +2,8 @@
"name" : "信任桥", "name" : "信任桥",
"appid" : "__UNI__4910728", "appid" : "__UNI__4910728",
"description" : "信任桥优品是一款集线上商城、线下联盟商家的DAO聚合商城;通过“有趣”“有利”“有希望”的卖货玩法,吸引消费者、推广者、商家、投资人参与生态,共同打造共创共享的全球产业生态。", "description" : "信任桥优品是一款集线上商城、线下联盟商家的DAO聚合商城;通过“有趣”“有利”“有希望”的卖货玩法,吸引消费者、推广者、商家、投资人参与生态,共同打造共创共享的全球产业生态。",
"versionName" : "1.0.2", "versionName" : "1.0.3",
"versionCode" : 161, "versionCode" : 162,
"transformPx" : false, "transformPx" : false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus" : {
+3 -2
View File
@@ -22,7 +22,7 @@
<text style="margin-right: 20rpx">{{ <text style="margin-right: 20rpx">{{
currentUserData.nickname || "信任桥用户" currentUserData.nickname || "信任桥用户"
}}</text> }}</text>
<view class="level" @click="jumpToTrustBridge"> <view class="level" @click="jumpToTrustBridge" v-if="currentUserData.grade">
<up-image <up-image
src="https://static.tbmall.xin/static/mine/rz.png" src="https://static.tbmall.xin/static/mine/rz.png"
style="margin-right: 8rpx; margin-top: 6rpx" style="margin-right: 8rpx; margin-top: 6rpx"
@@ -31,7 +31,8 @@
height="12" height="12"
bgColor="#f1f6ff00" bgColor="#f1f6ff00"
></up-image> ></up-image>
<view>{{ currentUserData.gradeName }}</view> <view>星级用户</view>
<!-- <view>{{ currentUserData.gradeName }}</view> -->
</view> </view>
<!-- <view class="grade_warp" v-if="currentUserData && Object.keys(currentUserData).length !== 0"> <!-- <view class="grade_warp" v-if="currentUserData && Object.keys(currentUserData).length !== 0">
<up-image <up-image
+280 -51
View File
@@ -1,42 +1,23 @@
<template> <template>
<view class="purse_warp"> <view class="purse_warp">
<header-component <header-component :leftTitle="$t('purse.title')" left-path-type="switchTab" left-path="/pages/mine/mine" />
:leftTitle="$t('purse.title')"
left-path-type="switchTab"
left-path="/pages/mine/mine"
/>
<view class="purse_content_warp"> <view class="purse_content_warp">
<view <view v-for="(item, vIndex) in balanceList" :key="item.id" class="purse_warp_item" @click="jumpBonus(item)">
v-for="(item, vIndex) in balanceList"
:key="item.id"
class="purse_warp_item"
@click="jumpBonus(item)"
>
<view class="purse_item_title"> <view class="purse_item_title">
<view class="purse_item_title-left"> <view class="purse_item_title-left">
<up-image <up-image :src="`https://static.tbmall.xin/static/mine-purse/${item.categoty}.png`" width="22" height="22"
:src="`https://static.tbmall.xin/static/mine-purse/${item.categoty}.png`" bgColor="#f1f6ff00" class="purse_amount"></up-image>
width="22"
height="22"
bgColor="#f1f6ff00"
class="purse_amount"
></up-image>
<view class="title">{{ item.name }}</view> <view class="title">{{ item.name }}</view>
<up-image <up-image src="/static/common/right_soild.png" width="10" height="10" bgColor="#fff"
src="/static/common/right_soild.png" class="right_soild"></up-image>
width="10"
height="10"
bgColor="#fff"
class="right_soild"
></up-image>
</view> </view>
<view class="purse_item_title-right"> <view class="purse_item_title-right">
<view class="button exchange_button" @click.stop="jumpInfo(item, 'withdraw')" v-if="vIndex == 4"> <!-- <view class="button exchange_button" @click.stop="jumpInfo(item, 'withdraw')" v-if="vIndex == 4">
提现 提现
</view> </view> -->
<view v-for="(btn, index) in getOperationButtons(item)" :key="index" :type="btn.type" class="button" <view v-for="(btn, index) in getOperationButtons(item)" :key="index" :type="btn.code"
:class="btn.type + '_button'" @click.stop="jumpInfo(item, btn.type)">{{ btn.text }}</view> class="button exchange_button" @click.stop="jumpInfo(item, btn.code)">{{ btn.memo }}</view>
</view> </view>
</view> </view>
@@ -51,32 +32,72 @@
<view class="bottom_item" @click.stop="onTip(vIndex)"> <view class="bottom_item" @click.stop="onTip(vIndex)">
<view class="bottom_item_lock">{{ item.lockAmount || 0 }}</view> <view class="bottom_item_lock">{{ item.lockAmount || 0 }}</view>
<view class="bottom_item_title" <view class="bottom_item_title">{{ item.categoty === "raffle" ? "不可用次数" : "不可用余额" }}
>{{ item.categoty === "raffle" ? "不可用次数" : "不可用余额" }} <up-image src="/static/common/tips.png" width="12" height="12" bgColor="#fff"
<up-image style="margin-left: 8rpx; margin-top: 4rpx" v-if="item.categoty == 'balance'" />
src="/static/common/tips.png" </view>
width="12"
height="12"
bgColor="#fff"
style="margin-left: 8rpx; margin-top: 4rpx"
v-if="item.categoty == 'balance'"
/></view>
</view> </view>
</view> </view>
<view <view class="bottom_item_tip" v-if="item.categoty == 'balance' && activeTip == vIndex">抽奖7天后释放到可用余额中</view>
class="bottom_item_tip"
v-if="item.categoty == 'balance' && activeTip == vIndex"
>抽奖7天后释放到可用余额中</view
>
</view> </view>
</view> </view>
<!-- 归集弹窗 -->
<up-popup :show="collectShow" @close="closeCollect" position="bottom" :round="24">
<view class="popup_content">
<view class="popup_header">
<view class="popup_title">归集数字积分</view>
<view class="popup_close" @click="closeCollect">
<u-icon name="close" style="margin-left:32rpx" size="24"></u-icon>
</view>
</view>
<!-- 表单界面 -->
<view class="popup_form" v-if="!collectSuccess">
<view class="form_item">
<view class="form_icon">
<up-image src="/static/common/phone-1.png" width="24" height="24" />
</view>
<input class="form_input" v-model="collectForm.mobile" placeholder="请输入省代理手机号" type="number" />
</view>
<view class="form_item">
<view class="form_icon">
<up-image src="/static/common/amount-1.png" width="24" height="24" />
</view>
<input class="form_input" v-model="collectForm.amount" placeholder="请输入数量" type="digit" />
<view class="form_all" @click="fillAllAmount">全部</view>
</view>
<view class="form_tip">可用数量:{{ availableAmount }}</view>
<view class="form_item">
<view class="form_icon">
<up-image src="/static/common/password-1.png" width="24" height="24" />
</view>
<input class="form_input" v-model="collectForm.password" placeholder="请输入支付密码"
:type="collectForm.showPassword ? 'text' : 'password'" />
<view class="form_eye" @click="togglePassword">
<up-image :src="collectForm.showPassword ? '/static/login/show.png' : '/static/login/hidden.png'"
width="24" height="24" />
</view>
</view>
<view class="popup_confirm" @click="collectConfirm">确定归集</view>
</view>
<!-- 成功界面 -->
<view class="popup_success" v-else>
<view class="success_icon">
<up-image src="/static/common/success-1.png" width="64" height="64" bgColor="#fff" />
</view>
<view class="success_title">归集成功</view>
<view class="success_amount">{{ collectForm.amount }}</view>
<view class="popup_confirm" @click="closeCollect">好的</view>
</view>
</view>
</up-popup>
</view> </view>
</template> </template>
<script> <script>
import CryptoJS from 'crypto-js';
import Header from "@/components/header.vue"; import Header from "@/components/header.vue";
import { getAcctBalance } from "@/api/finance.js"; import { getAcctBalance, collectQuery } from "@/api/finance.js";
import { getValue } from "@/utils/enumUtils.js"; import { getValue } from "@/utils/enumUtils.js";
import { formatDate, handleAmount } from "@/utils/index.js"; import { formatDate, handleAmount } from "@/utils/index.js";
@@ -87,6 +108,15 @@ export default {
balanceLoading: false, balanceLoading: false,
balanceList: [], balanceList: [],
activeTip: -1, activeTip: -1,
collectShow: false,
collectSuccess: false,
availableAmount: 0,
collectForm: {
mobile: "",
amount: "",
password: "",
showPassword: false,
},
}; };
}, },
onLoad() { onLoad() {
@@ -97,13 +127,19 @@ export default {
formatDate, formatDate,
handleAmount, handleAmount,
getOperationButtons(item) { getOperationButtons(item) {
return [ // return [
// { type: 'recharge', text: '充值', show: item.isRecharge }, // { type: 'recharge', text: '充值', show: item.isRecharge },
{ type: "withdraw", text: "提现", show: item.isWithdrawal }, // { type: "withdraw", text: "提现", show: item.isWithdrawal },
{ type: "exchange", text: "兑换", show: item.isExchange }, //{ type: "exchange", text: "兑换", show: item.isExchange },
].filter((btn) => btn.show); //].filter((btn) => btn.show);
let buttons = [];
const functionConfig = JSON.parse(item.functionConfig);
console.log("functionConfig---", functionConfig);
if (functionConfig && functionConfig.length > 0) {
buttons = functionConfig.filter((btn) => btn.status);
}
return buttons
}, },
// 跳转到详情 // 跳转到详情
jumpBonus(item) { jumpBonus(item) {
uni.navigateTo({ uni.navigateTo({
@@ -131,7 +167,7 @@ export default {
}, },
// 提现 // 提现
jumpInfo(row, type) { jumpInfo(row, type) {
console.log("row", row); console.log("row", row, type);
if (type === "withdraw") { if (type === "withdraw") {
// 提现 // 提现
// uni.navigateTo({ // uni.navigateTo({
@@ -159,6 +195,12 @@ export default {
}); });
} else if (type === "transfer") { } else if (type === "transfer") {
console.log("transfer转出..."); console.log("transfer转出...");
} else if (type === "collect") {
// 归集
console.log("collect归集...");
this.availableAmount = row ? (row.curAmount || 0) : 0;
this.collectSuccess = false;
this.collectShow = true;
} }
}, },
onTip(index) { onTip(index) {
@@ -168,6 +210,54 @@ export default {
} }
this.activeTip = index; this.activeTip = index;
}, },
// 填充全部数量
fillAllAmount() {
this.collectForm.amount = String(this.availableAmount);
},
// 切换密码显示
togglePassword() {
this.collectForm.showPassword = !this.collectForm.showPassword;
},
// 关闭弹窗
closeCollect() {
this.collectShow = false;
this.collectSuccess = false;
this.collectForm = { mobile: "", amount: "", password: "", showPassword: false };
},
// 归集确认
async collectConfirm() {
const { mobile, amount, password } = this.collectForm;
if (!mobile) {
uni.showToast({ title: '请输入省代理手机号', icon: 'none' });
return;
}
if (!/^1[3-9]\d{9}$/.test(mobile)) {
uni.showToast({ title: '请输入正确的手机号', icon: 'none' });
return;
}
if (!amount || parseFloat(amount) <= 0) {
uni.showToast({ title: '请输入有效数量', icon: 'none' });
return;
}
if (parseFloat(amount) > parseFloat(this.availableAmount)) {
uni.showToast({ title: '数量不能超过可用数量', icon: 'none' });
return;
}
if (!password) {
uni.showToast({ title: '请输入支付密码', icon: 'none' });
return;
}
// 调用归集接口
const resp = await collectQuery({ mobile, amount, password: CryptoJS.MD5(password).toString() });
if (resp && resp.bizcode === 100) {
uni.showToast({ title: '归集成功', icon: 'success' });
this.collectSuccess = true;
this.getAcctBalance();
} else {
uni.showToast({ title: resp.msg || '归集失败', icon: 'none' });
}
},
}, },
}; };
</script> </script>
@@ -218,6 +308,7 @@ export default {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
.button { .button {
border-radius: 12rpx; border-radius: 12rpx;
width: 120rpx; width: 120rpx;
@@ -279,5 +370,143 @@ export default {
margin-top: 5rpx; margin-top: 5rpx;
} }
} }
.popup_content {
background: #ffffff;
border-radius: 48rpx 48rpx 0 0;
padding: 30rpx 32rpx;
padding-bottom: calc(60rpx + env(safe-area-inset-bottom));
.popup_header {
display: flex;
justify-content: center;
align-items: center;
position: relative;
margin-bottom: 48rpx;
.popup_title {
font-weight: 600;
font-size: 28rpx;
color: #71737C;
}
.popup_close {
position: absolute;
right: 0;
width: 48rpx;
height: 48rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
.popup_form {
.form_item {
display: flex;
align-items: center;
background: #f7f7f7;
border-radius: 20rpx;
padding: 0 28rpx;
height: 100rpx;
margin-bottom: 28rpx;
.form_icon {
width: 48rpx;
height: 48rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 20rpx;
}
.form_input {
flex: 1;
font-size: 30rpx;
color: #333333;
}
.form_all {
font-size: 28rpx;
color: #7934f6;
margin-left: 20rpx;
font-weight: 500;
}
.form_eye {
width: 48rpx;
height: 48rpx;
display: flex;
align-items: center;
justify-content: center;
margin-left: 20rpx;
}
}
.form_tip {
font-size: 26rpx;
color: #999999;
text-align: right;
margin-bottom: 28rpx;
}
.popup_confirm {
margin-top: 20rpx;
background: linear-gradient(270deg, #b164fb 0%, #7934f6 100%);
border-radius: 20rpx;
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 500;
font-size: 32rpx;
color: #ffffff;
}
}
.popup_success {
display: flex;
flex-direction: column;
align-items: center;
padding: 60rpx 0;
.success_icon {
width: 160rpx;
height: 160rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 32rpx;
}
.success_title {
font-weight: 600;
font-size: 36rpx;
color: #333333;
margin-bottom: 16rpx;
}
.success_amount {
font-weight: bold;
font-size: 48rpx;
color: #333333;
margin-bottom: 48rpx;
}
.popup_confirm {
width: 100%;
background: linear-gradient(270deg, #b164fb 0%, #7934f6 100%);
border-radius: 20rpx;
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 500;
font-size: 32rpx;
color: #ffffff;
}
}
}
} }
</style> </style>
-2
View File
@@ -25,8 +25,6 @@ import { searchList } from '@/api/product.js';
import { getCascadeCategory } from '@/api/common.js'; import { getCascadeCategory } from '@/api/common.js';
import PingItem from "@/components/shop/ping-item.vue"; import PingItem from "@/components/shop/ping-item.vue";
import func from '@/utils/func.js';
export default { export default {
components: { Header, TopSafe,MyBtn,PingItem }, components: { Header, TopSafe,MyBtn,PingItem },
data() { data() {
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

+4 -4
View File
@@ -2,11 +2,11 @@
// export const BASE_URL="http://cl55un59859.vicp.fun:24346"; // 测试环境 // export const BASE_URL="http://cl55un59859.vicp.fun:24346"; // 测试环境
export const BASE_URL = "https://api.tbmall.xin"; //生产 // export const BASE_URL = "https://api.tbmall.xin"; //生产
export const MILD_BASE_URL = "https://agent.tbmall.xin/"; //中台生产 // export const MILD_BASE_URL = "https://agent.tbmall.xin/"; //中台生产
// //
// export const BASE_URL ='https://api.o.tbmall.xin'; // 本地测试 export const BASE_URL ='https://api.o.tbmall.xin'; // 本地测试
// export const MILD_BASE_URL = "https://agent.o.tbmall.xin/"; //中台测试 export const MILD_BASE_URL = "https://agent.o.tbmall.xin/"; //中台测试
export const SHARE_URL = 'https://h.tbmall.xin'; export const SHARE_URL = 'https://h.tbmall.xin';