Ver código fonte

关于,支部介绍

liyongli 4 anos atrás
pai
commit
62c98a5100

+ 7 - 4
src/components/Detail/news.vue

@@ -4,9 +4,14 @@
       <div class="content" ref="content">
         <div class="grid-cell">
           <div class="render-detail-article">
-            <div class="render-detail-title" v-text="item.title"></div>
+            <div
+              class="render-detail-title"
+              v-if="item.title"
+              v-text="item.title"
+            ></div>
             <span
               style="font-size: 14px; color: #abb2b8"
+              v-if="item.origSource || item.publishTime"
               v-text="item.origSource + ' ' + item.publishTime"
             ></span>
             <div class="contentDetail" v-html="item.content"></div>
@@ -66,6 +71,7 @@ export default {
     }
   },
   mounted() {
+    if (!this.item.title) return;
     this.timeout = new Date() - 1001;
     window.webkit &&
       window.webkit.messageHandlers.setWebviewHeight.postMessage({
@@ -86,9 +92,6 @@ export default {
 };
 </script>
 <style lang="scss">
-.bg {
-  height: 100%;
-}
 #news {
   padding: 0.1rem;
   color: #262626;

+ 10 - 0
src/config/page.js

@@ -1,5 +1,15 @@
 //这里做页面参数约定和说明,如果url没有携带requiredParams的参数则无法初始化页面
 module.exports = {
+  aboutUs: {
+    title: "关于我们",
+    requiredParams: {},
+    optionalParams: {}
+  },
+  branchIntroduction: {
+    title: "支部介绍",
+    requiredParams: {},
+    optionalParams: {}
+  },
   robot: {
     title: "机器人",
     requiredParams: {},

+ 55 - 0
src/pages/aboutUs/Index.vue

@@ -0,0 +1,55 @@
+<template>
+  <div id="aboutUs" class="app">
+    <div class="head">
+      <van-image width="80" height="80" :src="logo" />
+      <br />
+      <div class="version">v{{ version }}</div>
+      <br />
+    </div>
+    <news v-if="content" :item="{ content: content }" />
+  </div>
+</template>
+
+<script>
+import { Image as vanImage } from "vant";
+import { currentUrlToParams, setToken } from "@/utils/common.js";
+import news from "@/components/Detail/news.vue";
+import logo from "@/assets/image/0.jpg";
+
+export default {
+  name: "app",
+  data: function() {
+    return {
+      logo,
+      content: "",
+      version: ""
+    };
+  },
+  methods: {},
+  mounted() {
+    let _this = this;
+    this.$pageParams = currentUrlToParams();
+    this.version = this.$pageParams.version || "";
+    setToken(this.$pageParams.token || "");
+    window.aboutUs = function(html) {
+      _this.content = html;
+    };
+  },
+  beforeDestroy: function() {},
+  components: { news, vanImage }
+};
+</script>
+<style lang="scss">
+#aboutUs {
+  height: 100%;
+  overflow-y: scroll;
+  .head {
+    text-align: center;
+    padding-bottom: 1em;
+    padding-top: 0.5rem;
+    .van-image {
+      margin: 0 auto;
+    }
+  }
+}
+</style>

+ 16 - 0
src/pages/aboutUs/index.js

@@ -0,0 +1,16 @@
+import Vue from "vue";
+import App from "./Index.vue";
+import "@/pages/common.js";
+import { validateInitPage } from "@/utils/validateInitPage.js";
+
+validateInitPage() //这里还可以链式then做一些权限拦截
+  .then((pageName, pageParams) => {
+    Vue.prototype.$pageName = pageName;
+    Vue.prototype.$pageParams = pageParams;
+    new Vue({
+      render: h => h(App)
+    }).$mount("#app");
+  })
+  .catch(e => {
+    console.log(e);
+  });

+ 33 - 0
src/pages/branchIntroduction/Index.vue

@@ -0,0 +1,33 @@
+<template>
+  <div id="branchIntroduction" class="app">
+    <news v-if="content" :item="{ content: content }" />
+  </div>
+</template>
+
+<script>
+import news from "@/components/Detail/news.vue";
+
+export default {
+  name: "app",
+  data: function() {
+    return {
+      content: ""
+    };
+  },
+  methods: {},
+  mounted() {
+    let _this = this;
+    window.branchIntroduction = function(html) {
+      _this.content = html;
+    };
+  },
+  beforeDestroy: function() {},
+  components: { news }
+};
+</script>
+<style lang="scss">
+#branchIntroduction {
+  height: 100%;
+  overflow-y: scroll;
+}
+</style>

+ 16 - 0
src/pages/branchIntroduction/index.js

@@ -0,0 +1,16 @@
+import Vue from "vue";
+import App from "./Index.vue";
+import "@/pages/common.js";
+import { validateInitPage } from "@/utils/validateInitPage.js";
+
+validateInitPage() //这里还可以链式then做一些权限拦截
+  .then((pageName, pageParams) => {
+    Vue.prototype.$pageName = pageName;
+    Vue.prototype.$pageParams = pageParams;
+    new Vue({
+      render: h => h(App)
+    }).$mount("#app");
+  })
+  .catch(e => {
+    console.log(e);
+  });

+ 1 - 1
src/pages/robot/Index.vue

@@ -459,7 +459,7 @@ export default {
     .bg {
       width: 0;
       height: 0;
-      border: 87px solid #fafafa;
+      border: 83px solid #fafafa;
       border-radius: 50%;
       position: absolute;
       z-index: -1;