weixin_52219567 3 săptămâni în urmă
părinte
comite
383dc33a95

+ 114 - 0
src/App.vue

@@ -92,6 +92,120 @@ onLaunch((data: any) => {
 
     // 控制弹窗展示
     uni.setStorageSync('isOnLoad', true); // 存储是页面是否加载完成的状态
+
+    useSystemStore().getInitFn(async () => {
+
+        // const configStore = useConfigStore()
+
+        // let loginConfig = uni.getStorageSync('login_config')
+        // if (!loginConfig) {
+        //     loginConfig = deepClone(configStore.login)
+        // }
+
+        // let url: any = currRoute()
+        // // 设置主色调
+        // setThemeColor(url)
+
+        // // 判断账号锁定后在登录注册页面不进行请求三方登录注册,防止在页面出不去 member_lock 为账号锁定标识
+        // if (uni.getStorageSync('member_lock') && (['app/pages/auth/index', 'app/pages/auth/login', 'app/pages/auth/register', 'app/pages/auth/resetpwd'].indexOf(url) != -1) && (loginConfig.is_username || loginConfig.is_mobile || loginConfig.is_bind_mobile)) {
+        //     return false
+        // }
+
+        // // 判断是否已登录
+        // if (getToken()) {
+        //     const memberStore: any = useMemberStore()
+
+        //     await memberStore.setToken(getToken(), () => {
+        //         if (!uni.getStorageSync('openid')) {
+        //             const memberInfo = useMemberStore().info
+        //             const login = useLogin()
+
+        //             // #ifdef MP-WEIXIN
+        //             if (memberInfo.mobile) uni.setStorageSync('wap_member_mobile', memberInfo.mobile) // 存储会员手机号,防止重复请求微信获取手机号接口
+        //             if (memberInfo && memberInfo.weapp_openid) {
+        //                 uni.setStorageSync('openid', memberInfo.weapp_openid) // 授权登录后存储openid
+        //             } else {
+        //                 login.getAuthCode({ updateFlag: true }) // 更新openid
+        //             }
+        //             // #endif
+
+        //             // #ifdef H5
+        //             if (isWeixinBrowser()) {
+        //                 if (memberInfo && memberInfo.wx_openid) {
+        //                     uni.setStorageSync('openid', memberInfo.wx_openid)
+        //                 } else {
+        //                     if (data.query.code) {
+        //                         // 检测身份是否合法(当前登录的账号是不是我的),openid有效后才能更新登录
+        //                         login.updateOpenid(data.query.code, () => {
+        //                             login.authLogin({ code: data.query.code })
+        //                         })
+        //                     } else if (loginConfig.is_auth_register && loginConfig.is_force_access_user_info) {
+        //                         // 强制获取用户信息
+        //                         login.getAuthCode({ scopes: 'snsapi_userinfo' })
+        //                     } else {
+        //                         // 静默获取
+        //                         login.getAuthCode({ scopes: 'snsapi_base' })
+        //                     }
+        //                 }
+        //             }
+        //             // #endif
+
+        //         }
+
+        //         // todo 已注册的会员不受影响
+        //         // 开启强制绑定手机号
+        //         if (uni.getStorageSync('isBindMobile')) {
+        //             uni.removeStorageSync('isBindMobile');
+        //         }
+        //         //
+        //         // if (loginConfig.is_bind_mobile && !memberStore.info.mobile) {
+        //         //     // 强制绑定手机号
+        //         //     uni.setStorageSync('isBindMobile', true)
+        //         // }
+        //     })
+
+        // }
+
+        // if (!getToken()) {
+
+        //     // #ifdef MP
+        //     // 小程序 会员退出后不会自动登录
+        //     if (uni.getStorageSync('autoLoginLock')) return;
+        //     // #endif
+
+        //     const login = useLogin()
+
+        //     // #ifdef MP
+        //     // 第三方平台自动注册登录
+        //     login.getAuthCode()
+        //     // #endif
+
+        //     // #ifdef H5
+        //     if (isWeixinBrowser()) {
+        //         if (uni.getStorageSync('autoLoginLock') && !uni.getStorageSync('wechat_login_back')) return;
+        //         if (uni.getStorageSync('wechat_login_back')) {
+        //             uni.removeStorageSync('wechat_login_back') // 删除微信公众号手动授权登录回调标识
+        //             if (data.query.code) {
+        //                 login.authLogin({ code: data.query.code })
+        //             }
+        //         } else if (loginConfig.is_auth_register && loginConfig.is_force_access_user_info) {
+        //             // 开启自动注册会员,并且强制获取用户信息
+        //             // 检测是否已授权获取用户信息
+        //             // let nickname = uni.getStorageSync('nickname');
+        //             // let avatar = uni.getStorageSync('avatar');
+        //             // let openid = uni.getStorageSync('openid');
+        //             // if (!nickname || !avatar || !openid) {}
+        //             login.getAuthCode({ scopes: 'snsapi_userinfo' })
+        //         } else {
+        //             // 检测是否已授权获取用户信息
+        //             // let openid = uni.getStorageSync('openid');
+        //             // if (!openid) {}
+        //             login.getAuthCode({ scopes: 'snsapi_base' }) // 静默获取
+        //         }
+        //     }
+        //     // #endif
+        // }
+    })
 })
 
 onShow(() => {

+ 2 - 2
src/addon/shop/api/order.ts

@@ -46,8 +46,8 @@ export function getShopOrderDetail(order_id: any) {
 /**
  * 关闭订单
  */
-export function orderClose(order_id: number) {
-    return request.put(`order/miniOrder/cancel/${ order_id }`)
+export function orderClose(params: any) {
+    return request.put(`order/miniOrder/cancel`,params)
 }
 
 /**

+ 9 - 9
src/addon/shop/components/diy/goods-coupon/index.vue

@@ -206,15 +206,15 @@ const getShopCouponListFn = () => {
         num: diyComponent.value.source == 'all' ? diyComponent.value.num : '',
         coupon_ids: diyComponent.value.source == 'custom' ? diyComponent.value.couponIds : '',
     };
-    getShopCouponComponents(data).then((res: any) => {
-        couponList.value = res.data
-        skeleton.loading = false;
-
-        // 数据为空时隐藏整个组件
-        // if(couponList.value.length == 0) {
-        //     diyComponent.value.pageStyle = '';
-        // }
-    })
+    // getShopCouponComponents(data).then((res: any) => {
+    //     couponList.value = res.data
+    //     skeleton.loading = false;
+
+    //     // 数据为空时隐藏整个组件
+    //     // if(couponList.value.length == 0) {
+    //     //     diyComponent.value.pageStyle = '';
+    //     // }
+    // })
 }
 
 const couponItemLink = (data: any) => {

+ 7 - 7
src/addon/shop/components/diy/shop-goods-recommend/index.vue

@@ -172,13 +172,13 @@ const getGoodsListFn = () => {
     }
 
     getGoodsComponents(data).then((res) => {
-        let goodsObj = res.data;
-        goodsNum.value = goodsObj.length || 0;
-        diyComponent.value.list.filter((el: any, index) => {
-            el.info = deepClone(goodsObj[index])
-        });
-        goodsList.value = deepClone(diyComponent.value.list)
-        skeleton.loading = false;
+        // let goodsObj = res.data;
+        // goodsNum.value = goodsObj.length || 0;
+        // diyComponent.value.list.filter((el: any, index) => {
+        //     el.info = deepClone(goodsObj[index])
+        // });
+        // goodsList.value = deepClone(diyComponent.value.list)
+        // skeleton.loading = false;
     });
 }
 

+ 1 - 1
src/addon/shop/pages/order/list.vue

@@ -267,7 +267,7 @@ const close = (item: any) => {
         confirmColor: useConfigStore().themeColor['--primary-color'],
         success: res => {
             if (res.confirm) {
-                orderClose(item.id).then((data) => {
+                orderClose({id:item.id}).then((data) => {
                     getMescroll().resetUpScroll();
                 })
             }

+ 7 - 0
src/app/api/system.ts

@@ -159,6 +159,13 @@ export function getInitInfo(params: Record<string, any>) {
     return request.get('init', params)
 }
 
+/**
+ * 获取底部导航
+ */
+export function current(params: Record<string, any>) {
+    return request.get('mall/miniNavigationConfig/current', params)
+}
+
 /**
  * 获取是否绑定手机号
  */

+ 184 - 111
src/app/pages/auth/login.vue

@@ -1,7 +1,7 @@
 <template>
-	<view class="w-screen h-screen flex flex-col  " :style="themeColor()">
+	<view class="w-screen h-screen flex flex-col" :style="themeColor()">
 		<!-- #ifdef MP-WEIXIN -->
-		<view :style="{ 'height': headerHeight }">
+		<view :style="{ height: headerHeight }">
 			<top-tabbar :data="param" :scrollBool="topTabarObj.getScrollBool()" class="top-header" />
 		</view>
 		<!-- #endif -->
@@ -12,104 +12,152 @@
 				<text>还没有账号,</text>
 				<text class="text-primary">去注册</text>
 			</view>
-			<u-form labelPosition="left" :model="formData" errorType='toast' :rules="rules" ref="formRef">
-				<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6]">
-					<u-form-item label="" prop="username" :border-bottom="false">
-						<u-input v-model="formData.username" border="none" maxlength="40" placeholder="请输入账号"
-							autocomplete="off" class="!bg-transparent" :disabled="real_name_input" fontSize="26rpx"
-							placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]" />
-					</u-form-item>
-				</view>
+			<u-form labelPosition="left" :model="formData" errorType="toast" :rules="rules" ref="formRef">
+				<template v-if="type == 'username'">
+					<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6]">
+						<u-form-item label="" prop="username" :border-bottom="false">
+							<u-input v-model="formData.username" border="none" maxlength="40" placeholder="请输入账号"
+								autocomplete="off" class="!bg-transparent" :disabled="real_name_input" fontSize="26rpx"
+								placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]" />
+						</u-form-item>
+					</view>
+					<view
+						class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6] mt-[40rpx]">
+						<u-form-item label="" prop="password" :border-bottom="false">
+							<u-input v-model="formData.password" border="none" :password="isPassword" maxlength="40"
+								placeholder="请输入密码" autocomplete="new-password" class="!bg-transparent"
+								:disabled="real_name_input" fontSize="26rpx"
+								placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]">
+								<template #suffix>
+									<view @click="changePassword" v-if="formData.password">
+										<u-icon :name="isPassword ? 'eye-off' : 'eye-fill'" color="#b9b9b9"
+											size="20"></u-icon>
+									</view>
+								</template>
+							</u-input>
+						</u-form-item>
+					</view>
+				</template>
+				<!-- #ifdef MP-WEIXIN -->
+				<template v-if="type == 'wx'">
+					<button
+						class="w-full h-[80rpx] !bg-[var(--primary-color)] text-[26rpx] rounded-[40rpx] leading-[80rpx] font-500 !text-[#fff] !mx-[0]"
+						open-type="getPhoneNumber" @getphonenumber="getphonenumber">
+						授权手机号登录
+					</button>
+				</template>
+				<!-- #endif -->
+				<template v-if="type == 'mobile'">
+					<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6]">
+						<u-form-item label="" prop="mobile" :border-bottom="false">
+							<u-input v-model="formData.username" type="number" maxlength="11" border="none"
+								placeholder="请输入手机号" autocomplete="off" class="!bg-transparent"
+								:disabled="real_name_input" fontSize="26rpx"
+								placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]" />
+						</u-form-item>
+					</view>
+					<view
+						class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6] mt-[40rpx]">
+						<u-form-item label="" prop="mobile_code" :border-bottom="false">
+							<u-input v-model="formData.code" type="number" maxlength="4" border="none"
+								class="!bg-transparent" fontSize="26rpx" :disabled="real_name_input"
+								placeholder="请输入手机验证码" placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]">
+								<template #suffix>
+									<sms-code v-if="configStore.login.agreement_show" :mobile="formData.username"
+										type="login" v-model="formData.mobile_key" :isAgree="isAgree"></sms-code>
+									<sms-code v-else :mobile="formData.username" type="login"
+										v-model="formData.mobile_key"></sms-code>
+								</template>
+							</u-input>
+						</u-form-item>
+					</view>
+				</template>
+			</u-form>
+			<template v-if="type != 'wx'">
 				<view
