Skip to content

Commit 22d6818

Browse files
committed
首页部分完成
1 parent 51f8b15 commit 22d6818

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+477
-74
lines changed

app.json

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,42 @@
11
{
22
"pages": [
33
"pages/home/home",
4-
"pages/about/about"
5-
]
4+
"pages/category/category",
5+
"pages/cart/cart",
6+
"pages/profile/profile"
7+
],
8+
"window": {
9+
"navigationBarBackgroundColor": "#ff5777",
10+
"navigationBarTextStyle": "white"
11+
},
12+
"tabBar": {
13+
"selectedColor": "#ff5777",
14+
"list": [
15+
{
16+
"pagePath": "pages/home/home",
17+
"text": "首页",
18+
"iconPath": "/assets/tabbar/home.png",
19+
"selectedIconPath": "/assets/tabbar/home_active.png"
20+
},
21+
{
22+
"pagePath": "pages/category/category",
23+
"text": "分类",
24+
"iconPath": "/assets/tabbar/category.png",
25+
"selectedIconPath": "/assets/tabbar/category_active.png"
26+
},
27+
{
28+
"pagePath": "pages/cart/cart",
29+
"text": "购物车",
30+
"iconPath": "/assets/tabbar/cart.png",
31+
"selectedIconPath": "/assets/tabbar/cart_active.png"
32+
},
33+
{
34+
"pagePath": "pages/profile/profile",
35+
"text": "我的",
36+
"iconPath": "/assets/tabbar/profile.png",
37+
"selectedIconPath": "/assets/tabbar/profile_active.png"
38+
}
39+
]
40+
},
41+
"sitemapLocation": "sitemap.json"
642
}

assets/detail/collect.png

7.78 KB
Loading

assets/detail/service.png

9.21 KB
Loading

assets/detail/shop.png

7.5 KB
Loading

assets/home/popular_bg.jpg

56.6 KB
Loading

assets/tabbar/cart.png

11.9 KB
Loading

assets/tabbar/cart_active.png

10.9 KB
Loading

assets/tabbar/category.png

14 KB
Loading

assets/tabbar/category_active.png

12.7 KB
Loading

assets/tabbar/home.png

11.1 KB
Loading

assets/tabbar/home_active.png

10.1 KB
Loading

assets/tabbar/profile.png

12.2 KB
Loading

assets/tabbar/profile_active.png

11 KB
Loading

components/w-swiper/w-swiper.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// components/w-swiper/w-swiper.js
2+
Component({
3+
/**
4+
* 组件的属性列表
5+
*/
6+
properties: {
7+
list: {
8+
type: Array,
9+
value: []
10+
}
11+
},
12+
13+
/**
14+
* 组件的初始数据
15+
*/
16+
data: {
17+
18+
},
19+
20+
/**
21+
* 组件的方法列表
22+
*/
23+
methods: {
24+
25+
}
26+
})

components/w-swiper/w-swiper.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"component": true,
3+
"usingComponents": {}
4+
}

components/w-swiper/w-swiper.wxml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!--components/w-swiper/w-swiper.wxml-->
2+
<swiper class='swiper'
3+
circular
4+
autoplay
5+
interval='3000'
6+
duration='300'
7+
indicator-dots
8+
indicator-active-color='#ff5777'>
9+
<block wx:for="{{list}}" wx:key="{{index}}">
10+
<swiper-item class="swiper-item">
11+
<image src="{{item.image}}" mode="widthFix"/>
12+
</swiper-item>
13+
</block>
14+
</swiper>

