24 changed files with 1521 additions and 53 deletions
@ -0,0 +1,51 @@ |
|||
<template> |
|||
<view class="bg"> |
|||
<image v-if="headImg" :src="showImg(headImg)" class="topImg" mode="widthFix"></image> |
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
headImg: '', |
|||
} |
|||
}, |
|||
onLoad(option) { |
|||
|
|||
}, |
|||
onReady() { |
|||
this.getHeadImg(2392) |
|||
|
|||
}, |
|||
methods: { |
|||
getHeadImg (id) { |
|||
this.Post({id},'/api/multimedia/detail').then(res => { |
|||
this.headImg = res.data.head_img |
|||
uni.setNavigationBarTitle({ |
|||
title:res.data.title |
|||
}) |
|||
}); |
|||
}, |
|||
|
|||
|
|||
|
|||
|
|||
}, |
|||
onPageScroll(res) { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.bg { |
|||
width: 750rpx; |
|||
min-height: 100vh; |
|||
} |
|||
|
|||
.topImg { |
|||
width: 100%; |
|||
} |
|||
</style> |
@ -0,0 +1,377 @@ |
|||
<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/20250916/d5e91bdb2114c3e485349d8edae18173.png"></image> |
|||
|
|||
<view class="main-container" style="margin-top: -2400rpx;position: relative;" > |
|||
|
|||
<!-- <view class="type-container no-scrollbar" > |
|||
<view :class="['type-item']" @click="changeTypeIndex(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> --> |
|||
<scroll-view class="type-container type-scroll" scroll-x="true" scroll-with-animation="true" enable-flex |
|||
:scroll-into-view="scrollIntoView" :show-scrollbar="false"> |
|||
<view :id="`item-${i}`" :class="['type-item']" @click="changeTypeIndex(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 style="width: 20rpx;height: 1rpx;flex-shrink: 0;"></view> |
|||
</scroll-view> |
|||
|
|||
|
|||
<uni-transition :mode-class="['slide-left','fade']" :show="show"> |
|||
<view class="type-container"> |
|||
<image :src="typeList[typeIndex].textImg" mode="widthFix" style="width: 100%;margin: 25rpx 0 30rpx;"></image> |
|||
</view> |
|||
</uni-transition> |
|||
|
|||
|
|||
|
|||
<view class="flex-between" style="flex-wrap: wrap;padding: 0 26rpx;box-sizing: border-box;"> |
|||
<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/20250916/70b50a9d3f0b70454763e7146ac0a4d1.png", |
|||
imgs:"https://static.ticket.sz-trip.com/uploads/20250916/3b251683c250cf6669378266ed786de4.png", |
|||
textImg: "https://static.ticket.sz-trip.com/uploads/20250916/277332c4b9e2e9c52eff288f131bc290.png", |
|||
}, |
|||
{ |
|||
id: 105,title: "有机农产品",viewNum:6, list: [], |
|||
img:"https://static.ticket.sz-trip.com/uploads/20250916/600b3f0ca1b6582da3dc128f98cc1ea9.png", |
|||
imgs:"https://static.ticket.sz-trip.com/uploads/20250916/9692497b22091c3e3d3d69bf9c4fd311.png", |
|||
textImg:"https://static.ticket.sz-trip.com/uploads/20250916/b9f991050bfaaee598e2d91cd731801f.png", |
|||
}, |
|||
{ |
|||
id: 106,title: "名特优新",viewNum:6, list: [], |
|||
img:"https://static.ticket.sz-trip.com/uploads/20250916/9810f9261e137b354132063fced2d43c.png", |
|||
imgs:"https://static.ticket.sz-trip.com/uploads/20250916/2b3cfb94571cd911af3cca2b4027438c.png", |
|||
textImg:"https://static.ticket.sz-trip.com/uploads/20250916/40dc980c379e382d2e43dfc6d2cfc5f8.png", |
|||
}, |
|||
{ |
|||
id: 107,title: "农产品地理标志",viewNum:6, list: [], |
|||
img:"https://static.ticket.sz-trip.com/uploads/20250916/6c8216888e1224e9534309bde2a87a14.png", |
|||
imgs:"https://static.ticket.sz-trip.com/uploads/20250916/37d84af1f692cce86158ff0784fefb73.png", |
|||
textImg:"https://static.ticket.sz-trip.com/uploads/20250916/3b7395a773381ebe93c224528100e0c8.png", |
|||
}, |
|||
], |
|||
showGoTop: false, |
|||
|
|||
show: true, |
|||
scrollIntoView: "item-0", |
|||
} |
|||
}, |
|||
onLoad(option) { |
|||
this.getHeadImg(2397) |
|||
this.getGoods() |
|||
}, |
|||
onReady() { |
|||
|
|||
}, |
|||
methods: { |
|||
changeTypeIndex (i) { |
|||
if (this.typeIndex==i) { |
|||
return |
|||
} |
|||
this.show = false |
|||
setTimeout(()=>{ |
|||
this.typeIndex = i; |
|||
this.show = true; |
|||
},300) |
|||
|
|||
this.$nextTick(()=>{ |
|||
let index=i-1; |
|||
if (index<0) {index=0} |
|||
// 小程序:使用scroll-into-view |
|||
this.scrollIntoView = `item-${index}`; |
|||
// 强制刷新(解决偶发不滚动问题) |
|||
setTimeout(() => { |
|||
this.scrollIntoView = `item-${index}`; |
|||
}, 100); |
|||
}) |
|||
}, |
|||
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; |
|||
width: 100%; |
|||
overflow-y: hidden; |
|||
overflow-x: auto; |
|||
padding:0 26rpx; |
|||
.type-item{ |
|||
height: 88rpx; |
|||
margin-right: 10rpx; |
|||
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; |
|||
margin-right: 0; |
|||
} |
|||
} |
|||
.type-container.type-scroll{ |
|||
height: 90rpx; |
|||
padding: 0; |
|||
padding-left: 20rpx; |
|||
box-sizing: border-box; |
|||
} |
|||
|
|||
.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> |
@ -0,0 +1,287 @@ |
|||
<template> |
|||
<view class="bg"> |
|||
<image v-if="headImg" :src="showImg(headImg)" class="topImg" mode="widthFix"></image> |
|||
|
|||
<view class="main-container"> |
|||
|
|||
<view class="coupon-box"> |
|||
<view class="rule" @click="goRule(5)"> |
|||
活动规则<uni-icons type="right" size="12"></uni-icons> |
|||
</view> |
|||
<!-- <view class="coupon-tip">消费券领取后3天内未使用自动失效<br>失效后可再次领取</view> --> |
|||
<view class="flex-between" style="flex-wrap: wrap;margin-top: 20rpx;"> |
|||
<image class="coupon-img" v-for="(item,i) in couponList" :key="i" |
|||
:src="item.img" @click="getCoupon(item)" mode="aspectFill"></image> |
|||
</view> |
|||
</view> |
|||
|
|||
<image class="adv-image" mode="aspectFill" |
|||
src="https://static.ticket.sz-trip.com/uploads/20250909/76159d9ddffcf7b53daf4fa5ebd1180f.png"></image> |
|||
|
|||
|
|||
<view class="row-product" v-for="(item,index) in list.slice(0,viewNum)" |
|||
:key="index" @click="gotoDetailByType(item)"> |
|||
<image class="img" :src="showImg(item.headimg)" mode="aspectFill"></image> |
|||
<view class="content flex-column"> |
|||
<view class="title text-overflowRows">{{item.title}}</view> |
|||
<view class="tags" v-if="item.display_tags"> |
|||
<view class="tag" v-for="(tag,tagI) in item.display_tags.split(',')" :key="tagI">{{tag}}</view> |
|||
</view> |
|||
<view class="flex-between"> |
|||
<view class="price">{{(item.price/100).toFixed(2)}}</view> |
|||
<view class="btn">立即购买</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="view-more" v-if="list.length>0&&viewNum<=5" @click="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/20250815/108583b6b888b0e5556393b140a7cb84.png"></image> --> |
|||
|
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
list: [], |
|||
viewNum: 5, |
|||
headImg: '', |
|||
couponList: [ |
|||
{id: null, img: "https://static.ticket.sz-trip.com/uploads/20250909/df85ecc7576c496c6f0c1b8f0187f354.png"}, |
|||
{id: null, img: "https://static.ticket.sz-trip.com/uploads/20250909/edc18f90c11f8ac6b0b6219015055994.png"}, |
|||
{id: null, img: "https://static.ticket.sz-trip.com/uploads/20250909/3f0b4898b5dbb53665fc2cb7771959f7.png"}, |
|||
{id: null, img: "https://static.ticket.sz-trip.com/uploads/20250909/177508729382abf7eac929b952e9de1e.png"}, |
|||
], |
|||
isReceive: true, |
|||
|
|||
showGoTop: false, |
|||
} |
|||
}, |
|||
onLoad(option) { |
|||
|
|||
}, |
|||
onReady() { |
|||
this.getHeadImg(2395) |
|||
this.getGoods() |
|||
}, |
|||
methods: { |
|||
getHeadImg (id) { |
|||
this.Post({id},'/api/multimedia/detail').then(res => { |
|||
this.headImg = res.data.head_img |
|||
uni.setNavigationBarTitle({ |
|||
title:res.data.title |
|||
}) |
|||
if (res.data.company_name) { |
|||
res.data.company_name.split(',').forEach((item, index) => { |
|||
this.couponList[index].id = item |
|||
}) |
|||
} |
|||
}); |
|||
}, |
|||
goRule (id) { |
|||
uni.navigateTo({ |
|||
url:"/subPackages/activity/commonRule?id="+id |
|||
}) |
|||
}, |
|||
|
|||
// 产品列表 |
|||
getGoods() { |
|||
this.Post({ |
|||
tag_id: 102, |
|||
offset: 0, |
|||
limit: 999, |
|||
},'/api/product/get_product_by_tag_subject').then(res => { |
|||
if (res.data.length < this.viewNum) { |
|||
this.viewNum = 999 |
|||
} |
|||
this.list = res.data.list |
|||
}) |
|||
|
|||
|
|||
}, |
|||
getCoupon(item) { |
|||
if (!this.isReceive) { |
|||
uni.showToast({ |
|||
title: "短时间内请勿重复点击!", |
|||
icon: 'none' |
|||
}) |
|||
return; |
|||
} |
|||
this.isReceive = false |
|||
setTimeout(() => {this.isReceive = true}, 3000) |
|||
this.Post({ |
|||
ids: item.id, |
|||
is_all: 1, |
|||
},"/api/coupon/getNewCouponsByActivitiesIds").then(res => { |
|||
if (res) { |
|||
uni.showToast({ |
|||
title: res.data, |
|||
icon: 'none' |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
|
|||
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> |
|||
.bg { |
|||
width: 750rpx; |
|||
min-height: 100vh; |
|||
padding-bottom: 27rpx; |
|||
background-image: url("https://static.ticket.sz-trip.com/uploads/20250909/0b246a12035de1bc119b6a0bb8ee96db.png"); |
|||
background-size: 100% 100%; |
|||
// background-repeat: repeat-y; |
|||
} |
|||
|
|||
.topImg { |
|||
width: 100%; |
|||
} |
|||
.main-container{ |
|||
width: 100%; |
|||
margin-top: -330rpx; |
|||
padding: 0 26rpx 60rpx; |
|||
.adv-image{ |
|||
margin: 26rpx 0 36rpx; |
|||
width: 100%; |
|||
height: 258.67rpx; |
|||
} |
|||
} |
|||
.coupon-box{ |
|||
width: 100%; |
|||
|
|||
.rule{ |
|||
text-align: right; |
|||
font-weight: 400; |
|||
font-size: 24rpx; |
|||
color: #000000; |
|||
} |
|||
|
|||
.coupon-img{ |
|||
width: 340.85rpx; |
|||
height: 143.16rpx; |
|||
margin-bottom: 18rpx; |
|||
} |
|||
} |
|||
|
|||
.row-product{ |
|||
width: 100%; |
|||
height: 213.33rpx; |
|||
background: #FFFFFF; |
|||
border-radius: 21rpx; |
|||
padding: 22rpx 22rpx 14rpx 19rpx; |
|||
display: flex; |
|||
align-items: center; |
|||
margin-bottom: 22rpx; |
|||
.img{ |
|||
width: 160rpx; |
|||
height: 160rpx; |
|||
flex-shrink: 0; |
|||
} |
|||
.content{ |
|||
width: 100rpx; |
|||
height: 100%; |
|||
flex: 1; |
|||
justify-content: space-between; |
|||
padding: 0rpx 0 0rpx 22rpx; |
|||
} |
|||
.price{ |
|||
font-weight: 400; |
|||
font-size: 32rpx; |
|||
color: #FE2E18; |
|||
&::before{ |
|||
content: "¥"; |
|||
font-size: 24rpx; |
|||
} |
|||
// &::after{ |
|||
// content: "起"; |
|||
// font-size: 24rpx; |
|||
// } |
|||
} |
|||
.btn{ |
|||
width: 123rpx; |
|||
height: 48rpx; |
|||
background: #FE4A29; |
|||
border-radius: 7rpx 7rpx 7rpx 7rpx; |
|||
font-weight: 400; |
|||
font-size: 24rpx; |
|||
color: #FFFFFF; |
|||
|
|||
line-height: 48rpx; |
|||
text-align: center; |
|||
} |
|||
} |
|||
.title{ |
|||
font-weight: 400; |
|||
font-size: 28rpx; |
|||
color: #000000; |
|||
} |
|||
.tags{ |
|||
width: 100%; |
|||
display: flex; |
|||
overflow: hidden; |
|||
.tag{ |
|||
font-weight: 400; |
|||
font-size: 20rpx; |
|||
color: #FFA100; |
|||
height: 33rpx; |
|||
// line-height: 33rpx; |
|||
padding: 0rpx 8rpx; |
|||
border-radius: 3rpx; |
|||
border: 1rpx solid #FFA100; |
|||
margin-right: 10rpx; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
} |
|||
} |
|||
.view-more{ |
|||
font-weight: 400; |
|||
font-size: 24rpx; |
|||
color: #8C8C8C; |
|||
text-align: center; |
|||
margin: 27rpx auto 0; |
|||
image{ |
|||
width: 18.67rpx; |
|||
height: 18.67rpx; |
|||
margin-left: 8rpx; |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
.bottom-img{ |
|||
width: 149.33rpx; |
|||
height: 64rpx; |
|||
margin: 27rpx auto 0; |
|||
display: block; |
|||
} |
|||
.back-img{ |
|||
position: fixed; |
|||
width: 66rpx; |
|||
height: 66rpx; |
|||
bottom: 66rpx; |
|||
right: 26rpx; |
|||
} |
|||
</style> |
@ -0,0 +1,293 @@ |
|||
<template> |
|||
<view class="bg"> |
|||
<image v-if="headImg" :src="showImg(headImg)" class="topImg" mode="widthFix"></image> |
|||
|
|||
<view class="main-container"> |
|||
<image class="title-image" src="https://static.ticket.sz-trip.com/uploads/20250903/0962fc4e972a669f83e97a5a126b2f53.png"></image> |
|||
<view class="coupon-box"> |
|||
<view class="flex-between"> |
|||
<image class="coupon-img" v-for="(item,i) in couponList" :key="i" |
|||
:src="item.img" @click="getCoupon(item)" mode="aspectFill"></image> |
|||
</view> |
|||
<view class="rule" @click="goRule(3)">活动规则</view> |
|||
</view> |
|||
|
|||
|
|||
|
|||
<view class="row-product" v-for="(item,index) in list.slice(0,viewNum)" |
|||
:key="index" @click="gotoDetailByType(item)"> |
|||
<image class="img" :src="showImg(item.headimg)" mode="aspectFill"></image> |
|||
<view class="content flex-column"> |
|||
<view class="title text-overflowRows">{{item.title}}</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 class="view-more" v-if="list.length>4&&viewNum<=4" @click="viewNum=999">查看更多</view> |
|||
|
|||
<image class="bottom-img" src="https://static.ticket.sz-trip.com/uploads/20250903/5b9a286d9f77a62fac2ffa54c77a9ff7.png"></image> |
|||
<image @click="returnTop" v-show="showGoTop" class="back-img" src="https://static.ticket.sz-trip.com/uploads/20250903/0654ba8242c922ca4008b80948e6c9e4.png"></image> |
|||
|
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
list: [], |
|||
viewNum: 4, |
|||
headImg: '', |
|||
couponList: [ |
|||
{id: null, img: "https://static.ticket.sz-trip.com/uploads/20250904/6bb90a456a4800a99df91b97197fbc76.png"}, |
|||
{id: null, img: "https://static.ticket.sz-trip.com/uploads/20250904/a20709036f31e6979c9ae84c543a8538.png"}, |
|||
], |
|||
isReceive: true, |
|||
|
|||
showGoTop: false, |
|||
} |
|||
}, |
|||
onLoad(option) { |
|||
|
|||
}, |
|||
onReady() { |
|||
this.getHeadImg(2393) |
|||
this.getGoods() |
|||
}, |
|||
methods: { |
|||
getHeadImg (id) { |
|||
this.Post({id},'/api/multimedia/detail').then(res => { |
|||
this.headImg = res.data.head_img |
|||
uni.setNavigationBarTitle({ |
|||
title:res.data.title |
|||
}) |
|||
if (res.data.company_name) { |
|||
res.data.company_name.split(',').forEach((item, index) => { |
|||
this.couponList[index].id = item |
|||
}) |
|||
} |
|||
}); |
|||
}, |
|||
goRule (id) { |
|||
uni.navigateTo({ |
|||
url:"/subPackages/activity/commonRule?id="+id |
|||
}) |
|||
}, |
|||
|
|||
// 产品列表 |
|||
getGoods() { |
|||
// 太慢了 先请求5条 |
|||
this.Post({ |
|||
tag_id: 101, |
|||
offset: 0, |
|||
limit: 5, |
|||
},'/api/product/get_product_by_tag_subject').then(res => { |
|||
this.list = res.data.list |
|||
this.Post({ |
|||
tag_id: 101,offset: 0, |
|||
limit: 999,noShowLoading: true, |
|||
},'/api/product/get_product_by_tag_subject').then(res => { |
|||
this.list = res.data.list |
|||
}) |
|||
}) |
|||
|
|||
}, |
|||
getCoupon(item) { |
|||
if (!this.isReceive) { |
|||
uni.showToast({ |
|||
title: "短时间内请勿重复点击!", |
|||
icon: 'none' |
|||
}) |
|||
return; |
|||
} |
|||
this.isReceive = false |
|||
setTimeout(() => {this.isReceive = true}, 3000) |
|||
this.Post({ |
|||
ids: item.id, |
|||
is_all: 1, |
|||
},"/api/coupon/getNewCouponsByActivitiesIds").then(res => { |
|||
if (res) { |
|||
uni.showToast({ |
|||
title: res.data, |
|||
icon: 'none' |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
|
|||
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> |
|||
.bg { |
|||
width: 750rpx; |
|||
min-height: 100vh; |
|||
background: #319F56; |
|||
padding-bottom: 60rpx; |
|||
} |
|||
|
|||
.topImg { |
|||
width: 100%; |
|||
} |
|||
.main-container{ |
|||
width: 100%; |
|||
margin-top: -140rpx; |
|||
padding: 0 26rpx 60rpx; |
|||
position: relative; |
|||
z-index: 5; |
|||
.title-image{ |
|||
width: 100%; |
|||
height: 112rpx; |
|||
display: block; |
|||
} |
|||
} |
|||
.rule{ |
|||
width: 109rpx; |
|||
height: 41rpx; |
|||
background: #319F56; |
|||
border-radius: 7rpx 0rpx 0rpx 7rpx; |
|||
font-weight: 600; |
|||
font-size: 24rpx; |
|||
color: #FFFFFF; |
|||
|
|||
position: absolute; |
|||
top: 20rpx; |
|||
right: 0; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
line-height: 41rpx; |
|||
} |
|||
.coupon-box{ |
|||
height: 293rpx; |
|||
background: #F4FFFE; |
|||
border-radius:0 0 25rpx 25rpx; |
|||
position: relative; |
|||
padding: 80rpx 26rpx 0; |
|||
overflow: hidden; |
|||
margin-bottom: 44rpx; |
|||
|
|||
.coupon-img{ |
|||
width: 311.33rpx; |
|||
height: 169.33rpx; |
|||
margin-bottom: 32rpx; |
|||
} |
|||
} |
|||
|
|||
.row-product{ |
|||
width: 100%; |
|||
height: 268rpx; |
|||
background: #FFFFFF; |
|||
border-radius: 25rpx; |
|||
padding: 24rpx 26rpx; |
|||
display: flex; |
|||
margin-bottom: 32rpx; |
|||
.img{ |
|||
width: 220rpx; |
|||
height: 100%; |
|||
border-radius: 24rpx; |
|||
flex-shrink: 0; |
|||
} |
|||
.content{ |
|||
width: 100rpx; |
|||
flex: 1; |
|||
justify-content: space-between; |
|||
padding-left: 24rpx; |
|||
} |
|||
.price{ |
|||
font-weight: 500; |
|||
font-size: 40rpx; |
|||
color: #FF7700; |
|||
&::before{ |
|||
content: "¥"; |
|||
font-size: 28rpx; |
|||
} |
|||
&::after{ |
|||
content: "起"; |
|||
font-size: 28rpx; |
|||
} |
|||
} |
|||
.btn{ |
|||
width: 160rpx; |
|||
height: 57rpx; |
|||
background: linear-gradient( 270deg, #319F56 0%, #9CED46 100%); |
|||
border-radius: 30rpx; |
|||
font-weight: bold; |
|||
font-size: 28rpx; |
|||
color: #FFFFFF; |
|||
text-shadow: 0px 1px 3px #244705; |
|||
line-height: 57rpx; |
|||
text-align: center; |
|||
} |
|||
} |
|||
.title{ |
|||
font-weight: 600; |
|||
font-size: 32rpx; |
|||
color: #000000; |
|||
} |
|||
.tags{ |
|||
width: 100%; |
|||
display: flex; |
|||
overflow: hidden; |
|||
.tag{ |
|||
font-weight: 500; |
|||
font-size: 24rpx; |
|||
height: 40rpx; |
|||
line-height: 38rpx; |
|||
color: #026EF6; |
|||
padding: 0rpx 10rpx; |
|||
border-radius: 20rpx; |
|||
border: 1px solid #026EF6; |
|||
margin-right: 20rpx; |
|||
} |
|||
} |
|||
.view-more{ |
|||
width: 262rpx; |
|||
height: 87rpx; |
|||
background: #FFFFFF; |
|||
box-shadow: 0rpx 4rpx 11rpx 0rpx rgba(0,25,72,0.25); |
|||
border-radius: 16rpx; |
|||
line-height: 87rpx; |
|||
|
|||
font-weight: 600; |
|||
font-size: 35rpx; |
|||
color: #319F56; |
|||
text-align: center; |
|||
margin: 48rpx auto 0; |
|||
} |
|||
|
|||
|
|||
.bottom-img{ |
|||
width: 174.67rpx; |
|||
height: 78rpx; |
|||
margin: 74rpx auto 0; |
|||
display: block; |
|||
} |
|||
.back-img{ |
|||
position: fixed; |
|||
width: 66rpx; |
|||
height: 66rpx; |
|||
bottom: 66rpx; |
|||
right: 26rpx; |
|||
} |
|||
</style> |
Loading…
Reference in new issue