mirror of
https://gitee.com/niucloud-team/niucloud.git
synced 2025-12-14 18:42:49 +00:00
update uniapp
This commit is contained in:
parent
96533ab7b0
commit
8a1dea9ea9
@ -1,20 +1,18 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
||||||
import manifest from '@/manifest.json'
|
|
||||||
import { launchInterceptor } from '@/utils/interceptor'
|
import { launchInterceptor } from '@/utils/interceptor'
|
||||||
import { getToken, isWeixinBrowser, getSiteId } from '@/utils/common'
|
import { getToken, isWeixinBrowser, getSiteId } from '@/utils/common'
|
||||||
import useMemberStore from '@/stores/member'
|
import useMemberStore from '@/stores/member'
|
||||||
import useConfigStore from '@/stores/config'
|
import useConfigStore from '@/stores/config'
|
||||||
import useSystemStore from '@/stores/system'
|
import useSystemStore from '@/stores/system'
|
||||||
import { useLogin } from '@/hooks/useLogin'
|
import { useLogin } from '@/hooks/useLogin'
|
||||||
|
import { useShare } from '@/hooks/useShare'
|
||||||
|
|
||||||
onLaunch(async(data) => {
|
onLaunch(async(data) => {
|
||||||
|
|
||||||
// 添加初始化拦截器
|
// 添加初始化拦截器
|
||||||
launchInterceptor()
|
launchInterceptor()
|
||||||
|
|
||||||
uni.removeStorageSync('isWatchShare')
|
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
uni.getSystemInfoSync().platform == 'ios' && (uni.setStorageSync('initUrl', location.href))
|
uni.getSystemInfoSync().platform == 'ios' && (uni.setStorageSync('initUrl', location.href))
|
||||||
|
|
||||||
@ -48,21 +46,41 @@
|
|||||||
|
|
||||||
// 缺少站点id,拦截
|
// 缺少站点id,拦截
|
||||||
if (process.env.NODE_ENV == 'development' && (getSiteId(uni.getStorageSync('wap_site_id') || import.meta.env.VITE_SITE_ID) === '')) return;
|
if (process.env.NODE_ENV == 'development' && (getSiteId(uni.getStorageSync('wap_site_id') || import.meta.env.VITE_SITE_ID) === '')) return;
|
||||||
|
|
||||||
|
const { wechatInit } = useShare()
|
||||||
|
wechatInit()
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
const configStore = useConfigStore()
|
const configStore = useConfigStore()
|
||||||
|
await configStore.getTabbarConfig()
|
||||||
await configStore.getLoginConfig()
|
await configStore.getLoginConfig()
|
||||||
|
|
||||||
useSystemStore().getMapFn()
|
useSystemStore().getMapFn()
|
||||||
useSystemStore().getSiteInfoFn()
|
useSystemStore().getSiteInfoFn()
|
||||||
|
|
||||||
|
try {
|
||||||
// 隐藏tabbar
|
// 隐藏tabbar
|
||||||
uni.hideTabBar()
|
uni.hideTabBar()
|
||||||
|
} catch (e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// 判断是否已登录
|
// 判断是否已登录
|
||||||
if (getToken()) {
|
if (getToken()) {
|
||||||
const memberStore = useMemberStore()
|
const memberStore = useMemberStore()
|
||||||
await memberStore.setToken(getToken())
|
await memberStore.setToken(getToken())
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
if (!uni.getStorageSync('openid')) {
|
||||||
|
const memberInfo = useMemberStore().info
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
memberInfo && memberInfo.weapp_openid && uni.setStorageSync('openid', memberInfo.weapp_openid)
|
||||||
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
|
isWeixinBrowser() && memberInfo && memberInfo.wx_openid && uni.setStorageSync('openid', memberInfo.wx_openid)
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
}, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getToken()) {
|
if (!getToken()) {
|
||||||
|
|||||||
@ -61,15 +61,17 @@
|
|||||||
import topTabbar from '@/components/top-tabbar/top-tabbar.vue'
|
import topTabbar from '@/components/top-tabbar/top-tabbar.vue'
|
||||||
|
|
||||||
import useDiyStore from '@/app/stores/diy';
|
import useDiyStore from '@/app/stores/diy';
|
||||||
import { ref, onMounted, nextTick, computed } from 'vue';
|
import { ref, onMounted, nextTick, computed, watch } from 'vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
import { getLocation } from '@/utils/common';
|
import { getLocation } from '@/utils/common';
|
||||||
import Sortable from 'sortablejs';
|
import Sortable from 'sortablejs';
|
||||||
import { range } from 'lodash-es';
|
import { range } from 'lodash-es';
|
||||||
import { onPageScroll } from '@dcloudio/uni-app'
|
import { onPageScroll } from '@dcloudio/uni-app'
|
||||||
import useConfigStore from '@/stores/config'
|
import useConfigStore from '@/stores/config'
|
||||||
|
|
||||||
const props = defineProps(['data','pullDownRefreshCount']);
|
const props = defineProps(['data','pullDownRefreshCount']);
|
||||||
const diyStore = useDiyStore();
|
const diyStore = useDiyStore();
|
||||||
|
const router = useRouter();
|
||||||
const data = computed(()=>{
|
const data = computed(()=>{
|
||||||
if (diyStore.mode == 'decorate') {
|
if (diyStore.mode == 'decorate') {
|
||||||
return diyStore;
|
return diyStore;
|
||||||
@ -78,6 +80,25 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 兼容轮播搜索组件-切换分类时,导致个人中心白屏 - start
|
||||||
|
// #ifdef H5
|
||||||
|
watch(() => router.currentRoute.value, (newRoute) => {
|
||||||
|
if(newRoute.path != "/addon/shop/pages/index"){
|
||||||
|
diyStore.topFixedStatus = 'home'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef MP
|
||||||
|
wx.onAppRoute(function(res) {
|
||||||
|
if(res.path != "addon/shop/pages/index"){
|
||||||
|
diyStore.topFixedStatus = 'home'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
// 兼容轮播搜索组件-切换分类时,导致个人中心白屏 - end
|
||||||
|
|
||||||
const tabbarAddonName = computed(() => {
|
const tabbarAddonName = computed(() => {
|
||||||
return useConfigStore().addon;
|
return useConfigStore().addon;
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name" : "wx59e6ba6050bbe7bc",
|
"name" : "",
|
||||||
"appid" : "__UNI__ED923AB",
|
"appid" : "__UNI__ED923AB",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.0",
|
||||||
|
|||||||
@ -86,6 +86,9 @@
|
|||||||
{
|
{
|
||||||
"path": "app/pages/member/commission",
|
"path": "app/pages/member/commission",
|
||||||
"style": {
|
"style": {
|
||||||
|
// #ifndef H5
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
// #endif
|
||||||
"navigationBarTitleText": "%pages.member.commission%"
|
"navigationBarTitleText": "%pages.member.commission%"
|
||||||
},
|
},
|
||||||
"needLogin": true
|
"needLogin": true
|
||||||
@ -93,6 +96,9 @@
|
|||||||
{
|
{
|
||||||
"path": "app/pages/member/balance",
|
"path": "app/pages/member/balance",
|
||||||
"style": {
|
"style": {
|
||||||
|
// #ifndef H5
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
// #endif
|
||||||
"navigationBarTitleText": "%pages.member.balance%"
|
"navigationBarTitleText": "%pages.member.balance%"
|
||||||
},
|
},
|
||||||
"needLogin": true
|
"needLogin": true
|
||||||
@ -128,10 +134,10 @@
|
|||||||
{
|
{
|
||||||
"path": "app/pages/member/index",
|
"path": "app/pages/member/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "%pages.member.index%",
|
|
||||||
// #ifndef H5
|
// #ifndef H5
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
// #endif
|
// #endif
|
||||||
|
"navigationBarTitleText": "%pages.member.index%",
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"diy-group": "../../../../addon/components/diy/group/index",
|
"diy-group": "../../../../addon/components/diy/group/index",
|
||||||
"fixed-group": "../../../../addon/components/fixed/group/index"
|
"fixed-group": "../../../../addon/components/fixed/group/index"
|
||||||
@ -152,10 +158,20 @@
|
|||||||
{
|
{
|
||||||
"path": "app/pages/member/point",
|
"path": "app/pages/member/point",
|
||||||
"style": {
|
"style": {
|
||||||
|
// #ifndef H5
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
// #endif
|
||||||
"navigationBarTitleText": "%pages.member.point%"
|
"navigationBarTitleText": "%pages.member.point%"
|
||||||
},
|
},
|
||||||
"needLogin": true
|
"needLogin": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "app/pages/member/point_detail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "%pages.member.point_detail%"
|
||||||
|
},
|
||||||
|
"needLogin": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "app/pages/member/account",
|
"path": "app/pages/member/account",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user