myworks.wxml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <!--pages/user/myworks/myworks.wxml-->
  2. <wxs module="wxs">
  3. function formatDate(time) {
  4. console.log(time);
  5. var t = getDate(time);
  6. var tf = function(i){return (i < 10 ? '0' : '') + i};
  7. var year = t.getFullYear();
  8. var month = tf(t.getMonth() + 1);
  9. var day = tf(t.getDate());
  10. var hour = tf(t.getHours());
  11. var minute = tf(t.getMinutes());
  12. return month + '-' + day + ' ' + hour + ':' + minute;
  13. }
  14. module.exports.formatDate = formatDate;
  15. </wxs>
  16. <view class='user-works'>
  17. <view class='works-article' wx:for="{{ wareCards }}" wx:key="{{ index }}">
  18. <view class='user-info'>
  19. <view class='avatar-img'>
  20. <image src='{{ item.user.avatar }}'></image>
  21. </view>
  22. <view>
  23. <view class='user-name'>{{ item.user.wechatName }}</view>
  24. <view class='user-time'>{{ wxs.formatDate(item.userRead.gmtCreated) }}</view>
  25. </view>
  26. </view>
  27. <view class='video-preview' bindtap='toMyWorks' data-id='{{ item.userRead.id }}' data-title='{{ item.userRead.title }}'>
  28. <image src='{{ item.userRead.iconImg }}'></image>
  29. </view>
  30. <view class='content-title'>
  31. {{ item.userRead.title }}
  32. </view>
  33. <view class='content-detail'>
  34. <view class='left'>{{ item.userRead.summary }}</view>
  35. <view class='right'>
  36. <view class='right-detail'>
  37. <view class='play-img'>
  38. <image src='../../../static/image/hotPlays.png'></image>
  39. </view>
  40. <text>{{ item.userRead.playAmount }}</text>
  41. </view>
  42. <view class='right-detail'>
  43. <view class='point-img'>
  44. <image src='../../../static/image/like.png'></image>
  45. </view>
  46. <text>{{ item.userRead.likeAmount }}</text>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>