合并分支 'volun' 到 'master'
Volun 查看合并请求 !1
正在显示
100 个修改的文件
包含
2336 行增加
和
124 行删除
1 | //app.js | 1 | //app.js |
2 | App({ | 2 | App({ |
3 | - onLaunch: function() { | 3 | + onLaunch: function () { |
4 | //自动更新版本 | 4 | //自动更新版本 |
5 | const updateManager = wx.getUpdateManager() | 5 | const updateManager = wx.getUpdateManager() |
6 | - updateManager.onCheckForUpdate(function(res) { | 6 | + updateManager.onCheckForUpdate(function (res) { |
7 | // 请求完新版本信息的回调 | 7 | // 请求完新版本信息的回调 |
8 | }) | 8 | }) |
9 | 9 | ||
10 | - updateManager.onUpdateReady(function() { | 10 | + updateManager.onUpdateReady(function () { |
11 | wx.showModal({ | 11 | wx.showModal({ |
12 | title: '更新提示', | 12 | title: '更新提示', |
13 | content: '新版本已经准备好,是否重启应用?', | 13 | content: '新版本已经准备好,是否重启应用?', |
14 | - success: function(res) { | 14 | + success: function (res) { |
15 | if (res.confirm) { | 15 | if (res.confirm) { |
16 | // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 | 16 | // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 |
17 | updateManager.applyUpdate() | 17 | updateManager.applyUpdate() |
@@ -21,7 +21,7 @@ App({ | @@ -21,7 +21,7 @@ App({ | ||
21 | 21 | ||
22 | }) | 22 | }) |
23 | 23 | ||
24 | - updateManager.onUpdateFailed(function() { | 24 | + updateManager.onUpdateFailed(function () { |
25 | // 新的版本下载失败 | 25 | // 新的版本下载失败 |
26 | wx.showModal({ | 26 | wx.showModal({ |
27 | title: '更新提示', | 27 | title: '更新提示', |
@@ -31,7 +31,7 @@ App({ | @@ -31,7 +31,7 @@ App({ | ||
31 | }) | 31 | }) |
32 | }, | 32 | }, |
33 | 33 | ||
34 | - post: function(url, data, headerParams) { | 34 | + post: function (url, data, headerParams) { |
35 | wx.showNavigationBarLoading() | 35 | wx.showNavigationBarLoading() |
36 | wx.showLoading({ | 36 | wx.showLoading({ |
37 | title: '加载中', | 37 | title: '加载中', |
@@ -40,7 +40,8 @@ App({ | @@ -40,7 +40,8 @@ App({ | ||
40 | var promise = new Promise((resolve, reject) => { | 40 | var promise = new Promise((resolve, reject) => { |
41 | let that = this; | 41 | let that = this; |
42 | let postData = data; | 42 | let postData = data; |
43 | - let baseUrl = 'https://volunteer.cnpu.org/api/'; | 43 | + let baseUrl = 'http://volunteer.w.bronet.cn/api/'; |
44 | + // let baseUrl = 'https://volunteer.cnpu.org/api/'; | ||
44 | //网络请求 | 45 | //网络请求 |
45 | let header = { | 46 | let header = { |
46 | 'content-type': 'application/x-www-form-urlencoded' | 47 | 'content-type': 'application/x-www-form-urlencoded' |
@@ -51,29 +52,45 @@ App({ | @@ -51,29 +52,45 @@ App({ | ||
51 | data: postData, | 52 | data: postData, |
52 | method: 'POST', | 53 | method: 'POST', |
53 | header: header, | 54 | header: header, |
54 | - success: function(res) { //返回取得的数据 | 55 | + success: function (res) { //返回取得的数据 |
55 | if (res.data.code == '20000') { | 56 | if (res.data.code == '20000') { |
56 | resolve(res.data.data); | 57 | resolve(res.data.data); |
57 | } else if (res.data.code == '10001') { //用户未登录 | 58 | } else if (res.data.code == '10001') { //用户未登录 |
59 | + | ||
58 | wx.reLaunch({ | 60 | wx.reLaunch({ |
59 | url: "/pages/start/start" | 61 | url: "/pages/start/start" |
60 | }) | 62 | }) |
61 | 63 | ||
62 | } else if (res.data.code == '40000') { | 64 | } else if (res.data.code == '40000') { |
63 | - wx.showModal({ | ||
64 | - title: '提示', | ||
65 | - content: res.data.msg, | ||
66 | - showCancel: false, | ||
67 | - success: function(res) { | ||
68 | 65 | ||
69 | - } | ||
70 | - }) | 66 | + if (url == '/index/second/checkTranStatus') { |
67 | + wx.showModal({ | ||
68 | + title: '提示', | ||
69 | + content: '请先申请成为志愿者', | ||
70 | + showCancel: false, | ||
71 | + }) | ||
72 | + | ||
73 | + } else | ||
74 | + | ||
75 | + if (url == '/index/second/commitAnswer') { | ||
76 | + resolve(res.data); | ||
77 | + } else { | ||
78 | + wx.showModal({ | ||
79 | + title: '提示', | ||
80 | + content: res.data.msg, | ||
81 | + showCancel: false, | ||
82 | + success: function (res) { | ||
83 | + | ||
84 | + } | ||
85 | + }) | ||
86 | + } | ||
87 | + | ||
71 | } else if (res.data.code == '40005') { | 88 | } else if (res.data.code == '40005') { |
72 | wx.showModal({ | 89 | wx.showModal({ |
73 | title: '提示', | 90 | title: '提示', |
74 | content: res.data.msg, | 91 | content: res.data.msg, |
75 | showCancel: false, | 92 | showCancel: false, |
76 | - success: function(res) { | 93 | + success: function (res) { |
77 | if (res.confirm) { | 94 | if (res.confirm) { |
78 | wx.reLaunch({ | 95 | wx.reLaunch({ |
79 | url: '/pages/start/start' | 96 | url: '/pages/start/start' |
@@ -96,7 +113,7 @@ App({ | @@ -96,7 +113,7 @@ App({ | ||
96 | wx.hideLoading() | 113 | wx.hideLoading() |
97 | wx.hideNavigationBarLoading() | 114 | wx.hideNavigationBarLoading() |
98 | }, | 115 | }, |
99 | - fail: function(e) { | 116 | + fail: function (e) { |
100 | reject('网络出错'); | 117 | reject('网络出错'); |
101 | // wx.hideLoading() | 118 | // wx.hideLoading() |
102 | wx.hideNavigationBarLoading() | 119 | wx.hideNavigationBarLoading() |
@@ -3,7 +3,9 @@ | @@ -3,7 +3,9 @@ | ||
3 | "pages/start/start", | 3 | "pages/start/start", |
4 | "pages/index/index", | 4 | "pages/index/index", |
5 | "pages/my/my", | 5 | "pages/my/my", |
6 | + "pages/mydetail/mydetail", | ||
6 | "pages/more/more", | 7 | "pages/more/more", |
8 | + "pages/more_other/more_other", | ||
7 | "pages/admin/admin", | 9 | "pages/admin/admin", |
8 | "pages/apply/apply", | 10 | "pages/apply/apply", |
9 | "pages/img_txt/img_txt", | 11 | "pages/img_txt/img_txt", |
@@ -12,26 +14,60 @@ | @@ -12,26 +14,60 @@ | ||
12 | "pages/my/my_active/my_active", | 14 | "pages/my/my_active/my_active", |
13 | "pages/index/active/active", | 15 | "pages/index/active/active", |
14 | "pages/word_report/word_report", | 16 | "pages/word_report/word_report", |
15 | - "pages/enroll/enroll" | 17 | + "pages/enroll/enroll", |
18 | + | ||
19 | + | ||
20 | + "pages/Volunteer_dynamic/Volunteer_dynamic", | ||
21 | + "pages/getNewsInfo/getNewsInfo", | ||
22 | + "pages/Volunteer_group/Volunteer_group", | ||
23 | + "pages/Volunteer_group/active/active", | ||
24 | + "pages/Volunteer_detail/Volunteer_detail", | ||
25 | + "pages/Online_regulations/Online_regulations", | ||
26 | + "pages/getStudycontent/getStudycontent", | ||
27 | + "pages/getStudycontent/answer/answer", | ||
28 | + "pages/guanlitiaoli/guanlitiaoli", | ||
29 | + "pages/guangrongpaihang/guangrongpaihang", | ||
30 | + | ||
31 | + | ||
32 | + "pages/myactivity/myactivity", | ||
33 | + "pages/myactivity/myactivity_active/myactivity_active", | ||
34 | + "pages/myactivity/myactivity_report/myactivity_report", | ||
35 | + "pages/myteam/myteam", | ||
36 | + "pages/mytrain/mytrain", | ||
37 | + "pages/myfeedback/myfeedback", | ||
38 | + "pages/myfeedback/myfeedback_active/myfeedback_active", | ||
39 | + "pages/myfeedback/myfeedback_duihuan/myfeedback_duihuan", | ||
40 | + "pages/myfeedback/myfeedback_list/myfeedback_list", | ||
41 | + "pages/myfeedback_lists/myfeedback_lists", | ||
42 | + "pages/mycertificate/mycertificate", | ||
43 | + "pages/myaddress/myaddress", | ||
44 | + "pages/myaddcompile/myaddcompile" | ||
45 | + | ||
46 | + | ||
16 | ], | 47 | ], |
48 | + | ||
49 | + "permission": { | ||
50 | + "scope.userLocation": { | ||
51 | + "desc": "你的位置信息将用于小程序位置接口的效果展示" | ||
52 | + } | ||
53 | + }, | ||
17 | "window": { | 54 | "window": { |
18 | "backgroundTextStyle": "light", | 55 | "backgroundTextStyle": "light", |
19 | "navigationBarBackgroundColor": "#21AE59", | 56 | "navigationBarBackgroundColor": "#21AE59", |
20 | - "navigationBarTitleText": "志愿者小程序", | 57 | + "navigationBarTitleText": "白求恩志愿者中心", |
21 | "navigationBarTextStyle": "white" | 58 | "navigationBarTextStyle": "white" |
22 | }, | 59 | }, |
23 | "tabBar": { | 60 | "tabBar": { |
24 | - "color": "#fff", | ||
25 | - "selectedColor": "#fff", | ||
26 | - "backgroundColor": "#EBEBEB", | ||
27 | - "list": [ | ||
28 | - { | 61 | + "color":"#999999", |
62 | + "list": [{ | ||
29 | "pagePath": "pages/index/index", | 63 | "pagePath": "pages/index/index", |
64 | + "text": "首页", | ||
30 | "iconPath": "imgs/shouye_02@2x.png", | 65 | "iconPath": "imgs/shouye_02@2x.png", |
31 | "selectedIconPath": "imgs/shouye_01@2x.png" | 66 | "selectedIconPath": "imgs/shouye_01@2x.png" |
32 | }, | 67 | }, |
33 | { | 68 | { |
34 | "pagePath": "pages/my/my", | 69 | "pagePath": "pages/my/my", |
70 | + "text": "个人中心", | ||
35 | "iconPath": "imgs/wode_01@2x.png", | 71 | "iconPath": "imgs/wode_01@2x.png", |
36 | "selectedIconPath": "imgs/wode_02@2x.png" | 72 | "selectedIconPath": "imgs/wode_02@2x.png" |
37 | } | 73 | } |
@@ -89,3 +89,34 @@ | @@ -89,3 +89,34 @@ | ||
89 | .icon-chakanshenqing:before { | 89 | .icon-chakanshenqing:before { |
90 | content: "\e6a6"; | 90 | content: "\e6a6"; |
91 | } | 91 | } |
92 | +.display { | ||
93 | + display: flex; | ||
94 | +} | ||
95 | +.display1 { | ||
96 | + display: flex; | ||
97 | + justify-content: space-between; | ||
98 | + flex-wrap: wrap; | ||
99 | + | ||
100 | +} | ||
101 | +.display2 { | ||
102 | + display: flex; | ||
103 | + align-items: center; | ||
104 | +} | ||
105 | + | ||
106 | +.display3 { | ||
107 | + display: flex; | ||
108 | + align-items: center; | ||
109 | + justify-content: center; | ||
110 | +} | ||
111 | + | ||
112 | +.displayB { | ||
113 | + display: flex; | ||
114 | + align-items: center; | ||
115 | + justify-content: space-between; | ||
116 | +} | ||
117 | + | ||
118 | +.displayA { | ||
119 | + display: flex; | ||
120 | + align-items: center; | ||
121 | + justify-content: space-around; | ||
122 | +} |
zhiyuanzhe/imgs/ac1.png
0 → 100644
5.0 KB
zhiyuanzhe/imgs/ac10.png
0 → 100644
1.3 KB
zhiyuanzhe/imgs/ac11.png
0 → 100644
830 字节
zhiyuanzhe/imgs/ac12.png
0 → 100644
1.1 KB
zhiyuanzhe/imgs/ac13.png
0 → 100644
1.4 KB
zhiyuanzhe/imgs/ac14.png
0 → 100644
501 字节
zhiyuanzhe/imgs/ac15.png
0 → 100644
470 字节
zhiyuanzhe/imgs/ac2.png
0 → 100644
5.4 KB
zhiyuanzhe/imgs/ac3.png
0 → 100644
4.4 KB
zhiyuanzhe/imgs/ac4.png
0 → 100644
4.7 KB
zhiyuanzhe/imgs/ac5.png
0 → 100644
1.6 KB
zhiyuanzhe/imgs/ac6.png
0 → 100644
1.1 KB
zhiyuanzhe/imgs/ac7.png
0 → 100644
672 字节
zhiyuanzhe/imgs/ac8.png
0 → 100644
2.1 KB
zhiyuanzhe/imgs/ac9.png
0 → 100644
1.3 KB
zhiyuanzhe/imgs/active.png
0 → 100644
35.3 KB
zhiyuanzhe/imgs/active1.png
0 → 100644
14.9 KB
zhiyuanzhe/imgs/card.png
0 → 100644
39.8 KB
zhiyuanzhe/imgs/clock.png
0 → 100644
7.2 KB
zhiyuanzhe/imgs/compile.png
0 → 100644
592 字节
zhiyuanzhe/imgs/cuowu-3@2x.png
0 → 100644
1.3 KB
zhiyuanzhe/imgs/delete.png
0 → 100644
601 字节
zhiyuanzhe/imgs/dianzizhengjian.png
0 → 100644
29.6 KB
zhiyuanzhe/imgs/dianzizhengjian1.png
0 → 100644
41.6 KB
zhiyuanzhe/imgs/dianzizhengjian2.png
0 → 100644
10.6 KB
zhiyuanzhe/imgs/dianzizhengjian3.png
0 → 100644
11.4 KB
zhiyuanzhe/imgs/didian-14.png
0 → 100644
547 字节
zhiyuanzhe/imgs/dingdan.png
0 → 100644
1.5 KB
zhiyuanzhe/imgs/dingdan1.png
0 → 100644
1.4 KB
zhiyuanzhe/imgs/dingdanliebaio.png
0 → 100644
33.2 KB
zhiyuanzhe/imgs/dizhigreen.png
0 → 100644
1.4 KB
zhiyuanzhe/imgs/menu1.png
0 → 100644
6.4 KB
zhiyuanzhe/imgs/menu2.png
0 → 100644
6.6 KB
zhiyuanzhe/imgs/menu3.png
0 → 100644
6.2 KB
zhiyuanzhe/imgs/menu4.png
0 → 100644
6.1 KB
zhiyuanzhe/imgs/menu5.png
0 → 100644
7.1 KB
zhiyuanzhe/imgs/menu6.png
0 → 100644
6.5 KB
zhiyuanzhe/imgs/menu7.png
0 → 100644
6.4 KB
zhiyuanzhe/imgs/menu8.png
0 → 100644
6.6 KB
zhiyuanzhe/imgs/more.png
0 → 100644
189 字节
zhiyuanzhe/imgs/more1.png
0 → 100644
193 字节
zhiyuanzhe/imgs/more_blue1.png
0 → 100644
192 字节
zhiyuanzhe/imgs/more_gray.png
0 → 100644
158 字节
zhiyuanzhe/imgs/myfeedback.png
0 → 100644
36.9 KB
zhiyuanzhe/imgs/mytrain.png
0 → 100644
19.5 KB
zhiyuanzhe/imgs/shaixuan-1.png
0 → 100644
258 字节
zhiyuanzhe/imgs/shaixuan-2.png
0 → 100644
351 字节
zhiyuanzhe/imgs/shijian-19.png
0 → 100644
294 字节
zhiyuanzhe/imgs/tishi-3@2x.png
0 → 100644
919 字节
zhiyuanzhe/imgs/tishi-4@2x.png
0 → 100644
838 字节
zhiyuanzhe/imgs/tishiclear.png
0 → 100644
358 字节
zhiyuanzhe/imgs/vg_1.png
0 → 100644
372 字节
zhiyuanzhe/imgs/vg_2.png
0 → 100644
470 字节
zhiyuanzhe/imgs/vg_3.png
0 → 100644
500 字节
zhiyuanzhe/imgs/wancheng.png
0 → 100644
37.3 KB
zhiyuanzhe/imgs/wancheng1.png
0 → 100644
687 字节
zhiyuanzhe/imgs/zhengque-5@2x.png
0 → 100644
1.4 KB
zhiyuanzhe/imgs/zhiyuan1.png
0 → 100644
1.3 KB
zhiyuanzhe/imgs/zhiyuan2.png
0 → 100644
1.1 KB
zhiyuanzhe/imgs/zhiyuan3.png
0 → 100644
894 字节
zhiyuanzhe/imgs/zhiyuan4.png
0 → 100644
782 字节
1 | +const app = getApp() | ||
2 | +Page({ | ||
3 | + | ||
4 | + /** | ||
5 | + * 页面的初始数据 | ||
6 | + */ | ||
7 | + data: { | ||
8 | + | ||
9 | + }, | ||
10 | + onLoad: function (options) { | ||
11 | + | ||
12 | + }, | ||
13 | + | ||
14 | + onReady: function () { | ||
15 | + | ||
16 | + }, | ||
17 | + onShow: function () { | ||
18 | + let that = this; | ||
19 | + that.getList() | ||
20 | + }, | ||
21 | + // 列表 | ||
22 | + | ||
23 | + getList() { | ||
24 | + | ||
25 | + let that = this; | ||
26 | + let url = '/index/second/tranOnlineList'; | ||
27 | + let head = { | ||
28 | + 'XX-Token': wx.getStorageSync('token') | ||
29 | + } | ||
30 | + | ||
31 | + app.post(url, '', head).then((res) => { | ||
32 | + // console.log(res) | ||
33 | + that.setData({ | ||
34 | + list: res | ||
35 | + }) | ||
36 | + | ||
37 | + }).catch((err) => { | ||
38 | + | ||
39 | + }) | ||
40 | + }, | ||
41 | + | ||
42 | + | ||
43 | + // 前往答题 | ||
44 | + getStudycontent(e) { | ||
45 | + | ||
46 | + let that = this; | ||
47 | + let url = '/index/second/checkTranStatus'; | ||
48 | + let head = { | ||
49 | + 'XX-Token': wx.getStorageSync('token') | ||
50 | + } | ||
51 | + | ||
52 | + app.post(url, '', head).then((res) => { | ||
53 | + | ||
54 | + var id = e.currentTarget.dataset.id | ||
55 | + wx.navigateTo({ | ||
56 | + url: '/pages/getStudycontent/getStudycontent?id=' + id, | ||
57 | + }) | ||
58 | + | ||
59 | + }).catch((err) => { | ||
60 | + | ||
61 | + }) | ||
62 | + | ||
63 | + | ||
64 | + }, | ||
65 | + | ||
66 | + | ||
67 | + /** | ||
68 | + * 生命周期函数--监听页面隐藏 | ||
69 | + */ | ||
70 | + onHide: function () { | ||
71 | + | ||
72 | + }, | ||
73 | + | ||
74 | + /** | ||
75 | + * 生命周期函数--监听页面卸载 | ||
76 | + */ | ||
77 | + onUnload: function () { | ||
78 | + | ||
79 | + }, | ||
80 | + | ||
81 | + /** | ||
82 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
83 | + */ | ||
84 | + onPullDownRefresh: function () { | ||
85 | + | ||
86 | + }, | ||
87 | + | ||
88 | + /** | ||
89 | + * 页面上拉触底事件的处理函数 | ||
90 | + */ | ||
91 | + onReachBottom: function () { | ||
92 | + | ||
93 | + }, | ||
94 | + | ||
95 | + /** | ||
96 | + * 用户点击右上角分享 | ||
97 | + */ | ||
98 | + onShareAppMessage: function () { | ||
99 | + | ||
100 | + } | ||
101 | +}) |
1 | +<!--在线培训--> | ||
2 | +<view class="myanswer" bindtap="getStudycontent" wx:for="{{list.data}}" data-id="{{item.id}}"> | ||
3 | + | ||
4 | + <image src="{{item.pic}}"></image> | ||
5 | + <view class="myanswer_right"> | ||
6 | + <view class="myanswer_name"> | ||
7 | + {{item.title}} | ||
8 | + </view> | ||
9 | + | ||
10 | + <view class="myanswer_num"> | ||
11 | + <view> | ||
12 | + {{item.num}}道题 | ||
13 | + </view> | ||
14 | + <view class="myanswer_end" wx:if="{{item.user_status==0}}"> | ||
15 | + 前往答题 | ||
16 | + <image src="/imgs/more_blue1.png"></image> | ||
17 | + </view> | ||
18 | + <view class="myanswer_end green" wx:if="{{item.user_status==1}}"> | ||
19 | + 完成答题 | ||
20 | + <image src="/imgs/more1.png"></image> | ||
21 | + </view> | ||
22 | + | ||
23 | + </view> | ||
24 | + | ||
25 | + </view> | ||
26 | + | ||
27 | +</view> |
1 | +page{ | ||
2 | + | ||
3 | + background-color:rgb(240, 240, 240); | ||
4 | +} | ||
5 | +.myanswer { | ||
6 | + margin: 24rpx 32rpx; | ||
7 | + padding: 24rpx 24rpx; | ||
8 | + border-radius: 7px; | ||
9 | + background-color: #ffffff; | ||
10 | + display: flex; | ||
11 | + font-size: 28rpx; | ||
12 | + | ||
13 | + } | ||
14 | + | ||
15 | + .myanswer image { | ||
16 | + width: 182rpx; | ||
17 | + height: 138rpx; | ||
18 | + margin-right: 24rpx; | ||
19 | + border-radius: 7px; | ||
20 | + } | ||
21 | + | ||
22 | + .myanswer_right { | ||
23 | + width: 434rpx; | ||
24 | + display: flex; | ||
25 | + flex-direction: column; | ||
26 | + justify-content: space-between; | ||
27 | + } | ||
28 | + | ||
29 | + | ||
30 | + .myanswer_num { | ||
31 | + display: flex; | ||
32 | + justify-content: space-between; | ||
33 | + font-size: 28rpx; | ||
34 | + color: #7D7E80; | ||
35 | + | ||
36 | + } | ||
37 | + | ||
38 | + .myanswer_num image { | ||
39 | + width: 22rpx; | ||
40 | + height: 22rpx; | ||
41 | + } | ||
42 | + | ||
43 | + .myanswer_end { | ||
44 | + | ||
45 | + color: #54A7FB; | ||
46 | + | ||
47 | + } | ||
48 | + .green{ | ||
49 | + | ||
50 | + color:#21AE58 | ||
51 | + ; | ||
52 | + | ||
53 | + } | ||
54 | + .myanswer_end image{ | ||
55 | + | ||
56 | + margin-left: 5rpx; | ||
57 | + } |
1 | +const app = getApp(); | ||
2 | + | ||
3 | +Page({ | ||
4 | + | ||
5 | + /** | ||
6 | + * 页面的初始数据 | ||
7 | + */ | ||
8 | + data: { | ||
9 | + id:'', | ||
10 | + list:'' | ||
11 | + | ||
12 | + }, | ||
13 | + | ||
14 | + getLists() { | ||
15 | + var id = this.data.id; | ||
16 | + console.log(id) | ||
17 | + let that = this; | ||
18 | + let url = '/index/second/teamInfo'; | ||
19 | + let head = { | ||
20 | + 'XX-Token': wx.getStorageSync('token') | ||
21 | + } | ||
22 | + let d = { | ||
23 | + id: id | ||
24 | + } | ||
25 | + app.post(url,d, head).then((res) => { | ||
26 | + console.log(res) | ||
27 | + that.setData({ | ||
28 | + list: res | ||
29 | + }) | ||
30 | + | ||
31 | + }).catch((err) => { | ||
32 | + | ||
33 | + }) | ||
34 | + }, | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + getshengqin(e) { | ||
39 | + var id =e.currentTarget.dataset.id | ||
40 | + console.log(e) | ||
41 | + wx.navigateTo({ | ||
42 | + url: '/pages/Volunteer_group/active/active?id='+id, | ||
43 | + }) | ||
44 | + | ||
45 | + }, | ||
46 | + | ||
47 | + onLoad: function (options) { | ||
48 | + // console.log(options) | ||
49 | + this.setData({ | ||
50 | + id: options.id | ||
51 | + }) | ||
52 | + | ||
53 | + }, | ||
54 | + onShow: function () { | ||
55 | + let that =this; | ||
56 | + that.getLists(); | ||
57 | + }, | ||
58 | + | ||
59 | + /** | ||
60 | + * 生命周期函数--监听页面初次渲染完成 | ||
61 | + */ | ||
62 | + onReady: function () { | ||
63 | + | ||
64 | + | ||
65 | + }, | ||
66 | + | ||
67 | + | ||
68 | + /** | ||
69 | + * 生命周期函数--监听页面隐藏 | ||
70 | + */ | ||
71 | + onHide: function () { | ||
72 | + | ||
73 | + }, | ||
74 | + | ||
75 | + /** | ||
76 | + * 生命周期函数--监听页面卸载 | ||
77 | + */ | ||
78 | + onUnload: function () { | ||
79 | + | ||
80 | + }, | ||
81 | + | ||
82 | + /** | ||
83 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
84 | + */ | ||
85 | + onPullDownRefresh: function () { | ||
86 | + | ||
87 | + }, | ||
88 | + | ||
89 | + /** | ||
90 | + * 页面上拉触底事件的处理函数 | ||
91 | + */ | ||
92 | + onReachBottom: function () { | ||
93 | + | ||
94 | + }, | ||
95 | + | ||
96 | + /** | ||
97 | + * 用户点击右上角分享 | ||
98 | + */ | ||
99 | + onShareAppMessage: function () { | ||
100 | + | ||
101 | + } | ||
102 | +}) |
1 | +<view class="goods_title"> | ||
2 | + <view>{{list.name}}</view> | ||
3 | + <view class="goods_list"> | ||
4 | + <view> | ||
5 | + <image src="/imgs/vg_1.png"></image>{{list.work_total_time}}小时 | ||
6 | + </view> | ||
7 | + <view> | ||
8 | + <image src="/imgs/vg_2.png"></image>{{list.city}} | ||
9 | + </view> | ||
10 | + <view> | ||
11 | + <image src="/imgs/vg_3.png"></image>{{list.people_num}}人 | ||
12 | + </view> | ||
13 | + </view> | ||
14 | +</view> | ||
15 | +<view class="goods_introduce"> | ||
16 | + <view class="goods_line"></view> | ||
17 | + <view bindtap="getadd">详情介绍</view> | ||
18 | + <view class="goods_line"></view> | ||
19 | +</view> | ||
20 | +<rich-text nodes="{{list.content}}"></rich-text> | ||
21 | + | ||
22 | +<view class="shengqin"> | ||
23 | + <button wx:if="{{list.user_status ==0}}">未审核</button> | ||
24 | + <button style="background:#cfcfcf;box-shadow:0rpx 18rpx 38rpx 0rpx rgba(179, 179, 179, 0.42);" | ||
25 | + wx:if="{{list.user_status ==1}}">审核已通过</button> | ||
26 | + <button wx:if="{{list.user_status ==-1}}">审核不通过</button> | ||
27 | + <button wx:if="{{list.user_status ==3}}" bindtap="getshengqin" data-id="{{id}}">未申请</button> | ||
28 | +</view> |
1 | +page { | ||
2 | + background-color: rgb(240, 240, 240); | ||
3 | +} | ||
4 | + | ||
5 | +.goods_title { | ||
6 | + padding: 0 32rpx; | ||
7 | + padding-top: 32rpx; | ||
8 | + height: 164rpx; | ||
9 | + background-color: #ffffff; | ||
10 | +} | ||
11 | + | ||
12 | +.goods_list { | ||
13 | + display: flex; | ||
14 | + align-items: center; | ||
15 | + font-size: 28rpx; | ||
16 | + color: #FF976A; | ||
17 | + margin-top: 16rpx; | ||
18 | +} | ||
19 | + | ||
20 | +.goods_list image { | ||
21 | + width: 44rpx; | ||
22 | + height: 44rpx; | ||
23 | +} | ||
24 | + | ||
25 | +.goods_list>view { | ||
26 | + display: flex; | ||
27 | + align-items: center; | ||
28 | + margin-right: 42rpx; | ||
29 | +} | ||
30 | + | ||
31 | +/* */ | ||
32 | +.goods_introduce { | ||
33 | + height: 88rpx; | ||
34 | + display: flex; | ||
35 | + justify-content: center; | ||
36 | + align-items: center; | ||
37 | + font-size: 28rpx; | ||
38 | + color: #969799; | ||
39 | +} | ||
40 | + | ||
41 | +.goods_introduce :nth-child(2) { | ||
42 | + margin: 0 32rpx; | ||
43 | +} | ||
44 | + | ||
45 | +.goods_line { | ||
46 | + width: 200rpx; | ||
47 | + height: 2rpx; | ||
48 | + background-color: #d2d2d2; | ||
49 | +} | ||
50 | + | ||
51 | +.shengqin { | ||
52 | + height: 122rpx; | ||
53 | + background-color: #ffffff; | ||
54 | + font-size: 32rpx; | ||
55 | + position: fixed; | ||
56 | + left: 0; | ||
57 | + right: 0; | ||
58 | + bottom: 0; | ||
59 | + display: flex; | ||
60 | + align-items: center; | ||
61 | +} | ||
62 | + | ||
63 | +.shengqin button { | ||
64 | + width: 622rpx; | ||
65 | + height: 88rpx; | ||
66 | + color: #ffffff; | ||
67 | + border-radius: 22px; | ||
68 | + background: linear-gradient(130deg, #2ed26e 13%, #05983e 98%); | ||
69 | + box-shadow: 0px 9px 19px 0px rgba(0, 116, 45, 0.42); | ||
70 | + | ||
71 | +} | ||
72 | + | ||
73 | +.gray { | ||
74 | + width: 622rpx; | ||
75 | + height: 88rpx; | ||
76 | + border-radius: 44rpx; | ||
77 | + | ||
78 | +} |
1 | +const app = getApp(); | ||
2 | +Page({ | ||
3 | + data: { | ||
4 | + navbar: [], | ||
5 | + currentTab: 1, | ||
6 | + list: [], | ||
7 | + | ||
8 | + | ||
9 | + }, | ||
10 | + //切换navbar | ||
11 | + navbarTap: function (e) { | ||
12 | + console.log(e) | ||
13 | + this.setData({ | ||
14 | + currentTab: e.currentTarget.dataset.id | ||
15 | + }) | ||
16 | + | ||
17 | + //全局变量 | ||
18 | + // app.globalData.currentTab = e.currentTarget.dataset.id; | ||
19 | + this.getactive(); | ||
20 | + }, | ||
21 | + onShow() { | ||
22 | + // this.setData({ | ||
23 | + // currentTab: app.globalData.currentTab | ||
24 | + // }) | ||
25 | + | ||
26 | + let that = this; | ||
27 | + that.getNewsType() | ||
28 | + that.getactive(); | ||
29 | + | ||
30 | + }, | ||
31 | + | ||
32 | + onLoad: function () { | ||
33 | + | ||
34 | + }, | ||
35 | + // 志愿动态栏目类型 | ||
36 | + getNewsType() { | ||
37 | + let that = this; | ||
38 | + let url = '/index/second/getNewsType'; | ||
39 | + let head = { | ||
40 | + 'XX-Token': wx.getStorageSync('token') | ||
41 | + } | ||
42 | + app.post(url, head).then((res) => { | ||
43 | + console.log(res) | ||
44 | + that.setData({ | ||
45 | + navbar: res, | ||
46 | + | ||
47 | + }) | ||
48 | + }).catch((err) => { | ||
49 | + | ||
50 | + }) | ||
51 | + | ||
52 | + }, | ||
53 | + | ||
54 | + // 列表 | ||
55 | + getactive() { | ||
56 | + | ||
57 | + let that = this; | ||
58 | + let url = '/index/second/getNewsList'; | ||
59 | + let head = { | ||
60 | + 'XX-Token': wx.getStorageSync('token') | ||
61 | + } | ||
62 | + let params = { | ||
63 | + | ||
64 | + page: that.data.currentTab | ||
65 | + | ||
66 | + } | ||
67 | + console.log(params) | ||
68 | + app.post(url, params, head).then((res) => { | ||
69 | + // console.log(res) | ||
70 | + that.setData({ | ||
71 | + list: res | ||
72 | + }) | ||
73 | + }).catch((err) => { | ||
74 | + | ||
75 | + }) | ||
76 | + | ||
77 | + }, | ||
78 | + | ||
79 | + // 列表详情 | ||
80 | + getNewsInfo(e) { | ||
81 | + var id = e.currentTarget.dataset.id | ||
82 | + wx.navigateTo({ | ||
83 | + url: '/pages/getNewsInfo/getNewsInfo?id=' + id, | ||
84 | + }) | ||
85 | + } | ||
86 | + | ||
87 | + | ||
88 | + | ||
89 | + | ||
90 | + | ||
91 | +}) |
1 | +<!-- --> | ||
2 | +<view class="goods_index"> | ||
3 | + <!-- 导航条开始data-idx="{{index}}" --> | ||
4 | + <view class="navbar"> | ||
5 | + <view wx:for="{{navbar}}" data-id="{{item.id}}" class="item {{currentTab==item.id ? 'active' : ''}}" | ||
6 | + wx:key="unique" bindtap="navbarTap"> | ||
7 | + {{item.name}} | ||
8 | + </view> | ||
9 | + </view> | ||
10 | + <!-- 导航条结束 --> | ||
11 | + <!-- 内容 --> | ||
12 | + <!-- 活动资讯开始 --> | ||
13 | + <view class="display1" wx:if="{{currentTab==1}}" > | ||
14 | + <view class="goods_wrap" wx:for="{{list.data}}" data-id="{{item.id}}" bindtap="getNewsInfo"> | ||
15 | + <image src="{{item.thumbnail}}"></image> | ||
16 | + <view class="goods_name">{{item.activity_name}}</view> | ||
17 | + <view class="goods_time">{{item.create_time}}</view> | ||
18 | + </view> | ||
19 | + | ||
20 | + </view> | ||
21 | + <!--媒体报道 --> | ||
22 | + <view class="display1" wx:elif="{{currentTab==2}}" > | ||
23 | + <view class="goods_wrap" wx:for="{{list.data}}" data-id="{{item.id}}" bindtap="getNewsInfo"> | ||
24 | + <image src="{{item.thumbnail}}"></image> | ||
25 | + <view class="goods_name">{{item.activity_name}}</view> | ||
26 | + <view class="goods_time">{{item.create_time}}</view> | ||
27 | + </view> | ||
28 | + </view> | ||
29 | + <!--通知公告 --> | ||
30 | + <view class="display1" wx:elif="{{currentTab==3}}"> | ||
31 | + | ||
32 | + <view class="goods_wrap" wx:for="{{list.data}}" data-id="{{item.id}}" bindtap="getNewsInfo"> | ||
33 | + <image src="{{item.thumbnail}}"></image> | ||
34 | + <view class="goods_name">{{item.activity_name}}</view> | ||
35 | + <view class="goods_time">{{item.create_time}}</view> | ||
36 | + </view> | ||
37 | + | ||
38 | + </view> | ||
39 | + <!--志愿随笔 --> | ||
40 | + <view class="display1" wx:elif="{{currentTab==4}}"> | ||
41 | + <view class="goods_wrap" wx:for="{{list.data}}" data-id="{{item.id}}" bindtap="getNewsInfo"> | ||
42 | + <image src="{{item.thumbnail}}"></image> | ||
43 | + <view class="goods_name">{{item.activity_name}}</view> | ||
44 | + <view class="goods_time">{{item.create_time}}</view> | ||
45 | + </view> | ||
46 | + </view> | ||
47 | +</view> |
1 | + | ||
2 | +page{ | ||
3 | + | ||
4 | + background-color: rgb(240, 240, 240); | ||
5 | +} | ||
6 | +.goods_index { | ||
7 | + padding: 20rpx 32rpx; | ||
8 | +} | ||
9 | + | ||
10 | +/* 导航条开始 */ | ||
11 | +.navbar { | ||
12 | + /* padding : 10rpx 0; */ | ||
13 | + display: flex; | ||
14 | + justify-content: space-around; | ||
15 | + /* background : linear-gradient(136deg,#4e8fff 2%, #55c2fa); */ | ||
16 | + font-size: 30rpx; | ||
17 | + color: #969799; | ||
18 | + border-radius: 2px 0px 0px 2px; | ||
19 | + | ||
20 | +} | ||
21 | + | ||
22 | +.navbar .item { | ||
23 | + width: 346rpx; | ||
24 | + height: 64rpx; | ||
25 | + line-height: 64rpx; | ||
26 | + font-size: 24rpx; | ||
27 | + position: relative; | ||
28 | + text-align: center; | ||
29 | + /* background-color: #FFC909; */ | ||
30 | + /* border-radius : 19px; */ | ||
31 | + | ||
32 | +} | ||
33 | + | ||
34 | +.navbar .item.active { | ||
35 | + color: black; | ||
36 | + /* background: linear-gradient(136deg, #4e8fff 2%, #55c2fa); */ | ||
37 | + | ||
38 | +} | ||
39 | + | ||
40 | +.navbar .item.active:after { | ||
41 | + content: ""; | ||
42 | + display: block; | ||
43 | + position: absolute; | ||
44 | + bottom: 0; | ||
45 | + left: 0; | ||
46 | + right: 0; | ||
47 | + width: 80rpx; | ||
48 | + height: 6rpx; | ||
49 | + background: #21AE58; | ||
50 | + margin: 0 auto; | ||
51 | +} | ||
52 | + | ||
53 | +/* 导航条结束 */ | ||
54 | + | ||
55 | +/* 活动开始 */ | ||
56 | +.goods_wrap { | ||
57 | + width: 334rpx; | ||
58 | + margin-top: 24rpx; | ||
59 | + padding-bottom:24rpx ; | ||
60 | + border-radius: 7px; | ||
61 | + background-color: #ffffff; | ||
62 | + overflow: hidden; | ||
63 | + | ||
64 | +} | ||
65 | + | ||
66 | +.goods_wrap image { | ||
67 | + width: 334rpx; | ||
68 | + height: 200rpx; | ||
69 | +} | ||
70 | + | ||
71 | +.goods_name { | ||
72 | + padding: 0 16rpx; | ||
73 | + margin-top: 16rpx; | ||
74 | + font-size: 26rpx; | ||
75 | + color: #3E3E3F; | ||
76 | +} | ||
77 | + | ||
78 | +.goods_time { | ||
79 | + padding: 0 16rpx; | ||
80 | + margin-top: 16rpx; | ||
81 | + font-size: 24rpx; | ||
82 | + color: #7D7E80; | ||
83 | + | ||
84 | +} |
1 | +const app = getApp(); | ||
2 | +Page({ | ||
3 | + | ||
4 | + data: { | ||
5 | + list: [],//列表 | ||
6 | + array: [],//地址 | ||
7 | + index: 1 | ||
8 | + }, | ||
9 | + onLoad: function (options) { | ||
10 | + wx.getLocation({ | ||
11 | + altitude: 'true', | ||
12 | + success(res) { | ||
13 | + console.log(res) | ||
14 | + } | ||
15 | + }) | ||
16 | + }, | ||
17 | + | ||
18 | + onReady: function () { | ||
19 | + | ||
20 | + }, | ||
21 | + | ||
22 | + onShow: function () { | ||
23 | + let that = this; | ||
24 | + that.get_city(); | ||
25 | + | ||
26 | + that.getList(); | ||
27 | + | ||
28 | + }, | ||
29 | + | ||
30 | + // 选择 | ||
31 | + bindPickerChange: function (e) { | ||
32 | + let that = this; | ||
33 | + this.setData({ | ||
34 | + index: e.detail.value | ||
35 | + }) | ||
36 | + that.getList() | ||
37 | + | ||
38 | + }, | ||
39 | + | ||
40 | + // 志愿列表 | ||
41 | + getList() { | ||
42 | + let that = this; | ||
43 | + let url = '/index/second/teamList'; | ||
44 | + let head = { | ||
45 | + 'XX-Token': wx.getStorageSync('token') | ||
46 | + } | ||
47 | + let params = { | ||
48 | + city: that.data.array[that.data.index] | ||
49 | + } | ||
50 | + app.post(url, params, head).then((res) => { | ||
51 | + console.log(res) | ||
52 | + that.setData({ | ||
53 | + list: res | ||
54 | + }) | ||
55 | + | ||
56 | + }).catch((err) => { | ||
57 | + | ||
58 | + }) | ||
59 | + }, | ||
60 | + // 地址获取 | ||
61 | + get_city() { | ||
62 | + let that = this; | ||
63 | + let url = '/index/index/cityList' | ||
64 | + let head = { | ||
65 | + 'XX-Token': wx.getStorageSync('token') | ||
66 | + } | ||
67 | + | ||
68 | + app.post(url, {}, head).then((res) => { | ||
69 | + console.log(res) | ||
70 | + that.setData({ | ||
71 | + array: res.city | ||
72 | + | ||
73 | + }) | ||
74 | + }).catch((err) => { | ||
75 | + | ||
76 | + }) | ||
77 | + }, | ||
78 | + | ||
79 | + // 详情页 | ||
80 | + getDetail(e) { | ||
81 | + let that = this; | ||
82 | + let url = '/index/second/checkTranStatus'; | ||
83 | + let head = { | ||
84 | + 'XX-Token': wx.getStorageSync('token') | ||
85 | + } | ||
86 | + app.post(url, '', head).then((res) => { | ||
87 | + | ||
88 | + var id = e.currentTarget.dataset.id; | ||
89 | + wx.navigateTo({ | ||
90 | + url: '/pages/Volunteer_detail/Volunteer_detail?id=' + id, | ||
91 | + }) | ||
92 | + | ||
93 | + }).catch((err) => { | ||
94 | + | ||
95 | + }) | ||
96 | + }, | ||
97 | + | ||
98 | + | ||
99 | + | ||
100 | + | ||
101 | + | ||
102 | + | ||
103 | + | ||
104 | + | ||
105 | + /** | ||
106 | + * 用户点击右上角分享 | ||
107 | + */ | ||
108 | + onShareAppMessage: function () { | ||
109 | + | ||
110 | + } | ||
111 | +}) |
1 | +<!-- 志愿团队 --> | ||
2 | +<view class="group_name" bindtap="chooseLocation"> | ||
3 | + <image src="/imgs/didian-14.png"></image> | ||
4 | + <picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}"> | ||
5 | + <view class="picker"> | ||
6 | + {{array[index]}} | ||
7 | + <image class="right" src="/imgs/right.png"></image> | ||
8 | + </view> | ||
9 | + </picker> | ||
10 | +</view> | ||
11 | + | ||
12 | + | ||
13 | +<view class='new_box'> | ||
14 | + <view class='new_cell' data-id="{{list.id}}" bindtap="getDetail" > | ||
15 | + <view class='new_cellmain' > | ||
16 | + <view class='new_img'> | ||
17 | + <image src='{{list.pic}}' mode="aspectFill" /> | ||
18 | + <view class="new_num"> | ||
19 | + <view> {{list.work_total_time}}小时</view> | ||
20 | + <view>{{list.people_num}}人</view> | ||
21 | + </view> | ||
22 | + </view> | ||
23 | + <view class='new_title'>{{list.name}}</view> | ||
24 | + <view class='title_box'> | ||
25 | + <view class='wz_box'> | ||
26 | + <text>{{list.create_time}}</text> | ||
27 | + </view> | ||
28 | + <view class='word'>{{list.city}}</view> | ||
29 | + </view> | ||
30 | + </view> | ||
31 | + </view> | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | +</view> |
1 | +/* pages/Volunteer_group/Volunteer_group.wxss */ | ||
2 | +page { | ||
3 | + background-color: rgb(240, 240, 240); | ||
4 | +} | ||
5 | + | ||
6 | +.group_name { | ||
7 | + padding: 0 32rpx; | ||
8 | + height: 88rpx; | ||
9 | + line-height: 88rpx; | ||
10 | + font-size: 34rpx; | ||
11 | + color: #7D7E80; | ||
12 | + background-color: #ffffff; | ||
13 | + display: flex; | ||
14 | + align-items: center; | ||
15 | +} | ||
16 | + | ||
17 | +.group_name image { | ||
18 | + width: 36rpx; | ||
19 | + height: 36rpx; | ||
20 | + margin-right: 16rpx; | ||
21 | +} | ||
22 | + | ||
23 | +.group_name .right { | ||
24 | + width: 25rpx; | ||
25 | + height: 30rpx; | ||
26 | + margin-left: 16rpx; | ||
27 | + | ||
28 | +} | ||
29 | + | ||
30 | +/* */ | ||
31 | +.new_box { | ||
32 | + display: flex; | ||
33 | + justify-content: space-between; | ||
34 | + align-items: center; | ||
35 | + color: #999; | ||
36 | + padding: 0 32rpx; | ||
37 | + margin-bottom: 24rpx; | ||
38 | + font-size: 24rpx; | ||
39 | + flex-wrap: wrap; | ||
40 | + | ||
41 | +} | ||
42 | + | ||
43 | +.new_cell { | ||
44 | + width: 48%; | ||
45 | + /* padding: 29rpx 0rpx; */ | ||
46 | + /* background-color: #ffffff; */ | ||
47 | + border-radius: 7px; | ||
48 | + overflow: hidden; | ||
49 | + margin-top: 24rpx; | ||
50 | + | ||
51 | +} | ||
52 | + | ||
53 | + | ||
54 | +.new_cellmain { | ||
55 | + overflow: hidden; | ||
56 | + /* width: 336rpx; */ | ||
57 | + background-color: #ffffff; | ||
58 | +} | ||
59 | + | ||
60 | +.new_img { | ||
61 | + width: 336rpx; | ||
62 | + height: 220rpx; | ||
63 | + display: flex; | ||
64 | + align-items: center; | ||
65 | + justify-content: center; | ||
66 | + overflow: hidden; | ||
67 | + position: relative; | ||
68 | +} | ||
69 | + | ||
70 | +.new_img image { | ||
71 | + width: 100%; | ||
72 | + height: 100%; | ||
73 | + display: block; | ||
74 | + | ||
75 | +} | ||
76 | + | ||
77 | +.new_num { | ||
78 | + padding: 0 16rpx; | ||
79 | + /* width: 100%; */ | ||
80 | + height: 46rpx; | ||
81 | + color: #ffffff; | ||
82 | + position: absolute; | ||
83 | + left: 0; | ||
84 | + bottom: 0; | ||
85 | + display: flex; | ||
86 | + justify-content: space-between; | ||
87 | + | ||
88 | +} | ||
89 | + | ||
90 | +.new_num view { | ||
91 | + width: 200rpx; | ||
92 | + | ||
93 | +} | ||
94 | + | ||
95 | +.new_title { | ||
96 | + padding: 0 20rpx; | ||
97 | + height: 76rpx; | ||
98 | + overflow: hidden; | ||
99 | + text-overflow: ellipsis; | ||
100 | + display: -webkit-box; | ||
101 | + word-break: break-all; | ||
102 | + -webkit-box-orient: vertical; | ||
103 | + -webkit-line-clamp: 2; | ||
104 | + margin: 18rpx 0 13rpx 0; | ||
105 | + color: #292929; | ||
106 | + font-size: 28rpx; | ||
107 | +} | ||
108 | + | ||
109 | +.activity_title { | ||
110 | + margin: 0 32rpx; | ||
111 | + display: flex; | ||
112 | + justify-content: space-between; | ||
113 | + align-items: center; | ||
114 | +} | ||
115 | + | ||
116 | +.title_box { | ||
117 | + padding: 0 20rpx; | ||
118 | + margin: 18rpx 0 13rpx 0; | ||
119 | + font-size: 24rpx; | ||
120 | + font-family: PingFang SC; | ||
121 | + font-weight: 500; | ||
122 | + color: rgba(153, 153, 153, 1); | ||
123 | + display: flex; | ||
124 | + align-items: center; | ||
125 | + justify-content: space-between; | ||
126 | +} | ||
127 | + | ||
128 | +.wz_box { | ||
129 | + overflow: hidden; | ||
130 | + text-overflow: ellipsis; | ||
131 | + white-space: nowrap; | ||
132 | +} | ||
133 | + | ||
134 | +.title_box .word { | ||
135 | + max-width: 200rpx; | ||
136 | + color: #FF976A; | ||
137 | + font-size: 24rpx; | ||
138 | + overflow: hidden; | ||
139 | + text-overflow: ellipsis; | ||
140 | + white-space: nowrap; | ||
141 | +} |
1 | +const app = getApp(); | ||
2 | +Page({ | ||
3 | + | ||
4 | + /** | ||
5 | + * 页面的初始数据 | ||
6 | + */ | ||
7 | + data: { | ||
8 | + textareaNum: 0, | ||
9 | + join_reason: '', //加入理由 | ||
10 | + id: '', | ||
11 | + wechat: '', //微信号 | ||
12 | + move_phone: '' //手机号 | ||
13 | + }, | ||
14 | + | ||
15 | + // 微信号 | ||
16 | + setwechat(e) { | ||
17 | + console.log(e) | ||
18 | + this.setData({ | ||
19 | + wechat: e.detail.value | ||
20 | + }) | ||
21 | + | ||
22 | + }, | ||
23 | + // 手机号码 | ||
24 | + setmove_phone(e) { | ||
25 | + this.setData({ | ||
26 | + move_phone: e.detail.value | ||
27 | + }) | ||
28 | + }, | ||
29 | + | ||
30 | + //加入理由 | ||
31 | + textareaIn: function (e) { | ||
32 | + this.setData({ | ||
33 | + textareaNum: e.detail.cursor, | ||
34 | + join_reason: e.detail.value | ||
35 | + | ||
36 | + }) | ||
37 | + }, | ||
38 | + submit(e) { | ||
39 | + let that = this; | ||
40 | + // //验证手机号 | ||
41 | + // var AuglyTest_phone = /^1(3|4|5|6|7|8)\d{9}$/; | ||
42 | + // if (that.data.wechat == '') { | ||
43 | + // wx.showToast({ | ||
44 | + // title: '请输入微信号!', | ||
45 | + // icon: 'none' | ||
46 | + // }) | ||
47 | + // } else if (!AuglyTest_phone.test(that.data.move_phone)) { | ||
48 | + // wx.showToast({ | ||
49 | + // title: '请输入正确的电话号码!', | ||
50 | + // icon: 'none' | ||
51 | + // }) | ||
52 | + // } else if (that.data.join_reason == '') { | ||
53 | + // wx.showToast({ | ||
54 | + // title: '请填写加入理由!', | ||
55 | + // icon: 'none' | ||
56 | + // }) | ||
57 | + | ||
58 | + // } | ||
59 | + | ||
60 | + let url = '/index/second/applyTeam'; | ||
61 | + let head = { | ||
62 | + 'XX-Token': wx.getStorageSync('token') | ||
63 | + } | ||
64 | + let params = { | ||
65 | + wx_id: that.data.wechat, | ||
66 | + mobile: that.data.move_phone, | ||
67 | + join_reason: that.data.join_reason, | ||
68 | + team_id: that.data.id | ||
69 | + } | ||
70 | + | ||
71 | + app.post(url, params, head).then((res) => { | ||
72 | + | ||
73 | + wx.showModal({ | ||
74 | + title: '提示', | ||
75 | + content: '请仔细核对信息,确认无误!', | ||
76 | + confirmText: '确认提交', | ||
77 | + cancelText: '我再想想', | ||
78 | + success(res) { | ||
79 | + if (res.confirm) { | ||
80 | + | ||
81 | + wx.showToast({ | ||
82 | + title: '提交成功,等待审核', | ||
83 | + mask: true, | ||
84 | + icon: 'none', | ||
85 | + // duration: 2000 | ||
86 | + }) | ||
87 | + setTimeout(function () { | ||
88 | + wx.switchTab({ | ||
89 | + url: '/pages/index/index' | ||
90 | + }) | ||
91 | + }, 1000) | ||
92 | + console.log('用户点击确定') | ||
93 | + } else if (res.cancel) { | ||
94 | + | ||
95 | + console.log('用户点击取消') | ||
96 | + } | ||
97 | + } | ||
98 | + }) | ||
99 | + | ||
100 | + | ||
101 | + }).catch(() => {}) | ||
102 | + | ||
103 | + | ||
104 | + | ||
105 | + | ||
106 | + | ||
107 | + }, | ||
108 | + | ||
109 | + | ||
110 | + | ||
111 | + // 提示 | ||
112 | + click: function (e) { | ||
113 | + this.setData({ | ||
114 | + hiddenName: !this.data.hiddenName | ||
115 | + }) | ||
116 | + }, | ||
117 | + /** | ||
118 | + * 生命周期函数--监听页面加载 | ||
119 | + */ | ||
120 | + onLoad: function (options) { | ||
121 | + // console.log(options) | ||
122 | + this.setData({ | ||
123 | + id: options.id | ||
124 | + }) | ||
125 | + }, | ||
126 | + | ||
127 | + /** | ||
128 | + * 生命周期函数--监听页面初次渲染完成 | ||
129 | + */ | ||
130 | + onReady: function () { | ||
131 | + | ||
132 | + }, | ||
133 | + | ||
134 | + /** | ||
135 | + * 生命周期函数--监听页面显示 | ||
136 | + */ | ||
137 | + onShow: function () { | ||
138 | + | ||
139 | + }, | ||
140 | + | ||
141 | + /** | ||
142 | + * 生命周期函数--监听页面隐藏 | ||
143 | + */ | ||
144 | + onHide: function () { | ||
145 | + | ||
146 | + }, | ||
147 | + | ||
148 | + /** | ||
149 | + * 生命周期函数--监听页面卸载 | ||
150 | + */ | ||
151 | + onUnload: function () { | ||
152 | + | ||
153 | + }, | ||
154 | + | ||
155 | + /** | ||
156 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
157 | + */ | ||
158 | + onPullDownRefresh: function () { | ||
159 | + | ||
160 | + }, | ||
161 | + | ||
162 | + /** | ||
163 | + * 页面上拉触底事件的处理函数 | ||
164 | + */ | ||
165 | + onReachBottom: function () { | ||
166 | + | ||
167 | + }, | ||
168 | + | ||
169 | + /** | ||
170 | + * 用户点击右上角分享 | ||
171 | + */ | ||
172 | + onShareAppMessage: function () { | ||
173 | + | ||
174 | + } | ||
175 | +}) |
1 | +<!--微信号 --> | ||
2 | +<view class='apply_item'> | ||
3 | + <view>微信号</view> | ||
4 | + <view class='apply_item_input'> | ||
5 | + <input placeholder='请输入微信号码' placeholder-class='input_p' bindinput='setwechat' value='{{wechat}}' | ||
6 | + disabled="{{page_type}}"></input> | ||
7 | + </view> | ||
8 | +</view> | ||
9 | +<view class="line"> | ||
10 | + <view></view> | ||
11 | +</view> | ||
12 | +<!--手机号码 --> | ||
13 | +<view class='apply_item'> | ||
14 | + <view>手机号码</view> | ||
15 | + <view class='apply_item_input'> | ||
16 | + <input placeholder='请输入手机号码' type='number' placeholder-class='input_p' bindinput='setmove_phone' | ||
17 | + value='{{move_phone}}' disabled="{{page_type}}" maxlength="11"></input> | ||
18 | + </view> | ||
19 | +</view> | ||
20 | +<!-- 加入理由 --> | ||
21 | +<view class="doc-listform"> | ||
22 | + <view>加入理由</view> | ||
23 | + <textarea show-confirm-bar="" placeholder="请填写加入理由" maxlength="100" bindinput="textareaIn" value='{{join_reason}}'> | ||
24 | + <view style="position:absolute;bottom:20rpx;right:0rpx;color:gray;"><text style="color:#000;">{{textareaNum}}</text> / 100</view> | ||
25 | + </textarea> | ||
26 | +</view> | ||
27 | +<!-- 提示 --> | ||
28 | +<view class="tishi_wrap" hidden="{{hiddenName}}"> | ||
29 | + <view class="tishi"> | ||
30 | + <view> | ||
31 | + <image src="/imgs/tishi-3@2x.png"></image> | ||
32 | + 提示 | ||
33 | + </view> | ||
34 | + <image bindtap="click" style="width:20rpx;height:20rpx;" src="/imgs/tishiclear.png"></image> | ||
35 | + </view> | ||
36 | + <view class="tishi_text">“请填写真实信息”以便于志愿团队管理员与您联系 并邀请您加入该团队志愿者管理服务群聊</view> | ||
37 | +</view> | ||
38 | +<form class="shengqin" bindsubmit="submit" report-submit='true'> | ||
39 | + <button form-type="submit">确认申请</button> | ||
40 | + | ||
41 | +</form> |
1 | +/* @import "../../apply//apply.wxss"; */ | ||
2 | +page { | ||
3 | + background-color: rgb(240, 240, 240); | ||
4 | +} | ||
5 | + | ||
6 | +.apply_item { | ||
7 | + color: #333; | ||
8 | + font-size: 28rpx; | ||
9 | + display: flex; | ||
10 | + align-items: center; | ||
11 | + justify-content: space-between; | ||
12 | + /* margin: 0 32rpx; */ | ||
13 | + /* border-bottom: 1rpx solid #e6e6e6; */ | ||
14 | + padding: 30rpx 32rpx; | ||
15 | + background-color: #ffffff; | ||
16 | +} | ||
17 | + | ||
18 | +.apply_item_input { | ||
19 | + display: flex; | ||
20 | + align-items: center; | ||
21 | + flex-direction: row-reverse; | ||
22 | + width: 70%; | ||
23 | + color: #333; | ||
24 | + font-size: 28rpx; | ||
25 | +} | ||
26 | + | ||
27 | +.apply_item_input input { | ||
28 | + width: 100%; | ||
29 | +} | ||
30 | + | ||
31 | +.apply_item_input .iconfont { | ||
32 | + color: #ccc; | ||
33 | +} | ||
34 | + | ||
35 | +.big_item .apply_item_input { | ||
36 | + width: 60%; | ||
37 | +} | ||
38 | + | ||
39 | +.apply_item_input input { | ||
40 | + text-align: right; | ||
41 | +} | ||
42 | + | ||
43 | +.input_p { | ||
44 | + color: #ccc; | ||
45 | + font-size: 28rpx; | ||
46 | +} | ||
47 | + | ||
48 | +.line view { | ||
49 | + margin: 0 32rpx; | ||
50 | + background-color: #e6e6e6; | ||
51 | + height: 1px; | ||
52 | +} | ||
53 | + | ||
54 | +.line { | ||
55 | + background-color: #ffffff; | ||
56 | +} | ||
57 | + | ||
58 | +/* */ | ||
59 | +.doc-listform { | ||
60 | + margin-top: 30rpx; | ||
61 | + padding: 0 32rpx; | ||
62 | + padding-top: 16rpx; | ||
63 | + background-color: #ffffff; | ||
64 | + position: relative; | ||
65 | + | ||
66 | +} | ||
67 | + | ||
68 | +textarea { | ||
69 | + font-size: 28rpx; | ||
70 | + margin-top: 20rpx; | ||
71 | + width: auto; | ||
72 | +} | ||
73 | +/* 提示 */ | ||
74 | +.tishi_wrap { | ||
75 | + padding: 24rpx 36rpx; | ||
76 | + margin: 0 32rpx; | ||
77 | + margin-top: 40rpx; | ||
78 | + border-radius: 8px; | ||
79 | + background-color: #ffffff; | ||
80 | +} | ||
81 | + | ||
82 | +.tishi { | ||
83 | + display: flex; | ||
84 | + align-items: center; | ||
85 | + justify-content: space-between; | ||
86 | + color: #FF4444; | ||
87 | + font-size: 32rpx; | ||
88 | +} | ||
89 | + | ||
90 | +.tishi image { | ||
91 | + width: 28rpx; | ||
92 | + height: 28rpx; | ||
93 | + margin-right: 8rpx; | ||
94 | +} | ||
95 | + | ||
96 | +.tishi_text { | ||
97 | + margin-top: 16rpx; | ||
98 | + font-size: 28rpx; | ||
99 | + color: #7D7E80; | ||
100 | + | ||
101 | +} | ||
102 | + | ||
103 | +.shengqin { | ||
104 | + height: 122rpx; | ||
105 | + background-color: #ffffff; | ||
106 | + font-size: 32rpx; | ||
107 | + position: fixed; | ||
108 | + left: 0; | ||
109 | + right: 0; | ||
110 | + bottom: 0; | ||
111 | + display: flex; | ||
112 | + justify-content: center; | ||
113 | + align-items: center; | ||
114 | +} | ||
115 | + | ||
116 | +.shengqin button { | ||
117 | + width: 622rpx; | ||
118 | + height: 88rpx; | ||
119 | + color: #ffffff; | ||
120 | + border-radius: 22px; | ||
121 | + background: linear-gradient(130deg, #2ed26e 13%, #05983e 98%); | ||
122 | + box-shadow: 0px 9px 19px 0px rgba(0, 116, 45, 0.42); | ||
123 | + | ||
124 | +} |
@@ -75,102 +75,174 @@ Page({ | @@ -75,102 +75,174 @@ Page({ | ||
75 | front_card: '', //身份证正面照 | 75 | front_card: '', //身份证正面照 |
76 | reverse_card: '', //身份证反面照 | 76 | reverse_card: '', //身份证反面照 |
77 | id: '', //用户id, | 77 | id: '', //用户id, |
78 | + status:''//状态 | ||
78 | }, | 79 | }, |
80 | + | ||
81 | + onShow: function () { | ||
82 | + | ||
83 | + var that = this; | ||
84 | + // 登记表缓存 | ||
85 | + that.setData({ | ||
86 | + name: wx.getStorageSync('name'), | ||
87 | + sex: wx.getStorageSync('sex'), | ||
88 | + photo: wx.getStorageSync('photo'), | ||
89 | + front_card: wx.getStorageSync('front_card'), | ||
90 | + reverse_card: wx.getStorageSync('reverse_card'), | ||
91 | + birthday: wx.getStorageSync('birthday'), | ||
92 | + nation: wx.getStorageSync('nation'), | ||
93 | + education: wx.getStorageSync('education'), | ||
94 | + politics: wx.getStorageSync('politics'), | ||
95 | + unit: wx.getStorageSync('unit'), | ||
96 | + duty: wx.getStorageSync('duty'), | ||
97 | + addr: wx.getStorageSync('addr'), | ||
98 | + postcode: wx.getStorageSync('postcode'), | ||
99 | + school: wx.getStorageSync('school'), | ||
100 | + card_number: wx.getStorageSync('card_number'), | ||
101 | + fixed_phone: wx.getStorageSync('fixed_phone'), | ||
102 | + move_phone: wx.getStorageSync('move_phone'), | ||
103 | + email: wx.getStorageSync('email'), | ||
104 | + urgency_phone: wx.getStorageSync('urgency_phone'), | ||
105 | + qq: wx.getStorageSync('qq'), | ||
106 | + address: wx.getStorageSync('address'), | ||
107 | + | ||
108 | + }) | ||
109 | + }, | ||
110 | + | ||
111 | +// 姓名 | ||
79 | setname(e) { | 112 | setname(e) { |
80 | this.setData({ | 113 | this.setData({ |
81 | name: e.detail.value | 114 | name: e.detail.value |
82 | }) | 115 | }) |
116 | + wx.setStorageSync('name', e.detail.value) | ||
83 | }, | 117 | }, |
84 | - setunit(e) { | 118 | + // 性别 |
119 | + bindsex(e) { | ||
85 | this.setData({ | 120 | this.setData({ |
86 | - unit: e.detail.value | 121 | + sex: parseInt(e.detail.value) + 1 |
87 | }) | 122 | }) |
123 | + wx.setStorageSync('sex', parseInt(e.detail.value) + 1) | ||
88 | }, | 124 | }, |
89 | - setduty(e) { | 125 | + // 出生日期 |
126 | + bindbirthdayChange(e) { | ||
90 | this.setData({ | 127 | this.setData({ |
91 | - duty: e.detail.value | 128 | + birthday: e.detail.value |
92 | }) | 129 | }) |
130 | + wx.setStorageSync('birthday', e.detail.value) | ||
93 | }, | 131 | }, |
94 | - setaddr(e) { | 132 | + // 民族 |
133 | + bindnationChange(e) { | ||
134 | + let nationarr = this.data.nationarr; | ||
95 | this.setData({ | 135 | this.setData({ |
96 | - addr: e.detail.value | 136 | + nation: nationarr[e.detail.value] |
97 | }) | 137 | }) |
138 | + | ||
139 | + wx.setStorageSync('nation', nationarr[e.detail.value]) | ||
140 | + | ||
98 | }, | 141 | }, |
99 | - setpostcode(e) { | 142 | + // 学历 |
143 | + bindeducationChange(e) { | ||
144 | + let educationarr = this.data.educationarr; | ||
100 | this.setData({ | 145 | this.setData({ |
101 | - postcode: e.detail.value | 146 | + education: educationarr[e.detail.value] |
102 | }) | 147 | }) |
148 | + wx.setStorageSync('education', educationarr[e.detail.value]) | ||
103 | }, | 149 | }, |
104 | - setschool(e) { | 150 | + // 政治面貌 |
151 | + | ||
152 | + bindpoliticsChange(e) { | ||
153 | + let politicsarr = this.data.politicsarr; | ||
105 | this.setData({ | 154 | this.setData({ |
106 | - school: e.detail.value | 155 | + politics: politicsarr[e.detail.value] |
107 | }) | 156 | }) |
157 | + | ||
158 | + wx.setStorageSync('politics', politicsarr[e.detail.value]) | ||
159 | + | ||
108 | }, | 160 | }, |
109 | - setcard_number(e) { | 161 | + // 工作单位 |
162 | + setunit(e) { | ||
110 | this.setData({ | 163 | this.setData({ |
111 | - card_number: e.detail.value | 164 | + unit: e.detail.value |
112 | }) | 165 | }) |
166 | + wx.setStorageSync('unit', e.detail.value) | ||
113 | }, | 167 | }, |
114 | - setemail(e) { | 168 | + // 职务 |
169 | + setduty(e) { | ||
115 | this.setData({ | 170 | this.setData({ |
116 | - email: e.detail.value | 171 | + duty: e.detail.value |
117 | }) | 172 | }) |
173 | + wx.setStorageSync('duty', e.detail.value) | ||
174 | + | ||
175 | + | ||
118 | }, | 176 | }, |
119 | - seturgency_phone(e) { | 177 | + // 通讯地址 |
178 | + setaddr(e) { | ||
120 | this.setData({ | 179 | this.setData({ |
121 | - urgency_phone: e.detail.value | 180 | + addr: e.detail.value |
122 | }) | 181 | }) |
182 | + wx.setStorageSync('addr', e.detail.value) | ||
123 | }, | 183 | }, |
124 | - setqq(e) { | 184 | + //邮编 |
185 | + setpostcode(e) { | ||
125 | this.setData({ | 186 | this.setData({ |
126 | - qq: e.detail.value | 187 | + postcode: e.detail.value |
127 | }) | 188 | }) |
189 | + wx.setStorageSync('postcode', e.detail.value) | ||
128 | }, | 190 | }, |
129 | - bindsex(e) { | 191 | + // 就读学校 |
192 | + setschool(e) { | ||
130 | this.setData({ | 193 | this.setData({ |
131 | - sex: parseInt(e.detail.value) + 1 | 194 | + school: e.detail.value |
132 | }) | 195 | }) |
196 | + wx.setStorageSync('school', e.detail.value) | ||
197 | + | ||
198 | + }, | ||
199 | + // 身份证号 | ||
200 | + setcard_number(e) { | ||
201 | + this.setData({ | ||
202 | + card_number: e.detail.value | ||
203 | + }) | ||
204 | + wx.setStorageSync('card_number', e.detail.value) | ||
205 | + | ||
133 | }, | 206 | }, |
134 | //固定电话 | 207 | //固定电话 |
135 | setfixed_phone(e) { | 208 | setfixed_phone(e) { |
136 | this.setData({ | 209 | this.setData({ |
137 | fixed_phone: e.detail.value | 210 | fixed_phone: e.detail.value |
138 | }) | 211 | }) |
212 | + wx.setStorageSync('fixed_phone', e.detail.value) | ||
139 | }, | 213 | }, |
140 | - | 214 | + |
141 | //移动电话 | 215 | //移动电话 |
142 | setmove_phone(e) { | 216 | setmove_phone(e) { |
143 | this.setData({ | 217 | this.setData({ |
144 | move_phone: e.detail.value | 218 | move_phone: e.detail.value |
145 | }) | 219 | }) |
220 | + wx.setStorageSync('move_phone', e.detail.value) | ||
146 | }, | 221 | }, |
147 | - | ||
148 | - bindbirthdayChange(e) { | ||
149 | - this.setData({ | ||
150 | - birthday: e.detail.value | ||
151 | - }) | ||
152 | - }, | ||
153 | - bindnationChange(e) { | ||
154 | - let nationarr = this.data.nationarr; | 222 | + // 电子邮箱 |
223 | + setemail(e) { | ||
155 | this.setData({ | 224 | this.setData({ |
156 | - nation: nationarr[e.detail.value] | 225 | + email: e.detail.value |
157 | }) | 226 | }) |
227 | + wx.setStorageSync('email', e.detail.value) | ||
228 | + | ||
158 | }, | 229 | }, |
159 | - bindeducationChange(e) { | ||
160 | - let educationarr = this.data.educationarr; | 230 | + // 紧急联系人 |
231 | + seturgency_phone(e) { | ||
161 | this.setData({ | 232 | this.setData({ |
162 | - education: educationarr[e.detail.value] | 233 | + urgency_phone: e.detail.value |
163 | }) | 234 | }) |
164 | - }, | 235 | + wx.setStorageSync('urgency_phone', e.detail.value) |
165 | 236 | ||
166 | - bindpoliticsChange(e) { | ||
167 | - let politicsarr = this.data.politicsarr; | 237 | + }, |
238 | + // QQ号码 | ||
239 | + setqq(e) { | ||
168 | this.setData({ | 240 | this.setData({ |
169 | - politics: politicsarr[e.detail.value] | 241 | + qq: e.detail.value |
170 | }) | 242 | }) |
243 | + wx.setStorageSync('qq', e.detail.value) | ||
171 | }, | 244 | }, |
172 | 245 | ||
173 | - | ||
174 | //选择省市区 | 246 | //选择省市区 |
175 | getarea() { | 247 | getarea() { |
176 | let that = this; | 248 | let that = this; |
@@ -197,7 +269,7 @@ Page({ | @@ -197,7 +269,7 @@ Page({ | ||
197 | that.setData({ | 269 | that.setData({ |
198 | ifempower: false | 270 | ifempower: false |
199 | }) | 271 | }) |
200 | - | 272 | + |
201 | } else if (that.data.is_submit == '1') { | 273 | } else if (that.data.is_submit == '1') { |
202 | that.getdatalist(); | 274 | that.getdatalist(); |
203 | } | 275 | } |
@@ -256,7 +328,7 @@ Page({ | @@ -256,7 +328,7 @@ Page({ | ||
256 | 328 | ||
257 | }) | 329 | }) |
258 | }, | 330 | }, |
259 | - bindChange: function(e) { | 331 | + bindChange: function (e) { |
260 | let that = this; | 332 | let that = this; |
261 | let valarr = that.data.valarr; | 333 | let valarr = that.data.valarr; |
262 | let provincearr = that.data.provincearr; | 334 | let provincearr = that.data.provincearr; |
@@ -312,6 +384,8 @@ Page({ | @@ -312,6 +384,8 @@ Page({ | ||
312 | address: provincearr[i].province_name + cityarr[j].city_name + countryarr[k].country_name, | 384 | address: provincearr[i].province_name + cityarr[j].city_name + countryarr[k].country_name, |
313 | showapply: false | 385 | showapply: false |
314 | }) | 386 | }) |
387 | + | ||
388 | + wx.setStorageSync('address', this.data.address) | ||
315 | }, | 389 | }, |
316 | 390 | ||
317 | setshowapply() { | 391 | setshowapply() { |
@@ -396,6 +470,8 @@ Page({ | @@ -396,6 +470,8 @@ Page({ | ||
396 | let tem = e.currentTarget.dataset.tem; | 470 | let tem = e.currentTarget.dataset.tem; |
397 | that.uploadImage(tem); | 471 | that.uploadImage(tem); |
398 | 472 | ||
473 | + | ||
474 | + | ||
399 | }, | 475 | }, |
400 | //上传头像1为头像,2为省份证正面,3为省份证反面 | 476 | //上传头像1为头像,2为省份证正面,3为省份证反面 |
401 | uploadImage(tem) { | 477 | uploadImage(tem) { |
@@ -403,42 +479,47 @@ Page({ | @@ -403,42 +479,47 @@ Page({ | ||
403 | wx.chooseImage({ | 479 | wx.chooseImage({ |
404 | count: 1, | 480 | count: 1, |
405 | sizeType: ['original', 'compressed'], | 481 | sizeType: ['original', 'compressed'], |
406 | - success: function(res) { | 482 | + success: function (res) { |
407 | let tempFilePaths = res.tempFilePaths //总文件 | 483 | let tempFilePaths = res.tempFilePaths //总文件 |
408 | let head = { | 484 | let head = { |
409 | 'XX-Token': wx.getStorageSync('token'), | 485 | 'XX-Token': wx.getStorageSync('token'), |
410 | 'XX-Device-Type': '' | 486 | 'XX-Device-Type': '' |
411 | } | 487 | } |
412 | - let url = 'https://volunteer.cnpu.org/api/user/upload/one'; | 488 | + // let url = 'https://volunteer.cnpu.org/api/user/upload/one'; |
489 | + let url = 'http://volunteer.w.bronet.cn/api/user/upload/one'; | ||
490 | + | ||
413 | wx.uploadFile({ | 491 | wx.uploadFile({ |
414 | url: url, //仅为示例,非真实的接口地址 | 492 | url: url, //仅为示例,非真实的接口地址 |
415 | filePath: tempFilePaths[0], | 493 | filePath: tempFilePaths[0], |
416 | name: 'file', | 494 | name: 'file', |
417 | header: head, | 495 | header: head, |
418 | formData: {}, | 496 | formData: {}, |
419 | - success: function(res) { | 497 | + success: function (res) { |
420 | let temdata = JSON.parse(res.data); | 498 | let temdata = JSON.parse(res.data); |
421 | if (temdata.code == 20000) { | 499 | if (temdata.code == 20000) { |
422 | if (tem == '1') { | 500 | if (tem == '1') { |
423 | that.setData({ | 501 | that.setData({ |
424 | photo: temdata.data.url | 502 | photo: temdata.data.url |
425 | }) | 503 | }) |
504 | + wx.setStorageSync('photo', temdata.data.url) | ||
426 | } else if (tem == '2') { | 505 | } else if (tem == '2') { |
427 | that.setData({ | 506 | that.setData({ |
428 | front_card: temdata.data.url | 507 | front_card: temdata.data.url |
429 | }) | 508 | }) |
509 | + wx.setStorageSync('front_card', temdata.data.url) | ||
430 | } else if (tem == '3') { | 510 | } else if (tem == '3') { |
431 | that.setData({ | 511 | that.setData({ |
432 | reverse_card: temdata.data.url | 512 | reverse_card: temdata.data.url |
433 | }) | 513 | }) |
514 | + wx.setStorageSync('reverse_card', temdata.data.url) | ||
434 | } | 515 | } |
435 | } | 516 | } |
436 | }, | 517 | }, |
437 | - fail: function(res) {}, | 518 | + fail: function (res) {}, |
438 | complete: () => {} | 519 | complete: () => {} |
439 | }) | 520 | }) |
440 | }, | 521 | }, |
441 | - fail: function(res) {} | 522 | + fail: function (res) {} |
442 | }) | 523 | }) |
443 | }, | 524 | }, |
444 | setapply_nav(e) { | 525 | setapply_nav(e) { |
@@ -490,8 +571,6 @@ Page({ | @@ -490,8 +571,6 @@ Page({ | ||
490 | err = '请输入您的身份证号!'; | 571 | err = '请输入您的身份证号!'; |
491 | } else if (!AuglyTest_ID.test(that.data.card_number)) { | 572 | } else if (!AuglyTest_ID.test(that.data.card_number)) { |
492 | err = '请输入正确的身份证号!'; | 573 | err = '请输入正确的身份证号!'; |
493 | - } else if (that.data.fixed_phone == '' || !that.data.fixed_phone) { | ||
494 | - err = '请输入您的固定电话!'; | ||
495 | } else if (that.data.move_phone == '') { | 574 | } else if (that.data.move_phone == '') { |
496 | err = '请输入您的移动电话!'; | 575 | err = '请输入您的移动电话!'; |
497 | } else if (!AuglyTest_phone.test(that.data.move_phone)) { | 576 | } else if (!AuglyTest_phone.test(that.data.move_phone)) { |
@@ -514,6 +593,7 @@ Page({ | @@ -514,6 +593,7 @@ Page({ | ||
514 | err = '请上传身份证反面!'; | 593 | err = '请上传身份证反面!'; |
515 | } | 594 | } |
516 | if (err == '') { | 595 | if (err == '') { |
596 | + | ||
517 | let record = that.data.record; | 597 | let record = that.data.record; |
518 | let record_start_time = []; | 598 | let record_start_time = []; |
519 | let record_end_time = []; | 599 | let record_end_time = []; |
@@ -567,18 +647,35 @@ Page({ | @@ -567,18 +647,35 @@ Page({ | ||
567 | photo: that.data.photo | 647 | photo: that.data.photo |
568 | } | 648 | } |
569 | app.post(url, params, head).then((res) => { | 649 | app.post(url, params, head).then((res) => { |
570 | - wx.showToast({ | ||
571 | - title: '提交成功,等待审核', | ||
572 | - mask: true, | ||
573 | - icon: 'none', | ||
574 | - duration: 2000 | 650 | + |
651 | + wx.showModal({ | ||
652 | + title: '请仔细核对信息,确认无误!', | ||
653 | + content: '如需修改个人信息,请在微信公众号申请:关注微信公众号“白求恩志愿者中心”,点击菜单按钮“修改个人信息”,申请提交。', | ||
654 | + confirmText:'确认提交', | ||
655 | + cancelText:'我再想想', | ||
656 | + success(res) { | ||
657 | + if (res.confirm) { | ||
658 | + | ||
659 | + wx.showToast({ | ||
660 | + title: '提交成功,等待审核', | ||
661 | + mask: true, | ||
662 | + icon: 'none', | ||
663 | + duration: 2000 | ||
664 | + }) | ||
665 | + setTimeout(function () { | ||
666 | + wx.switchTab({ | ||
667 | + url: '/pages/my/my' | ||
668 | + }) | ||
669 | + }, 1000) | ||
670 | + console.log('用户点击确定') | ||
671 | + } else if (res.cancel) { | ||
672 | + | ||
673 | + console.log('用户点击取消') | ||
674 | + } | ||
675 | + } | ||
575 | }) | 676 | }) |
576 | 677 | ||
577 | - setTimeout(function() { | ||
578 | - wx.switchTab({ | ||
579 | - url: '/pages/my/my' | ||
580 | - }) | ||
581 | - }, 1000) | 678 | + |
582 | }).catch((err) => {}) | 679 | }).catch((err) => {}) |
583 | } else { | 680 | } else { |
584 | wx.showToast({ | 681 | wx.showToast({ |
@@ -588,7 +685,10 @@ Page({ | @@ -588,7 +685,10 @@ Page({ | ||
588 | duration: 2000 | 685 | duration: 2000 |
589 | }) | 686 | }) |
590 | } | 687 | } |
688 | + | ||
689 | + | ||
591 | }, | 690 | }, |
691 | + | ||
592 | getdatalist() { | 692 | getdatalist() { |
593 | let that = this; | 693 | let that = this; |
594 | let url = '/index/member_center/edit'; | 694 | let url = '/index/member_center/edit'; |
@@ -599,6 +699,7 @@ Page({ | @@ -599,6 +699,7 @@ Page({ | ||
599 | 'XX-Token': wx.getStorageSync('token') | 699 | 'XX-Token': wx.getStorageSync('token') |
600 | } | 700 | } |
601 | app.post(url, params, head).then((res) => { | 701 | app.post(url, params, head).then((res) => { |
702 | + console.log(res) | ||
602 | let provincearr = that.data.provincearr; | 703 | let provincearr = that.data.provincearr; |
603 | let cityarr = that.data.cityarr; | 704 | let cityarr = that.data.cityarr; |
604 | let countryarr = that.data.countryarr; | 705 | let countryarr = that.data.countryarr; |
@@ -646,7 +747,8 @@ Page({ | @@ -646,7 +747,8 @@ Page({ | ||
646 | sex: res.sex, | 747 | sex: res.sex, |
647 | unit: res.unit, | 748 | unit: res.unit, |
648 | urgency_phone: res.urgency_phone, | 749 | urgency_phone: res.urgency_phone, |
649 | - type: res.type | 750 | + type: res.type, |
751 | + status:res.status | ||
650 | }) | 752 | }) |
651 | }).catch((err) => { | 753 | }).catch((err) => { |
652 | 754 | ||
@@ -655,10 +757,11 @@ Page({ | @@ -655,10 +757,11 @@ Page({ | ||
655 | /** | 757 | /** |
656 | * 生命周期函数--监听页面加载 | 758 | * 生命周期函数--监听页面加载 |
657 | */ | 759 | */ |
658 | - onLoad: function(options) { | 760 | + onLoad: function (options) { |
761 | + console.log(options) | ||
659 | let that = this; | 762 | let that = this; |
660 | that.setData({ | 763 | that.setData({ |
661 | - is_submit: options.is_submit ? options.is_submit:null, | 764 | + is_submit: options.is_submit ? options.is_submit : null, |
662 | id: options.id, | 765 | id: options.id, |
663 | page_type: options.type ? options.type : null | 766 | page_type: options.type ? options.type : null |
664 | }) | 767 | }) |
@@ -673,22 +776,19 @@ Page({ | @@ -673,22 +776,19 @@ Page({ | ||
673 | /** | 776 | /** |
674 | * 生命周期函数--监听页面初次渲染完成 | 777 | * 生命周期函数--监听页面初次渲染完成 |
675 | */ | 778 | */ |
676 | - onReady: function() { | 779 | + onReady: function () { |
677 | 780 | ||
678 | }, | 781 | }, |
679 | 782 | ||
680 | /** | 783 | /** |
681 | * 生命周期函数--监听页面显示 | 784 | * 生命周期函数--监听页面显示 |
682 | */ | 785 | */ |
683 | - onShow: function() { | ||
684 | - | ||
685 | 786 | ||
686 | - }, | ||
687 | 787 | ||
688 | /** | 788 | /** |
689 | * 生命周期函数--监听页面隐藏 | 789 | * 生命周期函数--监听页面隐藏 |
690 | */ | 790 | */ |
691 | - onHide: function() { | 791 | + onHide: function () { |
692 | 792 | ||
693 | 793 | ||
694 | 794 | ||
@@ -697,28 +797,28 @@ Page({ | @@ -697,28 +797,28 @@ Page({ | ||
697 | /** | 797 | /** |
698 | * 生命周期函数--监听页面卸载 | 798 | * 生命周期函数--监听页面卸载 |
699 | */ | 799 | */ |
700 | - onUnload: function() { | 800 | + onUnload: function () { |
701 | 801 | ||
702 | }, | 802 | }, |
703 | 803 | ||
704 | /** | 804 | /** |
705 | * 页面相关事件处理函数--监听用户下拉动作 | 805 | * 页面相关事件处理函数--监听用户下拉动作 |
706 | */ | 806 | */ |
707 | - onPullDownRefresh: function() { | 807 | + onPullDownRefresh: function () { |
708 | 808 | ||
709 | }, | 809 | }, |
710 | 810 | ||
711 | /** | 811 | /** |
712 | * 页面上拉触底事件的处理函数 | 812 | * 页面上拉触底事件的处理函数 |
713 | */ | 813 | */ |
714 | - onReachBottom: function() { | 814 | + onReachBottom: function () { |
715 | 815 | ||
716 | }, | 816 | }, |
717 | 817 | ||
718 | /** | 818 | /** |
719 | * 用户点击右上角分享 | 819 | * 用户点击右上角分享 |
720 | */ | 820 | */ |
721 | - onShareAppMessage: function() { | 821 | + onShareAppMessage: function () { |
722 | 822 | ||
723 | } | 823 | } |
724 | }) | 824 | }) |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <image src='{{photo}}' wx:if='{{photo}}' mode="aspectFill"></image> | 3 | <image src='{{photo}}' wx:if='{{photo}}' mode="aspectFill"></image> |
4 | <view class='iconfont icon-xiangji' wx:if='{{!photo}}'></view> | 4 | <view class='iconfont icon-xiangji' wx:if='{{!photo}}'></view> |
5 | </view> | 5 | </view> |
6 | - <view class='tips_word'>请选择1:1的图像</view> | 6 | + <view class='tips_word'>请选择1寸免冠照片</view> |
7 | </view> | 7 | </view> |
8 | 8 | ||
9 | 9 | ||
@@ -11,7 +11,8 @@ | @@ -11,7 +11,8 @@ | ||
11 | <view class='apply_item'> | 11 | <view class='apply_item'> |
12 | <view>姓名</view> | 12 | <view>姓名</view> |
13 | <view class='apply_item_input'> | 13 | <view class='apply_item_input'> |
14 | - <input placeholder='未填写' placeholder-class='input_p' bindinput='setname' value='{{name}}' disabled="{{page_type}}"></input> | 14 | + <input placeholder='未填写' placeholder-class='input_p' bindinput='setname' value='{{name}}' |
15 | + disabled="{{page_type}}"></input> | ||
15 | </view> | 16 | </view> |
16 | </view> | 17 | </view> |
17 | <picker bindchange="bindsex" range="{{arraysex}}" disabled="{{page_type}}"> | 18 | <picker bindchange="bindsex" range="{{arraysex}}" disabled="{{page_type}}"> |
@@ -23,7 +24,7 @@ | @@ -23,7 +24,7 @@ | ||
23 | </view> | 24 | </view> |
24 | </view> | 25 | </view> |
25 | </picker> | 26 | </picker> |
26 | -<picker mode='date' bindchange="bindbirthdayChange" end='{{enddata}}' disabled="{{page_type}}"> | 27 | +<picker mode='date' bindchange="bindbirthdayChange" value="{{2000-01-01}}" end='{{enddata}}' disabled="{{page_type}}"> |
27 | <view class='apply_item'> | 28 | <view class='apply_item'> |
28 | <view>出生日期</view> | 29 | <view>出生日期</view> |
29 | <view class='apply_item_input'> | 30 | <view class='apply_item_input'> |
@@ -62,67 +63,78 @@ | @@ -62,67 +63,78 @@ | ||
62 | <view class='apply_item'> | 63 | <view class='apply_item'> |
63 | <view>工作单位</view> | 64 | <view>工作单位</view> |
64 | <view class='apply_item_input'> | 65 | <view class='apply_item_input'> |
65 | - <input placeholder='未填写' placeholder-class='input_p' bindinput='setunit' value='{{unit}}' disabled="{{page_type}}"></input> | 66 | + <input placeholder='未填写' placeholder-class='input_p' bindinput='setunit' value='{{unit}}' |
67 | + disabled="{{page_type}}"></input> | ||
66 | </view> | 68 | </view> |
67 | </view> | 69 | </view> |
68 | <view class='apply_item'> | 70 | <view class='apply_item'> |
69 | <view>职务</view> | 71 | <view>职务</view> |
70 | <view class='apply_item_input'> | 72 | <view class='apply_item_input'> |
71 | - <input placeholder='未填写' placeholder-class='input_p' bindinput='setduty' value='{{duty}}' disabled="{{page_type}}"></input> | 73 | + <input placeholder='未填写' placeholder-class='input_p' bindinput='setduty' value='{{duty}}' |
74 | + disabled="{{page_type}}"></input> | ||
72 | </view> | 75 | </view> |
73 | </view> | 76 | </view> |
74 | <view class='apply_item'> | 77 | <view class='apply_item'> |
75 | <view>通讯地址</view> | 78 | <view>通讯地址</view> |
76 | <view class='apply_item_input'> | 79 | <view class='apply_item_input'> |
77 | - <input placeholder='未填写' placeholder-class='input_p' bindinput='setaddr' value='{{addr}}' disabled="{{page_type}}"></input> | 80 | + <input placeholder='未填写' placeholder-class='input_p' bindinput='setaddr' value='{{addr}}' |
81 | + disabled="{{page_type}}"></input> | ||
78 | </view> | 82 | </view> |
79 | </view> | 83 | </view> |
80 | <view class='apply_item'> | 84 | <view class='apply_item'> |
81 | <view>邮编</view> | 85 | <view>邮编</view> |
82 | <view class='apply_item_input'> | 86 | <view class='apply_item_input'> |
83 | - <input placeholder='未填写' placeholder-class='input_p' bindinput='setpostcode' value='{{postcode}}' disabled="{{page_type}}"></input> | 87 | + <input placeholder='未填写' placeholder-class='input_p' bindinput='setpostcode' value='{{postcode}}' |
88 | + disabled="{{page_type}}"></input> | ||
84 | </view> | 89 | </view> |
85 | </view> | 90 | </view> |
86 | <view class='apply_item'> | 91 | <view class='apply_item'> |
87 | <view>就读/毕业院校</view> | 92 | <view>就读/毕业院校</view> |
88 | <view class='apply_item_input'> | 93 | <view class='apply_item_input'> |
89 | - <input placeholder='未填写' placeholder-class='input_p' bindinput='setschool' value='{{school}}' disabled="{{page_type}}"></input> | 94 | + <input placeholder='未填写' placeholder-class='input_p' bindinput='setschool' value='{{school}}' |
95 | + disabled="{{page_type}}"></input> | ||
90 | </view> | 96 | </view> |
91 | </view> | 97 | </view> |
92 | <view class='apply_item'> | 98 | <view class='apply_item'> |
93 | <view>身份证号</view> | 99 | <view>身份证号</view> |
94 | <view class='apply_item_input'> | 100 | <view class='apply_item_input'> |
95 | - <input placeholder='未填写' placeholder-class='input_p' bindinput='setcard_number' value='{{card_number}}' disabled="{{page_type}}" maxlength="20"></input> | 101 | + <input placeholder='未填写' placeholder-class='input_p' bindinput='setcard_number' value='{{card_number}}' |
102 | + disabled="{{page_type}}" maxlength="20"></input> | ||
96 | </view> | 103 | </view> |
97 | </view> | 104 | </view> |
98 | <view class='apply_item'> | 105 | <view class='apply_item'> |
99 | - <view>固定电话</view> | 106 | + <view>固定电话(选填)</view> |
100 | <view class='apply_item_input'> | 107 | <view class='apply_item_input'> |
101 | - <input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='setfixed_phone' value='{{fixed_phone}}'></input> | 108 | + <input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='setfixed_phone' |
109 | + value='{{fixed_phone}}'></input> | ||
102 | </view> | 110 | </view> |
103 | </view> | 111 | </view> |
104 | <view class='apply_item'> | 112 | <view class='apply_item'> |
105 | <view>移动电话</view> | 113 | <view>移动电话</view> |
106 | <view class='apply_item_input'> | 114 | <view class='apply_item_input'> |
107 | - <input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='setmove_phone' value='{{move_phone}}' disabled="{{page_type}}" maxlength="11"></input> | 115 | + <input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='setmove_phone' value='{{move_phone}}' |
116 | + disabled="{{page_type}}" maxlength="11"></input> | ||
108 | </view> | 117 | </view> |
109 | </view> | 118 | </view> |
110 | <view class='apply_item'> | 119 | <view class='apply_item'> |
111 | <view>电子邮箱</view> | 120 | <view>电子邮箱</view> |
112 | <view class='apply_item_input'> | 121 | <view class='apply_item_input'> |
113 | - <input placeholder='未填写' placeholder-class='input_p' bindinput='setemail' value='{{email}}' disabled="{{page_type}}"></input> | 122 | + <input placeholder='未填写' placeholder-class='input_p' bindinput='setemail' value='{{email}}' |
123 | + disabled="{{page_type}}"></input> | ||
114 | </view> | 124 | </view> |
115 | </view> | 125 | </view> |
116 | <view class='apply_item big_item'> | 126 | <view class='apply_item big_item'> |
117 | <view>紧急联系人及电话</view> | 127 | <view>紧急联系人及电话</view> |
118 | <view class='apply_item_input'> | 128 | <view class='apply_item_input'> |
119 | - <input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='seturgency_phone' value='{{urgency_phone}}' disabled="{{page_type}}"></input> | 129 | + <input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='seturgency_phone' |
130 | + value='{{urgency_phone}}' disabled="{{page_type}}"></input> | ||
120 | </view> | 131 | </view> |
121 | </view> | 132 | </view> |
122 | <view class='apply_item'> | 133 | <view class='apply_item'> |
123 | <view>QQ号码</view> | 134 | <view>QQ号码</view> |
124 | <view class='apply_item_input'> | 135 | <view class='apply_item_input'> |
125 | - <input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='setqq' value='{{qq}}' disabled="{{page_type}}"></input> | 136 | + <input placeholder='未填写' type='number' placeholder-class='input_p' bindinput='setqq' value='{{qq}}' |
137 | + disabled="{{page_type}}"></input> | ||
126 | </view> | 138 | </view> |
127 | </view> | 139 | </view> |
128 | 140 | ||
@@ -138,7 +150,7 @@ | @@ -138,7 +150,7 @@ | ||
138 | 150 | ||
139 | 151 | ||
140 | 152 | ||
141 | - | 153 | +<!-- 个人履历 --> |
142 | <view class='apply_nav'> | 154 | <view class='apply_nav'> |
143 | <view class='apply_cell {{apply_nav==0?"apply_active":""}}' data-apply_nav='0' bindtap='setapply_nav'>个人履历1</view> | 155 | <view class='apply_cell {{apply_nav==0?"apply_active":""}}' data-apply_nav='0' bindtap='setapply_nav'>个人履历1</view> |
144 | <view class='apply_cell {{apply_nav==1?"apply_active":""}}' data-apply_nav='1' bindtap='setapply_nav'>个人履历2</view> | 156 | <view class='apply_cell {{apply_nav==1?"apply_active":""}}' data-apply_nav='1' bindtap='setapply_nav'>个人履历2</view> |
@@ -150,7 +162,8 @@ | @@ -150,7 +162,8 @@ | ||
150 | <view>开始时间</view> | 162 | <view>开始时间</view> |
151 | <view class='apply_item_input'> | 163 | <view class='apply_item_input'> |
152 | <view class='iconfont icon-xiangyou'></view> | 164 | <view class='iconfont icon-xiangyou'></view> |
153 | - <view class='apply_itemtxt {{record[apply_nav].record_start_time?"color333":""}}'>{{record[apply_nav].record_start_time?record[apply_nav].record_start_time:'请选择'}}</view> | 165 | + <view class='apply_itemtxt {{record[apply_nav].record_start_time?"color333":""}}'> |
166 | + {{record[apply_nav].record_start_time?record[apply_nav].record_start_time:'请选择'}}</view> | ||
154 | </view> | 167 | </view> |
155 | </view> | 168 | </view> |
156 | </picker> | 169 | </picker> |
@@ -159,32 +172,37 @@ | @@ -159,32 +172,37 @@ | ||
159 | <view>结束时间</view> | 172 | <view>结束时间</view> |
160 | <view class='apply_item_input'> | 173 | <view class='apply_item_input'> |
161 | <view class='iconfont icon-xiangyou'></view> | 174 | <view class='iconfont icon-xiangyou'></view> |
162 | - <view class='apply_itemtxt {{record[apply_nav].record_end_time?"color333":""}}'>{{record[apply_nav].record_end_time?record[apply_nav].record_end_time:'请选择'}}</view> | 175 | + <view class='apply_itemtxt {{record[apply_nav].record_end_time?"color333":""}}'> |
176 | + {{record[apply_nav].record_end_time?record[apply_nav].record_end_time:'请选择'}}</view> | ||
163 | </view> | 177 | </view> |
164 | </view> | 178 | </view> |
165 | </picker> | 179 | </picker> |
166 | <view class='apply_item'> | 180 | <view class='apply_item'> |
167 | <view>单位名称</view> | 181 | <view>单位名称</view> |
168 | <view class='apply_item_input'> | 182 | <view class='apply_item_input'> |
169 | - <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_unit}}' bindinput='setrecordunit' disabled="{{page_type}}"></input> | 183 | + <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_unit}}' |
184 | + bindinput='setrecordunit' disabled="{{page_type}}"></input> | ||
170 | </view> | 185 | </view> |
171 | </view> | 186 | </view> |
172 | <view class='apply_item'> | 187 | <view class='apply_item'> |
173 | <view>职务</view> | 188 | <view>职务</view> |
174 | <view class='apply_item_input'> | 189 | <view class='apply_item_input'> |
175 | - <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_duty}}' bindinput='setrecordduty' disabled="{{page_type}}"></input> | 190 | + <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_duty}}' |
191 | + bindinput='setrecordduty' disabled="{{page_type}}"></input> | ||
176 | </view> | 192 | </view> |
177 | </view> | 193 | </view> |
178 | <view class='apply_item'> | 194 | <view class='apply_item'> |
179 | <view>证明人</view> | 195 | <view>证明人</view> |
180 | <view class='apply_item_input'> | 196 | <view class='apply_item_input'> |
181 | - <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_name}}' bindinput='setrecordname' disabled="{{page_type}}"></input> | 197 | + <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_name}}' |
198 | + bindinput='setrecordname' disabled="{{page_type}}"></input> | ||
182 | </view> | 199 | </view> |
183 | </view> | 200 | </view> |
184 | <view class='apply_item'> | 201 | <view class='apply_item'> |
185 | <view>证明人电话</view> | 202 | <view>证明人电话</view> |
186 | <view class='apply_item_input'> | 203 | <view class='apply_item_input'> |
187 | - <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_phone}}' bindinput='setrecordphone' disabled="{{page_type}}"></input> | 204 | + <input placeholder='未填写' placeholder-class='input_p' value='{{record[apply_nav].record_phone}}' |
205 | + bindinput='setrecordphone' disabled="{{page_type}}"></input> | ||
188 | </view> | 206 | </view> |
189 | </view> | 207 | </view> |
190 | </view> | 208 | </view> |
@@ -197,7 +215,8 @@ | @@ -197,7 +215,8 @@ | ||
197 | </view> | 215 | </view> |
198 | <view>上传身份证正面</view> | 216 | <view>上传身份证正面</view> |
199 | </view> | 217 | </view> |
200 | - <image src='{{front_card?front_card:"https://volunteer.cnpu.org/imgs/renzhengxinxi_fanmian_bg@2x.png"}}' mode="aspectFill"></image> | 218 | + <image src='{{front_card?front_card:"https://volunteer.cnpu.org/imgs/renzhengxinxi_fanmian_bg@2x.png"}}' |
219 | + mode="aspectFill"></image> | ||
201 | </view> | 220 | </view> |
202 | <view class='apply_idimg' bindtap="{{page_type?'':'uploadImages'}}" data-tem='3'> | 221 | <view class='apply_idimg' bindtap="{{page_type?'':'uploadImages'}}" data-tem='3'> |
203 | <view class='apply_idimgmain' wx:if='{{!reverse_card}}'> | 222 | <view class='apply_idimgmain' wx:if='{{!reverse_card}}'> |
@@ -206,27 +225,36 @@ | @@ -206,27 +225,36 @@ | ||
206 | </view> | 225 | </view> |
207 | <view>上传身份证反面</view> | 226 | <view>上传身份证反面</view> |
208 | </view> | 227 | </view> |
209 | - <image src='{{reverse_card?reverse_card:"https://volunteer.cnpu.org/imgs/renzhengxinxi_zhengmian_bg@2x.png"}}'></image> | 228 | + <image src='{{reverse_card?reverse_card:"https://volunteer.cnpu.org/imgs/renzhengxinxi_zhengmian_bg@2x.png"}}'> |
229 | + </image> | ||
210 | </view> | 230 | </view> |
211 | </view> | 231 | </view> |
212 | <view class='apply_bottomtitle' wx:if="{{!page_type}}">志愿者申请书 | 232 | <view class='apply_bottomtitle' wx:if="{{!page_type}}">志愿者申请书 |
213 | </view> | 233 | </view> |
214 | <view class='apply_bottom' wx:if="{{!page_type}}"> | 234 | <view class='apply_bottom' wx:if="{{!page_type}}"> |
215 | - 为继承和弘扬国际主义战士白求恩的伟大风范和高尚情操,传承和弘扬白求恩的伟大精神,本人自愿申请加入白求恩志愿者队伍。 本人愿尽己所能,以“志愿服务”为宗旨,不计报酬、帮助他人、服务社会,恪守国家法律、法规,遵守白求恩志愿者各项规章制度,努力工作,尽职尽责,力争为公益事业做出贡献。 | 235 | + 为继承和弘扬国际主义战士白求恩的伟大风范和高尚情操,传承和弘扬白求恩的伟大精神,本人自愿申请加入白求恩志愿者队伍。本人愿尽己所能,以“志愿服务”为宗旨,不计报酬、帮助他人、服务社会,恪守国家法律、法规,遵守白求恩志愿者各项规章制度,努力工作,尽职尽责,力争为公益事业做出贡献。 |
236 | +</view> | ||
237 | +<view wx:if="{{status==1}}"> | ||
238 | + <form wx:if="{{!page_type}}" bindsubmit="submit" report-submit='true' class="apply_btn"> | ||
239 | + <button class="a_btn" form-type="submit" style="">提交</button> | ||
240 | + </form> | ||
241 | +</view> | ||
242 | +<view wx:if="{{status==2}}"> | ||
243 | + <form wx:if="{{!page_type}}" report-submit='true' class="apply_btn"> | ||
244 | + <button class="a_btn gray" form-type="submit" style="">提交</button> | ||
245 | + </form> | ||
216 | </view> | 246 | </view> |
217 | 247 | ||
218 | 248 | ||
219 | -<form wx:if="{{!page_type}}" bindsubmit="submit" report-submit='true' class="apply_btn"> | ||
220 | - <button class="a_btn" form-type="submit" style="">提交</button> | ||
221 | -</form> | ||
222 | - | ||
223 | <!-- 服务区域 --> | 249 | <!-- 服务区域 --> |
224 | <view class='apply_vold' wx:if='{{showapply}}'> | 250 | <view class='apply_vold' wx:if='{{showapply}}'> |
225 | <view class='pickerview'> | 251 | <view class='pickerview'> |
226 | - <picker-view indicator-style="height: 40px;" class='pickerview_top' value="{{confirmvalarr}}" bindchange="bindChange"> | 252 | + <picker-view indicator-style="height: 40px;" class='pickerview_top' value="{{confirmvalarr}}" |
253 | + bindchange="bindChange"> | ||
227 | <view class='iconfont icon-guanbi1' catchtap='setshowapply_no'></view> | 254 | <view class='iconfont icon-guanbi1' catchtap='setshowapply_no'></view> |
228 | <picker-view-column> | 255 | <picker-view-column> |
229 | - <view wx:for="{{provincearr}}" wx:key style="line-height: 40px" class='column_view'>{{ item.province_name}}</view> | 256 | + <view wx:for="{{provincearr}}" wx:key style="line-height: 40px" class='column_view'>{{ item.province_name}} |
257 | + </view> | ||
230 | </picker-view-column> | 258 | </picker-view-column> |
231 | <picker-view-column> | 259 | <picker-view-column> |
232 | <view wx:for="{{cityarr}}" wx:key style="line-height: 40px" class='column_view'>{{item.city_name}}</view> | 260 | <view wx:for="{{cityarr}}" wx:key style="line-height: 40px" class='column_view'>{{item.city_name}}</view> |
zhiyuanzhe/pages/getNewsInfo/getNewsInfo.js
0 → 100644
1 | +// pages/getNewsInfo/getNewsInfo.js | ||
2 | +const app = getApp(); | ||
3 | +Page({ | ||
4 | + | ||
5 | + | ||
6 | + data: { | ||
7 | + id: '', | ||
8 | + list: '' | ||
9 | + }, | ||
10 | + // | ||
11 | + getactive() { | ||
12 | + | ||
13 | + let that = this; | ||
14 | + let url = '/index/second/getNewsInfo'; | ||
15 | + let head = { | ||
16 | + 'XX-Token': wx.getStorageSync('token') | ||
17 | + } | ||
18 | + let params = { | ||
19 | + id: that.data.id | ||
20 | + } | ||
21 | + app.post(url,params, head).then((res) => { | ||
22 | + console.log(res) | ||
23 | + that.setData({ | ||
24 | + list: res | ||
25 | + | ||
26 | + }) | ||
27 | + }).catch((err) => { | ||
28 | + | ||
29 | + }) | ||
30 | + | ||
31 | + }, | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + /** | ||
36 | + * 生命周期函数--监听页面加载 | ||
37 | + */ | ||
38 | + onLoad: function (options) { | ||
39 | + // console.log(options) | ||
40 | + this.setData({ | ||
41 | + id: options.id | ||
42 | + | ||
43 | + }) | ||
44 | + }, | ||
45 | + | ||
46 | + /** | ||
47 | + * 生命周期函数--监听页面初次渲染完成 | ||
48 | + */ | ||
49 | + onReady: function () { | ||
50 | + | ||
51 | + }, | ||
52 | + | ||
53 | + /** | ||
54 | + * 生命周期函数--监听页面显示 | ||
55 | + */ | ||
56 | + onShow: function () { | ||
57 | + let that = this; | ||
58 | + that.getactive() | ||
59 | + | ||
60 | + | ||
61 | + }, | ||
62 | + | ||
63 | + /** | ||
64 | + * 生命周期函数--监听页面隐藏 | ||
65 | + */ | ||
66 | + onHide: function () { | ||
67 | + | ||
68 | + }, | ||
69 | + | ||
70 | + /** | ||
71 | + * 生命周期函数--监听页面卸载 | ||
72 | + */ | ||
73 | + onUnload: function () { | ||
74 | + | ||
75 | + }, | ||
76 | + | ||
77 | + /** | ||
78 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
79 | + */ | ||
80 | + onPullDownRefresh: function () { | ||
81 | + | ||
82 | + }, | ||
83 | + | ||
84 | + /** | ||
85 | + * 页面上拉触底事件的处理函数 | ||
86 | + */ | ||
87 | + onReachBottom: function () { | ||
88 | + | ||
89 | + }, | ||
90 | + | ||
91 | + /** | ||
92 | + * 用户点击右上角分享 | ||
93 | + */ | ||
94 | + onShareAppMessage: function () { | ||
95 | + | ||
96 | + } | ||
97 | +}) |
1 | +<view class="newinfo_banner"> | ||
2 | + <image src="{{list.thumbnail}}"></image> | ||
3 | +</view> | ||
4 | +<view class="newinfo_list"> | ||
5 | + <view class="goods_title">{{list.activity_name}}</view> | ||
6 | + <view class="goods_name"> | ||
7 | + <image src="/imgs/zhiyuan1.png"></image> {{list.author}} | ||
8 | + <image class="goods_time" src="/imgs/zhiyuan2.png"></image>{{list.create_time}} | ||
9 | + </view> | ||
10 | + <view class="newinfo_text"> | ||
11 | + <rich-text nodes="{{list.content}}"></rich-text> | ||
12 | + </view> | ||
13 | + | ||
14 | +</view> |
1 | +image { | ||
2 | + width: 100%; | ||
3 | + height: 400rpx; | ||
4 | +} | ||
5 | + | ||
6 | +.newinfo_list { | ||
7 | + /* margin-top: -10rpx; */ | ||
8 | + /* padding: 0 32rpx; */ | ||
9 | + /* border-top-left-radius: 10px; | ||
10 | + border-top-right-radius: 10px; */ | ||
11 | + margin: 0 32rpx; | ||
12 | +} | ||
13 | + | ||
14 | +.goods_title { | ||
15 | + margin-top: 32rpx; | ||
16 | + /* height: 52rpx; */ | ||
17 | + font-size: 36rpx; | ||
18 | + font-weight: 600; | ||
19 | + | ||
20 | +} | ||
21 | + | ||
22 | +.goods_name { | ||
23 | + padding: 24rpx 0; | ||
24 | + display: flex; | ||
25 | + align-items: center; | ||
26 | + font-size: 28rpx; | ||
27 | + color: #7d7e80; | ||
28 | +} | ||
29 | + | ||
30 | +.goods_name image { | ||
31 | + width: 36rpx; | ||
32 | + height: 36rpx; | ||
33 | + | ||
34 | +} | ||
35 | + | ||
36 | +.goods_time { | ||
37 | + margin-left: 58rpx; | ||
38 | +} | ||
39 | + | ||
40 | +.newinfo_text { | ||
41 | + text-align: justify; | ||
42 | + color: #5D5D5D; | ||
43 | + | ||
44 | +} |
1 | +const app = getApp(); | ||
2 | +Page({ | ||
3 | + | ||
4 | + | ||
5 | + data: { | ||
6 | + id: '', | ||
7 | + list: '', | ||
8 | + answers:[], | ||
9 | + finaAnswer:[], | ||
10 | + showAnswer: false | ||
11 | + }, | ||
12 | + | ||
13 | + onLoad: function (options) { | ||
14 | + // console.log(options) | ||
15 | + this.setData({ | ||
16 | + id: options.id | ||
17 | + }) | ||
18 | + }, | ||
19 | + onReady: function () { | ||
20 | + | ||
21 | + }, | ||
22 | + onShow: function () { | ||
23 | + let that = this; | ||
24 | + that.getlist(); | ||
25 | + | ||
26 | + }, | ||
27 | + // 题 | ||
28 | + getlist() { | ||
29 | + | ||
30 | + let that = this; | ||
31 | + let url = '/index/second/getClassQuestion'; | ||
32 | + let head = { | ||
33 | + 'XX-Token': wx.getStorageSync('token') | ||
34 | + } | ||
35 | + let params = { | ||
36 | + class_id: that.data.id | ||
37 | + } | ||
38 | + app.post(url, params, head).then((res) => { | ||
39 | + console.log(res) | ||
40 | + that.setData({ | ||
41 | + list: res, | ||
42 | + tempList:JSON.parse(JSON.stringify(res)) | ||
43 | + }) | ||
44 | + }).catch((err) => { | ||
45 | + | ||
46 | + }) | ||
47 | + | ||
48 | + }, | ||
49 | + radioChange(e){ | ||
50 | + let tempAnswer = e.detail.value.split(','); | ||
51 | + this.data.answers[tempAnswer[1]] = tempAnswer[0]; | ||
52 | + this.data.finaAnswer[tempAnswer[1]]={ | ||
53 | + key: tempAnswer[0], | ||
54 | + answer: tempAnswer[1] | ||
55 | + } | ||
56 | + this.data.list[tempAnswer[1]].choose = tempAnswer[2] | ||
57 | + this.setData({ | ||
58 | + answers: this.data.answers, | ||
59 | + finaAnswer:this.data.finaAnswer, | ||
60 | + list:this.data.list | ||
61 | + }) | ||
62 | + }, | ||
63 | + | ||
64 | + // 确认 | ||
65 | + getcomfirm() { | ||
66 | + | ||
67 | + let that = this; | ||
68 | + let url = '/index/second/commitAnswer'; | ||
69 | + let head = { | ||
70 | + 'XX-Token': wx.getStorageSync('token') | ||
71 | + } | ||
72 | + let params = { | ||
73 | + class_id: that.data.id, | ||
74 | + } | ||
75 | + app.post(url, params, head).then((res) => { | ||
76 | + | ||
77 | + if (res.code == '40000') { | ||
78 | + let answer = res | ||
79 | + wx.showModal({ | ||
80 | + title: '提示', | ||
81 | + content: '很遗憾你没有获得学时', | ||
82 | + confirmText: '重新答题', | ||
83 | + cancelText: '查看答案', | ||
84 | + success(res) { | ||
85 | + if (res.confirm) { | ||
86 | + wx.redirectTo({ | ||
87 | + url: '/pages/getStudycontent/answer/answer?id='+that.data.id, | ||
88 | + }) | ||
89 | + // let tempList = JSON.stringify(that.data.tempList) | ||
90 | + // that.setData({ | ||
91 | + // showAnswer: false, | ||
92 | + // // list: JSON.parse(tempList) | ||
93 | + // }) | ||
94 | + console.log('用户点击确定') | ||
95 | + } else if (res.cancel) { | ||
96 | + | ||
97 | + // wx.navigateTo({ | ||
98 | + // url: '/pages/getStudycontent/answer/answer', | ||
99 | + // }) | ||
100 | + that.setData({ | ||
101 | + showAnswer: true | ||
102 | + }) | ||
103 | + | ||
104 | + console.log('用户点击取消') | ||
105 | + } | ||
106 | + } | ||
107 | + }) | ||
108 | + | ||
109 | + | ||
110 | + } else { | ||
111 | + wx.showModal({ | ||
112 | + title: '提示', | ||
113 | + content: '恭喜', | ||
114 | + showCancel: false, | ||
115 | + success: function (res) { | ||
116 | + | ||
117 | + } | ||
118 | + }) | ||
119 | + } | ||
120 | + | ||
121 | + | ||
122 | + }).catch((err) => { | ||
123 | + console.log(err) | ||
124 | + }) | ||
125 | + | ||
126 | + | ||
127 | + }, | ||
128 | + | ||
129 | + | ||
130 | + onHide: function () { | ||
131 | + | ||
132 | + }, | ||
133 | + | ||
134 | + | ||
135 | + onUnload: function () { | ||
136 | + | ||
137 | + }, | ||
138 | + | ||
139 | + /** | ||
140 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
141 | + */ | ||
142 | + onPullDownRefresh: function () { | ||
143 | + | ||
144 | + }, | ||
145 | + | ||
146 | + /** | ||
147 | + * 页面上拉触底事件的处理函数 | ||
148 | + */ | ||
149 | + onReachBottom: function () { | ||
150 | + | ||
151 | + }, | ||
152 | + | ||
153 | + /** | ||
154 | + * 用户点击右上角分享 | ||
155 | + */ | ||
156 | + onShareAppMessage: function () { | ||
157 | + | ||
158 | + } | ||
159 | +}) |
1 | +<view class="answer" wx:for="{{list}}" wx:for-index="index"> | ||
2 | + <view class="answer_left" wx:if="{{item.id<9}}">0{{item.id}}</view> | ||
3 | + <view class="answer_left" wx:else>{{item.id}}</view> | ||
4 | + <view class="answer_right"> | ||
5 | + <view class="answer_question">{{item.title}}</view> | ||
6 | + <radio-group bindchange="radioChange"> | ||
7 | + <view class="flexs" wx:for="{{item.options_array}}" wx:for-index="idx" wx:for-item="second"> | ||
8 | + <view class="answer_answer"> | ||
9 | + <radio value="{{second+','+index+','+idx}}" checked=''>{{second}}</radio> | ||
10 | + <block wx:if="{{showAnswer}}"> | ||
11 | + {{answer[index]}} | ||
12 | + <image src="/imgs/zhengque-5.png" wx:if="{{item.answer==idx}}"></image> | ||
13 | + <image src="/imgs/cuowu-3.png" wx:if='{{item.choose==idx}}'></image> | ||
14 | + </block> | ||
15 | + </view> | ||
16 | + | ||
17 | + </view> | ||
18 | + </radio-group> | ||
19 | + | ||
20 | + </view> | ||
21 | +</view> | ||
22 | +<view class="shengqin"> | ||
23 | + <button bindtap="getcomfirm">确认</button> | ||
24 | +</view> | ||
25 | + | ||
26 | +<!-- 答案 --> | ||
27 | +<!-- <view class="answer" wx:for="{{list}}" wx:for-index="index"> | ||
28 | + <view class="answer_left" wx:if="{{item.id<9}}">0{{item.id}}</view> | ||
29 | + <view class="answer_left" wx:else>{{item.id}}</view> | ||
30 | + <view class="answer_right"> | ||
31 | + <view class="answer_question">{{item.title}}</view> | ||
32 | + <radio-group bindchange="radioChange"> | ||
33 | + <view class="flexs" wx:for="{{item.options_array}}" wx:for-index="idx" wx:for-item="second"> | ||
34 | + <view class="answer_answer"> | ||
35 | + <radio value="{{second+','+index}}" checked='{{item.choose}}'>{{second}}</radio> | ||
36 | + | ||
37 | + </view> | ||
38 | + | ||
39 | + </view> | ||
40 | + </radio-group> | ||
41 | + | ||
42 | + </view> | ||
43 | +</view> --> | ||
44 | +<view class="shengqin"> | ||
45 | + <button bindtap="getcomfirm">确认</button> | ||
46 | +</view> |
1 | +page { | ||
2 | + background-color: rgb(240, 240, 240); | ||
3 | +} | ||
4 | + | ||
5 | +.answer { | ||
6 | + padding: 32rpx 24rpx; | ||
7 | + margin: 34rpx 32rpx; | ||
8 | + border-radius: 16rpx; | ||
9 | + background-color: #ffffff; | ||
10 | + display: flex; | ||
11 | +} | ||
12 | + | ||
13 | +.answer_left { | ||
14 | + font-size: 48rpx; | ||
15 | + color: #C8C9CC; | ||
16 | + margin-right: 20rpx; | ||
17 | +} | ||
18 | + | ||
19 | +.answer_right { | ||
20 | + font-size: 28rpx; | ||
21 | + color: #7D7E80; | ||
22 | +} | ||
23 | + | ||
24 | +.answer_question { | ||
25 | + font-size: 32rpx; | ||
26 | + color: #323233; | ||
27 | + | ||
28 | +} | ||
29 | + | ||
30 | +.answer_answer { | ||
31 | + margin-top: 36rpx; | ||
32 | + display: flex; | ||
33 | + align-items: center; | ||
34 | +} | ||
35 | +.flexs{ | ||
36 | + | ||
37 | + display: flex; | ||
38 | + flex-direction: column; | ||
39 | + | ||
40 | +} | ||
41 | +.flexs image{ | ||
42 | + width: 28rpx; | ||
43 | + height: 28rpx; | ||
44 | + margin-left: 22rpx; | ||
45 | +} | ||
46 | +/*单选框样式修改 */ | ||
47 | + | ||
48 | +/* 选中后的 背景样式 (红色背景 无边框 可根据UI需求自己修改) */ | ||
49 | + | ||
50 | +radio .wx-radio-input.wx-radio-input-checked { | ||
51 | + border-color: #099D43; | ||
52 | + background: #099D43; | ||
53 | + | ||
54 | + } | ||
55 | + /* 未选中的 背景样式 */ | ||
56 | +checkbox .wx-checkbox-input{ | ||
57 | + border-color: #999; | ||
58 | + border-radius: 50%;/* 圆角 */ | ||
59 | + height: 28rpx; | ||
60 | + width: 28rpx; | ||
61 | + } | ||
62 | + | ||
63 | + /* 自定义样式.... */ | ||
64 | + | ||
65 | + radio .wx-radio-input { | ||
66 | + height: 28rpx; | ||
67 | + width: 28rpx; | ||
68 | + margin-top: -4rpx; | ||
69 | + border-radius: 50%; | ||
70 | + border: 2rpx solid #999; | ||
71 | + background: transparent; | ||
72 | + } | ||
73 | + | ||
74 | +/* 选中后的 对勾样式 (白色对勾 可根据UI需求自己修改) */ | ||
75 | + | ||
76 | +radio .wx-radio-input.wx-radio-input-checked::before { | ||
77 | + | ||
78 | + border-radius: 50%; /* 圆角 */ | ||
79 | + width: 28rpx; /* 选中后对勾大小,不要超过背景的尺寸 */ | ||
80 | + height: 28rpx; /* 选中后对勾大小,不要超过背景的尺寸 */ | ||
81 | + line-height: 28rpx; | ||
82 | + text-align: center; | ||
83 | + font-size: 28rpx; /* 对勾大小 30rpx */ | ||
84 | + color: #099D43; /* 对勾颜色 白色 */ | ||
85 | + background: #ffffff; | ||
86 | + transform: translate(-50%, -50%) scale(1); | ||
87 | + -webkit-transform: translate(-50%, -50%) scale(1); | ||
88 | + } | ||
89 | + | ||
90 | + | ||
91 | +/* */ | ||
92 | +.shengqin { | ||
93 | + height: 122rpx; | ||
94 | + background-color: #ffffff; | ||
95 | + font-size: 32rpx; | ||
96 | + position: fixed; | ||
97 | + left: 0; | ||
98 | + right: 0; | ||
99 | + bottom: 0; | ||
100 | + display: flex; | ||
101 | + align-items: center; | ||
102 | +} | ||
103 | + | ||
104 | +.shengqin button { | ||
105 | + width: 622rpx; | ||
106 | + height: 88rpx; | ||
107 | + color: #ffffff; | ||
108 | + border-radius: 22px; | ||
109 | + background: linear-gradient(130deg, #2ed26e 13%, #05983e 98%); | ||
110 | + box-shadow: 0px 9px 19px 0px rgba(0, 116, 45, 0.42); | ||
111 | + | ||
112 | +} |
1 | +const app = getApp() | ||
2 | + | ||
3 | +Page({ | ||
4 | + | ||
5 | + /** | ||
6 | + * 页面的初始数据 | ||
7 | + */ | ||
8 | + data: { | ||
9 | + id: '', | ||
10 | + list: '' | ||
11 | + }, | ||
12 | + onLoad: function (options) { | ||
13 | + // console.log(options) | ||
14 | + this.setData({ | ||
15 | + id: options.id | ||
16 | + }) | ||
17 | + }, | ||
18 | + | ||
19 | + onReady: function () { | ||
20 | + | ||
21 | + }, | ||
22 | + | ||
23 | + onShow: function () { | ||
24 | + let that = this; | ||
25 | + that.getlist(); | ||
26 | + | ||
27 | + | ||
28 | + }, | ||
29 | + | ||
30 | + // 答题 | ||
31 | + getanswer() { | ||
32 | + let that = this | ||
33 | + var id = that.data.id | ||
34 | + console.log(id) | ||
35 | + wx.navigateTo({ | ||
36 | + url: '/pages/getStudycontent/answer/answer?id='+id, | ||
37 | + }) | ||
38 | + | ||
39 | + }, | ||
40 | + // 内容 | ||
41 | + getlist() { | ||
42 | + | ||
43 | + let that = this; | ||
44 | + let url = '/index/second/getClassInfo'; | ||
45 | + let head = { | ||
46 | + 'XX-Token': wx.getStorageSync('token') | ||
47 | + } | ||
48 | + let params = { | ||
49 | + id: that.data.id | ||
50 | + } | ||
51 | + app.post(url, params, head).then((res) => { | ||
52 | + console.log(res) | ||
53 | + that.setData({ | ||
54 | + list: res | ||
55 | + | ||
56 | + }) | ||
57 | + }).catch((err) => { | ||
58 | + | ||
59 | + }) | ||
60 | + | ||
61 | + }, | ||
62 | + | ||
63 | + | ||
64 | + | ||
65 | + | ||
66 | + | ||
67 | + | ||
68 | + | ||
69 | + | ||
70 | + | ||
71 | + onHide: function () { | ||
72 | + | ||
73 | + }, | ||
74 | + | ||
75 | + /** | ||
76 | + * 生命周期函数--监听页面卸载 | ||
77 | + */ | ||
78 | + onUnload: function () { | ||
79 | + | ||
80 | + }, | ||
81 | + | ||
82 | + /** | ||
83 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
84 | + */ | ||
85 | + onPullDownRefresh: function () { | ||
86 | + | ||
87 | + }, | ||
88 | + | ||
89 | + /** | ||
90 | + * 页面上拉触底事件的处理函数 | ||
91 | + */ | ||
92 | + onReachBottom: function () { | ||
93 | + | ||
94 | + }, | ||
95 | + | ||
96 | + /** | ||
97 | + * 用户点击右上角分享 | ||
98 | + */ | ||
99 | + onShareAppMessage: function () { | ||
100 | + | ||
101 | + } | ||
102 | +}) |
1 | +<!--pages/getStudycontent/getStudycontent.wxml--> | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | +<view class="answer_text"> | ||
6 | + | ||
7 | + <view class="answer_title"> | ||
8 | + {{list.title}} | ||
9 | + </view> | ||
10 | + <view class="answer_author"> | ||
11 | + <image src="/imgs/zhiyuan3.png"></image> {{list.author}} | ||
12 | + <image style="margin-left:64rpx" src="/imgs/zhiyuan4.png"></image> {{list.work_time}} | ||
13 | + </view> | ||
14 | + <rich-text nodes="{{list.content}}"></rich-text> | ||
15 | +</view> | ||
16 | +<view class="answer" bindtap="getanswer"> | ||
17 | + <button hover-class="none">去答题</button> | ||
18 | +</view> |
1 | +.answer_title { | ||
2 | + | ||
3 | + font-size: 36rpx; | ||
4 | + color: black; | ||
5 | +} | ||
6 | + | ||
7 | +.answer_author { | ||
8 | + display: flex; | ||
9 | + align-items: center; | ||
10 | + margin: 24rpx 0; | ||
11 | + | ||
12 | +} | ||
13 | + | ||
14 | +.answer_author image { | ||
15 | + width: 30rpx; | ||
16 | + height: 30rpx; | ||
17 | + background: #666666; | ||
18 | + margin-right: 8rpx; | ||
19 | +} | ||
20 | + | ||
21 | +.answer_text { | ||
22 | + padding: 24rpx 32rpx; | ||
23 | + font-size: 28rpx; | ||
24 | + color: #5D5D5D; | ||
25 | +} | ||
26 | + | ||
27 | + | ||
28 | +.answer { | ||
29 | + width: 100%; | ||
30 | + height: 122rpx; | ||
31 | + position: fixed; | ||
32 | + bottom: 0; | ||
33 | + box-shadow: 0px -6px 15px 0px rgba(0, 67, 26, 0.06); | ||
34 | + display: flex; | ||
35 | + align-items: center; | ||
36 | + | ||
37 | +} | ||
38 | + | ||
39 | +button { | ||
40 | + width: 622rpx; | ||
41 | + height: 88rpx; | ||
42 | + color: #ffffff; | ||
43 | + font-size: 32rpx; | ||
44 | + background: linear-gradient(130deg, #2ed26e 13%, #05983e 98%); | ||
45 | + border-radius: 22px; | ||
46 | + box-shadow: 0px 9px 19px 0px rgba(0, 116, 45, 0.42); | ||
47 | +} |
1 | +//index.js | ||
2 | +const app = getApp(); | ||
3 | +Page({ | ||
4 | + data: { | ||
5 | + nav: 1, | ||
6 | + navs: 1, | ||
7 | + list: [], | ||
8 | + | ||
9 | + }, | ||
10 | + //切换 | ||
11 | + | ||
12 | + | ||
13 | + bindNav(e) { | ||
14 | + var nav = e.currentTarget.dataset.nav | ||
15 | + console.log(nav) | ||
16 | + this.setData({ | ||
17 | + nav | ||
18 | + }) | ||
19 | + | ||
20 | + this.getaList(); | ||
21 | + | ||
22 | + }, | ||
23 | + bindtype(e) { | ||
24 | + var navs = e.currentTarget.dataset.navs | ||
25 | + console.log(navs) | ||
26 | + this.setData({ | ||
27 | + navs | ||
28 | + }) | ||
29 | + | ||
30 | + this.getaList(); | ||
31 | + }, | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + onShow() { | ||
38 | + | ||
39 | + let that = this; | ||
40 | + this.getaList(); | ||
41 | + | ||
42 | + }, | ||
43 | + | ||
44 | + onLoad: function () { | ||
45 | + | ||
46 | + }, | ||
47 | + | ||
48 | + getaList() { | ||
49 | + | ||
50 | + let that = this; | ||
51 | + let url = '/index/second/getRank'; | ||
52 | + let head = { | ||
53 | + 'XX-Token': wx.getStorageSync('token') | ||
54 | + } | ||
55 | + | ||
56 | + let params = { | ||
57 | + type: that.data.nav, | ||
58 | + star: that.data.navs | ||
59 | + } | ||
60 | + | ||
61 | + console.log(params) | ||
62 | + app.post(url, params, head).then((res) => { | ||
63 | + console.log(res) | ||
64 | + that.setData({ | ||
65 | + list: res | ||
66 | + | ||
67 | + }) | ||
68 | + }).catch((err) => { | ||
69 | + | ||
70 | + }) | ||
71 | + | ||
72 | + }, | ||
73 | + | ||
74 | + | ||
75 | + | ||
76 | + | ||
77 | + | ||
78 | + | ||
79 | + | ||
80 | + | ||
81 | + | ||
82 | +}) |
-
请 注册 或 登录 后发表评论