From dc35cd9b86efee9985480db627a005cb75dcd815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Fri, 25 Jun 2021 14:43:13 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=20=E5=B1=8F=E8=94=BD?= =?UTF-8?q?=E6=AD=A3=E5=BC=8Fconsole=20[=E5=AE=8C=E5=96=84]=20=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=AD=E5=BF=83=E9=A1=B5=E9=9D=A2=20[=E6=8E=A5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3]=20=E5=AE=A2=E6=9C=8D=E8=90=BD=E5=9C=B0?= =?UTF-8?q?=E9=A1=B5=20[=E4=BF=AE=E6=94=B9]=20=E5=95=86=E5=93=81=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5UI=20[=E6=96=B0=E5=A2=9E]=20=E5=B8=B8?= =?UTF-8?q?=E8=A7=81=E9=97=AE=E9=A2=98=E9=A1=B5UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 1 + common/api.js | 1 + common/styles/iconfont.css | 74 ++++++++++++++++++++++++++++++++++ pages/contactService/index.vue | 13 +++++- pages/index/index.vue | 9 +++-- 5 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 common/styles/iconfont.css diff --git a/App.vue b/App.vue index c1b54e5..e8fe4ff 100644 --- a/App.vue +++ b/App.vue @@ -85,6 +85,7 @@ @import './colorui/icon.css'; @import "@/colorui/animation.css"; @import '@/common/styles/common.css'; + @import "@/common/styles/iconfont.css"; /*每个页面公共css */ //底部按钮 .btn-bottom { diff --git a/common/api.js b/common/api.js index 34b0861..b118ef1 100644 --- a/common/api.js +++ b/common/api.js @@ -26,6 +26,7 @@ export const API_PRPAID = '/api/order/deal' /* 个人中心相关 */ export const API_COLLECT_LIST = '/api/collect/list'; // 我的收藏列表 +export const API_CONTACT = '/api/contact'; // 客服落地页信息 /* 用户相关 */ export const API_WXLOGIN = '/api/wxlogin'; // 用户登录 diff --git a/common/styles/iconfont.css b/common/styles/iconfont.css new file mode 100644 index 0000000..bd0a103 --- /dev/null +++ b/common/styles/iconfont.css @@ -0,0 +1,74 @@ +@font-face { + font-family: "lf-iconfont"; /* Project id 2631569 */ + src: url('//at.alicdn.com/t/font_2631569_rgieivs47oc.woff2?t=1624527625328') format('woff2'), + url('//at.alicdn.com/t/font_2631569_rgieivs47oc.woff?t=1624527625328') format('woff'), + url('//at.alicdn.com/t/font_2631569_rgieivs47oc.ttf?t=1624527625328') format('truetype'); +} + +.lf-iconfont { + font-family: "lf-iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.lf-icon-jia1:before { + content: "\e6d4"; +} + +.lf-icon-xiangyou-copy:before { + content: "\e623"; +} + +.lf-icon-dianhua:before { + content: "\e64c"; +} + +.lf-icon-shuaxin:before { + content: "\e60e"; +} + +.lf-icon-shibai:before { + content: "\e645"; +} + +.lf-icon-jianshao:before { + content: "\e663"; +} + +.lf-icon-cuo:before { + content: "\e63f"; +} + +.lf-icon-icon-test:before { + content: "\e61e"; +} + +.lf-icon-dizhi:before { + content: "\e612"; +} + +.lf-icon-fanhui-xianxing:before { + content: "\e641"; +} + +.lf-icon-weigouxuan:before { + content: "\e615"; +} + +.lf-icon-gouxuan-xianxing:before { + content: "\e616"; +} + +.lf-icon-jian1:before { + content: "\e646"; +} + +.lf-icon-chenggong:before { + content: "\e60a"; +} + +.lf-icon-fenxiangzhuanfa:before { + content: "\e74f"; +} diff --git a/pages/contactService/index.vue b/pages/contactService/index.vue index 12878e6..8c55ea3 100644 --- a/pages/contactService/index.vue +++ b/pages/contactService/index.vue @@ -4,6 +4,7 @@ 在线客服 + 服务时间 10:00~20:00 @@ -23,6 +24,7 @@ 复制 + 当前版本 {{ version }} @@ -34,13 +36,22 @@ export default { data(){ return { - version: '' + version: '', + list: [] } }, onLoad(){ this.version = this.API.VERSION; + this.getInfo(); }, methods: { + // 获取信息 + getInfo(){ + this.$http(this.API.API_CONTACT).then(res => { + console.log("info", res); + this.list = res.data; + }) + }, // 拨打电话 makePhoneCall(){ uni.makePhoneCall({ diff --git a/pages/index/index.vue b/pages/index/index.vue index 551eba4..90f4058 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -155,9 +155,12 @@ this.getGoodsList(); uni.stopPullDownRefresh() }, - // onShareAppMessage(){ - - // } + onShareAppMessage(){ + return { + title: '分享小程序', + path: '/pages/route/index' + } + } } From f58f694a3820ecc58b124a94ec7b27b33a341abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Fri, 25 Jun 2021 14:43:42 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=20=E5=B1=8F=E8=94=BD?= =?UTF-8?q?=E6=AD=A3=E5=BC=8Fconsole=20[=E5=AE=8C=E5=96=84]=20=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=AD=E5=BF=83=E9=A1=B5=E9=9D=A2=20[=E6=8E=A5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3]=20=E5=AE=A2=E6=9C=8D=E8=90=BD=E5=9C=B0?= =?UTF-8?q?=E9=A1=B5=20[=E4=BF=AE=E6=94=B9]=20=E5=95=86=E5=93=81=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5UI=20[=E6=96=B0=E5=A2=9E]=20=E5=B8=B8?= =?UTF-8?q?=E8=A7=81=E9=97=AE=E9=A2=98=E9=A1=B5UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 28 +++-- common/api.js | 3 + common/http.interceptor.js | 15 +-- components/my-nocontent/my-nocontent.vue | 6 +- pages.json | 8 +- pages/FQA/index.vue | 25 +++++ pages/center/index.vue | 132 +++++++++++++++++------ pages/collect/index.vue | 1 - pages/contactService/index.vue | 17 ++- pages/goodsDetail/index.vue | 40 +++++-- pages/index/index.vue | 4 +- pages/login/index.vue | 20 ++-- static/center/collect-active.png | Bin 0 -> 1471 bytes static/center/order.png | Bin 0 -> 1445 bytes static/center/scan.png | Bin 904 -> 1025 bytes static/images/empty.png | Bin 0 -> 301901 bytes static/logo.png | Bin 15558 -> 460697 bytes 17 files changed, 212 insertions(+), 87 deletions(-) create mode 100644 pages/FQA/index.vue create mode 100644 static/center/collect-active.png create mode 100644 static/center/order.png create mode 100644 static/images/empty.png diff --git a/App.vue b/App.vue index e8fe4ff..7811e02 100644 --- a/App.vue +++ b/App.vue @@ -4,6 +4,7 @@ wxlogin: () => {} }, onLaunch: function() { + this.disableConsole(); this.getUserInfo(); }, onShow: function() { @@ -25,16 +26,19 @@ this.globalData.wxlogin(); }, wxlogin(){ - uni.login({ - complete: result => { - if(result.errMsg == 'login:ok'){ - let code = result.code; - this.$http(this.API.API_WXLOGIN, { code }).then(res => { - console.log("获得用户信息", res); - uni.setStorageSync('userinfo', res.data); - }) + return new Promise((resolve, rejecj) => { + uni.login({ + complete: result => { + if(result.errMsg == 'login:ok'){ + let code = result.code; + this.$http(this.API.API_WXLOGIN, { code }).then(res => { + console.log("获得用户信息", res); + uni.setStorageSync('userinfo', res.data); + resolve(res.data); + }) + } } - } + }) }) }, // 小程序版本更新检查 @@ -74,6 +78,12 @@ } }); }); + }, + // 判断正式服屏蔽console输出 + disableConsole(){ + if(this.API.DEV == 'prod'){ + console.log = () => {}; + } } } } diff --git a/common/api.js b/common/api.js index b118ef1..ac1f131 100644 --- a/common/api.js +++ b/common/api.js @@ -25,6 +25,7 @@ export const API_COLLECT_DEAL = '/api/collect/deal'; // 商品收藏 export const API_PRPAID = '/api/order/deal' /* 个人中心相关 */ +export const API_USER_CENTER = '/api/user/center'; // 个人中心 export const API_COLLECT_LIST = '/api/collect/list'; // 我的收藏列表 export const API_CONTACT = '/api/contact'; // 客服落地页信息 @@ -33,3 +34,5 @@ export const API_WXLOGIN = '/api/wxlogin'; // 用户登录 export const API_WECHAT_SETPHONE = '/api/wechat/setPhone'; // 用户授权手机号提交 export const API_WECHAT_SETPROFILE = '/api/wechat/setProfile'; // 用户授权微信信息提交(返回用户信息) +/* 商户相关 */ +export const API_CONFIRM_CODE = '/api/confirm/code'; // 扫码核销 \ No newline at end of file diff --git a/common/http.interceptor.js b/common/http.interceptor.js index 83b2943..dbf0892 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -23,22 +23,11 @@ const install = (Vue, vm) => { Vue.prototype.$u.http.interceptor.response = res => { if(res.code == 0) { return res; - } else if(res.code == 201) { - console.log("其他状态:", res.code) - return false; - } else if (res.code == 9999) { - uni.navigateTo({ - url: '/pages/login/index?type=userinfo' - }) - return false; - } else if (res.code == 9998) { - uni.navigateTo({ - url: '/pages/login/index?type=phone' - }) - return false; } else { + vm.$msg(res.msg); return false; } + // res.code == 9998 手机号 res.code == 9999 用户信息 } } diff --git a/components/my-nocontent/my-nocontent.vue b/components/my-nocontent/my-nocontent.vue index e0de312..8f44b37 100644 --- a/components/my-nocontent/my-nocontent.vue +++ b/components/my-nocontent/my-nocontent.vue @@ -2,7 +2,7 @@ - + 暂无数据 @@ -21,7 +21,7 @@ diff --git a/pages.json b/pages.json index bfab971..1f80e04 100644 --- a/pages.json +++ b/pages.json @@ -102,6 +102,12 @@ "style": { "navigationBarTitleText": "时空网" } + }, + { + "path": "pages/FQA/index", + "style": { + "navigationBarTitleText": "常见问题" + } } ], "globalStyle": { @@ -111,7 +117,7 @@ "backgroundColor": "#fff" }, "tabBar": { - "color": "#909399", + "color": "#333333", "selectedColor": "#FE9903", "borderStyle": "black", "backgroundColor": "#ffffff", diff --git a/pages/FQA/index.vue b/pages/FQA/index.vue new file mode 100644 index 0000000..d88270b --- /dev/null +++ b/pages/FQA/index.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/pages/center/index.vue b/pages/center/index.vue index 7620c0b..f81e527 100644 --- a/pages/center/index.vue +++ b/pages/center/index.vue @@ -1,80 +1,90 @@