Browse Source

优化

master
zhaoyongnian 5 years ago
parent
commit
d8332ccd6c
  1. 3
      subpages/heart/pages/heartDetail/heartDetail.js
  2. 186
      subpages/heart/pages/heartDetail/heartDetail.wxml
  3. 12
      subpages/heart/pages/heartDetail/heartDetail.wxss

3
subpages/heart/pages/heartDetail/heartDetail.js

@ -24,8 +24,10 @@ Page({
cancelSignupTipVisible: false, cancelSignupTipVisible: false,
selectedTab:'',//用来判断详情是否显示志愿者打卡 selectedTab:'',//用来判断详情是否显示志愿者打卡
preloadVisible: true, preloadVisible: true,
timeJudge:false,//根据当前时间比较活动结束时间,判断活动是否已经结束,用以判断显示订单多多里面的志愿者
}, },
onLoad: function(options) { onLoad: function(options) {
console.log("当前时间"+getTimestamp())
this.setData({ this.setData({
id: options.id, id: options.id,
actCurrentState: options.actcurrentstate, actCurrentState: options.actcurrentstate,
@ -50,6 +52,7 @@ Page({
actStartTime: res.data.actStartTime.substring(0, 16), actStartTime: res.data.actStartTime.substring(0, 16),
actEndTime: res.data.actEndTime.substring(0, 16), actEndTime: res.data.actEndTime.substring(0, 16),
signupEndTime: res.data.signupEndTime.substring(0, 16), signupEndTime: res.data.signupEndTime.substring(0, 16),
timeJudge: getTimestamp() > res.data.actEndTime.substring(0, 16) ? true : false,
preloadVisible:false preloadVisible:false
}) })
} }

186
subpages/heart/pages/heartDetail/heartDetail.wxml

@ -8,7 +8,7 @@
<view class="{{detail.title.length < 32 ? 'position-absolute-top1' : 'position-absolute-top2'}} position-absolute"> <view class="{{detail.title.length < 32 ? 'position-absolute-top1' : 'position-absolute-top2'}} position-absolute">
<!-- 点击进入活动页面详情只显示志愿者打卡内容,志愿者打卡以上的内容去掉,用新闻稿替代。 --> <!-- 点击进入活动页面详情只显示志愿者打卡内容,志愿者打卡以上的内容去掉,用新闻稿替代。 -->
<block wx:if="{{selectedTab != 'tab2' || detail.currentUserStatus != 6}}"> <block wx:if="{{selectedTab != 'tab2'}}">
<!-- 详细内容 --> <!-- 详细内容 -->
<view class="info"> <view class="info">
<view class="info-box"> <view class="info-box">
@ -105,7 +105,7 @@
</view> </view>
<!-- 活动详情 --> <!-- 活动详情 -->
<view <view
class="require {{detail.currentUserStatus == 0||detail.currentUserStatus == 1||detail.currentUserStatus == 2||detail.currentUserStatus == 3? 'margin-bottom':''}}"> class="require {{selectedTab == 'tab0' && detail.currentUserStatus != 6 && timeJudge ? 'margin-bottom' : ''}} {{detail.currentUserStatus == 0||detail.currentUserStatus == 1||detail.currentUserStatus == 2||detail.currentUserStatus == 3? 'margin-bottom':''}}">
<view class="info-box-title"> <view class="info-box-title">
<view class="info-left"> <view class="info-left">
<image src="../../images/xiangqing.png"></image> <image src="../../images/xiangqing.png"></image>
@ -128,74 +128,150 @@
<!-- 志愿者打卡 --> <!-- 志愿者打卡 -->
<!-- selectedTab==tab0 说明从订单多多列表跳转过来的,对于已经结束的活动,页面不显示志愿者打卡的内容,其他内容保留留 --> <!-- selectedTab==tab0 说明从订单多多列表跳转过来的,对于已经结束的活动,页面不显示志愿者打卡的内容,其他内容保留留 -->
<block wx:if="{{selectedTab != 'tab0' || detail.currentUserStatus != 6}}"> <block wx:if="{{selectedTab == 'tab0'}}">
<block <!-- tab==6肯定不显示 -->
wx:if="{{detail.currentUserStatus == 4 || detail.currentUserStatus == 5 || detail.currentUserStatus == 6 || detail.currentUserStatus == 7 || detail.currentUserStatus == 8 || detail.currentUserStatus == 9}}"> <block wx:if = "{{detail.currentUserStatus != 6}}">
<view class="require {{detail.currentUserStatus == 4||detail.currentUserStatus == 5? 'margin-bottom':''}}"> <!-- timeJudge 为true 说明当前时间大于活动结束时间 -->
<view class="info-box-title"> <block wx:if="{{!timeJudge}}">
<view class="info-left"> <block
<image src="../../images/ren_red.png"></image> wx:if="{{detail.currentUserStatus == 4 || detail.currentUserStatus == 5 || detail.currentUserStatus == 6 || detail.currentUserStatus == 7 || detail.currentUserStatus == 8 || detail.currentUserStatus == 9}}">
<view class="info-font-zhaomu display-inline">志愿者打卡</view> <view class="require {{detail.currentUserStatus == 4||detail.currentUserStatus == 5? 'margin-bottom':''}}">
</view> <view class="info-box-title">
<view class="info-right volunteer"> <view class="info-left">
{{clockNum}}次 <image src="../../images/ren_red.png"></image>
<view class="info-font-zhaomu display-inline">志愿者打卡</view>
</view>
<view class="info-right volunteer">
{{clockNum}}次
</view>
</view> </view>
</view>
<!-- 志愿者打卡列表循环 --> <!-- 志愿者打卡列表循环 -->
<!-- info-box-volunteer-last --> <!-- info-box-volunteer-last -->
<block wx:for="{{clocks}}" wx:key="index"> <block wx:for="{{clocks}}" wx:key="index">
<view class="info-box-volunteer"> <view class="info-box-volunteer">
<!-- <view class="info-box-volunteer-ph"></view> --> <!-- <view class="info-box-volunteer-ph"></view> -->
<image class="info-box-volunteer-ph" src="{{item.faceImg}}"></image> <image class="info-box-volunteer-ph" src="{{item.faceImg}}"></image>
<view class="info-box-volunteer-name"> <view class="info-box-volunteer-name">
<view class="info-box-volunteer-name-t">{{item.nickname}}</view> <view class="info-box-volunteer-name-t">{{item.nickname}}</view>
<view class="info-box-volunteer-name-b">{{item.createdTime}}</view> <view class="info-box-volunteer-name-b">{{item.createdTime}}</view>
</view>
<view class="info-box-volunteer-content">
<text>{{item.clockDesc}}</text>
</view>
<!-- <view wx:if='{{item.images.length > 0 }}' class="photo">
<block wx:for="{{item.images}}" wx:key="index" wx:for-index="index" wx:for-item="val">
<image data-src="{{val}}" data-list="{{item.images}}" bindtap="preViewImage" class="image-a" src="{{val}}"></image>
</block>
</view> -->
<view class="photo">
<!-- 只有一张图片的时候 -->
<block wx:if='{{item.images.length == 1 }}'>
<image data-src="{{item.images[0]}}" data-list="{{item.images}}" bindtap="preViewImage"
src="{{item.images[0]}}" class="photo-one"></image>
</block>
<!-- 有两张图片时的布局 -->
<block wx:if='{{item.images.length == 2 }}'>
<block wx:for="{{item.images}}" wx:key="index" wx:for-index="index" wx:for-item="val">
<image data-src="{{val}}" data-list="{{item.images}}" bindtap="preViewImage" src="{{val}}"
class="{{index==0 ? 'photo-two-left' : 'photo-two-right'}}"></image>
</block>
</block>
<!-- 有三张图片时的布局 -->
<block wx:if='{{item.images.length == 3 }}'>
<block wx:for="{{item.images}}" wx:key="index" wx:for-index="index" wx:for-item="val">
<image data-src="{{val}}" data-list="{{item.images}}" bindtap="preViewImage" src="{{val}}"
class="{{index==0 ? 'photo-three-left' : index==1 ? 'photo-three-center' : index==2 ? 'photo-three-right' : ''}}">
</image>
</block>
</block>
</view>
<view class="clear"></view>
</view>
</block>
<!-- 志愿者打卡列表循环**********end*************** -->
</view>
<!-- 志愿者打卡 *************** end **************** -->
</block>
</block>
</block>
</block>
<!-- 精彩说说的情况下 -->
<block wx:else>
<block
wx:if="{{detail.currentUserStatus == 4 || detail.currentUserStatus == 5 || detail.currentUserStatus == 6 || detail.currentUserStatus == 7 || detail.currentUserStatus == 8 || detail.currentUserStatus == 9}}">
<view class="require {{detail.currentUserStatus == 4||detail.currentUserStatus == 5? 'margin-bottom':''}}">
<view class="info-box-title">
<view class="info-left">
<image src="../../images/ren_red.png"></image>
<view class="info-font-zhaomu display-inline">志愿者打卡</view>
</view> </view>
<view class="info-box-volunteer-content"> <view class="info-right volunteer">
<text>{{item.clockDesc}}</text> {{clockNum}}次
</view> </view>
<!-- <view wx:if='{{item.images.length > 0 }}' class="photo"> </view>
<block wx:for="{{item.images}}" wx:key="index" wx:for-index="index" wx:for-item="val">
<image data-src="{{val}}" data-list="{{item.images}}" bindtap="preViewImage" class="image-a" src="{{val}}"></image>
</block>
</view> -->
<view class="photo">
<!-- 只有一张图片的时候 --> <!-- 志愿者打卡列表循环 -->
<block wx:if='{{item.images.length == 1 }}'> <!-- info-box-volunteer-last -->
<image data-src="{{item.images[0]}}" data-list="{{item.images}}" bindtap="preViewImage" <block wx:for="{{clocks}}" wx:key="index">
src="{{item.images[0]}}" class="photo-one"></image> <view class="info-box-volunteer">
</block> <!-- <view class="info-box-volunteer-ph"></view> -->
<!-- 有两张图片时的布局 --> <image class="info-box-volunteer-ph" src="{{item.faceImg}}"></image>
<block wx:if='{{item.images.length == 2 }}'> <view class="info-box-volunteer-name">
<view class="info-box-volunteer-name-t">{{item.nickname}}</view>
<view class="info-box-volunteer-name-b">{{item.createdTime}}</view>
</view>
<view class="info-box-volunteer-content">
<text>{{item.clockDesc}}</text>
</view>
<!-- <view wx:if='{{item.images.length > 0 }}' class="photo">
<block wx:for="{{item.images}}" wx:key="index" wx:for-index="index" wx:for-item="val"> <block wx:for="{{item.images}}" wx:key="index" wx:for-index="index" wx:for-item="val">
<image data-src="{{val}}" data-list="{{item.images}}" bindtap="preViewImage" src="{{val}}" <image data-src="{{val}}" data-list="{{item.images}}" bindtap="preViewImage" class="image-a" src="{{val}}"></image>
class="{{index==0 ? 'photo-two-left' : 'photo-two-right'}}"></image>
</block> </block>
</block> </view> -->
<!-- 有三张图片时的布局 -->
<block wx:if='{{item.images.length == 3 }}'>
<block wx:for="{{item.images}}" wx:key="index" wx:for-index="index" wx:for-item="val">
<image data-src="{{val}}" data-list="{{item.images}}" bindtap="preViewImage" src="{{val}}"
class="{{index==0 ? 'photo-three-left' : index==1 ? 'photo-three-center' : index==2 ? 'photo-three-right' : ''}}">
</image>
<view class="photo">
<!-- 只有一张图片的时候 -->
<block wx:if='{{item.images.length == 1 }}'>
<image data-src="{{item.images[0]}}" data-list="{{item.images}}" bindtap="preViewImage"
src="{{item.images[0]}}" class="photo-one"></image>
</block> </block>
</block> <!-- 有两张图片时的布局 -->
<block wx:if='{{item.images.length == 2 }}'>
<block wx:for="{{item.images}}" wx:key="index" wx:for-index="index" wx:for-item="val">
<image data-src="{{val}}" data-list="{{item.images}}" bindtap="preViewImage" src="{{val}}"
class="{{index==0 ? 'photo-two-left' : 'photo-two-right'}}"></image>
</block>
</block>
<!-- 有三张图片时的布局 -->
<block wx:if='{{item.images.length == 3 }}'>
<block wx:for="{{item.images}}" wx:key="index" wx:for-index="index" wx:for-item="val">
<image data-src="{{val}}" data-list="{{item.images}}" bindtap="preViewImage" src="{{val}}"
class="{{index==0 ? 'photo-three-left' : index==1 ? 'photo-three-center' : index==2 ? 'photo-three-right' : ''}}">
</image>
</block>
</block>
</view>
<view class="clear"></view>
</view> </view>
<view class="clear"></view> </block>
</view>
</block>
<!-- 志愿者打卡列表循环**********end*************** --> <!-- 志愿者打卡列表循环**********end*************** -->
</view> </view>
<!-- 志愿者打卡 *************** end **************** --> <!-- 志愿者打卡 *************** end **************** -->
</block> </block>
</block> </block>
</view> </view>
<view class="bottom" <view class="bottom"

12
subpages/heart/pages/heartDetail/heartDetail.wxss

@ -1,7 +1,6 @@
page { page{
background: #f7f7f7; background: #f7f7f7;
} }
.container { .container {
width: 100%; width: 100%;
} }
@ -246,7 +245,6 @@ page {
color: rgba(153, 153, 153, 1); color: rgba(153, 153, 153, 1);
margin-top: 10rpx; margin-top: 10rpx;
} }
.info-box-volunteer { .info-box-volunteer {
width: 100wh; width: 100wh;
height: auto; height: auto;
@ -254,7 +252,6 @@ page {
padding: 26rpx 0rpx; padding: 26rpx 0rpx;
margin: 0rpx 22rpx; margin: 0rpx 22rpx;
} }
.info-box-volunteer:last-child { .info-box-volunteer:last-child {
border: none; border: none;
} }
@ -362,7 +359,6 @@ page {
margin-left: 1%; margin-left: 1%;
border-radius: 15rpx; border-radius: 15rpx;
} }
rich-text{
rich-text { line-height: 75rpx;
line-height: 75rpx; }
}

Loading…
Cancel
Save