对接个人中心物业费和积分的接口

This commit is contained in:
赵毅 2025-10-08 10:14:37 +08:00
parent 631ef8154e
commit 6f655bed0b
5 changed files with 53 additions and 31 deletions

View File

@ -1,4 +1,6 @@
export const apiArr = {
getUserInfo: '/api/v2/wechat/mpuser-crud/info', // 获取城市列表
userInfoUpdate: '/api/v2/wechat/mpuser-crud/update', // 会员信息更新
getAccumulationFund: '/api/v2/wechat/government-housing-fund-flow-crud/page', // 物业费公积金
getPoints: '/api/v2/wechat/member-points-flow-crud/page', // 积分
}

View File

@ -1,5 +1,5 @@
<template>
<view class="container" @click="headerEnterClick" :data-id="item.community_id":data-name="item.name" >
<view class="container" @click="headerEnterClick" :data-id="item.community_id" :data-name="item.name" >
<image class="left_logo" :src="item.pic" mode="aspectFill" />
<view :class="['right', isLast && 'no_bottom']">
<view class="header">

View File

@ -26,26 +26,36 @@
<view class="records-container">
<view class="records-title">{{ topVal }}变动记录</view>
<view class="records-list">
<view v-if="records.length > 0">
<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 }} - {{
record.community_order_pay ? record.community_order_pay.order_pay_no :
record.quick_payment_record.order_no }}</view>
<view class="record-time">{{ record.create_time }}</view>
</view>
<view class="record-amount">
<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 == '下单' ? 'positive' : 'negative']">{{
record.change_reason == '下单' ? '+' : '-' }}</text>
<text
:class="['amount-value', record.change_reason == '下单' ? 'positive' : 'negative']">¥{{
record.amount_change }}</text>
</view>
<view class="record-balance">:¥{{ record.remain }}</view>
<view class="record-balance">:¥{{ record.balance_after }}</view>
</view>
</view>
</view>
<view v-else>
<view class="no-record">暂无变动记录</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { apiArr } from '../../../api/v2User';
import { menuButtonInfo, NavgateTo, picUrl, request } from '../../../utils/index';
export default {
data() {
@ -54,7 +64,7 @@ export default {
localHeight: "",
topVal: "",
photoVal: '',
balance: "160.80",
balance: "",
records: [
{
name: "退单-1312312317972",
@ -68,7 +78,11 @@ export default {
amount: "-1808.5",
remain: "286.79"
}
]
],
itemObj: {},
itemType: '',
page_num: 1,
page_size: 10,
}
},
onLoad(options) {
@ -77,6 +91,9 @@ export default {
this.localHeight = meun.height;
this.topVal = options.type == 1 ? '积分' : (options.type == 2 ? '物业公积金' : '红包卡券');
this.photoVal = options.type == 1 ? 'http://localhost:8080/user_wallet1.png' : (options.type == 2 ? 'http://localhost:8080/user_wallet2.png' : 'http://localhost:8080/user_wallet3.png');
this.itemObj = JSON.parse(options.item);
this.itemType = options.type;
this.balance = options.type == 1 ? this.itemObj.points : (options.type == 2 ? this.itemObj.property_housing_fund : 0)
this.getWalletInfo();
},
methods: {
@ -87,16 +104,19 @@ 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 = {
page_num: this.page_num,
page_size: this.page_size,
}
if (this.itemType == 1) {
request(apiArr.getPoints, 'POST', params, { silent: false }).then(res => {
this.records = res.rows;
})
} else if (this.itemType == 2) {
request(apiArr.getAccumulationFund, 'POST', params, { silent: false }).then(res => {
this.records = res.rows;
})
}
}
}
}

View File

@ -98,7 +98,7 @@
</view>
<view class="serverList1_right">
<view :class="['serverItemRight', `serverItemRight${index + 1}`]"
@tap="index === 1 ? toAdvertisingView(serverRightList) : headerServerClick(item)"
@tap="index === 0 ? toAdvertisingView(serverRightList) : headerServerClick(item)"
v-for="(item, index) in serverRightList" :key="index">
<image :src="item.pic_src" mode="" />
</view>

View File

@ -24,15 +24,15 @@
</view>
</view>
<view class="section section1">
<view class="section_label" @click="goWallet(1)">
<view>{{ userInfo.property_housing_fund }}</view>
<view class="section_label" @click="goWallet(1,userInfo)">
<view>{{ userInfo.points }}</view>
<view>积分</view>
</view>
<view class="section_label">
<view>0.00</view>
<view>繁华币</view>
</view>
<view class="section_label" @click="goWallet(2)">
<view class="section_label" @click="goWallet(2,userInfo)">
<view>{{ userInfo.property_housing_fund }}</view>
<view>物业费公积金</view>
</view>
@ -267,8 +267,8 @@ export default {
},
methods: {
goWallet(type) {
NavgateTo('/packages/user/wallet/index?type=' + type);
goWallet(type,item) {
NavgateTo('/packages/user/wallet/index?type=' + type + '&item=' + JSON.stringify(item));
},
//
toLogin() {