-					class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6] mt-[40rpx]">
-					<u-form-item label="" prop="password" :border-bottom="false">
-						<u-input v-model="formData.password" border="none" :password="isPassword" maxlength="40"
-							placeholder="请输入密码" autocomplete="new-password" class="!bg-transparent"
-							:disabled="real_name_input" fontSize="26rpx"
-							placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]">
-							<template #suffix>
-								<view @click="changePassword" v-if="formData.password">
-									<u-icon :name="isPassword ? 'eye-off' : 'eye-fill'" color="#b9b9b9"
-										size="20"></u-icon>
-								</view>
-							</template>
-						</u-input>
-					</u-form-item>
+					class="h-[34rpx] text-right text-[24rpx] text-[var(--text-color-light6)] leading-[34rpx] mt-[20rpx]"
+					@click="toResetpwd">忘记密码</view>
+				<view class="mt-[106rpx]">
+					<button
+						class="w-full h-[80rpx] !bg-[var(--primary-color)] text-[26rpx] rounded-[40rpx] leading-[80rpx] font-500 !text-[#fff] !mx-[0]"
+						loadingText="登录中" @click="handleLogin">
+						登录
+					</button>
 				</view>
-			</u-form>
-			<view class="h-[34rpx] text-right text-[24rpx] text-[var(--text-color-light6)] leading-[34rpx] mt-[20rpx] "
-				@click="toResetpwd">忘记密码</view>
-			<view class="mt-[106rpx]">
-				<button
-					class="w-full h-[80rpx] !bg-[var(--primary-color)] text-[26rpx] rounded-[40rpx] leading-[80rpx] font-500 !text-[#fff] !mx-[0]"
-					loadingText="登录中" @click="handleLogin">登录</button>
-			</view>
+			</template>
 		</view>
 		<view class="footer w-full">
