作者 niufei

志愿者二期

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/zhiyuanzhe.iml" filepath="$PROJECT_DIR$/.idea/zhiyuanzhe.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="f6bf484e-3695-4425-9f8d-0483a0eb1752" name="Default" comment="" />
<ignored path="$PROJECT_DIR$/.tmp/" />
<ignored path="$PROJECT_DIR$/temp/" />
<ignored path="$PROJECT_DIR$/tmp/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>http://volunteer.w.bronet.cn</find>
</findStrings>
<replaceStrings>
<replace />
<replace>https://volunteer.cnpu.org</replace>
</replaceStrings>
<dirStrings>
<dir>E:\wxproject\03志愿者小程序效果图\volunteer\zhiyuanzhe\pages</dir>
</dirStrings>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="NodePackageJsonFileManager">
<packageJsonPaths />
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="121" />
<option name="y" value="19" />
<option name="width" value="1400" />
<option name="height" value="1000" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="zhiyuanzhe" type="b2602c69:ProjectViewProjectNode" />
<item name="zhiyuanzhe" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="zhiyuanzhe" type="b2602c69:ProjectViewProjectNode" />
<item name="zhiyuanzhe" type="462c0819:PsiDirectoryNode" />
<item name="pages" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="node.js.detected.package.prettier" value="true" />
<property name="node.js.path.for.package.prettier" value="project" />
<property name="node.js.selected.package.prettier" value="" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="settings.editor.selected.configurable" value="configurable.group.appearance" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="f6bf484e-3695-4425-9f8d-0483a0eb1752" name="Default" comment="" />
<created>1546648168340</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1546648168340</updated>
<workItem from="1546648170160" duration="644000" />
<workItem from="1547097879598" duration="899000" />
<workItem from="1547268145045" duration="628000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="2171000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24973656" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
<window_info anchor="bottom" id="Event Log" order="7" side_tool="true" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info anchor="bottom" id="Terminal" order="7" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
//app.js
App({
onLaunch: function () {
//自动更新版本
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
})
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function () {
// 新的版本下载失败
wx.showModal({
title: '更新提示',
content: '新版本下载失败',
showCancel: false
})
})
},
/**
* 自定义post函数,返回Promise
... ... @@ -67,7 +94,7 @@ App({
url: '/pages/start/start'
})
} else if (res.cancel) {
console.log('用户点击取消')
// console.log('用户点击取消')
}
}
})
... ... @@ -85,7 +112,6 @@ App({
wx.hideNavigationBarLoading()
},
fail: function (e) {
console.log(e)
reject('网络出错');
// wx.hideLoading()
wx.hideNavigationBarLoading()
... ...
{
"pages": [
"pages/index/index",
"pages/start/start",
"pages/my/my",
"pages/more/more",
"pages/admin/admin",
"pages/apply/apply",
"pages/img_txt/img_txt",
"pages/result/result",
"pages/close_apply/close_apply"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#21AE59",
"navigationBarTitleText": "志愿者小程序",
"navigationBarTextStyle": "white"
},
"tabBar": {
"color": "#fff",
"selectedColor": "#fff",
"backgroundColor": "#EBEBEB",
"list": [
{
"pagePath": "pages/index/index",
"text": "",
"iconPath": "imgs/shouye_02@2x.png",
"selectedIconPath": "imgs/shouye_01@2x.png"
},
{
"pagePath": "pages/my/my",
"text": "",
"iconPath": "imgs/wode_01@2x.png",
"selectedIconPath": "imgs/wode_02@2x.png"
}
]
}
"pages": [
"pages/index/index",
"pages/start/start",
"pages/my/my",
"pages/more/more",
"pages/admin/admin",
"pages/apply/apply",
"pages/img_txt/img_txt",
"pages/result/result",
"pages/close_apply/close_apply",
"pages/my/my_active/my_active",
"pages/index/active/active"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#21AE59",
"navigationBarTitleText": "志愿者小程序",
"navigationBarTextStyle": "white"
},
"tabBar": {
"color": "#fff",
"selectedColor": "#fff",
"backgroundColor": "#EBEBEB",
"list": [
{
"pagePath": "pages/index/index",
"text": "",
"iconPath": "imgs/shouye_02@2x.png",
"selectedIconPath": "imgs/shouye_01@2x.png"
},
{
"pagePath": "pages/my/my",
"text": "",
"iconPath": "imgs/wode_01@2x.png",
"selectedIconPath": "imgs/wode_02@2x.png"
}
]
}
}
\ No newline at end of file
... ...
... ... @@ -29,14 +29,12 @@ getdatalist(){
page: res.page
})
}).catch((err)=>{
console.log(err)
})
},
update_status(e){
let that=this;
let index = e.currentTarget.dataset.index;
console.log('index', index);
let url ='index/member_center/update_status';
let head = {
'XX-Token': wx.getStorageSync('token')
... ... @@ -53,13 +51,11 @@ getdatalist(){
})
let datalist = that.data.datalist;
datalist[index].status = e.currentTarget.dataset.status;
console.log('e.currentTarget.dataset.status', e.currentTarget.dataset.status);
that.setData({
datalist: datalist
})
}).catch((err)=>{
console.log(err)
})
},
/**
... ...
... ... @@ -164,7 +164,6 @@ Page({
})
},
bindtypeChange(e) {
console.log(e)
let typearr = this.data.typearr;
this.setData({
type: parseInt(e.detail.value) +1
... ... @@ -185,7 +184,7 @@ Page({
app.post(url, param).then((res) => {
that.login(res.openid, res.session_key, e.detail.encryptedData, e.detail.iv,tem);
}).catch((errMsg) => {
console.log(errMsg);
})
}
}
... ... @@ -207,7 +206,7 @@ Page({
})
that.uploadImage(tem);
}).catch((errMsg) => {
console.log(errMsg);
})
},
... ... @@ -243,7 +242,7 @@ Page({
}
}).catch((err)=>{
console.log(err)
})
},
//切换省份获取市和区/县
... ... @@ -254,7 +253,6 @@ Page({
'province_id': province_id
}
app.post(url, params).then((res)=>{
console.log('切换省份获取市和区/县',res);
let country = res.country;
let tem = {
id: 0,
... ... @@ -269,7 +267,7 @@ Page({
countryarr: temcountry
})
}).catch((err)=>{
console.log(err)
})
},
//切换市获取区/县
... ... @@ -280,7 +278,6 @@ Page({
'city_id': city_id
}
app.post(url, params).then((res) => {
console.log('切换市获取区/县', res);
let country = res.country;
let tem={
id:0,
... ... @@ -294,7 +291,7 @@ Page({
countryarr: temcountry
})
}).catch((err) => {
console.log(err)
})
},
bindChange: function (e) {
... ... @@ -371,7 +368,6 @@ Page({
},
bindRegionChange(e){
let that=this;
console.log(e);
this.setData({
region: e.detail.value,
province: e.detail.value[0],
... ... @@ -461,7 +457,6 @@ Page({
formData: {},
success: function(res) {
let temdata = JSON.parse(res.data);
console.log('上传图temdata', temdata);
if (temdata.code == 20000) {
if (tem == '1') {
that.setData({
... ... @@ -624,7 +619,6 @@ Page({
})
},1000)
}).catch((err) => {
console.log(err)
})
}else{
wx.showToast({
... ... @@ -693,7 +687,7 @@ Page({
type: res.type
})
}).catch((err)=>{
console.log(err)
})
},
/**
... ...
... ... @@ -139,7 +139,7 @@ Page({
type: res.type
})
}).catch((err) => {
console.log(err)
})
},
/**
... ...
// pages/img_txt/img_txt.js
const app=getApp();
const app = getApp();
var wxParse = require('../../wxParse/wxParse.js');
Page({
/**
* 页面的初始数据
*/
data: {
id:'',
status:''
},
getdatalist(){
let that=this;
let head = {
'XX-Token': wx.getStorageSync('token')
}
let url='';
let params=''
if (that.data.status=='1'){
url = 'index/index/activity_info';
params = {
id: that.data.id
}
} else if (that.data.status == '2'){
url = 'index/member_center/about';
params = {};
} else if (that.data.status == '3'){
url = 'index/member_center/contact';
params = {};
}
app.post(url, params,head).then((res)=>{
console.log(res.content);
that.setData({
datalist:res
})
wxParse.wxParse('content', 'html', res.content, that, 5);
}).catch((err)=>{
console.log(err)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that=this;
if (options.status=='1'){
that.setData({
id: options.id,
status: options.status
})
wx.setNavigationBarTitle({
title: '活动详情'
})
that.getdatalist();
} else if (options.status == '2'){
that.setData({
status: options.status
})
wx.setNavigationBarTitle({
title: '关于我们'
})
that.getdatalist();
} else if (options.status == '3'){
that.setData({
status: options.status
})
wx.setNavigationBarTitle({
title: '联系我们'
})
that.getdatalist();
}
/**
* 页面的初始数据
*/
data: {
cover_type: false,
enroll_arr: ['线上', '线下', '线上加线下'],
enroll: '请选择报名方式',
starTime: '请选择开始时间',
endTime: '请选择结束时间',
type: 0,
id: '',
status: ''
},
// 选择报名方式
selectenroll(e) {
let that = this
that.setData({
enroll: that.data.enroll_arr[e.detail.value],
enroll_id: Number(e.detail.value) + 1
})
if (e.detail.value == 0) {
that.setData({
type: 0
})
} else {
that.setData({
type: 1
})
}
},
selecte_startTime(e) {
this.setData({
starTime: e.detail.value
})
},
selecte_endTime(e) {
this.setData({
endTime: e.detail.value
})
},
change_cover: function() {
this.setData({
cover_type: false
})
},
//报名
submit: function() {
let that = this
if (that.data.enroll == '请选择报名方式') {
wx.showToast({
title: '请选择报名方式',
icon: 'none',
duration: 1000
})
return false
}
if (that.data.enroll_id != 1) {
if (that.data.starTime == '请选择开始时间') {
wx.showToast({
title: '请选择开始时间',
icon: 'none',
duration: 1000
})
return false
}
if (that.data.endTime == '请选择结束时间') {
wx.showToast({
title: '请选择结束时间',
icon: 'none',
duration: 1000
})
return false
}
} else {
}
let head = {
'XX-Token': wx.getStorageSync('token')
}
let url = '/index/index/applyJoin';
let params = {}
if (that.data.enroll_id != 1){
params = {
id: that.data.id,
type: that.data.enroll_id,
start_time: that.data.starTime,
end_time: that.data.end_time
}
}else{
params = {
id: that.data.id,
type: that.data.enroll_id,
start_time: '',
end_time: ''
}
}
app.post(url, params, head).then((res) => {
wx.showToast({
title: '提交成功',
duration: 1000,
success: (res) => {
let t = setInterval((res) => {
clearInterval(t)
wx.switchTab({
url: '/pages/index/index',
})
}, 1000)
}
})
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
},
// 展示报名弹窗
enroll() {
this.setData({
cover_type: true
})
},
/**
* 获取设备信息
*/
getSystemInfo() {
let that = this;
wx.getSystemInfo({
success: function(res) {
that.setData({
height: res.windowHeight + 'px'
})
}
})
},
//签到
sign() {
let that = this;
let head = {
'XX-Token': wx.getStorageSync('token')
}
let url = '/index/index/sginIn';
let params = {
id: that.data.id
}
app.post(url, params, head).then((res) => {
wx.showToast({
title: '签到成功',
duration: 1000,
success: (res) => {
let t = setInterval((res) => {
clearInterval(t)
wx.switchTab({
url: '/pages/index/index',
})
}, 1000)
}
})
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
}).catch((err) => {
},
})
},
getdatalist() {
let that = this;
let head = {
'XX-Token': wx.getStorageSync('token')
}
let url = '';
let params = ''
if (that.data.status == '1') {
url = 'index/index/activity_info';
params = {
id: that.data.id
}
} else if (that.data.status == '2') {
url = 'index/member_center/about';
params = {};
} else if (that.data.status == '3') {
url = 'index/member_center/contact';
params = {};
}
app.post(url, params, head).then((res) => {
that.setData({
datalist: res
})
wxParse.wxParse('content', 'html', res.content, that, 5);
}).catch((err) => {
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
})
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that = this;
if (options.status == '1') {
that.setData({
id: options.id,
status: options.status
})
wx.setNavigationBarTitle({
title: '活动详情'
})
that.getdatalist();
} else if (options.status == '2') {
that.setData({
status: options.status
})
wx.setNavigationBarTitle({
title: '关于我们'
})
that.getdatalist();
} else if (options.status == '3') {
that.setData({
status: options.status
})
wx.setNavigationBarTitle({
title: '联系我们'
})
that.getdatalist();
}
that.getSystemInfo()
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
}
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
<!--pages/img_txt/img_txt.wxml-->
<view class='main'>
<view class='top_img'>
<image src='{{datalist.thumbnail}}'></image>
</view>
<view class='text_title'>{{datalist.activity_name}}</view>
<view class='text_time' wx:if='{{status=="1"}}'>{{datalist.time}}</view>
<view class='text_content'>
<!-- <rich-text nodes="{{datalist.content}}" bindtap="tap"></rich-text> -->
<view class='top_img'>
<image src='{{datalist.thumbnail}}'></image>
</view>
<view class='text_title'>{{datalist.activity_name}}</view>
<view class='text_time' wx:if='{{status=="1"}}'>{{datalist.time}}</view>
<view class='text_content'>
<!-- <rich-text nodes="{{datalist.content}}" bindtap="tap"></rich-text> -->
<import src="../../wxParse/wxParse.wxml" />
<template is='wxParse' data='{{wxParseData:content.nodes}}' />
</view>
<view class='memberbox' wx:if='{{datalist.join.length>0}}'>
<view class='title'>已成功报名人员</view>
<view class='member' wx:for='{{datalist.join}}' wx:key=''>
<image src='{{item.photo}}'></image>
<view>{{item.name}}</view>
</view>
</view>
</view>
</view>
<view class='foot' bindtap='enroll' wx:if='{{datalist.button_status == 1}}'>报名</view>
<view class='foot' wx:if='{{datalist.button_status == 2}}'>待审核</view>
<view class='foot' bindtap='sign' wx:if='{{datalist.button_status == 3}}'>签到</view>
<view class='foot' wx:if='{{datalist.button_status == 4}}'>已签到</view>
<view class='foot' wx:if='{{datalist.button_status == 5}}'>已结束</view>
<navigator url='/pages/result/result' class='foot' wx:if='{{datalist.button_status == 6}}'>成为志愿者</navigator>
<view class='cover' style='width:100%;height:{{height}};' wx:if='{{cover_type}}'>
<view class='toast_box'>
<view class='cover_box' catchtap=''>
<view class='title'>报名方式</view>
<image src='/imgs/del.png' class='close' bindtap='change_cover'></image>
<picker range='{{enroll_arr}}' bindchange='selectenroll'>
<view class="enroll ">
{{enroll}}
</view>
</picker>
<picker mode='date' bindchange='selecte_startTime' wx:if='{{type}}'>
<view class='time'>
{{starTime}}
</view>
</picker>
<picker mode='date' bindchange='selecte_endTime' wx:if='{{type}}'>
<view class='time'>
{{endTime}}
</view>
</picker>
<view class='sub_bnt' bindtap='submit'>确定</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/img_txt/img_txt.wxss */
.main{
margin: 24rpx 32rpx ;
}
.top_img{
height:450rpx;
overflow: hidden;
}
.top_img image{
width:100%;
height: 100%;
display: block;
}
.text_title{
text-align: center;
color:#292929;
font-size:32rpx;
font-weight: bold;
padding:24rpx 0 10rpx 0;
}
.text_content{
/* text-indent: 50rpx; */
/* color:#666666;
font-size:26rpx; */
/* line-height: 46rpx; */
}
.text_time{
color:#999;
font-size:26rpx;
margin: 0 0 10rpx 0;
text-align: center;
page {
padding-bottom: 110rpx;
}
.main {
margin: 24rpx 32rpx;
}
.top_img {
height: 450rpx;
overflow: hidden;
}
.top_img image {
width: 100%;
height: 100%;
display: block;
}
.text_title {
text-align: center;
color: #292929;
font-size: 32rpx;
font-weight: bold;
padding: 24rpx 0 10rpx 0;
}
.text_content {
/* text-indent: 50rpx; *//* color:#666666;
font-size:26rpx; *//* line-height: 46rpx; */
}
.text_time {
color: #999;
font-size: 26rpx;
margin: 0 0 10rpx 0;
text-align: center;
}
.foot {
width: 100%;
height: 100rpx;
background: #21ae59;
box-shadow: 0rpx 1rpx 54rpx 0rpx rgba(62, 62, 62, 0.1);
color: #fff;
font-size: 32rpx;
text-align: center;
line-height: 100rpx;
position: fixed;
left: 0;
bottom: 0;
}
.memberbox {
width: 100%;
display: flex;
flex-wrap: wrap;
margin-top: 20rpx;
}
.memberbox .title {
width: 100%;
color: #333;
font-size: 32rpx;
font-weight: bold;
margin-bottom: 20rpx;
}
.member {
width: 170rpx;
margin-bottom: 20rpx;
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.member image {
width: 120rpx;
height: 120rpx;
}
.member view {
width: 100%;
padding: 0 10rpx;
box-sizing: border-box;
color: #ccc;
font-size: 26rpx;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.cover{
position: fixed;
left: 0;
top: 0;
z-index: 2;
background: rgba(0,0,0,0.6);
}
.cover_box{
width: 600rpx;
height: auto;
border-radius: 10rpx;
background: #fff;
padding-bottom: 60rpx;
padding-top: 20rpx;
margin: auto;
position: relative;
}
.cover_box .title{
width: 500rpx;
text-align: center;
color: #333;
font-size: 30rpx;
font-weight: bold;
margin: 50rpx auto 0;
}
.enroll,.time{
width: 500rpx;
height: 80rpx;
border: 2rpx solid #eee;
color: #999;
font-size: 30rpx;
display: flex;
justify-content: center;
align-items: center;
margin: 60rpx auto 20rpx;
border-radius: 10rpx;
text-align: left;
}
.time{
margin-top: 50rpx;
}
.active{
margin-top: 70rpx ! important;
}
.close{
width: 50rpx;
height: 50rpx;
position: absolute;
right: 10rpx;
top: 10rpx;
}
.sub_bnt{
width: 86%;
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
border-radius: 10rpx;
background: #21ae59;
color: #FFF;
margin-top: 80rpx;
font-size: 32rpx;
}
.toast_box{
height: 100%;
width: 100%;
display: flex;
}
\ No newline at end of file
... ...
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
clickIndex: true,
index:0,
datalist: [],
activity_page: 0,
activity: [],
city_arr: [],
city_arrid: [],
class_arr: [],
class_arrid: [],
city:'选择城市',
category: '选择分类',
},
selecteCtiy(e){
this.setData({
city: this.data.city_arr[e.detail.value],
city_id: this.data.city_arrid[e.detail.value]
})
this.city_active()
},
selecteClass(e) {
this.setData({
category: this.data.class_arr[e.detail.value],
type: this.data.class_arrid[e.detail.value]
})
this.type_active()
},
/**
* 切换
*/
clicktab(e) {
let that = this
let id = e.currentTarget.dataset.id
if (id == '2') {
that.setData({
clickIndexs: true,
clickIndex: false
})
this.type_active()
} else if (id == '1') {
that.setData({
clickIndexs: false,
clickIndex: true
})
this.city_active()
}
//调用接口
},
//获取城市列表
get_city(){
let that = this;
let url = '/index/index/cityList';
let head = {
'XX-Token': wx.getStorageSync('token')
}
app.post(url, {}, head).then((res) => {
that.setData({
city_arr: res.city,
city_arrid: res.id
})
}).catch((err) => {
})
},
//获取分类列表
get_class() {
let that = this;
let url = '/index/index/activityType';
let head = {
'XX-Token': wx.getStorageSync('token')
}
app.post(url, {}, head).then((res) => {
that.setData({
class_arr: res.type_name,
class_arrid: res.id
})
}).catch((err) => {
})
},
//获取城市活动
city_active(){
let that = this;
let url = '/index/index/cityGetActivity';
let head = {
'XX-Token': wx.getStorageSync('token')
}
let params = {
city_id: that.data.city_id
}
app.post(url, params, head).then((res) => {
that.setData({
activity: res
})
}).catch((err) => {
})
},
//获取分类活动
type_active() {
let that = this;
let url = '/index/index/typeGetActivity';
let head = {
'XX-Token': wx.getStorageSync('token')
}
let params = {
type: that.data.type
}
app.post(url, params, head).then((res) => {
that.setData({
activity: res
})
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that = this
that.get_city()
that.get_class()
that.city_active()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let that = this;
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<view class='index_newbox'>
<view class='tabbar'>
<view class='tabbar_item' data-id='1' bindtap='clicktab'>
<picker range='{{city_arr}}' bindchange='selecteCtiy'>
<view class="title {{clickIndex?'titleActive':''}}">
{{city}}
</view>
</picker>
</view>
<view class='tabbar_item' data-id='2' bindtap='clicktab'>
<picker range='{{class_arr}}' bindchange='selecteClass'>
<view class="title {{clickIndexs?'titleActive':''}}">
{{category}}
</view>
</picker>
</view>
</view>
<view>
<view class='new_box'>
<navigator class='new_cell' wx:for='{{activity}}' wx:key url='/pages/img_txt/img_txt?id={{item.id}}&status=1' hover-class="none">
<view class='new_cellmain'>
<view class='new_img'>
<image src='{{item.thumbnail}}'> </image>
</view>
<view class='new_title'>{{item.activity_name}}</view>
<view class='title_box'>
<view>
<image src='/imgs/dizhi@2x.png' />
<text>{{item.province_name}}</text>
</view>
<view class='word'>{{item.type_name}}</view>
</view>
<view>{{item.time}}</view>
</view>
</navigator>
<view class='empty' wx:if='{{activity.length == 0}}'>暂无数据,请去添加</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
.index_newbox {
}
.new_box {
display: flex;
justify-content: space-between;
align-items: center;
color: #999;
padding: 0 32rpx;
font-size: 24rpx;
flex-wrap: wrap;
}
.new_cell {
width: 48%;
padding: 29rpx 0rpx;
/* border-bottom:1rpx solid #E6E6E6; */
}
.new_cell:nth-child(2n) {
margin: 0 0 0 10rpx;
}
.new_cellmain {
overflow: hidden;
}
.new_img {
width: 336rpx;
height: 220rpx;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.new_img image {
width: 100%;
height: 100%;
display: block;
}
.new_title {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin: 18rpx 0 13rpx 0;
color: #292929;
font-size: 28rpx;
}
.title_box {
margin: 18rpx 0 13rpx 0;
color: #292929;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.title_box image{
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
}
.title_box .word{
color: #666;
font-size: 24rpx;
}
.tabbar {
width: 100%;
height: 100rpx;
display: flex;
justify-content: space-between;
border-top: 8rpx solid RGBA(245, 246, 250, 1);
border-bottom: 2rpx solid RGBA(245, 246, 250, 1);
}
.tabbar_item {
width: 50%;
height: 100%;
}
.title {
height: 100%;
box-sizing: border-box;
font-size: 32rpx;
line-height: 100rpx;
text-align: center;
font-family: PingFang-SC-Medium;
margin: 0 auto;
}
.titleActive {
color: rgba(152, 97, 225, 1);
border-bottom: 3rpx solid RGBA(152, 97, 225, 1);
}
.empty{
width: 100%;
font-size: 32rpx;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: #97a0a8;
text-align: center;
margin-top: 50rpx;
}
\ No newline at end of file
... ...
... ... @@ -5,6 +5,7 @@ Page({
* 页面的初始数据
*/
data: {
star_num: 3,
datalist:[],
activity_page:0,
activity:[]
... ... @@ -44,10 +45,11 @@ Page({
that.setData({
datalist:res,
activity: temdataactivity,
activity_page: res.activity_page
activity_page: res.activity_page,
begin: res.begin
})
}).catch((err)=>{
console.log(err)
})
},
//判断是否登陆
... ... @@ -82,7 +84,7 @@ let that=this;
})
}
}).catch((err)=>{
console.log(err);
})
}).catch((errMsg) => {
console.log(errMsg);
... ...
<!--index.wxml-->
<scroll-view scroll-y='true' bindscrolltolower='getdatalist' style='height:{{scroll_height}}rpx'>
<swiper indicator-dots="true" autoplay="true" indicator-color='#8C9194' indicator-active-color='#ffffff' class="slide-image">
<navigator wx:for="{{datalist.slide}}" wx:key hover-class="none" url='/pages/img_txt/img_txt?id={{item.activity_id}}&status=1' >
<swiper-item>
<image src="{{item.image}}" />
</swiper-item>
</navigator>
</swiper>
<view class='vold_line'></view>
<view class='index_volunteertitle'>
<view class='title'>志愿者</view>
<navigator url='/pages/more/more' hover-class="none">更多</navigator>
</view>
<view class='volunteerbox'>
<view class='volunteercell' wx:for='{{datalist.volunteer}}' wx:key id='{{item.id}}'>
<view class='cell_top'>
<view class='cellimg'>
<image src='{{item.photo?item.photo:"https://volunteer.cnpu.org/imgs/wode_02@2x.png"}}'></image>
</view>
<view>{{item.name}}</view>
<swiper indicator-dots="true" autoplay="true" indicator-color='#8C9194' indicator-active-color='#ffffff' class="slide-image">
<navigator wx:for="{{datalist.slide}}" wx:key hover-class="none" url='/pages/img_txt/img_txt?id={{item.activity_id}}&status=1'>
<swiper-item>
<image src="{{item.image}}" />
</swiper-item>
</navigator>
</swiper>
<view class='vold_line'></view>
<view class='index_volunteertitle'>
<view class='title'>志愿者</view>
<navigator url='/pages/more/more' hover-class="none">更多</navigator>
</view>
<view>{{item.duty}}
<view class='volunteerbox'>
<view class='volunteercell' wx:for='{{datalist.volunteer}}' wx:key id='{{item.id}}'>
<view class='cell_top'>
<view class='cellimg'>
<image src='{{item.photo?item.photo:"https://volunteer.cnpu.org/imgs/wode_02@2x.png"}}'></image>
</view>
<view>{{item.name}}</view>
</view>
<view>{{item.duty}}</view>
<view class='star_box'>
<image src="/imgs/xingxing_xuanzhong_icon@2x.png" mode='scaleToFill' wx:if='{{item.level>0}}'></image>
<image src="/imgs/xingxing_xuanzhong_icon@2x.png" mode='scaleToFill' wx:if='{{item.level>1}}'></image>
<image src="/imgs/xingxing_xuanzhong_icon@2x.png" mode='scaleToFill' wx:if='{{item.level>2}}'></image>
<image src="/imgs/xingxing_xuanzhong_icon@2x.png" mode='scaleToFill' wx:if='{{item.level>3}}'></image>
<image src="/imgs/xingxing_xuanzhong_icon@2x.png" mode='scaleToFill' wx:if='{{item.level>4}}'></image>
</view>
</view>
</view>
</view>
</view>
<view class='vold_line'></view>
<view class='index_newbox'>
<view class='title activity_title'>活动快讯</view>
<view>
<view class='new_box' wx:for='{{activity}}' wx:key >
<navigator class='new_cell' wx:for='{{item}}' wx:key url='/pages/img_txt/img_txt?id={{item.id}}&status=1' hover-class="none">
<view class='new_cellmain'>
<view class='new_img'>
<image src='{{item.thumbnail}}'> </image>
</view>
<view class='new_title'>{{item.activity_name}}</view>
<view>{{item.time}}</view>
<view class='vold_line'></view>
<view class='index_newbox'>
<view class='index_volunteertitle'>
<view class='title'>即将开始的活动</view>
<navigator url='/pages/index/active/active' hover-class="none">更多</navigator>
</view>
<view>
<view class='new_box'>
<navigator class='new_cell' wx:for='{{begin}}' wx:key url='/pages/img_txt/img_txt?id={{item.id}}&status=1' hover-class="none">
<view class='new_cellmain'>
<view class='new_img'>
<image src='{{item.thumbnail}}'> </image>
</view>
<view class='new_title'>{{item.activity_name}}</view>
<view class='title_box'>
<view>
<image src='/imgs/dizhi@2x.png' />
<text>{{item.province_name}}</text>
</view>
<view class='word'>{{item.type_name}}</view>
</view>
<view>{{item.time}}</view>
</view>
</navigator>
</view>
</view>
</view>
<view class='index_newbox'>
<view class='title activity_title'>活动快讯</view>
<view>
<view class='new_box' wx:for='{{activity}}' wx:key>
<navigator class='new_cell' wx:for='{{item}}' wx:key url='/pages/img_txt/img_txt?id={{item.id}}&status=1' hover-class="none">
<view class='new_cellmain'>
<view class='new_img'>
<image src='{{item.thumbnail}}'> </image>
</view>
<view class='new_title'>{{item.activity_name}}</view>
<view>{{item.time}}</view>
</view>
</navigator>
</view>
</view>
</view>
</navigator>
</view>
</view>
</view>
</scroll-view>
\ No newline at end of file
... ...
/**index.wxss**/
.slide-image{
height: 300rpx;
width:100%;
}
.slide-image image{
width:100%;
height: 100%;
}
.index_volunteertitle{
color:#666666;
font-size:26rpx;
display: flex;
justify-content: space-between;
align-items: center;
margin: 32rpx 32rpx 0 32rpx;
}
.title{
color:#333;
padding:0 0 0 20rpx;
font-size:32rpx;
font-weight: bold;
position: relative;
}
.title::after{
position: absolute;
content: '';
top:50%;
transform: translateY(-50%);
left:0;
width:4rpx;
height: 32rpx;
background: #21AE59;
}
.volunteerbox{
margin: 0 32rpx;
color:#999999;
font-size: 26rpx;
display: flex;
/* justify-content: space-between; */
align-items: center;
}
.volunteercell{
width:33%;
padding:30rpx 0;
}
.cell_top{
display: flex;
align-items: center;
color:#333;
font-size: 29rpx;
}
.cellimg{
display: flex;
align-items: cneter;
justify-content: center;
margin: 0 18rpx 16rpx 0;
width: 76rpx;
height: 76rpx;
border-radius: 50%;
overflow: hidden;
}
.cellimg image{
width:100%;
height: 100%;
display: block;
}
.index_newbox{
margin: 32rpx 0rpx 0 0rpx;
}
.new_box{
display: flex;
justify-content: space-between;
align-items: center;
color:#999;
padding:0 32rpx;
font-size:24rpx;
flex-wrap: wrap;
border-bottom: 1rpx solid #E6E6E6;
}
.new_cell{
width:48%;
padding:29rpx 0rpx;
/* border-bottom:1rpx solid #E6E6E6; */
}
.new_cell:nth-child(2n){
margin: 0 0 0 10rpx;
}
.new_cellmain{
overflow: hidden;
}
.new_img{
width:336rpx;
height: 220rpx;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.new_img image{
width:100%;
height: 100%;
display: block;
}
.new_title{
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin: 18rpx 0 13rpx 0;
color:#292929;
font-size:28rpx;
}
.activity_title{
margin: 0 32rpx;
.slide-image {
height: 300rpx;
width: 100%;
}
.slide-image image {
width: 100%;
height: 100%;
}
.index_volunteertitle {
color: #666;
font-size: 26rpx;
display: flex;
justify-content: space-between;
align-items: center;
margin: 32rpx 32rpx 0 32rpx;
}
.title {
color: #333;
padding: 0 0 0 20rpx;
font-size: 32rpx;
font-weight: bold;
position: relative;
}
.title::after {
position: absolute;
content: '';
top: 50%;
transform: translateY(-50%);
left: 0;
width: 4rpx;
height: 32rpx;
background: #21ae59;
}
.volunteerbox {
margin: 0 32rpx;
color: #999;
font-size: 26rpx;
display: flex;
/* justify-content: space-between; */
align-items: center;
}
.volunteercell {
width: 33%;
padding: 30rpx 0;
}
.cell_top {
display: flex;
align-items: center;
color: #333;
font-size: 29rpx;
}
.cellimg {
display: flex;
align-items: cneter;
justify-content: center;
margin: 0 18rpx 16rpx 0;
width: 76rpx;
height: 76rpx;
border-radius: 50%;
overflow: hidden;
}
.cellimg image {
width: 100%;
height: 100%;
display: block;
}
/* 22 */
.index_newbox {
margin: 32rpx 0rpx 0 0rpx;
}
.new_box {
display: flex;
justify-content: space-between;
align-items: center;
color: #999;
padding: 0 32rpx;
font-size: 24rpx;
flex-wrap: wrap;
border-bottom: 1rpx solid #e6e6e6;
}
.new_cell {
width: 48%;
padding: 29rpx 0rpx;
/* border-bottom:1rpx solid #E6E6E6; */
}
.new_cell:nth-child(2n) {
margin: 0 0 0 10rpx;
}
.new_cellmain {
overflow: hidden;
}
.new_img {
width: 336rpx;
height: 220rpx;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.new_img image {
width: 100%;
height: 100%;
display: block;
}
.new_title {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin: 18rpx 0 13rpx 0;
color: #292929;
font-size: 28rpx;
}
.activity_title {
margin: 0 32rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.title_box {
margin: 18rpx 0 13rpx 0;
color: #292929;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.title_box image{
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
}
.title_box .word{
color: #666;
font-size: 24rpx;
}
.star_box {
width: auto;
height: auto;
margin-top: 16rpx;
}
.star_box image {
width: 28rpx;
height: 26rpx;
padding-left: 5rpx;
padding-right: 5rpx;
}
.star_box image:first-child{
padding-left: 0;
}
.star_box image:last-child{
padding-right: 0;
}
\ No newline at end of file
... ...
// pages/more/more.js
const app=getApp();
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
page:0,
pageNum:24,
volunteer:''
},
getdatalist(){
let that=this;
let head = {
'XX-Token': wx.getStorageSync('token')
}
let url ='index/index/volunteer';
let params={
page: that.data.page,
pageNum: that.data.pageNum
/**
* 页面的初始数据
*/
data: {
star_num: 3,
page: 0,
pageNum: 24,
volunteer: ''
},
getdatalist() {
let that = this;
let head = {
'XX-Token': wx.getStorageSync('token')
}
let url = 'index/index/volunteer';
let params = {
page: that.data.page,
pageNum: that.data.pageNum
}
app.post(url, params, head).then((res) => {
let volunteer = res.volunteer;
let datavolunteer = this.data.volunteer;
let tem = [];
let temvolunteer = [];
for (let i = 0; i < volunteer.length; i++) {
tem.push(volunteer[i]);
if ((i + 1) != volunteer.length) {
if ((i + 1) % 3 == 0) {
temvolunteer.push(tem);
tem = [];
}
} else {
temvolunteer.push(tem);
tem = [];
}
}
let setvolunteer = datavolunteer.concat(temvolunteer);
that.setData({
volunteer: setvolunteer,
page: res.page
})
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let windowHeight = wx.getSystemInfoSync().windowHeight; // 屏幕的高度
let windowWidth = wx.getSystemInfoSync().windowWidth // 屏幕的宽度
this.setData({
scroll_height: windowHeight * 750 / windowWidth
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
let that = this;
that.setData({
volunteer: [],
page: 0
})
that.getdatalist();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
app.post(url,params,head).then((res)=>{
let volunteer= res.volunteer;
let datavolunteer = this.data.volunteer;
let tem=[];
let temvolunteer=[];
for (let i = 0; i < volunteer.length;i++){
tem.push(volunteer[i]);
if ((i + 1) != volunteer.length){
if ((i + 1) % 3 == 0) {
temvolunteer.push(tem);
tem = [];
}
}else{
temvolunteer.push(tem);
tem = [];
}
}
let setvolunteer = datavolunteer.concat(temvolunteer);
that.setData({
volunteer: setvolunteer,
page: res.page
})
}).catch((err)=>{
console.log(err)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let windowHeight = wx.getSystemInfoSync().windowHeight;// 屏幕的高度
let windowWidth = wx.getSystemInfoSync().windowWidth // 屏幕的宽度
this.setData({
scroll_height: windowHeight * 750 / windowWidth
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let that=this;
that.setData({
volunteer: [],
page: 0
})
that.getdatalist();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
<!--pages/more/more.wxml-->
<scroll-view scroll-y='true' bindscrolltolower='getdatalist' style='height:{{scroll_height}}rpx' >
<bolck wx:for='{{volunteer}}' wx:key>
<view class='volunteerbox'>
<view class='volunteercell' wx:for='{{item}}' wx:key >
<view class='cell_top'>
<view class='cellimg'>
<image src='{{item.photo?item.photo:"https://volunteer.cnpu.org/imgs/wode_02@2x.png"}}'></image>
</view>
<view>{{item.name}}</view>
</view>
<view>{{item.duty}}
</view>
</view>
</view>
<view class='vold_line'></view>
</bolck>
</scroll-view>
<scroll-view scroll-y='true' bindscrolltolower='getdatalist' style='height:{{scroll_height}}rpx'>
<bolck wx:for='{{volunteer}}' wx:key>
<view class='volunteerbox'>
<view class='volunteercell' wx:for='{{item}}' wx:key>
<view class='cell_top'>
<view class='cellimg'>
<image src='{{item.photo?item.photo:"https://volunteer.cnpu.org/imgs/wode_02@2x.png"}}'></image>
</view>
<view>{{item.name}}</view>
</view>
<view>{{item.duty}}
</view>
<view class='star_box'>
<image src="/imgs/xingxing_xuanzhong_icon@2x.png" mode='scaleToFill' wx:if='{{item.level>0}}'></image>
<image src="/imgs/xingxing_xuanzhong_icon@2x.png" mode='scaleToFill' wx:if='{{item.level>1}}'></image>
<image src="/imgs/xingxing_xuanzhong_icon@2x.png" mode='scaleToFill' wx:if='{{item.level>2}}'></image>
<image src="/imgs/xingxing_xuanzhong_icon@2x.png" mode='scaleToFill' wx:if='{{item.level>3}}'></image>
<image src="/imgs/xingxing_xuanzhong_icon@2x.png" mode='scaleToFill' wx:if='{{item.level>4}}'></image>
</view>
</view>
</view>
<view class='vold_line'></view>
</bolck>
</scroll-view>
\ No newline at end of file
... ...
... ... @@ -9,3 +9,21 @@
width:33.333%;
padding:30rpx 0rpx;
}
.star_box {
width: auto;
height: auto;
margin-top: 16rpx;
}
.star_box image {
width: 28rpx;
height: 26rpx;
padding-left: 5rpx;
padding-right: 5rpx;
}
.star_box image:first-child{
padding-left: 0;
}
.star_box image:last-child{
padding-right: 0;
}
\ No newline at end of file
... ...
// pages/my/my.js
const app=getApp();
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
datalist:'',
},
getdatalist(){
let that=this;
let url ='index/member_center/index';
let head={
'XX-Token': wx.getStorageSync('token')
/**
* 页面的初始数据
*/
data: {
star_num: 3,
datalist: '',
},
getdatalist() {
let that = this;
let url = 'index/member_center/index';
let head = {
'XX-Token': wx.getStorageSync('token')
}
app.post(url, {}, head).then((res) => {
that.setData({
datalist: res
})
}).catch((err) => {
console.log(err)
})
},
goamdin() {
let that = this;
wx.navigateTo({
url: '/pages/admin/admin'
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
let that = this;
that.getdatalist();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
app.post(url, {}, head).then((res)=>{
that.setData({
datalist:res
})
}).catch((err)=>{
console.log(err)
})
},
goamdin(){
let that=this;
wx.navigateTo({
url: '/pages/admin/admin'
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let that=this;
that.getdatalist();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
<!--pages/my/my.wxml-->
<view class='my_head'>
<image src='https://volunteer.cnpu.org/imgs/gerenzhongxin_bg@2x.png'></image>
<view class='my_headitem'>
<view class='my_headitemimg'>
<image src='{{datalist.avatar}}'></image>
<image src='https://volunteer.cnpu.org/imgs/gerenzhongxin_bg@2x.png'></image>
<view class='my_headitem'>
<view class='my_headitemimg'>
<image src='{{datalist.avatar}}'></image>
</view>
<view class='word'>{{datalist.user_nickname}}</view>
<view class='word'>已完成的工时: {{datalist.work_time}}h</view>
<view class='star_box'>
<image src="/imgs/xingxing_xuanzhong_icon@2x.png" mode='scaleToFill' wx:if='{{datalist.level>0}}'></image>
<image src="/imgs/xingxing_xuanzhong_icon@2x.png" mode='scaleToFill' wx:if='{{datalist.level>1}}'></image>
<image src="/imgs/xingxing_xuanzhong_icon@2x.png" mode='scaleToFill' wx:if='{{datalist.level>2}}'></image>
<image src="/imgs/xingxing_xuanzhong_icon@2x.png" mode='scaleToFill' wx:if='{{datalist.level>3}}'></image>
<image src="/imgs/xingxing_xuanzhong_icon@2x.png" mode='scaleToFill' wx:if='{{datalist.level>4}}'></image>
</view>
</view>
<view>{{datalist.user_nickname}}</view>
</view>
</view>
<view class='my_itembox'>
<navigator class='my_item' url='/pages/apply/apply?id={{datalist.id}}&is_submit={{datalist.is_submit}}' hover-class="none" >
<view class='my_itemletf'>
<view class='iconfont icon-aixin'></view>成为志愿者
</view>
<view class='iconfont icon-xiangyou'></view>
</navigator>
<navigator class='my_item' url='/pages/result/result' hover-class="none">
<view class='my_itemletf'>
<view class='iconfont icon-chakanshenqing'></view>查看审核状态
</view>
<view class='iconfont icon-xiangyou'></view>
</navigator>
<navigator class='my_item' url='/pages/apply/apply?id={{datalist.id}}&is_submit={{datalist.is_submit}}' hover-class="none">
<view class='my_itemletf'>
<view class='iconfont icon-aixin'></view>成为志愿者
</view>
<view class='iconfont icon-xiangyou'></view>
</navigator>
<navigator class='my_item' url='/pages/result/result' hover-class="none">
<view class='my_itemletf'>
<view class='iconfont icon-chakanshenqing'></view>查看审核状态
</view>
<view class='iconfont icon-xiangyou'></view>
</navigator>
<navigator class='my_item' url='/pages/img_txt/img_txt' hover-class="none" url='/pages/img_txt/img_txt?status=3'>
<view class='my_itemletf'>
<view class='iconfont icon-lianximaijia'></view>联系我们
</view>
<view class='iconfont icon-xiangyou'></view>
</navigator>
<navigator class='my_item' url='/pages/img_txt/img_txt' hover-class="none" url='/pages/img_txt/img_txt?status=2'>
<view class='my_itemletf'>
<view class='iconfont icon-renyuanxiaozu'></view>关于我们
</view>
<view class='iconfont icon-xiangyou'></view>
</navigator>
<view class='my_item' bindtap='goamdin' wx:if='{{datalist.type=="2"}}'>
<view class='my_itemletf'>
<view class='iconfont icon-gongzhang'></view>管理员审核
<view class='my_itemletf'>
<view class='iconfont icon-lianximaijia'></view>联系我们
</view>
<view class='iconfont icon-xiangyou'></view>
</navigator>
<navigator class='my_item' url='/pages/img_txt/img_txt' hover-class="none" url='/pages/img_txt/img_txt?status=2'>
<view class='my_itemletf'>
<view class='iconfont icon-renyuanxiaozu'></view>关于我们
</view>
<view class='iconfont icon-xiangyou'></view>
</navigator>
<navigator class='my_item' url='/pages/my/my_active/my_active' hover-class="none">
<view class='my_itemletf'>
<image src='/imgs/activity-close-open@2x.png' mode='widthFix'></image>参与过的活动
</view>
<view class='iconfont icon-xiangyou'></view>
</navigator>
<view class='my_item' bindtap='goamdin' wx:if='{{datalist.type=="2"}}'>
<view class='my_itemletf'>
<view class='iconfont icon-gongzhang'></view>管理员审核
</view>
<view class='iconfont icon-xiangyou'></view>
</view>
<view class='iconfont icon-xiangyou'></view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/my/my.wxss */
.my_head{
position: relative;
height: 268rpx;
width:750rpx;
}
.my_head image{
width:100%;
height: 100%;
display: block;
}
.my_headitem{
position: absolute;
left:50%;
bottom:-93rpx;
transform: translateX(-50%);
color:#5E6661;
font-weight: bold;
font-size:32rpx;
}
.my_headitemimg{
margin: 0 0 32rpx 0;
width:132rpx;
height: 132rpx;
border-radius: 50%;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}
.my_headitemimg image{
width:100%;
height: 100%;
display: block;
}
.my_itembox{
margin: 210rpx 0 0 0;
}
.my_item{
display: flex;
align-items: center;
justify-content: space-between;
color:#333;
font-size:32rpx;
padding:30rpx 32rpx;
border-bottom: 1px solid #e6e6e6;
.my_head {
position: relative;
height: 268rpx;
width: 750rpx;
}
.my_item .iconfont{
color:#ccc;
font-size:32rpx;
.my_head image {
width: 100%;
height: 100%;
display: block;
}
.my_headitem {
position: absolute;
left: 50%;
bottom: -93rpx;
transform: translateX(-50%);
color: #5e6661;
font-weight: bold;
font-size: 32rpx;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
.my_headitemimg {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.my_headitemimg image {
width: 132rpx;
height: 132rpx;
border-radius: 50%;
display: block;
}
.my_headitem .word {
width: 100%;
text-align: center;
margin-top: 10rpx;
}
.my_itembox {
margin: 210rpx 0 0 0;
}
.my_itemletf{
display: flex;
align-items: center;
justify-content: center;
color:#333;
font-size: 32rpx;
.my_item {
display: flex;
align-items: center;
justify-content: space-between;
color: #333;
font-size: 32rpx;
padding: 30rpx 32rpx;
border-bottom: 1px solid #e6e6e6;
}
.my_item .iconfont {
color: #ccc;
font-size: 32rpx;
}
.my_itemletf {
display: flex;
align-items: center;
justify-content: center;
color: #333;
font-size: 32rpx;
}
.my_itemletf image{
width: 64rpx;
height: 64rpx;
margin-right: 5rpx;
position: relative;
left: -10rpx;
top: 0;
}
.my_itemletf .iconfont{
font-size:40rpx;
color:#FA8286;
margin: 0 32rpx 0 0;
.my_itemletf .iconfont {
font-size: 40rpx;
color: #fa8286;
margin: 0 32rpx 0 0;
}
.my_itemletf .icon-chakanshenqing{
color:#68A6FF;
.my_itemletf .icon-chakanshenqing {
color: #68a6ff;
}
.my_itemletf .icon-renyuanxiaozu {
color: #f9a949;
}
.my_itemletf .icon-gongzhang {
color: #44cbee;
}
.my_itemletf .icon-renyuanxiaozu{
color:#F9A949;
.star_box {
width: auto;
height: auto;
margin-top: 16rpx;
display: flex;
justify-content: space-between;
}
.my_itemletf .icon-gongzhang{
color:#44CBEE;
.star_box image {
width: 28rpx;
height: 26rpx;
padding-left: 10rpx;
padding-right: 10rpx;
}
\ No newline at end of file
... ...
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
},
getdatalist() {
let that = this;
let url = '/index/member_center/joined';
let head = {
'XX-Token': wx.getStorageSync('token')
}
let params = {}
app.post(url, params, head).then((res) => {
console.log(res)
that.setData({
activity: res
})
// let activity = res.activity;
// let tem = [];
// let temactivity = [];
// for (let i = 0; i < activity.length; i++) {
// tem.push(activity[i])
// if ((i + 1) != activity.length) {
// if ((i + 1) % 2 == 0) {
// temactivity.push(tem);
// tem = [];
// }
// } else {
// temactivity.push(tem);
// tem = [];
// }
// }
// let dataactivity = that.data.activity;
// let temdataactivity = dataactivity.concat(temactivity);
// that.setData({
// datalist: res,
// activity: temdataactivity,
// activity_page: res.activity_page
// })
}).catch((err) => {
console.log(err)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let that = this;
that.getdatalist();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "我的活动"
}
\ No newline at end of file
... ...
<view class='index_newbox'>
<view>
<view class='new_box' wx:key>
<navigator class='new_cell' wx:for='{{activity}}' wx:key url='/pages/img_txt/img_txt?id={{item.id}}&status=1' hover-class="none">
<view class='new_cellmain'>
<view class='new_img'>
<image src='{{item.thumbnail}}'> </image>
</view>
<view class='new_title'>{{item.activity_name}}</view>
<view class='title_box'>
<view>
<image src='/imgs/dizhi@2x.png' />
<text>北京</text>
</view>
<view class='word'>{{item.type_name}}</view>
</view>
<view>{{item.create_time}}</view>
</view>
</navigator>
</view>
</view>
</view>
<view class='empty' wx:if='{{activity.length == 0}}'>暂无数据</view>
\ No newline at end of file
... ...
.index_newbox {
margin: 32rpx 0rpx 0 0rpx;
}
.new_box {
display: flex;
justify-content: space-between;
align-items: center;
color: #999;
padding: 0 32rpx;
font-size: 24rpx;
flex-wrap: wrap;
}
.new_cell {
width: 48%;
padding: 29rpx 0rpx;
/* border-bottom:1rpx solid #E6E6E6; */
}
.new_cell:nth-child(2n) {
margin: 0 0 0 10rpx;
}
.new_cellmain {
overflow: hidden;
}
.new_img {
width: 336rpx;
height: 220rpx;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.new_img image {
width: 100%;
height: 100%;
display: block;
}
.new_title {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin: 18rpx 0 13rpx 0;
color: #292929;
font-size: 28rpx;
}
.activity_title {
margin: 0 32rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.activity_title .more{
display: inline-block;
color: #999;
padding: 5rpx 10rpx;
border: 2rpx solid #999;
font-size: 28rpx;
}
.title_box {
margin: 18rpx 0 13rpx 0;
color: #292929;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.title_box image{
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
}
.title_box .word{
color: #666;
font-size: 24rpx;
}
.empty{
width: 100%;
font-size: 32rpx;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: #97a0a8;
text-align: center;
margin-top: 50rpx;
}
\ No newline at end of file
... ...
... ... @@ -4,16 +4,17 @@
"ignore": []
},
"setting": {
"urlCheck": true,
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true
"newFeature": true,
"autoAudits": false
},
"compileType": "miniprogram",
"libVersion": "2.4.3",
"libVersion": "2.6.0",
"appid": "wx7a3bf4e0796c070a",
"projectname": "zhiyuanzhe1",
"projectname": "zhiyuanzhe",
"debugOptions": {
"hidedInDevtools": []
},
... ... @@ -36,57 +37,8 @@
"list": []
},
"miniprogram": {
"current": 2,
"list": [
{
"id": -1,
"name": "index",
"pathName": "pages/index/index",
"query": ""
},
{
"id": 1,
"name": "index",
"pathName": "pages/img_txt/img_txt",
"query": ""
},
{
"id": 2,
"name": "apply",
"pathName": "pages/apply/apply",
"query": ""
},
{
"id": -1,
"name": "index",
"pathName": "pages/close_apply/close_apply",
"query": "id=2"
},
{
"id": -1,
"name": "mao",
"pathName": "pages/mao/mao",
"query": ""
},
{
"id": -1,
"name": "start",
"pathName": "pages/start/start",
"query": ""
},
{
"id": -1,
"name": "my",
"pathName": "pages/my/my",
"query": ""
},
{
"id": -1,
"name": "o_my",
"pathName": "pages/start/start",
"query": ""
}
]
"current": -1,
"list": []
}
}
}
\ No newline at end of file
... ...