|
|
|
@ -3,13 +3,50 @@ import { onLoad } from "@dcloudio/uni-app"; |
|
|
|
import { ref } from "vue"; |
|
|
|
import navv from "@/components/nav/nav.vue"; |
|
|
|
import TopTitle from "@/components/topTitle/topTitle.vue"; |
|
|
|
import { getJoinEnterpriseApi } from "@/libs/api"; |
|
|
|
|
|
|
|
/** |
|
|
|
* 标注 |
|
|
|
*/ |
|
|
|
const showTil = ref(false); |
|
|
|
/** |
|
|
|
* 企业名称 |
|
|
|
*/ |
|
|
|
const company = ref(""); |
|
|
|
/** |
|
|
|
* 加入企业列表 |
|
|
|
*/ |
|
|
|
const enterprise = ref([]); |
|
|
|
|
|
|
|
function inputEdit() { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function createEnterprise() { } |
|
|
|
|
|
|
|
async function addEnterprise() { |
|
|
|
const res = await getJoinEnterpriseApi({ |
|
|
|
search: company.value, |
|
|
|
pageSize: 500, |
|
|
|
pageNum: 1, |
|
|
|
}); |
|
|
|
if (res.code !== "0") { |
|
|
|
return; |
|
|
|
} |
|
|
|
// 将接口返回数据中的 null 值统一替换为空字符串,避免后续渲染异常 |
|
|
|
res.data.forEach(item => |
|
|
|
Object.keys(item).forEach(k => item[k] ??= ""), |
|
|
|
); |
|
|
|
enterprise.value = res.data; |
|
|
|
showTil.value = true; |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
|
<navv> |
|
|
|
<template #default="{ content, fixStyle }"> |
|
|
|
<template #default="{ fixStyle, padStyle }"> |
|
|
|
<TopTitle title="加入企业" :style="fixStyle" /> |
|
|
|
<view class="content" wx:if="{{!showTil}}"> |
|
|
|
<view v-if="!showTil" class="content" :style="padStyle"> |
|
|
|
<view class="tips"> |
|
|
|
注:创建企业您将成为企业的管理者,加入企业您将成为企业的子账号,若有同事已经创建过企业请加入企业 |
|
|
|
</view> |
|
|
|
@ -22,19 +59,18 @@ import TopTitle from "@/components/topTitle/topTitle.vue"; |
|
|
|
type="text" |
|
|
|
placeholder="请输入您要添加的企业" |
|
|
|
data-item="company" |
|
|
|
type="text" |
|
|
|
:value="company" |
|
|
|
placeholder-style="color:#999999" |
|
|
|
@input="inputEdit" |
|
|
|
@input="(e) => company = e.detail.value" |
|
|
|
> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="buttons"> |
|
|
|
<!-- <button class="btn" bindtap="aginAddEnterprise">创建企业</button> --> |
|
|
|
<button class="btn" data-create="{{true}}" @tap="addEnterprise"> |
|
|
|
<button class="btn" @tap="createEnterprise"> |
|
|
|
创建企业 |
|
|
|
</button> |
|
|
|
<button class="btn" data-create="{{false}}" @tap="addEnterprise"> |
|
|
|
<button class="btn" @tap="addEnterprise"> |
|
|
|
加入企业 |
|
|
|
</button> |
|
|
|
</view> |
|
|
|
@ -42,3 +78,7 @@ import TopTitle from "@/components/topTitle/topTitle.vue"; |
|
|
|
</template> |
|
|
|
</navv> |
|
|
|
</template> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
@import './joinEnterprise.scss' |
|
|
|
</style> |