myworks.wxml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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' wx:if='{{ true }}'>
  37. <image src='../../../static/image/flowers.png'></image>
  38. </view>
  39. <view class='flowers-box' wx:else>
  40. <image src='../../../static/image/boy.png'></image>
  41. </view>
  42. </view>
  43. <view class='avatar-birthday'>{{ wxs.getBirthday(wareCards[0].user.birthday) }}</view>
  44. <view class='avatar-address'>{{ wareCards[0].user.schoolName }}</view>
  45. </view>
  46. </view>
  47. <view class='mine-category'>
  48. <view class='play-count'>
  49. <view>{{ wareCards[0].userRead.playAmount }}</view>
  50. <view class='border-right'>
  51. <view class='play-img'>
  52. <image src='../../../static/image/play.png'></image>
  53. </view>
  54. <text>播放量</text>
  55. </view>
  56. </view>
  57. <view class='follow-count'>
  58. <view class='color'>{{ wareCards[0].userRead.fansAmount || 0 }}</view>
  59. <view class='border-right'>
  60. <view class='play-img'>
  61. <image src='../../../static/image/follow.png'></image>
  62. </view>
  63. <text>关注</text>
  64. </view>
  65. </view>
  66. <view class='point-count'>
  67. <view class='color'>{{ wareCards[0].userRead.likeAmount || 0 }}</view>
  68. <view class='border-right'>
  69. <view class='play-img'>
  70. <image src='../../../static/image/point.png'></image>
  71. </view>
  72. <text>赞</text>
  73. </view>
  74. </view>
  75. <view class='flower-count'>
  76. <view class='color'>{{ wareCards[0].userRead.pointAmount || 0 }}</view>
  77. <view class='border-right'>
  78. <view class='play-img'>
  79. <image src='../../../static/image/flower.png'></image>
  80. </view>
  81. <text>红花</text>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class='works-article' wx:for="{{ wareCards }}" wx:key="{{ index }}">
  87. <view class='user-info'>
  88. <view class='user-img'>
  89. <image src='{{ item.user.avatar }}'></image>
  90. </view>
  91. <view class='user-details'>
  92. <view class='user-name'>
  93. <view class='left-detail'>{{ item.user.wechatName }}</view>
  94. <view class='right-detail'>
  95. <view class='play-img'>
  96. <image src='../../../static/image/hotPlays.png'></image>
  97. </view>
  98. <text class='plays-count'>{{ item.userRead.playAmount || 0 }}</text>
  99. </view>
  100. </view>
  101. <view class='user-name'>
  102. <view class='left-detail'>{{ wxs.formatDate(item.userRead.gmtCreated) || 0 }}</view>
  103. <view class='right-detail'>
  104. <view class='point-img'>
  105. <image src='../../../static/image/like.png'></image>
  106. </view>
  107. <text class='likes-count'>{{ item.userRead.likeAmount }}</text>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. <view class='video-preview' bindtap='toMyWorks' data-id='{{ item.userRead.id }}' data-title='{{ item.userRead.title }}'>
  113. <image src='{{ item.userRead.iconImg }}'></image>
  114. </view>
  115. <view class='content-title'>
  116. <view>{{ item.userRead.title }}</view>
  117. <view class='content-grage'>{{ item.userRead.summary }}</view>
  118. </view>
  119. </view>
  120. </view>