前端-胡立永 1 month ago
parent
commit
e820dc5330
4 changed files with 224 additions and 104 deletions
  1. +9
    -0
      pages.json
  2. +155
    -59
      pages_order/task/taskDetail.vue
  3. +57
    -43
      pages_order/task/taskList.vue
  4. +3
    -2
      utils/getUrl.js

+ 9
- 0
pages.json View File

@ -1,4 +1,13 @@
{
"easycom": {
"autoscan": true,
// customhttps://ask.dcloud.net.cn/question/131175
"custom": {
"^u--(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue",
"^up-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue",
"^u-([^-].*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue"
}
},
"pages": [{
"path": "pages/index",
"style": {


+ 155
- 59
pages_order/task/taskDetail.vue View File

@ -2,30 +2,41 @@
<view class="task-detail">
<!-- 任务头部信息 -->
<view class="task-header">
<view class="task-title">{{taskInfo.title}}</view>
<view class="task-deadline">请于{{taskInfo.taskEndTime ? formatDate(taskInfo.taskEndTime) : ''}}之前上传任务超时将自动取消</view>
<view class="header-content">
<view class="header-top-row">
<view class="task-title">{{ getStatusText() }}</view>
<view class="task-type">{{taskInfo.taskName || ''}}</view>
<view class="task-reward">酬劳 <text> ¥{{taskInfo.taskMoney}}</text> </view>
</view>
<view class="task-deadline">请于
<text style="color: #FF5722;">{{taskInfo.taskEndTime ? formatDate(taskInfo.taskEndTime) : ''}}</text>
之前上传任务超时将自动取消</view>
</view>
</view>
<!-- 任务进度 -->
<view class="task-progress">
<view class="progress-title">任务进度</view>
<uni-steps :options="stepsList" :active="currentStep" active-icon="checkbox-filled" active-color="#ffaa48"></uni-steps>
<uni-steps :options="stepsList" :active="currentStep" active-icon="checkbox-filled"
active-color="#ffaa48"></uni-steps>
</view>
<!-- 任务说明 -->
<view class="task-instruction">
<view class="instruction-header">
<image class="instruction-icon" :src="taskInfo.taskIcon || 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png'"></image>
<!-- <view class="instruction-header">
<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> -->
<view class="instruction-content">
<view class="instruction-main">
<!-- <view class="instruction-main">
<text>{{taskInfo.theme || '暂无任务说明'}}</text>
</view>
</view> -->
<!-- 审核未通过时显示驳回原因 -->
<view class="requirement-section" v-if="taskInfo.examineState === 2">
<!-- <view class="requirement-section" v-if="taskInfo.examineState === 2">
<view class="requirement-title">驳回原因</view>
<view class="other-requirements">
<view class="requirement-item">
@ -33,19 +44,24 @@
<view class="requirement-text">{{taskInfo.examineText || '未提供驳回原因'}}</view>
</view>
</view>
</view>
</view> -->
<!-- 任务图片 -->
<view class="task-images" v-if="taskInfo.image">
<image :src="taskInfo.image" mode="widthFix" style="width: 100%;"></image>
</view>
</view>
</view>
<!-- 底部按钮 -->
<view class="footer-buttons">
<u-button shape="circle" plain @click="cancelTask">取消</u-button>
<u-button shape="circle" color="#ffaa48" v-if="taskInfo.taskState === 0 || taskInfo.examineState === 2" @click="uploadTask">{{taskInfo.examineState === 2 ? '重新上传' : '立即上传'}}</u-button>
<u-button shape="circle" color="#ffaa48" v-if="taskInfo.status == 0"
@click="acceptTaskHandler">接受任务</u-button>
<u-button shape="circle" color="#ffaa48" v-else-if="taskInfo.taskState == 1 || taskInfo.examineState == 2"
@click="uploadTask">{{taskInfo.examineState === 2 ? '重新上传' : '立即上传'}}</u-button>
</view>
</view>
</template>
@ -54,6 +70,10 @@
import {
getTaskDetail
} from "@/api/order/task.js"
import {
getTaskList,
acceptTask
} from "@/api/order/task.js"
export default {
data() {
return {
@ -70,8 +90,7 @@
image: '',
taskIcon: ''
},
stepsList: [
{
stepsList: [{
title: '接受任务'
},
{
@ -84,15 +103,38 @@
title: '酬劳到账'
}
],
currentStep: 0
currentStep: 0,
id : 0,
}
},
onLoad(options) {
if (options.id) {
this.id = options.id
this.loadTaskDetail(options.id);
}
},
methods: {
acceptTaskHandler(task) {
//
uni.showModal({
title: '接受任务',
content: `确定接受任务: ${task.title}`,
success: res => {
if (res.confirm) {
acceptTask({id : task.id}).then(res => {
if (res && res.code === 200) {
uni.showToast({
title: '任务接受成功',
icon: 'success'
});
//
this.loadTaskDetail(this.id);
}
});
}
}
});
},
loadTaskDetail(taskId) {
getTaskDetail(taskId).then(res => {
if (res && res.code === 200) {
@ -141,6 +183,22 @@
uni.navigateTo({
url: `/pages_order/task/taskUpload?id=${this.taskInfo.id}&status=${this.taskInfo.examineState === 2 ? 'REJECTED' : 'ACCEPTED'}`
});
},
getStatusText() {
if (this.taskInfo.status === 0) {
return '待接受';
} else if (this.taskInfo.taskState === 0) {
return '待上传';
} else if (this.taskInfo.taskState === 1) {
if (this.taskInfo.examineState === 0) {
return '待审核';
} else if (this.taskInfo.examineState === 1) {
return '审核通过';
} else if (this.taskInfo.examineState === 2) {
return '审核未通过';
}
}
return '';
}
}
}
@ -151,29 +209,66 @@
background-color: #f5f5f7;
min-height: 100vh;
padding-bottom: 120rpx;
.task-header {
background-color: #FFFFFF;
padding: 30rpx;
.task-title {
font-size: 36rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;
}
.task-deadline {
font-size: 24rpx;
color: #999;
margin: 20rpx;
border-radius: 20rpx;
background: linear-gradient(to bottom, #FFE4BB66, #fff, #fff, #fff);
.header-content {
.header-top-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
.task-title {
font-size: 30rpx;
flex-shrink: 0;
font-weight: 900;
}
.task-type {
color: #C68C5B;
font-size: 26rpx;
background-color: #FFE4BB;
padding: 10rpx 30rpx;
border-radius: 30rpx;
text-align: center;
margin: 0 10rpx;
width: fit-content;
}
.task-reward {
font-size: 26rpx;
color: #333;
flex-shrink: 0;
margin-left: auto;
text {
color: #FF5722;
font-weight: bold;
margin-left: 10rpx;
font-size: 30rpx;
}
}
}
.task-deadline {
font-size: 24rpx;
color: #999;
}
}
}
.task-progress {
background-color: #FFFFFF;
margin-top: 20rpx;
margin: 20rpx;
border-radius: 20rpx;
padding: 30rpx;
.progress-title {
font-size: 30rpx;
font-weight: bold;
@ -181,58 +276,59 @@
margin-bottom: 30rpx;
}
}
.task-instruction {
background-color: #FFFFFF;
margin-top: 20rpx;
margin: 20rpx;
border-radius: 20rpx;
padding: 30rpx;
.instruction-header {
display: flex;
align-items: center;
margin-bottom: 30rpx;
.instruction-icon {
width: 60rpx;
height: 60rpx;
margin-right: 20rpx;
}
.instruction-title {
font-size: 32rpx;
font-weight: bold;
color: #A94F20;
}
}
.instruction-content {
.instruction-main {
padding: 20rpx 0;
border-bottom: 1px solid #EEEEEE;
margin-bottom: 20rpx;
text {
font-size: 28rpx;
color: #666;
line-height: 1.6;
}
}
.requirement-section {
margin-bottom: 30rpx;
.requirement-title {
font-size: 28rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;
}
.requirement-content {
padding: 20rpx;
background-color: #FFF4E5;
border-radius: 10rpx;
text {
display: block;
font-size: 26rpx;
@ -240,17 +336,17 @@
line-height: 1.8;
}
}
.title-examples {
background-color: #FFF4E5;
padding: 20rpx;
border-radius: 10rpx;
.example-item {
display: flex;
align-items: center;
margin-bottom: 15rpx;
.example-tag {
width: 50rpx;
height: 50rpx;
@ -263,24 +359,24 @@
font-size: 24rpx;
margin-right: 20rpx;
}
.example-text {
font-size: 26rpx;
color: #A94F20;
}
}
}
.other-requirements {
background-color: #FFF4E5;
padding: 20rpx;
border-radius: 10rpx;
.requirement-item {
display: flex;
align-items: center;
margin-bottom: 15rpx;
.requirement-tag {
width: 40rpx;
height: 40rpx;
@ -291,7 +387,7 @@
font-size: 24rpx;
margin-right: 20rpx;
}
.requirement-text {
font-size: 26rpx;
color: #A94F20;
@ -299,11 +395,11 @@
}
}
}
.note-text {
text-align: center;
margin-top: 20rpx;
text {
font-size: 24rpx;
color: #FF5722;
@ -311,7 +407,7 @@
}
}
}
.footer-buttons {
position: fixed;
bottom: 0;
@ -322,8 +418,8 @@
display: flex;
justify-content: space-around;
align-items: center;
box-shadow: 0 -2rpx 10rpx rgba(0,0,0,0.05);
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
.u-button {
width: 300rpx;
height: 80rpx;


+ 57
- 43
pages_order/task/taskList.vue View File

@ -1,24 +1,28 @@
<template>
<view class="task-center">
<u-subsection :list="tabList"
<!-- <u-subsection :list="tabList"
active-color="#ffaa48"
bg-color="#fff"
inactive-color="#aaaaaa"
font-size="16"
:current="curNow"
@change="sectionChange"></u-subsection>
@change="sectionChange"></u-subsection> -->
<!-- <u-tabs :list="list1" @click="sectionChange"></u-tabs> -->
<!-- <view class="container-tabs">
<up-tabs :list="tabList" lineWidth="68rpx" :activeStyle="{
color: '#ffaa48',
<view class="container-tabs">
<u-tabs :list="tabList"
:scrollable="false"
lineWidth="68rpx" :activeStyle="{
color: '#fff',
fontWeight: 'bold',
transform: 'scale(1.05)'
}" :inactiveStyle="{
color: '#555',
color: '#eee',
transform: 'scale(1)'
}" :itemStyle="{height:'88rpx',padding:'0 52rpx'}" lineColor="#ffaa48" @click="sectionChange"></up-tabs>
</view> -->
}" :itemStyle="{height:'88rpx',padding:'0 52rpx'}" lineColor="#fff" @click="sectionChange"></u-tabs>
</view>
<!-- 待接受任务列表 -->
<view v-if="curNow === 0">
@ -33,7 +37,7 @@
</view>
<view class="task-content">
<view class="task-icon">
<image :src="item.icon" style="width: 120rpx; height: 120rpx;" mode="aspectFill"></image>
<image :src="item.icon" style="width: 150rpx; height: 150rpx;" mode="aspectFill"></image>
</view>
<view class="task-info">
<view class="task-title">{{item.title}}</view>
@ -61,17 +65,18 @@
<image src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/index/point.png" mode="heightFix"></image>
</view>
<view class="task-type">{{item.taskType}}</view>
<view class="task-reward">酬劳 <text> ¥{{item.reward}}</text> </view>
<!-- <view class="task-reward">酬劳 <text> ¥{{item.reward}}</text> </view> -->
<view class="task-status-tag" :class="{'status-pending': item.status === 'ACCEPTED', 'status-reviewing': item.status === 'SUBMITTED', 'status-rejected': item.status === 'REJECTED', 'status-approved': item.status === 'APPROVED'}">{{getStatusText(item.status)}}</view>
</view>
<view class="task-content">
<view class="task-icon">
<image :src="item.icon" style="width: 120rpx; height: 120rpx;" mode="aspectFill"></image>
<image :src="item.icon" style="width: 150rpx; height: 150rpx;" mode="aspectFill"></image>
</view>
<view class="task-info">
<view class="task-title">{{item.title}}</view>
<view class="task-desc">{{item.description}}</view>
<view class="task-deadline">任务截止日期: {{item.deadline}}</view>
<view class="task-status-tag" :class="{'status-pending': item.status === 'ACCEPTED', 'status-reviewing': item.status === 'SUBMITTED', 'status-rejected': item.status === 'REJECTED', 'status-approved': item.status === 'APPROVED'}">{{getStatusText(item.status)}}</view>
<!-- <view class="task-status-tag" :class="{'status-pending': item.status === 'ACCEPTED', 'status-reviewing': item.status === 'SUBMITTED', 'status-rejected': item.status === 'REJECTED', 'status-approved': item.status === 'APPROVED'}">{{getStatusText(item.status)}}</view> -->
</view>
</view>
<view class="task-footer">
@ -124,7 +129,7 @@
this.getTaskList()
},
methods: {
sectionChange(index) {
sectionChange({index}) {
this.curNow = index;
this.getTaskList()
},
@ -246,6 +251,39 @@
.task-center {
background-color: #f5f5f7;
min-height: 100vh;
.container-tabs{
background-color: #FFBF60;
}
.task-status-tag {
display: inline-block;
font-size: 24rpx;
padding: 6rpx 20rpx;
border-radius: 20rpx;
margin-top: 10rpx;
margin-left: auto;
&.status-pending {
// background-color: #E6F7FF;
color: #1890FF;
}
&.status-reviewing {
// background-color: #FFF7E6;
color: #FA8C16;
}
&.status-rejected {
// background-color: #FFF1F0;
color: #F5222D;
}
&.status-approved {
// background-color: #F6FFED;
color: #52C41A;
}
}
.task-card {
background-color: #FFFFFF;
@ -272,9 +310,9 @@
}
.task-type {
color: #A94F20;
color: #C68C5B;
font-size: 26rpx;
background-color: #FFF4E5;
background-color: #FFE4BB;
padding: 10rpx 30rpx;
border-radius: 30rpx;
}
@ -304,6 +342,9 @@
.task-info {
flex: 1;
position: relative;
display: flex;
flex-direction: column;
gap: 10rpx;
.task-title {
font-size: 32rpx;
@ -316,6 +357,7 @@
font-size: 28rpx;
color: #666;
margin-bottom: 10rpx;
color: #FFC673;
}
.task-deadline {
@ -323,34 +365,6 @@
color: #999;
margin-bottom: 10rpx;
}
.task-status-tag {
display: inline-block;
font-size: 24rpx;
padding: 6rpx 20rpx;
border-radius: 20rpx;
margin-top: 10rpx;
&.status-pending {
background-color: #E6F7FF;
color: #1890FF;
}
&.status-reviewing {
background-color: #FFF7E6;
color: #FA8C16;
}
&.status-rejected {
background-color: #FFF1F0;
color: #F5222D;
}
&.status-approved {
background-color: #F6FFED;
color: #52C41A;
}
}
}
}


+ 3
- 2
utils/getUrl.js View File

@ -5,11 +5,12 @@ const accountInfo = wx.getAccountInfoSync();
const api={
develop:"http://h5.xzaiyp.top",
develop:"http://127.0.0.1:8002",
// develop:"http://h5.xzaiyp.top",
// develop:"https://api.catmdogd.com/prod-api",
// develop:"https://api-test.catmdogd.com/test-api",
trial:"https://pet-admin.hhlm1688.com/api",
release:"https://api.catmdogd.com/prod-api",
release:"https://api.catmdogd.com",
}
const currentUrl = api[current];

Loading…
Cancel
Save