Skip to content

Commit b0f5c21

Browse files
committedJul 24, 2018
首页
1 parent 43f0f05 commit b0f5c21

File tree

7 files changed

+110
-17
lines changed

7 files changed

+110
-17
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ yarn-error.log*
1111
*.ntvs*
1212
*.njsproj
1313
*.sln
14+
package-lock.json

‎project.config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"miniprogramRoot": "./dist/",
1111
"compileType": "miniprogram",
1212
"appid": "wx601ce71bde7b9add",
13-
"projectname": "newmpvue",
13+
"projectname": "mpvue-shop",
1414
"condition": {
1515
"search": {
1616
"current": -1,

‎src/App.vue

+4
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ export default {
2121
padding: 200rpx 0;
2222
box-sizing: border-box;
2323
}
24+
page{
25+
background: #f4f4f4;
26+
}
2427
view,
2528
text {
2629
font-size: 28rpx;
30+
color: #333;
2731
}
2832
2933
/* this rule will be remove */

‎src/main.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ export default {
5555
"text": "我的"
5656
}
5757
]
58-
},
59-
// debug: true
60-
58+
}
6159
}
6260
}

‎src/main.json

+44-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,46 @@
11
{
2-
"pages": [
3-
"pages/index/main",
4-
"pages/counter/main",
5-
"pages/logs/main"
6-
],
7-
"window": {
8-
"backgroundTextStyle": "light",
9-
"navigationBarBackgroundColor": "#fff",
10-
"navigationBarTitleText": "WeChat",
11-
"navigationBarTextStyle": "black"
12-
}
2+
"pages": [ "pages/index/main","pages/logs/main"],
3+
"window": {
4+
"backgroundTextStyle": "light",
5+
"navigationBarBackgroundColor": "#fff",
6+
"navigationBarTitleText": "网易严选",
7+
"navigationBarTextStyle": "black"
8+
},
9+
"tabBar": {
10+
"backgroundColor": "#fafafa",
11+
"borderStyle": "white",
12+
"selectedColor": "#b4282d",
13+
"color": "#666",
14+
"list": [{
15+
"pagePath": "pages/index/main",
16+
"iconPath": "static/images/ic_menu_choice_nor.png",
17+
"selectedIconPath": "static/images/ic_menu_choice_pressed.png",
18+
"text": "首页"
19+
},
20+
{
21+
"pagePath": "pages/index/main",
22+
"iconPath": "static/images/ic_menu_topic_nor.png",
23+
"selectedIconPath": "static/images/ic_menu_topic_pressed.png",
24+
"text": "专题"
25+
},
26+
{
27+
"pagePath": "pages/index/main",
28+
"iconPath": "static/images/ic_menu_sort_nor.png",
29+
"selectedIconPath": "static/images/ic_menu_sort_pressed.png",
30+
"text": "分类"
31+
},
32+
{
33+
"pagePath": "pages/index/main",
34+
"iconPath": "static/images/ic_menu_shoping_nor.png",
35+
"selectedIconPath": "static/images/ic_menu_shoping_pressed.png",
36+
"text": "购物车"
37+
},
38+
{
39+
"pagePath": "pages/index/main",
40+
"iconPath": "static/images/ic_menu_me_nor.png",
41+
"selectedIconPath": "static/images/ic_menu_me_pressed.png",
42+
"text": "我的"
43+
}
44+
]
45+
}
1346
}

‎src/pages/index/index.vue

+21-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@
1515
<p>{{item.name}}</p>
1616
</div>
1717
</div>
18+
<div class="brand">
19+
<div class="head">
20+
品牌制造商直供
21+
</div>
22+
<div class="content">
23+
<div v-for="(item, index) in brandList" :key="index">
24+
<div>
25+
<p>{{item.name}}</p>
26+
<p>{{item.floor_price}}元起</p>
27+
</div>
28+
<img :src="item.new_pic_url" alt="">
29+
</div>
30+
</div>
31+
</div>
32+
<div class="newgoods">
33+
34+
</div>
1835
</div>
1936
</template>
2037

@@ -24,7 +41,8 @@ export default {
2441
data() {
2542
return {
2643
banner: [],
27-
channel: []
44+
channel: [],
45+
brandList: []
2846
};
2947
},
3048
components: {},
@@ -33,6 +51,7 @@ export default {
3351
var data = await get("/index/index");
3452
this.banner = data.banner;
3553
this.channel = data.channel;
54+
this.brandList = data.brandList;
3655
}
3756
},
3857
created() {
@@ -44,4 +63,4 @@ export default {
4463

4564
<style lang='scss' scoped>
4665
@import "./style.scss";
47-
</style>
66+
</style>

‎src/pages/index/style.scss

+38
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
}
1919
.channel {
2020
display: flex;
21+
padding: 20rpx 0;
22+
background: #ffffff;
2123
div {
2224
width: 25%;
2325
text-align: center;
@@ -28,4 +30,40 @@
2830
}
2931
}
3032
}
33+
.brand {
34+
width: 100%;
35+
margin-top: 20rpx;
36+
background: #ffffff;
37+
.head{
38+
text-align: center;
39+
padding: 40rpx 0;
40+
41+
}
42+
.content {
43+
width: 97%;
44+
margin: 0 auto;
45+
// margin: 10rpx;
46+
display: flex;
47+
justify-content: space-between;
48+
flex-wrap: wrap;
49+
div {
50+
width: 49%;
51+
height: 235rpx;
52+
position: relative;
53+
div {
54+
position: absolute;
55+
top: 0;
56+
left: 0;
57+
padding: 10rpx;
58+
p:nth-child(2) {
59+
font-size: 24rpx;
60+
}
61+
}
62+
img {
63+
width: 100%;
64+
height: 100%;
65+
}
66+
}
67+
}
68+
}
3169
}

0 commit comments

Comments
 (0)
Please sign in to comment.