Commit da7741ce9f72de623cadfe7502ec3db72360b3d4

Authored by DESKTOP-QHAFKU5\iceling
1 parent e631a2a1

texteat层次过高问题,历史服务添加未服务状态

pages/user/my_service/appment_main.js
@@ -60,11 +60,13 @@ Page({ @@ -60,11 +60,13 @@ Page({
60 if (store) { 60 if (store) {
61 th.setData({ 61 th.setData({
62 store: 0, 62 store: 0,
  63 + is_textea: 1
63 }) 64 })
64 } else { 65 } else {
65 th.setData({ 66 th.setData({
66 beautician: 0, 67 beautician: 0,
67 store: 1, 68 store: 1,
  69 + is_textea: 0
68 }) 70 })
69 if (th.data.store_list.length < 1) { 71 if (th.data.store_list.length < 1) {
70 wx.showLoading({ 72 wx.showLoading({
@@ -86,116 +88,131 @@ Page({ @@ -86,116 +88,131 @@ Page({
86 var th = this; 88 var th = this;
87 var store = th.data.store_name; //门店名称 89 var store = th.data.store_name; //门店名称
88 var bea_name = th.data.beautician_name; //美容师名称 90 var bea_name = th.data.beautician_name; //美容师名称
89 - var time = th.data.time+":00"; //预约时间 91 + var time = th.data.time + ":00"; //预约时间
90 var is_sub = th.data.is_sub; //是否重复提交 92 var is_sub = th.data.is_sub; //是否重复提交
91 //提交预约前的判断 93 //提交预约前的判断
92 if (store == "") { 94 if (store == "") {
93 getApp().my_warnning("请选择服务门店", 0, th); 95 getApp().my_warnning("请选择服务门店", 0, th);
  96 + th.settime();
94 return false; 97 return false;
95 } else if (bea_name == "") { 98 } else if (bea_name == "") {
96 getApp().my_warnning("请选择美容师", 0, th); 99 getApp().my_warnning("请选择美容师", 0, th);
  100 + th.settime();
97 return false; 101 return false;
98 } else if (time == "") { 102 } else if (time == "") {
99 getApp().my_warnning("请选择预约时间", 0, th); 103 getApp().my_warnning("请选择预约时间", 0, th);
  104 + th.settime();
100 return false; 105 return false;
101 } else { 106 } else {
102 -  
103 - var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/insert"; //接口路径  
104 - var serviceId = th.data.itemId; //服务id  
105 - var beauticianID = th.data.beauticianID; //美容师id  
106 - var buyType = th.data.buyType; //服务项目类型  
107 - var storeId = a.stoid; //商家id  
108 - var storageId = th.data.storageId; //门店id  
109 - var userId = d.user_id; //用户id  
110 - var remarks = th.data.remarks; //用户备注  
111 - var project_id = th.data.project_id; //项目id  
112 - var validay = th.data.validay;  
113 - var json = {  
114 - "arrangeTime": time,  
115 - "beauticianId": beauticianID,  
116 - "buyType": buyType,  
117 - "effectiveDay": "",  
118 - "number": "",  
119 - "projectId": project_id,  
120 - "remark": remarks,  
121 - "serviceId": serviceId,  
122 - "states": 0,  
123 - "storageId": storageId,  
124 - "storeId": storeId,  
125 - "userId": userId,  
126 - "validay": validay  
127 - }  
128 - var data = JSON.stringify(json);  
129 - wx.request({  
130 - url: url,  
131 - data: json,  
132 - method: 'post',  
133 - header: {  
134 - 'content-type': 'application/json'  
135 - }, // 设置请求的 header  
136 - success: function(res) { 107 + wx.showLoading({
  108 + title: '加载中',
  109 + })
  110 + var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/insert"; //接口路径
  111 + var serviceId = th.data.itemId; //服务id
  112 + var beauticianID = th.data.beauticianID; //美容师id
  113 + var buyType = th.data.buyType; //服务项目类型
  114 + var storeId = a.stoid; //商家id
  115 + var storageId = th.data.storageId; //门店id
  116 + var userId = d.user_id; //用户id
  117 + var remarks = th.data.remarks; //用户备注
  118 + var project_id = th.data.project_id; //项目id
  119 + var validay = th.data.validay;
  120 + var json = {
  121 + "arrangeTime": time,
  122 + "beauticianId": beauticianID,
  123 + "buyType": buyType,
  124 + "effectiveDay": "",
  125 + "number": "",
  126 + "projectId": project_id,
  127 + "remark": remarks,
  128 + "serviceId": serviceId,
  129 + "states": 0,
  130 + "storageId": storageId,
  131 + "storeId": storeId,
  132 + "userId": userId,
  133 + "validay": validay
  134 + }
  135 + var data = JSON.stringify(json);
  136 + wx.request({
  137 + url: url,
  138 + data: json,
  139 + method: 'post',
  140 + header: {
  141 + 'content-type': 'application/json'
  142 + }, // 设置请求的 header
  143 + success: function(res) {
  144 + th.setData({
  145 + is_sub: 0
  146 + })
  147 + wx.hideLoading();
  148 + if (res.data.code == 0) {
  149 + getApp().my_warnning("预约成功", 1, th);
  150 + var store_name = th.data.store_name; //预约门店
  151 + var number = res.data.data.Number;
  152 + var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口
  153 + var userinfo = getApp().globalData.userInfo;
  154 + var name = d.userInfo.nickname;
  155 + var json = {
  156 + // "formId": formid,
  157 + "keyWord": [{
  158 + "keyword": res.data.data.ServiceName
  159 + },
  160 + {
  161 + "keyword": time.substring(0, 16)
  162 + }, {
  163 + "keyword": res.data.data.BeauticianName
  164 + }, {
  165 + "keyword": res.data.data.StorageName
  166 + }, {
  167 + "keyword": res.data.data.Address
  168 + }
  169 + ],
  170 + "page": "/pages/user/my_service/tment_details?number=" + number,
  171 + "storeId": a.stoid,
  172 + "typeId": "1011",
  173 + "userId": d.user_id
  174 + };
  175 + var data = JSON.stringify(json);
  176 + //调用发送预约成功模版接口
  177 + wx.request({
  178 + url: th.data.inurl + temp_url,
  179 + data: data,
  180 + method: 'post',
  181 + header: {
  182 + 'content-type': 'application/json'
  183 + }, // 设置请求的 header
  184 + success: function(data) {}
  185 + })
  186 + setTimeout(function() {
  187 + wx.redirectTo({
  188 + url: "/pages/user/my_service/tment_details?number=" + number
  189 + });
  190 + }, 1000);
  191 + } else {
  192 + getApp().my_warnning(res.data.msg, 0, th);
  193 + th.settime();
137 th.setData({ 194 th.setData({
138 is_sub: 0 195 is_sub: 0
139 }) 196 })
140 - wx.hideLoading();  
141 - if (res.data.code == 0) {  
142 - getApp().my_warnning("预约成功", 1, th);  
143 - var store_name = th.data.store_name; //预约门店  
144 - var number = res.data.data.Number;  
145 - var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口  
146 - var userinfo = getApp().globalData.userInfo;  
147 - var name = d.userInfo.nickname;  
148 - var json = {  
149 - // "formId": formid,  
150 - "keyWord": [{  
151 - "keyword": res.data.data.ServiceName  
152 - },  
153 - {  
154 - "keyword": time.substring(0,16)  
155 - }, {  
156 - "keyword": res.data.data.BeauticianName  
157 - }, {  
158 - "keyword": res.data.data.StorageName  
159 - }, {  
160 - "keyword": res.data.data.Address  
161 - }  
162 - ],  
163 - "page": "/pages/user/my_service/tment_details?number=" + number,  
164 - "storeId": a.stoid,  
165 - "typeId": "1011",  
166 - "userId": d.user_id  
167 - };  
168 - var data = JSON.stringify(json);  
169 - //调用发送预约成功模版接口  
170 - wx.request({  
171 - url: th.data.inurl + temp_url,  
172 - data: data,  
173 - method: 'post',  
174 - header: {  
175 - 'content-type': 'application/json'  
176 - }, // 设置请求的 header  
177 - success: function(data) {}  
178 - })  
179 - setTimeout(function() {  
180 - wx.redirectTo({  
181 - url: "/pages/user/my_service/tment_details?number=" + number  
182 - });  
183 - }, 1000);  
184 - } else {  
185 - getApp().my_warnning(res.data.msg, 0, th);  
186 - th.setData({  
187 - is_sub: 0  
188 - })  
189 - }  
190 } 197 }
191 - })  
192 - }  
193 - 198 + }
  199 + })
  200 + }
  201 +
  202 + },
  203 + //定时显示texteat
  204 + settime:function(){
  205 + var th = this;
  206 + setTimeout(function () {
  207 + th.setData({
  208 + is_textea: 1
  209 + })
  210 + }, 2000);
194 }, 211 },
195 //提交预约 212 //提交预约
196 sub_success: function(e) { 213 sub_success: function(e) {
197 var th = this; 214 var th = this;
198 - var temp_url = th.data.inurl+"/api/wx/weappSendlist/page"; 215 + var temp_url = th.data.inurl + "/api/wx/weappSendlist/page";
199 var template_id = ""; 216 var template_id = "";
200 if (th.data.is_sub == 1) { 217 if (th.data.is_sub == 1) {
201 return false; 218 return false;
@@ -204,9 +221,6 @@ Page({ @@ -204,9 +221,6 @@ Page({
204 is_textea: 0, 221 is_textea: 0,
205 is_sub: 1 222 is_sub: 1
206 }) 223 })
207 - wx.showLoading({  
208 - title: '加载中',  
209 - })  
210 //获取模版id 224 //获取模版id
211 getApp().request.promiseGet(temp_url, { 225 getApp().request.promiseGet(temp_url, {
212 data: { 226 data: {
@@ -219,13 +233,10 @@ Page({ @@ -219,13 +233,10 @@ Page({
219 // //授权订阅 233 // //授权订阅
220 wx.requestSubscribeMessage({ 234 wx.requestSubscribeMessage({
221 tmplIds: [template_id], 235 tmplIds: [template_id],
222 - success(res) {  
223 - },  
224 - fail(res) {  
225 - } 236 + success(res) {},
  237 + fail(res) {}
226 }) 238 })
227 - } else {  
228 - } 239 + } else {}
229 }) 240 })
230 th.success(); 241 th.success();
231 }, 242 },
@@ -237,8 +248,10 @@ Page({ @@ -237,8 +248,10 @@ Page({
237 }) 248 })
238 if (th.data.store_name == "") { 249 if (th.data.store_name == "") {
239 getApp().my_warnning("请选择服务门店", 0, th); 250 getApp().my_warnning("请选择服务门店", 0, th);
  251 + th.settime();
240 } else if (th.data.beautician_name == "") { 252 } else if (th.data.beautician_name == "") {
241 getApp().my_warnning("请选择美容师", 0, th); 253 getApp().my_warnning("请选择美容师", 0, th);
  254 + th.settime();
242 } else { 255 } else {
243 var url = e.currentTarget.dataset.url; 256 var url = e.currentTarget.dataset.url;
244 getApp().goto(url); 257 getApp().goto(url);
@@ -257,7 +270,8 @@ Page({ @@ -257,7 +270,8 @@ Page({
257 fir_pick_index: index_c, 270 fir_pick_index: index_c,
258 beautician_name: "", 271 beautician_name: "",
259 time: "", 272 time: "",
260 - tment_count: "" 273 + tment_count: "",
  274 + is_textea: 1
261 }) 275 })
262 } 276 }
263 }, 277 },
@@ -270,7 +284,8 @@ Page({ @@ -270,7 +284,8 @@ Page({
270 th.setData({ 284 th.setData({
271 store: 0, 285 store: 0,
272 store_name: store_name, 286 store_name: store_name,
273 - storageId: Id 287 + storageId: Id,
  288 + is_textea:1
274 }) 289 })
275 }, 290 },
276 onReachBottom: function() { 291 onReachBottom: function() {
@@ -325,6 +340,7 @@ Page({ @@ -325,6 +340,7 @@ Page({
325 } 340 }
326 } else { 341 } else {
327 getApp().my_warnning(res.data.msg, 0, th); 342 getApp().my_warnning(res.data.msg, 0, th);
  343 + th.settime();
328 } 344 }
329 }) 345 })
330 }, 346 },
@@ -336,6 +352,7 @@ Page({ @@ -336,6 +352,7 @@ Page({
336 }) 352 })
337 if (th.data.store_name == "") { 353 if (th.data.store_name == "") {
338 getApp().my_warnning("请选择服务门店", 0, th); 354 getApp().my_warnning("请选择服务门店", 0, th);
  355 + th.settime();
339 } else { 356 } else {
340 wx.showLoading({ 357 wx.showLoading({
341 title: '加载中', 358 title: '加载中',
@@ -358,6 +375,7 @@ Page({ @@ -358,6 +375,7 @@ Page({
358 }) 375 })
359 if (res.data.data.pageData.length < 1) { 376 if (res.data.data.pageData.length < 1) {
360 getApp().my_warnning("暂无美容师", 0, th); 377 getApp().my_warnning("暂无美容师", 0, th);
  378 + th.settime();
361 } else { 379 } else {
362 if (th.data.beautician == 0) { 380 if (th.data.beautician == 0) {
363 th.setData({ 381 th.setData({
@@ -370,7 +388,8 @@ Page({ @@ -370,7 +388,8 @@ Page({
370 } 388 }
371 } 389 }
372 } else { 390 } else {
373 - getApp().my_warnning("暂无美容师", 0, th); 391 + getApp().my_warnning(res.data.msg, 0, th);
  392 + th.settime();
374 } 393 }
375 }) 394 })
376 } 395 }
@@ -387,7 +406,7 @@ Page({ @@ -387,7 +406,7 @@ Page({
387 beauticianID: BeauticianID, 406 beauticianID: BeauticianID,
388 time: "", 407 time: "",
389 tment_count: "", 408 tment_count: "",
390 - is_textea: 0 409 + is_textea: 1
391 }) 410 })
392 411
393 }, 412 },
@@ -424,6 +443,7 @@ Page({ @@ -424,6 +443,7 @@ Page({
424 var project_id = th.data.project_id; 443 var project_id = th.data.project_id;
425 if (storageId == "") { 444 if (storageId == "") {
426 getApp().my_warnning("请选择服务门店", 0, th); 445 getApp().my_warnning("请选择服务门店", 0, th);
  446 + th.settime();
427 } else { 447 } else {
428 wx.navigateTo({ 448 wx.navigateTo({
429 url: "/pages/user/my_service/cosmetology_list?" + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id 449 url: "/pages/user/my_service/cosmetology_list?" + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id
@@ -458,6 +478,7 @@ Page({ @@ -458,6 +478,7 @@ Page({
458 }); 478 });
459 if (th.data.is_gps == 0) { 479 if (th.data.is_gps == 0) {
460 getApp().confirmBox("请开启GPS定位", null, 25000, !1); 480 getApp().confirmBox("请开启GPS定位", null, 25000, !1);
  481 + th.settime();
461 } 482 }
462 } else { 483 } else {
463 th.setData({ 484 th.setData({
@@ -494,6 +515,7 @@ Page({ @@ -494,6 +515,7 @@ Page({
494 }) 515 })
495 } else { 516 } else {
496 getApp().my_warnning(res.data.msg, 0, th); 517 getApp().my_warnning(res.data.msg, 0, th);
  518 + th.settime();
497 } 519 }
498 }) 520 })
499 521
@@ -529,7 +551,8 @@ Page({ @@ -529,7 +551,8 @@ Page({
529 validay: res.data.data.pageData[0].Validay 551 validay: res.data.data.pageData[0].Validay
530 }) 552 })
531 } else { 553 } else {
532 - getApp().my_warnning(res.data.msg, 0, th); 554 + getApp().my_warnning(res.data.msg, 0, th);
  555 + th.settime();
533 } 556 }
534 }) 557 })
535 }, 558 },
pages/user/my_service/appment_main.wxml
@@ -69,12 +69,12 @@ @@ -69,12 +69,12 @@
69 <view>注</view> 69 <view>注</view>
70 </view> 70 </view>
71 <view class="flex fs26"> 71 <view class="flex fs26">
72 - <block wx:if="{{is_textea==1 && store==0}}"> 72 + <block wx:if="{{is_textea==1}}">
73 <textarea class="textarea" placeholder="{{remarks==''?'填写备注':remarks}}" placeholder-class="fs26 color" value="{{remarks}}" bindinput="input_remarks" maxlength="100"> 73 <textarea class="textarea" 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>
77 - <view class="textarea color" bindtap="check_text">{{remarks==''?'填写备注':remarks}} 77 + <view class="textarea {{remarks==''?'color':''}}" bindtap="check_text">{{remarks==''?'填写备注':remarks}}
78 </view> 78 </view>
79 </block> 79 </block>
80 </view> 80 </view>
pages/user/my_service/hist_service.wxml
@@ -39,6 +39,7 @@ @@ -39,6 +39,7 @@
39 </view> 39 </view>
40 <!-- right --> 40 <!-- right -->
41 <view class="serState fs32"> 41 <view class="serState fs32">
  42 + <view wx:if="{{item.State==0}}">未服务</view>
42 <view wx:if="{{item.State==1}}">已服务</view> 43 <view wx:if="{{item.State==1}}">已服务</view>
43 <view wx:if="{{item.State==2}}">已过期</view> 44 <view wx:if="{{item.State==2}}">已过期</view>
44 <view wx:if="{{item.State==3}}">已取消</view> 45 <view wx:if="{{item.State==3}}">已取消</view>