diff --git a/pages/user/my_service/appment_main.js b/pages/user/my_service/appment_main.js
index de08c24..c4e4cd5 100644
--- a/pages/user/my_service/appment_main.js
+++ b/pages/user/my_service/appment_main.js
@@ -91,17 +91,20 @@ Page({
var userId = d.user_id; //用户id
var remarks = th.data.remarks; //用户备注
var project_id = th.data.project_id; //项目id
+
var json = {
- "serviceId": serviceId,
- "projectId": project_id,
+ "arrangeTime": time,
"beauticianId": beauticianID,
"buyType": buyType,
- "storeId": storeId,
- "storageId": storageId,
- "arrangeTime": time,
- "userId": userId,
+ "effectiveDay": "",
+ "number": "",
+ "projectId": project_id,
"remark": remarks,
- "states": 0
+ "serviceId": serviceId,
+ "states": 0,
+ "storageId": storageId,
+ "storeId": storeId,
+ "userId": userId
}
var data = JSON.stringify(json);
wx.request({
@@ -149,7 +152,7 @@ Page({
th.setData({
fir_pick_index: index_c,
beautician_name: "",
- time: "2019-12-10 12:00:00",
+ time: "",
tment_count: ""
})
}
@@ -243,6 +246,8 @@ Page({
th.setData({
beautician_list: res.data.data.pageData
}) //停止下拉刷新
+ } else {
+ getApp().my_warnning(res.data.msg, 0, th);
}
})
}
@@ -257,7 +262,7 @@ Page({
beautician: 0,
bea_index: bea_index,
beauticianID: BeauticianID,
- time: "2019-12-10 13:00:00",
+ time: "",
tment_count: ""
})
@@ -316,17 +321,17 @@ Page({
//查询剩下可预约人数
query_more: function() {
var th = this;
- var url = "/api/weshop/marketing/reservation/marketing/can/reservation/count";
+ var url = "/api/weshop/marketing/reservation/can/reservation/count";
var beauticianID = th.data.beauticianID; //美容师id
- var projectID = th.data.itemId; //项目id
- var seekTime = th.data.time.substring(0, 11); //预约日期
+ var projectID = th.data.itemId; //服务id
+ var seekTime = th.data.time.substring(0, 10); //预约日期
var storageId = th.data.storageId; //门店id
var storeId = a.stoid; //商家id
getApp().request.promiseGet(url, {
data: {
- beauticianID: beauticianID,
- serviceId: projectID,
+ beauticianId: beauticianID,
seekTime: seekTime,
+ serviceId: projectID,
storageId: storageId,
storeId: storeId
}
@@ -336,6 +341,8 @@ Page({
th.setData({
tment_count: tment_count
})
+ } else {
+ getApp().my_warnning(res.data.msg, 0, th);
}
})
@@ -345,6 +352,9 @@ Page({
*/
onShow: function() {
var th = this;
- th.query_more();
+ var seekTime = th.data.time; //预约日期
+ if (seekTime != "") {
+ th.query_more();
+ }
}
})
\ No newline at end of file
diff --git a/pages/user/my_service/appment_main.wxml b/pages/user/my_service/appment_main.wxml
index 6ee2307..5e5250d 100644
--- a/pages/user/my_service/appment_main.wxml
+++ b/pages/user/my_service/appment_main.wxml
@@ -90,7 +90,6 @@
提交预约
-
diff --git a/pages/user/my_service/beauty_deta.js b/pages/user/my_service/beauty_deta.js
index 306a54e..589fe80 100644
--- a/pages/user/my_service/beauty_deta.js
+++ b/pages/user/my_service/beauty_deta.js
@@ -9,6 +9,7 @@ Page({
* 页面的初始数据
*/
data: {
+ inurl: a.url, //接口网址
iurl: a.imghost,
url: "", //选择选择时间后返回的页面
defimgurl: "/miniapp/images/yyservice/yyxmdefault.jpg",
@@ -18,11 +19,12 @@ Page({
comment: "", //美容师评价
aweeks: [], //七天的预约时间
head_img: "", //美容师头像
- 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"],
+ 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"],
time_index: "", //选择预约时间下标
date_id: 0, //选择日期的id
beautician_id: "337C11B8-034B-495D-B360-FC2F6CB29394", //美容师id
itemId: "", //服务id
+ number: "", //预约单号
},
/**
@@ -36,6 +38,11 @@ Page({
beautician_id: beautician_id,
itemId: options.itemId
})
+ if (options.number != "") {
+ th.setData({
+ number: options.number
+ })
+ }
th.query_beatea();
th.query_aweek();
},
@@ -95,13 +102,32 @@ Page({
//返回上个页面
navigateBack: function() {
var th = this;
- var seekTime = th.data.seekTime;//选择的日期
+ var seekTime = th.data.seekTime; //选择的日期
var time_list = th.data.time_list;
var time_index = th.data.time_index;
- var time = time_list[time_index];
+ var date_id = th.data.date_id;
+ var date = th.data.aweeks[date_id].time;
+ var time = date+" "+time_list[time_index]+":00";
+ // wx.navigateBack({
+ // url: th.data.url + '?' + 'seekTime=' + seekTime + '&' + "time=" + time
+ // });
+ var pages = getCurrentPages(); //当前页面
+
+ var prevPage = pages[pages.length - 2]; //上一页面
+
+ prevPage.setData({
+
+ //直接给上一个页面赋值
+ time: time,
+
+ });
+
wx.navigateBack({
- url: th.data.url + '?' + 'seekTime=' + seekTime+'&'+"time="+time
- });
+
+ //返回
+ delta: 1
+
+ })
},
//选择时间
Selection_time: function(e) {
@@ -171,7 +197,7 @@ Page({
for (var ii = 0; ii < time_list.length; ii++) {
if (time[i] == time_list[ii].GroupHour.substring(0, 5)) {
new_time[i] = time_list[ii].GroupHour.substring(0, 5);
- break;
+ break;
} else {
new_time[i] = "";
}
@@ -185,8 +211,41 @@ Page({
}
})
},
+ //更改预约时间
+ change_time: function() {
+ var th = this;
+ var seekTime = th.data.seekTime; //选择的日期
+ var time_list = th.data.time_list;
+ var time_index = th.data.time_index;
+ var time = time_list[time_index];
+ var number = th.data.number; //预约单号
+ var json = {
+ "arrangeTime": seekTime + " " + time,
+ "number": number,
+ "remark": "更改预约时间",
+ "states": 0,
+ "storeId": a.stoid
+ };
+ var data = JSON.stringify(json);
+ var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/update"; //预约接口地址
+ wx.request({
+ url: url,
+ data: data,
+ method: 'put',
+ header: {
+ 'content-type': 'application/json'
+ }, // 设置请求的 header
+ success: function(res) {
+ if (res.data.code == 0) {
+ getApp().my_warnning("更改成功", 0, th);
+ } else {
+ getApp().my_warnning(res.data.msg, 0, th);
+ }
+ }
+ })
+ },
//预览头像
- previewImage: function (e) {
+ previewImage: function(e) {
var th = this;
var current = e.currentTarget.dataset.src;
wx.previewImage({
diff --git a/pages/user/my_service/i_service.wxml b/pages/user/my_service/i_service.wxml
index b62cbb2..47de058 100644
--- a/pages/user/my_service/i_service.wxml
+++ b/pages/user/my_service/i_service.wxml
@@ -29,7 +29,7 @@
- {{item.ProjectName}}
+ {{item.ServiceName}}
diff --git a/pages/user/my_service/tment_order_list.wxml b/pages/user/my_service/tment_order_list.wxml
index 9e5c90c..21ceeda 100644
--- a/pages/user/my_service/tment_order_list.wxml
+++ b/pages/user/my_service/tment_order_list.wxml
@@ -63,7 +63,7 @@
查看详情
- 更改时间
+ 更改时间
发表评价
重新预约