update uniapp

This commit is contained in:
全栈小学生 2024-06-15 15:43:09 +08:00
parent 96533ab7b0
commit 8a1dea9ea9
4 changed files with 119 additions and 64 deletions

View File

@ -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) => {
//
launchInterceptor()
uni.removeStorageSync('isWatchShare')
// #ifdef H5
uni.getSystemInfoSync().platform == 'ios' && (uni.setStorageSync('initUrl', location.href))
@ -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()) {

View File

@ -61,15 +61,17 @@
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 router = useRouter();
const data = computed(()=>{
if (diyStore.mode == 'decorate') {
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(() => {
return useConfigStore().addon;
})

View File

@ -1,5 +1,5 @@
{
"name" : "wx59e6ba6050bbe7bc",
"name" : "",
"appid" : "__UNI__ED923AB",
"description" : "",
"versionName" : "1.0.0",

View File

@ -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": {