Commit 6c8124b6 by biao

11

parent 6d06c32b
// pages/getCertificate/getCertificate.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
certificateList:[],
name:'',//收件人姓名
mobile: '',//收件人手机
address: '',//详细收件地址
inpShow: false,
certificateId:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function () {
//获取全部的证书
this.getCertificateList();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
//获取全部的证书
getCertificateList() {
var that = this;
//获取用户的证书
var config = wx.getStorageSync('config');
wx.request({
url: app.url + 'ajax_get_certificates.php',
data: {
unionId: config.unionId
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
that.setData({
certificateList: res.data.result.certificateList
})
},
fail: function (res) { },
complete: function (res) { },
})
},
//证书申领
applyCertificate(e) {
let certificateId = e.currentTarget.dataset['index'];
this.setData({
inpShow: true,
certificateId: certificateId
})
},
// 输入姓名
changeName(event){
this.setData({
name: event.detail.value
})
},
// 输入手机号
changeMobile(event) {
this.setData({
mobile: event.detail.value
})
},
// 输入详细地址
changeAddress(event) {
this.setData({
address: event.detail.value
})
},
sureApplyCertificate() {
var that = this;
var config = wx.getStorageSync('config');
wx.request({
url: app.url + 'ajax_apply_certificate.php',
data: {
unionId: config.unionId,
certificateId: that.data.certificateId,
name: that.data.name,
mobile: that.data.mobile,
address: that.data.address
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
that.setData({
inpShow:false
})
wx.showToast({
title: res.data.result.message,
icon: 'success',
duration: 2000
});
//跳转到我的证书
wx.navigateTo({
url: '../myCertificate/myCertificate'
})
},
fail: function (res) { },
complete: function (res) { },
})
},
backApplyCertificate(){
this.setData({
inpShow:false
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "证书申领"
}
\ No newline at end of file
<!--pages/myCertificate/myCertificate.wxml-->
<view class='myCertificate'>
<view style='font-size:12px;color:#666;float:right;padding-right:15px;'>
</view>
<view class="certificateItem" wx:for="{{certificateList}}">
<image src='{{item.front_image}}'></image>
<view class="getRow">
<text>{{item.title}}</text>
<van-button type="default" size='mini' bindtap="applyCertificate" data-index='{{item.id}}'>申领</van-button>
</view>
</view>
</view>
<!--添加底部弹出对话框开始-->
<view class='bot_myCertificate' wx:if="{{inpShow==true}}">
<view class='con_bot_myCertificate'>
<input placeholder='请输入姓名' value='{{name}}' bindinput='changeName'></input>
<input placeholder='请输入手机号' value='{{mobile}}' bindinput='changeMobile'></input>
<input placeholder='请输入收件地址' value='{{address}}' bindinput='changeAddress'></input>
<view class='btnBot'>
<view bindtap='backApplyCertificate'>取消</view>
<view style='background:#00C56B;' bindtap='sureApplyCertificate'>确定</view>
</view>
</view>
</view>
<!--添加底部弹出对话框结束-->
\ No newline at end of file
/* pages/myCertificate/myCertificate.wxss */
page{
width: 100%;
height: 100%;
}
.certificateItem{
margin-top: 10px;
width: 90%;
margin: 0 auto;
display: flex;
flex-direction:column;
justify-content : space-between;
align-items:center;
font-size: 14px;
border-bottom: 1px solid #F0F0F0;
}
.certificateItem>image{
width:100%;
}
.getRow{
margin-top: 10px;
width: 100%;
display: flex;
flex-direction:row;
justify-content : space-between;
align-items:center;
}
.getRow>text{
width:100%;
height:35px;
line-height: 35px;
text-align: left;
}
.bot_myCertificate{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5)
}
.con_bot_myCertificate{
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 80%;
height: 150px;
background: #fff;
border-radius: 15px 15px 0 0;
}
.con_bot_myCertificate>input{
width: 80%;
height: 25px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px auto;
font-size: 12px;
box-sizing: border-box;
padding-left: 15px;
}
.btnBot{
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 80%;
height: 25px;
display: flex;
justify-content: space-between;
}
.btnBot>view{
flex: 1;
height: 25px;
text-align: center;
line-height: 25px;
font-size: 12px;
}
\ No newline at end of file
...@@ -51,14 +51,44 @@ $param['delete_flg'] = false; ...@@ -51,14 +51,44 @@ $param['delete_flg'] = false;
if($userMst->role == 5 || $userMst->role == 6) { if($userMst->role == 5 || $userMst->role == 6) {
$param['include_social_user'] = true; $param['include_social_user'] = true;
} }
$volunteerEventList = VolunteerEventDat::getList($param,'id','desc', $offset, $rowCount); $volunteerEventList = array();
$tmpVolunteerEventList = VolunteerEventDat::getList($param,'id','desc', $offset, $rowCount);
$volunteerEvenCount = VolunteerEventDat::getListCount($param); $volunteerEvenCount = VolunteerEventDat::getListCount($param);
$pageCount = ceil($volunteerEvenCount/$rowCount);
//查询所在区域能力分汇总
//能力分汇总
$abilityPoint = 0;
$sql = "select sum(ability_point) as ability_point from user_mst where delete_flg = false and school_no is not null and province='{$province}'";
if(!empty($city)) {
$sql .= " and city='{$city}'";
}
if(!empty($district)) {
$sql .= " and district='{$district}'";
}
$db = &CompassDBManager::getInstance();
$tmp = $db->executeQuery($sql);
if(!empty($tmp)) {
$abilityPoint = $tmp[0]['ability_point'];
}
$result["abilityPoint"] = $abilityPoint;
//设置状态和招募范围
foreach($tmpVolunteerEventList as $tmp) {
$tmp->status_title = "征集中";
$tmp->scope = "校内";
if($tmp->include_social_user) {
$tmp->scope = "校内.社会人士";
}
$volunteerEventList[] = $tmp;
}
//组装返回数据 //组装返回数据
$result["rowCount"] = $rowCount; $result["rowCount"] = $rowCount;
$result["page"] = $page; $result["page"] = $page;
$result["volunteerEvenCount"] = $volunteerEvenCount; $result["pageCount"] = $pageCount;
$result["volunteerEventList"] = $volunteerEventList; $result["volunteerEventList"] = $volunteerEventList;
ErrorLogger::doOutput("Compass...ajax_get_volunteer_event_list.php....End.", 0); ErrorLogger::doOutput("Compass...ajax_get_volunteer_event_list.php....End.", 0);
......
src/wx/img/jia.png

4.33 KB | W: | H:

src/wx/img/jia.png

15.6 KB | W: | H:

src/wx/img/jia.png
src/wx/img/jia.png
src/wx/img/jia.png
src/wx/img/jia.png
  • 2-up
  • Swipe
  • Onion skin
src/wx/img/sanjiao.png

2.25 KB | W: | H:

src/wx/img/sanjiao.png

15.4 KB | W: | H:

src/wx/img/sanjiao.png
src/wx/img/sanjiao.png
src/wx/img/sanjiao.png
src/wx/img/sanjiao.png
  • 2-up
  • Swipe
  • Onion skin
src/wx/img/search.png

6.75 KB | W: | H:

src/wx/img/search.png

19.7 KB | W: | H:

src/wx/img/search.png
src/wx/img/search.png
src/wx/img/search.png
src/wx/img/search.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -98,16 +98,14 @@ Page({ ...@@ -98,16 +98,14 @@ Page({
console.log(res) console.log(res)
if (res.statusCode == 200) { if (res.statusCode == 200) {
that.setData({ that.setData({
circleList: res.data.result.circleList circleList: res.data.result.circleList,
showNearCircles: 1
}) })
} }
}, },
fail: function (res) { }, fail: function (res) { },
complete: function (res) { }, complete: function (res) { },
}) })
this.setData({
showNearCircles:1
})
}, },
//圈子详细 //圈子详细
......
...@@ -13,7 +13,10 @@ ...@@ -13,7 +13,10 @@
<text>我的圈子</text> <text>我的圈子</text>
<view class='myQuanzilist'> <view class='myQuanzilist'>
<view wx:for="{{userCircleList}}" wx:key="{{index}}"> <view wx:for="{{userCircleList}}" wx:key="{{index}}">
<view>
<image src='{{item.front_image}}'></image>
<text>{{item.circle_title}}</text> <text>{{item.circle_title}}</text>
</view>
<van-button type="default" size='small' bind:click="circleDetails">进入</van-button> <van-button type="default" size='small' bind:click="circleDetails">进入</van-button>
</view> </view>
</view> </view>
...@@ -29,9 +32,9 @@ ...@@ -29,9 +32,9 @@
<view class='con_conQuanzi' wx:if="{{showNearCircles==1}}"> <view class='con_conQuanzi' wx:if="{{showNearCircles==1}}">
<view class='quanziList' wx:for="{{circleList}}" wx:key="{{index}}"> <view class='quanziList' wx:for="{{circleList}}" wx:key="{{index}}">
<view> <view>
<text></text>{{item.circle_title}} <image src='{{item.front_image}}'></image>{{item.circle_title}}
</view>
<text>({{item.member_count}}人)</text> <text>({{item.member_count}}人)</text>
</view>
<van-button type="default" size='mini' bind:click="joinCircle">进圈</van-button> <van-button type="default" size='mini' bind:click="joinCircle">进圈</van-button>
</view> </view>
</view> </view>
......
...@@ -69,6 +69,18 @@ ...@@ -69,6 +69,18 @@
padding: 10px; padding: 10px;
font-size: 14px; font-size: 14px;
} }
.myQuanzilist>view>view{
flex: 1;
display: flex;
align-items: center;
}
.myQuanzilist>view>view>image{
width: 30px;
height: 30px;
border: 1px solid #ccc;
border-radius: 50%;
margin-right: 5px;
}
.top_conQuanzi{ .top_conQuanzi{
width: 100%; width: 100%;
display: flex; display: flex;
...@@ -110,13 +122,17 @@ ...@@ -110,13 +122,17 @@
font-size: 14px; font-size: 14px;
} }
.quanziList>view{ .quanziList>view{
flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.quanziList>view>text{ .quanziList>view>image{
width: 30px; width: 30px;
height: 30px; height: 30px;
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 50%; border-radius: 50%;
margin-right: 5px; margin-right: 5px;
} }
.quanziList>view>text{
margin-left: 10px;
}
\ No newline at end of file
...@@ -45,6 +45,21 @@ Page({ ...@@ -45,6 +45,21 @@ Page({
success: function (res) { success: function (res) {
console.log(res) console.log(res)
if(res.statusCode==200){ if(res.statusCode==200){
//保存用户当前的省市区县信息
location.province = res.data.result.province
location.city = res.data.result.city
location.district = res.data.result.district
wx.setStorage({
key: 'location',
data: location,
})
//保存用户名称信息
config.name = res.data.result.name
wx.setStorage({
key: 'config',
data: config,
})
//未注册用户的话。跳转到社会人士注册页面 //未注册用户的话。跳转到社会人士注册页面
if (res.data.status =="REGIST") { if (res.data.status =="REGIST") {
//页面跳转 //页面跳转
...@@ -75,37 +90,12 @@ Page({ ...@@ -75,37 +90,12 @@ Page({
showNews: false showNews: false
}) })
} }
that.getIndexData();
} }
}, },
fail: function (res) { }, fail: function (res) { },
complete: function (res) { }, complete: function (res) { },
}) })
//获取首页数据
wx: wx.request({
url: app.url + 'ajax_get_top_dat.php',
data: {
unionId: config.unionId,
province: location.province,
city: location.city,
district: location.district
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
//设定页面数据
that.setData({
volunteerEventList: res.data.result.volunteerEventList,
familyEventList: res.data.result.familyEventList,
socialEventList: res.data.result.socialEventList,
mediaList: res.data.result.mediaList
})
console.log(res)
},
fail: function (res) { },
complete: function (res) { },
})
}, },
/** /**
...@@ -143,6 +133,37 @@ Page({ ...@@ -143,6 +133,37 @@ Page({
}, },
//获取首页数据
getIndexData(e) {
var that = this;
var config = wx.getStorageSync('config');
var location = wx.getStorageSync('location');
wx.request({
url: app.url + 'ajax_get_top_dat.php',
data: {
unionId: config.unionId,
province: location.province,
city: location.city,
district: location.district
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
//设定页面数据
that.setData({
volunteerEventList: res.data.result.volunteerEventList,
familyEventList: res.data.result.familyEventList,
socialEventList: res.data.result.socialEventList,
mediaList: res.data.result.mediaList
})
console.log(res)
},
fail: function (res) { },
complete: function (res) { },
})
},
//志愿者活动详情 //志愿者活动详情
volunteersEventDetail(e){ volunteersEventDetail(e){
let volunteersEventId = e.currentTarget.dataset['index'] let volunteersEventId = e.currentTarget.dataset['index']
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</view> </view>
<scroll-view scroll-y="true" style='height:750rpx;bottom:10rpx;' bindscrolltolower='loadMore'> <scroll-view scroll-y="true" style='height:750rpx;bottom:10rpx;' bindscrolltolower='loadMore'>
<view class='circleItem' bindtap='cicleDetails' wx:for="{{circleList}}" > <view class='circleItem' bindtap='cicleDetails' wx:for="{{circleList}}" >
<view class='circleIitle'>{{item.title}}</view> <view class='circleIitle'><image src='{{item.front_image}}'></image>{{item.title}}</view>
<view class='circleMemberCount'>({{item.member_count}}人)</view> <view class='circleMemberCount'>({{item.member_count}}人)</view>
<view class='circleJoin' bindtap='circleJoin' data-index="{{item.id}}">进圈</view> <view class='circleJoin' bindtap='circleJoin' data-index="{{item.id}}">进圈</view>
</view> </view>
......
...@@ -45,8 +45,15 @@ ...@@ -45,8 +45,15 @@
.circleItem .circleIitle{ .circleItem .circleIitle{
width: 55%; width: 55%;
height: 30px; height: 30px;
text-align: left; display: flex;
line-height: 30px; align-items: center;
}
.circleItem .circleIitle>image{
width: 30px;
height: 30px;
border: 1px solid #ccc;
border-radius: 50%;
margin-right: 5px;
} }
.circleItem .circleMemberCount{ .circleItem .circleMemberCount{
width: 14%; width: 14%;
......
...@@ -10,6 +10,8 @@ Page({ ...@@ -10,6 +10,8 @@ Page({
place:'', place:'',
page: 0,//当前页数 page: 0,//当前页数
pageCount: 0,//总页数 pageCount: 0,//总页数
abilityPoint: 0,//能力分汇总
//数据加载loading //数据加载loading
showLoading: false, showLoading: false,
}, },
...@@ -27,7 +29,8 @@ Page({ ...@@ -27,7 +29,8 @@ Page({
showLoading: true, showLoading: true,
}) })
wx: wx.request({ //检索志愿者活动列表
wx.request({
url: app.url + 'ajax_get_volunteer_event_list.php', url: app.url + 'ajax_get_volunteer_event_list.php',
data: { data: {
unionId: config.unionId, unionId: config.unionId,
...@@ -42,8 +45,11 @@ Page({ ...@@ -42,8 +45,11 @@ Page({
if (res.statusCode == 200) { if (res.statusCode == 200) {
console.log(res) console.log(res)
that.setData({ that.setData({
page: res.data.result.page,
pageCount: res.data.result.pageCount,
volunteerEventList: res.data.result.volunteerEventList, volunteerEventList: res.data.result.volunteerEventList,
page: res.data.result.page abilityPoint: res.data.result.abilityPoint
}) })
} }
}, },
...@@ -67,27 +73,6 @@ Page({ ...@@ -67,27 +73,6 @@ Page({
}, },
/** /**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
...@@ -100,15 +85,16 @@ Page({ ...@@ -100,15 +85,16 @@ Page({
onShareAppMessage: function () { onShareAppMessage: function () {
}, },
paiming(){
//志愿者排名1
rank1(){
wx.navigateTo({ wx.navigateTo({
url: '../volunteersRank3/volunteersRank3', url: '../volunteersRank1/volunteersRank1',
}); });
wx.setNavigationBarTitle({
title: '志愿者排名'
})
}, },
activeXiangxi(e){
//志愿者活动详情页面
volunteersEventDetail(e){
let id = e.currentTarget.dataset['id']; let id = e.currentTarget.dataset['id'];
wx.navigateTo({ wx.navigateTo({
url: '../volunteersEventDetail/volunteersEventDetail?id='+id, url: '../volunteersEventDetail/volunteersEventDetail?id='+id,
......
...@@ -6,25 +6,24 @@ ...@@ -6,25 +6,24 @@
<image src='../../img/sanjiao.png'></image>志愿者活动 <image src='../../img/sanjiao.png'></image>志愿者活动
</view> </view>
<view style='font-size:12px;color:#666;padding-right:15px'> <view style='font-size:12px;color:#666;padding-right:15px'>
<van-button type="default" size='mini' bind:click="paiming">排名</van-button>志愿能力分:<text>100</text> <van-button type="default" size='mini' bind:click="rank1">排名</van-button>志愿能力分:<text>{{abilityPoint}}</text>
</view> </view>
</view> </view>
<view class='listVolunteers'> <view class='listVolunteers'>
<scroll-view scroll-y="true" style='height:1000rpx;bottom:10rpx;' class="listPublicWelfare" bindscrolltolower='loadMore'> <scroll-view scroll-y="true" style='height:1000rpx;bottom:10rpx;' class="listPublicWelfare" bindscrolltolower='loadMore'>
<view class='activelist' bindtap='activeXiangxi' wx:for="{{volunteerEventList}}" wx:key="{{volunteerEventList[index].id}}" data-id='{{item.id}}'> <view class='activelist' bindtap='volunteersEventDetail' wx:for="{{volunteerEventList}}" wx:key="{{volunteerEventList[index].id}}" data-id='{{item.id}}'>
<view class='left_listVolunteers'> <view class='left_listVolunteers'>
<image src='{{item.front_image}}'></image> <image src='{{item.front_image}}'></image>
<text>征集中</text> <text>{{item.status_title}}</text>
<view>(市)</view> <!--<view>(市)</view>-->
</view> </view>
<view class='right_listVolunteers'> <view class='right_listVolunteers'>
<text>{{item.title}}</text> <text>{{item.title}}</text>
<view> <view>
<text wx:if="{{item.include_social_user=='true'}}">征集范围:不限\n</text> <text>征集范围:{{item.scope}}\n</text>
<text wx:else>征集范围:校内\n</text>
<text>征集人数:{{item.max_member}}人\n</text> <text>征集人数:{{item.max_member}}人\n</text>
<text>发布单位:{{item.city}}教育局\n</text> <text>发布单位:{{item.author}}\n</text>
<text>报名截止:{{item.registration_date}}</text> <text>报名截止:{{item.enroll_time}}</text>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -6,6 +6,7 @@ Page({ ...@@ -6,6 +6,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
name:'',
rankList:[] rankList:[]
}, },
...@@ -15,11 +16,13 @@ Page({ ...@@ -15,11 +16,13 @@ Page({
onLoad: function (options) { onLoad: function (options) {
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
var that=this; var that=this;
wx: wx.request({ that.setData({
name: config.name
})
wx.request({
url: app.url + 'ajax_get_volunteer_rank1.php', url: app.url + 'ajax_get_volunteer_rank1.php',
data: { data: {
unionId: config.unionId, unionId: config.unionId
age: 4
}, },
header: { 'content-type': 'application/json' }, header: { 'content-type': 'application/json' },
method: 'GET', method: 'GET',
...@@ -51,27 +54,6 @@ Page({ ...@@ -51,27 +54,6 @@ Page({
}, },
/** /**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
...@@ -83,5 +65,13 @@ Page({ ...@@ -83,5 +65,13 @@ Page({
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
} },
//志愿者排名2
rank2(e) {
let province = e.currentTarget.dataset['index']
wx.navigateTo({
url: '../volunteersRank2/volunteersRank2?province=' + province,
});
},
}) })
\ No newline at end of file
<!--pages/volunteerRanking/volunteerRanking.wxml--> <!--pages/volunteerRanking/volunteerRanking.wxml-->
<view class='volunteerRanking'> <view class='volunteerRanking'>
<text>志愿角色:<text>江苏省教育局</text></text> <text>志愿角色:<text>{{name}}</text></text>
<view class='table'> <view class='table'>
<view class='tr'> <view class='tr'>
<view class='th'>排名</view> <view class='th'>排名</view>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<view class='th'>城市</view> <view class='th'>城市</view>
<view class='th'>能力分</view> <view class='th'>能力分</view>
</view> </view>
<view wx:for="{{rankList}}" class='tr' wx:key="{{index}}"> <view wx:for="{{rankList}}" class='tr' wx:key="{{index}}" data-index="{{item.province}}" bindtap="rank2">
<view class='td'><text class="idNum">{{index+1}}</text></view> <view class='td'><text class="idNum">{{index+1}}</text></view>
<view class='td'>{{item.province}}</view> <view class='td'>{{item.province}}</view>
<view class='td'>{{item.city_count}}市</view> <view class='td'>{{item.city_count}}市</view>
......
...@@ -6,6 +6,8 @@ Page({ ...@@ -6,6 +6,8 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
name: '',
province:'',
rankList: [] rankList: []
}, },
...@@ -15,11 +17,15 @@ Page({ ...@@ -15,11 +17,15 @@ Page({
onLoad: function (options) { onLoad: function (options) {
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
var that = this; var that = this;
wx: wx.request({ that.setData({
name: config.name,
province: options.province
})
wx.request({
url: app.url + 'ajax_get_volunteer_rank2.php', url: app.url + 'ajax_get_volunteer_rank2.php',
data: { data: {
unionId: config.unionId, unionId: config.unionId,
province: '上海市' province: that.data.province
}, },
header: { 'content-type': 'application/json' }, header: { 'content-type': 'application/json' },
method: 'GET', method: 'GET',
...@@ -51,37 +57,17 @@ Page({ ...@@ -51,37 +57,17 @@ Page({
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 用户点击右上角分享
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onShareAppMessage: function () {
}, },
/** //志愿者排名3
* 页面上拉触底事件的处理函数 rank3(e) {
*/ let city = e.currentTarget.dataset['index']
onReachBottom: function () { wx.navigateTo({
url: '../volunteersRank3/volunteersRank3?province=' + this.data.province + "&city=" + city,
});
}, },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
}) })
\ No newline at end of file
<!--pages/volunteerRanking/volunteerRanking.wxml--> <!--pages/volunteerRanking/volunteerRanking.wxml-->
<view class='volunteerRanking'> <view class='volunteerRanking'>
<text>志愿角色:<text>江苏省教育局</text></text> <text>志愿角色:<text>{{name}}</text></text>
<view class='table'> <view class='table'>
<view class='tr'> <view class='tr'>
<view class='th'>排名</view> <view class='th'>排名</view>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<view class='th'>学校</view> <view class='th'>学校</view>
<view class='th'>能力分</view> <view class='th'>能力分</view>
</view> </view>
<view wx:for="{{rankList}}" class='tr' wx:key="{{index}}"> <view wx:for="{{rankList}}" class='tr' wx:key="{{index}}" data-index="{{item.city}}" bindtap="rank3">
<view class='td'><text class="idNum">{{index+1}}</text></view> <view class='td'><text class="idNum">{{index+1}}</text></view>
<view class='td'>{{item.city}}</view> <view class='td'>{{item.city}}</view>
<view class='td'>{{item.district_count}}所</view> <view class='td'>{{item.district_count}}所</view>
......
...@@ -6,10 +6,10 @@ Page({ ...@@ -6,10 +6,10 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
rankList:[ name: '',
{ qu:'栖霞区',school:'20所',gread:'29013901'}, province: '',
{ qu: '马群区', school: '12所', gread: '29013901' } city: '',
] rankList:[]
}, },
/** /**
...@@ -18,12 +18,18 @@ Page({ ...@@ -18,12 +18,18 @@ Page({
onLoad: function (options) { onLoad: function (options) {
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
var that = this; var that = this;
wx: wx.request({ that.setData({
name: config.name,
province: options.province,
city: options.city
})
var config = wx.getStorageSync('config');
wx.request({
url: app.url + 'ajax_get_volunteer_rank3.php', url: app.url + 'ajax_get_volunteer_rank3.php',
data: { data: {
unionId: config.unionId, unionId: config.unionId,
province: '上海市', province: that.data.province,
city:'1市' city: that.data.city
}, },
header: { 'content-type': 'application/json' }, header: { 'content-type': 'application/json' },
method: 'GET', method: 'GET',
...@@ -56,27 +62,6 @@ Page({ ...@@ -56,27 +62,6 @@ Page({
}, },
/** /**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
...@@ -88,5 +73,13 @@ Page({ ...@@ -88,5 +73,13 @@ Page({
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
} },
//志愿者排名3
rank4(e) {
let district = e.currentTarget.dataset['index']
wx.navigateTo({
url: '../volunteersRank4/volunteersRank4?province=' + this.data.province + "&city=" + this.data.city + "&district=" + district,
});
},
}) })
\ No newline at end of file
<!--pages/volunteerRanking/volunteerRanking.wxml--> <!--pages/volunteerRanking/volunteerRanking.wxml-->
<view class='volunteerRanking'> <view class='volunteerRanking'>
<text>志愿角色:<text>江苏省教育局</text></text> <text>志愿角色:<text>{{name}}</text></text>
<view class='table'> <view class='table'>
<view class='tr'> <view class='tr'>
<view class='th'>排名</view> <view class='th'>排名</view>
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
<view class='th'>学校</view> <view class='th'>学校</view>
<view class='th'>能力分</view> <view class='th'>能力分</view>
</view> </view>
<view wx:for="{{list}}" class='tr' wx:key="{{index}}"> <view wx:for="{{rankList}}" class='tr' wx:key="{{index}}" data-index="{{item.district}}" bindtap="rank4">
<view class='td'><text class="idNum">{{index+1}}</text></view> <view class='td'><text class="idNum">{{index+1}}</text></view>
<view class='td'>{{item.qu}}</view> <view class='td'>{{item.district}}</view>
<view class='td'>{{item.school}}</view> <view class='td'>{{item.school_count}}</view>
<view class='td'>{{item.gread}}</view> <view class='td'>{{item.ability_point}}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -6,11 +6,11 @@ Page({ ...@@ -6,11 +6,11 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
list:[ name: '',
{ school:'测试小学',num:'200人',gread:'29013901'}, province: '',
{ school: '测试中学', num: '500人', gread: '29013901' }, city: '',
{ school: '测试高中', num: '500人', gread: '29013901' } district:'',
] rankList:[]
}, },
/** /**
...@@ -19,12 +19,19 @@ Page({ ...@@ -19,12 +19,19 @@ Page({
onLoad: function (options) { onLoad: function (options) {
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
var that = this; var that = this;
wx: wx.request({ that.setData({
url: app.url + 'ajax_get_volunteer_rank3.php', name: config.name,
province: options.province,
city: options.city,
district: options.district
})
wx.request({
url: app.url + 'ajax_get_volunteer_rank4.php',
data: { data: {
unionId: config.unionId, unionId: config.unionId,
province: '上海市', province: that.data.province,
city: '1市' city: that.data.city,
district: that.data.district
}, },
header: { 'content-type': 'application/json' }, header: { 'content-type': 'application/json' },
method: 'GET', method: 'GET',
......
<!--pages/volunteerRanking/volunteerRanking.wxml--> <!--pages/volunteerRanking/volunteerRanking.wxml-->
<view class='volunteerRanking'> <view class='volunteerRanking'>
<text>志愿角色:<text>江苏省教育局</text></text> <text>志愿角色:<text>{{name}}</text></text>
<view class='table'> <view class='table'>
<view class='tr'> <view class='tr'>
<view class='th'>排名</view> <view class='th'>排名</view>
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
<view class='th'>人数</view> <view class='th'>人数</view>
<view class='th'>能力分</view> <view class='th'>能力分</view>
</view> </view>
<view wx:for="{{list}}" class='tr' wx:key="{{index}}"> <view wx:for="{{rankList}}" class='tr' wx:key="{{index}}">
<view class='td'><text class="idNum">{{index+1}}</text></view> <view class='td'><text class="idNum">{{index+1}}</text></view>
<view class='td'>{{item.school}}</view> <view class='td'>{{item.school}}</view>
<view class='td'>{{item.num}}</view> <view class='td'>{{item.user_count}}</view>
<view class='td'>{{item.gread}}</view> <view class='td'>{{item.ability_point}}</view>
</view> </view>
</view> </view>
</view> </view>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment