diff --git a/wxmp/bin/pages.js b/wxmp/bin/pages.js index a67b025..2563060 100644 --- a/wxmp/bin/pages.js +++ b/wxmp/bin/pages.js @@ -16,6 +16,17 @@ const start = () => { {root: "mods/", pages: []}, {root: "components/pages/", pages: []}, ], + tabBar: { + // position: "top", + color: "#ddd", + selectedColor: "#92ACD1", + fontSize: "12px", + list: [ + {text: "店铺", pagePath: "pages/home", iconPath: "static/tabbar/home.png", selectedIconPath: "static/tabbar/home-s.png"}, + {text: "购物车", pagePath: "pages/AppCart", iconPath: "static/tabbar/cart.png", selectedIconPath: "static/tabbar/cart-s.png"}, + {text: "我的", pagePath: "pages/AppMine", iconPath: "static/tabbar/mine.png", selectedIconPath: "static/tabbar/mine-s.png"}, + ] + }, globalStyle: { pageOrientation: "auto", navigationBarTextStyle: "white", @@ -35,6 +46,12 @@ const start = () => { return json.subPackages[0].pages.push(app) } }), + findPages('src/pages', file => { + if (/.+\\App[^\\]+\.vue/g.test(file)) { + const app = new PageBase(file.replace(/^src\\pages\\(.*).vue/g, 'pages/$1').replace(/\\/g, '/'), fs.readFileSync(file).toString()) + return json.pages.push(app) + } + }), ]).then(() => { fsExtra.outputJson('src/pages.json', json, () => { chalkTag.done('生成pages.json') diff --git a/wxmp/src/App.vue b/wxmp/src/App.vue index f037934..5484f83 100644 --- a/wxmp/src/App.vue +++ b/wxmp/src/App.vue @@ -14,7 +14,7 @@ export default { /*每个页面公共css */ @each $padMar, $pm in (mar:margin, pad:padding) { - @each $v in (8, 10, 16, 20, 32, 48, 64, 80) { + @each $v in (8, 10, 16, 20, 32, 48, 56, 64, 80) { @each $pos, $p in (l:left, r:right, t:top, b:bottom) { .#{$padMar}-#{$pos+$v} { #{$pm}-#{$p}: #{$v}px diff --git a/wxmp/src/mods/AppCart/AppCart.vue b/wxmp/src/pages/AppCart.vue similarity index 100% rename from wxmp/src/mods/AppCart/AppCart.vue rename to wxmp/src/pages/AppCart.vue diff --git a/wxmp/src/mods/AppMine/AppMine.vue b/wxmp/src/pages/AppMine.vue similarity index 100% rename from wxmp/src/mods/AppMine/AppMine.vue rename to wxmp/src/pages/AppMine.vue diff --git a/wxmp/src/pages/home.vue b/wxmp/src/pages/home.vue index 2d6a1cb..4c39fdd 100644 --- a/wxmp/src/pages/home.vue +++ b/wxmp/src/pages/home.vue @@ -2,7 +2,7 @@
-
+
@@ -19,7 +19,6 @@
-
@@ -52,6 +51,7 @@ export default { }, handleAdd2Cart() { + uni.setTabBarBadge({index: 1, text: "4"}) this.$toast("加入购物车") }, handleDetail() { diff --git a/wxmp/src/static/tabbar/cart-s.png b/wxmp/src/static/tabbar/cart-s.png new file mode 100644 index 0000000..e2f115c Binary files /dev/null and b/wxmp/src/static/tabbar/cart-s.png differ diff --git a/wxmp/src/static/tabbar/cart.png b/wxmp/src/static/tabbar/cart.png new file mode 100644 index 0000000..8ebce07 Binary files /dev/null and b/wxmp/src/static/tabbar/cart.png differ diff --git a/wxmp/src/static/tabbar/home-s.png b/wxmp/src/static/tabbar/home-s.png new file mode 100644 index 0000000..09113a4 Binary files /dev/null and b/wxmp/src/static/tabbar/home-s.png differ diff --git a/wxmp/src/static/tabbar/home.png b/wxmp/src/static/tabbar/home.png new file mode 100644 index 0000000..b4f00bd Binary files /dev/null and b/wxmp/src/static/tabbar/home.png differ diff --git a/wxmp/src/static/tabbar/mine-s.png b/wxmp/src/static/tabbar/mine-s.png new file mode 100644 index 0000000..9a65e74 Binary files /dev/null and b/wxmp/src/static/tabbar/mine-s.png differ diff --git a/wxmp/src/static/tabbar/mine.png b/wxmp/src/static/tabbar/mine.png new file mode 100644 index 0000000..bc672e8 Binary files /dev/null and b/wxmp/src/static/tabbar/mine.png differ