From d5146fab7721edba262dd29e92c967c7c7c5965e Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Fri, 12 Jul 2024 17:53:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=EF=BC=9A=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E9=BB=98=E8=AE=A41=E6=9C=88=EF=BC=8C=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=9C=9F=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/request.js | 6 +- order/addCourse/addCourse.vue | 5 +- order/clientDetail/clientDetail.vue | 8 +- order/editCourse/editCourse.vue | 196 +++++++++++++++++----------- order/orderDetail/orderDetail.vue | 195 +++++++++++++++++---------- 5 files changed, 260 insertions(+), 150 deletions(-) diff --git a/apis/request.js b/apis/request.js index 9673157..4ea0553 100644 --- a/apis/request.js +++ b/apis/request.js @@ -15,16 +15,16 @@ const request = options => { method: options.method || 'GET', // 请求类型,默认为GET data: options.data || {}, // 请求参数,默认空对象 success: ({ data }) => { - const { status, message } = data + const { status, message, code } = data // 状态判断,根据后台定义并提示 if (status === 200) { resolve(data) - } else if (status == 401) { + } else if (status == 401 || code === 401) { if (!logouted) { // 登录过期 uni.clearStorageSync() uni.showToast({ - title: message, + title: message || '登录过期,请重新登录', icon: 'none' }) setTimeout(() => { diff --git a/order/addCourse/addCourse.vue b/order/addCourse/addCourse.vue index 3fb5ba2..9b03c23 100644 --- a/order/addCourse/addCourse.vue +++ b/order/addCourse/addCourse.vue @@ -213,7 +213,7 @@ dataOrCourseId: e.associatedProduct, // id mallId: e.mallId, productName: e.productName, // 名称 - periodOfUse: '', // 使用期限 + periodOfUse: trial ? 1 : '', // 使用期限 startTime: this.$util.formatDate(new Date(), 'yyyy-MM-dd'), // 开始 endTime: '', // 终止 remainingPeriod: '', // 剩余期限 @@ -227,7 +227,7 @@ isEnable: 0, // 启用否:1启用,0禁用 ship: 0, // 发货否(0未发货,1已发货,默认不发货) authority, // 区分权限 0为数据平台权限,1为课程权限 - options: 2, + options: trial ? 1 : 2, miniProgramPictureAddress: e.appletIcon || '', // 图标 settlementPrice: trial ? 0 : '', // 结算价 settlementPriceUnit: e.settlementPrice || 0, // 结算单价 @@ -321,6 +321,7 @@ this.handleRenew(4, customerId, list4, result, resolve, reject) })) Promise.all(promises).then(_ => { + console.log(33, result) uni.setStorageSync('courses', result) // 把选中的产品添加至缓存 uni.redirectTo({ url: `../editCourse/editCourse?customerId=${customerId}&orderType=${this.orderType}` diff --git a/order/clientDetail/clientDetail.vue b/order/clientDetail/clientDetail.vue index 8098b8e..bfc7ace 100644 --- a/order/clientDetail/clientDetail.vue +++ b/order/clientDetail/clientDetail.vue @@ -133,9 +133,9 @@ form: { countries: '中国', customerId: '', - customerName: '', - industryClassId: '', - industryId: '', + customerName: '', + industryClassId: 16, + industryId: 83, provinceId: '', provinceName: '', account: '', @@ -169,7 +169,7 @@ this.shopCart = options.shopCart // 从购物车进去订单的标识 this.fromOrder = options.order // 从创建订单页面跳转进来 - options.customerId && this.getInfo() + options.customerId ? this.getInfo() : this.getIndustry() // 非详情才需要查询学校和行业 if (!this.isDetail) { this.getSchool() diff --git a/order/editCourse/editCourse.vue b/order/editCourse/editCourse.vue index 4a13e0a..feda620 100644 --- a/order/editCourse/editCourse.vue +++ b/order/editCourse/editCourse.vue @@ -2,8 +2,15 @@