12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <wxs module="m1">
- function formatDate(time, flag) {
- const t = new Date(time);
- const tf = function(i){return (i < 10 ? '0' : '') + i};
- const year = t.getFullYear();
- const month = tf(t.getMonth() + 1);
- const day = tf(t.getDate());
- const hour = tf(t.getHours());
- const minute = tf(t.getMinutes());
- //console.log( month + '月' + day + '日' + hour + ':' + minute);
- if(flag == 1) {
- return month + '月' + day + '日' + ' ' + hour + ':' + minute;
- }else if(flag == 2) {
- return year + '-' + month + '-' + day
- }else if(flag == 3){
- return month + '-' + day + ' ' + hour + ':' + minute;
- }
- }
- module.exports.formatDate = formatDate;
- </wxs>
- <view class='walletDetails'>
- <view class="walletDetails-center">
- <view class='walletDetails-info' wx:for="{{ walletDatails }}" wx:key="{{ index }}">
- <view class="walletDetails-left">
- <view class='avatar-box'>
- <image src="../../../static/image/walletdetails.png" />
- </view>
- <view class="avatar-info">
- <text class="avatar-doc">{{ item.description }}</text>
- <text class="avatar-time"></text>
- </view>
- </view>
- <view class="walletDetails-right">
- <view class="avatar-value-pos" wx:if="{{ item.type === 'INCOME' }}">
- <text class="avatar-symbol">+</text>
- <text>{{ item.price }}</text>
- </view>
- <view class="avatar-value-neg" wx:else>
- <text class="avatar-symbol">-</text>
- <text>{{ item.price }}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
|