walletDetails.wxml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. function parseDouble(number) {
  8. return parseFloat(number).toFixed(2);
  9. }
  10. module.exports.formatDate = formatDate;
  11. module.exports.parseDouble = parseDouble;
  12. </wxs>
  13. <view class='walletDetails'>
  14. <view class="walletDetails-center">
  15. <view class='walletDetails-info' wx:for="{{ walletDatails }}" wx:key="{{ index }}">
  16. <view class="walletDetails-left">
  17. <view class='avatar-box'>
  18. <image src="../../../static/image/walletdetails.png" />
  19. </view>
  20. <view class="avatar-info">
  21. <text class="avatar-doc">{{ item.description }}</text>
  22. <text class="avatar-time">{{wxs.formatDate(item.gmtCreated)}}</text>
  23. </view>
  24. </view>
  25. <view class="walletDetails-right">
  26. <view class="avatar-value-pos" wx:if="{{ item.type === 'INCOME' }}">
  27. <text class="avatar-symbol">+</text>
  28. <text>{{ wxs.parseDouble(item.price / 100) }}</text>
  29. </view>
  30. <view class="avatar-value-neg" wx:else>
  31. <text class="avatar-symbol">-</text>
  32. <text>{{ wxs.parseDouble(item.price / 100) }}</text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>