Commit 879a397e74d0cc8ce1efb5a5eda6b082878efcca
1 parent
5b9e67e5
~~OA单的~~
Showing
6 changed files
with
162 additions
and
12 deletions
pages/user/my_service/g_filter.wxs
0 → 100644
1 | +var is_acting = function(stime){ | ||
2 | + //判断结束时间减去当前时间 ,如果当前时间大于0则为True | ||
3 | + if(stime=='') return true; | ||
4 | + stime = stime.substring(0, 19); | ||
5 | + var reg = getRegExp("-", "g"); | ||
6 | + stime = stime.replace(reg, '/'); | ||
7 | + var bijiao = getDate(stime) - getDate(); | ||
8 | + return bijiao >= 0 ? false : true; | ||
9 | +} | ||
10 | +module.exports = { | ||
11 | + is_acting:is_acting | ||
12 | +} | ||
0 | \ No newline at end of file | 13 | \ No newline at end of file |
pages/user/my_service/i_service.js
@@ -71,10 +71,14 @@ Page({ | @@ -71,10 +71,14 @@ Page({ | ||
71 | } | 71 | } |
72 | }).then(res => { | 72 | }).then(res => { |
73 | wx.hideLoading(); | 73 | wx.hideLoading(); |
74 | - if (res.data.code == 0) { | 74 | + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length) { |
75 | th.data.curpage++; | 75 | th.data.curpage++; |
76 | var arr1 = th.data.service_List; | 76 | var arr1 = th.data.service_List; |
77 | var arr2 = res.data.data.pageData; | 77 | var arr2 = res.data.data.pageData; |
78 | + | ||
79 | + | ||
80 | + | ||
81 | + | ||
78 | var arr3 = [...arr1, ...arr2]; | 82 | var arr3 = [...arr1, ...arr2]; |
79 | var ismore = 0; | 83 | var ismore = 0; |
80 | if (arr3.length == res.data.data.total) ismore = 1 | 84 | if (arr3.length == res.data.data.total) ismore = 1 |
pages/user/my_service/i_service.wxml
1 | +<wxs module="s_filter" src="g_filter.wxs"></wxs> | ||
1 | <com_top_nav title="服务项目"></com_top_nav> | 2 | <com_top_nav title="服务项目"></com_top_nav> |
2 | 3 | ||
3 | <!-- 背景图片 --> | 4 | <!-- 背景图片 --> |
@@ -52,9 +53,14 @@ | @@ -52,9 +53,14 @@ | ||
52 | </view> | 53 | </view> |
53 | 54 | ||
54 | <view class="flex-center fs28 functionMax"> | 55 | <view class="flex-center fs28 functionMax"> |
55 | - <view class="flex-level Use" bindtap="open_fw" data-ind="{{index}}" data-service_id="{{item.ServiceID}}"> | 56 | + |
57 | + <view wx:if="{{s_filter.is_acting(item.BeginDate)}}" class="flex-level Use" bindtap="open_fw" data-ind="{{index}}" data-service_id="{{item.ServiceID}}"> | ||
56 | <view>立即使用</view> | 58 | <view>立即使用</view> |
57 | </view> | 59 | </view> |
60 | + <view wx:else class="flex-level Use nostart" data-ind="{{index}}" data-service_id="{{item.ServiceID}}"> | ||
61 | + <view>未开始</view> | ||
62 | + </view> | ||
63 | + | ||
58 | <!-- 可预约 --> | 64 | <!-- 可预约 --> |
59 | <view wx:if="{{item.State>0}}" class="flex-level appointment yellow-b" data-url="/packageG/pages/user/my_service/appment_main?service_id={{item.ServiceID}}&BuyType={{item.BuyType}}&ProjectID={{item.ProjectID}}&Validay={{item.Validay}}" bindtap="correcting" data-service_id="{{item.ServiceID}}" data-project_id="{{item.ProjectID}}"> | 65 | <view wx:if="{{item.State>0}}" class="flex-level appointment yellow-b" data-url="/packageG/pages/user/my_service/appment_main?service_id={{item.ServiceID}}&BuyType={{item.BuyType}}&ProjectID={{item.ProjectID}}&Validay={{item.Validay}}" bindtap="correcting" data-service_id="{{item.ServiceID}}" data-project_id="{{item.ProjectID}}"> |
60 | <view>预约</view> | 66 | <view>预约</view> |
pages/user/my_service/i_service.wxss
pages/user/order_detail/order_detail.js
@@ -404,6 +404,68 @@ Page({ | @@ -404,6 +404,68 @@ Page({ | ||
404 | th.setData({ paying: 0 }); | 404 | th.setData({ paying: 0 }); |
405 | return false; | 405 | return false; |
406 | } | 406 | } |
407 | + | ||
408 | + var listform=[]; | ||
409 | + var adv_num=0; | ||
410 | + order_goods.map(ite => { | ||
411 | + //-- 不是赠品的时候 -- | ||
412 | + if(!ite.is_gift) { | ||
413 | + let obj = { | ||
414 | + wareno: ite.goods_sn, | ||
415 | + price: ite.first_account, //account是平摊后的实收价格 | ||
416 | + qty: ite.goods_num, | ||
417 | + sumprice: parseFloat(ite.account * ite.goods_num - ite.account_yu-(ite.quan_num?ite.quan_num:0)).toFixed(2) | ||
418 | + } | ||
419 | + | ||
420 | + adv_num+=ite.account * ite.goods_num - ite.account_yu-(ite.quan_num?ite.quan_num:0); | ||
421 | + listform.push(obj) | ||
422 | + } | ||
423 | + }) | ||
424 | + | ||
425 | + adv_num=parseFloat(adv_num).toFixed(2); | ||
426 | + let res1 = await getApp().request.promisePost(`/api/weshop/delphiapi/saveErpApi`, { | ||
427 | + data: { | ||
428 | + accdb: getApp().globalData.config.erpid, | ||
429 | + ApiName: 'api.pos.shop.advancesum.seek', | ||
430 | + usercode: "admin", | ||
431 | + vipid: getApp().globalData.userInfo.erpvipid, | ||
432 | + oddsum: "0", | ||
433 | + advancesum: adv_num, | ||
434 | + storageid: keyid, | ||
435 | + listform | ||
436 | + }, | ||
437 | + is_json: 1 | ||
438 | + }) | ||
439 | + if(!res1 && res1.data.code!=0 ){ | ||
440 | + getApp().confirmBox("获取预存的金额失败"); | ||
441 | + th.setData({ paying: 0 }); | ||
442 | + return false; | ||
443 | + } | ||
444 | + | ||
445 | + if(res1.data.data.length<=0){ | ||
446 | + getApp().confirmBox("获取预存的金额失败"); | ||
447 | + th.setData({ paying: 0 }); | ||
448 | + return false; | ||
449 | + } | ||
450 | + | ||
451 | + var yck=0 | ||
452 | + let resData = res1.data.data | ||
453 | + resData.map(ite => { | ||
454 | + yck += ite.advancesum*1 | ||
455 | + }) | ||
456 | + if(yck<=0){ | ||
457 | + getApp().confirmBox("获取预存的金额失败"); | ||
458 | + th.setData({ paying: 0 }); | ||
459 | + return false; | ||
460 | + } | ||
461 | + | ||
462 | + if(pre_cut && yck!=pre_cut){ | ||
463 | + getApp().confirmBox("获取预存的金额不对"); | ||
464 | + th.setData({ paying: 0 }); | ||
465 | + return false; | ||
466 | + } | ||
467 | + | ||
468 | + | ||
407 | } | 469 | } |
408 | // 幸运购检查库存量 api/weshop/activitylist/getActLen/{store_id}/{prom_type}/{prom_id} | 470 | // 幸运购检查库存量 api/weshop/activitylist/getActLen/{store_id}/{prom_type}/{prom_id} |
409 | if (parseInt(order_goods['0']['prom_type']) == 9) { | 471 | if (parseInt(order_goods['0']['prom_type']) == 9) { |
pages/user/order_list/order_list.js
@@ -708,16 +708,78 @@ Page({ | @@ -708,16 +708,78 @@ Page({ | ||
708 | 708 | ||
709 | //如果使用预存的话,要重新效验下预存金额是否足够 | 709 | //如果使用预存的话,要重新效验下预存金额是否足够 |
710 | if(order.pre_cut && order.pre_json){ | 710 | if(order.pre_cut && order.pre_json){ |
711 | - let pickup_id=order.pickup_id | ||
712 | - let res = await r.promiseGet('/api/weshop/pickup/get/' + os.stoid + '/' + pickup_id, {}) | ||
713 | - let keyid = res.data.data.keyid | ||
714 | - let resdata = await th.vipadvancesum(keyid,order.pre_cut,order.pre_json) | ||
715 | - if(resdata.code !=0){ | ||
716 | - let msg=resdata.msg || "预存金额不足" | ||
717 | - getApp().confirmBox(msg); | ||
718 | - th.setData({ paying: 0 }); | ||
719 | - return false; | ||
720 | - } | 711 | + let pickup_id=order.pickup_id |
712 | + let res = await r.promiseGet('/api/weshop/pickup/get/' + os.stoid + '/' + pickup_id, {}) | ||
713 | + let keyid = res.data.data.keyid | ||
714 | + let resdata = await th.vipadvancesum(keyid,order.pre_cut,order.pre_json) | ||
715 | + if(resdata.code !=0){ | ||
716 | + let msg=resdata.msg || "预存金额不足" | ||
717 | + getApp().confirmBox(msg); | ||
718 | + th.setData({ paying: 0 }); | ||
719 | + return false; | ||
720 | + } | ||
721 | + | ||
722 | + var listform=[]; | ||
723 | + var adv_num=0; | ||
724 | + order_goods.map(ite => { | ||
725 | + //-- 不是赠品的时候 -- | ||
726 | + if(!ite.is_gift) { | ||
727 | + let obj = { | ||
728 | + wareno: ite.goods_sn, | ||
729 | + price: ite.first_account, //account是平摊后的实收价格 | ||
730 | + qty: ite.goods_num, | ||
731 | + sumprice: parseFloat(ite.account * ite.goods_num - ite.account_yu-(ite.quan_num?ite.quan_num:0)).toFixed(2) | ||
732 | + } | ||
733 | + | ||
734 | + adv_num+=ite.account * ite.goods_num - ite.account_yu-(ite.quan_num?ite.quan_num:0); | ||
735 | + listform.push(obj) | ||
736 | + } | ||
737 | + }) | ||
738 | + | ||
739 | + adv_num=parseFloat(adv_num).toFixed(2); | ||
740 | + let res1 = await getApp().request.promisePost(`/api/weshop/delphiapi/saveErpApi`, { | ||
741 | + data: { | ||
742 | + accdb: getApp().globalData.config.erpid, | ||
743 | + ApiName: 'api.pos.shop.advancesum.seek', | ||
744 | + usercode: "admin", | ||
745 | + vipid: getApp().globalData.userInfo.erpvipid, | ||
746 | + oddsum: "0", | ||
747 | + advancesum: adv_num, | ||
748 | + storageid: keyid, | ||
749 | + listform | ||
750 | + }, | ||
751 | + is_json: 1 | ||
752 | + }) | ||
753 | + if(!res1 && res1.data.code!=0 ){ | ||
754 | + getApp().confirmBox("获取预存的金额失败"); | ||
755 | + th.setData({ paying: 0 }); | ||
756 | + return false; | ||
757 | + } | ||
758 | + | ||
759 | + if(res1.data.data.length<=0){ | ||
760 | + getApp().confirmBox("获取预存的金额失败"); | ||
761 | + th.setData({ paying: 0 }); | ||
762 | + return false; | ||
763 | + } | ||
764 | + | ||
765 | + var yck=0 | ||
766 | + let resData = res1.data.data | ||
767 | + resData.map(ite => { | ||
768 | + yck += ite.advancesum*1 | ||
769 | + }) | ||
770 | + if(yck<=0){ | ||
771 | + getApp().confirmBox("获取预存的金额失败"); | ||
772 | + th.setData({ paying: 0 }); | ||
773 | + return false; | ||
774 | + } | ||
775 | + | ||
776 | + if(pre_cut && yck!=pre_cut){ | ||
777 | + getApp().confirmBox("获取预存的金额不对"); | ||
778 | + th.setData({ paying: 0 }); | ||
779 | + return false; | ||
780 | + } | ||
781 | + | ||
782 | + | ||
721 | } | 783 | } |
722 | 784 | ||
723 | // 幸运购检查库存量 api/weshop/activitylist/getActLen/{store_id}/{prom_type}/{prom_id} | 785 | // 幸运购检查库存量 api/weshop/activitylist/getActLen/{store_id}/{prom_type}/{prom_id} |