|
|
@ -1,157 +1,171 @@ |
|
|
|
<template> |
|
|
|
<up-list @scrolltolower="scrolltolower"> |
|
|
|
<up-list-item v-for="item in orderList"> |
|
|
|
<view class="mb28 container-list-item"> |
|
|
|
<view class="flex-between flex" style="background: #FFF4E5;padding: 22rpx 42rpx"> |
|
|
|
<view> |
|
|
|
<text v-if="current != 2">待接单</text> |
|
|
|
</view> |
|
|
|
<view>本单酬劳 |
|
|
|
<text style="color: #FF530A">¥{{ item.price }}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="container-list"> |
|
|
|
<view class="flex-between flex mb28"> |
|
|
|
<up-image style="flex-shrink:0" class="mr20" width="70px" height="70px" |
|
|
|
src="https://cdn.catmdogd.com/Work/image/work/tx.png" shape="circle"></up-image> |
|
|
|
<view> |
|
|
|
<view class="font28 col3">服务天数: 共2天 I 12-07,12-08</view> |
|
|
|
<view style="margin: 18rpx 0">期望上门时间:早</view> |
|
|
|
<view>中华田园犬(小型犬) | 专业喂养+提前熟悉+陪玩</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<view class="mb28 address">{{ item.address }}</view> |
|
|
|
<view class="mb28">订单为系统派发,请确认订单信息后再抢单</view> |
|
|
|
<view class="flex flex-between"> |
|
|
|
<up-button @click="unableToAcceptOrder(item.id)" text="无法接单" shape="circle" plain |
|
|
|
class="mr20"></up-button> |
|
|
|
<up-button @click="toOrderDetail(item.id)" type="primary" text="查看详情后接单" shape="circle" |
|
|
|
color="#FFAA48"></up-button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</up-list-item> |
|
|
|
</up-list> |
|
|
|
|
|
|
|
<Modal @confirm="confirm" @cancel="cancel" ref="modal"> |
|
|
|
<template> |
|
|
|
<view class="tip"> |
|
|
|
确认要拒绝该系统派单的订单吗? |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</Modal> |
|
|
|
<up-popup :show="showCause" mode="bottom" @close="close" @open="open" :round="10" :closeable="true" |
|
|
|
:safeAreaInsetBottom="false" :customStyle="{padding:'60rpx 20rpx 40rpx 20rpx;position:relative;height:auto;'}"> |
|
|
|
<view> |
|
|
|
<view style="position:absolute;top: 20rpx;text-align: center;width: 100%;"> |
|
|
|
请补充无法接单原因 |
|
|
|
</view> |
|
|
|
<view style="margin: 20rpx 0rpx;"> |
|
|
|
<up-textarea style="background-color: #f0f0f0;" v-model="cause" placeholder="请输入内容" |
|
|
|
border="none"></up-textarea> |
|
|
|
</view> |
|
|
|
<up-button @click="noneOrder" color="#FFBF60" text="提交" shape="circle"></up-button> |
|
|
|
</view> |
|
|
|
</up-popup> |
|
|
|
<up-list @scrolltolower="scrolltolower"> |
|
|
|
<up-list-item v-for="item in orderList"> |
|
|
|
<view class="mb28 container-list-item"> |
|
|
|
<view class="flex-between flex" style="background: #FFF4E5;padding: 22rpx 42rpx"> |
|
|
|
<view> |
|
|
|
<text v-if="current != 2">待接单</text> |
|
|
|
</view> |
|
|
|
<view>本单酬劳 |
|
|
|
<text style="color: #FF530A">¥{{ item.price }}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="container-list"> |
|
|
|
<view class="flex-between flex mb28"> |
|
|
|
<up-image style="flex-shrink:0" class="mr20" width="70px" height="70px" src="" |
|
|
|
shape="circle"></up-image> |
|
|
|
<view> |
|
|
|
<!-- <view class="font28 col3">服务天数: 共2天 I {{itemService.serviceDate}}</view> --> |
|
|
|
<view class="font28 col3">服务天数: 共{{ item.h5OrderVO.orderServiceList.length }}天 I |
|
|
|
|
|
|
|
<text v-for="itemService in item.h5OrderVO.orderServiceList" :key="itemService.id"> |
|
|
|
{{ itemService.serviceDate }} |
|
|
|
</text> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- <view style="margin: 18rpx 0">期望上门时间:{{itemService.expectServiceTime}}</view> --> |
|
|
|
<view>中华田园犬(小型犬) | |
|
|
|
|
|
|
|
<text v-for="itemPet in item.h5OrderVO.orderItemList" :key="itemPet.id"> |
|
|
|
{{ itemPet.productName }} |
|
|
|
</text> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="mb28 address">{{ item.address }}</view> |
|
|
|
<view class="mb28">订单为系统派发,请确认订单信息后再抢单</view> |
|
|
|
<view class="flex flex-between"> |
|
|
|
<up-button @click="unableToAcceptOrder(item.id)" text="无法接单" shape="circle" plain |
|
|
|
class="mr20"></up-button> |
|
|
|
<up-button @click="toOrderDetail(item.id)" type="primary" text="查看详情后接单" shape="circle" |
|
|
|
color="#FFAA48"></up-button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</up-list-item> |
|
|
|
</up-list> |
|
|
|
|
|
|
|
<Modal @confirm="confirm" @cancel="cancel" ref="modal"> |
|
|
|
<template> |
|
|
|
<view class="tip"> |
|
|
|
确认要拒绝该系统派单的订单吗? |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</Modal> |
|
|
|
<up-popup :show="showCause" mode="bottom" @close="close" @open="open" :round="10" :closeable="true" |
|
|
|
:safeAreaInsetBottom="false" :customStyle="{ padding: '60rpx 20rpx 40rpx 20rpx;position:relative;height:auto;' }"> |
|
|
|
<view> |
|
|
|
<view style="position:absolute;top: 20rpx;text-align: center;width: 100%;"> |
|
|
|
请补充无法接单原因 |
|
|
|
</view> |
|
|
|
<view style="margin: 20rpx 0rpx;"> |
|
|
|
<up-textarea style="background-color: #f0f0f0;" v-model="cause" placeholder="请输入内容" |
|
|
|
border="none"></up-textarea> |
|
|
|
</view> |
|
|
|
<up-button @click="noneOrder" color="#FFBF60" text="提交" shape="circle"></up-button> |
|
|
|
</view> |
|
|
|
</up-popup> |
|
|
|
</template> |
|
|
|
<script setup> |
|
|
|
import { |
|
|
|
computed, |
|
|
|
ref |
|
|
|
} from "vue"; |
|
|
|
import Modal from "@/components/Modal/index.vue" |
|
|
|
import { |
|
|
|
endByOrderId |
|
|
|
} from "@/api/receivingHall/index.js" |
|
|
|
import { useStore } from "vuex" |
|
|
|
|
|
|
|
const modal = ref(null); |
|
|
|
const showCause = ref(false); |
|
|
|
const cause = ref(""); |
|
|
|
const id = ref(0); |
|
|
|
const store = useStore(); |
|
|
|
|
|
|
|
const userInfo = computed(() => { |
|
|
|
return store.getters.userInfo |
|
|
|
}) |
|
|
|
|
|
|
|
const scrolltolower = () => { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
|
orderList: { |
|
|
|
type: Array, |
|
|
|
default: () => [] |
|
|
|
}, |
|
|
|
current: { |
|
|
|
type: Number, |
|
|
|
required: true |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
const emits = defineEmits(['update']); |
|
|
|
|
|
|
|
// 跳转订单详情 |
|
|
|
const toOrderDetail = (id) => { |
|
|
|
uni.navigateTo({ |
|
|
|
url: `/otherPages/orderTakingManage/detail/index?id=${id}` |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
const confirm = () => { |
|
|
|
open(); |
|
|
|
} |
|
|
|
|
|
|
|
const cancel = () => { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const unableToAcceptOrder = (currentId) => { |
|
|
|
modal.value.open(); |
|
|
|
id.value = currentId; |
|
|
|
} |
|
|
|
|
|
|
|
const open = () => { |
|
|
|
showCause.value = true; |
|
|
|
} |
|
|
|
|
|
|
|
const close = () => { |
|
|
|
showCause.value = false; |
|
|
|
} |
|
|
|
|
|
|
|
// 无法接单逻辑 |
|
|
|
const noneOrder = async () => { |
|
|
|
if(!id.value || !userInfo.value.userId) return |
|
|
|
if (!cause.value) { |
|
|
|
return uni.showToast({ |
|
|
|
title: '提交无法接单原因成功~', |
|
|
|
icon: "none" |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
let response = await endByOrderId({ |
|
|
|
id : id.value, |
|
|
|
reason : cause.value, |
|
|
|
userId : userInfo.value.userId |
|
|
|
}); |
|
|
|
if (response.code == 200 && response.data) { |
|
|
|
uni.showToast({ |
|
|
|
title: '提交无法接单原因成功~', |
|
|
|
icon: "none" |
|
|
|
}); |
|
|
|
emits('update'); |
|
|
|
close(); |
|
|
|
} |
|
|
|
} |
|
|
|
import { |
|
|
|
computed, |
|
|
|
ref |
|
|
|
} from "vue"; |
|
|
|
import Modal from "@/components/Modal/index.vue" |
|
|
|
import { |
|
|
|
endByOrderId |
|
|
|
} from "@/api/receivingHall/index.js" |
|
|
|
import { useStore } from "vuex" |
|
|
|
|
|
|
|
const modal = ref(null); |
|
|
|
const showCause = ref(false); |
|
|
|
const cause = ref(""); |
|
|
|
const id = ref(0); |
|
|
|
const store = useStore(); |
|
|
|
|
|
|
|
const userInfo = computed(() => { |
|
|
|
return store.getters.userInfo |
|
|
|
}) |
|
|
|
|
|
|
|
const scrolltolower = () => { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
|
orderList: { |
|
|
|
type: Array, |
|
|
|
default: () => [] |
|
|
|
}, |
|
|
|
current: { |
|
|
|
type: Number, |
|
|
|
required: true |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
const emits = defineEmits(['update']); |
|
|
|
|
|
|
|
// 跳转订单详情 |
|
|
|
const toOrderDetail = (id) => { |
|
|
|
uni.navigateTo({ |
|
|
|
url: `/otherPages/orderTakingManage/detail/index?id=${id}` |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
const confirm = () => { |
|
|
|
open(); |
|
|
|
} |
|
|
|
|
|
|
|
const cancel = () => { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const unableToAcceptOrder = (currentId) => { |
|
|
|
modal.value.open(); |
|
|
|
id.value = currentId; |
|
|
|
} |
|
|
|
|
|
|
|
const open = () => { |
|
|
|
showCause.value = true; |
|
|
|
} |
|
|
|
|
|
|
|
const close = () => { |
|
|
|
showCause.value = false; |
|
|
|
} |
|
|
|
|
|
|
|
// 无法接单逻辑 |
|
|
|
const noneOrder = async () => { |
|
|
|
if (!id.value || !userInfo.value.userId) return |
|
|
|
if (!cause.value) { |
|
|
|
return uni.showToast({ |
|
|
|
title: '提交无法接单原因成功~', |
|
|
|
icon: "none" |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
let response = await endByOrderId({ |
|
|
|
id: id.value, |
|
|
|
reason: cause.value, |
|
|
|
userId: userInfo.value.userId |
|
|
|
}); |
|
|
|
if (response.code == 200 && response.data) { |
|
|
|
uni.showToast({ |
|
|
|
title: '提交无法接单原因成功~', |
|
|
|
icon: "none" |
|
|
|
}); |
|
|
|
emits('update'); |
|
|
|
close(); |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
@import "../index"; |
|
|
|
@import "../index"; |
|
|
|
|
|
|
|
.tip { |
|
|
|
text-align: center; |
|
|
|
padding: 25rpx 0rpx; |
|
|
|
} |
|
|
|
.tip { |
|
|
|
text-align: center; |
|
|
|
padding: 25rpx 0rpx; |
|
|
|
} |
|
|
|
</style> |