myconcern.wxml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <wxs module="wxs">
  2. function formatDate(time) {
  3. console.log(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. module.exports.formatDate = formatDate;
  14. </wxs>
  15. <view class='my-concern'>
  16. <view class="concern-center">
  17. <view class='concern-info' wx:for="{{ fanList }}" wx:key="{{ index }}" bindtap='toUserDetails' data-uid='{{ item.user.uid }}' data-fanId='{{ item.fans.fanId }}'>
  18. <view class='avatar-box'>
  19. <image class='avatar-image' src="{{ item.user.avatar }}" />
  20. </view>
  21. <view class="avatar-name">
  22. <text class="nickName">{{ item.user.wechatName }}</text>
  23. <text class="time">{{ wxs.formatDate(item.fans.gmtCreated) }}</text>
  24. </view>
  25. <view class="avatar-follow" wx:if='{{ item.isEachOther }}'>
  26. <view class='avatar-img'>
  27. <image class='avatar-images' src="../../../static/image/concernback.png" />
  28. </view>
  29. <view class="follow-status">相互关注</view>
  30. </view>
  31. <view class="avatar-follow" wx:elif='{{ item.followBack === item.followBack || item.isEachOther }}'>
  32. <view class='avatar-img'>
  33. <image class='avatar-images' src="../../../static/image/concerned.png" />
  34. </view>
  35. <view class="follow-status">已关注</view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>