主管理员 1 week ago
parent
commit
0121b1b1d9
19 changed files with 1332 additions and 893 deletions
  1. +13
    -0
      api/home.js
  2. +38
    -0
      api/order/order.js
  3. +38
    -3
      api/order/task.js
  4. +18
    -0
      pages.json
  5. +13
    -21
      pages/companionPetList/companionPetInfo.vue
  6. +264
    -162
      pages/index.vue
  7. +2
    -0
      pages/newOrder/confirmOrder.vue
  8. +3
    -1
      pages/newOrder/serviceNew.vue
  9. +12
    -1
      pages/personalCenter/index.vue
  10. +7
    -3
      pages_order/components/order/CancelOrderPopup.vue
  11. +197
    -0
      pages_order/mine/InvitationCode.vue
  12. +16
    -0
      pages_order/order/orderDetail.vue
  13. +12
    -2
      pages_order/order/orderList.vue
  14. +286
    -274
      pages_order/order/orderModify.vue
  15. +5
    -11
      pages_order/order/orderReview.vue
  16. +77
    -0
      pages_order/task/AppletTask.java
  17. +60
    -93
      pages_order/task/taskDetail.vue
  18. +46
    -193
      pages_order/task/taskList.vue
  19. +225
    -129
      pages_order/task/taskUpload.vue

+ 13
- 0
api/home.js View File

@ -0,0 +1,13 @@
import request from '@/utils/request'
//
export function getTeacherListIndex(data) {
return request({
url: '/applet/mall/teacher/getTeacherListIndex',
method: 'get',
data: data
})
}

+ 38
- 0
api/order/order.js View File

@ -94,6 +94,32 @@ export const getOrderDetail = (params) => {
})
}
// 根据id查询
export function getOrderDetailById(data) {
return request({
url: '/api/order/detail',
method: 'post',
data: data
})
}
// 创建订单
export function createOrder(data) {
return request({
url: '/api/order/create',
method: 'post',
data: data
})
}
// 更新订单
export function updateOrder(data) {
return request({
url: '/api/order/update',
method: 'post',
data: data
})
}
// 评价订单
export const orderEvaluate = (params) => {
@ -107,5 +133,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
})
}

+ 38
- 3
api/order/task.js View File

@ -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
})
}

+ 18
- 0
pages.json View File

@ -393,6 +393,24 @@
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white"
}
},
{
"path": "order/orderModify",
"style": {
"navigationBarTitleText": "服务过的伴宠师",
"navigationBarBackgroundColor": "#FFBF60",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white"
}
},
{
"path": "mine/InvitationCode",
"style": {
"navigationBarTitleText": "邀请绑定",
"navigationBarBackgroundColor": "#FFBF60",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white"
}
}
]
}


+ 13
- 21
pages/companionPetList/companionPetInfo.vue View File

@ -108,7 +108,7 @@
<view>
<image @click="changeOrderType" style="height: 132rpx; width: 710rpx; margin: 0 20rpx 0 20rpx;"
slot='cover'
src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/petServiceOrder/CMDFServiceDetail.png">
src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/petServiceOrder/CMDFServiceDetail.png" />
<!-- <uni-card padding=0>
<view class="service-new-pet-content" style="padding: 10px 0 5px 0;">
<view style="display: flex;">
@ -222,28 +222,20 @@
style="margin: 10rpx 0;"
:key="index"
v-for="(address, index) in addressList">
可接单地址{{ index + 1 }}
{{ address.area }}
{{ address.address }}
{{ address.rangeNo ? address.rangeNo + '公里内' : '' }}
<view v-if="address.appletOutDate && address.appletOutDate.length">
<view class="service-record-content"
style="display: flex;justify-content: space-around;height: 100rpx;align-items: center;">
<view style="font-size: 30rpx;color: #333;">
共不接单{{ address.appletOutDate.length }}
</view>
<view style="font-size: 26rpx;color: #FFB13F;display: flex;align-items: center;"
<view style="display: flex; justify-content: space-between; align-items: center;">
<view style="flex: 1; padding-right: 10rpx;">
<text>可接单地址{{ index + 1 }}</text>
<text>{{ address.area }} {{ address.address }} {{ address.rangeNo ? address.rangeNo + '公里内' : '' }}</text>
</view>
<view v-if="address.appletOutDate && address.appletOutDate.length"
style="display: flex; justify-content: flex-end;">
<view
style="font-size: 20rpx; color: #FFB13F; display: flex; align-items: center; padding: 2rpx 8rpx; background-color: #FFF9F0; border-radius: 20rpx;"
@click="selectDate = address.appletOutDate.map(n => n.date);$refs.calendarPopup.open('bottom')">
<uni-icons type="calendar" size="40rpx" color="#FFB13F"
style="margin-top: 6rpx;"></uni-icons>
点击查看不接单日期
<uni-icons type="calendar" size="20rpx" color="#FFB13F" style="margin-right: 2rpx;"></uni-icons>
<text>不接单{{address.appletOutDate.length}}</text>
</view>
</view>
</view>
</view>


+ 264
- 162
pages/index.vue View File

