123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- <template>
- <view class="home">
- <topbar>
- </topbar>
- <view class="top-list">
- <loadSke :loading='topLoading' :list='bannerList'>
- <swiper class="swiper-box" :current="current" autoplay circular indicator-dots>
- <swiper-item v-for="(item,index) in bannerList" :key='index'>
- <image @click="clickJumpType(item)" class="image" :src="item.fileUrl" mode="aspectFill" :draggable="false" />
- </swiper-item>
- </swiper>
- <view class="eat-box">
- <view class="eat" v-for="(item,index) in couponList" :key='index' @click="clickJumpType(item)">
- <image :src="item.fileUrl" mode="scaleToFill" class="img"></image>
- <view class="text-box">
- <text class="text-1">{{item.pictureName}}</text>
- <text class="text-2">{{item.dataDescribe.toString()}}</text>
- </view>
- </view>
- </view>
- <view class="menu-box">
- <view class="menu" v-for="(item,index) in menuList" :key='index' @click="clickJumpType(item)">
- <image :src="item.fileUrl" mode="scaleToFill" class="img"></image>
- <text class="text-1">{{item.pictureName}}</text>
- <text class="text-2">{{item.dataDescribe || '暂无描述'}}</text>
- </view>
- </view>
- </loadSke>
- </view>
- <view class="item-box">
- <view class="item-titBox">
- <text class="item-tit">限时特价</text>
- <!-- <text class="item-tit-right" @tap='go()'>更多视频 ></text> -->
- </view>
- <loadSke :loading='pddLoading' :list='pddList'>
- <view class="flex-box">
- <view class="film-box" v-for="(item,index) in pddList" :key='index' @click="goMiniApp(JSON.stringify({appId:item.we_app_info.app_id,path:item.we_app_info.page_path}))">
- <image :src="item.goods_image_url" mode="scaleToFill" class="img" draggable></image>
- <view class="bottom-box">
- <view class="tit">
- <text class="text-1">{{item.goods_name}}</text>
- </view>
- <view class="des-box">
- <view class="des">{{item.unified_tags}}</view>
- <!-- <view class="des">演员:高山南 山崎和佳奈 小山 山崎和佳奈 小山 ...</view> -->
- </view>
- <view class="buy-box">
- <text class="price">{{'¥'+(item.min_group_price)/100}}</text>
- <button type="default" class="buy">活动价 {{'¥'+(item.min_group_price-item.coupon_discount)/100}}</button>
- </view>
- </view>
- </view>
- </view>
- <!-- <view class="ad-video">
- <ad unit-id="adunit-173f2958099a2b25" ad-type="video" ad-theme="white"></ad>
- </view> -->
- </loadSke>
- </view>
- </view>
- </template>
- <script>
- import {
- getHomePageDataList,
- getPDD,
- getPddWxData
- } from '@/api/home.js'
- export default {
- data: () => ({
- bannerList: [],
- couponList: [],
- menuList: [],
- topLoading: true,
- pddList: [],
- pddLoading: true
- }),
- mounted() {
- this.init()
- },
- methods: {
- init() {
- getHomePageDataList().then(res => {
- this.bannerList = res.data.carouselChart
- this.couponList = res.data.coupon.slice(0, 4)
- this.menuList = res.data.menu
- this.$nextTick(() => {
- this.topLoading = false
- })
- })
- getPddWxData().then(res => {
- this.pddList = res
- this.$nextTick(() => {
- this.pddLoading = false
- })
- })
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .top-list {
- padding: 30rpx;
- box-sizing: border-box;
- width: 100%;
- background-color: #FFFFFF;
- .swiper-box {
- width: 690rpx;
- height: 342rpx;
- overflow: hidden;
- .image {
- width: 100%;
- height: 100%;
- border-radius: 10px;
- }
- }
- .eat-box {
- margin-top: 40rpx;
- display: flex;
- justify-content: space-between;
- .eat {
- width: 144rpx;
- height: 190rpx;
- position: relative;
- .img {
- width: 100%;
- height: 100%;
- }
- .text-box {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- position: absolute;
- bottom: 10rpx;
- left: 50%;
- width: 100%;
- transform: translateX(-50%);
- .text-1 {
- font-size: 24rpx;
- color: #FFFFFF;
- text-align: center;
- }
- .text-2 {
- font-size: 20rpx;
- color: #FFFFFF;
- text-align: center;
- }
- }
- }
- }
- .menu-box {
- display: flex;
- justify-content: flex-start;
- flex-wrap: wrap;
- margin: 0 -10rpx;
- .menu {
- width: 20%;
- padding: 0 10rpx;
- box-sizing: border-box;
- // height: 121rpx;
- margin-top: 40rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- align-items: center;
- .img {
- flex-shrink: 0;
- width: 64rpx;
- height: 64rpx;
- border-radius: 50%;
- }
- .text-1 {
- margin-top: 10rpx;
- font-size: 24rpx;
- color: #0F0404;
- text-align: center;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .text-2 {
- font-size: 20rpx;
- color: #666666;
- text-align: center;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- }
- }
- .item-box {
- background-color: #fff;
- margin-top: 40rpx;
- .item-titBox {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 20rpx;
- border-bottom: 1rpx solid #e8e8e8;
- .item-tit {
- border-left: 8rpx solid #E31818;
- font-size: 30rpx;
- padding: 11rpx;
- margin-left: 20rpx;
- }
- .item-tit-right {
- font-size: 26rpx;
- color: #666666;
- line-height: 58rpx;
- padding: 11rpx;
- }
- }
- .flex-box {
- display: flex;
- justify-content: center;
- flex-wrap: wrap;
- background-color: #F8F8F8;
- padding-bottom: 20rpx;
- .film-box {
- width: 334rpx;
- border-radius: 20rpx;
- overflow: hidden;
- background: #FFFFFF;
- margin: 30rpx 11rpx 0;
- .img {
- width: 100%;
- height: 334rpx;
- }
- .bottom-box {
- padding: 30rpx 20rpx;
- .tit {
- display: flex;
- justify-content: space-between;
- .text-1 {
- width: 100%;
- font-size: 26rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- .des-box {
- margin-top: 10rpx;
- .des {
- width: 100%;
- font-size: 22rpx;
- color: #666666;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- .buy-box {
- margin-top: 20rpx;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .price {
- // color: #E31818;
- text-decoration: line-through;
- font-size: 34rpx;
- }
- .buy {
- height: 40rpx;
- background: linear-gradient(90deg, #E31818, #ED3E24, #ED4F24);
- border-radius: 20rpx;
- margin-left: 10rpx;
- font-size: 20rpx;
- color: #FFFFFF;
- display: flex;
- justify-content: center;
- align-items: center;
- white-space: nowrap;
- }
- }
- }
- }
- }
- }
- .ad-video {
- margin-top: 40rpx;
- }
- </style>
|