Commit 6d1c5ce3 authored by jyx's avatar jyx

代码优化

parent 6643da5e
......@@ -89,7 +89,7 @@
bottomSafePadding: 12,
h5Url: 'https://api.mints-id.com/index.html',
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,
token: '',
userId: 0,
......
......@@ -56,7 +56,7 @@
removeCollectionChangeWatch(this);
},
methods: {
show() {
show() {
this.$refs.timeCount.refresh()
this.initHeight();
......
<template>
<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">
<book-list-item v-for='(item, index) in dataList' :key='index' :item='item'
@tapItem='tapItem($event, index)' @close='tapClose($event, index)'>
<!-- <template v-slot:footer>
<template v-slot:footer>
<view class="c-flex_row c-aligns_center">
<uni-icons type='calendar' size="16" color="#999"></uni-icons>
<view class="info">
{{item.lastReadTimeDesc}} 前阅读过
{{item.lastReadTime}} 前阅读过
</view>
</view>
</template> -->
</template>
</book-list-item>
</c-list>
</view>
......@@ -59,8 +59,8 @@
}
},
changeData(e) {
console.log(e)
this.dataList = e.detail.data.list.map(item => {
console.log(e)
this.dataList = e.detail.data.map(item => {
return new BookshelfBookItem(item)
})
},
......
......@@ -126,17 +126,7 @@
},
computed: {
showEmpty: function() {
console.log(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
return isEmpty(this.dataList)
},
scrollStyle: function() {
return {
......
......@@ -12,6 +12,7 @@
@change="changeSwiper">
<swiper-item v-for='(item, index) in categorys' :key='index'>
<WarehouseList :ref="`bookList${index}`" :category='item' :height='listHeight'></WarehouseList>
<!-- <WarehouseList ref="bookList" :category='item' :height='listHeight'></WarehouseList> -->
</swiper-item>
</swiper>
</view>
......@@ -50,7 +51,7 @@
};
},
onLoad(options) {
},
computed: {
showEmpty: function() {
......@@ -75,13 +76,16 @@
watch: {
categroyChange: {
handler: function(n, o) {
this.$nextTick(() => {
setTimeout(() => {
this.$refs[`bookList${n.currentIndex}`][0].initRefresh();
// let ref = this.$refs.bookList;
// if (ref) {
// ref[n.currentIndex].initRefresh();
// }
})
}, 500)
// this.$nextTick(() => {
// // this.$refs[`bookList${n.currentIndex}`][0].initRefresh();
// let ref = this.$refs.bookList;
// if (ref) {
// ref[n.currentIndex].initRefresh();
// }
// })
},
deep: true
}
......
......@@ -9,7 +9,7 @@ const {
}
} = require("../configEnum");
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_MODULE: "",
BASE_SOCKET_URL: "",
......
......@@ -9,7 +9,7 @@ const {
}
} = require("../configEnum");
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_MODULE: "",
BASE_SOCKET_URL: "",
......
......@@ -5,8 +5,8 @@
<detail-warn></detail-warn>
<detail-thumb :detail='bookData' @tapThumb='tapThumb'></detail-thumb>
<detail-content @tapVip='tapPayPop' :detail='bookData' :userInfo='userInfo'></detail-content>
<detail-new-buy v-if="bookData.isUnlock==0 && !isVip()" :showVipOpen="showVipOpen"
:showBeanOpen="showBeanOpen" :detail='bookData' :userInfo='userInfo' @unlockBook='unlockBook'
<detail-new-buy v-if="bookData.isUnlock==0 && !isVip()" :showVipOpen="1"
:showBeanOpen="0" :detail='bookData' :userInfo='userInfo' @unlockBook='unlockBook'
@tapVip='tapVipPop' @tapBean='tapBeanPop'></detail-new-buy>
<detail-bottom :detail='bookData' :userInfo='userInfo' @tapBottomItem='tapBottomItem'></detail-bottom>
<setting-pop :show='showSetting' @close='closePop'></setting-pop>
......
......@@ -74,7 +74,7 @@
}
},
changeData(e) {
this.dataList = e.detail.data.list.map(item => {
this.dataList = e.detail.data.map(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