合并分支 'wumengyu' 到 'master'
添加逆解析域名,优化申诉上传图片,去掉console 查看合并请求 !16
正在显示
22 个修改的文件
包含
211 行增加
和
318 行删除
@@ -25,7 +25,7 @@ var getLocation = function (self) {//当第一次未授æƒæ—¶éœ€è¦é‡æ–°è°ƒç”¨æ | @@ -25,7 +25,7 @@ var getLocation = function (self) {//当第一次未授æƒæ—¶éœ€è¦é‡æ–°è°ƒç”¨æ | ||
25 | longitude: res.longitude//经度 | 25 | longitude: res.longitude//经度 |
26 | }, | 26 | }, |
27 | success: function (res) { | 27 | success: function (res) { |
28 | - console.log('城市', res); | 28 | + // console.log('城市', res); |
29 | wx.setStorageSync('city', res.result.address_component.city); | 29 | wx.setStorageSync('city', res.result.address_component.city); |
30 | let params = { | 30 | let params = { |
31 | city: res.result.address_component.city, | 31 | city: res.result.address_component.city, |
@@ -86,7 +86,7 @@ Page({ | @@ -86,7 +86,7 @@ Page({ | ||
86 | "XX-token": wx.getStorageSync('token') | 86 | "XX-token": wx.getStorageSync('token') |
87 | }; | 87 | }; |
88 | app.post(url, {}, header).then((res) => { | 88 | app.post(url, {}, header).then((res) => { |
89 | - console.log(res); | 89 | + // console.log(res); |
90 | if (res.is_binding) { | 90 | if (res.is_binding) { |
91 | this.setData({is_bingding: true}) | 91 | this.setData({is_bingding: true}) |
92 | } else { | 92 | } else { |
@@ -102,7 +102,7 @@ Page({ | @@ -102,7 +102,7 @@ Page({ | ||
102 | }, | 102 | }, |
103 | //打卡 | 103 | //打卡 |
104 | punch() { | 104 | punch() { |
105 | - console.log('city', wx.getStorageSync('city')); | 105 | + // console.log('city', wx.getStorageSync('city')); |
106 | if(wx.getStorageSync('city') !== '') { | 106 | if(wx.getStorageSync('city') !== '') { |
107 | if (this.data.test.name !== '') { | 107 | if (this.data.test.name !== '') { |
108 | let url = '/portal/Experiment/user_sign'; | 108 | let url = '/portal/Experiment/user_sign'; |
@@ -115,7 +115,7 @@ Page({ | @@ -115,7 +115,7 @@ Page({ | ||
115 | lng: this.data.longitude, | 115 | lng: this.data.longitude, |
116 | }; | 116 | }; |
117 | app.post(url, params, header).then((res) => { | 117 | app.post(url, params, header).then((res) => { |
118 | - console.log('打卡结果', res); | 118 | + // console.log('打卡结果', res); |
119 | if (res.is_success) { | 119 | if (res.is_success) { |
120 | this.setData({ | 120 | this.setData({ |
121 | punchState: false, | 121 | punchState: false, |
@@ -153,7 +153,7 @@ Page({ | @@ -153,7 +153,7 @@ Page({ | ||
153 | "XX-token": wx.getStorageSync('token') | 153 | "XX-token": wx.getStorageSync('token') |
154 | }; | 154 | }; |
155 | app.post(url, params, header).then((res) => { | 155 | app.post(url, params, header).then((res) => { |
156 | - console.log('获取用户所在实验室', res); | 156 | + // console.log('获取用户所在实验室', res); |
157 | if(res === undefined) { | 157 | if(res === undefined) { |
158 | this.setData({ | 158 | this.setData({ |
159 | ['test.name']: '' | 159 | ['test.name']: '' |
@@ -168,10 +168,9 @@ Page({ | @@ -168,10 +168,9 @@ Page({ | ||
168 | }, | 168 | }, |
169 | //打卡页面获取位置授权 | 169 | //打卡页面获取位置授权 |
170 | getExperiment() { | 170 | getExperiment() { |
171 | - console.log('实验室'); | ||
172 | const self = this; | 171 | const self = this; |
173 | - if (wx.getStorageSync('city') !== '') {//如果第一次授权过 | ||
174 | - console.log(111); | 172 | + if (wx.getStorageSync('city') !== '') { //如果第一次授权过 |
173 | + console.log('如果第一次授权过'); | ||
175 | wx.getLocation({ | 174 | wx.getLocation({ |
176 | type: 'wgs84', | 175 | type: 'wgs84', |
177 | success(res) { | 176 | success(res) { |
@@ -185,10 +184,10 @@ Page({ | @@ -185,10 +184,10 @@ Page({ | ||
185 | } | 184 | } |
186 | }); | 185 | }); |
187 | } else {//重新调起授权 | 186 | } else {//重新调起授权 |
188 | - console.log('获取当前城市'); | 187 | + console.log('重新调起授权,获取当前城市'); |
189 | wx.getSetting({ | 188 | wx.getSetting({ |
190 | success: (res) => { | 189 | success: (res) => { |
191 | - console.log('成功'); | 190 | + // console.log('成功'); |
192 | if (res.authSetting['scope.userLocation'] != undefined && res.authSetting['scope.userLocation'] != true) {//非初始化进入该页面,且未授权 | 191 | if (res.authSetting['scope.userLocation'] != undefined && res.authSetting['scope.userLocation'] != true) {//非初始化进入该页面,且未授权 |
193 | console.log('非初始化进入该页面,且未授权'); | 192 | console.log('非初始化进入该页面,且未授权'); |
194 | wx.showModal({ | 193 | wx.showModal({ |
@@ -22,7 +22,7 @@ Page({ | @@ -22,7 +22,7 @@ Page({ | ||
22 | tabCharge(e) { | 22 | tabCharge(e) { |
23 | var index = +e.currentTarget.dataset.current | 23 | var index = +e.currentTarget.dataset.current |
24 | var current = this.data.current | 24 | var current = this.data.current |
25 | - console.log('index', index); | 25 | + // console.log('index', index); |
26 | if (index == current) { | 26 | if (index == current) { |
27 | return false | 27 | return false |
28 | } else { | 28 | } else { |
@@ -33,7 +33,7 @@ Page({ | @@ -33,7 +33,7 @@ Page({ | ||
33 | examining:[] | 33 | examining:[] |
34 | }); | 34 | }); |
35 | if(index !== 0) { | 35 | if(index !== 0) { |
36 | - console.log('aa'); | 36 | + // console.log('aa'); |
37 | this.getMyComplain(index) | 37 | this.getMyComplain(index) |
38 | } | 38 | } |
39 | } | 39 | } |
@@ -71,7 +71,7 @@ Page({ | @@ -71,7 +71,7 @@ Page({ | ||
71 | sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有 | 71 | sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有 |
72 | sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 | 72 | sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 |
73 | success: function (res) { | 73 | success: function (res) { |
74 | - console.log(res); | 74 | + // console.log(res); |
75 | const tempFilePaths = res.tempFilePaths; | 75 | const tempFilePaths = res.tempFilePaths; |
76 | let token = wx.getStorageSync('token'); | 76 | let token = wx.getStorageSync('token'); |
77 | let uploadImgCount = 0; | 77 | let uploadImgCount = 0; |
@@ -91,7 +91,7 @@ Page({ | @@ -91,7 +91,7 @@ Page({ | ||
91 | success: function(res) { | 91 | success: function(res) { |
92 | uploadImgCount++; | 92 | uploadImgCount++; |
93 | let data = JSON.parse(res.data); | 93 | let data = JSON.parse(res.data); |
94 | - console.log('data',data); | 94 | + // console.log('data',data); |
95 | if (data.code == 20000) { | 95 | if (data.code == 20000) { |
96 | //服务器返回格式: { "Catalog": "testFolder", "FileName": "1.jpg", "Url": "https://test.com/1.jpg" } | 96 | //服务器返回格式: { "Catalog": "testFolder", "FileName": "1.jpg", "Url": "https://test.com/1.jpg" } |
97 | if (current === 0) { | 97 | if (current === 0) { |
@@ -104,14 +104,14 @@ Page({ | @@ -104,14 +104,14 @@ Page({ | ||
104 | const images = []; | 104 | const images = []; |
105 | const new_images = []; | 105 | const new_images = []; |
106 | images.push(self.data.image_params,self.data.image_params1,self.data.image_params2); | 106 | images.push(self.data.image_params,self.data.image_params1,self.data.image_params2); |
107 | - console.log('images push后',images); | 107 | + // console.log('images push后',images); |
108 | images.map((item)=> { | 108 | images.map((item)=> { |
109 | if(item !== undefined) { | 109 | if(item !== undefined) { |
110 | new_images.push(item) | 110 | new_images.push(item) |
111 | } | 111 | } |
112 | }); | 112 | }); |
113 | self.setData({new_images: new_images.join(',')}); | 113 | self.setData({new_images: new_images.join(',')}); |
114 | - console.log('images',new_images.join(',')); | 114 | + // console.log('images',new_images.join(',')); |
115 | 115 | ||
116 | } else { | 116 | } else { |
117 | wx.showModal({ | 117 | wx.showModal({ |
@@ -154,7 +154,7 @@ Page({ | @@ -154,7 +154,7 @@ Page({ | ||
154 | formId: e.detail.formId, | 154 | formId: e.detail.formId, |
155 | }; | 155 | }; |
156 | app.post(url, params, header).then((res) => { | 156 | app.post(url, params, header).then((res) => { |
157 | - console.log('提交结果',res); | 157 | + // console.log('提交结果',res); |
158 | if(res.is_success) { | 158 | if(res.is_success) { |
159 | wx.showToast({ | 159 | wx.showToast({ |
160 | title:'申诉成功', | 160 | title:'申诉成功', |
@@ -175,7 +175,7 @@ Page({ | @@ -175,7 +175,7 @@ Page({ | ||
175 | }, | 175 | }, |
176 | //我的申诉 | 176 | //我的申诉 |
177 | getMyComplain(current) { | 177 | getMyComplain(current) { |
178 | - console.log(this.data.has_more); | 178 | + // console.log(this.data.has_more); |
179 | if(!this.data.has_more) return; | 179 | if(!this.data.has_more) return; |
180 | this.setData({has_more: false}); | 180 | this.setData({has_more: false}); |
181 | let url = '/portal/Experiment/user_complain_list'; | 181 | let url = '/portal/Experiment/user_complain_list'; |
@@ -187,12 +187,12 @@ Page({ | @@ -187,12 +187,12 @@ Page({ | ||
187 | page: this.data.page_number, | 187 | page: this.data.page_number, |
188 | }; | 188 | }; |
189 | app.post(url, params, header).then((res) => { | 189 | app.post(url, params, header).then((res) => { |
190 | - console.log('我的申诉',res); | 190 | + // console.log('我的申诉',res); |
191 | if(res.this_page < res.total_page) { | 191 | if(res.this_page < res.total_page) { |
192 | this.setData({has_more: true}); | 192 | this.setData({has_more: true}); |
193 | } | 193 | } |
194 | this.setData({examining: this.data.examining.concat(res.list)}); | 194 | this.setData({examining: this.data.examining.concat(res.list)}); |
195 | - console.log(this.data.examining); | 195 | + // console.log(this.data.examining); |
196 | }) | 196 | }) |
197 | }, | 197 | }, |
198 | //取消申诉 | 198 | //取消申诉 |
@@ -206,7 +206,7 @@ Page({ | @@ -206,7 +206,7 @@ Page({ | ||
206 | complain_id: id,//申诉id | 206 | complain_id: id,//申诉id |
207 | }; | 207 | }; |
208 | app.post(url, params, header).then((res) => { | 208 | app.post(url, params, header).then((res) => { |
209 | - console.log('取消申诉',res); | 209 | + // console.log('取消申诉',res); |
210 | if(res.is_success == 1) { | 210 | if(res.is_success == 1) { |
211 | wx.showToast({title:'取消成功',icon:'none'}); | 211 | wx.showToast({title:'取消成功',icon:'none'}); |
212 | const current = 1; | 212 | const current = 1; |
@@ -223,7 +223,7 @@ Page({ | @@ -223,7 +223,7 @@ Page({ | ||
223 | listDetail(e) { | 223 | listDetail(e) { |
224 | const current = +e.currentTarget.dataset.index; | 224 | const current = +e.currentTarget.dataset.index; |
225 | const id = +e.currentTarget.dataset.id; | 225 | const id = +e.currentTarget.dataset.id; |
226 | - console.log('current',current); | 226 | + // console.log('current',current); |
227 | wx.navigateTo({ | 227 | wx.navigateTo({ |
228 | url: '../punchAppealDetail/punchAppealDetail?status=' + current | 228 | url: '../punchAppealDetail/punchAppealDetail?status=' + current |
229 | + '&test_name=' + this.data.test_name + | 229 | + '&test_name=' + this.data.test_name + |
@@ -234,7 +234,7 @@ Page({ | @@ -234,7 +234,7 @@ Page({ | ||
234 | * 生命周期函数--监听页面加载 | 234 | * 生命周期函数--监听页面加载 |
235 | */ | 235 | */ |
236 | onLoad: function (options) { | 236 | onLoad: function (options) { |
237 | - console.log('options', options); | 237 | + // console.log('options', options); |
238 | this.setData({test_name: options.test_name?options.test_name:'',}); | 238 | this.setData({test_name: options.test_name?options.test_name:'',}); |
239 | }, | 239 | }, |
240 | 240 |
@@ -12,11 +12,12 @@ Page({ | @@ -12,11 +12,12 @@ Page({ | ||
12 | image: [], | 12 | image: [], |
13 | image_params:[], | 13 | image_params:[], |
14 | disabled:true, | 14 | disabled:true, |
15 | + new_images:[], | ||
15 | }, | 16 | }, |
16 | //补充提交申诉 | 17 | //补充提交申诉 |
17 | againSubmit(e) { | 18 | againSubmit(e) { |
18 | const self = this; | 19 | const self = this; |
19 | - console.log(self.data.image.join(','),self.data.new_images); | 20 | + // console.log(self.data.new_images); |
20 | if (self.data.image.length === 0) { | 21 | if (self.data.image.length === 0) { |
21 | wx.showToast({title: '请上传申诉照片!', icon: 'none'}) | 22 | wx.showToast({title: '请上传申诉照片!', icon: 'none'}) |
22 | } else { | 23 | } else { |
@@ -31,7 +32,7 @@ Page({ | @@ -31,7 +32,7 @@ Page({ | ||
31 | formId: e.detail.formId, | 32 | formId: e.detail.formId, |
32 | }; | 33 | }; |
33 | app.post(url, params, header).then((res) => { | 34 | app.post(url, params, header).then((res) => { |
34 | - console.log('补充提交结果', res); | 35 | + // console.log('补充提交结果', res); |
35 | if (res.data.is_success) { | 36 | if (res.data.is_success) { |
36 | wx.showToast({ | 37 | wx.showToast({ |
37 | title: '二次申诉成功', | 38 | title: '二次申诉成功', |
@@ -53,9 +54,9 @@ Page({ | @@ -53,9 +54,9 @@ Page({ | ||
53 | //上传图片 | 54 | //上传图片 |
54 | uploadImg(e) { | 55 | uploadImg(e) { |
55 | const current = +e.currentTarget.dataset.current; | 56 | const current = +e.currentTarget.dataset.current; |
56 | - console.log(current); | 57 | + // console.log(current); |
57 | const self = this; | 58 | const self = this; |
58 | - console.log('status=3才可上传',self.data.detail.status); | 59 | + // console.log('status=3才可上传',self.data.detail.status); |
59 | // self.setData({current:current}) | 60 | // self.setData({current:current}) |
60 | if (self.data.detail.status === 3) { | 61 | if (self.data.detail.status === 3) { |
61 | wx.chooseImage({ | 62 | wx.chooseImage({ |
@@ -63,7 +64,7 @@ Page({ | @@ -63,7 +64,7 @@ Page({ | ||
63 | sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有 | 64 | sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有 |
64 | sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 | 65 | sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 |
65 | success: function (res) { | 66 | success: function (res) { |
66 | - console.log(res.tempFilePaths[0]); | 67 | + // console.log(res.tempFilePaths[0]); |
67 | // const tempFilePaths = res.tempFilePaths[0]; | 68 | // const tempFilePaths = res.tempFilePaths[0]; |
68 | // self.setData({[`image[${current}]`]: tempFilePaths}); | 69 | // self.setData({[`image[${current}]`]: tempFilePaths}); |
69 | 70 | ||
@@ -87,26 +88,38 @@ Page({ | @@ -87,26 +88,38 @@ Page({ | ||
87 | success: function(res) { | 88 | success: function(res) { |
88 | uploadImgCount++; | 89 | uploadImgCount++; |
89 | let data = JSON.parse(res.data); | 90 | let data = JSON.parse(res.data); |
90 | - console.log('data',data); | 91 | + // console.log('data',data); |
91 | if (data.code == 20000) { | 92 | if (data.code == 20000) { |
92 | //服务器返回格式: { "Catalog": "testFolder", "FileName": "1.jpg", "Url": "https://test.com/1.jpg" } | 93 | //服务器返回格式: { "Catalog": "testFolder", "FileName": "1.jpg", "Url": "https://test.com/1.jpg" } |
93 | - if (current === 0) { | ||
94 | - self.setData({[`image[${current}]`]: data.data.url,image_params:data.data.local_url}); | ||
95 | - } else if (current === 1) { | ||
96 | - self.setData({[`image[${current}]`]: data.data.url,image_params1:data.data.local_url}); | ||
97 | - } else { | ||
98 | - self.setData({[`image[${current}]`]: data.data.url,image_params2:data.data.local_url}); | 94 | + // let image_params = self.data.image; |
95 | + if (current === 0) { //点击第一个照片 | ||
96 | + // image_params[0].local_url = data.data.local_url; | ||
97 | + // console.log('进入0',image_params[0].local_url); | ||
98 | + | ||
99 | + self.setData({[`image[${current}].url`]: data.data.url,[`image_params[${current}].local_url`]:data.data.local_url}); | ||
100 | + | ||
101 | + } else if (current === 1) { //点击第二个照片 | ||
102 | + // console.log('进入1'); | ||
103 | + | ||
104 | + self.setData({[`image[${current}].url`]: data.data.url,[`image_params[${current}].local_url`]:data.data.local_url}); | ||
105 | + } else { //点击第三个照片 | ||
106 | + // console.log('进入2'); | ||
107 | + | ||
108 | + self.setData({[`image[${current}].url`]: data.data.url,[`image_params[${current}].local_url`]:data.data.local_url}); | ||
99 | } | 109 | } |
100 | - const images = []; | 110 | + // console.log('image_params', self.data.image_params); |
111 | + // console.log('image', self.data.image); | ||
112 | + // const images = []; | ||
101 | const new_images = []; | 113 | const new_images = []; |
102 | - images.push(self.data.image_params,self.data.image_params1,self.data.image_params2); | ||
103 | - images.map((item)=> { | ||
104 | - if(item !== undefined) { | ||
105 | - new_images.push(item) | 114 | + // images.push(self.data.image_params,self.data.image_params1,self.data.image_params2); |
115 | + self.data.image_params.map((item)=> { | ||
116 | + if(item.local_url !== "") { | ||
117 | + // console.log('item', item); | ||
118 | + new_images.push(item.local_url) | ||
106 | } | 119 | } |
107 | }); | 120 | }); |
108 | self.setData({new_images: new_images.join(',')}); | 121 | self.setData({new_images: new_images.join(',')}); |
109 | - console.log('new_images',new_images.join(',')); | 122 | + // console.log('new_images',new_images,new_images.join(','),'image',self.data.image); |
110 | 123 | ||
111 | }else { | 124 | }else { |
112 | wx.showModal({ | 125 | wx.showModal({ |
@@ -145,14 +158,15 @@ Page({ | @@ -145,14 +158,15 @@ Page({ | ||
145 | id: this.data.id,//申诉id | 158 | id: this.data.id,//申诉id |
146 | }; | 159 | }; |
147 | app.post(url, params, header).then((res) => { | 160 | app.post(url, params, header).then((res) => { |
148 | - console.log('申诉详情', res); | 161 | + // console.log('申诉详情', res); |
162 | + // (1,审核中、2,已通过、3,未通过、4,二次审核中;5,二次审核已通过;6,二次审核未通过) | ||
149 | if (res.info.status === 4 || res.info.status === 5 || res.info.status === 6) { | 163 | if (res.info.status === 4 || res.info.status === 5 || res.info.status === 6) { |
150 | this.setData({detail: res.info, image: res.info.re_images}) | 164 | this.setData({detail: res.info, image: res.info.re_images}) |
151 | } else { | 165 | } else { |
152 | - if(res.info.status === 3) { | 166 | + if(res.info.status === 3) { //二次申诉时开启textarea |
153 | this.setData({disabled:false}) | 167 | this.setData({disabled:false}) |
154 | } | 168 | } |
155 | - this.setData({detail: res.info, image: res.info.images}) | 169 | + this.setData({detail: res.info, image: res.info.images,image_params:res.info.images}) |
156 | } | 170 | } |
157 | }) | 171 | }) |
158 | }, | 172 | }, |
@@ -161,7 +175,7 @@ Page({ | @@ -161,7 +175,7 @@ Page({ | ||
161 | */ | 175 | */ |
162 | onLoad: function (options) { | 176 | onLoad: function (options) { |
163 | const self = this; | 177 | const self = this; |
164 | - console.log('options', options); | 178 | + // console.log('options', options); |
165 | self.setData({ | 179 | self.setData({ |
166 | // status: options.status, | 180 | // status: options.status, |
167 | test_name: options.test_name ? options.test_name : '', | 181 | test_name: options.test_name ? options.test_name : '', |
@@ -5,15 +5,15 @@ | @@ -5,15 +5,15 @@ | ||
5 | <view class='uoload_box' wx:if="{{image.length > 0}}"> | 5 | <view class='uoload_box' wx:if="{{image.length > 0}}"> |
6 | <view class='upload_item' bindtap='uploadImg' data-current="0"> | 6 | <view class='upload_item' bindtap='uploadImg' data-current="0"> |
7 | <text class='iconfont icon-jia' wx:if="{{image[0] === undefined}}"></text> | 7 | <text class='iconfont icon-jia' wx:if="{{image[0] === undefined}}"></text> |
8 | - <image src="{{image[0]}}" mode="aspectFill" wx:else></image> | 8 | + <image src="{{image[0].url}}" mode="aspectFill" wx:else></image> |
9 | </view> | 9 | </view> |
10 | <view class='upload_item' bindtap='uploadImg' data-current="1"> | 10 | <view class='upload_item' bindtap='uploadImg' data-current="1"> |
11 | <text class='iconfont icon-jia' wx:if="{{image[1] === undefined}}"></text> | 11 | <text class='iconfont icon-jia' wx:if="{{image[1] === undefined}}"></text> |
12 | - <image src="{{image[1]}}" mode="aspectFill" wx:else></image> | 12 | + <image src="{{image[1].url}}" mode="aspectFill" wx:else></image> |
13 | </view> | 13 | </view> |
14 | <view class='upload_item' bindtap='uploadImg' data-current="2"> | 14 | <view class='upload_item' bindtap='uploadImg' data-current="2"> |
15 | <text class='iconfont icon-jia' wx:if="{{image[2] === undefined}}"></text> | 15 | <text class='iconfont icon-jia' wx:if="{{image[2] === undefined}}"></text> |
16 | - <image src="{{image[2]}}" mode="aspectFill" wx:else></image> | 16 | + <image src="{{image[2].url}}" mode="aspectFill" wx:else></image> |
17 | </view> | 17 | </view> |
18 | </view> | 18 | </view> |
19 | </view> | 19 | </view> |
@@ -12,7 +12,7 @@ Page({ | @@ -12,7 +12,7 @@ Page({ | ||
12 | }, | 12 | }, |
13 | clickAgreeBtn() { | 13 | clickAgreeBtn() { |
14 | this.setData({is_agree: !this.data.is_agree}); | 14 | this.setData({is_agree: !this.data.is_agree}); |
15 | - console.log(this.data.is_agree); | 15 | + // console.log(this.data.is_agree); |
16 | }, | 16 | }, |
17 | getDetail() { | 17 | getDetail() { |
18 | let url = '/portal/Experiment/detail'; | 18 | let url = '/portal/Experiment/detail'; |
@@ -23,7 +23,7 @@ Page({ | @@ -23,7 +23,7 @@ Page({ | ||
23 | "XX-token": wx.getStorageSync('token') | 23 | "XX-token": wx.getStorageSync('token') |
24 | }; | 24 | }; |
25 | app.post(url, params,header).then((res) => { | 25 | app.post(url, params,header).then((res) => { |
26 | - console.log(res); | 26 | + // console.log(res); |
27 | if(res.code === 0) { | 27 | if(res.code === 0) { |
28 | wx.navigateTo({url: '/pages/index/phone-code/phone-code'}) | 28 | wx.navigateTo({url: '/pages/index/phone-code/phone-code'}) |
29 | }else { | 29 | }else { |
@@ -47,7 +47,7 @@ Page({ | @@ -47,7 +47,7 @@ Page({ | ||
47 | * 生命周期函数--监听页面加载 | 47 | * 生命周期函数--监听页面加载 |
48 | */ | 48 | */ |
49 | onLoad: function (options) { | 49 | onLoad: function (options) { |
50 | - console.log(options); | 50 | + // console.log(options); |
51 | this.setData({ | 51 | this.setData({ |
52 | test_id: +options.id, | 52 | test_id: +options.id, |
53 | is_the_week: options.is_the_week | 53 | is_the_week: options.is_the_week |
@@ -31,56 +31,56 @@ Page({ | @@ -31,56 +31,56 @@ Page({ | ||
31 | // checked_student: [], | 31 | // checked_student: [], |
32 | }, | 32 | }, |
33 | chooseChildren(e) { | 33 | chooseChildren(e) { |
34 | - console.log(e,e.detail); | 34 | + // console.log(e,e.detail); |
35 | // const current = e.currentTarget.dataset.index; | 35 | // const current = e.currentTarget.dataset.index; |
36 | const that = this; | 36 | const that = this; |
37 | var index_arr = e.detail.value; | 37 | var index_arr = e.detail.value; |
38 | - console.log(index_arr) | 38 | + // console.log(index_arr) |
39 | //新建数组全部设置为没被选中 | 39 | //新建数组全部设置为没被选中 |
40 | var new_arr = []; | 40 | var new_arr = []; |
41 | - console.log('选择时学员', that.data.student_list); | 41 | + // console.log('选择时学员', that.data.student_list); |
42 | that.data.student_list.forEach((item) => { | 42 | that.data.student_list.forEach((item) => { |
43 | new_arr.push({ ...item, checked: false }) | 43 | new_arr.push({ ...item, checked: false }) |
44 | });//给每一项添加checked属性 | 44 | });//给每一项添加checked属性 |
45 | - console.log('new_arr',new_arr); | 45 | + // console.log('new_arr',new_arr); |
46 | var new_itmes = new_arr; | 46 | var new_itmes = new_arr; |
47 | - console.log('new_itmes', new_itmes); | 47 | + // console.log('new_itmes', new_itmes); |
48 | if(that.data.student_num >=2) { //两个学员预约时 | 48 | if(that.data.student_num >=2) { //两个学员预约时 |
49 | - console.log('两个学员'); | 49 | + // console.log('两个学员'); |
50 | if (index_arr.length > 2) { | 50 | if (index_arr.length > 2) { |
51 | //取出倒数两个值 | 51 | //取出倒数两个值 |
52 | var key1 = index_arr[index_arr.length - 1]; | 52 | var key1 = index_arr[index_arr.length - 1]; |
53 | var key2 = index_arr[index_arr.length - 2]; | 53 | var key2 = index_arr[index_arr.length - 2]; |
54 | // var key3 = skin[skin.length - 3]; | 54 | // var key3 = skin[skin.length - 3]; |
55 | // console.log(key1, key2, key3); | 55 | // console.log(key1, key2, key3); |
56 | - console.log(key1, key2); | ||
57 | - console.log(new_itmes[key1]['checked'],new_itmes[key1].id,new_itmes[key2].id); | 56 | + // console.log(key1, key2); |
57 | + // console.log(new_itmes[key1]['checked'],new_itmes[key1].id,new_itmes[key2].id); | ||
58 | //设置最后两个值为选中状态 | 58 | //设置最后两个值为选中状态 |
59 | new_itmes[key1]['checked'] = true | 59 | new_itmes[key1]['checked'] = true |
60 | new_itmes[key2]['checked'] = true | 60 | new_itmes[key2]['checked'] = true |
61 | // new_itmes[key3 - 1]['checked'] = 'true' | 61 | // new_itmes[key3 - 1]['checked'] = 'true' |
62 | //删除被选中的第一个值 | 62 | //删除被选中的第一个值 |
63 | index_arr.splice(0, 1); | 63 | index_arr.splice(0, 1); |
64 | - console.log('skin',index_arr); | 64 | + // console.log('skin',index_arr); |
65 | const id_arr = []; | 65 | const id_arr = []; |
66 | id_arr.push(new_itmes[key1].id,new_itmes[key2].id); | 66 | id_arr.push(new_itmes[key1].id,new_itmes[key2].id); |
67 | that.setData({student_id: id_arr.join(','),is_choose_student:true}); | 67 | that.setData({student_id: id_arr.join(','),is_choose_student:true}); |
68 | - console.log('student_id', that.data.student_id); | 68 | + // console.log('student_id', that.data.student_id); |
69 | } else { | 69 | } else { |
70 | //被选中少于两个,直接设置被选中 | 70 | //被选中少于两个,直接设置被选中 |
71 | const checked_student = []; | 71 | const checked_student = []; |
72 | for (var i = 0; i < index_arr.length; i++) { | 72 | for (var i = 0; i < index_arr.length; i++) { |
73 | var key = index_arr[i] | 73 | var key = index_arr[i] |
74 | - console.log('key', key); | 74 | + // console.log('key', key); |
75 | new_itmes[key]['checked'] = true; | 75 | new_itmes[key]['checked'] = true; |
76 | } | 76 | } |
77 | - console.log('选一个时候new_itmes', new_itmes); | 77 | + // console.log('选一个时候new_itmes', new_itmes); |
78 | new_itmes.forEach((item) => { | 78 | new_itmes.forEach((item) => { |
79 | if(item.checked) { | 79 | if(item.checked) { |
80 | checked_student.push(item) | 80 | checked_student.push(item) |
81 | } | 81 | } |
82 | }); | 82 | }); |
83 | - console.log('选择学员length', checked_student,checked_student.length); | 83 | + // console.log('选择学员length', checked_student,checked_student.length); |
84 | if(checked_student.length>=2) { | 84 | if(checked_student.length>=2) { |
85 | const arr = []; | 85 | const arr = []; |
86 | new_itmes.forEach((item) => { | 86 | new_itmes.forEach((item) => { |
@@ -93,7 +93,7 @@ Page({ | @@ -93,7 +93,7 @@ Page({ | ||
93 | wx.showToast({title:'请选择两个学员!',icon:'none'}); | 93 | wx.showToast({title:'请选择两个学员!',icon:'none'}); |
94 | that.setData({student_id: new_itmes[key].id,is_choose_student:true}); | 94 | that.setData({student_id: new_itmes[key].id,is_choose_student:true}); |
95 | } | 95 | } |
96 | - console.log('student_id', that.data.student_id); | 96 | + // console.log('student_id', that.data.student_id); |
97 | } | 97 | } |
98 | //存入 | 98 | //存入 |
99 | that.setData({ | 99 | that.setData({ |
@@ -102,26 +102,26 @@ Page({ | @@ -102,26 +102,26 @@ Page({ | ||
102 | student_list: new_itmes, | 102 | student_list: new_itmes, |
103 | }) | 103 | }) |
104 | }else if(that.data.student_num <2){ //一个学员预约时 | 104 | }else if(that.data.student_num <2){ //一个学员预约时 |
105 | - console.log('一个学员'); | 105 | + // console.log('一个学员'); |
106 | if (index_arr.length > 1) { | 106 | if (index_arr.length > 1) { |
107 | //取出倒数一个值 | 107 | //取出倒数一个值 |
108 | var key1 = index_arr[index_arr.length - 1]; | 108 | var key1 = index_arr[index_arr.length - 1]; |
109 | // var key2 = skin[skin.length - 2]; | 109 | // var key2 = skin[skin.length - 2]; |
110 | // var key3 = skin[skin.length - 3]; | 110 | // var key3 = skin[skin.length - 3]; |
111 | // console.log(key1, key2, key3); | 111 | // console.log(key1, key2, key3); |
112 | - console.log(key1); | ||
113 | - console.log(new_itmes[key1]['checked'],new_itmes[key1].id); | 112 | + // console.log(key1); |
113 | + // console.log(new_itmes[key1]['checked'],new_itmes[key1].id); | ||
114 | //设置最后一个值为选中状态 | 114 | //设置最后一个值为选中状态 |
115 | new_itmes[key1]['checked'] = true | 115 | new_itmes[key1]['checked'] = true |
116 | // new_itmes[key2]['checked'] = true | 116 | // new_itmes[key2]['checked'] = true |
117 | // new_itmes[key3 - 1]['checked'] = 'true' | 117 | // new_itmes[key3 - 1]['checked'] = 'true' |
118 | //删除被选中的第一个值 | 118 | //删除被选中的第一个值 |
119 | index_arr.splice(0, 1); | 119 | index_arr.splice(0, 1); |
120 | - console.log('skin',index_arr); | 120 | + // console.log('skin',index_arr); |
121 | that.setData({student_id: new_itmes[key1].id,is_choose_student:true}); | 121 | that.setData({student_id: new_itmes[key1].id,is_choose_student:true}); |
122 | - console.log('student_id', that.data.student_id); | 122 | + // console.log('student_id', that.data.student_id); |
123 | } else { | 123 | } else { |
124 | - console.log('111'); | 124 | + // console.log('111'); |
125 | //被选中少于1个,直接设置被选中 | 125 | //被选中少于1个,直接设置被选中 |
126 | // new_itmes.forEach((item,index) => { | 126 | // new_itmes.forEach((item,index) => { |
127 | // if(item.id === that.data.student_id) { | 127 | // if(item.id === that.data.student_id) { |
@@ -129,15 +129,15 @@ Page({ | @@ -129,15 +129,15 @@ Page({ | ||
129 | // } | 129 | // } |
130 | // }); | 130 | // }); |
131 | for (var i = 0; i < index_arr.length; i++) { | 131 | for (var i = 0; i < index_arr.length; i++) { |
132 | - console.log('222',index_arr,i); | 132 | + // console.log('222',index_arr,i); |
133 | var key = index_arr[i] | 133 | var key = index_arr[i] |
134 | - console.log('key', key); | 134 | + // console.log('key', key); |
135 | new_itmes[key]['checked'] = true | 135 | new_itmes[key]['checked'] = true |
136 | that.setData({student_id: new_itmes[key].id,is_choose_student:true}); | 136 | that.setData({student_id: new_itmes[key].id,is_choose_student:true}); |
137 | } | 137 | } |
138 | index_arr = [] | 138 | index_arr = [] |
139 | - console.log('333'); | ||
140 | - console.log('student_id', that.data.student_id); | 139 | + // console.log('333'); |
140 | + // console.log('student_id', that.data.student_id); | ||
141 | } | 141 | } |
142 | //存入 | 142 | //存入 |
143 | that.setData({ | 143 | that.setData({ |
@@ -150,13 +150,13 @@ Page({ | @@ -150,13 +150,13 @@ Page({ | ||
150 | }, | 150 | }, |
151 | //提交预约 | 151 | //提交预约 |
152 | formSubmit(e) { | 152 | formSubmit(e) { |
153 | - console.log('预约学生人数',this.data.student_num,e.detail); | 153 | + // console.log('预约学生人数',this.data.student_num,e.detail); |
154 | if(this.data.student_list.length === 0) { | 154 | if(this.data.student_list.length === 0) { |
155 | wx.showToast({title: '请添加学员!',icon:'none'}) | 155 | wx.showToast({title: '请添加学员!',icon:'none'}) |
156 | }else if(!this.data.is_choose_student) { | 156 | }else if(!this.data.is_choose_student) { |
157 | wx.showToast({title: '请选择学员!',icon:'none'}) | 157 | wx.showToast({title: '请选择学员!',icon:'none'}) |
158 | }else if(this.data.student_num>=2 && ('' + this.data.student_id).indexOf(',') === -1) { | 158 | }else if(this.data.student_num>=2 && ('' + this.data.student_id).indexOf(',') === -1) { |
159 | - console.log('检验student_id',('' + this.data.student_id).indexOf(',')); | 159 | + // console.log('检验student_id',('' + this.data.student_id).indexOf(',')); |
160 | wx.showToast({title:'请选择两个学员!',icon:'none'}) | 160 | wx.showToast({title:'请选择两个学员!',icon:'none'}) |
161 | } else { | 161 | } else { |
162 | // this.setData({'modal_data.is_showModal': true}) | 162 | // this.setData({'modal_data.is_showModal': true}) |
@@ -173,7 +173,7 @@ Page({ | @@ -173,7 +173,7 @@ Page({ | ||
173 | students: this.data.student_id, | 173 | students: this.data.student_id, |
174 | }; | 174 | }; |
175 | app.post(url,params,header).then((res) => { | 175 | app.post(url,params,header).then((res) => { |
176 | - console.log('提交预约信息',res); | 176 | + // console.log('提交预约信息',res); |
177 | if(res.data.card_modal === 1) { | 177 | if(res.data.card_modal === 1) { |
178 | this.setData({'modal_data.is_showModal': true}); | 178 | this.setData({'modal_data.is_showModal': true}); |
179 | }else if(res.data.reservation_modal === 1) { | 179 | }else if(res.data.reservation_modal === 1) { |
@@ -217,115 +217,70 @@ Page({ | @@ -217,115 +217,70 @@ Page({ | ||
217 | reservation_id: this.data.reservation_id, | 217 | reservation_id: this.data.reservation_id, |
218 | }; | 218 | }; |
219 | app.post(url,params,header).then((res) => { | 219 | app.post(url,params,header).then((res) => { |
220 | - console.log('预约信息',res); | 220 | + // console.log('预约信息',res); |
221 | var arr = []; | 221 | var arr = []; |
222 | for (let i in res.list) { | 222 | for (let i in res.list) { |
223 | arr.push(res.list[i]); //属性 | 223 | arr.push(res.list[i]); //属性 |
224 | //arr.push(obj[i]); //值 | 224 | //arr.push(obj[i]); //值 |
225 | }//对象转数组 | 225 | }//对象转数组 |
226 | - console.log('arr',arr); | 226 | + // console.log('arr',arr); |
227 | var new_arr = []; | 227 | var new_arr = []; |
228 | arr.forEach((item) => { | 228 | arr.forEach((item) => { |
229 | new_arr.push({ ...item, checked: false }) | 229 | new_arr.push({ ...item, checked: false }) |
230 | });//给每一项添加checked属性 | 230 | });//给每一项添加checked属性 |
231 | - console.log(new_arr); | 231 | + // console.log(new_arr); |
232 | this.setData({ | 232 | this.setData({ |
233 | student_list: new_arr, | 233 | student_list: new_arr, |
234 | new_arr:new_arr, | 234 | new_arr:new_arr, |
235 | session_info: res.session_info, | 235 | session_info: res.session_info, |
236 | }) | 236 | }) |
237 | - console.log('student_list', this.data.student_list); | 237 | + // console.log('student_list', this.data.student_list); |
238 | }) | 238 | }) |
239 | }, | 239 | }, |
240 | //获取学员列表 | 240 | //获取学员列表 |
241 | getStudentList() { | 241 | getStudentList() { |
242 | const self = this; | 242 | const self = this; |
243 | - console.log('预约学生人数',this.data.student_num); | 243 | + // console.log('预约学生人数',this.data.student_num); |
244 | self.setData({is_choose_student: true}); | 244 | self.setData({is_choose_student: true}); |
245 | - console.log('返回时的学生列表预约信息自带的学员', self.data.student_list); | 245 | + // console.log('返回时的学生列表预约信息自带的学员', self.data.student_list); |
246 | const buy_arr = []; | 246 | const buy_arr = []; |
247 | self.data.student_list.forEach((item) => { | 247 | self.data.student_list.forEach((item) => { |
248 | buy_arr.push({ ...item, checked: false }) | 248 | buy_arr.push({ ...item, checked: false }) |
249 | });//给每一项添加checked属性 | 249 | });//给每一项添加checked属性 |
250 | - console.log('buy_arr', buy_arr); | 250 | + // console.log('buy_arr', buy_arr); |
251 | this.setData({ | 251 | this.setData({ |
252 | student_list: buy_arr, | 252 | student_list: buy_arr, |
253 | // new_arr:buy_arr, | 253 | // new_arr:buy_arr, |
254 | // session_info: res.session_info, | 254 | // session_info: res.session_info, |
255 | }) | 255 | }) |
256 | this.refreshBuyState(); | 256 | this.refreshBuyState(); |
257 | - | ||
258 | - | ||
259 | - | ||
260 | - // console.log('预约学生人数',this.data.student_num); | ||
261 | - // self.setData({is_choose_student: true}) | ||
262 | - // console.log('返回时的学生列表预约信息自带的学员', self.data.student_list); | ||
263 | - // let url = '/user/Student/student_list'; | ||
264 | - // let header = { | ||
265 | - // "XX-token": wx.getStorageSync('token') | ||
266 | - // }; | ||
267 | - // let params = { | ||
268 | - // page: 2, | ||
269 | - // }; | ||
270 | - // app.post(url,params,header).then((res) => { | ||
271 | - // console.log('学员列表',res); | ||
272 | - // | ||
273 | - // var arr = []; | ||
274 | - // for (let i in res.list) { | ||
275 | - // arr.push(res.list[i]); //属性 | ||
276 | - // //arr.push(obj[i]); //值 | ||
277 | - // }//对象转数组 | ||
278 | - // console.log('arr',arr); | ||
279 | - // var new_arr = []; | ||
280 | - // arr.forEach((item) => { | ||
281 | - // new_arr.push({ ...item, checked: false }) | ||
282 | - // });//给每一项添加checked属性 | ||
283 | - // console.log('new_arr',new_arr); | ||
284 | - // this.setData({ | ||
285 | - // student_list: new_arr, | ||
286 | - // new_arr:new_arr, | ||
287 | - // // session_info: res.session_info, | ||
288 | - // }) | ||
289 | - // console.log('student_list', this.data.student_list); | ||
290 | - // this.refreshBuyState(); | ||
291 | - | ||
292 | - // res.list.forEach((item) => { | ||
293 | - // if(item.time !== '') { | ||
294 | - // self.data.student_list.forEach((item) => { | ||
295 | - // new_arr.push({ ...item, checked: false }) | ||
296 | - // });//给每一项添加checked属性 | ||
297 | - | ||
298 | - // } | ||
299 | - // }) | ||
300 | - // this.setData({student_list: res.list}) | ||
301 | - // }) | ||
302 | }, | 257 | }, |
303 | //更新购买状态 | 258 | //更新购买状态 |
304 | refreshBuyState() { | 259 | refreshBuyState() { |
305 | - console.log('更新购买状态---学生id--人数',this.data.student_num,this.data.is_buy,this.data.choose_student_id); | 260 | + // console.log('更新购买状态---学生id--人数',this.data.student_num,this.data.is_buy,this.data.choose_student_id); |
306 | if(this.data.is_buy) { | 261 | if(this.data.is_buy) { |
307 | if(this.data.student_num<2) { | 262 | if(this.data.student_num<2) { |
308 | this.data.student_list.forEach((item) => { | 263 | this.data.student_list.forEach((item) => { |
309 | item.checked = false; | 264 | item.checked = false; |
310 | if (item.id === this.data.choose_student_id) { | 265 | if (item.id === this.data.choose_student_id) { |
311 | - console.log('item.id', item.id); | 266 | + // console.log('item.id', item.id); |
312 | item.checked = true; | 267 | item.checked = true; |
313 | } | 268 | } |
314 | }); | 269 | }); |
315 | this.setData({student_list:this.data.student_list,is_choose_student:true}) | 270 | this.setData({student_list:this.data.student_list,is_choose_student:true}) |
316 | - console.log('student_list',this.data.student_list); | 271 | + // console.log('student_list',this.data.student_list); |
317 | }else if(this.data.student_num>=2) { | 272 | }else if(this.data.student_num>=2) { |
318 | - console.log('购买完进入两个学员student_list',this.data.student_list); | 273 | + // console.log('购买完进入两个学员student_list',this.data.student_list); |
319 | this.data.student_list.forEach((item) => { | 274 | this.data.student_list.forEach((item) => { |
320 | item.checked = false; | 275 | item.checked = false; |
321 | if (item.id === this.data.choose_student_id) { | 276 | if (item.id === this.data.choose_student_id) { |
322 | - console.log('item.id', item.id); | 277 | + // console.log('item.id', item.id); |
323 | item.checked = true; | 278 | item.checked = true; |
324 | // total_student_num.push(item) | 279 | // total_student_num.push(item) |
325 | } | 280 | } |
326 | }); | 281 | }); |
327 | this.setData({student_list:this.data.student_list,is_choose_student:true,}); | 282 | this.setData({student_list:this.data.student_list,is_choose_student:true,}); |
328 | - console.log('student_list',this.data.student_list); | 283 | + // console.log('student_list',this.data.student_list); |
329 | } | 284 | } |
330 | } | 285 | } |
331 | }, | 286 | }, |
@@ -334,8 +289,8 @@ Page({ | @@ -334,8 +289,8 @@ Page({ | ||
334 | */ | 289 | */ |
335 | onLoad: function (options) { | 290 | onLoad: function (options) { |
336 | const self =this; | 291 | const self =this; |
337 | - console.log('load'); | ||
338 | - console.log(options); | 292 | + // console.log('load'); |
293 | + // console.log(options); | ||
339 | self.setData({ | 294 | self.setData({ |
340 | experiment_id: +options.experiment_id?+options.experiment_id:'', | 295 | experiment_id: +options.experiment_id?+options.experiment_id:'', |
341 | session_id: +options.session_id?+options.session_id:'', | 296 | session_id: +options.session_id?+options.session_id:'', |
@@ -356,7 +311,7 @@ Page({ | @@ -356,7 +311,7 @@ Page({ | ||
356 | * 生命周期函数--监听页面显示 | 311 | * 生命周期函数--监听页面显示 |
357 | */ | 312 | */ |
358 | onShow: function() { | 313 | onShow: function() { |
359 | - console.log('show'); | 314 | + // console.log('show'); |
360 | const self = this; | 315 | const self = this; |
361 | self.setData({is_choose_student: false}); | 316 | self.setData({is_choose_student: false}); |
362 | self.getStudentList(); | 317 | self.getStudentList(); |
@@ -44,16 +44,10 @@ Page({ | @@ -44,16 +44,10 @@ Page({ | ||
44 | this.setData({ | 44 | this.setData({ |
45 | currentTest: current, | 45 | currentTest: current, |
46 | current_test_id: current_id, | 46 | current_test_id: current_id, |
47 | - // is_choose_test: true, | ||
48 | - // current_session_id: this.data.areaTest[current].lab_list ? this.data.areaTest[current].lab_list[0].session_list[0].id : '', | ||
49 | - // description: this.data.areaTest[current].lab_list[current].description | ||
50 | }); | 47 | }); |
51 | - // console.log(util.formatTimeTwo(1543375800,'h:m'),'1543375800'); | ||
52 | - // console.log('areaTest',this.data.areaTest); | ||
53 | return this.data.areaTest.forEach((item, index) => { | 48 | return this.data.areaTest.forEach((item, index) => { |
54 | // console.log(item.lab_list[current].id, current_id); | 49 | // console.log(item.lab_list[current].id, current_id); |
55 | if (item.lab_list && (item.lab_list[current].id === current_id)) { | 50 | if (item.lab_list && (item.lab_list[current].id === current_id)) { |
56 | - // console.log(current_id, item.lab_list[current].id,item.lab_list[current].description); | ||
57 | this.setData({ | 51 | this.setData({ |
58 | description: item.lab_list && item.lab_list[current].description ? item.lab_list[current].description : '', | 52 | description: item.lab_list && item.lab_list[current].description ? item.lab_list[current].description : '', |
59 | session_list: item.lab_list && item.lab_list[current].session_list ? item.lab_list[current].session_list : '', | 53 | session_list: item.lab_list && item.lab_list[current].session_list ? item.lab_list[current].session_list : '', |
@@ -61,8 +55,6 @@ Page({ | @@ -61,8 +55,6 @@ Page({ | ||
61 | // return | 55 | // return |
62 | } | 56 | } |
63 | }); | 57 | }); |
64 | - // console.log(a); | ||
65 | - // console.log(this.data.areaTest[current].lab_list[current].description); | ||
66 | }, | 58 | }, |
67 | 59 | ||
68 | //选择场次 | 60 | //选择场次 |
@@ -92,9 +84,6 @@ Page({ | @@ -92,9 +84,6 @@ Page({ | ||
92 | student_num: 1, | 84 | student_num: 1, |
93 | }) | 85 | }) |
94 | } | 86 | } |
95 | - // wx.navigateTo({ | ||
96 | - // url: '/pages/index/confirm-appointment-info/confirm-appointment-info?num=' + 1 | ||
97 | - // }) | ||
98 | }, | 87 | }, |
99 | 88 | ||
100 | //点击双人预约 | 89 | //点击双人预约 |
@@ -107,9 +96,6 @@ Page({ | @@ -107,9 +96,6 @@ Page({ | ||
107 | student_num: 2, | 96 | student_num: 2, |
108 | }) | 97 | }) |
109 | } | 98 | } |
110 | - // wx.navigateTo({ | ||
111 | - // url: '/pages/index/confirm-appointment-info/confirm-appointment-info?num=' + 2 | ||
112 | - // }) | ||
113 | }, | 99 | }, |
114 | //提交 | 100 | //提交 |
115 | submit() { | 101 | submit() { |
@@ -123,12 +109,8 @@ Page({ | @@ -123,12 +109,8 @@ Page({ | ||
123 | session_id: this.data.current_session_id, | 109 | session_id: this.data.current_session_id, |
124 | student_num: this.data.student_num, | 110 | student_num: this.data.student_num, |
125 | }; | 111 | }; |
126 | - // wx.navigateTo({ | ||
127 | - // url: '/pages/index/confirm-appointment-info/confirm-appointment-info?experiment_id=' + this.data.experiment_id | ||
128 | - // + '&session_id=' + this.data.current_session_id + '&student_num=' + this.data.student_num | ||
129 | - // }) | ||
130 | app.post(url, params, header).then((res) => { | 112 | app.post(url, params, header).then((res) => { |
131 | - console.log(res); | 113 | + // console.log(res); |
132 | wx.navigateTo({ | 114 | wx.navigateTo({ |
133 | url: '/pages/index/confirm-appointment-info/confirm-appointment-info?experiment_id=' + this.data.experiment_id | 115 | url: '/pages/index/confirm-appointment-info/confirm-appointment-info?experiment_id=' + this.data.experiment_id |
134 | + '&session_id=' + this.data.current_session_id | 116 | + '&session_id=' + this.data.current_session_id |
@@ -151,7 +133,7 @@ Page({ | @@ -151,7 +133,7 @@ Page({ | ||
151 | var city_list = []; | 133 | var city_list = []; |
152 | res.forEach((item, index) => { | 134 | res.forEach((item, index) => { |
153 | if(item.city == wx.getStorageSync('city')){ | 135 | if(item.city == wx.getStorageSync('city')){ |
154 | - console.log('item.city', item.city, wx.getStorageSync('city')); | 136 | + // console.log('item.city', item.city, wx.getStorageSync('city')); |
155 | this.setData({city_index:index}) | 137 | this.setData({city_index:index}) |
156 | } | 138 | } |
157 | city_list.push(item.city) | 139 | city_list.push(item.city) |
@@ -159,11 +141,8 @@ Page({ | @@ -159,11 +141,8 @@ Page({ | ||
159 | // console.log(city_list,res); | 141 | // console.log(city_list,res); |
160 | this.setData({ | 142 | this.setData({ |
161 | cityList: city_list, | 143 | cityList: city_list, |
162 | - // description: res.list[0].lab_list[0].description,//默认显示第一个实验室的描述 | ||
163 | - // session_list: res.list[0].lab_list[0].session_list//默认显示第一个实验室的实验时间 | ||
164 | 144 | ||
165 | }) | 145 | }) |
166 | - // console.log(this.data.this_week_test_info); | ||
167 | }) | 146 | }) |
168 | }, | 147 | }, |
169 | //获取预约城市、区、实验室、场次 | 148 | //获取预约城市、区、实验室、场次 |
@@ -177,27 +156,10 @@ Page({ | @@ -177,27 +156,10 @@ Page({ | ||
177 | "XX-token": wx.getStorageSync('token') | 156 | "XX-token": wx.getStorageSync('token') |
178 | }; | 157 | }; |
179 | app.post(url, params, header).then((res) => { | 158 | app.post(url, params, header).then((res) => { |
180 | - console.log(res, res.list); | ||
181 | - // res.list.forEach((item,index) => { | ||
182 | - // if(item.lab_list) { | ||
183 | - // item.lab_list.forEach((i,k) => { | ||
184 | - // if(i.session_list) { | ||
185 | - // i.session_list.forEach((j,b) => { | ||
186 | - // j.start_time = util.formatTimeTwo(j.start_time, 'h:m'); | ||
187 | - // j.end_time = util.formatTimeTwo(j.end_time, 'h:m'); | ||
188 | - // }) | ||
189 | - // } | ||
190 | - // }) | ||
191 | - // } | ||
192 | - // }); | ||
193 | - // console.log(res,res.list); | ||
194 | - // console.log(res.list[0].lab_list[0].id); | ||
195 | this.setData({ | 159 | this.setData({ |
196 | areaTest: res.list, | 160 | areaTest: res.list, |
197 | student_num: res.student_num, | 161 | student_num: res.student_num, |
198 | current_test_id: res.list[0].lab_list[0].id, | 162 | current_test_id: res.list[0].lab_list[0].id, |
199 | - // current_test_id: res.list[0].lab_list ? res.list[0].lab_list[0].id : '',//默认实验室id | ||
200 | - // current_session_id: res.list[0].lab_list ? res.list[0].lab_list[0].session_list[0].id : '',//默认场次id | ||
201 | description: res.list[0].lab_list ? res.list[0].lab_list[0].description : '',//默认显示第一个实验室的描述 | 163 | description: res.list[0].lab_list ? res.list[0].lab_list[0].description : '',//默认显示第一个实验室的描述 |
202 | session_list: res.list[0].lab_list ? res.list[0].lab_list[0].session_list : ''//默认显示第一个实验室的实验时间 | 164 | session_list: res.list[0].lab_list ? res.list[0].lab_list[0].session_list : ''//默认显示第一个实验室的实验时间 |
203 | 165 | ||
@@ -210,16 +172,8 @@ Page({ | @@ -210,16 +172,8 @@ Page({ | ||
210 | */ | 172 | */ |
211 | onLoad: function (options) { | 173 | onLoad: function (options) { |
212 | const self = this; | 174 | const self = this; |
213 | - console.log('load-experiment_id',options); | 175 | + // console.log('load-experiment_id',options); |
214 | self.setData({experiment_id: +options.experiment_id}); | 176 | self.setData({experiment_id: +options.experiment_id}); |
215 | - | ||
216 | - // this.data.areaTest.forEach((v, i) => { | ||
217 | - // Object.keys(v).forEach(v => { | ||
218 | - // console.log(v) //取到了key | ||
219 | - // console.log(this.data.areaTest[i][v]) //取到了值 | ||
220 | - // }) | ||
221 | - // }) | ||
222 | - // console.log(this.data.areaTest); | ||
223 | }, | 177 | }, |
224 | 178 | ||
225 | /** | 179 | /** |
@@ -230,9 +184,8 @@ Page({ | @@ -230,9 +184,8 @@ Page({ | ||
230 | }, | 184 | }, |
231 | getData() { | 185 | getData() { |
232 | const self = this; | 186 | const self = this; |
233 | - console.log(wx.getStorageSync('city') == wx.getStorageSync('choose-city'),wx.getStorageSync('city') === wx.getStorageSync('choose-city'),wx.getStorageSync('choose-city') !==''); | ||
234 | if ((wx.getStorageSync('city') === wx.getStorageSync('choose-city')) && wx.getStorageSync('choose-city') !=='') { | 187 | if ((wx.getStorageSync('city') === wx.getStorageSync('choose-city')) && wx.getStorageSync('choose-city') !=='') { |
235 | - console.log('相同'); | 188 | + // console.log('相同'); |
236 | const city = wx.getStorageSync('city'); | 189 | const city = wx.getStorageSync('city'); |
237 | // console.log('city',city); | 190 | // console.log('city',city); |
238 | self.getChooseSession(city); | 191 | self.getChooseSession(city); |
@@ -241,12 +194,11 @@ Page({ | @@ -241,12 +194,11 @@ Page({ | ||
241 | // console.log(self.data.currentCity); | 194 | // console.log(self.data.currentCity); |
242 | 195 | ||
243 | }else if((wx.getStorageSync('city') !== wx.getStorageSync('choose-city')) && wx.getStorageSync('choose-city') !=='') { | 196 | }else if((wx.getStorageSync('city') !== wx.getStorageSync('choose-city')) && wx.getStorageSync('choose-city') !=='') { |
244 | - console.log('不同'); | 197 | + // console.log('不同'); |
245 | const city = wx.getStorageSync('choose-city'); | 198 | const city = wx.getStorageSync('choose-city'); |
246 | self.getChooseSession(city); | 199 | self.getChooseSession(city); |
247 | self.setData({currentCity: city}) | 200 | self.setData({currentCity: city}) |
248 | } else if(wx.getStorageSync('city') === ''){ | 201 | } else if(wx.getStorageSync('city') === ''){ |
249 | - console.log('aaa'); | ||
250 | const city = '北京市'; | 202 | const city = '北京市'; |
251 | self.getChooseSession(city); | 203 | self.getChooseSession(city); |
252 | self.setData({currentCity: city}) | 204 | self.setData({currentCity: city}) |
@@ -27,13 +27,8 @@ Page({ | @@ -27,13 +27,8 @@ Page({ | ||
27 | "XX-token": wx.getStorageSync('token') | 27 | "XX-token": wx.getStorageSync('token') |
28 | }; | 28 | }; |
29 | app.post(url, {}, {}).then((res) => { | 29 | app.post(url, {}, {}).then((res) => { |
30 | - console.log('获取购买背景图',res); | 30 | + // console.log('获取购买背景图',res); |
31 | this.setData({buy_card: res.info}) | 31 | this.setData({buy_card: res.info}) |
32 | - // if (res.is_binding) { | ||
33 | - // this.setData({is_bingding: true}) | ||
34 | - // } else { | ||
35 | - // this.setData({is_bingding: false}) | ||
36 | - // } | ||
37 | }) | 32 | }) |
38 | }, | 33 | }, |
39 | //判断手机号是否绑定 | 34 | //判断手机号是否绑定 |
@@ -43,7 +38,7 @@ Page({ | @@ -43,7 +38,7 @@ Page({ | ||
43 | "XX-token": wx.getStorageSync('token') | 38 | "XX-token": wx.getStorageSync('token') |
44 | }; | 39 | }; |
45 | app.post(url, {},header).then((res) => { | 40 | app.post(url, {},header).then((res) => { |
46 | - console.log(res); | 41 | + // console.log(res); |
47 | if(res.is_binding) { | 42 | if(res.is_binding) { |
48 | this.setData({is_bingding: true}) | 43 | this.setData({is_bingding: true}) |
49 | }else { | 44 | }else { |
@@ -78,7 +73,7 @@ Page({ | @@ -78,7 +73,7 @@ Page({ | ||
78 | //前往预约 | 73 | //前往预约 |
79 | goAppointment(e) { | 74 | goAppointment(e) { |
80 | const id = e.currentTarget.dataset.id; | 75 | const id = e.currentTarget.dataset.id; |
81 | - console.log('实验室id', id); | 76 | + // console.log('实验室id', id); |
82 | wx.navigateTo({url: './go-appointment/go-appointment?experiment_id=' + id}) | 77 | wx.navigateTo({url: './go-appointment/go-appointment?experiment_id=' + id}) |
83 | }, | 78 | }, |
84 | //获取轮播图 | 79 | //获取轮播图 |
@@ -96,7 +91,7 @@ Page({ | @@ -96,7 +91,7 @@ Page({ | ||
96 | let url = '/portal/Index/index'; | 91 | let url = '/portal/Index/index'; |
97 | 92 | ||
98 | app.post(url, params).then((res) => { | 93 | app.post(url, params).then((res) => { |
99 | - console.log('轮播图',res); | 94 | + // console.log('轮播图',res); |
100 | this.setData({imgUrls: res.list}) | 95 | this.setData({imgUrls: res.list}) |
101 | }) | 96 | }) |
102 | }, | 97 | }, |
@@ -122,7 +117,7 @@ Page({ | @@ -122,7 +117,7 @@ Page({ | ||
122 | page: this.data.page_number, | 117 | page: this.data.page_number, |
123 | } | 118 | } |
124 | app.post(url, params,{}).then((res) => { | 119 | app.post(url, params,{}).then((res) => { |
125 | - console.log('获取往期实验',res); | 120 | + // console.log('获取往期实验',res); |
126 | if(res.this_page < res.total_page) { | 121 | if(res.this_page < res.total_page) { |
127 | this.setData({has_more: true}); | 122 | this.setData({has_more: true}); |
128 | } | 123 | } |
@@ -138,10 +133,8 @@ Page({ | @@ -138,10 +133,8 @@ Page({ | ||
138 | }, | 133 | }, |
139 | //打卡页面获取位置授权 | 134 | //打卡页面获取位置授权 |
140 | getExperiment() { | 135 | getExperiment() { |
141 | - console.log('实验室'); | ||
142 | const self = this; | 136 | const self = this; |
143 | if (wx.getStorageSync('city')) {//如果第一次授权过 | 137 | if (wx.getStorageSync('city')) {//如果第一次授权过 |
144 | - console.log(111); | ||
145 | wx.getLocation({ | 138 | wx.getLocation({ |
146 | type: 'wgs84', | 139 | type: 'wgs84', |
147 | success(res) { | 140 | success(res) { |
@@ -208,8 +201,8 @@ Page({ | @@ -208,8 +201,8 @@ Page({ | ||
208 | const self = this; | 201 | const self = this; |
209 | // self.setData({is_bingding: +options.is_bingding?+options.is_bingding:''}); | 202 | // self.setData({is_bingding: +options.is_bingding?+options.is_bingding:''}); |
210 | self.setData({is_bingding: app.globalData.is_bingding}); | 203 | self.setData({is_bingding: app.globalData.is_bingding}); |
211 | - console.log('is_bingding', self.data.is_bingding); | ||
212 | - console.log('options',options); | 204 | + // console.log('is_bingding', self.data.is_bingding); |
205 | + // console.log('options',options); | ||
213 | // self.checkMobile(); | 206 | // self.checkMobile(); |
214 | self.getTheWeekTest(); | 207 | self.getTheWeekTest(); |
215 | self.getPastWeekTest(); | 208 | self.getPastWeekTest(); |
@@ -218,7 +211,7 @@ Page({ | @@ -218,7 +211,7 @@ Page({ | ||
218 | wx.getLocation({ | 211 | wx.getLocation({ |
219 | type: 'wgs84', | 212 | type: 'wgs84', |
220 | success: function(res) { | 213 | success: function(res) { |
221 | - console.log(res); | 214 | + // console.log(res); |
222 | // 实例化API核心类 | 215 | // 实例化API核心类 |
223 | var demo = new QQMapWX({ | 216 | var demo = new QQMapWX({ |
224 | key: 'CLVBZ-KHZKP-KWLDW-VDJTA-QVUST-XOBVO' // 必填 | 217 | key: 'CLVBZ-KHZKP-KWLDW-VDJTA-QVUST-XOBVO' // 必填 |
@@ -231,7 +224,7 @@ Page({ | @@ -231,7 +224,7 @@ Page({ | ||
231 | longitude: res.longitude//经度 | 224 | longitude: res.longitude//经度 |
232 | }, | 225 | }, |
233 | success: function (res) { | 226 | success: function (res) { |
234 | - console.log('获取城市',res.result.address_component.city); | 227 | + // console.log('获取城市',res.result.address_component.city); |
235 | self.setData({city: res.result.address_component.city}); | 228 | self.setData({city: res.result.address_component.city}); |
236 | wx.setStorageSync('city', res.result.address_component.city); | 229 | wx.setStorageSync('city', res.result.address_component.city); |
237 | self.getSlideImage(); | 230 | self.getSlideImage(); |
@@ -247,7 +240,7 @@ Page({ | @@ -247,7 +240,7 @@ Page({ | ||
247 | }); | 240 | }); |
248 | }, | 241 | }, |
249 | onShow() { | 242 | onShow() { |
250 | - console.log('show-globalData',app.globalData.is_bingding,typeof(app.globalData.is_bingding)); | 243 | + // console.log('show-globalData',app.globalData.is_bingding,typeof(app.globalData.is_bingding)); |
251 | }, | 244 | }, |
252 | onReachBottom: function () { | 245 | onReachBottom: function () { |
253 | const self = this; | 246 | const self = this; |
@@ -260,6 +253,6 @@ Page({ | @@ -260,6 +253,6 @@ Page({ | ||
260 | icon: 'none' | 253 | icon: 'none' |
261 | }); | 254 | }); |
262 | } | 255 | } |
263 | - console.log('上拉加载'); | 256 | + // console.log('上拉加载'); |
264 | }, | 257 | }, |
265 | }); | 258 | }); |
@@ -44,7 +44,7 @@ Page({ | @@ -44,7 +44,7 @@ Page({ | ||
44 | "XX-token": wx.getStorageSync('token') | 44 | "XX-token": wx.getStorageSync('token') |
45 | }; | 45 | }; |
46 | app.post(url, params,header).then((res) => { | 46 | app.post(url, params,header).then((res) => { |
47 | - console.log(res); | 47 | + // console.log(res); |
48 | that.setData({verification_code: res.code}) | 48 | that.setData({verification_code: res.code}) |
49 | // console.log(this.data.this_week_test_info); | 49 | // console.log(this.data.this_week_test_info); |
50 | }) | 50 | }) |
@@ -65,7 +65,7 @@ Page({ | @@ -65,7 +65,7 @@ Page({ | ||
65 | }, | 65 | }, |
66 | //确认绑定 | 66 | //确认绑定 |
67 | formSubmit(e) { | 67 | formSubmit(e) { |
68 | - console.log(e.detail); | 68 | + // console.log(e.detail); |
69 | const self = this; | 69 | const self = this; |
70 | if(self.data.phone_number === '') { | 70 | if(self.data.phone_number === '') { |
71 | wx.showToast({title: '请输入手机号!',icon: 'none'}) | 71 | wx.showToast({title: '请输入手机号!',icon: 'none'}) |
@@ -83,7 +83,7 @@ Page({ | @@ -83,7 +83,7 @@ Page({ | ||
83 | "XX-token": wx.getStorageSync('token') | 83 | "XX-token": wx.getStorageSync('token') |
84 | }; | 84 | }; |
85 | app.post(url, params,header).then((res) => { | 85 | app.post(url, params,header).then((res) => { |
86 | - console.log('绑定结果',res); | 86 | + // console.log('绑定结果',res); |
87 | app.globalData.is_bingding = 1; | 87 | app.globalData.is_bingding = 1; |
88 | if(self.data.from_index) { | 88 | if(self.data.from_index) { |
89 | wx.switchTab({ | 89 | wx.switchTab({ |
@@ -34,13 +34,13 @@ Page({ | @@ -34,13 +34,13 @@ Page({ | ||
34 | page: self.data.page_number, | 34 | page: self.data.page_number, |
35 | }; | 35 | }; |
36 | app.post(url, params,header).then((res) => { | 36 | app.post(url, params,header).then((res) => { |
37 | - console.log('获取预约列表',res); | 37 | + // console.log('获取预约列表',res); |
38 | if(res.this_page < res.total_page) { | 38 | if(res.this_page < res.total_page) { |
39 | self.setData({has_more: true}); | 39 | self.setData({has_more: true}); |
40 | } | 40 | } |
41 | self.setData({orderList: self.data.orderList.concat(res.list)}) | 41 | self.setData({orderList: self.data.orderList.concat(res.list)}) |
42 | // self.setData({orderList: res.list}) | 42 | // self.setData({orderList: res.list}) |
43 | - console.log(self.data.orderList); | 43 | + // console.log(self.data.orderList); |
44 | }) | 44 | }) |
45 | }, | 45 | }, |
46 | //查看预约详情 | 46 | //查看预约详情 |
@@ -52,29 +52,17 @@ Page({ | @@ -52,29 +52,17 @@ Page({ | ||
52 | }, | 52 | }, |
53 | //取消 | 53 | //取消 |
54 | clickCancel(e) { | 54 | clickCancel(e) { |
55 | - console.log('取消',e); | 55 | + // console.log('取消',e); |
56 | const current = e.currentTarget.dataset.index; | 56 | const current = e.currentTarget.dataset.index; |
57 | wx.navigateTo({url: '../order-detail/order-detail?currentTab=' + this.data.currentTab | 57 | wx.navigateTo({url: '../order-detail/order-detail?currentTab=' + this.data.currentTab |
58 | + '&reservation_id=' + this.data.orderList[current].id | 58 | + '&reservation_id=' + this.data.orderList[current].id |
59 | }) | 59 | }) |
60 | - // let url = '/user/Reservation/reservation_cancel'; | ||
61 | - // let header = { | ||
62 | - // "XX-token": wx.getStorageSync('token') | ||
63 | - // }; | ||
64 | - // let params = { | ||
65 | - // reservation_id: this.data.orderList[e.detail.target.dataset.index].id, | ||
66 | - // formId: e.detail.formId, | ||
67 | - // }; | ||
68 | - // app.post(url, params,header).then((res) => { | ||
69 | - // console.log('取消',res); | ||
70 | - // // this.setData({orderList: res.list}) | ||
71 | - // }) | ||
72 | }, | 60 | }, |
73 | /** | 61 | /** |
74 | * 生命周期函数--监听页面加载 | 62 | * 生命周期函数--监听页面加载 |
75 | */ | 63 | */ |
76 | onLoad: function (options) { | 64 | onLoad: function (options) { |
77 | - console.log('options', options); | 65 | + // console.log('options', options); |
78 | const self = this; | 66 | const self = this; |
79 | self.setData({currentTab: +options.currentTab}); | 67 | self.setData({currentTab: +options.currentTab}); |
80 | self.getAppointmentList(); | 68 | self.getAppointmentList(); |
@@ -24,7 +24,7 @@ Page({ | @@ -24,7 +24,7 @@ Page({ | ||
24 | "XX-Token": wx.getStorageSync('token') | 24 | "XX-Token": wx.getStorageSync('token') |
25 | }; | 25 | }; |
26 | app.post(url, params, header).then((res) => { | 26 | app.post(url, params, header).then((res) => { |
27 | - console.log(res); | 27 | + // console.log(res); |
28 | if(res.this_page < res.total_page) { | 28 | if(res.this_page < res.total_page) { |
29 | this.setData({has_more: true}); | 29 | this.setData({has_more: true}); |
30 | } | 30 | } |
@@ -36,7 +36,7 @@ Page({ | @@ -36,7 +36,7 @@ Page({ | ||
36 | * 生命周期函数--监听页面加载 | 36 | * 生命周期函数--监听页面加载 |
37 | */ | 37 | */ |
38 | onLoad: function (options) { | 38 | onLoad: function (options) { |
39 | - console.log('options', options); | 39 | + // console.log('options', options); |
40 | this.setData({student_id: +options.student_id ? +options.student_id : ''}); | 40 | this.setData({student_id: +options.student_id ? +options.student_id : ''}); |
41 | this.recordList() | 41 | this.recordList() |
42 | }, | 42 | }, |
@@ -52,7 +52,7 @@ Page({ | @@ -52,7 +52,7 @@ Page({ | ||
52 | id: this.data.student_list[this.data.index].id | 52 | id: this.data.student_list[this.data.index].id |
53 | }; | 53 | }; |
54 | app.post(url, params,header).then((res) => { | 54 | app.post(url, params,header).then((res) => { |
55 | - console.log('支付换参',res); | 55 | + // console.log('支付换参',res); |
56 | this.wxPay(res.pay) | 56 | this.wxPay(res.pay) |
57 | }) | 57 | }) |
58 | }else { | 58 | }else { |
@@ -73,7 +73,7 @@ Page({ | @@ -73,7 +73,7 @@ Page({ | ||
73 | 'signType': data.signType, | 73 | 'signType': data.signType, |
74 | 'paySign': data.paySign, | 74 | 'paySign': data.paySign, |
75 | 'success': function(res) { | 75 | 'success': function(res) { |
76 | - console.log('支付成功',res); | 76 | + // console.log('支付成功',res); |
77 | wx.showToast({ | 77 | wx.showToast({ |
78 | title: '支付成功', | 78 | title: '支付成功', |
79 | icon: 'success', | 79 | icon: 'success', |
@@ -107,12 +107,12 @@ Page({ | @@ -107,12 +107,12 @@ Page({ | ||
107 | changeState() { | 107 | changeState() { |
108 | var pages = getCurrentPages(); | 108 | var pages = getCurrentPages(); |
109 | if (pages.length > 1) { | 109 | if (pages.length > 1) { |
110 | - console.log('pay_success',this.data.pay_success); | 110 | + // console.log('pay_success',this.data.pay_success); |
111 | var beforePage = pages[pages.length - 2]//获取上一页面实例 | 111 | var beforePage = pages[pages.length - 2]//获取上一页面实例 |
112 | if (this.data.pay_success) { | 112 | if (this.data.pay_success) { |
113 | // beforePage.refreshStudent() | 113 | // beforePage.refreshStudent() |
114 | beforePage.data.is_buy = true; | 114 | beforePage.data.is_buy = true; |
115 | - console.log('学生id',this.data.student_list[this.data.index].id); | 115 | + // console.log('学生id',this.data.student_list[this.data.index].id); |
116 | beforePage.data.choose_student_id = this.data.student_list[this.data.index].id; | 116 | beforePage.data.choose_student_id = this.data.student_list[this.data.index].id; |
117 | beforePage.refreshBuyState() | 117 | beforePage.refreshBuyState() |
118 | } | 118 | } |
@@ -125,14 +125,14 @@ Page({ | @@ -125,14 +125,14 @@ Page({ | ||
125 | "XX-token": wx.getStorageSync('token') | 125 | "XX-token": wx.getStorageSync('token') |
126 | }; | 126 | }; |
127 | app.post(url, {},header).then((res) => { | 127 | app.post(url, {},header).then((res) => { |
128 | - console.log(res); | 128 | + // console.log(res); |
129 | this.setData({ | 129 | this.setData({ |
130 | card_info: res | 130 | card_info: res |
131 | }) | 131 | }) |
132 | }) | 132 | }) |
133 | }, | 133 | }, |
134 | getMoreStudent() { | 134 | getMoreStudent() { |
135 | - console.log('has_more',this.data.has_more); | 135 | + // console.log('has_more',this.data.has_more); |
136 | if (this.data.has_more) { | 136 | if (this.data.has_more) { |
137 | this.data.page_number++; | 137 | this.data.page_number++; |
138 | this.getStudentList(); | 138 | this.getStudentList(); |
@@ -178,7 +178,7 @@ Page({ | @@ -178,7 +178,7 @@ Page({ | ||
178 | * 生命周期函数--监听页面加载 | 178 | * 生命周期函数--监听页面加载 |
179 | */ | 179 | */ |
180 | onLoad: function (options) { | 180 | onLoad: function (options) { |
181 | - console.log('options',options); | 181 | + // console.log('options',options); |
182 | const self =this; | 182 | const self =this; |
183 | self.getArcCard(); | 183 | self.getArcCard(); |
184 | self.setData({ | 184 | self.setData({ |
@@ -36,7 +36,6 @@ Page({ | @@ -36,7 +36,6 @@ Page({ | ||
36 | // 'modal_data.is_showModal': true, | 36 | // 'modal_data.is_showModal': true, |
37 | // 'modal_data.title': '绑定后无法更改,确认绑定' + this.data.picker_list[this.data.index] + '吗?', | 37 | // 'modal_data.title': '绑定后无法更改,确认绑定' + this.data.picker_list[this.data.index] + '吗?', |
38 | // }); | 38 | // }); |
39 | - console.log('34',e.detail); | ||
40 | const self = this; | 39 | const self = this; |
41 | if(self.data.code === '') { | 40 | if(self.data.code === '') { |
42 | wx.showToast({title: '请输入兑换码!',icon: 'none'}) | 41 | wx.showToast({title: '请输入兑换码!',icon: 'none'}) |
@@ -54,7 +53,7 @@ Page({ | @@ -54,7 +53,7 @@ Page({ | ||
54 | formId: self.data.detail.formId, | 53 | formId: self.data.detail.formId, |
55 | }; | 54 | }; |
56 | app.post(url,params,header).then((res) => { | 55 | app.post(url,params,header).then((res) => { |
57 | - console.log('兑换并绑定',res); | 56 | + // console.log('兑换并绑定',res); |
58 | this.setData({is_confirm: false}); | 57 | this.setData({is_confirm: false}); |
59 | if(res === '参数错误') { | 58 | if(res === '参数错误') { |
60 | } | 59 | } |
@@ -111,11 +110,11 @@ Page({ | @@ -111,11 +110,11 @@ Page({ | ||
111 | }; | 110 | }; |
112 | var list = []; | 111 | var list = []; |
113 | app.post(url,params,header).then((res) => { | 112 | app.post(url,params,header).then((res) => { |
114 | - console.log('学员列表',res); | 113 | + // console.log('学员列表',res); |
115 | res.list.forEach((item) => { | 114 | res.list.forEach((item) => { |
116 | list.push(item.name) | 115 | list.push(item.name) |
117 | }); | 116 | }); |
118 | - console.log('list', list); | 117 | + // console.log('list', list); |
119 | this.setData({picker_list: list,student_list: res.list}) | 118 | this.setData({picker_list: list,student_list: res.list}) |
120 | }) | 119 | }) |
121 | }, | 120 | }, |
@@ -47,7 +47,7 @@ Page({ | @@ -47,7 +47,7 @@ Page({ | ||
47 | }) | 47 | }) |
48 | } | 48 | } |
49 | }, 1000); | 49 | }, 1000); |
50 | - console.log(that.data.disabled); | 50 | + // console.log(that.data.disabled); |
51 | }else if(that.data.time_flag){ | 51 | }else if(that.data.time_flag){ |
52 | var currentTime1 = that.data.currentTime1; | 52 | var currentTime1 = that.data.currentTime1; |
53 | interval1 = setInterval(function () { | 53 | interval1 = setInterval(function () { |
@@ -64,7 +64,7 @@ Page({ | @@ -64,7 +64,7 @@ Page({ | ||
64 | }) | 64 | }) |
65 | } | 65 | } |
66 | }, 1000); | 66 | }, 1000); |
67 | - console.log(that.data.disabled1); | 67 | + // console.log(that.data.disabled1); |
68 | } | 68 | } |
69 | if(this.data.time_flag === '') { | 69 | if(this.data.time_flag === '') { |
70 | let url = '/user/Profile/getOldCode'; | 70 | let url = '/user/Profile/getOldCode'; |
@@ -75,7 +75,7 @@ Page({ | @@ -75,7 +75,7 @@ Page({ | ||
75 | "XX-token": wx.getStorageSync('token') | 75 | "XX-token": wx.getStorageSync('token') |
76 | }; | 76 | }; |
77 | app.post(url, params,header).then((res) => { | 77 | app.post(url, params,header).then((res) => { |
78 | - console.log('旧验证码',res); | 78 | + // console.log('旧验证码',res); |
79 | that.setData({old_verification_code: res.code,old_time: res.time}) | 79 | that.setData({old_verification_code: res.code,old_time: res.time}) |
80 | // console.log(this.data.this_week_test_info); | 80 | // console.log(this.data.this_week_test_info); |
81 | }) | 81 | }) |
@@ -89,10 +89,10 @@ Page({ | @@ -89,10 +89,10 @@ Page({ | ||
89 | "XX-token": wx.getStorageSync('token') | 89 | "XX-token": wx.getStorageSync('token') |
90 | }; | 90 | }; |
91 | app.post(url, params,header).then((res) => { | 91 | app.post(url, params,header).then((res) => { |
92 | - console.log('新验证码',res); | 92 | + // console.log('新验证码',res); |
93 | if(res == '手机号已经存在!') { | 93 | if(res == '手机号已经存在!') { |
94 | clearInterval(interval1); | 94 | clearInterval(interval1); |
95 | - console.log('...',that.data.disabled1); | 95 | + // console.log('...',that.data.disabled1); |
96 | that.setData({ | 96 | that.setData({ |
97 | time1: '获取验证码', | 97 | time1: '获取验证码', |
98 | disabled1:false, | 98 | disabled1:false, |
@@ -126,16 +126,16 @@ Page({ | @@ -126,16 +126,16 @@ Page({ | ||
126 | //下一步 | 126 | //下一步 |
127 | next() { | 127 | next() { |
128 | const self = this; | 128 | const self = this; |
129 | - console.log(0); | 129 | + // console.log(0); |
130 | clearInterval(interval); | 130 | clearInterval(interval); |
131 | if(self.data.old_phone === '') { | 131 | if(self.data.old_phone === '') { |
132 | - console.log(1); | 132 | + // console.log(1); |
133 | wx.showToast({title: '请输入手机号!',icon: 'none'}) | 133 | wx.showToast({title: '请输入手机号!',icon: 'none'}) |
134 | }else if(self.data.old_verification_code === '') { | 134 | }else if(self.data.old_verification_code === '') { |
135 | - console.log(2); | 135 | + // console.log(2); |
136 | wx.showToast({title: '请输入验证码!',icon: 'none'}) | 136 | wx.showToast({title: '请输入验证码!',icon: 'none'}) |
137 | }else { | 137 | }else { |
138 | - console.log(3); | 138 | + // console.log(3); |
139 | if(self.data.old_phone && self.data.old_verification_code) { | 139 | if(self.data.old_phone && self.data.old_verification_code) { |
140 | let url = '/user/Profile/checkOldMobile'; | 140 | let url = '/user/Profile/checkOldMobile'; |
141 | let params = { | 141 | let params = { |
@@ -147,7 +147,7 @@ Page({ | @@ -147,7 +147,7 @@ Page({ | ||
147 | "XX-token": wx.getStorageSync('token') | 147 | "XX-token": wx.getStorageSync('token') |
148 | }; | 148 | }; |
149 | app.post(url, params,header).then((res) => { | 149 | app.post(url, params,header).then((res) => { |
150 | - console.log('原手机号验证结果',res); | 150 | + // console.log('原手机号验证结果',res); |
151 | self.setData({time_flag: res.time}); | 151 | self.setData({time_flag: res.time}); |
152 | }); | 152 | }); |
153 | } | 153 | } |
@@ -156,16 +156,16 @@ Page({ | @@ -156,16 +156,16 @@ Page({ | ||
156 | //保存 | 156 | //保存 |
157 | formSubmit(e) { | 157 | formSubmit(e) { |
158 | const self = this; | 158 | const self = this; |
159 | - console.log(e,e.detail); | 159 | + // console.log(e,e.detail); |
160 | clearInterval(interval1); | 160 | clearInterval(interval1); |
161 | if(self.data.new_phone === '') { | 161 | if(self.data.new_phone === '') { |
162 | - console.log(1); | 162 | + // console.log(1); |
163 | wx.showToast({title: '请输入手机号!',icon: 'none'}) | 163 | wx.showToast({title: '请输入手机号!',icon: 'none'}) |
164 | }else if(self.data.new_verification_code === '') { | 164 | }else if(self.data.new_verification_code === '') { |
165 | - console.log(2); | 165 | + // console.log(2); |
166 | wx.showToast({title: '请输入验证码!',icon: 'none'}) | 166 | wx.showToast({title: '请输入验证码!',icon: 'none'}) |
167 | }else { | 167 | }else { |
168 | - console.log(3); | 168 | + // console.log(3); |
169 | if(self.data.new_phone && self.data.new_verification_code) { | 169 | if(self.data.new_phone && self.data.new_verification_code) { |
170 | let url = '/user/Profile/bindingNewMobile'; | 170 | let url = '/user/Profile/bindingNewMobile'; |
171 | let params = { | 171 | let params = { |
@@ -179,7 +179,7 @@ Page({ | @@ -179,7 +179,7 @@ Page({ | ||
179 | "XX-token": wx.getStorageSync('token') | 179 | "XX-token": wx.getStorageSync('token') |
180 | }; | 180 | }; |
181 | app.post(url, params, header).then((res) => { | 181 | app.post(url, params, header).then((res) => { |
182 | - console.log('新手机号绑定结果', res); | 182 | + // console.log('新手机号绑定结果', res); |
183 | if(res.is_bingding) { | 183 | if(res.is_bingding) { |
184 | wx.showToast({ | 184 | wx.showToast({ |
185 | title: '更换手机号成功!', | 185 | title: '更换手机号成功!', |
@@ -200,7 +200,7 @@ Page({ | @@ -200,7 +200,7 @@ Page({ | ||
200 | * 生命周期函数--监听页面加载 | 200 | * 生命周期函数--监听页面加载 |
201 | */ | 201 | */ |
202 | onLoad: function (options) { | 202 | onLoad: function (options) { |
203 | - console.log(options); | 203 | + // console.log(options); |
204 | this.setData({ | 204 | this.setData({ |
205 | old_phone: options.old_phone?options.old_phone:'', | 205 | old_phone: options.old_phone?options.old_phone:'', |
206 | old_phone_hidden: options.old_phone_hidden?options.old_phone_hidden:'', | 206 | old_phone_hidden: options.old_phone_hidden?options.old_phone_hidden:'', |
@@ -44,7 +44,7 @@ Page({ | @@ -44,7 +44,7 @@ Page({ | ||
44 | }, | 44 | }, |
45 | //选择性别 | 45 | //选择性别 |
46 | sexPickerChange: function(e) { | 46 | sexPickerChange: function(e) { |
47 | - console.log('picker发送选择改变,携带值为', e.detail.value) | 47 | + // console.log('picker发送选择改变,携带值为', e.detail.value) |
48 | this.setData({ | 48 | this.setData({ |
49 | sex_index: e.detail.value, | 49 | sex_index: e.detail.value, |
50 | is_sex_change: true, | 50 | is_sex_change: true, |
@@ -52,7 +52,7 @@ Page({ | @@ -52,7 +52,7 @@ Page({ | ||
52 | }, | 52 | }, |
53 | //选择生日 | 53 | //选择生日 |
54 | birthPickerChange: function(e) { | 54 | birthPickerChange: function(e) { |
55 | - console.log('picker发送选择改变,携带值为', e.detail.value) | 55 | + // console.log('picker发送选择改变,携带值为', e.detail.value) |
56 | this.setData({ | 56 | this.setData({ |
57 | birth_date: e.detail.value, | 57 | birth_date: e.detail.value, |
58 | is_birth_change: true, | 58 | is_birth_change: true, |
@@ -66,7 +66,7 @@ Page({ | @@ -66,7 +66,7 @@ Page({ | ||
66 | }, | 66 | }, |
67 | //选择城市 | 67 | //选择城市 |
68 | cityPickerChange: function(e) { | 68 | cityPickerChange: function(e) { |
69 | - console.log('picker发送选择改变,携带值为', e.detail.value) | 69 | + // console.log('picker发送选择改变,携带值为', e.detail.value) |
70 | this.setData({ | 70 | this.setData({ |
71 | city_index: e.detail.value, | 71 | city_index: e.detail.value, |
72 | is_city_change: true, | 72 | is_city_change: true, |
@@ -87,7 +87,7 @@ Page({ | @@ -87,7 +87,7 @@ Page({ | ||
87 | city: self.data.city[self.data.city_index] || self.data.current_student.city, | 87 | city: self.data.city[self.data.city_index] || self.data.current_student.city, |
88 | }; | 88 | }; |
89 | app.post(url, params, header).then((res) => { | 89 | app.post(url, params, header).then((res) => { |
90 | - console.log('保存', res); | 90 | + // console.log('保存', res); |
91 | if (res.is_success) { | 91 | if (res.is_success) { |
92 | wx.showToast({ | 92 | wx.showToast({ |
93 | title: '编辑成功', | 93 | title: '编辑成功', |
@@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
29 | getBanner() { | 29 | getBanner() { |
30 | let url = '/portal/Group/banner' | 30 | let url = '/portal/Group/banner' |
31 | app.post(url, {}, {}).then((res) => { | 31 | app.post(url, {}, {}).then((res) => { |
32 | - console.log('获取banner',res) | 32 | + // console.log('获取banner',res) |
33 | this.setData({banner: res.info}); | 33 | this.setData({banner: res.info}); |
34 | }) | 34 | }) |
35 | }, | 35 | }, |
@@ -84,7 +84,7 @@ Page({ | @@ -84,7 +84,7 @@ Page({ | ||
84 | "XX-token": wx.getStorageSync('token') | 84 | "XX-token": wx.getStorageSync('token') |
85 | }; | 85 | }; |
86 | app.post(url, {}, header).then((res) => { | 86 | app.post(url, {}, header).then((res) => { |
87 | - console.log('个人信息结果',res); | 87 | + // console.log('个人信息结果',res); |
88 | this.setData({personal_info: res.user}) | 88 | this.setData({personal_info: res.user}) |
89 | }); | 89 | }); |
90 | }, | 90 | }, |
@@ -15,7 +15,7 @@ Page({ | @@ -15,7 +15,7 @@ Page({ | ||
15 | 15 | ||
16 | //获取轮播当前页 | 16 | //获取轮播当前页 |
17 | swiperCharge(e) { | 17 | swiperCharge(e) { |
18 | - console.log(e.detail.current) | 18 | + // console.log(e.detail.current) |
19 | this.setData({ | 19 | this.setData({ |
20 | swipercurrent: e.detail.current, | 20 | swipercurrent: e.detail.current, |
21 | current_student: e.detail.current, | 21 | current_student: e.detail.current, |
@@ -29,7 +29,7 @@ Page({ | @@ -29,7 +29,7 @@ Page({ | ||
29 | "XX-Token": wx.getStorageSync('token') | 29 | "XX-Token": wx.getStorageSync('token') |
30 | } | 30 | } |
31 | app.post(url, params, header).then((res) => { | 31 | app.post(url, params, header).then((res) => { |
32 | - console.log(res); | 32 | + // console.log(res); |
33 | this.setData({imgsUrl: res.list, service: res.service}) | 33 | this.setData({imgsUrl: res.list, service: res.service}) |
34 | }) | 34 | }) |
35 | }, | 35 | }, |
@@ -42,7 +42,7 @@ Page({ | @@ -42,7 +42,7 @@ Page({ | ||
42 | "XX-Token": wx.getStorageSync('token') | 42 | "XX-Token": wx.getStorageSync('token') |
43 | } | 43 | } |
44 | app.post(url, {}, {}).then((res) => { | 44 | app.post(url, {}, {}).then((res) => { |
45 | - console.log('畅玩卡说明',res); | 45 | + // console.log('畅玩卡说明',res); |
46 | this.setData({service: res}) | 46 | this.setData({service: res}) |
47 | }) | 47 | }) |
48 | }, | 48 | }, |
@@ -25,7 +25,6 @@ Page({ | @@ -25,7 +25,6 @@ Page({ | ||
25 | student_list: [], | 25 | student_list: [], |
26 | }, | 26 | }, |
27 | handleBackground() { | 27 | handleBackground() { |
28 | - console.log('111') | ||
29 | this.setData({ 'modal_data.is_showModal': false}) | 28 | this.setData({ 'modal_data.is_showModal': false}) |
30 | }, | 29 | }, |
31 | //更换手机号 | 30 | //更换手机号 |
@@ -47,7 +46,7 @@ Page({ | @@ -47,7 +46,7 @@ Page({ | ||
47 | //编辑学员信息 | 46 | //编辑学员信息 |
48 | editInfo(e) { | 47 | editInfo(e) { |
49 | const current = e.currentTarget.dataset.index; | 48 | const current = e.currentTarget.dataset.index; |
50 | - console.log(current,JSON.stringify(this.data.student_list[current])); | 49 | + // console.log(current,JSON.stringify(this.data.student_list[current])); |
51 | wx.navigateTo({ | 50 | wx.navigateTo({ |
52 | url: '../edit-student/edit-student?current_student=' + | 51 | url: '../edit-student/edit-student?current_student=' + |
53 | JSON.stringify(this.data.student_list[current]) + | 52 | JSON.stringify(this.data.student_list[current]) + |
@@ -83,7 +82,6 @@ Page({ | @@ -83,7 +82,6 @@ Page({ | ||
83 | is_delete: true, | 82 | is_delete: true, |
84 | }); | 83 | }); |
85 | if(this.data.is_delete) { | 84 | if(this.data.is_delete) { |
86 | - console.log('diaoyong'); | ||
87 | this.delStudent(this.data.current_student); | 85 | this.delStudent(this.data.current_student); |
88 | } | 86 | } |
89 | }, | 87 | }, |
@@ -93,14 +91,12 @@ Page({ | @@ -93,14 +91,12 @@ Page({ | ||
93 | }, | 91 | }, |
94 | //删除学员 | 92 | //删除学员 |
95 | delStudent(e) { | 93 | delStudent(e) { |
96 | - console.log(e); | ||
97 | // var current = e.currentTarget.dataset.index; | 94 | // var current = e.currentTarget.dataset.index; |
98 | if(typeof(e) === "number") { | 95 | if(typeof(e) === "number") { |
99 | this.setData({current_student: e}); | 96 | this.setData({current_student: e}); |
100 | }else { | 97 | }else { |
101 | this.setData({current_student: e.currentTarget.dataset.index}); | 98 | this.setData({current_student: e.currentTarget.dataset.index}); |
102 | } | 99 | } |
103 | - console.log('current_student',this.data.current_student); | ||
104 | if(this.data.is_delete) { | 100 | if(this.data.is_delete) { |
105 | if(this.data.student_list[this.data.current_student].is_end === 1) {//该学员已绑卡,不能删除 | 101 | if(this.data.student_list[this.data.current_student].is_end === 1) {//该学员已绑卡,不能删除 |
106 | this.setData({'state_data.is_showSuccessModal': true,is_delete: false}) | 102 | this.setData({'state_data.is_showSuccessModal': true,is_delete: false}) |
@@ -113,7 +109,7 @@ Page({ | @@ -113,7 +109,7 @@ Page({ | ||
113 | id: this.data.student_list[this.data.current_student].id, | 109 | id: this.data.student_list[this.data.current_student].id, |
114 | }; | 110 | }; |
115 | app.post(url, params, header).then((res) => { | 111 | app.post(url, params, header).then((res) => { |
116 | - console.log('删除学员结果', res); | 112 | + // console.log('删除学员结果', res); |
117 | }); | 113 | }); |
118 | const arr = [] | 114 | const arr = [] |
119 | this.data.student_list.map((item) => { | 115 | this.data.student_list.map((item) => { |
@@ -121,7 +117,7 @@ Page({ | @@ -121,7 +117,7 @@ Page({ | ||
121 | arr.push(item) | 117 | arr.push(item) |
122 | } | 118 | } |
123 | }); | 119 | }); |
124 | - console.log('arr', arr); | 120 | + // console.log('arr', arr); |
125 | this.setData({student_list: arr,is_delete: false}); | 121 | this.setData({student_list: arr,is_delete: false}); |
126 | } | 122 | } |
127 | }else { | 123 | }else { |
@@ -138,13 +134,12 @@ Page({ | @@ -138,13 +134,12 @@ Page({ | ||
138 | "XX-token": wx.getStorageSync('token') | 134 | "XX-token": wx.getStorageSync('token') |
139 | }; | 135 | }; |
140 | app.post(url, {}, header).then((res) => { | 136 | app.post(url, {}, header).then((res) => { |
141 | - console.log('个人信息结果', res); | 137 | + // console.log('个人信息结果', res); |
142 | this.setData({personal_info: res.user}) | 138 | this.setData({personal_info: res.user}) |
143 | }); | 139 | }); |
144 | }, | 140 | }, |
145 | //获取学员列表 | 141 | //获取学员列表 |
146 | getStudentList() { | 142 | getStudentList() { |
147 | - console.log(this.data.page_number); | ||
148 | if(!this.data.has_more) return; | 143 | if(!this.data.has_more) return; |
149 | this.setData({has_more: false}); | 144 | this.setData({has_more: false}); |
150 | let url = '/user/Student/student_list'; | 145 | let url = '/user/Student/student_list'; |
@@ -155,7 +150,7 @@ Page({ | @@ -155,7 +150,7 @@ Page({ | ||
155 | page: this.data.page_number, | 150 | page: this.data.page_number, |
156 | }; | 151 | }; |
157 | app.post(url,params,header).then((res) => { | 152 | app.post(url,params,header).then((res) => { |
158 | - console.log('学员列表',res); | 153 | + // console.log('学员列表',res); |
159 | if(res.this_page < res.total_page) { | 154 | if(res.this_page < res.total_page) { |
160 | this.setData({has_more: true}); | 155 | this.setData({has_more: true}); |
161 | } | 156 | } |
@@ -222,7 +217,7 @@ Page({ | @@ -222,7 +217,7 @@ Page({ | ||
222 | icon: 'none' | 217 | icon: 'none' |
223 | }); | 218 | }); |
224 | } | 219 | } |
225 | - console.log('上拉加载'); | 220 | + // console.log('上拉加载'); |
226 | }, | 221 | }, |
227 | 222 | ||
228 | /** | 223 | /** |
@@ -44,7 +44,7 @@ Page({ | @@ -44,7 +44,7 @@ Page({ | ||
44 | page: this.data.page_number, | 44 | page: this.data.page_number, |
45 | }; | 45 | }; |
46 | app.post(url,params,header).then((res) => { | 46 | app.post(url,params,header).then((res) => { |
47 | - console.log('学员列表',res); | 47 | + // console.log('学员列表',res); |
48 | if(res.this_page < res.total_page) { | 48 | if(res.this_page < res.total_page) { |
49 | this.setData({has_more: true}); | 49 | this.setData({has_more: true}); |
50 | } | 50 | } |
@@ -53,63 +53,62 @@ Page({ | @@ -53,63 +53,62 @@ Page({ | ||
53 | res.list.forEach((item) => { | 53 | res.list.forEach((item) => { |
54 | new_arr.push({ ...item, checked: false }) | 54 | new_arr.push({ ...item, checked: false }) |
55 | });//给每一项添加checked属性 | 55 | });//给每一项添加checked属性 |
56 | - console.log(new_arr); | 56 | + // console.log(new_arr); |
57 | this.setData({student_list:this.data.student_list.concat(new_arr)}) | 57 | this.setData({student_list:this.data.student_list.concat(new_arr)}) |
58 | }) | 58 | }) |
59 | }, | 59 | }, |
60 | //选择学员(待确认可选) | 60 | //选择学员(待确认可选) |
61 | chooseChildren(e) { | 61 | chooseChildren(e) { |
62 | - console.log('29------e', e); | ||
63 | // const current = e.currentTarget.dataset.index; | 62 | // const current = e.currentTarget.dataset.index; |
64 | const that = this; | 63 | const that = this; |
65 | if(that.data.detail.status === 1) {//待确认可选择学员 | 64 | if(that.data.detail.status === 1) {//待确认可选择学员 |
66 | - console.log(e.detail); | 65 | + // console.log(e.detail); |
67 | var index_arr = e.detail.value; | 66 | var index_arr = e.detail.value; |
68 | - console.log(index_arr); | 67 | + // console.log(index_arr); |
69 | //新建数组全部设置为没被选中 | 68 | //新建数组全部设置为没被选中 |
70 | var new_arr = []; | 69 | var new_arr = []; |
71 | that.data.student_list.forEach((item) => { | 70 | that.data.student_list.forEach((item) => { |
72 | new_arr.push({ ...item, checked: false }) | 71 | new_arr.push({ ...item, checked: false }) |
73 | });//给每一项添加checked属性 | 72 | });//给每一项添加checked属性 |
74 | - console.log('new_arr',new_arr); | 73 | + // console.log('new_arr',new_arr); |
75 | var new_itmes = new_arr; | 74 | var new_itmes = new_arr; |
76 | - console.log('new_itmes', new_itmes); | 75 | + // console.log('new_itmes', new_itmes); |
77 | if(that.data.detail.num >=2) { //两个学员预约时 | 76 | if(that.data.detail.num >=2) { //两个学员预约时 |
78 | - console.log('两个学员'); | 77 | + // console.log('两个学员'); |
79 | if (index_arr.length > 2) { | 78 | if (index_arr.length > 2) { |
80 | //取出倒数两个值 | 79 | //取出倒数两个值 |
81 | var key1 = index_arr[index_arr.length - 1]; | 80 | var key1 = index_arr[index_arr.length - 1]; |
82 | var key2 = index_arr[index_arr.length - 2]; | 81 | var key2 = index_arr[index_arr.length - 2]; |
83 | // var key3 = skin[skin.length - 3]; | 82 | // var key3 = skin[skin.length - 3]; |
84 | // console.log(key1, key2, key3); | 83 | // console.log(key1, key2, key3); |
85 | - console.log(key1, key2); | ||
86 | - console.log(new_itmes[key1]['checked'],new_itmes[key1].id,new_itmes[key2].id); | 84 | + // console.log(key1, key2); |
85 | + // console.log(new_itmes[key1]['checked'],new_itmes[key1].id,new_itmes[key2].id); | ||
87 | //设置最后两个值为选中状态 | 86 | //设置最后两个值为选中状态 |
88 | new_itmes[key1]['checked'] = true | 87 | new_itmes[key1]['checked'] = true |
89 | new_itmes[key2]['checked'] = true | 88 | new_itmes[key2]['checked'] = true |
90 | // new_itmes[key3 - 1]['checked'] = 'true' | 89 | // new_itmes[key3 - 1]['checked'] = 'true' |
91 | //删除被选中的第一个值 | 90 | //删除被选中的第一个值 |
92 | index_arr.splice(0, 1); | 91 | index_arr.splice(0, 1); |
93 | - console.log('skin',index_arr); | 92 | + // console.log('skin',index_arr); |
94 | const id_arr = []; | 93 | const id_arr = []; |
95 | id_arr.push(new_itmes[key1].id,new_itmes[key2].id); | 94 | id_arr.push(new_itmes[key1].id,new_itmes[key2].id); |
96 | that.setData({student_id: id_arr.join(','),is_choose_student:true}); | 95 | that.setData({student_id: id_arr.join(','),is_choose_student:true}); |
97 | - console.log('student_id', that.data.student_id); | 96 | + // console.log('student_id', that.data.student_id); |
98 | } else { | 97 | } else { |
99 | const checked_student = []; | 98 | const checked_student = []; |
100 | //被选中少于两个,直接设置被选中 | 99 | //被选中少于两个,直接设置被选中 |
101 | for (var i = 0; i < index_arr.length; i++) { | 100 | for (var i = 0; i < index_arr.length; i++) { |
102 | var key = index_arr[i] | 101 | var key = index_arr[i] |
103 | - console.log('key', key); | 102 | + // console.log('key', key); |
104 | new_itmes[key]['checked'] = true | 103 | new_itmes[key]['checked'] = true |
105 | } | 104 | } |
106 | - console.log('选一个时候new_itmes', new_itmes); | 105 | + // console.log('选一个时候new_itmes', new_itmes); |
107 | new_itmes.forEach((item) => { | 106 | new_itmes.forEach((item) => { |
108 | if(item.checked) { | 107 | if(item.checked) { |
109 | checked_student.push(item) | 108 | checked_student.push(item) |
110 | } | 109 | } |
111 | }); | 110 | }); |
112 | - console.log('选择学员length', checked_student,checked_student.length); | 111 | + // console.log('选择学员length', checked_student,checked_student.length); |
113 | if(checked_student.length>=2) { | 112 | if(checked_student.length>=2) { |
114 | const arr = []; | 113 | const arr = []; |
115 | new_itmes.forEach((item) => { | 114 | new_itmes.forEach((item) => { |
@@ -122,36 +121,36 @@ Page({ | @@ -122,36 +121,36 @@ Page({ | ||
122 | wx.showToast({title:'请选择两个学员!',icon:'none'}); | 121 | wx.showToast({title:'请选择两个学员!',icon:'none'}); |
123 | that.setData({student_id: new_itmes[key].id,is_choose_student:true}); | 122 | that.setData({student_id: new_itmes[key].id,is_choose_student:true}); |
124 | } | 123 | } |
125 | - console.log('student_id', that.data.student_id); | 124 | + // console.log('student_id', that.data.student_id); |
126 | } | 125 | } |
127 | }else if(that.data.detail.num <2){//一个学员预约时 | 126 | }else if(that.data.detail.num <2){//一个学员预约时 |
128 | - console.log('一个学员'); | 127 | + // console.log('一个学员'); |
129 | if (index_arr.length > 1) { | 128 | if (index_arr.length > 1) { |
130 | //取出倒数一个值 | 129 | //取出倒数一个值 |
131 | var key1 = index_arr[index_arr.length - 1]; | 130 | var key1 = index_arr[index_arr.length - 1]; |
132 | // var key2 = skin[skin.length - 2]; | 131 | // var key2 = skin[skin.length - 2]; |
133 | // var key3 = skin[skin.length - 3]; | 132 | // var key3 = skin[skin.length - 3]; |
134 | // console.log(key1, key2, key3); | 133 | // console.log(key1, key2, key3); |
135 | - console.log(key1); | ||
136 | - console.log(new_itmes[key1]['checked'],new_itmes[key1].id); | 134 | + // console.log(key1); |
135 | + // console.log(new_itmes[key1]['checked'],new_itmes[key1].id); | ||
137 | //设置最后一个值为选中状态 | 136 | //设置最后一个值为选中状态 |
138 | new_itmes[key1]['checked'] = true | 137 | new_itmes[key1]['checked'] = true |
139 | // new_itmes[key2]['checked'] = true | 138 | // new_itmes[key2]['checked'] = true |
140 | // new_itmes[key3 - 1]['checked'] = 'true' | 139 | // new_itmes[key3 - 1]['checked'] = 'true' |
141 | //删除被选中的第一个值 | 140 | //删除被选中的第一个值 |
142 | index_arr.splice(0, 1); | 141 | index_arr.splice(0, 1); |
143 | - console.log('skin',index_arr); | 142 | + // console.log('skin',index_arr); |
144 | that.setData({student_id: new_itmes[key1].id,is_choose_student:true}); | 143 | that.setData({student_id: new_itmes[key1].id,is_choose_student:true}); |
145 | - console.log('student_id', that.data.student_id); | 144 | + // console.log('student_id', that.data.student_id); |
146 | } else { | 145 | } else { |
147 | //被选中少于1个,直接设置被选中 | 146 | //被选中少于1个,直接设置被选中 |
148 | for (var i = 0; i < index_arr.length; i++) { | 147 | for (var i = 0; i < index_arr.length; i++) { |
149 | var key = index_arr[i] | 148 | var key = index_arr[i] |
150 | - console.log('key', key); | 149 | + // console.log('key', key); |
151 | new_itmes[key]['checked'] = true | 150 | new_itmes[key]['checked'] = true |
152 | } | 151 | } |
153 | that.setData({student_id: new_itmes[key].id,is_choose_student:true}); | 152 | that.setData({student_id: new_itmes[key].id,is_choose_student:true}); |
154 | - console.log('student_id', that.data.student_id); | 153 | + // console.log('student_id', that.data.student_id); |
155 | } | 154 | } |
156 | } | 155 | } |
157 | 156 | ||
@@ -189,7 +188,7 @@ Page({ | @@ -189,7 +188,7 @@ Page({ | ||
189 | }, | 188 | }, |
190 | //获取预约详情 | 189 | //获取预约详情 |
191 | getAppointmentInfo() { | 190 | getAppointmentInfo() { |
192 | - console.log('this.data.student_list', this.data.student_list); | 191 | + // console.log('this.data.student_list', this.data.student_list); |
193 | let url = '/user/Reservation/reservation_detail'; | 192 | let url = '/user/Reservation/reservation_detail'; |
194 | let header = { | 193 | let header = { |
195 | "XX-token": wx.getStorageSync('token') | 194 | "XX-token": wx.getStorageSync('token') |
@@ -198,48 +197,46 @@ Page({ | @@ -198,48 +197,46 @@ Page({ | ||
198 | reservation_id: this.data.reservation_id, | 197 | reservation_id: this.data.reservation_id, |
199 | }; | 198 | }; |
200 | app.post(url,params,header).then((res) => { | 199 | app.post(url,params,header).then((res) => { |
201 | - console.log('预约详情',res.info.status === 1); | 200 | + // console.log('预约详情',res.info.status === 1); |
202 | this.setData({ | 201 | this.setData({ |
203 | detail: res.info, | 202 | detail: res.info, |
204 | }); | 203 | }); |
205 | if(this.data.detail.status === 1 && !this.data.is_buy) { | 204 | if(this.data.detail.status === 1 && !this.data.is_buy) { |
206 | - console.log('111111111111111'); | ||
207 | this.getStudentList(); | 205 | this.getStudentList(); |
208 | } | 206 | } |
209 | }); | 207 | }); |
210 | }, | 208 | }, |
211 | //更新购买状态 | 209 | //更新购买状态 |
212 | refreshBuyState() { | 210 | refreshBuyState() { |
213 | - console.log('更新购买状态---学生id--人数',this.data.detail.num,this.data.is_buy,this.data.choose_student_id); | 211 | + // console.log('更新购买状态---学生id--人数',this.data.detail.num,this.data.is_buy,this.data.choose_student_id); |
214 | if(this.data.is_buy) { | 212 | if(this.data.is_buy) { |
215 | if(this.data.detail.num<2) { | 213 | if(this.data.detail.num<2) { |
216 | this.data.student_list.forEach((item) => { | 214 | this.data.student_list.forEach((item) => { |
217 | item.checked = false; | 215 | item.checked = false; |
218 | if (item.id === this.data.choose_student_id) { | 216 | if (item.id === this.data.choose_student_id) { |
219 | - console.log('item.id', item.id); | 217 | + // console.log('item.id', item.id); |
220 | item.checked = true; | 218 | item.checked = true; |
221 | } | 219 | } |
222 | }); | 220 | }); |
223 | this.setData({student_list:this.data.student_list,is_choose_student:true}) | 221 | this.setData({student_list:this.data.student_list,is_choose_student:true}) |
224 | - console.log('student_list',this.data.student_list); | 222 | + // console.log('student_list',this.data.student_list); |
225 | }else if(this.data.detail.num>=2) { | 223 | }else if(this.data.detail.num>=2) { |
226 | - console.log('购买完进入两个学员student_list',this.data.student_list); | 224 | + // console.log('购买完进入两个学员student_list',this.data.student_list); |
227 | this.data.student_list.forEach((item) => { | 225 | this.data.student_list.forEach((item) => { |
228 | item.checked = false; | 226 | item.checked = false; |
229 | if (item.id === this.data.choose_student_id) { | 227 | if (item.id === this.data.choose_student_id) { |
230 | - console.log('item.id', item.id); | 228 | + // console.log('item.id', item.id); |
231 | item.checked = true; | 229 | item.checked = true; |
232 | // total_student_num.push(item) | 230 | // total_student_num.push(item) |
233 | } | 231 | } |
234 | }); | 232 | }); |
235 | this.setData({student_list:this.data.student_list,is_choose_student:true,}); | 233 | this.setData({student_list:this.data.student_list,is_choose_student:true,}); |
236 | - console.log('student_list',this.data.student_list); | 234 | + // console.log('student_list',this.data.student_list); |
237 | } | 235 | } |
238 | } | 236 | } |
239 | }, | 237 | }, |
240 | //取消 | 238 | //取消 |
241 | clickCancel(e) { | 239 | clickCancel(e) { |
242 | - console.log('取消',e); | ||
243 | let url = '/user/Reservation/reservation_cancel'; | 240 | let url = '/user/Reservation/reservation_cancel'; |
244 | let header = { | 241 | let header = { |
245 | "XX-token": wx.getStorageSync('token') | 242 | "XX-token": wx.getStorageSync('token') |
@@ -249,19 +246,19 @@ Page({ | @@ -249,19 +246,19 @@ Page({ | ||
249 | formId: e.detail.formId, | 246 | formId: e.detail.formId, |
250 | }; | 247 | }; |
251 | app.post(url, params,header).then((res) => { | 248 | app.post(url, params,header).then((res) => { |
252 | - console.log('取消',res); | 249 | + // console.log('取消',res); |
253 | // this.setData({orderList: res.list}) | 250 | // this.setData({orderList: res.list}) |
254 | }) | 251 | }) |
255 | }, | 252 | }, |
256 | //确认 | 253 | //确认 |
257 | clickConfirm(e) { | 254 | clickConfirm(e) { |
258 | - console.log(e.detail); | 255 | + // console.log(e.detail); |
259 | if(this.data.student_list.length === 0) { | 256 | if(this.data.student_list.length === 0) { |
260 | wx.showToast({title: '请添加学员!',icon:'none'}) | 257 | wx.showToast({title: '请添加学员!',icon:'none'}) |
261 | }else if(!this.data.is_choose_student) { | 258 | }else if(!this.data.is_choose_student) { |
262 | wx.showToast({title: '请选择学员!',icon:'none'}) | 259 | wx.showToast({title: '请选择学员!',icon:'none'}) |
263 | }else if(this.data.detail.num>=2 && ('' + this.data.student_id).indexOf(',') === -1) { | 260 | }else if(this.data.detail.num>=2 && ('' + this.data.student_id).indexOf(',') === -1) { |
264 | - console.log('检验student_id',('' + this.data.student_id).indexOf(',')); | 261 | + // console.log('检验student_id',('' + this.data.student_id).indexOf(',')); |
265 | wx.showToast({title:'请选择两个学员!',icon:'none'}) | 262 | wx.showToast({title:'请选择两个学员!',icon:'none'}) |
266 | }else { | 263 | }else { |
267 | // this.setData({'modal_data.is_showModal': true}) | 264 | // this.setData({'modal_data.is_showModal': true}) |
@@ -278,7 +275,7 @@ Page({ | @@ -278,7 +275,7 @@ Page({ | ||
278 | students: this.data.student_id, | 275 | students: this.data.student_id, |
279 | }; | 276 | }; |
280 | app.post(url,params,header).then((res) => { | 277 | app.post(url,params,header).then((res) => { |
281 | - console.log('提交预约信息',res); | 278 | + // console.log('提交预约信息',res); |
282 | if(res.data.card_modal === 1) { | 279 | if(res.data.card_modal === 1) { |
283 | this.setData({'modal_data.is_showModal': true}); | 280 | this.setData({'modal_data.is_showModal': true}); |
284 | }else if(res.data.reservation_modal === 1) { | 281 | }else if(res.data.reservation_modal === 1) { |
@@ -292,8 +289,8 @@ Page({ | @@ -292,8 +289,8 @@ Page({ | ||
292 | */ | 289 | */ |
293 | onLoad: function (options) { | 290 | onLoad: function (options) { |
294 | const self =this; | 291 | const self =this; |
295 | - console.log('load'); | ||
296 | - console.log(options); | 292 | + // console.log('load'); |
293 | + // console.log(options); | ||
297 | self.setData({ | 294 | self.setData({ |
298 | currentTab: +options.currentTab?+options.currentTab:'', | 295 | currentTab: +options.currentTab?+options.currentTab:'', |
299 | reservation_id: +options.reservation_id?options.reservation_id:'', | 296 | reservation_id: +options.reservation_id?options.reservation_id:'', |
-
请 注册 或 登录 后发表评论