修改中

This commit is contained in:
mactj 2021-01-15 16:04:26 +08:00
parent 5b023af01c
commit 24ba3b9b87
3 changed files with 82 additions and 23 deletions

View File

@ -114,9 +114,7 @@
</van-grid>
<div>
<van-image width="100%" height="60px" :src="navDefine.HOME_BANNER.image" style="margin-top: 15px;" />
</div>
<van-image width="100%" height="60px" :src="navDefine.HOME_BANNER.image" style="margin-top: 15px;" />
<span v-if="columnRecord.length > 0" style="margin:15px 0;font-weight: bold;">热门专题</span>

View File

@ -1,29 +1,55 @@
<template>
<view style="padding: 0 10px;background: #fafafa;">
<van-nav-bar
title="福利购"
/>
<view style="margin: 10px;">
<view v-for="(item, index) in list" :key="index" style="margin-top: 10px;border: #fafafa 1px solid; border-radius: 10px;">
<van-card
price="2.00"
desc="描述信息"
title="商品标题"
thumb="https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=751441608,3469454349&fm=15&gp=0.jpg"
@tap="onItem(item)"
>
<view slot="num" style="float:right;">
<div>{{"已优惠¥xx元"}} </div>
</view>
</van-card>
<van-image class="banner" :src="navDefine.HOME_BANNER.image" />
</view>
<van-row gutter="20">
<van-col span="8" style="font-weight: bold;font-size: 20px;">精选推荐</van-col>
<van-col offset="10" span="6">
<div>
<van-icon name="shopping-cart-o" color="#1989fa" />
<span style="margin-left: 5px;">购物车</span>
</div>
</van-col>
</van-row>
<div style="display: flex;flex-wrap: wrap;">
<div class="filter-button" v-for="(item,index) in filterButtons">
<van-button round size="small" :color=" currentFilter === item ? '#7232dd' : '#7232dd' "
:plain="currentFilter === item ? false : true" @tap="onFilterBtn(item)">{{item}}
</van-button>
</div>
</div>
<!-- <view v-for="(item, index) in list" :key="index" style="margin-top: 10px;border: #fafafa 1px solid; border-radius: 10px;">-->
<!-- <van-card-->
<!-- price="2.00"-->
<!-- desc="描述信息"-->
<!-- title="商品标题"-->
<!-- thumb="https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=751441608,3469454349&fm=15&gp=0.jpg"-->
<!-- @tap="onItem(item)"-->
<!-- >-->
<!-- <view slot="num" style="float:right;">-->
<!-- <div>{{'已优惠¥xx元'}} </div>-->
<!-- </view>-->
<!-- </van-card>-->
<!-- </view>-->
</view>
</template>
<script>
import wepy from '@wepy/core'
import store from '@/store'
import { mapActions } from '@wepy/x'
import { mapActions, mapState } from '@wepy/x'
import appManager from '../../../appManager'
wepy.component({
@ -32,26 +58,47 @@ wepy.component({
data: {
active: 0,
list: [1, 2, 3, 4]
list: [1, 2, 3, 4],
currentFilter: '全部',
filterButtons: ['全部']
},
computed: {},
computed: {
...mapState({
'imageDefine': state => state.imageDefine,
'user': state => state.user,
'navDefine': state => state.navDefine
})
},
methods: {
onItem(item) {
console.log(item)
appManager.navigateTo(`goods-detail?id=${item}`)
},
onFilterBtn(item) {
console.log(item)
this.currentFilter = item
}
},
ready() {
let i = 0
while (true) {
this.filterButtons.push('按钮按钮' + i)
i++
if (i > 8) {
break
}
}
}
})
</script>
<config>
{
navigationBarTitleText: ''
}
</config>
<style lang="less">
@ -62,5 +109,19 @@ navigationBarTitleText: ''
z-index: -10;
}
.banner {
border: #eeeeee 1px solid;
border-radius: 25px;
margin-top: 15px;
width: 100%;
height: 80px;
}
.filter-button {
margin-top: 10px;
margin-right: 10px;
}
</style>

View File

@ -89,8 +89,8 @@ module.exports.getTime = getTime;
自定义
</van-tabbar-item>
</van-tabbar>
<mall-home v-if="pageIndex === 0" />
<mall-shopping v-else-if="pageIndex === 1" />
<mall-home v-if="pageIndex === 1" />
<mall-shopping v-else-if="pageIndex === 0" />
<mall-bbs v-else-if="pageIndex === 2" />
<mall-my v-else-if="pageIndex === 3" />
<dialog-registration />