panhui 4 ani în urmă
părinte
comite
b6abae8c62
2 a modificat fișierele cu 34 adăugiri și 2 ștergeri
  1. BIN
      src/assets/raex_icon.png
  2. 34 2
      src/views/product/NewsDetail.vue

BIN
src/assets/raex_icon.png


+ 34 - 2
src/views/product/NewsDetail.vue

@@ -1,5 +1,19 @@
 <template>
     <div class="news newsB">
+        <van-sticky>
+            <van-notice-bar
+                text="RAEX宇宙,立即下载"
+                @click="download"
+                background="#3ab20010"
+                color="#3ab200"
+                mode="link"
+                v-if="!inApp && isShare"
+            >
+                <template #left-icon>
+                    <img class="app-icon" src="@assets/raex_icon.png" alt="" />
+                </template>
+            </van-notice-bar>
+        </van-sticky>
         <div class="detail" v-html="info.detail"></div>
         <div class="news-btn" v-if="info.link">
             <van-button round block type="primary" @click="goNext(info)">{{ info.buttonName }}</van-button>
@@ -31,24 +45,33 @@
 <script>
 import banner from '../../mixins/banner';
 import resolveUrl from 'resolve-url';
+let inApp = /#cordova#/i.test(navigator.userAgent);
 export default {
     data() {
         return {
-            info: {}
+            info: {},
+            inApp,
+            isShare: false
         };
     },
     mixins: [banner],
     mounted() {
         this.getDetail();
+        if (this.$route.query.share === 'true' || this.$route.query.share === true) {
+            this.isShare = true;
+        }
     },
     computed: {
         shareText() {
-            return `『绿洲新闻』${resolveUrl(this.$baseUrl, '9th/newsDetail?id=' + this.info.id)}「${
+            return `『绿洲新闻』${resolveUrl(this.$baseUrl, '9th/newsDetail?id=' + this.info.id + '&share=true')}「${
                 this.info.title
             }」`;
         }
     },
     methods: {
+        download() {
+            window.location.href = 'https://www.raex.vip/static/download_raex.html';
+        },
         getDetail(str = '') {
             if (str) {
                 this.$toast.success(str);
@@ -169,4 +192,13 @@ export default {
         width: 50%;
     }
 }
+
+.app-icon {
+    width: 30px;
+    height: 30px;
+}
+
+/deep/.van-notice-bar__content {
+    padding-left: 16px;
+}
 </style>