Commit 1f55765a by shibukun

商品列表

parent a9f9a33d
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"path" : "pages/home/home", "path" : "pages/home/home",
"style" : "style" :
{ {
"navigationBarTitleText": "", "navigationBarTitleText": "懒人企业福利社",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
......
<template> <template>
<view class="layout"> <view class="layout">
<view class="title">懒人企业福利社</view>
<view class="header"> <view class="header">
<view class="header-top"> <view class="header-top">
<text v-if="isLogin" class="header-name">你好,{{ name }}</text> <text v-if="isLogin" class="header-name">你好,{{ name }}</text>
...@@ -14,10 +13,12 @@ ...@@ -14,10 +13,12 @@
</view> </view>
<view class="list"> <view class="list">
<view class="item" v-for="(item, index) in brandList" :key="index"> <view class="item" v-for="(item, index) in brandList" :key="index">
<image class="icon"></image> <view class="item-layout">
<image class="icon" mode="aspectFill" :src="item.imgPath"></image>
<view class="item-right"> <view class="item-right">
<text class="item-title">叮咚买菜</text> <text class="item-title">{{item.name}}</text>
<text class="item-desc">最高70%返现</text> <text class="item-desc">{{item.des}}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -68,10 +69,12 @@ export default { ...@@ -68,10 +69,12 @@ export default {
this.$net this.$net
.get('/goods/brand', { page: this.page, pageSize: this.pageSize }) .get('/goods/brand', { page: this.page, pageSize: this.pageSize })
.then(res => { .then(res => {
if (res.list.length > 0) {
this.brandList.concat(res.list); if (res.data.list.length > 0) {
this.brandList = this.brandList.concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list);
} }
this.loadingType = res.list.length < this.pageSize ? 'more' : 'noMore'; this.loadingType = res.data.list.length < this.pageSize ? 'noMore' : 'more';
console.log(this.loadingType)
}) })
.catch(err => { .catch(err => {
console.log(err); console.log(err);
...@@ -87,17 +90,10 @@ export default { ...@@ -87,17 +90,10 @@ export default {
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.title {
background: #ffffff;
width: 100%;
color: #333333;
text-align: center;
height: 88rpx;
line-height: 88rpx;
}
.header { .header {
height: 350rpx; height: 350rpx;
position: relative; width: 100%;
position: sticky;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background-image: url(../../static/home-header-bg.png); background-image: url(../../static/home-header-bg.png);
...@@ -125,6 +121,7 @@ export default { ...@@ -125,6 +121,7 @@ export default {
color: #ffffff; color: #ffffff;
line-height: 58rpx; line-height: 58rpx;
text-align: center; text-align: center;
background-size: 100% 100%;
} }
} }
.header-center { .header-center {
...@@ -142,34 +139,60 @@ export default { ...@@ -142,34 +139,60 @@ export default {
color: #ffffff; color: #ffffff;
} }
} }
}
.list { .list {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
background: #ffeeee; background: #ffeeee;
border-radius: 30rpx 30rpx 0rpx 0rpx; border-radius: 30rpx 30rpx 0rpx 0rpx;
padding-top: 25rpx; padding-top: 25rpx;
margin-top: -50rpx;
z-index: 99;
padding: 15rpx 15rpx;
flex-wrap: wrap;
.item { .item {
width: 50%; width: 50%;
height: 144rpx; height: 144rpx;
margin-top: 15rpx;
margin-bottom: 15rpx;
.item-layout {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 144rpx;
margin: 0 15rpx;
background: #ffffff;
border-radius: 20rpx;
padding-left: 15rpx;
padding-right: 15rpx;
overflow: hidden;
.icon { .icon {
width: 90rpx; width: 90rpx;
height: 90rpx; height: 90rpx;
border-radius: 90rpx;
} }
.item-right { .item-right {
display: flex; display: flex;
flex: 1;
flex-direction: column; flex-direction: column;
margin-left: 20rpx;
overflow: hidden;
.item-title { .item-title {
font-size: 30rpx; font-size: 30rpx;
font-weight: bolder; font-weight: bolder;
color: #333333; color: #333333;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
} }
.item-desc { .item-desc {
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
text-overflow: ellipsis;
white-space: nowrap;
margin-top: 15rpx;
overflow: hidden;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment