Commit 14a8d5f6fb04001b1a0eab27f2e048acaec050b0

Authored by iceling
1 parent 36f8eae3

变量名称改变,日期数据填充

pages/user/my_service/appment_main.js
... ... @@ -25,7 +25,8 @@ Page({
25 25 pageSize: 8, //页大小
26 26 total: 0,
27 27 ismore: 0, //是否加载完毕
28   - itemId: "", //项目id
  28 + itemId: "", //服务id
  29 + project_id: "", //项目id
29 30 isScroll: true, //scroll-y是否可以滑动
30 31 key_word: "", //是否按门店文字查询
31 32 is_service_read: 0, //是否调用过门店接口
... ... @@ -82,19 +83,21 @@ Page({
82 83 return false;
83 84 } else {
84 85 var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/insert"; //接口路径
85   - var projectID = th.data.itemId; //项目id
  86 + var serviceId = th.data.itemId; //服务id
86 87 var beauticianID = th.data.beauticianID; //美容师id
87 88 var buyType = th.data.buyType; //服务项目类型
88 89 var storeId = a.stoid; //商家id
89 90 var storageId = th.data.storageId; //门店id
90 91 var userId = d.user_id; //用户id
91   - var remarks = th.data.remarks;
  92 + var remarks = th.data.remarks; //用户备注
  93 + var project_id = th.data.project_id; //项目id
92 94 var json = {
93   - "projectID": projectID,
94   - "beauticianID": beauticianID,
  95 + "serviceId": serviceId,
  96 + "projectId": project_id,
  97 + "beauticianId": beauticianID,
95 98 "buyType": buyType,
96 99 "storeId": storeId,
97   - "storageID": storageId,
  100 + "storageId": storageId,
98 101 "arrangeTime": time,
99 102 "userId": userId,
100 103 "remark": remarks,
... ... @@ -146,7 +149,7 @@ Page({
146 149 th.setData({
147 150 fir_pick_index: index_c,
148 151 beautician_name: "",
149   - time: "2019-12-10 18:00:00",
  152 + time: "2019-12-10 12:00:00",
150 153 tment_count: ""
151 154 })
152 155 }
... ... @@ -176,14 +179,16 @@ Page({
176 179 //分页查询门店信息
177 180 query_store: function() {
178 181 var th = this;
179   - var itemId = th.data.itemId; //正式使用项目id
  182 + var itemId = th.data.itemId; //服务id
180 183 var url = "/api/weshop/marketing/reservation/storage/page";
181 184 var key_word = th.data.key_word;
182 185 getApp().request.promiseGet(url, {
183 186 data: {
184 187 storeId: a.stoid,
185 188 userId: d.user_id,
186   - itemId: itemId,
  189 + serviceId: itemId,
  190 + latitude: 1,
  191 + longitude: 1,
187 192 page: th.data.curpage,
188 193 pageSize: th.data.pageSize,
189 194 KeyWord: key_word
... ... @@ -230,7 +235,7 @@ Page({
230 235 data: {
231 236 storeId: a.stoid,
232 237 userId: d.user_id,
233   - itemId: itemid,
  238 + serviceId: itemid,
234 239 storageId: storageId
235 240 }
236 241 }).then(res => {
... ... @@ -252,7 +257,7 @@ Page({
252 257 beautician: 0,
253 258 bea_index: bea_index,
254 259 beauticianID: BeauticianID,
255   - time: "2019-12-10 19:00:00",
  260 + time: "2019-12-10 13:00:00",
256 261 tment_count: ""
257 262 })
258 263  
... ... @@ -303,8 +308,9 @@ Page({
303 308 onLoad: function(options) {
304 309 var th = this;
305 310 th.setData({
306   - itemId: options.itemId,
307   - buyType: options.BuyType
  311 + itemId: options.service_id,
  312 + buyType: options.BuyType,
  313 + project_id: options.ProjectID,
308 314 })
309 315 },
310 316 //查询剩下可预约人数
... ... @@ -319,7 +325,7 @@ Page({
319 325 getApp().request.promiseGet(url, {
320 326 data: {
321 327 beauticianID: beauticianID,
322   - projectID: projectID,
  328 + serviceId: projectID,
323 329 seekTime: seekTime,
324 330 storageId: storageId,
325 331 storeId: storeId
... ...
pages/user/my_service/beauty_deta.js
... ... @@ -12,17 +12,17 @@ Page({
12 12 iurl: a.imghost,
13 13 url: "", //选择选择时间后返回的页面
14 14 defimgurl: "/miniapp/images/yyservice/yyxmdefault.jpg",
15   - seekTime: "", //当前服务预约选择的时间
  15 + seekTime: "2019-11-24", //当前服务预约选择的时间
16 16 time_list: [], //可预约时间
17 17 name: "", //美容师姓名
18 18 comment: "", //美容师评价
19 19 aweeks: [], //七天的预约时间
20 20 head_img: "", //美容师头像
21   - 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"],
22   - time_index: 0, //选择预约时间下标
  21 + 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_index: "", //选择预约时间下标
23 23 date_id: 0, //选择日期的id
24   - beautician_id: "", //美容师id
25   - itemId: "", //项目id
  24 + beautician_id: "337C11B8-034B-495D-B360-FC2F6CB29394", //美容师id
  25 + itemId: "", //服务id
26 26 },
27 27  
28 28 /**
... ... @@ -38,7 +38,6 @@ Page({
38 38 })
39 39 th.query_beatea();
40 40 th.query_aweek();
41   - // th.query_date();
42 41 },
43 42 /**
44 43 * 生命周期函数--监听页面显示
... ... @@ -60,12 +59,15 @@ Page({
60 59 check_date: function(e) {
61 60 var th = this;
62 61 var id = e.currentTarget.dataset.dateid;
  62 + var date_id = th.data.date_id;
63 63 var seekTime = th.data.aweeks[id].time;
64   - th.setData({
65   - date_id: id,
66   - seekTime: seekTime
67   - })
68   - th.query_date();
  64 + if (id != date_id) {
  65 + th.setData({
  66 + date_id: id,
  67 + seekTime: seekTime
  68 + })
  69 + th.query_date();
  70 + }
69 71 },
70 72 //获取美容师信息
71 73 query_beatea: function() {
... ... @@ -74,7 +76,7 @@ Page({
74 76 var beautician_id = th.data.beautician_id;
75 77 getApp().request.promiseGet(url, {
76 78 data: {
77   - BeauticianID: beautician_id,
  79 + beauticianId: beautician_id,
78 80 storeId: a.stoid,
79 81 }
80 82 }).then(res => {
... ... @@ -92,9 +94,14 @@ Page({
92 94 },
93 95 //返回上个页面
94 96 navigateBack: function() {
  97 + var th = this;
  98 + var seekTime = th.data.seekTime;//选择的日期
  99 + var time_list = th.data.time_list;
  100 + var time_index = th.data.time_index;
  101 + var time = time_list[time_index];
95 102 wx.navigateBack({
96   - changed: true
97   - }); //返回上一页
  103 + url: th.data.url + '?' + 'seekTime=' + seekTime+'&'+"time="+time
  104 + });
98 105 },
99 106 //选择时间
100 107 Selection_time: function(e) {
... ... @@ -102,7 +109,7 @@ Page({
102 109 var index = e.currentTarget.dataset.index;
103 110 var time_index = th.data.time_index;
104 111 if (index == time_index) {
105   - return;
  112 + return false;
106 113 } else {
107 114 th.setData({
108 115 time_index: index
... ... @@ -117,8 +124,8 @@ Page({
117 124 var url = "/api/weshop/marketing/reservation/staff/seven/time/list"; //接口地址
118 125 getApp().request.promiseGet(url, {
119 126 data: {
120   - BeauticianID: beautician_id,
121   - ProjectID: itemId,
  127 + beauticianId: beautician_id,
  128 + serviceId: itemId,
122 129 storeId: a.stoid,
123 130 }
124 131 }).then(res => {
... ... @@ -131,11 +138,11 @@ Page({
131 138 "val": data[i]
132 139 };
133 140 arr.push(em);
134   - console.log(arr[0].time.length + "1111111111111111111111111" + arr[0].time[0]);
135 141 }
136 142 th.setData({
137 143 aweeks: arr
138 144 })
  145 + th.query_date();
139 146 } else {
140 147 getApp().my_warnning(res.data.msg, 0, th);
141 148 }
... ... @@ -146,37 +153,45 @@ Page({
146 153 query_date: function() {
147 154 var th = this;
148 155 var date_id = th.data.date_id; //日期下标
149   - var SeekTime = th.data.aweeks[date_id];
  156 + var SeekTime = th.data.aweeks[date_id].time;
150 157 var url = "/api/weshop/marketing/reservation/staff/time/list";
151 158 getApp().request.promiseGet(url, {
152 159 data: {
153   - BeauticianID: "337C11B8-034B-495D-B360-FC2F6CB29394",
154   - ProjectID: "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6",
155   - SeekTime: SeekTime,
  160 + beauticianId: th.data.beautician_id,
  161 + serviceId: th.data.itemId,
  162 + seekTime: SeekTime,
156 163 storeId: a.stoid,
157 164 }
158 165 }).then(res => {
159 166 if (res.data.code == 0) {
160   - var data = res.data.data;
161   - // var date_id = th.data.date_id; //选择日期
162   - // var time = th.data.aweeks[date_id].val; //固定时间
163   - // var time_list = [];
164   - // for (var i = 0; i < time.length; i++) {
165   - // for (var ii = ii; ii < data.length; ii++) {
166   - // if (time[i] == data[ii].GroupHour) {
167   - // time_list.push(data[ii].GroupHour);
168   - // continue;
169   - // } else {
170   - // time_list.push("");
171   - // }
172   - // }
173   - // }
  167 + var time_list = res.data.data;
  168 + var time = th.data.time;
  169 + var new_time = [];
  170 + for (var i = 0; i < time.length; i++) {
  171 + for (var ii = 0; ii < time_list.length; ii++) {
  172 + if (time[i] == time_list[ii].GroupHour.substring(0, 5)) {
  173 + new_time[i] = time_list[ii].GroupHour.substring(0, 5);
  174 + break;
  175 + } else {
  176 + new_time[i] = "";
  177 + }
  178 + }
  179 + }
174 180 th.setData({
175   - time_list: data
  181 + time_list: new_time
176 182 })
177 183 } else {
178 184 getApp().my_warnning(res.data.msg, 0, th);
179 185 }
180 186 })
181 187 },
  188 + //预览头像
  189 + previewImage: function (e) {
  190 + var th = this;
  191 + var current = e.currentTarget.dataset.src;
  192 + wx.previewImage({
  193 + current: current, // 当前显示图片的http链接
  194 + urls: [th.data.head_img] // 需要预览的图片http链接列表
  195 + })
  196 + },
182 197 })
183 198 \ No newline at end of file
... ...
pages/user/my_service/beauty_deta.wxml
... ... @@ -5,7 +5,7 @@
5 5 <!-- 个人信息 -->
6 6 <view class="Personal">
7 7 <view class="name fs36 ellipsis-1">{{name}}</view>
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>
  8 + <image class="head" src="{{head_img==''?iurl+defimgurl:head_img}}" data-errorimg="{{head_img}}" binderror="bind_bnerr1" data-img="{{head_img}}" data-src="{{head_img}}" bindtap="previewImage"></image>
9 9  
10 10 <view class="introduce fs26">
11 11 <block wx:if="{{comment!=''}}">
... ... @@ -35,11 +35,11 @@
35 35 <!-- 选择时间 -->
36 36 <view class="Times">
37 37  
38   - <view class="flex-center" wx:for="{{aweeks[date_id].time}}" style="display:inline-block;" wx:for-index="key" wx:for="it">
39   - <block wx:if="{{item.GroupHour==time_list[key].GroupHour}}">
  38 + <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]}}">
40 40 <view class="Time flex-center {{time_index==key?'chTime':''}}" bindtap="Selection_time" data-index="{{key}}">
41 41 <view>
42   - <view class="fs26">{{it.GroupHour}}</view>
  42 + <view class="fs26">{{it}}</view>
43 43 <block wx:if="{{flase}}">
44 44 <view class="fs24">约满</view>
45 45 </block>
... ... @@ -49,7 +49,7 @@
49 49 <block wx:else>
50 50 <view class="Time flex-center nochTime">
51 51 <view>
52   - <view class="fs26">{it.GroupHour}}</view>
  52 + <view class="fs26">{{it}}</view>
53 53 </view>
54 54 </view>
55 55 </block>
... ...
pages/user/my_service/cosmetology_list.js
... ... @@ -16,7 +16,7 @@ Page({
16 16 pageSize: 10, //页大小
17 17 total: 0, //总数量
18 18 ismore: 0, //是否加载完毕
19   - itemId: 0, //项目id,
  19 + itemId: 0, //服务id,
20 20 storageId: 0, //线下门店id
21 21 },
22 22 onReachBottom: function() {
... ... @@ -30,13 +30,15 @@ Page({
30 30 },
31 31 query_cology: function() {
32 32 var th = this;
33   - var url = "/api/weshop/marketing/reservation/staff/page";
  33 + var url = "/api/weshop/marketing/reservation/staff/page";
  34 + var itemId = th.data.itemId; //服务id
  35 + var storageId = th.data.storageId;
34 36 getApp().request.promiseGet(url, {
35 37 data: {
36 38 storeId: a.stoid,
37 39 userId: d.user_id,
38   - itemId:"08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6",
39   - storageId: "FD8EC44A-6474-4BA1-A17C-A87306690E59",
  40 + serviceId: itemId,
  41 + storageId: storageId,
40 42 page: th.data.curpage,
41 43 pageSize: th.data.pageSize
42 44 }
... ... @@ -55,6 +57,11 @@ Page({
55 57 ismore: ismore,
56 58 is_service_read: 1,
57 59 }), wx.stopPullDownRefresh(); //停止下拉刷新
  60 + } else {
  61 + getApp().my_warnning(res.data.msg, 0, th);
  62 + th.setData({
  63 + is_cosmetology_read:1
  64 + })
58 65 }
59 66 })
60 67 },
... ... @@ -72,12 +79,6 @@ Page({
72 79 * 生命周期函数--监听页面加载
73 80 */
74 81 onLoad: function(options) {
75   - // var th = this;
76   - // var label = "技术好|长得帅|很可爱";
77   - // var split = label.split("|");//标签通过分割符
78   - // for (var i = 0; i < split.length; i++) {
79   - // console.log("成功啦啦啦啦"+split[i]+i);
80   - // }
81 82 var th = this;
82 83 th.setData({
83 84 itemId: options.itemId,
... ...
pages/user/my_service/cosmetology_list.json
1 1 {
2   - "navigationBarTitleText": "美容师列表"
  2 + "navigationBarTitleText": "美容师列表",
  3 + "usingComponents": {
  4 + "warn": "/components/long_warn/long_warn"
  5 + }
3 6 }
4 7 \ No newline at end of file
... ...
pages/user/my_service/cosmetology_list.wxml
... ... @@ -20,13 +20,13 @@
20 20 <!-- 个人标签 -->
21 21 <view class="Label fs22 flex" wx:if="{{item.EvaluationLabel!=''?true:false}} " wx:for="{{item.EvaluationLabel.split('|')}}">
22 22 <view wx:if="{{index==0}}" class="flex-center Labelitem itone">
23   - <view>{{item.type_a}}</view>
  23 + <view>{{item}}</view>
24 24 </view>
25 25 <view wx:if="{{index==1}}" class="flex-center Labelitem itwo">
26   - <view>{{item.type_b}}</view>
  26 + <view>{{item}}</view>
27 27 </view>
28 28 <view wx:if="{{index==2}}" class="flex-center Labelitem ith">
29   - <view>{{item.type_c}}</view>
  29 + <view>{{item}}</view>
30 30 </view>
31 31  
32 32 </view>
... ... @@ -34,17 +34,12 @@
34 34 </view>
35 35  
36 36 <!-- 预约状态 -->
37   - <navigator class="flex-center gofu go" url="/pages/user/my_service/beauty_deta?BeauticianID={{item.Id}}">
  37 + <navigator class="flex-center gofu go" url="/pages/user/my_service/beauty_deta?BeauticianID={{item.Id}}&itemId={{item.Id}}">
38 38 <view class="fs24">预约</view>
39 39 </navigator>
40   - <!-- <block wx:else>
41   - <navigator class="flex-center gofu gofull" url="/pages/user/my_service/beauty_deta">
42   - <view class="fs24">已约满</view>
43   - </navigator>
44   - </block> -->
45 40 </view>
46 41 <view class="fs26 information">
47   - <block wx:if="{{true}}">
  42 + <block wx:if="{{item.Remark1!=''}}">
48 43 <view class="ellipsis-3">{{item.Remark1}}
49 44 </view>
50 45 </block>
... ... @@ -73,4 +68,5 @@
73 68 <view class="flex-center fs28 white">其他项目</view>
74 69 </navigator>
75 70 </view>
76   -</view>
77 71 \ No newline at end of file
  72 +</view>
  73 +<warn id="warn"></warn>
78 74 \ No newline at end of file
... ...
pages/user/my_service/hist_service.js
... ... @@ -135,7 +135,10 @@ Page({
135 135 is_reset:0
136 136 }), wx.stopPullDownRefresh(); //停止下拉刷新
137 137 } else {
138   - getApp().my_warnning(res.data.msg, 0, this);
  138 + th.setData({
  139 + is_service_read:1,
  140 + is_screen:0
  141 + })
139 142 }
140 143 })
141 144 },
... ...
pages/user/my_service/i_service.wxml
1 1 <!-- 背景图片 -->
2 2 <view>
3   - <image class="backimage" src="{{iurl}}/miniapp/images/yyservice/backimage.png" mode="widthFix"></image>
  3 + <image class="backimage" src="{{iurl}}/miniapp/images/yyservice/backimage.png" mode="widthFix" lazy-load="true"></image>
4 4 <navigator class="History fs26" url="/pages/user/my_service/hist_service">历史服务</navigator>
5 5 </view>
6 6  
... ... @@ -49,7 +49,7 @@
49 49 <view>立即使用</view>
50 50 </view>
51 51 <!-- 可预约 -->
52   - <navigator class="flex-level appointment yellow-b" url="/pages/user/my_service/appment_main?itemId={{item.ProjectID}}&BuyType={{item.BuyType}}">
  52 + <navigator class="flex-level appointment yellow-b" url="/pages/user/my_service/appment_main?service_id={{item.ServiceID}}&BuyType={{item.BuyType}}&ProjectID={{item.ProjectID}}">
53 53 <view>预约</view>
54 54 </navigator>
55 55 </view>
... ...
pages/user/my_service/i_service.wxss
... ... @@ -26,7 +26,7 @@ page {
26 26 .rel {
27 27 background-color: rgb(255, 255, 255);
28 28 width: 350rpx;
29   - height: 420rpx;
  29 + height: 405rpx;
30 30 border-radius: 20rpx;
31 31 display: inline-block;
32 32 margin-right: 15rpx;
... ...
pages/user/my_service/tment_details.wxml
... ... @@ -14,7 +14,7 @@
14 14 <!-- 预约门店 -->
15 15 <view class="flex-vertical bmt">
16 16 <view class="name">预约门店:</view>
17   - <view class="ellipsis-1 value">{{item.ProjectName}}</view>
  17 + <view class="ellipsis-1 value">{{item.StorageName}}</view>
18 18 </view>
19 19  
20 20 <!-- 预约项目 -->
... ...
pages/user/my_service/tment_eval.js
... ... @@ -19,6 +19,7 @@ Page({
19 19 number: "", //订单单号
20 20 beautician: "", //美容师信息
21 21 fromType: "服务评价", //评价来源
  22 + arrangeTime:"",//服务日期
22 23 },
23 24 //点击星级
24 25 check_stars: function(e) {
... ... @@ -94,9 +95,10 @@ Page({
94 95 }).then(res => {
95 96 if (res.data.code == 0) {
96 97 var data = res.data.data.pageData;
97   - data = data[0].ArrangeTime.substring(0, 11);
  98 + var arrangeTime = data[0].ArrangeTime.substring(0, 11);
98 99 th.setData({
99   - beautician: data[0]
  100 + beautician: data[0],
  101 + arrangeTime: arrangeTime
100 102 })
101 103 } else {
102 104 getApp().my_warnning(res.data.msg, 0, th);
... ...
pages/user/my_service/tment_eval.wxml
... ... @@ -14,13 +14,13 @@
14 14 <!-- 项目 -->
15 15 <view class="flex-center item">
16 16 <view class="itemlf fs32">服务项目:</view>
17   - <view class="itemlr fs30 ellipsis-1">{{beautician.ProjectName}}</view>
  17 + <view class="itemlr fs30 ellipsis-1">{{beautician.StorageName}}</view>
18 18 </view>
19 19  
20 20 <!-- 时间 -->
21 21 <view class="flex-center">
22 22 <view class="itemlf fs32">服务时间:</view>
23   - <view class="itemlr fs30">{{beautician.ArrangeTime}}</view>
  23 + <view class="itemlr fs30">{{arrangeTime}}</view>
24 24 </view>
25 25 <!-- 设置虚线 -->
26 26  
... ...
pages/user/my_service/tment_order_list.js
... ... @@ -39,7 +39,8 @@ Page({
39 39 * 生命周期函数--监听页面加载
40 40 */
41 41 onLoad: function(options) {
42   -
  42 + var th = this;
  43 + th.query_orderList();
43 44 },
44 45 changeTab: function(e) {
45 46 var th = this;
... ... @@ -171,8 +172,7 @@ Page({
171 172 * 生命周期函数--监听页面显示
172 173 */
173 174 onShow: function() {
174   - var th = this;
175   - th.query_orderList();
  175 +
176 176 },
177 177  
178 178 /**
... ...
pages/user/my_service/tment_order_list.wxml
... ... @@ -18,7 +18,7 @@
18 18 <view wx:if="{{item.State==1}}">已服务</view>
19 19 <view wx:if="{{item.State==2}}">已过期</view>
20 20 <view wx:if="{{item.State==3}}">已取消</view>
21   - <view wx:if="{{item.State>3}}">订单异常</view>
  21 + <view wx:if="{{item.State==4}}">已评价</view>
22 22 </view>
23 23 </view>
24 24  
... ... @@ -63,9 +63,9 @@
63 63 <block wx:else>
64 64 <navigator url="/pages/user/my_service/tment_details?number={{item.Number}}" class="Unimportance flex-level">查看详情</navigator>
65 65 </block>
66   - <navigator wx:if="{{item.State==0}}" class="important Unimportance flex-level" url="/pages/user/my_service/beauty_deta?BeauticianID={{item.BeauticianID}}">更改时间</navigator>
  66 + <navigator wx:if="{{item.State==0}}" class="important Unimportance flex-level" url="/pages/user/my_service/beauty_deta?BeauticianID={{item.BeauticianID}}&service_id={{item.ServiceID}}">更改时间</navigator>
67 67 <navigator wx:if="{{item.State==1}}" url="/pages/user/my_service/tment_eval?Number={{item.Number}}" class="important Unimportance flex-level">发表评价</navigator>
68   - <navigator wx:if="{{item.State==2 || item.State==3}}" url="/pages/user/my_service/appment_main?itemId={{item.ProjectID}}&BuyType={{item.BuyType}}" class="important Unimportance flex-level">重新预约</navigator>
  68 + <navigator wx:if="{{item.State==2 || item.State==3 || item.State==4}}" url="/pages/user/my_service/appment_main?ProjectID={{item.ProjectID}}&BuyType={{item.BuyType}}&service_id={{item.ServiceID}}" class="important Unimportance flex-level">重新预约</navigator>
69 69 </view>
70 70 </view>
71 71 <view class="exactly flex-center fs26" wx:if="{{ismore & tm_order_list.length>3}}">
... ...