This commit is contained in:
2025-12-24 17:25:43 +08:00
parent 5840a1022d
commit d34ce070c1
3 changed files with 40 additions and 7 deletions

View File

@@ -310,6 +310,7 @@ const props = defineProps({
default: () => ({})
}
});
const { feature } = toRefs(props);
// Emits
const emit = defineEmits(['submit-success']);
@@ -337,6 +338,7 @@ const loadProductBackground = async (productType) => {
console.warn(`Failed to load background image for ${productType}:`, error);
return null;
}
console.log('Loaded background21:', background);
};
const route = useRoute();
@@ -384,6 +386,7 @@ const getProductBackground = computed(() => productBackground.value);
// 背景图片样式
const backgroundStyle = computed(() => {
console.log('getProductBackground', getProductBackground.value);
if (getProductBackground.value) {
return {
backgroundImage: `url(${getProductBackground.value})`,
@@ -670,12 +673,12 @@ const toHistory = () => {
// 生命周期
onMounted(async () => {
await loadBackgroundImage();
await loadTrapezoidBackground();
});
// 加载背景图片
const loadBackgroundImage = async () => {
console.log('加载背景图片:s111s', props.feature);
const background = await loadProductBackground(props.feature);
productBackground.value = background || '';
};
@@ -685,6 +688,10 @@ onUnmounted(() => {
clearInterval(timer);
}
});
watch(feature, async () => {
await loadBackgroundImage();
await loadTrapezoidBackground();
});
</script>
<style scoped>

View File

@@ -4,16 +4,25 @@
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
<div v-for="(item, index) in data.list" :key="index" class="mx-4 my-2 bg-white rounded-lg p-4 shadow-sm">
<div class="flex justify-between items-center mb-2">
<span class="text-gray-500 text-sm">{{ item.create_time || '-' }}</span>
<span class="text-green-500 font-bold">+{{ item.amount.toFixed(2) }}</span>
</div>
<div class="flex items-center">
<!-- 修改点 1: 使用 desen 函数处理 mobile -->
<span class="text-gray-500 text-sm">{{ desen(item.query_params.mobile, 'mobile') || '-' }}</span>
<span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium"
:class="getReportTypeStyle(item.product_name)">
<span class="w-2 h-2 rounded-full mr-1" :class="getDotColor(item.product_name)"></span>
{{ item.product_name }}
</span>
</div>
<div class="flex items-center">
<h4>直接收益</h4>
<span class="text-green-500 font-bold">+{{ item.amount.toFixed(2) }}</span>
</div>
<div class="flex items-center">
<!-- 修改点 2: 使用 desen 函数处理 name -->
<span class="text-gray-500 text-sm">{{ desen(item.query_params.name) || '-' }}</span>
</div>
<div class="flex justify-between items-center mb-2">
<span class="text-gray-500 text-sm">{{ item.create_time || '-' }}</span>
</div>
</div>
</van-list>
</div>
@@ -34,6 +43,24 @@ const typeColors = {
'default': { bg: 'bg-gray-100', text: 'text-gray-800', dot: 'bg-gray-500' }
}
// 新增点 4: 定义脱敏函数
const desen = (value, type) => {
// 如果值是空,直接返回空字符串,让外层的 || '-' 生效
if (!value) {
return '';
}
// 根据类型进行不同的替换
switch (type) {
case 'mobile': // 手机号保留前3位和后4位中间4位替换为 ****
return value.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2');
case 'id_card':// 身份证保留前6位和后1位中间替换为 ********
return value.replace(/^(.{6}).*(.{1})$/, '$1********$2');
default:
return value; // 其他类型不处理
}
};
const page = ref(1)
const pageSize = ref(10)
const data = ref({

View File

@@ -152,7 +152,6 @@ const toBigData = () => {
</div>
</div>
</div>
<div class="relative p-4 pt-0">
<div class="grid grid-cols-2 gap-4 my-4" style="grid-template-rows: repeat(2, 1fr);">