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 @@