|
@@ -1,52 +1,32 @@
|
|
|
<!--pages/user/myworks/myworks.wxml-->
|
|
|
-<wxs module="wxs">
|
|
|
- function formatDate(time) {
|
|
|
- var t = getDate(time);
|
|
|
- var tf = function(i){return (i < 10 ? '0' : '') + i};
|
|
|
- var year = t.getFullYear();
|
|
|
- var month = tf(t.getMonth() + 1);
|
|
|
- var day = tf(t.getDate());
|
|
|
- var hour = tf(t.getHours());
|
|
|
- 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>
|
|
|
+<wxs src="../../commonWxs/format.wxs" module="format" />
|
|
|
<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>
|
|
|
+ <image class='avatar-image' src='{{ wareCards.user.avatar }}'></image>
|
|
|
</view>
|
|
|
- <view class='occupation-title'>{{ wareCards[0].user.profession }}</view>
|
|
|
+ <view class='occupation-title'>{{ wareCards.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 }}'>
|
|
|
+ <text>{{ wareCards.user.wechatName }}</text>
|
|
|
+ <view class='flowers-box' wx:if='{{ wareCards.user.gender === 2 }}'>
|
|
|
<image src='../../../static/image/flowers.png'></image>
|
|
|
</view>
|
|
|
- <view class='flowers-box' wx:else>
|
|
|
+ <view class='flowers-box' wx:elif='{{ wareCards.user.gender === 1 }}'>
|
|
|
<image src='../../../static/image/boy.png'></image>
|
|
|
</view>
|
|
|
+ <view wx:else class='gender-size'>未知</view>
|
|
|
</view>
|
|
|
- <view class='avatar-birthday'>{{ wxs.getBirthday(wareCards[0].user.birthday) }}</view>
|
|
|
- <view class='avatar-address'>{{ wareCards[0].user.schoolName }}</view>
|
|
|
+ <view class='avatar-birthday'>{{ format.getBirthday(wareCards.user.birthday) }}</view>
|
|
|
+ <view class='avatar-address'>{{ wareCards.user.schoolName }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class='mine-category'>
|
|
|
<view class='play-count'>
|
|
|
- <view>{{ wareCards[0].userRead.playAmount }}</view>
|
|
|
+ <view>{{ wareCards.playAmount || 0 }}</view>
|
|
|
<view class='border-right'>
|
|
|
<view class='play-img'>
|
|
|
<image src='../../../static/image/play.png'></image>
|
|
@@ -55,7 +35,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class='follow-count'>
|
|
|
- <view class='color'>{{ wareCards[0].userRead.fansAmount || 0 }}</view>
|
|
|
+ <view class='color'>{{ wareCards.fansAmount || 0 }}</view>
|
|
|
<view class='border-right'>
|
|
|
<view class='play-img'>
|
|
|
<image src='../../../static/image/follow.png'></image>
|
|
@@ -64,7 +44,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class='point-count'>
|
|
|
- <view class='color'>{{ wareCards[0].userRead.likeAmount || 0 }}</view>
|
|
|
+ <view class='color'>{{ wareCards.likeAmount || 0 }}</view>
|
|
|
<view class='border-right'>
|
|
|
<view class='play-img'>
|
|
|
<image src='../../../static/image/point.png'></image>
|
|
@@ -73,7 +53,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class='flower-count'>
|
|
|
- <view class='color'>{{ wareCards[0].userRead.pointAmount || 0 }}</view>
|
|
|
+ <view class='color'>{{ wareCards.pointAmount || 0 }}</view>
|
|
|
<view class='border-right'>
|
|
|
<view class='play-img'>
|
|
|
<image src='../../../static/image/flower.png'></image>
|
|
@@ -83,7 +63,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class='works-article' wx:for="{{ wareCards }}" wx:key="{{ index }}">
|
|
|
+ <view class='works-article' wx:for="{{ worksList }}" wx:key="{{ index }}">
|
|
|
<view class='user-info'>
|
|
|
<view class='user-img'>
|
|
|
<image src='{{ item.user.avatar }}'></image>
|
|
@@ -99,7 +79,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class='user-name'>
|
|
|
- <view class='left-detail'>{{ wxs.formatDate(item.userRead.gmtCreated) || 0 }}</view>
|
|
|
+ <view class='left-detail'>{{ format.formatDate(item.userRead.gmtCreated) || 0 }}</view>
|
|
|
<view class='right-detail'>
|
|
|
<view class='point-img'>
|
|
|
<image src='../../../static/image/like.png'></image>
|