Commit 061511a0318f69130c5c339fa89626e5f984df99
1 parent
ddb4664f
修改选择时间bug
Showing
6 changed files
with
63 additions
and
66 deletions
pages/user/my_service/appment_main.wxss
@@ -88,7 +88,7 @@ button { | @@ -88,7 +88,7 @@ button { | ||
88 | .textarea { | 88 | .textarea { |
89 | width: 420rpx; | 89 | width: 420rpx; |
90 | background-color: rgb(238, 238, 238); | 90 | background-color: rgb(238, 238, 238); |
91 | - border-radius: 10rpx; | 91 | + border-radius: 6rpx; |
92 | height: 130rpx; | 92 | height: 130rpx; |
93 | padding-left: 40rpx; | 93 | padding-left: 40rpx; |
94 | padding-right: 15rpx; | 94 | padding-right: 15rpx; |
@@ -106,7 +106,7 @@ button { | @@ -106,7 +106,7 @@ button { | ||
106 | height: 55rpx; | 106 | height: 55rpx; |
107 | line-height: 55rpx; | 107 | line-height: 55rpx; |
108 | background-color: rgb(238, 238, 238); | 108 | background-color: rgb(238, 238, 238); |
109 | - border-radius: 10rpx; | 109 | + border-radius: 6rpx; |
110 | padding-left: 40rpx; | 110 | padding-left: 40rpx; |
111 | padding-right: 15rpx; | 111 | padding-right: 15rpx; |
112 | } | 112 | } |
@@ -118,7 +118,7 @@ button { | @@ -118,7 +118,7 @@ button { | ||
118 | background-color: rgb(238, 238, 238); | 118 | background-color: rgb(238, 238, 238); |
119 | height: 50rpx; | 119 | height: 50rpx; |
120 | line-height: 50rpx; | 120 | line-height: 50rpx; |
121 | - border-radius: 10rpx; | 121 | + border-radius: 6rpx; |
122 | } | 122 | } |
123 | 123 | ||
124 | .beauticians { | 124 | .beauticians { |
pages/user/my_service/beauty_deta.js
@@ -37,14 +37,11 @@ Page({ | @@ -37,14 +37,11 @@ Page({ | ||
37 | */ | 37 | */ |
38 | onLoad: function(options) { | 38 | onLoad: function(options) { |
39 | var th = this; | 39 | var th = this; |
40 | - var myDate = new Date(); | ||
41 | - var date = myDate.getHours() + ":00"; //获取当前小时数(0-23) | ||
42 | var beautician_id = options.BeauticianID; | 40 | var beautician_id = options.BeauticianID; |
43 | th.setData({ | 41 | th.setData({ |
44 | beautician_id: beautician_id, | 42 | beautician_id: beautician_id, |
45 | itemId: options.itemId, | 43 | itemId: options.itemId, |
46 | modify: options.modify, | 44 | modify: options.modify, |
47 | - hours: date, | ||
48 | projectId: options.projectId | 45 | projectId: options.projectId |
49 | }) | 46 | }) |
50 | if (options.url != undefined) { | 47 | if (options.url != undefined) { |
@@ -69,7 +66,13 @@ Page({ | @@ -69,7 +66,13 @@ Page({ | ||
69 | * 生命周期函数--监听页面显示 | 66 | * 生命周期函数--监听页面显示 |
70 | */ | 67 | */ |
71 | onShow: function() { | 68 | onShow: function() { |
72 | - | 69 | + var th = this; |
70 | + var myDate = new Date(); | ||
71 | + var date = myDate.getHours() + ":00"; //获取当前小时数(0-23) | ||
72 | + th.setData({ | ||
73 | + hours:date | ||
74 | + }) | ||
75 | + th.query_date(); | ||
73 | }, | 76 | }, |
74 | 77 | ||
75 | //图片失败,默认图片 | 78 | //图片失败,默认图片 |
@@ -248,7 +251,7 @@ Page({ | @@ -248,7 +251,7 @@ Page({ | ||
248 | aweeks: arr, | 251 | aweeks: arr, |
249 | weeks: weeks | 252 | weeks: weeks |
250 | }) | 253 | }) |
251 | - if (arr.length > 0) { | 254 | + if (data.length > 0) { |
252 | th.query_date(); | 255 | th.query_date(); |
253 | } | 256 | } |
254 | } else { | 257 | } else { |
@@ -264,40 +267,40 @@ Page({ | @@ -264,40 +267,40 @@ Page({ | ||
264 | var date_id = th.data.date_id; //日期下标 | 267 | var date_id = th.data.date_id; //日期下标 |
265 | var SeekTime = th.data.aweeks[date_id].time; | 268 | var SeekTime = th.data.aweeks[date_id].time; |
266 | var val = th.data.aweeks[date_id].val; | 269 | var val = th.data.aweeks[date_id].val; |
267 | - if(val!=""){ | ||
268 | - var url = "/api/weshop/marketing/reservation/staff/time/list"; | ||
269 | - getApp().request.promiseGet(url, { | ||
270 | - data: { | ||
271 | - projectId: projectId, | ||
272 | - beauticianId: th.data.beautician_id, | ||
273 | - serviceId: th.data.itemId, | ||
274 | - seekTime: SeekTime, | ||
275 | - storeId: a.stoid, | ||
276 | - } | ||
277 | - }).then(res => { | ||
278 | - if (res.data.code == 0) { | ||
279 | - var time_list = res.data.data; | ||
280 | - var time = th.data.time; | ||
281 | - var new_time = []; | ||
282 | - if (time_list != null) { | ||
283 | - for (var i = 0; i < time.length; i++) { | ||
284 | - for (var ii = 0; ii < res.data.data.length; ii++) { | ||
285 | - if (time[i] == time_list[ii].GroupHour.substring(0, 5)) { | ||
286 | - new_time[i] = time_list[ii].GroupHour.substring(0, 5); | ||
287 | - break; | ||
288 | - } else { | ||
289 | - new_time[i] = ""; | 270 | + if (val != "") { |
271 | + var url = "/api/weshop/marketing/reservation/staff/time/list"; | ||
272 | + getApp().request.promiseGet(url, { | ||
273 | + data: { | ||
274 | + projectId: projectId, | ||
275 | + beauticianId: th.data.beautician_id, | ||
276 | + serviceId: th.data.itemId, | ||
277 | + seekTime: SeekTime, | ||
278 | + storeId: a.stoid, | ||
279 | + } | ||
280 | + }).then(res => { | ||
281 | + if (res.data.code == 0) { | ||
282 | + var time_list = res.data.data; | ||
283 | + var time = th.data.time; | ||
284 | + var new_time = []; | ||
285 | + if (time_list != null) { | ||
286 | + for (var i = 0; i < time.length; i++) { | ||
287 | + for (var ii = 0; ii < time_list.length; ii++) { | ||
288 | + if (time[i] == time_list[ii].GroupHour.substring(0, 5)) { | ||
289 | + new_time[i] = time_list[ii].GroupHour.substring(0, 5); | ||
290 | + break; | ||
291 | + } else { | ||
292 | + new_time[i] = ""; | ||
293 | + } | ||
290 | } | 294 | } |
291 | } | 295 | } |
292 | } | 296 | } |
297 | + th.setData({ | ||
298 | + time_list: new_time | ||
299 | + }) | ||
300 | + } else { | ||
301 | + getApp().my_warnning(res.data.msg, 0, th); | ||
293 | } | 302 | } |
294 | - th.setData({ | ||
295 | - time_list: new_time | ||
296 | - }) | ||
297 | - } else { | ||
298 | - getApp().my_warnning(res.data.msg, 0, th); | ||
299 | - } | ||
300 | - }) | 303 | + }) |
301 | } | 304 | } |
302 | }, | 305 | }, |
303 | //更改预约时间 | 306 | //更改预约时间 |
pages/user/my_service/beauty_deta.wxml
@@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
41 | <view class="Times"> | 41 | <view class="Times"> |
42 | 42 | ||
43 | <view class="flex-center" wx:for="{{time}}" style="display:inline-block;" wx:for-index="key" wx:for-item="it"> | 43 | <view class="flex-center" wx:for="{{time}}" style="display:inline-block;" wx:for-index="key" wx:for-item="it"> |
44 | - <block wx:if="{{it==time_list[key] && date_id==0?hours<it:true}}"> | 44 | + <block wx:if="{{it==time_list[key]}} && time[key]>=hours?true:false}}"> |
45 | <view class="Time flex-center {{time_index==key?'chTime':''}}" bindtap="Selection_time" data-index="{{key}}"> | 45 | <view class="Time flex-center {{time_index==key?'chTime':''}}" bindtap="Selection_time" data-index="{{key}}"> |
46 | <view> | 46 | <view> |
47 | <view class="fs26">{{it}}</view> | 47 | <view class="fs26">{{it}}</view> |
pages/user/my_service/i_service.wxml
@@ -49,9 +49,9 @@ | @@ -49,9 +49,9 @@ | ||
49 | <view>立即使用</view> | 49 | <view>立即使用</view> |
50 | </view> | 50 | </view> |
51 | <!-- 可预约 --> | 51 | <!-- 可预约 --> |
52 | - <navigator wx:if="{{item.State>0}}" class="flex-level appointment yellow-b" data-url="/pages/user/my_service/appment_main?service_id={{item.ServiceID}}&BuyType={{item.BuyType}}&ProjectID={{item.ProjectID}}&Validay={{item.Validay}}" bindtap="correcting" data-service_id="{{item.ServiceID}}" data-project_id="{{item.ProjectID}}"> | 52 | + <view wx:if="{{item.State>0}}" class="flex-level appointment yellow-b" data-url="/pages/user/my_service/appment_main?service_id={{item.ServiceID}}&BuyType={{item.BuyType}}&ProjectID={{item.ProjectID}}&Validay={{item.Validay}}" bindtap="correcting" data-service_id="{{item.ServiceID}}" data-project_id="{{item.ProjectID}}"> |
53 | <view>预约</view> | 53 | <view>预约</view> |
54 | - </navigator> | 54 | + </view> |
55 | </view> | 55 | </view> |
56 | </view> | 56 | </view> |
57 | <!-- 没有数据 --> | 57 | <!-- 没有数据 --> |
pages/user/my_service/tment_details.js
@@ -9,16 +9,16 @@ Page({ | @@ -9,16 +9,16 @@ Page({ | ||
9 | * 页面的初始数据 | 9 | * 页面的初始数据 |
10 | */ | 10 | */ |
11 | data: { | 11 | data: { |
12 | - url:a.url, | 12 | + url: a.url, |
13 | iurl: a.imghost, | 13 | iurl: a.imghost, |
14 | tment_details: [], //预约详情 | 14 | tment_details: [], //预约详情 |
15 | - number:"",//订单号 | ||
16 | - arrangeTime:"",//预约年月日 | ||
17 | - day:"",//判断是上午还是下午 | ||
18 | - states:3,//3为取消预约 | 15 | + number: "", //订单号 |
16 | + arrangeTime: "", //预约年月日 | ||
17 | + day: "", //判断是上午还是下午 | ||
18 | + states: 3, //3为取消预约 | ||
19 | }, | 19 | }, |
20 | //取消预约 | 20 | //取消预约 |
21 | - cancel_tment: function (e) { | 21 | + cancel_tment: function(e) { |
22 | var th = this; | 22 | var th = this; |
23 | var index = e.currentTarget.dataset.index; | 23 | var index = e.currentTarget.dataset.index; |
24 | var states = th.data.states; | 24 | var states = th.data.states; |
@@ -38,7 +38,7 @@ Page({ | @@ -38,7 +38,7 @@ Page({ | ||
38 | header: { | 38 | header: { |
39 | 'content-type': 'application/json' | 39 | 'content-type': 'application/json' |
40 | }, // 设置请求的 header | 40 | }, // 设置请求的 header |
41 | - success: function (res) { | 41 | + success: function(res) { |
42 | if (res.data.code == 0) { | 42 | if (res.data.code == 0) { |
43 | getApp().my_warnning("取消成功", 0, th); | 43 | getApp().my_warnning("取消成功", 0, th); |
44 | var id = th.data.activeCategoryId; | 44 | var id = th.data.activeCategoryId; |
@@ -69,13 +69,9 @@ Page({ | @@ -69,13 +69,9 @@ Page({ | ||
69 | th.setData({ | 69 | th.setData({ |
70 | number: options.number | 70 | number: options.number |
71 | }) | 71 | }) |
72 | - th.query_bea(); | ||
73 | }, | 72 | }, |
74 | //查询美容师详情 | 73 | //查询美容师详情 |
75 | query_bea: function() { | 74 | query_bea: function() { |
76 | - wx.showLoading({ | ||
77 | - title: '加载中', | ||
78 | - }) | ||
79 | var th = this; | 75 | var th = this; |
80 | var number = th.data.number; | 76 | var number = th.data.number; |
81 | var url = "/api/weshop/marketing/reservation/reservation/page"; | 77 | var url = "/api/weshop/marketing/reservation/reservation/page"; |
@@ -89,26 +85,26 @@ Page({ | @@ -89,26 +85,26 @@ Page({ | ||
89 | wx.hideLoading(); | 85 | wx.hideLoading(); |
90 | if (res.data.code == 0) { | 86 | if (res.data.code == 0) { |
91 | var data = res.data.data.pageData; | 87 | var data = res.data.data.pageData; |
92 | - var arrangeTime = data[0].ArrangeTime.substring(0,11); | 88 | + var arrangeTime = data[0].ArrangeTime.substring(0, 11); |
93 | var day = data[0].ArrangeTime.substring(12, 13); | 89 | var day = data[0].ArrangeTime.substring(12, 13); |
94 | - if (day<12){ | ||
95 | - day = "上午" | ||
96 | - }else{ | 90 | + if (day < 12) { |
91 | + day = "上午" | ||
92 | + } else { | ||
97 | day = "下午" | 93 | day = "下午" |
98 | } | 94 | } |
99 | th.setData({ | 95 | th.setData({ |
100 | tment_details: data, | 96 | tment_details: data, |
101 | arrangeTime: arrangeTime, | 97 | arrangeTime: arrangeTime, |
102 | - day:day | 98 | + day: day |
103 | }) | 99 | }) |
104 | - | ||
105 | - }else{ | 100 | + |
101 | + } else { | ||
106 | getApp().my_warnning(res.data.msg, 0, th); | 102 | getApp().my_warnning(res.data.msg, 0, th); |
107 | } | 103 | } |
108 | }) | 104 | }) |
109 | }, | 105 | }, |
110 | //显示核销码 | 106 | //显示核销码 |
111 | - code_show: function (e) { | 107 | + code_show: function(e) { |
112 | var th = this; | 108 | var th = this; |
113 | //--获取成功的时候-- | 109 | //--获取成功的时候-- |
114 | var no = e.currentTarget.dataset.order_sn; | 110 | var no = e.currentTarget.dataset.order_sn; |
@@ -120,7 +116,7 @@ Page({ | @@ -120,7 +116,7 @@ Page({ | ||
120 | qc_com.open(obj) | 116 | qc_com.open(obj) |
121 | }, | 117 | }, |
122 | //跳到首页 | 118 | //跳到首页 |
123 | - goto: function (e) { | 119 | + goto: function(e) { |
124 | wx.switchTab({ | 120 | wx.switchTab({ |
125 | url: '/pages/index/index/index', | 121 | url: '/pages/index/index/index', |
126 | }) | 122 | }) |
@@ -129,6 +125,7 @@ Page({ | @@ -129,6 +125,7 @@ Page({ | ||
129 | * 生命周期函数--监听页面显示 | 125 | * 生命周期函数--监听页面显示 |
130 | */ | 126 | */ |
131 | onShow: function() { | 127 | onShow: function() { |
132 | - | 128 | + var th = this; |
129 | + th.query_bea(); | ||
133 | }, | 130 | }, |
134 | }) | 131 | }) |
135 | \ No newline at end of file | 132 | \ No newline at end of file |
pages/user/my_service/tment_order_list.js
@@ -85,7 +85,7 @@ Page({ | @@ -85,7 +85,7 @@ Page({ | ||
85 | title: '加载中', | 85 | title: '加载中', |
86 | }) | 86 | }) |
87 | th.setData({ | 87 | th.setData({ |
88 | - is_read:0 | 88 | + is_read: 0 |
89 | }) | 89 | }) |
90 | getApp().request.promiseGet(url, { | 90 | getApp().request.promiseGet(url, { |
91 | data: { | 91 | data: { |
@@ -179,9 +179,6 @@ Page({ | @@ -179,9 +179,6 @@ Page({ | ||
179 | */ | 179 | */ |
180 | onShow: function() { | 180 | onShow: function() { |
181 | var th = this; | 181 | var th = this; |
182 | - th.setData({ | ||
183 | - is_read:0 | ||
184 | - }) | ||
185 | th.query_orderList(); | 182 | th.query_orderList(); |
186 | }, | 183 | }, |
187 | 184 |