From ef15949d5965b5a72d4feb3311e9ded3174a8b2d Mon Sep 17 00:00:00 2001 From: "liujw155@outlook.com" Date: Fri, 29 Jan 2021 18:05:26 +0800 Subject: [PATCH] add api --- src/js/api.js | 12 +++- src/js/server.js | 14 +++-- src/pages/course/list/list.vue | 96 ++++++++++++++++++++++-------- src/pages/index/index.vue | 88 +++++++++++++++++++++------ src/pages/login/login.vue | 35 ++++++++++- src/pages/message_list/message_list.vue | 9 ++- src/static/images/arrow_cb2.png | Bin 0 -> 219 bytes src/static/images/index/feedback_c874.png | Bin 0 -> 432 bytes src/static/images/index/i_1.png | Bin 0 -> 294 bytes src/static/images/index/i_2.png | Bin 0 -> 514 bytes src/static/images/index/i_3.png | Bin 0 -> 447 bytes src/static/images/index/i_4.png | Bin 0 -> 705 bytes src/static/images/index/i_5.png | Bin 0 -> 476 bytes src/static/images/index/i_6.png | Bin 0 -> 374 bytes src/static/images/index/i_7.png | Bin 0 -> 461 bytes src/static/images/index/notice_c874.png | Bin 0 -> 452 bytes src/static/images/logo.png | Bin 0 -> 2814 bytes 17 files changed, 197 insertions(+), 57 deletions(-) create mode 100644 src/static/images/arrow_cb2.png create mode 100644 src/static/images/index/feedback_c874.png create mode 100644 src/static/images/index/i_1.png create mode 100644 src/static/images/index/i_2.png create mode 100644 src/static/images/index/i_3.png create mode 100644 src/static/images/index/i_4.png create mode 100644 src/static/images/index/i_5.png create mode 100644 src/static/images/index/i_6.png create mode 100644 src/static/images/index/i_7.png create mode 100644 src/static/images/index/notice_c874.png create mode 100644 src/static/images/logo.png diff --git a/src/js/api.js b/src/js/api.js index 67f4729..ce231ba 100644 --- a/src/js/api.js +++ b/src/js/api.js @@ -1,8 +1,14 @@ -export const ORIGIN = ``; // 测试 -// export const ORIGIN = ``; // 正式 +export const ORIGIN = `https://test.ouxuanzhineng.cn`; // 测试 +// export const ORIGIN = `https://coach.ouxuanzhineng.cn`; // 正式 export const API = { - ex: `${ORIGIN}/test/test`, + coachLogin: `${ORIGIN}/stadium/coach/login`, // 小程序-账号登录 + saveFeedback: `${ORIGIN}/stadium/coach/saveFeedback`, // 小程序-保存教练反馈 + +} + +API['course'] = { + courseList: `${ORIGIN}/stadium/coach/courseList`, // 小程序-课程列表 } diff --git a/src/js/server.js b/src/js/server.js index e5cebad..19be11c 100644 --- a/src/js/server.js +++ b/src/js/server.js @@ -4,14 +4,20 @@ const islog = true; export class Server { request(url,data,method,header,isDefaultGet,failMsg){ - return new Promise(async (rs,rj)=>{ + return new Promise(async (rs,rj)=>{ // const _store = vm.$store; // let storeInfo = _store.state.storeInfo || null; // if(storeInfo)data['brand_id'] = storeInfo.brand_id; + const _loginInfo = uni.getStorageSync('loginInfo'); + + if(_loginInfo || true){ + data = Object.assign({ + coach_token: _loginInfo.coach_token || '0c30100d-5ba8-11eb-9029-5254005df464', + brand_id: _loginInfo.brand_id || '63', + }, data); + } - const _token = uni.getStorageSync('token') || ''; - if(_token)data['token'] = _token; - if(method === 'POST'&&_token)url = url + `?token=${_token}` + // if(method === 'POST'&&_loginInfo)url = url + `?coach_token=${_loginInfo.coach_token}` uni.request({ url, data, diff --git a/src/pages/course/list/list.vue b/src/pages/course/list/list.vue index 3b3db47..6630899 100644 --- a/src/pages/course/list/list.vue +++ b/src/pages/course/list/list.vue @@ -1,36 +1,39 @@ diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 54ab78c..18a3ffa 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -1,52 +1,108 @@ @@ -92,7 +148,6 @@ margin-left: 20upx; width: 28upx; height: 28upx; - background-color: skyblue; } } .ih-tip{ @@ -132,7 +187,6 @@ width: 52upx; height: 52upx; margin-right: 10upx; - background-color: skyblue; } } @@ -154,7 +208,6 @@ flex-shrink: 0; width: 28upx; height: 28upx; - background-color: skyblue; } } } @@ -168,7 +221,6 @@ width: 33.33%; height: auto; >image{ - background-color: skyblue; margin: 0 auto 20upx; display: block; width: 52upx; @@ -199,7 +251,6 @@ margin-right: 16upx; width: 52upx; height: 52upx; - background-color: skyblue; } } >image{ @@ -207,7 +258,6 @@ flex-grow: 0; width: 28upx; height: 28upx; - background-color: skyblue; } } diff --git a/src/pages/login/login.vue b/src/pages/login/login.vue index db8ff22..8c2a27c 100644 --- a/src/pages/login/login.vue +++ b/src/pages/login/login.vue @@ -1,7 +1,9 @@