Kaynağa Gözat

进入书架重新请求

gdy96 5 yıl önce
ebeveyn
işleme
8294bd0e6d
2 değiştirilmiş dosya ile 15 ekleme ve 4 silme
  1. 3 3
      src/views/Index/index.ux
  2. 12 1
      src/views/Shelf/index.ux

+ 3 - 3
src/views/Index/index.ux

@@ -11,7 +11,7 @@
         <tab-content>
           <home-page @change="pageSwitch"></home-page>
           <category-page></category-page>
-          <shelf-page @change="pageSwitch"></shelf-page>
+          <shelf-page @change="pageSwitch" tabindex='{{current}}'></shelf-page>
           <my-page @customer="openCustomer"></my-page>
         </tab-content>
       </tabs>
@@ -85,7 +85,7 @@ export default {
     showSignPop: false,
     showShortPop: false,
     cutomerQrcode: '',
-    cutomerName:''
+    cutomerName: ''
   },
   onInit() {
     this.$on('dispathEvt', this.changeSignPop);
@@ -131,7 +131,7 @@ export default {
   //复制客服微信
   duplication() {
     clipboard.set({
-      text: this.cutomerName, 
+      text: this.cutomerName,
       success: function (data) {
         prompt.showToast({
           message: '复制成功!'

+ 12 - 1
src/views/Shelf/index.ux

@@ -62,7 +62,12 @@
 import { getUserShelfBooks, deleteShelfBook } from "../../api";
 
 export default {
-  props: {},
+  props: {
+    tabindex: {
+      type: Number,
+      default: 0
+    },
+  },
   data() {
     return {
       current: 0,
@@ -84,6 +89,12 @@ export default {
   onInit() {
     this.getUserShelfBooks()
     this.$watch('isDelMode', 'listenMode')
+    this.$watch('tabindex', 'watchPropsChange')
+  },
+  watchPropsChange(newV, oldV) {
+    if (newV == 2) {
+      this.getUserShelfBooks()
+    }
   },
   getUserShelfBooks() {
     getUserShelfBooks().then(r => {