作者 niufei

基本对接完成

1 -// pages/admin/admin.js  
2 -const app=getApp(); 1 +const app = getApp();
3 2
4 Page({ 3 Page({
5 4
6 - /**  
7 - * 页面的初始数据  
8 - */  
9 - data: {  
10 - page:0,  
11 - datalist:[],  
12 - pageNum:10,  
13 - },  
14 -getdatalist(){  
15 - let that=this;  
16 - let head={  
17 - 'XX-Token':wx.getStorageSync('token')  
18 - }  
19 - let url ='index/member_center/admin';  
20 - let params={  
21 - page: that.data.page,  
22 - pageNum: that.data.pageNum  
23 - }  
24 - app.post(url, params, head).then((res)=>{  
25 - let datalist = that.data.datalist;  
26 - let datadatalist = datalist.concat(res.volunteer);  
27 - that.setData({  
28 - datalist: datadatalist,  
29 - page: res.page  
30 - })  
31 - }).catch((err)=>{  
32 - })  
33 -  
34 -},  
35 - update_status(e){  
36 - let that=this;  
37 - let index = e.currentTarget.dataset.index;  
38 - let url ='index/member_center/update_status';  
39 - let head = {  
40 - 'XX-Token': wx.getStorageSync('token')  
41 - }  
42 - let params={  
43 - id: e.currentTarget.id,  
44 - status: e.currentTarget.dataset.status 5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + page: 0,
  10 + datalist: [],
  11 + pageNum: 10,
  12 + cover_type: false
  13 + },
  14 +// 输入信息
  15 + get_word(e) {
  16 + this.setData({
  17 + word: e.detail.value
  18 + })
  19 + },
  20 + // 改变弹窗状态
  21 + change_cover(e) {
  22 + if (e.currentTarget.dataset.index){
  23 + this.setData({
  24 + index: e.currentTarget.dataset.index,
  25 + id: e.currentTarget.dataset.id
  26 + })
  27 + }
  28 + this.setData({
  29 + cover_type: !this.data.cover_type
  30 + })
  31 + },
  32 + getdatalist() {
  33 + wx.showLoading({
  34 + title: '加载中',
  35 + })
  36 + let that = this
  37 + let head = {
  38 + 'XX-Token': wx.getStorageSync('token')
  39 + }
  40 + let url = that.data.type > 1 ? 'index/member_center/addTimeList' : 'index/member_center/admin';
  41 + let params = {
  42 + page: that.data.page,
  43 + pageNum: that.data.pageNum
  44 + }
  45 + app.post(url, params, head).then((res) => {
  46 + if (res.volunteer.length == 0) {
  47 + that.setData({
  48 + page_type: true
  49 + })
  50 + }
  51 + if (that.data.page == 0) {
  52 + that.setData({
  53 + datalist: res.volunteer,
  54 + page: res.page
  55 + })
  56 + wx.hideLoading()
  57 + } else {
  58 + setTimeout(() => {
  59 + that.setData({
  60 + datalist: that.data.datalist.concat(res.volunteer),
  61 + page: res.page
  62 + })
  63 + wx.hideLoading()
  64 + }, 1000)
  65 + }
  66 + }).catch((err) => {})
  67 +
  68 + },
  69 +
  70 +// 添加时间
  71 + add_time(){
  72 + let that = this
  73 + if (!that.data.word) {
  74 + wx.showToast({
  75 + title: '请输入工时',
  76 + icon: 'none',
  77 + duration: 1000
  78 + })
  79 + return
  80 + }
  81 + let url = 'index/member_center/addTime';
  82 + let head = {
  83 + 'XX-Token': wx.getStorageSync('token')
  84 + }
  85 + let params = {
  86 + user_id: that.data.id,
  87 + add_time: that.data.word
  88 + }
  89 + app.post(url, params, head).then((res) => {
  90 + wx.showToast({
  91 + title: '操作成功',
  92 + icon: 'success',
  93 + duration: 1000,
  94 + success: () => {
  95 + that.setData({
  96 + word: null,
  97 + cover_type: false
  98 + })
  99 + }
  100 + })
  101 + }).catch((err) => { })
  102 + },
  103 + //通过
  104 + pass(e) {
  105 + this.update_status(e.currentTarget.dataset.id,e.currentTarget.dataset.index, 2)
  106 + },
  107 + //驳回
  108 + reject() {
  109 + if(!this.data.word){
  110 + wx.showToast({
  111 + title: '请填写不通过原因',
  112 + icon: 'none',
  113 + duration: 1000
  114 + })
  115 + return
  116 + }
  117 + this.update_status(this.data.id,this.data.index, 3)
  118 + },
  119 + // 通过,不通过接口
  120 + update_status(id,index, status) {
  121 + let that = this
  122 + let datalist = that.data.datalist
  123 + let url = 'index/member_center/update_status';
  124 + let head = {
  125 + 'XX-Token': wx.getStorageSync('token')
  126 + }
  127 + let params = {
  128 + id: id,
  129 + status: status
  130 + }
  131 + if(status == 3){
  132 + params.refund_reason = that.data.word
  133 + }
  134 + console.log(params)
  135 + app.post(url, params, head).then((res) => {
  136 + wx.showToast({
  137 + title: '操作成功',
  138 + icon: 'success',
  139 + duration: 1000,
  140 + success: () => {
  141 + datalist.splice(index, 1)
  142 + that.setData({
  143 + datalist: datalist,
  144 + word: null,
  145 + cover_type: false
  146 + })
  147 + }
  148 + })
  149 + }).catch((err) => {})
  150 + },
  151 + /**
  152 + * 生命周期函数--监听页面加载
  153 + */
  154 + onLoad: function(options) {
  155 + this.setData({
  156 + type: options.type
  157 + })
  158 + this.getdatalist()
  159 +
  160 + },
  161 +
  162 + /**
  163 + * 生命周期函数--监听页面初次渲染完成
  164 + */
  165 + onReady: function() {
  166 +
  167 + },
  168 +
  169 + /**
  170 + * 生命周期函数--监听页面显示
  171 + */
  172 + onShow: function() {
  173 +
  174 + },
  175 +
  176 + /**
  177 + * 生命周期函数--监听页面隐藏
  178 + */
  179 + onHide: function() {
  180 +
  181 + },
  182 +
  183 + /**
  184 + * 生命周期函数--监听页面卸载
  185 + */
  186 + onUnload: function() {
  187 +
  188 + },
  189 +
  190 + /**
  191 + * 页面相关事件处理函数--监听用户下拉动作
  192 + */
  193 + onPullDownRefresh: function() {
  194 +
  195 + },
  196 +
  197 + /**
  198 + * 页面上拉触底事件的处理函数
  199 + */
  200 + onReachBottom: function() {
  201 + let that = this
  202 + if (that.data.page_type) {
  203 + wx.showToast({
  204 + title: '暂无更多数据',
  205 + icon: 'none'
  206 + })
  207 + return
  208 + }
  209 + that.getdatalist()
  210 + },
  211 +
  212 + /**
  213 + * 用户点击右上角分享
  214 + */
  215 + onShareAppMessage: function() {
  216 +
45 } 217 }
46 - app.post(url, params,head).then((res)=>{  
47 - wx.showToast({  
48 - title: '更新成功',  
49 - icon: 'success',  
50 - duration: 2000  
51 - })  
52 - let datalist = that.data.datalist;  
53 - datalist[index].status = e.currentTarget.dataset.status;  
54 - that.setData({  
55 - datalist: datalist  
56 - })  
57 -  
58 - }).catch((err)=>{  
59 - })  
60 - },  
61 - /**  
62 - * 生命周期函数--监听页面加载  
63 - */  
64 - onLoad: function (options) {  
65 - let windowHeight = wx.getSystemInfoSync().windowHeight;// 屏幕的高度  
66 - let windowWidth = wx.getSystemInfoSync().windowWidth // 屏幕的宽度  
67 - this.setData({  
68 - scroll_height: windowHeight * 750 / windowWidth  
69 - })  
70 - },  
71 -  
72 - /**  
73 - * 生命周期函数--监听页面初次渲染完成  
74 - */  
75 - onReady: function () {  
76 -  
77 - },  
78 -  
79 - /**  
80 - * 生命周期函数--监听页面显示  
81 - */  
82 - onShow: function () {  
83 - let that=this;  
84 - that.setData({  
85 - page: 0,  
86 - datalist: []  
87 - })  
88 - that.getdatalist();  
89 - },  
90 -  
91 - /**  
92 - * 生命周期函数--监听页面隐藏  
93 - */  
94 - onHide: function () {  
95 -  
96 - },  
97 -  
98 - /**  
99 - * 生命周期函数--监听页面卸载  
100 - */  
101 - onUnload: function () {  
102 -  
103 - },  
104 -  
105 - /**  
106 - * 页面相关事件处理函数--监听用户下拉动作  
107 - */  
108 - onPullDownRefresh: function () {  
109 -  
110 - },  
111 -  
112 - /**  
113 - * 页面上拉触底事件的处理函数  
114 - */  
115 - onReachBottom: function () {  
116 -  
117 - },  
118 -  
119 - /**  
120 - * 用户点击右上角分享  
121 - */  
122 - onShareAppMessage: function () {  
123 -  
124 - }  
125 }) 218 })
1 -<!--pages/admin/admin.wxml-->  
2 -<scroll-view scroll-y='true' bindscrolltolower='getdatalist' style='height:{{scroll_height}}rpx'>  
3 -<block wx:for='{{datalist}}' wx:key>  
4 -<view class='adminitem'>  
5 - <navigator class='admin_left' url='/pages/close_apply/close_apply?id={{item.user_id}}' hover-class="none">  
6 - <view class='admin_img'>  
7 - <image src='{{item.photo?item.photo:"https://volunteer.cnpu.org/imgs/wode_02@2x.png"}}'></image> 1 +
  2 +<block wx:for='{{datalist}}' wx:key="index">
  3 + <view class='adminitem'>
  4 + <navigator class='admin_left' url='/pages/close_apply/close_apply?id={{item.user_id}}' hover-class="none">
  5 + <view class='admin_img'>
  6 + <image src='{{item.photo?item.photo:"https://volunteer.cnpu.org/imgs/wode_02@2x.png"}}' mode="aspectFill"></image>
  7 + </view>
  8 + <view class='admin_txt'>
  9 + <view class='admin_txttitle'>{{item.nane}}</view>
  10 + <view>{{item.duty}}</view>
  11 + </view>
  12 + </navigator>
  13 + <view class='admin_rigth' wx:if="{{type == 1}}">
  14 + <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>
  15 + <view class='admin_buttom {{item.status !="3"?"admin_active":""}}' data-id='{{item.id}}' data-status='2' data-index='{{index}}' bindtap='pass'>通过</view>
  16 + </view>
  17 + <view class="add_time" wx:if="{{type == 2}}" bindtap='change_cover' data-index='{{index}}' data-id='{{item.user_id}}'>添加工时</view>
8 </view> 18 </view>
9 - <view class='admin_txt'>  
10 - <view class='admin_txttitle'>{{item.nane}}</view>  
11 - <view>{{item.duty}}</view>  
12 - </view>  
13 - </navigator>  
14 - <view class='admin_rigth'>  
15 - <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>  
16 - <view class='admin_buttom {{item.status !="3"?"admin_active":""}}' id='{{item.id}}' data-status='2' data-index='{{index}}' bindtap='update_status'>通过</view>  
17 - </view>  
18 -</view>  
19 -<view class='vold_line'></view> 19 + <view class='vold_line'></view>
20 </block> 20 </block>
21 -</scroll-view>  
  21 +
  22 +
  23 +<view class="cover_box" catchtouchmove="true" wx:if="{{cover_type}}">
  24 + <view class="show_box">
  25 + <view class="s_title">{{type>1?'请输入工时':'请输入未通过理由'}}</view>
  26 + <textarea placeholder="请输入..." class="word_area {{type>1?'active':''}}" value="{{word}}" bindinput="get_word" wx:if="{{type==1}}"/>
  27 + <input placeholder="请输入..." class="word_area active" value="{{word}}" bindinput="get_word" type="number" wx:if="{{type==2}}"/>
  28 + <view class="submit" catchtap="{{type>1?'add_time':'reject'}}">确认</view>
  29 + <image src="/imgs/close.png" class="close" catchtap="change_cover"/>
  30 + </view>
  31 +</view>
1 -/* pages/admin/admin.wxss */  
2 -.adminitem{  
3 - display: flex;  
4 - align-items: center;  
5 - justify-content: space-between;  
6 - padding:30rpx 32rpx;  
7 -}  
8 -.admin_left{  
9 - width:60%;  
10 - display: flex;  
11 - align-items: center;  
12 -}  
13 -.admin_img{  
14 - display: flex;  
15 - justify-content: center;  
16 - align-items: center;  
17 - margin: 0 16rpx 0 0;  
18 - width:76rpx;  
19 - height: 76rpx;  
20 - border-radius: 50%;  
21 - overflow: hidden;  
22 -}  
23 -.admin_img image{  
24 - display: block;  
25 - width:100%;  
26 - height: 100%;  
27 -}  
28 -.admin_txttitle{  
29 - color:#333333;  
30 - font-size:28rpx;  
31 -}  
32 -.admin_txt{  
33 - color:#999;  
34 - font-size:26rpx;  
35 -}  
36 -.admin_rigth{  
37 - display: flex;  
38 - align-items: center;  
39 - flex-direction:row-reverse;  
40 - width:40%;  
41 -}  
42 -.admin_buttom{  
43 - width:120rpx;  
44 - height: 60rpx;  
45 - border-radius: 30rpx;  
46 - margin: 0 0 0 32rpx;  
47 - color:#fff;  
48 - font-size: 26rpx;  
49 - background: #CCCCCC;  
50 - display: flex;  
51 - align-items: center;  
52 - justify-content: center;  
53 -}  
54 -.admin_active{  
55 - background: #2ED671;  
56 -}  
  1 +page {
  2 + height: 100%;
  3 +}
  4 +
  5 +.adminitem {
  6 + display: flex;
  7 + align-items: center;
  8 + justify-content: space-between;
  9 + padding: 30rpx 32rpx;
  10 +}
  11 +
  12 +.admin_left {
  13 + width: 60%;
  14 + display: flex;
  15 + align-items: center;
  16 +}
  17 +
  18 +.admin_img {
  19 + display: flex;
  20 + justify-content: center;
  21 + align-items: center;
  22 + margin: 0 16rpx 0 0;
  23 + width: 76rpx;
  24 + height: 76rpx;
  25 + border-radius: 50%;
  26 + overflow: hidden;
  27 +}
  28 +
  29 +.admin_img image {
  30 + display: block;
  31 + width: 100%;
  32 + height: 100%;
  33 +}
  34 +
  35 +.admin_txttitle {
  36 + color: #333;
  37 + font-size: 28rpx;
  38 +}
  39 +
  40 +.admin_txt {
  41 + color: #999;
  42 + font-size: 26rpx;
  43 +}
  44 +
  45 +.admin_rigth {
  46 + display: flex;
  47 + align-items: center;
  48 + flex-direction: row-reverse;
  49 + width: 40%;
  50 +}
  51 +
  52 +.admin_buttom {
  53 + width: 120rpx;
  54 + height: 60rpx;
  55 + border-radius: 30rpx;
  56 + margin: 0 0 0 32rpx;
  57 + color: #fff;
  58 + font-size: 26rpx;
  59 + background: #ccc;
  60 + display: flex;
  61 + align-items: center;
  62 + justify-content: center;
  63 +}
  64 +
  65 +.admin_active {
  66 + background: #2ed671;
  67 +}
  68 +
  69 +.add_time {
  70 + width: 142rpx;
  71 + height: 60rpx;
  72 + border: 1px solid rgba(46, 214, 113, 1);
  73 + border-radius: 30rpx;
  74 + display: flex;
  75 + justify-content: center;
  76 + align-items: center;
  77 + font-size: 26rpx;
  78 + font-family: PingFang SC;
  79 + font-weight: 500;
  80 + color: rgba(46, 214, 113, 1);
  81 +}
  82 +
  83 +.cover_box {
  84 + width: 100%;
  85 + height: 100%;
  86 + position: fixed;
  87 + left: 0;
  88 + top: 0;
  89 + display: flex;
  90 + justify-content: center;
  91 + align-items: center;
  92 + background: rgba(0, 0, 0, 0.3);
  93 +}
  94 +
  95 +.show_box {
  96 + width: 595rpx;
  97 + padding: 0 28rpx 54rpx;
  98 + box-sizing: border-box;
  99 + background: rgba(255, 255, 255, 1);
  100 + border-radius: 10rpx;
  101 + position: relative;
  102 +}
  103 +
  104 +.show_box .s_title {
  105 + font-size: 32rpx;
  106 + font-family: PingFang SC;
  107 + font-weight: bold;
  108 + color: rgba(51, 51, 51, 1);
  109 + margin: 74rpx auto 38rpx;
  110 + text-align: center;
  111 +}
  112 +
  113 +.show_box .word_area {
  114 + width: 539rpx;
  115 + height: 275rpx;
  116 + border: 1px solid rgba(229, 229, 229, 1);
  117 + border-radius: 10rpx;
  118 + font-size: 26rpx;
  119 + font-family: PingFang SC;
  120 + font-weight: 500;
  121 + color: rgba(204, 204, 204, 1);
  122 + padding: 30rpx 36rpx;
  123 + box-sizing: border-box;
  124 +}
  125 +.show_box .active{
  126 + height: 85rpx !important;
  127 +}
  128 +.show_box .submit {
  129 + width: 495rpx;
  130 + height: 88rpx;
  131 + background: rgba(65, 205, 121, 1);
  132 + border-radius: 10rpx;
  133 + margin: 56rpx auto 0;
  134 + font-size: 32rpx;
  135 + font-family: PingFang SC;
  136 + font-weight: 500;
  137 + color: rgba(255, 255, 255, 1);
  138 + display: flex;
  139 + justify-content: center;
  140 + align-items: center;
  141 +}
  142 +
  143 +.show_box .close {
  144 + width: 26rpx;
  145 + height: 26rpx;
  146 + color: #ccc;
  147 + font-size: 32rpx;
  148 + font-family: PingFang SC;
  149 + font-weight: 500;
  150 + position: absolute;
  151 + right: 29rpx;
  152 + top: 31rpx;
  153 +}
