shish пре 3 година
родитељ
комит
6b7d4411c0
2 измењених фајлова са 19 додато и 26 уклоњено
  1. 12 19
      ghsApp/src/admin/book/detail.vue
  2. 7 7
      ghsApp/src/admin/book/index.vue

+ 12 - 19
ghsApp/src/admin/book/detail.vue

@@ -29,7 +29,7 @@
 
 		</view>
 		<view style="text-align:center;margin-top:30upx;">
-			<button class="admin-button-com big blue go-back" @click="goBack()">返回</button>
+			<button class="admin-button-com big blue go-back" @click="goBack()">返回列表</button>
 		</view>
 	</view>
 </template>
@@ -48,11 +48,17 @@ export default {
 		};
 	},
 	onLoad() {
-
-	},
-	computed:{
-	},
-	onShow() {
+		let that = this
+		getBookDetail({id:this.option.id}).then(res => {
+			that.bookList = res.data.list
+			that.bookList.forEach((item) => {
+		    if(item.style == 'title'){
+					this.pageTitle = item.value
+					uni.setNavigationBarTitle({title: item.value})
+		    }
+		  })
+			
+		});
 	},
   	onShareAppMessage(res) {
 		return {
@@ -77,19 +83,6 @@ export default {
 		playVide(){
 			this.videoContext = uni.createVideoContext('myVideo',this)
 			this.videoContext.play()
-		},
-		init(){
-			let that = this
-            getBookDetail({id:this.option.id}).then(res => {
-                that.bookList = res.data.list
-                that.bookList.forEach((item) => {
-                if(item.style == 'title'){
-						this.pageTitle = item.value
-                    	uni.setNavigationBarTitle({title: item.value})
-                }
-              })
-				
-            });
 		}
 	},
 };

+ 7 - 7
ghsApp/src/admin/book/index.vue

@@ -34,6 +34,12 @@ export default {
 			path: "admin/book/index",
 		}
 	},
+    onLoad(){
+        let that = this
+        getBookList().then(res => {
+            that.book = res.data.list
+        })
+    },
 	methods: {
         goDetail(item){
             // #ifdef MP-WEIXIN
@@ -42,13 +48,7 @@ export default {
 			// #ifdef APP-PLUS
             this.$util.pageTo({url: '/admin/book/detail',query:{id:item.id}})
             // #endif
-        },
-		init() {
-            let that = this
-            getBookList().then(res => {
-                that.book = res.data.list
-            });
-		}
+        }
 	}
 };
 </script>