|
@@ -1,7 +1,6 @@
|
|
|
<!--pages/user/myworks/myworks.wxml-->
|
|
|
<wxs module="wxs">
|
|
|
function formatDate(time) {
|
|
|
- console.log(time);
|
|
|
var t = getDate(time);
|
|
|
var tf = function(i){return (i < 10 ? '0' : '') + i};
|
|
|
var year = t.getFullYear();
|
|
@@ -11,41 +10,111 @@
|
|
|
var minute = tf(t.getMinutes());
|
|
|
return month + '-' + day + ' ' + hour + ':' + minute;
|
|
|
}
|
|
|
+ function getBirthday(birthday){
|
|
|
+ var t = getDate(birthday);
|
|
|
+ var tf = function(i){return (i < 10 ? '0' : '') + i};
|
|
|
+ var year = t.getFullYear();
|
|
|
+ var month = tf(t.getMonth() + 1);
|
|
|
+ var day = tf(t.getDate());
|
|
|
+ return year + '年' + month + '月' + day + '日';
|
|
|
+ }
|
|
|
module.exports.formatDate = formatDate;
|
|
|
+ module.exports.getBirthday = getBirthday;
|
|
|
</wxs>
|
|
|
<view class='user-works'>
|
|
|
+ <view class='follow-details'>
|
|
|
+ <view class='follow-info'>
|
|
|
+ <view class='avatar-bg'>
|
|
|
+ <view class='avatar-box'>
|
|
|
+ <image class='avatar-image' src='{{ wareCards[0].user.avatar }}'></image>
|
|
|
+ </view>
|
|
|
+ <view class='occupation-title'>{{ wareCards[0].user.profession }}</view>
|
|
|
+ </view>
|
|
|
+ <view class='avatar-msg'>
|
|
|
+ <view class='avatar-nickname'>
|
|
|
+ <text>{{ wareCards[0].user.wechatName }}</text>
|
|
|
+ <view class='flowers-box' wx:if='{{ true }}'>
|
|
|
+ <image src='../../../static/image/flowers.png'></image>
|
|
|
+ </view>
|
|
|
+ <view class='flowers-box' wx:else>
|
|
|
+ <image src='../../../static/image/boy.png'></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class='avatar-birthday'>{{ wxs.getBirthday(wareCards[0].user.birthday) }}</view>
|
|
|
+ <view class='avatar-address'>{{ wareCards[0].user.schoolName }}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class='mine-category'>
|
|
|
+ <view class='play-count'>
|
|
|
+ <view>{{ wareCards[0].userRead.playAmount }}</view>
|
|
|
+ <view class='border-right'>
|
|
|
+ <view class='play-img'>
|
|
|
+ <image src='../../../static/image/play.png'></image>
|
|
|
+ </view>
|
|
|
+ <text>播放量</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class='follow-count'>
|
|
|
+ <view class='color'>{{ wareCards[0].userRead.fansAmount || 0 }}</view>
|
|
|
+ <view class='border-right'>
|
|
|
+ <view class='play-img'>
|
|
|
+ <image src='../../../static/image/follow.png'></image>
|
|
|
+ </view>
|
|
|
+ <text>关注</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class='point-count'>
|
|
|
+ <view class='color'>{{ wareCards[0].userRead.likeAmount || 0 }}</view>
|
|
|
+ <view class='border-right'>
|
|
|
+ <view class='play-img'>
|
|
|
+ <image src='../../../static/image/point.png'></image>
|
|
|
+ </view>
|
|
|
+ <text>赞</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class='flower-count'>
|
|
|
+ <view class='color'>{{ wareCards[0].userRead.pointAmount || 0 }}</view>
|
|
|
+ <view class='border-right'>
|
|
|
+ <view class='play-img'>
|
|
|
+ <image src='../../../static/image/flower.png'></image>
|
|
|
+ </view>
|
|
|
+ <text>红花</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view class='works-article' wx:for="{{ wareCards }}" wx:key="{{ index }}">
|
|
|
<view class='user-info'>
|
|
|
- <view class='avatar-img'>
|
|
|
+ <view class='user-img'>
|
|
|
<image src='{{ item.user.avatar }}'></image>
|
|
|
</view>
|
|
|
- <view>
|
|
|
- <view class='user-name'>{{ item.user.wechatName }}</view>
|
|
|
- <view class='user-time'>{{ wxs.formatDate(item.userRead.gmtCreated) }}</view>
|
|
|
+ <view class='user-details'>
|
|
|
+ <view class='user-name'>
|
|
|
+ <view class='left-detail'>{{ item.user.wechatName }}</view>
|
|
|
+ <view class='right-detail'>
|
|
|
+ <view class='play-img'>
|
|
|
+ <image src='../../../static/image/hotPlays.png'></image>
|
|
|
+ </view>
|
|
|
+ <text class='plays-count'>{{ item.userRead.playAmount || 0 }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class='user-name'>
|
|
|
+ <view class='left-detail'>{{ wxs.formatDate(item.userRead.gmtCreated) || 0 }}</view>
|
|
|
+ <view class='right-detail'>
|
|
|
+ <view class='point-img'>
|
|
|
+ <image src='../../../static/image/like.png'></image>
|
|
|
+ </view>
|
|
|
+ <text class='likes-count'>{{ item.userRead.likeAmount }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class='video-preview' bindtap='toMyWorks' data-id='{{ item.userRead.id }}' data-title='{{ item.userRead.title }}'>
|
|
|
<image src='{{ item.userRead.iconImg }}'></image>
|
|
|
</view>
|
|
|
<view class='content-title'>
|
|
|
- {{ item.userRead.title }}
|
|
|
- </view>
|
|
|
- <view class='content-detail'>
|
|
|
- <view class='left'>{{ item.userRead.summary }}</view>
|
|
|
- <view class='right'>
|
|
|
- <view class='right-detail'>
|
|
|
- <view class='play-img'>
|
|
|
- <image src='../../../static/image/hotPlays.png'></image>
|
|
|
- </view>
|
|
|
- <text>{{ item.userRead.playAmount }}</text>
|
|
|
- </view>
|
|
|
- <view class='right-detail'>
|
|
|
- <view class='point-img'>
|
|
|
- <image src='../../../static/image/like.png'></image>
|
|
|
- </view>
|
|
|
- <text>{{ item.userRead.likeAmount }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <view>{{ item.userRead.title }}</view>
|
|
|
+ <view class='content-grage'>{{ item.userRead.summary }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|