walletDetails.wxml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <wxs module="m1">
  2. function formatDate(time, flag) {
  3. const t = new Date(time);
  4. const tf = function(i){return (i < 10 ? '0' : '') + i};
  5. const year = t.getFullYear();
  6. const month = tf(t.getMonth() + 1);
  7. const day = tf(t.getDate());
  8. const hour = tf(t.getHours());
  9. const minute = tf(t.getMinutes());
  10. //console.log( month + '月' + day + '日' + hour + ':' + minute);
  11. if(flag == 1) {
  12. return month + '月' + day + '日' + ' ' + hour + ':' + minute;
  13. }else if(flag == 2) {
  14. return year + '-' + month + '-' + day
  15. }else if(flag == 3){
  16. return month + '-' + day + ' ' + hour + ':' + minute;
  17. }
  18. }
  19. module.exports.formatDate = formatDate;
  20. </wxs>
  21. <view class='walletDetails'>
  22. <view class="walletDetails-center">
  23. <view class='walletDetails-info' wx:for="{{ walletDatails }}" wx:key="{{ index }}">
  24. <view class="walletDetails-left">
  25. <view class='avatar-box'>
  26. <image src="../../../static/image/walletdetails.png" />
  27. </view>
  28. <view class="avatar-info">
  29. <text class="avatar-doc">{{ item.description }}</text>
  30. <text class="avatar-time"></text>
  31. </view>
  32. </view>
  33. <view class="walletDetails-right">
  34. <view class="avatar-value-pos" wx:if="{{ item.type === 'INCOME' }}">
  35. <text class="avatar-symbol">+</text>
  36. <text>{{ item.price }}</text>
  37. </view>
  38. <view class="avatar-value-neg" wx:else>
  39. <text class="avatar-symbol">-</text>
  40. <text>{{ item.price }}</text>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>