|
@@ -16,23 +16,31 @@
|
|
|
import templateBookH3 from '../bookstore/template/template-book-H-3.vue'
|
|
|
import templateBookV3 from '../bookstore/template/template-book-V-3.vue'
|
|
|
import templateBookList from '../bookstore/template/template-book-List.vue'
|
|
|
+ import { bookstore_template_data, book_item_data } from '../../data/data';
|
|
|
import { ref } from 'vue';
|
|
|
- import { bookstore_template_data, book_item_data } from '../../data/data';
|
|
|
import { tools } from '../../framework/tools';
|
|
|
import { http } from '../../framework/http';
|
|
|
import { config } from '../../config/config';
|
|
|
import { log } from '../../framework/log';
|
|
|
import { util } from '../../framework/util'
|
|
|
+ import { onPullDownRefresh } from '@dcloudio/uni-app'
|
|
|
|
|
|
let data_list = ref<Array<bookstore_template_data>>([])
|
|
|
let H3_data_list = ref<Array<Array<book_item_data>>>([])
|
|
|
|
|
|
- requestData()
|
|
|
+ onPullDownRefresh(()=>{
|
|
|
+ setTimeout(()=>{
|
|
|
+ requestData(true)
|
|
|
+ },500)
|
|
|
+ })
|
|
|
|
|
|
- function requestData() {
|
|
|
+ requestData()
|
|
|
+
|
|
|
+ function requestData(isPullDown:boolean=false) {
|
|
|
util.showLoading()
|
|
|
http.StaticRequest(config.url_confg.Static.book_store,(err,data)=>{
|
|
|
util.hideLoading()
|
|
|
+ if(isPullDown){ uni.stopPullDownRefresh() }
|
|
|
if(!err) {
|
|
|
if(data.code==config.url_confg.StatesCode.SUCCESS){
|
|
|
data_list.value = data.content
|
|
@@ -52,7 +60,7 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
function clickBook(data:book_item_data) {
|
|
|
tools.gotoBookdetails(data.book_id)
|
|
|
}
|