myworks.wxml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <!--pages/user/myworks/myworks.wxml-->
  2. <wxs module="wxs">
  3. function formatDate(time) {
  4. var t = getDate(time);
  5. var tf = function(i){return (i < 10 ? '0' : '') + i};
  6. var year = t.getFullYear();
  7. var month = tf(t.getMonth() + 1);
  8. var day = tf(t.getDate());
  9. var hour = tf(t.getHours());
  10. var minute = tf(t.getMinutes());
  11. return month + '-' + day + ' ' + hour + ':' + minute;
  12. }
  13. function getBirthday(birthday){
  14. var t = getDate(birthday);
  15. var tf = function(i){return (i < 10 ? '0' : '') + i};
  16. var year = t.getFullYear();
  17. var month = tf(t.getMonth() + 1);
  18. var day = tf(t.getDate());
  19. return year + '年' + month + '月' + day + '日';
  20. }
  21. module.exports.formatDate = formatDate;
  22. module.exports.getBirthday = getBirthday;
  23. </wxs>
  24. <view class='user-works'>
  25. <view class='follow-details'>
  26. <view class='follow-info'>
  27. <view class='avatar-bg'>
  28. <view class='avatar-box'>
  29. <image class='avatar-image' src='{{ wareCards[0].user.avatar }}'></image>
  30. </view>
  31. <view class='occupation-title'>{{ wareCards[0].user.profession }}</view>
  32. </view>
  33. <view class='avatar-msg'>
  34. <view class='avatar-nickname'>
  35. <text>{{ wareCards[0].user.wechatName }}</text>
  36. <view class='flowers-box'>
  37. <image src='../../../static/image/flowers.png'></image>
  38. </view>
  39. </view>
  40. <view class='avatar-birthday'>{{ wxs.getBirthday(wareCards[0].user.birthday) }}</view>
  41. <view class='avatar-address'>{{ wareCards[0].user.schoolName }}</view>
  42. </view>
  43. </view>
  44. <view class='mine-category'>
  45. <view class='play-count'>
  46. <view>{{ wareCards[0].userRead.playAmount }}</view>
  47. <view class='border-right'>
  48. <view class='play-img'>
  49. <image src='../../../static/image/play.png'></image>
  50. </view>
  51. <text>播放量</text>
  52. </view>
  53. </view>
  54. <view class='follow-count'>
  55. <view class='color'>{{ wareCards[0].userRead.playAmount }}</view>
  56. <view class='border-right'>
  57. <view class='play-img'>
  58. <image src='../../../static/image/follow.png'></image>
  59. </view>
  60. <text>关注</text>
  61. </view>
  62. </view>
  63. <view class='point-count'>
  64. <view class='color'>{{ wareCards[0].userRead.likeAmount }}</view>
  65. <view class='border-right'>
  66. <view class='play-img'>
  67. <image src='../../../static/image/point.png'></image>
  68. </view>
  69. <text>赞</text>
  70. </view>
  71. </view>
  72. <view class='flower-count'>
  73. <view class='color'>{{ 100 }}</view>
  74. <view class='border-right'>
  75. <view class='play-img'>
  76. <image src='../../../static/image/flower.png'></image>
  77. </view>
  78. <text>红花</text>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view class='works-article' wx:for="{{ wareCards }}" wx:key="{{ index }}">
  84. <view class='user-info'>
  85. <view class='user-img'>
  86. <image src='{{ item.user.avatar }}'></image>
  87. </view>
  88. <view class='user-details'>
  89. <view class='user-name'>
  90. <view class='left-detail'>{{ item.user.wechatName }}</view>
  91. <view class='right-detail'>
  92. <view class='play-img'>
  93. <image src='../../../static/image/hotPlays.png'></image>
  94. </view>
  95. <text class='plays-count'>{{ item.userRead.playAmount }}</text>
  96. </view>
  97. </view>
  98. <view class='user-name'>
  99. <view class='left-detail'>{{ wxs.formatDate(item.userRead.gmtCreated) }}</view>
  100. <view class='right-detail'>
  101. <view class='point-img'>
  102. <image src='../../../static/image/like.png'></image>
  103. </view>
  104. <text class='likes-count'>{{ item.userRead.likeAmount }}</text>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. <view class='video-preview' bindtap='toMyWorks' data-id='{{ item.userRead.id }}' data-title='{{ item.userRead.title }}'>
  110. <image src='{{ item.userRead.iconImg }}'></image>
  111. </view>
  112. <view class='content-title'>
  113. <view>{{ item.userRead.title }}</view>
  114. <view class='content-grage'>{{ item.userRead.summary }}</view>
  115. </view>
  116. </view>
  117. </view>