api
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
<image src="/static/image/shop/2.png"></image>
|
||||
</view>
|
||||
<u-search placeholder="日照香炉生紫烟" v-model="keyword" :show-action="false" bg-color="#fff" border-color="#999999"></u-search>
|
||||
<image src="/static/image/shop/3.png" class="mnue"></image>
|
||||
<image src="/static/image/shop/3.png" class="mnue" @click="toClassifyPage"></image>
|
||||
</view>
|
||||
<u-swiper :list="list"></u-swiper>
|
||||
<u-swiper :list="list" mode="dot" @click="clickImage"></u-swiper>
|
||||
<view class="chengnuo">
|
||||
<view>
|
||||
<image src="/static/image/shop/4.png"></image>
|
||||
@@ -28,11 +28,11 @@
|
||||
<text>上门取件</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fenlei">
|
||||
<!-- <view class="fenlei">
|
||||
<shopitem v-for="item in 5" class="item"></shopitem>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="fenlei">
|
||||
<shopitem v-for="item in 5" class="item"></shopitem>
|
||||
<shopitem v-for="item in goodsClassify" :key="item.gc_id" :info="item" class="item"></shopitem>
|
||||
</view>
|
||||
<view class="hr" style="margin-top:80rpx"></view>
|
||||
<recommend></recommend>
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
area: "北京市",
|
||||
area: "请选择",
|
||||
chooseArea: false,
|
||||
areaParams: {
|
||||
province: true,
|
||||
@@ -80,34 +80,33 @@ export default {
|
||||
area: false
|
||||
},
|
||||
keyword:"",
|
||||
list:[{
|
||||
image: '/static/uView/swiper/swiper1.jpg',
|
||||
title: '蒹葭苍苍,白露为霜。所谓伊人,在水一方'
|
||||
},
|
||||
{
|
||||
image: '/static/uView/swiper/swiper2.jpg',
|
||||
title: '溯洄从之,道阻且长。溯游从之,宛在水中央'
|
||||
},
|
||||
{
|
||||
image: '/static/uView/swiper/swiper3.jpg',
|
||||
title: '蒹葭萋萋,白露未晞。所谓伊人,在水之湄'
|
||||
}
|
||||
],
|
||||
list:[],
|
||||
goodsClassify: [], // 商品分类
|
||||
classifyList: [],
|
||||
goodsList: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// this.getShopTopList();
|
||||
this.getShopTopList();
|
||||
this.getGoodsRecommend();
|
||||
},
|
||||
methods: {
|
||||
// getShopTopList() {
|
||||
// this.$u.api.getShopTopList().then((res)=>{
|
||||
// if (res.errCode == 0) {
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
getShopTopList() {
|
||||
this.$u.api.getShopTopList().then((res)=>{
|
||||
if (res.errCode == 0) {
|
||||
let temp = [];
|
||||
res.data.banner.forEach(item => {
|
||||
temp.push({
|
||||
image: item.adv_code,
|
||||
adv_link: item.adv_link,
|
||||
adv_id: item.adv_id,
|
||||
})
|
||||
})
|
||||
this.list = temp;
|
||||
this.goodsClassify = res.data.goodsclass;
|
||||
}
|
||||
})
|
||||
},
|
||||
getGoodsRecommend() {
|
||||
this.$u.api.getGoodsRecommend({
|
||||
page: 1,
|
||||
@@ -120,6 +119,11 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
clickImage(index) {
|
||||
console.log(index);
|
||||
console.log(this.list[index]);
|
||||
|
||||
},
|
||||
setArea(e) {
|
||||
// console.log(e);
|
||||
this.area = e.city.label;
|
||||
@@ -128,7 +132,12 @@ export default {
|
||||
uni.navigateTo({
|
||||
url: '/pageC/cart/index'
|
||||
});
|
||||
}
|
||||
},
|
||||
toClassifyPage() {
|
||||
uni.navigateTo({
|
||||
url: '/pageC/classify/index'
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -189,8 +198,15 @@ export default {
|
||||
}
|
||||
.fenlei{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// justify-content: space-between;
|
||||
margin-top: 30rpx;
|
||||
flex-wrap: wrap;
|
||||
> view {
|
||||
margin-bottom: 30rpx;
|
||||
&:not(:nth-child(5n)) {
|
||||
margin-right: 70rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.hr{
|
||||
width: 750rpx;
|
||||
|
||||
Reference in New Issue
Block a user