Merge branch 'aigc' of https://git.nianxx.cn/zoujing/YGChatCS into home3.0
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<view class="ledger-card">
|
||||
<view class="ledger-card-copy">
|
||||
<text class="ledger-title">{{ record.type }}</text>
|
||||
<text class="ledger-task">{{ record.task }}</text>
|
||||
<text class="ledger-time">{{ record.time }}</text>
|
||||
<text class="ledger-title">{{ record.title }}</text>
|
||||
<text class="ledger-task">{{ record.subTitle }}</text>
|
||||
<text class="ledger-time">{{ record.createTime }}</text>
|
||||
</view>
|
||||
|
||||
<text :class="['ledger-delta', isPlus ? 'is-plus' : 'is-minus']">
|
||||
{{ record.delta }}
|
||||
<text class="ledger-delta" :class="{ 'is-plus': isPlus, 'is-minus': isMinus }">
|
||||
{{ changePointsText }}
|
||||
</text>
|
||||
<text class="ledger-status">{{ record.status }}</text>
|
||||
<text class="ledger-status">{{ statusText }}</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -23,7 +23,27 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const isPlus = computed(() => String(props.record.delta || "").startsWith("+"));
|
||||
const changePoints = computed(() => {
|
||||
const value = Number(props.record.changePoints);
|
||||
return Number.isFinite(value) ? value : 0;
|
||||
});
|
||||
|
||||
const changePointsText = computed(() => {
|
||||
return changePoints.value > 0 ? `+${changePoints.value}` : String(changePoints.value);
|
||||
});
|
||||
|
||||
const isPlus = computed(() => changePoints.value > 0);
|
||||
const isMinus = computed(() => changePoints.value < 0);
|
||||
|
||||
const statusText = computed(() => {
|
||||
const statusName = props.record.statusName;
|
||||
if (statusName !== undefined && statusName !== null && statusName !== "") {
|
||||
return statusName;
|
||||
}
|
||||
|
||||
const status = props.record.status;
|
||||
return status === undefined || status === null ? "" : String(status);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
export const pointsLedgerRecords = [
|
||||
{
|
||||
id: "new-user-gift",
|
||||
type: "新用户赠送",
|
||||
task: "试用权益",
|
||||
time: "2026-06-29 09:41:00",
|
||||
delta: "+300",
|
||||
status: "已到账",
|
||||
},
|
||||
{
|
||||
id: "recharge-1000",
|
||||
type: "优惠充值",
|
||||
task: "实付 ¥9.5",
|
||||
time: "2026-06-29 10:18:25",
|
||||
delta: "+1000",
|
||||
status: "已到账",
|
||||
},
|
||||
{
|
||||
id: "video-freeze",
|
||||
type: "动效视频版冻结",
|
||||
task: "鸳鸯湖明信片",
|
||||
time: "2026-06-29 15:45:58",
|
||||
delta: "-200",
|
||||
status: "冻结中",
|
||||
},
|
||||
{
|
||||
id: "video-success",
|
||||
type: "动效视频版成功",
|
||||
task: "鸳鸯湖明信片",
|
||||
time: "2026-06-29 15:46:12",
|
||||
delta: "-200",
|
||||
status: "已扣除",
|
||||
},
|
||||
{
|
||||
id: "video-refund",
|
||||
type: "动效视频版失败退回",
|
||||
task: "卧龙潭旅行成片",
|
||||
time: "2026-06-29 16:05:30",
|
||||
delta: "+200",
|
||||
status: "已退回",
|
||||
},
|
||||
];
|
||||
@@ -1,27 +1,45 @@
|
||||
<template>
|
||||
<view class="points-details-page">
|
||||
<TopNavBar
|
||||
title="积分明细"
|
||||
background="transparent"
|
||||
title-color="#172033"
|
||||
back-icon-color="#172033"
|
||||
:align-with-menu-button="true"
|
||||
:z-index="3"
|
||||
@back="handleBack"
|
||||
/>
|
||||
<z-paging ref="paging" v-model="records" class="points-details-page" bg-color="#effaf5"
|
||||
safe-area-inset-bottom @query="queryList">
|
||||
<template #top>
|
||||
<TopNavBar title="积分明细" background="transparent" title-color="#172033" back-icon-color="#172033"
|
||||
:align-with-menu-button="true" :z-index="3" @back="handleBack" />
|
||||
</template>
|
||||
|
||||
<view class="points-details-content">
|
||||
<LedgerList :records="records" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<template #empty>
|
||||
<CustomEmpty statusText="暂无积分明细" />
|
||||
</template>
|
||||
</z-paging>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import CustomEmpty from "@/components/CustomEmpty/index.vue";
|
||||
import TopNavBar from "@/components/TopNavBar/index.vue";
|
||||
import { getCreditLedgerPage } from "@/request/api/AigcApi.js";
|
||||
import LedgerList from "./components/LedgerList/index.vue";
|
||||
import { pointsLedgerRecords } from "./data/ledger.js";
|
||||
|
||||
const records = pointsLedgerRecords;
|
||||
const records = ref([]);
|
||||
const paging = ref(null);
|
||||
|
||||
const queryList = async (pageNum, pageSize) => {
|
||||
try {
|
||||
const res = await getCreditLedgerPage({ pageNum, pageSize });
|
||||
if (res?.code === 0 && Array.isArray(res.data?.records)) {
|
||||
paging.value?.completeByTotal(res.data.records, Number(res.data.total) || 0);
|
||||
return;
|
||||
}
|
||||
|
||||
paging.value?.complete([]);
|
||||
} catch (error) {
|
||||
console.error("获取积分明细失败", error);
|
||||
paging.value?.complete(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleBack = () => {
|
||||
const pages = getCurrentPages();
|
||||
|
||||
@@ -32,6 +32,10 @@ function rechargeCredit(args) {
|
||||
return request.post("/hotelBiz/credit/recharge", args);
|
||||
}
|
||||
|
||||
function getCreditLedgerPage(args) {
|
||||
return request.post("/hotelBiz/credit/ledger/page", args);
|
||||
}
|
||||
|
||||
export {
|
||||
getAigcTemplateList,
|
||||
getAigcTemplateItemList,
|
||||
@@ -41,4 +45,5 @@ export {
|
||||
getCurrentCredit,
|
||||
getRechargeOptions,
|
||||
rechargeCredit,
|
||||
getCreditLedgerPage,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user