deming/pages/shop/index.vue

226 lines
5.8 KiB
Vue
Raw Normal View History

2020-06-11 01:34:23 +00:00
<template>
<view class="shop">
<view class="top">
2020-06-18 06:57:26 +00:00
<image src="/static/image/shop/1.png" class="local"></image>
<view class="add" @click="chooseArea=true">
<text class="u-line-1">{{ area }}</text>
<image src="/static/image/shop/2.png"></image>
2020-06-11 01:34:23 +00:00
</view>
<u-search placeholder="日照香炉生紫烟" v-model="keyword" :show-action="false" bg-color="#fff" border-color="#999999"></u-search>
2020-06-18 06:57:26 +00:00
<image src="/static/image/shop/3.png" class="mnue"></image>
2020-06-11 01:34:23 +00:00
</view>
<u-swiper :list="list"></u-swiper>
<view class="chengnuo">
<view>
2020-06-18 06:57:26 +00:00
<image src="/static/image/shop/4.png"></image>
2020-06-11 01:34:23 +00:00
<text>免费洗衣</text>
</view>
<view>
2020-06-18 06:57:26 +00:00
<image src="/static/image/shop/5.png"></image>
2020-06-11 01:34:23 +00:00
<text>全国包邮</text>
</view>
<view>
2020-06-18 06:57:26 +00:00
<image src="/static/image/shop/6.png"></image>
2020-06-11 01:34:23 +00:00
<text>延误必赔</text>
</view>
<view>
2020-06-18 06:57:26 +00:00
<image src="/static/image/shop/7.png"></image>
2020-06-11 01:34:23 +00:00
<text>上门取件</text>
</view>
</view>
<view class="fenlei">
2020-06-19 10:07:11 +00:00
<shopitem v-for="item in 5" class="item"></shopitem>
2020-06-11 01:34:23 +00:00
</view>
<view class="fenlei">
<shopitem v-for="item in 5" class="item"></shopitem>
</view>
<view class="hr" style="margin-top:80rpx"></view>
<recommend></recommend>
<view class="hr" style="margin-top:40rpx"></view>
<seckill></seckill>
<view class="hr" style="margin-top:40rpx"></view>
<recommend></recommend>
<view class="hr" style="margin-top:40rpx"></view>
2020-06-11 08:12:04 +00:00
<group></group>
<image class="lingquan"></image>
<youhq></youhq>
<view class="hr" style="margin-top:40rpx"></view>
2020-06-18 06:57:26 +00:00
<list :classifyList="classifyList" :goodsList="goodsList"></list>
2020-06-29 09:24:57 +00:00
<view class="cart" @click="toCartPage">
<image src="/static/image/common/3.png"></image>
</view>
2020-06-18 06:57:26 +00:00
<u-picker mode="region" :params="areaParams" v-model="chooseArea" @confirm="setArea"></u-picker>
2020-06-11 01:34:23 +00:00
</view>
</template>
<script>
import shopitem from "@/components/shop/shop-item/index"
import recommend from "@/components/shop/recommend/index"
import seckill from "@/components/shop/seckill/index"
2020-06-11 08:12:04 +00:00
import group from "@/components/shop/group/index"
import youhq from "@/components/shop/youhq/index"
2020-06-11 08:37:52 +00:00
import list from "../../components/shop/list/index"
2020-06-11 01:34:23 +00:00
export default {
name:"shop",
components:{
shopitem,
recommend,
2020-06-11 08:12:04 +00:00
seckill,
group,
2020-06-11 08:37:52 +00:00
youhq,
list
2020-06-11 01:34:23 +00:00
},
data(){
return {
2020-06-18 06:57:26 +00:00
area: "北京市",
chooseArea: false,
areaParams: {
province: true,
city: true,
area: false
},
2020-06-11 01:34:23 +00:00
keyword:"",
list:[{
2020-06-18 06:57:26 +00:00
image: '/static/uView/swiper/swiper1.jpg',
title: '蒹葭苍苍,白露为霜。所谓伊人,在水一方'
},
{
image: '/static/uView/swiper/swiper2.jpg',
title: '溯洄从之,道阻且长。溯游从之,宛在水中央'
},
{
image: '/static/uView/swiper/swiper3.jpg',
title: '蒹葭萋萋,白露未晞。所谓伊人,在水之湄'
}
],
classifyList: [],
goodsList: []
2020-06-11 01:34:23 +00:00
}
2020-06-18 06:57:26 +00:00
},
onLoad() {
2020-06-24 08:39:31 +00:00
// this.getShopTopList();
2020-06-18 06:57:26 +00:00
this.getGoodsRecommend();
},
methods: {
2020-06-24 08:39:31 +00:00
// getShopTopList() {
// this.$u.api.getShopTopList().then((res)=>{
// if (res.errCode == 0) {
// }
// })
// },
2020-06-18 06:57:26 +00:00
getGoodsRecommend() {
this.$u.api.getGoodsRecommend({
page: 1,
}).then((res)=>{
if (res.errCode == 0) {
this.classifyList = res.data.classifyList;
this.goodsList = res.data.goodsList;
// console.log(this.classifyList);
}
})
},
setArea(e) {
// console.log(e);
this.area = e.city.label;
2020-06-29 09:24:57 +00:00
},
toCartPage() {
uni.navigateTo({
url: '/pageC/cart/index'
});
2020-06-18 06:57:26 +00:00
}
},
2020-06-11 01:34:23 +00:00
}
</script>
<style lang="scss" scoped>
.shop{
padding: 0 33rpx;
.top{
width: 100%;
height: 88rpx;
display: flex;
align-items: center;
.local{
width: 31rpx;
height: 37rpx;
}
}
.add{
width: 115rpx;
height: 25rpx;
display: flex;
font-size: 26rpx;
color: #333;
justify-content: space-between;
align-items: center;
margin-left: 14rpx;
margin-right: 37rpx;
2020-06-18 06:57:26 +00:00
> text {
width: 80rpx;
}
2020-06-11 01:34:23 +00:00
>image{
width: 24rpx;
height: 15rpx;
}
}
.mnue{
width: 35rpx;
height: 26rpx;
margin-left: 36rpx;
}
.chengnuo{
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 24rpx;
>view{
display: flex;
align-items: center;
>image{
width: 23rpx;
height: 23rpx;
}
>text{
font-size: 22rpx;
color: #999;
margin-left: 8rpx;
}
}
}
.fenlei{
display: flex;
justify-content: space-between;
margin-top: 30rpx;
}
.hr{
width: 750rpx;
margin-left: -33rpx;
height: 20rpx;
background-color: #ececec;
}
2020-06-11 08:12:04 +00:00
.lingquan{
width: 750rpx;
height: 177rpx;
margin-left: -33rpx;
margin-top: 29rpx;
background-color: #ececec;
}
2020-06-29 09:24:57 +00:00
.cart {
position: fixed;
right: 30rpx;
bottom: 300rpx;
width: 100rpx;
height: 100rpx;
background: rgba(253, 211, 96, 1);
box-shadow: 0rpx 10rpx 6rpx 0rpx rgba(253,211,96,0.34);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
> image {
width: 56rpx;
height: 54rpx;
}
}
2020-06-11 01:34:23 +00:00
}
</style>