Commit ae80634905778483db2f8dd6f0561a8f4e59a908
1 parent
44d87757
服务测试已知bug修复
Showing
11 changed files
with
183 additions
and
76 deletions
pages/user/my_service/appment_main.js
@@ -40,7 +40,7 @@ Page({ | @@ -40,7 +40,7 @@ Page({ | ||
40 | tment_count: "", //可预约人数 | 40 | tment_count: "", //可预约人数 |
41 | lat: "", //纬度坐标 | 41 | lat: "", //纬度坐标 |
42 | lon: "", //经度坐标 | 42 | lon: "", //经度坐标 |
43 | - is_gps: 1,//是否开启gps | 43 | + is_gps: 1, //是否开启gps |
44 | }, | 44 | }, |
45 | onclickstore: function() { | 45 | onclickstore: function() { |
46 | var th = this; | 46 | var th = this; |
@@ -53,6 +53,7 @@ Page({ | @@ -53,6 +53,7 @@ Page({ | ||
53 | wx.hideLoading(); | 53 | wx.hideLoading(); |
54 | } else { | 54 | } else { |
55 | th.setData({ | 55 | th.setData({ |
56 | + beautician: 0, | ||
56 | store: 1, | 57 | store: 1, |
57 | placeholder: "" | 58 | placeholder: "" |
58 | }) | 59 | }) |
@@ -125,10 +126,11 @@ Page({ | @@ -125,10 +126,11 @@ Page({ | ||
125 | th.setData({ | 126 | th.setData({ |
126 | is_success: 1 | 127 | is_success: 1 |
127 | }) | 128 | }) |
128 | - setTimeout(function() {}, 3000); | ||
129 | - wx.redirectTo({ | ||
130 | - url: "/pages/user/my_service/tment_order_list" | ||
131 | - }); | 129 | + setTimeout(function() { |
130 | + wx.redirectTo({ | ||
131 | + url: "/pages/user/my_service/tment_order_list" | ||
132 | + }); | ||
133 | + }, 800); | ||
132 | } else { | 134 | } else { |
133 | getApp().my_warnning(res.data.msg, 0, th); | 135 | getApp().my_warnning(res.data.msg, 0, th); |
134 | } | 136 | } |
@@ -203,8 +205,8 @@ Page({ | @@ -203,8 +205,8 @@ Page({ | ||
203 | keyWord: key_word | 205 | keyWord: key_word |
204 | } | 206 | } |
205 | }).then(res => { | 207 | }).then(res => { |
208 | + wx.hideLoading(); | ||
206 | if (res.data.code == 0) { | 209 | if (res.data.code == 0) { |
207 | - wx.hideLoading(); | ||
208 | th.data.curpage++; | 210 | th.data.curpage++; |
209 | var arr1 = th.data.store_list; | 211 | var arr1 = th.data.store_list; |
210 | var arr2 = res.data.data.pageData; | 212 | var arr2 = res.data.data.pageData; |
@@ -237,6 +239,9 @@ Page({ | @@ -237,6 +239,9 @@ Page({ | ||
237 | beautician: 0 | 239 | beautician: 0 |
238 | }) | 240 | }) |
239 | } | 241 | } |
242 | + wx.showLoading({ | ||
243 | + title: '加载中', | ||
244 | + }) | ||
240 | var itemid = th.data.itemId; //正式使用的项目id | 245 | var itemid = th.data.itemId; //正式使用的项目id |
241 | var storageId = th.data.storageId; //正式使用的线下门店id | 246 | var storageId = th.data.storageId; //正式使用的线下门店id |
242 | var url = "/api/weshop/marketing/reservation/staff/page"; //接口地址 | 247 | var url = "/api/weshop/marketing/reservation/staff/page"; //接口地址 |
@@ -248,12 +253,16 @@ Page({ | @@ -248,12 +253,16 @@ Page({ | ||
248 | storageId: storageId | 253 | storageId: storageId |
249 | } | 254 | } |
250 | }).then(res => { | 255 | }).then(res => { |
256 | + wx.hideLoading(); | ||
251 | if (res.data.code == 0) { | 257 | if (res.data.code == 0) { |
252 | th.setData({ | 258 | th.setData({ |
253 | beautician_list: res.data.data.pageData | 259 | beautician_list: res.data.data.pageData |
254 | - }) //停止下拉刷新 | 260 | + }) |
261 | + if (res.data.data.pageData.length < 1) { | ||
262 | + getApp().my_warnning("暂无美容师", 0, th); | ||
263 | + } | ||
255 | } else { | 264 | } else { |
256 | - getApp().my_warnning(res.data.msg, 0, th); | 265 | + getApp().my_warnning("暂无美容师", 0, th); |
257 | } | 266 | } |
258 | }) | 267 | }) |
259 | } | 268 | } |
@@ -289,6 +298,9 @@ Page({ | @@ -289,6 +298,9 @@ Page({ | ||
289 | is_search: 0, | 298 | is_search: 0, |
290 | store_list: [] | 299 | store_list: [] |
291 | }) | 300 | }) |
301 | + wx.showLoading({ | ||
302 | + title: '加载中', | ||
303 | + }) | ||
292 | th.query_store(); | 304 | th.query_store(); |
293 | if (store_list.length < 1) { | 305 | if (store_list.length < 1) { |
294 | th.setData({ | 306 | th.setData({ |
pages/user/my_service/appment_main.wxml
@@ -70,7 +70,7 @@ | @@ -70,7 +70,7 @@ | ||
70 | </view> | 70 | </view> |
71 | <view class="flex fs26"> | 71 | <view class="flex fs26"> |
72 | <block wx:if="{{store==0 && beautician==0}}"> | 72 | <block wx:if="{{store==0 && beautician==0}}"> |
73 | - <textarea class="textarea" disabled="{{store || beautician}}" placeholder="{{remarks==''?'填写备注':remarks}}" placeholder-class="fs26 color" value="{{remarks}}" bindinput="input_remarks"> | 73 | + <textarea class="textarea" disabled="{{store || beautician}}" placeholder="{{remarks==''?'填写备注':remarks}}" placeholder-class="fs26 color" value="{{remarks}}" bindinput="input_remarks" maxlength="100"> |
74 | </textarea> | 74 | </textarea> |
75 | </block> | 75 | </block> |
76 | <block wx:else> | 76 | <block wx:else> |
@@ -108,7 +108,7 @@ | @@ -108,7 +108,7 @@ | ||
108 | <icon bindtap="onclickstore" color="black" size="22" type="cancel"></icon> | 108 | <icon bindtap="onclickstore" color="black" size="22" type="cancel"></icon> |
109 | </view> | 109 | </view> |
110 | <view class="searchbar flex-vertical-between storeListpadd"> | 110 | <view class="searchbar flex-vertical-between storeListpadd"> |
111 | - <input class="inputstore fs28" placeholder="{{key_word==''?'输入要搜索的门店':key_word}}" placeholder-class="fs28" maxlength="16" bindinput="input_store" /> | 111 | + <input class="inputstore fs28" placeholder="{{key_word==''?'输入要搜索的门店':key_word}}" placeholder-class="fs28" maxlength="16" bindinput="input_store" bindconfirm="search_store"/> |
112 | <view class="search flex-center" bindtap="search_store"> | 112 | <view class="search flex-center" bindtap="search_store"> |
113 | <view class="fs28">搜索</view> | 113 | <view class="fs28">搜索</view> |
114 | </view> | 114 | </view> |
@@ -125,7 +125,7 @@ | @@ -125,7 +125,7 @@ | ||
125 | <view class="store_name_dis"> | 125 | <view class="store_name_dis"> |
126 | <view class="name_dis flex-vertical-between"> | 126 | <view class="name_dis flex-vertical-between"> |
127 | <view class="store_name fs28 ellipsis-1">{{item.StorageName}}</view> | 127 | <view class="store_name fs28 ellipsis-1">{{item.StorageName}}</view> |
128 | - <view wx:if="{{item.Distance!='未设置经纬度'}}" class="store_dis flex fs22"> | 128 | + <view wx:if="{{item.Distance!=1000000}}" class="store_dis flex fs22"> |
129 | <view class="ellipsis-1">距您:{{item.Distance}}km</view> | 129 | <view class="ellipsis-1">距您:{{item.Distance}}km</view> |
130 | </view> | 130 | </view> |
131 | </view> | 131 | </view> |
pages/user/my_service/appment_main.wxss
@@ -122,6 +122,7 @@ | @@ -122,6 +122,7 @@ | ||
122 | padding: 0rpx 5rpx; | 122 | padding: 0rpx 5rpx; |
123 | border: 2rpx solid rgb(238, 238, 238); | 123 | border: 2rpx solid rgb(238, 238, 238); |
124 | background-color: rgb(255, 255, 255); | 124 | background-color: rgb(255, 255, 255); |
125 | + padding-bottom: 5rpx; | ||
125 | } | 126 | } |
126 | 127 | ||
127 | .beautician { | 128 | .beautician { |
@@ -244,6 +245,7 @@ | @@ -244,6 +245,7 @@ | ||
244 | 245 | ||
245 | .store_dis { | 246 | .store_dis { |
246 | height: 30rpx; | 247 | height: 30rpx; |
248 | + line-height: 30rpx; | ||
247 | padding: 5rpx 15rpx; | 249 | padding: 5rpx 15rpx; |
248 | background-color: rgb(227, 227, 227); | 250 | background-color: rgb(227, 227, 227); |
249 | border-radius: 25rpx; | 251 | border-radius: 25rpx; |
pages/user/my_service/beauty_deta.js
@@ -20,13 +20,15 @@ Page({ | @@ -20,13 +20,15 @@ Page({ | ||
20 | aweeks: [], //七天的预约时间 | 20 | aweeks: [], //七天的预约时间 |
21 | head_img: "", //美容师头像 | 21 | head_img: "", //美容师头像 |
22 | time: ["08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00"], | 22 | time: ["08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00"], |
23 | - time_index: "", //选择预约时间下标 | 23 | + weeks: [], //星期几数组 |
24 | + time_index: -1, //选择预约时间下标 | ||
24 | date_id: 0, //选择日期的id | 25 | date_id: 0, //选择日期的id |
25 | beautician_id: "", //美容师id | 26 | beautician_id: "", //美容师id |
26 | itemId: "", //服务id | 27 | itemId: "", //服务id |
27 | number: "", //预约单号 | 28 | number: "", //预约单号 |
28 | modify: 0, //是否是修改时间 | 29 | modify: 0, //是否是修改时间 |
29 | iscos: 0, //是否是从美容师列表过来的 | 30 | iscos: 0, //是否是从美容师列表过来的 |
31 | + hours: "", //获取当前时分秒 | ||
30 | }, | 32 | }, |
31 | 33 | ||
32 | /** | 34 | /** |
@@ -34,20 +36,31 @@ Page({ | @@ -34,20 +36,31 @@ Page({ | ||
34 | */ | 36 | */ |
35 | onLoad: function(options) { | 37 | onLoad: function(options) { |
36 | var th = this; | 38 | var th = this; |
39 | + var myDate = new Date(); | ||
40 | + var date = myDate.getHours() + ":00"; //获取当前小时数(0-23) | ||
41 | + console.log(date > "09:00" + "和哦哦哦哦的"); | ||
37 | var beautician_id = options.BeauticianID; | 42 | var beautician_id = options.BeauticianID; |
38 | th.setData({ | 43 | th.setData({ |
39 | - url: options.url, | ||
40 | beautician_id: beautician_id, | 44 | beautician_id: beautician_id, |
41 | itemId: options.itemId, | 45 | itemId: options.itemId, |
42 | - iscos: options.iscos, | ||
43 | - modify: options.modify | 46 | + modify: options.modify, |
47 | + hours: date | ||
44 | }) | 48 | }) |
45 | - | ||
46 | - if (options.number != "") { | 49 | + if (options.url != undefined) { |
50 | + th.setData({ | ||
51 | + url: options.url | ||
52 | + }) | ||
53 | + } | ||
54 | + if (options.number != undefined) { | ||
47 | th.setData({ | 55 | th.setData({ |
48 | number: options.number | 56 | number: options.number |
49 | }) | 57 | }) |
50 | } | 58 | } |
59 | + if (options.iscos != undefined) { | ||
60 | + th.setData({ | ||
61 | + iscos: options.iscos | ||
62 | + }) | ||
63 | + } | ||
51 | th.query_beatea(); | 64 | th.query_beatea(); |
52 | th.query_aweek(); | 65 | th.query_aweek(); |
53 | }, | 66 | }, |
@@ -57,7 +70,7 @@ Page({ | @@ -57,7 +70,7 @@ Page({ | ||
57 | onShow: function() { | 70 | onShow: function() { |
58 | 71 | ||
59 | }, | 72 | }, |
60 | - | 73 | + |
61 | //图片失败,默认图片 | 74 | //图片失败,默认图片 |
62 | bind_bnerr1: function(e) { | 75 | bind_bnerr1: function(e) { |
63 | var _errImg = e.target.dataset.errorimg; | 76 | var _errImg = e.target.dataset.errorimg; |
@@ -95,7 +108,7 @@ Page({ | @@ -95,7 +108,7 @@ Page({ | ||
95 | }).then(res => { | 108 | }).then(res => { |
96 | if (res.data.code == 0) { | 109 | if (res.data.code == 0) { |
97 | var data = res.data.data; | 110 | var data = res.data.data; |
98 | - th.setData({ | 111 | + th.setData({ |
99 | name: data.StaffName, | 112 | name: data.StaffName, |
100 | comment: data.Remark1, | 113 | comment: data.Remark1, |
101 | head_img: data.PhotoUrl | 114 | head_img: data.PhotoUrl |
@@ -112,7 +125,7 @@ Page({ | @@ -112,7 +125,7 @@ Page({ | ||
112 | var seekTime = th.data.seekTime; //选择的日期 | 125 | var seekTime = th.data.seekTime; //选择的日期 |
113 | var time_list = th.data.time_list; | 126 | var time_list = th.data.time_list; |
114 | var time_index = th.data.time_index; | 127 | var time_index = th.data.time_index; |
115 | - if (time_index == "") { | 128 | + if (time_index == -1) { |
116 | getApp().my_warnning("请选择预约时间", 0, th); | 129 | getApp().my_warnning("请选择预约时间", 0, th); |
117 | return false; | 130 | return false; |
118 | } | 131 | } |
@@ -139,10 +152,12 @@ Page({ | @@ -139,10 +152,12 @@ Page({ | ||
139 | success: function(res) { | 152 | success: function(res) { |
140 | if (res.data.code == 0) { | 153 | if (res.data.code == 0) { |
141 | getApp().my_warnning(res.data.msg, 0, th); | 154 | getApp().my_warnning(res.data.msg, 0, th); |
142 | - wx.navigateBack({ | ||
143 | - //返回 | ||
144 | - delta: 1 | ||
145 | - }) | 155 | + setTimeout(function() { |
156 | + wx.navigateBack({ | ||
157 | + //返回 | ||
158 | + delta: 1 | ||
159 | + }) | ||
160 | + }, 1000); | ||
146 | } else { | 161 | } else { |
147 | getApp().my_warnning(res.data.msg, 0, th); | 162 | getApp().my_warnning(res.data.msg, 0, th); |
148 | } | 163 | } |
@@ -151,16 +166,29 @@ Page({ | @@ -151,16 +166,29 @@ Page({ | ||
151 | } else { | 166 | } else { |
152 | var pages = getCurrentPages(); //当前页面 | 167 | var pages = getCurrentPages(); //当前页面 |
153 | var iscos = th.data.iscos; | 168 | var iscos = th.data.iscos; |
154 | - var delta = 1 + Number(iscos);//返回哪个页面 | ||
155 | - var prevPage = pages[pages.length - 2 - iscos]; //上一页面 | ||
156 | - prevPage.setData({ | ||
157 | - //直接给上一个页面赋值 | ||
158 | - time: time, | ||
159 | - }); | ||
160 | - wx.navigateBack({ | ||
161 | - //返回 | ||
162 | - delta: delta | ||
163 | - }) | 169 | + var delta = 1; |
170 | + if (Number(iscos) == 1) { | ||
171 | + delta = delta + Number(iscos); //返回哪个页面 | ||
172 | + var prevPage = pages[pages.length - 2 - Number(iscos)]; //上一页面 | ||
173 | + prevPage.setData({ | ||
174 | + //直接给上一个页面赋值 | ||
175 | + time: time, | ||
176 | + }); | ||
177 | + wx.navigateBack({ | ||
178 | + //返回 | ||
179 | + delta: 2 | ||
180 | + }) | ||
181 | + } else { | ||
182 | + var prevPage = pages[pages.length - 2]; //上一页面 | ||
183 | + prevPage.setData({ | ||
184 | + //直接给上一个页面赋值 | ||
185 | + time: time, | ||
186 | + }); | ||
187 | + wx.navigateBack({ | ||
188 | + //返回 | ||
189 | + delta: 1 | ||
190 | + }) | ||
191 | + } | ||
164 | } | 192 | } |
165 | }, | 193 | }, |
166 | //选择时间 | 194 | //选择时间 |
@@ -199,19 +227,32 @@ Page({ | @@ -199,19 +227,32 @@ Page({ | ||
199 | }; | 227 | }; |
200 | arr.push(em); | 228 | arr.push(em); |
201 | } | 229 | } |
202 | - for (var i = 0; i < arr.length; i++) { | ||
203 | - for (var j = 0; j < arr.length - i - 1; j++) { | ||
204 | - if (arr[j].time > arr[j + 1].time) { | ||
205 | - var c = arr[j].time; | ||
206 | - arr[j].time = arr[j + 1].time; | ||
207 | - arr[j + 1].time = c; | ||
208 | - } | ||
209 | - } | 230 | + |
231 | + arr.sort(th.sort_arr); | ||
232 | + | ||
233 | + | ||
234 | + | ||
235 | + | ||
236 | + var weeks = ["今天", "明天", "后天"]; | ||
237 | + var week = ""; | ||
238 | + for (var i = 3; i < arr.length; i++) { | ||
239 | + var date = new Date(arr[i].time); | ||
240 | + if (date.getDay() == 0) week = "周日" | ||
241 | + if (date.getDay() == 1) week = "周一" | ||
242 | + if (date.getDay() == 2) week = "周二" | ||
243 | + if (date.getDay() == 3) week = "周三" | ||
244 | + if (date.getDay() == 4) week = "周四" | ||
245 | + if (date.getDay() == 5) week = "周五" | ||
246 | + if (date.getDay() == 6) week = "周六" | ||
247 | + weeks[i] = week; | ||
210 | } | 248 | } |
211 | th.setData({ | 249 | th.setData({ |
212 | - aweeks: arr | 250 | + aweeks: arr, |
251 | + weeks: weeks | ||
213 | }) | 252 | }) |
214 | - th.query_date(); | 253 | + if (arr.length > 0) { |
254 | + th.query_date(); | ||
255 | + } | ||
215 | } else { | 256 | } else { |
216 | getApp().my_warnning(res.data.msg, 0, th); | 257 | getApp().my_warnning(res.data.msg, 0, th); |
217 | } | 258 | } |
@@ -236,13 +277,15 @@ Page({ | @@ -236,13 +277,15 @@ Page({ | ||
236 | var time_list = res.data.data; | 277 | var time_list = res.data.data; |
237 | var time = th.data.time; | 278 | var time = th.data.time; |
238 | var new_time = []; | 279 | var new_time = []; |
239 | - for (var i = 0; i < time.length; i++) { | ||
240 | - for (var ii = 0; ii < time_list.length; ii++) { | ||
241 | - if (time[i] == time_list[ii].GroupHour.substring(0, 5)) { | ||
242 | - new_time[i] = time_list[ii].GroupHour.substring(0, 5); | ||
243 | - break; | ||
244 | - } else { | ||
245 | - new_time[i] = ""; | 280 | + if (time_list != null) { |
281 | + for (var i = 0; i < time.length; i++) { | ||
282 | + for (var ii = 0; ii < res.data.data.length; ii++) { | ||
283 | + if (time[i] == time_list[ii].GroupHour.substring(0, 5)) { | ||
284 | + new_time[i] = time_list[ii].GroupHour.substring(0, 5); | ||
285 | + break; | ||
286 | + } else { | ||
287 | + new_time[i] = ""; | ||
288 | + } | ||
246 | } | 289 | } |
247 | } | 290 | } |
248 | } | 291 | } |
@@ -296,4 +339,19 @@ Page({ | @@ -296,4 +339,19 @@ Page({ | ||
296 | urls: [th.data.head_img] // 需要预览的图片http链接列表 | 339 | urls: [th.data.head_img] // 需要预览的图片http链接列表 |
297 | }) | 340 | }) |
298 | }, | 341 | }, |
342 | + | ||
343 | + sort_arr: function(a, b) { | ||
344 | + a = a['time']; | ||
345 | + b = b['time']; | ||
346 | + if (a < b) { | ||
347 | + return -1; | ||
348 | + } | ||
349 | + if (a > b) { | ||
350 | + return 1; | ||
351 | + } | ||
352 | + return 0; | ||
353 | + } | ||
354 | + | ||
355 | + | ||
356 | + | ||
299 | }) | 357 | }) |
300 | \ No newline at end of file | 358 | \ No newline at end of file |
pages/user/my_service/beauty_deta.wxml
@@ -21,12 +21,17 @@ | @@ -21,12 +21,17 @@ | ||
21 | <view class="fs36" style="margin-bottom:35rpx;">服务预约</view> | 21 | <view class="fs36" style="margin-bottom:35rpx;">服务预约</view> |
22 | <scroll-view class="scroll-h fs26 " scroll-x> | 22 | <scroll-view class="scroll-h fs26 " scroll-x> |
23 | <view class="rel" wx:for="{{aweeks}}" style="display: inline-block;"> | 23 | <view class="rel" wx:for="{{aweeks}}" style="display: inline-block;"> |
24 | - <view class="scroll-item-h bd {{index==date_id?'chbd':''}}" bindtap="check_date" data-dateid="{{index}}"> | ||
25 | - <view>{{item.time}}</view> | ||
26 | - <view></view> | ||
27 | - </view> | ||
28 | - <block wx:if="{{index==date_id}}"> | ||
29 | - <view class="abs box"></view> | 24 | + <block wx:if="{{aweeks[index].val!=''}}"> |
25 | + <view class="scroll-item-h bd {{index==date_id?'chbd':''}}" bindtap="check_date" data-dateid="{{index}}"> | ||
26 | + <view>{{weeks[index]}}</view> | ||
27 | + <view>{{item.time}}</view> | ||
28 | + </view> | ||
29 | + </block> | ||
30 | + <block wx:else> | ||
31 | + <view class="scroll-item-h bd"> | ||
32 | + <view>{{weeks[index]}}(约满)</view> | ||
33 | + <view>{{item.time}}</view> | ||
34 | + </view> | ||
30 | </block> | 35 | </block> |
31 | </view> | 36 | </view> |
32 | 37 | ||
@@ -36,13 +41,10 @@ | @@ -36,13 +41,10 @@ | ||
36 | <view class="Times"> | 41 | <view class="Times"> |
37 | 42 | ||
38 | <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"> |
39 | - <block wx:if="{{it==time_list[key]}}"> | 44 | + <block wx:if="{{it==time_list[key] && date_id==0?hours<it:true}}"> |
40 | <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}}"> |
41 | <view> | 46 | <view> |
42 | <view class="fs26">{{it}}</view> | 47 | <view class="fs26">{{it}}</view> |
43 | - <block wx:if="{{flase}}"> | ||
44 | - <view class="fs24">约满</view> | ||
45 | - </block> | ||
46 | </view> | 48 | </view> |
47 | </view> | 49 | </view> |
48 | </block> | 50 | </block> |
pages/user/my_service/cosmetology_list.js
@@ -44,8 +44,8 @@ Page({ | @@ -44,8 +44,8 @@ Page({ | ||
44 | pageSize: th.data.pageSize | 44 | pageSize: th.data.pageSize |
45 | } | 45 | } |
46 | }).then(res => { | 46 | }).then(res => { |
47 | + wx.hideLoading(); | ||
47 | if (res.data.code == 0) { | 48 | if (res.data.code == 0) { |
48 | - wx.hideLoading(); | ||
49 | th.data.curpage++; | 49 | th.data.curpage++; |
50 | var arr1 = th.data.cosmetology_list; | 50 | var arr1 = th.data.cosmetology_list; |
51 | var arr2 = res.data.data.pageData; | 51 | var arr2 = res.data.data.pageData; |
pages/user/my_service/hist_service.js
@@ -118,8 +118,8 @@ Page({ | @@ -118,8 +118,8 @@ Page({ | ||
118 | pageSize: th.data.pageSize | 118 | pageSize: th.data.pageSize |
119 | } | 119 | } |
120 | }).then(res => { | 120 | }).then(res => { |
121 | + wx.hideLoading(); | ||
121 | if (res.data.code == 0) { | 122 | if (res.data.code == 0) { |
122 | - wx.hideLoading(); | ||
123 | th.data.curpage++; | 123 | th.data.curpage++; |
124 | var arr1 = th.data.hist_List; | 124 | var arr1 = th.data.hist_List; |
125 | var arr2 = res.data.data.pageData; | 125 | var arr2 = res.data.data.pageData; |
pages/user/my_service/i_service.js
@@ -51,13 +51,13 @@ Page({ | @@ -51,13 +51,13 @@ Page({ | ||
51 | if (this.data.total <= th.data.pageSize) return; | 51 | if (this.data.total <= th.data.pageSize) return; |
52 | if (this.data.ismore) return; | 52 | if (this.data.ismore) return; |
53 | 53 | ||
54 | - wx.showLoading({ | ||
55 | - title: '加载中...', | ||
56 | - }) | ||
57 | th.query_service(); | 54 | th.query_service(); |
58 | }, | 55 | }, |
59 | //查询服务项目列表 | 56 | //查询服务项目列表 |
60 | query_service: function() { | 57 | query_service: function() { |
58 | + wx.showLoading({ | ||
59 | + title: '加载中', | ||
60 | + }) | ||
61 | var th = this; | 61 | var th = this; |
62 | var url = "/api/weshop/marketing/reservation/sm/page"; | 62 | var url = "/api/weshop/marketing/reservation/sm/page"; |
63 | getApp().request.promiseGet(url, { | 63 | getApp().request.promiseGet(url, { |
@@ -68,8 +68,8 @@ Page({ | @@ -68,8 +68,8 @@ Page({ | ||
68 | pageSize: th.data.pageSize | 68 | pageSize: th.data.pageSize |
69 | } | 69 | } |
70 | }).then(res => { | 70 | }).then(res => { |
71 | + wx.hideLoading(); | ||
71 | if (res.data.code == 0) { | 72 | if (res.data.code == 0) { |
72 | - wx.hideLoading(); | ||
73 | th.data.curpage++; | 73 | th.data.curpage++; |
74 | var arr1 = th.data.service_List; | 74 | var arr1 = th.data.service_List; |
75 | var arr2 = res.data.data.pageData; | 75 | var arr2 = res.data.data.pageData; |
@@ -82,9 +82,7 @@ Page({ | @@ -82,9 +82,7 @@ Page({ | ||
82 | ismore: ismore, | 82 | ismore: ismore, |
83 | is_service_read: 1, | 83 | is_service_read: 1, |
84 | }), | 84 | }), |
85 | - console.log("顶顶顶顶顶" + res.data.data.pageData.length); | ||
86 | - console.log("呃呃呃呃" + th.data.service_List.length); | ||
87 | - wx.stopPullDownRefresh(); //停止下拉刷新 | 85 | + wx.stopPullDownRefresh(); //停止下拉刷新 |
88 | } else { | 86 | } else { |
89 | getApp().my_warnning(res.data.msg, 0, th); | 87 | getApp().my_warnning(res.data.msg, 0, th); |
90 | } | 88 | } |
@@ -128,5 +126,41 @@ Page({ | @@ -128,5 +126,41 @@ Page({ | ||
128 | goto: function(e) { | 126 | goto: function(e) { |
129 | var url = e.currentTarget.dataset.url; | 127 | var url = e.currentTarget.dataset.url; |
130 | getApp().goto(url); | 128 | getApp().goto(url); |
129 | + }, | ||
130 | + //校正是否可预约 | ||
131 | + correcting: function(e) { | ||
132 | + var th = this; | ||
133 | + var url = e.currentTarget.dataset.url; | ||
134 | + var service_id = e.currentTarget.dataset.service_id; //服务id | ||
135 | + var project_id = e.currentTarget.dataset.project_id; | ||
136 | + getApp().request.promiseGet("/api/weshop/marketing/reservation/reservation/check", { | ||
137 | + data: { | ||
138 | + serviceId: service_id, | ||
139 | + storeId: a.stoid, | ||
140 | + userId: d.user_id | ||
141 | + } | ||
142 | + }).then(res => { | ||
143 | + if (res.data.code == 0) { | ||
144 | + getApp().request.promiseGet("/api/weshop/marketing/reservation/reservation/sm/check", { | ||
145 | + data: { | ||
146 | + projectId: project_id, | ||
147 | + serviceId: service_id, | ||
148 | + storeId: a.stoid, | ||
149 | + userId: d.user_id | ||
150 | + } | ||
151 | + }).then(res => { | ||
152 | + if (res.data.code == 0) { | ||
153 | + wx.navigateTo({ | ||
154 | + url: url | ||
155 | + }) | ||
156 | + } else { | ||
157 | + getApp().my_warnning(res.data.msg, 0, th); | ||
158 | + } | ||
159 | + }) | ||
160 | + } else { | ||
161 | + getApp().my_warnning(res.data.msg, 0, th); | ||
162 | + } | ||
163 | + }) | ||
131 | } | 164 | } |
165 | + | ||
132 | }) | 166 | }) |
133 | \ No newline at end of file | 167 | \ No newline at end of file |
pages/user/my_service/i_service.wxml
1 | <!-- 背景图片 --> | 1 | <!-- 背景图片 --> |
2 | <view> | 2 | <view> |
3 | - <image class="backimage" src="{{iurl}}/miniapp/images/yyservice/backimage.png" mode="widthFix" lazy-load="true"></image> | 3 | + <image class="backimage" src="{{iurl}}/miniapp/images/yyservice/backimage.png" lazy-load="true"></image> |
4 | <navigator class="History fs26" url="/pages/user/my_service/hist_service">历史服务</navigator> | 4 | <navigator class="History fs26" url="/pages/user/my_service/hist_service">历史服务</navigator> |
5 | </view> | 5 | </view> |
6 | 6 | ||
@@ -49,7 +49,7 @@ | @@ -49,7 +49,7 @@ | ||
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" url="/pages/user/my_service/appment_main?service_id={{item.ServiceID}}&BuyType={{item.BuyType}}&ProjectID={{item.ProjectID}}"> | 52 | + <navigator wx:if="{{item.State}}" class="flex-level appointment yellow-b" data-url="/pages/user/my_service/appment_main?service_id={{item.ServiceID}}&BuyType={{item.BuyType}}&ProjectID={{item.ProjectID}}" bindtap="correcting" data-service_id="{{item.ServiceID}}" data-project_id="{{item.ProjectID}}"> |
53 | <view>预约</view> | 53 | <view>预约</view> |
54 | </navigator> | 54 | </navigator> |
55 | </view> | 55 | </view> |
pages/user/my_service/i_service.wxss
@@ -10,7 +10,7 @@ page { | @@ -10,7 +10,7 @@ page { | ||
10 | left: 0rpx; | 10 | left: 0rpx; |
11 | z-index: 0; | 11 | z-index: 0; |
12 | width: 100%; | 12 | width: 100%; |
13 | - height: 100%; | 13 | + /* height: 100%; */ |
14 | } | 14 | } |
15 | 15 | ||
16 | /* 历史服务定位 */ | 16 | /* 历史服务定位 */ |
@@ -26,7 +26,7 @@ page { | @@ -26,7 +26,7 @@ page { | ||
26 | .rel { | 26 | .rel { |
27 | background-color: rgb(255, 255, 255); | 27 | background-color: rgb(255, 255, 255); |
28 | width: 350rpx; | 28 | width: 350rpx; |
29 | - height: 405rpx; | 29 | + height: 430rpx; |
30 | border-radius: 20rpx; | 30 | border-radius: 20rpx; |
31 | display: inline-block; | 31 | display: inline-block; |
32 | margin-right: 15rpx; | 32 | margin-right: 15rpx; |
pages/user/my_service/tment_order_list.js
@@ -93,9 +93,8 @@ Page({ | @@ -93,9 +93,8 @@ Page({ | ||
93 | pageSize: th.data.pageSize | 93 | pageSize: th.data.pageSize |
94 | } | 94 | } |
95 | }).then(res => { | 95 | }).then(res => { |
96 | - | 96 | + wx.hideLoading(); |
97 | if (res.data.code == 0) { | 97 | if (res.data.code == 0) { |
98 | - wx.hideLoading(); | ||
99 | th.data.curpage++; | 98 | th.data.curpage++; |
100 | var arr1 = th.data.tm_order_list; | 99 | var arr1 = th.data.tm_order_list; |
101 | var arr2 = res.data.data.pageData; | 100 | var arr2 = res.data.data.pageData; |