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

View File

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

View File

@@ -1,16 +1,40 @@
import $ from "jquery"; import $ from "jquery";
// 老年化样式
export const changeStyle = function() { export const changeStyle = function() {
$(".bottomContent").addClass("old_bottomContent"); $(".bottomContent").addClass("old_bottomContent");
$("#app").addClass("old_app"); $("#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"); $("#app").removeClass("old_app2");
}; };
export const changeBottomStyle = function() { export const changeBottomStyle = function() {
$(".bottomContent").addClass("old_bottomContent"); $(".bottomContent").addClass("old_bottomContent");
$("#app").addClass("old_app2"); $("#app").addClass("old_app2");
};
export const projectSelectChangeStyle = function() {
changeBottomStyle();
}; };

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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