Pārlūkot izejas kodu

Merge branch 'feature/v1.2.7_z' of jianyu/jy-docs into feature/v1.2.7

zhangyuhan 2 gadi atpakaļ
vecāks
revīzija
2c5fcc6930

+ 15 - 5
jydocs-mobile/src/views/details/details.vue

@@ -25,15 +25,17 @@
                   :key="i"  :src="pdfPage.url" :page="i"></pdf>
         </div>
         <van-goods-action>
-            <van-goods-action-icon class="no-icon">
-                <template #default>
-                    <p class="p1">剑鱼币</p>
-                    <p class="p2">{{detailData.price}}</p>
-                </template>
+          <div class="goods-action">
+            <van-goods-action-icon class="no-icon" v-if="needBuy">
+              <template #default>
+                <p class="p1">剑鱼币</p>
+                <p class="p2">{{detailData.price}}</p>
+              </template>
             </van-goods-action-icon>
             <van-goods-action-icon icon="diy-jubao" text="投诉" @click="jubaod" />
             <van-goods-action-icon :icon="collectd==1?'diy-guanzhu':'diy-weiguanzhu'" :text="collectd==1?'已收藏':'收藏'" @click="canged" v-if="!flag" />
             <van-goods-action-icon :icon="collectd==1?'diy-guanzhu':'diy-weiguanzhu'" :text="collectd==1?'已收藏':'收藏'" v-else />
+          </div>
             <van-goods-action-button text="下载文档" @click="uploaded" />
         </van-goods-action>
         <!-- 充值 -->
@@ -141,6 +143,10 @@ export default class extends Vue {
     }
   }
 
+  get needBuy () {
+    return this.buyed === 0
+  }
+
   getMorePage () {
     if (this.showPageNum < this.pdfPage.pageNum) {
       if (this.showPageNum + 2 <= this.pdfPage.pageNum) {
@@ -315,6 +321,10 @@ export default class extends Vue {
     height: 100%;
     padding-bottom: 80px;
     box-sizing: border-box;
+  .goods-action {
+    display: flex;
+    align-items: center;
+  }
   .top-title-group {
     padding: 24px 16px;
     box-sizing: border-box;

+ 28 - 2
jydocs-mobile/src/views/user/Library.vue

@@ -30,6 +30,14 @@
           </div>
         </van-list>
         <Empty v-if="myLibListState.list.length === 0 && myLibListState.loaded">暂无我的文库</Empty>
+        <van-notice-bar
+          class="doc-tip--bottom"
+          v-if="showTip"
+          wrapable
+          :scrollable="false"
+          text="温馨提示:您可通过“剑鱼标讯”微信公众号,点击【发现-百宝箱-服务】查看“我的文库”"
+          mode="closeable"
+        />
       </van-tab>
 
       <van-tab title="文库收藏" name="1">
@@ -61,7 +69,7 @@
 </template>
 <script lang="ts">
 import { Component, Vue, Watch } from 'vue-property-decorator'
-import { Tabs, Tab, List } from 'vant'
+import { Tabs, Tab, List, NoticeBar } from 'vant'
 import { mapState, mapMutations, mapActions } from 'vuex'
 import Card from '@/components/docs-card/Card.vue'
 import Empty from '@/components/common/Empty.vue'
@@ -73,13 +81,17 @@ import { dateFormatter, formatSize } from '@/utils/globalFunctions'
     [Tabs.name]: Tabs,
     [Tab.name]: Tab,
     [List.name]: List,
+    [NoticeBar.name]: NoticeBar,
     Card,
     Empty
   },
   computed: {
     ...mapState('main', {
       userLibInfo: (state: any) => state.userLib
-    })
+    }),
+    showTip () {
+      return this.$route.query.tip
+    }
   },
   methods: {
     ...mapMutations({
@@ -258,6 +270,20 @@ export default class UserLibrary extends Vue {
 
 <style lang="scss" scoped>
 .user-library {
+  .doc-tip--bottom {
+    position: fixed;
+    bottom: 0;
+    color: #FF9F40;
+    font-size: 13px;
+    font-weight: 500;
+    line-height: 20px;
+    ::v-deep {
+      .van-icon {
+        color: #FF9F40;
+        font-weight: bold;
+      }
+    }
+  }
   ::v-deep {
     .van-tabs__wrap {
       height: 48px;