2025-10-18 16:57:36 +08:00

117 lines
5.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view>
<view class="header">
<view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
<view class="searchBox_left" @click="back">
<u-icon name="arrow-left" size="20px" color="#000"></u-icon>
</view>
<view class="searchBox_mid">{{ topVal }}</view>
</view>
</view>
<!-- 余额显示部分 -->
<view class="balance-container">
<view class="balance-content">
<view>
<view class="balance-title">{{ topVal }}余额</view>
<view class="balance-amount">{{ balance }}</view>
<view class="balance-icon">
<image :src="photoVal" mode="widthFix" />
</view>
</view>
</view>
</view>
<!-- 余额变动记录 -->
<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" v-if="topVal == '积分'">{{ record.change_reason }} - {{
record.community_order_pay ? record.community_order_pay.order_pay_no :
record.quick_payment_record.order_no }}</view>
<view class="record-name" v-else>{{ record.change_reason }} - {{ record.related_order }}</view>
<view class="record-time">{{ record.create_time }}</view>
</view>
<view class="record-amount">
<view>
<text
:class="['amount-sign', record.change_reason == '下单' ? 'positive' : 'negative']">{{
record.change_reason == '下单' ? '+' : '-' }}</text>
<text v-if="topVal == '积分'"
:class="['amount-value', record.change_reason == '下单' ? 'positive' : 'negative']">¥{{
record.change_value }}</text>
<text v-else
:class="['amount-value', record.change_reason == '下单' ? 'positive' : 'negative']">¥{{
record.amount_change }}</text>
</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() {
return {
top: "",
localHeight: "",
topVal: "",
photoVal: '',
balance: "",
records: [],
itemObj: {},
itemType: '',
page_num: 1,
page_size: 10,
}
},
onLoad(options) {
const meun = menuButtonInfo();
this.top = meun.top;
this.localHeight = meun.height;
this.topVal = options.type == 1 ? '积分' : (options.type == 2 ? '物业费' : '红包卡券');
this.photoVal = options.type == 1 ? 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com//user_wallet1.png' : (options.type == 2 ? 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com//user_wallet2.png' : 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com//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: {
back() {
uni.navigateBack({
delta: 1
});
},
// 获取钱包信息
getWalletInfo() {
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;
})
}
}
}
}
</script>
<style>
@import url("./index.css");
</style>