作者 niufei

基本对接完成

// pages/admin/admin.js
const app=getApp();
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
page:0,
datalist:[],
pageNum:10,
},
getdatalist(){
let that=this;
let head={
'XX-Token':wx.getStorageSync('token')
}
let url ='index/member_center/admin';
let params={
page: that.data.page,
pageNum: that.data.pageNum
}
app.post(url, params, head).then((res)=>{
let datalist = that.data.datalist;
let datadatalist = datalist.concat(res.volunteer);
that.setData({
datalist: datadatalist,
page: res.page
})
}).catch((err)=>{
})
},
update_status(e){
let that=this;
let index = e.currentTarget.dataset.index;
let url ='index/member_center/update_status';
let head = {
'XX-Token': wx.getStorageSync('token')
}
let params={
id: e.currentTarget.id,
status: e.currentTarget.dataset.status
/**
* 页面的初始数据
*/
data: {
page: 0,
datalist: [],
pageNum: 10,
cover_type: false
},
// 输入信息
get_word(e) {
this.setData({
word: e.detail.value
})
},
// 改变弹窗状态
change_cover(e) {
if (e.currentTarget.dataset.index){
this.setData({
index: e.currentTarget.dataset.index,
id: e.currentTarget.dataset.id
})
}
this.setData({
cover_type: !this.data.cover_type
})
},
getdatalist() {
wx.showLoading({
title: '加载中',
})
let that = this
let head = {
'XX-Token': wx.getStorageSync('token')
}
let url = that.data.type > 1 ? 'index/member_center/addTimeList' : 'index/member_center/admin';
let params = {
page: that.data.page,
pageNum: that.data.pageNum
}
app.post(url, params, head).then((res) => {
if (res.volunteer.length == 0) {
that.setData({
page_type: true
})
}
if (that.data.page == 0) {
that.setData({
datalist: res.volunteer,
page: res.page
})
wx.hideLoading()
} else {
setTimeout(() => {
that.setData({
datalist: that.data.datalist.concat(res.volunteer),
page: res.page
})
wx.hideLoading()
}, 1000)
}
}).catch((err) => {})
},
// 添加时间
add_time(){
let that = this
if (!that.data.word) {
wx.showToast({
title: '请输入工时',
icon: 'none',
duration: 1000
})
return
}
let url = 'index/member_center/addTime';
let head = {
'XX-Token': wx.getStorageSync('token')
}
let params = {
user_id: that.data.id,
add_time: that.data.word
}
app.post(url, params, head).then((res) => {
wx.showToast({
title: '操作成功',
icon: 'success',
duration: 1000,
success: () => {
that.setData({
word: null,
cover_type: false
})
}
})
}).catch((err) => { })
},
//通过
pass(e) {
this.update_status(e.currentTarget.dataset.id,e.currentTarget.dataset.index, 2)
},
//驳回
reject() {
if(!this.data.word){
wx.showToast({
title: '请填写不通过原因',
icon: 'none',
duration: 1000
})
return
}
this.update_status(this.data.id,this.data.index, 3)
},
// 通过,不通过接口
update_status(id,index, status) {
let that = this
let datalist = that.data.datalist
let url = 'index/member_center/update_status';
let head = {
'XX-Token': wx.getStorageSync('token')
}
let params = {
id: id,
status: status
}
if(status == 3){
params.refund_reason = that.data.word
}
console.log(params)
app.post(url, params, head).then((res) => {
wx.showToast({
title: '操作成功',
icon: 'success',
duration: 1000,
success: () => {
datalist.splice(index, 1)
that.setData({
datalist: datalist,
word: null,
cover_type: false
})
}
})
}).catch((err) => {})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.setData({
type: options.type
})
this.getdatalist()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
let that = this
if (that.data.page_type) {
wx.showToast({
title: '暂无更多数据',
icon: 'none'
})
return
}
that.getdatalist()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
app.post(url, params,head).then((res)=>{
wx.showToast({
title: '更新成功',
icon: 'success',
duration: 2000
})
let datalist = that.data.datalist;
datalist[index].status = e.currentTarget.dataset.status;
that.setData({
datalist: datalist
})
}).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({
page: 0,
datalist: []
})
that.getdatalist();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
<!--pages/admin/admin.wxml-->
<scroll-view scroll-y='true' bindscrolltolower='getdatalist' style='height:{{scroll_height}}rpx'>
<block wx:for='{{datalist}}' wx:key>
<view class='adminitem'>
<navigator class='admin_left' url='/pages/close_apply/close_apply?id={{item.user_id}}' hover-class="none">
<view class='admin_img'>
<image src='{{item.photo?item.photo:"https://volunteer.cnpu.org/imgs/wode_02@2x.png"}}'></image>
<block wx:for='{{datalist}}' wx:key="index">
<view class='adminitem'>
<navigator class='admin_left' url='/pages/close_apply/close_apply?id={{item.user_id}}' hover-class="none">
<view class='admin_img'>
<image src='{{item.photo?item.photo:"https://volunteer.cnpu.org/imgs/wode_02@2x.png"}}' mode="aspectFill"></image>
</view>
<view class='admin_txt'>
<view class='admin_txttitle'>{{item.nane}}</view>
<view>{{item.duty}}</view>
</view>
</navigator>
<view class='admin_rigth' wx:if="{{type == 1}}">
<view class='admin_buttom {{item.status=="3"?"admin_active":""}}' data-id='{{item.id}}' data-idi='{{item.status}}' data-status='3' data-index='{{index}}' bindtap='change_cover'>不通过</view>
<view class='admin_buttom {{item.status !="3"?"admin_active":""}}' data-id='{{item.id}}' data-status='2' data-index='{{index}}' bindtap='pass'>通过</view>
</view>
<view class="add_time" wx:if="{{type == 2}}" bindtap='change_cover' data-index='{{index}}' data-id='{{item.user_id}}'>添加工时</view>
</view>
<view class='admin_txt'>
<view class='admin_txttitle'>{{item.nane}}</view>
<view>{{item.duty}}</view>
</view>
</navigator>
<view class='admin_rigth'>
<view class='admin_buttom {{item.status=="3"?"admin_active":""}}' id='{{item.id}}' data-idi='{{item.status}}' data-status='3' data-index='{{index}}' bindtap='update_status'>不通过</view>
<view class='admin_buttom {{item.status !="3"?"admin_active":""}}' id='{{item.id}}' data-status='2' data-index='{{index}}' bindtap='update_status'>通过</view>
</view>
</view>
<view class='vold_line'></view>
<view class='vold_line'></view>
</block>
</scroll-view>
\ No newline at end of file
<view class="cover_box" catchtouchmove="true" wx:if="{{cover_type}}">
<view class="show_box">
<view class="s_title">{{type>1?'请输入工时':'请输入未通过理由'}}</view>
<textarea placeholder="请输入..." class="word_area {{type>1?'active':''}}" value="{{word}}" bindinput="get_word" wx:if="{{type==1}}"/>
<input placeholder="请输入..." class="word_area active" value="{{word}}" bindinput="get_word" type="number" wx:if="{{type==2}}"/>
<view class="submit" catchtap="{{type>1?'add_time':'reject'}}">确认</view>
<image src="/imgs/close.png" class="close" catchtap="change_cover"/>
</view>
</view>
\ No newline at end of file
... ...
/* pages/admin/admin.wxss */
.adminitem{
display: flex;
align-items: center;
justify-content: space-between;
padding:30rpx 32rpx;
}
.admin_left{
width:60%;
display: flex;
align-items: center;
}
.admin_img{
display: flex;
justify-content: center;
align-items: center;
margin: 0 16rpx 0 0;
width:76rpx;
height: 76rpx;
border-radius: 50%;
overflow: hidden;
}
.admin_img image{
display: block;
width:100%;
height: 100%;
}
.admin_txttitle{
color:#333333;
font-size:28rpx;
}
.admin_txt{
color:#999;
font-size:26rpx;
}
.admin_rigth{
display: flex;
align-items: center;
flex-direction:row-reverse;
width:40%;
}
.admin_buttom{
width:120rpx;
height: 60rpx;
border-radius: 30rpx;
margin: 0 0 0 32rpx;
color:#fff;
font-size: 26rpx;
background: #CCCCCC;
display: flex;
align-items: center;
justify-content: center;
}
.admin_active{
background: #2ED671;
}
\ No newline at end of file
page {
height: 100%;
}
.adminitem {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx 32rpx;
}
.admin_left {
width: 60%;
display: flex;
align-items: center;
}
.admin_img {
display: flex;
justify-content: center;
align-items: center;
margin: 0 16rpx 0 0;
width: 76rpx;
height: 76rpx;
border-radius: 50%;
overflow: hidden;
}
.admin_img image {
display: block;
width: 100%;
height: 100%;
}
.admin_txttitle {
color: #333;
font-size: 28rpx;
}
.admin_txt {
color: #999;
font-size: 26rpx;
}
.admin_rigth {
display: flex;
align-items: center;
flex-direction: row-reverse;
width: 40%;
}
.admin_buttom {
width: 120rpx;
height: 60rpx;
border-radius: 30rpx;
margin: 0 0 0 32rpx;
color: #fff;
font-size: 26rpx;
background: #ccc;
display: flex;
align-items: center;
justify-content: center;
}
.admin_active {
background: #2ed671;
}
.add_time {
width: 142rpx;
height: 60rpx;
border: 1px solid rgba(46, 214, 113, 1);
border-radius: 30rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(46, 214, 113, 1);
}
.cover_box {
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
display: flex;
justify-content: center;
align-items: center;
background: rgba(0, 0, 0, 0.3);
}
.show_box {
width: 595rpx;
padding: 0 28rpx 54rpx;
box-sizing: border-box;
background: rgba(255, 255, 255, 1);
border-radius: 10rpx;
position: relative;
}
.show_box .s_title {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: rgba(51, 51, 51, 1);
margin: 74rpx auto 38rpx;
text-align: center;
}
.show_box .word_area {
width: 539rpx;
height: 275rpx;
border: 1px solid rgba(229, 229, 229, 1);
border-radius: 10rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(204, 204, 204, 1);
padding: 30rpx 36rpx;
box-sizing: border-box;
}
.show_box .active{
height: 85rpx !important;
}
.show_box .submit {
width: 495rpx;
height: 88rpx;
background: rgba(65, 205, 121, 1);
border-radius: 10rpx;
margin: 56rpx auto 0;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
display: flex;
justify-content: center;
align-items: center;
}
.show_box .close {
width: 26rpx;
height: 26rpx;
color: #ccc;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
position: absolute;
right: 29rpx;
top: 31rpx;
}
... ...
const app=getApp();
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
//
ifempower:true,//是否授权
showapply:false,
provincearr:[],
cityarr:[],
countryarr:[],
confirmvalarr:[0,0,0],
valarr:[0,0,0],
photo: '',
name: '',
enddata:'',
arraysex: ['男', '女'],
sex: '',
birthday: '', //生日
nation: '', //民族
nationarr: ["汉族", "蒙古族", "回族", "藏族", "维吾尔族", "苗族", "彝族", "壮族", "布依族", "朝鲜族", "满族", "侗族", "瑶族", "白族", "土家族",
"哈尼族", "哈萨克族", "傣族", "黎族", "傈僳族", "佤族", "畲族", "高山族", "拉祜族", "水族", "东乡族", "纳西族", "景颇族", "柯尔克孜族",
"土族", "达斡尔族", "仫佬族", "羌族", "布朗族", "撒拉族", "毛南族", "仡佬族", "锡伯族", "阿昌族", "普米族", "塔吉克族", "怒族", "乌孜别克族",
"俄罗斯族", "鄂温克族", "德昂族", "保安族", "裕固族", "京族", "塔塔尔族", "独龙族", "鄂伦春族", "赫哲族", "门巴族", "珞巴族", "基诺族"
],
politics: '', //政治面貌
politicsarr: ['共青团员', '中共预备党员', '中共党员', '群众', '无党派人士', '其他'], //
education: '', //学历
educationarr: ['小学', '中学', '专科', '本科', '硕士研究生', '博士研究生', '其他'], //
unit: '', //工作单位
duty: '', //职务
addr: '', //通讯地址,
postcode: '', //邮编
school: '', //
card_number: '', //身份证号码
move_phone: '', //
email: '', //
urgency_phone: '', //
qq: '',
province: '',
city: '',
county: '',
address: '', //详细地址,
type: '', //1医院志愿者,2社会志愿者,3办事处志愿者
typearr: ['医院志愿者', '社会志愿者', '办事处志愿者'],
apply_nav: 0, //0为履历1,1为履历2,2为履历3,
record: [{
record_start_time: '',
record_end_time: '',
record_unit: '',
record_duty: '',
record_name: '',
record_phone: ''
},
{
record_start_time: '',
record_end_time: '',
record_unit: '',
record_duty: '',
record_name: '',
record_phone: ''
},
{
record_start_time: '',
record_end_time: '',
record_unit: '',
record_duty: '',
record_name: '',
record_phone: ''
}
],
front_card: '', //身份证正面照
reverse_card: '', //身份证反面照
id:'',//用户id,
},
setname(e) {
this.setData({
name: e.detail.value
})
},
setunit(e) {
this.setData({
unit: e.detail.value
})
},
setduty(e) {
this.setData({
duty: e.detail.value
})
},
setaddr(e) {
this.setData({
addr: e.detail.value
})
},
setpostcode(e) {
this.setData({
postcode: e.detail.value
})
},
setschool(e) {
this.setData({
school: e.detail.value
})
},
setcard_number(e) {
this.setData({
card_number: e.detail.value
})
},
setemail(e) {
this.setData({
email: e.detail.value
})
},
seturgency_phone(e) {
this.setData({
urgency_phone: e.detail.value
})
},
setqq(e) {
this.setData({
qq: e.detail.value
})
},
bindsex(e) {
this.setData({
sex: parseInt(e.detail.value) + 1
})
},
setmove_phone(e) {
this.setData({
move_phone: e.detail.value
})
},
bindbirthdayChange(e) {
this.setData({
birthday: e.detail.value
})
},
bindnationChange(e) {
let nationarr = this.data.nationarr;
this.setData({
nation: nationarr[e.detail.value]
})
},
bindeducationChange(e) {
let educationarr = this.data.educationarr;
this.setData({
education: educationarr[e.detail.value]
})
},
bindpoliticsChange(e) {
let politicsarr = this.data.politicsarr;
this.setData({
politics: politicsarr[e.detail.value]
})
},
// bindtypeChange(e) {
// let typearr = this.data.typearr;
// this.setData({
// type: parseInt(e.detail.value) +1
// })
// },
start(e) {
let that = this;
let tem = e.currentTarget.dataset.tem;
app.globalData.userInfo = e.detail.userInfo;
wx.login({
success: function (s) {
let url = 'wxapp/public/getSessionKey';
if (s.code) {
var code = s.code;
var param = {
code: code
}
app.post(url, param).then((res) => {
that.login(res.openid, res.session_key, e.detail.encryptedData, e.detail.iv,tem);
}).catch((errMsg) => {
})
}
}
});
},
login(openid, session_key, encrypted_data, iv,tem) {
let that = this;
let param = {
openid: openid,
session_key: session_key,
encrypted_data: encrypted_data,
iv: iv
}
let url = 'wxapp/public/login';
app.post(url, param).then((res) => {
wx.setStorageSync('token', res.token);
that.setData({
ifempower:true
})
that.uploadImage(tem);
}).catch((errMsg) => {
})
},
//选择省市区
getarea(){
let that=this;
let url ='index/area/index';
app.post(url,{}).then((res)=>{
let country = res.country;
let tem = {
id: 0,
city_id: res.country[0].city_id,
country_id: 0,
country_name: ''
}
country.push(tem);
let temcountry = country.reverse();
let cityarr = res.city;
let countryarr = res.country;
let provincearr = res.province;
that.setData({
cityarr: cityarr,
countryarr: temcountry,
provincearr: provincearr
})
if (that.data.is_submit==undefined){
that.setData({
ifempower:false
/**
* 页面的初始数据
*/
data: {
//
ifempower: true, //是否授权
showapply: false,
provincearr: [],
cityarr: [],
countryarr: [],
confirmvalarr: [0, 0, 0],
valarr: [0, 0, 0],
photo: '',
name: '',
enddata: '',
arraysex: ['男', '女'],
sex: '',
birthday: '', //生日
nation: '', //民族
nationarr: ["汉族", "蒙古族", "回族", "藏族", "维吾尔族", "苗族", "彝族", "壮族", "布依族", "朝鲜族", "满族", "侗族", "瑶族", "白族", "土家族",
"哈尼族", "哈萨克族", "傣族", "黎族", "傈僳族", "佤族", "畲族", "高山族", "拉祜族", "水族", "东乡族", "纳西族", "景颇族", "柯尔克孜族",
"土族", "达斡尔族", "仫佬族", "羌族", "布朗族", "撒拉族", "毛南族", "仡佬族", "锡伯族", "阿昌族", "普米族", "塔吉克族", "怒族", "乌孜别克族",
"俄罗斯族", "鄂温克族", "德昂族", "保安族", "裕固族", "京族", "塔塔尔族", "独龙族", "鄂伦春族", "赫哲族", "门巴族", "珞巴族", "基诺族"
],
politics: '', //政治面貌
politicsarr: ['共青团员', '中共预备党员', '中共党员', '群众', '无党派人士', '其他'], //
education: '', //学历
educationarr: ['小学', '中学', '专科', '本科', '硕士研究生', '博士研究生', '其他'], //
unit: '', //工作单位
duty: '', //职务
addr: '', //通讯地址,
postcode: '', //邮编
school: '', //
card_number: '', //身份证号码
move_phone: '', //
email: '', //
urgency_phone: '', //
qq: '',
province: '',
city: '',
county: '',
address: '', //详细地址,
type: '', //1医院志愿者,2社会志愿者,3办事处志愿者
typearr: ['医院志愿者', '社会志愿者', '办事处志愿者'],
apply_nav: 0, //0为履历1,1为履历2,2为履历3,
record: [{
record_start_time: '',
record_end_time: '',
record_unit: '',
record_duty: '',
record_name: '',
record_phone: ''
},
{
record_start_time: '',
record_end_time: '',
record_unit: '',
record_duty: '',
record_name: '',
record_phone: ''
},
{
record_start_time: '',
record_end_time: '',
record_unit: '',
record_duty: '',
record_name: '',
record_phone: ''
}
],
front_card: '', //身份证正面照
reverse_card: '', //身份证反面照
id: '', //用户id,
},
setname(e) {
this.setData({
name: e.detail.value
})
},
setunit(e) {
this.setData({
unit: e.detail.value
})
},
setduty(e) {
this.setData({
duty: e.detail.value
})
},
setaddr(e) {
this.setData({
addr: e.detail.value
})
},
setpostcode(e) {
this.setData({
postcode: e.detail.value
})
},
setschool(e) {
this.setData({
school: e.detail.value
})
},
setcard_number(e) {
this.setData({
card_number: e.detail.value
})
},
setemail(e) {
this.setData({
email: e.detail.value
})
},
seturgency_phone(e) {
this.setData({
urgency_phone: e.detail.value
})
},
setqq(e) {
this.setData({
qq: e.detail.value
})
},
bindsex(e) {
this.setData({
sex: parseInt(e.detail.value) + 1
})
},
}else if (that.data.is_submit=='1'){
that.getdatalist();
}
setmove_phone(e) {
this.setData({
move_phone: e.detail.value
})
},
}).catch((err)=>{
bindbirthdayChange(e) {
this.setData({
birthday: e.detail.value
})
},
bindnationChange(e) {
let nationarr = this.data.nationarr;
this.setData({
nation: nationarr[e.detail.value]
})
},
bindeducationChange(e) {
let educationarr = this.data.educationarr;
this.setData({
education: educationarr[e.detail.value]
})
},
})
},
//切换省份获取市和区/县
get_city(province_id=0){
let that=this;
let url ='index/area/get_city';
let params={
'province_id': province_id
}
app.post(url, params).then((res)=>{
let country = res.country;
let tem = {
id: 0,
city_id: res.country[0].city_id,
country_id: 0,
country_name: ' '
}
country.push(tem);
let temcountry = country.reverse();
that.setData({
cityarr: res.city,
countryarr: temcountry
})
}).catch((err)=>{
})
},
//切换市获取区/县
get_country(city_id=0){
let that=this;
let url ='index/area/get_country';
let params={
'city_id': city_id
}
app.post(url, params).then((res) => {
let country = res.country;
let tem={
id:0,
city_id: res.country[0].city_id,
country_id:0,
country_name:' '
}
country.push(tem);
let temcountry = country.reverse();
that.setData({
countryarr: temcountry
})
}).catch((err) => {
})
},
bindChange: function (e) {
let that=this;
let valarr = that.data.valarr;
let provincearr = that.data.provincearr;
let cityarr = that.data.cityarr;
const val = e.detail.value;
if (valarr[0] != val[0] ){//改变省
let i = val[0];
that.get_city(provincearr[i].province_id);
valarr[0] = val[0];
valarr[1] = 0;
valarr[2] = 0;
that.setData({
valarr: valarr
})
} else if (valarr[1] != val[1]){//改变市
let j = val[1];
that.get_country(cityarr[j].city_id);
valarr[1] = val[1];
valarr[2] = 0;
that.setData({
valarr: valarr
})
}else {//改变区
valarr[2] = val[2];
that.setData({
valarr: valarr
})
}
},
//取消地区选择
setno(){
let that=this;
that.setData({
valarr: that.data.confirmvalarr,
showapply: false
})
},
//确定选择区域
setyes(){
let that=this;
let valarr = that.data.valarr;
let i = valarr[0];
let j = valarr[1];
let k = valarr[2];
let provincearr = that.data.provincearr;
let cityarr = that.data.cityarr;
let countryarr = that.data.countryarr;
that.setData({
confirmvalarr: valarr,
province: provincearr[i].province_name,
city: cityarr[j].city_name,
county: countryarr[k].country_name,
address: provincearr[i].province_name + cityarr[j].city_name + countryarr[k].country_name,
showapply:false
})
},
setshowapply(){
let that=this;
that.setData({
showapply:true
})
},
setshowapply_no() {
let that = this;
that.setData({
showapply: false
})
},
void_fun(){
},
bindRegionChange(e){
let that=this;
this.setData({
region: e.detail.value,
province: e.detail.value[0],
city: e.detail.value[1],
county: e.detail.value[2],
address: e.detail.value[0] + e.detail.value[1] + e.detail.value[2]
})
},
bindstartChange(e) {
let that = this;
let apply_nav = parseInt(that.data.apply_nav);
let record = that.data.record;
record[apply_nav].record_start_time = e.detail.value;
that.setData({
record: record
})
},
bindendChange(e) {
let that = this;
let apply_nav = that.data.apply_nav;
let record = that.data.record;
record[apply_nav].record_end_time = e.detail.value;
that.setData({
record: record
})
},
setrecordunit(e) {
let that = this;
let apply_nav = that.data.apply_nav;
let record = that.data.record;
record[apply_nav].record_unit = e.detail.value;
that.setData({
record: record
})
},
setrecordname(e) {
let that = this;
let apply_nav = that.data.apply_nav;
let record = that.data.record;
record[apply_nav].record_name = e.detail.value;
that.setData({
record: record
})
},
setrecordduty(e) {
let that = this;
let apply_nav = that.data.apply_nav;
let record = that.data.record;
record[apply_nav].record_duty = e.detail.value;
that.setData({
record: record
})
},
setrecordphone(e) {
let that = this;
let apply_nav = that.data.apply_nav;
let record = that.data.record;
record[apply_nav].record_phone = e.detail.value;
that.setData({
record: record
})
},
uploadImages(e){
let that=this;
let tem = e.currentTarget.dataset.tem;
that.uploadImage(tem);
},
//上传头像1为头像,2为省份证正面,3为省份证反面
uploadImage(tem) {
let that = this;
wx.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
success: function(res) {
let tempFilePaths = res.tempFilePaths //总文件
let head = {
'XX-Token': wx.getStorageSync('token'),
'XX-Device-Type': ''
bindpoliticsChange(e) {
let politicsarr = this.data.politicsarr;
this.setData({
politics: politicsarr[e.detail.value]
})
},
// bindtypeChange(e) {
// let typearr = this.data.typearr;
// this.setData({
// type: parseInt(e.detail.value) +1
// })
// },
start(e) {
let that = this;
let tem = e.currentTarget.dataset.tem;
app.globalData.userInfo = e.detail.userInfo;
wx.login({
success: function(s) {
let url = 'wxapp/public/getSessionKey';
if (s.code) {
var code = s.code;
var param = {
code: code
}
app.post(url, param).then((res) => {
that.login(res.openid, res.session_key, e.detail.encryptedData, e.detail.iv, tem);
}).catch((errMsg) => {
})
}
}
});
},
login(openid, session_key, encrypted_data, iv, tem) {
let that = this;
let param = {
openid: openid,
session_key: session_key,
encrypted_data: encrypted_data,
iv: iv
}
let url = 'https://volunteer.cnpu.org/api/user/upload/one';
wx.uploadFile({
url: url, //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'file',
header: head,
formData: {},
success: function(res) {
let temdata = JSON.parse(res.data);
if (temdata.code == 20000) {
if (tem == '1') {
that.setData({
photo: temdata.data.url
})
} else if (tem == '2') {
that.setData({
front_card: temdata.data.url
})
} else if (tem == '3') {
let url = 'wxapp/public/login';
app.post(url, param).then((res) => {
wx.setStorageSync('token', res.token);
that.setData({
ifempower: true
})
that.uploadImage(tem);
}).catch((errMsg) => {
})
},
//选择省市区
getarea() {
let that = this;
let url = 'index/area/index';
app.post(url, {}).then((res) => {
let country = res.country;
let tem = {
id: 0,
city_id: res.country[0].city_id,
country_id: 0,
country_name: ''
}
country.push(tem);
let temcountry = country.reverse();
let cityarr = res.city;
let countryarr = res.country;
let provincearr = res.province;
that.setData({
cityarr: cityarr,
countryarr: temcountry,
provincearr: provincearr
})
if (that.data.is_submit == undefined) {
that.setData({
reverse_card: temdata.data.url
ifempower: false
})
}
} else if (that.data.is_submit == '1') {
that.getdatalist();
}
},
fail: function(res) {},
complete: () => {}
})
},
fail: function(res) {}
})
},
setapply_nav(e) {
let that = this;
that.setData({
apply_nav: e.currentTarget.dataset.apply_nav
})
},
submit() {
let that = this;
let err='';
//匹配中国邮政编码
// var AuglyTest_PostalCode = /^[0-9]\\d{5}$/;
//匹配身份证
var AuglyTest_ID = /\d{15}|\d{18}/;
//验证手机号
var AuglyTest_phone =/^1(3|4|5|6|7|8)\d{9}$/;
//验证腾讯QQ号
var AuglyTest_QQ = /^[1-9]*[1-9][0-9]*$/;
//匹配国内电话号码
var AuglyTest_tel = /(\d{3}-|\d{4}-)?(\d{8}|\d{7})?/;
//email地址
var AuglyTest_email = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (that.data.photo==''){
err = '请上传您的头像!'
} else if (that.data.name==''){
err='请输入您的姓名!'
} else if (that.data.sex==''){
err = '请选择您的姓别!';
} else if (that.data.birthday==''){
err = '请选择您的出生日期!';
} else if (that.data.nation==''){
err = '请选择您的民族!';
} else if (that.data.education==''){
err = '请选择您的学历!';
} else if (that.data.politics==''){
err = '请选择您的政治面貌!';
} else if (that.data.unit==''){
err='请填写您的工作单位!';
} else if (that.data.duty==''){
err = '请填写您的职务!';
} else if (that.data.addr==''){
err ='请填写您的通讯地址!';
} else if (that.data.postcode==''){
err = '请填写您的邮编!';
} else if (that.data.school==''){
err ='请输入就读/毕业院校!';
} else if (that.data.card_number==''){
err = '请输入您的身份证号!';
} else if (!AuglyTest_ID.test(that.data.card_number)){
err = '请输入正确的身份证号!';
}else if (that.data.move_phone==''){
err = '请输入您的移动电话!';
} else if (!AuglyTest_phone.test(that.data.move_phone)){
err = '请输入正确的移动电话!';
}else if (that.data.email==''){
err = '请输入您的电子邮箱!';
} else if (!AuglyTest_email.test(that.data.email)){
err = '请输入正确的电子邮箱!';
}else if (that.data.urgency_phone==''){
err = '请输入紧急联系人及电话!';
} else if (that.data.qq==''){
err = '请输入您的QQ!';
} else if (!AuglyTest_QQ.test(that.data.qq)){
err = '请输入正确的QQ号!';
}
else if (that.data.address==''){
err = '请选择您的服务区域';
} else if(that.data.type==''){
err = '请选择您的志愿类别!';
} else if (that.data.front_card==''){
err = '请上传身份证正面!';
} else if (that.data.reverse_card==''){
err = '请上传身份证反面!';
}
if(err==''){
let record = that.data.record;
let record_start_time = [];
let record_end_time = [];
let record_unit = [];
let record_duty = [];
let record_name = [];
let record_phone = [];
for (let obj of record) {
record_start_time.push(obj.record_start_time);
record_end_time.push(obj.record_end_time);
record_unit.push(obj.record_unit);
record_duty.push(obj.record_duty);
record_name.push(obj.record_name);
record_phone.push(obj.record_phone);
}
let url = 'index/member_center/submit_form';
let head = {
'XX-Token': wx.getStorageSync('token')
}
let params = {
name: that.data.name,
sex: that.data.sex,
birthday: that.data.birthday,
nation: that.data.nation,
politics: that.data.politics,
education: that.data.education,
unit: that.data.unit,
duty: that.data.duty,
addr: that.data.addr,
school: that.data.school,
card_number: that.data.card_number,
move_phone: that.data.move_phone,
postcode: that.data.postcode,
email: that.data.email,
urgency_phone: that.data.urgency_phone,
qq: that.data.qq,
province: that.data.province,
city: that.data.city,
county: that.data.county,
address: that.data.address,
// type: that.data.type,
record_start_time: record_start_time,
record_end_time: record_end_time,
record_unit: record_unit,
record_duty: record_duty,
record_name: record_name,
record_phone: record_phone,
front_card: that.data.front_card,
reverse_card: that.data.reverse_card,
photo: that.data.photo
}
app.post(url, params, head).then((res) => {
wx.showToast({
title: '提交成功,等待审核',
icon: 'none',
duration: 2000
})
setTimeout(function(){
wx.switchTab({
url: '/pages/my/my'
})
},1000)
}).catch((err) => {
})
}else{
wx.showToast({
title: err,
icon: 'none',
duration: 2000
})
}
},
getdatalist(){
let that=this;
let url ='/index/member_center/edit';
let params={
'id':that.data.id
};
let head={
'XX-Token':wx.getStorageSync('token')
}
app.post(url, params, head).then((res)=>{
let provincearr = that.data.provincearr;
let cityarr = that.data.cityarr;
let countryarr = that.data.countryarr;
let val=[0,0,0];
for (let i=0; i<provincearr.length;i++ ){
if (provincearr[i].province_name == res.province){
val[0]=i;
}).catch((err) => {
})
},
//切换省份获取市和区/县
get_city(province_id = 0) {
let that = this;
let url = 'index/area/get_city';
let params = {
'province_id': province_id
}
}
for (let i = 0; i < cityarr.length; i++) {
if (cityarr[i].city_name == res.city) {
val[1] = i;
app.post(url, params).then((res) => {
let country = res.country;
let tem = {
id: 0,
city_id: res.country[0].city_id,
country_id: 0,
country_name: ' '
}
country.push(tem);
let temcountry = country.reverse();
that.setData({
cityarr: res.city,
countryarr: temcountry
})
}).catch((err) => {
})
},
//切换市获取区/县
get_country(city_id = 0) {
let that = this;
let url = 'index/area/get_country';
let params = {
'city_id': city_id
}
}
for (let i = 0; i < countryarr.length; i++) {
if (countryarr[i].country_name == res.county) {
val[2] = i;
app.post(url, params).then((res) => {
let country = res.country;
let tem = {
id: 0,
city_id: res.country[0].city_id,
country_id: 0,
country_name: ' '
}
country.push(tem);
let temcountry = country.reverse();
that.setData({
countryarr: temcountry
})
}).catch((err) => {
})
},
bindChange: function(e) {
let that = this;
let valarr = that.data.valarr;
let provincearr = that.data.provincearr;
let cityarr = that.data.cityarr;
const val = e.detail.value;
if (valarr[0] != val[0]) { //改变省
let i = val[0];
that.get_city(provincearr[i].province_id);
valarr[0] = val[0];
valarr[1] = 0;
valarr[2] = 0;
that.setData({
valarr: valarr
})
} else if (valarr[1] != val[1]) { //改变市
let j = val[1];
that.get_country(cityarr[j].city_id);
valarr[1] = val[1];
valarr[2] = 0;
that.setData({
valarr: valarr
})
} else { //改变区
valarr[2] = val[2];
that.setData({
valarr: valarr
})
}
}
that.setData({
valarr: val,
confirmvalarr: val,
addr: res.addr,
address: res.address,
birthday: res.birthday,
card_number: res.card_number,
city: res.city,
county: res.county,
duty: res.duty,
education: res.education,
email: res.email,
front_card: res.front_card,
move_phone: res.move_phone,
name: res.name,
nation: res.nation,
photo: res.photo,
politics: res.politics,
postcode:res.postcode,
province: res.province,
qq: res.qq,
record: res.record,
reverse_card: res.reverse_card,
school: res.school,
sex: res.sex,
unit: res.unit,
urgency_phone: res.urgency_phone,
type: res.type
})
}).catch((err)=>{
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that=this;
that.setData({
is_submit: options.is_submit,
id: options.id
})
let now = new Date();
let time = now.getFullYear() + "-" + ((now.getMonth() + 1) < 10 ? "0" : "") + (now.getMonth() + 1) + "-" + (now.getDate() < 10 ? "0" : "") + now.getDate();
this.setData({
enddata: time
})
that.getarea();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
},
//取消地区选择
setno() {
let that = this;
that.setData({
valarr: that.data.confirmvalarr,
showapply: false
})
},
//确定选择区域
setyes() {
let that = this;
let valarr = that.data.valarr;
let i = valarr[0];
let j = valarr[1];
let k = valarr[2];
let provincearr = that.data.provincearr;
let cityarr = that.data.cityarr;
let countryarr = that.data.countryarr;
that.setData({
confirmvalarr: valarr,
province: provincearr[i].province_name,
city: cityarr[j].city_name,
county: countryarr[k].country_name,
address: provincearr[i].province_name + cityarr[j].city_name + countryarr[k].country_name,
showapply: false
})
},
setshowapply() {
let that = this;
that.setData({
showapply: true
})
},
setshowapply_no() {
let that = this;
that.setData({
showapply: false
})
},
void_fun() {},
bindRegionChange(e) {
let that = this;
this.setData({
region: e.detail.value,
province: e.detail.value[0],
city: e.detail.value[1],
county: e.detail.value[2],
address: e.detail.value[0] + e.detail.value[1] + e.detail.value[2]
})
},
bindstartChange(e) {
let that = this;
let apply_nav = parseInt(that.data.apply_nav);
let record = that.data.record;
record[apply_nav].record_start_time = e.detail.value;
that.setData({
record: record
})
},
bindendChange(e) {
let that = this;
let apply_nav = that.data.apply_nav;
let record = that.data.record;
record[apply_nav].record_end_time = e.detail.value;
that.setData({
record: record
})
},
setrecordunit(e) {
let that = this;
let apply_nav = that.data.apply_nav;
let record = that.data.record;
record[apply_nav].record_unit = e.detail.value;
that.setData({
record: record
})
},
setrecordname(e) {
let that = this;
let apply_nav = that.data.apply_nav;
let record = that.data.record;
record[apply_nav].record_name = e.detail.value;
that.setData({
record: record
})
},
setrecordduty(e) {
let that = this;
let apply_nav = that.data.apply_nav;
let record = that.data.record;
record[apply_nav].record_duty = e.detail.value;
that.setData({
record: record
})
},
setrecordphone(e) {
let that = this;
let apply_nav = that.data.apply_nav;
let record = that.data.record;
record[apply_nav].record_phone = e.detail.value;
that.setData({
record: record
})
},
uploadImages(e) {
let that = this;
let tem = e.currentTarget.dataset.tem;
that.uploadImage(tem);
},
//上传头像1为头像,2为省份证正面,3为省份证反面
uploadImage(tem) {
let that = this;
wx.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
success: function(res) {
let tempFilePaths = res.tempFilePaths //总文件
let head = {
'XX-Token': wx.getStorageSync('token'),
'XX-Device-Type': ''
}
let url = 'https://volunteer.cnpu.org/api/user/upload/one';
wx.uploadFile({
url: url, //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'file',
header: head,
formData: {},
success: function(res) {
let temdata = JSON.parse(res.data);
if (temdata.code == 20000) {
if (tem == '1') {
that.setData({
photo: temdata.data.url
})
} else if (tem == '2') {
that.setData({
front_card: temdata.data.url
})
} else if (tem == '3') {
that.setData({
reverse_card: temdata.data.url
})
}
}
},
fail: function(res) {},
complete: () => {}
})
},
fail: function(res) {}
})
},
setapply_nav(e) {
let that = this;
that.setData({
apply_nav: e.currentTarget.dataset.apply_nav
})
},
submit() {
let that = this;
let err = '';
//匹配中国邮政编码
// var AuglyTest_PostalCode = /^[0-9]\\d{5}$/;
//匹配身份证
var AuglyTest_ID = /\d{15}|\d{18}/;
//验证手机号
var AuglyTest_phone = /^1(3|4|5|6|7|8)\d{9}$/;
//验证腾讯QQ号
var AuglyTest_QQ = /^[1-9]*[1-9][0-9]*$/;
//匹配国内电话号码
var AuglyTest_tel = /(\d{3}-|\d{4}-)?(\d{8}|\d{7})?/;
//email地址
var AuglyTest_email = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (that.data.photo == '') {
err = '请上传您的头像!'
} else if (that.data.name == '') {
err = '请输入您的姓名!'
} else if (that.data.sex == '') {
err = '请选择您的姓别!';
} else if (that.data.birthday == '') {
err = '请选择您的出生日期!';
} else if (that.data.nation == '') {
err = '请选择您的民族!';
} else if (that.data.education == '') {
err = '请选择您的学历!';
} else if (that.data.politics == '') {
err = '请选择您的政治面貌!';
} else if (that.data.unit == '') {
err = '请填写您的工作单位!';
} else if (that.data.duty == '') {
err = '请填写您的职务!';
} else if (that.data.addr == '') {
err = '请填写您的通讯地址!';
} else if (that.data.postcode == '') {
err = '请填写您的邮编!';
} else if (that.data.school == '') {
err = '请输入就读/毕业院校!';
} else if (that.data.card_number == '') {
err = '请输入您的身份证号!';
} else if (!AuglyTest_ID.test(that.data.card_number)) {
err = '请输入正确的身份证号!';
} else if (that.data.move_phone == '') {
err = '请输入您的移动电话!';
} else if (!AuglyTest_phone.test(that.data.move_phone)) {
err = '请输入正确的移动电话!';
} else if (that.data.email == '') {
err = '请输入您的电子邮箱!';
} else if (!AuglyTest_email.test(that.data.email)) {
err = '请输入正确的电子邮箱!';
} else if (that.data.urgency_phone == '') {
err = '请输入紧急联系人及电话!';
} else if (that.data.qq == '') {
err = '请输入您的QQ!';
} else if (!AuglyTest_QQ.test(that.data.qq)) {
err = '请输入正确的QQ号!';
} else if (that.data.address == '') {
err = '请选择您的服务区域';
} else if (that.data.type == '') {
err = '请选择您的志愿类别!';
} else if (that.data.front_card == '') {
err = '请上传身份证正面!';
} else if (that.data.reverse_card == '') {
err = '请上传身份证反面!';
}
if (err == '') {
let record = that.data.record;
let record_start_time = [];
let record_end_time = [];
let record_unit = [];
let record_duty = [];
let record_name = [];
let record_phone = [];
for (let obj of record) {
record_start_time.push(obj.record_start_time);
record_end_time.push(obj.record_end_time);
record_unit.push(obj.record_unit);
record_duty.push(obj.record_duty);
record_name.push(obj.record_name);
record_phone.push(obj.record_phone);
}
let url = 'index/member_center/submit_form';
let head = {
'XX-Token': wx.getStorageSync('token')
}
let params = {
name: that.data.name,
sex: that.data.sex,
birthday: that.data.birthday,
nation: that.data.nation,
politics: that.data.politics,
education: that.data.education,
unit: that.data.unit,
duty: that.data.duty,
addr: that.data.addr,
school: that.data.school,
card_number: that.data.card_number,
move_phone: that.data.move_phone,
postcode: that.data.postcode,
email: that.data.email,
urgency_phone: that.data.urgency_phone,
qq: that.data.qq,
province: that.data.province,
city: that.data.city,
county: that.data.county,
address: that.data.address,
// type: that.data.type,
record_start_time: record_start_time,
record_end_time: record_end_time,
record_unit: record_unit,
record_duty: record_duty,
record_name: record_name,
record_phone: record_phone,
front_card: that.data.front_card,
reverse_card: that.data.reverse_card,
photo: that.data.photo
}
app.post(url, params, head).then((res) => {
wx.showToast({
title: '提交成功,等待审核',
icon: 'none',
duration: 2000
})
setTimeout(function() {
wx.switchTab({
url: '/pages/my/my'
})
}, 1000)
}).catch((err) => {})
} else {
wx.showToast({
title: err,
icon: 'none',
duration: 2000
})
}
},
getdatalist() {
let that = this;
let url = '/index/member_center/edit';
let params = {
'id': that.data.id
};
let head = {
'XX-Token': wx.getStorageSync('token')
}
app.post(url, params, head).then((res) => {
let provincearr = that.data.provincearr;
let cityarr = that.data.cityarr;
let countryarr = that.data.countryarr;
let val = [0, 0, 0];
for (let i = 0; i < provincearr.length; i++) {
if (provincearr[i].province_name == res.province) {
val[0] = i;
}
}
for (let i = 0; i < cityarr.length; i++) {
if (cityarr[i].city_name == res.city) {
val[1] = i;
}
}
for (let i = 0; i < countryarr.length; i++) {
if (countryarr[i].country_name == res.county) {
val[2] = i;
}
}
that.setData({
valarr: val,
confirmvalarr: val,
addr: res.addr,
address: res.address,
birthday: res.birthday,
card_number: res.card_number,
city: res.city,
county: res.county,
duty: res.duty,
education: res.education,
email: res.email,
front_card: res.front_card,
move_phone: res.move_phone,
name: res.name,
nation: res.nation,
photo: res.photo,
politics: res.politics,
postcode: res.postcode,
province: res.province,
qq: res.qq,
record: res.record,
reverse_card: res.reverse_card,
school: res.school,
sex: res.sex,
unit: res.unit,
urgency_phone: res.urgency_phone,
type: res.type
})
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that = this;
that.setData({
is_submit: options.is_submit,
id: options.id,
page_type: options.type ? options.type : null
})
let now = new Date();
let time = now.getFullYear() + "-" + ((now.getMonth() + 1) < 10 ? "0" : "") + (now.getMonth() + 1) + "-" + (now.getDate() < 10 ? "0" : "") + now.getDate();
this.setData({
enddata: time
})
that.getarea();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
<view class='avator_box'>
<view class='avator_box' wx:if="{{!page_type}}">
<view class='upimg' bindtap='{{ifempower?"uploadImages":""}}' data-tem='1'>
<button open-type='getUserInfo' bindgetuserinfo='start' class='inofbtn' if='{{!ifempower}}' data-tem='1'></button>
<image src='{{photo}}' wx:if='{{photo}}'></image>
<image src='{{photo}}' wx:if='{{photo}}' mode="aspectFill"></image>
<view class='iconfont icon-xiangji' wx:if='{{!photo}}'></view>
</view>
... ... @@ -14,10 +14,10 @@
<view class='apply_item'>
<view>姓名</view>
<view class='apply_item_input'>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setname' value='{{name}}'></input>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setname' value='{{name}}' disabled="{{page_type}}"></input>
</view>
</view>
<picker bindchange="bindsex" range="{{arraysex}}">
<picker bindchange="bindsex" range="{{arraysex}}" disabled="{{page_type}}">
<view class='apply_item'>
<view>姓别</view>
<view class='apply_item_input'>
... ... @@ -26,7 +26,7 @@
</view>
</view>
</picker>
<picker mode='date' bindchange="bindbirthdayChange" end='{{enddata}}'>
<picker mode='date' bindchange="bindbirthdayChange" end='{{enddata}}' disabled="{{page_type}}">
<view class='apply_item'>
<view>出生日期</view>
<view class='apply_item_input'>
... ... @@ -35,7 +35,7 @@
</view>
</view>
</picker>
<picker range='{{nationarr}}' bindchange="bindnationChange">
<picker range='{{nationarr}}' bindchange="bindnationChange" disabled="{{page_type}}">
<view class='apply_item'>
<view>民族</view>
<view class='apply_item_input'>
... ... @@ -44,7 +44,7 @@
</view>
</view>
</picker>
<picker range='{{educationarr}}' bindchange="bindeducationChange">
<picker range='{{educationarr}}' bindchange="bindeducationChange" disabled="{{page_type}}">
<view class='apply_item'>
<view>学历</view>
<view class='apply_item_input'>
... ... @@ -53,7 +53,7 @@
</view>
</view>
</picker>
<picker range='{{politicsarr}}' bindchange="bindpoliticsChange">
<picker range='{{politicsarr}}' bindchange="bindpoliticsChange" disabled="{{page_type}}">
<view class='apply_item'>
<view>政治面貌</view>
<view class='apply_item_input'>
... ... @@ -65,37 +65,37 @@
<view class='apply_item'>
<view>工作单位</view>
<view class='apply_item_input'>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setunit' value='{{unit}}'></input>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setunit' value='{{unit}}' disabled="{{page_type}}"></input>
</view>
</view>
<view class='apply_item'>
<view>职务</view>
<view class='apply_item_input'>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setduty' value='{{duty}}'></input>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setduty' value='{{duty}}' disabled="{{page_type}}"></input>
</view>
</view>
<view class='apply_item'>
<view>通讯地址</view>
<view class='apply_item_input'>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setaddr' value='{{addr}}'></input>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setaddr' value='{{addr}}' disabled="{{page_type}}"></input>
</view>
</view>
<view class='apply_item'>
<view>邮编</view>
<view class='apply_item_input'>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setpostcode' value='{{postcode}}'></input>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setpostcode' value='{{postcode}}' disabled="{{page_type}}"></input>
</view>
</view>
<view class='apply_item'>
<view>就读/毕业院校</view>
<view class='apply_item_input'>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setschool' value='{{school}}'></input>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setschool' value='{{school}}' disabled="{{page_type}}"></input>
</view>
</view>
<view class='apply_item'>
<view>身份证号</view>
<view class='apply_item_input'>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setcard_number' value='{{card_number}}'></input>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setcard_number' value='{{card_number}}' disabled="{{page_type}}"></input>
</view>
</view>
<!-- <view class='apply_item'>
... ... @@ -107,29 +107,29 @@
<view class='apply_item'>
<view>移动电话</view>
<view class='apply_item_input'>
<input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='setmove_phone' value='{{move_phone}}'></input>
<input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='setmove_phone' value='{{move_phone}}' disabled="{{page_type}}"></input>
</view>
</view>
<view class='apply_item'>
<view>电子邮箱</view>
<view class='apply_item_input'>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setemail' value='{{email}}'></input>
<input placeholder='未填写' placeholder-class='input_p' bindinput='setemail' value='{{email}}' disabled="{{page_type}}"></input>
</view>
</view>
<view class='apply_item big_item'>
<view>紧急联系人及电话</view>
<view class='apply_item_input'>
<input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='seturgency_phone' value='{{urgency_phone}}'></input>
<input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='seturgency_phone' value='{{urgency_phone}}' disabled="{{page_type}}"></input>
</view>
</view>
<view class='apply_item'>
<view>QQ号码</view>
<view class='apply_item_input'>
<input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='setqq' value='{{qq}}'></input>
<input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='setqq' value='{{qq}}' disabled="{{page_type}}"></input>
</view>
</view>
<view class='apply_item' bindtap='setshowapply'>
<view class='apply_item' bindtap="{{page_type?'':'setshowapply'}}">
<view>服务区域</view>
<view class='apply_item_input'>
<view class='iconfont icon-xiangyou'></view>
... ... @@ -156,7 +156,7 @@
<view class='apply_cell {{apply_nav==2?"apply_active":""}}' data-apply_nav='2' bindtap='setapply_nav'>个人履历3</view>
</view>
<view class='navbox'>
<picker mode='date' bindchange="bindstartChange">
<picker mode='date' bindchange="bindstartChange" disabled="{{page_type}}">
<view class='apply_item'>
<view>开始时间</view>
<view class='apply_item_input'>
... ... @@ -165,7 +165,7 @@
</view>
</view>
</picker>
<picker mode='date' bindchange="bindendChange">
<picker mode='date' bindchange="bindendChange" disabled="{{page_type}}">
<view class='apply_item'>
<view>结束时间</view>
<view class='apply_item_input'>
... ... @@ -177,31 +177,31 @@
<view class='apply_item'>
<view>单位名称</view>
<view class='apply_item_input'>
<input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_unit}}' bindinput='setrecordunit'></input>
<input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_unit}}' bindinput='setrecordunit' disabled="{{page_type}}"></input>
</view>
</view>
<view class='apply_item'>
<view>职务</view>
<view class='apply_item_input'>
<input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_duty}}' bindinput='setrecordduty'></input>
<input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_duty}}' bindinput='setrecordduty' disabled="{{page_type}}"></input>
</view>
</view>
<view class='apply_item'>
<view>证明人</view>
<view class='apply_item_input'>
<input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_name}}' bindinput='setrecordname'></input>
<input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_name}}' bindinput='setrecordname' disabled="{{page_type}}"></input>
</view>
</view>
<view class='apply_item'>
<view>证明人电话</view>
<view class='apply_item_input'>
<input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_phone}}' bindinput='setrecordphone'></input>
<input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_phone}}' bindinput='setrecordphone' disabled="{{page_type}}"></input>
</view>
</view>
</view>
<view class='apply_title'>上传身份证照片</view>
<view class='apply_idbox'>
<view class='apply_idimg' bindtap='uploadImages' data-tem='2'>
<view class='apply_idimg' bindtap="{{page_type?'':'uploadImages'}}" data-tem='2'>
<view class='apply_idimgmain' wx:if='{{!front_card}}'>
<view class='apply_idupimg'>
<text class='iconfont icon-camera1'></text>
... ... @@ -210,7 +210,7 @@
</view>
<image src='{{front_card?front_card:"https://volunteer.cnpu.org/imgs/renzhengxinxi_fanmian_bg@2x.png"}}'></image>
</view>
<view class='apply_idimg' bindtap='uploadImages' data-tem='3'>
<view class='apply_idimg' bindtap="{{page_type?'':'uploadImages'}}" data-tem='3'>
<view class='apply_idimgmain' wx:if='{{!reverse_card}}'>
<view class='apply_idupimg'>
<text class='iconfont icon-camera1'></text>
... ... @@ -220,12 +220,12 @@
<image src='{{reverse_card?reverse_card:"https://volunteer.cnpu.org/imgs/renzhengxinxi_zhengmian_bg@2x.png"}}'></image>
</view>
</view>
<view class='apply_bottomtitle'>志愿者申请书
<view class='apply_bottomtitle' wx:if="{{!page_type}}">志愿者申请书
</view>
<view class='apply_bottom'>
<view class='apply_bottom' wx:if="{{!page_type}}">
为继承和弘扬国际主义战士白求恩的伟大风范和高尚情操,传承和弘扬白求恩的伟大精神,本人自愿申请加入白求恩志愿者队伍。 本人愿尽己所能,以“志愿服务”为宗旨,不计报酬、帮助他人、服务社会,恪守国家法律、法规,遵守白求恩志愿者各项规章制度,努力工作,尽职尽责,力争为公益事业做出贡献。
</view>
<view class='apply_btn' bindtap='submit'>
<view class='apply_btn' bindtap='submit' wx:if="{{!page_type}}">
提交
</view>
... ... @@ -245,7 +245,7 @@
<view wx:for="{{countryarr}}" wx:key style="line-height: 40px" class='column_view'>{{item.country_name}}</view>
</picker-view-column>
</picker-view>
<view class='apply_vold_btn'>
<view class='apply_vold_btn' wx:if="{{!page_type}}">
<view class='applybtn' catchtap='setno'>取消</view>
<view class='applybtn yes_applybtn' catchtap='setyes'>确定</view>
</view>
... ...
... ... @@ -46,8 +46,98 @@ Page({
t_type: false,
z_type: false,
e_type: false,
cover_type: false
},
// 审核用户信息是否通过
examine(e){
let that = this
let id = e.currentTarget.dataset.id
let url = 'index/member_center/adminApprove';
let head = {
'XX-Token': wx.getStorageSync('token')
}
let params = {
id: that.data.info.id,
status: id
}
app.post(url, params, head).then((res) => {
wx.showToast({
title: '操作成功',
icon: 'success',
duration: 1000,
success: () => {
that.setData({
two_type: true
})
}
})
}).catch((err) => { })
},
//查看工作汇报
look_word(){
if (this.data.info.is_complete !=1){
wx.showToast({
title: '该用户还未提交工作汇报',
icon: 'none'
})
return
}
wx.navigateTo({
url: '/pages/word_report/word_report?id=' + this.data.id + '&user_id=' + this.data.user_id,
})
},
//查看注册信息
look_register(){
wx.navigateTo({
url: '/pages/apply/apply?id=' + this.data.user_id + '&is_submit=' + 1 + '&type=1',
})
},
// 输入信息
get_word(e) {
this.setData({
word: e.detail.value
})
},
// 改变弹窗状态
change_cover(e) {
this.setData({
cover_type: !this.data.cover_type
})
},
// 添加时间
add_time() {
let that = this
if (!that.data.word) {
wx.showToast({
title: '请输入工时',
icon: 'none',
duration: 1000
})
return
}
let url = 'index/member_center/addTime';
let head = {
'XX-Token': wx.getStorageSync('token')
}
let params = {
user_id: that.data.user_id,
add_time: that.data.word
}
app.post(url, params, head).then((res) => {
wx.showToast({
title: '操作成功',
icon: 'success',
duration: 1000,
success: () => {
that.setData({
word: null,
cover_type: false
})
}
})
}).catch((err) => { })
},
// 选择参加日期,入住日期,用餐日期
change_date(e) {
let that = this
... ... @@ -212,7 +302,7 @@ Page({
z_arr: res.apply_stay ? res.apply_stay : this.data.z_arr,
e_arr: res.apply_food ? res.apply_food : this.data.e_arr,
})
})
},
... ... @@ -297,7 +387,8 @@ Page({
t_type: true,
z_type: true,
e_type: true,
page_type: options.type
page_type: options.type,
user_id: options.user_id ? options.user_id:null
})
}
this.setData({
... ...
... ... @@ -19,7 +19,7 @@
<view class="left">
<image src="/imgs/must.png" /> 工作类型
</view>
<picker range="{{enroll_arr}}" value="{{type}}" bindchange="change_enroll">
<picker range="{{enroll_arr}}" value="{{type}}" bindchange="change_enroll" disabled="{{page_type == 0 || page_type == 1}}">
<view class="right">
<text>{{type?type:'请选择'}}</text>
<image src="/imgs/right.png" />
... ... @@ -30,11 +30,11 @@
<view class="left">
<image src="/imgs/must.png" /> 工作内容
</view>
<picker range="{{check_arr}}" value="{{check_item}}" bindchange="change_check">
<view class="right" bindtap="show_cover">
<text>{{check?check:'请选择'}}</text>
<image src="/imgs/right.png" />
</view>
<picker range="{{check_arr}}" value="{{check_item}}" bindchange="change_check" disabled="{{page_type == 0 || page_type == 1}}">
<view class="right" bindtap="show_cover">
<text>{{check?check:'请选择'}}</text>
<image src="/imgs/right.png" />
</view>
</picker>
</view>
</view>
... ... @@ -45,7 +45,7 @@
<view class="left">
<image src="/imgs/must.png" /> 参加日期
</view>
<picker mode="selector" value="{{item.date}}" bindchange="change_date" range="{{date_arr}}" data-index="{{index}}" data-id="1">
<picker mode="selector" value="{{item.date}}" bindchange="change_date" range="{{date_arr}}" data-index="{{index}}" data-id="1" disabled="{{page_type == 0 || page_type == 1}}">
<view class="right">
<text>{{item.date?item.date:'请选择'}}</text>
<image src="/imgs/right.png" />
... ... @@ -56,14 +56,14 @@
<view class="left">
<image src="/imgs/must.png" /> 参加时间
</view>
<picker mode="selector" value="{{item.time}}" bindchange="change_time" range="{{time_arr}}" data-index="{{index}}">
<picker mode="selector" value="{{item.time}}" bindchange="change_time" range="{{time_arr}}" data-index="{{index}}" disabled="{{page_type == 0 || page_type == 1}}">
<view class="right">
<text>{{item.time?item.time:'请选择'}}</text>
<image src="/imgs/right.png" />
</view>
</picker>
</view>
<view class="add" bindtap="add_item" data-id="1" wx:if="{{index == t_arr.length -1}}">+添加</view>
<view class="add" bindtap="add_item" data-id="1" wx:if="{{index == t_arr.length -1 && page_type!=0 && page_type!=1}}">+添加</view>
</view>
<view class="info_box" wx:for="{{z_arr}}" wx:key="index">
... ... @@ -74,7 +74,7 @@
<view class="left">
<image src="/imgs/must.png" /> 入住日期
</view>
<picker mode="selector" value="{{item.date}}" bindchange="change_date" range="{{date_arr}}" data-index="{{index}}" data-id="2">
<picker mode="selector" value="{{item.date}}" bindchange="change_date" range="{{date_arr}}" data-index="{{index}}" data-id="2" disabled="{{page_type == 0 || page_type == 1}}">
<view class="right">
<text>{{item.date?item.date:'请选择'}}</text>
<image src="/imgs/right.png" />
... ... @@ -83,9 +83,9 @@
</view>
<view class="item">
<text>入住人身份证号码</text>
<input placeholder="请输入" bindinput="get_card" value="{{item.idcard}}" maxlength="18" data-index="{{index}}"/>
<input placeholder="请输入" bindinput="get_card" value="{{item.idcard}}" maxlength="18" data-index="{{index}}" disabled="{{page_type == 0 || page_type == 1}}" />
</view>
<view class="add" bindtap="add_item" data-id="2" wx:if="{{index == z_arr.length -1}}">+添加</view>
<view class="add" bindtap="add_item" data-id="2" wx:if="{{index == z_arr.length -1 && page_type!=0 && page_type!=1}}">+添加</view>
</view>
<view class="info_box" wx:for="{{e_arr}}" wx:key="index">
... ... @@ -94,25 +94,45 @@
<view class="left">
<image src="/imgs/must.png" /> 用餐日期
</view>
<picker mode="selector" value="{{item.date}}" bindchange="change_date" range="{{date_arr}}" data-index="{{index}}" data-id="3">
<picker mode="selector" value="{{item.date}}" bindchange="change_date" range="{{date_arr}}" data-index="{{index}}" data-id="3" disabled="{{page_type == 0 || page_type == 1}}">
<view class="right">
<text>{{item.date?item.date:'请选择'}}</text>
<text>{{item.date?item.date:'请选择'}}</text>
<image src="/imgs/right.png" />
</view>
</picker>
</view>
<view class="item">
<view class="left">
<image src="/imgs/must.png"/> 用餐时间
<image src="/imgs/must.png" /> 用餐时间
</view>
<picker mode="selector" value="{{item.time}}" bindchange="eat_time" range="{{eat_arr}}" data-index="{{index}}">
<picker mode="selector" value="{{item.time}}" bindchange="eat_time" range="{{eat_arr}}" data-index="{{index}}" disabled="{{page_type == 0 || page_type == 1}}">
<view class="right">
<text>{{item.time?item.time:'请选择'}}</text>
<text>{{item.time?item.time:'请选择'}}</text>
<image src="/imgs/right.png" />
</view>
</picker>
</view>
<view class="add" bindtap="add_item" data-id="3" wx:if="{{index == e_arr.length -1}}">+添加</view>
<view class="add" bindtap="add_item" data-id="3" wx:if="{{index == e_arr.length -1 && page_type!=0 && page_type!=1}}">+添加</view>
</view>
<view class="submit" bindtap="submit" wx:if="{{page_type!=0 && page_type!=1}}">确认</view>
<view class="btn_box" wx:else>
<view class="look_table" catchtap="{{page_type == 1?'look_word':'look_register'}}">{{page_type == 1?'查看工作汇报':'查看注册信息'}}</view>
<view class="fill_time" catchtap="change_cover" wx:if="{{page_type == 1}}">输入工时</view>
<view class="two_btn" wx:if="{{page_type == 0 && !two_type}}">
<view catchtap="examine" data-id="2">不通过</view>
<view catchtap="examine" data-id="1">通过</view>
</view>
</view>
<view class="submit" bindtap="submit">确认</view>
\ No newline at end of file
<view class="cover_box" catchtouchmove="true" wx:if="{{cover_type}}">
<view class="show_box">
<view class="s_title">请输入工时</view>
<input placeholder="请输入..." class="word_area active" value="{{word}}" bindinput="get_word" type="number"/>
<view class="submit" catchtap="add_time">确认</view>
<image src="/imgs/close.png" class="close" catchtap="change_cover" />
</view>
</view>
\ No newline at end of file
... ...
page {
height: 100%;
padding-bottom: 78rpx;
box-sizing: border-box;
}
... ... @@ -9,9 +10,11 @@ page {
border-bottom: 16rpx solid #f5f6f8;
box-sizing: border-box;
}
.info_box:last-child{
.info_box:last-child {
border-bottom: none !important;
}
.item {
width: 100%;
height: 100rpx;
... ... @@ -25,13 +28,15 @@ page {
border-bottom: 2rpx solid #e6e6e6;
box-sizing: border-box;
}
.item input{
.item input {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
text-align: right;
}
.item:last-child {
border: none;
}
... ... @@ -92,62 +97,121 @@ page {
align-items: center;
}
/* .cover_box {
.submit {
width: 686rpx;
height: 88rpx;
background: rgba(65, 205, 121, 1);
border-radius: 10rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
display: flex;
justify-content: center;
align-items: center;
margin: 90rpx auto 0;
}
.cover_box {
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.3);
position: fixed;
left: 0;
top: 0;
display: flex;
justify-content: center;
align-items: center;
background: rgba(0, 0, 0, 0.3);
}
.content_box {
.show_box {
width: 595rpx;
padding: 0 28rpx 54rpx;
box-sizing: border-box;
background: rgba(255, 255, 255, 1);
border-radius: 10rpx;
padding: 50rpx 32rpx;
box-sizing: border-box;
position: relative;
}
.content_box .w_title {
.show_box .s_title {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: rgba(51, 51, 51, 1);
margin: 74rpx auto 38rpx;
text-align: center;
margin-top: 24rpx;
}
.w_content {
.show_box .word_area {
width: 539rpx;
height: 275rpx;
border: 1px solid rgba(229, 229, 229, 1);
border-radius: 10rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(204, 204, 204, 1);
padding: 30rpx 36rpx;
box-sizing: border-box;
}
.show_box .active {
height: 85rpx !important;
}
.show_box .submit {
width: 495rpx;
height: 88rpx;
background: rgba(65, 205, 121, 1);
border-radius: 10rpx;
margin: 56rpx auto 0;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
display: flex;
justify-content: center;
align-items: center;
}
.show_box .close {
width: 26rpx;
height: 26rpx;
color: #ccc;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
position: absolute;
right: 29rpx;
top: 31rpx;
}
.btn_box {
width: 100%;
margin-top: 50rpx;
margin-top: 226rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
justify-content: center;
}
.w_item {
font-size: 26rpx;
.look_table {
width: 322rpx;
height: 88rpx;
background: rgba(65, 205, 121, 1);
border-radius: 44rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #666666;
padding: 18rpx 22rpx;
border-radius: 10rpx;
margin-bottom: 30rpx;
margin-right: 18rpx;
border: 1px solid #ccc;
}
.w_item:nth-child(2n){
margin-right: 0;
color: rgba(255, 255, 255, 1);
display: flex;
justify-content: center;
align-items: center;
}
.submit {
.fill_time {
width: 100%;
height: 88rpx;
background: rgba(65, 205, 121, 1);
border-radius: 10rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
... ... @@ -155,19 +219,19 @@ page {
display: flex;
justify-content: center;
align-items: center;
margin-top: 34rpx;
margin-top: 119rpx;
}
.active{
border-color: rgba(65, 205, 121, 1);
color: rgba(255, 255, 255, 1);
background: rgba(65, 205, 121, 1);
} */
.submit {
width: 686rpx;
.two_btn {
width: 100%;
height: 88rpx;
background: rgba(65, 205, 121, 1);
border-radius: 10rpx;
display: flex;
justify-content: space-between;
}
.two_btn view {
width: 50%;
height: 100%;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
... ... @@ -175,5 +239,11 @@ page {
display: flex;
justify-content: center;
align-items: center;
margin: 90rpx auto 0;
margin-top: 119rpx;
}
.two_btn view:first-child{
background: #CCCCCC;
}
.two_btn view:last-child{
background: #41CD79;
}
\ No newline at end of file
... ...
... ... @@ -12,6 +12,31 @@ Page({
status: '',
cover_type: false
},
//查看更多报名用户信息(审核端)
look_more(e){
wx.navigateTo({
url: '/pages/enroll/enroll?type=' + e.currentTarget.dataset.type + '&id=' + this.data.id + '&user_id=' + e.currentTarget.dataset.user_id
})
},
// 工作内容(管理员)
join_info() {
let that = this;
let head = {
'XX-Token': wx.getStorageSync('token')
}
let url = 'index/member_center/getJoinPerson';
let params = {
id: that.data.id
}
app.post(url, params, head).then((res) => {
console.log(res)
that.setData({
join_info: res
})
}).catch((err) => {
})
},
//保存海报到本地
save_poster(){
wx.downloadFile({
... ... @@ -67,7 +92,7 @@ Page({
// 编辑报名信息
edit_info() {
wx.navigateTo({
url: '/pages/enroll/enroll?id=' + this.data.id + '&type=1'
url: '/pages/enroll/enroll?id=' + this.data.id + '&type=3'
})
},
get_poster() {
... ... @@ -122,6 +147,7 @@ Page({
})
if (that.data.status == '1'){
that.get_poster()
that.join_info()
}
wxParse.wxParse('content', 'html', res.content, that, 5);
}).catch((err) => {
... ... @@ -133,7 +159,7 @@ Page({
let head = {
'XX-Token': wx.getStorageSync('token')
}
let url = '/index/index/news_info';
let url = 'index/index/news_info';
let params = {
id: that.data.id
}
... ...
... ... @@ -8,7 +8,7 @@
<import src="../../wxParse/wxParse.wxml" />
<template is='wxParse' data='{{wxParseData:content.nodes}}' />
</view>
<view class='memberbox' wx:if='{{datalist.join.length>0 && type != 1}}'>
<view class='memberbox' wx:if='{{datalist.join.length>0 && type != 1 && datalist.admin !=1}}'>
<view class='title'>已成功报名人员</view>
<view class='member' wx:for='{{datalist.join}}' wx:key='index'>
<view class="top">
... ... @@ -19,12 +19,11 @@
</view>
</view>
</view>
<view wx:if="{{type!= 1}}">
<view wx:if="{{type!= 1 && datalist.admin !=1}}">
<navigator class='foot' url="/pages/enroll/enroll?id={{id}}" wx:if='{{datalist.button_status == 1}}' hover-class="none">报名</navigator>
<view class='foot' wx:if='{{datalist.button_status == 2}}' style='background: #FFD700; color: #fff;'>待审核</view>
<navigator class='foot' wx:if='{{datalist.button_status == 3}}' url="/pages/word_report/word_report?id={{id}}" hover-class="none">签到工作汇报</navigator>
<!-- <navigator class='foot' bindtap='sign' url="/pages/word_report/word_report?id={{id}}" hover-class="none">签到工作汇报</navigator> -->
<view class='foot' wx:if='{{datalist.button_status == 4}}' style='background: #ccc;color: #fff;'>已签到工作汇报</view>
<navigator class='foot' wx:if='{{datalist.button_status == 3}}' url="/pages/word_report/word_report?id={{id}}" hover-class="none">工作汇报</navigator>
<view class='foot' wx:if='{{datalist.button_status == 4}}' style='background: #ccc;color: #fff;'>工作汇报</view>
<view class='foot' wx:if='{{datalist.button_status == 5}}' style='background: #ccc;color: #fff;'>已结束</view>
<navigator url='/pages/result/result' class='foot' wx:if='{{datalist.button_status == 6}}'>成为志愿者</navigator>
... ... @@ -32,8 +31,8 @@
<view class="btn_box">
<navigator class="btn-item" style="background: url('/imgs/index.png') no-repeat center;background-size: cover;" url="/pages/index/index" open-type="switchTab">首页</navigator>
<view class="btn-item" style="background: url('{{datalist.button_status == 2?'/imgs/edit.png':'/imgs/edit@.png'}}') no-repeat center;background-size: cover;" bindtap="{{datalist.button_status == 2?'edit_info':''}}" wx:if="{{1<datalist.button_status<6}}">编辑</view>
<view class="btn-item" style="background: url('{{datalist.button_status == 5?'/imgs/out@.png':'/imgs/out.png'}}') no-repeat center;background-size: cover;" wx:if="{{2<datalist.button_status<6}}" bindtap="change_cover" data-id="1">退出</view>
<view class="btn-item" style="background: url('{{datalist.button_status == 2?'/imgs/edit.png':'/imgs/edit@.png'}}') no-repeat center;background-size: cover;" bindtap="{{datalist.button_status == 2?'edit_info':''}}" wx:if="{{1<datalist.button_status<6 && datalist.admin !=1}}">编辑</view>
<view class="btn-item" style="background: url('{{datalist.button_status == 5?'/imgs/out@.png':'/imgs/out.png'}}') no-repeat center;background-size: cover;" wx:if="{{2<datalist.button_status<6 && datalist.admin !=1}}" bindtap="change_cover" data-id="1">退出</view>
<view class="btn-item" style="background: url('/imgs/share.png') no-repeat center;background-size: cover;" bindtap="change_cover" data-id="2">分享</view>
</view>
... ... @@ -48,7 +47,75 @@
<view class="poster_box" wx:if="{{cover_id == 2}}" style="background: url('{{poster}}') no-repeat center;background-size: cover;">
<view class="select_box" style="margin-top:812rpx;">
<view catchtap="change_cover" catchtap="save_poster" class="b_item">保存到相册</view>
<button class="b_item" open-type="share">发送给朋友</button>
<button class="b_item" open-type="share">发送给朋友</button>
</view>
</view>
</view>
<view class="c_item" wx:if="{{join_info.camera.length>0}}">
<view class="c_title">摄影(设备自带</view>
<view class="c_box">
<view class="i_info {{join_info.camera.length>3 && index<join_info.camera.length-2?'line':''}}" wx:for="{{join_info.camera}}" wx:key="index" data-type="{{item.status =='已通过'?'1':0}}" data-user_id="{{item.user_id}}" bindtap="look_more">
<image src="{{item.photo}}" mode="aspectFill" />
<view class="name">李强</view>
<view class="status" wx:if="{{item.status =='已通过'}}" style="background: #41CD79;">已通过</view>
<view class="status" wx:else style="background: #F84141;">未通过</view>
</view>
</view>
</view>
<view class="c_item" wx:if="{{join_info.photo.length>0}}">
<view class="c_title">摄像(设备自带</view>
<view class="c_box">
<view class="i_info {{join_info.photo.length>3 && index<join_info.photo.length-2?'line':''}}" wx:for="{{join_info.photo}}" wx:key="index" data-type="{{item.status =='已通过'?'1':0}}" data-user_id="{{item.user_id}}" bindtap="look_more">
<image src="{{item.photo}}" mode="aspectFill" />
<view class="name">李强</view>
<view class="status" wx:if="{{item.status =='已通过'}}" style="background: #41CD79;">已通过</view>
<view class="status" wx:else style="background: #F84141;">未通过</view>
</view>
</view>
</view>
<view class="c_item" wx:if="{{join_info.motorcade.length>0}}">
<view class="c_title">爱心车队</view>
<view class="c_box">
<view class="i_info {{join_info.motorcade.length>3 && index<join_info.motorcade.length-2?'line':''}}" wx:for="{{join_info.motorcade}}" wx:key="index" data-type="{{item.status =='已通过'?'1':0}}" data-user_id="{{item.user_id}}" bindtap="look_more">
<image src="{{item.photo}}" mode="aspectFill" />
<view class="name">李强</view>
<view class="status" wx:if="{{item.status =='已通过'}}" style="background: #41CD79;">已通过</view>
<view class="status" wx:else style="background: #F84141;">未通过</view>
</view>
</view>
</view>
<view class="c_item" wx:if="{{join_info.question.length>0}}">
<view class="c_title">线上答疑</view>
<view class="c_box">
<view class="i_info {{join_info.question.length>3 && index<join_info.question.length-2?'line':''}}" wx:for="{{join_info.question}}" wx:key="index" data-type="{{item.status =='已通过'?'1':0}}" data-user_id="{{item.user_id}}" bindtap="look_more">
<image src="{{item.photo}}" mode="aspectFill" />
<view class="name">李强</view>
<view class="status" wx:if="{{item.status =='已通过'}}" style="background: #41CD79;">已通过</view>
<view class="status" wx:else style="background: #F84141;">未通过</view>
</view>
</view>
</view>
<view class="c_item" wx:if="{{join_info.ill.length>0}}">
<view class="c_title">门诊服务</view>
<view class="c_box">
<view class="i_info {{join_info.ill.length>3 && index<join_info.ill.length-2?'line':''}}" wx:for="{{join_info.ill}}" wx:key="index" data-type="{{item.status =='已通过'?'1':0}}" data-user_id="{{item.user_id}}" bindtap="look_more">
<image src="{{item.photo}}" mode="aspectFill" />
<view class="name">李强</view>
<view class="status" wx:if="{{item.status =='已通过'}}" style="background: #41CD79;">已通过</view>
<view class="status" wx:else style="background: #F84141;">未通过</view>
</view>
</view>
</view>
<view class="c_item" wx:if="{{join_info.ill.service>0}}">
<view class="c_title">现场服务(签到、指引、礼仪等</view>
<view class="c_box">
<view class="i_info {{join_info.service.length>3 && index<join_info.service.length-2?'line':''}}" wx:for="{{join_info.service}}" wx:key="index" data-type="{{item.status =='已通过'?'1':0}}" data-user_id="{{item.user_id}}" bindtap="look_more">
<image src="{{item.photo}}" mode="aspectFill" />
<view class="name">李强</view>
<view class="status" wx:if="{{item.status =='已通过'}}" style="background: #41CD79;">已通过</view>
<view class="status" wx:else style="background: #F84141;">未通过</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -229,3 +229,68 @@ page {
height: 952rpx;
border-radius: 10rpx;
}
.c_item {
width: 100%;
padding: 0 32rpx;
box-sizing: border-box;
border-bottom: 16rpx solid #f5f6f8;
}
.c_item:last-child {
border-bottom: none;
}
.c_item .c_title {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: rgba(51, 51, 51, 1);
border-left: 4rpx solid #21ae59;
padding-left: 13rpx;
margin-top: 44rpx;
box-sizing: border-box;
}
.c_box {
width: 100%;
margin-top: 21rpx;
display: flex;
flex-wrap: wrap;
}
.i_info {
width: 33.333%;
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 28rpx 48rpx;
box-sizing: border-box;
}
.i_info image {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
}
.i_info .name {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
margin: 14rpx 0;
}
.i_info .status {
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
padding: 10rpx 14rpx;
}
.line {
border-bottom: 1px solid #e6e6e6;
}
... ...
... ... @@ -21,7 +21,7 @@
<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>
<image src='{{item.thumbnail}}' mode="aspectFill"> </image>
</view>
<view class='new_title'>{{item.activity_name}}</view>
<view class='title_box'>
... ...
... ... @@ -23,10 +23,10 @@ Page({
})
},
goamdin() {
let that = this;
// 管理员
goamdin(e) {
wx.navigateTo({
url: '/pages/admin/admin'
url: '/pages/admin/admin?type=' + e.currentTarget.dataset.type
})
},
... ...
<!--pages/my/my.wxml-->
<view class='my_head'>
<image src='https://volunteer.cnpu.org/imgs/gerenzhongxin_bg@2x.png'></image>
<view class='my_headitem'>
... ... @@ -47,10 +47,18 @@
</view>
<view class='iconfont icon-xiangyou'></view>
</navigator>
<view class='my_item' bindtap='goamdin' wx:if='{{datalist.type=="2"}}'>
<view class='my_item' bindtap='goamdin' wx:if='{{datalist.type=="2"}}' data-type="1">
<view class='my_itemletf'>
<view class='iconfont icon-gongzhang'></view>管理员审核
</view>
<view class='iconfont icon-xiangyou'></view>
</view>
<view class='my_item' bindtap='goamdin' wx:if='{{datalist.type=="2"}}' data-type="2">
<view class='my_itemletf'>
<image src="/imgs/time.png" class="time"/>志愿者工时管理
</view>
<view class='iconfont icon-xiangyou'></view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -80,6 +80,12 @@
left: -10rpx;
top: 0;
}
.my_itemletf .time{
width: 34rpx;
height: 32rpx;
margin-right: 30rpx;
left: 0;
}
.my_itemletf .iconfont {
font-size: 40rpx;
color: #fa8286;
... ...
... ... @@ -4,7 +4,7 @@
<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>
<image src='{{item.thumbnail}}' mode="aspectFill"> </image>
</view>
<view class='new_title'>{{item.activity_name}}</view>
<view class='title_box'>
... ...
... ... @@ -60,6 +60,9 @@ Page({
let params = {
id: id
}
if (this.data.user_id){
params.user_id = this.data.user_id
}
let header = {
'XX-Token': wx.getStorageSync('token')
}
... ... @@ -117,8 +120,10 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
this.setData({
id: options.id
id: options.id,
user_id: options.user_id ? options.user_id:null
})
this.get_info(options.id)
},
... ...