This commit is contained in:
2024-03-18 21:52:10 +08:00
parent 7f0f11cf14
commit 8d7f82b07c
13 changed files with 187 additions and 108 deletions

View File

@@ -63,10 +63,10 @@
</template>
<script setup lang='ts'>
import { getCompanyInfo } from '@/api/company';
import { getCompanyInfo, getCompanyList } from '@/api/company';
import { useUserStore } from '@/store';
import { assetsUrl } from '@/utils/assets';
import { goPath } from '@/utils';
import { goPath, setCompanyId } from '@/utils';
import { storeToRefs } from 'pinia';
const store = useUserStore();
@@ -97,6 +97,18 @@ onLoad(async (e) => {
const data = await getCompanyInfo(userInfo.value.companyId);
bannerList.value = data.bannerinx?.map((res: { src: string }) => res.src);
recommendBannerList.value = data.bannerhot?.map((res: { src: string }) => res.src);
getCompanyList(userInfo.value.maOpenId).then(res => {
const companyList = res.map((res: { company: any }) => res.company);
const userList = res.map((res: { user: any }) => res.user);
uni.showActionSheet({
itemList: companyList.map((res: { companyName: string }) => res.companyName),
success: (res) => {
setCompanyId(companyList[res.tapIndex].id);
store.setUserInfo(userList[res.tapIndex]);
}
});
});
});
const swiperChange = (e: any) => {