diff --git a/apis/modules/order.js b/apis/modules/order.js index ee4b22f..1016137 100644 --- a/apis/modules/order.js +++ b/apis/modules/order.js @@ -25,6 +25,10 @@ export const list = (data) => { return post('nakadai/applets/order/getOrderBasedOnBusinessManagerId', data) } +export const all = (data) => { + return post('nakadai/applets/order/allTeamOrders', 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 5f6581e..bf2f122 100644 --- a/apis/modules/parner.js +++ b/apis/modules/parner.js @@ -6,13 +6,9 @@ export const savePartnerAccount = (data) => { } export const teamList = (data) => { - return get('nakadai/partner-team/teamList', data) + return post('nakadai/partnerAccount/partnerAccountList', data) } -export const generateInvitationCode = (data) => { - return post('nakadai/partnerAccount/generateInvitationCode', data) -} - -export const generationQrCode = (data) => { - return get('nakadai/partnerAccount/generationQrCode ', data) +export const generateInvitationCode = accountId => { + return post(`nakadai/partnerAccount/generateInvitationCode?accountId=${accountId}`) } \ No newline at end of file diff --git a/apis/request.js b/apis/request.js index 01d9e70..ea73144 100644 --- a/apis/request.js +++ b/apis/request.js @@ -12,8 +12,8 @@ const request = options => { }) } const header = Object.assign({}, config.headers, { - // token: uni.getStorageSync('token') - token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjU0NTY5OTA1LCJleHAiOjE2NTQ2MTMxMDUsImFjY291bnRJZCI6IjQ1MiJ9.IwVDQSpfYctr3ScaBiwXApNiSFjfwVbivt_uLCEPiW0' + token: uni.getStorageSync('token') + // token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjU0NTY5OTA1LCJleHAiOjE2NTQ2MTMxMDUsImFjY291bnRJZCI6IjQ1MiJ9.IwVDQSpfYctr3ScaBiwXApNiSFjfwVbivt_uLCEPiW0' }) return new Promise((resolve, reject)=>{ const { url } = options @@ -23,13 +23,18 @@ const request = options => { method: options.method || 'GET', // 请求类型,默认为GET data: options.data || {}, // 请求参数,默认空对象 success: ({ data }) => { + const { status, message } = data // 状态判断,根据后台定义并提示 - if (data.status === 200) { + if (status === 200) { resolve(data) - } else if (data.status == 401) { + } else if (status == 401) { // 登录过期 + uni.removeStorageSync('token') + uni.removeStorageSync('userName') + uni.removeStorageSync('avatar') + uni.removeStorageSync('sessionKey') uni.showToast({ - title: data.message, + title: message, icon: 'none' }) setTimeout(() => { @@ -38,9 +43,11 @@ const request = options => { }) }, 1500) reject(data) + } else if (!status) { + resolve(data) } else { uni.showToast({ - title: data.message, + title: message, icon: 'none' }) reject(data) diff --git a/config/request.js b/config/request.js index 24cd55b..c3aa89f 100644 --- a/config/request.js +++ b/config/request.js @@ -5,7 +5,7 @@ */ export default { - baseURL: 'http://192.168.31.151:9000/', + baseURL: 'http://192.168.31.137:9000/', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, diff --git a/libs/util.js b/libs/util.js index 0889fb9..82c5a0e 100644 --- a/libs/util.js +++ b/libs/util.js @@ -22,6 +22,10 @@ export default { handleNaN(val) { return isNaN(val) ? 0 : val }, + // 小于10,返回0+传入值 + preZero(val) { + return val < 10 ? '0' + val : val + }, //返回格式化时间,传参例如:"yyyy-MM-dd hh:mm:ss" formatDate(date, fmt = 'yyyy-MM-dd hh:mm:ss') { var date = date ? date : new Date() diff --git a/pages.json b/pages.json index aee1f88..95f57d5 100644 --- a/pages.json +++ b/pages.json @@ -9,18 +9,26 @@ } }, { - "path" : "pages/invite/invite", + "path" : "pages/index/index", "style" : { - "navigationBarTitleText": "加入团队", + "navigationBarTitleText": "", "enablePullDownRefresh": false } }, { - "path" : "pages/index/index", + "path" : "pages/qrcode/qrcode", "style" : { - "navigationBarTitleText": "", + "navigationBarTitleText": "邀请加入", + "enablePullDownRefresh": false + } + }, + { + "path" : "pages/invite/invite", + "style" : + { + "navigationBarTitleText": "加入团队", "enablePullDownRefresh": false } }, @@ -96,14 +104,6 @@ "enablePullDownRefresh": false } }, - { - "path" : "pages/qrcode/qrcode", - "style" : - { - "navigationBarTitleText": "邀请加入", - "enablePullDownRefresh": false - } - }, { "path" : "pages/send/send", "style" : @@ -133,7 +133,7 @@ "style" : { "navigationBarTitleText": "团队", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/addStaff/addStaff.vue b/pages/addStaff/addStaff.vue index 7efc6c2..c45aee5 100644 --- a/pages/addStaff/addStaff.vue +++ b/pages/addStaff/addStaff.vue @@ -2,7 +2,7 @@ - +