index.wxml 5.56 KB
<!--pages/tab/index/index.wxml-->
<navigation-bar bindnavbarReady="navbarReady"
                class="navigation-header"
                navStyle="background-color:{{ isSticky ? '#FFFFFF' : 'transparent' }};box-shadow:none;">
	<view class="page-title">
		工作台
	</view>
</navigation-bar>
<view class="bg" wx:if="{{ !isSticky }}"></view>
<scroll-view class="container"
             scroll-y
             enable-back-to-top
             scroll-top="{{ setScrollTop }}"
             bind:scroll="onScroll"
             bind:refresherrefresh="search"
             bind:scrolltolower="scrollonReachBottom"
             enhanced="{{ true }}"
             show-scrollbar="{{ false }}"
             style="padding-top: {{ navBarHeight }}px;">
	<view class="top-box">
		<view class="user-info">
			<image src="{{ IMG_URL }}default-avatar.png" />
			<view>
				督导{{ userInfo.name }}
			</view>
		</view>
		<view class="static-info">
			<view class="static-item"
			      style="flex: {{ item.width }}rpx 0 0;background: {{ item.background }};"
			      wx:for="{{ staticList }}"
			      wx:key="index">
				<view class="label">
					{{ item.label }}
				</view>
				<view class="value">
					{{ staticData[item.key] }}
				</view>
			</view>
		</view>
	</view>
	<view class="data-container">
		<view class="sticky-box {{ isSticky ? 'is-sticky' : '' }}">
			<view class="tab-box">
				<tab-bar tabList="{{ tabList }}"
				         bindclick="tabClick"
				         activeIndex="{{ tabIndex }}" />
			</view>
			<view class="date">
				<date-screen tabSelected="{{ tabIndex }}"
				             isSticky="{{ isSticky }}"
				             bind:search="search"></date-screen>
			</view>
			<view class="number">
				共{{ total || 0 }}条任务
			</view>
		</view>
		<view class="content-box">
			<view class="list">
				<block wx:if="{{ list.length > 0 }}">
					<block wx:for="{{ list }}"
					       wx:for-item="val"
					       wx:for-index="sIndex"
					       wx:key="sIndex">
						<block wx:for="{{ val }}" wx:key="index">
							<view class="item content">
								<!-- 顶部状态和标题 -->
								<view class="item-top">
									<view class="status text-center"
									      style="color: {{ statusMap[item.taskStatus].color }}; background-color: {{ statusMap[item.taskStatus].background }};">
										{{ statusMap[item.taskStatus].name }}
									</view>
									<view class="name" wx:if="{{ item.taskType != 4 }}">
										{{ missionMap[item.taskType].name }}<text wx:if="{{ item.taskType == 5 }}">-{{ item.storeManagerName || '-' }}</text>
									</view>
									<view class="name" wx:else>
										{{ item.merchantName || '-' }}
									</view>
								</view>
								<view wx:if="{{ (item.taskType == 0 || item.taskType == 1 || item.taskType == 2) && item.taskStatus == 2 }}"
								      class="list-item">
									<image class="icon"
									       src="{{ IMG_URL }}task-icon.png"
									       mode="" />
									<view class="label">
										{{ ['日报内容:', '复盘内容:', '月度计划:'][item.taskType] }}
									</view>
									<view class="text-hide">
										{{ item.taskContext || '-' }}
									</view>
								</view>
								<block wx:if="{{ item.taskType == 4 }}">
									<view class="list-item">
										<image class="icon"
										       src="{{ IMG_URL }}matter-icon.png"
										       mode="" />
										<view class="label">
											事项描述:
										</view>
										<view class="text-hide">
											{{ item.taskDesc || '-' }}
										</view>
									</view>
									<view wx:if="{{ item.taskStatus == 2 }}" class="list-item">
										<image class="icon"
										       src="{{ IMG_URL }}task-icon.png"
										       mode="" />
										<view class="label">
											专项任务:
										</view>
										<view class="text-hide">
											{{ item.taskContext || '-' }}
										</view>
									</view>
									<view wx:else class="list-item">
										<image class="icon"
										       src="{{ IMG_URL }}time-icon.png"
										       mode="" />
										<view class="label">
											创建时间:
										</view>
										<view>
											{{ item.createTime || '-' }}
										</view>
									</view>
								</block>
								<view wx:if="{{ item.taskType != 4 || (item.taskType == 4 && item.taskStatus == 2) }}"
								      class="list-item">
									<image class="icon"
									       src="{{ IMG_URL }}time-icon.png"
									       mode="" />
									<view class="label">
										完成时间:
									</view>
									<view>
										{{ item.updatedDate || '-' }}
									</view>
								</view>
								<view wx:if="{{ item.taskType == 3 }}" class="list-item">
									<view class="progress">
										<view class="progress-line"></view>
										<view class="progress-item"
										      style="width: {{ (item.audioReviewCompletedCount / item.audioReviewTotalCount * 100) + '%' }}"></view>
										<view class="num">
											{{ item.audioReviewCompletedCount + '/' + item.audioReviewTotalCount }}
										</view>
									</view>
								</view>
								<!-- 底部按钮 -->
								<view class="btn-box">
									<view bindtap="jump"
									      data-target="{{ item }}"
									      class="btn {{ item.taskStatus == 2 ? '' : 'primary' }}">
										{{ item.taskStatus == 2 ? '查看' : '去执行' }}
									</view>
								</view>
							</view>
						</block>
					</block>
					<block wx:if="{{ nothing }}">
						<view class="list-nothing">
							到底了~
						</view>
					</block>
				</block>
				<block wx:else>
					<empty-data />
				</block>
			</view>
		</view>
	</view>
</scroll-view>