@ -8,12 +8,8 @@
<swiper class="swiper" indicator-dots indicator-color="rgba(255, 255, 255, 0.50)"
indicator-active-color="#ffffff" autoplay interval="5000">
<swiper-item v-for="(item,i) in bannerList" :key="i">
<img :src="item&&item.dictValue" style="width: 100%;" mode="widthFix" />
<image :src="item&&item.dictValue" style="width: 100%;" mode="widthFix" />
</swiper-item>
<!-- <swiper-item>
<img src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/banner/banner2_3x.png"
style="width: 100%;" mode="widthFix" />
</swiper-item> -->
</swiper>
</uni-swiper-dot>
</view>
@ -64,7 +60,6 @@
:startDate="startDate" :endDate="endDate" :showMonth="false"
@change="changeCalendar" @confirm="changeCalendar" @close="close" />
<view style="display: flex; justify-content: center; align-items: center;">
<!-- <button class="bottom-btn" @click="closePopup">确定</button> -->
<image @click="closePopup" style="width: 670rpx; height: 80rpx;" slot='cover' src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/petServiceOrder/yesButton.png" />
</view>
</view>
@ -76,11 +71,11 @@
<view style="display: flex;">
<view @click="getOrder(true)" style="margin-right: 20rpx;">
<image style="width: 304rpx; height: 100rpx;" slot='cover'
src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/petServiceOrder/OrderByCompanion.png">
src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/petServiceOrder/OrderByCompanion.png" />
</view>
<view @click="getOrder(false)">
<image style="width: 304rpx; height: 100rpx;"
src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/petServiceOrder/OrderBySystem.png">
src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/petServiceOrder/OrderBySystem.png" />
</view>
</view>
</view>
@ -117,13 +112,11 @@
<text class="card-type-text">专业喂养</text>
<text class="card-type-text">专业遛狗</text>
</view>
<view class="card-time">有效期至: {{item.availableEndTime.slice(0, 16)}}</view>
<view class="card-time">有效期至: {{item && item.availableEndTime ? item.availableEndTime.slice(0, 16) : ''}}</view>
</view>
<view>
<!-- <u-button @click="receiveCoupon(item.id)" shape="circle" size="mini"
color="#ffaa48" text="立即领取"></u-button> -->
<view style="width: 132rpx;height: 52rpx;background-color: #FFAA48; display: flex;align-items: center;justify-content: center;border-radius: 56rpx;">
<text style="font-size: 24rpx; font-weight: 500; color: #FFFFFF;">立即领取</text>
<text @click="receiveCoupon(item.id)" style="font-size: 24rpx; font-weight: 500; color: #FFFFFF;">立即领取</text>
</view>
</view>
</view>
@ -132,7 +125,7 @@
<view class="card-bottom-text">
优惠券不可兑换现金
</view>
<view class="card-bottom-text">
<view class="card-bottom-text" @click="showRulePopup(item)">
查看详细规则>
</view>
</view>
@ -160,7 +153,7 @@
<view class="companion-item">
<view class="companion-info">
<image class="companion-img" slot='cover'
:src="defaultCompanion&&defaultCompanion.staffImages&&defaultCompanion.staffImages.length>0?defaultCompanion.staffImages[0].url:defaultStaffIamge">
:src="defaultCompanion.staffImages && defaultCompanion.staffImages.length > 0 ? defaultCompanion.staffImages[0].url : defaultStaffIamge">
</image>
<view class="companion-info-1">
<view class="companion-info-2">
@ -169,8 +162,7 @@
{{defaultCompanion.name}}
</view>
<view class="companion-sex">
<img :src="defaultCompanion.gender=='1'?'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/sex_m.png':
'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/sex_f.png'" alt="sex"
<image :src="defaultCompanion.gender == '1' ? 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/sex_m.png' : 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/sex_f.png'" alt="sex"
style="width: 40rpx;height: 40rpx;" />
</view>
</view>
@ -244,8 +236,8 @@
</view>
<view class="service-content">
<img src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/second_stage/ysbz.png"
style="width: 100%;" mode="widthFix" alt="service">
<image src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/second_stage/ysbz.png"
style="width: 100%;" mode="widthFix" alt="service" />
</view>
<view class="card-container">
@ -271,7 +263,7 @@
<view>
<image style="height: 132rpx; width: 710rpx; margin: 0 20rpx 20rpx 20rpx;"
slot='cover'
src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/petServiceOrder/joinus.png">
src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/petServiceOrder/joinus.png" />
</view>
<Kefu></Kefu>
@ -279,7 +271,6 @@
<view class="details-subscribe">
<view @click="getCoupon" class="details-btn">点击领取到卡包</view>
</view>
<!-- 领取弹窗 -->
<view v-if="showMask" @closeMask="closeMask">
<view class="mask-coupon" @click="closeMask">
<view class="wx-coupon">
@ -290,7 +281,6 @@
<view class="content">
优惠券列表显示
</view>
<!-- 小程序领券插件 -->
<view class="" v-for="(item,index) in couponList" :key="index">
<send-coupon @sendcoupon="getSendCoupon" @userconfirm="redirectuser" :sign="item.sign"
:send_coupon_params="item.sendCouponParams"
@ -304,6 +294,36 @@
</view>
</view>
<!-- 优惠券详细规则弹窗 -->
<uni-popup ref="rulePopup" type="center">
<view class="rule-popup">
<view class="rule-popup-title">优惠券详细规则</view>
<view class="rule-popup-content">
<view class="rule-item">
<view class="rule-label">名称</view>
<view class="rule-value">{{currentCoupon && currentCoupon.stockName || ''}}</view>
</view>
<view class="rule-item">
<view class="rule-label">折扣</view>
<view class="rule-value">{{getDiscountText(currentCoupon)}}</view>
</view>
<view class="rule-item">
<view class="rule-label">使用规则</view>
<view class="rule-value">可用于专业喂养和专业遛狗服务</view>
</view>
<view class="rule-item">
<view class="rule-label">有效日期</view>
<view class="rule-value">{{currentCoupon && currentCoupon.availableEndTime ? currentCoupon.availableEndTime.slice(0, 16) : ''}}</view>
</view>
<view class="rule-item">
<view class="rule-label">特别说明</view>
<view class="rule-value">单笔订单仅限使用1张优惠券优惠券仅限用户本人使用不可赠送不可提现不得找零</view>
</view>
</view>
<view class="rule-popup-close" @click="closeRulePopup">关闭</view>
</view>
</uni-popup>
</view>
</template>
@ -317,19 +337,20 @@
getOpenId,
receiveCoupon,
} from "@/api/system/user"
import {
getCompanionList
} from "@/api/system/companion"
import {
setToken,
getToken,
getOpenIdKey,
setOpenIdKey
} from '@/utils/auth'
import { getTeacherListIndex } from '@/api/home'
import Kefu from './common/kefu.vue'
import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue';
import NewUserCoupon from './components/NewUserCoupon.vue';
import positionMixin from '@/mixins/position.js';
export default {
mixins: [positionMixin],
data() {
return {
current: 0,
@ -387,6 +408,7 @@
num: "47131",
numTime: "2024.12.12",
},
currentCoupon: null,
}
},
components: {
@ -400,12 +422,9 @@
},
methods: {
checkNewUser() {
//
// 访
const isFirstVisit = !uni.getStorageSync('hasVisited');
if (isFirstVisit) {
this.isNewUser = true;
// 访
uni.setStorageSync('hasVisited', true);
}
},
@ -413,11 +432,9 @@
this.isNewUser = false;
},
handleGetCoupon() {
//
if (getToken()) {
this.getCoupon();
} else {
//
uni.navigateTo({
url: '/pages/personalCenter/index'
});
@ -475,11 +492,9 @@
changeCalendar(e) {
console.log('change 返回:', e)
this.selectedDateShowText = ''
//
const selectedValue = this.selectedDate.find(item => item.date === e.fulldate)
console.log('const selectedValue', selectedValue)
if (selectedValue) {
//
this.selectedDate = this.selectedDate.filter(item => item.date !== e.fulldate);
this.allInfo.selectedDate = this.selectedDate;
} else {
@ -518,7 +533,6 @@
let tomorrow = new Date()
tomorrow.setDate(tomorrow.getDate() + 2);
this.startDate = this.formatDate(tomorrow);
//
let threeMonthsLater = new Date();
threeMonthsLater.setMonth(threeMonthsLater.getMonth() + 3);
this.endDate = this.formatDate(threeMonthsLater);
@ -531,9 +545,8 @@
},
getLocationInfo() {
wx.chooseLocation({
type: 'gcj02', // wgs84 gps gcj02 wx.openLocation
type: 'gcj02',
success: (res) => {
//
this.isCheckLocation = true
this.locationName = res.address
this.locationLongitude = res.longitude
@ -545,18 +558,26 @@
this.allInfo.locationLongitude = res.longitude
this.allInfo.locationLatitude = res.latitude
this.allInfo.locationAddress = res.address
// Vuex
this.$store.commit('setPosition', {
address: res.address,
longitude: res.longitude,
latitude: res.latitude
});
//
this.getCompanionList();
},
fail: (err) => {
//
console.error('选择位置失败:', err);
}
});
},
getLocationFirst() {
wx.chooseLocation({
type: 'gcj02', // wgs84 gps gcj02 wx.openLocation
type: 'gcj02',
success: (res) => {
//
this.isCheckLocation = true
this.locationName = res.address
this.locationLongitude = res.longitude
@ -567,44 +588,87 @@
this.allInfo.locationLongitude = res.longitude
this.allInfo.locationLatitude = res.latitude
this.allInfo.locationAddress = res.address
this.getCompanionList()
// Vuex
this.$store.commit('setPosition', {
address: res.address,
longitude: res.longitude,
latitude: res.latitude
});
//
this.getCompanionList();
},
fail: (err) => {
//
console.error('选择位置失败:', err);
}
});
},
getCompanionList() {
// let data = {
// longitude: this.locationLongitude,
// latitude: this.locationLatitude,
// petTypes: this.selectedPet,
// staffName: '',
// address: this.locationAddress
// }
// 使
let data = {
address: "上海市浦东新区浦东南路150弄",
latitude: 29.56471,
longitude: 106.55073,
address: this.locationAddress || "上海市浦东新区浦东南路150弄",
latitude: this.locationLatitude || 31.22514,
longitude: this.locationLongitude || 121.49857,
petTypes: ["1", "2"],
staffName: ""
staffName: ""
}
console.log('data', data);
getCompanionList(data).then(response => {
if (response.code == 200) {
// this.companionList = response.rows
this.defaultCompanion.name = response.rows[0].name
this.defaultCompanion.gender = response.rows[0].gender
this.defaultCompanion.star = response.rows[0].id
this.defaultCompanion.distance = response.rows[0].id
this.defaultCompanion.shortDescription = response.rows[0].shortDescription
this.defaultCompanion.staffImages = response.rows[0].staffImages
this.defaultCompanion.year = 4
this.defaultCompanion.record = 11
this.defaultCompanion.serviceNum = 13
console.log('获取周边伴宠师参数:', data);
// Vuexposition mixin使
this.$store.commit('setPosition', {
address: this.locationAddress,
longitude: this.locationLongitude,
latitude: this.locationLatitude
});
getTeacherListIndex(data).then(response => {
if (response.code == 200 && response.rows && response.rows.length > 0) {
const nearbyTeacher = response.rows[0];
console.log('伴宠师原始数据:', nearbyTeacher);
// 使mixincalculateDistanceAddress
let distance = 0;
if (nearbyTeacher.addressList && nearbyTeacher.addressList.length > 0) {
distance = this.calculateDistanceAddress(nearbyTeacher.addressList);
} else if (nearbyTeacher.latitude && nearbyTeacher.longitude) {
//
const addressList = [{
latitude: nearbyTeacher.latitude,
longitude: nearbyTeacher.longitude
}];
distance = this.calculateDistanceAddress(addressList);
}
//
let userImageUrl = "";
if (typeof nearbyTeacher.userImage === 'string') {
userImageUrl = nearbyTeacher.userImage;
} else if (nearbyTeacher.userImage && Array.isArray(nearbyTeacher.userImage) && nearbyTeacher.userImage.length > 0) {
userImageUrl = nearbyTeacher.userImage[0].url || "";
}
//
this.defaultCompanion = {
name: nearbyTeacher.userName || '宠小二',
gender: nearbyTeacher.gender || '1', // 1-2-
star: nearbyTeacher.likeNum || 0,
distance: distance.toFixed(1),
shortDescription: nearbyTeacher.shortDescription || '专业伴宠师,用心照顾每一位小宠物',
staffImages: [{
url: userImageUrl || "https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/catdog.png"
}],
year: nearbyTeacher.serviceAge || 1, //
record: nearbyTeacher.commentNum || 0, //
serviceNum: nearbyTeacher.serviceSummaryNum || 0 //
}
console.log('周边伴宠师信息:', this.defaultCompanion);
} else {
console.log('没有找到周边伴宠师或返回数据有误');
}
console.log(response);
}).catch(err => {
console.error('获取周边伴宠师失败:', err);
})
},
getOrder(value) {
@ -625,7 +689,6 @@
})
uni.navigateTo({
// url: '/pages/companionPetList/companionPetList',
url: `/pages/companionPetList/companionPetList?info=`
+ encodeURIComponent(JSON
.stringify(this.allInfo))
@ -635,22 +698,20 @@
this.$store.commit('setPosition', {})
this.buyInfo.teacher = null
uni.navigateTo({
// url: '/pages_order/order/payOrderSuccessful',
url: '/pages/newOrder/serviceNew',
// url: '/pages/newOrder/serviceNew2',
});
}
},
getCoupon() {
getCouponList().then(res => {
if (res.code == 200) {
this.couponList = res.rows
this.showMask = true
} else {
this.$modal.showToast('获取优惠券失败')
}
// getCouponList().then(res => {
// if (res.code == 200) {
// this.couponList = res.rows
// this.showMask = true
// } else {
// this.$modal.showToast('')
// }
})
// })
},
getCouponListAuth() {
@ -689,20 +750,28 @@
})
},
getCouponListNoAuth() {
console.log('进入 getCouponListNoAuth:');
getCouponListNoAuth().then(res => {
if (res.code == 200) {
this.couponData = res.rows
} else {
this.$modal.showToast('获取优惠券失败')
}
})
// console.log(' getCouponListNoAuth');
// getCouponListNoAuth().then(res => {
// if (res.code == 200) {
// if (res.rows && Array.isArray(res.rows)) {
// this.couponData = res.rows.filter(item => item !== null);
// console.log("", this.couponData);
// } else if (res.data && Array.isArray(res.data)) {
// this.couponData = res.data.filter(item => item !== null);
// console.log("", this.couponData);
// } else {
// console.log(":", res);
// }
// } else {
// this.$modal.showToast('')
// }
// }).catch(err => {
// console.error(":", err);
// })
},
closeMask() {
this.showMask = false
},
//
getSendCoupon(res) {
let that = this
console.log('res', res)
@ -733,7 +802,6 @@
that.showMask = false
}
},
//
redirectuser() {},
getBanner() {
getBannerList().then(res => {
@ -770,9 +838,6 @@
},
goDetails(item) {
if (item) {
// uni.navigateTo({
// url: `/pages/details/successful`
// });
uni.navigateTo({
url: `/pages/details/detail?id=${item.id}`
});
@ -813,7 +878,6 @@
this.getOpenId(loginRes.code)
},
fail: function(error) {
//
uni.showToast('授权失败,请授权后再试')
}
});
@ -831,23 +895,80 @@
}
})
},
showRulePopup(coupon) {
if (!coupon) {
console.warn('尝试显示空优惠券详情');
return;
}
this.currentCoupon = coupon;
this.$refs.rulePopup.open();
},
closeRulePopup() {
this.$refs.rulePopup.close();
},
getDiscountText(coupon) {
if (!coupon || !coupon.stockType) return '';
if (coupon.stockType === 'PNORMAL') {
return '满100可减10元';
} else if (coupon.stockType === 'PDISCOUNT') {
return '打8折';
} else if (coupon.stockType === 'PTRAIL') {
return '免费体验一次';
}
return '';
},
},
onShow() {
if (!getToken() || !getOpenIdKey()) {
this.login()
}
if(this.$globalData.mainSku.length < 1 || !this.$globalData.mainSku[0].price){
//
this.getProductList()
}
this.currentAddress = this.$globalData.newOrderData.currentAddress
if(this.currentAddress&&this.currentAddress.name){
this.isAddressSelected=true
}
this.currentPets = this.$globalData.newOrderData.currentPets
if(this.currentPets&&this.currentPets.length>0){
this.isPetSelected=true
}
this.needPreFamiliarize = this.$globalData.newOrderData.needPreFamiliarize
//
if(this.$globalData.newOrderData.companionLevel) {
this.companionLevel = this.$globalData.newOrderData.companionLevel
}
//
this.getCompanionList();
},
onLoad: function() {
this.init()
this.getPeopleList()
this.getProductList()
this.getBanner()
// this.getCouponListNoAuth()
const accountInfo = wx.getAccountInfoSync();
this.envVersion = accountInfo.miniProgram.envVersion;
if (!getToken() || !getOpenIdKey()) {
this.login()
} else {
// this.getLocationFirst()
this.getCouponListAuth()
}
this.getCouponListAuth()
//
this.getCouponListNoAuth()
// 使
this.$store.commit('setPosition', {
address: "上海市浦东新区浦东南路150弄",
longitude: 121.49857,
latitude: 31.22514
});
}
}
</script>
@ -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;
}
</style>

