receptionRecording.wxml
3.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!--packageCrew/pages/receptionRecording/receptionRecording.wxml-->
<wxs module="filter">
var isShowEmpty = function (listData) {
var listDataLength = 0
for (var i = 0; i < listData.length; i++) {
var curr = listData[i]
listDataLength += curr.receptionStaticInfoDTOList ? curr.receptionStaticInfoDTOList.length : 0
}
return listDataLength > 0
}
var isFirstDateInAllPages = function (allPages, pageIndex, itemDate) {
if (!itemDate) return true
if (!allPages || !allPages.length) return true
// 只检查当前页之前的所有页
for (var p = 0; p < pageIndex; p++) {
var pageArr = allPages[p]
if (!pageArr || !pageArr.length) continue
for (var i = 0; i < pageArr.length; i++) {
if (pageArr[i] && pageArr[i].date === itemDate) {
return false
}
}
}
return true
}
module.exports = {
isShowEmpty: isShowEmpty,
isFirstDateInAllPages: isFirstDateInAllPages
}
</wxs>
<view class="content">
<view class="top-box">
<view class="name">
<view class="staff">
{{detailInfo.storeManagerName}}
<image class="sex-icon" src="{{IMG_URL}}{{detailInfo.sex == 1 ? 'female-icon' : 'male-iconx'}}.png" mode="aspectFit" />
</view>
</view>
<view class="items">
<view class="item {{item.inline ? 'inline' : ''}}" style="{{item.width ? ('width:' + item.width + ';') : ''}}" wx:for="{{detailItems}}" wx:key="index">
<view class="label">{{item.label}}:</view>
<view class="value">{{detailInfo[item.key] || '-'}}</view>
</view>
</view>
</view>
<view class="date">
<date-screen wx:if="{{dateReady}}" bind:search="search" customBackground="#F7F8FA" initTimeDimension="{{initTimeDimension}}" initStartDate="{{initStartDate}}" initEndDate="{{initEndDate}}"></date-screen>
</view>
<view class="grid grid-3">
<view class="grid-item" wx:for="{{staticsItems}}" wx:key="label">
<view class="label">{{item.label}}</view>
<view class="value">{{staticDate[item.key]}}</view>
</view>
</view>
</view>
<scroll-view scroll-y class="list-box" enable-back-to-top bindscrolltolower="onBottomRefresh" style="height: calc(100% - {{contentHeight}}px);" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}">
<view class="box-content">
<block wx:if="{{list.length}}">
<block wx:for="{{list}}" wx:for-item="listData" wx:for-index="listIndex" wx:key="listIndex">
<block wx:for="{{listData}}" wx:for-item="item" wx:for-index="index" wx:key="index" wx:if="{{item.receptionStaticInfoDTOList.length}}">
<view class="date-section" wx:if="{{filter.isFirstDateInAllPages(list, listIndex, item.date)}}">
<view class="list-date">{{item.staticDateStr}}</view>
<block>
<view class="static">
<view class="static-warp">
<view>
<text class="summary-item green" data-type="upgrade" bindtap="filterItemData">成交 {{item.dealCount}}</text>
<text class="line"></text>
</view>
<view>
<text class="summary-item red" data-type="defeat" bindtap="filterItemData">战败 {{item.defeatCount}}</text>
</view>
</view>
</view>
</block>
</view>
<block wx:for="{{item.receptionStaticInfoDTOList}}" wx:key="subIndex" wx:for-index="subIndex" wx:for-item="record">
<view class="record-card" bind:tap="goto" data-record="{{record}}">
<view class="record-card-top">
<text class="round-dot" style="font-size: {{subIndex + 1 > 99 ? 'var(--fontSize16)' : 'var(--fontSize20)'}};">{{subIndex + 1}}</text>
<view class="card-line"></view>
</view>
<view class="card-item" wx:key="subIndex">
<record-item record="{{record}}" detailInfo="{{detailInfo}}"></record-item>
</view>
</view>
</block>
</block>
<block wx:if="{{nothing}}">
<view class="list-nothing">到底了~</view>
</block>
</block>
</block>
<block wx:else>
<empty-data />
</block>
</view>
</scroll-view>