bug修复

This commit is contained in:
@fawn-nine
2023-11-20 17:31:10 +08:00
parent 79fb0c430f
commit 31b73967a3
4 changed files with 151 additions and 119 deletions

View File

@@ -6,8 +6,8 @@ if (process.env.NODE_ENV === 'development') {
// socketUrl = "ws://localhost:6001/"; // socketUrl = "ws://localhost:6001/";
// baseUrl = "https://twin-ui.com/demo/"; // baseUrl = "https://twin-ui.com/demo/";
// baseUrl = "http://59.110.212.44:9200/pb/"; // baseUrl = "http://59.110.212.44:9200/pb/";
baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境 // baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
// baseUrl = "https://api.nuttyreading.com/"; // 线上正式 baseUrl = "https://api.nuttyreading.com/"; // 线上正式
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑 // baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
// baseUrl = "http://192.168.110.110:9200/pb/"; // baseUrl = "http://192.168.110.110:9200/pb/";
// baseUrl = "http://192.168.110.38:9200/pb/"; // 吴春磊笔记本1 // baseUrl = "http://192.168.110.38:9200/pb/"; // 吴春磊笔记本1

View File

@@ -224,7 +224,7 @@
// 去讲书 // 去讲书
goJiangShu(){ goJiangShu(){
uni.navigateTo({ uni.navigateTo({
url: '../talkBook/talkBookDetail?bookId='+ this.bookId url: '../talkBook/talkBookML?bookid='+ this.bookId
}); });
}, },
// 去听书 // 去听书

View File

@@ -19,17 +19,17 @@
</view> --> </view> -->
<view class="mainContainer"> <view class="mainContainer">
<view class="item" v-if="bookList.length > 0"> <view class="item" v-if="bookList.length > 0">
<u-row gutter="16" justify="flex-start" > <u-row gutter="16" justify="flex-start">
<u-col span="4" v-for="(item,index) in bookList" :key="index"> <u-col span="4" v-for="(item,index) in bookList" :key="index">
<view> <view>
<view class="videoBox demo-layout bg-purple" @click="toDetail(item)"> <view class="videoBox demo-layout bg-purple" @click="toDetail(item)">
<image v-if="item.images != ''" :src="item.images" mode="scaleToFill"></image> <image v-if="item.images != ''" :src="item.images" mode="scaleToFill"></image>
<image v-else src="../../static/icon/wufeng.jpg" mode="scaleToFill"></image> <image v-else src="../../static/icon/wufeng.jpg" mode="scaleToFill"></image>
</view> </view>
<text class="bookName">{{item.name}}</text> <text class="bookName">{{item.name}}</text>
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
</view> </view>
<u-divider v-else text="暂无数据"></u-divider> <u-divider v-else text="暂无数据"></u-divider>
<view style="width: 100%;"> <view style="width: 100%;">
@@ -41,10 +41,10 @@
<u-divider text="全部加载完成"></u-divider> <u-divider text="全部加载完成"></u-divider>
</view> </view>
</view> </view>
</view> </view>
<!-- 公共组件-每个页面必须引入 --> <!-- 公共组件-每个页面必须引入 -->
<public-module></public-module> <public-module></public-module>
<music-play :playData="playData"></music-play> <music-play :playData="playData"></music-play>
</view> </view>
</template> </template>
@@ -52,42 +52,44 @@
<script> <script>
import $http from '@/config/requestConfig.js'; import $http from '@/config/requestConfig.js';
// import emotion from '@/bkhumor-emojiplus/components/bkhumor-emojiplus/bkhumor-emojiplus.vue'; // import emotion from '@/bkhumor-emojiplus/components/bkhumor-emojiplus/bkhumor-emojiplus.vue';
import musicPlay from '@/components/music.vue' import musicPlay from '@/components/music.vue'
import { data } from 'jquery'; import {
import { data
mapState } from 'jquery';
} from 'vuex'; import {
mapState
} from 'vuex';
export default { export default {
data() { data() {
return { return {
loadingNow : false, loadingNow: false,
playData:{}, playData: {},
windowWidth:0, windowWidth: 0,
bookid:null, bookid: null,
productInfo:{}, productInfo: {},
page:1, page: 1,
bookList:[], bookList: [],
pageSize:9, pageSize: 9,
total:0, total: 0,
totalPage:0, totalPage: 0,
status:3, status: 3,
shupingList:[], shupingList: [],
bfaid:null, bfaid: null,
contentShow: 1, contentShow: 1,
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
console.log('下拉刷新了') console.log('下拉刷新了')
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, },
onReachBottom() { onReachBottom() {
this.loadingNow = true this.loadingNow = true
// if(this.page < this.total){ // if(this.page < this.total){
// this.page++ // this.page++
// console.log('加载',this.page) // console.log('加载',this.page)
// this.status = 0 // this.status = 0
// this.getBookCom() // this.getBookCom()
// }else{ // }else{
// this.status = 1 // this.status = 1
// console.log('加载完成了',this.page) // console.log('加载完成了',this.page)
@@ -96,104 +98,112 @@ import { data } from 'jquery';
}, },
onLoad(e) { onLoad(e) {
this.windowWidth = uni.getSystemInfoSync().windowWidth; this.windowWidth = uni.getSystemInfoSync().windowWidth;
console.log(e,'onload') console.log(e, 'onload')
this.bookid = e.bookid this.bookid = e.bookid
// this.getProDetail(e) // this.getProDetail(e)
this.getBooks() this.getBooks()
}, },
computed:{ computed: {
...mapState(['userInfo']), ...mapState(['userInfo']),
}, },
methods: { methods: {
setData(e) { setData(e) {
this.contentShow = e this.contentShow = e
this.getBooks() this.getBooks()
}, },
getBooks(){ getBooks() {
if(this.contentShow == 1){ if (this.contentShow == 1) {
$http.request({ $http.request({
url: "book/teach/getUserTeachBooks", url: "book/teach/getUserTeachBooks",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档 method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: { data: {
id: this.userInfo.id, id: this.userInfo.id,
'limit': 100, 'limit': 100,
'page': this.page 'page': this.page
}, },
header: { //默认 无 说明:请求头 header: { //默认 无 说明:请求头
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
}) })
.then(res => { .then(res => {
console.log(res,'讲书列表') console.log(res, '讲书列表')
if(res.code == 0 && res.page.records.length > 0){ if (res.code == 0 && res.page.records.length > 0) {
this.bookList = res.page.records this.bookList = res.page.records
this.totalPage = res.page.pages this.totalPage = res.page.pages
this.status = 3 this.status = 3
console.log(this.bookList,'this.bookList') console.log(this.bookList, 'this.bookList')
}else{ } else {
this.bookList = [] this.bookList = []
this.totalPage = 0 this.totalPage = 0
} }
}).catch(e => { }).catch(e => {
console.log(e,'e') console.log(e, 'e')
}); });
}else{ } else {
$http.request({ $http.request({
url: "book/teach/getUserBestTeachBooks", url: "book/teach/getUserBestTeachBooks",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档 method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: { data: {
id: this.userInfo.id, id: this.userInfo.id,
'limit': 100, 'limit': 100,
'page': this.page 'page': this.page
}, },
header: { //默认 无 说明:请求头 header: { //默认 无 说明:请求头
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
}) })
// this.$http // this.$http
// .post('book/teach/getUserBestTeachBooks',{ // .post('book/teach/getUserBestTeachBooks',{
// id: this.userInfo.id, // id: this.userInfo.id,
// 'limit': 100, // 'limit': 100,
// 'page': this.page // 'page': this.page
// }) // })
.then(res => { .then(res => {
console.log(res,'讲书列表') console.log(res, '讲书列表')
if(res.code == 0 && res.page.records.length > 0){ if (res.code == 0 && res.page.records.length > 0) {
this.bookList = res.page.records this.bookList = res.page.records
this.totalPage = res.page.pages this.totalPage = res.page.pages
this.status = 3 this.status = 3
console.log(this.bookList,'this.bookList') console.log(this.bookList, 'this.bookList')
}else{ } else {
this.bookList = [] this.bookList = []
this.totalPage = 0 this.totalPage = 0
} }
}).catch(e => { }).catch(e => {
console.log(e,'e') console.log(e, 'e')
}); });
} }
}, },
// 书评详情 // 书评详情
toDetail(val){ toDetail(val) {
console.log(val,'val') // console.log(val,'val')
uni.navigateTo({ if (this.contentShow == 1) {
url:'./talkBookML?bookid='+val.id uni.navigateTo({
}) url: './talkBookML?bookid=' + val.id
})
}
if (this.contentShow == 2) {
uni.navigateTo({
url: '../eBook/bookContent?Id=' + val.id
});
}
}, },
}, },
components:{ components: {
musicPlay musicPlay
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.mytabs { .mytabs {
// background: url('@/static/icon/bgtushu.png') no-repeat left top; // background: url('@/static/icon/bgtushu.png') no-repeat left top;
height: 80rpx; height: 80rpx;
@@ -219,35 +229,55 @@ import { data } from 'jquery';
margin-right: 20rpx; margin-right: 20rpx;
} }
} }
.tip{
padding: 20rpx; background-color: #fff; .tip {
text{ font-size: 36rpx;} padding: 20rpx;
background-color: #fff;
text {
font-size: 36rpx;
}
} }
.flexbox{display: flex;}
.container{padding: 10px;} .flexbox {
.bookName { display: flex;
white-space: nowrap; }
.container {
padding: 10px;
}
.bookName {
white-space: nowrap;
overflow-x: hidden; overflow-x: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
font-size: 30rpx; font-size: 30rpx;
color: #333; color: #333;
padding: 10rpx 0; padding: 10rpx 0;
} }
uni-image { uni-image {
width: auto !important; width: auto !important;
height: 350rpx; height: 350rpx;
} }
.listenList { .listenList {
padding: 10rpx; padding: 10rpx;
box-sizing: border-box; box-sizing: border-box;
width: calc(100% - 10rpx); width: calc(100% - 10rpx);
} }
.u-row { .u-row {
flex-wrap: wrap; flex-wrap: wrap;
} }
.u-col { .u-col {
overflow: hidden; overflow: hidden;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.mb30{margin-bottom: 30rpx; overflow: hidden;}
</style> .mb30 {
margin-bottom: 30rpx;
overflow: hidden;
}
</style>

View File

@@ -209,7 +209,7 @@
this.$http this.$http
.post('book/teach/getBookTeachItems', { .post('book/teach/getBookTeachItems', {
'bookId': this.bookid, 'bookId': this.bookid,
'limit': 10, 'limit': 20,
'page': this.page 'page': this.page
// 'userid': this.userInfo.id, // 'userid': this.userInfo.id,
// 'bookid': // 'bookid':
@@ -222,7 +222,9 @@
this.libLIst = this.libLIst.concat(res.page.records) this.libLIst = this.libLIst.concat(res.page.records)
this.status = 3 this.status = 3
this.totalPage = res.page.pages this.totalPage = res.page.pages
if(this.totalPage = res.page.current){
this.status = 1
}
} else { } else {
this.libLIst = [] this.libLIst = []
this.totalPage = 0 this.totalPage = 0