正在显示
13 个修改的文件
包含
264 行增加
和
167 行删除
@@ -12,6 +12,13 @@ | @@ -12,6 +12,13 @@ | ||
12 | height: 16rpx; | 12 | height: 16rpx; |
13 | background: #F0F0F0; | 13 | background: #F0F0F0; |
14 | } | 14 | } |
15 | +.wxParse-span{ | ||
16 | + overflow: hidden; | ||
17 | + padding: 0; | ||
18 | + display: flex; | ||
19 | + | ||
20 | + justify-content: center; | ||
21 | +} | ||
15 | .wxParse-img{ | 22 | .wxParse-img{ |
16 | width: 100% !important; | 23 | width: 100% !important; |
17 | } | 24 | } |
@@ -9,7 +9,21 @@ Page({ | @@ -9,7 +9,21 @@ Page({ | ||
9 | page: 0, | 9 | page: 0, |
10 | datalist: [], | 10 | datalist: [], |
11 | pageNum: 10, | 11 | pageNum: 10, |
12 | - cover_type: false | 12 | + cover_type: false, |
13 | + input_bottom:0 | ||
14 | + }, | ||
15 | + // 获取到焦点 | ||
16 | + focus: function (e) { | ||
17 | + this.setData({ | ||
18 | + input_bottom: 100 | ||
19 | + }) | ||
20 | + }, | ||
21 | + | ||
22 | + // 失去焦点 | ||
23 | + no_focus: function (e) { | ||
24 | + this.setData({ | ||
25 | + input_bottom: 0 | ||
26 | + }) | ||
13 | }, | 27 | }, |
14 | // 输入信息 | 28 | // 输入信息 |
15 | get_word(e) { | 29 | get_word(e) { |
@@ -19,7 +33,7 @@ Page({ | @@ -19,7 +33,7 @@ Page({ | ||
19 | }, | 33 | }, |
20 | // 改变弹窗状态 | 34 | // 改变弹窗状态 |
21 | change_cover(e) { | 35 | change_cover(e) { |
22 | - if (e.currentTarget.dataset.index){ | 36 | + if (e.currentTarget.dataset.id){ |
23 | this.setData({ | 37 | this.setData({ |
24 | index: e.currentTarget.dataset.index, | 38 | index: e.currentTarget.dataset.index, |
25 | id: e.currentTarget.dataset.id | 39 | id: e.currentTarget.dataset.id |
@@ -6,8 +6,8 @@ | @@ -6,8 +6,8 @@ | ||
6 | <image src='{{item.photo?item.photo:"https://volunteer.cnpu.org/imgs/wode_02@2x.png"}}' mode="aspectFill"></image> | 6 | <image src='{{item.photo?item.photo:"https://volunteer.cnpu.org/imgs/wode_02@2x.png"}}' mode="aspectFill"></image> |
7 | </view> | 7 | </view> |
8 | <view class='admin_txt'> | 8 | <view class='admin_txt'> |
9 | - <view class='admin_txttitle'>{{item.nane}}</view> | ||
10 | - <view>{{item.duty}}</view> | 9 | + <view class='admin_txttitle'>{{item.name}}</view> |
10 | + <view>{{item.province}}</view> | ||
11 | </view> | 11 | </view> |
12 | </navigator> | 12 | </navigator> |
13 | <view class='admin_rigth' wx:if="{{type == 1}}"> | 13 | <view class='admin_rigth' wx:if="{{type == 1}}"> |
@@ -20,11 +20,11 @@ | @@ -20,11 +20,11 @@ | ||
20 | </block> | 20 | </block> |
21 | 21 | ||
22 | 22 | ||
23 | -<view class="cover_box" catchtouchmove="true" wx:if="{{cover_type}}"> | 23 | +<view class="cover_box" catchtouchmove="true" wx:if="{{cover_type}}" style=" bottom: {{input_bottom}}px;"> |
24 | <view class="show_box"> | 24 | <view class="show_box"> |
25 | <view class="s_title">{{type>1?'请输入工时':'请输入未通过理由'}}</view> | 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}}"/> | 26 | + <textarea placeholder="请输入..." class="word_area {{type>1?'active':''}}" value="{{word}}" bindinput="get_word" wx:if="{{type==1}}" adjust-position='{{false}}' bindfocus="focus" bindblur='no_focus'/> |
27 | + <input placeholder="请输入..." class="word_area active" value="{{word}}" bindinput="get_word" type="number" wx:if="{{type==2}}" adjust-position='{{false}}' bindfocus="focus" bindblur='no_focus'/> | ||
28 | <view class="submit" catchtap="{{type>1?'add_time':'reject'}}">确认</view> | 28 | <view class="submit" catchtap="{{type>1?'add_time':'reject'}}">确认</view> |
29 | <image src="/imgs/close.png" class="close" catchtap="change_cover"/> | 29 | <image src="/imgs/close.png" class="close" catchtap="change_cover"/> |
30 | </view> | 30 | </view> |
@@ -85,11 +85,11 @@ page { | @@ -85,11 +85,11 @@ page { | ||
85 | height: 100%; | 85 | height: 100%; |
86 | position: fixed; | 86 | position: fixed; |
87 | left: 0; | 87 | left: 0; |
88 | - top: 0; | ||
89 | display: flex; | 88 | display: flex; |
90 | justify-content: center; | 89 | justify-content: center; |
91 | align-items: center; | 90 | align-items: center; |
92 | background: rgba(0, 0, 0, 0.3); | 91 | background: rgba(0, 0, 0, 0.3); |
92 | + z-index: 3; | ||
93 | } | 93 | } |
94 | 94 | ||
95 | .show_box { | 95 | .show_box { |
@@ -123,7 +123,7 @@ page { | @@ -123,7 +123,7 @@ page { | ||
123 | box-sizing: border-box; | 123 | box-sizing: border-box; |
124 | } | 124 | } |
125 | .show_box .active{ | 125 | .show_box .active{ |
126 | - height: 85rpx !important; | 126 | + height: auto !important; |
127 | } | 127 | } |
128 | .show_box .submit { | 128 | .show_box .submit { |
129 | width: 495rpx; | 129 | width: 495rpx; |
@@ -676,6 +676,7 @@ Page({ | @@ -676,6 +676,7 @@ Page({ | ||
676 | name: res.name, | 676 | name: res.name, |
677 | nation: res.nation, | 677 | nation: res.nation, |
678 | photo: res.photo, | 678 | photo: res.photo, |
679 | + fixed_phone: res.fixed_phone, | ||
679 | politics: res.politics, | 680 | politics: res.politics, |
680 | postcode: res.postcode, | 681 | postcode: res.postcode, |
681 | province: res.province, | 682 | province: res.province, |
@@ -5,12 +5,13 @@ Page({ | @@ -5,12 +5,13 @@ Page({ | ||
5 | * 页面的初始数据 | 5 | * 页面的初始数据 |
6 | */ | 6 | */ |
7 | data: { | 7 | data: { |
8 | + input_bottom: 0, | ||
8 | enroll_arr: ['线上', '线下', '线上及线下'], | 9 | enroll_arr: ['线上', '线下', '线上及线下'], |
9 | check_arr: [ | 10 | check_arr: [ |
10 | - "摄影(设备自带", | ||
11 | - "摄像(设备自带", | 11 | + "摄影(设备自带)", |
12 | + "摄像(设备自带)", | ||
12 | "爱心车队", | 13 | "爱心车队", |
13 | - "现场服务(签到、指引、礼仪等", | 14 | + "现场服务(签到、指引、礼仪等)", |
14 | "线上答疑", | 15 | "线上答疑", |
15 | "门诊服务" | 16 | "门诊服务" |
16 | ], | 17 | ], |
@@ -20,12 +21,6 @@ Page({ | @@ -20,12 +21,6 @@ Page({ | ||
20 | eat_arr: [ | 21 | eat_arr: [ |
21 | '午餐', '晚餐' | 22 | '午餐', '晚餐' |
22 | ], | 23 | ], |
23 | - date_arr: [ | ||
24 | - "2019-07-21", | ||
25 | - "2019-07-22", | ||
26 | - "2019-07-23", | ||
27 | - "2019-07-24" | ||
28 | - ], | ||
29 | t_arr: [{ //选择日期数组 | 24 | t_arr: [{ //选择日期数组 |
30 | date: '', | 25 | date: '', |
31 | time: '' | 26 | time: '' |
@@ -44,10 +39,23 @@ Page({ | @@ -44,10 +39,23 @@ Page({ | ||
44 | ], | 39 | ], |
45 | 40 | ||
46 | t_type: false, | 41 | t_type: false, |
47 | - z_type: false, | ||
48 | - e_type: false, | 42 | + z_type: true, |
43 | + e_type: true, | ||
49 | cover_type: false | 44 | cover_type: false |
50 | }, | 45 | }, |
46 | + // 获取到焦点 | ||
47 | + focus: function (e) { | ||
48 | + this.setData({ | ||
49 | + input_bottom: 100 | ||
50 | + }) | ||
51 | + }, | ||
52 | + | ||
53 | + // 失去焦点 | ||
54 | + no_focus: function (e) { | ||
55 | + this.setData({ | ||
56 | + input_bottom: 0 | ||
57 | + }) | ||
58 | + }, | ||
51 | // 审核用户信息是否通过 | 59 | // 审核用户信息是否通过 |
52 | examine(e){ | 60 | examine(e){ |
53 | let that = this | 61 | let that = this |
@@ -57,7 +65,7 @@ Page({ | @@ -57,7 +65,7 @@ Page({ | ||
57 | 'XX-Token': wx.getStorageSync('token') | 65 | 'XX-Token': wx.getStorageSync('token') |
58 | } | 66 | } |
59 | let params = { | 67 | let params = { |
60 | - id: that.data.user_id, | 68 | + id: that.data.info.id, |
61 | status: id | 69 | status: id |
62 | } | 70 | } |
63 | app.post(url, params, head).then((res) => { | 71 | app.post(url, params, head).then((res) => { |
@@ -173,12 +181,20 @@ Page({ | @@ -173,12 +181,20 @@ Page({ | ||
173 | that.setData({ | 181 | that.setData({ |
174 | z_type: true | 182 | z_type: true |
175 | }) | 183 | }) |
184 | + } else { | ||
185 | + that.setData({ | ||
186 | + z_type: false | ||
187 | + }) | ||
176 | } | 188 | } |
177 | } else if (type == 3) { | 189 | } else if (type == 3) { |
178 | if (that.data.e_arr[index].date != "" && that.data.e_arr[index].time != "") { | 190 | if (that.data.e_arr[index].date != "" && that.data.e_arr[index].time != "") { |
179 | that.setData({ | 191 | that.setData({ |
180 | e_type: true | 192 | e_type: true |
181 | }) | 193 | }) |
194 | + } else { | ||
195 | + that.setData({ | ||
196 | + e_type: false | ||
197 | + }) | ||
182 | } | 198 | } |
183 | } | 199 | } |
184 | }, | 200 | }, |
@@ -208,7 +224,29 @@ Page({ | @@ -208,7 +224,29 @@ Page({ | ||
208 | }) | 224 | }) |
209 | this.judge_status(2, index) | 225 | this.judge_status(2, index) |
210 | }, | 226 | }, |
211 | - | 227 | + //删除日期,入住,用餐 |
228 | + del(e){ | ||
229 | + let status = Number(e.currentTarget.dataset.status) | ||
230 | + let index = e.currentTarget.dataset.index | ||
231 | + let arr = status > 1 ? (status > 2 ? this.data.e_arr : this.data.z_arr) : this.data.t_arr | ||
232 | + arr.splice(index, 1) | ||
233 | + if (status == 1){ | ||
234 | + this.setData({ | ||
235 | + t_arr: arr, | ||
236 | + t_type: true | ||
237 | + }) | ||
238 | + } else if(status == 2){ | ||
239 | + this.setData({ | ||
240 | + z_arr: arr, | ||
241 | + z_type: true | ||
242 | + }) | ||
243 | + } else if (status == 3) { | ||
244 | + this.setData({ | ||
245 | + e_arr: arr, | ||
246 | + e_type: true | ||
247 | + }) | ||
248 | + } | ||
249 | + }, | ||
212 | // 添加日期,入住,用餐 | 250 | // 添加日期,入住,用餐 |
213 | add_item(e) { | 251 | add_item(e) { |
214 | let id = e.currentTarget.dataset.id | 252 | let id = e.currentTarget.dataset.id |
@@ -231,7 +269,7 @@ Page({ | @@ -231,7 +269,7 @@ Page({ | ||
231 | t_type: false | 269 | t_type: false |
232 | }) | 270 | }) |
233 | } else if (id == 2) { | 271 | } else if (id == 2) { |
234 | - if (this.data.z_type == false) { | 272 | + if (this.data.z_arr[this.data.z_arr.length - 1].date == "" && this.data.z_arr[this.data.z_arr.length - 1].idcard == "") { |
235 | wx.showToast({ | 273 | wx.showToast({ |
236 | title: '请先完善申请入住信息', | 274 | title: '请先完善申请入住信息', |
237 | icon: 'none' | 275 | icon: 'none' |
@@ -248,7 +286,7 @@ Page({ | @@ -248,7 +286,7 @@ Page({ | ||
248 | z_type: false | 286 | z_type: false |
249 | }) | 287 | }) |
250 | } else if (id == 3) { | 288 | } else if (id == 3) { |
251 | - if (this.data.e_type == false) { | 289 | + if (this.data.e_arr[this.data.e_arr.length - 1].date == "" && this.data.e_arr[this.data.e_arr.length - 1].time == "") { |
252 | wx.showToast({ | 290 | wx.showToast({ |
253 | title: '请先完善申请用餐信息', | 291 | title: '请先完善申请用餐信息', |
254 | icon: 'none' | 292 | icon: 'none' |
@@ -288,12 +326,16 @@ Page({ | @@ -288,12 +326,16 @@ Page({ | ||
288 | let params = { | 326 | let params = { |
289 | id: id | 327 | id: id |
290 | } | 328 | } |
329 | + if (this.data.status){ | ||
330 | + params.user_id = this.data.user_id | ||
331 | + } | ||
291 | let header = { | 332 | let header = { |
292 | 'XX-Token': wx.getStorageSync('token') | 333 | 'XX-Token': wx.getStorageSync('token') |
293 | } | 334 | } |
294 | app.post(url, params, header).then((res) => { | 335 | app.post(url, params, header).then((res) => { |
295 | this.setData({ | 336 | this.setData({ |
296 | info: res, | 337 | info: res, |
338 | + date_arr: res.time, //活动日期 | ||
297 | type_id: res.work_type ? res.work_type: null, | 339 | type_id: res.work_type ? res.work_type: null, |
298 | type: res.work_type ? this.data.enroll_arr[Number(res.work_type) - 1]:null, | 340 | type: res.work_type ? this.data.enroll_arr[Number(res.work_type) - 1]:null, |
299 | check_id: res.work_content ? res.work_content : null, | 341 | check_id: res.work_content ? res.work_content : null, |
@@ -301,9 +343,7 @@ Page({ | @@ -301,9 +343,7 @@ Page({ | ||
301 | t_arr: res.select_time ? res.select_time : this.data.t_arr, | 343 | t_arr: res.select_time ? res.select_time : this.data.t_arr, |
302 | z_arr: res.apply_stay ? res.apply_stay : this.data.z_arr, | 344 | z_arr: res.apply_stay ? res.apply_stay : this.data.z_arr, |
303 | e_arr: res.apply_food ? res.apply_food : this.data.e_arr, | 345 | e_arr: res.apply_food ? res.apply_food : this.data.e_arr, |
304 | - t_type: res.select_time?true:false, | ||
305 | - z_type: res.apply_stay ? true : false, | ||
306 | - e_type: res.apply_food ? true : false | 346 | + t_type: res.select_time?true:false |
307 | }) | 347 | }) |
308 | 348 | ||
309 | }) | 349 | }) |
@@ -368,7 +408,7 @@ Page({ | @@ -368,7 +408,7 @@ Page({ | ||
368 | } | 408 | } |
369 | app.post(url, params, header).then((res) => { | 409 | app.post(url, params, header).then((res) => { |
370 | wx.showToast({ | 410 | wx.showToast({ |
371 | - title: '报名成功,请等待审核', | 411 | + title: '报名成功', |
372 | duration: 1000, | 412 | duration: 1000, |
373 | success: ()=>{ | 413 | success: ()=>{ |
374 | setTimeout(()=>{ | 414 | setTimeout(()=>{ |
@@ -388,8 +428,6 @@ Page({ | @@ -388,8 +428,6 @@ Page({ | ||
388 | if (options.type){ | 428 | if (options.type){ |
389 | this.setData({ | 429 | this.setData({ |
390 | t_type: true, | 430 | t_type: true, |
391 | - z_type: true, | ||
392 | - e_type: true, | ||
393 | page_type: options.type | 431 | page_type: options.type |
394 | }) | 432 | }) |
395 | } | 433 | } |
@@ -40,7 +40,9 @@ | @@ -40,7 +40,9 @@ | ||
40 | </view> | 40 | </view> |
41 | 41 | ||
42 | <view class="info_box" wx:for="{{t_arr}}" wx:key="index"> | 42 | <view class="info_box" wx:for="{{t_arr}}" wx:key="index"> |
43 | - <view class="tilte">选择日期</view> | 43 | + <view class="tilte">选择日期 |
44 | + <image class="del" src="/imgs/del.png" wx:if="{{t_arr.length>1 && index == t_arr.length-1}}" data-index="{{index}}" data-status="1" catchtap="del"/> | ||
45 | + </view> | ||
44 | <view class="item"> | 46 | <view class="item"> |
45 | <view class="left"> | 47 | <view class="left"> |
46 | <image src="/imgs/must.png" /> 参加日期 | 48 | <image src="/imgs/must.png" /> 参加日期 |
@@ -67,8 +69,9 @@ | @@ -67,8 +69,9 @@ | ||
67 | </view> | 69 | </view> |
68 | 70 | ||
69 | <view class="info_box" wx:for="{{z_arr}}" wx:key="index"> | 71 | <view class="info_box" wx:for="{{z_arr}}" wx:key="index"> |
70 | - <view class="tilte">申请入住 | ||
71 | - <text>*仅限工作人员本人</text> | 72 | + <view class="tilte"> |
73 | + <view> 申请入住<text>*仅限工作人员本人</text></view> | ||
74 | + <image class="del" src="/imgs/del.png" wx:if="{{z_arr.length>1 && index == z_arr.length-1}}" data-index="{{index}}" data-status="2" catchtap="del"/> | ||
72 | </view> | 75 | </view> |
73 | <view class="item"> | 76 | <view class="item"> |
74 | <view class="left"> | 77 | <view class="left"> |
@@ -89,7 +92,9 @@ | @@ -89,7 +92,9 @@ | ||
89 | </view> | 92 | </view> |
90 | 93 | ||
91 | <view class="info_box" wx:for="{{e_arr}}" wx:key="index"> | 94 | <view class="info_box" wx:for="{{e_arr}}" wx:key="index"> |
92 | - <view class="tilte">申请用餐</view> | 95 | + <view class="tilte">申请用餐 |
96 | + <image class="del" src="/imgs/del.png" wx:if="{{e_arr.length>1 && index == e_arr.length-1}}" data-index="{{index}}" data-status="3" catchtap="del"/> | ||
97 | + </view> | ||
93 | <view class="item"> | 98 | <view class="item"> |
94 | <view class="left"> | 99 | <view class="left"> |
95 | <image src="/imgs/must.png" /> 用餐日期 | 100 | <image src="/imgs/must.png" /> 用餐日期 |
@@ -128,10 +133,10 @@ | @@ -128,10 +133,10 @@ | ||
128 | </view> | 133 | </view> |
129 | <view class="line" wx:if="{{!status}}"/> | 134 | <view class="line" wx:if="{{!status}}"/> |
130 | 135 | ||
131 | -<view class="cover_box" catchtouchmove="true" wx:if="{{cover_type}}"> | 136 | +<view class="cover_box" catchtouchmove="true" wx:if="{{cover_type}}" style=" bottom: {{input_bottom}}px;"> |
132 | <view class="show_box"> | 137 | <view class="show_box"> |
133 | <view class="s_title">请输入工时</view> | 138 | <view class="s_title">请输入工时</view> |
134 | - <input placeholder="请输入..." class="word_area active" value="{{word}}" bindinput="get_word" type="number" /> | 139 | + <input placeholder="请输入..." class="word_area active" value="{{word}}" bindinput="get_word" type="number" adjust-position='{{false}}' bindfocus="focus" bindblur='no_focus'/> |
135 | <view class="submit" catchtap="add_time">确认</view> | 140 | <view class="submit" catchtap="add_time">确认</view> |
136 | <image src="/imgs/close.png" class="close" catchtap="change_cover" /> | 141 | <image src="/imgs/close.png" class="close" catchtap="change_cover" /> |
137 | </view> | 142 | </view> |
@@ -75,8 +75,14 @@ page { | @@ -75,8 +75,14 @@ page { | ||
75 | font-weight: bold; | 75 | font-weight: bold; |
76 | color: rgba(51, 51, 51, 1); | 76 | color: rgba(51, 51, 51, 1); |
77 | margin-top: 50rpx; | 77 | margin-top: 50rpx; |
78 | + display: flex; | ||
79 | + align-items: center; | ||
80 | + justify-content: space-between; | ||
81 | +} | ||
82 | +.tilte .del{ | ||
83 | + width: 40rpx; | ||
84 | + height: 40rpx; | ||
78 | } | 85 | } |
79 | - | ||
80 | .tilte text { | 86 | .tilte text { |
81 | font-size: 24rpx; | 87 | font-size: 24rpx; |
82 | font-family: PingFang SC; | 88 | font-family: PingFang SC; |
@@ -117,11 +123,11 @@ page { | @@ -117,11 +123,11 @@ page { | ||
117 | height: 100%; | 123 | height: 100%; |
118 | position: fixed; | 124 | position: fixed; |
119 | left: 0; | 125 | left: 0; |
120 | - top: 0; | ||
121 | display: flex; | 126 | display: flex; |
122 | justify-content: center; | 127 | justify-content: center; |
123 | align-items: center; | 128 | align-items: center; |
124 | background: rgba(0, 0, 0, 0.3); | 129 | background: rgba(0, 0, 0, 0.3); |
130 | + z-index: 3; | ||
125 | } | 131 | } |
126 | 132 | ||
127 | .show_box { | 133 | .show_box { |
@@ -156,7 +162,7 @@ page { | @@ -156,7 +162,7 @@ page { | ||
156 | } | 162 | } |
157 | 163 | ||
158 | .show_box .active { | 164 | .show_box .active { |
159 | - height: 85rpx !important; | 165 | + height: auto !important; |
160 | } | 166 | } |
161 | 167 | ||
162 | .show_box .submit { | 168 | .show_box .submit { |
@@ -176,7 +176,7 @@ Page({ | @@ -176,7 +176,7 @@ Page({ | ||
176 | 176 | ||
177 | //判断是否登陆 | 177 | //判断是否登陆 |
178 | get_token() { | 178 | get_token() { |
179 | - let that = this; | 179 | + let that = this |
180 | wx.login({ | 180 | wx.login({ |
181 | success: function (s) { | 181 | success: function (s) { |
182 | let url = 'wxapp/public/getSessionKey'; | 182 | let url = 'wxapp/public/getSessionKey'; |
@@ -195,8 +195,8 @@ Page({ | @@ -195,8 +195,8 @@ Page({ | ||
195 | wx.setStorageSync('token', res.data) | 195 | wx.setStorageSync('token', res.data) |
196 | that.getdatalist() | 196 | that.getdatalist() |
197 | } else { | 197 | } else { |
198 | - wx.redirectTo({ | ||
199 | - url: '/pages/start/start' | 198 | + wx.navigateTo({ |
199 | + url: '/pages/start/start', | ||
200 | }) | 200 | }) |
201 | } | 201 | } |
202 | }).catch((err) => { | 202 | }).catch((err) => { |
@@ -222,10 +222,12 @@ Page({ | @@ -222,10 +222,12 @@ Page({ | ||
222 | status: 1, | 222 | status: 1, |
223 | id: options.scene | 223 | id: options.scene |
224 | }) | 224 | }) |
225 | - if (wx.getStorageSync('token')) { | ||
226 | - that.getdatalist() | 225 | + if (wx.getStorageSync('token')){ |
226 | + that.getdatalist(); | ||
227 | } else { | 227 | } else { |
228 | - that.get_token() | 228 | + wx.reLaunch({ |
229 | + url: '/pages/start/start?id=' + options.scene + '&type=1', | ||
230 | + }) | ||
229 | } | 231 | } |
230 | } else { | 232 | } else { |
231 | if (options.type == 1) { | 233 | if (options.type == 1) { |
@@ -28,10 +28,12 @@ | @@ -28,10 +28,12 @@ | ||
28 | <navigator url='/pages/result/result' class='foot' wx:if='{{datalist.button_status == 6}}' hover-class="none">成为志愿者</navigator> | 28 | <navigator url='/pages/result/result' class='foot' wx:if='{{datalist.button_status == 6}}' hover-class="none">成为志愿者</navigator> |
29 | 29 | ||
30 | </view> | 30 | </view> |
31 | -<view class="btn_box"> | 31 | +<view class="btn_box" wx:if="{{status == 1}}"> |
32 | <navigator class="btn-item" style="background: url('https://volunteer.cnpu.org/static/images/index.png') no-repeat center;background-size: cover;" url="/pages/index/index" open-type="switchTab">首页</navigator> | 32 | <navigator class="btn-item" style="background: url('https://volunteer.cnpu.org/static/images/index.png') no-repeat center;background-size: cover;" url="/pages/index/index" open-type="switchTab">首页</navigator> |
33 | - <view class="btn-item" style="background: url('{{datalist.button_status == 2?'/imgs/edit.png':'https://volunteer.cnpu.org/static/images/edit@.png'}}') no-repeat center;background-size: cover;" bindtap="{{datalist.button_status == 2?'edit_info':''}}" wx:if="{{1< datalist.button_status && datalist.button_status<6 && datalist.admin !=1}}">编辑</view> | ||
34 | - <view class="btn-item" style="background: url('{{datalist.button_status == 5?'https://volunteer.cnpu.org/static/images/out@.png':'https://volunteer.cnpu.org/static/images/out.png'}}') no-repeat center;background-size: cover;" wx:if="{{2<datalist.button_status && datalist.button_status<6 && datalist.admin !=1}}" bindtap="change_cover" data-id="1">退出</view> | 33 | + <view class="btn-item" style="background: url('{{datalist.button_status == 2?'https://volunteer.cnpu.org/static/images/edit.png':'https://volunteer.cnpu.org/static/images/edit@.png'}}') no-repeat center;background-size: cover;" bindtap="{{datalist.button_status == 2?'edit_info':''}}" |
34 | + wx:if="{{1< datalist.button_status && datalist.button_status<6 && datalist.admin !=1}}">编辑</view> | ||
35 | + <view class="btn-item" style="background: url('{{datalist.button_status == 5 || datalist.button_status == 4?'https://volunteer.cnpu.org/static/images/out@.png':'https://volunteer.cnpu.org/static/images/out.png'}}') no-repeat center;background-size: cover;" | ||
36 | + wx:if="{{2<datalist.button_status && datalist.button_status<6 && datalist.admin !=1}}" bindtap="{{datalist.button_status == 5 || datalist.button_status == 4 ?'':'change_cover'}}" data-id="1">退出</view> | ||
35 | <view class="btn-item" style="background: url('https://volunteer.cnpu.org/static/images/share.png') no-repeat center;background-size: cover;" bindtap="change_cover" data-id="2">分享</view> | 37 | <view class="btn-item" style="background: url('https://volunteer.cnpu.org/static/images/share.png') no-repeat center;background-size: cover;" bindtap="change_cover" data-id="2">分享</view> |
36 | </view> | 38 | </view> |
37 | 39 | ||
@@ -54,11 +56,10 @@ | @@ -54,11 +56,10 @@ | ||
54 | <view class="c_item" wx:for="{{join_info}}" wx:key="index"> | 56 | <view class="c_item" wx:for="{{join_info}}" wx:key="index"> |
55 | <view class="c_title">{{item.title}}</view> | 57 | <view class="c_title">{{item.title}}</view> |
56 | <view class="c_box"> | 58 | <view class="c_box"> |
57 | - <view class="i_info {{item.arr.length>3 && zindex<item.arr.length-1?'line':''}}" wx:for="{{item.arr}}" wx:for-item="zitem" wx:for-index="zindex" wx:key="zindex" data-status="{{zitem.status}}" data-user_id="{{zitem.id}}" bindtap="look_more"> | 59 | + <view class="i_info {{item.arr.length>3 && zindex<item.arr.length-1?'line':''}}" wx:for="{{item.arr}}" wx:for-item="zitem" wx:for-index="zindex" wx:key="zindex" data-status="{{zitem.status}}" data-user_id="{{zitem.user_id}}" bindtap="look_more"> |
58 | <image src="{{zitem.photo}}" mode="aspectFill" /> | 60 | <image src="{{zitem.photo}}" mode="aspectFill" /> |
59 | <view class="name">{{zitem.name}}</view> | 61 | <view class="name">{{zitem.name}}</view> |
60 | - <view class="status {{zitem.status>1?(zitem.status == 2?'bgb':'bga'):'bgc'}}">{{zitem.status>1?(zitem.status == 2?'未通过':'已通过'):'待审核'}}</view> | 62 | + <view class="status {{zitem.status>1?(zitem.status == 2?'bgb':'bga'):'bgc'}}">{{zitem.status>0?(zitem.status == 2?'未通过':'已通过'):'待审核'}}</view> |
61 | </view> | 63 | </view> |
62 | </view> | 64 | </view> |
63 | -</view> | ||
64 | - | 65 | +</view> |
1 | page { | 1 | page { |
2 | padding-bottom: 110rpx; | 2 | padding-bottom: 110rpx; |
3 | + box-sizing: border-box; | ||
3 | } | 4 | } |
4 | 5 | ||
5 | .main { | 6 | .main { |
@@ -23,6 +24,7 @@ page { | @@ -23,6 +24,7 @@ page { | ||
23 | font-size: 32rpx; | 24 | font-size: 32rpx; |
24 | font-weight: bold; | 25 | font-weight: bold; |
25 | padding: 24rpx 0 10rpx 0; | 26 | padding: 24rpx 0 10rpx 0; |
27 | + box-sizing: border-box; | ||
26 | } | 28 | } |
27 | 29 | ||
28 | .text_content { | 30 | .text_content { |
1 | // pages/start/start.js | 1 | // pages/start/start.js |
2 | -const app=getApp(); | 2 | +const app = getApp(); |
3 | Page({ | 3 | Page({ |
4 | 4 | ||
5 | - /** | ||
6 | - * 页面的初始数据 | ||
7 | - */ | ||
8 | - data: { | ||
9 | - | ||
10 | - }, | ||
11 | - start(e){ | ||
12 | - let that = this; | ||
13 | - app.globalData.userInfo = e.detail.userInfo; | ||
14 | - // wx.switchTab({ | ||
15 | - // url: '/pages/index/index' | ||
16 | - // }) | ||
17 | - wx.login({ | ||
18 | - success: function (s) { | ||
19 | - let url = 'wxapp/public/getSessionKey'; | ||
20 | - if (s.code) { | ||
21 | - var code = s.code; | ||
22 | - var param = { | ||
23 | - code: code | ||
24 | - } | ||
25 | - app.post(url, param).then((res) => { | ||
26 | - that.login(res.openid, res.session_key, e.detail.encryptedData, e.detail.iv); | ||
27 | - }).catch((errMsg) => { | ||
28 | - | ||
29 | - }) | 5 | + /** |
6 | + * 页面的初始数据 | ||
7 | + */ | ||
8 | + data: { | ||
9 | + | ||
10 | + }, | ||
11 | + start(e) { | ||
12 | + let that = this; | ||
13 | + app.globalData.userInfo = e.detail.userInfo; | ||
14 | + // wx.switchTab({ | ||
15 | + // url: '/pages/index/index' | ||
16 | + // }) | ||
17 | + wx.login({ | ||
18 | + success: function(s) { | ||
19 | + let url = 'wxapp/public/getSessionKey'; | ||
20 | + if (s.code) { | ||
21 | + var code = s.code; | ||
22 | + var param = { | ||
23 | + code: code | ||
24 | + } | ||
25 | + app.post(url, param).then((res) => { | ||
26 | + that.login(res.openid, res.session_key, e.detail.encryptedData, e.detail.iv); | ||
27 | + }).catch((errMsg) => { | ||
28 | + | ||
29 | + }) | ||
30 | + } | ||
31 | + } | ||
32 | + }); | ||
33 | + }, | ||
34 | + login(openid, session_key, encrypted_data, iv) { | ||
35 | + let that = this; | ||
36 | + let param = { | ||
37 | + openid: openid, | ||
38 | + session_key: session_key, | ||
39 | + encrypted_data: encrypted_data, | ||
40 | + iv: iv | ||
30 | } | 41 | } |
31 | - } | ||
32 | - }); | ||
33 | - }, | ||
34 | - login(openid, session_key, encrypted_data, iv) { | ||
35 | - let that = this; | ||
36 | - let param = { | ||
37 | - openid: openid, | ||
38 | - session_key: session_key, | ||
39 | - encrypted_data: encrypted_data, | ||
40 | - iv: iv | ||
41 | - } | ||
42 | - let url = 'wxapp/public/login'; | ||
43 | - app.post(url, param).then((res) => { | ||
44 | - wx.setStorageSync('token', res.token); | ||
45 | - wx.switchTab({ | ||
46 | - url: '/pages/index/index', | ||
47 | - }) | ||
48 | - }).catch((errMsg) => { | ||
49 | - | ||
50 | - }) | ||
51 | - }, | ||
52 | - | ||
53 | - /** | ||
54 | - * 生命周期函数--监听页面加载 | ||
55 | - */ | ||
56 | - onLoad: function (options) { | ||
57 | - | ||
58 | - }, | 42 | + let url = 'wxapp/public/login'; |
43 | + app.post(url, param).then((res) => { | ||
44 | + wx.setStorageSync('token', res.token); | ||
45 | + if(that.data.type){ | ||
46 | + wx.reLaunch({ | ||
47 | + url: "/pages/img_txt/img_txt?id=" + this.data.id + '&status=1', | ||
48 | + }) | ||
49 | + } else { | ||
50 | + wx.switchTab({ | ||
51 | + url: '/pages/index/index', | ||
52 | + }) | ||
53 | + } | ||
54 | + | ||
55 | + }).catch((errMsg) => { | ||
56 | + | ||
57 | + }) | ||
58 | + }, | ||
59 | + | ||
60 | + /** | ||
61 | + * 生命周期函数--监听页面加载 | ||
62 | + */ | ||
63 | + onLoad: function(options) { | ||
64 | + if (options.type){ | ||
65 | + this.setData({ | ||
66 | + type: true, | ||
67 | + id: options.id | ||
68 | + }) | ||
69 | + } | ||
70 | + }, | ||
59 | 71 | ||
60 | - /** | ||
61 | - * 生命周期函数--监听页面初次渲染完成 | ||
62 | - */ | ||
63 | - onReady: function () { | 72 | + /** |
73 | + * 生命周期函数--监听页面初次渲染完成 | ||
74 | + */ | ||
75 | + onReady: function() { | ||
64 | 76 | ||
65 | - }, | 77 | + }, |
66 | 78 | ||
67 | - /** | ||
68 | - * 生命周期函数--监听页面显示 | ||
69 | - */ | ||
70 | - onShow: function () { | 79 | + /** |
80 | + * 生命周期函数--监听页面显示 | ||
81 | + */ | ||
82 | + onShow: function() { | ||
71 | 83 | ||
72 | - }, | 84 | + }, |
73 | 85 | ||
74 | - /** | ||
75 | - * 生命周期函数--监听页面隐藏 | ||
76 | - */ | ||
77 | - onHide: function () { | 86 | + /** |
87 | + * 生命周期函数--监听页面隐藏 | ||
88 | + */ | ||
89 | + onHide: function() { | ||
78 | 90 | ||
79 | - }, | 91 | + }, |
80 | 92 | ||
81 | - /** | ||
82 | - * 生命周期函数--监听页面卸载 | ||
83 | - */ | ||
84 | - onUnload: function () { | 93 | + /** |
94 | + * 生命周期函数--监听页面卸载 | ||
95 | + */ | ||
96 | + onUnload: function() { | ||
85 | 97 | ||
86 | - }, | 98 | + }, |
87 | 99 | ||
88 | - /** | ||
89 | - * 页面相关事件处理函数--监听用户下拉动作 | ||
90 | - */ | ||
91 | - onPullDownRefresh: function () { | 100 | + /** |
101 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
102 | + */ | ||
103 | + onPullDownRefresh: function() { | ||
92 | 104 | ||
93 | - }, | 105 | + }, |
94 | 106 | ||
95 | - /** | ||
96 | - * 页面上拉触底事件的处理函数 | ||
97 | - */ | ||
98 | - onReachBottom: function () { | 107 | + /** |
108 | + * 页面上拉触底事件的处理函数 | ||
109 | + */ | ||
110 | + onReachBottom: function() { | ||
99 | 111 | ||
100 | - }, | 112 | + }, |
101 | 113 | ||
102 | - /** | ||
103 | - * 用户点击右上角分享 | ||
104 | - */ | ||
105 | - onShareAppMessage: function () { | 114 | + /** |
115 | + * 用户点击右上角分享 | ||
116 | + */ | ||
117 | + onShareAppMessage: function() { | ||
106 | 118 | ||
107 | - } | 119 | + } |
108 | }) | 120 | }) |
@@ -5,47 +5,56 @@ Page({ | @@ -5,47 +5,56 @@ Page({ | ||
5 | * 页面的初始数据 | 5 | * 页面的初始数据 |
6 | */ | 6 | */ |
7 | data: { | 7 | data: { |
8 | + imgarr: [], | ||
9 | + myimgurl:[] | ||
8 | }, | 10 | }, |
9 | //图片添加 | 11 | //图片添加 |
10 | upimg: function () { | 12 | upimg: function () { |
11 | let that = this | 13 | let that = this |
12 | - let imgarr = [], myimgurl = [] | 14 | + let myimgurl = that.data.myimgurl |
15 | + let imgarr = that.data.imgarr | ||
16 | + if (imgarr.length >= 6) { | ||
17 | + wx.showToast({ | ||
18 | + title: '最多添加6张图片', | ||
19 | + icon: 'none', | ||
20 | + duration: 1000 | ||
21 | + }) | ||
22 | + return | ||
23 | + } | ||
13 | wx.chooseImage({ | 24 | wx.chooseImage({ |
14 | - count: 5, | 25 | + count: 1, |
15 | sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 | 26 | sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 |
16 | sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 | 27 | sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 |
17 | success: function (res) { | 28 | success: function (res) { |
18 | - imgarr = res.tempFilePaths | 29 | + imgarr.push(res.tempFilePaths[0]) |
19 | that.setData({ | 30 | that.setData({ |
20 | - imgarr: res.tempFilePaths | 31 | + imgarr: imgarr |
21 | }) | 32 | }) |
22 | let header = { | 33 | let header = { |
23 | 'XX-Token': wx.getStorageSync('token'), | 34 | 'XX-Token': wx.getStorageSync('token'), |
24 | 'XX-Device-Type': '' | 35 | 'XX-Device-Type': '' |
25 | } | 36 | } |
26 | - for (let i = 0; i < res.tempFilePaths.length; i++) { | ||
27 | - wx.uploadFile({ | ||
28 | - url: "https://volunteer.cnpu.org/api/user/upload/one", //上传图片接口 | ||
29 | - filePath: imgarr[i], | ||
30 | - name: 'file', | ||
31 | - header: header, | ||
32 | - formData: { | ||
33 | - filetype: 'image', | ||
34 | - app: 'material' | ||
35 | - }, | ||
36 | - success: function (res) { | ||
37 | - if (JSON.parse(res.data).code == 20000) { | ||
38 | - myimgurl.push(JSON.parse(res.data).data.url) | ||
39 | - that.setData({ | ||
40 | - myimgurl: myimgurl | ||
41 | - }) | ||
42 | - } | ||
43 | - }, | ||
44 | - fail: function (red) { | ||
45 | - | 37 | + wx.uploadFile({ |
38 | + url: "https://volunteer.cnpu.org/api/user/upload/one", //上传图片接口 | ||
39 | + filePath: res.tempFilePaths[0], | ||
40 | + name: 'file', | ||
41 | + header: header, | ||
42 | + formData: { | ||
43 | + filetype: 'image', | ||
44 | + app: 'material' | ||
45 | + }, | ||
46 | + success: function (res) { | ||
47 | + if (JSON.parse(res.data).code == 20000) { | ||
48 | + myimgurl.push(JSON.parse(res.data).data.url) | ||
49 | + that.setData({ | ||
50 | + myimgurl: myimgurl | ||
51 | + }) | ||
46 | } | 52 | } |
47 | - }) | ||
48 | - } | 53 | + }, |
54 | + fail: function (red) { | ||
55 | + | ||
56 | + } | ||
57 | + }) | ||
49 | }, | 58 | }, |
50 | }) | 59 | }) |
51 | }, | 60 | }, |
-
请 注册 或 登录 后发表评论