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/ranking.vue

485 lines
11 KiB

10 months ago
<template>
10 months ago
<view class="newGoods">
<!-- :style="{backgroundImage:'url('+backgroundImg+')'}" -->
<!-- <view class="rule" @click="openPage()">规则</view> -->
<view>
10 months ago
<u-navbar title="排行榜" back-icon-color="#fff" :border-bottom="false" title-color="#fff" :background="background"></u-navbar>
10 months ago
</view>
10 months ago
<!-- <image :src="$picUrl+'/static/rank/rangkImg.png'" mode="" class="bgImg"></image> -->
10 months ago
<view class="headTitle">
全站热销好物
</view>
<view class="ranking">
- 实时排名 -
</view>
<view class="menuList">
<scroll-view scroll-x="true" class="list">
<view class="menuItem" v-for="(item,index) in menuList" :key="index" @click="onChosed(item,index)">
10 months ago
<view class="menuName">
{{item.name}}
</view>
<view class="line" v-if="chosed==index"></view>
10 months ago
</view>
</scroll-view>
</view>
10 months ago
<view class="rankList" v-for="(item,index) in jingList" :key="index" style="background-color: #fff;padding: 32rpx;">
<view class="firLine" @click="goDetailMore(item.category_id,item.name)">
<view class="hotTitle">{{item.name}}热销榜</view>
10 months ago
<view class="opera">
<text>更多上榜好物</text>
10 months ago
<image :src="$picUrl+'/static/order/left.png'" mode="" class="more"></image>
10 months ago
</view>
</view>
<view class="goodsList">
10 months ago
<view class="goodsItem" v-for="(item_1,index) in item.goods_list" :key="index" v-if="index < 3" @click="goDetail(item_1.goods_id)">
<image :src="$picUrl+'/static/rank/topOne.png'" class="topOne" v-if="index==0"></image>
<image :src="$picUrl+'/static/rank/topTwo.png'" class="topOne" v-if="index==1"></image>
<image :src="$picUrl+'/static/rank/topThree.png'" class="topOne" v-if="index==2"></image>
<image :src="item_1.goods_image" mode="" class="goodsImg"></image>
10 months ago
<view class="goodsName">
{{item_1.goods_name}}
10 months ago
</view>
<view class="goodsPrice">
10 months ago
<text>{{item_1.goods_price_min}}</text>
</view>
</view>
</view>
</view>
<!-- 商品 -->
10 months ago
<view class="rankList" v-if="chosed>0">
<view class="goodsList1" v-for="(item,index) in goodList" :key="index">
<view class="goodsDetail1">
10 months ago
<image :src="$picUrl+'/static/rank/topOne.png'" class="topOne1" v-if="index==0"></image>
<image :src="$picUrl+'/static/rank/topTwo.png'" class="topOne1" v-if="index==1"></image>
<image :src="$picUrl+'/static/rank/topThree.png'" class="topOne1" v-if="index==2"></image>
<view class="goodsInfo1">
10 months ago
<image :src="item.goods_image" class="goodsImg1"></image>
<view class="goodsName1">
<view class="name1">
{{item.goods_name}}
</view>
<view class="hot1">
<text class="hotTitle1">HOT</text>
<text class="zs1">综合热卖指数{{item.remaizhishu}}</text>
</view>
</view>
</view>
</view>
<view class="opera1">
<view class="price1">
<text>{{item.goods_price_min}}</text>
</view>
<view class="look1" @click="goDetail(item.goods_id)">
去看看
10 months ago
<image :src="$picUrl+'/static/rank/right.png'" mode="" class="right1"></image>
10 months ago
</view>
</view>
</view>
</view>
</view>
</template>
10 months ago
<script>
import * as Api from '@/api/activity'
10 months ago
export default {
data() {
return {
10 months ago
background: {
10 months ago
background: 'url(https://www.royaum.com.cn/static/rank/rank1.png) center top no-repeat',
10 months ago
backgroundSize: '100% auto',
},
10 months ago
category_id: "",
chosed: 0,
10 months ago
jingListAll: [],
menuList: [],
backgroundImg: '',
jingList: [],
goodList: [],
10 months ago
}
10 months ago
},
onShow() {
this.getListCharts()
},
methods: {
10 months ago
openPage() {
uni.navigateTo({
url: '/pages/activity/presaleRule?type=6'
})
},
// 获取背景图
getCarouselList(category_id) {
const app = this;
Api.getImage({
type: 3
})
.then(result => {
app.backgroundImg = result.data.imgurl;
if (app.chosed == 0) {
app.getListJingData()
} else {
app.getListgoodData(category_id)
}
})
.finally(() => app.isLoading = false)
},
getListJingData() {
let app = this;
let pamars = {
store_id: 10001,
}
Api.chartsGoodsJing(pamars)
.then(result => {
app.jingList = result.data;
10 months ago
app.jingListAll = result.data;
})
.finally(() => app.isLoading = false)
},
getListgoodData(categoryId) {
let app = this;
let pamars = {
store_id: 10001,
categoryId: categoryId,
}
Api.chartsGoodsList(pamars)
.then(result => {
app.goodList = result.data.data;
})
.finally(() => app.isLoading = false)
},
onChosed(item, index) {
let app = this;
app.chosed = index;
10 months ago
if(index == 0){
app.jingList = app.jingListAll;
}else{
app.jingList = app.jingListAll.filter(a=>a.category_id == item.category_id);
}
},
// 分类
getListCharts() {
let app = this
app.menuList = []
let pamars = {
store_id: 10001
}
Api.charts(pamars)
.then(result => {
let obj = {
name: '精品'
}
result.data.unshift(obj)
app.menuList = result.data;
app.getListJingData()
})
.finally(() => app.isLoading = false)
},
goDetail(orderId) {
10 months ago
uni.navigateTo({
10 months ago
url: '/pages/goods/detail?goodsId=' + orderId
})
},
10 months ago
goDetailMore(categoryId, name) {
uni.navigateTo({
10 months ago
url: '/pages/activity/charts?categoryId=' + categoryId + '&name=' + name
10 months ago
})
},
10 months ago
}
}
</script>
<style lang="scss" scoped>
.newGoods {
width: 100%;
position: relative;
min-height: 100vh;
10 months ago
padding-bottom: 30rpx;
background: #F34A40 url(https://www.royaum.com.cn/static/rank/rank1.png) center top no-repeat;
background-size: 100% auto;
10 months ago
.bgImg {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: -10;
}
}
10 months ago
.headTitle {
width: 100%;
text-align: center;
height: 98rpx;
font-size: 76rpx;
font-weight: 400;
color: #FFFFFF;
line-height: 98rpx;
text-shadow: 8px 2px 15px #FF5F4C;
10 months ago
margin-top: 60rpx;
10 months ago
}
.ranking {
width: 430rpx;
height: 150rpx;
10 months ago
background: url('https://www.royaum.com.cn/static/rank/timeRank.png') center top no-repeat;
background-size: contain;
10 months ago
text-align: center;
10 months ago
line-height: 100rpx;
10 months ago
font-size: 36rpx;
font-weight: 500;
color: #FFFFFF;
10 months ago
margin: 0 auto;
margin-top: 20rpx;
10 months ago
}
.menuList {
10 months ago
margin-top: 34rpx;
width: 100%;
padding-left: 50rpx;
.list {
10 months ago
white-space: nowrap;
}
.menuItem {
10 months ago
display: inline-block;
margin-right: 62rpx;
.menuName {
10 months ago
height: 50rpx;
font-size: 36rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #FFFFFF;
line-height: 50rpx;
}
.line {
10 months ago
width: 70rpx;
height: 10rpx;
background: #FFE4C3;
border-radius: 72rpx 72rpx 72rpx 72rpx;
opacity: 1;
margin-top: 8rpx;
}
}
}
.rankList {
10 months ago
width: 702rpx;
10 months ago
border-radius: 18rpx;
margin: 28rpx auto;
.firLine {
10 months ago
display: flex;
justify-content: space-between;
.hotTitle {
10 months ago
height: 50rpx;
font-size: 36rpx;
font-weight: 500;
color: #0E0E0E;
line-height: 50rpx;
}
.opera {
10 months ago
display: flex;
align-items: center;
text {
10 months ago
height: 44rpx;
font-size: 32rpx;
font-weight: 400;
color: #9F9F9F;
line-height: 44rpx;
margin-right: 18rpx;
}
.more {
10 months ago
width: 12rpx;
height: 18rpx;
10 months ago
}
}
}
.goodsList {
10 months ago
display: flex;
margin-top: 86rpx;
margin-left: 18rpx;
.goodsItem {
10 months ago
position: relative;
10 months ago
width: 33.3%;
.topOne {
10 months ago
width: 48rpx;
height: 66rpx;
position: absolute;
top: -38rpx;
10 months ago
left: -28rpx;
}
.goodsImg {
10 months ago
width: 160rpx;
height: 160rpx;
}
.goodsName {
10 months ago
width: 150rpx;
height: 40rpx;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #3F3F3F;
line-height: 40rpx;
margin: 8rpx 0 4rpx 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
10 months ago
}
.goodsPrice {
10 months ago
height: 50rpx;
10 months ago
font-size: 24rpx;
10 months ago
color: #DE041C;
line-height: 50rpx;
10 months ago
text{
font-size: 36rpx;
font-weight: 600;
}
10 months ago
}
}
}
.goodsList1 {
width: 700rpx;
height: 440rpx;
background: #FCE5C6;
10 months ago
border-radius: 18rpx;
margin-bottom: 42rpx;
.goodsDetail1 {
width: 700rpx;
height: 336rpx;
padding: 54rpx 0 0 52rpx;
background: #FFFFFF;
10 months ago
border-radius: 18rpx;
position: relative;
.topOne1 {
width: 73rpx;
height: 100rpx;
position: absolute;
left: 36rpx;
top: -8rpx;
}
.goodsInfo1 {
display: flex;
.goodsImg1 {
width: 224rpx;
height: 224rpx;
10 months ago
margin-right: 20rpx;
}
.goodsName1 {
.name1 {
width: 396rpx;
height: 132rpx;
font-size: 32rpx;
font-weight: 400;
color: #0E0E0E;
10 months ago
line-height: 44rpx;
word-break: break-all;
display: -webkit-box;
10 months ago
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
.hot1 {
width: 336rpx;
height: 60rpx;
background: linear-gradient(90deg, #FCE5C6 0%, #FFFFFF 100%);
10 months ago
border-radius: 70rpx;
opacity: 1;
10 months ago
margin-top: 26rpx;
.hotTitle1 {
margin-right: 8rpx;
width: 68rpx;
height: 42rpx;
font-size: 32rpx;
line-height: 60rpx;
margin-left: 8rpx;
background: -webkit-linear-gradient(180deg, #FFA621 0%, #F34A40 100%);
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
}
.zs1 {
height: 44rpx;
font-size: 32rpx;
font-weight: 400;
color: #9F6516;
line-height: 60rpx;
}
}
}
}
}
.opera1 {
display: flex;
justify-content: space-between;
width: 100%;
align-items: center;
height: 104rpx;
.price1 {
font-size: 32rpx;
font-weight: 400;
color: #301F14;
line-height: 44rpx;
10 months ago
margin-left: 30rpx;
text {
font-size: 48rpx;
font-weight: 600;
color: #301F14;
line-height: 68rpx;
}
}
.look1 {
width: 202rpx;
height: 60rpx;
background: linear-gradient(180deg, #FF7E6A 0%, #FB322A 100%);
10 months ago
border-radius: 70rpx;
margin-right: 22rpx;
text-align: center;
line-height: 60rpx;
10 months ago
color: #FFFFFF;
font-size: 32rpx;
display: flex;
align-items: center;
justify-content: center;
.right1 {
10 months ago
width: 18rpx;
height: 27rpx;
margin-left: 12rpx;
}
}
}
}
10 months ago
}
10 months ago
.rule {
width: 100rpx;
height: 60rpx;
position: absolute;
right: 0;
10 months ago
top: 150rpx;
z-index: 19;
10 months ago
background-color: #FFFFFF;
color: #0E0E0E;
text-align: center;
line-height: 60rpx;
border-radius: 50rpx 0 0 50rpx;
font-size: 30rpx;
}
</style>