Commit 6fc930c7330ebee5a70d5e8230b4bf78ff11afcd
1 parent
d2fff168
我的预约,历史服务,预约主界面,选择时间,数据填充及样式调整
Showing
17 changed files
with
241 additions
and
139 deletions
pages/user/my_service/appment_main.js
... | ... | @@ -12,7 +12,7 @@ Page({ |
12 | 12 | iurl: a.imghost, //服务器网址 |
13 | 13 | store: 0, //是否显示服务门店列表 |
14 | 14 | beautician: 0, //是否显示美容师列表 |
15 | - beautician_name: null, //选中的美容师名称 | |
15 | + beautician_name: "", //选中的美容师名称 | |
16 | 16 | placeholder: "填写备注", //备注为空的placeholder |
17 | 17 | store_list: [], //门店列表 |
18 | 18 | beautician_list: [], //美容师列表 |
... | ... | @@ -27,6 +27,9 @@ Page({ |
27 | 27 | key_word: "", //是否按门店文字查询 |
28 | 28 | is_service_read: 0, //是否调用过门店接口 |
29 | 29 | is_search: 0, //是否通过key_word调用接口 |
30 | + is_success: 0, //是否提交成功 | |
31 | + remarks: "", //备注 | |
32 | + storageId: "", //线下门店id | |
30 | 33 | }, |
31 | 34 | onclickstore: function() { |
32 | 35 | var th = this; |
... | ... | @@ -36,20 +39,77 @@ Page({ |
36 | 39 | store: 0, |
37 | 40 | placeholder: "填写备注" |
38 | 41 | }) |
42 | + wx.hideLoading(); | |
39 | 43 | } else { |
40 | 44 | th.setData({ |
41 | 45 | store: 1, |
42 | 46 | placeholder: "" |
43 | 47 | }) |
48 | + if (th.data.store_list.length < 1) { | |
49 | + th.query_store(); | |
50 | + } | |
44 | 51 | } |
45 | 52 | }, |
53 | + //输入的备注 | |
54 | + input_remarks: function(e) { | |
55 | + var remarks = e.detail.value; | |
56 | + this.setData({ | |
57 | + remarks: remarks | |
58 | + }) | |
59 | + }, | |
60 | + //提交预约 | |
61 | + sub_success: function() { | |
62 | + var th = this; | |
63 | + var store = th.data.store_name; //门店 | |
64 | + var bea_name = th.data.beautician_name; //选择的美容师 | |
65 | + // var time = th.data.time; //选择服务的时间 | |
66 | + // //提交预约前的判断 | |
67 | + // if (store == "") { | |
68 | + // getApp().my_warnning("请选择服务门店", 0, th); | |
69 | + // return false; | |
70 | + // } else if (bea_name == "") { | |
71 | + // getApp().my_warnning("请选择美容师", 0, th); | |
72 | + // return false; | |
73 | + // } else if (time == "") { | |
74 | + // getApp().my_warnning("请选择预约时间", 0, th); | |
75 | + // return false; | |
76 | + // } | |
77 | + | |
78 | + var url = "/api/weshop/marketing/reservation/reservation/insert"; | |
79 | + getApp().request.post(url, { | |
80 | + data: { | |
81 | + projectID: "", | |
82 | + beauticianID: "", | |
83 | + buyType: "", | |
84 | + storeId: a.stoid, | |
85 | + storageID: "", | |
86 | + arrangeTime: "", | |
87 | + userId: d.user_id, | |
88 | + remark: "", | |
89 | + states: "" | |
90 | + } | |
91 | + }).then(res => { | |
92 | + if (res.data.code == 0) { | |
93 | + th.setData({ | |
94 | + is_success: 1 | |
95 | + }) | |
96 | + wx.navigateTo({ | |
97 | + url: "/pages/user/my_service/tment_details" | |
98 | + }); | |
99 | + } else { | |
100 | + getApp().my_warnning(res.data.msg, 0, th); | |
101 | + } | |
102 | + }) | |
103 | + }, | |
46 | 104 | goto: function(e) { |
47 | 105 | var th = this; |
48 | - if (th.data.beautician_name != null) { | |
106 | + if (th.data.store_name == "") { | |
107 | + getApp().my_warnning("请选择服务门店", 0, th); | |
108 | + } else if (th.data.beautician_name == "") { | |
109 | + getApp().my_warnning("请选择美容师", 0, th); | |
110 | + } else { | |
49 | 111 | var url = e.currentTarget.dataset.url; |
50 | 112 | getApp().goto(url); |
51 | - } else { | |
52 | - getApp().my_warnning("请先选择美容师", 0, th); | |
53 | 113 | } |
54 | 114 | }, |
55 | 115 | //点击选择门店 |
... | ... | @@ -70,10 +130,12 @@ Page({ |
70 | 130 | choice_store: function() { |
71 | 131 | var th = this; |
72 | 132 | var index = th.data.fir_pick_index; |
73 | - var pickup_name = th.data.store_list[index].StorageName; | |
133 | + var store_name = th.data.store_list[index].StorageName; | |
134 | + var Id = th.data.store_list[index].Id; | |
74 | 135 | th.setData({ |
75 | 136 | store: 0, |
76 | - store_name: pickup_name | |
137 | + store_name: store_name, | |
138 | + storageId: Id | |
77 | 139 | }) |
78 | 140 | }, |
79 | 141 | onReachBottom: function() { |
... | ... | @@ -89,8 +151,8 @@ Page({ |
89 | 151 | //分页查询门店信息 |
90 | 152 | query_store: function() { |
91 | 153 | var th = this; |
92 | - // var itemId = th.data.itemId; | |
93 | - var itemId = "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6"; | |
154 | + // var itemId = th.data.itemId;//正式使用项目id | |
155 | + var itemId = "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6"; //测试的项目id | |
94 | 156 | var url = "/api/weshop/marketing/reservation/storage/page"; |
95 | 157 | var key_word = th.data.key_word; |
96 | 158 | getApp().request.promiseGet(url, { |
... | ... | @@ -117,6 +179,8 @@ Page({ |
117 | 179 | ismore: ismore, |
118 | 180 | is_service_read: 1, |
119 | 181 | }), wx.stopPullDownRefresh(); //停止下拉刷新 |
182 | + } else { | |
183 | + getApp().my_warnning(res.data.msg, 0, th); | |
120 | 184 | } |
121 | 185 | }) |
122 | 186 | }, |
... | ... | @@ -124,7 +188,7 @@ Page({ |
124 | 188 | query_beautician: function() { |
125 | 189 | var th = this; |
126 | 190 | if (th.data.store_name == "") { |
127 | - getApp().my_warnning("请先选择服务门店", 0, th); | |
191 | + getApp().my_warnning("请选择服务门店", 0, th); | |
128 | 192 | } else { |
129 | 193 | if (th.data.beautician == 0) { |
130 | 194 | th.setData({ |
... | ... | @@ -135,8 +199,10 @@ Page({ |
135 | 199 | beautician: 0 |
136 | 200 | }) |
137 | 201 | } |
138 | - var itemid = "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6"; | |
139 | - var storageId = "FD8EC44A-6474-4BA1-A17C-A87306690E59"; | |
202 | + var itemid = "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6"; //测试的项目id | |
203 | + // var itemid = th.data.itemId;//正式使用的项目id | |
204 | + // var storageId = th.data.storageId;//正式使用的线下门店id | |
205 | + var storageId = "FD8EC44A-6474-4BA1-A17C-A87306690E59"; //测试的线下门店id | |
140 | 206 | var url = "/api/weshop/marketing/reservation/staff/page"; |
141 | 207 | getApp().request.promiseGet(url, { |
142 | 208 | data: { |
... | ... | @@ -187,7 +253,19 @@ Page({ |
187 | 253 | }) |
188 | 254 | } |
189 | 255 | } else { |
190 | - getApp().my_warnning("请输入门店名称",0,th); | |
256 | + getApp().my_warnning("请输入门店名称", 0, th); | |
257 | + } | |
258 | + }, | |
259 | + //美容师预约跳转页面 | |
260 | + nav_bea: function() { | |
261 | + var th = this; | |
262 | + var storageId = th.data.storageId; //线下门店id | |
263 | + if (storageId == "") { | |
264 | + getApp().my_warnning("请选择服务门店", 0, th); | |
265 | + } else { | |
266 | + wx.navigateTo({ | |
267 | + url: "/pages/user/my_service/cosmetology_list" | |
268 | + }); | |
191 | 269 | } |
192 | 270 | }, |
193 | 271 | /** |
... | ... | @@ -204,7 +282,6 @@ Page({ |
204 | 282 | * 生命周期函数--监听页面显示 |
205 | 283 | */ |
206 | 284 | onShow: function() { |
207 | - var th = this; | |
208 | - th.query_store(); | |
285 | + | |
209 | 286 | } |
210 | 287 | }) |
211 | 288 | \ No newline at end of file | ... | ... |
pages/user/my_service/appment_main.wxml
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 | <!-- 选择门店 --> |
29 | 29 | <view class="rel fs26"> |
30 | 30 | <view class="flex-vertical-between Cosmetology" bindtap="query_beautician"> |
31 | - <view class="color value ellipsis-1">{{beautician_name==null?'选择美容师':beautician_name}}</view> | |
31 | + <view class="color value ellipsis-1">{{beautician_name==''?'选择美容师':beautician_name}}</view> | |
32 | 32 | <view class="angle">∟</view> |
33 | 33 | </view> |
34 | 34 | <!-- 美容师下拉列表 --> |
... | ... | @@ -41,9 +41,9 @@ |
41 | 41 | </view> |
42 | 42 | </view> |
43 | 43 | </view> |
44 | - <navigator class="flex-center" url="/pages/user/my_service/cosmetology_list"> | |
44 | + <view class="flex-center users" bindtap="nav_bea"> | |
45 | 45 | <image class="user" src="{{iurl}}/miniapp/images/yyservice/user.png"></image> |
46 | - </navigator> | |
46 | + </view> | |
47 | 47 | </view> |
48 | 48 | |
49 | 49 | <!-- 选择时间 --> |
... | ... | @@ -69,7 +69,7 @@ |
69 | 69 | </view> |
70 | 70 | <view class="flex fs26"> |
71 | 71 | <block wx:if="{{store==0 && beautician==0}}"> |
72 | - <textarea class="textarea" disabled="{{store || beautician}}" placeholder="填写备注" placeholder-class="fs26 color" value=""> | |
72 | + <textarea class="textarea" disabled="{{store || beautician}}" placeholder="{{remarks==''?'填写备注':remarks}}" placeholder-class="fs26 color" value="{{remarks}}" bindinput="input_remarks"> | |
73 | 73 | </textarea> |
74 | 74 | </block> |
75 | 75 | <block wx:else> |
... | ... | @@ -86,12 +86,12 @@ |
86 | 86 | <navigator class="appment flex-center" url="/pages/user/my_service/tment_order_list"> |
87 | 87 | <view>我的预约</view> |
88 | 88 | </navigator> |
89 | - <view class="sub_appment flex-center"> | |
89 | + <view class="sub_appment flex-center" bindtap="sub_success"> | |
90 | 90 | <view>提交预约</view> |
91 | 91 | </view> |
92 | 92 | </view> |
93 | 93 | |
94 | - <block wx:if="{{false}}"> | |
94 | + <block wx:if="{{is_success}}"> | |
95 | 95 | <view class="subSuccess fs36"> |
96 | 96 | <image class="Success" src="{{iurl}}/miniapp/images/yyservice/Success.png"></image> |
97 | 97 | <view>预约成功</view> |
... | ... | @@ -138,7 +138,7 @@ |
138 | 138 | </view> |
139 | 139 | |
140 | 140 | <!-- 数据加载完毕 --> |
141 | - <view wx:if="{{ismore && store_list.length>1 && key_word!=''}}" class="flex-center fs28 notstore"> | |
141 | + <view wx:if="{{ismore && store_list.length>1}}" class="flex-center fs28 notstore"> | |
142 | 142 | <view>数据加载完毕</view> |
143 | 143 | </view> |
144 | 144 | </scroll-view> | ... | ... |
pages/user/my_service/appment_main.wxss
pages/user/my_service/beauty_deta.js
... | ... | @@ -10,12 +10,13 @@ Page({ |
10 | 10 | */ |
11 | 11 | data: { |
12 | 12 | iurl: a.imghost, |
13 | + defimgurl: "/miniapp/images/yyservice/yyxmdefault.jpg", | |
13 | 14 | seekTime: "2019-11-18", //当前服务预约选择的时间 |
14 | 15 | time_list: [], //可预约时间 |
15 | 16 | name: "", //美容师姓名 |
16 | 17 | comment: "", //美容师评价 |
17 | 18 | head_img: "", //美容师头像 |
18 | - 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"], | |
19 | + time: ["08:00:00", "09:00: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"], | |
19 | 20 | time_index: 0, //选择预约时间下标 |
20 | 21 | }, |
21 | 22 | |
... | ... | @@ -83,7 +84,7 @@ Page({ |
83 | 84 | return; |
84 | 85 | } else { |
85 | 86 | th.setData({ |
86 | - time_index: time_index | |
87 | + time_index: index | |
87 | 88 | }) |
88 | 89 | } |
89 | 90 | }, |
... | ... | @@ -106,14 +107,15 @@ Page({ |
106 | 107 | var time_list = []; |
107 | 108 | for (var i = 0; i < time.length; i++) { |
108 | 109 | for (var ii = ii; ii < data.length; ii++) { |
109 | - if (time[i] == data[ii]) { | |
110 | - time_list[i] = data[ii]; | |
110 | + if (time[i] == data[ii].GroupHour) { | |
111 | + time_list[i] = data[ii].GroupHour; | |
111 | 112 | break; |
112 | 113 | } else { |
113 | 114 | time_list[i] = ""; |
114 | 115 | } |
115 | 116 | } |
116 | 117 | } |
118 | + console.log("1111111111"+time_list.length); | |
117 | 119 | th.setData({ |
118 | 120 | time_list: time_list |
119 | 121 | }) | ... | ... |
pages/user/my_service/beauty_deta.wxml
1 | 1 | <view class="container"> |
2 | 2 | <view class="backcolor"></view> |
3 | 3 | |
4 | - | |
5 | 4 | <view class="comments"> |
6 | 5 | <!-- 个人信息 --> |
7 | 6 | <view class="Personal"> |
8 | 7 | <view class="name fs36 ellipsis-1">{{name}}</view> |
9 | - <image class="head" src="{{iurl+head_img}}" lazy-load="true" data-errorimg="{{iurl+head_img}}" binderror="bind_bnerr1" data-img="{{iurl+head_img}}"></image> | |
8 | + <image class="head" src="{{head_img==''?iurl+defimgurl:iurl+head_img}}" lazy-load="true" data-errorimg="{{iurl+head_img}}" binderror="bind_bnerr1" data-img="{{iurl+head_img}}"></image> | |
10 | 9 | |
11 | 10 | <view class="introduce fs26"> |
12 | 11 | <block wx:if="{{comment!=''}}"> |
... | ... | @@ -37,7 +36,7 @@ |
37 | 36 | <view class="Times"> |
38 | 37 | |
39 | 38 | <view class="flex-center" wx:for="{{time}}" style="display:inline-block;"> |
40 | - <block wx:if="{{true}}"> | |
39 | + <block wx:if="{{item==time_list[index]}}"> | |
41 | 40 | <!-- {{item==time_list[index]}} --> |
42 | 41 | <view class="Time flex-center {{time_index==index?'chTime':''}}" bindtap="Selection_time" data-index="{{index}}"> |
43 | 42 | <view> | ... | ... |
pages/user/my_service/hist_service.js
... | ... | @@ -12,8 +12,8 @@ Page({ |
12 | 12 | iurl: a.imghost, |
13 | 13 | isPickerShow: false, |
14 | 14 | isPickerRender: false, |
15 | - startTime: 0, | |
16 | - endTime: 0, | |
15 | + startTime: "", | |
16 | + endTime: "", | |
17 | 17 | pickerConfig: { |
18 | 18 | endDate: true, |
19 | 19 | column: "", |
... | ... | @@ -26,9 +26,10 @@ Page({ |
26 | 26 | hist_List: [], //服务项目列表 |
27 | 27 | is_service_read: 0, |
28 | 28 | curpage: 1, //当前分页数 |
29 | - pageSize: 10, //页大小 | |
29 | + pageSize: 15, //页大小 | |
30 | 30 | total: 0, |
31 | 31 | ismore: 0, //是否加载完毕 |
32 | + is_screen: 0, //是否通过筛选来选择历史服务 | |
32 | 33 | }, |
33 | 34 | pickerShow: function() { |
34 | 35 | this.setData({ |
... | ... | @@ -54,8 +55,11 @@ Page({ |
54 | 55 | endTime: data.endTime, |
55 | 56 | val: 0, |
56 | 57 | distance: 0, |
58 | + hist_List: [], | |
59 | + curpage: 1, | |
60 | + is_screen: 1 | |
57 | 61 | }); |
58 | - console.log("开始" + data.startTime + "结束" + data.endTime, ); | |
62 | + th.query_hist(); | |
59 | 63 | }, |
60 | 64 | /** |
61 | 65 | * 生命周期函数--监听页面加载 |
... | ... | @@ -93,46 +97,41 @@ Page({ |
93 | 97 | th.query_service(); |
94 | 98 | }, |
95 | 99 | query_hist: function() { |
100 | + | |
96 | 101 | var th = this; |
97 | - var url = "http://localhost:8022/api/weshop/yy_fuwu_lishi"; | |
98 | - wx.request({ | |
99 | - url: url, | |
100 | - success: function(res) { | |
101 | - if (res.data.code == 0) { | |
102 | - th.setData({ | |
103 | - hist_List: res.data.data.pageData, | |
104 | - total: res.data.data.total | |
105 | - }) | |
106 | - } | |
102 | + var startTime = th.data.startTime.substring(0, 10); //开始 | |
103 | + var endTime = th.data.endTime.substring(0, 10); //结束 | |
104 | + var url = "/api/weshop/marketing/reservation/reservation/page"; | |
105 | + getApp().request.promiseGet(url, { | |
106 | + data: { | |
107 | + storeId: a.stoid, | |
108 | + userId: 5682130, //5682130 d.user_id | |
109 | + beginDate: startTime, | |
110 | + endDate: endTime, | |
111 | + page: th.data.curpage, | |
112 | + pageSize: th.data.pageSize | |
113 | + } | |
114 | + }).then(res => { | |
115 | + if (res.data.code == 0) { | |
116 | + wx.hideLoading(); | |
117 | + th.data.curpage++; | |
118 | + var arr1 = th.data.hist_List; | |
119 | + var arr2 = res.data.data.pageData; | |
120 | + var arr3 = [...arr1, ...arr2]; | |
121 | + var ismore = 0; | |
122 | + if (arr3.length == res.data.total) ismore = 1 | |
123 | + th.setData({ | |
124 | + hist_List: arr3, | |
125 | + total: res.data.data.total, | |
126 | + ismore: ismore, | |
127 | + is_service_read: 1, | |
128 | + }), wx.stopPullDownRefresh(); //停止下拉刷新 | |
129 | + } else { | |
130 | + th.setData({ | |
131 | + is_service_read: 1 | |
132 | + }) | |
107 | 133 | } |
108 | 134 | }) |
109 | - | |
110 | - // var th = this; | |
111 | - // var url = "/api/weshop/marketing/reservation/sm/page"; | |
112 | - // getApp().request.promiseGet(url, { | |
113 | - // data: { | |
114 | - // storeId: a.stoid, | |
115 | - // userId: d.user_id, | |
116 | - // page: th.data.curpage, | |
117 | - // pageSize: th.data.pageSize | |
118 | - // } | |
119 | - // }).then(res => { | |
120 | - // if (res.data.code == 0) { | |
121 | - // wx.hideLoading(); | |
122 | - // th.data.curpage++; | |
123 | - // var arr1 = th.data.service_List; | |
124 | - // var arr2 = res.data.data.pageData; | |
125 | - // var arr3 = [...arr1, ...arr2]; | |
126 | - // var ismore = 0; | |
127 | - // if (arr3.length == res.data.data.total) ismore = 1 | |
128 | - // th.setData({ | |
129 | - // service_List: arr3, | |
130 | - // total: res.data.data.total, | |
131 | - // ismore: ismore, | |
132 | - // is_service_read: 1, | |
133 | - // }), wx.stopPullDownRefresh(); //停止下拉刷新 | |
134 | - // } | |
135 | - // }) | |
136 | 135 | }, |
137 | 136 | /** |
138 | 137 | * 用户点击右上角分享 | ... | ... |
pages/user/my_service/hist_service.wxml
1 | 1 | <view wx:if="{{true}}" class="{{isPickerRender==true?'container':''}}"> |
2 | 2 | <!-- 点击方法 --> |
3 | - <view class="exption flex-vertical-between fs28"> | |
3 | + <view class="exption flex-vertical-between fs28" wx:if="{{hist_List.length>0 || is_screen==1}}"> | |
4 | 4 | <view class="flex"> |
5 | 5 | 共使用 |
6 | 6 | <view class="count">{{total}}</view> |
... | ... | @@ -26,18 +26,19 @@ |
26 | 26 | <!-- left --> |
27 | 27 | <view> |
28 | 28 | <view class="flex fs28"> |
29 | - <view class="itemName ellipsis-1">{{item.xm}}</view> | |
29 | + <view class="itemName ellipsis-1">{{item.ProjectName==''?'匿名':item.ProjectName}}</view> | |
30 | 30 | <view>(美容师:</view> |
31 | - <view class="itemUsna ellipsis-1">{{item.name}}</view> | |
31 | + <view class="itemUsna ellipsis-1">{{item.BeauticianName}}</view> | |
32 | 32 | ) |
33 | 33 | </view> |
34 | - <view class="fs24">{{item.type_a}}</view> | |
34 | + <view class="fs24">{{item.BillDate!=''?item.BillDate:item.ArrangeTime}}</view> | |
35 | 35 | </view> |
36 | 36 | <!-- right --> |
37 | 37 | <view class="serState fs32"> |
38 | - <view wx:if="{{item.type==1}}">未服务</view> | |
39 | - <view wx:if="{{item.type==2}}">已服务</view> | |
40 | - <view wx:if="{{item.type==3}}">已过期</view> | |
38 | + <view wx:if="{{item.State==0}}">未服务</view> | |
39 | + <view wx:if="{{item.State==1}}">已服务</view> | |
40 | + <view wx:if="{{item.State==2}}">已过期</view> | |
41 | + <view wx:if="{{item.State==3}}">已取消</view> | |
41 | 42 | </view> |
42 | 43 | </view> |
43 | 44 | <!-- 没有数据 --> |
... | ... | @@ -50,7 +51,7 @@ |
50 | 51 | </view> |
51 | 52 | </view> |
52 | 53 | <!-- 无历史服务 --> |
53 | -<view class="empty_order" wx:if="{{hist_List.length<1 && is_service_read}}"> | |
54 | +<view class="empty_order" wx:if="{{hist_List.length<1 && is_service_read && is_screen==0}}"> | |
54 | 55 | <view class="flex-level"> |
55 | 56 | <image src="{{iurl}}miniapp/images/yyservice/no_history.png"></image> |
56 | 57 | </view> | ... | ... |
pages/user/my_service/hist_service.wxss
pages/user/my_service/i_service.js
pages/user/my_service/i_service.wxml
1 | 1 | <!-- 背景图片 --> |
2 | 2 | <view> |
3 | 3 | <image class="backimage" src="{{iurl}}/miniapp/images/yyservice/backimage.png" mode="widthFix"></image> |
4 | - <navigator class="History fs26" url="/pages/user/hist_service/hist_service">历史服务</navigator> | |
4 | + <navigator class="History fs26" url="/pages/user/my_service/hist_service">历史服务</navigator> | |
5 | 5 | </view> |
6 | 6 | |
7 | 7 | <!-- 预约内容 --> |
... | ... | @@ -49,7 +49,7 @@ |
49 | 49 | <view>立即使用</view> |
50 | 50 | </view> |
51 | 51 | <!-- 可预约 --> |
52 | - <navigator class="flex-level appointment" url="/pages/user/my_service/appment_main?itemId={{item.ProjectID}}"> | |
52 | + <navigator class="flex-level appointment yellow-b" url="/pages/user/my_service/appment_main?itemId={{item.ProjectID}}"> | |
53 | 53 | <view>预约</view> |
54 | 54 | </navigator> |
55 | 55 | </view> | ... | ... |
pages/user/my_service/i_service.wxss
... | ... | @@ -31,7 +31,7 @@ page { |
31 | 31 | display: inline-block; |
32 | 32 | margin-right: 15rpx; |
33 | 33 | margin-bottom: 20rpx; |
34 | - box-shadow: 0rpx 2rpx 3rpx 3rpx rgb(233, 233, 233); | |
34 | + box-shadow: 0rpx 3rpx 3rpx 3rpx rgb(233, 233, 233); | |
35 | 35 | } |
36 | 36 | |
37 | 37 | .abs { |
... | ... | @@ -45,11 +45,12 @@ page { |
45 | 45 | } |
46 | 46 | |
47 | 47 | .Serviceitems { |
48 | - position: relative; | |
48 | + position: absolute; | |
49 | 49 | top: 370rpx; |
50 | 50 | left: 0rpx; |
51 | 51 | z-index: 2; |
52 | 52 | padding-left: 18rpx; |
53 | + padding-bottom: 20rpx; | |
53 | 54 | } |
54 | 55 | |
55 | 56 | .itemimage { |
... | ... | @@ -98,7 +99,6 @@ page { |
98 | 99 | height: 40rpx; |
99 | 100 | line-height: 40rpx; |
100 | 101 | border-radius: 25rpx; |
101 | - background-color: #ff9c00; | |
102 | 102 | margin-left: 20rpx; |
103 | 103 | } |
104 | 104 | ... | ... |
pages/user/my_service/tment_details.wxml
... | ... | @@ -82,17 +82,15 @@ |
82 | 82 | <!-- submit栏 --> |
83 | 83 | <view class="subs flex-vertical-between fs32"> |
84 | 84 | |
85 | - <view class="sub lb flex-center"> | |
85 | + <view class="sub flex-center yellow-b"> | |
86 | 86 | <view wx:if="{{tment_details.state==1}}">取消预约</view> |
87 | - <view wx:if="{{tment_details.state==2 || tment_details.state==3}}">删除订单</view> | |
87 | + <navigator wx:if="{{tment_details.state!=1}}" url="/pages/user/my_service/tment_order_list">我的服务</navigator> | |
88 | 88 | </view> |
89 | - | |
90 | 89 | <view class="sub rb flex-center"> |
91 | 90 | <navigator wx:if="{{tment_details.state==1}}" url="/pages/user/my_service/beauty_deta">更改时间</navigator> |
92 | 91 | <navigator wx:if="{{tment_details.state==2}}" url="/pages/user/my_service/tment_eval">发表评价</navigator> |
93 | 92 | <navigator wx:if="{{tment_details.state==3}}" url="/pages/user/my_service/appment_main">重新预约</navigator> |
94 | 93 | </view> |
95 | - | |
96 | 94 | </view> |
97 | 95 | </view> |
98 | 96 | <warn id="warn"></warn> |
99 | 97 | \ No newline at end of file | ... | ... |
pages/user/my_service/tment_details.wxss
pages/user/my_service/tment_order_list.js
1 | 1 | var e = getApp(), |
2 | 2 | a = e.globalData.setting, |
3 | 3 | os = a, |
4 | - t = e.request; | |
4 | + t = e.request, | |
5 | + d = e.globalData; | |
5 | 6 | Page({ |
6 | 7 | |
7 | 8 | /** |
... | ... | @@ -10,6 +11,7 @@ Page({ |
10 | 11 | data: { |
11 | 12 | iurl: a.imghost, |
12 | 13 | activeCategoryId: 0, //类别选中下标 |
14 | + defimgurl: "/miniapp/images/yyservice/yyxmdefault.jpg", | |
13 | 15 | categories: [{ |
14 | 16 | name: "全部", |
15 | 17 | id: 0 |
... | ... | @@ -43,14 +45,18 @@ Page({ |
43 | 45 | var activeCategoryId = th.data.activeCategoryId; |
44 | 46 | if (id != activeCategoryId) { |
45 | 47 | th.setData({ |
46 | - activeCategoryId: id | |
48 | + activeCategoryId: id, | |
49 | + tm_order_list: [], | |
50 | + curpage: 1, | |
51 | + ismore: 0 | |
47 | 52 | }) |
53 | + th.query_orderList(); | |
48 | 54 | } else { |
49 | 55 | return false; |
50 | 56 | } |
51 | 57 | }, |
52 | 58 | //显示核销码 |
53 | - code_show: function (e) { | |
59 | + code_show: function(e) { | |
54 | 60 | var th = this; |
55 | 61 | //--获取成功的时候-- |
56 | 62 | var no = e.currentTarget.dataset.order_sn; |
... | ... | @@ -63,27 +69,41 @@ Page({ |
63 | 69 | }, |
64 | 70 | query_orderList: function() { |
65 | 71 | var th = this; |
66 | - var url = "http://localhost:8022/api/weshop/yy_order_list"; | |
67 | - wx.request({ | |
68 | - url: url, | |
69 | - success: function(res) { | |
70 | - if (res.data.code == 0) { | |
71 | - th.setData({ | |
72 | - tm_order_list: res.data.data.pageData | |
73 | - }) | |
74 | - } | |
72 | + var url = "/api/weshop/marketing/reservation/reservation/page"; | |
73 | + | |
74 | + var state_index = th.data.activeCategoryId; | |
75 | + if (state_index == 0) { | |
76 | + state_index = ""; | |
77 | + } else { | |
78 | + --state_index; | |
79 | + } | |
80 | + getApp().request.promiseGet(url, { | |
81 | + data: { | |
82 | + storeId: a.stoid, | |
83 | + userId: 5682130, | |
84 | + state: state_index | |
85 | + } | |
86 | + }).then(res => { | |
87 | + if (res.data.code == 0) { | |
88 | + var data = res.data.data.pageData; | |
89 | + th.setData({ | |
90 | + tm_order_list: data | |
91 | + }) | |
92 | + } else { | |
93 | + getApp().my_warnning(res.data.msg, 0, this); //调用失败提示 | |
75 | 94 | } |
76 | 95 | }) |
96 | + | |
77 | 97 | }, |
78 | - //删除预约记录 | |
79 | - deleteOrderData: function(e) { | |
80 | - var th = this; | |
81 | - var index = e.currentTarget.dataset.order_id; | |
82 | - var arr = th.data.tm_order_list; | |
83 | - arr.splice(index, 1); | |
84 | - th.setData({ | |
85 | - tm_order_list: arr | |
86 | - }) | |
98 | + //图片失败,默认图片 | |
99 | + bind_bnerr1: function(e) { | |
100 | + var _errImg = e.target.dataset.errorimg; | |
101 | + var _Img = e.target.dataset.img; | |
102 | + if (_Img != undefined) { | |
103 | + var _errObj = {}; | |
104 | + _errObj[_errImg] = "/miniapp/images/no_cate_def.png"; | |
105 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
106 | + } | |
87 | 107 | }, |
88 | 108 | /** |
89 | 109 | * 生命周期函数--监听页面显示 |
... | ... | @@ -97,6 +117,14 @@ Page({ |
97 | 117 | * 页面上拉触底事件的处理函数 |
98 | 118 | */ |
99 | 119 | onReachBottom: function() { |
120 | + var th = this; | |
121 | + if (this.data.total <= th.data.pageSize) return; | |
122 | + if (this.data.ismore) return; | |
123 | + | |
124 | + wx.showLoading({ | |
125 | + title: '加载中...', | |
126 | + }) | |
127 | + th.query_orderList(); | |
128 | + }, | |
100 | 129 | |
101 | - } | |
102 | 130 | }) |
103 | 131 | \ No newline at end of file | ... | ... |
pages/user/my_service/tment_order_list.json
pages/user/my_service/tment_order_list.wxml
1 | 1 | <view class="container"> |
2 | 2 | <!-- 导航栏 --> |
3 | 3 | <view class="type-navbar padding flex-vertical fs30"> |
4 | - <view class="type-box flex-center {{activeCategoryId==item.id?'chtypebox':''}}" wx:for="{{categories}}"> | |
5 | - <view data-id="{{item.id}}" bindtap="changeTab">{{item.name}}</view> | |
4 | + <view class="type-box flex-center {{activeCategoryId==item.id?'chtypebox':''}}" wx:for="{{categories}}" bindtap="changeTab" data-id="{{item.id}}"> | |
5 | + <view>{{item.name}}</view> | |
6 | 6 | </view> |
7 | 7 | </view> |
8 | 8 | <view wx:if="{{true}}"> |
... | ... | @@ -11,13 +11,13 @@ |
11 | 11 | <!-- 商品编号和状态 --> |
12 | 12 | <view class="Commodity_number flex-vertical-between fs26 padding"> |
13 | 13 | <!--商品编号 --> |
14 | - <text class="order_number ellipsis-1" selectable='true'>订单编号:{{item.order_sn}}</text> | |
14 | + <text class="order_number ellipsis-1" selectable='true'>订单编号:{{item.Number}}</text> | |
15 | 15 | <!-- 订单状态 --> |
16 | 16 | <view class="flex-center state"> |
17 | - <view wx:if="{{item.is_prom==1}}">未服务</view> | |
18 | - <view wx:if="{{item.is_prom==2}}">已服务</view> | |
19 | - <view wx:if="{{item.is_prom==3}}">已过期</view> | |
20 | - <view wx:if="{{item.is_prom==4}}">已取消</view> | |
17 | + <view wx:if="{{item.State==0}}">未服务</view> | |
18 | + <view wx:if="{{item.State==1}}">已服务</view> | |
19 | + <view wx:if="{{item.State==2}}">已过期</view> | |
20 | + <view wx:if="{{item.State==3}}">已取消</view> | |
21 | 21 | </view> |
22 | 22 | </view> |
23 | 23 | |
... | ... | @@ -26,45 +26,45 @@ |
26 | 26 | |
27 | 27 | <view class="flex-center fs26"> |
28 | 28 | <view class="itemimage"> |
29 | - <image class="itemimage" src="{{item.img}}"></image> | |
29 | + <image class="itemimage" src="{{item.ImageUrl==''?iurl+defimgurl:item.ImageUrl}}" lazy-load="true" data-errorimg="tm_order_list[{{index}}].ImageUrl" binderror="bind_bnerr1" data-img="{{item.ImageUrl}}"></image> | |
30 | 30 | </view> |
31 | 31 | <!-- 项目内容 --> |
32 | 32 | <view class="details"> |
33 | 33 | <view class="item flex-vertical"> |
34 | 34 | <view class="itemname">预约门店:</view> |
35 | - <view class="itemvalue ellipsis-1">{{item.store}}</view> | |
35 | + <view class="itemvalue ellipsis-1">{{item.StorageName}}</view> | |
36 | 36 | </view> |
37 | 37 | <view class="item flex-vertical"> |
38 | 38 | <view class="itemname">预约项目:</view> |
39 | - <view class="itemvalue ellipsis-1">{{item.goods_name}}</view> | |
39 | + <view class="itemvalue ellipsis-1">{{item.projectName}}</view> | |
40 | 40 | </view> |
41 | 41 | <view class="item flex-vertical"> |
42 | 42 | <view class="itemname">美容师:</view> |
43 | - <view class="itemvalue ellipsis-1">{{item.meirongshi}}</view> | |
43 | + <view class="itemvalue ellipsis-1">{{item.BeauticianName}}</view> | |
44 | 44 | </view> |
45 | 45 | <view class="item flex-vertical"> |
46 | 46 | <view class="itemname">预约时间:</view> |
47 | - <view>{{item.time}}</view> | |
47 | + <view>{{item.ArrangeTime}}</view> | |
48 | 48 | </view> |
49 | - <view class="item flex-vertical" wx:if="{{item.endtime==undefined?false:true}}"> | |
49 | + <view class="item flex-vertical" wx:if="{{item.BillDate==''?false:true}}"> | |
50 | 50 | <view class="itemname">服务时间:</view> |
51 | - <view>{{item.endtime}}</view> | |
51 | + <view>{{item.BillDate}}</view> | |
52 | 52 | </view> |
53 | 53 | </view> |
54 | 54 | |
55 | 55 | </view> |
56 | 56 | </navigator> |
57 | 57 | <view class="Unim flex-right-vertical fs26 padding"> |
58 | - <image wx:if="{{item.is_prom==1}}" src="{{iurl}}miniapp/images/order/code.png" class="code" bindtap="code_show" data-order_sn="{{item.order_sn}}"></image> | |
59 | - <block wx:if="{{item.is_prom==1}}"> | |
58 | + <image wx:if="{{item.State==0}}" src="{{iurl}}miniapp/images/order/code.png" class="code" bindtap="code_show" data-order_sn="{{item.Number}}"></image> | |
59 | + <block wx:if="{{item.State==0}}"> | |
60 | 60 | <navigator url="/pages/user/my_service/tment_details" class="Unimportance flex-level">取消预约</navigator> |
61 | 61 | </block> |
62 | 62 | <block wx:else> |
63 | - <navigator wx:if="{{item.is_prom==2 || item.is_prom==3}}" url="/pages/user/my_service/tment_details" class="Unimportance flex-level">查看详情</navigator> | |
63 | + <navigator wx:if="{{item.State!=1}}" url="/pages/user/my_service/tment_details" class="Unimportance flex-level">查看详情</navigator> | |
64 | 64 | </block> |
65 | - <navigator wx:if="{{item.is_prom==1}}" class="important Unimportance flex-level" url="/pages/user/my_service/beauty_deta">更改时间</navigator> | |
66 | - <navigator wx:if="{{item.is_prom==2}}" url="/pages/user/my_service/tment_eval" class="important Unimportance flex-level">发表评价</navigator> | |
67 | - <navigator wx:if="{{item.is_prom==3}}" url="/pages/user/my_service/appment_main" class="important Unimportance flex-level">重新预约</navigator> | |
65 | + <navigator wx:if="{{item.State==0}}" class="important Unimportance flex-level" url="/pages/user/my_service/beauty_deta">更改时间</navigator> | |
66 | + <navigator wx:if="{{item.State==1}}" url="/pages/user/my_service/tment_eval" class="important Unimportance flex-level">发表评价</navigator> | |
67 | + <navigator wx:if="{{item.State==2}}" url="/pages/user/my_service/appment_main" class="important Unimportance flex-level">重新预约</navigator> | |
68 | 68 | |
69 | 69 | </view> |
70 | 70 | </view> |
... | ... | @@ -77,7 +77,7 @@ |
77 | 77 | </view> |
78 | 78 | |
79 | 79 | <!-- 无预约订单 --> |
80 | -<view class="empty_order" wx:if="{{tm_order_list.length<1 && is_service_read}}"> | |
80 | +<view class="empty_order" wx:if="{{tm_order_list.length<1 && is_service_read }}"> | |
81 | 81 | <view class="flex-level"> |
82 | 82 | <image src="{{iurl}}miniapp/images/order/empty_order.png"></image> |
83 | 83 | </view> |
... | ... | @@ -89,4 +89,5 @@ |
89 | 89 | </view> |
90 | 90 | </view> |
91 | 91 | <!-- 弹出框扫描 --> |
92 | -<qr_code id="qc_com"></qr_code> | |
93 | 92 | \ No newline at end of file |
93 | +<qr_code id="qc_com"></qr_code> | |
94 | +<warn id="warn"></warn> | |
94 | 95 | \ No newline at end of file | ... | ... |