Commit c9610869 authored by jyx's avatar jyx

优化样式,不默认收藏

parent 2e673af8
......@@ -36,7 +36,7 @@
this.globalData.bottomSafePadding = Math.max(res.screenHeight - res.safeArea.bottom, 12);
// #endif
try {
let value = uni.getStorageSync('token') || '';
let value = uni.getStorageSync("TOKEN") || '';
let inviteUId = uni.getStorageSync('inviteUId') || '';
if (!inviteUId && options.query.inviteUId) {
......
......@@ -247,9 +247,8 @@ function saveToken(token) {
function readToken() {
if (!LOCAL_TOKEN) {
// LOCAL_TOKEN = readStorage(KEY_STORAGE_TOKEN)
LOCAL_TOKEN = readStorage('token')
}
LOCAL_TOKEN = readStorage(KEY_STORAGE_TOKEN)
}
return LOCAL_TOKEN;
}
......
......@@ -8,7 +8,13 @@
</scroll-view>
</template>
<script>
<script>
import {
gotoBookContentPage
} from '../../common/services/page-route'
import {
getFirstShow
} from "./services/index.js"
import RecommendList from "../recommend-list/recommend-list.vue";
import Banner from "../banner/banner.vue";
import SystemInfoMixin from "../../common/mixins/system-info-mixin.js"
......@@ -34,10 +40,22 @@
},
methods: {
show() {
this.getFirstShowData();
},
hide() {
},
getFirstShowData() {
getFirstShow((success, data) => {
if (success) {
setTimeout(() => {
// 匹配用户直接跳转小说
if (data.articleMsg != null) {
gotoBookContentPage(data.articleMsg.id, data.articleMsg.shortis);
}
}, 800);
}
})
},
initData() {
this.refreshList();
......
......@@ -3,6 +3,13 @@ import {
apiPOST
} from "../../../common/utils/apiRequest.js"
module.exports = {
function getFirstShow(callback) {
apiPOST({
url: "/book/firstArticle",
callback
})
}
module.exports = {
getFirstShow
}
\ No newline at end of file
......@@ -29,7 +29,7 @@
this.initData();
// 监听收藏变动
watchCollectionChange(() => {
this.refreshList();
this.refreshCollect();
}, this);
},
onShow() {
......@@ -55,19 +55,21 @@
},
initData() {
this.refreshList();
this.refreshCollect();
this.refreshBook();
},
// 刷新数据列表
refreshList() {
let ref2 = this.$refs.recommendList;
if (ref2) {
ref2.refreshList();
}
refreshCollect() {
let ref = this.$refs.bookList;
if (ref) {
ref.refreshList();
}
},
refreshBook() {
let ref = this.$refs.recommendList;
if (ref) {
ref.refreshList();
}
},
initHeight() {
const query = uni.createSelectorQuery().in(this);
query.exec((res) => {
......
......@@ -126,13 +126,12 @@
deleteCollect() {
let str = ''
for (let i = 0; i < this.dataList.length; i++) {
if (this.dataList[i].isChecked) {
if (this.dataList[i].isChecked) {
if (this.dataList[i].id) {
str += (this.dataList[i].id + ',')
}
}
}
console.log('AAAA' + str)
collectionBook(false, str, (success, data) => {
if (success) {
......
import {
apiGET,
apiPOST
} from "../../../common/utils/apiRequest.js"
function getCategorys(callback) {
apiPOST({
url: "/book/categoryList/",
callback
})
}
function getFirstShow(callback) {
apiPOST({
url: "/book/firstArticle",
callback
})
}
module.exports = {
getCategorys,
getFirstShow
import {
apiGET,
apiPOST
} from "../../../common/utils/apiRequest.js"
function getCategorys(callback) {
apiPOST({
url: "/book/categoryList/",
callback
})
}
module.exports = {
getCategorys
}
\ No newline at end of file
......@@ -26,8 +26,7 @@
gotoBookContentPage
} from '../../common/services/page-route'
import {
getCategorys,
getFirstShow
getCategorys
} from "./services/index.js"
import {
isEmpty
......@@ -48,8 +47,9 @@
currentIndex: 0,
};
},
onLoad(options) {
onLoad(options) {},
onReady() {
this.getCategoryData()
},
computed: {
showEmpty: function() {
......@@ -83,16 +83,14 @@
},
methods: {
show() {
this.getFirstShowData();
this.getCategoryData();
if (wx.setVisualEffectOnCapture) {
wx.setVisualEffectOnCapture({
visualEffect: 'hidden',
success: (res) => {
// if (wx.setVisualEffectOnCapture) {
// wx.setVisualEffectOnCapture({
// visualEffect: 'hidden',
// success: (res) => {
},
})
}
// },
// })
// }
},
hide() {
......@@ -102,19 +100,6 @@
this.initHeight()
}, 300)
},
getFirstShowData() {
getFirstShow((success, data) => {
if (success) {
setTimeout(() => {
// 匹配用户直接跳转小说
if (data.articleMsg != null) {
gotoBookContentPage(data.articleMsg.id, data.articleMsg.shortis);
}
}, 800);
}
})
},
getCategoryData() {
getCategorys((success, data) => {
if (success) {
......
......@@ -79,8 +79,8 @@ export default {
// console.log(redirect)
// navigateTo('user/login?redirect=' + encodeURIComponent(redirect));
},
logout() {
uni.removeStorageSync('token');
logout() {
// uni.removeStorageSync("TOKEN");
},
post(options) {
options = Object.assign({
......
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