-			<view class="text-[26rpx] leading-[36rpx] text-[#666] text-center mb-[30rpx] font-400">其他登录方式</view>
-			<view class="flex justify-center gap-[40rpx]">
-				<text v-if="type == 'mobile' && configStore.login.is_username" @click="setType"
-					class="w-[66rpx] h-[66rpx] flex items-center justify-center iconfont iconmima6Vmm border-[2rpx] rounded-[50%] border-solid border-[#ddd] !text-[26rpx]"></text>
-				<text v-if="type == 'username' && configStore.login.is_mobile" @click="setType"
-					class="w-[66rpx] h-[66rpx] flex items-center justify-center iconfont iconshouji6Vmm border-[2rpx] rounded-[50%] border-solid border-[#ddd] !text-[26rpx]"></text>
-				<text v-if="isShowQuickLogin" @click="toLink"
-					class="w-[66rpx] h-[66rpx] !text-[#1AAB37] flex items-center justify-center iconfont iconweixinV6mm1 border-[2rpx] rounded-[50%] border-solid border-[#ddd] !text-[26rpx]"></text>
+			<view class="text-[26rpx] leading-[36rpx] text-[#666] text-center mb-[30rpx] font-400" @click="setType">
+				{{ type == "wx" ? "短信登录" : "其他登录方式" }}
 			</view>
