Commit 98e6190c authored by jason233's avatar jason233 Committed by linlinjava
Browse files

小程序首页增加搜索 (#135)

* 小程序首页增加搜索
parent 26118544
...@@ -15,7 +15,8 @@ Page({ ...@@ -15,7 +15,8 @@ Page({
floorGoods: [], floorGoods: [],
banner: [], banner: [],
channel: [], channel: [],
coupon: [] coupon: [],
goodsCount: 0
}, },
onShareAppMessage: function() { onShareAppMessage: function() {
...@@ -50,6 +51,11 @@ Page({ ...@@ -50,6 +51,11 @@ Page({
}); });
} }
}); });
util.request(api.GoodsCount).then(function (res) {
that.setData({
goodsCount: res.data.goodsCount
});
});
}, },
onLoad: function(options) { onLoad: function(options) {
......
<!--index.wxml--> <!--index.wxml-->
<view class="container"> <view class="container">
<view class="search">
<navigator url="/pages/search/search" class="input">
<image class="icon"></image>
<text class="txt">商品搜索, 共{{goodsCount}}款好物</text>
</navigator>
</view>
<swiper class="banner" indicator-dots="true" autoplay="true" interval="3000" duration="1000"> <swiper class="banner" indicator-dots="true" autoplay="true" interval="3000" duration="1000">
<swiper-item wx:for="{{banner}}" wx:key="id"> <swiper-item wx:for="{{banner}}" wx:key="id">
<!-- <navigator url="{{item.link}}"> --> <!-- <navigator url="{{item.link}}"> -->
......
...@@ -514,3 +514,36 @@ ...@@ -514,3 +514,36 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.search {
height: 88rpx;
width: 100%;
padding: 0 30rpx;
background: #fff;
display: flex;
align-items: center;
}
.search .input {
width: 690rpx;
height: 56rpx;
background: #ededed;
border-radius: 8rpx;
display: flex;
align-items: center;
justify-content: center;
}
.search .icon {
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/search2-2fb94833aa.png) center no-repeat;
background-size: 100%;
width: 28rpx;
height: 28rpx;
}
.search .txt {
height: 42rpx;
line-height: 42rpx;
color: #666;
padding-left: 10rpx;
font-size: 30rpx;
}
\ No newline at end of file
...@@ -262,4 +262,4 @@ ...@@ -262,4 +262,4 @@
] ]
} }
} }
} }
\ No newline at end of file
Supports Markdown
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