优化
This commit is contained in:
@@ -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) => {
|
||||
|
Reference in New Issue
Block a user