|
|
|
<template>
|
|
|
|
<view class="newsshop" v-if="shopItem" :style="{backgroundImage:'url('+shopItem.index_icon+')'}">
|
|
|
|
<view class="newsshop-navbar">
|
|
|
|
<u-navbar :title="shopItem.title" back-icon-color="#fff" :border-bottom="false" title-color="#fff"
|
|
|
|
:background="background"></u-navbar>
|
|
|
|
</view>
|
|
|
|
<view class="newsshop-hd">
|
|
|
|
</view>
|
|
|
|
<view class="newsshop-bd" v-if="shopList.length>0" v-for="(item,index) in shopList" :key="i">
|
|
|
|
<view class="newsshop-sale">
|
|
|
|
<view class="a">
|
|
|
|
<image :src="item.col_pic"></image>
|
|
|
|
</view>
|
|
|
|
<view class="info">
|
|
|
|
<view class="li b">
|
|
|
|
<view class="item" v-for="(i,index) in item.goods_list.slice(0, item.sliceIndex)" :key="index"
|
|
|
|
@click="goDetails(i.goods_id)">
|
|
|
|
<image class="pic" :src="i.goods_image"></image>
|
|
|
|
<view class="title">{{i.goods_name}}</view>
|
|
|
|
<view class="price">
|
|
|
|
<image class="icon" src="https://www.royaum.com.cn/static/news/newshop-05.png">
|
|
|
|
</image>
|
|
|
|
<view class="p">¥<text>{{i.goods_price_min}}</text></view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="c" @click="toggleList(index)" v-if="item.goods_list.length>5">点击查看更多<u-icon
|
|
|
|
style="margin-left: 20rpx;" name="arrow-down">
|
|
|
|
</u-icon>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import * as Api from '@/api/activity'
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
current: 0,
|
|
|
|
shopItem: '',
|
|
|
|
shopList: []
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onLoad() {
|
|
|
|
this.getInfo()
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
goDetails(goodsId) {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: '/pages/goods/detail?goodsId=' + goodsId
|
|
|
|
})
|
|
|
|
},
|
|
|
|
toggleList(index) {
|
|
|
|
let len = this.shopList[index].goods_list.length
|
|
|
|
if (this.shopList[index].sliceIndex >= len) {
|
|
|
|
this.$toast('已展示全部数据')
|
|
|
|
} else {
|
|
|
|
this.shopList[index].sliceIndex += 6;
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
// 获取新牌商品详情
|
|
|
|
getInfo() {
|
|
|
|
const app = this;
|
|
|
|
Api.info()
|
|
|
|
.then(result => {
|
|
|
|
this.shopItem = result.data;
|
|
|
|
this.getShopList(result.data.id)
|
|
|
|
})
|
|
|
|
.finally()
|
|
|
|
},
|
|
|
|
// 获取新牌商品
|
|
|
|
getShopList(active_id) {
|
|
|
|
const app = this;
|
|
|
|
let pamars = {
|
|
|
|
active_id: active_id,
|
|
|
|
}
|
|
|
|
Api.detail(pamars)
|
|
|
|
.then(result => {
|
|
|
|
result.data.col.forEach(item => {
|
|
|
|
item.sliceIndex = 6
|
|
|
|
});
|
|
|
|
this.shopList = result.data.col;
|
|
|
|
console.log(this.shopList)
|
|
|
|
})
|
|
|
|
.finally()
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
::v-deep .u-navbar-fixed {
|
|
|
|
background: none !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.newsshop {
|
|
|
|
width: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
min-height: 100vh;
|
|
|
|
background-size: 100% auto;
|
|
|
|
|
|
|
|
&-hd {
|
|
|
|
height: 380rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&-bd {
|
|
|
|
background-color: #f34a40;
|
|
|
|
padding-bottom: 30rpx;
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
.c {
|
|
|
|
width: 656rpx;
|
|
|
|
height: 83rpx;
|
|
|
|
background: #FFE7E3;
|
|
|
|
border-radius: 8rpx;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
font-size: 28rpx;
|
|
|
|
font-weight: 500;
|
|
|
|
color: #F34A40;
|
|
|
|
margin: 0 auto;
|
|
|
|
margin-top: 30rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-sale {
|
|
|
|
width: 710rpx;
|
|
|
|
margin: 0 auto;
|
|
|
|
margin-top: 30rpx;
|
|
|
|
|
|
|
|
.a {
|
|
|
|
width: 100%;
|
|
|
|
height: 93rpx;
|
|
|
|
|
|
|
|
image {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.info {
|
|
|
|
width: 100%;
|
|
|
|
padding: 30rpx 10rpx;
|
|
|
|
box-sizing: border-box;
|
|
|
|
background-color: #fff;
|
|
|
|
border-radius: 0 0 10rpx 10rpx;
|
|
|
|
|
|
|
|
.li {
|
|
|
|
margin-top: 20rpx;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
&:first-child {
|
|
|
|
margin-top: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.b {
|
|
|
|
width: 100%;
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
|
|
.item {
|
|
|
|
display: inline-block;
|
|
|
|
overflow: hidden;
|
|
|
|
margin: 20rpx 7rpx 0 7rpx;
|
|
|
|
|
|
|
|
&:first-child {
|
|
|
|
margin-left: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.pic {
|
|
|
|
width: 218rpx;
|
|
|
|
height: 218rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
|
|
|
text-align: center;
|
|
|
|
font-size: 28rpx;
|
|
|
|
font-weight: 400;
|
|
|
|
color: #3F3F3F;
|
|
|
|
line-height: 50rpx;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
-webkit-line-clamp: 1;
|
|
|
|
max-width: 200rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.price {
|
|
|
|
width: 215rpx;
|
|
|
|
height: 55rpx;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
line-height: 55rpx;
|
|
|
|
top: 0;
|
|
|
|
z-index: 2;
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: #DE041C;
|
|
|
|
padding-left: 5rpx;
|
|
|
|
|
|
|
|
text {
|
|
|
|
font-size: 30rpx;
|
|
|
|
font-weight: 600;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|