File tree Expand file tree Collapse file tree 3 files changed +50
-4
lines changed Expand file tree Collapse file tree 3 files changed +50
-4
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const user = require('../../services/user.js');
6
6
const app = getApp ( )
7
7
Page ( {
8
8
data : {
9
+ goodsCount : 0 ,
9
10
newGoods : [ ] ,
10
11
hotGoods : [ ] ,
11
12
topics : [ ] ,
@@ -40,6 +41,11 @@ Page({
40
41
} ,
41
42
onLoad : function ( options ) {
42
43
this . getIndexData ( ) ;
44
+ util . request ( api . GoodsCount ) . then ( res => {
45
+ this . setData ( {
46
+ goodsCount : res . data . goodsCount
47
+ } ) ;
48
+ } ) ;
43
49
} ,
44
50
onReady : function ( ) {
45
51
// 页面渲染完成
Original file line number Diff line number Diff line change 1
-
2
1
<!--index.wxml-->
3
2
<view class="container">
3
+ <view class="search">
4
+ <navigator url="/pages/search/search" class="input">
5
+ <image class="icon"></image>
6
+ <text class="txt">商品搜索, 共{{goodsCount}}款好物</text>
7
+ </navigator>
8
+ </view>
4
9
<swiper class="banner" indicator-dots="true" autoplay="true" interval="3000" duration="1000">
5
10
<swiper-item wx:for="{{banner}}" wx:key="{{item.id}}">
6
11
<navigator url="{{item.link}}">
9
14
</swiper-item>
10
15
</swiper>
11
16
<view class="m-menu">
12
- <navigator class="item" url="{{item.url}}" wx:for="{{channel}}" wx:key="{{item.id}}">
17
+ <navigator class="item" url="{{item.url}}" wx:for="{{channel}}" wx:key="{{item.id}}">
13
18
<image src="{{item.icon_url}}" background-size="cover"></image>
14
19
<text>{{item.name}}</text>
15
20
</navigator>
79
84
<view class="a-section a-topic" wx:if="topics.length > 0">
80
85
<view class="h">
81
86
<view>
82
- <navigator url="../topic/topic" open-type="switchTab">
83
- <text class="txt">专题精选</text>
87
+ <navigator url="../topic/topic" open-type="switchTab">
88
+ <text class="txt">专题精选</text>
84
89
</navigator>
85
90
</view>
86
91
</view>
Original file line number Diff line number Diff line change
1
+
2
+ .search {
3
+ height: 88rpx;
4
+ width: 100%;
5
+ padding: 0 30rpx;
6
+ background: #fff;
7
+ display: flex;
8
+ align-items: center;
9
+ }
10
+
11
+ .search .input {
12
+ width: 690rpx;
13
+ height: 56rpx;
14
+ background: #ededed;
15
+ border-radius: 8rpx;
16
+ display: flex;
17
+ align-items: center;
18
+ justify-content: center;
19
+ }
20
+
21
+ .search .icon {
22
+ background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/search2-2fb94833aa.png) center no-repeat;
23
+ background-size: 100%;
24
+ width: 28rpx;
25
+ height: 28rpx;
26
+ }
27
+
28
+ .search .txt {
29
+ height: 42rpx;
30
+ line-height: 42rpx;
31
+ color: #666;
32
+ padding-left: 10rpx;
33
+ font-size: 30rpx;
34
+ }
35
+
1
36
.banner {
2
37
width: 750rpx;
3
38
height: 417rpx;
You can’t perform that action at this time.
0 commit comments