|
|
|
@ -2,10 +2,10 @@ |
|
|
|
<view> |
|
|
|
<lf-nav title="兑换记录" :showIcon="true" bgColor="#fff"></lf-nav> |
|
|
|
<view class="head"> |
|
|
|
<u-search placeholder="搜你想要的" v-model="value" @custom="customClick"></u-search> |
|
|
|
<u-search placeholder="搜你想要的" v-model="value" @custom="onSearch" @search="onSearch" @clear="clearSearch"></u-search> |
|
|
|
</view> |
|
|
|
<scroll-view :style="{height: autoHeight}" :scroll-y="true" :refresher-enabled="true" :refresher-triggered="isRefresher" |
|
|
|
@scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh"> |
|
|
|
@scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh" > |
|
|
|
<view class="content"> |
|
|
|
<view class="card" v-for="(item, index) in list" :key="index" @click="$url('/pages/order/newdetail/newdetail?type=point&order_id='+item.order_no)"> |
|
|
|
<view> |
|
|
|
@ -53,12 +53,13 @@ |
|
|
|
scrollH: 0, |
|
|
|
nav_height: 0, |
|
|
|
isRefresher: true, |
|
|
|
pageSize: 10 |
|
|
|
pageSize: 10, |
|
|
|
is_search: false // 当前是否处于搜索中状态 |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
autoHeight(){ |
|
|
|
return `calc(${this.scrollH}px - ${this.nav_height}px - 180rpx)`; |
|
|
|
return `calc(${this.scrollH}px - ${this.nav_height}px - 180rpx - 120rpx)`; |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(){ |
|
|
|
@ -88,18 +89,41 @@ |
|
|
|
this.isRefresher = true; |
|
|
|
this.refreshFn({type: 'scrollRefresh'}); |
|
|
|
}, |
|
|
|
customClick(event){ |
|
|
|
// 触发搜索 |
|
|
|
onSearch(event){ |
|
|
|
console.log(event) |
|
|
|
if(event){ |
|
|
|
this.is_search = true; |
|
|
|
}else{ |
|
|
|
this.is_search = false; |
|
|
|
} |
|
|
|
this.page = 1; |
|
|
|
this.isPage = true; |
|
|
|
this.loadingClass = true; |
|
|
|
this.list = [] |
|
|
|
this.loadingText = '正在加载中'; |
|
|
|
this.getPointOrder(); |
|
|
|
}, |
|
|
|
// 清除搜索内容 |
|
|
|
clearSearch(){ |
|
|
|
if(this.is_search){ |
|
|
|
this.onSearch(false); |
|
|
|
} |
|
|
|
}, |
|
|
|
getPointOrder(options = {}){ |
|
|
|
let par = { |
|
|
|
page: this.page |
|
|
|
} |
|
|
|
if(this.is_search && this.value){ |
|
|
|
par.keyword = this.value; |
|
|
|
} |
|
|
|
|
|
|
|
this.$http.get({ |
|
|
|
api: 'api/order/point/list', |
|
|
|
header: { |
|
|
|
Authorization: this.$cookieStorage.get('user_token') |
|
|
|
}, |
|
|
|
data: { |
|
|
|
page: this.page |
|
|
|
} |
|
|
|
data: par |
|
|
|
}).then(res => { |
|
|
|
console.log("----", res); |
|
|
|
let isPage = this.page < res.data.meta.pagination.total_pages?true:false; |
|
|
|
|