cgc非遗
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

647 lines
15 KiB

5 months ago
<template>
4 months ago
<view class="content" style="overflow-x: auto;">
4 months ago
<view class="search-header" :style="{'height': height+'px','padding-top':statusBarHeight+'px'}">
4 months ago
<view class="title">CGC-ICH</view>
4 months ago
<view class="subtitle">大运河非物质文化遗产</view>
4 months ago
</view>
4 months ago
<div :style="{'height':height+'px','flex-shrink':0}"></div>
5 months ago
<!-- 头部banner -->
<view class="top-box">
<!-- 搜索 -->
5 months ago
<!-- <view class="search-box">
5 months ago
<image src="https://static.ticket.sz-trip.com/cgc/images/index/search.png" mode=""></image>
<span>|</span>
搜一搜您想要的
5 months ago
</view> -->
5 months ago
<swiper class="top-banner" :circular="true" :interval="6000"
5 months ago
:duration="800" :indicator-dots="false" :autoplay="true" v-if="topBanner && topBanner.length > 0">
5 months ago
<swiper-item v-for="(item, index) in topBanner" :key="index" @click.stop="gotoUrlNew(item)">
<image class="top-banner" :src="showImg(item.head_img)" mode="aspectFill" lazy-load="true"></image>
</swiper-item>
</swiper>
</view>
5 months ago
5 months ago
<!-- 金刚区 -->
<view class="menu-box flex-between">
<view class="menu-left flex-around">
5 months ago
<view class="" v-for="(item,index) in menuList" :key="index" @click="gotoPath(item.path)">
4 months ago
<image :src="showImg(`https://static.ticket.sz-trip.com/cgc/images/indexs/${index + 1}.png`)" class="topImg" mode="heightFix"></image>
<image :src="showImg(`https://static.ticket.sz-trip.com/cgc/images/indexs/${index + 1}s.png`)" class="titleImg" mode="heightFix"></image>
5 months ago
</view>
</view>
4 months ago
<!-- <view class="menu-right flex-around">
5 months ago
<swiper class="menu-right" :circular="true" :interval="6000"
5 months ago
:duration="800" :indicator-dots="false" :autoplay="true" v-if="smallBanner">
<swiper-item v-for="(item, index) in smallBanner" :key="index" @click.stop="gotoUrlNew(item)">
5 months ago
<image class="menu-right" :src="showImg(item.head_img)" mode="aspectFill" lazy-load="true"></image>
</swiper-item>
</swiper>
4 months ago
</view> -->
5 months ago
</view>
<!-- 非遗手札 -->
5 months ago
<view v-if="handwrittenList && handwrittenList.length > 0">
4 months ago
5 months ago
<view class="title-box flex-between">
4 months ago
<image src="https://cgc.js-dyyj.com/uploads/20250619/d0cfd5cd7253d8ce6a747842a40be020.png" mode="heightFix"></image>
5 months ago
<image src="https://static.ticket.sz-trip.com/cgc/images/index/more.png" mode="" @click="gotoPath('/subPackages/letter/index')"></image>
</view>
<view class="handwritten-box flex-between">
<image :src="showImg(item.image)" mode="aspectFill" v-for="(item,index) in handwrittenList" :key="index"
4 months ago
@click="viewDetail(item)"></image>
5 months ago
</view>
5 months ago
</view>
<!-- 非遗时光 -->
5 months ago
<view v-if="shiguang && shiguang.image">
<view class="title-box flex-between">
4 months ago
<image src="https://cgc.js-dyyj.com/uploads/20250619/b10ed22a2e5b2187d88352869575fb16.png" mode="heightFix"></image>
5 months ago
<image src="https://static.ticket.sz-trip.com/cgc/images/index/more.png" mode="" @click="gotoPath('/subPackages/shiguang/index')"></image>
</view>
<view class="time-box" :style="{backgroundImage: 'url('+showImg(shiguang.image)+')'}" @click="gotoVideo(shiguang)">
<image src="https://static.ticket.sz-trip.com/cgc/images/index/play.png" class="play"></image>
</view>
5 months ago
</view>
<!-- 底部推荐 -->
<view class="hot-type flex-around">
<view v-for="(item,index) in hotType" :key="index" :class="{'hot-active': index == hotIndex}" @click="changeType(index)">
{{item.title}}
</view>
</view>
4 months ago
<view class="hot-box" v-if="hotIndex==0">
5 months ago
<view class="hot-column" v-for="(column, index) in 2" :key="index">
4 months ago
<view v-if="indexs%2==1&&column==0" v-for="(item,indexs) in hotList" :key="indexs" class="hot-item" @click="gotoHotDetail(item)">
5 months ago
<view class="image-container">
4 months ago
<image :src="showImg(item.goods.image)" mode="widthFix" class="hot-img" lazy-load="true"></image>
</view>
<view class="hot-content">
<view class="title text-overflowRows">{{item.title || item.goods.title}}</view>
</view>
</view>
<view v-if="indexs%2==0&&column==1" v-for="(item,indexs) in hotList" :key="indexs" class="hot-item" @click="gotoHotDetail(item)">
<view class="image-container">
<image :src="showImg(item.goods.image)" mode="widthFix" class="hot-img" lazy-load="true"></image>
</view>
<view class="hot-content">
<view class="title text-overflowRows">{{item.title || item.goods.title}}</view>
</view>
</view>
</view>
</view>
<view class="hot-box" v-else>
<view class="hot-column" v-for="(column, index) in 2" :key="index">
<view v-if="indexs%2==1&&column==0" v-for="(item,indexs) in hotList1" :key="indexs" class="hot-item" @click="gotoHotDetail(item)">
<view class="image-container">
<image :src="showImg(item.goods.image)" mode="widthFix" class="hot-img" lazy-load="true"></image>
</view>
<view class="hot-content">
<view class="title text-overflowRows">{{item.title || item.goods.title}}</view>
</view>
</view>
<view v-if="indexs%2==0&&column==1" v-for="(item,indexs) in hotList1" :key="indexs" class="hot-item" @click="gotoHotDetail(item)">
<view class="image-container">
<image :src="showImg(item.goods.image)" mode="widthFix" class="hot-img" lazy-load="true"></image>
5 months ago
</view>
<view class="hot-content">
5 months ago
<view class="title text-overflowRows">{{item.title || item.goods.title}}</view>
5 months ago
</view>
</view>
</view>
</view>
4 months ago
5 months ago
</view>
</template>
<script>
export default {
data() {
return {
4 months ago
// 导航栏参数
height: 0,
statusBarHeight: 0,
5 months ago
topBanner: [],
smallBanner: [],
5 months ago
menuList: [
{
4 months ago
path: '/subPackages/techan/index?idIndex=0',
image: '',
5 months ago
},
{
4 months ago
path: '/subPackages/techan/index?idIndex=1',
image: '',
5 months ago
},
{
4 months ago
path: '/subPackages/techan/index?idIndex=2',
image: '',
5 months ago
},
{
4 months ago
path: '/subPackages/techan/index?idIndex=3',
image: '',
5 months ago
},
{
4 months ago
path: '/subPackages/techan/index?idIndex=4',
image: '',
5 months ago
},
{
4 months ago
path: '/subPackages/techan/index?idIndex=5',
image: '',
5 months ago
}
],
5 months ago
handwrittenList: [],
shiguang: {},
5 months ago
hotType: [
{
title: '好物推荐',
id: '41'
},
{
4 months ago
title: '苏州非遗',
5 months ago
id: '41'
}
],
4 months ago
5 months ago
hotIndex: 0,
hotList: [],
4 months ago
hotList1: [],
5 months ago
isLoading: false,
4 months ago
limit: 4,
5 months ago
}
},
onLoad() {
4 months ago
5 months ago
},
onReady() {
// 获取经纬度
4 months ago
// if(!uni.getStorageSync('location')) {
// this.getLocation()
// }
4 months ago
this.initRectInfo()
5 months ago
5 months ago
this.getList()
4 months ago
this.initHotList()
5 months ago
this.changeType(0)
},
onReachBottom() {
4 months ago
// setTimeout(() => {
// // if (!this.isLoading) this.getHotList();
// this.getHotList()
// }, 1000);
5 months ago
},
methods: {
4 months ago
viewDetail(item) {
if (item.url) {
uni.navigateTo({
url:"/subPackages/webPage/webPage?url="+encodeURIComponent(item.url)
})
return
}
uni.navigateTo({
url:'/subPackages/letter/detail?id='+item.id
})
},
initRectInfo () {
const sysInfo = uni.getSystemInfoSync()
this.statusBarHeight = sysInfo.statusBarHeight
// 默认高度
this.height = sysInfo.statusBarHeight + 40
},
5 months ago
getList() {
5 months ago
// 大轮播
5 months ago
this.Post({
type_id: 3,
position: 1,
}, '/api/adv/getAdv').then(res => {
if(res.data) {
this.topBanner = res.data;
}
});
// 小轮播
this.Post({
type_id: 3,
position: 2,
}, '/api/adv/getAdv').then(res => {
if(res.data) {
this.smallBanner = res.data;
4 months ago
this.screenPng = res.data[0]
5 months ago
}
});
// 非遗手札
this.Post({
type_id: 1,
offset: 0,
4 months ago
limit: 1
5 months ago
}, '/api/article/getArticleByType').then(res => {
if(res.data) {
this.handwrittenList = res.data
}
})
// 非遗拾光
this.Post({
type_id: 2,
offset: 0,
limit: 1
}, '/api/article/getArticleByType').then(res => {
if(res.data) {
this.shiguang = res.data[0]
}
})
},
// 2是各种详情页,3是列表专题页面,4是小程序
gotoUrlNew(item) {
console.log(item);
let that = this;
let url = '';
switch (item.jump_type) {
case 0:
break;
case 2:
uni.navigateTo({
url: item.tdata
});
break;
case 3:
uni.navigateTo({
url: '/subPackages/webPage/webPage?url=' + item.tdata
});
break;
case 4:
uni.navigateToMiniProgram({
appId: item.tdata.appid, // 此为appid
path: item.tdata.page, // 此为首页路径
envVersion: 'release',
success: res => {
// 打开成功
console.log('打开成功', res);
},
fail: err => {
console.log(err);
}
});
break;
default:
break;
}
5 months ago
},
5 months ago
// 瀑布流
4 months ago
// getColumnItems(columnIndex) {
// const columnItems = [];
// this.hotList.forEach((item, index) => {
// // switch (this.hotIndex) {
// // case 1:
// // item.src = this.showImg(item.image);
// // break;
// // default:
// // item.src = this.showImg(item.goods.image);
// // }
// item.src = this.showImg(item.goods.image);
5 months ago
4 months ago
// if (index % 2 === columnIndex) {
// columnItems.push(item);
// }
// });
// return columnItems;
// },
5 months ago
// 更改热门推荐类型
changeType(index) {
this.hotIndex = index
4 months ago
// this.isLoading = false
// if (index==0) {
// this.hotList = this.hotList1
// }
// this.getHotList()
},
initHotList () {
5 months ago
this.hotList = []
4 months ago
this.hotList1 = []
this.Post({
tag_id: 51,
offset: this.hotList.length,
limit: 100,
},'/api/tag/getGoodsByTagId').then(res => {
if(res.data.length < this.limit) this.isLoading = true
this.hotList = this.hotList.concat(res.data)
})
this.Post({
tag_id: 52,
offset: this.hotList1.length,
limit: 100,
},'/api/tag/getGoodsByTagId').then(res => {
if(res.data.length < this.limit) this.isLoading = true
this.hotList1 = this.hotList1.concat(res.data)
})
5 months ago
},
getHotList() {
5 months ago
if(this.hotIndex == 1) {
4 months ago
// this.Post({
// type_id: 3,
// offset: this.hotList.length,
// limit: this.limit
// },'/api/Article/getArticleByType').then(res => {
// if(res) {
// if(res.data.length < this.limit) this.isLoading = true
// this.hotList = this.hotList.concat(res.data)
// }
// })
5 months ago
this.Post({
4 months ago
tag_id: 52,
4 months ago
offset: this.hotList1.length,
4 months ago
limit: this.limit,
},'/api/tag/getGoodsByTagId').then(res => {
if(res.data.length < this.limit) this.isLoading = true
4 months ago
this.hotList1 = this.hotList.concat(res.data)
5 months ago
})
}else {
this.Post({
5 months ago
tag_id: 51,
5 months ago
offset: this.hotList.length,
5 months ago
limit: this.limit,
},'/api/tag/getGoodsByTagId').then(res => {
if(res.data.length < this.limit) this.isLoading = true
this.hotList = this.hotList.concat(res.data)
5 months ago
})
}
},
5 months ago
gotoVideo(item) {
uni.navigateTo({
url: '/subPackages/video/video?item=' + encodeURIComponent(JSON.stringify(item))
})
},
5 months ago
gotoHotDetail(item) {
5 months ago
uni.navigateTo({
url: '/subPackages/techan/detail?id=' + item.goods_id
})
4 months ago
// if(this.hotIndex == 1) {
// if(item.genre == 'video') {
// // 视频
// this.gotoVideo(item)
// }else {
// // 文章
// uni.navigateTo({
// url: '/subPackages/letter/detail?id=' + item.id
// })
// }
// }else {
// uni.navigateTo({
// url: '/subPackages/techan/detail?id=' + item.goods_id
// })
// }
5 months ago
}
5 months ago
}
}
</script>
5 months ago
<style lang="scss" scoped>
4 months ago
.search-header{
width: 100%;
position: fixed;
top: 0;
left: 0;
right: 0;
background: white;
text-align: center;
z-index:99;
.title{
font-size: 30rpx
}
.subtitle{
font-size: 22rpx;
}
}
5 months ago
.content {
5 months ago
min-height: 100vh;
background: #F9F0EA;
padding: 21rpx 0 50rpx;
5 months ago
}
5 months ago
.top-box {
width: 684rpx;
height: 451rpx;
border-radius: 30rpx;
overflow: hidden;
position: relative;
margin: auto;
.top-banner {
width: 100%;
height: 100%;
}
.search-box {
width: 632rpx;
height: 40rpx;
background: #FFFFFF;
border-radius: 20rpx;
position: absolute;
z-index: 1000;
top: 31rpx;
left: 26rpx;
display: flex;
align-items: center;
font-weight: 500;
font-size: 24rpx;
color: #7B7C7D;
padding-left: 21rpx;
image {
width: 29rpx;
height: 28rpx;
}
span {
padding: 0 15rpx;
}
}
}
.menu-box {
4 months ago
width: 100%;
padding: 54rpx 33rpx 0;
overflow: hidden;
box-sizing: border-box;
5 months ago
.menu-left {
4 months ago
// flex-wrap: wrap;
width: 100%;
display: flex;
justify-content: space-between;
5 months ago
&>view {
4 months ago
flex: 1;
flex-shrink: 0;
5 months ago
display: flex;
flex-direction: column;
align-items: center;
}
4 months ago
5 months ago
.topImg {
4 months ago
height: 84rpx;
5 months ago
}
.titleImg {
4 months ago
height: 21rpx;
margin-top: 19rpx;
5 months ago
}
}
.menu-right {
width: 254rpx;
height: 323rpx;
border-radius: 20rpx;
}
}
.title-box {
margin: 60rpx 44rpx 21rpx 50rpx;
align-items: flex-end;
&>image {
width: 350rpx;
height: 32rpx;
}
&>image:last-child {
width: 59rpx;
height: 20rpx;
}
}
.handwritten-box {
margin: 0 46rpx;
flex-wrap: wrap;
image {
4 months ago
width: 100%;
5 months ago
height: 181rpx;
border-radius: 10rpx;
}
4 months ago
// &>image:nth-child(n+3) {
// margin-top: 13rpx;
// }
5 months ago
}
.time-box {
background-size: 100% 100%;
width: 657rpx;
height: 370rpx;
border-radius: 30rpx;
margin: 23rpx auto 0;
position: relative;
.play {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 90rpx;
height: 90rpx;
}
}
.hot-type {
height: 122rpx;
font-weight: bold;
font-size: 32rpx;
color: #B5B5B6;
&>view {
position: relative;
}
&>view::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: -10rpx;
background-color: #B5B5B6;
margin: 0 auto;
width: 32rpx;
height: 4rpx;
}
.hot-active {
color: #000000;
}
.hot-active::after {
background-color: #000000;
}
}
.hot-box {
margin: 0 48rpx;
display: flex;
justify-content: space-between;
.hot-column {
width: 319rpx;
display: flex;
flex-direction: column;
}
.hot-item {
width: 319rpx;
background: #FFFFFF;
border-radius: 20rpx;
overflow: hidden;
margin-bottom: 13rpx;
.image-container {
position: relative;
.hot-img {
width: 319rpx;
}
.play-img {
width: 66.67rpx;
height: 66.67rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
.hot-content {
padding: 15rpx;
.title {
font-weight: bold;
font-size: 26rpx;
color: #000000;
}
.subtitle {
margin-top: 20rpx;
font-weight: 400;
font-size: 24rpx;
color: #000000;
display: flex;
align-items: center;
image {
width: 48rpx;
height: 48rpx;
border-radius: 50%;
display: block;
margin-right: 15rpx;
}
}
}
}
}
5 months ago
</style>