|
|
<!--miniprogram/pages/community/community.wxml-->
|
|
|
<wxs module="func">
|
|
|
var transtime=function(dateTime){
|
|
|
var dateTimeStamp =getDate(dateTime);
|
|
|
var result = '';
|
|
|
var minute = 1000 * 60;
|
|
|
var hour = minute * 60;
|
|
|
var day = hour * 24;
|
|
|
var halfamonth = day * 15;
|
|
|
var month = day * 30;
|
|
|
var year = day * 365;
|
|
|
var now = getDate();
|
|
|
var diffValue = now - dateTimeStamp;
|
|
|
if (diffValue < 0) {
|
|
|
return;
|
|
|
}
|
|
|
var monthEnd = diffValue / month;
|
|
|
var weekEnd = diffValue / (7 * day);
|
|
|
var dayEnd = diffValue / day;
|
|
|
var hourEnd = diffValue / hour;
|
|
|
var minEnd = diffValue / minute;
|
|
|
var yearEnd = diffValue / year;
|
|
|
if (yearEnd >= 1) {
|
|
|
result = dateTime;
|
|
|
} else if (monthEnd >= 1) {
|
|
|
result = dateTime;
|
|
|
} else if (dayEnd >= 4) {
|
|
|
result = dateTime;
|
|
|
} else if ((dayEnd >= 1)&&(dayEnd<=3)){
|
|
|
result = "" + parseInt(dayEnd) + "天前";
|
|
|
} else if (hourEnd >= 1) {
|
|
|
result = "" + parseInt(hourEnd) + "小时前";
|
|
|
} else if (minEnd >= 1) {
|
|
|
result = "" + parseInt(minEnd) + "分钟前";
|
|
|
} else {
|
|
|
result = "刚刚";
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
module.exports.transtime = transtime
|
|
|
</wxs>
|
|
|
<view class="container2" >
|
|
|
<view class="search">
|
|
|
<view class="search2">
|
|
|
<view class="search-input"><input placeholder="输入关键字搜索" bindinput="inputchange" value="{{inputcon}}"/></view>
|
|
|
<view class="search-submit"><image src="../../images/ss.png" bindtap="search"></image></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="menu">
|
|
|
<view class="{{new_}}" bindtap="menu_new">论坛</view>
|
|
|
<view class="{{hot_}}" bindtap="menu_hot">视频</view>
|
|
|
<picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}" name="type" style="display:inline-block">
|
|
|
<view class="picker" >
|
|
|
筛选
|
|
|
</view>
|
|
|
</picker>
|
|
|
<view class="backtop" bindtap="backtop">
|
|
|
回到顶部
|
|
|
</view>
|
|
|
</view>
|
|
|
<view wx:if="{{new_}}" class="forum" >
|
|
|
<scroll-view scroll-y="true" bindscrolltolower="lower" scroll-top="{{main_top}}" refresher-enabled="true" bindrefresherrefresh="refresh" refresher-triggered="{{isrefresh}}" style="height:1100rpx">
|
|
|
<view class="content" wx:for="{{content}}" wx:key="index">
|
|
|
<view class="num">
|
|
|
<view>{{index<9?'0'+(index+1):index+1}}</view>
|
|
|
</view>
|
|
|
<view class="content2" bindtap="detail" data-index="{{index}}">
|
|
|
<text class="title">#{{item.type}}</text>
|
|
|
<image class="title_img" wx:if="{{item.type=='二手闲置'}}" src="../../images/recycle.png"></image>
|
|
|
<image class="title_img" wx:if="{{item.type=='兼职实习'}}" src="../../images/partjob.png"></image>
|
|
|
<image class="title_img" wx:if="{{item.type=='校园资讯'}}" src="../../images/college.png"></image>
|
|
|
<text class="title">#{{item.z_type}}\n</text>
|
|
|
<text class="message" wx:if="{{item.type=='二手闲置'}}">
|
|
|
{{item.recycle.obj_name+'*'+item.recycle.obj_num+':'+item.recycle.obj_price}}\n
|
|
|
</text>
|
|
|
<text class="message" wx:if="{{item.type=='兼职实习'}}">
|
|
|
{{item.partjob.unit+'-'+item.partjob.name}}\n
|
|
|
</text>
|
|
|
<text class="message" wx:if="{{item.type=='校园资讯'}}">{{item.college}}\n</text>
|
|
|
<text class="c-time">{{func.transtime(item.date)}}</text>
|
|
|
</view>
|
|
|
<view class="img" wx:if="{{item.img}}">
|
|
|
<image src="{{item.img}}"/>
|
|
|
</view>
|
|
|
<view class="con-bottom">
|
|
|
<view class="good" bindtap="good" data-index="{{index}}" data-id="{{item._id}}">
|
|
|
<image src="{{like[index]==1?'../../images/good-active.png':'../../images/good.png'}}"></image>
|
|
|
<text>{{item.like}}</text>
|
|
|
</view>
|
|
|
<view class="comment" bindtap="comment" data-index="{{index}}" data-id="{{item._id}}">
|
|
|
<image src="../../images/comment.png"></image>
|
|
|
<text>{{item.comment}}</text>
|
|
|
</view>
|
|
|
<view class="favor" bindtap="favor" data-index="{{index}}" data-id="{{item._id}}">
|
|
|
<image src="{{collect[index]==1?'../../images/favor-active.png':'../../images/favor.png'}}"></image>
|
|
|
<text>{{item.collect_num}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="c-bottom" style="height:500rpx">欢迎关注微信公众号:广中E专线一</view>
|
|
|
</scroll-view>
|
|
|
<button class="publish" bindtap="publish" wx:if="{{canIUseGetUserProfile}}" >
|
|
|
<image src="../../images/publish.png"></image>
|
|
|
</button>
|
|
|
</view>
|
|
|
<view wx:if="{{hot_}}">
|
|
|
<scroll-view scroll-y="true" bindscrolltolower="lower" scroll-top="{{main_top}}" refresher-enabled="true" bindrefresherrefresh="refresh1" refresher-triggered="{{isrefresh1}}" style="height:1100rpx">
|
|
|
<view class="content" wx:for="{{video}}" wx:key="index">
|
|
|
<view class="num v-num">
|
|
|
<view>{{index<9?'0'+(index+1):index+1}}</view>
|
|
|
</view>
|
|
|
<text class="title v-title">#{{item.type}}\n</text>
|
|
|
<video
|
|
|
src="{{item.src}}"
|
|
|
binderror="videoErrorCallback"
|
|
|
|
|
|
show-center-play-btn='{{false}}'
|
|
|
show-play-btn="{{true}}"
|
|
|
controls
|
|
|
picture-in-picture-mode="{{['push', 'pop']}}"
|
|
|
bindenterpictureinpicture='bindVideoEnterPictureInPicture'
|
|
|
bindleavepictureinpicture='bindVideoLeavePictureInPicture'
|
|
|
></video>
|
|
|
<view class="con-bottom">
|
|
|
<view class="good" bindtap="good_video" data-index="{{index}}" data-id="{{item._id}}">
|
|
|
<image src="{{like_video[index]==1?'../../images/good-active.png':'../../images/good.png'}}"></image>
|
|
|
<text>{{item.like_video}}</text>
|
|
|
</view>
|
|
|
<view class="comment" bindtap="comment" data-index="{{index}}" data-id="{{item._id}}">
|
|
|
<image src="../../images/comment.png"></image>
|
|
|
<text>{{item.comment}}</text>
|
|
|
</view>
|
|
|
<view class="favor" bindtap="favor_video" data-index="{{index}}" data-id="{{item._id}}">
|
|
|
<image src="{{collect_video[index]==1?'../../images/favor-active.png':'../../images/favor.png'}}"></image>
|
|
|
<text>{{item.collect_video}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="c-bottom" style="height:400rpx">欢迎关注微信公众号:广中E专线一</view>
|
|
|
</scroll-view>
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="container3 {{iscomment?'show':'none'}} " >
|
|
|
<view style="width:100%;height:38%" bindtap="close"></view>
|
|
|
<view class="comment1">
|
|
|
<scroll-view scroll-y="true" bindscrolltolower="lower2" style="height:100%">
|
|
|
<view class="c-title">全部评论</view>
|
|
|
<view class="c-content clear" wx:for="{{comment}}" >
|
|
|
<view class="c-content1">
|
|
|
<view class="h-cut">
|
|
|
<image src="{{item.img}}"></image>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
<view class="c-content2">
|
|
|
<view class="c-name">{{item.username}}</view>
|
|
|
<text>\n</text>
|
|
|
<text class="c-mess">{{item.content}}</text>
|
|
|
<text>\n</text>
|
|
|
<view class="c-time">{{func.transtime(item.date)}}</view>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
<view class="c-bottom" style="height:200rpx">{{comment==''?'还没有人评论过,快来抢沙发吧~':'欢迎关注微信公众号:中医专线'}}</view>
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
<form catchsubmit="formSubmit">
|
|
|
<view class="input">
|
|
|
<view class="input1">
|
|
|
<textarea type="text" name="com_content" value="{{commentinput}}"
|
|
|
style="height:68rpx;line-height:10rpx;width:auto"></textarea>
|
|
|
</view>
|
|
|
<button class="input2" wx:if="{{canIUseGetUserProfile&&!getprofile}}" bindtap="getUserProfile">评论</button>
|
|
|
<button class="input2" wx:if="{{canIUseGetUserProfile&&getprofile}}" formType="submit">评论</button>
|
|
|
</view>
|
|
|
</form>
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|