"pages/AttentionMethod/index", | "pages/AttentionMethod/index", | ||||
"pages/AddPicture/index", | "pages/AddPicture/index", | ||||
"pages/LearningVideo/index", | "pages/LearningVideo/index", | ||||
"pages/VolunteerActivity/index" | |||||
"pages/VolunteerActivity/index", | |||||
"pages/VolunteerDetail/index", | |||||
"pages/ActivityApply/index" | |||||
] | ] | ||||
}, | }, | ||||
{ | { |
// package_first/pages/ActivityApply/index.js | |||||
Page({ | |||||
/** | |||||
* 页面的初始数据 | |||||
*/ | |||||
data: { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面加载 | |||||
*/ | |||||
onLoad(options) { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面初次渲染完成 | |||||
*/ | |||||
onReady() { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面显示 | |||||
*/ | |||||
onShow() { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面隐藏 | |||||
*/ | |||||
onHide() { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面卸载 | |||||
*/ | |||||
onUnload() { | |||||
}, | |||||
/** | |||||
* 页面相关事件处理函数--监听用户下拉动作 | |||||
*/ | |||||
onPullDownRefresh() { | |||||
}, | |||||
/** | |||||
* 页面上拉触底事件的处理函数 | |||||
*/ | |||||
onReachBottom() { | |||||
}, | |||||
/** | |||||
* 用户点击右上角分享 | |||||
*/ | |||||
onShareAppMessage() { | |||||
} | |||||
}) |
{ | |||||
"usingComponents": {} | |||||
} |
<!--package_first/pages/ActivityApply/index.wxml--> | |||||
<text>package_first/pages/ActivityApply/index.wxml</text> |
/* package_first/pages/ActivityApply/index.wxss */ |
//上传图片 | //上传图片 | ||||
uploadImage(){ | uploadImage(){ | ||||
wx.chooseMedia({ | wx.chooseMedia({ | ||||
count: 1 - this.data.imageList.length, // 最多可以选择的图片张数,默认9 | |||||
count: 1, // 最多可以选择的图片张数,默认9 | |||||
// count: 1 - this.data.imageList.length, // 最多可以选择的图片张数,默认9 | |||||
mediaType: ['image'], // 图片 | mediaType: ['image'], // 图片 | ||||
sizeType: ['original'], // original 原图,compressed 压缩图,默认二者都有 | sizeType: ['original'], // original 原图,compressed 压缩图,默认二者都有 | ||||
sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 | sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 | ||||
return item.tempFilePath | return item.tempFilePath | ||||
}) | }) | ||||
// success | // success | ||||
let imagePreviewList = this.data.imagePreviewList.concat(list) | |||||
let imageList = this.data.imageList.concat(list); | |||||
console.log(imageList); | |||||
let imagePreviewList = list | |||||
let imageList = list; | |||||
this.setData({ imageList, imagePreviewList }) | this.setData({ imageList, imagePreviewList }) | ||||
// this.validate('imageList') | // this.validate('imageList') | ||||
}, | }, |
<view class="add_container"> | <view class="add_container"> | ||||
<view class="title">上传图片</view> | <view class="title">上传图片</view> | ||||
<view class="upload_image" bindtap="uploadImage"> | <view class="upload_image" bindtap="uploadImage"> | ||||
<view> | |||||
<view class="add_imageList" wx:for="{{imageList}}" wx:key="index"> | |||||
<image style="width:100%;" mode="widthFix" src="{{item}}"></image> | |||||
</view> | |||||
<view wx:if="{{imageList.length<1}}" class="upload_part"> | |||||
<image style="height: 70rpx;width:70rpx;" mode="widthFix" src="../../../assets/img/upload.png"></image> | <image style="height: 70rpx;width:70rpx;" mode="widthFix" src="../../../assets/img/upload.png"></image> | ||||
<view class="upload_text">上传图片</view> | <view class="upload_text">上传图片</view> | ||||
</view> | </view> |
} | } | ||||
.upload_image{ | .upload_image{ | ||||
width:calc(100% - 60rpx); | width:calc(100% - 60rpx); | ||||
height: 265rpx; | |||||
min-height: 265rpx; | |||||
border: 4rpx dotted #006DF7; | border: 4rpx dotted #006DF7; | ||||
border-radius: 10rpx; | border-radius: 10rpx; | ||||
text-align: center; | text-align: center; | ||||
padding: 70rpx 0rpx 0rpx 0rpx; | |||||
margin: 52rpx 0rpx 192rpx 0rpx; | margin: 52rpx 0rpx 192rpx 0rpx; | ||||
} | } | ||||
.upload_part { | |||||
padding-top: 70rpx; | |||||
} | |||||
.upload_text{ | .upload_text{ | ||||
font-size: 32rpx; | font-size: 32rpx; | ||||
font-family: Source Han Sans CN; | font-family: Source Han Sans CN; | ||||
background-color: #2878ff; | background-color: #2878ff; | ||||
height: 80rpx; | height: 80rpx; | ||||
line-height: 80rpx; | line-height: 80rpx; | ||||
} | |||||
.add_imageList { | |||||
width: 100%; | |||||
} | } |
*/ | */ | ||||
data: { | data: { | ||||
list:[], | list:[], | ||||
entersList:[ | |||||
{ | |||||
title:'未学习', | |||||
isstudy:false | |||||
}, | |||||
{ | |||||
title:'学习中', | |||||
isstudy:false | |||||
}, | |||||
{ | |||||
title:'已学习', | |||||
isstudy:false | |||||
} | |||||
], | |||||
userPage:{ | userPage:{ | ||||
page:1, | page:1, | ||||
limit:10 | limit:10 | ||||
total, | total, | ||||
list, | list, | ||||
}) | }) | ||||
if(list.status == 0){ | |||||
data.entersList[0].isstudy = true | |||||
}else if(list.status == 1){ | |||||
data.entersList[1].isstudy = true | |||||
} | |||||
}) | }) | ||||
} | } | ||||
<view class="cotent"> | <view class="cotent"> | ||||
<view class="title"> | <view class="title"> | ||||
<view class="title_text">{{item.videoTitle}}</view> | <view class="title_text">{{item.videoTitle}}</view> | ||||
<view class="item__tag is--sutdy"> | |||||
已学习 | |||||
</view> | |||||
<view class="item__tag no--sutdy" wx:if="{{flase}}"> | |||||
待学习 | |||||
</view> | |||||
<view class="{{item.status==2?'item__tag sutdying':item.status==1?'item__tag no--sutdy':'item__tag is--sutdy'}}"> | |||||
{{item.status==2?'学习中':item.status==1?'待学习':'已学习'}} | |||||
</view> | |||||
</view> | </view> | ||||
<view class="title_content">{{item.videoBrief}}</view> | <view class="title_content">{{item.videoBrief}}</view> | ||||
</view> | </view> |
.no--sutdy{ | .no--sutdy{ | ||||
background: #EBAC14; | background: #EBAC14; | ||||
} | } | ||||
.sutdying{ | |||||
background-color: #1BE9BC; | |||||
} | |||||
.bottom{ | .bottom{ | ||||
font-size: 26rpx; | font-size: 26rpx; | ||||
font-family: Source Han Sans CN; | font-family: Source Han Sans CN; |
onShareAppMessage() { | onShareAppMessage() { | ||||
}, | }, | ||||
formatDate(dateString) { | |||||
const date = new Date(dateString); | |||||
const year = date.getFullYear(); | |||||
const month = ("0" + (date.getMonth() + 1)).slice(-2); | |||||
const day = ("0" + date.getDate()).slice(-2); | |||||
return `${year}年${month}月${day}日`; | |||||
}, | |||||
westreamActivity(){ | westreamActivity(){ | ||||
const tenantObj = wx.getStorageSync('tenant') | const tenantObj = wx.getStorageSync('tenant') | ||||
let data = { | let data = { | ||||
...this.data.userPage | ...this.data.userPage | ||||
} | } | ||||
api_westreamActivity(data).then(res=>{ | api_westreamActivity(data).then(res=>{ | ||||
let list = [...this.data.list,...res.data.records] | |||||
let list =[] | |||||
if(this.data.userPage.page==1){ | |||||
list =res.data.records | |||||
}else{ | |||||
list = [...this.data.list,...res.data.records] | |||||
} | |||||
let total = res.data.total | let total = res.data.total | ||||
list = list.reduce((pre,item)=>{ | |||||
return [...pre,{ | |||||
...item, | |||||
activityBeginTime:this.formatDate(item.activityBeginTime), | |||||
activityEndTime:this.formatDate(item.activityEndTime) | |||||
}] | |||||
},[]) | |||||
this.setData({ | this.setData({ | ||||
total, | total, | ||||
list, | list, | ||||
}) | |||||
}), | |||||
// res.activityBeginTime = res.activityBeginTime.replace(/\s[\x00-\xff]*/g,'') | |||||
console.log(res); | console.log(res); | ||||
}) | |||||
}, | |||||
showDetail(e) { | |||||
let data = JSON.stringify(e.currentTarget.dataset.item) | |||||
wx.navigateTo({ | |||||
url: '/package_first/pages/VolunteerDetail/index?data='+ encodeURIComponent(data), | |||||
}) | }) | ||||
} | } | ||||
}) | }) |
{ | { | ||||
"usingComponents": {} | |||||
"usingComponents": { | |||||
"list": "../../../components/List/index", | |||||
"ImageList": "../../../components/ImageList/index" | |||||
}, | |||||
"navigationBarTitleText": "志愿者活动", | |||||
"navigationBarBackgroundColor": "#3275E9" | |||||
} | } |
<view class="part_middle"> | <view class="part_middle"> | ||||
<view class="activity"> | <view class="activity"> | ||||
<view class="activity_name">{{item.activityTitle}}</view> | <view class="activity_name">{{item.activityTitle}}</view> | ||||
<view class="activity_tag is_apply">报名进行中</view> | |||||
<view class="activity_tag no_apply" wx:if="{{false}}">报名未开始</view> | |||||
<view class="activity_tag over_apply" wx:if="{{false}}">报名已结束</view> | |||||
<view class="{{item.status==2?'activity_tag is_apply':item.status==1?'activity_tag no_apply':'activity_tag over_apply'}}"> | |||||
{{item.status==2?'报名进行中':item.status==1?'报名未开始':'报名已结束'}} | |||||
</view> | |||||
</view> | </view> | ||||
<view class="activity_date"> | <view class="activity_date"> | ||||
<view class="dot"></view> | <view class="dot"></view> | ||||
<view class="activity_time">{{item.activityBeginTime}}~2023年4月20号</view> | |||||
<view class="activity_time">{{item.activityBeginTime}}~{{item.activityEndTime}}</view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="activity_bottom"> | <view class="activity_bottom"> | ||||
<view> | <view> | ||||
<view class="apply">立即报名</view> | |||||
<view class="join">进入活动》</view> | |||||
<view class="apply" wx:if="{{item.status==2}}">立即报名</view> | |||||
<view class="join" bindtap="showDetail" data-item="{{item}}">进入活动 》</view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> |
.part{ | .part{ | ||||
width: calc(100%-60rpx); | width: calc(100%-60rpx); | ||||
background-color:#FFFFFF ; | background-color:#FFFFFF ; | ||||
margin-bottom: 19rpx; | |||||
padding-bottom: 19rpx; | |||||
} | } | ||||
.activity_image{ | .activity_image{ | ||||
width: 100%; | width: 100%; |
// package_first/pages/VolunteerDetail/index.js | |||||
import {api_westreamActivity} from '../../../api/volunteer'; | |||||
Page({ | |||||
/** | |||||
* 页面的初始数据 | |||||
*/ | |||||
data: { | |||||
activityInfo:{}, | |||||
list:[], | |||||
userPage:{ | |||||
page:1, | |||||
limit:10 | |||||
}, | |||||
total:0, | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面加载 | |||||
*/ | |||||
onLoad(options) { | |||||
let data = JSON.parse(decodeURIComponent(options.data)) | |||||
data.applyBeginTime = this.formatDate(data.applyBeginTime) | |||||
data.applyEndTime = this.formatDate(data.applyEndTime) | |||||
this.setData({ | |||||
activityInfo:data | |||||
}) | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面初次渲染完成 | |||||
*/ | |||||
onReady() { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面显示 | |||||
*/ | |||||
onShow() { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面隐藏 | |||||
*/ | |||||
onHide() { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面卸载 | |||||
*/ | |||||
onUnload() { | |||||
}, | |||||
/** | |||||
* 页面相关事件处理函数--监听用户下拉动作 | |||||
*/ | |||||
onPullDownRefresh() { | |||||
}, | |||||
/** | |||||
* 页面上拉触底事件的处理函数 | |||||
*/ | |||||
onReachBottom() { | |||||
}, | |||||
formatDate(dateString) { | |||||
const date = new Date(dateString); | |||||
const year = date.getFullYear(); | |||||
const month = ("0" + (date.getMonth() + 1)).slice(-2); | |||||
const day = ("0" + date.getDate()).slice(-2); | |||||
return `${year}年${month}月${day}日`; | |||||
}, | |||||
goApply(e){ | |||||
// if(status == 2){ | |||||
// console.log(this.data.status); | |||||
// wx.navigateTo({ | |||||
// url:"/package_first/pages/ActivityApply/index" | |||||
// }) | |||||
// }else{ | |||||
// wx.showToast({ | |||||
// title: '不在报名时间', | |||||
// icon:'none' | |||||
// }) | |||||
// } | |||||
wx.navigateTo({ | |||||
url:"/package_first/pages/ActivityApply/index" | |||||
}) | |||||
}, | |||||
/** | |||||
* 用户点击右上角分享 | |||||
*/ | |||||
onShareAppMessage() { | |||||
} | |||||
}) |
{ | |||||
"usingComponents": {} | |||||
} |
<!--package_first/pages/VolunteerDetail/index.wxml--> | |||||
<view class="VolunteerDetail_container"> | |||||
<view class="main"> | |||||
<view class="content"> | |||||
{{activityInfo.intro}} | |||||
</view> | |||||
<view > | |||||
<image class="Volunteer_image" src="{{activityInfo.imageUrl}}" mode=""/> | |||||
</view> | |||||
<view class="apply_time"> | |||||
<view class="apply">报名时间:</view> | |||||
<view class="time">{{activityInfo.applyBeginTime}}~{{activityInfo.applyEndTime}}</view> | |||||
</view> | |||||
<view class="activity_time"> | |||||
<view class="activity">活动时间:</view> | |||||
<view class="time_act">{{activityInfo.activityBeginTime}}~{{activityInfo.activityEndTime}}</view> | |||||
</view> | |||||
</view> | |||||
<view class="button" bindtap="goApply"> | |||||
报名 | |||||
</view> | |||||
</view> |
/* package_first/pages/VolunteerDetail/index.wxss */ | |||||
.VolunteerDetail_container{ | |||||
width: 100%; | |||||
height: 100vh; | |||||
background: #F2F6F9; | |||||
padding: 30rpx 29rpx 24 prx 60rpx; | |||||
} | |||||
.main{ | |||||
width: calc(100% - 60rpx); | |||||
background: #FFFFFF; | |||||
box-shadow: 0rpx 0rpx 14rpx 2rpx rgba(43,93,184,0.09); | |||||
border-radius: 20rpx; | |||||
margin-left: 30rpx; | |||||
padding: 62rpx 30rpx 56rpx 29rpx ; | |||||
} | |||||
.content{ | |||||
font-size: 30rpx; | |||||
font-family: Source Han Sans CN; | |||||
font-weight: 400; | |||||
color: #000000; | |||||
line-height: 48rpx; | |||||
margin-bottom:40rpx; | |||||
} | |||||
.Volunteer_image{ | |||||
width: 100%; | |||||
height: 340rpx; | |||||
border-radius: 10rpx; | |||||
} | |||||
.apply{ | |||||
font-size: 30rpx; | |||||
font-family: Source Han Sans CN; | |||||
font-weight: 400; | |||||
color: #000000; | |||||
line-height: 48rpx; | |||||
margin: 30rpx 0 31rpx 0; | |||||
} | |||||
.time_act{ | |||||
width: 645rpx; | |||||
height: 66rpx; | |||||
background: rgba(50, 117, 233, 0.2); | |||||
border-radius: 4rpx; | |||||
font-size: 30rpx; | |||||
font-family: Source Han Sans CN; | |||||
font-weight: 400; | |||||
color: #3275E9; | |||||
text-align: center; | |||||
line-height:66rpx; | |||||
} | |||||
.time{ | |||||
width: 645rpx; | |||||
height: 66rpx; | |||||
background: rgba(16, 177, 255, 0.2); | |||||
border-radius: 4rpx; | |||||
font-size: 30rpx; | |||||
font-family: Source Han Sans CN; | |||||
font-weight: 400; | |||||
color: rgba(16, 177, 255, 1); | |||||
text-align: center; | |||||
line-height:66rpx; | |||||
} | |||||
.activity{ | |||||
margin: 31rpx 0 30rpx 0; | |||||
} | |||||
.button{ | |||||
width:calc(100% - 60rpx); | |||||
text-align: center; | |||||
border-radius: 32rpx; | |||||
color: white; | |||||
background-color: #2878ff; | |||||
position: absolute; | |||||
bottom: 24rpx; | |||||
height: 90rpx; | |||||
line-height: 80rpx; | |||||
margin: 0 30rpx 0 30rpx; | |||||
} |
<view class="beauty_container"> | <view class="beauty_container"> | ||||
<!-- 列表 --> | <!-- 列表 --> | ||||
<list id="list" class="beauty_list" url="{{current}}" bind:update-list="updateList" list="{{list}}" bind:reset-list="resetList" params="{{params}}"> | <list id="list" class="beauty_list" url="{{current}}" bind:update-list="updateList" list="{{list}}" bind:reset-list="resetList" params="{{params}}"> | ||||
<view class="beauty_item" data-item="{{item}}" bindtap="showDetail" wx:for="{{list}}" wx:key="index"> | |||||
<view class="beauty_item" data-item="{{item}}" bindtap="showDetail" bindtap="showDetail" wx:for="{{list}}" wx:key="index"> | |||||
<view class="item_head"> | <view class="item_head"> | ||||
<image class="user_avatar" src="{{item.headimgurl}}"></image> | <image class="user_avatar" src="{{item.headimgurl}}"></image> | ||||
<view class="other_info"> | <view class="other_info"> |
"query": "", | "query": "", | ||||
"launchMode": "default", | "launchMode": "default", | ||||
"scene": null | "scene": null | ||||
}, | |||||
{ | |||||
"name": "志愿者活动详情", | |||||
"pathName": "package_first/pages/VolunteerDetail/index", | |||||
"query": "", | |||||
"launchMode": "default", | |||||
"scene": null | |||||
} | } | ||||
] | ] | ||||
} | } |