Commit ccbc5a7b by luyt

other:调整首页刷新

1 parent 301cdcdd
...@@ -14,7 +14,7 @@ Component({ ...@@ -14,7 +14,7 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
refresherFlag:true,
}, },
/** /**
...@@ -27,5 +27,14 @@ Component({ ...@@ -27,5 +27,14 @@ Component({
let { num } = e.currentTarget.dataset let { num } = e.currentTarget.dataset
this.triggerEvent('selectCar',num) this.triggerEvent('selectCar',num)
}, },
refresherrefreshFn(){
this.triggerEvent('refresherrefresh')
setTimeout(()=>{
this.setData({
refresherFlag:false
})
},1000)
}
} }
}) })
/* pages/tab/index/components/indexProduct/indexProduct.wxss */ /* pages/tab/index/components/indexProduct/indexProduct.wxss */
.content-scroll{
height: 100vh;
// height: calc(100% - 80rpx);
}
.content-product { .content-product {
.scene { .scene {
// margin-top: 32rpx; // margin-top: 32rpx;
......
<!--pages/tab/index/components/indexProduct/indexProduct.wxml--> <!--pages/tab/index/components/indexProduct/indexProduct.wxml-->
<!-- class="content-scroll" -->
<!-- style="height: calc(100vh - {{headerHeight/2}}px)" -->
<!-- <scroll-view
scroll-y="true"
refresher-enabled="{{true}}"
refresher-triggered="{{refresherFlag}}"
bindrefresherrefresh="refresherrefreshFn"> -->
<view <view
class="content-product" class="content-product"
hover-class="none" hover-class="none"
...@@ -24,6 +31,7 @@ ...@@ -24,6 +31,7 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<!-- stickyTop="{{headerHeight}}" -->
<product <product
img_version="{{img_version}}" img_version="{{img_version}}"
isShow="{{false}}" isShow="{{false}}"
...@@ -33,3 +41,4 @@ ...@@ -33,3 +41,4 @@
origin="home" origin="home"
bindsharehandle="sharehandle" /> bindsharehandle="sharehandle" />
</view> </view>
<!-- </scroll-view> -->
\ No newline at end of file \ No newline at end of file
...@@ -59,6 +59,7 @@ Component({ ...@@ -59,6 +59,7 @@ Component({
getMoreBtn: false, getMoreBtn: false,
showVideo: true, //显示视频列表 showVideo: true, //显示视频列表
imgTopArr: [], imgTopArr: [],
// navFixed:false //步骤条定位
}, },
lifetimes: { lifetimes: {
ready: function () { ready: function () {
...@@ -87,8 +88,21 @@ Component({ ...@@ -87,8 +88,21 @@ Component({
// } // }
//监听页面滚动的距离 //监听页面滚动的距离
// let {stickyTop} = this.data
// //44 nav的高度
// let top = stickyTop/2 + 44
wx.$eventbus.on("evt_page_scroll", async (e) => { wx.$eventbus.on("evt_page_scroll", async (e) => {
// console.log(e) // console.log('top: ', e.scrollTop,top);
// if(e.scrollTop>top ){
// this.setData({
// navFixed:true
// })
// }else{
// this.setData({
// navFixed:false
// })
// }
// let heightTop = this.data.stickyTop// 90 场景高度,8 场景margin-bottom // let heightTop = this.data.stickyTop// 90 场景高度,8 场景margin-bottom
// let prodArr = await this.getHeight('.prod-wrap') // let prodArr = await this.getHeight('.prod-wrap')
// // console.log('prodArr: ', prodArr); // // console.log('prodArr: ', prodArr);
......
...@@ -206,6 +206,11 @@ ...@@ -206,6 +206,11 @@
z-index: 2; z-index: 2;
background-color: #f5f7fb; background-color: #f5f7fb;
} }
.stickyTab-fixed{
position: fixed;
left: 0;
top: 352rpx;
}
// .out-tab{ // .out-tab{
// .out-text { // .out-text {
......
...@@ -42,9 +42,14 @@ ...@@ -42,9 +42,14 @@
</view> </view>
<view class="project-wrap {{isShow ?'check-prod':''}}"> <view class="project-wrap {{isShow ?'check-prod':''}}">
<!-- stickyTop+88 --> <!-- stickyTop+88 -->
<view class="stickyTab" style="top:{{isShare ? stickyTop : stickyTop}}rpx"> <!-- style="top:{{isShare ? stickyTop : stickyTop}}rpx" -->
<view class="stickyTab" style="top:{{isShare ? stickyTop : stickyTop}}rpx" >
<tab outClassName="project-tab" openScroll="{{true}}" tab="{{tab}}" index="{{curTabIdx}}" bindclick="changeTab" productHeight /> <tab outClassName="project-tab" openScroll="{{true}}" tab="{{tab}}" index="{{curTabIdx}}" bindclick="changeTab" productHeight />
</view> </view>
<!-- wx:if="{{navFixed}}" -->
<!-- <view class="stickyTab stickyTab-fixed">
<tab outClassName="project-tab" openScroll="{{true}}" tab="{{tab}}" index="{{curTabIdx}}" bindclick="changeTab" productHeight />
</view> -->
<!-- style="{height:{{allHeight}}px}" scroll-y="{{true}}" bindscroll="scrolltoupper"--> <!-- style="{height:{{allHeight}}px}" scroll-y="{{true}}" bindscroll="scrolltoupper"-->
<!-- <scroll-view class="project-img" scroll-into-view="{{intoViewId}}"> --> <!-- <scroll-view class="project-img" scroll-into-view="{{intoViewId}}"> -->
......
...@@ -101,6 +101,22 @@ Page({ ...@@ -101,6 +101,22 @@ Page({
readApi(param) readApi(param)
} }
}, },
//看产品下拉刷新
refresherrefresh(){
let {tabIndx} = this.data
if(tabIndx == 1){
// 看产品
this.getProductByscene()
// // 看线索
// this.getClueInit()
this.getUnreadApi()
wx.pro.showToast({
title: "刷新成功",
icon: "loading",
duration: 1500,
});
}
},
// 跳转咨询页面 // 跳转咨询页面
goConsult() { goConsult() {
console.log('跳转到咨询页面') console.log('跳转到咨询页面')
...@@ -485,20 +501,6 @@ Page({ ...@@ -485,20 +501,6 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
// console.log(123546)
let {tabIndx} = this.data
if(tabIndx == 1){
// 看产品
this.getProductByscene()
// // 看线索
// this.getClueInit()
this.getUnreadApi()
wx.pro.showToast({
title: "刷新成功",
icon: "loading",
duration: 1500,
});
}
}, },
/** /**
......
...@@ -7,6 +7,5 @@ ...@@ -7,6 +7,5 @@
"FullscreenVideo":"../../../components/FullscreenVideo/FullscreenVideo" "FullscreenVideo":"../../../components/FullscreenVideo/FullscreenVideo"
}, },
"navigationStyle": "custom", "navigationStyle": "custom",
"onReachBottomDistance": 50, "onReachBottomDistance": 50
"enablePullDownRefresh":true
} }
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
senceData="{{senceData}}" senceData="{{senceData}}"
actNum="{{actNum}}" actNum="{{actNum}}"
img_version="{{img_version}}" img_version="{{img_version}}"
headerHeight="{{headerHeight}}"></indexProduct> headerHeight="{{headerHeight}}"
bindrefresherrefresh="refresherrefresh"></indexProduct>
<!-- 看线索内容 --> <!-- 看线索内容 -->
<indexClue <indexClue
wx:if="{{tabIndx == 0 }}" wx:if="{{tabIndx == 0 }}"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!