h5
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

45 lines
1.5 KiB

<template>
<view>
<!-- 上传提交 v-if="isMine && deliver" -->
<!-- TODO: 2022年春节为了演示所有人都能看到交付物插件 -->
<p-deliver-upload v-if="deliver" @upload-success="getDeliverData" class="p-2" @edit-success="getDeliverData"></p-deliver-upload>
<p-deliver-check
v-if="deliver && deliver.details && deliver.details.length"
@check-success="getDeliverData"
class="p-2"
></p-deliver-check>
</view>
</template>
<script setup>
import { useStore } from 'vuex';
import { ref, inject, provide, computed, watch } from 'vue';
import pDeliverUpload from "@/plugins/p-deliver/p-deliver-upload.vue"
import pDeliverCheck from "@/plugins/p-deliver/p-deliver-check.vue"
const store = useStore();
const task = inject('task');
const pluginInfo = inject('pluginInfo');
const deliver = ref(null); // 服务端返回的交付物信息
const isMine = computed(() => store.getters['role/isMine']); // 是不是我的任务
// const remindData = computed(() => store.state.socket.remindData); // 小红点
deliver.value = pluginInfo && pluginInfo.data ? JSON.parse(pluginInfo.data) : null;
provide('deliver', deliver);
// 根据任务id获取交付物信息
async function getDeliverData() {
try {
const { id: taskId } = task;
if (!taskId) return;
const param = { taskId };
const data = await uni.$u.api.getDeliverByTaskId(param);
deliver.value = data;
} catch (error) {
console.log('error: ', error);
}
}
// getDeliverData();
</script>