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.
yanzong_qianduan/pages/activity/newGoods.vue

392 lines
8.2 KiB

11 months ago
<template>
8 months ago
<view class="newGoods" :id="`newGoods${styleIndex}`">
11 months ago
<!-- <image src="/static/newGoods/newBack.png" mode="" class="bgImg"></image> -->
<view>
8 months ago
<u-navbar title="新品首发" :border-bottom="false" title-color="#333" :background="styleIndex > 0 ? { background: '#fff'} : background"></u-navbar>
11 months ago
</view>
8 months ago
<view v-if="!styleIndex" class="firGoods" :style="{backgroundImage:'url('+backgroundImg+')'}">
</view>
<view v-else class="firGoods" :style="{backgroundImage:`url(${$picUrl + '/static/goods/firGood' + styleIndex + '.png'})`}">
11 months ago
</view>
<view class="goodsList">
10 months ago
<view class="goodsItem" v-for="(item,index) in list" :key="index" @click="goDetails(item.goods_id)">
11 months ago
<view class="hotSell">
9 months ago
抢先体验
11 months ago
</view>
<view class="item">
<view class="goodsInfo">
<view class="goodsDetail">
<view class="infoRight">
<image :src="item.goods_image" mode="widthFix" class="infoImg"></image>
</view>
11 months ago
<view class="infoLeft">
<view class="gName">
{{item.goods_name}}
11 months ago
</view>
<!-- <view class="gd">
{{item.selling_point}}
</view> -->
<view class="price">
<view class="lowPrice">
{{item.goods_price_min?Number(item.goods_price_min):''}}
</view>
<view class="buyNow">
立即购买
</view>
11 months ago
</view>
</view>
11 months ago
</view>
</view>
</view>
9 months ago
</view>
<view class="lookBtn" @click="backtop">
8 months ago
再挑挑看<u-icon name="arrow-upward" color="#fff" size="30" style="transform: rotate(90deg);"></u-icon>
9 months ago
</view>
<view class="lookJie" v-html="content">
11 months ago
</view>
</view>
9 months ago
11 months ago
</view>
</template>
<script>
import * as Api from '@/api/activity'
import * as help from '@/api/help'
import {
getEmptyPaginateObj,
getMoreListData
} from '@/core/app'
export default {
data() {
10 months ago
let img = 'https://www.royaum.com.cn/static/member/head.png'
return {
11 months ago
background: {
background: 'url(' + img + ') center top no-repeat',
10 months ago
backgroundSize: '100% auto',
11 months ago
},
backgroundImg: '',
list: [],
content: ''
11 months ago
}
},
8 months ago
computed: {
styleIndex() {
const index = uni.getStorageSync('styleIndex') || '';
8 months ago
return index;
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getCarouselList()
this.getBrandList()
this.getCarousel()
},
methods: {
// 获取预售规则
getCarousel(type) {
const app = this;
help.getAgreement({
type: 'copyright'
})
.then(result => {
let content = result.data.detail.content || '';
this.content = content
})
.finally(() => app.isLoading = false)
},
// 获取新牌商品
getBrandList() {
const app = this;
let pamars = {
page: 1,
9 months ago
is_brand: '',
is_new: 1,
9 months ago
categoryId: '',
order: '',
is_in_store: 0
}
Api.brandList(pamars)
.then(result => {
9 months ago
app.list = result.data.data;
})
.finally(() => app.isLoading = false)
},
goDetails(goodsId) {
uni.navigateTo({
url: '/pages/goods/detail?goodsId=' + goodsId
})
},
// 获取背景图
getCarouselList() {
const app = this;
Api.getImage({
type: 1
})
.then(result => {
app.backgroundImg = result.data.imgurl
})
.finally(() => app.isLoading = false)
},
9 months ago
backtop() {
uni.pageScrollTo({
scrollTop: 0
});
}
11 months ago
}
11 months ago
}
</script>
<style lang="scss" scoped>
8 months ago
@import './newGoodsStyle.scss';
9 months ago
.lookBtn {
8 months ago
width: 500rpx;
line-height: 90rpx;
height: 90rpx;
9 months ago
background-color: #FFDCC3;
text-align: center;
9 months ago
font-size: 30rpx;
9 months ago
border-radius: 40rpx;
margin: 30rpx auto;
color: #242424;
}
.lookJie {
text-align: center;
color: #fff;
font-size: 28rpx;
8 months ago
margin: 30rpx 0 50rpx 0;
9 months ago
}
.newGoods {
11 months ago
width: 100%;
position: relative;
.bgImg {
11 months ago
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: -10;
}
}
.firGoods {
11 months ago
width: 100%;
8 months ago
height: 652rpx;
10 months ago
background-image: url('https://www.royaum.com.cn/static/newGoods/top.png');
background-repeat: no-repeat; /* 不重复平铺背景图片 */
background-position: center top; /* 居中显示背景图片 */
background-size: 100% auto; /* 拉伸并填充至元素内部 */
.topLine {
11 months ago
display: flex;
justify-content: center;
9 months ago
.left {
11 months ago
margin-top: 132rpx;
9 months ago
.goodsName {
11 months ago
height: 58rpx;
10 months ago
font-size: 40rpx;
11 months ago
font-weight: 600;
color: #242424;
line-height: 58rpx;
}
.goodsDesc {
11 months ago
width: 280rpx;
height: 78rpx;
font-size: 56rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 600;
color: #242424;
line-height: 78rpx;
}
.newTip {
11 months ago
width: 156rpx;
height: 56rpx;
background: #DA1646;
opacity: 1;
border-radius: 25rpx 0 25rpx 25rpx;
text-align: center;
font-size: 36rpx;
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
font-weight: 400;
color: #FFFFFF;
line-height: 56rpx;
}
}
.right {
10 months ago
background-image: url('https://www.royaum.com.cn/static/newGoods/bg.png');
11 months ago
background-repeat: no-repeat;
background-size: 422rpx 102rpx;
11 months ago
position: relative;
background-position: left bottom;
height: 500rpx;
.goodsImg {
11 months ago
width: 414rpx;
height: 414rpx;
box-shadow: 0rpx 12rpx 29rpx 0rpx rgba(0, 0, 0, 0.25);
11 months ago
border-radius: 0rpx 0rpx 0rpx 0rpx;
opacity: 1;
11 months ago
z-index: 99;
11 months ago
}
.bg {
11 months ago
width: 422rpx;
height: 102rpx;
11 months ago
position: absolute;
top: 374rpx;
z-index: 0;
11 months ago
}
}
}
}
.goodsList {
11 months ago
width: 100%;
padding: 26rpx 0 30rpx 26rpx;
10 months ago
background-image: url('https://www.royaum.com.cn/static/newGoods/bot.png');
11 months ago
background-repeat: no-repeat;
background-size: 100% 100%;
9 months ago
.goodsItem {
11 months ago
margin-bottom: 32rpx;
}
11 months ago
.item {
11 months ago
width: 700rpx;
height: 334rpx;
background: #FDE7D5;
border-radius: 12rpx 12rpx 12rpx 12rpx;
opacity: 1;
padding: 8rpx 10rpx 10rpx;
}
.hotSell {
11 months ago
width: 226rpx;
height: 82rpx;
background: linear-gradient(180deg, #FDE7D5 0%, #FFDCC3 100%);
opacity: 1;
text-align: center;
font-size: 36rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 600;
color: #C82821;
line-height: 82rpx;
position: relative;
top: 8rpx;
border-radius: 20rpx 20rpx 0 0;
}
.goodsInfo {
11 months ago
width: 680rpx;
height: 316rpx;
background: #FFFFFF;
border-radius: 8rpx 8rpx 8rpx 8rpx;
opacity: 1;
padding-left: 28rpx;
.goodsDetail {
11 months ago
display: flex;
justify-content: space-between;
width: 100%;
position: relative;
align-items: flex-start;
.infoLeft {
flex: 1;
margin-top: 20rpx;
.gName {
margin-bottom: 15rpx;
overflow: hidden;
-webkit-line-clamp: 2;
10 months ago
max-width: 300rpx;
height: 112rpx;
11 months ago
font-size: 40rpx;
font-weight: 600;
color: #3F3F3F;
line-height: 56rpx;
margin-top: 32rpx;
}
// .gd {
// overflow: hidden;
// -webkit-line-clamp: 2;
// height: 88rpx;
// font-size: 32rpx;
// font-weight: 400;
// color: #9F9F9F;
// line-height: 44rpx;
// }
// .gp {
// height: 44rpx;
// font-size: 32rpx;
// font-family: PingFang SC, PingFang SC;
// font-weight: 400;
// color: #DE041C;
// line-height: 38rpx;
// }
11 months ago
}
.infoRight {
width: 220rpx;
height: 220rpx;
11 months ago
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin-right: 14rpx;
display: flex;
justify-content: flex-start;
align-items: center;
margin-top: 40rpx;
.infoImg {
width: 200rpx;
height: 200rpx;
11 months ago
}
}
}
.price {
11 months ago
display: flex;
justify-content: space-between;
10 months ago
margin-top: 50rpx;
margin-right: 30rpx;
9 months ago
.lowPrice {
11 months ago
height: 50rpx;
font-size: 36rpx;
font-weight: 600;
color: #DE041C;
line-height: 50rpx;
}
.buyNow {
11 months ago
width: 174rpx;
height: 58rpx;
background: linear-gradient(180deg, #FC522C 0%, #FA2929 100%);
border-radius: 58rpx 58rpx 58rpx 58rpx;
opacity: 1;
text-align: center;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #FFFFFF;
line-height: 58rpx;
}
}
}
}
</style>