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 @@
  • - {{ item.curriculumName }} + {{ item.productName }}
  • + @@ -24,7 +25,7 @@ - - diff --git a/pages/agreement/agreement.vue b/pages/agreement/agreement.vue new file mode 100644 index 0000000..8de3cfe --- /dev/null +++ b/pages/agreement/agreement.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/pages/clients/clients.vue b/pages/clients/clients.vue index d7e4d2e..cbc8c7b 100644 --- a/pages/clients/clients.vue +++ b/pages/clients/clients.vue @@ -16,13 +16,13 @@ {{ item.customerName }} - 联系人:海文 - 账号:海文 - 产品到期时间:海文 - 商务经理:海文 + 联系人:{{ item.orderContact }} + 账号:{{ item.account }} + 产品到期时间:{{ item.expireDate.replace(' 00:00:00', '') }} + 商务经理:{{ item.account }} - 试用客户 + {{ menuList[0].detailList.find(e => e.value === item.customerType).title }}客户 @@ -33,7 +33,7 @@ @@ -83,6 +154,7 @@ .phone { color: #007EFF; border: 1px solid #007EFF; + background-color: #fff; image { width: 40rpx; } @@ -106,6 +178,9 @@ .checklist-box { margin: 0; } + .checkbox__inner { + border-radius: 50% !important; + } } } diff --git a/pages/orderDetail/orderDetail.vue b/pages/orderDetail/orderDetail.vue index b977e44..357179f 100644 --- a/pages/orderDetail/orderDetail.vue +++ b/pages/orderDetail/orderDetail.vue @@ -52,11 +52,11 @@ - - 实训课程产品 + + {{ c.name }}
      -
    • +
    • @@ -162,6 +162,7 @@ customerName: '', businessManager: '' }, + courseList: [], courses: [], // 缓存的产品列表 purchase: 0, profit: 0, @@ -191,6 +192,7 @@ this.getInfo() } else if (store) { // 新增取缓存,取了删除 + this.handleProduct(store) this.courses = store try { uni.removeStorageSync('courses') @@ -221,8 +223,41 @@ this.contract = order.contractInformation this.form = order.order this.courses = order.orderOther + this.handleProduct(order.orderOther) + this.calcTotal() }).catch(e => {}) }, + // 转换产品列表 + handleProduct(list) { + const courses = { + practice: { + name: '实训课程产品', + list: [] + }, + theory: { + name: '理论课程产品', + list: [] + }, + data: { + name: '数据产品', + list: [] + } + } + // 3个分类的课程分别push到不同数组(0->理论 1-实训 2 数据产品) + list.map(e => { + const type = e.productType + !type ? + courses.theory.list.push(e) : + type === 1 ? + courses.practice.list.push(e) : + courses.data.list.push(e) + }) + // 没有数据的课程,直接删除 + courses.practice.list.length || delete courses.practice + courses.theory.list.length || delete courses.theory + courses.data.list.length || delete courses.data + this.courseList = courses + }, // 获取客户列表 getCustomer() { queryCustomer({ diff --git a/pages/products/products.vue b/pages/products/products.vue index 3e2bf99..7965517 100644 --- a/pages/products/products.vue +++ b/pages/products/products.vue @@ -14,6 +14,7 @@
      • + {{ item.productName }} @@ -46,7 +47,7 @@