文档资料加下拉刷新
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
>
|
||||
<template slot="title">
|
||||
<div v-show="!show">文档资料</div>
|
||||
<van-field v-model="keyword" placeholder="请输入关键词" v-show="show" @keyup.enter="getList"/>
|
||||
<van-field v-model="keyword" placeholder="请输入关键词" v-show="show" @input="getList"/>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<div class="rightWrap" @click="show = !show">
|
||||
@ -29,7 +29,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="contentWrap" v-show="!showEmpty">
|
||||
<div class="itemWrap" v-for="(item,index) in pageList" :key="index">
|
||||
<van-pull-refresh v-model="isLoading" @refresh="onRefresh" style="min-height:85vh">
|
||||
<div class="itemWrap" v-for="(item,index) in pageList" :key="index" @click="goH5Detail(item)">
|
||||
<div class="info flexBetween common">
|
||||
<div class="title">{{ item.pushUser }}</div>
|
||||
<div class="time">{{ item.pushTime }}</div>
|
||||
@ -47,6 +48,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-pull-refresh>
|
||||
</div>
|
||||
<div class="empty" style="display: flex;justify-content: center;align-items: center;height:calc(100% - 86px);background-color: #FAFAFA" v-show="showEmpty">
|
||||
<img src="@/assets/empty.png" style="width: 100%"/>
|
||||
@ -69,6 +71,7 @@ export default {
|
||||
pageSize:10,
|
||||
keyword:'',
|
||||
trainingType:1,
|
||||
isLoading:false,
|
||||
show:false,
|
||||
showEmpty:false
|
||||
}
|
||||
@ -77,6 +80,28 @@ export default {
|
||||
this.getList()
|
||||
},
|
||||
methods:{
|
||||
goH5Detail(item){
|
||||
let data = {
|
||||
"action": "goTraining",
|
||||
"params": {
|
||||
"id": item.id,
|
||||
}
|
||||
};
|
||||
let u = navigator.userAgent;
|
||||
let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
||||
if(isiOS){
|
||||
window.webkit.messageHandlers.nativeObject.postMessage(data);
|
||||
}else {
|
||||
window.android.sendMessage("articleId=" + item.id);
|
||||
}
|
||||
},
|
||||
onRefresh() {
|
||||
this.getList()
|
||||
setTimeout(() => {
|
||||
this.$toast('刷新成功');
|
||||
this.isLoading = false;
|
||||
}, 1000);
|
||||
},
|
||||
async changeTab(index) {
|
||||
this.activeIndex = index
|
||||
this.pageNum = 1
|
||||
@ -161,6 +186,7 @@ export default {
|
||||
padding: 0 8px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
.itemWrap{
|
||||
margin-top: 16px;
|
||||
@include wh(100%, 300px);
|
||||
|
@ -23,7 +23,7 @@
|
||||
</div>
|
||||
|
||||
<div class="contentWrap" v-show="!showEmpty">
|
||||
<van-pull-refresh v-model="isLoading" @refresh="onRefresh">
|
||||
<van-pull-refresh v-model="isLoading" @refresh="onRefresh" style="min-height:85vh">
|
||||
<div class="itemWrap" v-for="(item,index) in pageList" :key="index" @click="goH5Detail(item)">
|
||||
<div class="info flexBetween common">
|
||||
<div class="title">{{ item.pushUser }}</div>
|
||||
@ -87,14 +87,11 @@ export default {
|
||||
};
|
||||
let u = navigator.userAgent;
|
||||
let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
||||
// if (window.MyAppBridge) {
|
||||
if(isiOS){
|
||||
window.webkit.messageHandlers.nativeObject.postMessage(data);
|
||||
}else {
|
||||
window.android.sendMessage("articleId=" + item.id);
|
||||
}
|
||||
// }
|
||||
// window.location.href = `http://crm1.sino-assist.com/res/training/training.html?id=${item.id}&source=supplierApp&supplierId=${this.supplierId}&userId=${this.userId}`;
|
||||
},
|
||||
onRefresh() {
|
||||
this.getList()
|
||||
|
Reference in New Issue
Block a user