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