Commit 07d275405bed5efb6b6c93b1bfd1b465381b9b53
Merge branch 'test' of http://git.vipzhuang.cn/wxd/MShopWeApp into qa
Showing
10 changed files
with
173 additions
and
20 deletions
components/add_purchase/add_purchase.js
components/add_purchase/add_purchase.wxml
| 1 | 1 | <!--components/add_purchase/add_purchase.wxml--> |
| 2 | 2 | |
| 3 | 3 | <view > |
| 4 | - <view bindtap="closeSpecModal" class="cover-layer"></view> | |
| 4 | + <view class="cover-layer"></view> | |
| 5 | 5 | <view class="spec-model"> |
| 6 | 6 | <view class="pding"> |
| 7 | 7 | <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon> | ... | ... |
packageA/pages/chongzhiDetails/chongzhiDetails.wxml
| ... | ... | @@ -43,7 +43,7 @@ |
| 43 | 43 | <view wx:if="{{item.GiveType=='0'}}">{{item.CouponSum}}元优惠券</view> |
| 44 | 44 | <view wx:elif="{{item.Integral>0}}">{{item.Integral}}积分</view> |
| 45 | 45 | <view wx:elif="{{item.GradeSum>0}}">{{item.GradeSum}}成长值</view> |
| 46 | - <view wx:else>{{item.GiveName}}</view> | |
| 46 | + <view wx:else class="max_len_name ellipsis-2">{{item.GiveName}}</view> | |
| 47 | 47 | <!-- <view class="fs28 pdv10 txt-justify">节日可免费享受专业美甲,可以享受1次。</view> --> |
| 48 | 48 | <view wx:if="{{item.Qty>0}}" class="fs24">数量:{{item.Qty}}</view> |
| 49 | 49 | <view wx:if="{{item.GiveType=='2'}}" class="date fs24">{{'兑换截止日期' + ':' + item.BeginDate + '至' + (item.EndDate==''?'不限':item.EndDate) }}</view> |
| ... | ... | @@ -51,9 +51,12 @@ |
| 51 | 51 | <!-- 优化显示二维码 --> |
| 52 | 52 | <view class="box_ware_code data-v-3a5b7e36" wx:if="{{item.GiveType=='2' && item.IsQrCode==1}}"> |
| 53 | 53 | <!-- <block wx:if="{{c_state==0}}"> --> |
| 54 | - <image src="{{url+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" | |
| 54 | + <image wx:if="{{item.IsRetrieval}}" src="{{url+'/miniapp/images/hui-ewm.png'}}" lazy-load="true" bindtap="getcode" | |
| 55 | 55 | data-index="{{index}}" |
| 56 | - class="data-v-3a5b7e36 {{item.IsRetrieval?'imggray':''}} "></image> | |
| 56 | + class="data-v-3a5b7e36"></image> | |
| 57 | + <image wx:else src="{{url+'/miniapp/images/user_r_code.png'}}" lazy-load="true" bindtap="getcode" | |
| 58 | + data-index="{{index}}" | |
| 59 | + class="data-v-3a5b7e36 "></image> | |
| 57 | 60 | </view> |
| 58 | 61 | |
| 59 | 62 | </view> | ... | ... |
packageA/pages/chongzhiDetails/chongzhiDetails.wxss
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 | 13 | \ No newline at end of file | ... | ... |
pages/user/my_service/i_service.js
| ... | ... | @@ -71,10 +71,14 @@ Page({ |
| 71 | 71 | } |
| 72 | 72 | }).then(res => { |
| 73 | 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 | 75 | th.data.curpage++; |
| 76 | 76 | var arr1 = th.data.service_List; |
| 77 | 77 | var arr2 = res.data.data.pageData; |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 78 | 82 | var arr3 = [...arr1, ...arr2]; |
| 79 | 83 | var ismore = 0; |
| 80 | 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 | 2 | <com_top_nav title="服务项目"></com_top_nav> |
| 2 | 3 | |
| 3 | 4 | <!-- 背景图片 --> |
| ... | ... | @@ -52,9 +53,14 @@ |
| 52 | 53 | </view> |
| 53 | 54 | |
| 54 | 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 | 58 | <view>立即使用</view> |
| 57 | 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 | 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 | 66 | <view>预约</view> | ... | ... |
pages/user/my_service/i_service.wxss
pages/user/order_detail/order_detail.js
| ... | ... | @@ -404,6 +404,68 @@ Page({ |
| 404 | 404 | th.setData({ paying: 0 }); |
| 405 | 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 | 470 | // 幸运购检查库存量 api/weshop/activitylist/getActLen/{store_id}/{prom_type}/{prom_id} |
| 409 | 471 | if (parseInt(order_goods['0']['prom_type']) == 9) { | ... | ... |
pages/user/order_list/order_list.js
| ... | ... | @@ -708,16 +708,78 @@ Page({ |
| 708 | 708 | |
| 709 | 709 | //如果使用预存的话,要重新效验下预存金额是否足够 |
| 710 | 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 | 785 | // 幸运购检查库存量 api/weshop/activitylist/getActLen/{store_id}/{prom_type}/{prom_id} | ... | ... |