diff --git a/pages/clock/index.vue b/pages/clock/index.vue index d67a8cf..ebcba92 100644 --- a/pages/clock/index.vue +++ b/pages/clock/index.vue @@ -11,9 +11,9 @@ - + diff --git a/pages/talkBook/talkBook.vue b/pages/talkBook/talkBook.vue index 15ae042..b845ced 100644 --- a/pages/talkBook/talkBook.vue +++ b/pages/talkBook/talkBook.vue @@ -4,9 +4,19 @@ - - 请选择要查看的书籍: + + + + 已购图书 + + + 推荐图书 + + + @@ -62,6 +72,7 @@ import { data } from 'jquery'; status:3, shupingList:[], bfaid:null, + contentShow: 1, } }, onPullDownRefresh() { @@ -93,11 +104,24 @@ import { data } from 'jquery'; ...mapState(['userInfo']), }, methods: { + setData(e) { + this.contentShow = e + this.getBooks() + }, getBooks(){ - this.$http - .post('book/teach/getTeachBooks',{ - 'limit': 100, - 'page': this.page + if(this.contentShow == 1){ + + $http.request({ + url: "book/teach/getUserTeachBooks", + method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 + data: { + id: this.userInfo.id, + 'limit': 100, + 'page': this.page + }, + header: { //默认 无 说明:请求头 + 'Content-Type': 'application/json' + }, }) .then(res => { console.log(res,'讲书列表') @@ -114,6 +138,42 @@ import { data } from 'jquery'; }).catch(e => { console.log(e,'e') }); + }else{ + $http.request({ + url: "book/teach/getUserBestTeachBooks", + method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 + data: { + id: this.userInfo.id, + 'limit': 100, + 'page': this.page + }, + header: { //默认 无 说明:请求头 + 'Content-Type': 'application/json' + }, + }) + // this.$http + // .post('book/teach/getUserBestTeachBooks',{ + // id: this.userInfo.id, + // 'limit': 100, + // 'page': this.page + // }) + .then(res => { + console.log(res,'讲书列表') + if(res.code == 0 && res.page.records.length > 0){ + this.bookList = res.page.records + this.totalPage = res.page.pages + this.status = 3 + console.log(this.bookList,'this.bookList') + }else{ + this.bookList = [] + this.totalPage = 0 + } + + }).catch(e => { + console.log(e,'e') + }); + } + }, // 书评详情 toDetail(val){ @@ -133,6 +193,31 @@ import { data } from 'jquery';