mirror of
https://gitee.com/niucloud-team/niucloud.git
synced 2025-12-14 10:32:49 +00:00
update uniapp
This commit is contained in:
parent
96533ab7b0
commit
8a1dea9ea9
@ -1,20 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
||||
import manifest from '@/manifest.json'
|
||||
import { launchInterceptor } from '@/utils/interceptor'
|
||||
import { getToken, isWeixinBrowser, getSiteId } from '@/utils/common'
|
||||
import useMemberStore from '@/stores/member'
|
||||
import useConfigStore from '@/stores/config'
|
||||
import useSystemStore from '@/stores/system'
|
||||
import { useLogin } from '@/hooks/useLogin'
|
||||
import { useShare } from '@/hooks/useShare'
|
||||
|
||||
onLaunch(async (data) => {
|
||||
onLaunch(async(data) => {
|
||||
|
||||
// 添加初始化拦截器
|
||||
launchInterceptor()
|
||||
|
||||
uni.removeStorageSync('isWatchShare')
|
||||
|
||||
// #ifdef H5
|
||||
uni.getSystemInfoSync().platform == 'ios' && (uni.setStorageSync('initUrl', location.href))
|
||||
|
||||
@ -28,11 +26,11 @@
|
||||
window.addEventListener('message', event => {
|
||||
try {
|
||||
let data = {
|
||||
type :''
|
||||
type: ''
|
||||
};
|
||||
if(typeof event.data == 'string') {
|
||||
if (typeof event.data == 'string') {
|
||||
data = JSON.parse(event.data)
|
||||
}else if(typeof event.data == 'object') {
|
||||
} else if (typeof event.data == 'object') {
|
||||
data = event.data
|
||||
}
|
||||
if (data.type && data.type == 'appOnReady') {
|
||||
@ -48,21 +46,41 @@
|
||||
|
||||
// 缺少站点id,拦截
|
||||
if (process.env.NODE_ENV == 'development' && (getSiteId(uni.getStorageSync('wap_site_id') || import.meta.env.VITE_SITE_ID) === '')) return;
|
||||
|
||||
const { wechatInit } = useShare()
|
||||
wechatInit()
|
||||
// #endif
|
||||
|
||||
const configStore = useConfigStore()
|
||||
await configStore.getTabbarConfig()
|
||||
await configStore.getLoginConfig()
|
||||
|
||||
useSystemStore().getMapFn()
|
||||
useSystemStore().getSiteInfoFn()
|
||||
|
||||
try {
|
||||
// 隐藏tabbar
|
||||
uni.hideTabBar()
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
// 判断是否已登录
|
||||
if (getToken()) {
|
||||
const memberStore = useMemberStore()
|
||||
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()) {
|
||||
@ -88,6 +106,6 @@
|
||||
|
||||
<style>
|
||||
uni-page-head {
|
||||
display: none!important;
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -61,16 +61,18 @@
|
||||
import topTabbar from '@/components/top-tabbar/top-tabbar.vue'
|
||||
|
||||
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 Sortable from 'sortablejs';
|
||||
import { range } from 'lodash-es';
|
||||
import { onPageScroll } from '@dcloudio/uni-app'
|
||||
import useConfigStore from '@/stores/config'
|
||||
|
||||
const props = defineProps(['data','pullDownRefreshCount']);
|
||||
const diyStore = useDiyStore();
|
||||
|
||||
const data = computed(() => {
|
||||
const router = useRouter();
|
||||
const data = computed(()=>{
|
||||
if (diyStore.mode == 'decorate') {
|
||||
return diyStore;
|
||||
} else {
|
||||
@ -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(() => {
|
||||
return useConfigStore().addon;
|
||||
})
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name" : "wx59e6ba6050bbe7bc",
|
||||
"name" : "",
|
||||
"appid" : "__UNI__ED923AB",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
|
||||
@ -86,6 +86,9 @@
|
||||
{
|
||||
"path": "app/pages/member/commission",
|
||||
"style": {
|
||||
// #ifndef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.commission%"
|
||||
},
|
||||
"needLogin": true
|
||||
@ -93,6 +96,9 @@
|
||||
{
|
||||
"path": "app/pages/member/balance",
|
||||
"style": {
|
||||
// #ifndef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.balance%"
|
||||
},
|
||||
"needLogin": true
|
||||
@ -128,10 +134,10 @@
|
||||
{
|
||||
"path": "app/pages/member/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%pages.member.index%",
|
||||
// #ifndef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.index%",
|
||||
"usingComponents": {
|
||||
"diy-group": "../../../../addon/components/diy/group/index",
|
||||
"fixed-group": "../../../../addon/components/fixed/group/index"
|
||||
@ -152,10 +158,20 @@
|
||||
{
|
||||
"path": "app/pages/member/point",
|
||||
"style": {
|
||||
// #ifndef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.point%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "app/pages/member/point_detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%pages.member.point_detail%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "app/pages/member/account",
|
||||
"style": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user