购物车逻辑完善
个人信息存储优化 团购下单
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
import { getCompanyInfo, getCompanyList } from '@/api/company';
|
||||
import { useUserStore } from '@/store';
|
||||
import { assetsUrl } from '@/utils/assets';
|
||||
import { goPath, setCompanyId } from '@/utils';
|
||||
import { getCompanyId, goPath, isLogin, setCompanyId } from '@/utils';
|
||||
import { storeToRefs } from 'pinia';
|
||||
|
||||
const store = useUserStore();
|
||||
@@ -93,22 +93,30 @@ const submenuList = [
|
||||
}
|
||||
];
|
||||
|
||||
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);
|
||||
onLoad((e) => {
|
||||
console.log('home load e ', e);
|
||||
});
|
||||
|
||||
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]);
|
||||
onShow(async () => {
|
||||
if(isLogin()) {
|
||||
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);
|
||||
if(getCompanyId() == undefined) {
|
||||
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