1 -  
2 -const app=getApp(); 1 +const app = getApp();
3 Page({ 2 Page({
4 3
5 - /**  
6 - * 页面的初始数据  
7 - */  
8 - data: {  
9 - //  
10 - ifempower:true,//是否授权  
11 - showapply:false,  
12 - provincearr:[],  
13 - cityarr:[],  
14 - countryarr:[],  
15 - confirmvalarr:[0,0,0],  
16 - valarr:[0,0,0],  
17 - photo: '',  
18 - name: '',  
19 - enddata:'',  
20 - arraysex: ['男', '女'],  
21 - sex: '',  
22 - birthday: '', //生日  
23 - nation: '', //民族  
24 - nationarr: ["汉族", "蒙古族", "回族", "藏族", "维吾尔族", "苗族", "彝族", "壮族", "布依族", "朝鲜族", "满族", "侗族", "瑶族", "白族", "土家族",  
25 - "哈尼族", "哈萨克族", "傣族", "黎族", "傈僳族", "佤族", "畲族", "高山族", "拉祜族", "水族", "东乡族", "纳西族", "景颇族", "柯尔克孜族",  
26 - "土族", "达斡尔族", "仫佬族", "羌族", "布朗族", "撒拉族", "毛南族", "仡佬族", "锡伯族", "阿昌族", "普米族", "塔吉克族", "怒族", "乌孜别克族",  
27 - "俄罗斯族", "鄂温克族", "德昂族", "保安族", "裕固族", "京族", "塔塔尔族", "独龙族", "鄂伦春族", "赫哲族", "门巴族", "珞巴族", "基诺族"  
28 - ],  
29 -  
30 - politics: '', //政治面貌  
31 - politicsarr: ['共青团员', '中共预备党员', '中共党员', '群众', '无党派人士', '其他'], //  
32 - education: '', //学历  
33 - educationarr: ['小学', '中学', '专科', '本科', '硕士研究生', '博士研究生', '其他'], //  
34 - unit: '', //工作单位  
35 - duty: '', //职务  
36 - addr: '', //通讯地址,  
37 - postcode: '', //邮编  
38 - school: '', //  
39 - card_number: '', //身份证号码  
40 - move_phone: '', //  
41 - email: '', //  
42 - urgency_phone: '', //  
43 - qq: '',  
44 - province: '',  
45 - city: '',  
46 - county: '',  
47 - address: '', //详细地址,  
48 - type: '', //1医院志愿者,2社会志愿者,3办事处志愿者  
49 - typearr: ['医院志愿者', '社会志愿者', '办事处志愿者'],  
50 - apply_nav: 0, //0为履历1,1为履历2,2为履历3,  
51 - record: [{  
52 - record_start_time: '',  
53 - record_end_time: '',  
54 - record_unit: '',  
55 - record_duty: '',  
56 - record_name: '',  
57 - record_phone: ''  
58 - },  
59 - {  
60 - record_start_time: '',  
61 - record_end_time: '',  
62 - record_unit: '',  
63 - record_duty: '',  
64 - record_name: '',  
65 - record_phone: ''  
66 - },  
67 - {  
68 - record_start_time: '',  
69 - record_end_time: '',  
70 - record_unit: '',  
71 - record_duty: '',  
72 - record_name: '',  
73 - record_phone: ''  
74 - }  
75 - ],  
76 - front_card: '', //身份证正面照  
77 - reverse_card: '', //身份证反面照  
78 - id:'',//用户id,  
79 - },  
80 - setname(e) {  
81 - this.setData({  
82 - name: e.detail.value  
83 - })  
84 - },  
85 - setunit(e) {  
86 - this.setData({  
87 - unit: e.detail.value  
88 - })  
89 - },  
90 - setduty(e) {  
91 - this.setData({  
92 - duty: e.detail.value  
93 - })  
94 - },  
95 - setaddr(e) {  
96 - this.setData({  
97 - addr: e.detail.value  
98 - })  
99 - },  
100 - setpostcode(e) {  
101 - this.setData({  
102 - postcode: e.detail.value  
103 - })  
104 - },  
105 - setschool(e) {  
106 - this.setData({  
107 - school: e.detail.value  
108 - })  
109 - },  
110 - setcard_number(e) {  
111 - this.setData({  
112 - card_number: e.detail.value  
113 - })  
114 - },  
115 - setemail(e) {  
116 - this.setData({  
117 - email: e.detail.value  
118 - })  
119 - },  
120 - seturgency_phone(e) {  
121 - this.setData({  
122 - urgency_phone: e.detail.value  
123 - })  
124 - },  
125 - setqq(e) {  
126 - this.setData({  
127 - qq: e.detail.value  
128 - })  
129 - },  
130 - bindsex(e) {  
131 - this.setData({  
132 - sex: parseInt(e.detail.value) + 1  
133 - })  
134 - },  
135 -  
136 - setmove_phone(e) {  
137 - this.setData({  
138 - move_phone: e.detail.value  
139 - })  
140 - },  
141 -  
142 - bindbirthdayChange(e) {  
143 - this.setData({  
144 - birthday: e.detail.value  
145 - })  
146 - },  
147 - bindnationChange(e) {  
148 - let nationarr = this.data.nationarr;  
149 - this.setData({  
150 - nation: nationarr[e.detail.value]  
151 - })  
152 - },  
153 - bindeducationChange(e) {  
154 - let educationarr = this.data.educationarr;  
155 - this.setData({  
156 - education: educationarr[e.detail.value]  
157 - })  
158 - },  
159 -  
160 - bindpoliticsChange(e) {  
161 - let politicsarr = this.data.politicsarr;  
162 - this.setData({  
163 - politics: politicsarr[e.detail.value]  
164 - })  
165 - },  
166 -// bindtypeChange(e) {  
167 -// let typearr = this.data.typearr;  
168 -// this.setData({  
169 -// type: parseInt(e.detail.value) +1  
170 -// })  
171 -// },  
172 - start(e) {  
173 - let that = this;  
174 - let tem = e.currentTarget.dataset.tem;  
175 - app.globalData.userInfo = e.detail.userInfo;  
176 - wx.login({  
177 - success: function (s) {  
178 - let url = 'wxapp/public/getSessionKey';  
179 - if (s.code) {  
180 - var code = s.code;  
181 - var param = {  
182 - code: code  
183 - }  
184 - app.post(url, param).then((res) => {  
185 - that.login(res.openid, res.session_key, e.detail.encryptedData, e.detail.iv,tem);  
186 - }).catch((errMsg) => {  
187 -  
188 - })  
189 - }  
190 - }  
191 - });  
192 - },  
193 - login(openid, session_key, encrypted_data, iv,tem) {  
194 - let that = this;  
195 - let param = {  
196 - openid: openid,  
197 - session_key: session_key,  
198 - encrypted_data: encrypted_data,  
199 - iv: iv  
200 - }  
201 - let url = 'wxapp/public/login';  
202 - app.post(url, param).then((res) => {  
203 - wx.setStorageSync('token', res.token);  
204 - that.setData({  
205 - ifempower:true  
206 - })  
207 - that.uploadImage(tem);  
208 - }).catch((errMsg) => {  
209 -  
210 - })  
211 - },  
212 -  
213 - //选择省市区  
214 - getarea(){  
215 - let that=this;  
216 - let url ='index/area/index';  
217 - app.post(url,{}).then((res)=>{  
218 - let country = res.country;  
219 - let tem = {  
220 - id: 0,  
221 - city_id: res.country[0].city_id,  
222 - country_id: 0,  
223 - country_name: ''  
224 - }  
225 - country.push(tem);  
226 - let temcountry = country.reverse();  
227 - let cityarr = res.city;  
228 - let countryarr = res.country;  
229 - let provincearr = res.province;  
230 - that.setData({  
231 - cityarr: cityarr,  
232 - countryarr: temcountry,  
233 - provincearr: provincearr  
234 - })  
235 - if (that.data.is_submit==undefined){  
236 - that.setData({  
237 - ifempower:false 4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 + //
  9 + ifempower: true, //是否授权
  10 + showapply: false,
  11 + provincearr: [],
  12 + cityarr: [],
  13 + countryarr: [],
  14 + confirmvalarr: [0, 0, 0],
  15 + valarr: [0, 0, 0],
  16 + photo: '',
  17 + name: '',
  18 + enddata: '',
  19 + arraysex: ['男', '女'],
  20 + sex: '',
  21 + birthday: '', //生日
  22 + nation: '', //民族
  23 + nationarr: ["汉族", "蒙古族", "回族", "藏族", "维吾尔族", "苗族", "彝族", "壮族", "布依族", "朝鲜族", "满族", "侗族", "瑶族", "白族", "土家族",
  24 + "哈尼族", "哈萨克族", "傣族", "黎族", "傈僳族", "佤族", "畲族", "高山族", "拉祜族", "水族", "东乡族", "纳西族", "景颇族", "柯尔克孜族",
  25 + "土族", "达斡尔族", "仫佬族", "羌族", "布朗族", "撒拉族", "毛南族", "仡佬族", "锡伯族", "阿昌族", "普米族", "塔吉克族", "怒族", "乌孜别克族",
  26 + "俄罗斯族", "鄂温克族", "德昂族", "保安族", "裕固族", "京族", "塔塔尔族", "独龙族", "鄂伦春族", "赫哲族", "门巴族", "珞巴族", "基诺族"
  27 + ],
  28 +
  29 + politics: '', //政治面貌
  30 + politicsarr: ['共青团员', '中共预备党员', '中共党员', '群众', '无党派人士', '其他'], //
  31 + education: '', //学历
  32 + educationarr: ['小学', '中学', '专科', '本科', '硕士研究生', '博士研究生', '其他'], //
  33 + unit: '', //工作单位
  34 + duty: '', //职务
  35 + addr: '', //通讯地址,
  36 + postcode: '', //邮编
  37 + school: '', //
  38 + card_number: '', //身份证号码
  39 + move_phone: '', //
  40 + email: '', //
  41 + urgency_phone: '', //
  42 + qq: '',
  43 + province: '',
  44 + city: '',
  45 + county: '',
  46 + address: '', //详细地址,
  47 + type: '', //1医院志愿者,2社会志愿者,3办事处志愿者
  48 + typearr: ['医院志愿者', '社会志愿者', '办事处志愿者'],
  49 + apply_nav: 0, //0为履历1,1为履历2,2为履历3,
  50 + record: [{
  51 + record_start_time: '',
  52 + record_end_time: '',
  53 + record_unit: '',
  54 + record_duty: '',
  55 + record_name: '',
  56 + record_phone: ''
  57 + },
  58 + {
  59 + record_start_time: '',
  60 + record_end_time: '',
  61 + record_unit: '',
  62 + record_duty: '',
  63 + record_name: '',
  64 + record_phone: ''
  65 + },
  66 + {
  67 + record_start_time: '',
  68 + record_end_time: '',
  69 + record_unit: '',
  70 + record_duty: '',
  71 + record_name: '',
  72 + record_phone: ''
  73 + }
  74 + ],
  75 + front_card: '', //身份证正面照
  76 + reverse_card: '', //身份证反面照
  77 + id: '', //用户id,
  78 + },
  79 + setname(e) {
  80 + this.setData({
  81 + name: e.detail.value
  82 + })
  83 + },
  84 + setunit(e) {
  85 + this.setData({
  86 + unit: e.detail.value
  87 + })
  88 + },
  89 + setduty(e) {
  90 + this.setData({
  91 + duty: e.detail.value
  92 + })
  93 + },
  94 + setaddr(e) {
  95 + this.setData({
  96 + addr: e.detail.value
  97 + })
  98 + },
  99 + setpostcode(e) {
  100 + this.setData({
  101 + postcode: e.detail.value
  102 + })
  103 + },
  104 + setschool(e) {
  105 + this.setData({
  106 + school: e.detail.value
  107 + })
  108 + },
  109 + setcard_number(e) {
  110 + this.setData({
  111 + card_number: e.detail.value
  112 + })
  113 + },
  114 + setemail(e) {
  115 + this.setData({
  116 + email: e.detail.value
  117 + })
  118 + },
  119 + seturgency_phone(e) {
  120 + this.setData({
  121 + urgency_phone: e.detail.value
  122 + })
  123 + },
  124 + setqq(e) {
  125 + this.setData({
  126 + qq: e.detail.value
238 }) 127 })
  128 + },
  129 + bindsex(e) {
  130 + this.setData({
  131 + sex: parseInt(e.detail.value) + 1
  132 + })
  133 + },
239 134
240 - }else if (that.data.is_submit=='1'){  
241 - that.getdatalist();  
242 - } 135 + setmove_phone(e) {
  136 + this.setData({
  137 + move_phone: e.detail.value
  138 + })
  139 + },
243 140
244 - }).catch((err)=>{ 141 + bindbirthdayChange(e) {
  142 + this.setData({
  143 + birthday: e.detail.value
  144 + })
  145 + },
  146 + bindnationChange(e) {
  147 + let nationarr = this.data.nationarr;
  148 + this.setData({
  149 + nation: nationarr[e.detail.value]
  150 + })
  151 + },
  152 + bindeducationChange(e) {
  153 + let educationarr = this.data.educationarr;
  154 + this.setData({
  155 + education: educationarr[e.detail.value]
  156 + })
  157 + },
245 158
246 - })  
247 - },  
248 - //切换省份获取市和区/县  
249 - get_city(province_id=0){  
250 - let that=this;  
251 - let url ='index/area/get_city';  
252 - let params={  
253 - 'province_id': province_id  
254 - }  
255 - app.post(url, params).then((res)=>{  
256 - let country = res.country;  
257 - let tem = {  
258 - id: 0,  
259 - city_id: res.country[0].city_id,  
260 - country_id: 0,  
261 - country_name: ' '  
262 - }  
263 - country.push(tem);  
264 - let temcountry = country.reverse();  
265 - that.setData({  
266 - cityarr: res.city,  
267 - countryarr: temcountry  
268 - })  
269 - }).catch((err)=>{  
270 -  
271 - })  
272 - },  
273 - //切换市获取区/县  
274 - get_country(city_id=0){  
275 - let that=this;  
276 - let url ='index/area/get_country';  
277 - let params={  
278 - 'city_id': city_id  
279 - }  
280 - app.post(url, params).then((res) => {  
281 - let country = res.country;  
282 - let tem={  
283 - id:0,  
284 - city_id: res.country[0].city_id,  
285 - country_id:0,  
286 - country_name:' '  
287 - }  
288 - country.push(tem);  
289 - let temcountry = country.reverse();  
290 - that.setData({  
291 - countryarr: temcountry  
292 - })  
293 - }).catch((err) => {  
294 -  
295 - })  
296 - },  
297 - bindChange: function (e) {  
298 - let that=this;  
299 - let valarr = that.data.valarr;  
300 - let provincearr = that.data.provincearr;  
301 - let cityarr = that.data.cityarr;  
302 - const val = e.detail.value;  
303 - if (valarr[0] != val[0] ){//改变省  
304 - let i = val[0];  
305 - that.get_city(provincearr[i].province_id);  
306 - valarr[0] = val[0];  
307 - valarr[1] = 0;  
308 - valarr[2] = 0;  
309 - that.setData({  
310 - valarr: valarr  
311 - })  
312 - } else if (valarr[1] != val[1]){//改变市  
313 - let j = val[1];  
314 - that.get_country(cityarr[j].city_id);  
315 - valarr[1] = val[1];  
316 - valarr[2] = 0;  
317 - that.setData({  
318 - valarr: valarr  
319 - })  
320 - }else {//改变区  
321 - valarr[2] = val[2];  
322 - that.setData({  
323 - valarr: valarr  
324 - })  
325 - }  
326 - },  
327 - //取消地区选择  
328 - setno(){  
329 - let that=this;  
330 - that.setData({  
331 - valarr: that.data.confirmvalarr,  
332 - showapply: false  
333 - })  
334 - },  
335 - //确定选择区域  
336 - setyes(){  
337 - let that=this;  
338 - let valarr = that.data.valarr;  
339 - let i = valarr[0];  
340 - let j = valarr[1];  
341 - let k = valarr[2];  
342 - let provincearr = that.data.provincearr;  
343 - let cityarr = that.data.cityarr;  
344 - let countryarr = that.data.countryarr;  
345 - that.setData({  
346 - confirmvalarr: valarr,  
347 - province: provincearr[i].province_name,  
348 - city: cityarr[j].city_name,  
349 - county: countryarr[k].country_name,  
350 - address: provincearr[i].province_name + cityarr[j].city_name + countryarr[k].country_name,  
351 - showapply:false  
352 - })  
353 - },  
354 -  
355 - setshowapply(){  
356 - let that=this;  
357 - that.setData({  
358 - showapply:true  
359 - })  
360 - },  
361 - setshowapply_no() {  
362 - let that = this;  
363 - that.setData({  
364 - showapply: false  
365 - })  
366 - },  
367 - void_fun(){  
368 - },  
369 - bindRegionChange(e){  
370 - let that=this;  
371 - this.setData({  
372 - region: e.detail.value,  
373 - province: e.detail.value[0],  
374 - city: e.detail.value[1],  
375 - county: e.detail.value[2],  
376 - address: e.detail.value[0] + e.detail.value[1] + e.detail.value[2]  
377 - })  
378 - },  
379 - bindstartChange(e) {  
380 - let that = this;  
381 - let apply_nav = parseInt(that.data.apply_nav);  
382 - let record = that.data.record;  
383 - record[apply_nav].record_start_time = e.detail.value;  
384 - that.setData({  
385 - record: record  
386 - })  
387 - },  
388 - bindendChange(e) {  
389 - let that = this;  
390 - let apply_nav = that.data.apply_nav;  
391 - let record = that.data.record;  
392 - record[apply_nav].record_end_time = e.detail.value;  
393 - that.setData({  
394 - record: record  
395 - })  
396 - },  
397 - setrecordunit(e) {  
398 - let that = this;  
399 - let apply_nav = that.data.apply_nav;  
400 - let record = that.data.record;  
401 - record[apply_nav].record_unit = e.detail.value;  
402 - that.setData({  
403 - record: record  
404 - })  
405 - },  
406 - setrecordname(e) {  
407 - let that = this;  
408 - let apply_nav = that.data.apply_nav;  
409 - let record = that.data.record;  
410 - record[apply_nav].record_name = e.detail.value;  
411 - that.setData({  
412 - record: record  
413 - })  
414 - },  
415 - setrecordduty(e) {  
416 - let that = this;  
417 - let apply_nav = that.data.apply_nav;  
418 - let record = that.data.record;  
419 - record[apply_nav].record_duty = e.detail.value;  
420 - that.setData({  
421 - record: record  
422 - })  
423 - },  
424 - setrecordphone(e) {  
425 - let that = this;  
426 - let apply_nav = that.data.apply_nav;  
427 - let record = that.data.record;  
428 - record[apply_nav].record_phone = e.detail.value;  
429 - that.setData({  
430 - record: record  
431 - })  
432 - },  
433 - uploadImages(e){  
434 - let that=this;  
435 - let tem = e.currentTarget.dataset.tem;  
436 - that.uploadImage(tem);  
437 -  
438 - },  
439 - //上传头像1为头像,2为省份证正面,3为省份证反面  
440 - uploadImage(tem) {  
441 - let that = this;  
442 - wx.chooseImage({  
443 - count: 1,  
444 - sizeType: ['original', 'compressed'],  
445 - success: function(res) {  
446 - let tempFilePaths = res.tempFilePaths //总文件  
447 - let head = {  
448 - 'XX-Token': wx.getStorageSync('token'),  
449 - 'XX-Device-Type': '' 159 + bindpoliticsChange(e) {
  160 + let politicsarr = this.data.politicsarr;
  161 + this.setData({
  162 + politics: politicsarr[e.detail.value]
  163 + })
  164 + },
  165 + // bindtypeChange(e) {
  166 + // let typearr = this.data.typearr;
  167 + // this.setData({
  168 + // type: parseInt(e.detail.value) +1
  169 + // })
  170 + // },
  171 + start(e) {
  172 + let that = this;
  173 + let tem = e.currentTarget.dataset.tem;
  174 + app.globalData.userInfo = e.detail.userInfo;
  175 + wx.login({
  176 + success: function(s) {
  177 + let url = 'wxapp/public/getSessionKey';
  178 + if (s.code) {
  179 + var code = s.code;
  180 + var param = {
  181 + code: code
  182 + }
  183 + app.post(url, param).then((res) => {
  184 + that.login(res.openid, res.session_key, e.detail.encryptedData, e.detail.iv, tem);
  185 + }).catch((errMsg) => {
  186 +
  187 + })
  188 + }
  189 + }
  190 + });
  191 + },
  192 + login(openid, session_key, encrypted_data, iv, tem) {
  193 + let that = this;
  194 + let param = {
  195 + openid: openid,
  196 + session_key: session_key,
  197 + encrypted_data: encrypted_data,
  198 + iv: iv
450 } 199 }
451 - let url = 'https://volunteer.cnpu.org/api/user/upload/one';  
452 - wx.uploadFile({  
453 - url: url, //仅为示例,非真实的接口地址  
454 - filePath: tempFilePaths[0],  
455 - name: 'file',  
456 - header: head,  
457 - formData: {},  
458 - success: function(res) {  
459 - let temdata = JSON.parse(res.data);  
460 - if (temdata.code == 20000) {  
461 - if (tem == '1') {  
462 - that.setData({  
463 - photo: temdata.data.url  
464 - })  
465 - } else if (tem == '2') {  
466 - that.setData({  
467 - front_card: temdata.data.url  
468 - })  
469 - } else if (tem == '3') { 200 + let url = 'wxapp/public/login';
  201 + app.post(url, param).then((res) => {
  202 + wx.setStorageSync('token', res.token);
  203 + that.setData({
  204 + ifempower: true
  205 + })
  206 + that.uploadImage(tem);
  207 + }).catch((errMsg) => {
  208 +
  209 + })
  210 + },
  211 +
  212 + //选择省市区
  213 + getarea() {
  214 + let that = this;
  215 + let url = 'index/area/index';
  216 + app.post(url, {}).then((res) => {
  217 + let country = res.country;
  218 + let tem = {
  219 + id: 0,
  220 + city_id: res.country[0].city_id,
  221 + country_id: 0,
  222 + country_name: ''
  223 + }
  224 + country.push(tem);
  225 + let temcountry = country.reverse();
  226 + let cityarr = res.city;
  227 + let countryarr = res.country;
  228 + let provincearr = res.province;
  229 + that.setData({
  230 + cityarr: cityarr,
  231 + countryarr: temcountry,
  232 + provincearr: provincearr
  233 + })
  234 + if (that.data.is_submit == undefined) {
470 that.setData({ 235 that.setData({
471 - reverse_card: temdata.data.url 236 + ifempower: false
472 }) 237 })
473 - } 238 +
  239 + } else if (that.data.is_submit == '1') {
  240 + that.getdatalist();
474 } 241 }
475 - },  
476 - fail: function(res) {},  
477 - complete: () => {}  
478 - })  
479 - },  
480 - fail: function(res) {}  
481 - })  
482 - },  
483 - setapply_nav(e) {  
484 - let that = this;  
485 - that.setData({  
486 - apply_nav: e.currentTarget.dataset.apply_nav  
487 - })  
488 - },  
489 - submit() {  
490 - let that = this;  
491 - let err='';  
492 - //匹配中国邮政编码  
493 - // var AuglyTest_PostalCode = /^[0-9]\\d{5}$/;  
494 - //匹配身份证  
495 - var AuglyTest_ID = /\d{15}|\d{18}/;  
496 - //验证手机号  
497 - var AuglyTest_phone =/^1(3|4|5|6|7|8)\d{9}$/;  
498 - //验证腾讯QQ号  
499 - var AuglyTest_QQ = /^[1-9]*[1-9][0-9]*$/;  
500 - //匹配国内电话号码  
501 - var AuglyTest_tel = /(\d{3}-|\d{4}-)?(\d{8}|\d{7})?/;  
502 - //email地址  
503 - var AuglyTest_email = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;  
504 - if (that.data.photo==''){  
505 - err = '请上传您的头像!'  
506 - } else if (that.data.name==''){  
507 - err='请输入您的姓名!'  
508 - } else if (that.data.sex==''){  
509 - err = '请选择您的姓别!';  
510 - } else if (that.data.birthday==''){  
511 - err = '请选择您的出生日期!';  
512 - } else if (that.data.nation==''){  
513 - err = '请选择您的民族!';  
514 - } else if (that.data.education==''){  
515 - err = '请选择您的学历!';  
516 - } else if (that.data.politics==''){  
517 - err = '请选择您的政治面貌!';  
518 - } else if (that.data.unit==''){  
519 - err='请填写您的工作单位!';  
520 - } else if (that.data.duty==''){  
521 - err = '请填写您的职务!';  
522 - } else if (that.data.addr==''){  
523 - err ='请填写您的通讯地址!';  
524 - } else if (that.data.postcode==''){  
525 - err = '请填写您的邮编!';  
526 - } else if (that.data.school==''){  
527 - err ='请输入就读/毕业院校!';  
528 - } else if (that.data.card_number==''){  
529 - err = '请输入您的身份证号!';  
530 - } else if (!AuglyTest_ID.test(that.data.card_number)){  
531 - err = '请输入正确的身份证号!';  
532 - }else if (that.data.move_phone==''){  
533 - err = '请输入您的移动电话!';  
534 - } else if (!AuglyTest_phone.test(that.data.move_phone)){  
535 - err = '请输入正确的移动电话!';  
536 - }else if (that.data.email==''){  
537 - err = '请输入您的电子邮箱!';  
538 - } else if (!AuglyTest_email.test(that.data.email)){  
539 - err = '请输入正确的电子邮箱!';  
540 - }else if (that.data.urgency_phone==''){  
541 - err = '请输入紧急联系人及电话!';  
542 - } else if (that.data.qq==''){  
543 - err = '请输入您的QQ!';  
544 - } else if (!AuglyTest_QQ.test(that.data.qq)){  
545 - err = '请输入正确的QQ号!';  
546 - }  
547 - else if (that.data.address==''){  
548 - err = '请选择您的服务区域';  
549 - } else if(that.data.type==''){  
550 - err = '请选择您的志愿类别!';  
551 - } else if (that.data.front_card==''){  
552 - err = '请上传身份证正面!';  
553 - } else if (that.data.reverse_card==''){  
554 - err = '请上传身份证反面!';  
555 - }  
556 - if(err==''){  
557 - let record = that.data.record;  
558 - let record_start_time = [];  
559 - let record_end_time = [];  
560 - let record_unit = [];  
561 - let record_duty = [];  
562 - let record_name = [];  
563 - let record_phone = [];  
564 - for (let obj of record) {  
565 - record_start_time.push(obj.record_start_time);  
566 - record_end_time.push(obj.record_end_time);  
567 - record_unit.push(obj.record_unit);  
568 - record_duty.push(obj.record_duty);  
569 - record_name.push(obj.record_name);  
570 - record_phone.push(obj.record_phone);  
571 - }  
572 - let url = 'index/member_center/submit_form';  
573 - let head = {  
574 - 'XX-Token': wx.getStorageSync('token')  
575 - }  
576 - let params = {  
577 - name: that.data.name,  
578 - sex: that.data.sex,  
579 - birthday: that.data.birthday,  
580 - nation: that.data.nation,  
581 - politics: that.data.politics,  
582 - education: that.data.education,  
583 - unit: that.data.unit,  
584 - duty: that.data.duty,  
585 - addr: that.data.addr,  
586 - school: that.data.school,  
587 - card_number: that.data.card_number,  
588 -  
589 - move_phone: that.data.move_phone,  
590 - postcode: that.data.postcode,  
591 - email: that.data.email,  
592 - urgency_phone: that.data.urgency_phone,  
593 - qq: that.data.qq,  
594 - province: that.data.province,  
595 - city: that.data.city,  
596 - county: that.data.county,  
597 - address: that.data.address,  
598 - // type: that.data.type,  
599 - record_start_time: record_start_time,  
600 - record_end_time: record_end_time,  
601 - record_unit: record_unit,  
602 - record_duty: record_duty,  
603 - record_name: record_name,  
604 - record_phone: record_phone,  
605 - front_card: that.data.front_card,  
606 - reverse_card: that.data.reverse_card,  
607 - photo: that.data.photo  
608 - }  
609 - app.post(url, params, head).then((res) => {  
610 - wx.showToast({  
611 - title: '提交成功,等待审核',  
612 - icon: 'none',  
613 - duration: 2000  
614 - })  
615 -  
616 - setTimeout(function(){  
617 - wx.switchTab({  
618 - url: '/pages/my/my'  
619 - })  
620 - },1000)  
621 - }).catch((err) => {  
622 - })  
623 - }else{  
624 - wx.showToast({  
625 - title: err,  
626 - icon: 'none',  
627 - duration: 2000  
628 - })  
629 - }  
630 - },  
631 - getdatalist(){  
632 - let that=this;  
633 - let url ='/index/member_center/edit';  
634 - let params={  
635 - 'id':that.data.id  
636 - };  
637 - let head={  
638 - 'XX-Token':wx.getStorageSync('token')  
639 - }  
640 - app.post(url, params, head).then((res)=>{  
641 - let provincearr = that.data.provincearr;  
642 - let cityarr = that.data.cityarr;  
643 - let countryarr = that.data.countryarr;  
644 - let val=[0,0,0];  
645 - for (let i=0; i<provincearr.length;i++ ){  
646 - if (provincearr[i].province_name == res.province){  
647 - val[0]=i; 242 +
  243 + }).catch((err) => {
  244 +
  245 + })
  246 + },
  247 + //切换省份获取市和区/县
  248 + get_city(province_id = 0) {
  249 + let that = this;
  250 + let url = 'index/area/get_city';
  251 + let params = {
  252 + 'province_id': province_id
648 } 253 }
649 - }  
650 - for (let i = 0; i < cityarr.length; i++) {  
651 - if (cityarr[i].city_name == res.city) {  
652 - val[1] = i; 254 + app.post(url, params).then((res) => {
  255 + let country = res.country;
  256 + let tem = {
  257 + id: 0,
  258 + city_id: res.country[0].city_id,
  259 + country_id: 0,
  260 + country_name: ' '
  261 + }
  262 + country.push(tem);
  263 + let temcountry = country.reverse();
  264 + that.setData({
  265 + cityarr: res.city,
  266 + countryarr: temcountry
  267 + })
  268 + }).catch((err) => {
  269 +
  270 + })
  271 + },
  272 + //切换市获取区/县
  273 + get_country(city_id = 0) {
  274 + let that = this;
  275 + let url = 'index/area/get_country';
  276 + let params = {
  277 + 'city_id': city_id
653 } 278 }
654 - }  
655 - for (let i = 0; i < countryarr.length; i++) {  
656 - if (countryarr[i].country_name == res.county) {  
657 - val[2] = i; 279 + app.post(url, params).then((res) => {
  280 + let country = res.country;
  281 + let tem = {
  282 + id: 0,
  283 + city_id: res.country[0].city_id,
  284 + country_id: 0,
  285 + country_name: ' '
  286 + }
  287 + country.push(tem);
  288 + let temcountry = country.reverse();
  289 + that.setData({
  290 + countryarr: temcountry
  291 + })
  292 + }).catch((err) => {
  293 +
  294 + })
  295 + },
  296 + bindChange: function(e) {
  297 + let that = this;
  298 + let valarr = that.data.valarr;
  299 + let provincearr = that.data.provincearr;
  300 + let cityarr = that.data.cityarr;
  301 + const val = e.detail.value;
  302 + if (valarr[0] != val[0]) { //改变省
  303 + let i = val[0];
  304 + that.get_city(provincearr[i].province_id);
  305 + valarr[0] = val[0];
  306 + valarr[1] = 0;
  307 + valarr[2] = 0;
  308 + that.setData({
  309 + valarr: valarr
  310 + })
  311 + } else if (valarr[1] != val[1]) { //改变市
  312 + let j = val[1];
  313 + that.get_country(cityarr[j].city_id);
  314 + valarr[1] = val[1];
  315 + valarr[2] = 0;
  316 + that.setData({
  317 + valarr: valarr
  318 + })
  319 + } else { //改变区
  320 + valarr[2] = val[2];
  321 + that.setData({
  322 + valarr: valarr
  323 + })
658 } 324 }
659 - }  
660 - that.setData({  
661 - valarr: val,  
662 - confirmvalarr: val,  
663 - addr: res.addr,  
664 - address: res.address,  
665 - birthday: res.birthday,  
666 - card_number: res.card_number,  
667 - city: res.city,  
668 - county: res.county,  
669 - duty: res.duty,  
670 - education: res.education,  
671 - email: res.email,  
672 - front_card: res.front_card,  
673 - move_phone: res.move_phone,  
674 - name: res.name,  
675 - nation: res.nation,  
676 - photo: res.photo,  
677 - politics: res.politics,  
678 - postcode:res.postcode,  
679 - province: res.province,  
680 - qq: res.qq,  
681 - record: res.record,  
682 - reverse_card: res.reverse_card,  
683 - school: res.school,  
684 - sex: res.sex,  
685 - unit: res.unit,  
686 - urgency_phone: res.urgency_phone,  
687 - type: res.type  
688 - })  
689 - }).catch((err)=>{  
690 -  
691 - })  
692 - },  
693 - /**  
694 - * 生命周期函数--监听页面加载  
695 - */  
696 - onLoad: function(options) {  
697 - let that=this;  
698 - that.setData({  
699 - is_submit: options.is_submit,  
700 - id: options.id  
701 - })  
702 - let now = new Date();  
703 - let time = now.getFullYear() + "-" + ((now.getMonth() + 1) < 10 ? "0" : "") + (now.getMonth() + 1) + "-" + (now.getDate() < 10 ? "0" : "") + now.getDate();  
704 - this.setData({  
705 - enddata: time  
706 - })  
707 - that.getarea();  
708 - },  
709 -  
710 - /**  
711 - * 生命周期函数--监听页面初次渲染完成  
712 - */  
713 - onReady: function() {  
714 -  
715 - },  
716 -  
717 - /**  
718 - * 生命周期函数--监听页面显示  
719 - */  
720 - onShow: function() {  
721 -  
722 -  
723 - },  
724 -  
725 - /**  
726 - * 生命周期函数--监听页面隐藏  
727 - */  
728 - onHide: function() {  
729 -  
730 -  
731 -  
732 - },  
733 -  
734 - /**  
735 - * 生命周期函数--监听页面卸载  
736 - */  
737 - onUnload: function() {  
738 -  
739 - },  
740 -  
741 - /**  
742 - * 页面相关事件处理函数--监听用户下拉动作  
743 - */  
744 - onPullDownRefresh: function() {  
745 -  
746 - },  
747 -  
748 - /**  
749 - * 页面上拉触底事件的处理函数  
750 - */  
751 - onReachBottom: function() {  
752 -  
753 - },  
754 -  
755 - /**  
756 - * 用户点击右上角分享  
757 - */  
758 - onShareAppMessage: function() {  
759 -  
760 - } 325 + },
  326 + //取消地区选择
  327 + setno() {
  328 + let that = this;
  329 + that.setData({
  330 + valarr: that.data.confirmvalarr,
  331 + showapply: false
  332 + })
  333 + },
  334 + //确定选择区域
  335 + setyes() {
  336 + let that = this;
  337 + let valarr = that.data.valarr;
  338 + let i = valarr[0];
  339 + let j = valarr[1];
  340 + let k = valarr[2];
  341 + let provincearr = that.data.provincearr;
  342 + let cityarr = that.data.cityarr;
  343 + let countryarr = that.data.countryarr;
  344 + that.setData({
  345 + confirmvalarr: valarr,
  346 + province: provincearr[i].province_name,
  347 + city: cityarr[j].city_name,
  348 + county: countryarr[k].country_name,
  349 + address: provincearr[i].province_name + cityarr[j].city_name + countryarr[k].country_name,
  350 + showapply: false
  351 + })
  352 + },
  353 +
  354 + setshowapply() {
  355 + let that = this;
  356 + that.setData({
  357 + showapply: true
  358 + })
  359 + },
  360 + setshowapply_no() {
  361 + let that = this;
  362 + that.setData({
  363 + showapply: false
  364 + })
  365 + },
  366 + void_fun() {},
  367 + bindRegionChange(e) {
  368 + let that = this;
  369 + this.setData({
  370 + region: e.detail.value,
  371 + province: e.detail.value[0],
  372 + city: e.detail.value[1],
  373 + county: e.detail.value[2],
  374 + address: e.detail.value[0] + e.detail.value[1] + e.detail.value[2]
  375 + })
  376 + },
  377 + bindstartChange(e) {
  378 + let that = this;
  379 + let apply_nav = parseInt(that.data.apply_nav);
  380 + let record = that.data.record;
  381 + record[apply_nav].record_start_time = e.detail.value;
  382 + that.setData({
  383 + record: record
  384 + })
  385 + },
  386 + bindendChange(e) {
  387 + let that = this;
  388 + let apply_nav = that.data.apply_nav;
  389 + let record = that.data.record;
  390 + record[apply_nav].record_end_time = e.detail.value;
  391 + that.setData({
  392 + record: record
  393 + })
  394 + },
  395 + setrecordunit(e) {
  396 + let that = this;
  397 + let apply_nav = that.data.apply_nav;
  398 + let record = that.data.record;
  399 + record[apply_nav].record_unit = e.detail.value;
  400 + that.setData({
  401 + record: record
  402 + })
  403 + },
  404 + setrecordname(e) {
  405 + let that = this;
  406 + let apply_nav = that.data.apply_nav;
  407 + let record = that.data.record;
  408 + record[apply_nav].record_name = e.detail.value;
  409 + that.setData({
  410 + record: record
  411 + })
  412 + },
  413 + setrecordduty(e) {
  414 + let that = this;
  415 + let apply_nav = that.data.apply_nav;
  416 + let record = that.data.record;
  417 + record[apply_nav].record_duty = e.detail.value;
  418 + that.setData({
  419 + record: record
  420 + })
  421 + },
  422 + setrecordphone(e) {
  423 + let that = this;
  424 + let apply_nav = that.data.apply_nav;
  425 + let record = that.data.record;
  426 + record[apply_nav].record_phone = e.detail.value;
  427 + that.setData({
  428 + record: record
  429 + })
  430 + },
  431 + uploadImages(e) {
  432 + let that = this;
  433 + let tem = e.currentTarget.dataset.tem;
  434 + that.uploadImage(tem);
  435 +
  436 + },
  437 + //上传头像1为头像,2为省份证正面,3为省份证反面
  438 + uploadImage(tem) {
  439 + let that = this;
  440 + wx.chooseImage({
  441 + count: 1,
  442 + sizeType: ['original', 'compressed'],
  443 + success: function(res) {
  444 + let tempFilePaths = res.tempFilePaths //总文件
  445 + let head = {
  446 + 'XX-Token': wx.getStorageSync('token'),
  447 + 'XX-Device-Type': ''
  448 + }
  449 + let url = 'https://volunteer.cnpu.org/api/user/upload/one';
  450 + wx.uploadFile({
  451 + url: url, //仅为示例,非真实的接口地址
  452 + filePath: tempFilePaths[0],
  453 + name: 'file',
  454 + header: head,
  455 + formData: {},
  456 + success: function(res) {
  457 + let temdata = JSON.parse(res.data);
  458 + if (temdata.code == 20000) {
  459 + if (tem == '1') {
  460 + that.setData({
  461 + photo: temdata.data.url
  462 + })
  463 + } else if (tem == '2') {
  464 + that.setData({
  465 + front_card: temdata.data.url
  466 + })
  467 + } else if (tem == '3') {
  468 + that.setData({
  469 + reverse_card: temdata.data.url
  470 + })
  471 + }
  472 + }
  473 + },
  474 + fail: function(res) {},
  475 + complete: () => {}
  476 + })
  477 + },
  478 + fail: function(res) {}
  479 + })
  480 + },
  481 + setapply_nav(e) {
  482 + let that = this;
  483 + that.setData({
  484 + apply_nav: e.currentTarget.dataset.apply_nav
  485 + })
  486 + },
  487 + submit() {
  488 + let that = this;
  489 + let err = '';
  490 + //匹配中国邮政编码
  491 + // var AuglyTest_PostalCode = /^[0-9]\\d{5}$/;
  492 + //匹配身份证
  493 + var AuglyTest_ID = /\d{15}|\d{18}/;
  494 + //验证手机号
  495 + var AuglyTest_phone = /^1(3|4|5|6|7|8)\d{9}$/;
  496 + //验证腾讯QQ号
  497 + var AuglyTest_QQ = /^[1-9]*[1-9][0-9]*$/;
  498 + //匹配国内电话号码
  499 + var AuglyTest_tel = /(\d{3}-|\d{4}-)?(\d{8}|\d{7})?/;
  500 + //email地址
  501 + var AuglyTest_email = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  502 + if (that.data.photo == '') {
  503 + err = '请上传您的头像!'
  504 + } else if (that.data.name == '') {
  505 + err = '请输入您的姓名!'
  506 + } else if (that.data.sex == '') {
  507 + err = '请选择您的姓别!';
  508 + } else if (that.data.birthday == '') {
  509 + err = '请选择您的出生日期!';
  510 + } else if (that.data.nation == '') {
  511 + err = '请选择您的民族!';
  512 + } else if (that.data.education == '') {
  513 + err = '请选择您的学历!';
  514 + } else if (that.data.politics == '') {
  515 + err = '请选择您的政治面貌!';
  516 + } else if (that.data.unit == '') {
  517 + err = '请填写您的工作单位!';
  518 + } else if (that.data.duty == '') {
  519 + err = '请填写您的职务!';
  520 + } else if (that.data.addr == '') {
  521 + err = '请填写您的通讯地址!';
  522 + } else if (that.data.postcode == '') {
  523 + err = '请填写您的邮编!';
  524 + } else if (that.data.school == '') {
  525 + err = '请输入就读/毕业院校!';
  526 + } else if (that.data.card_number == '') {
  527 + err = '请输入您的身份证号!';
  528 + } else if (!AuglyTest_ID.test(that.data.card_number)) {
  529 + err = '请输入正确的身份证号!';
  530 + } else if (that.data.move_phone == '') {
  531 + err = '请输入您的移动电话!';
  532 + } else if (!AuglyTest_phone.test(that.data.move_phone)) {
  533 + err = '请输入正确的移动电话!';
  534 + } else if (that.data.email == '') {
  535 + err = '请输入您的电子邮箱!';
  536 + } else if (!AuglyTest_email.test(that.data.email)) {
  537 + err = '请输入正确的电子邮箱!';
  538 + } else if (that.data.urgency_phone == '') {
  539 + err = '请输入紧急联系人及电话!';
  540 + } else if (that.data.qq == '') {
  541 + err = '请输入您的QQ!';
  542 + } else if (!AuglyTest_QQ.test(that.data.qq)) {
  543 + err = '请输入正确的QQ号!';
  544 + } else if (that.data.address == '') {
  545 + err = '请选择您的服务区域';
  546 + } else if (that.data.type == '') {
  547 + err = '请选择您的志愿类别!';
  548 + } else if (that.data.front_card == '') {
  549 + err = '请上传身份证正面!';
  550 + } else if (that.data.reverse_card == '') {
  551 + err = '请上传身份证反面!';
  552 + }
  553 + if (err == '') {
  554 + let record = that.data.record;
  555 + let record_start_time = [];
  556 + let record_end_time = [];
  557 + let record_unit = [];
  558 + let record_duty = [];
  559 + let record_name = [];
  560 + let record_phone = [];
  561 + for (let obj of record) {
  562 + record_start_time.push(obj.record_start_time);
  563 + record_end_time.push(obj.record_end_time);
  564 + record_unit.push(obj.record_unit);
  565 + record_duty.push(obj.record_duty);
  566 + record_name.push(obj.record_name);
  567 + record_phone.push(obj.record_phone);
  568 + }
  569 + let url = 'index/member_center/submit_form';
  570 + let head = {
  571 + 'XX-Token': wx.getStorageSync('token')
  572 + }
  573 + let params = {
  574 + name: that.data.name,
  575 + sex: that.data.sex,
  576 + birthday: that.data.birthday,
  577 + nation: that.data.nation,
  578 + politics: that.data.politics,
  579 + education: that.data.education,
  580 + unit: that.data.unit,
  581 + duty: that.data.duty,
  582 + addr: that.data.addr,
  583 + school: that.data.school,
  584 + card_number: that.data.card_number,
  585 +
  586 + move_phone: that.data.move_phone,
  587 + postcode: that.data.postcode,
  588 + email: that.data.email,
  589 + urgency_phone: that.data.urgency_phone,
  590 + qq: that.data.qq,
  591 + province: that.data.province,
  592 + city: that.data.city,
  593 + county: that.data.county,
  594 + address: that.data.address,
  595 + // type: that.data.type,
  596 + record_start_time: record_start_time,
  597 + record_end_time: record_end_time,
  598 + record_unit: record_unit,
  599 + record_duty: record_duty,
  600 + record_name: record_name,
  601 + record_phone: record_phone,
  602 + front_card: that.data.front_card,
  603 + reverse_card: that.data.reverse_card,
  604 + photo: that.data.photo
  605 + }
  606 + app.post(url, params, head).then((res) => {
  607 + wx.showToast({
  608 + title: '提交成功,等待审核',
  609 + icon: 'none',
  610 + duration: 2000
  611 + })
  612 +
  613 + setTimeout(function() {
  614 + wx.switchTab({
  615 + url: '/pages/my/my'
  616 + })
  617 + }, 1000)
  618 + }).catch((err) => {})
  619 + } else {
  620 + wx.showToast({
  621 + title: err,
  622 + icon: 'none',
  623 + duration: 2000
  624 + })
  625 + }
  626 + },
  627 + getdatalist() {
  628 + let that = this;
  629 + let url = '/index/member_center/edit';
  630 + let params = {
  631 + 'id': that.data.id
  632 + };
  633 + let head = {
  634 + 'XX-Token': wx.getStorageSync('token')
  635 + }
  636 + app.post(url, params, head).then((res) => {
  637 + let provincearr = that.data.provincearr;
  638 + let cityarr = that.data.cityarr;
  639 + let countryarr = that.data.countryarr;
  640 + let val = [0, 0, 0];
  641 + for (let i = 0; i < provincearr.length; i++) {
  642 + if (provincearr[i].province_name == res.province) {
  643 + val[0] = i;
  644 + }
  645 + }
  646 + for (let i = 0; i < cityarr.length; i++) {
  647 + if (cityarr[i].city_name == res.city) {
  648 + val[1] = i;
  649 + }
  650 + }
  651 + for (let i = 0; i < countryarr.length; i++) {
  652 + if (countryarr[i].country_name == res.county) {
  653 + val[2] = i;
  654 + }
  655 + }
  656 + that.setData({
  657 + valarr: val,
  658 + confirmvalarr: val,
  659 + addr: res.addr,
  660 + address: res.address,
  661 + birthday: res.birthday,
  662 + card_number: res.card_number,
  663 + city: res.city,
  664 + county: res.county,
  665 + duty: res.duty,
  666 + education: res.education,
  667 + email: res.email,
  668 + front_card: res.front_card,
  669 + move_phone: res.move_phone,
  670 + name: res.name,
  671 + nation: res.nation,
  672 + photo: res.photo,
  673 + politics: res.politics,
  674 + postcode: res.postcode,
  675 + province: res.province,
  676 + qq: res.qq,
  677 + record: res.record,
  678 + reverse_card: res.reverse_card,
  679 + school: res.school,
  680 + sex: res.sex,
  681 + unit: res.unit,
  682 + urgency_phone: res.urgency_phone,
  683 + type: res.type
  684 + })
  685 + }).catch((err) => {
  686 +
  687 + })
  688 + },
  689 + /**
  690 + * 生命周期函数--监听页面加载
  691 + */
  692 + onLoad: function(options) {
  693 + let that = this;
  694 + that.setData({
  695 + is_submit: options.is_submit,
  696 + id: options.id,
  697 + page_type: options.type ? options.type : null
  698 + })
  699 + let now = new Date();
  700 + let time = now.getFullYear() + "-" + ((now.getMonth() + 1) < 10 ? "0" : "") + (now.getMonth() + 1) + "-" + (now.getDate() < 10 ? "0" : "") + now.getDate();
  701 + this.setData({
  702 + enddata: time
  703 + })
  704 + that.getarea();
  705 + },
  706 +
  707 + /**
  708 + * 生命周期函数--监听页面初次渲染完成
  709 + */
  710 + onReady: function() {
  711 +
  712 + },
  713 +
  714 + /**
  715 + * 生命周期函数--监听页面显示
  716 + */
  717 + onShow: function() {
  718 +
  719 +
  720 + },
  721 +
  722 + /**
  723 + * 生命周期函数--监听页面隐藏
  724 + */
  725 + onHide: function() {
  726 +
  727 +
  728 +
  729 + },
  730 +
  731 + /**
  732 + * 生命周期函数--监听页面卸载
  733 + */
  734 + onUnload: function() {
  735 +
  736 + },
  737 +
  738 + /**
  739 + * 页面相关事件处理函数--监听用户下拉动作
  740 + */
  741 + onPullDownRefresh: function() {
  742 +
  743 + },
  744 +
  745 + /**
  746 + * 页面上拉触底事件的处理函数
  747 + */
  748 + onReachBottom: function() {
  749 +
  750 + },
  751 +
  752 + /**
  753 + * 用户点击右上角分享
  754 + */
  755 + onShareAppMessage: function() {
  756 +
  757 + }
761 }) 758 })
1 -<view class='avator_box'> 1 +<view class='avator_box' wx:if="{{!page_type}}">
2 <view class='upimg' bindtap='{{ifempower?"uploadImages":""}}' data-tem='1'> 2 <view class='upimg' bindtap='{{ifempower?"uploadImages":""}}' data-tem='1'>
3 <button open-type='getUserInfo' bindgetuserinfo='start' class='inofbtn' if='{{!ifempower}}' data-tem='1'></button> 3 <button open-type='getUserInfo' bindgetuserinfo='start' class='inofbtn' if='{{!ifempower}}' data-tem='1'></button>
4 - <image src='{{photo}}' wx:if='{{photo}}'></image> 4 + <image src='{{photo}}' wx:if='{{photo}}' mode="aspectFill"></image>
5 <view class='iconfont icon-xiangji' wx:if='{{!photo}}'></view> 5 <view class='iconfont icon-xiangji' wx:if='{{!photo}}'></view>
6 6
7 </view> 7 </view>
@@ -14,10 +14,10 @@ @@ -14,10 +14,10 @@
14 <view class='apply_item'> 14 <view class='apply_item'>
15 <view>姓名</view> 15 <view>姓名</view>
16 <view class='apply_item_input'> 16 <view class='apply_item_input'>
17 - <input placeholder='未填写' placeholder-class='input_p' bindinput='setname' value='{{name}}'></input> 17 + <input placeholder='未填写' placeholder-class='input_p' bindinput='setname' value='{{name}}' disabled="{{page_type}}"></input>
18 </view> 18 </view>
19 </view> 19 </view>
20 -<picker bindchange="bindsex" range="{{arraysex}}"> 20 +<picker bindchange="bindsex" range="{{arraysex}}" disabled="{{page_type}}">
21 <view class='apply_item'> 21 <view class='apply_item'>
22 <view>姓别</view> 22 <view>姓别</view>
23 <view class='apply_item_input'> 23 <view class='apply_item_input'>
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 </view> 26 </view>
27 </view> 27 </view>
28 </picker> 28 </picker>
29 -<picker mode='date' bindchange="bindbirthdayChange" end='{{enddata}}'> 29 +<picker mode='date' bindchange="bindbirthdayChange" end='{{enddata}}' disabled="{{page_type}}">
30 <view class='apply_item'> 30 <view class='apply_item'>
31 <view>出生日期</view> 31 <view>出生日期</view>
32 <view class='apply_item_input'> 32 <view class='apply_item_input'>
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 </view> 35 </view>
36 </view> 36 </view>
37 </picker> 37 </picker>
38 -<picker range='{{nationarr}}' bindchange="bindnationChange"> 38 +<picker range='{{nationarr}}' bindchange="bindnationChange" disabled="{{page_type}}">
39 <view class='apply_item'> 39 <view class='apply_item'>
40 <view>民族</view> 40 <view>民族</view>
41 <view class='apply_item_input'> 41 <view class='apply_item_input'>
@@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
44 </view> 44 </view>
45 </view> 45 </view>
46 </picker> 46 </picker>
47 -<picker range='{{educationarr}}' bindchange="bindeducationChange"> 47 +<picker range='{{educationarr}}' bindchange="bindeducationChange" disabled="{{page_type}}">
48 <view class='apply_item'> 48 <view class='apply_item'>
49 <view>学历</view> 49 <view>学历</view>
50 <view class='apply_item_input'> 50 <view class='apply_item_input'>
@@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
53 </view> 53 </view>
54 </view> 54 </view>
55 </picker> 55 </picker>
56 -<picker range='{{politicsarr}}' bindchange="bindpoliticsChange"> 56 +<picker range='{{politicsarr}}' bindchange="bindpoliticsChange" disabled="{{page_type}}">
57 <view class='apply_item'> 57 <view class='apply_item'>
58 <view>政治面貌</view> 58 <view>政治面貌</view>
59 <view class='apply_item_input'> 59 <view class='apply_item_input'>
@@ -65,37 +65,37 @@ @@ -65,37 +65,37 @@
65 <view class='apply_item'> 65 <view class='apply_item'>
66 <view>工作单位</view> 66 <view>工作单位</view>
67 <view class='apply_item_input'> 67 <view class='apply_item_input'>
68 - <input placeholder='未填写' placeholder-class='input_p' bindinput='setunit' value='{{unit}}'></input> 68 + <input placeholder='未填写' placeholder-class='input_p' bindinput='setunit' value='{{unit}}' disabled="{{page_type}}"></input>
69 </view> 69 </view>
70 </view> 70 </view>
71 <view class='apply_item'> 71 <view class='apply_item'>
72 <view>职务</view> 72 <view>职务</view>
73 <view class='apply_item_input'> 73 <view class='apply_item_input'>
74 - <input placeholder='未填写' placeholder-class='input_p' bindinput='setduty' value='{{duty}}'></input> 74 + <input placeholder='未填写' placeholder-class='input_p' bindinput='setduty' value='{{duty}}' disabled="{{page_type}}"></input>
75 </view> 75 </view>
76 </view> 76 </view>
77 <view class='apply_item'> 77 <view class='apply_item'>
78 <view>通讯地址</view> 78 <view>通讯地址</view>
79 <view class='apply_item_input'> 79 <view class='apply_item_input'>
80 - <input placeholder='未填写' placeholder-class='input_p' bindinput='setaddr' value='{{addr}}'></input> 80 + <input placeholder='未填写' placeholder-class='input_p' bindinput='setaddr' value='{{addr}}' disabled="{{page_type}}"></input>
81 </view> 81 </view>
82 </view> 82 </view>
83 <view class='apply_item'> 83 <view class='apply_item'>
84 <view>邮编</view> 84 <view>邮编</view>
85 <view class='apply_item_input'> 85 <view class='apply_item_input'>
86 - <input placeholder='未填写' placeholder-class='input_p' bindinput='setpostcode' value='{{postcode}}'></input> 86 + <input placeholder='未填写' placeholder-class='input_p' bindinput='setpostcode' value='{{postcode}}' disabled="{{page_type}}"></input>
87 </view> 87 </view>
88 </view> 88 </view>
89 <view class='apply_item'> 89 <view class='apply_item'>
90 <view>就读/毕业院校</view> 90 <view>就读/毕业院校</view>
91 <view class='apply_item_input'> 91 <view class='apply_item_input'>
92 - <input placeholder='未填写' placeholder-class='input_p' bindinput='setschool' value='{{school}}'></input> 92 + <input placeholder='未填写' placeholder-class='input_p' bindinput='setschool' value='{{school}}' disabled="{{page_type}}"></input>
93 </view> 93 </view>
94 </view> 94 </view>
95 <view class='apply_item'> 95 <view class='apply_item'>
96 <view>身份证号</view> 96 <view>身份证号</view>
97 <view class='apply_item_input'> 97 <view class='apply_item_input'>
98 - <input placeholder='未填写' placeholder-class='input_p' bindinput='setcard_number' value='{{card_number}}'></input> 98 + <input placeholder='未填写' placeholder-class='input_p' bindinput='setcard_number' value='{{card_number}}' disabled="{{page_type}}"></input>
99 </view> 99 </view>
100 </view> 100 </view>
101 <!-- <view class='apply_item'> 101 <!-- <view class='apply_item'>
@@ -107,29 +107,29 @@ @@ -107,29 +107,29 @@
107 <view class='apply_item'> 107 <view class='apply_item'>
108 <view>移动电话</view> 108 <view>移动电话</view>
109 <view class='apply_item_input'> 109 <view class='apply_item_input'>
110 - <input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='setmove_phone' value='{{move_phone}}'></input> 110 + <input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='setmove_phone' value='{{move_phone}}' disabled="{{page_type}}"></input>
111 </view> 111 </view>
112 </view> 112 </view>
113 <view class='apply_item'> 113 <view class='apply_item'>
114 <view>电子邮箱</view> 114 <view>电子邮箱</view>
115 <view class='apply_item_input'> 115 <view class='apply_item_input'>
116 - <input placeholder='未填写' placeholder-class='input_p' bindinput='setemail' value='{{email}}'></input> 116 + <input placeholder='未填写' placeholder-class='input_p' bindinput='setemail' value='{{email}}' disabled="{{page_type}}"></input>
117 </view> 117 </view>
118 </view> 118 </view>
119 <view class='apply_item big_item'> 119 <view class='apply_item big_item'>
120 <view>紧急联系人及电话</view> 120 <view>紧急联系人及电话</view>
121 <view class='apply_item_input'> 121 <view class='apply_item_input'>
122 - <input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='seturgency_phone' value='{{urgency_phone}}'></input> 122 + <input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='seturgency_phone' value='{{urgency_phone}}' disabled="{{page_type}}"></input>
123 </view> 123 </view>
124 </view> 124 </view>
125 <view class='apply_item'> 125 <view class='apply_item'>
126 <view>QQ号码</view> 126 <view>QQ号码</view>
127 <view class='apply_item_input'> 127 <view class='apply_item_input'>
128 - <input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='setqq' value='{{qq}}'></input> 128 + <input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='setqq' value='{{qq}}' disabled="{{page_type}}"></input>
129 </view> 129 </view>
130 </view> 130 </view>
131 131
132 -<view class='apply_item' bindtap='setshowapply'> 132 +<view class='apply_item' bindtap="{{page_type?'':'setshowapply'}}">
133 <view>服务区域</view> 133 <view>服务区域</view>
134 <view class='apply_item_input'> 134 <view class='apply_item_input'>
135 <view class='iconfont icon-xiangyou'></view> 135 <view class='iconfont icon-xiangyou'></view>
@@ -156,7 +156,7 @@ @@ -156,7 +156,7 @@
156 <view class='apply_cell {{apply_nav==2?"apply_active":""}}' data-apply_nav='2' bindtap='setapply_nav'>个人履历3</view> 156 <view class='apply_cell {{apply_nav==2?"apply_active":""}}' data-apply_nav='2' bindtap='setapply_nav'>个人履历3</view>
157 </view> 157 </view>
158 <view class='navbox'> 158 <view class='navbox'>
159 - <picker mode='date' bindchange="bindstartChange"> 159 + <picker mode='date' bindchange="bindstartChange" disabled="{{page_type}}">
160 <view class='apply_item'> 160 <view class='apply_item'>
161 <view>开始时间</view> 161 <view>开始时间</view>
162 <view class='apply_item_input'> 162 <view class='apply_item_input'>
@@ -165,7 +165,7 @@ @@ -165,7 +165,7 @@
165 </view> 165 </view>
166 </view> 166 </view>
167 </picker> 167 </picker>
168 - <picker mode='date' bindchange="bindendChange"> 168 + <picker mode='date' bindchange="bindendChange" disabled="{{page_type}}">
169 <view class='apply_item'> 169 <view class='apply_item'>
170 <view>结束时间</view> 170 <view>结束时间</view>
171 <view class='apply_item_input'> 171 <view class='apply_item_input'>
@@ -177,31 +177,31 @@ @@ -177,31 +177,31 @@
177 <view class='apply_item'> 177 <view class='apply_item'>
178 <view>单位名称</view> 178 <view>单位名称</view>
179 <view class='apply_item_input'> 179 <view class='apply_item_input'>
180 - <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_unit}}' bindinput='setrecordunit'></input> 180 + <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_unit}}' bindinput='setrecordunit' disabled="{{page_type}}"></input>
181 </view> 181 </view>
182 </view> 182 </view>
183 <view class='apply_item'> 183 <view class='apply_item'>
184 <view>职务</view> 184 <view>职务</view>
185 <view class='apply_item_input'> 185 <view class='apply_item_input'>
186 - <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_duty}}' bindinput='setrecordduty'></input> 186 + <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_duty}}' bindinput='setrecordduty' disabled="{{page_type}}"></input>
187 </view> 187 </view>
188 </view> 188 </view>
189 <view class='apply_item'> 189 <view class='apply_item'>
190 <view>证明人</view> 190 <view>证明人</view>
191 <view class='apply_item_input'> 191 <view class='apply_item_input'>
192 - <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_name}}' bindinput='setrecordname'></input> 192 + <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_name}}' bindinput='setrecordname' disabled="{{page_type}}"></input>
193 </view> 193 </view>
194 </view> 194 </view>
195 <view class='apply_item'> 195 <view class='apply_item'>
196 <view>证明人电话</view> 196 <view>证明人电话</view>
197 <view class='apply_item_input'> 197 <view class='apply_item_input'>
198 - <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_phone}}' bindinput='setrecordphone'></input> 198 + <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_phone}}' bindinput='setrecordphone' disabled="{{page_type}}"></input>
199 </view> 199 </view>
200 </view> 200 </view>
201 </view> 201 </view>
202 <view class='apply_title'>上传身份证照片</view> 202 <view class='apply_title'>上传身份证照片</view>
203 <view class='apply_idbox'> 203 <view class='apply_idbox'>
204 - <view class='apply_idimg' bindtap='uploadImages' data-tem='2'> 204 + <view class='apply_idimg' bindtap="{{page_type?'':'uploadImages'}}" data-tem='2'>
205 <view class='apply_idimgmain' wx:if='{{!front_card}}'> 205 <view class='apply_idimgmain' wx:if='{{!front_card}}'>
206 <view class='apply_idupimg'> 206 <view class='apply_idupimg'>
207 <text class='iconfont icon-camera1'></text> 207 <text class='iconfont icon-camera1'></text>
@@ -210,7 +210,7 @@ @@ -210,7 +210,7 @@
210 </view> 210 </view>
211 <image src='{{front_card?front_card:"https://volunteer.cnpu.org/imgs/renzhengxinxi_fanmian_bg@2x.png"}}'></image> 211 <image src='{{front_card?front_card:"https://volunteer.cnpu.org/imgs/renzhengxinxi_fanmian_bg@2x.png"}}'></image>
212 </view> 212 </view>
213 - <view class='apply_idimg' bindtap='uploadImages' data-tem='3'> 213 + <view class='apply_idimg' bindtap="{{page_type?'':'uploadImages'}}" data-tem='3'>
214 <view class='apply_idimgmain' wx:if='{{!reverse_card}}'> 214 <view class='apply_idimgmain' wx:if='{{!reverse_card}}'>
215 <view class='apply_idupimg'> 215 <view class='apply_idupimg'>
216 <text class='iconfont icon-camera1'></text> 216 <text class='iconfont icon-camera1'></text>
@@ -220,12 +220,12 @@ @@ -220,12 +220,12 @@
220 <image src='{{reverse_card?reverse_card:"https://volunteer.cnpu.org/imgs/renzhengxinxi_zhengmian_bg@2x.png"}}'></image> 220 <image src='{{reverse_card?reverse_card:"https://volunteer.cnpu.org/imgs/renzhengxinxi_zhengmian_bg@2x.png"}}'></image>
221 </view> 221 </view>
222 </view> 222 </view>
223 -<view class='apply_bottomtitle'>志愿者申请书 223 +<view class='apply_bottomtitle' wx:if="{{!page_type}}">志愿者申请书
224 </view> 224 </view>
225 -<view class='apply_bottom'> 225 +<view class='apply_bottom' wx:if="{{!page_type}}">
226 为继承和弘扬国际主义战士白求恩的伟大风范和高尚情操,传承和弘扬白求恩的伟大精神,本人自愿申请加入白求恩志愿者队伍。 本人愿尽己所能,以“志愿服务”为宗旨,不计报酬、帮助他人、服务社会,恪守国家法律、法规,遵守白求恩志愿者各项规章制度,努力工作,尽职尽责,力争为公益事业做出贡献。 226 为继承和弘扬国际主义战士白求恩的伟大风范和高尚情操,传承和弘扬白求恩的伟大精神,本人自愿申请加入白求恩志愿者队伍。 本人愿尽己所能,以“志愿服务”为宗旨,不计报酬、帮助他人、服务社会,恪守国家法律、法规,遵守白求恩志愿者各项规章制度,努力工作,尽职尽责,力争为公益事业做出贡献。
227 </view> 227 </view>
228 -<view class='apply_btn' bindtap='submit'> 228 +<view class='apply_btn' bindtap='submit' wx:if="{{!page_type}}">
229 229
230 提交 230 提交
231 </view> 231 </view>
@@ -245,7 +245,7 @@ @@ -245,7 +245,7 @@
245 <view wx:for="{{countryarr}}" wx:key style="line-height: 40px" class='column_view'>{{item.country_name}}</view> 245 <view wx:for="{{countryarr}}" wx:key style="line-height: 40px" class='column_view'>{{item.country_name}}</view>
246 </picker-view-column> 246 </picker-view-column>
247 </picker-view> 247 </picker-view>
248 - <view class='apply_vold_btn'> 248 + <view class='apply_vold_btn' wx:if="{{!page_type}}">
249 <view class='applybtn' catchtap='setno'>取消</view> 249 <view class='applybtn' catchtap='setno'>取消</view>
250 <view class='applybtn yes_applybtn' catchtap='setyes'>确定</view> 250 <view class='applybtn yes_applybtn' catchtap='setyes'>确定</view>
251 </view> 251 </view>
@@ -46,8 +46,98 @@ Page({ @@ -46,8 +46,98 @@ Page({
46 t_type: false, 46 t_type: false,
47 z_type: false, 47 z_type: false,
48 e_type: false, 48 e_type: false,
  49 + cover_type: false
  50 + },
  51 + // 审核用户信息是否通过
  52 + examine(e){
  53 + let that = this
  54 + let id = e.currentTarget.dataset.id
  55 + let url = 'index/member_center/adminApprove';
  56 + let head = {
  57 + 'XX-Token': wx.getStorageSync('token')
  58 + }
  59 + let params = {
  60 + id: that.data.info.id,
  61 + status: id
  62 + }
  63 + app.post(url, params, head).then((res) => {
  64 + wx.showToast({
  65 + title: '操作成功',
  66 + icon: 'success',
  67 + duration: 1000,
  68 + success: () => {
  69 + that.setData({
  70 + two_type: true
  71 + })
  72 + }
  73 + })
  74 + }).catch((err) => { })
49 75
50 }, 76 },
  77 + //查看工作汇报
  78 + look_word(){
  79 + if (this.data.info.is_complete !=1){
  80 + wx.showToast({
  81 + title: '该用户还未提交工作汇报',
  82 + icon: 'none'
  83 + })
  84 + return
  85 + }
  86 + wx.navigateTo({
  87 + url: '/pages/word_report/word_report?id=' + this.data.id + '&user_id=' + this.data.user_id,
  88 + })
  89 + },
  90 + //查看注册信息
  91 + look_register(){
  92 + wx.navigateTo({
  93 + url: '/pages/apply/apply?id=' + this.data.user_id + '&is_submit=' + 1 + '&type=1',
  94 + })
  95 + },
  96 + // 输入信息
  97 + get_word(e) {
  98 + this.setData({
  99 + word: e.detail.value
  100 + })
  101 + },
  102 + // 改变弹窗状态
  103 + change_cover(e) {
  104 + this.setData({
  105 + cover_type: !this.data.cover_type
  106 + })
  107 + },
  108 + // 添加时间
  109 + add_time() {
  110 + let that = this
  111 + if (!that.data.word) {
  112 + wx.showToast({
  113 + title: '请输入工时',
  114 + icon: 'none',
  115 + duration: 1000
  116 + })
  117 + return
  118 + }
  119 + let url = 'index/member_center/addTime';
  120 + let head = {
  121 + 'XX-Token': wx.getStorageSync('token')
  122 + }
  123 + let params = {
  124 + user_id: that.data.user_id,
  125 + add_time: that.data.word
  126 + }
  127 + app.post(url, params, head).then((res) => {
  128 + wx.showToast({
  129 + title: '操作成功',
  130 + icon: 'success',
  131 + duration: 1000,
  132 + success: () => {
  133 + that.setData({
  134 + word: null,
  135 + cover_type: false
  136 + })
  137 + }
  138 + })
  139 + }).catch((err) => { })
  140 + },
51 // 选择参加日期,入住日期,用餐日期 141 // 选择参加日期,入住日期,用餐日期
52 change_date(e) { 142 change_date(e) {
53 let that = this 143 let that = this
@@ -212,7 +302,7 @@ Page({ @@ -212,7 +302,7 @@ Page({
212 z_arr: res.apply_stay ? res.apply_stay : this.data.z_arr, 302 z_arr: res.apply_stay ? res.apply_stay : this.data.z_arr,
213 e_arr: res.apply_food ? res.apply_food : this.data.e_arr, 303 e_arr: res.apply_food ? res.apply_food : this.data.e_arr,
214 }) 304 })
215 - 305 +
216 }) 306 })
217 }, 307 },
218 308
@@ -297,7 +387,8 @@ Page({ @@ -297,7 +387,8 @@ Page({
297 t_type: true, 387 t_type: true,
298 z_type: true, 388 z_type: true,
299 e_type: true, 389 e_type: true,
300 - page_type: options.type 390 + page_type: options.type,
  391 + user_id: options.user_id ? options.user_id:null
301 }) 392 })
302 } 393 }
303 this.setData({ 394 this.setData({
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 <view class="left"> 19 <view class="left">
20 <image src="/imgs/must.png" /> 工作类型 20 <image src="/imgs/must.png" /> 工作类型
21 </view> 21 </view>
22 - <picker range="{{enroll_arr}}" value="{{type}}" bindchange="change_enroll"> 22 + <picker range="{{enroll_arr}}" value="{{type}}" bindchange="change_enroll" disabled="{{page_type == 0 || page_type == 1}}">
23 <view class="right"> 23 <view class="right">
24 <text>{{type?type:'请选择'}}</text> 24 <text>{{type?type:'请选择'}}</text>
25 <image src="/imgs/right.png" /> 25 <image src="/imgs/right.png" />
@@ -30,11 +30,11 @@ @@ -30,11 +30,11 @@
30 <view class="left"> 30 <view class="left">
31 <image src="/imgs/must.png" /> 工作内容 31 <image src="/imgs/must.png" /> 工作内容
32 </view> 32 </view>
33 - <picker range="{{check_arr}}" value="{{check_item}}" bindchange="change_check">  
34 - <view class="right" bindtap="show_cover">  
35 - <text>{{check?check:'请选择'}}</text>  
36 - <image src="/imgs/right.png" />  
37 - </view> 33 + <picker range="{{check_arr}}" value="{{check_item}}" bindchange="change_check" disabled="{{page_type == 0 || page_type == 1}}">
  34 + <view class="right" bindtap="show_cover">
  35 + <text>{{check?check:'请选择'}}</text>
  36 + <image src="/imgs/right.png" />
  37 + </view>
38 </picker> 38 </picker>
39 </view> 39 </view>
40 </view> 40 </view>
@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
45 <view class="left"> 45 <view class="left">
46 <image src="/imgs/must.png" /> 参加日期 46 <image src="/imgs/must.png" /> 参加日期
47 </view> 47 </view>
48 - <picker mode="selector" value="{{item.date}}" bindchange="change_date" range="{{date_arr}}" data-index="{{index}}" data-id="1"> 48 + <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}}">
49 <view class="right"> 49 <view class="right">
50 <text>{{item.date?item.date:'请选择'}}</text> 50 <text>{{item.date?item.date:'请选择'}}</text>
51 <image src="/imgs/right.png" /> 51 <image src="/imgs/right.png" />
@@ -56,14 +56,14 @@ @@ -56,14 +56,14 @@
56 <view class="left"> 56 <view class="left">
57 <image src="/imgs/must.png" /> 参加时间 57 <image src="/imgs/must.png" /> 参加时间
58 </view> 58 </view>
59 - <picker mode="selector" value="{{item.time}}" bindchange="change_time" range="{{time_arr}}" data-index="{{index}}"> 59 + <picker mode="selector" value="{{item.time}}" bindchange="change_time" range="{{time_arr}}" data-index="{{index}}" disabled="{{page_type == 0 || page_type == 1}}">
60 <view class="right"> 60 <view class="right">
61 <text>{{item.time?item.time:'请选择'}}</text> 61 <text>{{item.time?item.time:'请选择'}}</text>
62 <image src="/imgs/right.png" /> 62 <image src="/imgs/right.png" />
63 </view> 63 </view>
64 </picker> 64 </picker>
65 </view> 65 </view>
66 - <view class="add" bindtap="add_item" data-id="1" wx:if="{{index == t_arr.length -1}}">+添加</view> 66 + <view class="add" bindtap="add_item" data-id="1" wx:if="{{index == t_arr.length -1 && page_type!=0 && page_type!=1}}">+添加</view>
67 </view> 67 </view>
68 68
69 <view class="info_box" wx:for="{{z_arr}}" wx:key="index"> 69 <view class="info_box" wx:for="{{z_arr}}" wx:key="index">
@@ -74,7 +74,7 @@ @@ -74,7 +74,7 @@
74 <view class="left"> 74 <view class="left">
75 <image src="/imgs/must.png" /> 入住日期 75 <image src="/imgs/must.png" /> 入住日期
76 </view> 76 </view>
77 - <picker mode="selector" value="{{item.date}}" bindchange="change_date" range="{{date_arr}}" data-index="{{index}}" data-id="2"> 77 + <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}}">
78 <view class="right"> 78 <view class="right">
79 <text>{{item.date?item.date:'请选择'}}</text> 79 <text>{{item.date?item.date:'请选择'}}</text>
80 <image src="/imgs/right.png" /> 80 <image src="/imgs/right.png" />
@@ -83,9 +83,9 @@ @@ -83,9 +83,9 @@
83 </view> 83 </view>
84 <view class="item"> 84 <view class="item">
85 <text>入住人身份证号码</text> 85 <text>入住人身份证号码</text>
86 - <input placeholder="请输入" bindinput="get_card" value="{{item.idcard}}" maxlength="18" data-index="{{index}}"/> 86 + <input placeholder="请输入" bindinput="get_card" value="{{item.idcard}}" maxlength="18" data-index="{{index}}" disabled="{{page_type == 0 || page_type == 1}}" />
87 </view> 87 </view>
88 - <view class="add" bindtap="add_item" data-id="2" wx:if="{{index == z_arr.length -1}}">+添加</view> 88 + <view class="add" bindtap="add_item" data-id="2" wx:if="{{index == z_arr.length -1 && page_type!=0 && page_type!=1}}">+添加</view>
89 </view> 89 </view>
90 90
91 <view class="info_box" wx:for="{{e_arr}}" wx:key="index"> 91 <view class="info_box" wx:for="{{e_arr}}" wx:key="index">
@@ -94,25 +94,45 @@ @@ -94,25 +94,45 @@
94 <view class="left"> 94 <view class="left">
95 <image src="/imgs/must.png" /> 用餐日期 95 <image src="/imgs/must.png" /> 用餐日期
96 </view> 96 </view>
97 - <picker mode="selector" value="{{item.date}}" bindchange="change_date" range="{{date_arr}}" data-index="{{index}}" data-id="3"> 97 + <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}}">
98 <view class="right"> 98 <view class="right">
99 - <text>{{item.date?item.date:'请选择'}}</text> 99 + <text>{{item.date?item.date:'请选择'}}</text>
100 <image src="/imgs/right.png" /> 100 <image src="/imgs/right.png" />
101 </view> 101 </view>
102 </picker> 102 </picker>
103 </view> 103 </view>
104 <view class="item"> 104 <view class="item">
105 <view class="left"> 105 <view class="left">
106 - <image src="/imgs/must.png"/> 用餐时间 106 + <image src="/imgs/must.png" /> 用餐时间
107 </view> 107 </view>
108 - <picker mode="selector" value="{{item.time}}" bindchange="eat_time" range="{{eat_arr}}" data-index="{{index}}"> 108 + <picker mode="selector" value="{{item.time}}" bindchange="eat_time" range="{{eat_arr}}" data-index="{{index}}" disabled="{{page_type == 0 || page_type == 1}}">
109 <view class="right"> 109 <view class="right">
110 - <text>{{item.time?item.time:'请选择'}}</text> 110 + <text>{{item.time?item.time:'请选择'}}</text>
111 <image src="/imgs/right.png" /> 111 <image src="/imgs/right.png" />
112 </view> 112 </view>
113 </picker> 113 </picker>
114 </view> 114 </view>
115 - <view class="add" bindtap="add_item" data-id="3" wx:if="{{index == e_arr.length -1}}">+添加</view> 115 + <view class="add" bindtap="add_item" data-id="3" wx:if="{{index == e_arr.length -1 && page_type!=0 && page_type!=1}}">+添加</view>
  116 +</view>
  117 +
  118 +<view class="submit" bindtap="submit" wx:if="{{page_type!=0 && page_type!=1}}">确认</view>
  119 +
  120 +<view class="btn_box" wx:else>
  121 + <view class="look_table" catchtap="{{page_type == 1?'look_word':'look_register'}}">{{page_type == 1?'查看工作汇报':'查看注册信息'}}</view>
  122 +
  123 + <view class="fill_time" catchtap="change_cover" wx:if="{{page_type == 1}}">输入工时</view>
  124 + <view class="two_btn" wx:if="{{page_type == 0 && !two_type}}">
  125 + <view catchtap="examine" data-id="2">不通过</view>
  126 + <view catchtap="examine" data-id="1">通过</view>
  127 + </view>
