|
@@ -5,39 +5,44 @@ navigationBarBackgroundColor: '#fff'
|
|
|
</route>
|
|
|
<script setup lang="ts">
|
|
|
import Card from '@designer-hub/app/src/components/card.vue'
|
|
|
-
|
|
|
-const tasks = ref([
|
|
|
- {
|
|
|
- status: 0,
|
|
|
- type: 1,
|
|
|
- name: 'imola',
|
|
|
- brand: 'imola瓷砖',
|
|
|
- start: '2024/06/07',
|
|
|
- end: '2024/06/15',
|
|
|
- targe: 30,
|
|
|
- finished: 22,
|
|
|
- },
|
|
|
- {
|
|
|
- status: 0,
|
|
|
- type: 2,
|
|
|
- name: 'imola',
|
|
|
- brand: 'imola瓷砖',
|
|
|
- start: '2024/06/07',
|
|
|
- end: '2024/06/15',
|
|
|
- targe: 30,
|
|
|
- finished: 22,
|
|
|
- },
|
|
|
- {
|
|
|
- status: 0,
|
|
|
- type: 1,
|
|
|
- name: 'imola',
|
|
|
- brand: 'imola瓷砖',
|
|
|
- start: '2024/06/07',
|
|
|
- end: '2024/06/15',
|
|
|
- targe: 30,
|
|
|
- finished: 22,
|
|
|
- },
|
|
|
-])
|
|
|
+import { getTaskList, taskReceive } from '@/core/libs/requests'
|
|
|
+import { useUserStore } from '@/store'
|
|
|
+import { storeToRefs } from 'pinia'
|
|
|
+const userStore = useUserStore()
|
|
|
+const { userInfo } = storeToRefs(userStore)
|
|
|
+// const tasks = ref([
|
|
|
+// {
|
|
|
+// status: 0,
|
|
|
+// type: 1,
|
|
|
+// name: 'imola',
|
|
|
+// brand: 'imola瓷砖',
|
|
|
+// start: '2024/06/07',
|
|
|
+// end: '2024/06/15',
|
|
|
+// targe: 30,
|
|
|
+// finished: 22,
|
|
|
+// },
|
|
|
+// {
|
|
|
+// status: 0,
|
|
|
+// type: 2,
|
|
|
+// name: 'imola',
|
|
|
+// brand: 'imola瓷砖',
|
|
|
+// start: '2024/06/07',
|
|
|
+// end: '2024/06/15',
|
|
|
+// targe: 30,
|
|
|
+// finished: 22,
|
|
|
+// },
|
|
|
+// {
|
|
|
+// status: 0,
|
|
|
+// type: 1,
|
|
|
+// name: 'imola',
|
|
|
+// brand: 'imola瓷砖',
|
|
|
+// start: '2024/06/07',
|
|
|
+// end: '2024/06/15',
|
|
|
+// targe: 30,
|
|
|
+// finished: 22,
|
|
|
+// },
|
|
|
+// ])
|
|
|
+const tasksList = ref([])
|
|
|
const types = ref({
|
|
|
1: { title: '到店', bg: '', bgClass: 'bg-gradient-to-r from-[#cfe0ff] to-[#e1ecff]' },
|
|
|
2: { title: '订单', bg: '', bgClass: 'bg-gradient-to-r from-[#ffe8cf] to-[#fff3e1]' },
|
|
@@ -45,6 +50,16 @@ const types = ref({
|
|
|
const toDetail = async () => {
|
|
|
await uni.navigateTo({ url: '/pages/home/tasks/detail/index' })
|
|
|
}
|
|
|
+const acceptingOrders = async () => {
|
|
|
+ const res = await taskReceive({ brokerId: '', taskId: '' })
|
|
|
+}
|
|
|
+const initData = async () => {
|
|
|
+ const res = await getTaskList({ brokerId: userInfo.value.userId })
|
|
|
+ tasksList.value = res.data
|
|
|
+}
|
|
|
+onMounted(async () => {
|
|
|
+ initData()
|
|
|
+})
|
|
|
</script>
|
|
|
<template>
|
|
|
<div class="bg-white rounded-lg shadow flex m-[18px] p-[11px]">
|
|
@@ -56,7 +71,7 @@ const toDetail = async () => {
|
|
|
<div class="w-6 h-6 relative"></div>
|
|
|
</div>
|
|
|
<div class="flex-grow flex flex-col gap-4 p-4">
|
|
|
- <template v-for="({ type }, i) of tasks" :key="i">
|
|
|
+ <template v-for="({ type }, i) of tasksList" :key="i">
|
|
|
<div @click="toDetail()">
|
|
|
<Card :custom-class="`${types[type].bgClass} p-0`" style="padding: 0">
|
|
|
<div class="flex p-4 items-center">
|
|
@@ -106,12 +121,16 @@ const toDetail = async () => {
|
|
|
<div class="flex items-center border-t border-t-solid border-t-[#efefef] pt-1.5">
|
|
|
<div class="text-black/90 text-sm font-normal font-['PingFang SC']">目标 30</div>
|
|
|
<div class="flex-1"></div>
|
|
|
- <div class="mr-[16px] w-[68px] h-7 px-2.5 py-[3px] rounded-[30px] border border-[#fe5053] justify-center items-center gap-2.5 inline-flex" style="border: 1px solid #fe5053">
|
|
|
+ <div
|
|
|
+ class="mr-[16px] w-[68px] h-7 px-2.5 py-[3px] rounded-[30px] border border-[#fe5053] justify-center items-center gap-2.5 inline-flex"
|
|
|
+ style="border: 1px solid #fe5053"
|
|
|
+ >
|
|
|
<div class="w-9 text-[#ff2d2d] text-xs font-normal font-['PingFang SC']">
|
|
|
不接单
|
|
|
</div>
|
|
|
</div>
|
|
|
<div
|
|
|
+ @click="acceptingOrders()"
|
|
|
class="w-[68px] h-7 px-2.5 py-[3px] bg-[#2357e9] rounded-[30px] justify-center items-center gap-2.5 inline-flex"
|
|
|
>
|
|
|
<div class="text-white text-xs font-normal font-['PingFang SC']">接单</div>
|