|
|
@ -1,53 +1,31 @@ |
|
|
|
<template> |
|
|
|
<view class="product-section"> |
|
|
|
<view class="title-section"> |
|
|
|
<div |
|
|
|
style=" |
|
|
|
<div style=" |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: space-between; |
|
|
|
" |
|
|
|
> |
|
|
|
"> |
|
|
|
<text class="title">文化IP合作体</text> |
|
|
|
</div> |
|
|
|
</view> |
|
|
|
<!-- 轮播容器 --> |
|
|
|
<view class="carousel-container"> |
|
|
|
<!-- 左箭头 --> |
|
|
|
<view |
|
|
|
class="nav-arrow left-arrow" |
|
|
|
@click="prevSlide" |
|
|
|
v-if="list.length > 1 && currentIndex > 0" |
|
|
|
> |
|
|
|
<image style="width: 50rpx;height: 50rpx;" :src="showImg('/uploads/20250908/29beeddf1e45571d2c5a4187f2f1ae05.png')"></image> |
|
|
|
<view class="nav-arrow left-arrow" @click="prevSlide" v-if="list.length > 1 && currentIndex > 0"> |
|
|
|
<image style="width: 50rpx;height: 50rpx;" |
|
|
|
:src="showImg('/uploads/20250908/29beeddf1e45571d2c5a4187f2f1ae05.png')"></image> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 轮播内容 --> |
|
|
|
<scroll-view |
|
|
|
class="carousel-scroll" |
|
|
|
scroll-x="true" |
|
|
|
:show-scrollbar="false" |
|
|
|
:enhanced="true" |
|
|
|
:scroll-with-animation="true" |
|
|
|
:scroll-left="scrollLeft" |
|
|
|
@scroll="onScroll" |
|
|
|
@scrollend="onScrollEnd" |
|
|
|
> |
|
|
|
<scroll-view class="carousel-scroll" scroll-x="true" :show-scrollbar="false" :enhanced="true" |
|
|
|
:scroll-with-animation="true" :scroll-left="scrollLeft" @scroll="onScroll" @scrollend="onScrollEnd"> |
|
|
|
<view class="carousel-content"> |
|
|
|
<view |
|
|
|
class="carousel-item" |
|
|
|
v-for="(item, index) in list" |
|
|
|
:key="index" |
|
|
|
@click="gotoDetail" |
|
|
|
v-if="item && item.image" |
|
|
|
> |
|
|
|
<view class="carousel-item" v-for="(item, index) in list" :key="index" @click="gotoDetail(item)" |
|
|
|
v-if="item && item.image"> |
|
|
|
<view class="issue-card"> |
|
|
|
<!-- 背景图片 --> |
|
|
|
<image |
|
|
|
class="card-bg" |
|
|
|
:src="showImg(item.image)" |
|
|
|
mode="aspectFill" |
|
|
|
></image> |
|
|
|
<image class="card-bg" :src="showImg(item.image)" mode="aspectFill"></image> |
|
|
|
<view class="title-info"> |
|
|
|
<view class="title-item"> |
|
|
|
{{item.title}} |
|
|
@ -67,62 +45,79 @@ |
|
|
|
</scroll-view> |
|
|
|
|
|
|
|
<!-- 右箭头 --> |
|
|
|
<view |
|
|
|
class="nav-arrow right-arrow" |
|
|
|
@click="nextSlide" |
|
|
|
v-if="list.length > 1 && currentIndex < list.length - 1" |
|
|
|
> |
|
|
|
<view class="nav-arrow right-arrow" @click="nextSlide" |
|
|
|
v-if="list.length > 1 && currentIndex < list.length - 1"> |
|
|
|
|
|
|
|
<image style="width: 50rpx;height: 50rpx;" :src="showImg('/uploads/20250908/6622b3699518d6b559e1241d7addb7af.png')"></image> |
|
|
|
<image style="width: 50rpx;height: 50rpx;" |
|
|
|
:src="showImg('/uploads/20250908/6622b3699518d6b559e1241d7addb7af.png')"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
list: [{ |
|
|
|
image:'/uploads/20250908/bb069c36e88de7cde4e8dd24ac3b33b5.png', |
|
|
|
title:'太湖NAINO', |
|
|
|
des:'NAINO的异次元发现', |
|
|
|
image: '/uploads/20250908/bb069c36e88de7cde4e8dd24ac3b33b5.png', |
|
|
|
title: '太湖NAINO', |
|
|
|
des: 'NAINO的异次元发现', |
|
|
|
}, |
|
|
|
{ |
|
|
|
image:'/uploads/20250908/ab1ffc93875de79fc87ee2c5e70cad3f.png', |
|
|
|
title:'SUNRISE日出东方', |
|
|
|
des:'扬州瓜洲古渡', |
|
|
|
image: '/uploads/20250908/ab1ffc93875de79fc87ee2c5e70cad3f.png', |
|
|
|
title: 'SUNRISE日出东方', |
|
|
|
des: '扬州瓜洲古渡', |
|
|
|
}, |
|
|
|
{ |
|
|
|
image:'/uploads/20250908/4d38fcd2e403a13b85a96188de12a2a8.png', |
|
|
|
title:'中国昆曲博物馆', |
|
|
|
des:'姹紫婿红里', |
|
|
|
image: '/uploads/20250908/4d38fcd2e403a13b85a96188de12a2a8.png', |
|
|
|
title: '中国昆曲博物馆', |
|
|
|
des: '姹紫婿红里', |
|
|
|
}, |
|
|
|
{ |
|
|
|
image:'/uploads/20250908/d4115d6c907f8b3ed5d30a11f9912460.png', |
|
|
|
title:'退思园', |
|
|
|
des:'苏州古典园林生活', |
|
|
|
}], |
|
|
|
image: '/uploads/20250908/d4115d6c907f8b3ed5d30a11f9912460.png', |
|
|
|
title: '退思园', |
|
|
|
des: '苏州古典园林生活', |
|
|
|
mini: { |
|
|
|
appID: 'wxf3af8e268906fd6d', |
|
|
|
path: 'pages/index/index' |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
currentIndex: 0, |
|
|
|
scrollLeft: 0, |
|
|
|
itemWidth: 224, // 207rpx + 30rpx margin |
|
|
|
JDSU_IMG_URL: "https://epic.js-dyyj.com", |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
// this.getList(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleMoreClick(){ |
|
|
|
handleMoreClick() { |
|
|
|
uni.switchTab({ |
|
|
|
url:'/pages/index/readingBody' |
|
|
|
url: '/pages/index/readingBody' |
|
|
|
}) |
|
|
|
}, |
|
|
|
gotoDetail(){ |
|
|
|
gotoDetail(item) { |
|
|
|
if(item.mini){ |
|
|
|
wx.navigateToMiniProgram({ |
|
|
|
appId: item.mini.appID, |
|
|
|
path: item.mini.path, |
|
|
|
envVersion: 'release', |
|
|
|
success(res) { |
|
|
|
// 打开成功 |
|
|
|
}, |
|
|
|
fail(e){ |
|
|
|
console.log(e) |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
uni.showToast({ |
|
|
|
title:'功能暂未开放', |
|
|
|
icon:'none' |
|
|
|
title: '功能暂未开放', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
getList() { |
|
|
|
// this.Post( |
|
|
@ -142,16 +137,6 @@ export default { |
|
|
|
// }); |
|
|
|
}, |
|
|
|
|
|
|
|
// 图片显示方法 |
|
|
|
showImg(img) { |
|
|
|
if (!img) return ""; |
|
|
|
if (img.indexOf("https://") != -1 || img.indexOf("http://") != -1) { |
|
|
|
return img; |
|
|
|
} else { |
|
|
|
return this.JDSU_IMG_URL + img; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 上一张 |
|
|
|
prevSlide() { |
|
|
|
if (!this.validateData()) return; |
|
|
@ -241,11 +226,11 @@ export default { |
|
|
|
return true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
.product-section { |
|
|
|
.product-section { |
|
|
|
width: 100%; |
|
|
|
background-color: #fffdd6; |
|
|
|
padding: 40rpx 25rpx; |
|
|
@ -253,58 +238,58 @@ export default { |
|
|
|
border-radius: 40rpx; |
|
|
|
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1), |
|
|
|
0 0 0 1rpx rgba(255, 255, 255, 0.2) inset; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 轮播容器 |
|
|
|
.carousel-container { |
|
|
|
// 轮播容器 |
|
|
|
.carousel-container { |
|
|
|
position: relative; |
|
|
|
width: 100%; |
|
|
|
height: 191rpx ; |
|
|
|
height: 191rpx; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 轮播滚动视图 |
|
|
|
.carousel-scroll { |
|
|
|
// 轮播滚动视图 |
|
|
|
.carousel-scroll { |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
white-space: nowrap; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 轮播内容 |
|
|
|
.carousel-content { |
|
|
|
// 轮播内容 |
|
|
|
.carousel-content { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
height: 100%; |
|
|
|
min-width: max-content; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 轮播项 |
|
|
|
.carousel-item { |
|
|
|
// 轮播项 |
|
|
|
.carousel-item { |
|
|
|
flex-shrink: 0; |
|
|
|
width: 154rpx; |
|
|
|
height: 191rpx; |
|
|
|
margin: 0 7rpx; |
|
|
|
will-change: transform; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 卡片样式 |
|
|
|
.issue-card { |
|
|
|
// 卡片样式 |
|
|
|
.issue-card { |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
position: relative; |
|
|
|
overflow: hidden; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 背景图片 |
|
|
|
.card-bg { |
|
|
|
// 背景图片 |
|
|
|
.card-bg { |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 导航箭头 |
|
|
|
.nav-arrow { |
|
|
|
// 导航箭头 |
|
|
|
.nav-arrow { |
|
|
|
position: absolute; |
|
|
|
top: 50%; |
|
|
|
transform: translateY(-50%); |
|
|
@ -325,17 +310,17 @@ export default { |
|
|
|
&.right-arrow { |
|
|
|
right: 0rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.arrow-icon { |
|
|
|
.arrow-icon { |
|
|
|
font-size: 32rpx; |
|
|
|
color: #ffffff; |
|
|
|
font-weight: bold; |
|
|
|
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 无数据提示 |
|
|
|
.no-data { |
|
|
|
// 无数据提示 |
|
|
|
.no-data { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
@ -343,13 +328,14 @@ export default { |
|
|
|
height: 368rpx; |
|
|
|
color: #999; |
|
|
|
font-size: 28rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 标题区域 |
|
|
|
.title-section { |
|
|
|
// 标题区域 |
|
|
|
.title-section { |
|
|
|
display: inline-block; |
|
|
|
padding: 0rpx 0 30rpx; |
|
|
|
width: 100%; |
|
|
|
|
|
|
|
.title { |
|
|
|
font-size: 34rpx; |
|
|
|
font-weight: bold; |
|
|
@ -361,15 +347,17 @@ export default { |
|
|
|
color: #000000; |
|
|
|
margin-left: 35rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
.title-info{ |
|
|
|
} |
|
|
|
|
|
|
|
.title-info { |
|
|
|
position: absolute; |
|
|
|
bottom: 10rpx; |
|
|
|
right: 0; |
|
|
|
width: 100%; |
|
|
|
color: white; |
|
|
|
padding: 0 5rpx; |
|
|
|
.title-item{ |
|
|
|
|
|
|
|
.title-item { |
|
|
|
text-align: center; |
|
|
|
font-size: 16rpx; |
|
|
|
font-weight: bold; |
|
|
@ -377,7 +365,8 @@ export default { |
|
|
|
word-wrap: normal; |
|
|
|
text-overflow: ellipsis; |
|
|
|
} |
|
|
|
.title-des{ |
|
|
|
|
|
|
|
.title-des { |
|
|
|
margin-top: 5rpx; |
|
|
|
text-align: center; |
|
|
|
font-size: 14rpx; |
|
|
@ -385,5 +374,5 @@ export default { |
|
|
|
word-wrap: normal; |
|
|
|
text-overflow: ellipsis; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |