f
This commit is contained in:
@@ -200,6 +200,16 @@ onMounted(async () => {
|
||||
postersGenerated.value = Array(posterImages.value.length).fill(false);
|
||||
});
|
||||
|
||||
// linkIdentifier 变化时重置海报缓存,避免继续复用旧二维码
|
||||
watch(linkIdentifier, () => {
|
||||
postersGenerated.value = Array(posterImages.value.length).fill(false);
|
||||
if (show.value) {
|
||||
nextTick(() => {
|
||||
generatePoster(currentIndex.value);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 生成海报并合成二维码
|
||||
const generatePoster = async (index) => {
|
||||
// 如果已经生成过海报,就直接返回
|
||||
|
||||
@@ -100,8 +100,8 @@ const getDotColor = (name) => {
|
||||
|
||||
// 获取金额颜色
|
||||
const getAmountColor = (item) => {
|
||||
// 如果净佣金为0或状态为已退款,显示红色
|
||||
if (item.net_amount <= 0 || item.status === 2) {
|
||||
// 状态为已退款,显示红色
|
||||
if (item.status === 2) {
|
||||
return 'text-red-500'
|
||||
}
|
||||
// 如果有部分退款,显示橙色
|
||||
@@ -114,7 +114,7 @@ const getAmountColor = (item) => {
|
||||
|
||||
// 获取金额前缀(+ 或 -)
|
||||
const getAmountPrefix = (item) => {
|
||||
if (item.net_amount <= 0 || item.status === 2) {
|
||||
if (item.status === 2) {
|
||||
return '-'
|
||||
}
|
||||
return '+'
|
||||
@@ -122,7 +122,7 @@ const getAmountPrefix = (item) => {
|
||||
|
||||
// 获取状态文本
|
||||
const getStatusText = (item) => {
|
||||
if (item.status === 2 || item.net_amount <= 0) {
|
||||
if (item.status === 2) {
|
||||
return '已退款'
|
||||
}
|
||||
if (item.status === 1) {
|
||||
@@ -144,7 +144,7 @@ const getStatusText = (item) => {
|
||||
|
||||
// 获取状态样式
|
||||
const getStatusStyle = (item) => {
|
||||
if (item.status === 2 || item.net_amount <= 0) {
|
||||
if (item.status === 2) {
|
||||
return 'bg-red-100 text-red-800'
|
||||
}
|
||||
if (item.status === 1) {
|
||||
|
||||
@@ -64,6 +64,10 @@ const formatNumber = num => {
|
||||
return Number(num).toFixed(2)
|
||||
}
|
||||
|
||||
const getLevelText = item => {
|
||||
return item?.level_name || item?.level || '普通'
|
||||
}
|
||||
|
||||
// 获取等级标签样式
|
||||
const getLevelClass = level => {
|
||||
switch (level) {
|
||||
@@ -117,8 +121,8 @@ onMounted(() => {
|
||||
{{ index + 1 }}
|
||||
</div>
|
||||
<div class="text-xl font-semibold text-gray-800">{{ item.mobile }}</div>
|
||||
<span :class="['px-3 py-1 rounded-full text-sm font-medium', getLevelClass(item.level)]">
|
||||
{{ item.level ? item.level : '普通' }}代理
|
||||
<span :class="['px-3 py-1 rounded-full text-sm font-medium', getLevelClass(getLevelText(item))]">
|
||||
{{ getLevelText(item) }}代理
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user