From 824df64b1911e846ec59d029aeb50ce70583ad8f Mon Sep 17 00:00:00 2001 From: yangjie <812952667@qq.com> Date: Tue, 8 Jun 2021 19:51:04 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=20=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/share.js | 35 ++++ components/zc-grid-item/zc-grid-item.vue | 145 ++++++++++++++ components/zc-grid-wrap/zc-grid-wrap.vue | 129 ++++++++++++ components/zc-grid/zc-grid.vue | 205 ++++++++++++++++++++ main.js | 7 +- pages.json | 67 +++++-- pages/tabBar/home/home.vue | 237 ++++++++++++++++------- static/img/headzq.png | Bin 0 -> 4090 bytes uni.scss | 6 +- 9 files changed, 735 insertions(+), 96 deletions(-) create mode 100644 common/share.js create mode 100644 components/zc-grid-item/zc-grid-item.vue create mode 100644 components/zc-grid-wrap/zc-grid-wrap.vue create mode 100644 components/zc-grid/zc-grid.vue create mode 100644 static/img/headzq.png 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 0000000000000000000000000000000000000000..ca8809f065e8b994851570fb43a0f46541fc1a55 GIT binary patch literal 4090 zcmd^CX;@R|wob85;8blvoQUD5RfZkL%z=!I0WwD!LP!EcNCHWafB~%t3fg0>MUS(# zT8|V+wO6cKH=x#v!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