walletDetails.wxml 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <wxs module="wxs">
  2. function formatDate(time) {
  3. var timeTemp = getDate(time);
  4. var timeString = timeTemp.toLocaleDateString() + timeTemp.toLocaleTimeString();
  5. return timeString.replace('/','-').replace('/','-').replace('上午',' ').replace('下午',' ');
  6. }
  7. module.exports.formatDate = formatDate;
  8. </wxs>
  9. <view class='walletDetails'>
  10. <view class="walletDetails-center">
  11. <view class='walletDetails-info' wx:for="{{ walletDatails }}" wx:key="{{ index }}">
  12. <view class="walletDetails-left">
  13. <view class='avatar-box'>
  14. <image src="../../../static/image/walletdetails.png" />
  15. </view>
  16. <view class="avatar-info">
  17. <text class="avatar-doc">{{ item.description }}</text>
  18. <text class="avatar-time">{{wxs.formatDate(item.gmtCreated)}}</text>
  19. </view>
  20. </view>
  21. <view class="walletDetails-right">
  22. <view class="avatar-value-pos" wx:if="{{ item.type === 'INCOME' }}">
  23. <text class="avatar-symbol">+</text>
  24. <text>{{ item.price / 100 }}</text>
  25. </view>
  26. <view class="avatar-value-neg" wx:else>
  27. <text class="avatar-symbol">-</text>
  28. <text>{{ item.price / 100 }}</text>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>