123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616 |
- <template>
- <view>
- <page-head title="home"></page-head>
- <view class="tabbar-container" :style="'padding-top:'+ safeAreaTop+'px'">
- <view class="searchView">
- <i class="iconfont icon-search_icon"></i>
- <input type="text" value="" placeholder="搜直播、品牌、商品、小店、达人" />
- <button>搜索</button>
- </view>
- <!-- 昨日数据 -->
- <view class="yesterdayData">
- <image src="../../static/img/pingtai_icon@2x.png" class="bg_img" mode="widthFix"></image>
- <view class="yesterday_title">
- <text class="text">昨日平台数据</text>
- <image class="image" src="../../static/img/zuori_icon@2x.png" mode="widthFix"></image>
- </view>
- <view class="yesterdayInfo">
- <view class="info">
- <text class="text">123.4w</text>
- <view class="view">平台销售额</view>
- </view>
- <view class="info">
- <text class="text">123.4w</text>
- <view class="view">平台销量</view>
- </view>
- <view class="info">
- <text class="text">123.4w</text>
- <view class="view">UV价值</view>
- </view>
- </view>
- </view>
- <!-- 入口板块 -->
- <view class="entrance">
- <view class="entranceInfo" v-for="(item,index) in entranceList" :key="index">
- <image :src="item.img" mode="widthFix" class="image"></image>
- <text class="text">{{item.name}}</text>
- </view>
- </view>
- <!-- 正在直播 -->
- <view class="plate">
- <view class="titleView">
- <view class="title">
- <text class="text">正在直播</text>
- <image src="https://kx-bigdata.oss-cn-beijing.aliyuncs.com/shop_live/live.gif" mode="widthFix" class="image"></image>
- </view>
- <view class="more">更多</view>
- </view>
- <scroll-view class="liveView" scroll-x="true">
- <view class="liveInfo" v-for="(item,index) in liveUserList" :key="item.live_id">
- <view class="info">
- <image :src="item.live_cover_url" class="cover" mode="aspectFill"></image>
- <view class="infoMask">
- <view class="liveing">直<br/>播<br/>中</view>
- <view class="shopView" v-if="item.user_info">
- <image :src="item.user_info.headurl" mode="widthFix" class="shopImage"></image>
- <view class="shopName">{{item.user_info.user_name}}</view>
- </view>
- </view>
- </view>
- <view class="liveData">
- <text class="text1">销售额</text>
- <text class="text2">{{item.sell_money_sum?$NumberHandle(item.sell_money_sum):'-'}}</text>
- </view>
- </view>
- </scroll-view>
- </view>
- <!-- 账号销售榜 -->
- <view class="plate plateRank">
- <view class="titleView">
- <view class="title title2">
- <image src="https://kx-bigdata.oss-cn-beijing.aliyuncs.com/shop_live/icon1.png?v=1" mode="widthFix" class="title_bg"></image>
- <text class="text">账号销售榜</text>
- <text class="time">{{rankTime}}</text>
- </view>
- <view class="more">更多</view>
- </view>
- <view class="rankBox">
- <view class="rankItem" v-for="(item,index) in sellTopUserList" :key="index">
- <view class="rankInfo">
- <view class="imageBox">
- <image :src="item.headurl" mode="widthFix" class="userImg"></image>
- <image v-if="index<3" :src="'https://kx-bigdata.oss-cn-beijing.aliyuncs.com/shop_live/top'+ (index+1) + '.png'" mode="widthFix" class="topImg"></image>
- </view>
- <view class="info">
- <view class="name">{{item.user_name?item.user_name:'-'}}</view>
- <view class="price">
- 粉丝数 <text>{{item.follower_count?$NumberHandle(item.follower_count):'-'}}</text>
- </view>
- </view>
- </view>
- <view class="rankData">
- <text>{{item.sales_money?$NumberHandle(item.sales_money):'-'}}</text>
- <view>销售额</view>
- </view>
- </view>
- </view>
- </view>
- <!-- 品牌销售榜 -->
- <view class="plate plateRank">
- <view class="titleView">
- <view class="title title2">
- <image src="https://kx-bigdata.oss-cn-beijing.aliyuncs.com/shop_live/icon1.png?v=1" mode="widthFix" class="title_bg"></image>
- <text class="text">品牌销售榜</text>
- <text class="time">{{rankTime}}</text>
- </view>
- <view class="more">更多</view>
- </view>
- <view class="rankBox">
- <view class="rankItem" v-for="(item,index) in sellTopBrandList" :key="index">
- <view class="rankInfo">
- <view class="imageBox">
- <image :src="item.icon" mode="widthFix" class="userImg"></image>
- <image v-if="index<3" :src="'https://kx-bigdata.oss-cn-beijing.aliyuncs.com/shop_live/top'+ (index+1) + '.png'" mode="widthFix" class="topImg"></image>
- </view>
- <view class="info">
- <view class="name">{{item.brand_name?item.brand_name:'-'}}</view>
- <view class="price">
- 销量 <text>{{item.sales_number?$NumberHandle(item.sales_number):'-'}}</text>
- </view>
- </view>
- </view>
- <view class="rankData">
- <text>{{item.sales_money?$NumberHandle(item.sales_money):'-'}}</text>
- <view>销售额</view>
- </view>
- </view>
- </view>
- </view>
- <!-- 商品销售榜 -->
- <view class="plate plateRank">
- <view class="titleView">
- <view class="title title2">
- <image src="https://kx-bigdata.oss-cn-beijing.aliyuncs.com/shop_live/icon1.png?v=1" mode="widthFix" class="title_bg"></image>
- <text class="text">商品销售榜</text>
- <text class="time">{{rankTime}}</text>
- </view>
- <view class="more">更多</view>
- </view>
- <view class="rankBox">
- <view class="rankItem" v-for="(item,index) in goodsSalesList" :key="index">
- <view class="rankInfo">
- <view class="imageBox" style="border-radius: 4rpx;">
- <image :src="item.cover" mode="widthFix" class="userImg" style="border-radius: 4rpx;"></image>
- <image v-if="index<3" :src="'https://kx-bigdata.oss-cn-beijing.aliyuncs.com/shop_live/top'+ (index+1) + '.png'" mode="widthFix" class="topImg"></image>
- </view>
- <view class="info">
- <view class="name">{{item.title?item.title:'-'}}</view>
- <view class="price">
- 价格 <text>{{(item.price_min||item.price_max) ? (item.price_max==item.price_max?'¥'+item.price_max:('¥'+item.price_min + '-' + '¥'+item.price_max)):'-'}}</text>
- </view>
- </view>
- </view>
- <view class="rankData">
- <text>{{item.sell_money?$NumberHandle(item.sell_money):'-'}}</text>
- <view>销售额</view>
- </view>
- </view>
- </view>
- </view>
- <!-- 商品热推榜 -->
- <view class="plate plateRank">
- <view class="titleView">
- <view class="title title2">
- <image src="https://kx-bigdata.oss-cn-beijing.aliyuncs.com/shop_live/icon1.png?v=1" mode="widthFix" class="title_bg"></image>
- <text class="text">商品热推榜</text>
- <text class="time">{{rankTime}}</text>
- </view>
- <view class="more">更多</view>
- </view>
- <view class="rankBox">
- <view class="rankItem" v-for="(item,index) in goodsHotList" :key="index">
- <view class="rankInfo">
- <view class="imageBox" style="border-radius: 4rpx;">
- <image :src="item.cover" mode="widthFix" class="userImg" style="border-radius: 4rpx;"></image>
- <image v-if="index<3" :src="'https://kx-bigdata.oss-cn-beijing.aliyuncs.com/shop_live/top'+ (index+1) + '.png'" mode="widthFix" class="topImg"></image>
- </view>
- <view class="info">
- <view class="name">{{item.title?item.title:'-'}}</view>
- <view class="price">
- 价格 <text>{{(item.price_min||item.price_max) ? (item.price_max==item.price_max?'¥'+item.price_max:('¥'+item.price_min + '-' + '¥'+item.price_max)):'-'}}</text>
- </view>
- </view>
- </view>
- <view class="rankData">
- <text>{{item.sell_money?$NumberHandle(item.sell_money):'-'}}</text>
- <view>销售额</view>
- </view>
- </view>
- </view>
- </view>
-
- </view>
- <tabbar selected='homePage'></tabbar>
- </view>
- </template>
- <script>
- import tabbar from '@/components/tabbar.vue'
- export default {
- components:{
- tabbar,
- },
- data() {
- return {
- safeAreaTop:this.$store.state.systemInfo.safeAreaTop,
- entranceList:[
- {img:'../../static/img/daihuo_icon@2x.png',name:'直播带货榜'},
- {img:'../../static/img/zhangfen_icon@2x.png',name:'直播涨粉榜'},
- {img:'../../static/img/zhagnhaoxiaoshou_icon@2x.png',name:'账号销售榜'},
- {img:'../../static/img/zhanghaozhangfen_icon@2x.png',name:'账号涨粉榜'},
- {img:'../../static/img/pinpai_icon@2x.png',name:'品牌销售榜'},
- {img:'../../static/img/douyinxiaoliang_icon@2x.png',name:'商品销售榜'},
- {img:'../../static/img/retui_icon@2x.png',name:'商品热推榜'},
- {img:'../../static/img/shishi_icon@2x.png',name:'实时销量榜'},
- ],
- liveUserList:[],
- sellTopUserList:[],
- rankTime:'',
- sellTopBrandList:[],
- goodsSalesList:[],
- goodsHotList:[]
- }
- },
- async onLoad() {
- await this.$onLaunched;
- if(new Date().getHours()<6){//6点以前是前天,6点以后是昨天
- this.rankTime = this.$getDay(-2, false)
- }else{
- this.rankTime = this.$getDay(-1, false)
- }
- var time_arr = this.rankTime.split('-')
- this.rankTime = time_arr[1]+'/'+time_arr[2]
-
- this.getLiveList()
- this.getSellTopUserList()
- this.getSellTopBrandList()
- this.getGoodsSalesList()
- this.getGoodsHotList()
- },
- methods:{
- getLiveList(){//正在直播
- this.$req(this.$api.home_onLiveUserList,'get',{page_size:5},(res)=>{
- if(res && res.errno == 0){
- this.liveUserList = res.rst;
- }else{
- }
- })
- },
- getSellTopUserList(){//账号销售榜
- this.$req(this.$api.home_sellTopUserList,'get',{page_size:3},(res)=>{
- if(res && res.errno == 0){
- this.sellTopUserList = res.rst;
- }else{
- }
- })
- },
- getSellTopBrandList(){//品牌销售榜
- this.$req(this.$api.home_sellTopBrandList,'get',{page_size:3},(res)=>{
- if(res && res.errno == 0){
- this.sellTopBrandList = res.rst;
- }else{
- }
- })
- },
- getGoodsSalesList(){//商品销售榜
- this.$req(this.$api.home_goodsSalesList,'get',{page_size:3},(res)=>{
- if(res && res.errno == 0){
- this.goodsSalesList = res.rst;
- }else{
- }
- })
- },
- getGoodsHotList(){//商品热推榜
- this.$req(this.$api.home_goodsHotList,'get',{page_size:3},(res)=>{
- if(res && res.errno == 0){
- this.goodsHotList = res.rst;
- }else{
- }
- })
- }
- }
-
- }
- </script>
- <style lang="scss" scoped>
- .searchView,.yesterdayData,.plate{
- width: 710rpx;
- margin: auto;
- }
- .searchView{
- margin: 20rpx auto;
- height: 70rpx;
- background: #FFFFFF;
- display: flex;
- align-items: center;
- padding: 12rpx;
- border-radius: 70rpx;
- .iconfont{
- color: #444444;
- font-size: 30rpx;
- margin: 0 14rpx;
- }
- input{
- font-size: 26rpx;
- flex: 1;
- }
- button{
- width: 104rpx;
- height: 52rpx;
- line-height: 52rpx;
- background: #FE9400;
- border-radius: 35rpx;
- color: #FFFFFF;
- padding: 0;
- font-size: 26rpx;
- }
- }
- .yesterdayData{
- height: 214rpx;
- background: linear-gradient(160deg, rgba(46, 44, 43, 0.92) 0%, #000000 100%);
- border-radius: 16rpx;
- position: relative;
- overflow: hidden;
- padding: 22rpx 24rpx;
- .bg_img{
- width: 110rpx;
- height: 108rpx;
- position: absolute;
- top: -1px;
- right: 0;
- }
- .yesterday_title{
- display: flex;
- align-items: center;
- .text{
- color: #FFFFFF;
- font-size: 30rpx;
- line-height: 42rpx;
- }
- .image{
- width: 30rpx;
- height: 30rpx;
- margin-left: 20rpx;
- }
- }
- .yesterdayInfo{
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: 20rpx;
- padding: 0 20rpx;
- .info{
- text-align: center;
- .text{
- color: #FFFFFF;
- font-size: 40rpx;
- line-height: 56rpx;
- font-weight: bold;
- }
- .view{
- color: #F1CBB4;
- font-size: 26rpx;
- line-height: 36rpx;
- margin-top: 8rpx;
- }
- }
- }
- }
- .entrance{
- display: flex;
- flex-wrap: wrap;
- margin-bottom: 36rpx;
- .entranceInfo{
- width: 25%;
- text-align: center;
- margin-top: 36rpx;
- .image{
- width: 72rpx;
- height: 72rpx;
- display: block;
- margin: auto;
- }
- .text{
- color: #000000;
- font-size: 24rpx;
- line-height: 34rpx;
- }
- }
- }
- .plate{
- background: #FFFFFF;
- border-radius: 16rpx;
- height: 492rpx;
- margin-bottom: 22rpx;
- .titleView{
- padding: 30rpx 26rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .title{
- display: flex;
- align-items: center;
- .text{
- color: #353C46;
- font-size: 38rpx;
- line-height: 52rpx;
- font-weight: bold;
- position: relative;
- }
- .image{
- width: 50rpx;
- height: 50rpx;
- margin-left: 10rpx;
- }
- .time{
- color: #A3A3A3;
- font-size: 26rpx;
- line-height: 36rpx;
- margin-left: 16rpx;
- }
- }
- .title2{
- position: relative;
- .title_bg{
- width: 70rpx;
- position: absolute;
- left: -10rpx;
- top: -20rpx;
- }
- }
- .more{
- width: 119rpx;
- height: 50rpx;
- line-height: 50rpx;
- text-align: center;
- background: #F6F6F6;
- border-radius: 30rpx;
- color: #FF6D28;
- font-size: 26rpx;
- }
- }
- }
- .liveView{
- width: calc(100% - 28rpx);
- white-space: nowrap;
- margin-left: 28rpx;
- .liveInfo{
- width: 236rpx;
- height: 344rpx;
- background: #F1F1F1;
- border-radius: 16rpx;
- overflow: hidden;
- display: inline-block;
- margin-right: 20rpx;
- .info{
- width: 100%;
- height: 298rpx;
- background: url(https://kx-bigdata.oss-cn-beijing.aliyuncs.com/blur_bg.png) no-repeat;
- background-size: 100% 100%;
- position: relative;
- .cover{
- width: 100%;
- height: 100%;
- }
- .infoMask{
- position: absolute;
- top: 0;
- left: 0;
- background: rgba(0,0,0,0.2);
- width: 100%;
- height: 100%;
- .liveing{
- width: 56rpx;
- height: 97rpx;
- background: #FF7217;
- border-radius: 0px 0px 200rpx 200rpx;
- color: #FFFFFF;
- font-size: 24rpx;
- font-weight: bold;
- text-align: center;
- line-height: 30rpx;
- position: absolute;
- top: 0;
- right: 20rpx;
- text-align: center;
- }
- .shopView{
- width: 100%;
- display: flex;
- align-items: center;
- position: absolute;
- bottom: 12rpx;
- left: 8rpx;
- .shopImage{
- width: 48rpx;
- height: 48rpx;
- border-radius: 50%;
- border: 2rpx solid #FFFFFF;
- margin-right: 16rpx;
- }
- .shopName{
- width: 144rpx;
- height: 34rpx;
- font-size: 24rpx;
- color: #FFFFFF;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- word-break: break-all;
- }
- }
- }
- }
- .liveData{
- display: flex;
- line-height: 46rpx;
- justify-content: space-between;
- padding: 0 12rpx;
- .text1{
- color: #989898;
- font-size: 18rpx;
- }
- .text2{
- color: #000000;
- font-size: 24rpx;
- font-weight: blue($color: #000000);
- }
- }
- }
- }
- .rankBox{
- .rankItem{
- display: flex;
- align-items: center;
- padding: 30rpx 0;
- border-bottom: 1rpx solid #ECECEC;
- &:last-of-type{
- border-bottom: none;
- }
- .rankInfo{
- flex: 1;
- display: flex;
- align-items: center;
- margin-left: 30rpx;
- .imageBox{
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- position: relative;
- background: #f2f2f2;
- .userImg{
- width: 100%;
- height: 100%;
- border-radius: 50%;
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- margin: auto;
- }
- .topImg{
- width: 36rpx;
- height: 30rpx;
- position: absolute;
- top: -16rpx;
- right: 2rpx;
- }
- }
- .info{
- flex: 1;
- margin-left: 16rpx;
- .name{
- color: #353C46;
- font-size: 28rpx;
- line-height: 40rpx;
- width: 338rpx;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- word-break: break-all;
- }
- .price{
- color: #A3A3A3;
- font-size: 24rpx;
- line-height: 34rpx;
- margin-top: 6rpx;
- text{
- color: #000000;
- margin-left: 10rpx;
- }
- }
- }
- }
- .rankData{
- margin-right: 30rpx;
- text-align: right;
- text{
- color: #353C46;
- font-size: 38rpx;
- line-height: 52rpx;
- font-weight: bold;
- }
- view{
- color: #A3A3A3;
- font-size: 24rpx;
- line-height: 34rpx;
- }
- }
- }
- }
- .plateRank{
- height: 602rpx;
- }
- </style>
|