|
|
@ -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-04-09 14:46:42
|
|
|
|
* @LastEditTime: 2022-04-09 17:02:23
|
|
|
|
* @Description: file content
|
|
|
|
* @Description: file content
|
|
|
|
-->
|
|
|
|
-->
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
@ -19,7 +19,7 @@
|
|
|
|
<view class="search" @click="$Router.push('/search')">
|
|
|
|
<view class="search" @click="$Router.push('/search')">
|
|
|
|
<text class="search--input">请输入您想搜索的商品名称</text>
|
|
|
|
<text class="search--input">请输入您想搜索的商品名称</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<Banner :bannerList="bannerList"></Banner>
|
|
|
|
<Banner :data="bannerList"></Banner>
|
|
|
|
|
|
|
|
|
|
|
|
<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"
|
|
|
@ -33,7 +33,7 @@
|
|
|
|
<Sekill></Sekill>
|
|
|
|
<Sekill></Sekill>
|
|
|
|
|
|
|
|
|
|
|
|
<view class="title">甄选推荐</view>
|
|
|
|
<view class="title">甄选推荐</view>
|
|
|
|
<Pick></Pick>
|
|
|
|
<Pick :data="recommendedGoodsList"></Pick>
|
|
|
|
|
|
|
|
|
|
|
|
<view class="title">为您推荐</view>
|
|
|
|
<view class="title">为您推荐</view>
|
|
|
|
<BsChoiceGoods ref="goodsGroup" ></BsChoiceGoods>
|
|
|
|
<BsChoiceGoods ref="goodsGroup" ></BsChoiceGoods>
|
|
|
@ -45,7 +45,7 @@ import Sekill from './components/Sekill';
|
|
|
|
import Pick from './components/Pick';
|
|
|
|
import Pick from './components/Pick';
|
|
|
|
import Banner from './components/Banner';
|
|
|
|
import Banner from './components/Banner';
|
|
|
|
import {ApiGetBannerData} from '@/common/api/index.js';
|
|
|
|
import {ApiGetBannerData} from '@/common/api/index.js';
|
|
|
|
import {ApiGetCategoryNav} from '@/common/api/goods.js';
|
|
|
|
import {ApiGetCategoryNav, ApiGetRecommendedGoodsList} from '@/common/api/goods.js';
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
components : {BsChoiceGoods, Pick, Banner, Sekill},
|
|
|
|
components : {BsChoiceGoods, Pick, Banner, Sekill},
|
|
|
|
data(){
|
|
|
|
data(){
|
|
|
@ -64,11 +64,13 @@ export default {
|
|
|
|
{ url : 'bz5.png', title : '数码周边'},
|
|
|
|
{ url : 'bz5.png', title : '数码周边'},
|
|
|
|
{ url : 'bz6.png', title : '数码周边'},
|
|
|
|
{ url : 'bz6.png', title : '数码周边'},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
goodsData:[]
|
|
|
|
recommendedGoodsList : []
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onLoad(){
|
|
|
|
onLoad(){
|
|
|
|
this.getCategoryList();
|
|
|
|
this.getCategoryList();
|
|
|
|
|
|
|
|
this.getRecommendedGoodsList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onReachBottom(){
|
|
|
|
onReachBottom(){
|
|
|
|
this.$refs.goodsGroup.next()
|
|
|
|
this.$refs.goodsGroup.next()
|
|
|
@ -90,8 +92,22 @@ export default {
|
|
|
|
methods : {
|
|
|
|
methods : {
|
|
|
|
async getCategoryList(){
|
|
|
|
async getCategoryList(){
|
|
|
|
const {error, result} = await ApiGetCategoryNav();
|
|
|
|
const {error, result} = await ApiGetCategoryNav();
|
|
|
|
|
|
|
|
if(result){
|
|
|
|
this.categoryList = result;
|
|
|
|
this.categoryList = result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
async getRecommendedGoodsList(){
|
|
|
|
|
|
|
|
console.log('-right');
|
|
|
|
|
|
|
|
const {error, result} = await ApiGetRecommendedGoodsList({
|
|
|
|
|
|
|
|
pageIndex : 1,
|
|
|
|
|
|
|
|
length : 3
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
if(result){
|
|
|
|
|
|
|
|
this.recommendedGoodsList = result.records
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|