index.wxml 8.52 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 wx:for="{{ staticList }}"
			      wx:key="{{ item.key }}"
			      class="static-item"
			      style="flex: {{ item.width }}rpx 0 0;background: {{ item.background }};"
			      data-key="{{ item.key }}"
			      bind:tap="handleNavigatePerformance">
				<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 }}"
				         badge="{{ true }}"
				         bind:click="tabClick"
				         activeIndex="{{ tabIndex }}" />
			</view>
			<view class="date">
				<date-screen tabSelected="{{ tabIndex }}"
				             isSticky="{{ isSticky }}"
				             bind:search="search"></date-screen>
			</view>
			<view class="count-row">
				<view class="number">
					共{{ total || 0 }}条任务
				</view>
				<view class="sub-tab" wx:if="{{ tabIndex == 3 }}">
					<view class="center-switch {{ subTabIndex == 0 ? 'active' : '' }}"
					      catchtap="switchSpecialCenter"
					      data-index="0">
						<text class="center-switch__text {{ subTabIndex == 0 ? 'active' : '' }}">任务中心</text>
					</view>
					<text class="center-switch__icon">⇄</text>
					<view class="center-switch {{ subTabIndex == 1 ? 'active' : '' }}"
					      catchtap="switchSpecialCenter"
					      data-index="1">
						<text class="center-switch__text {{ subTabIndex == 1 ? 'active' : '' }}">策略中心</text>
					</view>
				</view>
			</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">
								<block wx:if="{{ tabIndex == 3 && subTabIndex == 0 }}">
									<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">
											专项带教
										</view>
									</view>
									<view class="list-item">
										<image class="icon"
										       src="{{ IMG_URL }}special-task-merchant.png"
										       mode="" />
										<view class="label">
											归属门店:
										</view>
										<view class="text-hide">
											{{ item.taskMerchantName || '-' }}
										</view>
									</view>
									<view class="list-item">
										<image class="icon"
										       src="{{ IMG_URL }}time-icon.png"
										       mode="" />
										<view class="label">
											完成时间:
										</view>
										<view wx:if="{{ item.taskStatus == 2 }}">
											{{ item.completeTime || '-' }}
										</view>
										<view wx:else>
											-
										</view>
									</view>
									<view class="btn-box">
										<view bindtap="jumpTaskCenter"
										      data-target="{{ item }}"
										      class="btn {{ item.taskStatus == 2 ? '' : 'primary' }}">
											{{ item.taskStatus == 2 ? '查看' : '去执行' }}
										</view>
									</view>
								</block>
								<block wx:else>
									<!-- 顶部状态和标题 -->
									<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 }}"></text>
										</view>
										<view class="name" wx:else>
											{{ item.merchantName || '-' }}
										</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 wx:if="{{ item.taskStatus == 2 }}">
											{{ item.updatedDate || '-' }}
										</view>
										<view wx:else>
											-
										</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 wx:if="{{ item.taskType == 6 || item.taskType == 7 }}" class="list-item">
										<view class="progress">
											<view class="progress-line"></view>
											<view class="progress-item"
											      style="width: {{ (item.weeklyTaskCompletedCount / item.weeklyTaskTotalCount * 100) + '%' }};"></view>
											<view class="num">
												{{ item.weeklyTaskCompletedCount + '/' + item.weeklyTaskTotalCount }}
											</view>
										</view>
									</view>
									<!-- 底部按钮 -->
									<view class="btn-box">
										<view bindtap="jump"
										      data-target="{{ item }}"
										      class="btn {{ item.taskStatus == 2 ? '' : 'primary' }}">
											{{ item.taskStatus == 2 ? '查看' : '去执行' }}
										</view>
									</view>
								</block>
							</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>
<block wx:if="{{ tabIndex == 0 }}">
	<block wx:if="{{ showIcon1 }}">
		<view class="add-btn-box" bindtap="handleMentoring">
			<view class="addBtn">
				<van-icon name="plus" />
				<view class="btn-text">
					带教记录
				</view>
			</view>
		</view>
	</block>
	<block wx:else>
		<view class="arrowIcon">
			<image class="image"
			       src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/usedCar/arrow-right.png" />
		</view>
	</block>
</block>