实现服务页面接入
This commit is contained in:
767
components/home/HomeMallContent.uvue
Normal file
767
components/home/HomeMallContent.uvue
Normal file
@@ -0,0 +1,767 @@
|
||||
<template>
|
||||
<view class="hmall-content">
|
||||
<view v-if="currentCategory != 'recommend' && secondaryCategoryDisplay.length > 0" class="hmall-secondary-panel">
|
||||
<view
|
||||
v-for="(item, index) in secondaryCategoryDisplay"
|
||||
:key="item.id + '-' + index"
|
||||
:class="['hmall-secondary-item', selectedSubCategoryId == item.id ? 'hmall-secondary-item-active' : '']"
|
||||
@click="emit('secondary-category-click', item)"
|
||||
>
|
||||
<view class="hmall-secondary-icon-wrap">
|
||||
<image v-if="isImageIcon(item.icon)" class="hmall-secondary-image" :src="item.icon" mode="aspectFill" />
|
||||
<text v-else class="hmall-secondary-icon-text">{{ getCategoryDisplayIcon(item) }}</text>
|
||||
</view>
|
||||
<text class="hmall-secondary-name">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="currentCategory == 'recommend' && marketingChannels.length > 0" class="hmall-recommend-section">
|
||||
<view
|
||||
v-for="(channel, index) in marketingChannels"
|
||||
:key="channel.id + '-' + index"
|
||||
class="hmall-recommend-card"
|
||||
:style="{ backgroundColor: channel.bgColor }"
|
||||
@click="emit('select-channel', channel)"
|
||||
>
|
||||
<view class="hmall-recommend-header">
|
||||
<view class="hmall-recommend-title-row">
|
||||
<text class="hmall-recommend-title">{{ channel.title }}</text>
|
||||
<text class="hmall-recommend-badge" :style="{ color: channel.themeColor, borderColor: channel.themeColor }">{{ channel.badge }}</text>
|
||||
</view>
|
||||
<text class="hmall-recommend-subtitle">{{ channel.subtitle }}</text>
|
||||
</view>
|
||||
<view class="hmall-recommend-products">
|
||||
<view
|
||||
v-for="(product, pIndex) in channel.products"
|
||||
:key="product.id + '-' + pIndex"
|
||||
class="hmall-recommend-product"
|
||||
>
|
||||
<image class="hmall-recommend-product-image" :src="getChannelProductImage(product)" mode="aspectFill" />
|
||||
<text class="hmall-recommend-product-name">{{ product.shortName }}</text>
|
||||
<view class="hmall-recommend-price-row">
|
||||
<text class="hmall-recommend-product-tag" :style="{ color: channel.themeColor }">{{ product.tag }}</text>
|
||||
<text class="hmall-recommend-product-price" :style="{ color: channel.themeColor }">¥{{ formatChannelPrice(product.price) }}</text>
|
||||
</view>
|
||||
<text v-if="product.marketPrice > product.price" class="hmall-recommend-market-price">¥{{ formatChannelPrice(product.marketPrice) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-else-if="currentCategory != 'recommend' && categorySimpleChannels.length > 0" class="hmall-simple-section">
|
||||
<view
|
||||
v-for="(channel, index) in categorySimpleChannels"
|
||||
:key="channel.id + '-' + index"
|
||||
:class="['hmall-simple-card', index == 0 ? 'hmall-simple-card-with-divider' : '']"
|
||||
@click="emit('select-simple-channel', channel)"
|
||||
>
|
||||
<view class="hmall-simple-left">
|
||||
<view class="hmall-simple-title-row">
|
||||
<text class="hmall-simple-icon">{{ channel.icon }}</text>
|
||||
<text class="hmall-simple-title">{{ channel.title }}</text>
|
||||
</view>
|
||||
<text class="hmall-simple-subtitle">{{ channel.subtitle }}</text>
|
||||
</view>
|
||||
<view class="hmall-simple-cover-wrap">
|
||||
<view v-for="(cover, coverIndex) in channel.coverImages" :key="channel.id + '-cover-' + coverIndex" class="hmall-simple-cover-slot">
|
||||
<image v-if="isImageIcon(cover)" class="hmall-simple-cover-image" :src="cover" mode="aspectFill" />
|
||||
<view v-else class="hmall-simple-cover-fallback">
|
||||
<text class="hmall-simple-cover-text">{{ cover }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="hmall-feed-divider"></view>
|
||||
|
||||
<view v-if="hotProducts.length > 0" class="hmall-products-grid hmall-products-grid-dense">
|
||||
<view
|
||||
v-for="(product, index) in hotProducts"
|
||||
:key="product.id + '-' + index"
|
||||
class="hmall-product-card hmall-product-card-skeleton"
|
||||
@click="emit('select-product', product)"
|
||||
>
|
||||
<view class="hmall-product-image-wrapper hmall-product-image-wrapper-fixed">
|
||||
<image
|
||||
class="hmall-product-image"
|
||||
:src="getProductCover(product)"
|
||||
@error="() => handleProductImageError(product.id)"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
</view>
|
||||
<view class="hmall-product-body">
|
||||
<view v-if="getProductCardTags(product).length > 0" class="hmall-product-card-tags">
|
||||
<text
|
||||
v-for="(tag, tagIndex) in getProductCardTags(product)"
|
||||
:key="product.id + '-card-tag-' + tagIndex"
|
||||
class="hmall-product-card-tag"
|
||||
>
|
||||
{{ tag }}
|
||||
</text>
|
||||
</view>
|
||||
<text class="hmall-product-title">{{ getProductTitle(product) }}</text>
|
||||
<text v-if="getProductHighlight(product) != ''" class="hmall-product-highlight">{{ getProductHighlight(product) }}</text>
|
||||
<view v-if="getProductServiceTags(product).length > 0" class="hmall-product-service-tags">
|
||||
<text
|
||||
v-for="(tag, tagIndex) in getProductServiceTags(product)"
|
||||
:key="product.id + '-service-tag-' + tagIndex"
|
||||
class="hmall-product-service-tag"
|
||||
>
|
||||
{{ tag }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="hmall-product-price-row">
|
||||
<text class="hmall-product-price-value">¥{{ formatProductPrice(product) }}</text>
|
||||
<text v-if="showMarketPrice(product)" class="hmall-product-market-price">¥{{ formatMarketPrice(product) }}</text>
|
||||
</view>
|
||||
<text v-if="getProductSalesText(product) != ''" class="hmall-product-sales">{{ getProductSalesText(product) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-else-if="loading" class="hmall-loading-state">
|
||||
<text class="hmall-loading-text">正在加载商品...</text>
|
||||
</view>
|
||||
|
||||
<EmptyState v-else text="当前分类暂无商品"></EmptyState>
|
||||
|
||||
<view v-if="loading || showLoadMore" class="hmall-load-more-status">
|
||||
<text class="hmall-loading-text">正在加载更多商品...</text>
|
||||
</view>
|
||||
|
||||
<view v-if="!hasMore && hotProducts.length > 0" class="hmall-feed-end-state">
|
||||
<text class="hmall-feed-end-text">已经到底了</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import EmptyState from '@/components/consumer/EmptyState.uvue'
|
||||
import type { Category, Product } from '@/utils/supabaseService.uts'
|
||||
import type { MarketingChannel, ChannelProduct, SimpleCategoryChannel } from '@/utils/mockChannelData.uts'
|
||||
|
||||
const failedProductImageIds = ref<string[]>([])
|
||||
|
||||
const props = defineProps({
|
||||
currentCategory: {
|
||||
type: String,
|
||||
default: 'recommend'
|
||||
},
|
||||
selectedSubCategoryId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
secondaryCategoryDisplay: {
|
||||
type: Array<Category>,
|
||||
default: [] as Array<Category>
|
||||
},
|
||||
marketingChannels: {
|
||||
type: Array<MarketingChannel>,
|
||||
default: [] as Array<MarketingChannel>
|
||||
},
|
||||
categorySimpleChannels: {
|
||||
type: Array<SimpleCategoryChannel>,
|
||||
default: [] as Array<SimpleCategoryChannel>
|
||||
},
|
||||
hotProducts: {
|
||||
type: Array<Product>,
|
||||
default: [] as Array<Product>
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
hasMore: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
showLoadMore: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'secondary-category-click', category: Category): void
|
||||
(e: 'select-channel', channel: MarketingChannel): void
|
||||
(e: 'select-simple-channel', channel: SimpleCategoryChannel): void
|
||||
(e: 'select-product', product: Product): void
|
||||
}>()
|
||||
|
||||
function isImageIcon(icon: string): boolean {
|
||||
if (icon == '') {
|
||||
return false
|
||||
}
|
||||
return icon.indexOf('http') == 0 || icon.indexOf('/') == 0
|
||||
}
|
||||
|
||||
function getCategoryDisplayIcon(category: Category): string {
|
||||
const icon = category.icon ?? ''
|
||||
if (icon != '' && !isImageIcon(icon)) {
|
||||
return icon
|
||||
}
|
||||
const name = category.name ?? ''
|
||||
return name != '' ? name.substring(0, 1) : '品'
|
||||
}
|
||||
|
||||
function getChannelProductImage(product: ChannelProduct): string {
|
||||
return product.image != '' ? product.image : '/static/images/default.png'
|
||||
}
|
||||
|
||||
function formatChannelPrice(price: number): string {
|
||||
const rounded = Math.round(price)
|
||||
if (Math.abs(price - rounded) < 0.001) {
|
||||
return rounded.toString()
|
||||
}
|
||||
return price.toFixed(1)
|
||||
}
|
||||
|
||||
function getProductCover(product: Product): string {
|
||||
if (failedProductImageIds.value.indexOf(product.id) != -1) {
|
||||
return '/static/images/default.png'
|
||||
}
|
||||
if (product.main_image_url != null && product.main_image_url != '') {
|
||||
return product.main_image_url
|
||||
}
|
||||
if (product.images != null && product.images.length > 0 && product.images[0] != '') {
|
||||
return product.images[0]
|
||||
}
|
||||
if (product.image_url != null && product.image_url != '') {
|
||||
return product.image_url
|
||||
}
|
||||
return '/static/images/default.png'
|
||||
}
|
||||
|
||||
function handleProductImageError(productId: string): void {
|
||||
if (productId == '') {
|
||||
return
|
||||
}
|
||||
if (failedProductImageIds.value.indexOf(productId) == -1) {
|
||||
failedProductImageIds.value.push(productId)
|
||||
}
|
||||
}
|
||||
|
||||
function getProductTitle(product: Product): string {
|
||||
if (product.short_title != null && product.short_title != '') {
|
||||
return product.short_title
|
||||
}
|
||||
if (product.name != null && product.name != '') {
|
||||
return product.name
|
||||
}
|
||||
return product.id
|
||||
}
|
||||
|
||||
function getProductCardTags(product: Product): string[] {
|
||||
if (product.card_tags != null && product.card_tags.length > 0) {
|
||||
return product.card_tags.slice(0, 2)
|
||||
}
|
||||
const fallback: string[] = []
|
||||
if (product.is_hot == true) fallback.push('热卖')
|
||||
if (product.is_new == true && fallback.length < 2) fallback.push('新品')
|
||||
if (product.is_featured == true && fallback.length < 2) fallback.push('精选')
|
||||
return fallback
|
||||
}
|
||||
|
||||
function getProductServiceTags(product: Product): string[] {
|
||||
if (product.service_tags != null && product.service_tags.length > 0) {
|
||||
return product.service_tags.slice(0, 3)
|
||||
}
|
||||
return [] as string[]
|
||||
}
|
||||
|
||||
function getProductHighlight(product: Product): string {
|
||||
if (product.selling_points != null && product.selling_points.length > 0 && product.selling_points[0] != '') {
|
||||
return product.selling_points[0]
|
||||
}
|
||||
if (product.subtitle != null && product.subtitle != '') {
|
||||
return product.subtitle
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
function formatSaleCountText(saleCount: number): string {
|
||||
if (saleCount >= 100000) return '已售10万+'
|
||||
if (saleCount >= 10000) return '已售' + (saleCount / 10000).toFixed(1) + '万件'
|
||||
if (saleCount > 0) return '已售' + saleCount.toString() + '件'
|
||||
return ''
|
||||
}
|
||||
|
||||
function getProductSalesText(product: Product): string {
|
||||
if (product.display_sales_text != null && product.display_sales_text != '') {
|
||||
return product.display_sales_text
|
||||
}
|
||||
const saleCount = product.sale_count ?? 0
|
||||
return formatSaleCountText(saleCount)
|
||||
}
|
||||
|
||||
function formatProductPrice(product: Product): string {
|
||||
const price = product.base_price ?? product.price ?? 0
|
||||
return parseFloat(price.toString()).toFixed(2)
|
||||
}
|
||||
|
||||
function formatMarketPrice(product: Product): string {
|
||||
const price = product.market_price ?? product.original_price ?? 0
|
||||
return parseFloat(price.toString()).toFixed(2)
|
||||
}
|
||||
|
||||
function showMarketPrice(product: Product): boolean {
|
||||
const marketPrice = product.market_price ?? product.original_price ?? 0
|
||||
const salePrice = product.base_price ?? product.price ?? 0
|
||||
return marketPrice > 0 && marketPrice > salePrice
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.hmall-content {
|
||||
padding: 0 20rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.hmall-secondary-panel {
|
||||
margin-top: 16rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
padding: 18rpx 12rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
gap: 12rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.hmall-secondary-item {
|
||||
width: 124rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 16rpx 8rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #f7f7f7;
|
||||
gap: 10rpx;
|
||||
}
|
||||
|
||||
.hmall-secondary-item-active {
|
||||
background: #fff2f2;
|
||||
}
|
||||
|
||||
.hmall-secondary-icon-wrap {
|
||||
width: 68rpx;
|
||||
height: 68rpx;
|
||||
border-radius: 34rpx;
|
||||
background: #ffffff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.hmall-secondary-image {
|
||||
width: 68rpx;
|
||||
height: 68rpx;
|
||||
border-radius: 34rpx;
|
||||
}
|
||||
|
||||
.hmall-secondary-icon-text {
|
||||
font-size: 28rpx;
|
||||
color: #e2231a;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.hmall-secondary-name {
|
||||
font-size: 22rpx;
|
||||
color: #333333;
|
||||
line-height: 1.2;
|
||||
text-align: center;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.hmall-recommend-section {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
padding: 8rpx 0 18rpx;
|
||||
}
|
||||
|
||||
.hmall-recommend-card {
|
||||
width: 49%;
|
||||
border-radius: 22rpx;
|
||||
padding: 16rpx;
|
||||
min-height: 236rpx;
|
||||
margin-bottom: 14rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0 3rpx 12rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.hmall-recommend-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.hmall-recommend-title-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.hmall-recommend-title {
|
||||
font-size: 30rpx;
|
||||
color: #202020;
|
||||
font-weight: 800;
|
||||
line-height: 1.2;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.hmall-recommend-badge {
|
||||
font-size: 18rpx;
|
||||
border-width: 1rpx;
|
||||
border-style: solid;
|
||||
border-radius: 6rpx;
|
||||
padding: 2rpx 6rpx;
|
||||
line-height: 1.2;
|
||||
background: rgba(255, 255, 255, 0.72);
|
||||
}
|
||||
|
||||
.hmall-recommend-subtitle {
|
||||
font-size: 22rpx;
|
||||
color: #777777;
|
||||
margin-top: 6rpx;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.hmall-recommend-products {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.hmall-recommend-product {
|
||||
width: 48%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.hmall-recommend-product-image {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 12rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.hmall-recommend-product-name {
|
||||
margin-top: 6rpx;
|
||||
font-size: 20rpx;
|
||||
color: #333333;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.hmall-recommend-price-row {
|
||||
margin-top: 4rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.hmall-recommend-product-tag {
|
||||
font-size: 18rpx;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.hmall-recommend-product-price {
|
||||
font-size: 23rpx;
|
||||
font-weight: 800;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.hmall-recommend-market-price {
|
||||
margin-top: 4rpx;
|
||||
font-size: 18rpx;
|
||||
color: #999999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.hmall-simple-section {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.hmall-simple-card {
|
||||
width: 49%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding: 22rpx 18rpx;
|
||||
min-height: 148rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 22rpx;
|
||||
box-shadow: 0 3rpx 12rpx rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
|
||||
.hmall-simple-card-with-divider {
|
||||
border-right-width: 0;
|
||||
}
|
||||
|
||||
.hmall-simple-left {
|
||||
flex: 1;
|
||||
padding-right: 12rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.hmall-simple-title-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.hmall-simple-icon {
|
||||
font-size: 24rpx;
|
||||
line-height: 1;
|
||||
color: #202020;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
|
||||
.hmall-simple-title {
|
||||
font-size: 30rpx;
|
||||
line-height: 1.2;
|
||||
color: #202020;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.hmall-simple-subtitle {
|
||||
font-size: 22rpx;
|
||||
line-height: 1.2;
|
||||
color: #a0a0a0;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.hmall-simple-cover-wrap {
|
||||
width: 116rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.hmall-simple-cover-slot {
|
||||
width: 54rpx;
|
||||
height: 54rpx;
|
||||
border-radius: 14rpx;
|
||||
overflow: hidden;
|
||||
background: #f5f5f5;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.hmall-simple-cover-image {
|
||||
width: 54rpx;
|
||||
height: 54rpx;
|
||||
border-radius: 14rpx;
|
||||
}
|
||||
|
||||
.hmall-simple-cover-fallback {
|
||||
width: 54rpx;
|
||||
height: 54rpx;
|
||||
border-radius: 14rpx;
|
||||
background: #f5f5f5;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.hmall-simple-cover-text {
|
||||
font-size: 22rpx;
|
||||
line-height: 1;
|
||||
color: #555555;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.hmall-feed-divider {
|
||||
height: 20rpx;
|
||||
background: #f3f4f6;
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.hmall-products-grid {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
margin-top: 0;
|
||||
min-height: 0;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.hmall-product-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
border-radius: 18rpx;
|
||||
overflow: hidden;
|
||||
width: 49%;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.hmall-products-grid-dense .hmall-product-card {
|
||||
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.hmall-product-image-wrapper {
|
||||
width: 100%;
|
||||
padding-bottom: 100%;
|
||||
position: relative;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.hmall-product-image {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 18rpx 18rpx 0 0;
|
||||
}
|
||||
|
||||
.hmall-product-image-wrapper-fixed {
|
||||
padding-bottom: 100%;
|
||||
background: #f2f2f2;
|
||||
}
|
||||
|
||||
.hmall-product-card-skeleton {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.hmall-product-body {
|
||||
padding: 14rpx 14rpx 16rpx;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.hmall-product-card-tags {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.hmall-product-card-tag {
|
||||
height: 28rpx;
|
||||
line-height: 28rpx;
|
||||
padding: 0 8rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 18rpx;
|
||||
font-weight: 700;
|
||||
color: #fff7d1;
|
||||
background: #e1251b;
|
||||
margin-right: 6rpx;
|
||||
margin-bottom: 4rpx;
|
||||
}
|
||||
|
||||
.hmall-product-title {
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
line-height: 1.35;
|
||||
height: 64rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.hmall-product-highlight {
|
||||
font-size: 20rpx;
|
||||
line-height: 28rpx;
|
||||
color: #7a7a7a;
|
||||
margin-top: 6rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.hmall-product-service-tags {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.hmall-product-service-tag {
|
||||
height: 28rpx;
|
||||
line-height: 28rpx;
|
||||
padding: 0 8rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 18rpx;
|
||||
font-weight: 600;
|
||||
color: #12b76a;
|
||||
background: #ecfdf3;
|
||||
margin-right: 6rpx;
|
||||
margin-bottom: 4rpx;
|
||||
}
|
||||
|
||||
.hmall-product-price-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-end;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.hmall-product-price-value {
|
||||
font-size: 34rpx;
|
||||
line-height: 1;
|
||||
color: #ff1030;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.hmall-product-market-price {
|
||||
font-size: 20rpx;
|
||||
line-height: 1;
|
||||
color: #9a9a9a;
|
||||
text-decoration: line-through;
|
||||
margin-left: 8rpx;
|
||||
margin-bottom: 2rpx;
|
||||
}
|
||||
|
||||
.hmall-product-sales {
|
||||
margin-top: 8rpx;
|
||||
font-size: 20rpx;
|
||||
color: #8a8a8a;
|
||||
}
|
||||
|
||||
.hmall-loading-state,
|
||||
.hmall-load-more-status,
|
||||
.hmall-feed-end-state {
|
||||
padding: 28rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.hmall-loading-text,
|
||||
.hmall-feed-end-text {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
</style>
|
||||
301
components/home/HomeServiceContent.uvue
Normal file
301
components/home/HomeServiceContent.uvue
Normal file
@@ -0,0 +1,301 @@
|
||||
<template>
|
||||
<view class="service-content">
|
||||
<view class="hero-card">
|
||||
<view>
|
||||
<text class="hero-title">居家服务</text>
|
||||
<text class="hero-desc">围绕护理、康复、陪诊、助餐和健康管理,先把用户最常用的入口集中到首页。</text>
|
||||
</view>
|
||||
<view class="hero-badge">
|
||||
<text class="hero-badge-text">医养到家</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view class="service-filter-scroll" scroll-x="true" :show-scrollbar="false">
|
||||
<view class="service-filter-row">
|
||||
<view
|
||||
v-for="item in categories"
|
||||
:key="item.id"
|
||||
:class="['service-filter-item', activeCategory == item.id ? 'service-filter-item-active' : '']"
|
||||
@click="emit('change-category', item.id)"
|
||||
>
|
||||
<text :class="['service-filter-text', activeCategory == item.id ? 'service-filter-text-active' : '']">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view class="service-grid">
|
||||
<view
|
||||
v-for="item in filteredEntries"
|
||||
:key="item.id"
|
||||
class="service-entry-card"
|
||||
@click="emit('select-entry', item)"
|
||||
>
|
||||
<view :class="['entry-icon-wrap', item.tone]">
|
||||
<text class="entry-icon">{{ item.icon }}</text>
|
||||
</view>
|
||||
<text class="entry-title">{{ item.title }}</text>
|
||||
<text class="entry-desc">{{ item.desc }}</text>
|
||||
<text class="entry-link">{{ item.linkText }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="process-card">
|
||||
<text class="process-title">服务流程</text>
|
||||
<view class="process-row">
|
||||
<view v-for="(item, index) in processList" :key="item + '-' + index" class="process-item">
|
||||
<view class="process-dot"></view>
|
||||
<text class="process-text">{{ item }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="tips-card">
|
||||
<text class="tips-title">服务提醒</text>
|
||||
<text class="tips-text">当前首页先开放用户可直接触达的服务入口,评估、派单、执行等环节会在进入服务单后继续展示。</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { computed } from 'vue'
|
||||
|
||||
type ServiceCategoryItem = {
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
type ServiceEntryItem = {
|
||||
id: string
|
||||
title: string
|
||||
desc: string
|
||||
icon: string
|
||||
tone: string
|
||||
category: string
|
||||
linkText: string
|
||||
route: string
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
activeCategory: {
|
||||
type: String,
|
||||
default: 'all'
|
||||
},
|
||||
categories: {
|
||||
type: Array<ServiceCategoryItem>,
|
||||
default: [] as Array<ServiceCategoryItem>
|
||||
},
|
||||
entries: {
|
||||
type: Array<ServiceEntryItem>,
|
||||
default: [] as Array<ServiceEntryItem>
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'change-category', categoryId: string): void
|
||||
(e: 'select-entry', entry: ServiceEntryItem): void
|
||||
}>()
|
||||
|
||||
const processList = ['申请', '评估', '方案', '派单', '上门', '验收', '结算']
|
||||
|
||||
const filteredEntries = computed((): Array<ServiceEntryItem> => {
|
||||
if (props.activeCategory == 'all') {
|
||||
return props.entries
|
||||
}
|
||||
const result: Array<ServiceEntryItem> = []
|
||||
for (let i = 0; i < props.entries.length; i++) {
|
||||
if (props.entries[i].category == props.activeCategory) {
|
||||
result.push(props.entries[i])
|
||||
}
|
||||
}
|
||||
return result
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.service-content {
|
||||
padding: 16rpx 20rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.hero-card,
|
||||
.process-card,
|
||||
.tips-card {
|
||||
background: #ffffff;
|
||||
border-radius: 24rpx;
|
||||
padding: 24rpx;
|
||||
box-shadow: 0 6rpx 18rpx rgba(0, 0, 0, 0.04);
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.hero-card {
|
||||
background: linear-gradient(135deg, #edf8ff 0%, #f3fff7 100%);
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.hero-title,
|
||||
.process-title,
|
||||
.tips-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: #16324f;
|
||||
}
|
||||
|
||||
.hero-desc,
|
||||
.tips-text {
|
||||
margin-top: 12rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #5f6f6a;
|
||||
}
|
||||
|
||||
.hero-badge {
|
||||
padding: 12rpx 18rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #e2231a;
|
||||
}
|
||||
|
||||
.hero-badge-text {
|
||||
font-size: 22rpx;
|
||||
font-weight: 700;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.service-filter-scroll {
|
||||
height: 60rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.service-filter-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.service-filter-item {
|
||||
padding: 12rpx 22rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #ffffff;
|
||||
margin-right: 18rpx;
|
||||
}
|
||||
|
||||
.service-filter-item-active {
|
||||
background: #ffecec;
|
||||
}
|
||||
|
||||
.service-filter-text {
|
||||
font-size: 24rpx;
|
||||
color: #4b5563;
|
||||
}
|
||||
|
||||
.service-filter-text-active {
|
||||
color: #e2231a;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.service-grid {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
|
||||
.service-entry-card {
|
||||
width: 49%;
|
||||
background: #ffffff;
|
||||
border-radius: 24rpx;
|
||||
padding: 24rpx 20rpx;
|
||||
box-shadow: 0 6rpx 18rpx rgba(0, 0, 0, 0.04);
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 16rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.entry-icon-wrap {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.entry-icon-wrap.blue {
|
||||
background: #e8f4ff;
|
||||
}
|
||||
|
||||
.entry-icon-wrap.green {
|
||||
background: #e8f7ef;
|
||||
}
|
||||
|
||||
.entry-icon-wrap.orange {
|
||||
background: #fff4e5;
|
||||
}
|
||||
|
||||
.entry-icon-wrap.red {
|
||||
background: #ffecec;
|
||||
}
|
||||
|
||||
.entry-icon {
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
.entry-title {
|
||||
margin-top: 8rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #16324f;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.entry-desc {
|
||||
margin-top: 10rpx;
|
||||
font-size: 23rpx;
|
||||
line-height: 34rpx;
|
||||
color: #6b7280;
|
||||
min-height: 68rpx;
|
||||
}
|
||||
|
||||
.entry-link {
|
||||
margin-top: 12rpx;
|
||||
font-size: 22rpx;
|
||||
color: #e2231a;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.process-row {
|
||||
margin-top: 18rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.process-item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding: 10rpx 14rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #f5f8fb;
|
||||
margin-right: 18rpx;
|
||||
margin-bottom: 18rpx;
|
||||
}
|
||||
|
||||
.process-dot {
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 6rpx;
|
||||
background: #09c39d;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.process-text {
|
||||
font-size: 22rpx;
|
||||
color: #4b5563;
|
||||
}
|
||||
</style>
|
||||
240
components/home/JdLikeHomeHeader.uvue
Normal file
240
components/home/JdLikeHomeHeader.uvue
Normal file
@@ -0,0 +1,240 @@
|
||||
<template>
|
||||
<view class="jd2-header" :style="headerStyle">
|
||||
<view class="jd2-module-row" :style="capsuleStyle">
|
||||
<view
|
||||
v-for="item in modules"
|
||||
:key="item.key"
|
||||
class="jd2-module-item"
|
||||
@click="emit('changeModule', item.key)"
|
||||
>
|
||||
<text :class="['jd2-module-text', activeModule == item.key ? 'jd2-module-text-active' : '']">{{ item.label }}</text>
|
||||
<view v-if="activeModule == item.key" class="jd2-module-line"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="jd2-search-wrap" :style="capsuleStyle">
|
||||
<view class="jd2-search-box">
|
||||
<text class="jd2-search-icon">⌕</text>
|
||||
<input
|
||||
class="jd2-search-input"
|
||||
:value="searchKeyword"
|
||||
:placeholder="placeholder"
|
||||
placeholder-style="color:#b5b5b5"
|
||||
confirm-type="search"
|
||||
@input="handleInput"
|
||||
@confirm="handleConfirm"
|
||||
@click="emit('focusSearch')"
|
||||
/>
|
||||
<view class="jd2-search-btn" @click="handleSearch">
|
||||
<text class="jd2-search-btn-text">搜索</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view class="jd2-category-scroll" scroll-x="true" :show-scrollbar="false">
|
||||
<view class="jd2-category-row">
|
||||
<view
|
||||
v-for="item in categories"
|
||||
:key="item.id"
|
||||
class="jd2-category-item"
|
||||
@click="emit('changeCategory', item.id)"
|
||||
>
|
||||
<text :class="['jd2-category-text', activeCategory == item.id ? 'jd2-category-text-active' : '']">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { computed } from 'vue'
|
||||
|
||||
type TopModuleItem = {
|
||||
key: string
|
||||
label: string
|
||||
}
|
||||
|
||||
type TopCategoryItem = {
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
statusBarHeight: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
capsuleRight: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
modules: {
|
||||
type: Array<TopModuleItem>,
|
||||
default: [] as Array<TopModuleItem>
|
||||
},
|
||||
activeModule: {
|
||||
type: String,
|
||||
default: 'home'
|
||||
},
|
||||
searchKeyword: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
categories: {
|
||||
type: Array<TopCategoryItem>,
|
||||
default: [] as Array<TopCategoryItem>
|
||||
},
|
||||
activeCategory: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'changeModule', moduleKey: string): void
|
||||
(e: 'changeCategory', categoryId: string): void
|
||||
(e: 'update:searchKeyword', keyword: string): void
|
||||
(e: 'search', keyword: string): void
|
||||
(e: 'focusSearch'): void
|
||||
}>()
|
||||
|
||||
const headerStyle = computed((): string => `padding-top:${props.statusBarHeight}px;`)
|
||||
const capsuleStyle = computed((): string => props.capsuleRight > 0 ? `padding-right:${props.capsuleRight}px;` : '')
|
||||
|
||||
function handleInput(event: UniInputInputEvent | UniInputConfirmEvent) {
|
||||
emit('update:searchKeyword', event.detail.value)
|
||||
}
|
||||
|
||||
function handleConfirm(event: UniInputConfirmEvent) {
|
||||
emit('search', event.detail.value)
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
emit('search', props.searchKeyword)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.jd2-header {
|
||||
background: #ffffff;
|
||||
padding-bottom: 10rpx;
|
||||
box-shadow: 0 4rpx 14rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.jd2-module-row {
|
||||
flex-direction: row;
|
||||
align-items: flex-end;
|
||||
padding-left: 24rpx;
|
||||
padding-right: 24rpx;
|
||||
height: 78rpx;
|
||||
gap: 36rpx;
|
||||
}
|
||||
|
||||
.jd2-module-item {
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
height: 78rpx;
|
||||
}
|
||||
|
||||
.jd2-module-text {
|
||||
font-size: 30rpx;
|
||||
font-weight: 400;
|
||||
color: #222222;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.jd2-module-text-active {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #e2231a;
|
||||
}
|
||||
|
||||
.jd2-module-line {
|
||||
margin-top: 8rpx;
|
||||
width: 32rpx;
|
||||
height: 6rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #e2231a;
|
||||
}
|
||||
|
||||
.jd2-search-wrap {
|
||||
padding-left: 24rpx;
|
||||
padding-right: 24rpx;
|
||||
padding-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.jd2-search-box {
|
||||
height: 68rpx;
|
||||
border-width: 2rpx;
|
||||
border-style: solid;
|
||||
border-color: #ff2d2f;
|
||||
border-radius: 14rpx;
|
||||
background: #ffffff;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.jd2-search-icon {
|
||||
width: 52rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.jd2-search-input {
|
||||
flex: 1;
|
||||
height: 68rpx;
|
||||
font-size: 26rpx;
|
||||
color: #222222;
|
||||
padding-right: 12rpx;
|
||||
}
|
||||
|
||||
.jd2-search-btn {
|
||||
width: 100rpx;
|
||||
height: 68rpx;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #ff2d2f;
|
||||
}
|
||||
|
||||
.jd2-search-btn-text {
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.jd2-category-scroll {
|
||||
height: 56rpx;
|
||||
white-space: nowrap;
|
||||
padding-left: 24rpx;
|
||||
padding-right: 24rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.jd2-category-row {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
height: 56rpx;
|
||||
}
|
||||
|
||||
.jd2-category-item {
|
||||
margin-right: 32rpx;
|
||||
height: 56rpx;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.jd2-category-text {
|
||||
font-size: 26rpx;
|
||||
color: #444444;
|
||||
}
|
||||
|
||||
.jd2-category-text-active {
|
||||
color: #ff2d2f;
|
||||
font-weight: 700;
|
||||
}
|
||||
</style>
|
||||
110
components/homeService/ServicePageHeader.uvue
Normal file
110
components/homeService/ServicePageHeader.uvue
Normal file
@@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<view class="service-page-header" :style="headerStyle">
|
||||
<view class="service-page-header-inner">
|
||||
<view class="service-page-back" @click="goBack">
|
||||
<text class="service-page-back-icon"><</text>
|
||||
</view>
|
||||
<text class="service-page-title">{{ title }}</text>
|
||||
<view class="service-page-right-placeholder"></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { computed, ref } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
fallbackUrl: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
|
||||
const statusBarHeight = ref(0)
|
||||
|
||||
try {
|
||||
const systemInfo = uni.getSystemInfoSync()
|
||||
statusBarHeight.value = systemInfo.statusBarHeight
|
||||
} catch (error) {
|
||||
statusBarHeight.value = 20
|
||||
}
|
||||
|
||||
const headerStyle = computed((): string => {
|
||||
return 'padding-top:' + statusBarHeight.value + 'px;'
|
||||
})
|
||||
|
||||
function goBack() {
|
||||
let pageCount = 0
|
||||
try {
|
||||
pageCount = getCurrentPages().length
|
||||
} catch (error) {
|
||||
pageCount = 0
|
||||
}
|
||||
|
||||
if (pageCount > 1) {
|
||||
uni.navigateBack()
|
||||
return
|
||||
}
|
||||
|
||||
if (props.fallbackUrl == '') {
|
||||
uni.showToast({ title: '暂无可返回页面', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
if (props.fallbackUrl.indexOf('/pages/main/') == 0) {
|
||||
uni.switchTab({ url: props.fallbackUrl })
|
||||
return
|
||||
}
|
||||
|
||||
uni.redirectTo({ url: props.fallbackUrl })
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.service-page-header {
|
||||
background: #f3f7f9;
|
||||
padding-left: 24rpx;
|
||||
padding-right: 24rpx;
|
||||
padding-bottom: 16rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.service-page-header-inner {
|
||||
height: 88rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.service-page-back {
|
||||
min-width: 88rpx;
|
||||
height: 88rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.service-page-back-icon {
|
||||
font-size: 52rpx;
|
||||
line-height: 1;
|
||||
color: #16324f;
|
||||
}
|
||||
|
||||
.service-page-title {
|
||||
flex: 1;
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #16324f;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.service-page-right-placeholder {
|
||||
min-width: 88rpx;
|
||||
height: 88rpx;
|
||||
}
|
||||
</style>
|
||||
79
components/homeService/ServicePageScaffold.uvue
Normal file
79
components/homeService/ServicePageScaffold.uvue
Normal file
@@ -0,0 +1,79 @@
|
||||
<template>
|
||||
<view class="service-page-shell">
|
||||
<view class="service-page-fixed-header">
|
||||
<ServicePageHeader :title="title" :fallback-url="fallbackUrl"></ServicePageHeader>
|
||||
</view>
|
||||
<view class="service-page-header-placeholder" :style="{ height: headerHeight + 'px' }"></view>
|
||||
<scroll-view class="service-page-scroll" scroll-y="true">
|
||||
<view class="service-page-content">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import ServicePageHeader from '@/components/homeService/ServicePageHeader.uvue'
|
||||
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
fallbackUrl: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
|
||||
const headerHeight = ref(116)
|
||||
|
||||
try {
|
||||
const systemInfo = uni.getSystemInfoSync()
|
||||
const statusBar = systemInfo.statusBarHeight
|
||||
const unit = systemInfo.screenWidth / 750
|
||||
headerHeight.value = statusBar + Math.round(124 * unit)
|
||||
} catch (error) {
|
||||
headerHeight.value = 116
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.service-page-shell {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #f3f7f9;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.service-page-fixed-header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 100;
|
||||
background: #f3f7f9;
|
||||
}
|
||||
|
||||
.service-page-header-placeholder {
|
||||
width: 100%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.service-page-scroll {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.service-page-content {
|
||||
padding: 24rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
136
pages.json
136
pages.json
@@ -336,6 +336,55 @@
|
||||
"navigationBarTitleText": "添加银行卡"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "home-service/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "居家上门服务",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "home-service/apply",
|
||||
"style": {
|
||||
"navigationBarTitleText": "提交服务申请",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "home-service/order-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "服务单详情",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "home-service/feedback",
|
||||
"style": {
|
||||
"navigationBarTitleText": "验收反馈",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "home-service/assessment",
|
||||
"style": {
|
||||
"navigationBarTitleText": "上门评估",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "home-service/service-plan",
|
||||
"style": {
|
||||
"navigationBarTitleText": "服务方案",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "home-service/settlement-archive",
|
||||
"style": {
|
||||
"navigationBarTitleText": "结算归档",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "bank-cards/verify",
|
||||
"style": {
|
||||
@@ -373,6 +422,93 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/mall/merchant",
|
||||
"pages": [
|
||||
{
|
||||
"path": "home-service/tasks",
|
||||
"style": {
|
||||
"navigationBarTitleText": "执行任务",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "home-service/task-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "任务详情",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "home-service/check-in",
|
||||
"style": {
|
||||
"navigationBarTitleText": "到岗签到",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "home-service/service-record",
|
||||
"style": {
|
||||
"navigationBarTitleText": "服务记录",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "home-service/exception-report",
|
||||
"style": {
|
||||
"navigationBarTitleText": "异常上报",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/mall/admin/home-service",
|
||||
"pages": [
|
||||
{
|
||||
"path": "application-management/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "服务申请管理",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "dispatch-center/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "派单调度中心",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "assessment-form/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "上门评估",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "service-plan/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "服务方案",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "rectification/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "整改处理",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "settlement-archive/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "结算归档",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
|
||||
@@ -1,81 +1,26 @@
|
||||
<!-- pages/main/index.uvue -->
|
||||
<template>
|
||||
<view class="medic-home">
|
||||
<view class="pdd-home-header" :style="headerStyle">
|
||||
<view class="pdd-header-shell">
|
||||
<view class="pdd-search-row" :style="searchRowStyle" @tap="handleHomeSearchClick">
|
||||
<view class="pdd-search-box">
|
||||
<text class="pdd-search-icon">⌕</text>
|
||||
<view class="pdd-keyword-text">
|
||||
<view :class="['pdd-keyword-track', { 'pdd-keyword-track-animating': placeholderAnimating }]">
|
||||
<view class="pdd-keyword-slide">
|
||||
<text class="pdd-keyword-placeholder">{{ currentPlaceholderKeyword }}</text>
|
||||
</view>
|
||||
<view class="pdd-keyword-slide">
|
||||
<text class="pdd-keyword-placeholder">{{ nextPlaceholderKeyword }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<text class="pdd-camera-icon">◉</text>
|
||||
</view>
|
||||
<view class="jd-header-fixed">
|
||||
<JdLikeHomeHeader
|
||||
:status-bar-height="statusBarHeight"
|
||||
:capsule-right="navBarRight"
|
||||
:modules="topModules"
|
||||
:active-module="activeTopModule"
|
||||
:search-keyword="searchKeyword"
|
||||
:placeholder="headerSearchPlaceholder"
|
||||
:categories="headerCategories"
|
||||
:active-category="activeCategory"
|
||||
@changeModule="handleTopModuleChange"
|
||||
@update:searchKeyword="handleSearchKeywordUpdate"
|
||||
@search="handleHeaderSearch"
|
||||
@changeCategory="handleHeaderCategoryChange"
|
||||
@focusSearch="handleSearchFocus"
|
||||
></JdLikeHomeHeader>
|
||||
</view>
|
||||
|
||||
<view class="category-wrapper">
|
||||
<view :class="['category-bar-wrap', { 'category-bar-wrap-hidden': showCategoryPanel }]">
|
||||
<scroll-view
|
||||
class="category-scroll"
|
||||
direction="horizontal"
|
||||
:show-scrollbar="false"
|
||||
:scroll-with-animation="true"
|
||||
:scroll-into-view="categoryScrollIntoView"
|
||||
>
|
||||
<view
|
||||
v-for="(item, index) in categoryList"
|
||||
:key="buildListItemKey('top-category', item.id, index)"
|
||||
:id="'cat-' + item.id"
|
||||
:class="['category-item', { 'category-item-active': currentCategory === item.id }]"
|
||||
@tap="handleCategoryTabClick(item)"
|
||||
>
|
||||
<text :class="['category-item-text', { 'category-item-text-active': currentCategory === item.id, 'category-item-text-accent': shouldHighlightCategory(item.name) && currentCategory !== item.id }]">{{ getCategoryTabDisplayName(item.name) }}</text>
|
||||
<view v-if="currentCategory === item.id" class="category-active-line"></view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="jd-header-placeholder" :style="{ height: headerPlaceholderHeight + 'px' }"></view>
|
||||
|
||||
<view class="category-expand-btn" @tap="toggleCategoryPanel">
|
||||
<text class="category-expand-icon">{{ showCategoryPanel ? '∧' : '∨' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
v-if="showCategoryPanel"
|
||||
class="category-panel"
|
||||
:style="{ top: (navbarTotalHeight + 1) + 'px' }"
|
||||
>
|
||||
<view class="category-panel-header">
|
||||
<text class="category-panel-title">全部分类</text>
|
||||
<view class="category-panel-close-btn" @tap="toggleCategoryPanel">
|
||||
<text class="category-panel-close-text">收起</text>
|
||||
<text class="category-panel-close-arrow">∧</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="category-panel-grid">
|
||||
<view
|
||||
v-for="(item, index) in categoryList"
|
||||
:key="buildListItemKey('panel-category', item.id, index)"
|
||||
:class="['category-panel-item', { 'category-panel-item-active': currentCategory === item.id }]"
|
||||
@tap="selectCategoryFromPanel(item)"
|
||||
>
|
||||
<text :class="['category-panel-item-text', { 'category-panel-item-text-active': currentCategory === item.id }]">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="pdd-header-placeholder" :style="{ height: headerPlaceholderHeight + 'px' }"></view>
|
||||
|
||||
<!-- 主内容区 -->
|
||||
<scroll-view
|
||||
direction="vertical"
|
||||
class="main-scroll"
|
||||
@@ -83,184 +28,46 @@
|
||||
:refresher-triggered="refreshing"
|
||||
:lower-threshold="50"
|
||||
@refresherrefresh="onRefresh"
|
||||
@scrolltolower="loadMore"
|
||||
@scrolltolower="handleMainScrollToLower"
|
||||
@scroll="handleScroll"
|
||||
>
|
||||
<view class="category-feed-shell">
|
||||
<view v-if="currentCategory !== 'recommend' && secondaryCategoryDisplay.length > 0" class="secondary-category-panel">
|
||||
<view
|
||||
v-for="(item, index) in secondaryCategoryDisplay"
|
||||
:key="buildListItemKey('secondary-category', item.id, index)"
|
||||
:class="['secondary-category-item', { 'secondary-category-item-active': selectedSubCategoryId === item.id }]"
|
||||
@tap="handleSecondaryCategoryClick(item)"
|
||||
>
|
||||
<view class="secondary-category-icon-wrap">
|
||||
<image
|
||||
v-if="isImageIcon(item.icon)"
|
||||
class="secondary-category-image"
|
||||
:src="item.icon"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<text v-else class="secondary-category-icon-text">{{ getCategoryDisplayIcon(item) }}</text>
|
||||
</view>
|
||||
<text class="secondary-category-name">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<HomeMallContent
|
||||
v-if="activeTopModule == 'home'"
|
||||
:current-category="currentCategory"
|
||||
:selected-sub-category-id="selectedSubCategoryId"
|
||||
:secondary-category-display="secondaryCategoryDisplay"
|
||||
:marketing-channels="marketingChannels"
|
||||
:category-simple-channels="categorySimpleChannels"
|
||||
:hot-products="hotProducts"
|
||||
:loading="loading"
|
||||
:has-more="hasMore"
|
||||
:show-load-more="showLoadMore"
|
||||
@secondary-category-click="handleSecondaryCategoryClick"
|
||||
@select-channel="navigateToChannel"
|
||||
@select-simple-channel="navigateToSimpleChannel"
|
||||
@select-product="navigateToProduct"
|
||||
></HomeMallContent>
|
||||
|
||||
<view v-if="currentCategory === 'recommend' && marketingChannels.length > 0" class="recommend-channel-section">
|
||||
<view
|
||||
v-for="(channel, index) in marketingChannels"
|
||||
:key="buildListItemKey('marketing-channel', channel.id, index)"
|
||||
class="recommend-channel-card"
|
||||
:style="{ backgroundColor: channel.bgColor }"
|
||||
@tap="navigateToChannel(channel)"
|
||||
>
|
||||
<view class="recommend-channel-header">
|
||||
<view class="recommend-channel-title-row">
|
||||
<text class="recommend-channel-title">{{ channel.title }}</text>
|
||||
<text class="recommend-channel-badge" :style="{ color: channel.themeColor, borderColor: channel.themeColor }">{{ channel.badge }}</text>
|
||||
</view>
|
||||
<text class="recommend-channel-subtitle">{{ channel.subtitle }}</text>
|
||||
</view>
|
||||
<view class="recommend-channel-products">
|
||||
<view
|
||||
v-for="(product, pIndex) in channel.products"
|
||||
:key="buildListItemKey('channel-product', product.id, pIndex)"
|
||||
class="recommend-channel-product"
|
||||
>
|
||||
<image
|
||||
class="recommend-channel-product-image"
|
||||
:src="getChannelProductImage(product)"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<text class="recommend-channel-product-name">{{ product.shortName }}</text>
|
||||
<view class="recommend-channel-price-row">
|
||||
<text class="recommend-channel-product-tag" :style="{ color: channel.themeColor }">{{ product.tag }}</text>
|
||||
<text class="recommend-channel-product-price" :style="{ color: channel.themeColor }">¥{{ formatChannelPrice(product.price) }}</text>
|
||||
</view>
|
||||
<text v-if="product.marketPrice > product.price" class="recommend-channel-market-price">¥{{ formatChannelPrice(product.marketPrice) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<HomeServiceContent
|
||||
v-else
|
||||
:active-category="activeCategory"
|
||||
:categories="serviceCategories"
|
||||
:entries="serviceEntries"
|
||||
@change-category="handleHeaderCategoryChange"
|
||||
@select-entry="handleServiceEntrySelect"
|
||||
></HomeServiceContent>
|
||||
|
||||
<view v-else-if="currentCategory !== 'recommend' && categorySimpleChannels.length > 0" class="category-simple-channel-section">
|
||||
<view
|
||||
v-for="(channel, index) in categorySimpleChannels"
|
||||
:key="buildListItemKey('simple-channel', channel.id, index)"
|
||||
:class="['simple-channel-card', { 'simple-channel-card-with-divider': index === 0 }]"
|
||||
@tap="navigateToSimpleChannel(channel)"
|
||||
>
|
||||
<view class="simple-channel-left">
|
||||
<view class="simple-channel-title-row">
|
||||
<text class="simple-channel-icon">{{ channel.icon }}</text>
|
||||
<text class="simple-channel-title">{{ channel.title }}</text>
|
||||
</view>
|
||||
<text class="simple-channel-subtitle">{{ channel.subtitle }}</text>
|
||||
</view>
|
||||
<view class="simple-channel-cover-wrap">
|
||||
<view
|
||||
v-for="(cover, coverIndex) in channel.coverImages"
|
||||
:key="buildListItemKey('simple-channel-cover', channel.id + '-' + cover, coverIndex)"
|
||||
class="simple-channel-cover-slot"
|
||||
>
|
||||
<image
|
||||
v-if="isImageIcon(cover)"
|
||||
class="simple-channel-cover-image"
|
||||
:src="cover"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<view v-else class="simple-channel-cover-fallback">
|
||||
<text class="simple-channel-cover-text">{{ cover }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="feed-divider"></view>
|
||||
|
||||
<view v-if="hotProducts.length > 0" class="products-grid products-grid-dense">
|
||||
<view
|
||||
v-for="(product, index) in hotProducts"
|
||||
:key="buildProductLoopKey(product, index)"
|
||||
class="product-card product-card-skeleton"
|
||||
@click="navigateToProduct(product)"
|
||||
>
|
||||
<view class="product-image-wrapper product-image-wrapper-fixed">
|
||||
<image
|
||||
class="product-image"
|
||||
:src="getProductCover(product)"
|
||||
@error="() => handleProductImageError(product.id)"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
</view>
|
||||
<view class="product-placeholder-body">
|
||||
<view v-if="getProductCardTags(product).length > 0" class="product-card-tags">
|
||||
<text
|
||||
v-for="(tag, index) in getProductCardTags(product)"
|
||||
:key="product.id + '-card-tag-' + index"
|
||||
class="product-card-tag"
|
||||
>
|
||||
{{ tag }}
|
||||
</text>
|
||||
</view>
|
||||
<text class="product-skeleton-title">{{ getProductTitle(product) }}</text>
|
||||
<text v-if="getProductHighlight(product) !== ''" class="product-highlight-text">{{ getProductHighlight(product) }}</text>
|
||||
<view v-if="getProductServiceTags(product).length > 0" class="product-service-tags">
|
||||
<text
|
||||
v-for="(tag, index) in getProductServiceTags(product)"
|
||||
:key="product.id + '-service-tag-' + index"
|
||||
class="product-service-tag"
|
||||
>
|
||||
{{ tag }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="product-price-row">
|
||||
<text class="product-price-value">¥{{ formatProductPrice(product) }}</text>
|
||||
<text v-if="showMarketPrice(product)" class="product-market-price">¥{{ formatMarketPrice(product) }}</text>
|
||||
</view>
|
||||
<text v-if="getProductSalesText(product) !== ''" class="product-sales-text">{{ getProductSalesText(product) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-else-if="loading" class="feed-loading-state">
|
||||
<text class="loading-text">正在加载商品...</text>
|
||||
</view>
|
||||
|
||||
<view v-else class="feed-empty-state">
|
||||
<text class="feed-empty-title">当前分类暂无商品</text>
|
||||
<text class="feed-empty-desc">可以切换二级分类或其他频道继续浏览</text>
|
||||
</view>
|
||||
|
||||
<view class="load-more-status" v-if="loading || showLoadMore">
|
||||
<text class="loading-text">正在加载更多商品...</text>
|
||||
</view>
|
||||
|
||||
<view v-if="!hasMore && hotProducts.length > 0" class="feed-end-state">
|
||||
<text class="feed-end-text">已经到底了</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 底部安全区域 -->
|
||||
<view class="safe-area"></view>
|
||||
<view class="safe-area" :style="{ height: bottomSafeArea + 88 + 'px' }"></view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 遮罩:覆盖分类面板下方内容区域,点击关闭面板 -->
|
||||
<view
|
||||
v-if="showCategoryPanel"
|
||||
class="category-panel-mask"
|
||||
:style="{ top: navbarTotalHeight + 'px' }"
|
||||
@tap="toggleCategoryPanel"
|
||||
></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref, reactive, onMounted, onUnmounted } from 'vue'
|
||||
import { ref, reactive, onMounted, onUnmounted, computed } from 'vue'
|
||||
import { onShow, onLoad, onHide } from '@dcloudio/uni-app'
|
||||
import HomeMallContent from '@/components/home/HomeMallContent.uvue'
|
||||
import HomeServiceContent from '@/components/home/HomeServiceContent.uvue'
|
||||
import JdLikeHomeHeader from '@/components/home/JdLikeHomeHeader.uvue'
|
||||
import supabaseService from '@/utils/supabaseService.uts'
|
||||
import type { Product, Category, Brand, PaginatedResponse } from '@/utils/supabaseService.uts'
|
||||
import { getRecommendMarketingChannels } from '@/utils/mockChannelData.uts'
|
||||
@@ -271,6 +78,7 @@ import { logSupaConfig } from '@/ak/config.uts'
|
||||
|
||||
// 响应式数据
|
||||
const statusBarHeight = ref(0)
|
||||
const bottomSafeArea = ref(20)
|
||||
const scrollHeight = ref(0)
|
||||
const refreshing = ref(false)
|
||||
const loading = ref(false)
|
||||
@@ -301,6 +109,66 @@ const headerPlaceholderHeight = ref(128)
|
||||
|
||||
const headerStyle = ref('')
|
||||
const searchRowStyle = ref('')
|
||||
const activeTopModule = ref('home')
|
||||
const activeCategory = ref('recommend')
|
||||
const searchKeyword = ref('')
|
||||
|
||||
type HeaderModuleItem = {
|
||||
key: string
|
||||
label: string
|
||||
}
|
||||
|
||||
type ServiceHomeCategoryItem = {
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
type ServiceEntryItem = {
|
||||
id: string
|
||||
title: string
|
||||
desc: string
|
||||
icon: string
|
||||
tone: string
|
||||
category: string
|
||||
linkText: string
|
||||
route: string
|
||||
}
|
||||
|
||||
const topModules: Array<HeaderModuleItem> = [
|
||||
{ key: 'home', label: '首页' },
|
||||
{ key: 'service', label: '服务' }
|
||||
]
|
||||
|
||||
const serviceCategories: Array<ServiceHomeCategoryItem> = [
|
||||
{ id: 'all', name: '推荐' },
|
||||
{ id: 'nursing', name: '居家护理' },
|
||||
{ id: 'rehab', name: '康复照护' },
|
||||
{ id: 'assist', name: '适老用品' },
|
||||
{ id: 'health', name: '健康管理' },
|
||||
{ id: 'life', name: '生活服务' }
|
||||
]
|
||||
|
||||
const serviceEntries: Array<ServiceEntryItem> = [
|
||||
{ id: 'apply', title: '服务申请', desc: '快速发起上门护理与健康随访申请。', icon: '📝', tone: 'red', category: 'nursing', linkText: '立即申请', route: '/pages/mall/consumer/home-service/apply' },
|
||||
{ id: 'service-home', title: '服务大厅', desc: '查看服务项目、适用对象与预约说明。', icon: '🏠', tone: 'blue', category: 'all', linkText: '查看大厅', route: '/pages/mall/consumer/home-service/index' },
|
||||
{ id: 'progress', title: '服务进度', desc: '追踪评估、方案、执行和验收节点。', icon: '📍', tone: 'green', category: 'health', linkText: '查看工单', route: '/pages/mall/consumer/home-service/order-detail?id=case-001' },
|
||||
{ id: 'assessment', title: '上门评估', desc: '了解评估前准备事项和风险核对重点。', icon: '🩺', tone: 'blue', category: 'rehab', linkText: '查看说明', route: '/pages/mall/consumer/home-service/assessment?id=case-001' },
|
||||
{ id: 'plan', title: '服务方案', desc: '查看护理频次、服务周期和执行建议。', icon: '📋', tone: 'green', category: 'rehab', linkText: '方案说明', route: '/pages/mall/consumer/home-service/service-plan?id=case-001' },
|
||||
{ id: 'execution', title: '上门执行', desc: '同步执行记录、签到留痕与异常处理。', icon: '🚪', tone: 'orange', category: 'life', linkText: '查看进展', route: '/pages/mall/consumer/home-service/order-detail?id=case-002' },
|
||||
{ id: 'feedback', title: '验收反馈', desc: '服务完成后提交验收意见和满意度反馈。', icon: '✅', tone: 'red', category: 'nursing', linkText: '去反馈', route: '/pages/mall/consumer/home-service/feedback?id=case-001' },
|
||||
{ id: 'settlement', title: '结算归档', desc: '查看归档说明、账单结果和服务闭环。', icon: '🗂️', tone: 'green', category: 'assist', linkText: '查看说明', route: '/pages/mall/consumer/home-service/settlement-archive?id=case-001' }
|
||||
]
|
||||
|
||||
const headerCategories = computed((): Array<ServiceHomeCategoryItem | CategoryItem> => {
|
||||
return activeTopModule.value == 'home' ? categoryList.value : serviceCategories
|
||||
})
|
||||
|
||||
const headerSearchPlaceholder = computed((): string => {
|
||||
if (activeTopModule.value == 'service') {
|
||||
return '居家护理 / 康复照护 / 血压计 / 助餐服务'
|
||||
}
|
||||
return currentPlaceholderKeyword.value != '' ? currentPlaceholderKeyword.value : '感冒药 / 康复护理 / 居家护理 / 血压计'
|
||||
})
|
||||
|
||||
// 分类标签栏相关
|
||||
type CategoryItem = {
|
||||
@@ -442,6 +310,61 @@ const handleHomeSearchClick = () => {
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearchKeywordUpdate(keyword: string) {
|
||||
searchKeyword.value = keyword
|
||||
}
|
||||
|
||||
function handleSearchFocus() {
|
||||
if (searchKeyword.value == '' && activeTopModule.value == 'home') {
|
||||
searchKeyword.value = currentPlaceholderKeyword.value
|
||||
}
|
||||
}
|
||||
|
||||
function handleHeaderSearch(keyword: string) {
|
||||
const inputKeyword = keyword != '' ? keyword : searchKeyword.value
|
||||
const fallbackKeyword = headerSearchPlaceholder.value != '' ? headerSearchPlaceholder.value : '居家护理'
|
||||
const finalKeyword = inputKeyword != '' ? inputKeyword : fallbackKeyword
|
||||
searchKeyword.value = finalKeyword
|
||||
try {
|
||||
uni.navigateTo({ url: `/pages/mall/consumer/search?keyword=${encodeURIComponent(finalKeyword)}&source=home_header` })
|
||||
} catch (error) {
|
||||
console.error('首页搜索跳转失败', error)
|
||||
}
|
||||
}
|
||||
|
||||
function handleTopModuleChange(moduleKey: string) {
|
||||
activeTopModule.value = moduleKey
|
||||
if (moduleKey == 'home') {
|
||||
activeCategory.value = currentCategory.value
|
||||
} else {
|
||||
activeCategory.value = serviceCategories.length > 0 ? serviceCategories[0].id : 'all'
|
||||
}
|
||||
}
|
||||
|
||||
function handleHeaderCategoryChange(categoryId: string) {
|
||||
activeCategory.value = categoryId
|
||||
if (activeTopModule.value == 'home') {
|
||||
const matchedItem = categoryList.value.find((item: CategoryItem): boolean => item.id == categoryId)
|
||||
if (matchedItem != null) {
|
||||
handleCategoryTabClick(matchedItem)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleServiceEntrySelect(entry: ServiceEntryItem) {
|
||||
if (entry.route == '') {
|
||||
uni.showToast({ title: '该入口下一步补页面', icon: 'none' })
|
||||
return
|
||||
}
|
||||
uni.navigateTo({ url: entry.route })
|
||||
}
|
||||
|
||||
function handleMainScrollToLower() {
|
||||
if (activeTopModule.value == 'home') {
|
||||
void loadMore()
|
||||
}
|
||||
}
|
||||
|
||||
function toEventJsonObject(value: any | null): UTSJSONObject | null {
|
||||
if (value == null) {
|
||||
return null
|
||||
@@ -1356,9 +1279,11 @@ const familyItems = [
|
||||
// 初始化页面
|
||||
const initPage = () => {
|
||||
const systemInfo = uni.getSystemInfoSync()
|
||||
statusBarHeight.value = systemInfo.statusBarHeight
|
||||
const searchContentHeight = Math.round(60 * systemInfo.screenWidth / 750)
|
||||
const searchRowVerticalPadding = Math.round(12 * systemInfo.screenWidth / 750)
|
||||
statusBarHeight.value = systemInfo.statusBarHeight != null ? systemInfo.statusBarHeight : 20
|
||||
const searchContentHeight = Math.round(68 * systemInfo.screenWidth / 750)
|
||||
const searchRowVerticalPadding = Math.round(18 * systemInfo.screenWidth / 750)
|
||||
const moduleRowHeight = Math.round(78 * systemInfo.screenWidth / 750)
|
||||
const categoryRowHeight = Math.round(56 * systemInfo.screenWidth / 750)
|
||||
|
||||
let menuInfo: CapsuleButtonInfo | null = null
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
@@ -1377,20 +1302,22 @@ const initPage = () => {
|
||||
// 计算右边距避让
|
||||
const rightReserve = systemInfo.screenWidth - menuInfo.left + 8
|
||||
navBarRight.value = rightReserve
|
||||
const searchRowTotalH = statusBarHeight.value + Math.max(navHeight, searchContentHeight + searchRowVerticalPadding)
|
||||
const searchRowTotalH = statusBarHeight.value + Math.max(navHeight, moduleRowHeight) + searchContentHeight + searchRowVerticalPadding + categoryRowHeight + Math.round(18 * systemInfo.screenWidth / 750)
|
||||
searchRowStyle.value = `padding-top:${statusBarHeight.value}px;height:${searchRowTotalH}px;padding-right:${rightReserve}px;`
|
||||
navbarTotalHeight.value = searchRowTotalH
|
||||
} else {
|
||||
navBarHeight.value = 44
|
||||
navBarRight.value = 0
|
||||
const searchRowTotalH = statusBarHeight.value + Math.max(44, searchContentHeight + searchRowVerticalPadding)
|
||||
const searchRowTotalH = statusBarHeight.value + Math.max(44, moduleRowHeight) + searchContentHeight + searchRowVerticalPadding + categoryRowHeight + Math.round(18 * systemInfo.screenWidth / 750)
|
||||
searchRowStyle.value = `padding-top:${statusBarHeight.value}px;height:${searchRowTotalH}px;`
|
||||
navbarTotalHeight.value = searchRowTotalH
|
||||
}
|
||||
|
||||
headerStyle.value = ``
|
||||
categoryBarHeightPx.value = Math.round(64 * systemInfo.screenWidth / 750)
|
||||
headerPlaceholderHeight.value = navbarTotalHeight.value + categoryBarHeightPx.value
|
||||
categoryBarHeightPx.value = categoryRowHeight
|
||||
headerPlaceholderHeight.value = navbarTotalHeight.value
|
||||
const safeBottom = systemInfo.safeArea != null ? systemInfo.screenHeight - systemInfo.safeArea.bottom : 20
|
||||
bottomSafeArea.value = safeBottom > 0 ? safeBottom : 20
|
||||
|
||||
const screenWidth = systemInfo.screenWidth
|
||||
isMobile.value = screenWidth < 768
|
||||
@@ -1798,6 +1725,20 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.jd-header-fixed {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.jd-header-placeholder {
|
||||
width: 100%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.main-scroll {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<ServicePageScaffold title="服务申请管理">
|
||||
<ServicePanel title="服务申请管理" subtitle="沿用后台列表 + 状态标签 + 操作按钮的组织方式。">
|
||||
<view class="overview-row">
|
||||
<view v-for="item in overview" :key="item.id" class="overview-card" :class="'overview-' + item.tone">
|
||||
@@ -39,12 +39,13 @@
|
||||
</view>
|
||||
<view class="jump-btn" @click="goDispatch">进入派单调度</view>
|
||||
</ServicePanel>
|
||||
</scroll-view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServiceActionRow from '@/components/homeService/ServiceActionRow.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import ServiceStatusTag from '@/components/homeService/ServiceStatusTag.uvue'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<ServicePageScaffold title="上门评估" fallback-url="/pages/mall/admin/home-service/application-management/index">
|
||||
<view v-if="detail == null" class="empty-box">
|
||||
<text class="empty-text">未找到评估信息</text>
|
||||
</view>
|
||||
@@ -43,12 +43,13 @@
|
||||
<view class="submit-btn" @click="submitAssessment">提交评估</view>
|
||||
</ServicePanel>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServiceInfoList from '@/components/homeService/ServiceInfoList.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import { fetchAdminAssessmentDetail, submitAdminAssessment } from '@/services/homeServiceService.uts'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<ServicePageScaffold title="派单调度中心" fallback-url="/pages/mall/admin/home-service/application-management/index">
|
||||
<ServicePanel title="派单调度中心" subtitle="首批只做调度总览和待派单清单,后续再补排班与改派。">
|
||||
<view v-for="item in applications" :key="item.id" class="dispatch-card">
|
||||
<view class="dispatch-row">
|
||||
@@ -18,12 +18,13 @@
|
||||
</view>
|
||||
</view>
|
||||
</ServicePanel>
|
||||
</scroll-view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import ServiceStatusTag from '@/components/homeService/ServiceStatusTag.uvue'
|
||||
import { fetchAdminHomeServiceApplications } from '@/services/homeServiceService.uts'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<ServicePageScaffold title="整改处理" fallback-url="/pages/mall/admin/home-service/application-management/index">
|
||||
<view v-if="detail == null" class="empty-box">
|
||||
<text class="empty-text">未找到整改信息</text>
|
||||
</view>
|
||||
@@ -29,12 +29,13 @@
|
||||
<view class="submit-btn" @click="submitRectification">提交整改结果</view>
|
||||
</ServicePanel>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServiceInfoCard from '@/components/homeService/ServiceInfoCard.uvue'
|
||||
import ServiceInfoList from '@/components/homeService/ServiceInfoList.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<ServicePageScaffold title="服务方案" fallback-url="/pages/mall/admin/home-service/application-management/index">
|
||||
<view v-if="detail == null" class="empty-box">
|
||||
<text class="empty-text">未找到服务方案</text>
|
||||
</view>
|
||||
@@ -46,12 +46,13 @@
|
||||
<view class="submit-btn" @click="submitPlan">提交方案</view>
|
||||
</ServicePanel>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServiceInfoList from '@/components/homeService/ServiceInfoList.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import { fetchAdminServicePlanDetail, submitAdminServicePlan } from '@/services/homeServiceService.uts'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<ServicePageScaffold title="结算归档" fallback-url="/pages/mall/admin/home-service/application-management/index">
|
||||
<view v-if="detail == null" class="empty-box">
|
||||
<text class="empty-text">未找到结算信息</text>
|
||||
</view>
|
||||
@@ -32,12 +32,13 @@
|
||||
<view class="submit-btn" @click="submitArchive">确认归档</view>
|
||||
</ServicePanel>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServiceInfoCard from '@/components/homeService/ServiceInfoCard.uvue'
|
||||
import ServiceInfoList from '@/components/homeService/ServiceInfoList.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<ServicePageScaffold title="提交服务申请" fallback-url="/pages/mall/consumer/home-service/index">
|
||||
<ServicePanel title="提交服务申请" subtitle="先使用 mock 数据模拟申请受理流程。">
|
||||
<view class="form-item">
|
||||
<text class="label">选择服务</text>
|
||||
@@ -48,12 +48,13 @@
|
||||
|
||||
<view class="submit-btn" @click="submitApplication">提交申请</view>
|
||||
</ServicePanel>
|
||||
</scroll-view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { reactive, ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import { createHomeServiceApplication, fetchHomeServiceCatalog } from '@/services/homeServiceService.uts'
|
||||
import { HomeServiceApplicationDraftType, HomeServiceCatalogType } from '@/types/home-service.uts'
|
||||
@@ -105,13 +106,6 @@ onLoad(() => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
min-height: 100vh;
|
||||
background: #f3f7f9;
|
||||
padding: 24rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
@@ -128,13 +122,18 @@ onLoad(() => {
|
||||
width: 100%;
|
||||
background: #f8fbfc;
|
||||
border-radius: 18rpx;
|
||||
padding: 22rpx 24rpx;
|
||||
font-size: 28rpx;
|
||||
color: #23384d;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.input {
|
||||
height: 84rpx;
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
|
||||
.textarea {
|
||||
padding: 22rpx 24rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
|
||||
|
||||
95
pages/mall/consumer/home-service/assessment.uvue
Normal file
95
pages/mall/consumer/home-service/assessment.uvue
Normal file
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<ServicePageScaffold title="上门评估" fallback-url="/pages/mall/consumer/home-service/index">
|
||||
<view v-if="detail == null" class="empty-box">
|
||||
<text class="empty-text">未找到评估信息</text>
|
||||
</view>
|
||||
<view v-else>
|
||||
<ServicePanel title="上门评估" subtitle="展示评估前准备、风险等级和护理建议。">
|
||||
<ServiceInfoList
|
||||
:items="[
|
||||
{ label: '服务单号:', value: detail.caseNo },
|
||||
{ label: '服务对象:', value: detail.elderName },
|
||||
{ label: '申请服务:', value: detail.serviceName },
|
||||
{ label: '预约上门:', value: detail.visitTime }
|
||||
]"
|
||||
></ServiceInfoList>
|
||||
</ServicePanel>
|
||||
|
||||
<ServicePanel title="评估结果摘要">
|
||||
<view class="summary-card">
|
||||
<text class="summary-line">风险等级:{{ detail.riskLevel }}</text>
|
||||
<text class="summary-line">护理等级:{{ detail.careLevel }}</text>
|
||||
<text class="summary-line">结论摘要:{{ detail.assessmentSummary }}</text>
|
||||
</view>
|
||||
</ServicePanel>
|
||||
|
||||
<ServicePanel title="评估标签">
|
||||
<view class="tag-row">
|
||||
<view v-for="item in detail.requirementTags" :key="item" class="tag-item">{{ item }}</view>
|
||||
</view>
|
||||
</ServicePanel>
|
||||
</view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServiceInfoList from '@/components/homeService/ServiceInfoList.uvue'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import { fetchAdminAssessmentDetail } from '@/services/homeServiceService.uts'
|
||||
import { HomeServiceAssessmentType } from '@/types/home-service.uts'
|
||||
|
||||
const caseId = ref('case-001')
|
||||
const detail = ref<HomeServiceAssessmentType | null>(null)
|
||||
|
||||
async function loadData() {
|
||||
detail.value = await fetchAdminAssessmentDetail(caseId.value)
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
const id = options['id']
|
||||
if (id != null && id != '') {
|
||||
caseId.value = id as string
|
||||
}
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.empty-box {
|
||||
padding: 120rpx 0;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.empty-text,
|
||||
.summary-line,
|
||||
.tag-item {
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #16324f;
|
||||
}
|
||||
|
||||
.summary-card {
|
||||
padding: 24rpx;
|
||||
border-radius: 20rpx;
|
||||
background: #f8fbfc;
|
||||
}
|
||||
|
||||
.summary-line + .summary-line {
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.tag-row {
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.tag-item {
|
||||
padding: 14rpx 20rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #eef2f6;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<ServicePageScaffold title="验收反馈" fallback-url="/pages/mall/consumer/home-service/index">
|
||||
<view v-if="detail == null" class="empty-box">
|
||||
<text class="empty-text">未找到验收信息</text>
|
||||
</view>
|
||||
@@ -43,12 +43,13 @@
|
||||
</view>
|
||||
</ServicePanel>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import { fetchConsumerAcceptanceDetail, submitConsumerAcceptance } from '@/services/homeServiceService.uts'
|
||||
import { HomeServiceAcceptanceType } from '@/types/home-service.uts'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<ServicePageScaffold title="居家上门服务" fallback-url="/pages/main/index">
|
||||
<view class="hero-card">
|
||||
<text class="hero-title">居家上门服务</text>
|
||||
<text class="hero-desc">覆盖服务申请、上门评估、执行跟踪与验收反馈,先用 mock 数据跑通前端闭环。</text>
|
||||
@@ -39,12 +39,13 @@
|
||||
<text class="case-info">服务地址:{{ item.address }}</text>
|
||||
</view>
|
||||
</ServicePanel>
|
||||
</scroll-view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import ServiceStatusTag from '@/components/homeService/ServiceStatusTag.uvue'
|
||||
import { fetchConsumerHomeServiceCases, fetchHomeServiceCatalog } from '@/services/homeServiceService.uts'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<ServicePageScaffold title="服务单详情" fallback-url="/pages/mall/consumer/home-service/index">
|
||||
<view v-if="detail == null" class="empty-box">
|
||||
<text class="empty-text">未找到对应服务单</text>
|
||||
</view>
|
||||
@@ -35,12 +35,13 @@
|
||||
<ServiceTimeline :items="detail.timeline"></ServiceTimeline>
|
||||
</ServicePanel>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServiceInfoCard from '@/components/homeService/ServiceInfoCard.uvue'
|
||||
import ServiceInfoList from '@/components/homeService/ServiceInfoList.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
|
||||
87
pages/mall/consumer/home-service/service-plan.uvue
Normal file
87
pages/mall/consumer/home-service/service-plan.uvue
Normal file
@@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<ServicePageScaffold title="服务方案" fallback-url="/pages/mall/consumer/home-service/index">
|
||||
<view v-if="detail == null" class="empty-box">
|
||||
<text class="empty-text">未找到服务方案</text>
|
||||
</view>
|
||||
<view v-else>
|
||||
<ServicePanel title="服务方案" subtitle="查看服务频次、服务周期和执行建议。">
|
||||
<ServiceInfoList
|
||||
:items="[
|
||||
{ label: '服务单号:', value: detail.caseNo },
|
||||
{ label: '服务对象:', value: detail.elderName },
|
||||
{ label: '服务类型:', value: detail.serviceName },
|
||||
{ label: '方案标题:', value: detail.planTitle }
|
||||
]"
|
||||
></ServiceInfoList>
|
||||
</ServicePanel>
|
||||
|
||||
<ServicePanel title="执行安排">
|
||||
<view class="summary-card">
|
||||
<text class="summary-line">服务频次:{{ detail.serviceFrequency }}</text>
|
||||
<text class="summary-line">服务周期:{{ detail.serviceCycle }}</text>
|
||||
<text class="summary-line">方案摘要:{{ detail.planSummary }}</text>
|
||||
</view>
|
||||
</ServicePanel>
|
||||
|
||||
<ServicePanel title="补充说明">
|
||||
<view class="summary-card muted-card">
|
||||
<text class="summary-line">执行建议:{{ detail.executorAdvice }}</text>
|
||||
<text class="summary-line">收费说明:{{ detail.billingSummary }}</text>
|
||||
</view>
|
||||
</ServicePanel>
|
||||
</view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServiceInfoList from '@/components/homeService/ServiceInfoList.uvue'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import { fetchAdminServicePlanDetail } from '@/services/homeServiceService.uts'
|
||||
import { HomeServicePlanType } from '@/types/home-service.uts'
|
||||
|
||||
const caseId = ref('case-001')
|
||||
const detail = ref<HomeServicePlanType | null>(null)
|
||||
|
||||
async function loadData() {
|
||||
detail.value = await fetchAdminServicePlanDetail(caseId.value)
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
const id = options['id']
|
||||
if (id != null && id != '') {
|
||||
caseId.value = id as string
|
||||
}
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.empty-box {
|
||||
padding: 120rpx 0;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.empty-text,
|
||||
.summary-line {
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #16324f;
|
||||
}
|
||||
|
||||
.summary-card {
|
||||
padding: 24rpx;
|
||||
border-radius: 20rpx;
|
||||
background: #f8fbfc;
|
||||
}
|
||||
|
||||
.muted-card {
|
||||
background: #eef5fb;
|
||||
}
|
||||
|
||||
.summary-line + .summary-line {
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
</style>
|
||||
88
pages/mall/consumer/home-service/settlement-archive.uvue
Normal file
88
pages/mall/consumer/home-service/settlement-archive.uvue
Normal file
@@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<ServicePageScaffold title="结算归档" fallback-url="/pages/mall/consumer/home-service/index">
|
||||
<view v-if="detail == null" class="empty-box">
|
||||
<text class="empty-text">未找到结算信息</text>
|
||||
</view>
|
||||
<view v-else>
|
||||
<ServicePanel title="结算归档" subtitle="查看服务账单和归档状态。">
|
||||
<ServiceInfoList
|
||||
:items="[
|
||||
{ label: '服务单号:', value: detail.caseNo },
|
||||
{ label: '服务对象:', value: detail.elderName },
|
||||
{ label: '账期:', value: detail.billingPeriod },
|
||||
{ label: '归档状态:', value: detail.archiveStatusText }
|
||||
]"
|
||||
></ServiceInfoList>
|
||||
</ServicePanel>
|
||||
|
||||
<ServicePanel title="费用明细">
|
||||
<view class="amount-card">
|
||||
<text class="amount-line">服务总额:{{ detail.totalAmount }}</text>
|
||||
<text class="amount-line">长护险 / 补贴:{{ detail.insuranceAmount }}</text>
|
||||
<text class="amount-line">个人自付:{{ detail.selfPayAmount }}</text>
|
||||
</view>
|
||||
</ServicePanel>
|
||||
|
||||
<ServicePanel title="归档说明">
|
||||
<view class="archive-box">
|
||||
<text class="archive-text">已包含执行记录、验收反馈、结算单与电子档案索引,方便家属追踪服务闭环。</text>
|
||||
</view>
|
||||
</ServicePanel>
|
||||
</view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServiceInfoList from '@/components/homeService/ServiceInfoList.uvue'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import { fetchAdminSettlementDetail } from '@/services/homeServiceService.uts'
|
||||
import { HomeServiceSettlementType } from '@/types/home-service.uts'
|
||||
|
||||
const caseId = ref('case-001')
|
||||
const detail = ref<HomeServiceSettlementType | null>(null)
|
||||
|
||||
async function loadData() {
|
||||
detail.value = await fetchAdminSettlementDetail(caseId.value)
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
const id = options['id']
|
||||
if (id != null && id != '') {
|
||||
caseId.value = id as string
|
||||
}
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.empty-box {
|
||||
padding: 120rpx 0;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.empty-text,
|
||||
.amount-line,
|
||||
.archive-text {
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #16324f;
|
||||
}
|
||||
|
||||
.amount-card,
|
||||
.archive-box {
|
||||
padding: 24rpx;
|
||||
border-radius: 20rpx;
|
||||
background: #f8fbfc;
|
||||
}
|
||||
|
||||
.amount-line + .amount-line {
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.archive-text {
|
||||
color: #66788a;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<ServicePageScaffold title="到岗签到" fallback-url="/pages/mall/merchant/home-service/tasks">
|
||||
<ServicePanel title="到岗签到" subtitle="先用 mock 方式记录签到结果、到岗说明和留痕提示。">
|
||||
<text class="info">任务编号:{{ taskNo }}</text>
|
||||
<text class="info">当前状态:{{ taskStatus }}</text>
|
||||
@@ -17,12 +17,13 @@
|
||||
</view>
|
||||
<view class="submit-btn" @click="submitCheckIn">确认签到</view>
|
||||
</ServicePanel>
|
||||
</scroll-view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import { fetchWorkerTaskDetail, submitWorkerCheckIn } from '@/services/homeServiceService.uts'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<ServicePageScaffold title="异常上报" fallback-url="/pages/mall/merchant/home-service/tasks">
|
||||
<ServicePanel title="异常上报" subtitle="先完成异常类型、说明和调度通知的 mock 处理。">
|
||||
<text class="info">任务编号:{{ taskNo }}</text>
|
||||
<view class="block">
|
||||
@@ -26,12 +26,13 @@
|
||||
</view>
|
||||
<view class="submit-btn warn" @click="submitException">提交异常</view>
|
||||
</ServicePanel>
|
||||
</scroll-view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import { fetchWorkerTaskDetail, submitWorkerException } from '@/services/homeServiceService.uts'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<ServicePageScaffold title="服务记录" fallback-url="/pages/mall/merchant/home-service/tasks">
|
||||
<ServicePanel title="服务记录" subtitle="本页先记录执行摘要、服务步骤和后续待上传凭证占位。">
|
||||
<text class="info">任务编号:{{ taskNo }}</text>
|
||||
<view class="block">
|
||||
@@ -16,12 +16,13 @@
|
||||
</view>
|
||||
<view class="submit-btn" @click="submitRecord">保存记录</view>
|
||||
</ServicePanel>
|
||||
</scroll-view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import { fetchWorkerTaskDetail, submitWorkerServiceRecord } from '@/services/homeServiceService.uts'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<ServicePageScaffold title="任务详情" fallback-url="/pages/mall/merchant/home-service/tasks">
|
||||
<view v-if="detail == null" class="empty-box">
|
||||
<text class="empty-text">未找到任务详情</text>
|
||||
</view>
|
||||
@@ -38,12 +38,13 @@
|
||||
<ServiceTimeline :items="detail.timeline"></ServiceTimeline>
|
||||
</ServicePanel>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServiceActionRow from '@/components/homeService/ServiceActionRow.uvue'
|
||||
import ServiceInfoCard from '@/components/homeService/ServiceInfoCard.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<ServicePageScaffold title="执行任务">
|
||||
<ServicePanel title="执行任务" subtitle="按移动执行页风格,先做任务卡片与状态动作。">
|
||||
<view v-for="item in tasks" :key="item.id" class="task-card" @click="goDetail(item.id)">
|
||||
<view class="task-top">
|
||||
@@ -15,12 +15,13 @@
|
||||
<view class="action-btn">{{ item.actionText }}</view>
|
||||
</view>
|
||||
</ServicePanel>
|
||||
</scroll-view>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import ServiceStatusTag from '@/components/homeService/ServiceStatusTag.uvue'
|
||||
import { fetchWorkerTasks } from '@/services/homeServiceService.uts'
|
||||
|
||||
281
报错信息.txt
281
报错信息.txt
@@ -1,207 +1,74 @@
|
||||
=== index页面onShow被调用 ===
|
||||
mp.esm.js:529 主页重新显示,重置页面状态
|
||||
mp.esm.js:529 主页首次显示,跳过onShow中的用户资料检查,交由initData处理
|
||||
mp.esm.js:529 === index页面onShow执行完成 ===
|
||||
mp.esm.js:529 [Login] ▶ onMounted 开始
|
||||
mp.esm.js:529 [Login] 📝 form 初始值: UTSJSONObject {account: "", password: "(ref 已被其他逻辑覆盖)", toJSON: undefined, _resolveKeyPath: ƒ, _getValue: ƒ, …}
|
||||
mp.esm.js:529 [Login] 📦 读取 storage[rememberEmail]:
|
||||
mp.esm.js:529 [Login] ℹ️ 无缓存,使用默认账号密码(已由 ref 初始化)
|
||||
mp.esm.js:529 [Login] 📝 onMounted 完成,最终 form 値: UTSJSONObject {account: "", isDefault: false, toJSON: undefined, _resolveKeyPath: ƒ, _getValue: ƒ, …}
|
||||
[system] Launch Time: 7027 ms
|
||||
mp.esm.js:529 [ak-req] POST http://119.146.131.237:9126/auth/v1/token?grant_type=password
|
||||
mp.esm.js:529 [ak-req] apikey: eyJhbG...7890 | Authorization: Bearer eyJhbG...7890 | auth-mode: anon-key | prefer: (none)
|
||||
mp.esm.js:529 [SignInPersist] access token stored: eyJhbG...XZrEdE
|
||||
mp.esm.js:529 [SignInPersist] refresh token stored: mlvwsvdwrc5b
|
||||
mp.esm.js:529 [SignInPersist] expires_at stored: 1778732276
|
||||
mp.esm.js:529 signIn result: AkSupaSignInResult {access_token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJiN…HNlfQ.nwTcxi618xZggVkO8iNcYCCSZJtGxZrYnt0emXZrEdE", refresh_token: "mlvwsvdwrc5b", expires_at: 1778732276, user: UTSJSONObject, token_type: "bearer", …}
|
||||
mp.esm.js:529 [AkSupaQueryBuilder] execute - 表: ak_users filter: auth_id=eq.b653fded-7d5e-4950-aa0d-725595543e3c
|
||||
mp.esm.js:529 [ak-req] GET http://119.146.131.237:9126/rest/v1/ak_users?select=id%2C%20role&auth_id=eq.b653fded-7d5e-4950-aa0d-725595543e3c
|
||||
mp.esm.js:529 [ak-req] apikey: eyJhbG...7890 | Authorization: Bearer eyJhbG...rEdE | auth-mode: pre-set | prefer: (none)
|
||||
mp.esm.js:529 [AkSupaQueryBuilder] execute - 表: ak_users filter: auth_id=eq.b653fded-7d5e-4950-aa0d-725595543e3c
|
||||
mp.esm.js:529 [ak-req] GET http://119.146.131.237:9126/rest/v1/ak_users?select=*&auth_id=eq.b653fded-7d5e-4950-aa0d-725595543e3c
|
||||
mp.esm.js:529 [ak-req] apikey: eyJhbG...7890 | Authorization: Bearer eyJhbG...rEdE | auth-mode: pre-set | prefer: (none)
|
||||
mp.esm.js:529 Profile Load Result: AkReqResponse {status: 200, data: Array(1), headers: Proxy, error: null, total: 1, …}
|
||||
mp.esm.js:529 fetch profile success: UserProfile {id: "b653fded-7d5e-4950-aa0d-725595543e3c", username: "test_user", email: "test@mall.com", gender: null, birthday: null, …}
|
||||
mp.esm.js:529 获取 Push CID 失败: UniError: getPushClientId:fail uniPush is not enabled
|
||||
at _construct (weapp:///http://127.0.0.1:50694/appservice/@babel/runtime/helpers/construct.js?forceSync=true:1:1227)
|
||||
at new r (weapp:///http://127.0.0.1:50694/appservice/@babel/runtime/helpers/wrapNativeSuper.js?forceSync=true:1:1357)
|
||||
at UniError2.<anonymous> (weapp:///http://127.0.0.1:50694/appservice/@babel/runtime/helpers/createSuper.js?forceSync=true:1:1176)
|
||||
at new UniError2 (weapp:///http://127.0.0.1:50694/appservice/common/vendor.js?t=wechat&s=1778722325335&v=7a2b56415f28ccea76c623b821c329c0:890:22)
|
||||
at invokeFail (weapp:///http://127.0.0.1:50694/appservice/common/vendor.js?t=wechat&s=1778722325335&v=7a2b56415f28ccea76c623b821c329c0:7110:101)
|
||||
at reject (weapp:///http://127.0.0.1:50694/appservice/common/vendor.js?t=wechat&s=1778722325335&v=7a2b56415f28ccea76c623b821c329c0:7145:16)
|
||||
at weapp:///http://127.0.0.1:50694/appservice/common/vendor.js?t=wechat&s=1778722325335&v=7a2b56415f28ccea76c623b821c329c0:7530:9
|
||||
at weapp:///http://127.0.0.1:50694/appservice/common/vendor.js?t=wechat&s=1778722325335&v=7a2b56415f28ccea76c623b821c329c0:7510:5
|
||||
at Array.forEach (<anonymous>)
|
||||
at invokeGetPushCidCallbacks (weapp:///http://127.0.0.1:50694/appservice/common/vendor.js?t=wechat&s=1778722325335&v=7a2b56415f28ccea76c623b821c329c0:7509:23)
|
||||
(anonymous) @ mp.esm.js:529
|
||||
__f__ @ uni.api.esm.js:590
|
||||
fail @ login.uvue:598
|
||||
(anonymous) @ uni.api.esm.js:156
|
||||
(anonymous) @ uni.api.esm.js:226
|
||||
invokeCallback @ uni.api.esm.js:183
|
||||
invokeFail @ uni.api.esm.js:397
|
||||
reject @ uni.api.esm.js:426
|
||||
(anonymous) @ uni.api.esm.js:812
|
||||
(anonymous) @ uni.api.esm.js:795
|
||||
invokeGetPushCidCallbacks @ uni.api.esm.js:794
|
||||
(anonymous) @ uni.api.esm.js:816
|
||||
Promise.then (async)
|
||||
(anonymous) @ uni.api.esm.js:801
|
||||
(anonymous) @ uni.api.esm.js:424
|
||||
invokeApi @ uni.api.esm.js:330
|
||||
(anonymous) @ uni.api.esm.js:353
|
||||
invokeApi @ uni.api.esm.js:330
|
||||
promiseApi @ uni.api.esm.js:889
|
||||
_callee4$ @ login.uvue:579
|
||||
s @ regeneratorRuntime.js?forceSync=true:1
|
||||
(anonymous) @ regeneratorRuntime.js?forceSync=true:1
|
||||
(anonymous) @ regeneratorRuntime.js?forceSync=true:1
|
||||
fulfilled @ uni.mp.esm.js:1134
|
||||
Promise.then (async)
|
||||
step @ uni.mp.esm.js:1134
|
||||
fulfilled @ uni.mp.esm.js:1134
|
||||
Promise.then (async)
|
||||
step @ uni.mp.esm.js:1134
|
||||
fulfilled @ uni.mp.esm.js:1134
|
||||
Promise.then (async)
|
||||
step @ uni.mp.esm.js:1134
|
||||
(anonymous) @ uni.mp.esm.js:1134
|
||||
__awaiter @ uni.mp.esm.js:1134
|
||||
handleLogin @ login.uvue:437
|
||||
callWithErrorHandling @ vue.runtime.esm.js:1356
|
||||
callWithAsyncErrorHandling @ vue.runtime.esm.js:1363
|
||||
invoke @ vue.runtime.esm.js:6223
|
||||
setTimeout (async)
|
||||
invoker @ vue.runtime.esm.js:6232
|
||||
[自动热重载] 已开启代码文件保存后自动热重载
|
||||
mp.esm.js:529 === index页面onShow被调用 ===
|
||||
mp.esm.js:529 主页重新显示,重置页面状态
|
||||
mp.esm.js:529 主页首次显示,跳过onShow中的用户资料检查,交由initData处理
|
||||
mp.esm.js:529 === index页面onShow执行完成 ===
|
||||
wx.getSystemInfoSync is deprecated.Please use wx.getSystemSetting/wx.getAppAuthorizeSetting/wx.getDeviceInfo/wx.getWindowInfo/wx.getAppBaseInfo instead.
|
||||
(anonymous) @ uni.api.esm.js:1042
|
||||
initPage @ index.uvue:1358
|
||||
(anonymous) @ index.uvue:1401
|
||||
(anonymous) @ vue.runtime.esm.js:2483
|
||||
callWithErrorHandling @ vue.runtime.esm.js:1356
|
||||
callWithAsyncErrorHandling @ vue.runtime.esm.js:1363
|
||||
hook.__weh.hook.__weh @ vue.runtime.esm.js:2461
|
||||
invokeArrayFns @ uni-shared.es.js:1344
|
||||
callHook @ uni.mp.esm.js:241
|
||||
ready @ uni.mp.esm.js:1039
|
||||
mp.esm.js:529 [SupaConfig] SUPA_URL : http://119.146.131.237:9126
|
||||
mp.esm.js:529 [SupaConfig] SUPA_KEY : eyJhbGciOi...34567890
|
||||
mp.esm.js:529 [IndexInit] 准备加载首页数据,确认当前请求将使用上述 SUPA_URL
|
||||
mp.esm.js:529 [AkSupaQueryBuilder] execute - 表: ak_users filter: auth_id=eq.b653fded-7d5e-4950-aa0d-725595543e3c
|
||||
mp.esm.js:529 [ak-req] GET http://119.146.131.237:9126/rest/v1/ak_users?select=*&auth_id=eq.b653fded-7d5e-4950-aa0d-725595543e3c
|
||||
mp.esm.js:529 [ak-req] apikey: eyJhbG...7890 | Authorization: Bearer eyJhbG...rEdE | auth-mode: pre-set | prefer: (none)
|
||||
mp.esm.js:529 Profile Load Result: AkReqResponse {status: 200, data: Array(1), headers: Proxy, error: null, total: 1, …}
|
||||
mp.esm.js:529 主页初始化:用户资料加载完成
|
||||
mp.esm.js:529 [AkSupaQueryBuilder] execute - 表: ml_categories filter: parent_id=is.null
|
||||
mp.esm.js:529 [ak-req] GET http://119.146.131.237:9126/rest/v1/ml_categories?select=*&order=sort_order.asc&parent_id=is.null
|
||||
mp.esm.js:529 [ak-req] apikey: eyJhbG...7890 | Authorization: Bearer eyJhbG...rEdE | auth-mode: pre-set | prefer: (none)
|
||||
mp.esm.js:529 一级分类数据: [{"id":"e3a8b95c-80ad-4a64-8962-7663d55697f0","name":"数码电器","icon":"📱","description":"手机、电脑、家电等数码产品","color":"#ff5000","parent_id":null,"level":1,"slug":"digital","created_at":null},{"id":"86cfa659-fae9-4f84-920f-75073907eecc","name":"服装鞋帽","icon":"👕","description":"男装、女装、鞋子、配饰","color":"#ff5000","parent_id":null,"level":1,"slug":"fashion","created_at":null},{"id":"79cd5b69-f914-4358-ac05-bcce9919c483","name":"家居用品","icon":"🏠","description":"家具、装饰、生活用品","color":"#ff5000","parent_id":null,"level":1,"slug":"home","created_at":null},{"id":"ad6cb41c-eca6-4f81-a5ba-8177a621497f","name":"食品饮料","icon":"🍎","description":"新鲜食材、零食、饮品","color":"#ff5000","parent_id":null,"level":1,"slug":"food","created_at":null},{"id":"55169612-358e-4203-8c98-33d037cd7dde","name":"美妆护肤","icon":"💄","description":"化妆品、护肤品、个人护理","color":"#ff5000","parent_id":null,"level":1,"slug":"beauty","created_at":null},{"id":"5a1b6acc-104e-4b2b-b2a1-47a715155b0c","name":"运动户外","icon":"⚽","description":"运动器材、户外装备、健身用品","color":"#ff5000","parent_id":null,"level":1,"slug":"sports","created_at":null},{"id":"bc77baa7-c17b-40ff-a276-aabcf6c92f5e","name":"图书文娱","icon":"📚","description":"图书、音像、文具、玩具","color":"#ff5000","parent_id":null,"level":1,"slug":"books","created_at":null},{"id":"d3fa79f9-0dc7-4984-a7b3-742e802b99c9","name":"母婴用品","icon":"👶","description":"婴儿用品、孕妇用品、儿童玩具","color":"#ff5000","parent_id":null,"level":1,"slug":"baby","created_at":null},{"id":"65d46471-90e7-468b-a515-d039cfa29c35","name":"医药健康","icon":"💊","description":"","color":"#ff5000","parent_id":null,"level":1,"slug":"health","created_at":null}]
|
||||
mp.esm.js:529 [getBrands] 开始获取品牌数据...
|
||||
mp.esm.js:529 [AkSupaQueryBuilder] execute - 表: ml_brands filter: null
|
||||
mp.esm.js:529 [ak-req] GET http://119.146.131.237:9126/rest/v1/ml_brands?select=id%2C%20name%2C%20logo_url%2C%20description%2C%20is_active&order=name.asc
|
||||
mp.esm.js:529 [ak-req] apikey: eyJhbG...7890 | Authorization: Bearer eyJhbG...rEdE | auth-mode: pre-set | prefer: (none)
|
||||
mp.esm.js:529 [getBrands] 数据条数: 10
|
||||
mp.esm.js:529 [getBrands] 返回品牌数量: 10
|
||||
mp.esm.js:529 [AkSupaQueryBuilder] execute - 表: ml_search_history filter: null
|
||||
mp.esm.js:529 [ak-req] GET http://119.146.131.237:9126/rest/v1/ml_search_history?select=keyword&limit=100&order=created_at.desc
|
||||
mp.esm.js:529 [ak-req] apikey: eyJhbG...7890 | Authorization: Bearer eyJhbG...rEdE | auth-mode: pre-set | prefer: count=exact
|
||||
mp.esm.js:529 加载热搜词: 3 个
|
||||
mp.esm.js:529 [getSmartRecommendations] 开始获取智能推荐...
|
||||
mp.esm.js:529 [AkSupaQueryBuilder] execute - 表: ml_search_history filter: null
|
||||
mp.esm.js:529 [ak-req] GET http://119.146.131.237:9126/rest/v1/ml_search_history?select=keyword&limit=10&order=created_at.desc
|
||||
mp.esm.js:529 [ak-req] apikey: eyJhbG...7890 | Authorization: Bearer eyJhbG...rEdE | auth-mode: pre-set | prefer: count=exact
|
||||
mp.esm.js:529 [getSmartRecommendations] 用户搜索历史: []
|
||||
mp.esm.js:529 [AkSupaQueryBuilder] execute - 表: ml_browse_history filter: null
|
||||
mp.esm.js:529 [ak-req] GET http://119.146.131.237:9126/rest/v1/ml_browse_history?select=product_id&limit=20&order=created_at.desc
|
||||
mp.esm.js:529 [ak-req] apikey: eyJhbG...7890 | Authorization: Bearer eyJhbG...rEdE | auth-mode: pre-set | prefer: count=exact
|
||||
mp.esm.js:529 [getSmartRecommendations] 用户浏览分类: []
|
||||
mp.esm.js:529 [getHotProducts] 开始获取热销商品...
|
||||
mp.esm.js:529 [AkSupaQueryBuilder] execute - 表: ml_products_detail_view filter: status=eq.1
|
||||
mp.esm.js:529 [ak-req] GET http://119.146.131.237:9126/rest/v1/ml_products_detail_view?select=id%2C%20name%2C%20description%2C%20base_price%2C%20market_price%2C%20main_image_url%2C%20image_urls%2C%20category_id%2C%20brand_id%2C%20merchant_id%2C%20total_stock%2C%20sale_count%2C%20status%2C%20is_featured%2C%20is_new%2C%20is_hot&limit=60&order=sale_count.desc&status=eq.1
|
||||
mp.esm.js:529 [ak-req] apikey: eyJhbG...7890 | Authorization: Bearer eyJhbG...rEdE | auth-mode: pre-set | prefer: count=exact
|
||||
mp.esm.js:529 [getHotProducts] 原始数据条数: 60
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: iPhone 15 Pro 256GB 深空黑色
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: Nike Air Max 270 男士运动鞋
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: 厨具精选优品 4号 - 超值装
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: 老干妈风味豆豉
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: 男装精选优品 4号 - 超值装
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: 新鲜水果精选优品 2号 - 家庭装
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: 零食坚果精选优品 4号 - 超值装
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: 测试1
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: 瑞山天泉15L(20桶送2桶)
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: 加厚垃圾袋
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: 瑞山天泉15L(20桶送2桶)
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: 宜家 - 明星单品系列 03
|
||||
mp.esm.js:529 [getHotProducts] 最终返回商品数: 12
|
||||
mp.esm.js:529 [getSmartRecommendations] 返回商品数量: 6
|
||||
mp.esm.js:529 [getRecommendedProducts] 开始获取推荐商品...
|
||||
mp.esm.js:529 [AkSupaQueryBuilder] execute - 表: ml_products_detail_view filter: status=eq.1
|
||||
mp.esm.js:529 [ak-req] GET http://119.146.131.237:9126/rest/v1/ml_products_detail_view?select=id%2C%20name%2C%20description%2C%20base_price%2C%20market_price%2C%20main_image_url%2C%20image_urls%2C%20category_id%2C%20brand_id%2C%20merchant_id%2C%20total_stock%2C%20sale_count%2C%20status%2C%20is_featured%2C%20is_new%2C%20is_hot&limit=30&order=sale_count.desc&status=eq.1
|
||||
mp.esm.js:529 [ak-req] apikey: eyJhbG...7890 | Authorization: Bearer eyJhbG...rEdE | auth-mode: pre-set | prefer: count=exact
|
||||
mp.esm.js:529 [getRecommendedProducts] 查询完成
|
||||
mp.esm.js:529 [getRecommendedProducts] 数据条数: 30
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: 九阳破壁机
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: UNIQLO 优质棉圆领T恤(短袖)
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: iPhone 15 Pro 256GB 深空黑色
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: vc
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: Nike Air Max 270 男士运动鞋
|
||||
mp.esm.js:529 [parseProductFromRaw] 开始解析商品
|
||||
mp.esm.js:529 [parseProductFromRaw] JSON转换成功
|
||||
mp.esm.js:529 [parseProductFromRaw] 图片处理完成
|
||||
mp.esm.js:529 [parseProductFromRaw] 商品解析成功: 店铺1 - 甄选商品 1
|
||||
Error: MiniProgramError
|
||||
{"errMsg":"navigateTo:fail page \"pages/mall/consumer/home-service/apply\" is not found"}
|
||||
at Object.errorReport (WAServiceMainContext.js?t=wechat&v=3.14.2:1)
|
||||
at Function.thirdErrorReport (WAServiceMainContext.js?t=wechat&v=3.14.2:1)
|
||||
at Object.thirdErrorReport (WAServiceMainContext.js?t=wechat&v=3.14.2:1)
|
||||
at i (VM3754 WASubContext.js:1)
|
||||
at Object.cb (VM3754 WASubContext.js:1)
|
||||
at X._privEmit (VM3754 WASubContext.js:1)
|
||||
at X.emit (VM3754 WASubContext.js:1)
|
||||
at VM3754 WASubContext.js:1
|
||||
at n (VM3754 WASubContext.js:1)
|
||||
at He (VM3754 WASubContext.js:1)(env: Windows,mp,1.06.2504030; lib: 3.14.2)
|
||||
mp.esm.js:170 {reason: {…}, promise: Promise}(env: Windows,mp,1.06.2504030; lib: 3.14.2)
|
||||
onError2 @ mp.esm.js:170
|
||||
(anonymous) @ uni.api.esm.js:946
|
||||
[Deprecation] SharedArrayBuffer will require cross-origin isolation as of M92, around July 2021. See https://developer.chrome.com/blog/enabling-shared-array-buffer/ for more details.
|
||||
Error: MiniProgramError
|
||||
{"errMsg":"navigateTo:fail page \"pages/mall/consumer/home-service/index\" is not found"}
|
||||
at Object.errorReport (WAServiceMainContext.js?t=wechat&v=3.14.2:1)
|
||||
at Function.thirdErrorReport (WAServiceMainContext.js?t=wechat&v=3.14.2:1)
|
||||
at Object.thirdErrorReport (WAServiceMainContext.js?t=wechat&v=3.14.2:1)
|
||||
at i (VM3754 WASubContext.js:1)
|
||||
at Object.cb (VM3754 WASubContext.js:1)
|
||||
at X._privEmit (VM3754 WASubContext.js:1)
|
||||
at X.emit (VM3754 WASubContext.js:1)
|
||||
at VM3754 WASubContext.js:1
|
||||
at n (VM3754 WASubContext.js:1)
|
||||
at He (VM3754 WASubContext.js:1)(env: Windows,mp,1.06.2504030; lib: 3.14.2)
|
||||
mp.esm.js:170 {reason: {…}, promise: Promise}(env: Windows,mp,1.06.2504030; lib: 3.14.2)
|
||||
onError2 @ mp.esm.js:170
|
||||
(anonymous) @ uni.api.esm.js:946
|
||||
Error: MiniProgramError
|
||||
{"errMsg":"navigateTo:fail page \"pages/mall/consumer/home-service/order-detail?id=case-001\" is not found"}
|
||||
at Object.errorReport (WAServiceMainContext.js?t=wechat&v=3.14.2:1)
|
||||
at Function.thirdErrorReport (WAServiceMainContext.js?t=wechat&v=3.14.2:1)
|
||||
at Object.thirdErrorReport (WAServiceMainContext.js?t=wechat&v=3.14.2:1)
|
||||
at i (VM3754 WASubContext.js:1)
|
||||
at Object.cb (VM3754 WASubContext.js:1)
|
||||
at X._privEmit (VM3754 WASubContext.js:1)
|
||||
at X.emit (VM3754 WASubContext.js:1)
|
||||
at VM3754 WASubContext.js:1
|
||||
at n (VM3754 WASubContext.js:1)
|
||||
at He (VM3754 WASubContext.js:1)(env: Windows,mp,1.06.2504030; lib: 3.14.2)
|
||||
mp.esm.js:170 {reason: {…}, promise: Promise}(env: Windows,mp,1.06.2504030; lib: 3.14.2)
|
||||
onError2 @ mp.esm.js:170
|
||||
(anonymous) @ uni.api.esm.js:946
|
||||
Error: MiniProgramError
|
||||
{"errMsg":"navigateTo:fail page \"pages/mall/consumer/home-service/order-detail?id=case-002\" is not found"}
|
||||
at Object.errorReport (WAServiceMainContext.js?t=wechat&v=3.14.2:1)
|
||||
at Function.thirdErrorReport (WAServiceMainContext.js?t=wechat&v=3.14.2:1)
|
||||
at Object.thirdErrorReport (WAServiceMainContext.js?t=wechat&v=3.14.2:1)
|
||||
at i (VM3754 WASubContext.js:1)
|
||||
at Object.cb (VM3754 WASubContext.js:1)
|
||||
at X._privEmit (VM3754 WASubContext.js:1)
|
||||
at X.emit (VM3754 WASubContext.js:1)
|
||||
at VM3754 WASubContext.js:1
|
||||
at n (VM3754 WASubContext.js:1)
|
||||
at He (VM3754 WASubContext.js:1)(env: Windows,mp,1.06.2504030; lib: 3.14.2)
|
||||
mp.esm.js:170 {reason: {…}, promise: Promise}(env: Windows,mp,1.06.2504030; lib: 3.14.2)
|
||||
onError2 @ mp.esm.js:170
|
||||
(anonymous) @ uni.api.esm.js:946
|
||||
Error: MiniProgramError
|
||||
{"errMsg":"navigateTo:fail page \"pages/mall/consumer/home-service/feedback?id=case-001\" is not found"}
|
||||
at Object.errorReport (WAServiceMainContext.js?t=wechat&v=3.14.2:1)
|
||||
at Function.thirdErrorReport (WAServiceMainContext.js?t=wechat&v=3.14.2:1)
|
||||
at Object.thirdErrorReport (WAServiceMainContext.js?t=wechat&v=3.14.2:1)
|
||||
at i (VM3754 WASubContext.js:1)
|
||||
at Object.cb (VM3754 WASubContext.js:1)
|
||||
at X._privEmit (VM3754 WASubContext.js:1)
|
||||
at X.emit (VM3754 WASubContext.js:1)
|
||||
at VM3754 WASubContext.js:1
|
||||
at n (VM3754 WASubContext.js:1)
|
||||
at He (VM3754 WASubContext.js:1)(env: Windows,mp,1.06.2504030; lib: 3.14.2)
|
||||
mp.esm.js:170 {reason: {…}, promise: Promise}(env: Windows,mp,1.06.2504030; lib: 3.14.2)
|
||||
Reference in New Issue
Block a user