Commit deaa92de by chenwq

sort抖动,新增/编辑客户历史数据处理

1 parent 0b317108
......@@ -244,7 +244,7 @@ Page({
if (addOrEdit == 'edit') {
wx.setNavigationBarTitle({ title: '编辑客户' })
scenceList.forEach(item => {
item.isCheck = target.sceneList.findIndex(k => k == item.sceneCode) != -1
item.isCheck = target.sceneList?.findIndex(k => k == item.sceneCode) != -1
})
this.setData({
scenceList,
......
......@@ -85,6 +85,11 @@ Component({
// 升降序
handleSort() {
let { detail } = e
let sortTabModule = this.selectComponent("#sortTab")
let sortTabFixModule = this.selectComponent("#sortTabFix")
sortTabModule.syncVal(detail)
sortTabFixModule.syncVal(detail)
this.getBusiStatistics(true)
},
......
......@@ -54,9 +54,14 @@
.sort-fix {
box-sizing: border-box;
position: absolute;
top: 0;
left: 16rpx;
width: 100%;
height: 86rpx;
padding: 0 16rpx;
transition: height 0.05s ease-in-out;
}
.sort-hide {
height: 0;
}
.price-txt {
......
<!-- pages/tab/output/components/client/client.wxml -->
<wxs src="../../index.wxs" module="filter" />
<total-tab id="totalTab" bindbusiSearch="handleBusiSearch" bindtabChange="handleTabChange"></total-tab>
<view class="sort-fix {{stickyScrollTop >= 96 ? '' : 'sort-hide'}}" wx:if="{{tabActive == 'business'}}">
<sort-tab id="sortTabFix" sceneCode="{{formData.sceneCode}}" bindhandleSort="handleSort"></sort-tab>
</view>
<scroll-view wx:if="{{tabActive == 'store'}}" class="client" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindscrolltolower="onReachBottom" bindrefresherrefresh="onBindRefresh" lower-threshold='50' scroll-top="{{scrollTop}}">
<view class="client-box">
<view class="profit-box flex-between">
<text>总收益</text>
<text class="price-txt">¥{{filter.money_three_for_two_thousands(totalProfit || 0.00)}}</text>
</view>
<view wx:for="{{list}}" class="shadow" wx:key="index" bindtap="handleJump" data-idx="{{index}}">
<view class="box {{item.activityLastUnSharedInfo ? 'share' : ''}}">
<view class="head flex-between">
<view class="name ">{{item.merchantName}}</view>
<view class="price-txt ">¥{{filter.money_three_for_two_thousands(item.totalMoney || 0.00)}}</view>
</view>
<!-- 场景内容 -->
<view class="box-content">
<scene-box sceneInfo="{{item}}" hasLockIcon="{{false}}" scenePriceList="{{item.scenePriceList}}" />
<!-- 通知 -->
<view class="box-bottom">
<view wx:if="{{item.msgList.length}}" class="flex">
<view class="tip-blue">最新</view>
<view class="bottom-content">
<view class="flex-between tip-row" wx:for="{{item.msgList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view>{{subItem.msg}}</view>
<view class="time">{{subItem.createTime}}</view>
</view>
<view class="profit-box flex-between">
<text>总收益</text>
<text class="price-txt">¥{{filter.money_three_for_two_thousands(totalProfit || 0.00)}}</text>
</view>
<view wx:for="{{list}}" class="shadow" wx:key="index" bindtap="handleJump" data-idx="{{index}}">
<view class="box {{item.activityLastUnSharedInfo ? 'share' : ''}}">
<view class="head flex-between">
<view class="name ">{{item.merchantName}}</view>
<view class="price-txt ">¥{{filter.money_three_for_two_thousands(item.totalMoney || 0.00)}}</view>
</view>
<!-- 场景内容 -->
<view class="box-content">
<scene-box sceneInfo="{{item}}" hasLockIcon="{{false}}" scenePriceList="{{item.scenePriceList}}" />
<!-- 通知 -->
<view class="box-bottom">
<view wx:if="{{item.msgList.length}}" class="flex">
<view class="tip-blue">最新</view>
<view class="bottom-content">
<view class="flex-between tip-row" wx:for="{{item.msgList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view>{{subItem.msg}}</view>
<view class="time">{{subItem.createTime}}</view>
</view>
</view>
<view wx:if="{{!item.msgList.length && !item.isOpenScene}}" class="flex">
<view class="tip-blue">通知</view>
<view class="bottom-content">
<view class="tip-row">
<view>
运营建议:您的门店尚未开展活动,暂无产值。建议
<text class="tip-link" catchtap="handleJumpIdx">开通新产品</text>
拓展营收范围。
</view>
</view>
<view wx:if="{{!item.msgList.length && !item.isOpenScene}}" class="flex">
<view class="tip-blue">通知</view>
<view class="bottom-content">
<view class="tip-row">
<view>
运营建议:您的门店尚未开展活动,暂无产值。建议
<text class="tip-link" catchtap="handleJumpIdx">开通新产品</text>
拓展营收范围。
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 分享海报 -->
<view wx:if="{{item.activityLastUnSharedInfo}}" class="box-share">
<view>{{item.activityLastUnSharedInfo.activityName}}正在进行,分享母链海报开展业务</view>
<view class="btn-share" catchtap="handleShare" data-idx="{{index}}">去分享</view>
</view>
</view>
<view wx:if="{{totalPages != -1 && pageObj.currentPage == totalPages}}" class="end-txt">
到底啦!
<!-- 分享海报 -->
<view wx:if="{{item.activityLastUnSharedInfo}}" class="box-share">
<view>{{item.activityLastUnSharedInfo.activityName}}正在进行,分享母链海报开展业务</view>
<view class="btn-share" catchtap="handleShare" data-idx="{{index}}">去分享</view>
</view>
</view>
<view wx:if="{{totalPages != -1 && pageObj.currentPage == totalPages}}" class="end-txt">
到底啦!
</view>
</view>
</scroll-view>
<scroll-view wx:if="{{tabActive == 'business'}}" class="client" id="scroller" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="handleSort" lower-threshold='50' bind:scroll="handleBusiScroll" scroll-top="{{busiScrollTop}}">
<view class="client-box">
......@@ -62,7 +65,7 @@
<text class="price-txt">¥{{filter.money_three_for_two_thousands(busiObj.totalAmount || 0.00)}}</text>
</view>
<view>
<sort-tab id="sortTab" class="{{stickyScrollTop > 74 ? 'sort-fix' : ''}}" style="top: {{stickyScrollTop - 16 + 'px'}}" sceneCode="{{formData.sceneCode}}" bindhandleSort="handleSort"></sort-tab>
<sort-tab id="sortTab" sceneCode="{{formData.sceneCode}}" bindhandleSort="handleSort"></sort-tab>
</view>
</view>
<!-- 售后众筹 -->
......
......@@ -93,16 +93,16 @@ Component({
}
},
lifetimes: {
attached() {
console.log(this.data.formObj[this.data.sceneCode])
}
},
/**
* 组件的方法列表
*/
methods: {
// 同步值
syncVal(value) {
this.setData({
...value
})
},
// 处理升降序排序参数
dealParams() {
let { actIdx, formObj, sceneCode } = this.data
......@@ -174,7 +174,7 @@ Component({
[`formObj.${sceneCode}[${idx}].asc`]: _asc,
actIdx: _actIdx
})
this.triggerEvent('handleSort')
this.triggerEvent('handleSort', this.data)
},
}
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!