consumer模块完成度95%,检查消费者前端bug并修复
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="share-page" scroll-y>
|
||||
<scroll-view class="share-page" direction="vertical">
|
||||
<view class="share-summary">
|
||||
<view class="summary-item">
|
||||
<text class="summary-value">{{ totalShares }}</text>
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
<view v-else class="share-list">
|
||||
<view class="share-item" v-for="share in shares" :key="share.id" @click="goToShareDetail(share.id)">
|
||||
<image class="product-image" :src="share.product_image || defaultImage" mode="aspectFill" />
|
||||
<image class="product-image" :src="share.product_image != null && share.product_image.length > 0 ? share.product_image : defaultImage" mode="aspectFill" />
|
||||
<view class="share-info">
|
||||
<text class="product-name">{{ share.product_name }}</text>
|
||||
<view class="progress-section">
|
||||
@@ -118,23 +118,26 @@ const loadShares = 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) ?? '',
|
||||
product_id: (itemAny._getValue('product_id') as string) ?? '',
|
||||
product_name: (itemAny._getValue('product_name') as string) ?? '',
|
||||
product_image: itemAny._getValue('product_image') as string | null,
|
||||
product_price: (itemAny._getValue('product_price') as number) ?? 0,
|
||||
share_code: (itemAny._getValue('share_code') as string) ?? '',
|
||||
required_count: (itemAny._getValue('required_count') as number) ?? 4,
|
||||
current_count: (itemAny._getValue('current_count') as number) ?? 0,
|
||||
status: (itemAny._getValue('status') as number) ?? 0,
|
||||
reward_amount: itemAny._getValue('reward_amount') as number | 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') ?? '',
|
||||
product_id: itemObj.getString('product_id') ?? '',
|
||||
product_name: itemObj.getString('product_name') ?? '',
|
||||
product_image: itemObj.getString('product_image'),
|
||||
product_price: itemObj.getNumber('product_price') ?? 0,
|
||||
share_code: itemObj.getString('share_code') ?? '',
|
||||
required_count: itemObj.getNumber('required_count') ?? 4,
|
||||
current_count: itemObj.getNumber('current_count') ?? 0,
|
||||
status: itemObj.getNumber('status') ?? 0,
|
||||
reward_amount: itemObj.getNumber('reward_amount'),
|
||||
created_at: itemObj.getString('created_at') ?? ''
|
||||
})
|
||||
}
|
||||
|
||||
shares.value = parsed
|
||||
|
||||
Reference in New Issue
Block a user