- {{ getLogDeltaSign(row) }}{{ getLogDeltaAbsValue(row) }}
+
+
+
+
+
+
{{ row.ruleName || row.ruleKey || '-' }}
+
{{ row.completed === true ? '已完成' : '未完成' }}
+
+
{{ getRuleDesc(row.ruleKey) }}
+
+ 单次获得 +{{ row.value == null ? 0 : row.value }}
+ 限额 {{ row.maxValue }}
+ 已获得 {{ row.gainedExperience == null ? 0 : row.gainedExperience }}
+
+
{{ rulesDescription }}
-
@@ -92,7 +103,6 @@ const currentGradeId = ref('')
const selectedRuleKey = ref('')
const activeGradeTab = ref('rules')
const logLoading = ref(false)
-const gradeLoading = ref(false)
const params = reactive({
pageNumber: 1,
pageSize: 20
@@ -137,6 +147,15 @@ const diffExperience = computed(() => {
return diff > 0 ? diff : 0
})
+/** 当前经验占下一级所需经验的百分比(无下一级时视为 100%) */
+const progressPercent = computed(() => {
+ if (!nextGrade.value || !nextGrade.value.requiredExperience) return 100
+ const required = Number(nextGrade.value.requiredExperience)
+ if (!required || required <= 0) return 100
+ const percent = Math.round((Number(currentExperience.value || 0) / required) * 100)
+ return Math.min(100, Math.max(0, percent))
+})
+
/** 当前等级在列表详情中对应的启用权益(顺序与后台 benefits 一致) */
const currentGradeBenefits = computed(() => {
const id = currentGradeId.value
@@ -174,7 +193,6 @@ function loadRules () {
}
function loadGradeList () {
- gradeLoading.value = true
memberGradeList()
.then(res => {
if (res && res.success) {
@@ -197,9 +215,6 @@ function loadGradeList () {
gradeList.value = []
}
})
- .finally(() => {
- gradeLoading.value = false
- })
}
function loadCurrent () {
@@ -223,12 +238,6 @@ function loadCurrent () {
})
}
-function selectRule (ruleKey) {
- selectedRuleKey.value = ruleKey || ''
- params.pageNumber = 1
- loadCurrent()
-}
-
function changePage (val) {
params.pageNumber = val
loadCurrent()
@@ -283,30 +292,31 @@ function getLogDeltaAbsValue (row) {
const num = getLogDeltaRaw(row)
return Math.abs(num)
}
-
-function getLogDeltaColor (row) {
- return getLogDeltaRaw(row) >= 0 ? 'green' : 'red'
-}