|
|
|
|
@ -18,6 +18,10 @@
|
|
|
|
|
<view class="placeholder" :style="{ height: navBarHeight + statusBarHeight + 'px', background: 'red' }">
|
|
|
|
|
</view>
|
|
|
|
|
<view class="termBox">
|
|
|
|
|
<view class="tabsnav" :style="{top:navBarHeight + statusBarHeight + 'px'}">
|
|
|
|
|
<u-tabs lineWidth="100" active-color="#FF578A" lineHeight="2" :scrollable="false" :list="tablist" lineColor="#FF578A"
|
|
|
|
|
:is-scroll="false" :current="current" @change="activeChange"></u-tabs>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- <view class="termOuter">
|
|
|
|
|
<view class="termCol cur">综合排序<text class="iconfont icon-arrowbottom"></text></view>
|
|
|
|
|
<view class="termCol">距离最近<text class="iconfont icon-arrowbottom"></text></view>
|
|
|
|
|
@ -80,6 +84,14 @@
|
|
|
|
|
product_type_id: 0,
|
|
|
|
|
isLoading: false,
|
|
|
|
|
activeTypeId:'',
|
|
|
|
|
current: 0,
|
|
|
|
|
tablist:[{
|
|
|
|
|
name: '当前活动',
|
|
|
|
|
idx: 1
|
|
|
|
|
}, {
|
|
|
|
|
name: '往期回顾',
|
|
|
|
|
idx: 0
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -138,6 +150,7 @@
|
|
|
|
|
if(options.activeTypeId){
|
|
|
|
|
this.activeTypeId = options.activeTypeId
|
|
|
|
|
}
|
|
|
|
|
console.log(this.current)
|
|
|
|
|
this.loadPage(1);
|
|
|
|
|
},
|
|
|
|
|
onShow() {},
|
|
|
|
|
@ -165,9 +178,17 @@
|
|
|
|
|
url: "/pages/active/detail?id=" + id
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
activeChange(e) {
|
|
|
|
|
let that = this
|
|
|
|
|
that.current = e;
|
|
|
|
|
that.dataList = []
|
|
|
|
|
|
|
|
|
|
this.loadPage(1);
|
|
|
|
|
},
|
|
|
|
|
loadPage: function(page) {
|
|
|
|
|
uni.hideKeyboard()
|
|
|
|
|
var that = this;
|
|
|
|
|
console.log(that.current)
|
|
|
|
|
that.isLoading = true;
|
|
|
|
|
weixin.request({
|
|
|
|
|
bindThis: that,
|
|
|
|
|
@ -179,6 +200,7 @@
|
|
|
|
|
keyword: that.keyword,
|
|
|
|
|
sort_name:'sort',
|
|
|
|
|
sort_type:"ASC",
|
|
|
|
|
review:that.tablist[that.current].idx,
|
|
|
|
|
active_type_id:this.activeTypeId
|
|
|
|
|
},
|
|
|
|
|
utilSuccess: function(r) {
|
|
|
|
|
@ -187,6 +209,18 @@
|
|
|
|
|
that.isLoading = false;
|
|
|
|
|
var hasNoMore = r.total < 6 && page > 1;
|
|
|
|
|
console.log("hasNoMore", hasNoMore)
|
|
|
|
|
if(res.length==0 && page == 1){
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '当前暂无活动',
|
|
|
|
|
icon: 'none'
|
|
|
|
|
});
|
|
|
|
|
setTimeout(function(){
|
|
|
|
|
that.current = 1
|
|
|
|
|
that.loadPage(1)
|
|
|
|
|
},1000)
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (hasNoMore || res.length == 0 && page > 1) {
|
|
|
|
|
|
|
|
|
|
uni.stopPullDownRefresh(); // 服务器总条数 < 每页条数, 会将第一页的条数重新返回
|
|
|
|
|
@ -237,6 +271,18 @@
|
|
|
|
|
page {
|
|
|
|
|
display: flex
|
|
|
|
|
}
|
|
|
|
|
.tabsnav{
|
|
|
|
|
position: fixed;
|
|
|
|
|
top:0;
|
|
|
|
|
left:0;
|
|
|
|
|
width:100%;
|
|
|
|
|
z-index:999
|
|
|
|
|
}
|
|
|
|
|
/deep/ .tabsnav .u-tab-item{
|
|
|
|
|
}
|
|
|
|
|
/deep/ .u-tab-bar{
|
|
|
|
|
width:80rpx;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.navbar {
|
|
|
|
|
@ -277,6 +323,7 @@
|
|
|
|
|
height: 100%;
|
|
|
|
|
flex: 1;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
margin-top: 40px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.scroll-y-item {
|
|
|
|
|
|