+ 2
- 0
pages/newOrder/confirmOrder.vue View File

@ -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)
}


+ 3
- 1
pages/newOrder/serviceNew.vue View File

@ -244,7 +244,9 @@
//
if(this.$globalData.newOrderData.companionLevel) {
this.companionLevel = this.$globalData.newOrderData.companionLevel
}
}else{
this.$globalData.newOrderData.companionLevel = this.companionLevel
}
},
methods:{
selectAddress(){


+ 12
- 1
pages/personalCenter/index.vue View File

@ -111,7 +111,7 @@
</view>
<uni-steps :options="orderStatus" active-icon="checkbox" :active="active" active-color='#ffaa48'
/>
<view class="uni-steps-btns">
<view class="uni-steps-btns" v-if="active == 2">
<u-button
type="primary"
shape="circle"
@ -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`


+ 7
- 3
pages_order/components/order/CancelOrderPopup.vue View File

@ -29,7 +29,7 @@
</template>
<script>
import { cancelOrder } from "@/api/system/user.js"
import { orderCancel } from "@/api/order/order.js"
export default {
props: {
@ -59,7 +59,7 @@ export default {
//
confirmCancel() {
if (!this.order || !this.order.id) {
if (!this.order || !this.order.orderId) {
uni.showToast({
title: '订单信息不完整',
icon: 'none'
@ -73,7 +73,11 @@ export default {
});
// API
cancelOrder(this.order.id, this.cancelReason).then(res => {
orderCancel({
id : this.order.orderId,
idList : [this.order.orderId],
remark : this.cancelReason,
}).then(res => {
uni.hideLoading();
if (res && res.code === 200) {


+ 197
- 0
pages_order/mine/InvitationCode.vue View File

@ -0,0 +1,197 @@
<template>
<view class="invitation-container">
<!-- 填写邀请码区域 -->
<view class="invitation-section">
<view class="section-header">
<text class="iconfont icon-invite"></text>
<text class="section-title">填写邀请码</text>
</view>
<view class="section-subtitle">邀请人有且只有一位添加后不可更改</view>
<view class="input-area">
<input type="text" class="invite-input" placeholder="请输入邀请码,领取优惠券" v-model="inviteCode" />
</view>
<view class="submit-btn" @click="submitInviteCode">立即领取</view>
</view>
<!-- 我的邀请码区域 -->
<!-- <view class="my-invitation-section">
<view class="section-header">
<text class="iconfont icon-myinvite"></text>
<text class="section-title">我的邀请码</text>
</view>
<view class="section-subtitle">有关邀请码的更多功能请前往服务者端了解~</view>
<view class="my-code-area">
<text class="my-code">{{ myInviteCode }}</text>
<view class="copy-btn" @click="copyInviteCode">复制</view>
</view>
</view> -->
<!-- 推广员入口 -->
<!-- <view class="promotion-section">
<text class="promotion-text">了解并加入布了推广员赚取高达80%收益分成!!!</text>
<view class="promotion-btn" @click="goToPromotion">推广员后台</view>
</view> -->
</view>
</template>
<script>
export default {
name: 'InvitationCode',
data() {
return {
inviteCode: '', //
myInviteCode: 'b1014pib' //
}
},
methods: {
//
submitInviteCode() {
if (!this.inviteCode) {
uni.showToast({
title: '请输入邀请码',
icon: 'none'
})
return
}
//
uni.showToast({
title: '邀请码提交成功',
icon: 'success'
})
},
//
copyInviteCode() {
uni.setClipboardData({
data: this.myInviteCode,
success: () => {
uni.showToast({
title: '复制成功',
icon: 'success'
})
}
})
},
// 广
goToPromotion() {
// 广
uni.navigateTo({
url: '/pages_order/mine/promotion'
})
}
}
}
</script>
<style lang="scss" scoped>
.invitation-container {
padding: 20rpx;
font-family: PingFang SC, Helvetica Neue, Helvetica, Arial, sans-serif;
}
/* 公共样式 */
.section-header {
display: flex;
align-items: center;
margin-bottom: 10rpx;
}
.iconfont {
margin-right: 10rpx;
font-size: 36rpx;
color: #FFBF60;
}
.section-title {
font-size: 34rpx;
font-weight: bold;
color: #333;
}
.section-subtitle {
font-size: 24rpx;
color: #999;
margin-bottom: 20rpx;
}
/* 填写邀请码区域 */
.invitation-section {
background-color: #fff;
border-radius: 12rpx;
padding: 30rpx;
margin-bottom: 20rpx;
}
.input-area {
background-color: #F5F7FA;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
.invite-input {
height: 80rpx;
padding: 0 20rpx;
font-size: 28rpx;
}
.submit-btn {
background-color: #FFBF60;
color: #fff;
text-align: center;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
font-size: 30rpx;
}
/* 我的邀请码区域 */
.my-invitation-section {
background-color: #fff;
border-radius: 12rpx;
padding: 30rpx;
margin-bottom: 20rpx;
}
.my-code-area {
display: flex;
align-items: center;
justify-content: space-between;
}
.my-code {
font-size: 36rpx;
font-weight: bold;
color: #333;
}
.copy-btn {
border: 1px solid #FFBF60;
color: #FFBF60;
padding: 8rpx 30rpx;
border-radius: 30rpx;
font-size: 24rpx;
}
/* 推广员入口 */
.promotion-section {
text-align: center;
margin-top: 60rpx;
}
.promotion-text {
font-size: 26rpx;
color: #666;
margin-bottom: 20rpx;
}
.promotion-btn {
background-color: #FFBF60;
color: #fff;
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
font-size: 32rpx;
}
</style>

+ 16
- 0
pages_order/order/orderDetail.vue View File

@ -28,6 +28,9 @@
<view class="footer-btn pay-btn" v-if="orderDetail.status === '1'" @click="goToPay">
<text>去付款</text>
</view>
<!-- <view class="footer-btn modify-btn" v-if="orderDetail.status != 0 && orderDetail.status != 3" @click="modifyOrder">
<text>修改订单</text>
</view> -->
<view class="footer-btn review-btn" v-if="orderDetail.status === 4" @click="goToReview">
<text>评价订单</text>
</view>
@ -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;


+ 12
- 2
pages_order/order/orderList.vue View File

@ -60,7 +60,7 @@
<!-- 订单操作 -->
<view class="order-actions">
<view class="action-btn details-btn" v-if="order.status == 0"
@click="$refs.cancelOrderPopup.open()">
@click="$refs.cancelOrderPopup.open(order)">
<text>取消订单</text>
</view>
<view class="action-btn details-btn" @click="viewOrderDetails(order.orderId)">
@ -69,6 +69,9 @@
<view class="action-btn pay-btn" v-if="order.status == 0" @click="goToPay(order.orderId)">
<text>去付款</text>
</view>
<!-- <view class="action-btn pay-btn" v-if="order.status == 1 || order.status == 2" @click="modifyOrder(order)">
<text>修改订单</text>
</view> -->
<view class="action-btn pay-btn" v-if="order.status == 4" @click="goToReview(order)">
<text>去评价</text>
</view>
@ -210,7 +213,7 @@
},
handleCancelOrder() {
this.refresh()
},
//
@ -311,6 +314,13 @@
this.currentOrder = order;
this.$refs.companionSelectPopup.open();
},
//
modifyOrder(order) {
uni.navigateTo({
url: `/pages_order/order/orderModify?orderId=${order.orderId}`
});
},
},
onLoad() {


+ 286
- 274
pages_order/order/orderModify.vue View File

@ -1,66 +1,51 @@
<template>
<view class="order-modify-page">
<!-- 页面头部 -->
<view class="page-header">
<text class="header-title">修改订单</text>
<view class="order-modify-container">
<view class="header">
<text class="title">修改订单</text>
</view>
<!-- 订单内容区域 -->
<view class="order-modify-content">
<!-- 订单修改说明 -->
<view class="modify-notice">
<view class="notice-item">
<text class="notice-icon">🐾</text>
<text class="notice-text">您可以对<text class="highlight-text">未服务或未支付</text>的订单进行修改或取消</text>
</view>
<view class="notice-item">
<text class="notice-icon">🐾</text>
<text class="notice-text">若需修改已支付的服务项目增加服务时间/服务项目可点击下方按钮<text class="highlight-text">联系客服</text>寻求帮助感谢</text>
</view>
<view class="content">
<!-- 加载状态 -->
<view class="loading-container" v-if="loading">
<view class="loading-circle"></view>
<text class="loading-text">加载中...</text>
</view>
<!-- 服务修改信息 -->
<view class="modify-info-card">
<view class="card-title">
<text>服务修改信息</text>
<view v-else>
<view class="info-section">
<view class="section-title">修改说明</view>
<view class="info-content">
<view class="desc-text">修改订单不会额外收取任何费用如需修改服务内容请点击"修改服务"按钮</view>
</view>
</view>
<view class="info-content">
<view class="info-item">
<text class="info-label">联系人</text>
<text class="info-value">{{modifyInfo.contactName}}</text>
</view>
<view class="info-item">
<text class="info-label">联系方式</text>
<text class="info-value">{{modifyInfo.contactPhone}}</text>
</view>
<view class="info-item payment-method">
<text class="info-label">销售支持方式</text>
<view class="info-value payment-value">
<text>{{modifyInfo.paymentMethod}}</text>
<text class="arrow-right">></text>
<view class="info-section">
<view class="section-title">修改信息</view>
<view class="info-content">
<view class="info-item">
<text class="info-label">联系人</text>
<input class="info-value" type="text" v-model="modifyInfo.contactName" placeholder="请输入联系人姓名" />
</view>
<view class="info-item">
<text class="info-label">联系方式</text>
<input class="info-value" type="text" v-model="modifyInfo.contactPhone" placeholder="请输入联系电话" />
</view>
<view class="info-item payment-method">
<text class="info-label">销售支持方式</text>
<view class="info-value payment-value">
<input type="text" v-model="modifyInfo.paymentMethod" placeholder="请输入支付方式" />
<text class="arrow-right">></text>
</view>
</view>
</view>
</view>
</view>
<!-- 修改原因 -->
<view class="modify-reason-card">
<view class="card-title">
<text>修改原因</text>
</view>
<view class="reason-content">
<textarea
class="reason-input"
v-model="modifyReason"
placeholder="请输入修改原因(选填)"
maxlength="200"
></textarea>
<view class="word-count">
<text>{{modifyReason.length}}/200</text>
<view class="info-section">
<view class="section-title">修改原因</view>
<view class="info-content">
<textarea class="reason-input" v-model="modifyReason" placeholder="请输入修改原因(选填)"></textarea>
</view>
</view>
</view>
@ -68,8 +53,8 @@
<!-- 底部按钮区域 -->
<view class="order-modify-footer">
<view class="footer-btn cancel-service-btn" @click="$refs.cancelPopup.open()">
<text>取消服务</text>
<view class="footer-btn cancel-service-btn" @click="modifyOrder">
<text>修改服务</text>
</view>
<view class="footer-btn confirm-modify-btn" @click="confirmModify">
<text>确认修改</text>
@ -88,320 +73,347 @@
</template>
<script>
import CancelOrderPopup from '../../components/order/CancelOrderPopup.vue';
import { getOrderDetail, updateOrder } from '@/api/order/order.js';
export default {
components: {
CancelOrderPopup
},
data() {
return {
orderId: '', // ID
loading: false,
orderId: null,
modifyInfo: {
contactName: '张小二',
contactPhone: '18888888888',
paymentMethod: '存子快递宝'
contactName: '',
contactPhone: '',
paymentMethod: '',
},
modifyReason: '', //
showCancelOrderPopup: false //
};
modifyReason: '',
showCancelOrderPopup: false,
originalOrderData: null
}
},
onLoad(options) {
// ID
if (options.id) {
this.orderId = options.id;
//
if (options.orderId) {
this.orderId = options.orderId;
this.loadOrderData();
} else {
uni.showToast({
title: '订单ID不存在',
icon: 'none'
});
setTimeout(() => {
uni.navigateBack();
}, 1500);
}
},
methods: {
//
loadOrderData() {
// API
//
/*
const params = {
openId: getOpenIdKey(),
orderId: this.orderId
};
async loadOrderData() {
if (!this.orderId) return;
getOrderDetail(params).then(res => {
this.loading = true;
try {
const res = await getOrderDetail({ id: this.orderId });
if (res && res.code === 200) {
//
this.modifyInfo = {
contactName: res.data.contactName,
contactPhone: res.data.contactPhone,
paymentMethod: res.data.paymentMethod
};
const orderData = res.data;
this.originalOrderData = JSON.parse(JSON.stringify(orderData));
//
this.modifyInfo.contactName = orderData.contactName || '';
this.modifyInfo.contactPhone = orderData.contactPhone || '';
this.modifyInfo.paymentMethod = orderData.paymentMethod || '';
} else {
uni.showToast({
title: res.msg || '获取订单信息失败',
icon: 'none'
});
}
}).catch(err => {
console.error('获取订单详情失败', err);
} catch (error) {
console.error('获取订单数据失败', error);
uni.showToast({
title: '获取订单信息失败',
title: '网络异常,请稍后重试',
icon: 'none'
});
});
*/
// 使
console.log('加载订单数据,ID:', this.orderId);
} finally {
this.loading = false;
}
},
//
confirmModify() {
// API
//
/*
const params = {
openId: getOpenIdKey(),
orderId: this.orderId,
reason: this.modifyReason
};
//
async confirmModify() {
//
if (!this.modifyInfo.contactName.trim()) {
return uni.showToast({
title: '请输入联系人姓名',
icon: 'none'
});
}
modifyOrder(params).then(res => {
if (!this.modifyInfo.contactPhone.trim()) {
return uni.showToast({
title: '请输入联系方式',
icon: 'none'
});
}
//
const phoneReg = /^1[3-9]\d{9}$/;
if (!phoneReg.test(this.modifyInfo.contactPhone)) {
return uni.showToast({
title: '请输入正确的手机号码',
icon: 'none'
});
}
//
const hasChanged =
this.modifyInfo.contactName !== this.originalOrderData.contactName ||
this.modifyInfo.contactPhone !== this.originalOrderData.contactPhone ||
this.modifyInfo.paymentMethod !== this.originalOrderData.paymentMethod;
if (!hasChanged) {
return uni.showToast({
title: '未检测到任何修改',
icon: 'none'
});
}
this.loading = true;
try {
const updateData = {
id: this.orderId,
contactName: this.modifyInfo.contactName,
contactPhone: this.modifyInfo.contactPhone,
paymentMethod: this.modifyInfo.paymentMethod,
modifyReason: this.modifyReason || '客户修改订单信息'
};
const res = await updateOrder(updateData);
if (res && res.code === 200) {
uni.showToast({
title: '订单修改成功',
icon: 'success'
});
//
setTimeout(() => {
uni.navigateBack();
}, 1500);
} else {
uni.showToast({
title: res.msg || '订单修改失败',
icon: 'none'
});
}
}).catch(err => {
console.error('修改订单失败', err);
} catch (error) {
console.error('订单修改失败', error);
uni.showToast({
title: '修改订单失败',
title: '网络异常,请稍后重试',
icon: 'none'
});
});
*/
// 使
uni.showToast({
title: '订单修改成功',
icon: 'success'
});
// 1.5
setTimeout(() => {
uni.navigateBack();
}, 1500);
} finally {
this.loading = false;
}
},
//
modifyOrder() {
uni.navigateTo({
url: `/pages/newOrder/serviceNew?orderId=${this.orderId}&isModify=true`
});
},
//
handleCancelOrder(orderId) {
this.hideCancelPopup();
// API
//
/*
const params = {
openId: getOpenIdKey(),
orderId: this.orderId,
reason: this.modifyReason
};
cancelOrder(params).then(res => {
if (res && res.code === 200) {
uni.showToast({
title: '订单已取消',
icon: 'success'
});
//
setTimeout(() => {
uni.navigateBack({delta: 2});
}, 1500);
}
}).catch(err => {
console.error('取消订单失败', err);
});
*/
// 使
uni.showToast({
title: '订单已取消',
icon: 'success'
});
// 1.5
setTimeout(() => {
uni.navigateBack({delta: 2});
}, 1500);
}
}
};
}
</script>
<style lang="scss" scoped>
.order-modify-page {
.order-modify-container {
background-color: #f5f5f5;
min-height: 100vh;
display: flex;
flex-direction: column;
}
.page-header {
.header {
background-color: #FFAA48;
padding: 20rpx 30rpx;
color: #FFFFFF;
.header-title {
.title {
font-size: 36rpx;
font-weight: bold;
}
}
.order-modify-content {
.content {
flex: 1;
padding: 20rpx;
}
.modify-notice {
background-color: #FFF9F0;
border-radius: 20rpx;
padding: 20rpx;
.loading-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 300rpx;
margin-top: 100rpx;
}
.loading-circle {
width: 80rpx;
height: 80rpx;
border: 4rpx solid #FFAA48;
border-top-color: transparent;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 20rpx;
.notice-item {
display: flex;
align-items: flex-start;
margin-bottom: 10rpx;
&:last-child {
margin-bottom: 0;
}
.notice-icon {
margin-right: 10rpx;
font-size: 28rpx;
}
.notice-text {
font-size: 26rpx;
color: #666;
line-height: 1.5;
flex: 1;
.highlight-text {
color: #FFAA48;
}
}
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.modify-info-card, .modify-reason-card {
.loading-text {
font-size: 28rpx;
color: #666;
}
.info-section {
background-color: #FFFFFF;
border-radius: 20rpx;
padding: 30rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
overflow: hidden;
}
.card-title {
.section-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;
padding: 20rpx;
border-bottom: 1px solid #EEEEEE;
}
.info-content {
padding: 20rpx;
}
.desc-text {
font-size: 28rpx;
color: #666;
line-height: 1.5;
}
.info-item {
display: flex;
align-items: center;
margin-bottom: 20rpx;
&::before {
content: '';
display: inline-block;
width: 8rpx;
height: 32rpx;
background-color: #FFAA48;
margin-right: 16rpx;
border-radius: 4rpx;
&:last-child {
margin-bottom: 0;
}
.info-label {
width: 180rpx;
font-size: 28rpx;
color: #666;
}
.info-value {
flex: 1;
font-size: 28rpx;
color: #333;
padding: 10rpx;
border: 1px solid #EEEEEE;
border-radius: 8rpx;
}
}
.info-content {
.info-item {
.payment-method {
.payment-value {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 0;
border-bottom: 1px solid #EEEEEE;
&:last-child {
border-bottom: none;
}
.info-label {
font-size: 28rpx;
color: #666;
}
.info-value {
font-size: 28rpx;
color: #333;
}
&.payment-method {
.payment-value {
display: flex;
align-items: center;
.arrow-right {
margin-left: 10rpx;
color: #999;
}
}
input {
flex: 1;
border: none;
padding: 0;
}
}
}
.reason-content {
.reason-input {
width: 100%;
height: 200rpx;
background-color: #F8F8F8;
border-radius: 10rpx;
padding: 20rpx;
font-size: 28rpx;
color: #333;
box-sizing: border-box;
}
.word-count {
text-align: right;
margin-top: 10rpx;
text {
.arrow-right {
font-size: 24rpx;
color: #999;
margin-left: 10rpx;
}
}
}
.order-modify-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 30rpx;
.reason-input {
width: 100%;
height: 200rpx;
font-size: 28rpx;
padding: 20rpx;
box-sizing: border-box;
border: 1px solid #EEEEEE;
border-radius: 8rpx;
}
.footer {
padding: 30rpx 20rpx;
background-color: #FFFFFF;
border-top: 1px solid #EEEEEE;
.footer-btn {
padding: 16rpx 30rpx;
border-radius: 30rpx;
font-size: 28rpx;
text-align: center;
width: 45%;
}
.cancel-service-btn {
background-color: #F5F5F5;
color: #666;
border: 1px solid #DDDDDD;
.btn-container {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
.btn {
flex: 1;
padding: 16rpx 30rpx;
border-radius: 30rpx;
text-align: center;
font-size: 30rpx;
margin: 0 10rpx;
&:first-child {
margin-left: 0;
}
&:last-child {
margin-right: 0;
}
&:disabled {
opacity: 0.6;
}
}
.modify-service {
background-color: #F5F5F5;
color: #666;
border: 1px solid #DDDDDD;
}
.confirm-modify {
background-color: #FFAA48;
color: #FFFFFF;
}
.cancel-order {
background-color: #F5F5F5;
color: #666;
border: 1px solid #DDDDDD;
width: 100%;
}
}
.confirm-modify-btn {
background-color: #FFAA48;
color: #FFFFFF;
.mt-20 {
margin-top: 20rpx;
}
}
</style>

+ 5
- 11
pages_order/order/orderReview.vue View File

@ -4,11 +4,11 @@
<view class="companion-info-card">
<view class="profile-header">
<view class="companion-avatar">
<image :src="companion.avatar || '/static/images/personal/pet.png'" mode="aspectFill"></image>
<image :src="companion.userImage || '/static/images/personal/pet.png'" mode="aspectFill"></image>
</view>
<view class="companion-detail">
<view class="companion-name">
<text>{{companion.name || '伴宠师'}}</text>
<text>{{companion.userName || '伴宠师'}}</text>
<image v-if="companion.gender" :src="companion.gender === '男生' ? '/static/images/details/boy.svg' : '/static/images/details/girl.svg'" class="gender-icon"></image>
<view class="companion-tag" v-if="companion.level">
<text>{{companion.level === 'junior' ? '初级伴宠师' : '高级伴宠师'}}</text>
@ -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 = {


+ 77
- 0
pages_order/task/AppletTask.java View File

@ -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;
}

+ 60
- 93
pages_order/task/taskDetail.vue View File

@ -3,7 +3,7 @@
<!-- 任务头部信息 -->
<view class="task-header">
<view class="task-title">{{taskInfo.title}}</view>
<view class="task-deadline">请于{{taskInfo.deadline}}之前上传任务超时将自动取消</view>
<view class="task-deadline">请于{{taskInfo.taskEndTime ? formatDate(taskInfo.taskEndTime) : ''}}之前上传任务超时将自动取消</view>
</view>
<!-- 任务进度 -->
@ -15,69 +15,29 @@
<!-- 任务说明 -->
<view class="task-instruction">
<view class="instruction-header">
<image class="instruction-icon" src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png"></image>
<view class="instruction-title">悬赏任务说明</view>
<image class="instruction-icon" :src="taskInfo.taskIcon || 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png'"></image>
<view class="instruction-title">{{taskInfo.taskName || '任务说明'}}</view>
</view>
<view class="instruction-content">
<view class="instruction-main">
<text>请以"{{taskInfo.description}}"为主题编辑小红书宣传笔记~</text>
<text>{{taskInfo.theme || '暂无任务说明'}}</text>
</view>
<view class="requirement-section">
<view class="requirement-title">封面和配图要求</view>
<view class="requirement-content">
<text>封面: 个人宠物图片</text>
<text>配图: 个人宠物图片或小程序页面截图(共2-3)</text>
</view>
</view>
<view class="requirement-section">
<view class="requirement-title">标题示例 (实际发布可以参照以下)</view>
<view class="title-examples">
<view class="example-item">
<view class="example-tag">H1</view>
<view class="example-text">春节回家猫咪/狗狗怎么办?</view>
</view>
<view class="example-item">
<view class="example-tag">H2</view>
<view class="example-text">今年过年不用担心宠物没人照顾啦~</view>
</view>
<view class="example-item">
<view class="example-tag">H3</view>
<view class="example-text">关于宠物喂养平台的真实体验</view>
</view>
<view class="example-item">
<view class="example-tag">H4</view>
<view class="example-text">出门旅游再也不用担心宠物啦</view>
</view>
</view>
</view>
<view class="requirement-section">
<view class="requirement-title">其他要求</view>
<!-- 审核未通过时显示驳回原因 -->
<view class="requirement-section" v-if="taskInfo.examineState === 2">
<view class="requirement-title">驳回原因</view>
<view class="other-requirements">
<view class="requirement-item">
<view class="requirement-tag"></view>
<view class="requirement-text">文案内容不少于400字</view>
</view>
<view class="requirement-item">
<view class="requirement-tag"></view>
<view class="requirement-text">提及关键词上门猫咪/上门狗狗/上门喂养</view>
</view>
<view class="requirement-item">
<view class="requirement-tag"></view>
<view class="requirement-text">提及猫狗宠物平台并适当好评</view>
</view>
<view class="requirement-item">
<view class="requirement-tag"></view>
<view class="requirement-text">评论区@猫狗宠物官方账号</view>
<view class="requirement-tag">!</view>
<view class="requirement-text">{{taskInfo.examineText || '未提供驳回原因'}}</view>
</view>
</view>
</view>
<view class="note-text">
<text>注意是评论区请务必在正文@官方账号</text>
<!-- 任务图片 -->
<view class="task-images" v-if="taskInfo.image">
<image :src="taskInfo.image" mode="widthFix" style="width: 100%;"></image>
</view>
</view>
</view>
@ -85,7 +45,7 @@
<!-- 底部按钮 -->
<view class="footer-buttons">
<u-button shape="circle" plain @click="cancelTask">取消</u-button>
<u-button shape="circle" color="#ffaa48" @click="reuploadTask">重新上传</u-button>
<u-button shape="circle" color="#ffaa48" v-if="taskInfo.taskState === 0 || taskInfo.examineState === 2" @click="uploadTask">{{taskInfo.examineState === 2 ? '重新上传' : '立即上传'}}</u-button>
</view>
</view>
</template>
@ -93,18 +53,22 @@
<script>
import {
getTaskDetail
} from "@/api/system/task.js"
} from "@/api/order/task.js"
export default {
data() {
return {
taskInfo: {
id: 0,
title: '发布小红书宣传笔记',
description: '主题: 猫狗狗食使用感受&体验',
deadline: '2025-03-28',
taskType: '悬赏任务',
reward: '2',
status: 'PENDING'
title: '',
theme: '',
taskEndTime: '',
taskName: '',
taskMoney: 0,
taskState: 0,
examineState: 0,
examineText: '',
image: '',
taskIcon: ''
},
stepsList: [
{
@ -130,50 +94,53 @@
},
methods: {
loadTaskDetail(taskId) {
//
/*
getTaskDetail(taskId).then(res => {
if (res && res.code === 200) {
this.taskInfo = res.data;
//
switch(this.taskInfo.status) {
case 'PENDING':
this.currentStep = 0;
break;
case 'ACCEPTED':
this.currentStep = 1;
break;
case 'SUBMITTED':
this.currentStep = 2;
break;
case 'COMPLETED':
this.currentStep = 3;
break;
}
this.updateCurrentStep();
}
});
*/
//
console.log('加载任务详情,ID:', taskId);
// 1
this.currentStep = 1;
},
updateCurrentStep() {
//
if (this.taskInfo.status === 0) {
this.currentStep = 0; //
} else if (this.taskInfo.taskState === 0) {
this.currentStep = 1; //
} else if (this.taskInfo.taskState === 1) {
if (this.taskInfo.examineState === 0) {
this.currentStep = 2; //
} else if (this.taskInfo.examineState === 1) {
this.currentStep = 3; //
} else if (this.taskInfo.examineState === 2) {
this.currentStep = 1; //
}
}
},
formatDate(dateStr) {
if (!dateStr) return '';
let date = new Date(dateStr);
let year = date.getFullYear();
let month = (date.getMonth() + 1).toString().padStart(2, '0');
let day = date.getDate().toString().padStart(2, '0');
return `${year}-${month}-${day}`;
},
cancelTask() {
uni.showToast({
title: '已取消任务',
icon: 'none'
uni.showModal({
title: '取消任务',
content: '确定要取消此任务吗?',
success: (res) => {
if (res.confirm) {
uni.navigateBack();
}
}
});
setTimeout(() => {
uni.navigateBack();
}, 1500);
},
reuploadTask() {
uni.showToast({
title: '准备重新上传',
icon: 'none'
uploadTask() {
uni.navigateTo({
url: `/pages_order/task/taskUpload?id=${this.taskInfo.id}&status=${this.taskInfo.examineState === 2 ? 'REJECTED' : 'ACCEPTED'}`
});
//
}
}
}


+ 46
- 193
pages_order/task/taskList.vue View File

@ -94,10 +94,9 @@
<script>
import {
getTaskList,
acceptTask,
submitTask,
getTaskDetail
} from "@/api/system/task.js"
getTaskDetail,
acceptTask
} from "@/api/order/task.js"
export default {
data() {
return {
@ -116,181 +115,65 @@
},
],
curNow: 0,
pendingTasks: [{
id: 1,
taskType: '悬赏任务',
reward: '2',
icon: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png',
title: '发布小红书宣传笔记',
description: '主题: 猫狗狗食使用感受&体验',
deadline: '2025-03-28'
},
{
id: 2,
taskType: '体验任务',
reward: '3',
icon: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png',
title: '狗狗玩具测评',
description: '测试新款狗狗玩具并提供使用反馈',
deadline: '2025-04-05'
},
{
id: 3,
taskType: '推广任务',
reward: '5',
icon: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png',
title: '抖音短视频拍摄',
description: '拍摄宠物使用产品的有趣短视频',
deadline: '2025-04-10'
},
{
id: 13,
taskType: '问卷调查',
reward: '1',
icon: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png',
title: '宠物食品偏好调查',
description: '完成一份关于宠物食品偏好的问卷调查',
deadline: '2025-03-30'
},
{
id: 14,
taskType: '社区任务',
reward: '4',
icon: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png',
title: '宠物社区话题讨论',
description: '在指定宠物社区参与话题讨论并获得5个以上回复',
deadline: '2025-04-15'
}
],
acceptedTasks: [
{
id: 4,
taskType: '悬赏任务',
reward: '3',
icon: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png',
title: '发布小红书宣传笔记',
description: '主题: 猫狗狗食使用感受&体验',
deadline: '2025-03-28',
status: 'ACCEPTED' //
},
{
id: 5,
taskType: '悬赏任务',
reward: '3',
icon: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png',
title: '发布小红书宣传笔记',
description: '主题: 猫狗狗食使用感受&体验',
deadline: '2025-03-28',
status: 'SUBMITTED' //
},
{
id: 6,
taskType: '悬赏任务',
reward: '3',
icon: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png',
title: '发布小红书宣传笔记',
description: '主题: 猫狗狗食使用感受&体验',
deadline: '2025-03-28',
status: 'REJECTED', //
rejectReason: '图片不清晰,请重新上传高清图片'
},
{
id: 7,
taskType: '悬赏任务',
reward: '3',
icon: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png',
title: '发布小红书宣传笔记',
description: '主题: 猫狗狗食使用感受&体验',
deadline: '2025-03-28',
status: 'APPROVED' //
},
{
id: 8,
taskType: '体验任务',
reward: '5',
icon: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png',
title: '猫咪零食体验测评',
description: '体验新品猫咪零食并提供详细测评报告',
deadline: '2025-04-15',
status: 'ACCEPTED', //
receiveTime: '2025-03-10'
},
{
id: 9,
taskType: '推广任务',
reward: '8',
icon: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png',
title: '朋友圈分享宠物用品',
description: '在朋友圈分享指定宠物用品并获取5个以上点赞',
deadline: '2025-03-25',
status: 'SUBMITTED', //
submitTime: '2025-03-20'
},
{
id: 10,
taskType: '视频任务',
reward: '10',
icon: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png',
title: '拍摄宠物使用产品视频',
description: '拍摄15秒宠物使用我们产品的有趣视频',
deadline: '2025-04-10',
status: 'REJECTED', //
rejectReason: '视频时长不足,请确保视频至少15秒且清晰可见'
},
{
id: 11,
taskType: '问卷调查',
reward: '2',
icon: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png',
title: '宠物主人消费习惯调查',
description: '完成一份关于宠物主人消费习惯的问卷调查',
deadline: '2025-03-30',
status: 'APPROVED', //
approveTime: '2025-03-18'
},
{
id: 12,
taskType: '社区任务',
reward: '6',
icon: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png',
title: '参与线下宠物活动',
description: '参加指定城市的线下宠物主题活动并拍照记录',
deadline: '2025-05-01',
status: 'SUBMITTED', //
submitTime: '2025-04-25'
}
]
pendingTasks: [],
acceptedTasks: []
}
},
onLoad() {
onShow() {
//
this.getTaskList()
//
this.updateBadgeCount()
},
methods: {
sectionChange(index) {
this.curNow = index;
this.getTaskList()
},
getTaskList() {
// API
// API使
//
/*
getTaskList().then(res=>{
getTaskList({
status : this.curNow
}).then(res=>{
if (res && res.code === 200) {
let rows = res.rows || []
console.log(rows)
this.pendingTasks = rows.filter(item=>item.status=="PENDING")
this.acceptedTasks = rows.filter(item=>item.status!="PENDING")
// status01
this.pendingTasks = rows.filter(item => item.status === 0).map(item => this.formatTaskItem(item))
this.acceptedTasks = rows.filter(item => item.status === 1).map(item => this.formatTaskItem(item))
this.updateBadgeCount()
}
})
*/
// 使
console.log('加载任务列表')
//
this.updateBadgeCount()
},
//
formatTaskItem(item) {
return {
id: item.id,
taskType: item.taskName || '任务',
reward: item.taskMoney || '0',
icon: item.taskIcon || 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png',
title: item.title || '',
description: item.theme || '',
deadline: item.taskEndTime ? this.formatDate(item.taskEndTime) : '',
status: this.getTaskStatus(item.taskState, item.examineState),
rejectReason: item.examineText || ''
}
},
//
getTaskStatus(taskState, examineState) {
// taskState: examineState:
if (taskState === 0) return 'ACCEPTED'; //
if (taskState === 1 && examineState === 0) return 'SUBMITTED'; //
if (taskState === 1 && examineState === 1) return 'APPROVED'; //
if (taskState === 1 && examineState === 2) return 'REJECTED'; //
return 'ACCEPTED'; //
},
//
formatDate(dateStr) {
if (!dateStr) return '';
let date = new Date(dateStr);
let year = date.getFullYear();
let month = (date.getMonth() + 1).toString().padStart(2, '0');
let day = date.getDate().toString().padStart(2, '0');
return `${year}-${month}-${day}`;
},
updateBadgeCount() {
//
@ -310,9 +193,7 @@
content: `确定接受任务: ${task.title}`,
success: res => {
if (res.confirm) {
//
/*
acceptTask(task.id).then(res => {
acceptTask({id : task.id}).then(res => {
if (res && res.code === 200) {
uni.showToast({
title: '任务接受成功',
@ -322,24 +203,6 @@
this.getTaskList();
}
});
*/
//
const index = this.pendingTasks.findIndex(item => item.id === task.id);
if (index !== -1) {
const acceptedTask = {
...this.pendingTasks[index],
status: 'ACCEPTED'
};
this.acceptedTasks.push(acceptedTask);
this.pendingTasks.splice(index, 1);
this.updateBadgeCount();
uni.showToast({
title: '任务接受成功',
icon: 'success'
});
}
}
}
});
@ -374,16 +237,6 @@
'APPROVED': '已通过'
};
return statusMap[status] || status;
},
getStatusClass(status) {
//
const classMap = {
'ACCEPTED': 'status-pending',
'SUBMITTED': 'status-reviewing',
'REJECTED': 'status-rejected',
'APPROVED': 'status-approved'
};
return classMap[status] || '';
}
}
}


+ 225
- 129
pages_order/task/taskUpload.vue View File

@ -1,56 +1,53 @@
<template>
<view class="task-upload">
<!-- 驳回原因提示 -->
<view class="reject-tip" v-if="isRejected">
<text>拒绝原因:{{taskInfo.rejectReason || '部分任务要求不符合'}}</text>
</view>
<!-- 任务头部信息 -->
<view class="task-header">
<view class="task-title">{{taskInfo.title}}</view>
<view class="task-deadline">请于{{taskInfo.deadline}}之前上传任务超时将自动取消</view>
<view class="task-deadline">请于{{taskInfo.taskEndTime ? formatDate(taskInfo.taskEndTime) : ''}}之前上传任务超时将自动取消</view>
</view>
<!-- 驳回原因提示(如果任务被驳回) -->
<view class="reject-box" v-if="isRejected">
<view class="reject-title">审核未通过原因</view>
<view class="reject-reason">{{taskInfo.examineText || '暂无驳回原因'}}</view>
</view>
<!-- 上传表单 -->
<view class="upload-form">
<view class="form-title">任务完成凭证</view>
<!-- 笔记链接 -->
<!-- 链接输入 -->
<view class="form-item">
<view class="item-label">笔记链接</view>
<view class="item-content">
<u-textarea v-model="formData.noteLink" placeholder="猫妈狗爸" maxlength="300" height="120"></u-textarea>
<view class="word-count">{{formData.noteLink.length || 0}}/300</view>
<view class="form-label">笔记/视频链接</view>
<view class="form-input">
<u-input v-model="formData.examineText" placeholder="请输入小红书/抖音等平台的笔记链接" />
</view>
</view>
<!-- 笔记截 -->
<!-- 片上传 -->
<view class="form-item">
<view class="item-label">笔记截图 <text class="required">*</text></view>
<view class="item-content">
<view class="form-label">证明截图</view>
<view class="form-notice">请上传任务完成的截图证明例如发布成功的截图</view>
<view class="upload-box">
<u-upload
:fileList="fileList"
@afterRead="afterRead"
@delete="deletePic"
:maxCount="6"
name="1"
:multiple="true"
:maxSize="10 * 1024 * 1024"
name="examineImage"
multiple
:maxCount="3"
></u-upload>
<view class="upload-tips">请上传任务完成的截图凭证最多6张每张不超过10MB</view>
</view>
</view>
</view>
<!-- 提交按钮 -->
<view class="submit-btn">
<u-button type="primary" color="#ffaa48" text="确认上传" @click="submitTaskHandler"></u-button>
<!-- 提交按钮 -->
<view class="submit-btn">
<u-button type="primary" color="#ffaa48" shape="circle" @click="submitTaskHandler">提交审核</u-button>
</view>
</view>
</view>
</template>
<script>
import { getTaskDetail, submitTask } from "@/api/system/task.js"
import { getTaskDetail, submitTask } from "@/api/order/task.js"
export default {
data() {
return {
@ -60,12 +57,15 @@
taskInfo: {
id: 0,
title: '',
deadline: '',
rejectReason: ''
taskEndTime: '',
examineText: '',
taskState: 0,
examineState: 0
},
formData: {
noteLink: '',
images: []
taskId: 0,
examineImage: [],
examineText: '',
},
fileList: []
}
@ -73,6 +73,7 @@
onLoad(options) {
if (options.id) {
this.taskId = options.id
this.formData.taskId = options.id
this.taskStatus = options.status || ''
this.isRejected = this.taskStatus === 'REJECTED'
this.getTaskDetail()
@ -89,85 +90,193 @@
methods: {
getTaskDetail() {
//
//
/*
getTaskDetail(this.taskId).then(res => {
if (res && res.code === 200) {
this.taskInfo = res.data
//
if (res.data.examineText) {
this.formData.examineText = res.data.examineText;
}
//
if (res.data.examineImage) {
const imageUrls = res.data.examineImage.split(',');
imageUrls.forEach(url => {
if (url) {
this.fileList.push({
url: url,
status: 'success',
message: '已上传',
isImage: true
});
// formData
this.formData.examineImage.push(url);
}
});
}
}
})
*/
//
const mockData = {
id: this.taskId,
title: '发布小红书宣传笔记',
deadline: '2025-03-28',
rejectReason: this.isRejected ? '图片不清晰,请重新上传高清图片' : ''
}
this.taskInfo = mockData
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let uploadTask = uni.uploadFile({
url: 'https://store-test.catmdogd.com/test-api/h5/oss/upload',
filePath: url,
name: 'file',
formData: {
user: 'test'
},
success: (res) => {
if(res && res.data) {
try {
let resData = JSON.parse(res.data);
if(resData.url) {
resolve(resData.url);
} else {
reject("上传失败: 未获取到图片URL");
}
} catch(e) {
reject("上传失败: 解析响应数据错误");
}
} else {
reject("上传失败: 响应数据为空");
}
},
fail: (err) => {
reject("上传失败: " + (err.errMsg || JSON.stringify(err)));
}
});
//
uploadTask.onProgressUpdate((res) => {
//
const index = this.fileList.findIndex(file => file.status === 'uploading');
if(index !== -1) {
//
this.fileList[index].message = '上传中 ' + res.progress + '%';
}
});
})
},
formatDate(dateStr) {
if (!dateStr) return '';
let date = new Date(dateStr);
let year = date.getFullYear();
let month = (date.getMonth() + 1).toString().padStart(2, '0');
let day = date.getDate().toString().padStart(2, '0');
return `${year}-${month}-${day}`;
},
afterRead(event) {
//
const { file } = event
this.fileList.push({
url: file.url,
status: 'success',
message: '上传成功',
name: file.name
//
const fileList = Array.isArray(file) ? file : [file]
//
fileList.forEach(item => {
// UI
const fileListItem = {
...item,
status: 'uploading',
message: '上传中'
}
this.fileList.push(fileListItem)
const currentIndex = this.fileList.length - 1
// 使Promise
this.uploadFilePromise(item.url)
.then(url => {
// URL
this.fileList[currentIndex].status = 'success'
this.fileList[currentIndex].message = '上传成功'
this.fileList[currentIndex].url = url
// URL
this.formData.examineImage.push(url)
})
.catch(err => {
//
this.fileList[currentIndex].status = 'failed'
this.fileList[currentIndex].message = '上传失败'
uni.showToast({
title: '图片上传失败',
icon: 'none'
})
})
})
this.formData.images.push(file.url)
},
deletePic(event) {
//
const index = event.index
this.fileList.splice(index, 1)
this.formData.images.splice(index, 1)
this.formData.examineImage.splice(index, 1)
},
submitTaskHandler() {
//
if (this.formData.images.length === 0) {
//
if (!this.formData.examineText) {
uni.showToast({
title: '请输入笔记链接',
icon: 'none'
})
return
}
if (this.formData.examineImage.length === 0) {
uni.showToast({
title: '请上传任务完成凭证',
title: '请上传至少一张截图',
icon: 'none'
})
return
}
//
/*
//
const isUploading = this.fileList.some(file => file.status === 'uploading')
if (isUploading) {
uni.showToast({
title: '图片正在上传中,请稍候',
icon: 'none'
})
return
}
//
uni.showLoading({
title: '提交中...'
})
//
submitTask({
taskId: this.taskId,
noteLink: this.formData.noteLink,
images: this.formData.images
id: this.taskId,
taskId: this.formData.taskId,
examineText: this.formData.examineText,
examineImage: this.formData.examineImage.join(',')
}).then(res => {
uni.hideLoading()
if (res && res.code === 200) {
uni.showToast({
title: '任务提交成功',
title: '提交成功',
icon: 'success'
})
//
setTimeout(() => {
uni.navigateBack()
}, 1500)
} else {
uni.showToast({
title: res.msg || '提交失败',
icon: 'none'
})
}
})
*/
//
uni.showLoading({
title: '提交中...'
})
setTimeout(() => {
}).catch(err => {
uni.hideLoading()
uni.showToast({
title: '任务提交成功',
icon: 'success'
title: '提交失败',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 1500)
}, 1500)
console.error('提交任务失败:', err)
})
}
}
}
@ -177,91 +286,78 @@
.task-upload {
background-color: #f5f5f7;
min-height: 100vh;
padding-bottom: 120rpx;
.reject-tip {
background-color: #FFF1F0;
padding: 20rpx 30rpx;
text {
color: #FF5722;
font-size: 28rpx;
}
}
.task-header {
background-color: #FFFFFF;
padding: 30rpx;
.task-title {
font-size: 32rpx;
font-size: 36rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;
}
.task-deadline {
font-size: 26rpx;
font-size: 24rpx;
color: #999;
}
}
.upload-form {
background-color: #FFFFFF;
.reject-box {
background-color: #FFF1F0;
margin-top: 20rpx;
padding: 30rpx;
.form-title {
font-size: 30rpx;
.reject-title {
font-size: 28rpx;
font-weight: bold;
color: #333;
margin-bottom: 30rpx;
border-left: 8rpx solid #ffaa48;
padding-left: 20rpx;
color: #F5222D;
margin-bottom: 10rpx;
}
.reject-reason {
font-size: 26rpx;
color: #F5222D;
}
}
.upload-form {
background-color: #FFFFFF;
margin-top: 20rpx;
padding: 30rpx;
.form-item {
margin-bottom: 30rpx;
margin-bottom: 40rpx;
.item-label {
font-size: 28rpx;
.form-label {
font-size: 30rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;
.required {
color: #f56c6c;
margin-left: 4rpx;
}
}
.item-content {
position: relative;
.word-count {
position: absolute;
bottom: 10rpx;
right: 10rpx;
font-size: 24rpx;
color: #999;
}
.upload-tips {
font-size: 24rpx;
color: #999;
margin-top: 20rpx;
}
.form-notice {
font-size: 24rpx;
color: #999;
margin-bottom: 20rpx;
}
.form-input {
background-color: #F8F8F8;
border-radius: 8rpx;
padding: 10rpx;
}
.upload-box {
margin-top: 20rpx;
}
}
}
.submit-btn {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: #FFFFFF;
padding: 20rpx 30rpx;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
.submit-btn {
margin-top: 60rpx;
padding: 0 40rpx;
}
}
}
</style>

Loading…
Cancel
Save