Commit 6d1c5ce3 authored by jyx's avatar jyx

代码优化

parent 6643da5e
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
bottomSafePadding: 12, bottomSafePadding: 12,
h5Url: 'https://api.mints-id.com/index.html', h5Url: 'https://api.mints-id.com/index.html',
baseUrl: 'https://dx.mints-tech.cn/minip-api/miniApi', baseUrl: 'https://dx.mints-tech.cn/minip-api/miniApi',
// baseUrl: 'http://192.168.110.42:8303/miniApi', // baseUrl: 'http://192.168.110.141:8303/miniApi',
titleButtonWidth: 38, titleButtonWidth: 38,
token: '', token: '',
userId: 0, userId: 0,
......
<template> <template>
<view> <view>
<c-list ref='list' :showShelfEmpty="true" flag='bookshelf' :needLogin="true" :height="height" url='/book/collectList/' <c-list ref='list' :showShelfEmpty="true" flag='bookshelf' :needLogin="true" :height="height" url='/book/collectList'
:param="requestParam" @change='changeData' method="POST"> :param="requestParam" @change='changeData' method="POST">
<book-list-item v-for='(item, index) in dataList' :key='index' :item='item' <book-list-item v-for='(item, index) in dataList' :key='index' :item='item'
@tapItem='tapItem($event, index)' @close='tapClose($event, index)'> @tapItem='tapItem($event, index)' @close='tapClose($event, index)'>
<!-- <template v-slot:footer> <template v-slot:footer>
<view class="c-flex_row c-aligns_center"> <view class="c-flex_row c-aligns_center">
<uni-icons type='calendar' size="16" color="#999"></uni-icons> <uni-icons type='calendar' size="16" color="#999"></uni-icons>
<view class="info"> <view class="info">
{{item.lastReadTimeDesc}} 前阅读过 {{item.lastReadTime}} 前阅读过
</view> </view>
</view> </view>
</template> --> </template>
</book-list-item> </book-list-item>
</c-list> </c-list>
</view> </view>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
}, },
changeData(e) { changeData(e) {
console.log(e) console.log(e)
this.dataList = e.detail.data.list.map(item => { this.dataList = e.detail.data.map(item => {
return new BookshelfBookItem(item) return new BookshelfBookItem(item)
}) })
}, },
......
...@@ -126,17 +126,7 @@ ...@@ -126,17 +126,7 @@
}, },
computed: { computed: {
showEmpty: function() { showEmpty: function() {
console.log(this.dataList) return isEmpty(this.dataList)
if (isEmpty(this.dataList)) {
return true
} else {
if (typeof this.dataList == 'object') {
if (this.dataList.list != undefined) {
return isEmpty(this.dataList.list)
}
}
}
return false
}, },
scrollStyle: function() { scrollStyle: function() {
return { return {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
@change="changeSwiper"> @change="changeSwiper">
<swiper-item v-for='(item, index) in categorys' :key='index'> <swiper-item v-for='(item, index) in categorys' :key='index'>
<WarehouseList :ref="`bookList${index}`" :category='item' :height='listHeight'></WarehouseList> <WarehouseList :ref="`bookList${index}`" :category='item' :height='listHeight'></WarehouseList>
<!-- <WarehouseList ref="bookList" :category='item' :height='listHeight'></WarehouseList> -->
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
...@@ -75,13 +76,16 @@ ...@@ -75,13 +76,16 @@
watch: { watch: {
categroyChange: { categroyChange: {
handler: function(n, o) { handler: function(n, o) {
this.$nextTick(() => { setTimeout(() => {
this.$refs[`bookList${n.currentIndex}`][0].initRefresh(); this.$refs[`bookList${n.currentIndex}`][0].initRefresh();
}, 500)
// this.$nextTick(() => {
// // this.$refs[`bookList${n.currentIndex}`][0].initRefresh();
// let ref = this.$refs.bookList; // let ref = this.$refs.bookList;
// if (ref) { // if (ref) {
// ref[n.currentIndex].initRefresh(); // ref[n.currentIndex].initRefresh();
// } // }
}) // })
}, },
deep: true deep: true
} }
......
...@@ -9,7 +9,7 @@ const { ...@@ -9,7 +9,7 @@ const {
} }
} = require("../configEnum"); } = require("../configEnum");
export default { export default {
// BASE_URL: "http://192.168.110.42:8303/miniApi", // BASE_URL: "http://192.168.110.141:8303/miniApi",
BASE_URL: "https://dx.mints-tech.cn/minip-api/miniApi", BASE_URL: "https://dx.mints-tech.cn/minip-api/miniApi",
BASE_URL_MODULE: "", BASE_URL_MODULE: "",
BASE_SOCKET_URL: "", BASE_SOCKET_URL: "",
......
...@@ -9,7 +9,7 @@ const { ...@@ -9,7 +9,7 @@ const {
} }
} = require("../configEnum"); } = require("../configEnum");
export default { export default {
// BASE_URL: "http://192.168.110.42:8303/miniApi", // BASE_URL: "http://192.168.110.141:8303/miniApi",
BASE_URL: "https://dx.mints-tech.cn/minip-api/miniApi", BASE_URL: "https://dx.mints-tech.cn/minip-api/miniApi",
BASE_URL_MODULE: "", BASE_URL_MODULE: "",
BASE_SOCKET_URL: "", BASE_SOCKET_URL: "",
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<detail-warn></detail-warn> <detail-warn></detail-warn>
<detail-thumb :detail='bookData' @tapThumb='tapThumb'></detail-thumb> <detail-thumb :detail='bookData' @tapThumb='tapThumb'></detail-thumb>
<detail-content @tapVip='tapPayPop' :detail='bookData' :userInfo='userInfo'></detail-content> <detail-content @tapVip='tapPayPop' :detail='bookData' :userInfo='userInfo'></detail-content>
<detail-new-buy v-if="bookData.isUnlock==0 && !isVip()" :showVipOpen="showVipOpen" <detail-new-buy v-if="bookData.isUnlock==0 && !isVip()" :showVipOpen="1"
:showBeanOpen="showBeanOpen" :detail='bookData' :userInfo='userInfo' @unlockBook='unlockBook' :showBeanOpen="0" :detail='bookData' :userInfo='userInfo' @unlockBook='unlockBook'
@tapVip='tapVipPop' @tapBean='tapBeanPop'></detail-new-buy> @tapVip='tapVipPop' @tapBean='tapBeanPop'></detail-new-buy>
<detail-bottom :detail='bookData' :userInfo='userInfo' @tapBottomItem='tapBottomItem'></detail-bottom> <detail-bottom :detail='bookData' :userInfo='userInfo' @tapBottomItem='tapBottomItem'></detail-bottom>
<setting-pop :show='showSetting' @close='closePop'></setting-pop> <setting-pop :show='showSetting' @close='closePop'></setting-pop>
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
} }
}, },
changeData(e) { changeData(e) {
this.dataList = e.detail.data.list.map(item => { this.dataList = e.detail.data.map(item => {
return new WarehouseBookItem(item) return new WarehouseBookItem(item)
}) })
}, },
......
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