f9bdf0d5 by simon

默认提交

1 parent 16064539
......@@ -139,9 +139,14 @@ npm版本: 推荐6.10.3或以上
- 简体[zh]
- 英文[en]
三语文件所在目录:
#### 执行逻辑
访问页面时,会先从localStorage里获取历史选取语言,若活动结果为空,则默认使用繁体。
语言切换时,把当前选择语言注入到i18n并埋到localStorage,同时广播事件,通知页面初始化(重新读取cms内容)。
......
......@@ -49,7 +49,8 @@ export default {
let deviceType = output.device.type;
let isMobile = deviceType == "mobile";
this.$store.commit("IS_MOBILE", isMobile);
},
},
// 设置用户Profile
refreshProfile() {
let userInfoStr = decodeURIComponent(getCookie("_user_profile"));
if (userInfoStr) {
......
......@@ -122,17 +122,6 @@ export default {
let b10 = this.policyIllegal;
// console.log("b1:", b1);
// console.log("b2:", b2);
// console.log("b3:", b3);
// console.log("b4:", b4);
// console.log("b5:", b5);
// console.log("b6:", b6);
// console.log("b7:", b7);
// console.log("b8:", b8);
// console.log("b9:", b9);
// console.log("b10:", b10);
return b1 || b2 || b3 || b4 || b5 || b6 || b7 || b8 || b9 || b10;
},
isLogin() {
......@@ -152,7 +141,6 @@ export default {
sessionStorage.removeItem("clarmDataForm");
let aggressStr = sessionStorage.getItem("clarmAggressStr");
if (clarmDataFormStr) {
try {
this.data = JSON.parse(clarmDataFormStr);
......
import api from '@/api/api'
import {
httpGet,
httpPost
} from '@/api/fetch-api.js'
/**
* 组件描述:日历选择器
*/
import Date from '@/utils/date.js';
import { toSolar } from '@/utils/lunar.js';
import {
toSolar
} from '@/utils/lunar.js';
import {
ddMMyyyy2yyyyMMdd
} from '@utils/utils.js';
export default {
inheritAttrs: false,
inheritAttrs: false,
props: {
value: {
type: String,
......@@ -36,14 +37,14 @@ export default {
// holiday : 节假日不可选择
filtModel: {
type: Array,
default() {
default () {
return ["history", "weekend", "today"]
}
},
// 需要过滤的日期列表 格式 ["yyyy-MM-dd","yyyy-MM-dd"]
filterDates: {
type: Array,
default() {
default () {
return [] // ["2019-11-26", "2019-11-28"]
}
},
......@@ -70,9 +71,10 @@ export default {
type: Function,
default: null
},
// 属性值
cusStyle: {
type: Object,
default() {
default () {
return {};
}
},
......@@ -103,9 +105,23 @@ export default {
visible: false,
hkHolidayDefine: {
// 公历假期,缺少复活节,缺少聖誕節後第一個周日
gl: [[1, 1], [5, 1], [7, 1], [10, 1], [10, 2], [12, 25]],
gl: [
[1, 1],
[5, 1],
[7, 1],
[10, 1],
[10, 2],
[12, 25]
],
// 农历假期,缺少清明节
nl: [[1, 1], [1, 2], [1, 3], [5, 5], [8, 15], [9, 9]],
nl: [
[1, 1],
[1, 2],
[1, 3],
[5, 5],
[8, 15],
[9, 9]
],
// 清明节
qm: [
// 4月4号
......@@ -114,37 +130,223 @@ export default {
["2022", "2023", "2026", "2027", "2030", "2031", "2034", "2035", "2038", "2039"]
],
pub: {
2020: [[4, 10], [4, 11], [4, 12], [4, 13], [4, 30]],
2021: [[4, 2], [4, 3], [4, 4], [4, 5], [5, 19]],
2022: [[4, 15], [4, 16], [4, 17], [4, 18], [5, 8]],
2023: [[4, 7], [4, 8], [4, 9], [4, 10], [5, 26]],
2024: [[3, 29], [3, 30], [3, 31], [4, 1], [5, 15]],
2025: [[4, 18], [4, 19], [4, 20], [4, 21], [5, 5]],
2026: [[4, 3], [4, 4], [4, 5], [4, 6], [5, 24]],
2027: [[3, 26], [3, 27], [3, 28], [3, 29], [5, 13]],
2028: [[4, 14], [4, 15], [4, 16], [4, 17], [5, 2]],
2029: [[3, 30], [3, 31], [4, 1], [4, 2], [5, 20]],
2030: [[4, 19], [4, 20], [4, 21], [4, 22], [5, 9]],
2031: [[4, 11], [4, 12], [4, 13], [4, 14], [5, 28]],
2032: [[3, 26], [3, 27], [3, 28], [3, 29], [5, 16]],
2033: [[4, 15], [4, 16], [4, 17], [4, 18], [5, 6]],
2034: [[4, 7], [4, 8], [4, 9], [4, 10], [5, 25]],
2035: [[3, 23], [3, 24], [3, 25], [3, 26], [5, 15]],
2036: [[4, 11], [4, 12], [4, 13], [4, 14], [5, 3]],
2037: [[4, 3], [4, 4], [4, 5], [4, 6], [5, 22]],
2038: [[4, 23], [4, 24], [4, 25], [4, 26], [5, 11]],
2039: [[4, 8], [4, 9], [4, 10], [4, 11], [4, 30]],
2040: [[3, 30], [3, 31], [4, 1], [4, 2], [5, 18]],
2041: [[4, 19], [4, 20], [4, 21], [4, 22], [5, 7]],
2042: [[4, 4], [4, 5], [4, 6], [4, 7], [5, 26]],
2043: [[3, 27], [3, 28], [3, 29], [3, 30], [5, 16]],
2044: [[4, 15], [4, 16], [4, 17], [4, 18], [5, 5]],
2045: [[4, 7], [4, 8], [4, 9], [4, 10], [5, 24]],
2046: [[3, 23], [3, 24], [3, 25], [3, 26], [5, 13]],
2047: [[4, 12], [4, 13], [4, 14], [4, 15], [5, 2]],
2048: [[4, 3], [4, 4], [4, 5], [4, 6], [5, 20]],
2049: [[4, 16], [4, 17], [4, 18], [4, 19], [5, 9]],
2050: [[4, 8], [4, 9], [4, 10], [4, 11], [5, 28]]
2020: [
[4, 10],
[4, 11],
[4, 12],
[4, 13],
[4, 30]
],
2021: [
[4, 2],
[4, 3],
[4, 4],
[4, 5],
[5, 19]
],
2022: [
[4, 15],
[4, 16],
[4, 17],
[4, 18],
[5, 8]
],
2023: [
[4, 7],
[4, 8],
[4, 9],
[4, 10],
[5, 26]
],
2024: [
[3, 29],
[3, 30],
[3, 31],
[4, 1],
[5, 15]
],
2025: [
[4, 18],
[4, 19],
[4, 20],
[4, 21],
[5, 5]
],
2026: [
[4, 3],
[4, 4],
[4, 5],
[4, 6],
[5, 24]
],
2027: [
[3, 26],
[3, 27],
[3, 28],
[3, 29],
[5, 13]
],
2028: [
[4, 14],
[4, 15],
[4, 16],
[4, 17],
[5, 2]
],
2029: [
[3, 30],
[3, 31],
[4, 1],
[4, 2],
[5, 20]
],
2030: [
[4, 19],
[4, 20],
[4, 21],
[4, 22],
[5, 9]
],
2031: [
[4, 11],
[4, 12],
[4, 13],
[4, 14],
[5, 28]
],
2032: [
[3, 26],
[3, 27],
[3, 28],
[3, 29],
[5, 16]
],
2033: [
[4, 15],
[4, 16],
[4, 17],
[4, 18],
[5, 6]
],
2034: [
[4, 7],
[4, 8],
[4, 9],
[4, 10],
[5, 25]
],
2035: [
[3, 23],
[3, 24],
[3, 25],
[3, 26],
[5, 15]
],
2036: [
[4, 11],
[4, 12],
[4, 13],
[4, 14],
[5, 3]
],
2037: [
[4, 3],
[4, 4],
[4, 5],
[4, 6],
[5, 22]
],
2038: [
[4, 23],
[4, 24],
[4, 25],
[4, 26],
[5, 11]
],
2039: [
[4, 8],
[4, 9],
[4, 10],
[4, 11],
[4, 30]
],
2040: [
[3, 30],
[3, 31],
[4, 1],
[4, 2],
[5, 18]
],
2041: [
[4, 19],
[4, 20],
[4, 21],
[4, 22],
[5, 7]
],
2042: [
[4, 4],
[4, 5],
[4, 6],
[4, 7],
[5, 26]
],
2043: [
[3, 27],
[3, 28],
[3, 29],
[3, 30],
[5, 16]
],
2044: [
[4, 15],
[4, 16],
[4, 17],
[4, 18],
[5, 5]
],
2045: [
[4, 7],
[4, 8],
[4, 9],
[4, 10],
[5, 24]
],
2046: [
[3, 23],
[3, 24],
[3, 25],
[3, 26],
[5, 13]
],
2047: [
[4, 12],
[4, 13],
[4, 14],
[4, 15],
[5, 2]
],
2048: [
[4, 3],
[4, 4],
[4, 5],
[4, 6],
[5, 20]
],
2049: [
[4, 16],
[4, 17],
[4, 18],
[4, 19],
[5, 9]
],
2050: [
[4, 8],
[4, 9],
[4, 10],
[4, 11],
[5, 28]
]
}
},
// 节假日,key是月份,value是日期列表
......@@ -155,6 +357,7 @@ export default {
},
components: {},
computed: {
// 节日计算
holiday() {
// 计算新历
let result = {};
......@@ -164,7 +367,6 @@ export default {
}
let hkHolidayDefine = this.hkHolidayDefine;
// 加入清明节
if (hkHolidayDefine.qm[0].indexOf(year + "") >= 0) {
// 如果是周六/周日,顺延到下周一
......@@ -508,7 +710,9 @@ export default {
let _this = this;
let type = boo ? "show" : "close";
setTimeout(function () {
_this.pluginActivity({ type: type });
_this.pluginActivity({
type: type
});
}, 100);
}
},
......@@ -561,18 +765,13 @@ export default {
}
},
formatDateValue(year, month, date) {
// console.log("year:", year);
// console.log("month:", month);
// console.log("date:", date);
if (month < 10) {
month = "0" + month
}
if (date < 10) {
date = "0" + date
}
// this.dateValue = `${year}-${month}-${date}`;
this.dateValue = Date.parse(`${year}.${month}.${date}`).toString(this.formatter);
// console.log("this.dateValue:", this.dateValue);
},
/**
* 校验并返回日期
......@@ -613,16 +812,6 @@ export default {
// 设置今天日期
let isInit = false;
if (this.value) {
// console.log("this.value:", this.value);
// let ymd = this.value.split("-");
// if (ymd.length == 3) {
// try {
// this.year = Number(ymd[0]);
// this.month = Number(ymd[1]);
// this.date = Number(ymd[2]);
// isInit = true;
// } catch (e) {}
// }
try {
let dateStr = this.value;
if (this.formatter == "dd-MM-yyyy") {
......@@ -635,7 +824,7 @@ export default {
this.month = curDate.getMonth() + 1;
this.date = curDate.getDate();
isInit = true;
} catch (error) { }
} catch (error) {}
}
if (!isInit) {
let today = Date.today();
......@@ -678,7 +867,7 @@ export default {
// if (date.getDay() == 6) {
// // 周六
// date.addDays(2);
// } else
// } else
if (date.getDay() == 0) {
date.addDays(1);
}
......@@ -687,7 +876,7 @@ export default {
return [m, d];
}
},
mounted() { },
mounted() {},
created() {
this.initData();
},
......@@ -700,8 +889,6 @@ export default {
this.checkDateValue();
this.$emit('input', val);
},
year() {
// this.calculateHolidays();
}
year() {}
}
}
......
import {
mapState
} from 'vuex'
/**
* 组件描述:PC顶栏导航下拉菜单
*/
import api from '@/api/api'
import {
httpPost
......@@ -17,27 +16,39 @@ export default {
};
},
props: {
/**
* 导航类型
* nav:普通菜单导航
* login:登陆菜单
* lang:三语切换菜单
*/
type: {
type: String,
default() {
default () {
return "nav";
}
},
/**
* 传入菜单完整数据
*/
dataObj: {
type: Object,
default() {
default () {
return {};
}
},
/**
* 传入菜单列表
*/
dataList: {
type: Array,
default() {
default () {
return [];
}
},
labelProperty: {
type: String,
default() {
default () {
return "name";
}
}
......@@ -51,6 +62,7 @@ export default {
},
methods: {
onNavHandler() {
console.log("this.dataObj:", this.dataObj);
let path = this.dataObj && this.dataObj.path || "";
if (path) {
this.$router.push({
......@@ -69,8 +81,6 @@ export default {
},
onClickHandler(event, index) {
// 隐藏其他
// let path = event.path || (event.composedPath && event.composedPath()); //兼容火狐和safari
// path[1].style.display = "none";
if (this.$refs.ul) {
this.$refs.ul.style.display = "none";
}
......@@ -90,21 +100,13 @@ export default {
this.sTitle = curData.name;
this.$root.eventBus.$emit("langChange");
}
// console.log(this.$route);
}
} else {
// if (curData.value == "logout") {
// this.loginHandler();
// } else {
// this.$router.push({
// path: curData.path
// })
// }
let item = curData;
let path = item && item.path || "";
this.$root.eventBus.$emit(item.path);
if (path) {
console.log("path:", path);
// console.log("path:", path);
// modify
if (path == "/custom/service?q=m5") {
path = "/clarms"
......@@ -177,5 +179,5 @@ export default {
return this.dataList[this.activeIndex][this.labelProperty];
}
},
created() { },
created() {},
};
......
import api from '@/api/api'
import {
httpGet,
httpPost
} from '@/api/fetch-api.js'
/**
* 组件描述:页脚
* 静态页面
*/
export default {
data() {
......
......@@ -66,7 +66,6 @@
<!-- 版权 -->
<div class="copyright">
{{$t('footer.copyright')}}
<!-- <br>Copyright © PING AN INSURANCE (GROUP) COMPANY OF CHINA ,LTD. All Rights Reserved -->
</div>
</div>
</div>
......
/**
* 组件描述:官网顶栏导航
* 通过@midea 媒体查询决定显示PC/移动端样式
*/
import {
mapState
} from 'vuex'
......@@ -24,26 +29,29 @@ export default {
dropdownMVisible: false,
loginMVisible: false,
maxClientWidth: 1200,
// 用于传入到导航组件dropdown 常规导航菜单数据
navList: [],
// 用于传入到导航组件dropdown 登菜单数据
loginData: {},
// 用于传入到导航组件dropdown 语言菜单数据
langData: {
name: "繁",
path: "",
list: [{
name: "繁",
path: "",
value: "tc"
},
{
name: "简",
path: "",
value: "zh"
},
{
name: "EN",
path: "",
value: "en"
},
name: "繁",
path: "",
value: "tc"
},
{
name: "简",
path: "",
value: "zh"
},
{
name: "EN",
path: "",
value: "en"
},
]
}
}
......@@ -67,7 +75,7 @@ export default {
this.dropdownMVisible = true;
} else if (evtStr == 'login') {
this.loginMVisible = true;
} else { }
} else {}
},
checkIsSmallScreen() {
const self = this;
......@@ -79,14 +87,15 @@ export default {
},
initData() {
let i18n = this.$i18n.messages[this.$i18n.locale] || {};
// this.loginData = i18n.nav.loginData;
this._buildLoginMenu();
this.buildLoginMenu();
this.navList = i18n.nav.navList;
let curLang = getObjByListKeyValue(this.$i18n.locale, "value", this.langData.list)
this.langData.name = curLang.name;
},
_buildLoginMenu() {
// 构建登录页
/**
* 根据登陆状态构建登陆菜单
*/
buildLoginMenu() {
let i18n = this.$i18n.messages[this.$i18n.locale] || {};
let menuData = JSON.parse(JSON.stringify(i18n.nav.loginData));
let list = [];
......@@ -109,18 +118,12 @@ export default {
}
menuData.list = list;
this.$set(this, 'loginData', menuData);
// console.log(this.userInfo);
}
},
beforeDestroy() {
window.removeEventListener('resize', this.checkIsSmallScreen(), false)
},
mounted() {
// const self = this;
// self.checkIsSmallScreen();
// document.body.onresize = () => {
// self.checkIsSmallScreen();
// }
window.addEventListener('resize', () => this.checkIsSmallScreen(), false);
this.$root.eventBus.$on("langChange", () => {
this.initData();
......
......@@ -21,19 +21,28 @@ export default {
props: {
visible: {
type: Boolean,
default() {
default () {
return false;
}
},
/**
* 导航类型
* nav:普通菜单导航
* login:登陆菜单
* lang:三语切换菜单
*/
type: {
type: String,
default() {
default () {
return "nav";
}
},
/**
* 传入菜单列表
*/
langList: {
type: Array,
default() {
default () {
return [];
}
},
......@@ -88,10 +97,14 @@ export default {
if (this.$route.name == "login") {
return;
} else if (this.$route.name == "register" || this.$route.name == "passwordFind") {
this.$router.push({ path: "/login" });
this.$router.push({
path: "/login"
});
} else {
let callback = this.$route.fullPath;
this.$router.push({ path: "/login?callback=" + callback });
this.$router.push({
path: "/login?callback=" + callback
});
}
},
logoutHandler() {
......
import api from '@/api/api'
import {
httpGet,
httpPost
} from '@/api/fetch-api.js'
/**
* 组件描述:官网通用模态窗
*
* PC端样式为上图标 下文案
* 主要操作成功提示
*/
export default {
props: {
......
import api from '@/api/api'
import {
httpGet,
httpPost
} from '@/api/fetch-api.js'
/**
* 组件描述:官网协议模态窗
*/
export default {
props: {
......
import api from '@/api/api'
import {
httpGet,
httpPost
} from '@/api/fetch-api.js'
/**
* 组件描述:官网通用建议模态窗
*/
export default {
props: {
......
/**
* 组件描述:证件上传组件
*/
import api from '@/api/api'
import {
httpGet,
......
/**
* 组件描述:官网通用模态窗 第二类
* PC端样式为左图标右文案
* 主要用于错误提示
*/
export default {
props: {
// 是否显示组件
......
import api from '@/api/api'
import {
httpGet,
httpPost
} from '@/api/fetch-api.js'
/**
* 组件描述:官网通用模态窗 第二类
* PC端样式为左图标右文案
* 主要用于错误提示
*/
export default {
name: "pagination",
props: {
// 总页数
total: {
type: Number,
default: 1
},
// 总条数,名字自取 还有国家化
// 总条数
totalItem: {
type: Number,
default: 1
......@@ -19,7 +19,6 @@ export default {
},
data() {
return {
// total: 10, // 总页数
cur: 1, // 当前页码
sel: 1, // 选择的页码
}
......@@ -80,7 +79,7 @@ export default {
this.sendPage();
},
sendPage() {
// 发送事件
// 发送选页事件
this.$emit("selpage", {
page: this.cur
});
......
/**
* 组件描述:网销弹窗组件
* 该组件挂载在app.vue内跟导航header,页脚footer,主要内容main同级
*/
import {
mapState
} from "vuex";
......@@ -125,9 +130,6 @@ export default {
let d = now.getDate();
if (this.$i18n.locale == 'en') {
// this.policyDetail.nowYmd1 = m > 10 ? m : "0" + m;
// this.policyDetail.nowYmd2 = d > 10 ? d : "0" + d;
// this.policyDetail.nowYmd3 = y;
this.policyDetail.nowYmd2 = m > 10 ? m : "0" + m;
this.policyDetail.nowYmd1 = d > 10 ? d : "0" + d;
this.policyDetail.nowYmd3 = y;
......@@ -193,6 +195,7 @@ export default {
this.checkIfShowPolicy();
}
},
// 下载政策协议
downloadPolicy() {
if (this.policyDetail) {
httpPost({
......