+			<view class="flex justify-center gap-[40rpx]"> </view>
 		</view>
 	</view>
 </template>
 <script setup lang="ts">
-import { ref, reactive, computed, onMounted } from 'vue'
-import { usernameLogin, mobileLogin, clientLogin } from '@/app/api/auth'
-import useMemberStore from '@/stores/member'
-import useConfigStore from '@/stores/config'
-import { useLogin } from '@/hooks/useLogin'
-import { t } from '@/locale'
-import { redirect, getToken, pxToRpx, isWeixinBrowser } from '@/utils/common'
-import { onLoad } from '@dcloudio/uni-app';
-import { topTabar } from '@/utils/topTabbar'
+import { ref, reactive, computed, onMounted } from "vue";
+import { usernameLogin, mobileLogin, clientLogin } from "@/app/api/auth";
+import useMemberStore from "@/stores/member";
+import useConfigStore from "@/stores/config";
+import { useLogin } from "@/hooks/useLogin";
+import { t } from "@/locale";
+import { redirect, getToken, pxToRpx, isWeixinBrowser } from "@/utils/common";
+import { onLoad } from "@dcloudio/uni-app";
+import { topTabar } from "@/utils/topTabbar";
 import useSystemStore from "@/stores/system";
 
-const systemStore = useSystemStore()
+const systemStore = useSystemStore();
 /********* 自定义头部 - start ***********/
