菜大王uniapp开发
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.
 
 
 

90 lines
2.2 KiB

<script setup>
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="{ style, content }">
<topTitle title="加入企业" :style="style" />
<view
v-if="!showTil" class="content" :style="{
height: `${content}px`,
overflowY: 'auto',
}"
>
<view class="tips">
注:创建企业您将成为企业的管理者,加入企业您将成为企业的子账号,若有同事已经创建过企业请加入企业
</view>
<view class="info">
<text class="title">
企业名称
</text>
<view class="input-box">
<input
type="text"
placeholder="请输入您要添加的企业"
data-item="company"
:value="company"
placeholder-style="color:#999999"
@input="(e) => company = e.detail.value"
>
</view>
</view>
<view class="buttons">
<!-- <button class="btn" bindtap="aginAddEnterprise">创建企业</button> -->
<button class="btn" @tap="createEnterprise">
创建企业
</button>
<button class="btn" @tap="addEnterprise">
加入企业
</button>
</view>
</view>
</template>
</navv>
</template>
<style lang="scss" scoped>
@import './joinEnterprise.scss'
</style>