Commit 1ab1282c authored by jyx's avatar jyx

代码优化

parent 6401c10b
......@@ -6,10 +6,12 @@
99%读过这本书的人还在读
</view>
<view class="book-list-item" v-for='(item, index) in dataList' :key='index' :item='item' @click="tapItem(item)">
<view class="book-list-item" v-for='(item, index) in dataList' :key='index' :item='item'
@click="tapItem(item)">
<view class="cover-box item">
<image v-if="item.avatar===''" class="cover" src="/static/images/logo.png" mode="aspectFill"></image>
<image v-else class="cover" :src="item.avatar" mode="aspectFill" ></image>
<image v-if="item.avatar===''" class="cover" src="/static/images/logo.png" mode="aspectFill">
</image>
<image v-else class="cover" :src="item.avatar" mode="aspectFill"></image>
</view>
<view class="c-flex_column">
<view class="c-flex_row c-justify_between row">
......@@ -26,7 +28,8 @@
</view>
<view class="c-flex_row c-align_center label-box row">
<slot name="footer">
<view class="label label-color-1" v-if="item.categoryName!=null&&item.categoryName!=''">
<view class="label label-color-1"
v-if="item.categoryName!=null&&item.categoryName!=''">
{{item.categoryName}}
</view>
<view class="label label-color-2" v-for='(label, labelIndex) in item.tagList'
......@@ -39,7 +42,7 @@
</view>
</view>
<view style="display: flex;margin: auto;width: 200rpx;">
<button class="btn2" >去阅读</button>
<button class="btn2">去阅读</button>
</view>
</view>
</view>
......@@ -100,8 +103,7 @@
}
}
},
onUnload() {
},
onUnload() {},
mounted() {
this.requestPackData();
},
......@@ -117,7 +119,7 @@
this.showPop = false;
},
requestPackData() {
getBookRecommendData(this.bookId,(success, data) => {
getBookRecommendData(this.bookId, (success, data) => {
if (success) {
this.dataList = data.records;
}
......@@ -128,7 +130,9 @@
uni.navigateBack({
delta: 2
});
gotoBookContentPage(item.id);
setTimeout(() => {
gotoBookContentPage(item.id, item.shortis);
}, 1000)
}
}
}
......@@ -232,11 +236,13 @@
}
}
}
.book-list-item {
display: flex;
flex-direction: row;
padding-top: 14rpx;
padding-bottom: 14rpx;
.row {
margin-bottom: 20rpx;
}
......
......@@ -190,9 +190,7 @@
this.$set(this.bookData, "isUnlock", 1);
this.$set(this.bookData, "freeNum", this.bookData.articleChapterList.length);
this.$nextTick(() => {
this.$refs.content.reloadChapterinfoData()
})
},
// 文章数据刷新
refreshBookData(bookId) {
......
......@@ -14,7 +14,7 @@
<view class="html-content" :style="{'background-color':background}">
<view class="loading" v-if="size<1" :style="{'font-size':fontSize+'px'}"> 正在加载中... </view>
<swiper class="center" :current="step" :disable-programmatic-animation='true' :circular='false'
<swiper class="center" :current="step" :disable-programmatic-animation='true' :circular='true'
:indicator-dots="false" :autoplay="false" :interval="3000" :duration="500" @change="handleChange">
<swiper-item v-for="(item,index) in size" :key='index'>
<view class="article" v-if="catalogue<=detail.freeNum"
......@@ -414,7 +414,7 @@
left: 0;
bottom: 0;
box-sizing: border-box;
padding: 0 40rpx;
// padding: 0 40rpx;
.loading {
position: absolute;
......@@ -432,6 +432,7 @@
overflow-y: hidden;
.article {
margin: 0 40rpx;
box-sizing: border-box;
font-weight: 400;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", SimSun, sans-serif;
......
......@@ -128,7 +128,9 @@
uni.navigateBack({
delta: 2
});
setTimeout(() => {
gotoBookContentPage(item.id, item.shortis);
}, 1000)
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment