parent
6e8ab5b8b1
commit
65aca0f8df
|
|
@ -54,16 +54,7 @@ import { get_math } from '@/utils';
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
value: {
|
value: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({
|
default: () => {},
|
||||||
nav_style: '0',
|
|
||||||
nav_type: '0',
|
|
||||||
nav_content: [
|
|
||||||
{ id: '1', name: '首页', src: [{ id: 1, url: '/src/assets/images/layout/main/phone.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: 'tabs', href: {} },
|
|
||||||
{ id: '2', name: '分类', src: [{ id: 1, url: '/src/assets/images/layout/main/phone.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: 'tabs', href: {} },
|
|
||||||
{ id: '3', name: '购物车', src: [{ id: 1, url: '/src/assets/images/layout/main/phone.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: 'tabs', href: {} },
|
|
||||||
{ id: '4', name: '我的', src: [{ id: 1, url: '/src/assets/images/layout/main/phone.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: 'tabs', href: {} },
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const form = reactive(props.value);
|
const form = reactive(props.value);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
import defaultCommon from './index';
|
import defaultCommon from './index';
|
||||||
|
import { online_url } from '@/utils';
|
||||||
|
|
||||||
|
let new_url = await online_url();
|
||||||
|
|
||||||
interface DefaultFooterNav {
|
interface DefaultFooterNav {
|
||||||
content: {
|
content: {
|
||||||
nav_style: string;
|
nav_style: string;
|
||||||
|
|
@ -16,10 +20,10 @@ const defaultFooterNav: DefaultFooterNav = {
|
||||||
nav_style: '0',
|
nav_style: '0',
|
||||||
nav_type: '0',
|
nav_type: '0',
|
||||||
nav_content: [
|
nav_content: [
|
||||||
{ id: '1', name: '首页', src: [{ id: 1, url: '/src/assets/images/layout/main/foot/home.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: '/src/assets/images/layout/main/foot/home-checked.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
|
{ id: '1', name: '首页', src: [{ id: 1, url: new_url + 'home.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: new_url + 'active/home.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
|
||||||
{ id: '2', name: '分类', src: [{ id: 1, url: '/src/assets/images/layout/main/foot/category.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: '/src/assets/images/layout/main/foot/category-checked.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
|
{ id: '2', name: '分类', src: [{ id: 1, url: new_url + 'category.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: new_url + 'active/category.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
|
||||||
{ id: '3', name: '购物车', src: [{ id: 1, url: '/src/assets/images/layout/main/foot/cart.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: '/src/assets/images/layout/main/foot/cart-checked.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
|
{ id: '3', name: '购物车', src: [{ id: 1, url: new_url + 'cart.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: new_url + 'active/cart.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
|
||||||
{ id: '4', name: '我的', src: [{ id: 1, url: '/src/assets/images/layout/main/foot/user.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: '/src/assets/images/layout/main/foot/user-checked.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
|
{ id: '4', name: '我的', src: [{ id: 1, url: new_url + 'user.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: new_url + 'active/user.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@ export const set_cookie = (name: string, value: string, expire_time?: number) =>
|
||||||
export const tabs_style = (color: string, style: string | number | boolean | undefined) => {
|
export const tabs_style = (color: string, style: string | number | boolean | undefined) => {
|
||||||
const color_list = ['rgba(51,51,51,1)', 'rgba(255, 34, 34, 1)', 'rgba(255, 255, 255, 1)'];
|
const color_list = ['rgba(51,51,51,1)', 'rgba(255, 34, 34, 1)', 'rgba(255, 255, 255, 1)'];
|
||||||
if (color_list.includes(color)) {
|
if (color_list.includes(color)) {
|
||||||
if ((style == '2' || style == '4')) {
|
if (style == '2' || style == '4') {
|
||||||
return 'rgba(255, 255, 255, 1)';
|
return 'rgba(255, 255, 255, 1)';
|
||||||
} else if (style == '3') {
|
} else if (style == '3') {
|
||||||
return 'rgba(255, 34, 34, 1)';
|
return 'rgba(255, 34, 34, 1)';
|
||||||
|
|
@ -314,4 +314,13 @@ export const tabs_style = (color: string, style: string | number | boolean | und
|
||||||
} else {
|
} else {
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
// 在线地址
|
||||||
|
export const online_url = async () => {
|
||||||
|
if (import.meta.env.VITE_APP_BASE_API == '/dev-api') {
|
||||||
|
let temp_value = await import('../../temp.d');
|
||||||
|
return temp_value.default.temp_attachment_host + '/static/app/tabbar/';
|
||||||
|
} else {
|
||||||
|
return (await get_cookie('temp_attachment_host')) + '/static/app/tabbar/';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ service.interceptors.request.use(
|
||||||
// 如果是本地则使用静态tonken如果是线上则使用cookie的token
|
// 如果是本地则使用静态tonken如果是线上则使用cookie的token
|
||||||
const cookie = get_cookie('admin_info');
|
const cookie = get_cookie('admin_info');
|
||||||
if (import.meta.env.VITE_APP_BASE_API == '/dev-api') {
|
if (import.meta.env.VITE_APP_BASE_API == '/dev-api') {
|
||||||
let temp_token = await import('../../temp.d');
|
let temp_data = await import('../../temp.d');
|
||||||
config.url = config.url + '?token=' + temp_token.default;
|
config.url = config.url + '?token=' + temp_data.default.temp_token;
|
||||||
} else {
|
} else {
|
||||||
if (cookie) {
|
if (cookie) {
|
||||||
config.url = config.url + '&token=' + JSON.parse(cookie).token;
|
config.url = config.url + '&token=' + JSON.parse(cookie).token;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue