Ver Fonte

添加黑白模式

liyongli há 3 anos atrás
pai
commit
e0bc0ee29a

+ 9 - 0
src/assets/css/style.scss

@@ -5,6 +5,15 @@
   margin: 0;
   padding: 0;
 }
+// 黑白模式
+.block{
+  -webkit-filter: grayscale(100%);
+  -moz-filter: grayscale(100%);
+  -ms-filter: grayscale(100%);
+  -o-filter: grayscale(100%);
+  filter: grayscale(100%);
+  filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
+}
 html,body{
   height: 100%;
   width: 100%;

+ 4 - 2
src/pages/aboutUs/Index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div id="aboutUs" class="app">
+  <div id="aboutUs" :class="{ app: true, block: type === 1 }">
     <van-sticky :offset-top="0" v-if="!version">
       <van-nav-bar left-arrow @click-left="onClickLeft" title="关于我们" />
     </van-sticky>
@@ -37,7 +37,8 @@ export default {
     return {
       logo,
       content: "",
-      version: ""
+      version: "",
+      type: undefined
     };
   },
   methods: {
@@ -48,6 +49,7 @@ export default {
   mounted() {
     let _this = this;
     this.$pageParams = currentUrlToParams();
+    this.type = this.$pageParams.pattern - 0;
     this.version = this.$pageParams.version || "";
     setToken(this.$pageParams.token || "");
     window.aboutUs = function(html) {

+ 6 - 2
src/pages/branchIntroduction/Index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div id="branchIntroduction" class="app">
+  <div id="branchIntroduction" :class="{ app: true, block: type === 1 }">
     <div class="sk" v-if="!content">
       <van-skeleton title avatar :row="15" />
     </div>
@@ -10,18 +10,22 @@
 <script>
 import news from "@/components/Detail/news.vue";
 
+import { currentUrlToParams } from "@/utils/common.js";
 import { Skeleton as vanSkeleton } from "vant";
 import "vant/lib/skeleton/style";
 export default {
   name: "app",
   data: function() {
     return {
-      content: ""
+      content: "",
+      type: undefined
     };
   },
   methods: {},
   mounted() {
     let _this = this;
+    this.$pageParams = currentUrlToParams();
+    this.type = this.$pageParams.pattern - 0;
     window.branchIntroduction = function(html) {
       _this.content = html;
     };

+ 4 - 2
src/pages/detail/AppDetail/Index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div id="AppDetail" class="app">
+  <div id="AppDetail" :class="{ app: true, block: type === 1 }">
     <div class="sk" v-if="loda">
       <van-skeleton title :row="15" />
     </div>
@@ -27,12 +27,14 @@ export default {
     return {
       loda: true,
       detailData: {},
-      id: undefined
+      id: undefined,
+      type: undefined
     };
   },
   methods: {},
   mounted() {
     this.$pageParams = currentUrlToParams();
+    this.type = this.$pageParams.pattern - 0;
     this.$pageParams.token && setToken(this.$pageParams.token);
     window.Progress = function() {
       return this.progress + "";

+ 6 - 2
src/pages/download/Index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div id="download" class="app">
+  <div id="download" :class="{ app: true, block: type === 1 }">
     <van-overlay :show="show" class-name="overlay">
       <div class="wrapper text">
         <div class="top"></div>
@@ -22,6 +22,7 @@
 </template>
 
 <script>
+import { currentUrlToParams } from "@/utils/common.js";
 import { Button as vanButton, Overlay as vanOverlay } from "vant";
 import "vant/lib/button/style";
 import "vant/lib/overlay/style";
@@ -33,7 +34,8 @@ export default {
       isAndroid: true,
       isWindows: false,
       isIphone: false,
-      show: false
+      show: false,
+      type: undefined
     };
   },
   methods: {
@@ -43,6 +45,8 @@ export default {
     }
   },
   mounted() {
+    this.$pageParams = currentUrlToParams();
+    this.type = this.$pageParams.pattern - 0;
     const sys = window.navigator.userAgent.toLowerCase();
     this.isAndroid = /android/g.test(sys);
     this.isWindows = /windows/g.test(sys);

+ 2 - 6
src/pages/index/Index.vue

@@ -16,12 +16,8 @@
       <van-tabbar-item name="partyHome" icon="records">
         移动党校
       </van-tabbar-item>
-      <van-tabbar-item name="service" icon="orders-o">
-        服务
-      </van-tabbar-item>
-      <van-tabbar-item name="myHome" icon="home-o">
-        我的
-      </van-tabbar-item>
+      <van-tabbar-item name="service" icon="orders-o"> 服务 </van-tabbar-item>
+      <van-tabbar-item name="myHome" icon="home-o"> 我的 </van-tabbar-item>
     </van-tabbar>
   </div>
 </template>

+ 7 - 4
src/pages/privacy/Index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div id="privacy" class="app">
+  <div id="privacy" :class="{ app: true, block: type === 1 }">
     <div class="sk" v-if="!content">
       <br />
       <van-skeleton title :row="10" />
@@ -18,7 +18,8 @@ export default {
   name: "app",
   data: function() {
     return {
-      content: ""
+      content: "",
+      type: undefined
     };
   },
   methods: {
@@ -27,10 +28,12 @@ export default {
     }
   },
   mounted() {
-    window.privacy = html => {
-      this.content = html;
+    let _this = this;
+    window.privacy = function(html) {
+      _this.content = html;
     };
     this.$pageParams = currentUrlToParams();
+    this.type = this.$pageParams.pattern - 0;
   },
   beforeDestroy: function() {},
   components: { news, vanSkeleton }

+ 6 - 2
src/pages/robot/Index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="robot">
+  <div :class="{ robot: true, block: type === 1 }">
     <van-dropdown-menu v-if="robotList.length">
       <van-dropdown-item
         @change="change"
@@ -159,6 +159,7 @@
 </template>
 
 <script>
+import { currentUrlToParams } from "@/utils/common.js";
 import { getRobotToken, getRobotClient } from "@/api/robot/index.js";
 import Config from "@/config/index.js";
 import {
@@ -225,7 +226,8 @@ export default {
       q: [],
       touch: false,
       deviceId: "",
-      message: ""
+      message: "",
+      type: undefined
     };
   },
   computed: {
@@ -381,6 +383,8 @@ export default {
     }
   },
   mounted() {
+    this.$pageParams = currentUrlToParams();
+    this.type = this.$pageParams.pattern - 0;
     this.reset();
     getRobotToken().then(res => {
       if (res.error_code !== 0) return Toast("机器人走丢了");

+ 7 - 4
src/pages/userProtocol/Index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div id="userProtocol" class="app">
+  <div id="userProtocol" :class="{ app: true, block: type === 1 }">
     <div class="sk" v-if="!content">
       <br />
       <van-skeleton title :row="10" />
@@ -18,7 +18,8 @@ export default {
   name: "app",
   data: function() {
     return {
-      content: ""
+      content: "",
+      type: undefined
     };
   },
   methods: {
@@ -27,10 +28,12 @@ export default {
     }
   },
   mounted() {
-    window.userProtocol = html => {
-      this.content = html;
+    let _this = this;
+    window.userProtocol = function(html) {
+      _this.content = html;
     };
     this.$pageParams = currentUrlToParams();
+    this.type = this.$pageParams.pattern - 0;
   },
   beforeDestroy: function() {},
   components: { news, vanSkeleton }