components/w-swiper/w-swiper.wxss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* components/w-swiper/w-swiper.wxss */
2+
.swiper-item image {
3+
width: 100%;
4+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// components/w-tab-control/w-tab-control.js
2+
Component({
3+
/**
4+
* 组件的属性列表
5+
*/
6+
properties: {
7+
titles: {
8+
type: Array,
9+
value: []
10+
}
11+
},
12+
13+
/**
14+
* 组件的初始数据
15+
*/
16+
data: {
17+
currentIndex: 0
18+
},
19+
20+
/**
21+
* 组件的方法列表
22+
*/
23+
methods: {
24+
itemClick(e) {
25+
// 1.设置最新的index
26+
this.setData({
27+
currentIndex: e.currentTarget.dataset.index
28+
})
29+
30+
// 2.发出时间
31+
const data = {index: this.data.currentIndex}
32+
this.triggerEvent("tabclick", data, {})
33+
}
34+
}
35+
})
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"component": true,
3+
"usingComponents": {}
4+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!--components/w-tab-control/w-tab-control.wxml-->
2+
<view class='tab-control'>
3+
<block wx:for="{{titles}}" wx:key="index">
4+
<view class='tab-item {{index == currentIndex?"active": ""}}'
5+
bind:tap="itemClick"
6+
data-index="{{index}}">
7+
<text>{{item}}</text>
8+
</view>
9+
</block>
10+
</view>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* components/w-tab-control/w-tab-control.wxss */
2+
.tab-control {
3+
display: flex;
4+
margin-bottom: 16rpx;
5+
}
6+
7+
.tab-item {
8+
flex: 1;
9+
text-align: center;
10+
height: 80rpx;
11+
line-height: 80rpx;
12+
font-size: 32rpx;
13+
}
14+
15+
.active {
16+
color: #ff5777;
17+
}
18+
19+
.tab-item.active text {
20+
padding: 16rpx 10rpx;
21+
border-bottom: 6rpx solid #ff5777;
22+
}

pages/about/about.wxml

Lines changed: 0 additions & 2 deletions
This file was deleted.

pages/about/about.wxss

Lines changed: 0 additions & 1 deletion
This file was deleted.

pages/about/about.js renamed to pages/cart/cart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// pages/about/about.js
1+
// pages/cart/cart.js
22
Page({
33

44
/**
File renamed without changes.

pages/cart/cart.wxml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!--pages/cart/cart.wxml-->
2+
<text>pages/cart/cart.wxml</text>

pages/cart/cart.wxss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* pages/cart/cart.wxss */

pages/category/category.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// pages/category/category.js
2+
Page({
3+
4+
/**
5+
* 页面的初始数据
6+
*/
7+
data: {
8+
9+
},
10+
11+
/**
12+
* 生命周期函数--监听页面加载
13+
*/
14+
onLoad: function (options) {
15+
16+
},
17+
18+
/**
19+
* 生命周期函数--监听页面初次渲染完成
20+
*/
21+
onReady: function () {
22+
23+
},
24+
25+
/**
26+
* 生命周期函数--监听页面显示
27+
*/
28+
onShow: function () {
29+
30+
},
31+
32+
/**
33+
* 生命周期函数--监听页面隐藏
34+
*/
35+
onHide: function () {
36+
37+
},
38+
39+
/**
40+
* 生命周期函数--监听页面卸载
41+
*/
42+
onUnload: function () {
43+
44+
},
45+
46+
/**
47+
* 页面相关事件处理函数--监听用户下拉动作
48+
*/
49+
onPullDownRefresh: function () {
50+
51+
},
52+
53+
/**
54+
* 页面上拉触底事件的处理函数
55+
*/
56+
onReachBottom: function () {
57+
58+
},
59+
60+
/**
61+
* 用户点击右上角分享
62+
*/
63+
onShareAppMessage: function () {
64+
65+
}
66+
})

pages/category/category.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"usingComponents": {}
3+
}

pages/category/category.wxml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!--pages/category/category.wxml-->
2+
<text>pages/category/category.wxml</text>

pages/category/category.wxss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* pages/category/category.wxss */
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// pages/home/childCpns/w-popular/w-polular.js
2+
Component({
3+
/**
4+
* 组件的属性列表
5+
*/
6+
properties: {
7+
8+
},
9+
10+
/**
11+
* 组件的初始数据
12+
*/
13+
data: {
14+
15+
},
16+
17+
/**
18+
* 组件的方法列表
19+
*/
20+
methods: {
21+
22+
}
23+
})
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"component": true,
3+
"usingComponents": {}
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!--pages/home/childCpns/w-popular/w-polular.wxml-->
2+
<view class='popular'>
3+
<image src="/assets/home/popular_bg.jpg" mode='widthFix'/>
4+
</view>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* pages/home/childCpns/w-popular/w-polular.wxss */
2+
.popular image {
3+
width: 100%;
4+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// pages/home/childCpns/w-recommend/w-recommend.js
2+
Component({
3+
/**
4+
* 组件的属性列表
5+
*/
6+
properties: {
7+
recommends: {
8+
type: Array,
9+
value: []
10+
}
11+
},
12+
13+
/**
14+
* 组件的初始数据
15+
*/
16+
data: {
17+
18+
},
19+
20+
/**
21+
* 组件的方法列表
22+
*/
23+
methods: {
24+
25+
}
26+
})
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"component": true,
3+
"usingComponents": {}
4+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!--pages/home/childCpns/w-recommend/w-recommend.wxml-->
2+
<view class='recommend'>
3+
<block wx:for="{{recommends}}" wx:key="{{index}}">
4+
<view class='recommend-item'>
5+
<image src="{{item.image}}"/>
6+
<view>{{item.title}}</view>
7+
</view>
8+
</block>
9+
</view>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* pages/home/childCpns/w-recommend/w-recommend.wxss */
2+
.recommend {
3+
display: flex;
4+
margin-top: 40rpx;
5+
padding-bottom: 40rpx;
6+
border-bottom: 16rpx solid #eee;
7+
}
8+
9+
.recommend-item {
10+
flex: 1;
11+
text-align: center;
12+
}
13+
14+
.recommend-item image {
15+
width: 160rpx;
16+
height: 160rpx;
17+
}
18+
19+
.recommend-item view {
20+
font-size: 30rpx;
21+
color: #555;
22+
margin-top: 10rpx;
23+
}
24+

0 commit comments

Comments
 (0)