policeSecurity/collect_information/src/subPages/pages/myProject/myProject.vue

61 lines
1.9 KiB
Vue

<template>
<view class="myProject">
<view v-if="number !== 0">
<view class="myProjectItem" v-for="(item,index) in myProjectList" :key="index">
<view style="display: flex;justify-content: space-between">
<text>{{ item?.name }}</text>
<!--<text>进行中</text>-->
</view>
<view class="myProjectIndex">地址:
<text>{{ item?.provinceName }}{{ item.cityName }}{{ item.districtsName }}{{ item.streetName }}</text>
</view>
<view style="display: flex;justify-content: space-between">
<text>联系人:{{ item?.contactPersonInfo.name }}</text>
<text>电话:{{ item?.contactPersonInfo.telephone }}</text>
</view>
<view class="project">
<view @click="projectClick(items,item?.name)" v-for="(items,index) in item.serviceProjectList" :key="index">
{{ items.name }}
</view>
</view>
</view>
</view>
<view v-else class="myProject" >
<nut-empty image="empty" description="暂无项目">
<div style="margin-top: 10px">
</div>
</nut-empty>
</view>
</view>
</template>
<script setup lang="ts">
import api from "@/request/index";
import {onMounted, ref} from "vue";
import Taro from "@tarojs/taro";
import './myproject.scss'
const myProjectList = ref<MyProjectList[]>()
const number = ref(0)
const getMyServiceProject = async () => {
const resp = await api.get<MyProjectList[]>(`/projectManageIndex/getMyServiceProject`)
myProjectList.value = resp.data
number.value = resp.data.length
}
const projectClick = (items: ServiceProjectList, name: string) => {
console.log(items)
Taro.navigateTo({
url: `/subPages/pages/projectDetails/projectDetails?name=${name}&item=${JSON.stringify(items)}`,
})
}
onMounted(async () => {
await getMyServiceProject()
})
</script>
<!--<style scoped lang="scss">-->
<!--</style>-->