|
|
@ -2,7 +2,7 @@
|
|
|
|
* @Author: ch
|
|
|
|
* @Author: ch
|
|
|
|
* @Date: 2019-08-22 19:41:20
|
|
|
|
* @Date: 2019-08-22 19:41:20
|
|
|
|
* @LastEditors: ch
|
|
|
|
* @LastEditors: ch
|
|
|
|
* @LastEditTime: 2022-05-21 16:30:22
|
|
|
|
* @LastEditTime: 2022-05-31 14:56:04
|
|
|
|
* @Description: file content
|
|
|
|
* @Description: file content
|
|
|
|
-->
|
|
|
|
-->
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
@ -24,9 +24,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
<view class="category">
|
|
|
|
<view class="category">
|
|
|
|
<view class="category--item" v-for="item in categoryList" :key="item.id"
|
|
|
|
<view class="category--item" v-for="item in categoryList" :key="item.id"
|
|
|
|
@click="$Router.push(`/goodsList?categoryId=${item.id}`)">
|
|
|
|
@click="handleCategory(item)">
|
|
|
|
<view class="category--image-box">
|
|
|
|
<view class="category--image-box">
|
|
|
|
<image class="category--image" :src="item.picture"></image>
|
|
|
|
<image class="category--image" :src="item.pictureUrl"></image>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<text class="category--title">{{item.name}}</text>
|
|
|
|
<text class="category--title">{{item.name}}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
@ -50,31 +50,15 @@ import Banner from './modules/Banner';
|
|
|
|
import {ApiGetBannerData} from '@/common/api/index.js';
|
|
|
|
import {ApiGetBannerData} from '@/common/api/index.js';
|
|
|
|
import {ApiGetHomeSeckill} from '@/common/api/seckill.js';
|
|
|
|
import {ApiGetHomeSeckill} from '@/common/api/seckill.js';
|
|
|
|
import {ApiGetCategoryNav, ApiGetRecommendedGoodsList} from '@/common/api/goods.js';
|
|
|
|
import {ApiGetCategoryNav, ApiGetRecommendedGoodsList} from '@/common/api/goods.js';
|
|
|
|
|
|
|
|
import {ApiGetAdList} from '@/common/api/ad.js';
|
|
|
|
|
|
|
|
import {AD_LOCATION} from '@/common/dicts/ad.js';
|
|
|
|
|
|
|
|
import {AdJump} from '@/common/utils';
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
components : {BsChoiceGoods, Pick, Banner, Seckill},
|
|
|
|
components : {BsChoiceGoods, Pick, Banner, Seckill},
|
|
|
|
data(){
|
|
|
|
data(){
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
scrollTop : 0,
|
|
|
|
scrollTop : 0,
|
|
|
|
bannerList: [
|
|
|
|
bannerList: [],
|
|
|
|
{ url : 'https://msb-edu-prod.oss-cn-beijing.aliyuncs.com/uc/account-avatar/banner6.jpg',
|
|
|
|
|
|
|
|
link : 'https://m.mashibing.com/live/1530'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{ url : 'https://msb-edu-prod.oss-cn-beijing.aliyuncs.com/uc/account-avatar/banner5.jpg',
|
|
|
|
|
|
|
|
link : 'https://m.mashibing.com/course/1373/1/'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{ url : 'https://msb-edu-dev.oss-cn-beijing.aliyuncs.com/uc/account-avatar/banner4.jpg',
|
|
|
|
|
|
|
|
id : 13
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{ url : 'https://msb-edu-dev.oss-cn-beijing.aliyuncs.com/uc/account-avatar/1.png',
|
|
|
|
|
|
|
|
id : 30
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{ url : 'https://msb-edu-dev.oss-cn-beijing.aliyuncs.com/uc/account-avatar/2banner.png',
|
|
|
|
|
|
|
|
id : 15
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{ url : 'https://msb-edu-dev.oss-cn-beijing.aliyuncs.com/uc/account-avatar/3banner.png',
|
|
|
|
|
|
|
|
id : 40
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
categoryList : [
|
|
|
|
categoryList : [
|
|
|
|
],
|
|
|
|
],
|
|
|
|
recommendedGoodsList : [],
|
|
|
|
recommendedGoodsList : [],
|
|
|
@ -86,6 +70,7 @@ export default {
|
|
|
|
this.getCategoryList();
|
|
|
|
this.getCategoryList();
|
|
|
|
this.getRecommendedGoodsList();
|
|
|
|
this.getRecommendedGoodsList();
|
|
|
|
this.getSeckillList();
|
|
|
|
this.getSeckillList();
|
|
|
|
|
|
|
|
this.getBannerData();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onReachBottom(){
|
|
|
|
onReachBottom(){
|
|
|
|
this.$refs.goodsGroup.next();
|
|
|
|
this.$refs.goodsGroup.next();
|
|
|
@ -106,10 +91,11 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods : {
|
|
|
|
methods : {
|
|
|
|
async getCategoryList(){
|
|
|
|
async getCategoryList(){
|
|
|
|
const {error, result} = await ApiGetCategoryNav();
|
|
|
|
|
|
|
|
if(result){
|
|
|
|
const {error, result} = await ApiGetAdList({
|
|
|
|
|
|
|
|
location : AD_LOCATION.HOME_HARDCOVER
|
|
|
|
|
|
|
|
});
|
|
|
|
this.categoryList = result;
|
|
|
|
this.categoryList = result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async getRecommendedGoodsList(){
|
|
|
|
async getRecommendedGoodsList(){
|
|
|
@ -119,11 +105,22 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
async getBannerData(){
|
|
|
|
|
|
|
|
const {error, result} = await ApiGetAdList({
|
|
|
|
|
|
|
|
location : AD_LOCATION.HOME_BANNER
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.bannerList = result;
|
|
|
|
|
|
|
|
},
|
|
|
|
async getSeckillList(){
|
|
|
|
async getSeckillList(){
|
|
|
|
const {error, result} = await ApiGetHomeSeckill();
|
|
|
|
const {error, result} = await ApiGetHomeSeckill();
|
|
|
|
if(result){
|
|
|
|
if(result){
|
|
|
|
this.seckillData = result
|
|
|
|
this.seckillData = result
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handleCategory(item){
|
|
|
|
|
|
|
|
if(item.jumpUrl){
|
|
|
|
|
|
|
|
AdJump(item.jumpUrl);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|