116 </view> 128 </view>
117 129
118 -<view class="submit" bindtap="submit">确认</view>  
  130 +
  131 +<view class="cover_box" catchtouchmove="true" wx:if="{{cover_type}}">
  132 + <view class="show_box">
  133 + <view class="s_title">请输入工时</view>
  134 + <input placeholder="请输入..." class="word_area active" value="{{word}}" bindinput="get_word" type="number"/>
  135 + <view class="submit" catchtap="add_time">确认</view>
  136 + <image src="/imgs/close.png" class="close" catchtap="change_cover" />
  137 + </view>
  138 +</view>
1 page { 1 page {
  2 + height: 100%;
2 padding-bottom: 78rpx; 3 padding-bottom: 78rpx;
3 box-sizing: border-box; 4 box-sizing: border-box;
4 } 5 }
@@ -9,9 +10,11 @@ page { @@ -9,9 +10,11 @@ page {
9 border-bottom: 16rpx solid #f5f6f8; 10 border-bottom: 16rpx solid #f5f6f8;
10 box-sizing: border-box; 11 box-sizing: border-box;
11 } 12 }
12 -.info_box:last-child{ 13 +
  14 +.info_box:last-child {
13 border-bottom: none !important; 15 border-bottom: none !important;
14 } 16 }
  17 +
