纸通宝商家版本的小程序,原生微信开发。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

27 lines
1.9 KiB

<scroll-view scroll-x="true" style="width:100%;" class="table table-border">
<!-- 表格头 start -->
<view class="thead {{ border ? 'thead-border' : ''}} header-row-class-name" style="width:{{ scrolWidth }}rpx;">
<view wx:for="{{ headers }}" wx:key="index" class="td flex" style="width:{{ item.width }}rpx;" data-index="{{index}}" bindtap="onHeaderClick">
<view style="flex: 1;padding-left: {{item.sort ? 8 : 0}}rpx;line-height: 32rpx;">{{ item.label }}</view>
<view style="display: flex; flex-direction: column;width: 32rpx;margin-right: 2rpx;margin-left: -4rpx;" wx:if="{{item.sort}}">
<text class="cuIcon-triangleupfill text-{{item.sort == 2 ? 'blue' : 'gray'}}" style="height: 40rpx;font-size: 36rpx;margin-top: 0rpx;"></text>
<text class="cuIcon-triangledownfill text-{{item.sort == 3 ? 'blue' : 'gray'}}" style="height: 40rpx;font-size: 36rpx;margin-top: -28rpx;"></text>
</view>
</view>
</view>
<!-- 表格体 start -->
<scroll-view scroll-y="true" class="tbody" style="width:{{ scrolWidth }}rpx; height:{{ height ? height : 'auto' }}rpx;">
<block wx:if="{{ data.length > 0 }}" wx:for-item="it" wx:for="{{ data }}" wx:for-index="idx" wx:key="idx">
<view class="tbody-tr {{ stripe ? 'tbody-tr-stripe' : '' }} {{ border ? 'tbody-tr-border' : ''}} row-class-name" data-row="{{idx}}" bindtap="onRowClick">
<view wx:for-item="head" wx:for="{{ headers }}" wx:key="index" class="td cell-class-name text-cut" data-it="{{it}}"
data-row="{{index}}" data-column="{{idx+1}}" style="width:{{ headers[index].width }}rpx;color:{{ headers[index].color }};" bindtap="onCellClick">
{{ head["prop"] === 'index' ? (idx+1) : ( head["suffix"] ? it[head["prop"]] + head["suffix"] : it[head["prop"]] ) }}
</view>
</view>
</block>
<!-- 列表无数据处理 -->
<block wx:if="{{ data.length === 0 }}">
<view class="no-data">{{ msg }}</view>
</block>
</scroll-view>
</scroll-view>