Commit c9610869 authored by jyx's avatar jyx

优化样式,不默认收藏

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