update: 修复android pina引用问题 h5 app-plus 不支持getMenuButtonBoundingClientRect方法

This commit is contained in:
admin 2024-05-09 10:45:07 +08:00
parent f87e508efd
commit ce8cb31b5b
10 changed files with 22 additions and 12 deletions

View File

@ -56,8 +56,9 @@ import Title from "@/components/Title/index.vue";
import TabBar from "@/components/TabBar/index.vue";
import { useMemberStore } from "@/store/index";
import { ProfileApi } from "@/services";
import pinia from '@/store'
const store = useMemberStore();
const store = useMemberStore(pinia);
const list = reactive([
{
title: "收货",

View File

@ -39,7 +39,7 @@ const getSafeHeight = () => {
// #endif
};
onMounted(() => {
// #ifdef APP-PLUS || MP-WEIXIN
// #ifdef MP-WEIXIN
let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
navbarRect.height = menuButtonInfo.height;
navbarRect.top = menuButtonInfo.top;

View File

@ -44,7 +44,7 @@ const navbarRect = reactive({
msgCount: 10,
});
onMounted(() => {
// #ifdef APP-PLUS || MP-WEIXIN
// #ifdef MP-WEIXIN
let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
navbarRect.height = menuButtonInfo.height;
navbarRect.top = menuButtonInfo.top;

View File

@ -21,7 +21,7 @@ const navbarRect = reactive({
});
onMounted(() => {
// #ifdef APP-PLUS || MP-WEIXIN
// #ifdef MP-WEIXIN
let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
navbarRect.height = menuButtonInfo.height;
navbarRect.top = menuButtonInfo.top;

View File

@ -86,7 +86,7 @@ watch(
// ,{ deep: true, immediate:true}
onLoad(() => {
// #ifdef APP-PLUS || MP-WEIXIN
// #ifdef APP-PLUS || MP-WEIXIN || H5
getClineHeight();
// #endif
});

View File

@ -165,7 +165,9 @@ import {
import TabBar from "@/components/TabBar/index.vue";
import { formatMoney } from "@/utils";
import { onBackPress, onShow } from "@dcloudio/uni-app";
const store = useMemberStore();
import pinia from '@/store'
const store = useMemberStore(pinia);
const navbarRect = reactive({
height: 32,
top: 28,
@ -550,7 +552,7 @@ const init = () => {
});
};
onMounted(() => {
// #ifdef APP-PLUS || MP-WEIXIN
// #ifdef MP-WEIXIN
let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
navbarRect.height = menuButtonInfo.height;
navbarRect.top = menuButtonInfo.top;

View File

@ -116,13 +116,15 @@ import { ProfileApi } from "@/services/index";
import LoginLayout from "./components/loginLayout.vue";
import { useMemberStore } from "@/store/index";
import valid from "@/utils/validate";
import pinia from '@/store'
const handleClear = (item: any) => {
setTimeout(() => {
(model1.userInfo as any)[item.key] = "";
}, 100);
};
const store = useMemberStore();
const store = useMemberStore(pinia);
const loginForm = ref(null);
const model1 = reactive({
userInfo: {

View File

@ -8,7 +8,9 @@
</template>
<script setup lang="ts">
import { useMemberStore } from '@/store/index'
const store = useMemberStore()
import pinia from '@/store'
const store = useMemberStore(pinia)
const profile = store.profile.userInfo
</script>
<style lang="scss">

View File

@ -67,6 +67,8 @@ import { useMemberStore } from "@/store/index";
import TabBar from "@/components/TabBar/index.vue";
import SmallModal from "@/components/Modal/smallModal.vue";
import Box from "@/components/Box/index.vue";
import pinia from '@/store'
const isShowCancelModal = ref(false);
@ -82,7 +84,7 @@ const handleOk = () => {
}
});
};
const store = useMemberStore();
const store = useMemberStore(pinia);
const profile = store.profile.userInfo;
const list = reactive([
{
@ -113,7 +115,7 @@ const hanldeClick = (item: any) => {
.bg {
width: 100%;
position: absolute;
top: -60rpx;
top: 0rpx;
z-index: -1;
}
.baseinfo {

View File

@ -1,5 +1,6 @@
import { useMemberStore } from "@/store/modules/member";
import ENV_CONFIG from "../config/env";
import pinia from '@/store'
// 基础地址
let baseUrl = "";
@ -10,7 +11,7 @@ let baseUrl = "";
baseUrl = (process.env as any).config[(process.env as any).NODE_ENV]
.VITE_APP_BASE_URL;
const store = useMemberStore();
const store = useMemberStore(pinia);
const obj = {
// 拦截前触发