文档资料加下拉刷新
This commit is contained in:
@ -11,7 +11,7 @@
|
|||||||
>
|
>
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<div v-show="!show">文档资料</div>
|
<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>
|
||||||
<template slot="right">
|
<template slot="right">
|
||||||
<div class="rightWrap" @click="show = !show">
|
<div class="rightWrap" @click="show = !show">
|
||||||
@ -29,7 +29,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentWrap" v-show="!showEmpty">
|
<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="info flexBetween common">
|
||||||
<div class="title">{{ item.pushUser }}</div>
|
<div class="title">{{ item.pushUser }}</div>
|
||||||
<div class="time">{{ item.pushTime }}</div>
|
<div class="time">{{ item.pushTime }}</div>
|
||||||
@ -47,6 +48,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</van-pull-refresh>
|
||||||
</div>
|
</div>
|
||||||
<div class="empty" style="display: flex;justify-content: center;align-items: center;height:calc(100% - 86px);background-color: #FAFAFA" v-show="showEmpty">
|
<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%"/>
|
<img src="@/assets/empty.png" style="width: 100%"/>
|
||||||
@ -69,6 +71,7 @@ export default {
|
|||||||
pageSize:10,
|
pageSize:10,
|
||||||
keyword:'',
|
keyword:'',
|
||||||
trainingType:1,
|
trainingType:1,
|
||||||
|
isLoading:false,
|
||||||
show:false,
|
show:false,
|
||||||
showEmpty:false
|
showEmpty:false
|
||||||
}
|
}
|
||||||
@ -77,6 +80,28 @@ export default {
|
|||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods:{
|
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) {
|
async changeTab(index) {
|
||||||
this.activeIndex = index
|
this.activeIndex = index
|
||||||
this.pageNum = 1
|
this.pageNum = 1
|
||||||
@ -161,6 +186,7 @@ export default {
|
|||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.itemWrap{
|
.itemWrap{
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
@include wh(100%, 300px);
|
@include wh(100%, 300px);
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="contentWrap" v-show="!showEmpty">
|
<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="itemWrap" v-for="(item,index) in pageList" :key="index" @click="goH5Detail(item)">
|
||||||
<div class="info flexBetween common">
|
<div class="info flexBetween common">
|
||||||
<div class="title">{{ item.pushUser }}</div>
|
<div class="title">{{ item.pushUser }}</div>
|
||||||
@ -87,14 +87,11 @@ export default {
|
|||||||
};
|
};
|
||||||
let u = navigator.userAgent;
|
let u = navigator.userAgent;
|
||||||
let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
||||||
// if (window.MyAppBridge) {
|
|
||||||
if(isiOS){
|
if(isiOS){
|
||||||
window.webkit.messageHandlers.nativeObject.postMessage(data);
|
window.webkit.messageHandlers.nativeObject.postMessage(data);
|
||||||
}else {
|
}else {
|
||||||
window.android.sendMessage("articleId=" + item.id);
|
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() {
|
onRefresh() {
|
||||||
this.getList()
|
this.getList()
|
||||||
|
Reference in New Issue
Block a user