From c28ca6567afa95953c5174efcc70e11da9f5dc5c Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Sat, 26 Apr 2025 00:54:38 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(=E8=AE=A2=E5=8D=95):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=AE=A2=E5=8D=95=E5=8F=96=E6=B6=88=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E4=BB=BB=E5=8A=A1=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在订单模块中新增 `orderCancel` API,用于处理订单取消请求 - 优化任务模块,包括任务列表、任务详情和任务上传功能 - 修复任务详情页面中的状态显示逻辑 - 重构任务上传页面的表单验证和文件上传功能 --- api/order/order.js | 12 + api/order/task.js | 41 ++- pages/companionPetList/companionPetInfo.vue | 34 +-- pages/personalCenter/index.vue | 2 +- pages_order/components/order/CancelOrderPopup.vue | 10 +- pages_order/order/orderList.vue | 4 +- pages_order/order/orderReview.vue | 16 +- pages_order/task/AppletTask.java | 77 +++++ pages_order/task/taskDetail.vue | 153 ++++------ pages_order/task/taskList.vue | 239 +++------------ pages_order/task/taskUpload.vue | 354 ++++++++++++++-------- 11 files changed, 486 insertions(+), 456 deletions(-) create mode 100644 pages_order/task/AppletTask.java diff --git a/api/order/order.js b/api/order/order.js index d135c37..94b5829 100644 --- a/api/order/order.js +++ b/api/order/order.js @@ -107,5 +107,17 @@ export const orderEvaluate = (params) => { }) } +// 取消订单 +export const orderCancel = (data) => { + return request({ + url: '/applet/mall/order/orderCancel',///applet/mall/order/orderCancel + headers: { + isToken: true + }, + method: "POST", + data + }) +} + diff --git a/api/order/task.js b/api/order/task.js index f515578..313a0e7 100644 --- a/api/order/task.js +++ b/api/order/task.js @@ -1,14 +1,49 @@ import upload from '@/utils/upload' import request from '@/utils/request' -// 查询伴宠师列表 -export function getTeacherList(params) { +// 查询任务列表 +export function getTaskList(params) { return request({ - url: '/applet/mall/teacher/getTeacherList', + url: '/applet/mall/task/list', headers: { "isToken": true }, method: 'get', params }) +} + +// 查询任务详情 +export function getTaskDetail(params) { + return request({ + url: '/applet/mall/task/taskDetail/' + params, + headers: { + "isToken": true + }, + method: 'get', + }) +} + +// 接受任务 +export function acceptTask(params) { + return request({ + url: '/applet/mall/task/acceptTask', + headers: { + "isToken": true + }, + method: 'get', + params + }) +} + +// 提交任务 +export function submitTask(data) { + return request({ + url: '/applet/mall/task/submitTask', + headers: { + "isToken": true + }, + method: 'post', + data + }) } \ No newline at end of file diff --git a/pages/companionPetList/companionPetInfo.vue b/pages/companionPetList/companionPetInfo.vue index dc2a520..c9fe021 100644 --- a/pages/companionPetList/companionPetInfo.vue +++ b/pages/companionPetList/companionPetInfo.vue @@ -108,7 +108,7 @@ + src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/petServiceOrder/CMDFServiceDetail.png" /> + @click="$refs.cancelOrderPopup.open(order)"> 取消订单 @@ -210,7 +210,7 @@ }, handleCancelOrder() { - + this.refresh() }, // 加载更多 diff --git a/pages_order/order/orderReview.vue b/pages_order/order/orderReview.vue index 566ccc2..f35191c 100644 --- a/pages_order/order/orderReview.vue +++ b/pages_order/order/orderReview.vue @@ -4,11 +4,11 @@ - + - {{companion.name || '伴宠师'}} + {{companion.userName || '伴宠师'}} {{companion.level === 'junior' ? '初级伴宠师' : '高级伴宠师'}} @@ -96,18 +96,12 @@ // 调用获取伴宠师详情的API const params = { openId: getOpenIdKey(), - teacherId: this.teacherId + userId: this.teacherId }; getTeacherDetail(params).then(res => { - if (res && res.code === 200) { - const teacherData = res.data; - this.companion = { - name: teacherData.name || '伴宠师', - avatar: teacherData.avatar || '/static/images/personal/pet.png', - level: teacherData.level || 'junior', - gender: teacherData.gender || '女生' - }; + if (res) { + this.companion = res } else { // 如果获取失败,使用默认数据 this.companion = { diff --git a/pages_order/task/AppletTask.java b/pages_order/task/AppletTask.java new file mode 100644 index 0000000..d320f4d --- /dev/null +++ b/pages_order/task/AppletTask.java @@ -0,0 +1,77 @@ +package com.ruoyi.model.domain; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseAudit; +import lombok.Data; +/** + * 任务中心对象 applet_task + * + * @author daixiande + */ +@Data +public class AppletTask extends BaseAudit { + private static final long serialVersionUID = 1L; + + /** 标识 */ + private Long id; + + /** 当前状态0待接受1以接受 */ + @Excel(name = "当前状态0待接受1以接受") + private Integer status; + + /** 下单用户标识 */ + @Excel(name = "下单用户标识") + private Long memberId; + + /** 任务类型名称 */ + @Excel(name = "任务类型名称") + private String taskName; + + /** 任务小图 */ + @Excel(name = "任务小图") + private String taskIcon; + + /** 任务报酬 */ + @Excel(name = "任务报酬") + private BigDecimal taskMoney; + + /** 图片 */ + @Excel(name = "图片") + private String image; + + /** 标题 */ + @Excel(name = "标题") + private String title; + + /** 主题 */ + @Excel(name = "主题") + private String theme; + + /** 任务截至时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "任务截至时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime taskEndTime; + + /** 任务进度 */ + @Excel(name = "任务进度") + private Integer taskState; + + /** 审核状态 */ + @Excel(name = "审核状态") + private Integer examineState; + + /** 审核说明 */ + @Excel(name = "审核说明") + private String examineText; + + /** 审核图片 */ + @Excel(name = "审核图片") + private String examineImage; + + /** DEL_FLAG */ + private Long delFlag; + +} diff --git a/pages_order/task/taskDetail.vue b/pages_order/task/taskDetail.vue index 297abf4..8a869c1 100644 --- a/pages_order/task/taskDetail.vue +++ b/pages_order/task/taskDetail.vue @@ -3,7 +3,7 @@ {{taskInfo.title}} - 请于{{taskInfo.deadline}}之前上传任务,超时将自动取消 + 请于{{taskInfo.taskEndTime ? formatDate(taskInfo.taskEndTime) : ''}}之前上传任务,超时将自动取消 @@ -15,69 +15,29 @@ - - 悬赏任务说明 + + {{taskInfo.taskName || '任务说明'}} - 请以"{{taskInfo.description}}"为主题编辑小红书宣传笔记~ + {{taskInfo.theme || '暂无任务说明'}} - - 封面和配图要求 - - 封面: 个人宠物图片 - 配图: 个人宠物图片或小程序页面截图(共2-3张) - - - - - 标题示例 (实际发布可以参照以下) - - - H1 - 春节回家猫咪/狗狗怎么办? - - - H2 - 今年过年不用担心宠物没人照顾啦~ - - - H3 - 关于宠物喂养平台的真实体验; - - - H4 - 出门旅游,再也不用担心宠物啦! - - - - - - 其他要求 + + + 驳回原因 - - 文案内容不少于400字; - - - - 提及关键词上门猫咪/上门狗狗/上门喂养; - - - - 提及猫狗宠物平台并适当好评; - - - - 评论区@猫狗宠物官方账号; + ! + {{taskInfo.examineText || '未提供驳回原因'}} - - 注意是评论区!请务必在正文@官方账号! + + + @@ -85,7 +45,7 @@ 取消 - 重新上传 + {{taskInfo.examineState === 2 ? '重新上传' : '立即上传'}} @@ -93,18 +53,22 @@ @@ -859,12 +980,10 @@ .home-content { position: relative; - // background: linear-gradient(360deg, #F5F5F7 0%, #FFBF60 99%); .swiper { height: calc(100vw * 1098/1125); - // background-image: linear-gradient(180deg, #FFBF60 0%, #FFBF60 90%, #ffffff 99.41%); } .banner { @@ -879,15 +998,9 @@ .float-button { position: fixed; bottom: 150px; - /* 距离底部的距离 */ right: 10px; - /* 距离右侧的距离 */ width: 50px; - /* 按钮的宽度 */ height: 50px; - - /* 按钮的高度 */ - /* 其他样式 */ .kf-btn { background-color: rgba(255, 255, 255, 1); height: 52px; @@ -944,17 +1057,7 @@ align-items: center; width: 100%; padding: 10px 0; - // background: #fff; - // background: #f6f5f8; - // border: 1px solid #FFBF60; border-radius: 8px 8px 0 0; - // -webkit-mask-image: radial-gradient(circle at 88px 4px, transparent 4px, #d8d8d8 4.5px), radial-gradient(closest-side circle at 50%, #d8d8d8 99%, transparent 100%); - // -webkit-mask-size: 100%, 2px 4px; - // -webkit-mask-repeat: repeat, repeat-y; - // -webkit-mask-position: 0 -4px, 87px; - // -webkit-mask-composite: source-out; - // mask-composite: subtract; - // background: linear-gradient(45deg, orange, red); } .card-bottom { @@ -984,7 +1087,6 @@ .card-center { display: flex; flex-direction: column; - // align-items: center; .card-center-top { width: 40rpx; @@ -1011,7 +1113,6 @@ padding: 0 16rpx 0 0; display: flex; flex: 1; - /* flex-direction: column; */ justify-content: space-between; align-items: center; height: 60px; @@ -1026,42 +1127,6 @@ top: -10px; } } - - .card-info { - margin: 0; - font-size: 28rpx; - line-height: 28rpx; - color: #333333; - font-weight: 500; - } - - .card-type { - font-size: 24rpx; - font-weight: 400; - line-height: 24rpx; - font-weight: 400; - color: #AAAAAA; - margin-top: 10rpx; - - .card-type-text { - color: #FFAA48; - font-size: 24rpx; - font-weight: 400; - line-height: 24rpx; - border: #FFAA48 1px solid; - border-radius: 7rpx; - margin-left: 8rpx; - } - } - - .card-time { - font-size: 24rpx; - font-weight: 400; - line-height: 24rpx; - font-weight: 400; - color: #AAAAAA; - margin-top: 10rpx; - } } } @@ -1138,7 +1203,6 @@ .companion-name { color: #333; font-size: 32rpx; - // line-height: 32rpx; margin-right: 10rpx; font-weight: 900; font-style: normal; @@ -1354,7 +1418,6 @@ } } - /* #ifndef APP-NVUE */ page { display: flex; flex-direction: column; @@ -1364,8 +1427,6 @@ height: auto; } - /* #endif */ - .text { text-align: center; font-size: 26rpx; @@ -1400,9 +1461,7 @@ } .swiper-item { - /* #ifndef APP-NVUE */ display: flex; - /* #endif */ flex-direction: column; justify-content: center; align-items: center; @@ -1426,7 +1485,6 @@ } .service-content-img { - // height: 208px; padding: 5px; margin-top: 5px; border-radius: 8px; @@ -1479,7 +1537,6 @@ font-size: 10px; font-style: normal; line-height: 14px; - /* 140% */ position: absolute; top: 15px; left: 0; @@ -1531,11 +1588,8 @@ .text-wrapper { position: absolute; bottom: 83px; - /* 根据需要调整文字距离图片底部的距离 */ left: 10px; - /* 根据需要调整文字距离图片左边的距离 */ color: #fff; - /* 根据需要调整文字颜色 */ font-size: 10px; font-weight: blod; font-family: PingFang SC; @@ -1632,9 +1686,7 @@ @media screen and (min-width: 500px) { .uni-swiper-dot-box { width: 400px; - /* #ifndef APP-NVUE */ margin: 0 auto; - /* #endif */ margin-top: 8px; } @@ -1642,4 +1694,54 @@ width: 100%; } } + + /* 优惠券规则弹窗样式 */ + .rule-popup { + width: 600rpx; + background-color: #FFFFFF; + border-radius: 16rpx; + overflow: hidden; + } + + .rule-popup-title { + height: 100rpx; + line-height: 100rpx; + text-align: center; + font-size: 32rpx; + font-weight: 600; + color: #FFFFFF; + background-color: #FFAA48; + } + + .rule-popup-content { + padding: 30rpx; + } + + .rule-item { + display: flex; + margin-bottom: 20rpx; + } + + .rule-label { + width: 140rpx; + font-size: 28rpx; + color: #666666; + flex-shrink: 0; + } + + .rule-value { + flex: 1; + font-size: 28rpx; + color: #333333; + line-height: 40rpx; + } + + .rule-popup-close { + height: 90rpx; + line-height: 90rpx; + text-align: center; + font-size: 30rpx; + color: #FFAA48; + border-top: 1px solid #EEEEEE; + } \ No newline at end of file diff --git a/pages/newOrder/confirmOrder.vue b/pages/newOrder/confirmOrder.vue index 5aca76c..a766ccc 100644 --- a/pages/newOrder/confirmOrder.vue +++ b/pages/newOrder/confirmOrder.vue @@ -683,6 +683,8 @@ if(this.buyInfo.teacher){ order.teacherId = this.buyInfo.teacher.userId }else{ + //打印 + console.log(this.$globalData.newOrderData.companionLevel); order.companionLevel = ['', 'junior', 'senior'].indexOf(this.$globalData.newOrderData.companionLevel) } diff --git a/pages/newOrder/serviceNew.vue b/pages/newOrder/serviceNew.vue index 0c47ce8..42d0c71 100644 --- a/pages/newOrder/serviceNew.vue +++ b/pages/newOrder/serviceNew.vue @@ -244,7 +244,9 @@ // 初始化伴宠师等级 if(this.$globalData.newOrderData.companionLevel) { this.companionLevel = this.$globalData.newOrderData.companionLevel - } + }else{ + this.$globalData.newOrderData.companionLevel = this.companionLevel + } }, methods:{ selectAddress(){ diff --git a/pages_order/order/orderDetail.vue b/pages_order/order/orderDetail.vue index 44c25d6..15c5f40 100644 --- a/pages_order/order/orderDetail.vue +++ b/pages_order/order/orderDetail.vue @@ -28,6 +28,9 @@ 去付款 + 评价订单 @@ -208,6 +211,14 @@ // 处理取消订单 handleCancelOrder() { // 待实现取消订单逻辑 + }, + + // 修改订单 + modifyOrder() { + // 跳转到服务选择页面,并传递订单ID参数 + uni.navigateTo({ + url: `/pages_order/order/orderModify?orderId=${this.orderId}` + }); } } } @@ -252,6 +263,11 @@ color: #FFFFFF; } + .modify-btn { + background-color: #FFAA48; + color: #FFFFFF; + } + .review-btn { background-color: #FFAA48; color: #FFFFFF; diff --git a/pages_order/order/orderList.vue b/pages_order/order/orderList.vue index a61237b..e1b4774 100644 --- a/pages_order/order/orderList.vue +++ b/pages_order/order/orderList.vue @@ -69,6 +69,9 @@ 去付款 + 去评价 @@ -311,6 +314,13 @@ this.currentOrder = order; this.$refs.companionSelectPopup.open(); }, + + // 修改订单 + modifyOrder(order) { + uni.navigateTo({ + url: `/pages_order/order/orderModify?orderId=${order.orderId}` + }); + }, }, onLoad() { diff --git a/pages_order/order/orderModify.vue b/pages_order/order/orderModify.vue index 4fb89e8..1e1f086 100644 --- a/pages_order/order/orderModify.vue +++ b/pages_order/order/orderModify.vue @@ -1,66 +1,51 @@ \ No newline at end of file From 79d6b10d2f60936bf03ce5baae9db7b2b3647e90 Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Mon, 28 Apr 2025 00:07:57 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat(=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83):?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E9=82=80=E8=AF=B7=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8F=8A=E5=AF=BC=E8=88=AA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加了邀请绑定页面,并在个人中心页面中增加了对应的导航入口。用户可以通过输入邀请码进行绑定操作。 --- pages.json | 9 ++ pages/personalCenter/index.vue | 11 ++ pages_order/mine/InvitationCode.vue | 197 ++++++++++++++++++++++++++++++++++++ 3 files changed, 217 insertions(+) create mode 100644 pages_order/mine/InvitationCode.vue diff --git a/pages.json b/pages.json index 432d6e4..ad0f776 100644 --- a/pages.json +++ b/pages.json @@ -402,6 +402,15 @@ "enablePullDownRefresh": false, "navigationBarTextStyle": "white" } + }, + { + "path": "mine/InvitationCode", + "style": { + "navigationBarTitleText": "邀请绑定", + "navigationBarBackgroundColor": "#FFBF60", + "enablePullDownRefresh": false, + "navigationBarTextStyle": "white" + } } ] } diff --git a/pages/personalCenter/index.vue b/pages/personalCenter/index.vue index 9b4f560..d2a7c0b 100644 --- a/pages/personalCenter/index.vue +++ b/pages/personalCenter/index.vue @@ -229,6 +229,11 @@ label: '任务中心', path:'taskList' }, + { + icon:'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/lock.png', + label: '邀请绑定', + path:'InvitationCode' + }, ] } @@ -457,6 +462,12 @@ }); break; } + case 'InvitationCode':{ + uni.navigateTo({ + url: `/pages_order/mine/InvitationCode` + }); + break; + } case 'userInfo':{ uni.navigateTo({ url: `/pages/personalCenter/userInfo` diff --git a/pages_order/mine/InvitationCode.vue b/pages_order/mine/InvitationCode.vue new file mode 100644 index 0000000..98ee8da --- /dev/null +++ b/pages_order/mine/InvitationCode.vue @@ -0,0 +1,197 @@ + + + + +