table.wxml 2.55 KB
<!--pages/components/table/table.wxml-->
<!-- <text>pages/components/table/table.wxml</text> -->
<scroll-view
	scroll-x
	scroll-y
	show-scrollbar="{{ false }}"
	bindrefresherrefresh="restPageNum"
	bindscrolltolower="scrollonReachBottom"
	refresher-threshold="304"
	refresher-triggered="{{ triggered }}"
	class="table"
>
	<view class="table-box" style="width: var(--fontSize{{ tableWidth }})">
		<view class="table-header" style="width: var(--fontSize{{ tableWidth }})">
			<view class="label">合作门店</view>
			<view class="values">
				<!-- {{ tableSort == index?'active':'' }} -->
				<block wx:for="{{ tableObj }}" wx:key="index">
					<!-- 		bindtap="changeTableSort" -->
					<view class="value" style="width: {{ item.width }};" id="header-{{ index }}" data-index="{{ index }}">
						<view class="lable">
							<view class="name">{{item.name}}{{item.unit}}</view>
						</view>
						<!-- <view class="sort-list">
									<view class="up {{ item.sort?'sort-active':'' }}" />
									<view class="down {{ !item.sort?'sort-active':'' }}" />
								</view> -->
					</view>
				</block>
			</view>
		</view>
		<view class="table-body">
			<block wx:if="{{ tableFlag }}">
				<block wx:if="{{ table.length > 0 }}">
					<block wx:for="{{ table }}" wx:key="index">
						<view class="th" style="width: var(--fontSize{{ tableWidth }})">
							<view class="name">
								<view class="labelName {{ item.merchantName.length<=10?'oneLine':'' }}">{{item.merchantName}}</view>
							</view>
							<view class="values">
								<block wx:for="{{ tableObj }}" wx:key="ind" wx:for-item="i" wx:for-index="ind">
									<view class="td text-center" style="width: {{ tableObj[ind]['width'] }};">
										<block wx:if="{{ i.key == 'filmTimes' }}">
											<view
												class="text-center"
												style="width:100%;height: 100%;color:{{ isYqdSuper?'#347BFF':'#333333' }}"
												data-item="{{ item }}"
												bindtap="changeTableData"
											>{{item[i.key] || 0}}</view>
										</block>
										<block wx:elif="{{ i.key == 'upgradeRate' }}">{{item[i.key] || 0}}%</block>
										<block wx:else>{{item[i.key] || 0}}</block>
									</view>
								</block>
							</view>
						</view>
					</block>
				</block>
			</block>
		</view>
	</view>
</scroll-view>
<block wx:if="{{ table.length <= 0 }}">
	<view class="nothing">暂无数据</view>
</block>
<view class="showMore">
	<view class="btn">加载更多</view>
	<glsx-image class="icon" src="{{ '/index/arrowbottom.png' }}" webp></glsx-image>
</view>