From c28867f2d08096abc4aa3b05e403f3ae823ad1fa Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 30 May 2022 18:15:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E3=80=81=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/modules/client.js | 4 ++ apis/modules/{course.js => product.js} | 4 -- apis/modules/user.js | 6 ++ apis/request.js | 5 +- libs/WXBizDataCrypt.js | 35 +++++++++ pages.json | 57 +++++++-------- pages/addCourse/addCourse.vue | 64 ++++++++++++----- pages/addMember/addMember.vue | 62 ---------------- pages/agreement/agreement.vue | 45 ++++++++++++ pages/clients/clients.vue | 32 ++++----- pages/login/login.vue | 95 ++++++++++++++++++++++--- pages/orderDetail/orderDetail.vue | 41 ++++++++++- pages/products/products.vue | 3 +- static/image/index/index1.png | Bin 117777 -> 44947 bytes static/image/index/index2.png | Bin 119620 -> 85765 bytes static/image/index/index3.png | Bin 1745 -> 1178 bytes static/image/index/index4.png | Bin 1575 -> 975 bytes static/image/index/index5.png | Bin 354 -> 327 bytes static/image/index/index6.png | Bin 1577 -> 842 bytes static/image/index/index7.png | Bin 466 -> 335 bytes 20 files changed, 308 insertions(+), 145 deletions(-) rename apis/modules/{course.js => product.js} (63%) create mode 100644 apis/modules/user.js create mode 100644 libs/WXBizDataCrypt.js delete mode 100644 pages/addMember/addMember.vue create mode 100644 pages/agreement/agreement.vue diff --git a/apis/modules/client.js b/apis/modules/client.js index b32cfbd..3cdef8d 100644 --- a/apis/modules/client.js +++ b/apis/modules/client.js @@ -5,6 +5,10 @@ export const queryCustomer = (data) => { return post('nakadai/nakadai/customer/queryCustomer', data) } +export const list = (data) => { + return post('nakadai/nakadai/customer/GetCustomerListBasedOnBusinessManagerId', data) +} + export const queryCustomerDetails = (data) => { return get('nakadai/nakadai/customer/queryCustomerDetails', data) } diff --git a/apis/modules/course.js b/apis/modules/product.js similarity index 63% rename from apis/modules/course.js rename to apis/modules/product.js index 273137a..739f421 100644 --- a/apis/modules/course.js +++ b/apis/modules/product.js @@ -1,10 +1,6 @@ import request from '@/apis/request.js' const { get, post } = request -export const curriculumList = (data) => { - return post('nakadai/nakadai/curriculum/curriculumList', data) -} - export const AppletsDataProductList = (data) => { return post('nakadai/nakadai/dataProduct/AppletsDataProductList', data) } \ No newline at end of file diff --git a/apis/modules/user.js b/apis/modules/user.js new file mode 100644 index 0000000..d572a8d --- /dev/null +++ b/apis/modules/user.js @@ -0,0 +1,6 @@ +import request from '@/apis/request.js' +const { get, post } = request + +export const login = (data) => { + return get('users/users/user/weChatAppletCallback', data) +} \ No newline at end of file diff --git a/apis/request.js b/apis/request.js index 368e32d..d513239 100644 --- a/apis/request.js +++ b/apis/request.js @@ -12,12 +12,13 @@ const request = options => { }) } const header = Object.assign({}, config.headers, { - token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjUzNjE3NjI4LCJleHAiOjE2NTM2NjA4MjgsImFjY291bnRJZCI6IjEifQ.AmvmMxWkRD4f8J4oWHoRvm1CCrzBm7TH2QDG4E175_s' + token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjUzODc2NDczLCJleHAiOjE2NTM5MTk2NzMsImFjY291bnRJZCI6IjEifQ.sX2qEUJk_EzltbrLOos_ZFuyj_5OrXFhvq_qahbIfmc' }) return new Promise((resolve, reject)=>{ + const { url } = options uni.request({ header, - url: config.baseURL + options.url, + url: (url.includes('weChatAppletCallback') ? 'http://192.168.31.137:9000/' : config.baseURL) + url, method: options.method || 'GET', // 请求类型,默认为GET data: options.data || {}, // 请求参数,默认空对象 success: ({ data }) => { diff --git a/libs/WXBizDataCrypt.js b/libs/WXBizDataCrypt.js new file mode 100644 index 0000000..36b3de1 --- /dev/null +++ b/libs/WXBizDataCrypt.js @@ -0,0 +1,35 @@ +var crypto = require('crypto') + +function WXBizDataCrypt(appId, sessionKey) { + this.appId = appId + this.sessionKey = sessionKey +} + +WXBizDataCrypt.prototype.decryptData = function (encryptedData, iv) { + // base64 decode + var sessionKey = new Buffer(this.sessionKey, 'base64') + encryptedData = new Buffer(encryptedData, 'base64') + iv = new Buffer(iv, 'base64') + + try { + // 解密 + var decipher = crypto.createDecipheriv('aes-128-cbc', sessionKey, iv) + // 设置自动 padding 为 true,删除填充补位 + decipher.setAutoPadding(true) + var decoded = decipher.update(encryptedData, 'binary', 'utf8') + decoded += decipher.final('utf8') + + decoded = JSON.parse(decoded) + + } catch (err) { + throw new Error('Illegal Buffer') + } + + if (decoded.watermark.appid !== this.appId) { + throw new Error('Illegal Buffer') + } + + return decoded +} + +module.exports = WXBizDataCrypt \ No newline at end of file diff --git a/pages.json b/pages.json index d16266b..daa5377 100644 --- a/pages.json +++ b/pages.json @@ -1,11 +1,19 @@ { "pages": [ + { + "path" : "pages/login/login", + "style" : + { + "navigationBarTitleText": "登录", + "enablePullDownRefresh": false + } + }, { "path" : "pages/orders/orders", "style" : { "navigationBarTitleText": "订单列表", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { @@ -24,20 +32,12 @@ "enablePullDownRefresh": true } }, - { - "path" : "pages/clientDetail/clientDetail", - "style" : - { - "navigationBarTitleText": "客户详情", - "enablePullDownRefresh": false - } - }, { - "path" : "pages/orderDetail/orderDetail", + "path" : "pages/addCourse/addCourse", "style" : { - "navigationBarTitleText": "订单详情", - "enablePullDownRefresh": false + "navigationBarTitleText": "选择产品", + "enablePullDownRefresh": true } }, { @@ -46,11 +46,19 @@ "navigationBarTitleText": "首页" } }, + { + "path" : "pages/clientDetail/clientDetail", + "style" : + { + "navigationBarTitleText": "客户详情", + "enablePullDownRefresh": false + } + }, { - "path" : "pages/login/login", + "path" : "pages/orderDetail/orderDetail", "style" : { - "navigationBarTitleText": "登录", + "navigationBarTitleText": "订单详情", "enablePullDownRefresh": false } }, @@ -62,14 +70,6 @@ "enablePullDownRefresh": false } }, - { - "path" : "pages/addMember/addMember", - "style" : - { - "navigationBarTitleText": "添加成员", - "enablePullDownRefresh": false - } - }, { "path" : "pages/addStaff/addStaff", "style" : @@ -149,22 +149,23 @@ "navigationBarTitleText": "详情", "enablePullDownRefresh": false } - } - ,{ - "path" : "pages/addCourse/addCourse", + }, + { + "path" : "pages/editCourse/editCourse", "style" : { - "navigationBarTitleText": "选择产品", + "navigationBarTitleText": "编辑产品", "enablePullDownRefresh": false } } ,{ - "path" : "pages/editCourse/editCourse", + "path" : "pages/agreement/agreement", "style" : { - "navigationBarTitleText": "编辑产品", + "navigationBarTitleText": "", "enablePullDownRefresh": false } + } ], "condition": { //模式配置,仅开发期间生效 diff --git a/pages/addCourse/addCourse.vue b/pages/addCourse/addCourse.vue index 953df50..3d4f4d2 100644 --- a/pages/addCourse/addCourse.vue +++ b/pages/addCourse/addCourse.vue @@ -12,9 +12,10 @@