myworks.wxml 4.6 KB

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