HT语种; 当前语种

feature/price_manager
Lei OT 2 years ago
parent bf1d668301
commit ce345c7347

@ -1,4 +1,4 @@
export const useLanguageSets = () => {
export const useHTLanguageSets = () => {
const newData = [
{ key: '1', value: '1', label: 'English' },
{ key: '2', value: '2', label: 'Chinese (中文)' },

@ -4,20 +4,39 @@ import { useTranslation } from 'react-i18next';
/**
* 产品管理 相关的预设数据
* 项目类型
1 酒店预定
2 火车
3 飞机票务
4 游船
5 快巴
6 旅行社(综费) -
7 景点 -
8 特殊项目 -
9 其他
A 酒店
B 超公里 -
C 餐费 -
D 包价包
X
酒店预定 1
火车 2
飞机票务 3
游船 4
快巴 5
旅行社(综费) 6
景点 7
特殊项目 8
其他 9
酒店 A
超公里 B
餐费 C
小包价 D
X
购物 S
R
娱乐 E
精华线路 T
客人testimonial F
线路订单 O
P
信息 I
国家 G
城市 K
图片 H
地图 M
包价线路 L
节日节庆 V
火车站 N
手机租赁 Z
* * todo: webht 类型
P 导游
T 车费
*/
export const useProductsTypes = () => {
@ -28,8 +47,8 @@ export const useProductsTypes = () => {
const newData = [
{ label: t('products:type.Experience'), value: '6', key: '6' },
{ label: t('products:type.Overtravel'), value: 'B', key: 'B' },
{ label: t('products:type.Car'), value: 'Car', key: 'Car' },
{ label: t('products:type.Guide'), value: 'Guide', key: 'Guide' },
{ label: t('products:type.Car'), value: 'T', key: 'T' },
{ label: t('products:type.Guide'), value: 'P', key: 'P' },
{ label: t('products:type.Package'), value: 'D', key: 'D' },
{ label: t('products:type.Attractions'), value: '7', key: '7' },
{ label: t('products:type.Meals'), value: 'C', key: 'C' },
@ -42,7 +61,6 @@ export const useProductsTypes = () => {
return types;
};
export const useProductsAuditStates = () => {
const [types, setTypes] = useState([]);
const { t, i18n } = useTranslation();
@ -66,3 +84,18 @@ export const useProductsAuditStatesMapVal = (value) => {
const stateMapVal = stateSets.reduce((r, c) => ({ ...r, [`${c.value}`]: c }), {});
return stateMapVal;
};
export const useProductsTypesFieldsets = (type, role) => {
const infoDefault = ['code', 'title'];
const infoAdmin = ['remarks', 'dept'];
const infoTypesMap = {
'6': [],
'B': ['city_id', 'km'],
'车费': ['description', 'city_id', 'recommends_rate', 'duration', 'display_to_c'], // todo: 包价类型??
'导游': ['description', 'city_id', 'duration', ],
'D': [], //todo: 木有图
'7': ['description', 'city_id', 'recommends_rate', 'duration', 'display_to_c', 'open_weekdays'], // todo: 怎么是2个图
'C': ['description', 'city_id',],
'8': [], // todo: ?
};
};

@ -8,6 +8,11 @@ const i18n_to_htcode = {
'en': 1,
};
export const useLanguage = () => {
const { i18n } = useTranslation();
return { language: i18n.language, };
};
/**
* 语言选择组件
*/

Loading…
Cancel
Save