-const topTabarObj = topTabar()
-const param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
+const topTabarObj = topTabar();
+const param = topTabarObj.setTopTabbarParam({
+	title: "",
+	topStatusBar: { bgColor: "#fff", textColor: "#333" },
+});
 /********* 自定义头部 - end ***********/
 const headerHeight = computed(() => {
-	return Object.keys(systemStore.menuButtonInfo).length ? pxToRpx(Number(systemStore.menuButtonInfo.height)) + pxToRpx(systemStore.menuButtonInfo.top) + pxToRpx(8) + 'rpx' : 'auto'
-})
+	return Object.keys(systemStore.menuButtonInfo).length
+		? pxToRpx(Number(systemStore.menuButtonInfo.height)) +
+		pxToRpx(systemStore.menuButtonInfo.top) +
+		pxToRpx(8) +
+		"rpx"
+		: "auto";
+});
 const real_name_input = ref(true);
-const memberStore = useMemberStore()
-const configStore = useConfigStore()
-const type = ref('')
-const isAgree = ref(false)
-const isShowQuickLogin = ref(false) // 是否显示快捷登录
-const popupRef = ref()
-const isPassword = ref(true)
+const memberStore = useMemberStore();
+const configStore = useConfigStore();
+const type = ref("");
+const isAgree = ref(false);
+const isShowQuickLogin = ref(false); // 是否显示快捷登录
+const popupRef = ref();
+const isPassword = ref(true);
 
 const changePassword = () => {
-	isPassword.value = !isPassword.value
-}
+	isPassword.value = !isPassword.value;
+};
 
 const dialogClose = () => {
 	popupRef.value.close();
-}
+};
 
 const dialogConfirm = () => {
-	isAgree.value = true
+	isAgree.value = true;
 	popupRef.value.close();
-	handleLogin()
-}
+	handleLogin();
+};
 
 onLoad(async (option: any) => {
 	// #ifdef H5
-	uni.getStorageSync('openid') && (Object.assign(formData, { wx_openid: uni.getStorageSync('openid') }))
+	uni.getStorageSync("openid") &&
+		Object.assign(formData, { wx_openid: uni.getStorageSync("openid") });
 	// #endif
 
 	// #ifdef MP-WEIXIN
-	uni.getStorageSync('openid') && (Object.assign(formData, { weapp_openid: uni.getStorageSync('openid') }))
+	uni.getStorageSync("openid") &&
+		Object.assign(formData, { weapp_openid: uni.getStorageSync("openid") });
 	// #endif
 
+	type.value = option.type ? option.type : "username";
+
 	// if (option.type) {
 	// 	if (option.type == 'mobile') {
 	// 		if (configStore.login.is_mobile) {
@@ -151,91 +199,116 @@ onLoad(async (option: any) => {
 	// 	isShowQuickLogin.value = false;
 	// }
 	// // #endif
-})
+});
 
 const formData = reactive({
-	username: '',
-	password: ''
-})
+	username: "",
+	password: "",
+	code: "",
+	mobile_key: "",
+});
+
+const getphonenumber = async (res: any) => {
+	console.log(res, "?????????????");
+};
 
 onMounted(() => {
 	// 防止浏览器自动填充
 	setTimeout(() => {
 		real_name_input.value = false;
-	}, 800)
+	}, 800);
 });
 
 const agreeChange = () => {
-	isAgree.value = !isAgree.value
-}
+	isAgree.value = !isAgree.value;
+};
 
 const setType = () => {
-	type.value = type.value == 'username' ? 'mobile' : 'username'
-}
+	if (type.value == "username") {
+		// #ifndef MP-WEIXIN
+		type.value = "mobile";
+		// #endif
 
-const loading = ref(false)
+		// #ifdef MP-WEIXIN
+		type.value = "wx";
+		// #endif
+	} else if ((type.value == "wx")) {
+		type.value = "mobile";
+	} else {
+		type.value = "username";
+	}
+};
+
+const loading = ref(false);
 
 const rules = computed(() => {
 	return {
-		'username': [
+		username: [
 			{
-				type: 'string',
+				type: "string",
 				required: true,
-				message: '请输入账号',
-				trigger: ['blur', 'change'],
+				message: "请输入账号",
+				trigger: ["blur", "change"],
 			},
 			{
 				validator(rule: any, value: any) {
 					return uni.$u.test.mobile(value);
 				},
-				message: '请输入正确的手机号',
-				trigger: ['change', 'blur'],
-			}
+				message: "请输入正确的手机号",
+				trigger: ["change", "blur"],
+			},
 		],
-		'password': {
-			type: 'string',
+		password: {
+			type: "string",
 			required: true,
-			message: '请输入密码',
-			trigger: ['blur', 'change']
+			message: "请输入密码",
+			trigger: ["blur", "change"],
 		},
-	}
-})
+	};
+});
 
