diff --git a/common/share.js b/common/share.js new file mode 100644 index 0000000..5a1e159 --- /dev/null +++ b/common/share.js @@ -0,0 +1,35 @@ +export default{ + data(){ + return { + //设置默认的分享参数 + //如果页面不设置share,就触发这个默认的分享 + share:{ + title:'嗨森逛', + path:'/pages/tabBar/home/home', + imageUrl:'', + desc:'', + content:'' + } + } + }, + onShareAppMessage(res) { + return { + title:this.share.title, + path:this.share.path, + imageUrl:this.share.imageUrl, + desc:this.share.desc, + content:this.share.content, + success(res){ + uni.showToast({ + title:'分享成功' + }) + }, + fail(res){ + uni.showToast({ + title:'分享失败', + icon:'none' + }) + } + } + } +} \ No newline at end of file diff --git a/components/zc-grid-item/zc-grid-item.vue b/components/zc-grid-item/zc-grid-item.vue new file mode 100644 index 0000000..1180be7 --- /dev/null +++ b/components/zc-grid-item/zc-grid-item.vue @@ -0,0 +1,145 @@ + + + + + diff --git a/components/zc-grid-wrap/zc-grid-wrap.vue b/components/zc-grid-wrap/zc-grid-wrap.vue new file mode 100644 index 0000000..39dd864 --- /dev/null +++ b/components/zc-grid-wrap/zc-grid-wrap.vue @@ -0,0 +1,129 @@ + + + + + \ No newline at end of file diff --git a/components/zc-grid/zc-grid.vue b/components/zc-grid/zc-grid.vue new file mode 100644 index 0000000..74e6100 --- /dev/null +++ b/components/zc-grid/zc-grid.vue @@ -0,0 +1,205 @@ + + + + + diff --git a/main.js b/main.js index d090f90..5266c88 100644 --- a/main.js +++ b/main.js @@ -1,12 +1,13 @@ import Vue from 'vue' import App from './App' -// import api from './Utils/Api.js' import {VueJsonp} from 'vue-jsonp' +import share from 'common/share.js' +import imgGrid from './components/zc-grid/zc-grid.vue' Vue.config.productionTip = false -// Vue.prototype.api = api; Vue.use(VueJsonp) App.mpType = 'app' - +Vue.mixin(share) + Vue.component('imgGrid',imgGrid) const app = new Vue({ ...App }) diff --git a/pages.json b/pages.json index e1aaa9c..cbd1ede 100644 --- a/pages.json +++ b/pages.json @@ -5,6 +5,9 @@ "style": { "navigationBarTextStyle": "black", // "enablePullDownRefresh": true, + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white", "onReachBottomDistance": 50, "app-plus": { "titleNView": false, //禁用原生导航栏 @@ -20,6 +23,9 @@ { "path": "pages/goods/store-list/store-list", "style": { + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white", "navigationBarTitleText": "门店列表", "enablePullDownRefresh": false } @@ -29,6 +35,9 @@ "path": "pages/tabBar/category/category", "style": { "navigationBarTextStyle": "black", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white", "app-plus": { "titleNView": false, //禁用原生导航栏 "bounce": "none" @@ -41,6 +50,9 @@ "style": { "enablePullDownRefresh": true, "navigationBarTextStyle": "black", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white", "app-plus": { "titleNView": false, //禁用原生导航栏 "softinputNavBar": "none", @@ -57,8 +69,8 @@ "style": { "enablePullDownRefresh": true, "backgroundTextStyle": "light", - "navigationBarBackgroundColor": "#f06c7a", - "backgroundColorTop": "#f06c7a", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", "navigationBarTextStyle": "white", "app-plus": { "titleNView": false, //禁用原生导航栏 @@ -74,6 +86,9 @@ "path": "pages/goods/goods-list/goods-list", "style": { "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white", "enablePullDownRefresh": true, "app-plus": { "bounce": "none" @@ -84,6 +99,9 @@ "path": "pages/goods/HM-search/HM-search", "style": { "navigationBarTitleText": "搜索", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white", "app-plus": { "softinputNavBar": "none" } @@ -93,7 +111,9 @@ "path": "pages/goods/goods", "style": { "navigationBarTitleText": "", - "navigationBarBackgroundColor": "#f1f1f1", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white", "onReachBottomDistance": 50, "h5": { "titleNView": false @@ -107,7 +127,8 @@ { "path": "pages/login/login", "style": { - "navigationBarBackgroundColor": "#f06c7a", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", "navigationBarTextStyle": "white", "app-plus": { "bounce": "none", //关闭窗口回弹效果 @@ -119,7 +140,8 @@ "path": "pages/login/register", "style": { "navigationBarTitleText": "手机号登录", - "navigationBarBackgroundColor": "#f06c7a", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", "navigationBarTextStyle": "white", "app-plus": { "bounce": "none", //关闭窗口回弹效果 @@ -131,7 +153,8 @@ "path": "pages/login/resetpasswd", "style": { "navigationBarTitleText": "修改密码", - "navigationBarBackgroundColor": "#f06c7a", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", "navigationBarTextStyle": "white", "app-plus": { "bounce": "none", //关闭窗口回弹效果 @@ -142,20 +165,27 @@ "path": "pages/order/confirmation", "style": { "navigationBarTitleText": "确认订单", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white", "softinputNavBar": "none" } }, { "path": "pages/user/setting/setting", "style": { - "navigationBarBackgroundColor": "#f8f8f8", "navigationBarTitleText": "我的设置", - "backgroundColorTop": "#ffffff", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white", "backgroundColorBottom": "#f3f3f3" } }, { "path": "pages/user/myQR/myQR", "style": { "navigationBarTitleText": "我的二维码", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white", "app-plus": { "bounce": "none" } @@ -165,14 +195,15 @@ "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "消息列表", - "navigationBarBackgroundColor": "#f06c7a", + "navigationBarBackgroundColor": "#0083f5", "navigationBarTextStyle": "white" } }, { "path": "pages/user/coupon/coupon", "style": { "navigationBarTitleText": "优惠券", - "navigationBarBackgroundColor": "#f06c7a", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", "navigationBarTextStyle": "white", "app-plus": { "bounce": "none" @@ -182,8 +213,8 @@ "path": "pages/user/keep/keep", "style": { "navigationBarTitleText": "我的收藏", - "navigationBarBackgroundColor": "#f06c7a", - "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", "app-plus": { "bounce": "none" } @@ -272,7 +303,7 @@ "path": "pages/user/order_details/order_details", "style": { // "navigationBarTitleText": "订单详情", - "navigationBarBackgroundColor": "#f06c7a", + "navigationBarBackgroundColor": "#0083f5", "navigationBarTextStyle": "white", "enablePullDownRefresh": false } @@ -323,8 +354,8 @@ "style": { "navigationBarTitleText": "", "backgroundTextStyle": "light", - "navigationBarBackgroundColor": "#f06c7a", - "backgroundColorTop": "#f06c7a", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", "navigationBarTextStyle": "white" } }, @@ -334,8 +365,8 @@ "enablePullDownRefresh": false, "navigationBarTitleText": "", "backgroundTextStyle": "light", - "navigationBarBackgroundColor": "#f06c7a", - "backgroundColorTop": "#f06c7a", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", "navigationBarTextStyle": "white" } @@ -361,7 +392,7 @@ }, "tabBar": { "color": "#333333", - "selectedColor": "#f06c7a", + "selectedColor": "#0083f5", "borderStyle": "black", "backgroundColor": "#ffffff", "list": [{ diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue index b9cde28..d4f6903 100644 --- a/pages/tabBar/home/home.vue +++ b/pages/tabBar/home/home.vue @@ -29,6 +29,7 @@ + @@ -42,12 +43,40 @@ + + + + + + + + + + + + + {{item.subject}} + + + + + + + + + + + {{item.subject}} + + + + - + - - + --> + - + --> @@ -148,29 +175,57 @@ loadingText: '正在加载...', pageNum: 1, pageSize: 6, + imgList: [{ + url: '/static/img/wxpay.png', + text: '美食' + }, + { + url: '/static/img/wxpay.png', + text: '加油' + }, + { + url: '/static/img/wxpay.png', + text: '美食' + }, + { + url: '/static/img/wxpay.png', + text: '美食' + } + ], + list: [{ + id: 1, + img: '/static/img/wenj.png', + subject: '104' + }, + { + id: 1, + img: '/static/img/wenj.png', + subject: '123' + }, + { + id: 1, + img: '/static/img/wenj.png', + subject: '112' + }, + { + id: 1, + img: '/static/img/wenj.png', + subject: '221' + }, + { + id: 1, + img: '/static/img/wenj.png', + subject: '343' + }, + { + id: 1, + img: '/static/img/wenj.png', + subject: '123' + } + ] }; }, - onPageScroll(e) { - //兼容iOS端下拉时顶部漂移 - // this.headerPosition = e.scrollTop >= 0 ? "fixed" : "absolute"; - // this.headerTop = e.scrollTop >= 0 ? null : 0; - // this.statusTop = e.scrollTop >= 0 ? null : -this.statusHeight + 'px'; - }, - //下拉刷新,需要自己在page.json文件中配置开启页面下拉刷新 "enablePullDownRefresh": true - onPullDownRefresh() { - // setTimeout(function() { - // uni.stopPullDownRefresh(); - // }, 1000); - }, - //上拉加载,需要自己在page.json文件中配置"onReachBottomDistance" - onReachBottom() { - }, - - - authColse() { - - }, onShow() { // #ifdef H5 var arr1 = window.location.href; @@ -178,7 +233,7 @@ if (!app.globalData.userInfo && arr2[1] != undefined && arr2[2] == '2#/') { this.getH5UserInfo(arr2[1]); } - + if (app.globalData.userInfo && arr2[1] != undefined && arr2[2] == '1#/') { this.getH5AccessToken(arr2[1]); } @@ -306,8 +361,8 @@ uni.setStorage({ key: "openId", data: res.return_data - .object - .highUser.openIdH5 + .object + .highUser.openIdH5 }) app.globalData.openId = res.return_data .object @@ -406,45 +461,6 @@ } }); }, - - //消息列表 - toMsg() { - // uni.navigateTo({ - // url: '../../msg/msg' - // }) - // uni.showToast({ - // title: '暂未开通', - // icon: 'none' - // }); - }, - //搜索跳转 - toSearch() { - uni.navigateTo({ - url: '../../goods/HM-search/HM-search' - }) - // uni.showToast({ title: '建议跳转到新页面做搜索功能' }); - }, - //轮播图跳转 - toSwiper(e) { - // uni.showToast({ - // title: e.src, - // icon: 'none' - // }); - uni.reLaunch({ - url: '../category/category' - }) - }, - - //商品跳转 - toGoods(e) { - // uni.showToast({ - // title: '商品' + e.goods_id, - // icon: 'none' - // }); - uni.navigateTo({ - url: '../../goods/goods?id=' + e - }); - }, //轮播图指示器 swiperChange(event) { this.currentSwiper = event.detail.current; @@ -455,7 +471,7 @@ diff --git a/static/img/headzq.png b/static/img/headzq.png new file mode 100644 index 0000000..ca8809f Binary files /dev/null and b/static/img/headzq.png differ diff --git a/uni.scss b/uni.scss index 4198567..977cef0 100644 --- a/uni.scss +++ b/uni.scss @@ -225,7 +225,11 @@ $uni-font-size-paragraph:30upx; .backcorf06{ background-color: #f06c7a; } - + +.backcor008{ + background-color: #0083f5; +} + .backcor89 { background-color: #089bf5;