Compare commits

...

3 Commits

Author SHA1 Message Date
赵毅
8d60cb6200 完成钱包模块 2025-10-10 11:41:43 +08:00
赵毅
61c15f5d67 修改活动商品的提交订单页面的金额等数据异常问题 2025-10-10 10:56:55 +08:00
赵毅
a4a233f175 修改线上环境我的小区金刚区默认图标不显示的bug 2025-10-10 10:56:02 +08:00
7 changed files with 165 additions and 137 deletions

4
api/wallet.js Normal file
View File

@ -0,0 +1,4 @@
export const apiArr = {
walletList: "/api/v2/wechat/wallet/list", // 商户钱包
walletChangeList: "/api/v2/wechat/wallet/change/list", // 商户钱包变更详情
};

View File

@ -43,7 +43,7 @@
<view class="group-price">
<view>{{ item.commodity_goods_info.sales_price }}/{{
item.commodity_goods_info.goods_unit
}}</view>
}}</view>
<!-- 运费 -->
<view class="goods-desc" style="margin-top: 10rpx;">运费 {{
item.commodity_goods_info.freight }}</view>
@ -246,7 +246,8 @@
<view class="wealBox">
<view class="wealBoxItem wealBoxItem1">
<view class="wealBoxItemTop">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_fen.png" mode="aspectFit">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_fen.png"
mode="aspectFit">
</image>
<view>石榴分</view>
</view>
@ -259,7 +260,8 @@
</view>
<view class="wealBoxItem wealBoxItem2">
<view class="wealBoxItemTop">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_zi.png" mode="aspectFit">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_zi.png"
mode="aspectFit">
</image>
<view>石榴籽</view>
</view>
@ -272,7 +274,8 @@
</view>
<view class="wealBoxItem wealBoxItem3">
<view class="wealBoxItemTop">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_jin.png" mode="aspectFit"/>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_jin.png"
mode="aspectFit" />
<view>石榴金</view>
</view>
<view>
@ -374,6 +377,7 @@ export default {
//
verifyCode: '',
totalPrice: 0,
};
},
computed: {
@ -520,8 +524,10 @@ export default {
{
goods_id: item.goods_id,
count: item.count,
price: item.price,
},
],
adver_id: item.adver_id,
}
request(apiArr.updateCar, "POST", params).then(res => {
uni.showToast({
@ -533,37 +539,20 @@ export default {
//
calculateTotal(order) {
const currentTime = new Date().getTime();
if (order === 'order1') {
let total = 0;
this.orderList1.forEach(goods => {
//
const startTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
const endTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
if (currentTime >= startTime && currentTime <= endTime) {
// total += goods.commodity_goods_info.group_buy_price * goods.count + goods.commodity_goods_info.freight;
total += goods.commodity_goods_info.group_buy_price * goods.count;
} else {
// total += goods.commodity_goods_info.sales_price * goods.count + goods.commodity_goods_info.freight;
total += goods.commodity_goods_info.sales_price * goods.count;
}
// 使item.price
total += goods.price * goods.count;
});
//
return total.toFixed(2);
} else {
let total = 0;
this.orderList2.forEach(goods => {
// //
// const startTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
// const endTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
// if (currentTime >= startTime && currentTime <= endTime) {
// // total += goods.commodity_goods_info.group_buy_price * goods.count + goods.commodity_goods_info.freight;
// total += goods.commodity_goods_info.group_buy_price * goods.count;
// } else {
// // total += goods.commodity_goods_info.sales_price * goods.count + goods.commodity_goods_info.freight;
// total += goods.commodity_goods_info.sales_price * goods.count;
// }
// 使item.price
total += goods.price * goods.count;
this.totalPrice = total.toFixed(2);
});
//
return total.toFixed(2);
@ -654,7 +643,7 @@ export default {
const params = {
user_id: uni.getStorageSync('userId'),
// shopCarListisAdvertrue
order_cate : this.carList.some(item => item.isAdver === true) ? 3 : (isGroupBuyValid ? 2 : 1),
order_cate: this.carList.some(item => item.isAdver === true) ? 3 : (isGroupBuyValid ? 2 : 1),
goods_list: Object.keys(this.supplierGroups).map(supplierId => {
const group = this.supplierGroups[supplierId];
const firstItem = group[0];
@ -675,14 +664,10 @@ export default {
merchant_id: ztAddress.address_id,
group_buy_activity_id: firstItem.commodity_goods_info.group_buy_activity_id,
goods_and_count: group.map(item => {
const activityInfo = item.commodity_goods_info.group_buy_activity_info;
const isGroupBuy = activityInfo &&
currentTime >= new Date(activityInfo.start_time).getTime() &&
currentTime <= new Date(activityInfo.end_time).getTime();
return {
goods_id: item.goods_id,
count: item.count,
price: isGroupBuy ? item.commodity_goods_info.group_buy_price : item.commodity_goods_info.sales_price,
price: item.price,
freight: item.commodity_goods_info.freight,
}
})

View File

@ -317,7 +317,7 @@ export default {
is_published: 1,
jump_target: 1,
mini_program_url: "/packages/community/repairList/index",
nav_icon: picUrl + "/static/images/2025-07-05/db3s1b1lyxawt8cnke.png",
nav_icon: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction1.png",
nav_name: "报事报修",
other_appid: "",
other_path: "",
@ -331,7 +331,7 @@ export default {
is_published: 1,
jump_target: 1,
mini_program_url: "/packages/community/propertyPayment/index",
nav_icon: picUrl + "/static/images/2025-07-05/db3s1t7d1k0qmuha61.png",
nav_icon: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction2.png",
nav_name: "物业缴费",
other_appid: "",
other_path: "",
@ -345,7 +345,7 @@ export default {
is_published: 1,
jump_target: 1,
mini_program_url: "/packages/community/providentFund/index",
nav_icon: picUrl + "/static/images/2025-07-05/db3s29e33rd7rsrecf.png",
nav_icon: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/noValFunction3.png",
nav_name: "物业公积金",
other_appid: "",
other_path: "",

View File

@ -25,16 +25,16 @@
<view class="walletBox">
<view class="walletBox_top">钱包</view>
<view class="walletBox_content">
<view class="walletBox_item" @click="goWallet(1)">
<view>999.00</view>
<view class="walletBox_item" @click="goWallet(1, walletInfo.guarantee.toFixed(2))">
<view>{{ walletInfo.guarantee ? walletInfo.guarantee.toFixed(2) : "0.00" }}</view>
<view class="walletBox_item_text">保证金</view>
</view>
<view class="walletBox_item" @click="goWallet(2)">
<view>999.00</view>
<view class="walletBox_item" @click="goWallet(2, walletInfo.receivable.toFixed(2))">
<view>{{ walletInfo.receivable ? walletInfo.receivable.toFixed(2) : "0.00" }}</view>
<view class="walletBox_item_text">应收</view>
</view>
<view class="walletBox_item" @click="goWallet(3)">
<view>999.00</view>
<view class="walletBox_item" @click="goWallet(3, walletInfo.handling_fee.toFixed(2))">
<view>{{ walletInfo.handling_fee ? walletInfo.handling_fee.toFixed(2) : "0.00" }}</view>
<view class="walletBox_item_text">手续费</view>
</view>
</view>
@ -98,6 +98,7 @@ import {
import {
apiArr
} from '../../../api/community';
import { apiArr as walletApi } from '../../../api/wallet';
export default {
@ -125,6 +126,7 @@ export default {
url: "/packages/customerService/chattingRecords/index",
}
],
walletInfo: {},
}
},
onLoad(options) {
@ -135,8 +137,16 @@ export default {
this.getShopList();
},
methods: {
//
getWalletInfo() {
const params = {
merchant_id: this.selectedShop.id,
}
request(walletApi.walletList, 'POST', params, { silent: false }).then(res => {
this.walletInfo = res;
})
},
//
getShopList() {
request(apiArr.getShopList, 'POST', {}, { silent: false }).then(res => {
@ -146,11 +156,14 @@ export default {
this.shopList = res.rows;
if (this.shopList.length > 0) {
this.selectedShop = this.shopList[0];
// selectedShopgetWalletInfo()
this.getWalletInfo();
}
})
},
goWallet(type) {
NavgateTo('/packages/storeManagement/wallet/index?type=' + type);
//
goWallet(type, amount) {
NavgateTo('/packages/storeManagement/wallet/index?type=' + type + '&merchant_id=' + this.selectedShop.id + '&amount=' + amount);
},
changeTab(index) {
this.active = index;

View File

@ -15,11 +15,11 @@
<view>
<view class="balance-title">{{ topVal }}</view>
<view class="balance-amount">{{ balance }}</view>
<view class="balance-icon" v-if="topVal != '保证金'">
<image src="http://localhost:8080/user_wallet2.png" mode="widthFix" />
</view>
<view v-else class="balance-text">
<!-- <view v-if="topVal == '保证金'" class="balance-text">
去充值
</view> -->
<view class="balance-icon">
<image src="http://localhost:8080/user_wallet2.png" mode="widthFix" />
</view>
</view>
</view>
@ -27,44 +27,48 @@
<!-- 变动记录 -->
<view class="records-container">
<view class="tabs" v-if="topVal == '保证金'">
<!-- <view class="tabs" v-if="topVal == '保证金' && records.length > 0">
<view v-for="(item, index) in tabList" :key="index"
:class="['tabItem', selectedTab === item.id ? 'active2' : '']" @click="selectTab(index, item)">
{{ item.tabName }}
</view>
</view> -->
<view v-if="records.length == 0">
<view class="records-list">暂无变动记录</view>
</view>
<view class="records-list">
<view class="records-list" v-else>
<view class="record-item" v-for="(record, index) in records" :key="index">
<view class="record-info">
<view class="record-name">{{ record.name }}</view>
<view class="record-time">{{ record.time }}</view>
<view class="record-name">{{ record.change_reason == 1 ? '下单' : '退单' }} - {{
record.related_order }}</view>
<view class="record-time">{{ record.change_time }}</view>
</view>
<view class="record-amount" v-if="topVal == '保证金'">
<view>
<text :class="['amount-sign', record.amount.startsWith('+') ? 'positive' : 'negative']">{{
record.amount.startsWith('+') ? '+' : '-' }}</text>
<text :class="['amount-value', record.amount.startsWith('+') ? 'positive' : 'negative']">¥{{
record.amount.replace(/[+-]/, '') }}</text>
<text :class="['amount-sign', record.change_reason == 1 ? 'positive' : 'negative']">{{
record.change_reason == 1 ? '+' : '-' }}</text>
<text :class="['amount-value', record.change_reason == 1 ? 'positive' : 'negative']">¥{{
record.amount_change }}</text>
</view>
<view class="record-balance">:¥{{ record.remain }}</view>
<view class="record-balance">:¥{{ record.balance_after }}</view>
</view>
<view class="record-amount" v-else-if="topVal == '应收'">
<view :class="['amount-sign', record.amount.startsWith('+') ? 'positive' : 'negative']">{{
record.amount.startsWith('+') ? '收款' : '退款' }}</view>
<view :class="['amount-sign', record.change_reason == 1 ? 'positive' : 'negative']">{{
record.change_reason == 1 ? '收款' : '退款' }}</view>
<view>
<text :class="['amount-sign', record.amount.startsWith('+') ? 'positive' : 'negative']">{{
record.amount.startsWith('+') ? '+' : '-' }}</text>
<text :class="['amount-value', record.amount.startsWith('+') ? 'positive' : 'negative']">¥{{
record.amount.replace(/[+-]/, '') }}</text>
<text :class="['amount-sign', record.change_reason == 1 ? 'positive' : 'negative']">{{
record.change_reason == 1 ? '+' : '-' }}</text>
<text :class="['amount-value', record.change_reason == 1 ? 'positive' : 'negative']">¥{{
record.amount_change }}</text>
</view>
</view>
<view class="record-amount" v-else>
<view class="record-balance">手续费</view>
<view>
<text class="amount-sign">{{ record.amount.startsWith('+') ? '+' : '-' }}</text>
<text class="amount-sign">¥{{ record.amount.replace(/[+-]/, '') }}</text>
<text class="amount-sign">{{ record.change_reason == 1 ? '+' : '-' }}</text>
<text class="amount-sign">¥{{ record.amount_change }}</text>
</view>
</view>
</view>
@ -74,27 +78,16 @@
</template>
<script>
import { menuButtonInfo, NavgateTo, picUrl, request } from '../../../utils/index';
import { apiArr as walletApi } from '../../../api/wallet';
export default {
data() {
return {
top: "",
localHeight: "",
topVal: "",
balance: "160.80",
records: [
{
name: "退单-1312312317972",
time: "2025-08-12 13:00:00",
amount: "-1808.5",
remain: "286.79"
},
{
name: "退单-1312312317972",
time: "2025-08-12 13:00:00",
amount: "-1808.5",
remain: "286.79"
}
],
balance: "",
records: [],
tabList: [
{
id: 0,
@ -109,7 +102,8 @@ export default {
tabName: '消费记录'
}
],
selectedTab: 0
selectedTab: 0,
merchant_id: "",
}
},
onLoad(options) {
@ -117,6 +111,8 @@ export default {
this.top = meun.top;
this.localHeight = meun.height;
this.topVal = options.type == 1 ? '保证金' : (options.type == 2 ? '应收' : '手续费');
this.balance = options.amount;
this.merchant_id = options.merchant_id;
this.getWalletInfo();
},
methods: {
@ -126,21 +122,24 @@ export default {
});
},
selectTab(index, item) {
console.log("🚀 ~ selectTab ~ item:", item)
this.selectedTab = item.id;
},
//
getWalletInfo() {
//
// 使
console.log('获取钱包信息');
//
// request('/api/wallet/info', 'GET').then(res => {
// if (res.code === 0) {
// this.balance = res.data.balance;
// this.records = res.data.records;
// }
// })
const params = {
merchant_id: this.merchant_id,
}
request(walletApi.walletChangeList, 'POST', params, { silent: false }).then(res => {
let filteredRows = res.rows;
if (this.topVal == '保证金') {
filteredRows = res.rows.filter(item => item.change_category == 5);
} else if (this.topVal == '应收') {
filteredRows = res.rows.filter(item => item.change_category == 2);
} else {
filteredRows = res.rows.filter(item => item.change_category == 3);
}
this.records = filteredRows;
})
}
}
}

View File

@ -17,20 +17,20 @@
<view class="walletBox">
<view class="walletBox_top">钱包</view>
<view class="walletBox_content">
<view class="walletBox_item" @click="goWallet(1)">
<view>999.00</view>
<view class="walletBox_item" @click="goWallet(1, walletInfo.receivable.toFixed(2))">
<view>{{ walletInfo.receivable ? walletInfo.receivable.toFixed(2) : "0.00" }}</view>
<view class="walletBox_item_text">应收</view>
</view>
<view class="walletBox_item" @click="goWallet(2)">
<view>999.00</view>
<view class="walletBox_item" @click="goWallet(2, walletInfo.received.toFixed(2))">
<view>{{ walletInfo.received ? walletInfo.received.toFixed(2) : "0.00" }}</view>
<view class="walletBox_item_text">已收</view>
</view>
<view class="walletBox_item" @click="goWallet(3)">
<view>999.00</view>
<view class="walletBox_item" @click="goWallet(3, walletInfo.pending.toFixed(2))">
<view>{{ walletInfo.pending ? walletInfo.pending.toFixed(2) : "0.00" }}</view>
<view class="walletBox_item_text">待收物业公积金</view>
</view>
<view class="walletBox_item" @click="goWallet(4)">
<view>999.00</view>
<view class="walletBox_item" @click="goWallet(4, walletInfo.handling_fee.toFixed(2))">
<view>{{ walletInfo.handling_fee ? walletInfo.handling_fee.toFixed(2) : "0.00" }}</view>
<view class="walletBox_item_text">手续费</view>
</view>
</view>
@ -64,13 +64,15 @@ import {
} from "../../../utils";
import { apiArr } from "../../../api/community";
import { apiArr as walletApi } from '../../../api/wallet';
export default {
data() {
return {
communityVal: "切换小区",
showWorkOrderSection: false,
communityList: []
communityList: [],
walletInfo: {},
}
},
async onLoad() {
@ -92,6 +94,8 @@ export default {
uni.setStorageSync('changeWorkOrderData', { id: res.rows[0].community_id, name: res.rows[0].name });
this.communityVal = res.rows[0].name;
}
//
this.getWalletInfo();
});
},
async onShow() {
@ -107,12 +111,33 @@ export default {
}
},
methods: {
goWallet(type) {
if (type == 2) {
return
//
getWalletInfo() {
const changeCommData = uni.getStorageSync('changeWorkOrderData');
if (!changeCommData) {
return;
}
NavgateTo('/packages/workOrderDashboard/wallet/index?type=' + type);
const params = {
community_id: changeCommData.id,
}
request(walletApi.walletList, 'POST', params, { silent: false }).then(res => {
this.walletInfo = res;
})
},
goWallet(type, amount) {
const changeCommData = uni.getStorageSync('changeWorkOrderData');
if (!changeCommData) {
uni.showToast({
title: '请先选择小区',
icon: 'none'
});
return;
}
// if (type == 2) {
// return
// }
NavgateTo('/packages/workOrderDashboard/wallet/index?type=' + type + '&community_id=' + changeCommData.id + '&amount=' + amount);
},
addCommunity() {
NavgateTo("/packages/workOrderDashboard/myCommunity/index");
},

View File

@ -25,22 +25,26 @@
<!-- 余额变动记录 -->
<view class="records-container">
<view class="records-title" v-if="topVal == '待收物业公积金'">物业费公积金变动记录</view>
<view class="records-list">
<view v-if="records.length == 0">
<view class="records-list">暂无变动记录</view>
</view>
<view class="records-list" v-else>
<view class="record-item" v-for="(record, index) in records" :key="index">
<view class="record-info">
<view class="record-name">{{ record.name }}</view>
<view class="record-time">{{ record.time }}</view>
<view class="record-name">{{ record.change_reason == 1 ? '下单' : '退单' }} - {{
record.related_order }}</view>
<view class="record-time">{{ record.change_time }}</view>
</view>
<view class="record-amount">
<view class="record-balance" v-if="topVal == '应收'">{{ record.amount.startsWith('+') ? '收款' :
<view class="record-balance" v-if="topVal == '应收' || topVal == '已收'">{{ record.change_reason == 1 ? '收款' :
'退款' }}</view>
<view class="record-balance" v-else-if="topVal == '待收物业公积金'">待收</view>
<view class="record-balance" v-else-if="topVal == '手续费'">手续费</view>
<view>
<text :class="['amount-sign', record.amount.startsWith('+') ? 'positive' : 'negative']">{{
record.amount.startsWith('+') ? '+' : '-' }}</text>
<text :class="['amount-value', record.amount.startsWith('+') ? 'positive' : 'negative']">¥{{
record.amount.replace(/[+-]/, '') }}</text>
<text :class="['amount-sign', record.change_reason == 1 ? 'positive' : 'negative']">{{
record.change_reason == 1 ? '+' : '-' }}</text>
<text :class="['amount-value', record.change_reason == 1 ? 'positive' : 'negative']">¥{{
record.amount_change }}</text>
</view>
</view>
</view>
@ -50,27 +54,17 @@
</template>
<script>
import { menuButtonInfo, NavgateTo, picUrl, request } from '../../../utils/index';
import { apiArr as walletApi } from '../../../api/wallet';
export default {
data() {
return {
top: "",
localHeight: "",
topVal: "",
balance: "160.80",
records: [
{
name: "退单-1312312317972",
time: "2025-08-12 13:00:00",
amount: "-1808.5",
remain: "286.79"
},
{
name: "退单-1312312317972",
time: "2025-08-12 13:00:00",
amount: "-1808.5",
remain: "286.79"
}
]
balance: "",
records: [],
community_id: "",
}
},
onLoad(options) {
@ -78,6 +72,8 @@ export default {
this.top = meun.top;
this.localHeight = meun.height;
this.getTypeName(options.type);
this.balance = options.amount;
this.community_id = options.community_id;
this.getWalletInfo();
},
methods: {
@ -106,16 +102,22 @@ export default {
},
//
getWalletInfo() {
//
// 使
console.log('获取钱包信息');
//
// request('/api/wallet/info', 'GET').then(res => {
// if (res.code === 0) {
// this.balance = res.data.balance;
// this.records = res.data.records;
// }
// })
const params = {
community_id: this.community_id,
}
request(walletApi.walletChangeList, 'POST', params, { silent: false }).then(res => {
let filteredRows = res.rows;
if (this.topVal == '应收') {
filteredRows = res.rows.filter(item => item.change_category == 2);
} else if (this.topVal == '已收') {
filteredRows = res.rows.filter(item => item.change_category == 1);
} else if (this.topVal == '待收物业公积金') {
filteredRows = res.rows.filter(item => item.change_category == 4);
} else {
filteredRows = res.rows.filter(item => item.change_category == 3);
}
this.records = filteredRows;
})
}
}
}