From bbd54ac2882cadc18f622ef75aded6296494bd37 Mon Sep 17 00:00:00 2001 From: jcuser <2550960513@qq.com> Date: Sat, 23 Jan 2021 11:15:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?components/c-tabbar-popup=20=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/index.js | 5 - api/mock/help-form.js | 5 + api/request.js | 11 +- assets/languages/Chinese.json | 4 + assets/languages/English.json | 4 + components/c-page/index.vue | 2 +- components/c-popup/README.md | 37 ----- components/c-popup/index.vue | 109 ------------- components/c-tabbar-popup/index.vue | 164 ++++++++++--------- components/c-upload-image/README.md | 37 ----- components/c-upload-image/index.vue | 64 -------- manifest.json | 2 +- package.json | 2 + pages.json | 34 ++-- pages/help-form/help-form.vue | 189 ++++++++++------------ pages/login/WXLogin.vue | 66 +++----- pages/setting/setting.vue | 2 +- pages/test/test.vue | 8 - pages/user/Personal-Data.vue | 8 +- store/index.js | 28 +++- uview-ui/components/u-upload/u-upload.vue | 4 +- vue.config.js | 26 --- 22 files changed, 263 insertions(+), 548 deletions(-) delete mode 100644 components/c-popup/README.md delete mode 100644 components/c-popup/index.vue delete mode 100644 components/c-upload-image/README.md delete mode 100644 components/c-upload-image/index.vue delete mode 100644 vue.config.js diff --git a/api/index.js b/api/index.js index 6084708..0a668eb 100644 --- a/api/index.js +++ b/api/index.js @@ -11,10 +11,5 @@ export const helpInfo = { export const helpForm = { getTags: helpFormMock.getTags, - addInformation: (params)=>request.post("/information/addInformation",params), -} - -export const login = { - WXLogin: (params)=>request.post("/user/Thirdlogin",params) } diff --git a/api/mock/help-form.js b/api/mock/help-form.js index 2145e26..a9042d5 100644 --- a/api/mock/help-form.js +++ b/api/mock/help-form.js @@ -6,21 +6,26 @@ export default { name: '带饭', enName:'Bring Meal', id: '1', + img:'/static/images/logo.png' }, { name: '外卖', enName:'Take Out', id: '2', + img:'/static/images/logo.png' }, { name: '失物招领', enName:'Lost And Found', id: '3', + img:'/static/images/logo.png' }, { name: '代取快递', enName:'Express', id: '4', + img:'/static/images/logo.png' }, { name: '二手书', enName:'Used Books', id: '5', + img:'/static/images/logo.png' }]) } diff --git a/api/request.js b/api/request.js index 6a7cafb..46aabf2 100644 --- a/api/request.js +++ b/api/request.js @@ -1,9 +1,7 @@ import uni_request from './requestAxios.js' -import Vue from "vue" -import store from "../store" const request = uni_request({ // 有效配置项只有三个 - baseURL: 'http://121.5.12.180:80', //baseURL + baseURL: 'http://120.24.151.246:80', //baseURL timeout: 12345, // 超时时间,单位毫秒。默认 60 秒 header: {'x-custom-header': 'x-custom-header'}, // 设置请求头,建议放在请求拦截器中 statusCode: [200, 401] // 服务器相应状态码为 200/401 时,网络请求不会 reject。也就是不会被 catch 到。如响应 401 时可以在响应拦截后 await 刷新 token + await 重新请求 + return response。即可实现无痛刷新。 @@ -14,18 +12,13 @@ request.interceptors.request.use(async (config, ...args) => { //config.header.Authorization = 'Bearer ' + $store.state.app.token // 修改请求头 //config.body.test = 'test' // 修改请求体 // config.cancel = true // 取消请求 - config.header.token = store.state.token return config }) request.interceptors.response.use(async (response, ...args) => { // 响应拦截器(可以设置多个, 同时可以也可以使用异步方法) const {data: res} = response // args[0] method args[1] url args[3] data //await new Promise(resolve => setTimeout(() => resolve(), 3000)) - console.log(response); - if (res.token) { - store.commit("setToken",res.token) - } - if (res.state === 200) { + if (res.code === 200) { //console.log('响应拦截器, 会阻塞 3 s') } return response diff --git a/assets/languages/Chinese.json b/assets/languages/Chinese.json index a28f3da..1f61aeb 100644 --- a/assets/languages/Chinese.json +++ b/assets/languages/Chinese.json @@ -64,5 +64,9 @@ "submit": "发布", "chooseLocation": "选择任务地点", "location": "任务地点" + }, + "cTabberPopup":{ + "title1":"求助", + "title2":"动态" } } \ No newline at end of file diff --git a/assets/languages/English.json b/assets/languages/English.json index 323c9c6..92beb6e 100644 --- a/assets/languages/English.json +++ b/assets/languages/English.json @@ -63,5 +63,9 @@ "submit":"Submit", "chooseLocation": "Select mission location", "location": "Location" + }, + "cTabberPopup":{ + "title1":"Help", + "title2":"Trends" } } \ No newline at end of file diff --git a/components/c-page/index.vue b/components/c-page/index.vue index c2a6eab..2f7a551 100644 --- a/components/c-page/index.vue +++ b/components/c-page/index.vue @@ -1,5 +1,5 @@