mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-12 02:42:49 +00:00
update uni-app
This commit is contained in:
parent
5d94d8ebdc
commit
ce9c5e08ad
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'version' => '1.0.2',
|
||||
'code' => '202305310001'
|
||||
'version' => '1.0.3',
|
||||
'code' => '202306080001'
|
||||
];
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
<diy-text :component="component" :index="index"></diy-text>
|
||||
</template>
|
||||
</view>
|
||||
<template v-if="diyStore.mode == '' && data.global.bottomTabBarSwitch">
|
||||
<template v-if="diyStore.mode != 'decorate' && data.global.bottomTabBarSwitch">
|
||||
<view class="pt-[20rpx]"></view>
|
||||
<tabbar />
|
||||
</template>
|
||||
|
||||
@ -2,16 +2,16 @@
|
||||
<view class="image-ads" :style="warpCss">
|
||||
<view v-if="diyComponent.list.length == 1" class="leading-0 overflow-hidden" :style="swiperWarpCss">
|
||||
<app-link :data="diyComponent.list[0].link">
|
||||
<image :src="img(diyComponent.list[0].imageUrl)" :style="{height: diyComponent.imageHeight}"
|
||||
mode="scaleToFill" class="w-full" :show-menu-by-longpress="true"></image>
|
||||
<image :src="img(diyComponent.list[0].imageUrl)" :style="{height: imgHeight}" mode="scaleToFill"
|
||||
class="w-full" :show-menu-by-longpress="true"></image>
|
||||
</app-link>
|
||||
</view>
|
||||
|
||||
<swiper v-else class="swiper" :style="{ height: diyComponent.imageHeight }" autoplay="true" circular="true"
|
||||
<swiper v-else class="swiper" :style="{ height: imgHeight }" autoplay="true" circular="true"
|
||||
@change="swiperChange">
|
||||
<swiper-item class="swiper-item" v-for="(item) in diyComponent.list" :key="item.id" :style="swiperWarpCss">
|
||||
<app-link :data="item.link">
|
||||
<view class="item" :style="{height: diyComponent.imageHeight}">
|
||||
<view class="item" :style="{height: imgHeight}">
|
||||
<image :src="img(item.imageUrl)" mode="scaleToFill" class="w-full h-full"
|
||||
:show-menu-by-longpress="true"></image>
|
||||
</view>
|
||||
@ -38,6 +38,7 @@
|
||||
return props.component;
|
||||
}
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
if (diyComponent.value.componentBgColor) style += 'background-color:' + diyComponent.value.componentBgColor + ';';
|
||||
@ -53,6 +54,10 @@
|
||||
return style;
|
||||
})
|
||||
|
||||
const imgHeight = computed(() => {
|
||||
return (diyComponent.value.imageHeight * 2) + 'rpx';
|
||||
})
|
||||
|
||||
const swiperIndex = ref(0);
|
||||
|
||||
const swiperChange = e => {
|
||||
@ -60,7 +65,6 @@
|
||||
};
|
||||
|
||||
const handleData = () => {
|
||||
diyComponent.value.imageHeight = (diyComponent.value.imageHeight * 2) + 'rpx';
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@ -21,7 +21,8 @@
|
||||
<u-avatar src="" size="55"></u-avatar>
|
||||
<view class="ml-[22rpx]">
|
||||
<view class="text-[#222222] font-bold text-lg" :style="{ color : diyComponent.textColor }">
|
||||
{{ t('login') }}/{{ t('register') }}</view>
|
||||
{{ t('login') }}/{{ t('register') }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="set-icon flex items-center absolute right-0 top-2">
|
||||
<app-link url="/pages/setting/index">
|
||||
@ -34,19 +35,23 @@
|
||||
<view class="flex m-[30rpx] mb-0 py-[30rpx] items-center">
|
||||
<view class="flex-1 text-center">
|
||||
<view class="font-bold">
|
||||
<app-link :url="(info ? '/pages/member/balance' : '')" :style="{ color : diyComponent.textColor }">{{ money }}</app-link>
|
||||
<app-link :url="(info ? '/pages/member/balance' : '')"
|
||||
:style="{ color : diyComponent.textColor }">{{ money }}</app-link>
|
||||
</view>
|
||||
<view class="text-sm mt-[10rpx]">
|
||||
<app-link :url="(info ? '/pages/member/balance' : '')" :style="{ color : diyComponent.textColor }">{{ t('balance') }}</app-link>
|
||||
<app-link :url="(info ? '/pages/member/balance' : '')"
|
||||
:style="{ color : diyComponent.textColor }">{{ t('balance') }}</app-link>
|
||||
</view>
|
||||
</view>
|
||||
<view class="border-solid border-white border-l border-b-0 border-t-0 border-r-0 h-[60rpx]"></view>
|
||||
<view class="flex-1 text-center">
|
||||
<view class="font-bold">
|
||||
<app-link :url="(info ? '/pages/member/point' : '')" :style="{ color : diyComponent.textColor }">{{ parseInt(info?.point) || 0 }}</app-link>
|
||||
<app-link :url="(info ? '/pages/member/point' : '')"
|
||||
:style="{ color : diyComponent.textColor }">{{ parseInt(info?.point) || 0 }}</app-link>
|
||||
</view>
|
||||
<view class="text-sm mt-[10rpx]">
|
||||
<app-link :url="(info ? '/pages/member/point' : '')" :style="{ color : diyComponent.textColor }">{{ t('point') }}</app-link>
|
||||
<app-link :url="(info ? '/pages/member/point' : '')"
|
||||
:style="{ color : diyComponent.textColor }">{{ t('point') }}</app-link>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -81,7 +86,7 @@
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
if(diyComponent.value.componentBgColor) style += 'background-color:' + diyComponent.value.componentBgColor + ';';
|
||||
if (diyComponent.value.componentBgColor) style += 'background-color:' + diyComponent.value.componentBgColor + ';';
|
||||
if (diyComponent.value.bgUrl) {
|
||||
style += 'background-image:url(' + img(diyComponent.value.bgUrl) + ');';
|
||||
style += 'background-size: 100%;';
|
||||
@ -114,7 +119,7 @@
|
||||
balance: 0,
|
||||
point: 0,
|
||||
money: 0,
|
||||
member_no:'NIU0000021'
|
||||
member_no: 'NIU0000021'
|
||||
}
|
||||
} else {
|
||||
return memberStore.info;
|
||||
|
||||
@ -22,9 +22,7 @@ class Language {
|
||||
uni.setLocale(locale)
|
||||
|
||||
// #ifdef H5
|
||||
if (process.env.NODE_ENV == 'production') {
|
||||
setDocumentTitle(path)
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"developTitle":"开发环境配置",
|
||||
"baseUrl":"API请求地址",
|
||||
"imgUrl":"图片服务器地址",
|
||||
"siteId":"站点ID",
|
||||
"siteId":"站点ID(VITE_SITE_ID)",
|
||||
"siteIdPlaceholder": "请输入站点ID",
|
||||
"pleaseEnterNumber":"请输入数字",
|
||||
"maximumCannotExceed":"最大不能超过"
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
<template>
|
||||
<view class="w-screen h-screen flex flex-col items-center justify-center">
|
||||
<u-empty
|
||||
:icon="img('static/resource/images/site/close.png')"
|
||||
:text="t('siteNonexistence')"
|
||||
>
|
||||
</u-empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { img } from '@/utils/common'
|
||||
import { t } from '@/locale'
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@ -1,8 +0,0 @@
|
||||
<template>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@ -46,8 +46,8 @@ const useDiyStore = defineStore('diy', {
|
||||
try {
|
||||
let data = JSON.parse(event.data);
|
||||
this.currentIndex = data.currentIndex;
|
||||
if(data.global) this.global = data.global;
|
||||
if(data.value) this.value = data.value;
|
||||
if (data.global) this.global = data.global;
|
||||
if (data.value) this.value = data.value;
|
||||
|
||||
if (this.value) {
|
||||
this.value.forEach((item, index) => {
|
||||
@ -101,7 +101,7 @@ const useDiyStore = defineStore('diy', {
|
||||
});
|
||||
window.parent.postMessage(data, '*');
|
||||
// #endif
|
||||
},
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ import useDiyStore from '@/stores/diy'
|
||||
import useMemberStore from '@/stores/member'
|
||||
import pagesZh from '@/locale/zh-Hans.json'
|
||||
import pagesEn from '@/locale/en.json'
|
||||
import { onReady } from '@dcloudio/uni-app'
|
||||
|
||||
/**
|
||||
* 跳转页面
|
||||
@ -245,7 +246,17 @@ export function setDocumentTitle(route: string) {
|
||||
'en': pagesEn
|
||||
}
|
||||
const key = route.replace('/', '').replaceAll('/', '.')
|
||||
locale[ uni.getLocale() ][key] && (document.title = locale[ uni.getLocale() ][key])
|
||||
if (locale[ uni.getLocale() ][key]) {
|
||||
setTimeout(() => {
|
||||
uni.setNavigationBarTitle({
|
||||
title: locale[ uni.getLocale() ][key],
|
||||
fail(e) {
|
||||
setDocumentTitle(route)
|
||||
}
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,7 @@ import { language } from '@/locale'
|
||||
import { checkNeedLogin } from '@/utils/auth'
|
||||
import { redirect, urlDeconstruction, getToken, getSiteId, setDocumentTitle } from '@/utils/common'
|
||||
import { memberLog } from '@/api/auth'
|
||||
import { nextTick } from 'vue'
|
||||
|
||||
/**
|
||||
* 页面跳转拦截器
|
||||
@ -23,10 +24,10 @@ export const redirectInterceptor = () => {
|
||||
if ((getSiteId(uni.getStorageSync('wap_site_id') || import.meta.env.VITE_SITE_ID) === '') && route.path != '/pages/index/develop') {
|
||||
redirect({ url: '/pages/index/develop', mode: 'reLaunch' })
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
// 设置网站标题
|
||||
setDocumentTitle(route.path)
|
||||
}
|
||||
// #endif
|
||||
|
||||
// 校验是否需要登录
|
||||
@ -53,15 +54,17 @@ export const launchInterceptor = () => {
|
||||
if (location.search.indexOf('?mode=decorate&site_id=') != -1) {
|
||||
uni.setStorageSync('wap_site_id', location.search.replace('?mode=decorate&site_id=',''));
|
||||
}
|
||||
if (location.search.indexOf('?mode=preview&site_id=') != -1) {
|
||||
uni.setStorageSync('wap_site_id', location.search.replace('?mode=preview&site_id=',''));
|
||||
}
|
||||
if (getSiteId(uni.getStorageSync('wap_site_id') || import.meta.env.VITE_SITE_ID) === '') {
|
||||
launch.path = '/pages/index/develop';
|
||||
uni.setStorageSync('develop_before_path', launch.path);
|
||||
redirect({ url: '/pages/index/develop', mode: 'reLaunch' })
|
||||
}
|
||||
} else {
|
||||
}
|
||||
// 设置网站标题
|
||||
setDocumentTitle(launch.path)
|
||||
}
|
||||
// #endif
|
||||
|
||||
// 加载语言包
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user