update:优化代码(老年化模式切换)

This commit is contained in:
2021-10-20 09:58:45 +08:00
parent 1d7e944df2
commit 99fc92a798
11 changed files with 89 additions and 89 deletions

View File

@@ -15,7 +15,6 @@
<div id="app"></div>
<!-- built files will be auto injected -->
<script>
// console.log("初始页面");
(function(w, d, s, q, i) {
w[q] = w[q] || [];
var f = d.getElementsByTagName(s)[0];

View File

@@ -22,7 +22,7 @@
</template>
<script>
import $ from "jquery";
import { recoverStyle2, changeStyle1 } from "@/olderMode/1.js";
export default {
name: "App",
data() {
@@ -42,18 +42,13 @@ export default {
methods: {
logout() {
sessionStorage.setItem("mode", "normal");
$(".container").removeClass("old_container");
this.mode = false;
$(".bottomContent").removeClass("old_bottomContent");
$("#app").removeClass("old_app2");
$("#app").removeClass("old_app");
recoverStyle2();
},
toOlderMode() {
sessionStorage.setItem("mode", "older");
$(".container").addClass("old_container");
this.mode = true;
$(".bottomContent").addClass("old_bottomContent");
$("#app").addClass("old_app2");
changeStyle1();
},
onRefresh() {
this.$children[0].$children[0].onInit();
@@ -86,11 +81,11 @@ export default {
b {
color: #5d8cbc;
}
// 退出老年模式
.logout {
padding: 20px 0 10px;
span {
font-size: 20px;
height: 19px;
color: #fefefe;
background: red;
padding: 0 10px;
@@ -113,13 +108,6 @@ export default {
padding-bottom: 190px !important;
.logout {
padding-top: 30px;
span {
height: 19px;
font-size: 20px;
color: #fefefe;
background: red;
padding: 0 10px;
}
}
}
.old_app3 {

View File

@@ -1,16 +1,40 @@
import $ from "jquery";
// 老年化样式
export const changeStyle = function() {
$(".bottomContent").addClass("old_bottomContent");
$("#app").addClass("old_app");
$(".container").addClass("old_container");
// 网页倒退
$("#app").removeClass("old_app2");
// 页面内点击
$("#app").removeClass("old_app3");
};
export const changeStyle1 = function() {
$(".bottomContent").addClass("old_bottomContent");
$("#app").addClass("old_app2");
$(".container").addClass("old_container");
};
// 正常样式
export const recoverStyle = () => {
$(".container").removeClass("old_container");
$(".bottomContent").removeClass("old_bottomContent");
$("#app").removeClass("old_app");
// 网页倒退
$("#app").removeClass("old_app2");
$("#app").addClass("old_app3");
};
export const recoverStyle2 = () => {
$(".container").removeClass("old_container");
$(".bottomContent").removeClass("old_bottomContent");
$("#app").removeClass("old_app");
$("#app").removeClass("old_app2");
};
export const changeBottomStyle = function() {
$(".bottomContent").addClass("old_bottomContent");
$("#app").addClass("old_app2");
};
export const projectSelectChangeStyle = function() {
changeBottomStyle();
};

View File

@@ -203,7 +203,7 @@
import { apis } from "@/common/apis";
import { mgop } from "@aligov/jssdk-mgop";
import { SetTicket } from "@/common/util//tools";
import { changeStyle } from "@/olderMode/1.js";
import { changeStyle, recoverStyle } from "@/olderMode/1.js";
import $ from "jquery";
export default {
name: "home",
@@ -212,7 +212,7 @@ export default {
mode: false,
loading: true,
data: {
idCard: "",
idCard: "无数据",
userName: "无数据",
policiesRegulationsLists: {
totalCount: 0,
@@ -260,42 +260,43 @@ export default {
// summationShouldCompensateMoney: "无数据"
// }
]
},
{
// name: "无数据",
// currentState: "无数据",
// area: "无数据",
// zsbm: "无数据",
// year: "无数据",
// zsjdh: "无数据",
fhpgList: [
// {
// assessmentNo: "无数据",
// houseAddress: "无数据",
// countValue: "无数据"
// }
],
bcxyList: [
// {
// xyNo: "无数据",
// houseAddress: "无数据",
// switchProductionWay: "无数据",
// summationShouldCompensateMoney: "无数据"
// }
]
}
// {
// name: "无数据",
// currentState: "无数据",
// area: "无数据",
// zsbm: "无数据",
// year: "无数据",
// zsjdh: "无数据",
// fhpgList: [
// {
// assessmentNo: "无数据",
// houseAddress: "无数据",
// countValue: "无数据"
// }
// ],
// bcxyList: [
// {
// xyNo: "无数据",
// houseAddress: "无数据",
// switchProductionWay: "无数据",
// summationShouldCompensateMoney: "无数据"
// }
// ]
// }
]
}
};
},
created() {
if (!this.$route.query.ticket) {
window.location.replace(
"https://puser.zjzwfw.gov.cn/sso/mobile.do?action=oauth&scope=1&servicecode=fwzs"
);
} else {
this.onInit();
}
// if (!this.$route.query.ticket) {
// window.location.replace(
// "https://puser.zjzwfw.gov.cn/sso/mobile.do?action=oauth&scope=1&servicecode=fwzs"
// );
// } else {
// this.onInit();
// }
this.onInit();
this.setLocationAplus();
SetTicket(this.$route.query.ticket);
$(".logout").css("display", "none");
@@ -367,21 +368,18 @@ export default {
});
},
toOlderMode() {
// 正常页面
if (sessionStorage.getItem("mode") == "older") {
$("#app").addClass("old_app3");
sessionStorage.setItem("mode", "normal");
this.$parent.$parent.mode = false;
this.mode = false;
$(".container").removeClass("old_container");
$(".bottomContent").removeClass("old_bottomContent");
$("#app").removeClass("old_app");
recoverStyle();
} else {
$("#app").removeClass("old_app3");
// 老年化模式
sessionStorage.setItem("mode", "older");
this.$parent.$parent.mode = true;
this.mode = true;
changeStyle();
$(".container").addClass("old_container");
}
},
setIdCard(id) {
@@ -402,10 +400,8 @@ export default {
},
// 直接跳转分户评估结果页面
toEvaluate(id, type) {
$("#app").removeClass("old_app3");
$(".bottomContent").removeClass("display");
$("#app").removeClass("padding");
$(".logout").css("display", "block");
$("#app").removeClass("old_app3");
this.$router.push({
name: "evaluatePage",
params: {
@@ -416,10 +412,8 @@ export default {
},
// 直接跳转协议结果pdf
toAgreement(id) {
$("#app").removeClass("old_app3");
$(".bottomContent").removeClass("display");
$("#app").removeClass("padding");
$(".logout").css("display", "block");
$("#app").removeClass("old_app3");
this.$router.push({
name: "showPdf",
params: {
@@ -435,10 +429,8 @@ export default {
},
// 政策信息页面跳转
pageJump(id) {
$("#app").removeClass("old_app3");
$(".bottomContent").removeClass("display");
$("#app").removeClass("padding");
$(".logout").css("display", "block");
$("#app").removeClass("old_app3");
this.$router.push({
name: "policyInfo",
params: { id }
@@ -636,7 +628,7 @@ export default {
height: 27px;
> div {
background: #24bca3;
height: 27px;
height: 100%;
display: flex;
align-items: center;
border-radius: 13px 0 0 13px;
@@ -872,8 +864,9 @@ export default {
background-position: 0 -2px;
background-size: 100% 120%;
}
> :nth-child(2) {
.projectRight {
margin-top: 10px;
height: 27px;
> :nth-child(1) {
border-radius: unset !important;
padding-right: 5px;
@@ -881,8 +874,6 @@ export default {
> span {
font-size: 20px;
border-radius: 0px 13px 13px 0px;
// height: unset;
// line-height: unset;
}
}
}

View File

@@ -19,7 +19,7 @@
</template>
<script>
import { projectSelectChangeStyle } from "@/olderMode/1.js";
import { changeBottomStyle } from "@/olderMode/1.js";
import $ from "jquery";
export default {
components: {},
@@ -34,7 +34,7 @@ export default {
},
created() {
if (sessionStorage.getItem("mode") == "older") {
projectSelectChangeStyle();
changeBottomStyle();
}
this.onInit();
},

View File

@@ -20,7 +20,7 @@
<script>
import { mgop } from "@aligov/jssdk-mgop";
import { projectSelectChangeStyle } from "@/olderMode/1.js";
import { changeBottomStyle } from "@/olderMode/1.js";
import $ from "jquery";
export default {
components: {},
@@ -35,7 +35,7 @@ export default {
},
created() {
if (sessionStorage.getItem("mode") == "older") {
projectSelectChangeStyle();
changeBottomStyle();
}
this.onInit();
},

View File

@@ -14,7 +14,7 @@
</template>
<script>
import { mgop } from "@aligov/jssdk-mgop";
import { projectSelectChangeStyle } from "@/olderMode/1.js";
import { changeBottomStyle } from "@/olderMode/1.js";
import $ from "jquery";
export default {
data() {
@@ -28,7 +28,7 @@ export default {
},
created() {
if (sessionStorage.getItem("mode") == "older") {
projectSelectChangeStyle();
changeBottomStyle();
}
this.onInit();
},

View File

@@ -56,18 +56,16 @@
</template>
<script>
import { projectSelectChangeStyle } from "@/olderMode/1.js";
import { changeBottomStyle } from "@/olderMode/1.js";
import $ from "jquery";
export default {
data() {
return {
type: "",
data: new Object(),
finished: true,
// 初始数据
info: {
userName: "无数据",
idCard: "无数据",
idCard: "522121199001012012",
prjList: [
{
area: "无数据",
@@ -83,7 +81,7 @@ export default {
},
created() {
if (sessionStorage.getItem("mode") == "older") {
projectSelectChangeStyle();
changeBottomStyle();
}
this.onInit();
},

View File

@@ -53,7 +53,7 @@
</template>
<script>
import { SetProjectId } from "@/common/util/tools";
import { projectSelectChangeStyle } from "@/olderMode/1.js";
import { changeBottomStyle } from "@/olderMode/1.js";
import $ from "jquery";
export default {
data() {
@@ -80,7 +80,7 @@ export default {
},
created() {
if (sessionStorage.getItem("mode") == "older") {
projectSelectChangeStyle();
changeBottomStyle();
}
this.onInit();
},

View File

@@ -69,7 +69,7 @@
</template>
<script>
import { mgop } from "@aligov/jssdk-mgop";
import { projectSelectChangeStyle } from "@/olderMode/1.js";
import { changeBottomStyle } from "@/olderMode/1.js";
import $ from "jquery";
export default {
data() {
@@ -94,7 +94,7 @@ export default {
},
created() {
if (sessionStorage.getItem("mode") == "older") {
projectSelectChangeStyle();
changeBottomStyle();
}
this.onInit();
},

View File

@@ -112,7 +112,7 @@
</template>
<script>
import { SetProjectId } from "@/common/util/tools";
import { projectSelectChangeStyle } from "@/olderMode/1.js";
import { changeBottomStyle } from "@/olderMode/1.js";
import $ from "jquery";
export default {
data() {
@@ -145,7 +145,7 @@ export default {
},
created() {
if (sessionStorage.getItem("mode") == "older") {
projectSelectChangeStyle();
changeBottomStyle();
}
this.onInit();
},