Commit 6383f35a authored by jyx's avatar jyx

代码优化

parent 7325af29
......@@ -29,7 +29,8 @@ export default class Book {
lockRate,
shortis,
articleChapterList,
freeNum
freeNum,
carouselUrl
} = param || {}
this.id = id;
this.title = title;
......@@ -61,6 +62,7 @@ export default class Book {
this.lockRate = lockRate;
this.shortis = shortis;
this.freeNum = freeNum;
this.carouselUrl = carouselUrl;
this.articleChapterList = articleChapterList;
}
}
\ No newline at end of file
......@@ -246,12 +246,11 @@ function saveToken(token) {
}
function readToken() {
return '4C1A1C6113922B148949CB847D5C3E72D9E08F167DCDAD86D60D8B0C65261F615F433703067DF5142735505C42F58997'
// if (!LOCAL_TOKEN) {
// // LOCAL_TOKEN = readStorage(KEY_STORAGE_TOKEN)
// LOCAL_TOKEN = readStorage('token')
// }
// return LOCAL_TOKEN;
if (!LOCAL_TOKEN) {
// LOCAL_TOKEN = readStorage(KEY_STORAGE_TOKEN)
LOCAL_TOKEN = readStorage('token')
}
return LOCAL_TOKEN;
}
const KEY_STORAGE_NICKNAME = "NICKNAME"
......
......@@ -58,14 +58,14 @@
},
// 刷新数据列表
refreshList() {
getRecommendV1('carousel', 8, (success, data) => {
getRecommendV1('carousel', 10, (success, data) => {
if (success) {
this.changeData(data)
}
})
},
changeData(e) {
this.dataList = e.records.map(item => {
this.bannerList = e.records.map(item => {
return new BookshelfBookItem(item)
})
},
......@@ -76,10 +76,10 @@
<style lang="scss">
.banneritem {
margin: 20rpx 20rpx 0 20rpx;
height: 260rpx;
height: 310rpx;
.banner-img {
height: 260rpx;
height: 310rpx;
}
}
</style>
\ No newline at end of file
......@@ -8,7 +8,7 @@
<view class="c-flex_row row" style="justify-content: space-between;padding-left:20rpx;">
<view class="c-flex_column c-justify_center item">
<view class="title">
{{item.title}}
{{item.title?item.title:''}}
</view>
</view>
<view class="close-button item" v-if='showClose'>
......@@ -19,7 +19,7 @@
<view class="c-flex_row row">
<view class="c-flex_column c-justify_between content c-flex_1 item">
<view class="desc row">
{{item.summary}}
{{item.summary?item.summary:''}}
</view>
<view class="c-flex_row c-align_center label-box row">
<slot name="footer">
......@@ -60,7 +60,11 @@
watch: {},
computed: {
showCategory: function() {
return this.item.categoryName
if (this.item && this.item.categoryName) {
return true
} else {
return false
}
},
showErrorImage: function() {
return this.imageError;
......
......@@ -93,13 +93,18 @@
}
.label-box {
flex-wrap: wrap;
display: flex;
flex-direction: row;
// flex-wrap: wrap;
overflow: auto;
.label {
padding: 5rpx 10rpx;
font-size: 20rpx;
margin-right: 20rpx;
border-radius: 10rpx;
flex-shrink: 0;
display:inline-block;
}
.label-color-1 {
......
<template>
<scroll-view scroll-y style="height: 100%;">
<book-search-box id='search'></book-search-box>
<Banner></Banner>
<Banner ref='banner' ></Banner>
<RecommendList ref='recommendList1' :listType="1"></RecommendList>
<RecommendList ref='recommendList2' :listType="2"></RecommendList>
<view style="height: 20rpx;"></view>
......@@ -64,6 +64,10 @@
if (ref2) {
ref2.refreshList();
}
let banner = this.$refs.banner;
if (banner) {
banner.refreshList();
}
let ref = this.$refs.recommendList2;
if (ref) {
ref.refreshList();
......
......@@ -79,6 +79,7 @@
font-size: 30rpx;
color: #000000;
margin-right: 15rpx;
letter-spacing: 6rpx;
}
.value {
......@@ -97,7 +98,7 @@
.count-value {
position: absolute;
top: 50%;
top: 46%;
left: 50%;
transform: translate(-50%, -50%);
color: #000000;
......
<template>
<scroll-view class="bar-box" scroll-x id='box' :scroll-into-view="scrollId">
<view v-if='showEmpty' class="tab-item">
<!-- <view v-if='showEmpty' class="tab-item">
<view class="title">
暂无分类数据
</view>
</view>
<view v-else :id="'item_'+index" class="tab-item" :class="{'tab-item-selected': item.selected}"
</view> -->
<view :id="'item_'+index" class="tab-item" :class="{'tab-item-selected': item.selected}"
v-for="(item, index) in tabs" :key='item.name' @click="tapTab(index)">
<view class="title">
{{item.name}}
......
<template>
<view class="body">
<image style="width: 170rpx;height: 170rpx;margin-top: 30%;" src="@/static/image/logo.png" mode="widthFix" />
<image style="width: 170rpx;height: 170rpx;margin-top: 30%;" src="../static/images/logo.png" mode="widthFix" />
<view style="color: black;margin-top: 30rpx;font-size: 40rpx;font-size: 50rpx;">{{appName}}</view>
<view style="color: #FECF02;margin-top: 10rpx;font-size: 40rpx;font-size: 40rpx;">欢迎使用</view>
<view style="bottom: 0;position: absolute;">
......
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