Browse Source

优化

master
zhaoyongnian 5 years ago
parent
commit
8764e82847
  1. 6
      components/activity/activity.js
  2. 1
      components/activity/activity.wxml
  3. 11
      pages/heartNew/components/volunteer/volunteer.js
  4. 2
      pages/heartNew/components/volunteer/volunteer.wxml
  5. 22
      pages/heartNew/heartNew.js
  6. 4
      pages/heartNew/heartNew.wxss
  7. 8
      subpages/heart/pages/heartDetail/heartDetail.js
  8. 152
      subpages/heart/pages/heartDetail/heartDetail.wxml
  9. 14
      subpages/heart/pages/heartDetail/heartDetail.wxss

6
components/activity/activity.js

@ -17,6 +17,9 @@ Component({
methods: {
getActivityList(params) {
let that = this
that.setData({
selectedTab: params.selectedTab
})
if (params.qkdat == true) {
console.log('清空')
that.setData({
@ -45,6 +48,7 @@ Component({
},
toActDetail(e) {
console.log('selectedTab::::'+this.data.selectedTab)
const id = e.currentTarget.dataset.id
const actcurrentstate = e.currentTarget.dataset.actcurrentstate
const signupflag = e.currentTarget.dataset.signupflag
@ -52,7 +56,7 @@ Component({
actId: id
})
wx.navigateTo({
url: `/subpages/heart/pages/heartDetail/heartDetail?id=${id}&actcurrentstate=${actcurrentstate}&signupflag=${signupflag}`
url: `/subpages/heart/pages/heartDetail/heartDetail?id=${id}&actcurrentstate=${actcurrentstate}&signupflag=${signupflag}&selectedTab=${this.data.selectedTab}`
})
},
updateActivityList(params) {

1
components/activity/activity.wxml

@ -10,6 +10,7 @@
<view class="user-state" wx:if="{{item.actCurrentState=='2'}}">未开始</view>
<view class="user-state" wx:if="{{item.actCurrentState=='3'}}">进行中</view>
<view class="user-state" wx:if="{{item.actCurrentState=='4'}}">已结束</view>
<view class="user-state" wx:if="{{item.actCurrentState=='5'}}">已取消</view>
</view>
<view class="infos">
<view class="infos_title">{{item.title}}</view>

11
pages/heartNew/components/volunteer/volunteer.js

@ -1,4 +1,5 @@
// pages/indexNew/components/volunteer/volunteer.js
const app = getApp()
Component({
/**
* 组件的属性列表
@ -21,6 +22,12 @@ Component({
* 组件的方法列表
*/
methods: {
}
preViewImage(e) {
console.log(JSON.stringify(e))
wx.previewImage({
urls: [e.currentTarget.dataset.src],
current: e.currentTarget.dataset.src
})
}
},
})

2
pages/heartNew/components/volunteer/volunteer.wxml

@ -1,5 +1,5 @@
<view class="item">
<image src="{{volunteerItemObj.faceImg}}" />
<image data-src="{{volunteerItemObj.faceImg}}" bindtap="preViewImage" src="{{volunteerItemObj.faceImg}}" />
<view class="name">{{volunteerItemObj.nickname}}</view>
<view class="autograph">{{volunteerItemObj.volunteerSignature}}</view>
</view>

22
pages/heartNew/heartNew.js

@ -52,7 +52,8 @@ Page({
pageSize: this.data.pageSize,
timestamp: getTimestamp(),
actType: 0,
qkdat: true
qkdat: true,
selectedTab:this.data.selectedTab
}
this.selectComponent("#state-0").getActivityList(parms)
},
@ -106,7 +107,8 @@ Page({
pageSize: this.data.pageSize,
timestamp: getTimestamp(),
actType: 0,//活动列表类型(0-招募令,1-精彩活动)
qkdat: true
qkdat: true,
selectedTab:e.currentTarget.dataset.tab
}
this.selectComponent("#state-0").getActivityList(parms)
} else if (e.currentTarget.dataset.tab == 'tab1') {
@ -120,7 +122,6 @@ Page({
pageIndex: this.data.indexPage,
pageSize: this.data.pageSize,
}
console.log('志愿者列表传值:'+JSON.stringify(parms))
this.volunteerlist(parms)
} else if (e.currentTarget.dataset.tab == 'tab2') {
this.setData({
@ -132,7 +133,8 @@ Page({
pageSize: this.data.pageSize,
timestamp: getTimestamp(),
actType: 1,//活动列表类型(0-招募令,1-精彩活动)
qkdat: true
qkdat: true,
selectedTab:e.currentTarget.dataset.tab
}
this.selectComponent("#state-2").getActivityList(parms)
} else if (e.currentTarget.dataset.tab == 'tab3') {
@ -157,7 +159,8 @@ Page({
pageSize: 10,
timestamp: getTimestamp(),
actType: 0,
actId: this.data.actId
actId: this.data.actId,
selectedTab:this.data.selectedTab
}
this.selectComponent("#state-0").updateActivityList(params)
} else if (this.data.selectedTab === 'tab2') {
@ -166,7 +169,8 @@ Page({
pageSize: 10,
timestamp: getTimestamp(),
actType: 1,
actId: this.data.actId
actId: this.data.actId,
selectedTab:this.data.selectedTab
}
this.selectComponent("#state-2").updateActivityList(params)
}
@ -279,7 +283,8 @@ Page({
pageIndex: this.data.indexPage,
pageSize: this.data.pageSize,
timestamp: getTimestamp(),
actType: 0
actType: 0,
selectedTab:this.data.selectedTab
}
this.selectComponent("#state-0").getActivityList(parms)
}else if(this.data.selectedTab == 'tab1'){
@ -299,7 +304,8 @@ Page({
pageIndex: this.data.indexPage,
pageSize: this.data.pageSize,
timestamp: getTimestamp(),
actType: 1
actType: 1,
selectedTab:this.data.selectedTab
}
this.selectComponent("#state-2").getActivityList(parms)
}

4
pages/heartNew/heartNew.wxss

@ -309,7 +309,7 @@ button:last-child {
}
.tab-bar .tab {
font-size: 30rpx;
font-size: 34rpx;
font-weight: 500;
color: rgba(171, 171, 171, 1);
width: 25%;
@ -322,7 +322,7 @@ button:last-child {
}
.tab-bar .tab.select {
font-size: 32rpx;
font-size: 36rpx;
font-weight: bold;
color: rgba(229, 15, 0, 1);
}

8
subpages/heart/pages/heartDetail/heartDetail.js

@ -13,6 +13,7 @@ Page({
clocks: [], //打卡列表
clockNum: 0, //打卡人次
actContent: '', //富文本
actNewsContent:'',//新闻稿
dialogTitle: '',
dialogContent: '',
dialogConfirmText: '',
@ -20,13 +21,15 @@ Page({
uservolunteerflag: '',
cancelSignupVisible: false,
cancelSignupTipValue: '',
cancelSignupTipVisible: false
cancelSignupTipVisible: false,
selectedTab:'',//用来判断详情是否显示志愿者打卡
},
onLoad: function(options) {
this.setData({
id: options.id,
actCurrentState: options.actcurrentstate,
signupFlag: options.signupflag
signupFlag: options.signupflag,
selectedTab:options.selectedTab,
})
// this.getDetail();//活动详情
// this.clockList();//打卡列表
@ -42,6 +45,7 @@ Page({
this.setData({
detail: res.data,
actContent: res.data.actContent.replace(/\<img/gi, '<img style="max-width:100%;height:auto"'),
actNewsContent:res.data.actNewsContent.replace(/\<img/gi, '<img style="max-width:100%;height:auto"'),
actStartTime: res.data.actStartTime.substring(0, 16),
actEndTime: res.data.actEndTime.substring(0, 16),
signupEndTime: res.data.signupEndTime.substring(0, 16),

152
subpages/heart/pages/heartDetail/heartDetail.wxml

@ -6,7 +6,9 @@
<view class="top-font">{{detail.title}}</view>
<view class="{{detail.title.length < 32 ? 'position-absolute-top1' : 'position-absolute-top2'}} position-absolute">
<!-- 详细内容 -->
<!-- 点击进入活动页面详情只显示志愿者打卡内容,志愿者打卡以上的内容去掉,用新闻稿替代。 -->
<block wx:if="{{selectedTab != 'tab2' || detail.currentUserStatus != 6}}">
<!-- 详细内容 -->
<view class="info">
<view class="info-box">
<view class="info-left">
@ -91,7 +93,7 @@
<view class="clear"></view>
</view>
</view>
<!-- 招募要求 -->
<!-- 招募要求 -->
<view class="require">
<view class="info-box-title">
<view class="info-left">
@ -111,8 +113,9 @@
3. 专业不限,具有美术教育者优先。
</view> -->
</view>
<!-- 活动详情 -->
<view class="require {{detail.currentUserStatus == 0||detail.currentUserStatus == 1||detail.currentUserStatus == 2||detail.currentUserStatus == 3? 'margin-bottom':''}}">
<!-- 活动详情 -->
<view
class="require {{detail.currentUserStatus == 0||detail.currentUserStatus == 1||detail.currentUserStatus == 2||detail.currentUserStatus == 3? 'margin-bottom':''}}">
<view class="info-box-title">
<view class="info-left">
<image src="../../images/xiangqing.png"></image>
@ -124,74 +127,102 @@
<rich-text space="nbsp" nodes="{{actContent}}"></rich-text>
</view>
</view>
<!-- 志愿者打卡 -->
<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 class="info-right volunteer">
{{clockNum}}次
</view>
<view class="clear"></view>
</block>
<block wx:else>
<!-- 新闻稿 -->
<view
class="require">
<!-- <view class="info-box-title">
<view class="info-left">
<image src="../../images/xiangqing.png"></image>
<view class="info-font-zhaomu display-inline">活动详情</view>
</view>
<view class="clear"></view>
</view> -->
<view class="info-box-last-require">
<rich-text space="nbsp" nodes="{{actNewsContent}}"></rich-text>
</view>
</view>
</block>
<!-- 志愿者打卡列表循环 -->
<!-- info-box-volunteer-last -->
<block wx:for="{{clocks}}" wx:key="index">
<view class="info-box-volunteer">
<!-- <view class="info-box-volunteer-ph"></view> -->
<image class="info-box-volunteer-ph" src="{{item.faceImg}}"></image>
<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>
<!-- 志愿者打卡 -->
<!-- selectedTab==tab0 说明从订单多多列表跳转过来的,对于已经结束的活动,页面不显示志愿者打卡的内容,其他内容保留留 -->
<block wx:if="{{selectedTab != 'tab0' || detail.currentUserStatus != 6}}">
<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 class="info-box-volunteer-content">
<text>{{item.clockDesc}}</text>
<view class="info-right volunteer">
{{clockNum}}次
</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="clear"></view>
</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 }}'>
<!-- 志愿者打卡列表循环 -->
<!-- info-box-volunteer-last -->
<block wx:for="{{clocks}}" wx:key="index">
<view class="info-box-volunteer">
<!-- <view class="info-box-volunteer-ph"></view> -->
<image class="info-box-volunteer-ph" src="{{item.faceImg}}"></image>
<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">
<image data-src="{{val}}" data-list="{{item.images}}" bindtap="preViewImage" src="{{val}}" class="{{index==0 ? 'photo-two-left' : 'photo-two-right'}}"></image>
<image data-src="{{val}}" data-list="{{item.images}}" bindtap="preViewImage" class="image-a" src="{{val}}"></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>
</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>
</block>
</view>
<view class="clear"></view>
</view>
<view class="clear"></view>
</view>
</block>
</block>
<!-- 志愿者打卡列表循环**********end*************** -->
</view>
<!-- 志愿者打卡 *************** end **************** -->
</block>
<!-- 志愿者打卡列表循环**********end*************** -->
</view>
<!-- 志愿者打卡 *************** end **************** -->
</block>
</block>
</view>
<view class="bottom" wx:if="{{detail.currentUserStatus != 6 && detail.currentUserStatus != 7 &&detail.currentUserStatus != 8 && detail.currentUserStatus != 9}}">
<view class="bottom"
wx:if="{{detail.currentUserStatus != 6 && detail.currentUserStatus != 7 &&detail.currentUserStatus != 8 && detail.currentUserStatus != 9}}">
<block>
<view class="button-left" wx:if="{{detail.currentUserStatus == 0 || detail.currentUserStatus == 1 || detail.currentUserStatus == 2 || detail.currentUserStatus == 3 }}">
<view class="button-left"
wx:if="{{detail.currentUserStatus == 0 || detail.currentUserStatus == 1 || detail.currentUserStatus == 2 || detail.currentUserStatus == 3 }}">
已报名 {{detail.signupNum}}人
</view>
</block>
@ -257,7 +288,8 @@
<block wx:elif="{{detail.currentUserStatus == 4 || detail.currentUserStatus == 5}}">
<!-- 4-我要打卡 5-更新打卡 6-已结束 bindtap="goClockIn" -->
<view class="button1 button2" bindtap="goClockIn" data-id="{{detail.id}}" data-currentUserStatus="{{detail.currentUserStatus}}">
<view class="button1 button2" bindtap="goClockIn" data-id="{{detail.id}}"
data-currentUserStatus="{{detail.currentUserStatus}}">
<image class='header-bg' src="../../images/yuanjiao-red.png"></image>
<view wx:if="{{detail.currentUserStatus == 4}}" class="font"> 我要打卡 </view>
<view wx:elif="{{detail.currentUserStatus == 5}}" class="font"> 更新打卡 </view>
@ -266,8 +298,10 @@
</view>
</view>
<coverview-dialog bind:confirm="confirmDialog" dialogVisible="{{dialogVisible}}" title="{{dialogTitle}}" content="{{dialogContent}}" confirmText="{{dialogConfirmText}}" cancelText="{{dialogCancelText}}">
<coverview-dialog bind:confirm="confirmDialog" dialogVisible="{{dialogVisible}}" title="{{dialogTitle}}"
content="{{dialogContent}}" confirmText="{{dialogConfirmText}}" cancelText="{{dialogCancelText}}">
</coverview-dialog>
<cancel-signup-dialog title="取消报名" cancelText="否" confirmText="是" tipVisible="{{cancelSignupTipVisible}}" tipValue="{{cancelSignupTipValue}}" bind:confirm="cancelSignupCallback" cancelSignupVisible="{{cancelSignupVisible}}">
<cancel-signup-dialog title="取消报名" cancelText="否" confirmText="是" tipVisible="{{cancelSignupTipVisible}}"
tipValue="{{cancelSignupTipValue}}" bind:confirm="cancelSignupCallback" cancelSignupVisible="{{cancelSignupVisible}}">
</cancel-signup-dialog>

14
subpages/heart/pages/heartDetail/heartDetail.wxss

@ -1,3 +1,6 @@
page{
background: #f7f7f7;
}
.container {
width: 100%;
}
@ -143,6 +146,7 @@
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 54rpx;
word-break: break-all;
}
.bottom {
@ -231,7 +235,6 @@
color: rgba(153, 153, 153, 1);
margin-top: 10rpx;
}
.info-box-volunteer {
width: 100wh;
height: auto;
@ -239,6 +242,9 @@
padding: 26rpx 0rpx;
margin: 0rpx 22rpx;
}
.info-box-volunteer:last-child {
border: none;
}
.info-box-volunteer-last {
width: 100wh;
@ -343,3 +349,9 @@
margin-left: 1%;
border-radius: 15rpx;
}
/* rich-text{
white-space:normal;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} */

Loading…
Cancel
Save