diff --git a/pages/user/my_service/appment_main.js b/pages/user/my_service/appment_main.js
index 80fd7bb..eeaa4f3 100644
--- a/pages/user/my_service/appment_main.js
+++ b/pages/user/my_service/appment_main.js
@@ -12,7 +12,7 @@ Page({
iurl: a.imghost, //服务器网址
store: 0, //是否显示服务门店列表
beautician: 0, //是否显示美容师列表
- beautician_name: null, //选中的美容师名称
+ beautician_name: "", //选中的美容师名称
placeholder: "填写备注", //备注为空的placeholder
store_list: [], //门店列表
beautician_list: [], //美容师列表
@@ -27,6 +27,9 @@ Page({
key_word: "", //是否按门店文字查询
is_service_read: 0, //是否调用过门店接口
is_search: 0, //是否通过key_word调用接口
+ is_success: 0, //是否提交成功
+ remarks: "", //备注
+ storageId: "", //线下门店id
},
onclickstore: function() {
var th = this;
@@ -36,20 +39,77 @@ Page({
store: 0,
placeholder: "填写备注"
})
+ wx.hideLoading();
} else {
th.setData({
store: 1,
placeholder: ""
})
+ if (th.data.store_list.length < 1) {
+ th.query_store();
+ }
}
},
+ //输入的备注
+ input_remarks: function(e) {
+ var remarks = e.detail.value;
+ this.setData({
+ remarks: remarks
+ })
+ },
+ //提交预约
+ sub_success: function() {
+ var th = this;
+ var store = th.data.store_name; //门店
+ var bea_name = th.data.beautician_name; //选择的美容师
+ // var time = th.data.time; //选择服务的时间
+ // //提交预约前的判断
+ // if (store == "") {
+ // getApp().my_warnning("请选择服务门店", 0, th);
+ // return false;
+ // } else if (bea_name == "") {
+ // getApp().my_warnning("请选择美容师", 0, th);
+ // return false;
+ // } else if (time == "") {
+ // getApp().my_warnning("请选择预约时间", 0, th);
+ // return false;
+ // }
+
+ var url = "/api/weshop/marketing/reservation/reservation/insert";
+ getApp().request.post(url, {
+ data: {
+ projectID: "",
+ beauticianID: "",
+ buyType: "",
+ storeId: a.stoid,
+ storageID: "",
+ arrangeTime: "",
+ userId: d.user_id,
+ remark: "",
+ states: ""
+ }
+ }).then(res => {
+ if (res.data.code == 0) {
+ th.setData({
+ is_success: 1
+ })
+ wx.navigateTo({
+ url: "/pages/user/my_service/tment_details"
+ });
+ } else {
+ getApp().my_warnning(res.data.msg, 0, th);
+ }
+ })
+ },
goto: function(e) {
var th = this;
- if (th.data.beautician_name != null) {
+ if (th.data.store_name == "") {
+ getApp().my_warnning("请选择服务门店", 0, th);
+ } else if (th.data.beautician_name == "") {
+ getApp().my_warnning("请选择美容师", 0, th);
+ } else {
var url = e.currentTarget.dataset.url;
getApp().goto(url);
- } else {
- getApp().my_warnning("请先选择美容师", 0, th);
}
},
//点击选择门店
@@ -70,10 +130,12 @@ Page({
choice_store: function() {
var th = this;
var index = th.data.fir_pick_index;
- var pickup_name = th.data.store_list[index].StorageName;
+ var store_name = th.data.store_list[index].StorageName;
+ var Id = th.data.store_list[index].Id;
th.setData({
store: 0,
- store_name: pickup_name
+ store_name: store_name,
+ storageId: Id
})
},
onReachBottom: function() {
@@ -89,8 +151,8 @@ Page({
//分页查询门店信息
query_store: function() {
var th = this;
- // var itemId = th.data.itemId;
- var itemId = "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6";
+ // var itemId = th.data.itemId;//正式使用项目id
+ var itemId = "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6"; //测试的项目id
var url = "/api/weshop/marketing/reservation/storage/page";
var key_word = th.data.key_word;
getApp().request.promiseGet(url, {
@@ -117,6 +179,8 @@ Page({
ismore: ismore,
is_service_read: 1,
}), wx.stopPullDownRefresh(); //停止下拉刷新
+ } else {
+ getApp().my_warnning(res.data.msg, 0, th);
}
})
},
@@ -124,7 +188,7 @@ Page({
query_beautician: function() {
var th = this;
if (th.data.store_name == "") {
- getApp().my_warnning("请先选择服务门店", 0, th);
+ getApp().my_warnning("请选择服务门店", 0, th);
} else {
if (th.data.beautician == 0) {
th.setData({
@@ -135,8 +199,10 @@ Page({
beautician: 0
})
}
- var itemid = "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6";
- var storageId = "FD8EC44A-6474-4BA1-A17C-A87306690E59";
+ var itemid = "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6"; //测试的项目id
+ // var itemid = th.data.itemId;//正式使用的项目id
+ // var storageId = th.data.storageId;//正式使用的线下门店id
+ var storageId = "FD8EC44A-6474-4BA1-A17C-A87306690E59"; //测试的线下门店id
var url = "/api/weshop/marketing/reservation/staff/page";
getApp().request.promiseGet(url, {
data: {
@@ -187,7 +253,19 @@ Page({
})
}
} else {
- getApp().my_warnning("请输入门店名称",0,th);
+ getApp().my_warnning("请输入门店名称", 0, th);
+ }
+ },
+ //美容师预约跳转页面
+ nav_bea: function() {
+ var th = this;
+ var storageId = th.data.storageId; //线下门店id
+ if (storageId == "") {
+ getApp().my_warnning("请选择服务门店", 0, th);
+ } else {
+ wx.navigateTo({
+ url: "/pages/user/my_service/cosmetology_list"
+ });
}
},
/**
@@ -204,7 +282,6 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
- var th = this;
- th.query_store();
+
}
})
\ 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 ce0ffa2..67b7095 100644
--- a/pages/user/my_service/appment_main.wxml
+++ b/pages/user/my_service/appment_main.wxml
@@ -28,7 +28,7 @@
- {{beautician_name==null?'选择美容师':beautician_name}}
+ {{beautician_name==''?'选择美容师':beautician_name}}
∟
@@ -41,9 +41,9 @@
-
+
-
+
@@ -69,7 +69,7 @@
-
@@ -86,12 +86,12 @@
我的预约
-
+
提交预约
-
+
预约成功
@@ -138,7 +138,7 @@
-
+
数据加载完毕
diff --git a/pages/user/my_service/appment_main.wxss b/pages/user/my_service/appment_main.wxss
index 8f41a85..8b9ee6f 100644
--- a/pages/user/my_service/appment_main.wxss
+++ b/pages/user/my_service/appment_main.wxss
@@ -18,7 +18,9 @@
transform: rotate(227deg);
margin-bottom: 0rpx;
}
-
+.users{
+ background-color: rgb(255,255,255);
+}
.user {
width: 40rpx;
height: 40rpx;
diff --git a/pages/user/my_service/beauty_deta.js b/pages/user/my_service/beauty_deta.js
index 7a12427..a05fad3 100644
--- a/pages/user/my_service/beauty_deta.js
+++ b/pages/user/my_service/beauty_deta.js
@@ -10,12 +10,13 @@ Page({
*/
data: {
iurl: a.imghost,
+ defimgurl: "/miniapp/images/yyservice/yyxmdefault.jpg",
seekTime: "2019-11-18", //当前服务预约选择的时间
time_list: [], //可预约时间
name: "", //美容师姓名
comment: "", //美容师评价
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: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"],
time_index: 0, //选择预约时间下标
},
@@ -83,7 +84,7 @@ Page({
return;
} else {
th.setData({
- time_index: time_index
+ time_index: index
})
}
},
@@ -106,14 +107,15 @@ Page({
var time_list = [];
for (var i = 0; i < time.length; i++) {
for (var ii = ii; ii < data.length; ii++) {
- if (time[i] == data[ii]) {
- time_list[i] = data[ii];
+ if (time[i] == data[ii].GroupHour) {
+ time_list[i] = data[ii].GroupHour;
break;
} else {
time_list[i] = "";
}
}
}
+ console.log("1111111111"+time_list.length);
th.setData({
time_list: time_list
})
diff --git a/pages/user/my_service/beauty_deta.wxml b/pages/user/my_service/beauty_deta.wxml
index 4079c23..e5c3465 100644
--- a/pages/user/my_service/beauty_deta.wxml
+++ b/pages/user/my_service/beauty_deta.wxml
@@ -1,12 +1,11 @@
-