时味苏州
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.
 
 
 
 

332 lines
8.3 KiB

<template>
<view class="bg">
<image v-if="headImg" :src="showImg(headImg)" class="topImg" mode="widthFix"></image>
<image class="what-img" @click="openPop()" mode="aspectFill" src="https://static.ticket.sz-trip.com/uploads/20250915/798f91cfde30414c091603666be573b7.png"></image>
<view class="main-container" style="margin-top: -2400rpx;position: relative;" >
<view class="type-container no-scrollbar">
<view :class="['type-item']" @click="typeIndex=i"
v-for="(item,i) in typeList" :key="i">
<image v-show="typeIndex==i" mode="aspectFill" :src="item.imgs"></image>
<image v-show="typeIndex!=i" mode="aspectFill" :src="item.img"></image>
</view>
</view>
<view class="type-container">
<image :src="typeList[typeIndex].textImg" mode="widthFix" style="width: 100%;margin: 14rpx 0 30rpx;"></image>
</view>
<view class="flex-between" style="flex-wrap: wrap;padding: 0 26rpx;">
<view class="column-product" @click="gotoDetailByType(item)" :key="index"
v-for="(item,index) in typeList[typeIndex].list.slice(0,typeList[typeIndex].viewNum)">
<image class="img" :src="showImg(item.headimg)" mode="aspectFill"></image>
<view class="content flex-column">
<view class="title text-overflowRows">{{item.title}}</view>
<view>
<view class="tags" v-if="item.display_tags">
<view class="tag text-overflow" v-for="(tag,tagI) in item.display_tags.split(',')" :key="tagI">{{tag}}</view>
</view>
<view class="flex-between">
<view class="price">{{item.price/100}}</view>
<view class="btn">立即购买</view>
</view>
</view>
</view>
</view>
</view>
<view class="view-more" v-if="typeList[typeIndex].list.length>0&&typeList[typeIndex].viewNum<=6" @click="typeList[typeIndex].viewNum=999">
查看更多<image src="https://static.ticket.sz-trip.com/uploads/20250909/848e3a18b3ad3227fa4b2952890b91ef.png"></image>
</view>
<image class="bottom-img" src="https://static.ticket.sz-trip.com/uploads/20250909/55c100f9650df6cbd4a4e5a18c8201de.png"></image>
<image @click="returnTop" v-show="showGoTop" class="back-img" src="https://static.ticket.sz-trip.com/uploads/20250915/74031edf3be17888e522df104e790540.png"></image>
</view>
<uni-popup ref="popup" type="center" mask-background-color="rgba(10,13,11,0.72);">
<view style="idth: 608.67rpx;height: 592.67rpx;position: relative;">
<image style="width: 608.67rpx;height: 592.67rpx;" mode="aspectFill"
src="https://static.ticket.sz-trip.com/uploads/20250915/7a262bdbe38f2fb6efb202d2a14d7512.png"></image>
<view style="position: absolute;width: 60rpx;height: 60rpx;top: 10rpx;right: 10rpx;"
@click="$refs.popup.close()"></view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
list: [],
viewNum: 3,
headImg: '',
typeIndex: 0,
typeList: [
{
id: 104,title: "绿色食品",viewNum:6, list: [],
img:"https://static.ticket.sz-trip.com/uploads/20250915/d0f14bd53f532c48a2d5bd22bca1158f.png",
imgs:"https://static.ticket.sz-trip.com/uploads/20250915/d0f14bd53f532c48a2d5bd22bca1158f.png",
textImg: "https://static.ticket.sz-trip.com/uploads/20250915/cd9a01bfa17006675d0294847f20caa8.png",
},
{
id: 105,title: "有机农产品",viewNum:6, list: [],
img:"https://static.ticket.sz-trip.com/uploads/20250915/cd09a87a9c154f07b7f470aa1e62049c.png",
imgs:"https://static.ticket.sz-trip.com/uploads/20250915/1eb123c06d0f0bd860e107cf4adf57a8.png",
textImg:"https://static.ticket.sz-trip.com/uploads/20250915/6f8105990a5d701d5b384ce22c05d28e.png",
},
{
id: 106,title: "名特优新",viewNum:6, list: [],
img:"https://static.ticket.sz-trip.com/uploads/20250915/2148b40317d93d6ed2a710ff3488f3b7.png",
imgs:"https://static.ticket.sz-trip.com/uploads/20250915/c5140db3128bb15f4e34b68ddf31b644.png",
textImg:"https://static.ticket.sz-trip.com/uploads/20250915/bfa055d9cacd07e839c3219e0c198459.png",
},
{
id: 107,title: "农产品地理标志",viewNum:6, list: [],
img:"https://static.ticket.sz-trip.com/uploads/20250915/cb572317ca0cdeba972d430c7fea2b5d.png",
imgs:"https://static.ticket.sz-trip.com/uploads/20250915/8fbde0a77dca289c96100581b550c511.png",
textImg:"https://static.ticket.sz-trip.com/uploads/20250915/697ecdc92a344884ddbb6982ca453031.png",
},
],
showGoTop: false,
}
},
onLoad(option) {
this.getHeadImg(2397)
this.getGoods()
},
onReady() {
},
methods: {
getHeadImg (id) {
this.Post({id},'/api/multimedia/detail').then(res => {
this.headImg = res.data.head_img
uni.setNavigationBarTitle({
title:res.data.title
})
});
},
goRule (id) {
uni.navigateTo({
url:"/subPackages/activity/commonRule?id="+id
})
},
openPop () {
this.$refs.popup.open()
},
// 产品列表
getGoods() {
for(let p of this.typeList) {
this.Post({
tag_id: p.id,
offset: 0,
limit: 999,
},'/api/product/get_product_by_tag_subject').then(res => {
if (res.data.list.length < p.viewNum) {
p.viewNum = 999
}
p.list = res.data.list
console.log(p)
})
}
},
viewDetail(item) {
this.gotoDetailByType(item)
},
returnTop(){
uni.pageScrollTo({
scrollTop: 0,
duration: 200,
})
},
},
onPageScroll(res) {
this.showGoTop = res.scrollTop > 200 ? true : false;
}
}
</script>
<style lang="scss" scoped>
view{
box-sizing: border-box;
}
.bg {
width: 750rpx;
min-height: 100vh;
padding-bottom: 60rpx;
position: relative;
background: white;
}
.topImg {
width: 100%;
}
.what-img{
position: absolute;
top: 40rpx;
right: 0;
width: 230.67rpx;
height: 46.67rpx;
}
.main-container{
width: 100%;
padding: 48rpx 0 60rpx;
}
.type-item:first-of-type{
width: 238.67rpx;
}
.type-item:nth-of-type(1){
width: 262.67rpx
}
.type-item:nth-of-type(2){
width: 238.67rpx
}
.type-item:nth-of-type(2){
width: 307.33rpx
}
.title{
font-weight: 600;
font-size: 28rpx;
color: #000000;
}
.tags{
width: 100%;
display: flex;
overflow: hidden;
margin-bottom: 18rpx;
.tag{
height: 40rpx;
line-height: 38rpx;
font-weight: 400;
font-size: 24rpx;
color: #0E6500;
padding: 0rpx 10rpx;
border-radius: 20rpx;
border: 1px solid #317626;
margin-right: 13rpx;
}
}
.view-more{
font-weight: 400;
font-size: 24rpx;
color: #8C8C8C;
text-align: center;
margin: 27rpx auto 40rpx;
image{
width: 18.67rpx;
height: 18.67rpx;
margin-left: 8rpx;
}
}
.type-container{
display: flex;
flex-wrap: nowrap;
margin: 0 0 32rpx;
width: 100%;
overflow-y: hidden;
overflow-x: auto;
padding:0 26rpx;
.type-item{
height: 88rpx;
margin-right: 13rpx;
flex-shrink: 0;
image{
width: 100%;
height: 100%;
}
}
.type-item:first-of-type{
width: 238.67rpx;
}
.type-item:nth-of-type(2){
width: 262.67rpx
}
.type-item:nth-of-type(3){
width: 238.67rpx
}
.type-item:nth-of-type(4){
width: 307.33rpx
}
}
.column-product{
width: 335rpx;
height: 569rpx;
background: #ECFFE9;
border-radius: 25rpx;
overflow: hidden;
margin-bottom: 32rpx;
font-size: 0;
box-shadow: 0rpx 3rpx 15rpx 0rpx rgba(0,0,0,0.18);
.img{
width: 335rpx;
height: 335rpx;
border-radius: 25rpx 25rpx 0rpx 0rpx;
flex-shrink: 0;
}
.content{
width: 100%;
flex: 1;
height: 234rpx;
justify-content: space-between;
padding:10rpx 16rpx 20rpx;
}
.price{
font-weight: bold;
font-size: 28rpx;
color: #FF7700;
&::before{
content: "¥";
font-size: 24rpx;
font-weight: 500;
}
&::after{
content: "起";
font-size: 24rpx;
font-weight: 500;
}
}
.btn{
width: 160rpx;
height: 57rpx;
background: linear-gradient( 270deg, #319F56 0%, #9CED46 100%);
border-radius: 200rpx 200rpx 200rpx 200rpx;
font-weight: bold;
font-size: 28rpx;
color: #FFFFFF;
line-height: 57rpx;
text-align: center;
text-shadow: 0px 2px 4px #244705;
}
}
.bottom-img{
width: 149.33rpx;
height: 64rpx;
margin: 27rpx auto 0;
display: block;
}
.back-img{
position: fixed;
width: 68rpx;
height: 68rpx;
bottom: 66rpx;
right: 26rpx;
}
</style>