|
|
@ -1,20 +1,43 @@ |
|
|
|
<template> |
|
|
|
<view class="bg"> |
|
|
|
<headerVue @change="changeAddress" :address="addressInfo" fixed isLocation></headerVue> |
|
|
|
<headerVue |
|
|
|
@change="changeAddress" |
|
|
|
:address="addressInfo" |
|
|
|
fixed |
|
|
|
isLocation |
|
|
|
></headerVue> |
|
|
|
|
|
|
|
<!-- 灵动岛组件 --> |
|
|
|
<!-- 灵动岛组件 - 自包含,无需传递参数 --> |
|
|
|
<DynamicIsland ref="dynamicIsland" :page-id="'index_page'" @toggle="handleIslandToggle" |
|
|
|
@action="handleIslandAction" /> |
|
|
|
<DynamicIsland |
|
|
|
ref="dynamicIsland" |
|
|
|
:page-id="'index_page'" |
|
|
|
@toggle="handleIslandToggle" |
|
|
|
@action="handleIslandAction" |
|
|
|
/> |
|
|
|
|
|
|
|
<view class="content" @click="handleContentClick"> |
|
|
|
<!-- 权益商品区域 --> |
|
|
|
<ProductSection v-if="productList.length" title="权益商品" :productList="productList" |
|
|
|
moreUrl="/subPackages/equityGoods/index" detailUrlPrefix="/subPackages/equityGoods/detail" |
|
|
|
@like-toggle="handleLikeToggle" /> |
|
|
|
<ProductSection titleBgColor="#92FF8F" aiTagTextColor="#08FB05" aiTagBorderColor="#6EAA3D" title="有感商品" |
|
|
|
:productList="productListFeeling" moreUrl="/pages/index/sensoryStore" |
|
|
|
detailUrlPrefix="/subPackages/techan/detail" @like-toggle="handleLikeToggle" isFeel /> |
|
|
|
<ProductSection |
|
|
|
v-show="productList.length" |
|
|
|
title="权益商品" |
|
|
|
:productList="productList" |
|
|
|
moreUrl="/subPackages/equityGoods/index" |
|
|
|
detailUrlPrefix="/subPackages/equityGoods/detail" |
|
|
|
@like-toggle="handleLikeToggle" |
|
|
|
/> |
|
|
|
|
|
|
|
<ProductSection |
|
|
|
titleBgColor="#92FF8F" |
|
|
|
aiTagTextColor="#08FB05" |
|
|
|
aiTagBorderColor="#6EAA3D" |
|
|
|
title="有感商品" |
|
|
|
:productList="productListFeeling" |
|
|
|
moreUrl="/pages/index/sensoryStore" |
|
|
|
detailUrlPrefix="/subPackages/techan/detail" |
|
|
|
@like-toggle="handleLikeToggle" |
|
|
|
isFeel |
|
|
|
/> |
|
|
|
<view class="tab-bar-placeholder"></view> |
|
|
|
</view> |
|
|
|
|
|
|
@ -67,45 +90,48 @@ |
|
|
|
// isLiked: false, |
|
|
|
// }, |
|
|
|
], |
|
|
|
productListFeeling: [{ |
|
|
|
productListFeeling: [ |
|
|
|
{ |
|
|
|
id: 34, |
|
|
|
image: "https://epic.js-dyyj.com/uploads/20250728/22e319f3feb1b63fbb539d425c51fe70.png", |
|
|
|
image: |
|
|
|
"https://epic.js-dyyj.com/uploads/20250728/22e319f3feb1b63fbb539d425c51fe70.png", |
|
|
|
title: "OUT OF SPACE 东方线香", |
|
|
|
price: "138.00", |
|
|
|
isLiked: true, |
|
|
|
isShop: true |
|
|
|
isShop: true, |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 32, |
|
|
|
image: "https://epic.js-dyyj.com/uploads/20250728/cc9907153c887a6428283a407928db9a.png", |
|
|
|
image: |
|
|
|
"https://epic.js-dyyj.com/uploads/20250728/cc9907153c887a6428283a407928db9a.png", |
|
|
|
title: "AI-Agent智能玩具", |
|
|
|
price: "398.00", |
|
|
|
isLiked: false, |
|
|
|
}, |
|
|
|
], |
|
|
|
selectedText: '', |
|
|
|
selectedText: "", |
|
|
|
addressInfo: null, |
|
|
|
isLoading: true, // 添加加载状态 |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad() {}, |
|
|
|
async onReady() { |
|
|
|
let res = await this.$main.getLocationInfo() |
|
|
|
console.log(res) |
|
|
|
this.addressInfo = res |
|
|
|
this.selectedText = res && res.city |
|
|
|
uni.setStorageSync('SYS_ADDRESS_INFO', JSON.stringify(res)) |
|
|
|
let res = await this.$main.getLocationInfo(); |
|
|
|
console.log(res); |
|
|
|
this.addressInfo = res; |
|
|
|
this.selectedText = res && res.city; |
|
|
|
uni.setStorageSync("SYS_ADDRESS_INFO", JSON.stringify(res)); |
|
|
|
this.getList(); |
|
|
|
this.geBenefitPackaget() |
|
|
|
|
|
|
|
this.geBenefitPackaget(); |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.browse_record({ |
|
|
|
type: "page", |
|
|
|
title: "首页" |
|
|
|
title: "首页", |
|
|
|
}); |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.dynamicIsland.getUserInfo(); |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
onPageScroll(e) { |
|
|
|
// 只触发带页面ID的事件,避免不同页面间的状态冲突 |
|
|
@ -114,9 +140,9 @@ |
|
|
|
onReachBottom() {}, |
|
|
|
methods: { |
|
|
|
changeAddress(res) { |
|
|
|
this.addressInfo = res |
|
|
|
uni.setStorageSync('SYS_ADDRESS_INFO', JSON.stringify(res)) |
|
|
|
this.geBenefitPackaget() |
|
|
|
this.addressInfo = res; |
|
|
|
uni.setStorageSync("SYS_ADDRESS_INFO", JSON.stringify(res)); |
|
|
|
this.geBenefitPackaget(); |
|
|
|
}, |
|
|
|
gotoUrlNew(item, index) { |
|
|
|
if (index == 0) { |
|
|
@ -132,7 +158,8 @@ |
|
|
|
viewDetail(item) { |
|
|
|
if (item.url) { |
|
|
|
uni.navigateTo({ |
|
|
|
url: "/subPackages/webPage/webPage?url=" + encodeURIComponent(item.url), |
|
|
|
url: |
|
|
|
"/subPackages/webPage/webPage?url=" + encodeURIComponent(item.url), |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
@ -142,7 +169,8 @@ |
|
|
|
}, |
|
|
|
getList() { |
|
|
|
// 大轮播 |
|
|
|
this.Post({ |
|
|
|
this.Post( |
|
|
|
{ |
|
|
|
type_id: 3, |
|
|
|
position: 17, |
|
|
|
}, |
|
|
@ -154,37 +182,37 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
geBenefitPackaget() { |
|
|
|
this.Post({ |
|
|
|
cityId: this.addressInfo.cityId |
|
|
|
this.Post( |
|
|
|
{ |
|
|
|
cityId: this.addressInfo.cityId, |
|
|
|
}, |
|
|
|
"/framework/index/benefitPackage/list", |
|
|
|
'DES' |
|
|
|
"DES" |
|
|
|
).then((res) => { |
|
|
|
if (res.data) { |
|
|
|
this.productList = res.data.map(item => { |
|
|
|
this.productList = res.data.map((item) => { |
|
|
|
return { |
|
|
|
...item, |
|
|
|
image: item.mainUrl, |
|
|
|
id: item.benefitPackageId, |
|
|
|
avatar: "https://epic.js-dyyj.com/uploads/20250728/d27ef6e6c26877da7775664fed376c6f.png", |
|
|
|
avatar: |
|
|
|
"https://epic.js-dyyj.com/uploads/20250728/d27ef6e6c26877da7775664fed376c6f.png", |
|
|
|
aiName: "文徵明", |
|
|
|
} |
|
|
|
}) |
|
|
|
}; |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
gotoVideo(item) { |
|
|
|
uni.navigateTo({ |
|
|
|
url: "/subPackages/video/video?item=" + |
|
|
|
url: |
|
|
|
"/subPackages/video/video?item=" + |
|
|
|
encodeURIComponent(JSON.stringify(item)), |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 处理收藏状态切换 |
|
|
|
handleLikeToggle({ |
|
|
|
item, |
|
|
|
index |
|
|
|
}) { |
|
|
|
handleLikeToggle({ item, index }) { |
|
|
|
this.productList[index] = item; |
|
|
|
}, |
|
|
|
|
|
|
@ -213,7 +241,8 @@ |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style> |
|
|
|
page {} |
|
|
|
page { |
|
|
|
} |
|
|
|
</style> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.bg { |
|
|
@ -226,7 +255,7 @@ |
|
|
|
/* 页面样式 */ |
|
|
|
|
|
|
|
.content { |
|
|
|
height: calc(100vh - 123rpx); |
|
|
|
height: 100%; |
|
|
|
width: 100%; |
|
|
|
padding: 0 20rpx; |
|
|
|
box-sizing: border-box; |
|
|
|