consumer模块完成度95%,检查消费者前端bug并修复
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
</view>
|
||||
<view class="level-detail">
|
||||
<text class="level-title">{{ level.name }}</text>
|
||||
<text class="level-condition">{{ level.description || ('累计消费' + level.min_amount + '元') }}</text>
|
||||
<text class="level-condition">{{ level.description != null && level.description != '' ? level.description : ('累计消费' + level.min_amount + '元') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="level-right">
|
||||
@@ -166,15 +166,18 @@ const loadMemberInfo = async (): Promise<void> => {
|
||||
|
||||
const nextLevelRaw = result.get('next_level')
|
||||
if (nextLevelRaw != null) {
|
||||
const nextLevelAny = nextLevelRaw as any
|
||||
if (typeof nextLevelAny._getValue === 'function') {
|
||||
memberInfo.value.next_level = {
|
||||
id: (nextLevelAny._getValue('id') as number) ?? 0,
|
||||
name: (nextLevelAny._getValue('name') as string) ?? '',
|
||||
min_amount: (nextLevelAny._getValue('min_amount') as number) ?? 0,
|
||||
discount: 1.0,
|
||||
description: null
|
||||
}
|
||||
let nextLevelObj: UTSJSONObject | null = null
|
||||
if (nextLevelRaw instanceof UTSJSONObject) {
|
||||
nextLevelObj = nextLevelRaw
|
||||
} else {
|
||||
nextLevelObj = JSON.parse(JSON.stringify(nextLevelRaw)) as UTSJSONObject
|
||||
}
|
||||
memberInfo.value.next_level = {
|
||||
id: nextLevelObj.getNumber('id') ?? 0,
|
||||
name: nextLevelObj.getString('name') ?? '',
|
||||
min_amount: nextLevelObj.getNumber('min_amount') ?? 0,
|
||||
discount: 1.0,
|
||||
description: null
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -189,17 +192,20 @@ const loadLevels = async (): Promise<void> => {
|
||||
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
const item = result[i]
|
||||
const itemAny = item as any
|
||||
|
||||
if (typeof itemAny._getValue === 'function') {
|
||||
parsed.push({
|
||||
id: (itemAny._getValue('id') as number) ?? 0,
|
||||
name: (itemAny._getValue('name') as string) ?? '',
|
||||
min_amount: (itemAny._getValue('min_amount') as number) ?? 0,
|
||||
discount: (itemAny._getValue('discount') as number) ?? 1.0,
|
||||
description: itemAny._getValue('description') as string | null
|
||||
})
|
||||
let itemObj: UTSJSONObject | null = null
|
||||
if (item instanceof UTSJSONObject) {
|
||||
itemObj = item
|
||||
} else {
|
||||
itemObj = JSON.parse(JSON.stringify(item)) as UTSJSONObject
|
||||
}
|
||||
|
||||
parsed.push({
|
||||
id: itemObj.getNumber('id') ?? 0,
|
||||
name: itemObj.getString('name') ?? '',
|
||||
min_amount: itemObj.getNumber('min_amount') ?? 0,
|
||||
discount: itemObj.getNumber('discount') ?? 1.0,
|
||||
description: itemObj.getString('description')
|
||||
})
|
||||
}
|
||||
|
||||
levels.value = parsed
|
||||
@@ -216,17 +222,20 @@ const loadLogs = async (): Promise<void> => {
|
||||
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
const item = result[i]
|
||||
const itemAny = item as any
|
||||
|
||||
if (typeof itemAny._getValue === 'function') {
|
||||
parsed.push({
|
||||
id: (itemAny._getValue('id') as string) ?? '',
|
||||
old_level: (itemAny._getValue('old_level') as number) ?? 0,
|
||||
new_level: (itemAny._getValue('new_level') as number) ?? 0,
|
||||
reason: itemAny._getValue('reason') as string | null,
|
||||
created_at: (itemAny._getValue('created_at') as string) ?? ''
|
||||
})
|
||||
let itemObj: UTSJSONObject | null = null
|
||||
if (item instanceof UTSJSONObject) {
|
||||
itemObj = item
|
||||
} else {
|
||||
itemObj = JSON.parse(JSON.stringify(item)) as UTSJSONObject
|
||||
}
|
||||
|
||||
parsed.push({
|
||||
id: itemObj.getString('id') ?? '',
|
||||
old_level: itemObj.getNumber('old_level') ?? 0,
|
||||
new_level: itemObj.getNumber('new_level') ?? 0,
|
||||
reason: itemObj.getString('reason'),
|
||||
created_at: itemObj.getString('created_at') ?? ''
|
||||
})
|
||||
}
|
||||
|
||||
logs.value = parsed
|
||||
|
||||
Reference in New Issue
Block a user