consumer模块完成度95%,准备部署消费者端测试
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<template>
|
||||
<template>
|
||||
<view class="search-page">
|
||||
<!-- 搜索头部 -->
|
||||
<view class="search-header" :style="{ paddingTop: statusBarHeight + 'px' }">
|
||||
@@ -486,33 +486,23 @@ const performSearch = async (): Promise<void> => {
|
||||
try {
|
||||
const prodResp = await supabaseService.searchProducts(keyword, currentPage.value, 20, sortBy, ascending)
|
||||
|
||||
let shopRespData: Array<any> = []
|
||||
let shopList: Array<ShopResultType> = []
|
||||
if (currentPage.value === 1 && activeSort.value === 'default') {
|
||||
const shopResp = await supabaseService.searchShops(keyword)
|
||||
if (shopResp.data != null) {
|
||||
const rawData = shopResp.data
|
||||
for (let i: number = 0; i < rawData.length; i++) {
|
||||
shopRespData.push(rawData[i])
|
||||
if (shopResp.data != null && shopResp.data.length > 0) {
|
||||
for (let i: number = 0; i < shopResp.data.length; i++) {
|
||||
const s = shopResp.data[i]
|
||||
const shopItem: ShopResultType = {
|
||||
id: s.id ?? '',
|
||||
name: s.shop_name ?? '',
|
||||
logo: s.shop_logo ?? '/static/shop_logo_default.png',
|
||||
productCount: s.product_count ?? 0
|
||||
}
|
||||
shopList.push(shopItem)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (shopRespData.length > 0) {
|
||||
const shopList: Array<ShopResultType> = []
|
||||
for (let i: number = 0; i < shopRespData.length; i++) {
|
||||
const s = shopRespData[i] as UTSJSONObject
|
||||
const shopItem: ShopResultType = {
|
||||
id: s.getString('id') ?? '',
|
||||
name: s.getString('shop_name') ?? '',
|
||||
logo: s.getString('shop_logo') ?? '/static/shop_logo_default.png',
|
||||
productCount: s.getNumber('product_count') ?? 0
|
||||
}
|
||||
shopList.push(shopItem)
|
||||
}
|
||||
searchShopResults.value = shopList
|
||||
} else {
|
||||
searchShopResults.value = []
|
||||
}
|
||||
searchShopResults.value = shopList
|
||||
|
||||
const prodData = prodResp.data != null ? prodResp.data : []
|
||||
const resultList: Array<SearchResultType> = []
|
||||
@@ -1344,7 +1334,7 @@ const goBack = () => {
|
||||
}
|
||||
|
||||
.guess-item {
|
||||
width: 24%; /* 猜你喜欢在平板上显示4列 */
|
||||
width: 24%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1352,20 +1342,42 @@ const goBack = () => {
|
||||
@media screen and (min-width: 1024px) {
|
||||
.results-list {
|
||||
padding: 0 24px;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.result-item {
|
||||
width: 24%;
|
||||
width: 19%;
|
||||
}
|
||||
|
||||
.guess-item {
|
||||
width: 16%; /* 猜你喜欢在桌面上显示6列 */
|
||||
width: 16%;
|
||||
}
|
||||
|
||||
/* 桌面端调整图片高度 */
|
||||
.product-image {
|
||||
height: 160px;
|
||||
}
|
||||
|
||||
.guess-grid {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
/* 大屏幕 (1440px以上) */
|
||||
@media screen and (min-width: 1440px) {
|
||||
.result-item {
|
||||
width: 16%;
|
||||
}
|
||||
|
||||
.guess-item {
|
||||
width: 12%;
|
||||
}
|
||||
}
|
||||
|
||||
.result-item {
|
||||
@@ -1518,3 +1530,4 @@ const goBack = () => {
|
||||
height: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user