dk-table.wxml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <wxs src='/utils/numberFormat.wxs' module="numberFormat"></wxs>
  2. <view>
  3. <view class="top-data">
  4. <view wx:for="{{topData}}" wx:for-item="tdItem" wx:for-index="tdIndex" wx:key="tdIndex" style="{{'width:'+(100/topData.length)+'%;'}}">
  5. <view>
  6. <view wx:if="{{tdItem.type === 'amount'}}" style="display: flex;align-items: baseline;justify-content: center;"><text style="font-size: 12px;">¥</text>{{tdItem.value ? numberFormat.toThousandCents(tdItem.value) : '0.00'}}</view>
  7. <view wx:else>{{tdItem.value}}</view>
  8. </view>
  9. <view>
  10. {{tdItem.title}}
  11. </view>
  12. </view>
  13. </view>
  14. <view class="header">
  15. <view style="width:34rpx;"></view>
  16. <view style="width: calc(100% - 34rpx);display: flex;">
  17. <view style="{{'width:'+colItem.width+';text-align:'+(colItem.align?conItem.align:'center')}}" wx:for="{{columns}}" wx:for-item="colItem" wx:for-index="colIndex" wx:key="colIndex">{{colItem.title}}</view>
  18. </view>
  19. </view>
  20. <view wx:if="{{tableData && tableData.length>0}}" class="data">
  21. <view wx:for="{{tableData}}" wx:for-item="tableDataItem" wx:for-index="tableDataIndex" wx:key="tableDataIndex" style="display: flex;background: #fff;padding: 0 19rpx;">
  22. <view style="{{'width:34rpx;position: relative;border-bottom:'+(tableDataIndex!==tableData.length-1?1:0)+'px solid #E9F0FE;display: flex;align-items: center;'}}">
  23. <image style="position: absolute;width: 28.79rpx;height: 21.81rpx;top:15rpx;left:-19rpx;" wx:if="{{tableDataIndex<=2}}" src="{{'../../../static/img/index'+(tableDataIndex+1)+'.png'}}" />
  24. <view style="font-family: 'DIN Alternate';font-style: normal;font-weight: 700;font-size: 9px;color: #1B365D;" wx:else>{{tableDataIndex<=8?('0'+(tableDataIndex+1)):(tableDataIndex+1)}}</view>
  25. </view>
  26. <view style="width: calc(100% - 34rpx);display: flex;">
  27. <view class="cell" style="{{'width:'+col2Item.width+';border-bottom:'+(tableDataIndex!==tableData.length-1?1:0)+'px solid #E9F0FE;text-align:'+(col2Item.align?con2Item.align:'center')}}" wx:for="{{columns}}" wx:for-item="col2Item" wx:for-index="col2Index" wx:key="col2Index">
  28. <span wx:if="{{col2Item.type === 'amount'}}" style="display: inline-block;text-align: left;word-break: break-all;">
  29. <text style="font-size: 10px;" wx:if="{{(tableDataItem[col2Item.name] || tableDataItem[col2Item.name] === 0)}}">¥</text>
  30. {{tableDataItem[col2Item.name] ? numberFormat.toThousandCents(tableDataItem[col2Item.name]) : (!col2Item.ifNull?'0.00':col2Item.ifNull)}}
  31. </span>
  32. <span wx:else style="display: inline-block;text-align: left;word-break: break-all;">
  33. {{col2Item.before && (tableDataItem[col2Item.name] || tableDataItem[col2Item.name]===0)?col2Item.before:''}}
  34. {{(tableDataItem[col2Item.name] || tableDataItem[col2Item.name]===0)?tableDataItem[col2Item.name]:(col2Item.ifNull?col2Item.ifNull:'')}}
  35. {{col2Item.after && (tableDataItem[col2Item.name] || tableDataItem[col2Item.name]===0)?col2Item.after:''}}
  36. </span>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view wx:else style="line-height: 200rpx;color: #95A8CB;width:100%;font-family: 'PingFang SC';font-style: normal;font-weight: 400;font-size: 14px;background:#fff;text-align: center;">
  42. <view>暂无数据</view>
  43. </view>
  44. </view>
  45. <view style="width:100%;height:15rpx;border-radius: 0px 0px 15rpx 15rpx;background: #fff;"></view>