-const formRef: any = ref(null)
+const formRef: any = ref(null);
 
 const handleLogin = () => {
 	formRef.value.validate().then(() => {
-		if (loading.value) return
-		loading.value = true
-		clientLogin(formData).then((res: any) => {
-			memberStore.setToken(res.data.access_token)
-			useLogin().handleLoginBack()
-		}).catch(() => {
-			loading.value = false
-		})
-	})
-}
+		if (loading.value) return;
+		let datas: any = {}
+		if (type.value == "username") {
+			datas.username = formData.username
+			datas.password = formData.password
+		}
+		loading.value = true;
+		clientLogin(datas)
+			.then((res: any) => {
+				memberStore.setToken(res.data.access_token);
+				useLogin().handleLoginBack();
+			})
+			.catch(() => {
+				loading.value = false;
+			});
+	});
+};
 
 const toLink = () => {
 	const pages = getCurrentPages(); // 获取页面栈
 	if (pages.length > 1) {
 		const currentPage = pages[pages.length - 2].route;
-		if (currentPage == 'app/pages/auth/index') {
+		if (currentPage == "app/pages/auth/index") {
 			// 返回上一页
 			uni.navigateBack({
-				delta: 1 // 默认值是1,表示返回的页面层数
+				delta: 1, // 默认值是1,表示返回的页面层数
 			});
 		} else {
-			redirect({ url: '/app/pages/auth/index', mode: 'redirectTo' })
+			redirect({ url: "/app/pages/auth/index", mode: "redirectTo" });
 		}
 	} else {
-		redirect({ url: '/app/pages/auth/index', mode: 'redirectTo' })
+		redirect({ url: "/app/pages/auth/index", mode: "redirectTo" });
 	}
-}
+};
 
 const toResetpwd = () => {
-	uni.showToast({ title: '请联系管理员重置密码', icon: 'none' })
-}
+	uni.showToast({ title: "请联系管理员重置密码", icon: "none" });
+};
 </script>
 <style lang="scss" scoped>
 :deep(.u-input) {
@@ -264,4 +337,4 @@ const toResetpwd = () => {
 	padding-bottom: calc(151rpx + constant(safe-area-inset-bottom));
 	padding-bottom: calc(151rpx + env(safe-area-inset-bottom));
 }
-</style>
+</style>

+ 54 - 49
src/components/tabbar/tabbar.vue

@@ -1,12 +1,14 @@
 <template>
     <template v-if="tabbar && Object.keys(tabbar).length">
-        <u-tabbar :value="value" zIndex="9999" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true" :inactive-color="tabbar.value.textColor" :active-color="tabbar.value.textHoverColor" :border="props.border" class="custom-tabbar">
-            <template v-for="item in tabbar.value.list">
-                <u-tabbar-item class="py-[5rpx]" :custom-style="{'background-color': tabbar.value.backgroundColor}" :text="item.text" :icon="img(value == item.link.url ? item.iconSelectPath : item.iconPath)" :name="item.link.url" v-if="tabbar.value.type == 1" @click="itemBtn(item.link.url)"></u-tabbar-item>
-                <u-tabbar-item class="py-[5rpx]" :custom-style="{'background-color': tabbar.value.backgroundColor}" :icon="img(value == item.link.url ? item.iconSelectPath : item.iconPath)" :name="item.link.url" v-if="tabbar.value.type == 2" @click="itemBtn(item.link.url)"></u-tabbar-item>
-                <u-tabbar-item class="py-[5rpx]" :custom-style="{'background-color': tabbar.value.backgroundColor}" :text="item.text" :name="item.link.url" v-if="tabbar.value.type == 3" @click="itemBtn(item.link.url)"></u-tabbar-item>
+        <up-tabbar zIndex="9999" :value="value" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true"
+            :active-color="tabbar.value.bottomNavSelectedColor" :inactive-color="tabbar.value.bottomNavTextColor"
+            :border="props.border" class="custom-tabbar">
+            <template v-for="item in tabbar.value.navItems">
+                <up-tabbar-item class="py-[5rpx]" :custom-style="{ 'background-color': tabbar.value.bottomNavBgColor }"
+                    :text="item.text" :icon="img(value == item.linkUrl ? item.iconSelected : item.iconNormal)"
+                    @click="itemBtn"></up-tabbar-item>
             </template>
-        </u-tabbar>
+        </up-tabbar>
         <view class="tab-bar-placeholder"></view>
     </template>
 </template>
@@ -49,49 +51,52 @@ const tabbar: any = reactive({})
 
 const setTabbar = () => {
     let list = cloneDeep(useConfigStore().tabbarList);
-    if (list.length == 1) {
-        Object.assign(tabbar, list[0]);
-    } else {
-        let isExist = false;
-        for (let i = 0; i < list.length; i++) {
-            if (list[i].key == addon) {
-                Object.assign(tabbar, list[i]);
-                isExist = true;
-                break;
-            }
-        }
-
-        if (!isExist) {
-
-            // 检测是否单应用
-            let count = 0;
-            let singleTabbar = {}
-            try {
-                if (list) {
-                    list.forEach((item: any) => {
-                        if (item.info.type == 'app') {
-                            count++;
-                            singleTabbar = item;
-                        }
-                    })
-                }
-
-                if (count == 1) {
-                    Object.assign(tabbar, singleTabbar);
-                }
-
-            } catch (e) {
-            }
-        }
-
-    }
-    if (props.color) {
-        for (let key in props.color) {
-            if (props.color[key] && tabbar.value[key]) {
-                tabbar.value[key] = props.color[key];
-            }
-        }
-    }
+    list.type = 1;
+    tabbar.value = list
+    // console.log('tabbar', list)
+    // if (list.length == 1) {
+    //     Object.assign(tabbar, list[0]);
+    // } else {
+    //     let isExist = false;
+    //     for (let i = 0; i < list.length; i++) {
+    //         if (list[i].key == addon) {
+    //             Object.assign(tabbar, list[i]);
+    //             isExist = true;
+    //             break;
+    //         }
+    //     }
+
+    //     if (!isExist) {
+
+    //         // 检测是否单应用
+    //         let count = 0;
+    //         let singleTabbar = {}
+    //         try {
+    //             if (list) {
+    //                 list.forEach((item: any) => {
+    //                     if (item.info.type == 'app') {
+    //                         count++;
+    //                         singleTabbar = item;
+    //                     }
+    //                 })
+    //             }
+
+    //             if (count == 1) {
+    //                 Object.assign(tabbar, singleTabbar);
+    //             }
+
+    //         } catch (e) {
+    //         }
+    //     }
+
+    // }
+    // if (props.color) {
+    //     for (let key in props.color) {
+    //         if (props.color[key] && tabbar.value[key]) {
+    //             tabbar.value[key] = props.color[key];
+    //         }
+    //     }
+    // }
 }
 
 setTabbar()

+ 3 - 49
src/stores/system.ts

@@ -1,5 +1,5 @@
 import { defineStore } from 'pinia'
-import { getInitInfo, getSiteInfo,getMemberMobileExist } from '@/app/api/system'
+import { current, getSiteInfo,getMemberMobileExist } from '@/app/api/system'
 import useConfigStore from '@/stores/config'
 import useMemberStore from '@/stores/member'
 import { isWeixinBrowser } from '@/utils/common'
@@ -70,61 +70,15 @@ const useSystemStore = defineStore('system', {
             }
             // #endif
 
-            getInitInfo({
-                url,
-                openid: uni.getStorageSync('openid')
-            }).then((res: any) => {
+            current({}).then((res: any) => {
                 if (res.data) {
                     let data = res.data;
 
                     // 底部导航
                     const configStore = useConfigStore()
-                    configStore.tabbarList = data.tabbar_list;
-
-                    // 地图配置
-                    this.mapConfig.is_open = data.map_config.is_open;
-                    this.mapConfig.valid_time = data.map_config.valid_time;
-                    uni.setStorageSync('mapConfig', this.mapConfig);
-
-                    // 主题色
-                    uni.setStorageSync('theme_color_list', data.theme_list);
-
-                    // 站点信息
-                    this.site = data.site_info
-                    const apps: any = [], addons: any = []
-                    Object.keys(data.site_info.site_addons).forEach((key: string) => {
-                        const item = data.site_info.site_addons[key]
-                        item.type == 'app' ? apps.push(key) : addons.push(key)
-                    })
-                    this.siteApps = apps
-                    this.siteAddons = addons
-
-                    // 会员等级
-                    const memberStore = useMemberStore();
-                    memberStore.levelList = data.member_level;
-
-                    // 登录注册配置
-                    configStore.login.is_username = data.login_config.is_username
-                    configStore.login.is_mobile = data.login_config.is_mobile
-                    configStore.login.is_auth_register = parseInt(data.login_config.is_auth_register)
-                    configStore.login.is_force_access_user_info = parseInt(data.login_config.is_force_access_user_info)
-                    configStore.login.is_bind_mobile = parseInt(data.login_config.is_bind_mobile)
-                    configStore.login.agreement_show = parseInt(data.login_config.agreement_show)
-                    configStore.login.wechat_error = data.login_config.wechat_error // 微信错误消息
-                    configStore.login.bg_url = data.login_config.bg_url // 背景图
-                    configStore.login.logo = data.login_config.logo //logo
-                    configStore.login.desc = data.login_config.desc // 描述
-                    uni.setStorageSync('login_config', configStore.login)
-
-                    // 如果会员已存在则小程序端快捷登录时不再弹出授权弹框
-                    uni.setStorageSync('member_exist', data.member_exist)
+                    configStore.tabbarList = data;
 						
-
                     this.initStatus = 'finish'; // 初始化完成
-
-                    if (uni.getStorageSync('isBindMobile')) {
-                        uni.removeStorageSync('isBindMobile');
-                    }
                     if (callback) callback()
                 }
             })