consumer模块完成度95%,检查消费者前端bug并修复

This commit is contained in:
cyh666666
2026-03-09 17:20:59 +08:00
parent 7b5801a72b
commit 2262d1bfd9
128 changed files with 13485 additions and 1670 deletions

View File

@@ -1,7 +1,7 @@
<template>
<scroll-view class="share-detail-page" scroll-y>
<scroll-view class="share-detail-page" direction="vertical">
<view class="product-section">
<image class="product-image" :src="shareRecord.product_image || defaultImage" mode="aspectFill" />
<image class="product-image" :src="shareRecord.product_image != null && shareRecord.product_image.length > 0 ? shareRecord.product_image : defaultImage" mode="aspectFill" />
<view class="product-info">
<text class="product-name">{{ shareRecord.product_name }}</text>
<text class="product-price">¥{{ shareRecord.product_price }}</text>
@@ -144,21 +144,25 @@ const loadShareDetail = async (): Promise<void> => {
const recordRaw = result.get('share_record')
if (recordRaw != null) {
const recordAny = recordRaw as any
if (typeof recordAny._getValue === 'function') {
shareRecord.value = {
id: (recordAny._getValue('id') as string) ?? '',
product_name: (recordAny._getValue('product_name') as string) ?? '',
product_image: recordAny._getValue('product_image') as string | null,
product_price: (recordAny._getValue('product_price') as number) ?? 0,
share_code: (recordAny._getValue('share_code') as string) ?? '',
required_count: (recordAny._getValue('required_count') as number) ?? 4,
current_count: (recordAny._getValue('current_count') as number) ?? 0,
status: (recordAny._getValue('status') as number) ?? 0,
reward_amount: recordAny._getValue('reward_amount') as number | null,
created_at: (recordAny._getValue('created_at') as string) ?? '',
completed_at: recordAny._getValue('completed_at') as string | null
}
let recordObj: UTSJSONObject | null = null
if (recordRaw instanceof UTSJSONObject) {
recordObj = recordRaw
} else {
recordObj = JSON.parse(JSON.stringify(recordRaw)) as UTSJSONObject
}
shareRecord.value = {
id: recordObj.getString('id') ?? '',
product_name: recordObj.getString('product_name') ?? '',
product_image: recordObj.getString('product_image'),
product_price: recordObj.getNumber('product_price') ?? 0,
share_code: recordObj.getString('share_code') ?? '',
required_count: recordObj.getNumber('required_count') ?? 4,
current_count: recordObj.getNumber('current_count') ?? 0,
status: recordObj.getNumber('status') ?? 0,
reward_amount: recordObj.getNumber('reward_amount'),
created_at: recordObj.getString('created_at') ?? '',
completed_at: recordObj.getString('completed_at')
}
}
@@ -169,17 +173,20 @@ const loadShareDetail = async (): Promise<void> => {
for (let i = 0; i < arr.length; i++) {
const item = arr[i]
const itemAny = item as any
if (typeof itemAny._getValue === 'function') {
parsed.push({
id: (itemAny._getValue('id') as string) ?? '',
buyer_id: (itemAny._getValue('buyer_id') as string) ?? '',
buyer_name: '用户' + (i + 1),
quantity: (itemAny._getValue('quantity') as number) ?? 1,
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') ?? '',
buyer_id: itemObj.getString('buyer_id') ?? '',
buyer_name: '用户' + (i + 1),
quantity: itemObj.getNumber('quantity') ?? 1,
created_at: itemObj.getString('created_at') ?? ''
})
}
buyers.value = parsed
@@ -368,7 +375,7 @@ onMounted(() => {
.progress-numbers {
display: flex;
flex-direction: row;
align-items: baseline;
align-items: center;
margin-left: 12px;
}