15 .item { 18 .item {
16 width: 100%; 19 width: 100%;
17 height: 100rpx; 20 height: 100rpx;
@@ -25,13 +28,15 @@ page { @@ -25,13 +28,15 @@ page {
25 border-bottom: 2rpx solid #e6e6e6; 28 border-bottom: 2rpx solid #e6e6e6;
26 box-sizing: border-box; 29 box-sizing: border-box;
27 } 30 }
28 -.item input{ 31 +
  32 +.item input {
29 font-size: 28rpx; 33 font-size: 28rpx;
30 font-family: PingFang SC; 34 font-family: PingFang SC;
31 font-weight: 500; 35 font-weight: 500;
32 color: rgba(51, 51, 51, 1); 36 color: rgba(51, 51, 51, 1);
33 text-align: right; 37 text-align: right;
34 } 38 }
  39 +
35 .item:last-child { 40 .item:last-child {
36 border: none; 41 border: none;
37 } 42 }
@@ -92,62 +97,121 @@ page { @@ -92,62 +97,121 @@ page {
92 align-items: center; 97 align-items: center;
93 } 98 }
94 99
95 -/* .cover_box { 100 +.submit {
  101 + width: 686rpx;
  102 + height: 88rpx;
  103 + background: rgba(65, 205, 121, 1);
  104 + border-radius: 10rpx;
  105 + font-size: 32rpx;
  106 + font-family: PingFang SC;
  107 + font-weight: 500;
  108 + color: rgba(255, 255, 255, 1);
  109 + display: flex;
  110 + justify-content: center;
  111 + align-items: center;
  112 + margin: 90rpx auto 0;
  113 +}
  114 +
  115 +.cover_box {
96 width: 100%; 116 width: 100%;
97 height: 100%; 117 height: 100%;
98 - background: rgba(0, 0, 0, 0.3);  
99 position: fixed; 118 position: fixed;
100 left: 0; 119 left: 0;
101 top: 0; 120 top: 0;
102 display: flex; 121 display: flex;
103 justify-content: center; 122 justify-content: center;
104 align-items: center; 123 align-items: center;
  124 + background: rgba(0, 0, 0, 0.3);
105 } 125 }
106 126
107 -.content_box { 127 +.show_box {
108 width: 595rpx; 128 width: 595rpx;
  129 + padding: 0 28rpx 54rpx;
  130 + box-sizing: border-box;
109 background: rgba(255, 255, 255, 1); 131 background: rgba(255, 255, 255, 1);
110 border-radius: 10rpx; 132 border-radius: 10rpx;
111 - padding: 50rpx 32rpx;  
112 - box-sizing: border-box; 133 + position: relative;
113 } 134 }
114 135
115 -.content_box .w_title { 136 +.show_box .s_title {
116 font-size: 32rpx; 137 font-size: 32rpx;
117 font-family: PingFang SC; 138 font-family: PingFang SC;
118 font-weight: bold; 139 font-weight: bold;
119 color: rgba(51, 51, 51, 1); 140 color: rgba(51, 51, 51, 1);
  141 + margin: 74rpx auto 38rpx;
120 text-align: center; 142 text-align: center;
121 - margin-top: 24rpx;  
122 } 143 }
123 144
124 -.w_content { 145 +.show_box .word_area {
  146 + width: 539rpx;
  147 + height: 275rpx;
  148 + border: 1px solid rgba(229, 229, 229, 1);
  149 + border-radius: 10rpx;
  150 + font-size: 26rpx;
  151 + font-family: PingFang SC;
  152 + font-weight: 500;
  153 + color: rgba(204, 204, 204, 1);
  154 + padding: 30rpx 36rpx;
  155 + box-sizing: border-box;
  156 +}
  157 +
  158 +.show_box .active {
  159 + height: 85rpx !important;
  160 +}
  161 +
  162 +.show_box .submit {
  163 + width: 495rpx;
  164 + height: 88rpx;
  165 + background: rgba(65, 205, 121, 1);
  166 + border-radius: 10rpx;
  167 + margin: 56rpx auto 0;
  168 + font-size: 32rpx;
  169 + font-family: PingFang SC;
  170 + font-weight: 500;
  171 + color: rgba(255, 255, 255, 1);
  172 + display: flex;
  173 + justify-content: center;
  174 + align-items: center;
  175 +}
  176 +
  177 +.show_box .close {
  178 + width: 26rpx;
  179 + height: 26rpx;
  180 + color: #ccc;
  181 + font-size: 32rpx;
  182 + font-family: PingFang SC;
  183 + font-weight: 500;
  184 + position: absolute;
  185 + right: 29rpx;
  186 + top: 31rpx;
  187 +}
  188 +
  189 +.btn_box {
125 width: 100%; 190 width: 100%;
126 - margin-top: 50rpx; 191 + margin-top: 226rpx;
127 display: flex; 192 display: flex;
128 flex-wrap: wrap; 193 flex-wrap: wrap;
129 - justify-content: space-between; 194 + justify-content: center;
130 } 195 }
131 196
132 -.w_item {  
133 - font-size: 26rpx; 197 +.look_table {
  198 + width: 322rpx;
  199 + height: 88rpx;
  200 + background: rgba(65, 205, 121, 1);
  201 + border-radius: 44rpx;
  202 + font-size: 32rpx;
134 font-family: PingFang SC; 203 font-family: PingFang SC;
135 font-weight: 500; 204 font-weight: 500;
136 - color: #666666;  
137 - padding: 18rpx 22rpx;  
138 - border-radius: 10rpx;  
139 - margin-bottom: 30rpx;  
140 - margin-right: 18rpx;  
141 - border: 1px solid #ccc;  
142 -}  
143 -.w_item:nth-child(2n){  
144 - margin-right: 0; 205 + color: rgba(255, 255, 255, 1);
  206 + display: flex;
  207 + justify-content: center;
  208 + align-items: center;
145 } 209 }
146 -.submit { 210 +
  211 +.fill_time {
147 width: 100%; 212 width: 100%;
148 height: 88rpx; 213 height: 88rpx;
149 background: rgba(65, 205, 121, 1); 214 background: rgba(65, 205, 121, 1);
150 - border-radius: 10rpx;  
151 font-size: 32rpx; 215 font-size: 32rpx;
152 font-family: PingFang SC; 216 font-family: PingFang SC;
153 font-weight: 500; 217 font-weight: 500;
@@ -155,19 +219,19 @@ page { @@ -155,19 +219,19 @@ page {
155 display: flex; 219 display: flex;
156 justify-content: center; 220 justify-content: center;
157 align-items: center; 221 align-items: center;
158 - margin-top: 34rpx; 222 + margin-top: 119rpx;
159 } 223 }
160 -.active{  
161 - border-color: rgba(65, 205, 121, 1);  
162 - color: rgba(255, 255, 255, 1);  
163 - background: rgba(65, 205, 121, 1);  
164 -} */  
165 224
166 -.submit {  
167 - width: 686rpx; 225 +.two_btn {
  226 + width: 100%;
168 height: 88rpx; 227 height: 88rpx;
169 - background: rgba(65, 205, 121, 1);  
170 - border-radius: 10rpx; 228 + display: flex;
  229 + justify-content: space-between;
  230 +}
  231 +
  232 +.two_btn view {
  233 + width: 50%;
  234 + height: 100%;
171 font-size: 32rpx; 235 font-size: 32rpx;
172 font-family: PingFang SC; 236 font-family: PingFang SC;
173 font-weight: 500; 237 font-weight: 500;
@@ -175,5 +239,11 @@ page { @@ -175,5 +239,11 @@ page {
175 display: flex; 239 display: flex;
176 justify-content: center; 240 justify-content: center;
177 align-items: center; 241 align-items: center;
178 - margin: 90rpx auto 0; 242 + margin-top: 119rpx;
  243 +}
  244 +.two_btn view:first-child{
  245 + background: #CCCCCC;
179 } 246 }
  247 +.two_btn view:last-child{
  248 + background: #41CD79;
  249 +}
@@ -12,6 +12,31 @@ Page({ @@ -12,6 +12,31 @@ Page({
12 status: '', 12 status: '',
13 cover_type: false 13 cover_type: false
14 }, 14 },
  15 + //查看更多报名用户信息(审核端)
  16 + look_more(e){
  17 + wx.navigateTo({
  18 + url: '/pages/enroll/enroll?type=' + e.currentTarget.dataset.type + '&id=' + this.data.id + '&user_id=' + e.currentTarget.dataset.user_id
  19 + })
  20 + },
  21 + // 工作内容(管理员)
  22 + join_info() {
  23 + let that = this;
  24 + let head = {
  25 + 'XX-Token': wx.getStorageSync('token')
  26 + }
  27 + let url = 'index/member_center/getJoinPerson';
  28 + let params = {
  29 + id: that.data.id
  30 + }
  31 + app.post(url, params, head).then((res) => {
  32 + console.log(res)
  33 + that.setData({
  34 + join_info: res
  35 + })
  36 + }).catch((err) => {
  37 +
  38 + })
  39 + },
15 //保存海报到本地 40 //保存海报到本地
16 save_poster(){ 41 save_poster(){
17 wx.downloadFile({ 42 wx.downloadFile({
@@ -67,7 +92,7 @@ Page({ @@ -67,7 +92,7 @@ Page({
67 // 编辑报名信息 92 // 编辑报名信息
68 edit_info() { 93 edit_info() {
69 wx.navigateTo({ 94 wx.navigateTo({
70 - url: '/pages/enroll/enroll?id=' + this.data.id + '&type=1' 95 + url: '/pages/enroll/enroll?id=' + this.data.id + '&type=3'
71 }) 96 })
72 }, 97 },
73 get_poster() { 98 get_poster() {
@@ -122,6 +147,7 @@ Page({ @@ -122,6 +147,7 @@ Page({
122 }) 147 })
123 if (that.data.status == '1'){ 148 if (that.data.status == '1'){
124 that.get_poster() 149 that.get_poster()
  150 + that.join_info()
125 } 151 }
126 wxParse.wxParse('content', 'html', res.content, that, 5); 152 wxParse.wxParse('content', 'html', res.content, that, 5);
127 }).catch((err) => { 153 }).catch((err) => {
@@ -133,7 +159,7 @@ Page({ @@ -133,7 +159,7 @@ Page({
133 let head = { 159 let head = {
134 'XX-Token': wx.getStorageSync('token') 160 'XX-Token': wx.getStorageSync('token')
135 } 161 }
136 - let url = '/index/index/news_info'; 162 + let url = 'index/index/news_info';
137 let params = { 163 let params = {
138 id: that.data.id 164 id: that.data.id
139 } 165 }
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 <import src="../../wxParse/wxParse.wxml" /> 8 <import src="../../wxParse/wxParse.wxml" />
9 <template is='wxParse' data='{{wxParseData:content.nodes}}' /> 9 <template is='wxParse' data='{{wxParseData:content.nodes}}' />
10 </view> 10 </view>
11 - <view class='memberbox' wx:if='{{datalist.join.length>0 && type != 1}}'> 11 + <view class='memberbox' wx:if='{{datalist.join.length>0 && type != 1 && datalist.admin !=1}}'>
12 <view class='title'>已成功报名人员</view> 12 <view class='title'>已成功报名人员</view>
13 <view class='member' wx:for='{{datalist.join}}' wx:key='index'> 13 <view class='member' wx:for='{{datalist.join}}' wx:key='index'>
14 <view class="top"> 14 <view class="top">
@@ -19,12 +19,11 @@ @@ -19,12 +19,11 @@
19 </view> 19 </view>
20 </view> 20 </view>
21 </view> 21 </view>
22 -<view wx:if="{{type!= 1}}"> 22 +<view wx:if="{{type!= 1 && datalist.admin !=1}}">
23 <navigator class='foot' url="/pages/enroll/enroll?id={{id}}" wx:if='{{datalist.button_status == 1}}' hover-class="none">报名</navigator> 23 <navigator class='foot' url="/pages/enroll/enroll?id={{id}}" wx:if='{{datalist.button_status == 1}}' hover-class="none">报名</navigator>
24 <view class='foot' wx:if='{{datalist.button_status == 2}}' style='background: #FFD700; color: #fff;'>待审核</view> 24 <view class='foot' wx:if='{{datalist.button_status == 2}}' style='background: #FFD700; color: #fff;'>待审核</view>
25 - <navigator class='foot' wx:if='{{datalist.button_status == 3}}' url="/pages/word_report/word_report?id={{id}}" hover-class="none">签到工作汇报</navigator>  
26 - <!-- <navigator class='foot' bindtap='sign' url="/pages/word_report/word_report?id={{id}}" hover-class="none">签到工作汇报</navigator> -->  
27 - <view class='foot' wx:if='{{datalist.button_status == 4}}' style='background: #ccc;color: #fff;'>已签到工作汇报</view> 25 + <navigator class='foot' wx:if='{{datalist.button_status == 3}}' url="/pages/word_report/word_report?id={{id}}" hover-class="none">工作汇报</navigator>
  26 + <view class='foot' wx:if='{{datalist.button_status == 4}}' style='background: #ccc;color: #fff;'>工作汇报</view>
28 <view class='foot' wx:if='{{datalist.button_status == 5}}' style='background: #ccc;color: #fff;'>已结束</view> 27 <view class='foot' wx:if='{{datalist.button_status == 5}}' style='background: #ccc;color: #fff;'>已结束</view>
29 <navigator url='/pages/result/result' class='foot' wx:if='{{datalist.button_status == 6}}'>成为志愿者</navigator> 28 <navigator url='/pages/result/result' class='foot' wx:if='{{datalist.button_status == 6}}'>成为志愿者</navigator>
30 29
@@ -32,8 +31,8 @@ @@ -32,8 +31,8 @@
32 31
33 <view class="btn_box"> 32 <view class="btn_box">
34 <navigator class="btn-item" style="background: url('/imgs/index.png') no-repeat center;background-size: cover;" url="/pages/index/index" open-type="switchTab">首页</navigator> 33 <navigator class="btn-item" style="background: url('/imgs/index.png') no-repeat center;background-size: cover;" url="/pages/index/index" open-type="switchTab">首页</navigator>
35 - <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>  
36 - <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> 34 + <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>
  35 + <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>
37 <view class="btn-item" style="background: url('/imgs/share.png') no-repeat center;background-size: cover;" bindtap="change_cover" data-id="2">分享</view> 36 <view class="btn-item" style="background: url('/imgs/share.png') no-repeat center;background-size: cover;" bindtap="change_cover" data-id="2">分享</view>
38 </view> 37 </view>
39 38
@@ -48,7 +47,75 @@ @@ -48,7 +47,75 @@
48 <view class="poster_box" wx:if="{{cover_id == 2}}" style="background: url('{{poster}}') no-repeat center;background-size: cover;"> 47 <view class="poster_box" wx:if="{{cover_id == 2}}" style="background: url('{{poster}}') no-repeat center;background-size: cover;">
49 <view class="select_box" style="margin-top:812rpx;"> 48 <view class="select_box" style="margin-top:812rpx;">
50 <view catchtap="change_cover" catchtap="save_poster" class="b_item">保存到相册</view> 49 <view catchtap="change_cover" catchtap="save_poster" class="b_item">保存到相册</view>
51 - <button class="b_item" open-type="share">发送给朋友</button> 50 + <button class="b_item" open-type="share">发送给朋友</button>
  51 + </view>
  52 + </view>
  53 +</view>
  54 +
  55 +<view class="c_item" wx:if="{{join_info.camera.length>0}}">
  56 + <view class="c_title">摄影(设备自带</view>
  57 + <view class="c_box">
  58 + <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">
  59 + <image src="{{item.photo}}" mode="aspectFill" />
  60 + <view class="name">李强</view>
  61 + <view class="status" wx:if="{{item.status =='已通过'}}" style="background: #41CD79;">已通过</view>
  62 + <view class="status" wx:else style="background: #F84141;">未通过</view>
  63 + </view>
  64 + </view>
  65 +</view>
  66 +<view class="c_item" wx:if="{{join_info.photo.length>0}}">
  67 + <view class="c_title">摄像(设备自带</view>
  68 + <view class="c_box">
  69 + <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">
  70 + <image src="{{item.photo}}" mode="aspectFill" />
  71 + <view class="name">李强</view>
  72 + <view class="status" wx:if="{{item.status =='已通过'}}" style="background: #41CD79;">已通过</view>
  73 + <view class="status" wx:else style="background: #F84141;">未通过</view>
  74 + </view>
  75 + </view>
  76 +</view>
  77 +<view class="c_item" wx:if="{{join_info.motorcade.length>0}}">
  78 + <view class="c_title">爱心车队</view>
  79 + <view class="c_box">
  80 + <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">
  81 + <image src="{{item.photo}}" mode="aspectFill" />
  82 + <view class="name">李强</view>
  83 + <view class="status" wx:if="{{item.status =='已通过'}}" style="background: #41CD79;">已通过</view>
  84 + <view class="status" wx:else style="background: #F84141;">未通过</view>
  85 + </view>
  86 + </view>
  87 +</view>
  88 +<view class="c_item" wx:if="{{join_info.question.length>0}}">
  89 + <view class="c_title">线上答疑</view>
  90 + <view class="c_box">
  91 + <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">
  92 + <image src="{{item.photo}}" mode="aspectFill" />
  93 + <view class="name">李强</view>
  94 + <view class="status" wx:if="{{item.status =='已通过'}}" style="background: #41CD79;">已通过</view>
  95 + <view class="status" wx:else style="background: #F84141;">未通过</view>
  96 + </view>
  97 + </view>
  98 +</view>
  99 +<view class="c_item" wx:if="{{join_info.ill.length>0}}">
  100 + <view class="c_title">门诊服务</view>
  101 + <view class="c_box">
  102 + <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">
  103 + <image src="{{item.photo}}" mode="aspectFill" />
  104 + <view class="name">李强</view>
  105 + <view class="status" wx:if="{{item.status =='已通过'}}" style="background: #41CD79;">已通过</view>
  106 + <view class="status" wx:else style="background: #F84141;">未通过</view>
  107 + </view>
  108 + </view>
  109 +</view>
  110 +
  111 +<view class="c_item" wx:if="{{join_info.ill.service>0}}">
  112 + <view class="c_title">现场服务(签到、指引、礼仪等</view>
  113 + <view class="c_box">
  114 + <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">
  115 + <image src="{{item.photo}}" mode="aspectFill" />
  116 + <view class="name">李强</view>
  117 + <view class="status" wx:if="{{item.status =='已通过'}}" style="background: #41CD79;">已通过</view>
  118 + <view class="status" wx:else style="background: #F84141;">未通过</view>
52 </view> 119 </view>
53 </view> 120 </view>
54 </view> 121 </view>
@@ -229,3 +229,68 @@ page { @@ -229,3 +229,68 @@ page {
229 height: 952rpx; 229 height: 952rpx;
230 border-radius: 10rpx; 230 border-radius: 10rpx;
231 } 231 }
  232 +
  233 +.c_item {
  234 + width: 100%;
  235 + padding: 0 32rpx;
  236 + box-sizing: border-box;
  237 + border-bottom: 16rpx solid #f5f6f8;
  238 +}
  239 +
  240 +.c_item:last-child {
  241 + border-bottom: none;
  242 +}
  243 +
  244 +.c_item .c_title {
  245 + font-size: 32rpx;
  246 + font-family: PingFang SC;
  247 + font-weight: bold;
  248 + color: rgba(51, 51, 51, 1);
  249 + border-left: 4rpx solid #21ae59;
  250 + padding-left: 13rpx;
  251 + margin-top: 44rpx;
  252 + box-sizing: border-box;
  253 +}
  254 +
  255 +.c_box {
  256 + width: 100%;
  257 + margin-top: 21rpx;
  258 + display: flex;
  259 + flex-wrap: wrap;
  260 +}
  261 +
  262 +.i_info {
  263 + width: 33.333%;
  264 + display: flex;
  265 + flex-wrap: wrap;
  266 + justify-content: center;
  267 + padding: 28rpx 48rpx;
  268 + box-sizing: border-box;
  269 +}
  270 +
  271 +.i_info image {
  272 + width: 90rpx;
  273 + height: 90rpx;
  274 + border-radius: 50%;
  275 +}
  276 +
  277 +.i_info .name {
  278 + font-size: 28rpx;
  279 + font-family: PingFang SC;
  280 + font-weight: 500;
  281 + color: rgba(51, 51, 51, 1);
  282 + margin: 14rpx 0;
  283 +}
  284 +
  285 +.i_info .status {
  286 + font-size: 22rpx;
  287 + font-family: PingFang SC;
  288 + font-weight: 500;
  289 + color: rgba(255, 255, 255, 1);
  290 + padding: 10rpx 14rpx;
  291 +}
  292 +
  293 +.line {
  294 + border-bottom: 1px solid #e6e6e6;
  295 +}
  296 +
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 <navigator class='new_cell' wx:for='{{activity}}' wx:key url='/pages/img_txt/img_txt?id={{item.id}}&status=1' hover-class="none"> 21 <navigator class='new_cell' wx:for='{{activity}}' wx:key url='/pages/img_txt/img_txt?id={{item.id}}&status=1' hover-class="none">
22 <view class='new_cellmain'> 22 <view class='new_cellmain'>
23 <view class='new_img'> 23 <view class='new_img'>
24 - <image src='{{item.thumbnail}}'> </image> 24 + <image src='{{item.thumbnail}}' mode="aspectFill"> </image>
25 </view> 25 </view>
26 <view class='new_title'>{{item.activity_name}}</view> 26 <view class='new_title'>{{item.activity_name}}</view>
27 <view class='title_box'> 27 <view class='title_box'>
@@ -23,10 +23,10 @@ Page({ @@ -23,10 +23,10 @@ Page({
23 23
24 }) 24 })
25 }, 25 },
26 - goamdin() {  
27 - let that = this; 26 + // 管理员
  27 + goamdin(e) {
28 wx.navigateTo({ 28 wx.navigateTo({
29 - url: '/pages/admin/admin' 29 + url: '/pages/admin/admin?type=' + e.currentTarget.dataset.type
30 }) 30 })
31 31
32 }, 32 },
1 -<!--pages/my/my.wxml--> 1 +
2 <view class='my_head'> 2 <view class='my_head'>
3 <image src='https://volunteer.cnpu.org/imgs/gerenzhongxin_bg@2x.png'></image> 3 <image src='https://volunteer.cnpu.org/imgs/gerenzhongxin_bg@2x.png'></image>
4 <view class='my_headitem'> 4 <view class='my_headitem'>
@@ -47,10 +47,18 @@ @@ -47,10 +47,18 @@
47 </view> 47 </view>
48 <view class='iconfont icon-xiangyou'></view> 48 <view class='iconfont icon-xiangyou'></view>
49 </navigator> 49 </navigator>
50 - <view class='my_item' bindtap='goamdin' wx:if='{{datalist.type=="2"}}'> 50 +
  51 + <view class='my_item' bindtap='goamdin' wx:if='{{datalist.type=="2"}}' data-type="1">
51 <view class='my_itemletf'> 52 <view class='my_itemletf'>
52 <view class='iconfont icon-gongzhang'></view>管理员审核 53 <view class='iconfont icon-gongzhang'></view>管理员审核
53 </view> 54 </view>
54 <view class='iconfont icon-xiangyou'></view> 55 <view class='iconfont icon-xiangyou'></view>
55 </view> 56 </view>
  57 +
  58 + <view class='my_item' bindtap='goamdin' wx:if='{{datalist.type=="2"}}' data-type="2">
  59 + <view class='my_itemletf'>
  60 + <image src="/imgs/time.png" class="time"/>志愿者工时管理
  61 + </view>
  62 + <view class='iconfont icon-xiangyou'></view>
  63 + </view>
56 </view> 64 </view>
@@ -80,6 +80,12 @@ @@ -80,6 +80,12 @@
80 left: -10rpx; 80 left: -10rpx;
81 top: 0; 81 top: 0;
82 } 82 }
  83 +.my_itemletf .time{
  84 + width: 34rpx;
  85 + height: 32rpx;
  86 + margin-right: 30rpx;
  87 + left: 0;
  88 +}
83 .my_itemletf .iconfont { 89 .my_itemletf .iconfont {
84 font-size: 40rpx; 90 font-size: 40rpx;
85 color: #fa8286; 91 color: #fa8286;
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <navigator class='new_cell' wx:for='{{activity}}' wx:key url='/pages/img_txt/img_txt?id={{item.id}}&status=1' hover-class="none"> 4 <navigator class='new_cell' wx:for='{{activity}}' wx:key url='/pages/img_txt/img_txt?id={{item.id}}&status=1' hover-class="none">
5 <view class='new_cellmain'> 5 <view class='new_cellmain'>
6 <view class='new_img'> 6 <view class='new_img'>
7 - <image src='{{item.thumbnail}}'> </image> 7 + <image src='{{item.thumbnail}}' mode="aspectFill"> </image>
8 </view> 8 </view>
9 <view class='new_title'>{{item.activity_name}}</view> 9 <view class='new_title'>{{item.activity_name}}</view>
10 <view class='title_box'> 10 <view class='title_box'>
@@ -60,6 +60,9 @@ Page({ @@ -60,6 +60,9 @@ Page({
60 let params = { 60 let params = {
61 id: id 61 id: id
62 } 62 }
  63 + if (this.data.user_id){
  64 + params.user_id = this.data.user_id
  65 + }
63 let header = { 66 let header = {
64 'XX-Token': wx.getStorageSync('token') 67 'XX-Token': wx.getStorageSync('token')
65 } 68 }
@@ -117,8 +120,10 @@ Page({ @@ -117,8 +120,10 @@ Page({
117 * 生命周期函数--监听页面加载 120 * 生命周期函数--监听页面加载
118 */ 121 */
119 onLoad: function (options) { 122 onLoad: function (options) {
  123 + console.log(options)
120 this.setData({ 124 this.setData({
121 - id: options.id 125 + id: options.id,
  126 + user_id: options.user_id ? options.user_id:null
122 }) 127 })
123 this.get_info(options.id) 128 this.get_info(options.id)
124 }, 129 },