From 98bf599434ef289952d8de6a58490b52c42139f9 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Tue, 7 Jun 2022 16:32:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 14 -- apis/modules/order.js | 4 + apis/modules/parner.js | 12 ++ apis/request.js | 16 +- libs/util.js | 4 +- pages.json | 28 ++-- pages/addCourse/addCourse.vue | 4 +- pages/addStaff/addStaff.vue | 2 +- pages/clientDetail/clientDetail.vue | 6 +- pages/clients/clients.vue | 48 ++++-- pages/editCourse/editCourse.vue | 178 ++++++++++++++--------- pages/{main/main.vue => index/index.vue} | 61 ++++---- pages/invite/invite.vue | 2 +- pages/login/login.vue | 18 ++- pages/orderDetail/orderDetail.vue | 22 ++- pages/orders/orders.vue | 142 ++++++++++++++---- pages/person/person.vue | 16 +- pages/plans/plans.vue | 67 ++++++--- pages/products/products.vue | 30 +++- pages/qrcode/qrcode.vue | 2 +- pages/teams/teams.vue | 65 +++++++-- static/avatar.jpg | Bin 6723 -> 0 bytes static/customicons.css | 20 --- static/customicons.ttf | Bin 2416 -> 0 bytes styles/common.scss | 1 + 25 files changed, 504 insertions(+), 258 deletions(-) rename pages/{main/main.vue => index/index.vue} (71%) delete mode 100644 static/avatar.jpg delete mode 100644 static/customicons.css delete mode 100644 static/customicons.ttf diff --git a/App.vue b/App.vue index ee288b1..233affd 100644 --- a/App.vue +++ b/App.vue @@ -14,19 +14,5 @@ diff --git a/apis/modules/order.js b/apis/modules/order.js index 0ec1924..ee4b22f 100644 --- a/apis/modules/order.js +++ b/apis/modules/order.js @@ -23,4 +23,8 @@ export const renew = (data) => { export const list = (data) => { return post('nakadai/applets/order/getOrderBasedOnBusinessManagerId', data) +} + +export const del = (data) => { + return post('nakadai/nakadai/order/delete', data) } \ No newline at end of file diff --git a/apis/modules/parner.js b/apis/modules/parner.js index 16b5fd1..5f6581e 100644 --- a/apis/modules/parner.js +++ b/apis/modules/parner.js @@ -3,4 +3,16 @@ const { get, post } = request export const savePartnerAccount = (data) => { return post('nakadai/partnerAccount/savePartnerAccount', data) +} + +export const teamList = (data) => { + return get('nakadai/partner-team/teamList', data) +} + +export const generateInvitationCode = (data) => { + return post('nakadai/partnerAccount/generateInvitationCode', data) +} + +export const generationQrCode = (data) => { + return get('nakadai/partnerAccount/generationQrCode ', data) } \ No newline at end of file diff --git a/apis/request.js b/apis/request.js index 0849b32..01d9e70 100644 --- a/apis/request.js +++ b/apis/request.js @@ -13,19 +13,31 @@ const request = options => { } const header = Object.assign({}, config.headers, { // token: uni.getStorageSync('token') - token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjU0NDg1NjgzLCJleHAiOjE2NTQ1Mjg4ODMsImFjY291bnRJZCI6IjQ1MiJ9.rsgoTtE1l0ooK7TBTQjC8Xd1nKGYTfoQrM8BDZqODGU' + token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjU0NTY5OTA1LCJleHAiOjE2NTQ2MTMxMDUsImFjY291bnRJZCI6IjQ1MiJ9.IwVDQSpfYctr3ScaBiwXApNiSFjfwVbivt_uLCEPiW0' }) return new Promise((resolve, reject)=>{ const { url } = options uni.request({ header, - url: ((url.includes('weChatAppletCallback') || url.includes('userBinding')) ? 'http://192.168.31.151:9000/' : config.baseURL) + url, + url: ((url.includes('teamList')) ? 'http://192.168.31.137:9000/' : config.baseURL) + url, method: options.method || 'GET', // 请求类型,默认为GET data: options.data || {}, // 请求参数,默认空对象 success: ({ data }) => { // 状态判断,根据后台定义并提示 if (data.status === 200) { resolve(data) + } else if (data.status == 401) { + // 登录过期 + uni.showToast({ + title: data.message, + icon: 'none' + }) + setTimeout(() => { + uni.navigateTo({ + url: '../login/login' + }) + }, 1500) + reject(data) } else { uni.showToast({ title: data.message, diff --git a/libs/util.js b/libs/util.js index 02e05f6..0889fb9 100644 --- a/libs/util.js +++ b/libs/util.js @@ -46,10 +46,10 @@ export default { }, // 获取商务经理id getBmId(val) { - return uni.getStorageSync('partnerId') + return uni.getStorageSync('team').partnerId }, // 获取商务经理名称 getBmName(val) { - return uni.getStorageSync('partnerClassificationName') + return uni.getStorageSync('team').partnerClassificationName }, } \ No newline at end of file diff --git a/pages.json b/pages.json index f14e044..aee1f88 100644 --- a/pages.json +++ b/pages.json @@ -1,18 +1,26 @@ { "pages": [ { - "path" : "pages/main/main", + "path" : "pages/login/login", "style" : { - "navigationBarTitleText": "", + "navigationBarTitleText": "登录", "enablePullDownRefresh": false } }, { - "path" : "pages/login/login", + "path" : "pages/invite/invite", "style" : { - "navigationBarTitleText": "登录", + "navigationBarTitleText": "加入团队", + "enablePullDownRefresh": false + } + }, + { + "path" : "pages/index/index", + "style" : + { + "navigationBarTitleText": "", "enablePullDownRefresh": false } }, @@ -64,14 +72,6 @@ "enablePullDownRefresh": false } }, - { - "path" : "pages/invite/invite", - "style" : - { - "navigationBarTitleText": "加入团队", - "enablePullDownRefresh": false - } - }, { "path" : "pages/addStaff/addStaff", "style" : @@ -182,10 +182,8 @@ "selectedColor": "#007FFF", "borderStyle": "white", "backgroundColor": "#ffffff", - "height": "100px", - "spacing": "10px", "list": [{ - "pagePath": "pages/main/main", + "pagePath": "pages/index/index", "iconPath": "static/image/tab1.png", "selectedIconPath": "static/image/tab1-1.png", "text": "首页" diff --git a/pages/addCourse/addCourse.vue b/pages/addCourse/addCourse.vue index 7d1bd75..c18a9a8 100644 --- a/pages/addCourse/addCourse.vue +++ b/pages/addCourse/addCourse.vue @@ -211,13 +211,13 @@ const { customerId } = this list.map(e => { // 新勾选的产品,则获取到id,下面要调用, - if (!result.find(n => n.dataOrCourseId == e.id)) { + if (!result.find(n => n.dataOrCourseId == e.id && n.authority == e.authority)) { e.productType === 2 ? dataIds.push(e.id) : courseIds.push(e.id) result.push(this.createParam(e)) } }) - const promises = [] + // 课程和数据的分别调接口 dataIds.length && promises.push(new Promise((resolve, reject) => { this.handleRenew(0, customerId, dataIds, result, resolve, reject) })) diff --git a/pages/addStaff/addStaff.vue b/pages/addStaff/addStaff.vue index e63c6c3..7efc6c2 100644 --- a/pages/addStaff/addStaff.vue +++ b/pages/addStaff/addStaff.vue @@ -5,7 +5,7 @@