feat(页面组件): 新增图片组件和页面顶部导航组件

- 新增 images.vue 图片组件,支持图片展示、链接跳转和二维码长按识别
- 新增 pageTopbar.vue 页面顶部导航组件,支持自定义标题、返回按钮和样式配置
- 在首页和专题页中注册并使用新增组件
- 优化 homeComb.vue 组件,添加选项卡轮播显示控制逻辑
- 添加 DIY 组件调试日志功能,便于开发调试
- 修复缓存读取空值时的默认值处理
This commit is contained in:
2026-04-16 19:51:08 +08:00
parent a5c5d753b6
commit 797724c01d
6 changed files with 545 additions and 7 deletions

View File

@@ -62,7 +62,7 @@
</view>
</view>
</view>
<view class="swiperBg pb-20">
<view class="swiperBg pb-20" v-if="showTabCarousel">
<!-- :style="{ paddingBottom: isMenu ? '30rpx' : '30rpx'}" -->
<view class="swiper page_swiper" v-if="imgUrls.length">
<swiper
@@ -179,6 +179,13 @@
swiperMargin() {
return this.dataConfig.styleConfig.tabVal ? '50rpx' : '10rpx';
},
tabCarouselConfig() {
return this.dataConfig.tabCarouselConfig || { tabVal: 0 };
},
showTabCarousel() {
// 如果选项卡轮播设置为显示,则切换选项卡后也显示,如果选项卡轮播设置为隐藏,则只在首页时显示
return this.tabCarouselConfig.tabVal === 0 ? true : this.tabClick === 0 ? true : false;
},
bgGradientStyle(){
return {
'background-image': `linear-gradient(to bottom, rgba(245,245,245,0) 0%, rgba(245,245,245,0) 50%, ${this.dataConfig.gradientColor ? this.dataConfig.gradientColor.color[0].item : '#f5f5f5'} 100%)`
@@ -234,7 +241,7 @@
};
},
tabListConfig() {
let tabList = this.dataConfig.tabListConfig.list;
let tabList = [...(this.dataConfig.tabListConfig?.list || [])];
tabList.unshift({
classPage: {
id: 0
@@ -291,9 +298,20 @@
this.hotWordShow = true;
}
})
console.log('tabCarouselConfig', that.tabCarouselConfig.tabVal)
that.computedHeight();
uni.setStorageSync('hotList', that.hotWords);
},
watch: {
tabClick(nVal) {
if (nVal === 0 && this.showTabCarousel && this.imgUrls.length) {
this.$nextTick(() => {
this.computedHeight();
})
}
}
},
methods: {
goDetail(url) {
let urls = url.info[1].value
@@ -839,4 +857,4 @@
/deep/.dot2 .uni-swiper-dots-horizontal {
left: 90%;
}
</style>
</style>