Commit 9297ce65 by Lin

fix(HomeFrame): Update project name and enhance product listing logic

- Changed projectName from 'boutique' to 'pad' in API calls for consistency.
- Updated console log to retrieve sessionId from storage for better debugging.
- Enhanced getActivityProductList method to include detailed product information and dynamic data handling.
- Improved ActivityTime component to display product images and activity times dynamically.
- Refactored data mapping to ensure accurate representation of product details in the UI.
1 parent a644db22
...@@ -725,7 +725,7 @@ module.exports = { ...@@ -725,7 +725,7 @@ module.exports = {
getPrelernHomePopupAPI(data = {}) { getPrelernHomePopupAPI(data = {}) {
return http.post({ return http.post({
method: 'dj.api.pad.prelearn.home.popup', method: 'dj.api.pad.prelearn.home.popup',
projectName: 'boutique', projectName: 'pad',
...data ...data
}) })
}, },
...@@ -735,7 +735,7 @@ module.exports = { ...@@ -735,7 +735,7 @@ module.exports = {
deductSkipCountAPI(data = {}) { deductSkipCountAPI(data = {}) {
return http.post({ return http.post({
method: 'dj.api.pad.prelearn.deduct.skip', method: 'dj.api.pad.prelearn.deduct.skip',
projectName: 'boutique', projectName: 'pad',
...data ...data
}) })
}, },
......
...@@ -34,12 +34,12 @@ ...@@ -34,12 +34,12 @@
<view class="goods-img-wrap"> <view class="goods-img-wrap">
<image <image
class="goods-img" class="goods-img"
:src="require('@/assets/images/common/bg-activity-time.png')" :src="mainImageUrl"
mode="aspectFill" mode="aspectFill"
/> />
<view class="tiem-tag"> <view class="tiem-tag">
<image class="tiem-tag-img" :src="require('@/assets/images/common/icon-activity-date.png')" mode="aspectFit"></image> <image class="tiem-tag-img" :src="require('@/assets/images/common/icon-activity-date.png')" mode="aspectFit"></image>
<text class="tiem-tag-text">活动时间:2026-11-01至2026-11-10</text> <text class="tiem-tag-text">活动时间:{{startTime}}至{{endTime}}</text>
</view> </view>
</view> </view>
...@@ -51,14 +51,14 @@ ...@@ -51,14 +51,14 @@
:class="['goods-item', { active: goodsIndex === index }]" :class="['goods-item', { active: goodsIndex === index }]"
@click="handleGoodsClick(item, index)" @click="handleGoodsClick(item, index)"
> >
<view v-if="item.isMain" class="goods-item-badge">主推</view> <view v-if="item.isMainPush" class="goods-item-badge">主推</view>
<view v-else class="goods-item-badge badge02">次推</view> <view v-else class="goods-item-badge badge02">次推</view>
<view class="goods-item-img-wrap"> <view class="goods-item-img-wrap">
<image class="goods-item-img" :src="item.cover" mode="aspectFill" /> <image class="goods-item-img" :src="item.thumbImageUrl" mode="aspectFill" />
</view> </view>
<view class="goods-item-content"> <view class="goods-item-content">
<text class="goods-item-name">{{ item.name }}</text> <text class="goods-item-name">{{ item.name }}</text>
<text class="goods-item-desc">{{ item.description }}</text> <view class="goods-item-desc text-two-line">{{ item.description }}</view>
<view class="goods-item-price-wrap"> <view class="goods-item-price-wrap">
<text class="goods-item-price">¥ {{ item.price }}</text> <text class="goods-item-price">¥ {{ item.price }}</text>
<text v-if="item.originalPrice" class="goods-item-original-price">¥ {{ item.originalPrice }}</text> <text v-if="item.originalPrice" class="goods-item-original-price">¥ {{ item.originalPrice }}</text>
...@@ -159,6 +159,18 @@ export default { ...@@ -159,6 +159,18 @@ export default {
? this.carSeriesList.flatMap(series => series.productList ?? []) ? this.carSeriesList.flatMap(series => series.productList ?? [])
: (this.selectedCarTab?.productList ?? []) : (this.selectedCarTab?.productList ?? [])
return productList.map(product => this.mapProductItem(product)) return productList.map(product => this.mapProductItem(product))
},
selectedGoods() {
return this.goodsList[this.goodsIndex] || {}
},
mainImageUrl() {
return this.selectedGoods.mainImageUrl
},
startTime() {
return this.selectedGoods.startTime || ''
},
endTime() {
return this.selectedGoods.endTime || ''
} }
}, },
watch: { watch: {
...@@ -200,7 +212,11 @@ export default { ...@@ -200,7 +212,11 @@ export default {
description: product.tabDescription || '', description: product.tabDescription || '',
price: this.formatPrice(hasValidDiscount ? discountPrice : currentPrice), price: this.formatPrice(hasValidDiscount ? discountPrice : currentPrice),
originalPrice: hasValidDiscount ? this.formatPrice(currentPrice) : '', originalPrice: hasValidDiscount ? this.formatPrice(currentPrice) : '',
isMain: product.isMainPush === 1, isMainPush: product.isMainPush === 1,
mainImageUrl: product.mainImageUrl,
startTime: product.startTime,
endTime: product.endTime,
thumbImageUrl: product.thumbImageUrl,
cover: GOODS_COVER cover: GOODS_COVER
} }
}, },
...@@ -456,12 +472,9 @@ export default { ...@@ -456,12 +472,9 @@ export default {
font-size: 13px; font-size: 13px;
line-height: 16px; line-height: 16px;
color: #999EA8; color: #999EA8;
overflow: hidden; white-space: normal;
display: -webkit-box; word-break: break-all;
-webkit-box-orient: vertical; overflow-wrap: break-word;
-webkit-line-clamp: 2;
line-clamp: 2;
height: 32px;
} }
.goods-item-price-wrap { .goods-item-price-wrap {
......
...@@ -393,7 +393,7 @@ export default { ...@@ -393,7 +393,7 @@ export default {
uni.$off('pageBack') uni.$off('pageBack')
}, },
async mounted() { async mounted() {
console.log('sessionId', this.sessionId) console.log('sessionId**', uni.$storage.get('sessionId'))
this._syncShowFloatLog() this._syncShowFloatLog()
this._unsubFloatLog = FloatLogConfig.subscribe(() => { this._unsubFloatLog = FloatLogConfig.subscribe(() => {
this._syncShowFloatLog() this._syncShowFloatLog()
...@@ -490,6 +490,8 @@ export default { ...@@ -490,6 +490,8 @@ export default {
this.getStoreBaseSceneCodeList() this.getStoreBaseSceneCodeList()
this.getStrategyStatus() this.getStrategyStatus()
this.getPrelearnHome()
}, },
methods: { methods: {
handleHomeContentTabClick(index) { handleHomeContentTabClick(index) {
...@@ -707,14 +709,14 @@ export default { ...@@ -707,14 +709,14 @@ export default {
* 查询策略首页数据状态(营销活动和客户列表是否有数据) * 查询策略首页数据状态(营销活动和客户列表是否有数据)
*/ */
async getStrategyStatus() { async getStrategyStatus() {
const res = await uni.$api.activityApi.getActivityStatusAPI() // const res = await uni.$api.activityApi.getActivityStatusAPI()
// const res = { // console.log('查询策略首页数据状态(营销活动和客户列表是否有数据):', res)
// marketingActivityHasData: true, const res = {
// customerListHasData: true marketingActivityHasData: true,
// } customerListHasData: true
}
if (!res) return if (!res) return
console.log('查询策略首页数据状态(营销活动和客户列表是否有数据):', res)
this.marketingActivityHasData = !!res.marketingActivityHasData this.marketingActivityHasData = !!res.marketingActivityHasData
this.customerListHasData = !!res.customerListHasData this.customerListHasData = !!res.customerListHasData
this.homeContentTabIndex = 0 this.homeContentTabIndex = 0
...@@ -724,55 +726,123 @@ export default { ...@@ -724,55 +726,123 @@ export default {
this.getActivityProductList() this.getActivityProductList()
} }
}, },
/**
* 查询当前进行中的营销活动商品列表
*/
async getActivityProductList() { async getActivityProductList() {
// const res = await uni.$api.activityApi.getActivityProductListAPI() const { merchantId } = uni.$storage.get('userInfo')
const res = [ console.log('**&&merchantId**', merchantId)
{ // const res = await uni.$api.activityApi.getActivityProductListAPI({merchantId: 44211227})
marketingStage:0, // console.log('查询当前进行中的营销活动商品列表:', res)
carSeriesList:[ const res = [{
{ "marketingStage": 0,
carSeriesId:'0001', "carSeriesList": [{
carSeriesName:'问界M5', "carSeriesId": -1,
productList:[ "carSeriesName": "通用",
{tabName:'这是活动商品/套餐限时保养套餐限时保养套餐',detailImageUrl:'免排队·省时·省钱,包含机油更换、机滤、空调滤全套服务。',tabDescription:1999,discountPrice:'',endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:9999,thumbImageUrl:'',productId:'',mainImageUrl:''}, "productList": [{
{tabName:'这是活动商品/套餐限时保养套餐限时保养套餐',detailImageUrl:'免排队·省时·省钱,包含机油更换、机滤、空调滤全套服务。',tabDescription:1999,discountPrice:'',endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:9999,thumbImageUrl:'',productId:'',mainImageUrl:''}, "productId": 11,
{tabName:'这是活动商品/套餐限时保养套餐限时保养套餐',detailImageUrl:'免排队·省时·省钱,包含机油更换、机滤、空调滤全套服务。',tabDescription:1999,discountPrice:'',endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:9999,thumbImageUrl:'',productId:'',mainImageUrl:''} "productType": 0,
] "tabName": "tttttttt",
}, "tabDescription": "ttttttttttttttttttttt22222",
{ "isMainPush": 1,
carSeriesId:'0002', "currentPrice": 1680,
carSeriesName:'问界M9', "discountPrice": 2334,
productList:[ "mainImageUrl": "https://jinrong-huidan-test.oss-cn-shenzhen.aliyuncs.com/png/1782268203073_9522/主图.png",
{tabName:'618大促精品套餐',detailImageUrl:'',tabDescription:'免排队·省时·省钱,包含机油更换、机滤、空调滤全套服务。',discountPrice:1990,endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:1999,thumbImageUrl:'',productId:'',mainImageUrl:''}, "thumbImageUrl": "https://jinrong-huidan-test.oss-cn-shenzhen.aliyuncs.com/png/1782268229667_7133/小图.png",
{tabName:'618大促精品套餐',detailImageUrl:'',tabDescription:'免排队·省时·省钱,包含机油更换、机滤、空调滤全套服务。',discountPrice:1990,endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:1999,thumbImageUrl:'',productId:'',mainImageUrl:''}, "detailImageUrl": "https://jinrong-huidan-test.oss-cn-shenzhen.aliyuncs.com/png/1782268222766_6445/详情图.png",
{tabName:'618大促精品套餐',detailImageUrl:'',tabDescription:'免排队·省时·省钱,包含机油更换、机滤、空调滤全套服务。',discountPrice:1990,endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:1999,thumbImageUrl:'',productId:'',mainImageUrl:''} "startTime": "06-01",
] "endTime": "06-30"
} },
] {
}, "productId": 3,
{ "productType": 1,
marketingStage:1, "tabName": "tttttttt",
carSeriesList:[ "tabDescription": "ttttttttttttttttttttt22222",
{ "isMainPush": 1,
carSeriesId:'1001', "currentPrice": 1680,
carSeriesName:'问界M5', "discountPrice": 2334,
productList:[ "mainImageUrl": "",
{tabName:'618大促精品套餐',detailImageUrl:'',tabDescription:'',discountPrice:'这是选项卡描述-包含机油更换、机滤、空调滤、空气滤全套服务,活动期间享受8折优惠,先到先得。',discountPrice:1990,endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:2200,thumbImageUrl:'',productId:'',mainImageUrl:''} "thumbImageUrl": "",
] "detailImageUrl": "",
}, "startTime": "06-01",
{ "endTime": "06-30"
carSeriesId:'1002', }
carSeriesName:'问界M7', ]
productList:[ }]
{tabName:'这是活动商品/套餐限时保养套餐限时保养套餐',detailImageUrl:'',tabDescription:'这是选项卡描述-包含机油更换、机滤、空调滤、空气滤全套服务,活动期间享受8折优惠,先到先得。',discountPrice:1899,endTime:'2026-11-10',startTime:'2026-11-01',isMainPush:0,productType:0,currentPrice:2100,thumbImageUrl:'',productId:'',mainImageUrl:''} },
] {
} "marketingStage": 1,
] "carSeriesList": [{
} "carSeriesId": 2001,
] "carSeriesName": "奔驰C级",
"productList": [{
"productId": 13,
"productType": 0,
"tabName": "tttttttt",
"tabDescription": "ttttttttttttttttttttt22222",
"isMainPush": 1,
"currentPrice": 3000,
"discountPrice": 60,
"mainImageUrl": null,
"thumbImageUrl": null,
"detailImageUrl": null,
"startTime": "06-01",
"endTime": "07-31"
},
{
"productId": 14,
"productType": 0,
"tabName": "tttttttt",
"tabDescription": "ttttttttttttttttttttt22222",
"isMainPush": 1,
"currentPrice": 3000,
"discountPrice": 60,
"mainImageUrl": null,
"thumbImageUrl": null,
"detailImageUrl": null,
"startTime": "06-01",
"endTime": "07-31"
},
{
"productId": 12,
"productType": 0,
"tabName": "tttttttt",
"tabDescription": "套餐 MPG2026051713284619631",
"isMainPush": 0,
"currentPrice": 3000,
"discountPrice": 60,
"mainImageUrl": null,
"thumbImageUrl": null,
"detailImageUrl": null,
"startTime": "06-01",
"endTime": "07-31"
}
]
}]
}
]
this.activityProductList = res this.activityProductList = res
// console.log('查询当前进行中的营销活动商品列表:', res) // console.log('查询当前进行中的营销活动商品列表:', res)
}, },
/**
* 查询预学习首页弹框信息
*/
async getPrelearnHome() {
const res = await uni.$api.commonApi.getPrelernHomePopupAPI()
// const res = {
// "activityId": null,
// "activityName": null,
// "packages": null,
// "remainingSkipCount": null,
// "shouldPopup": false,
// "muteReason": null,
// "remainingActivityCount": null
// }
console.log('查询预学习首页弹框信息:', res)
if (res) {
this.showPreStudyPopup = res.shouldPopup
}
},
handleFooter(val) { handleFooter(val) {
this.footerBox = val this.footerBox = val
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!