Commit 6bf1e62c631d9afd1728e923f7977d47511f4155

Authored by 后端研发-苏明海
2 parents 4d5697f3 80e4af63

Merge branch 'dev' into 'test'

Dev

See merge request !650
Showing 108 changed files with 5271 additions and 987 deletions

Too many changes.

To preserve performance only 100 of 108 files are displayed.

... ... @@ -40,7 +40,7 @@ App({
40 40 ],
41 41  
42 42 globalData: {
43   - cartGoodsNum:0, //购物车总数量
  43 + cartGoodsNum:0, //购物车总数量
44 44 isTabBar :false,
45 45 isIpx: false, //适配IPhoneX
46 46 url:"",
... ... @@ -165,8 +165,9 @@ App({
165 165 }
166 166 }
167 167 })
168   -
169   -
  168 +
  169 + //获取一下门店的基本信息
  170 + this.getConfig();
170 171 },
171 172  
172 173 //---初始化第三方----
... ... @@ -216,7 +217,7 @@ App({
216 217 return false;
217 218 }
218 219 if(this.globalData.config==undefined) this.globalData.config=null;
219   - this.globalData.config ? "function" == typeof t && t(this.globalData.config) : e.request.get("/api/weshop/store/get/" + e.globalData.setting.stoid, {
  220 + this.globalData.config ? "function" == typeof t && t(this.globalData.config) : e.requestGet("/api/weshop/store/get/" + e.globalData.setting.stoid, {
220 221 success: function(o) {
221 222 console.log('getConfig');
222 223 if(o.data.code==0){
... ... @@ -523,6 +524,7 @@ App({
523 524 //-------获取购物车数量----------
524 525 requestCardNum: function(th) {
525 526 if(!this.globalData.user_id) return false;
  527 + var that=this;
526 528 this.request.get("/api/weshop/cart/page", {
527 529 isShoeLoading:false,
528 530 data: {
... ... @@ -538,14 +540,30 @@ App({
538 540 num += e.data.data.pageData[i].goods_num;
539 541 }
540 542 }
541   - getApp().globalData.cartGoodsNum=num;
  543 +
542 544 /*---
543 545 wx.setTabBarBadge({ //tabbar右上角添加文本
544 546 index: 2, ////tabbar下标
545 547 text: '' + num //显示的内容
546 548 });--*/
547   - th.getTabBar().setData({cartGoodsNum:num});
548   - th.data.up_dating = 0
  549 +
  550 + //-- 读取服务卡的数量 --
  551 + that.promiseGet("/api/weshop/cartService/page",{
  552 + data:{
  553 + store_id: that.globalData.setting.stoid,
  554 + user_id: that.globalData.user_id,
  555 + }
  556 + }).then(res=>{
  557 +
  558 + for (var i = 0; i < res.data.data.pageData.length; i++) {
  559 + num += res.data.data.pageData[i].goods_num;
  560 + }
  561 +
  562 + that.globalData.cartGoodsNum=num;
  563 + th.data.up_dating = 0
  564 + th.getTabBar().setData({cartGoodsNum:num});
  565 + })
  566 +
549 567 }
550 568 });
551 569 },
... ... @@ -660,6 +678,27 @@ App({
660 678 })
661 679 })
662 680 },
  681 +
  682 +
  683 + //---promise的使用get----
  684 + requestGet:function(url,data){
  685 + if(url.indexOf("http")==-1) url=this.globalData.setting.url +url;
  686 + data.isShowLoading && wx.showLoading();
  687 + wx.request({
  688 + url,
  689 + method: 'GET',
  690 + header: {"content-type": "application/x-www-form-urlencoded" },
  691 + data:data.data,
  692 + success(res) {
  693 + data.isShowLoading && wx.hideLoading();
  694 + data.success(res);
  695 + },
  696 + fail(err) {
  697 + data.isShowLoading && wx.hideLoading();
  698 + if(data.fail) data.fail(err);
  699 + }
  700 + })
  701 + },
663 702  
664 703  
665 704 // 判断是否登录
... ...
app.json
... ... @@ -19,8 +19,7 @@
19 19 "pages/user/coupon/coupon",
20 20 "pages/user/checkcoupon/checkcoupon",
21 21 "pages/user/add_address/add_address",
22   - "pages/user/withdrawals_list/withdrawals_list",
23   - "pages/user/add_comment/add_comment",
  22 + "pages/user/withdrawals_list/withdrawals_list",
24 23 "pages/user/return_goods_info/return_goods_info",
25 24 "pages/user/return_goods/return_goods",
26 25 "pages/user/withdrawals/withdrawals",
... ... @@ -50,8 +49,7 @@
50 49 "pages/user/integral/msg/msg",
51 50 "pages/user/userqy/userqy",
52 51 "pages/user/user_spsy/user_spsy",
53   - "pages/user/user_fw/user_fw",
54   - "pages/user/user_coupon/user_coupon",
  52 + "pages/user/user_fw/user_fw",
55 53 "pages/user/grow_value/grow_value",
56 54 "pages/payment/pay_success/pay_success",
57 55 "pages/user/plus/plus",
... ... @@ -66,10 +64,8 @@
66 64 "pages/user/my_service/tment_eval",
67 65 "pages/user/my_service/tment_order_list",
68 66 "pages/user/my_service/beauty_deta",
69   - "pages/user/labels/labels",
70   - "pages/user/view_comment/view_comment",
71   - "pages/giftpack/birthdaygift/birthdaygift",
72   - "pages/user/comment/comment",
  67 + "pages/user/labels/labels",
  68 + "pages/giftpack/birthdaygift/birthdaygift",
73 69 "pages/giftpack/evaluategift/evaluategift",
74 70 "pages/giftpack/newvipgift/newvipgift",
75 71 "pages/giftpack/payment/payment",
... ... @@ -88,7 +84,6 @@
88 84 "pages/cart/cart2_inte/cart2_inte",
89 85 "pages/giftpack/festival/festival",
90 86 "pages/team/team_more/team_more",
91   - "pages/user/collect_list/collect_list",
92 87 "pages/user/deposit/deposit",
93 88 "pages/user/deposit/prepaid/msg/msg",
94 89 "pages/user/deposit/prepaid/prepaid",
... ... @@ -96,7 +91,7 @@
96 91 ],
97 92 "plugins": {
98 93 "live-player-plugin": {
99   - "version": "1.2.5",
  94 + "version": "1.3.0",
100 95 "provider": "wx2b03c6e691cd7370"
101 96 }
102 97 },
... ... @@ -109,42 +104,62 @@
109 104 "pages/quan_pro/quan_pro",
110 105 "pages/liveStream/liveStream",
111 106 "pages/liveStreamDetails/liveStreamDetails",
112   - "pages/addCustomer/addCustomer",
113   - "pages/goods_share/goods_share",
114   - "pages/activity_share/activity_share",
115   - "pages/live_share/live_share",
116   - "pages/quan/quan",
117   - "pages/chongzhi/chongzhi",
118   - "pages/chongzhiDetails/chongzhiDetails",
119   - "pages/jfbuy/jfbuy",
120   - "pages/hongBao/hongBao",
121   - "pages/hongBaoDetails/hongBaoDetails",
122   - "pages/service_record/service_record",
123   - "pages/checkin/checkin",
124   - "pages/distribution/myteam/myteam",
125   - "pages/distribution/order/order",
126   - "pages/distribution/commision/commision",
127   - "pages/distribution/rank/rank",
128   - "pages/distribution/card/card",
129   - "pages/distribution/goods/goods",
130   - "pages/distribution/shop/shop",
131   - "pages/distribution/rookie/rookie",
132   - "pages/service_share/service_share",
133   - "pages/cardList/cardList",
134   - "pages/goodsInfo/goodsInfo",
135   - "pages/my_service/appment_main",
136   - "pages/my_service/i_service",
137   - "pages/my_service/cosmetology_list",
138   - "pages/my_service/hist_service",
139   - "pages/my_service/tment_details",
140   - "pages/my_service/tment_eval",
141   - "pages/my_service/tment_order_list",
142   - "pages/my_service/beauty_deta",
143   - "pages/profile/profile",
144   - "pages/parseHtml/parseHtml"
  107 + "pages/addCustomer/addCustomer",
  108 + "pages/goods_share/goods_share",
  109 + "pages/activity_share/activity_share",
  110 + "pages/live_share/live_share",
  111 + "pages/quan/quan",
  112 + "pages/chongzhi/chongzhi",
  113 + "pages/chongzhiDetails/chongzhiDetails",
  114 + "pages/jfbuy/jfbuy",
  115 + "pages/hongBao/hongBao",
  116 + "pages/hongBaoDetails/hongBaoDetails",
  117 + "pages/service_record/service_record",
  118 + "pages/checkin/checkin",
  119 + "pages/distribution/myteam/myteam",
  120 + "pages/distribution/order/order",
  121 + "pages/distribution/commision/commision",
  122 + "pages/distribution/rank/rank",
  123 + "pages/distribution/card/card",
  124 + "pages/distribution/goods/goods",
  125 + "pages/distribution/shop/shop",
  126 + "pages/distribution/rookie/rookie",
  127 + "pages/service_share/service_share",
  128 + "pages/cardList/cardList",
  129 + "pages/goodsInfo/goodsInfo",
  130 + "pages/my_service/appment_main",
  131 + "pages/my_service/i_service",
  132 + "pages/my_service/cosmetology_list",
  133 + "pages/my_service/hist_service",
  134 + "pages/my_service/tment_details",
  135 + "pages/my_service/tment_eval",
  136 + "pages/my_service/tment_order_list",
  137 + "pages/my_service/beauty_deta",
  138 + "pages/my_service2/appment_main",
  139 + "pages/profile/profile",
  140 + "pages/parseHtml/parseHtml",
  141 + "pages/myGift/myGift",
  142 + "pages/myGiftDetails/myGiftDetails",
  143 + "pages/cart2_ser/cart2_ser",
  144 + "pages/libao_payment/payment"
145 145 ]
146 146  
147   - }],
  147 + },
  148 + {
  149 + "root": "packageB/",
  150 + "name":"pack2",
  151 + "pages": [
  152 + "pages/user/collect_list/collect_list",
  153 + "pages/user/comment/comment",
  154 + "pages/user/view_comment/view_comment",
  155 + "pages/user/add_comment/add_comment",
  156 + "pages/user/user_coupon/user_coupon",
  157 + "pages/user/buyDetails/buyDetails"
  158 + ]
  159 +
  160 +}
  161 +
  162 +],
148 163 "permission": {
149 164 "scope.userLocation": {
150 165 "desc": "获取你的位置信息"
... ...
app.wxss
... ... @@ -50,6 +50,11 @@
50 50 .pdr40 {
51 51 padding-right: 40rpx;
52 52 }
  53 +
  54 +.pdr80 {
  55 + padding-right: 80rpx;
  56 +}
  57 +
53 58 .pdh10 {
54 59 padding-left: 10rpx;
55 60 padding-right: 10rpx;
... ... @@ -58,9 +63,13 @@
58 63 padding-left: 20rpx;
59 64 padding-right: 20rpx;
60 65 }
  66 +.pdv10 {
  67 + padding-top: 10rpx;
  68 + padding-bottom: 10rpx;
  69 +}
61 70 .pdv20 {
62   - padding-top: 30rpx;
63   - padding-bottom: 30rpx;
  71 + padding-top: 20rpx;
  72 + padding-bottom: 20rpx;
64 73 }
65 74 .pdv30 {
66 75 padding-top: 30rpx;
... ... @@ -132,6 +141,10 @@
132 141 background-color: #f0f0f0;
133 142 }
134 143  
  144 +.bg-f8 {
  145 + background-color: #f8f8f8;
  146 +}
  147 +
135 148 .pr {
136 149 position: relative;
137 150 }
... ... @@ -140,6 +153,14 @@
140 153 font-weight: bold;
141 154 }
142 155  
  156 +.mgl10 {
  157 + margin-left: 10rpx;
  158 +}
  159 +
  160 +.mgb10 {
  161 + margin-bottom: 10rpx;
  162 +}
  163 +
143 164 .mgl20 {
144 165 margin-left: 20rpx;
145 166 }
... ... @@ -604,7 +625,7 @@ background: #ffe3e2;
604 625 font-size: 38rpx;
605 626 }
606 627 .fs40 {
607   - font-size: 40rpx;
  628 + font-size: 40rpx !important;
608 629 }
609 630 .ai_c {
610 631 align-items: center;
... ... @@ -635,6 +656,10 @@ background: #ffe3e2;
635 656 line-height: 1;
636 657 }
637 658  
  659 +.lh {
  660 + line-height: 1.4;
  661 +}
  662 +
638 663  
639 664  
640 665  
... ... @@ -645,13 +670,10 @@ background: #ffe3e2;
645 670  
646 671 /* 图标字体(ty) */
647 672 @font-face {
648   - font-family: 'iconfont'; /* project id 2054717 */
649   - src: url('//at.alicdn.com/t/font_2054717_uapbrzlc8k.eot');
650   - src: url('//at.alicdn.com/t/font_2054717_uapbrzlc8k.eot?#iefix') format('embedded-opentype'),
651   - url('//at.alicdn.com/t/font_2054717_uapbrzlc8k.woff2') format('woff2'),
652   - url('//at.alicdn.com/t/font_2054717_uapbrzlc8k.woff') format('woff'),
653   - url('//at.alicdn.com/t/font_2054717_uapbrzlc8k.ttf') format('truetype'),
654   - url('//at.alicdn.com/t/font_2054717_uapbrzlc8k.svg#iconfont') format('svg');
  673 + font-family: 'iconfont'; /* Project id 2054717 */
  674 + src: url('//at.alicdn.com/t/font_2054717_f0lv6m3iryg.woff2?t=1621240949872') format('woff2'),
  675 + url('//at.alicdn.com/t/font_2054717_f0lv6m3iryg.woff?t=1621240949872') format('woff'),
  676 + url('//at.alicdn.com/t/font_2054717_f0lv6m3iryg.ttf?t=1621240949872') format('truetype');
655 677 }
656 678  
657 679 .iconfont {
... ... @@ -662,6 +684,14 @@ background: #ffe3e2;
662 684 -moz-osx-font-smoothing: grayscale;
663 685 }
664 686  
  687 +.icon-sandian:before {
  688 + content: "\e665";
  689 +}
  690 +
  691 +.icon-meirong:before {
  692 + content: "\e60e";
  693 +}
  694 +
665 695 .icon-yuanquan:before {
666 696 content: "\e60d";
667 697 }
... ...
components/diy_goodsGroup/diy_goodsGroup.js
... ... @@ -101,16 +101,13 @@ Component({
101 101 }
102 102  
103 103 this.data.requestData = new Array();
104   - if(nav_item && nav_item.data)
105   - {
106   - this.data.g_id = nav_item.data;
107   - var arr = [];
108   - for (var i = 0; i < this.data.g_id.length; i += this.data.goodscount) {
109   - arr.push(this.data.g_id.slice(i, i + this.data.goodscount));
110   - }
111   - this.data.firist_type_data = arr;
112   - }
  104 + this.data.g_id = nav_item.data;
  105 + var arr = [];
113 106  
  107 + for (var i = 0; i < this.data.g_id.length; i += this.data.goodscount) {
  108 + arr.push(this.data.g_id.slice(i, i + this.data.goodscount));
  109 + }
  110 + this.data.firist_type_data = arr;
114 111 this.init(this.data.classstyle_id, this.data.wgroup);
115 112 },
116 113 detached: function() {
... ... @@ -130,11 +127,12 @@ Component({
130 127 // 这里是一个自定义方法
131 128 init:async function (classstyle_id, wgroup) {
132 129  
133   - this.setData({classstyle_id:classstyle_id})
  130 + this.setData({classstyle_id:classstyle_id})
  131 +
134 132 var th = this;
135 133 var g_id = this.data.g_id;
136   - var len=this.data.firist_type_data?this.data.firist_type_data.length:0;
137   - if (classstyle_id == 1 && this.data.firist_type_data) {
  134 + var len=this.data.firist_type_data.length;
  135 + if (classstyle_id == 1) {
138 136 //---手动选择的时候---
139 137 g_id = this.data.firist_type_data[th.data.firist_type_curr];
140 138 th.data.firist_type_curr++;
... ...
components/diy_goodsGroup/diy_goodsGroup.wxml
... ... @@ -624,11 +624,12 @@
624 624 <view class="sp">
625 625 <swiper-item class="s_it" wx:for="{{goods_array}}">
626 626 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind">
627   - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}" >
628   - <view class='one'>
  627 + <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}" style="width: 32%" >
  628 + <view class='one' style="margin-left: 10rpx">
629 629 <view class='sp_top'>
630   - <view class='s_img' style="position: relative;">
631   - <image src="{{aitem.goods_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].goods_img" binderror="bind_bnerr3" lazy-load="true"></image>
  630 + <view class='s_img' style="position: relative; width: 100%">
  631 + <image src="{{aitem.goods_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].goods_img"
  632 + binderror="bind_bnerr3" lazy-load="true" style="width: 100%"></image>
632 633  
633 634 <block wx:if="{{object.goodicon==3}}">
634 635 <image class='{{g_filter.get_class(object.column,object.position)}}'
... ...
components/diy_goodsGroup/diy_goodsGroup.wxss
... ... @@ -304,7 +304,7 @@
304 304 .zs_wz1_2l {
305 305 overflow: hidden;
306 306 text-overflow: ellipsis;
307   - font-size: 30rpx;
  307 + font-size: 28rpx;
308 308 white-space: nowrap;
309 309 height: 40rpx;
310 310 line-height: 40rpx;
... ... @@ -343,7 +343,7 @@
343 343 .zs_wz5_2l {
344 344 overflow: hidden;
345 345 text-overflow: ellipsis;
346   - font-size: 30rpx;
  346 + font-size: 24rpx;
347 347 white-space: nowrap;
348 348 margin-top: 10rpx;
349 349 }
... ... @@ -428,8 +428,9 @@
428 428  
429 429 .zs_wz1_3l {
430 430 margin-bottom: 10rpx;
431   - font-size: 30rpx;
432   - height: 80rpx;
  431 + font-size: 28rpx;
  432 + height: 70rpx;
  433 + line-height: 35rpx;
433 434 width: 220rpx;
434 435 overflow: hidden;
435 436 text-overflow: ellipsis;
... ... @@ -440,7 +441,7 @@
440 441  
441 442 .zs_wz2_3l {
442 443 margin-bottom: 10rpx;
443   - font-size: 30rpx;
  444 + font-size: 26rpx;
444 445 height: 70rpx;
445 446 line-height: 30rpx
446 447 }
... ... @@ -464,7 +465,7 @@
464 465 .zs_wz5_3l {
465 466 overflow: hidden;
466 467 text-overflow: ellipsis;
467   - font-size: 30rpx;
  468 + font-size: 24rpx;
468 469 white-space: nowrap;
469 470 }
470 471  
... ... @@ -524,10 +525,15 @@
524 525 font-size: 24rpx;
525 526 }
526 527  
  528 +.fs24 {
  529 + font-size: 22rpx;
  530 +}
527 531 .fs35 {
528   - font-size: 35rpx;
  532 + font-size: 30rpx;
529 533 }
530 534  
  535 +.fs28{ font-size: 28rpx;}
  536 +
531 537 .xc-wc {
532 538 align-items: center;
533 539 margin-top: -3rpx;
... ...
pages/user/user_coupon/filter.wxs renamed to components/full_screen/filter.wxs
1 1 var format = function (text) {
  2 +
2 3 if (!text) {
3 4 return
4 5 }
... ...
components/full_screen/full_screen.js 0 → 100644
  1 +// components/userqy_pop_up/userqy_pop_up.js
  2 +var o = getApp().globalData.setting
  3 +Component({
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 + control: 1,
  9 + is_full_screen_show:0, //全屏显示
  10 + sec_show:3, //倒计时的秒数
  11 + full_ad:null, //全屏广告
  12 + url:o.imghost,
  13 + full_screen:0,
  14 + is_full_screen_men:1,
  15 + hidden:0,
  16 + },
  17 +
  18 + pageLifetimes:{
  19 + hide: function() {
  20 + // 页面被隐藏
  21 + clearInterval(this.data.full_screen);
  22 + },
  23 + },
  24 +
  25 + ready: function () {},
  26 + properties: {},
  27 + methods: {
  28 + close_full_screen(){
  29 + this.setData({is_full_screen_show:0,sec_show:0});
  30 + },
  31 + //-- 跳转到满屏广告的链接 --
  32 + go_full_ad(){
  33 + if(!this.data.full_ad) return false;
  34 + if(!this.data.full_ad.ad_weapplink) return false;
  35 + getApp().goto(this.data.full_ad.ad_weapplink);
  36 + },
  37 + get_the_full_screen(){
  38 + if(this.data.full_ad) {
  39 + return false;
  40 + }
  41 + var th=this;
  42 + //获取全屏的广告
  43 + getApp().request.promiseGet("/api/weshop/ad/page?pid=1001&store_id=" + o.stoid,{
  44 + data: { enabled: 1 }
  45 + }).then(res=>{
  46 + //判断是不是有全屏广告
  47 + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){
  48 + th.setData({
  49 + is_full_screen_show:1,
  50 + full_ad:res.data.data.pageData[0],
  51 + })
  52 + //--定时关闭--
  53 + th.data.full_screen=setInterval(function(){
  54 + if(!th.data.sec_show) {
  55 + clearInterval(th.data.full_screen);
  56 + th.close_full_screen();
  57 + return false;
  58 + }
  59 + th.data.sec_show--;
  60 + th.setData({sec_show:th.data.sec_show});
  61 + },1000)
  62 +
  63 + }
  64 + })
  65 + }
  66 + },
  67 +
  68 +})
0 69 \ No newline at end of file
... ...
components/full_screen/full_screen.json 0 → 100644
  1 +{
  2 + "component": true,
  3 + "usingComponents": {}
  4 +}
0 5 \ No newline at end of file
... ...
components/full_screen/full_screen.wxml 0 → 100644
  1 +<!-- 全屏控制 -->
  2 +<view wx:if="{{is_full_screen_show}}" class="full_screen" bindtap="go_full_ad" style="background-image: url('{{url+full_ad.ad_code}}');">
  3 + <view catchtap="close_full_screen" class="skip_box">跳过 <text>{{sec_show}}</text></view>
  4 +</view>
  5 +
  6 +
  7 +
... ...
components/full_screen/full_screen.wxss 0 → 100644
  1 +.full_screen{
  2 + position: fixed;left: 0;top: 0;
  3 + z-index: 1000000000000;
  4 + background-color: rgba(0,0,0,0.4);
  5 + width: 100%;
  6 + height: 100%;
  7 + background-position: center;
  8 + background-size: 100% 100%;
  9 + background-repeat: no-repeat;
  10 +}
  11 +.skip_box{
  12 + float: right; margin-top: 10rpx; margin-right: 10rpx;
  13 + background-color: gainsboro; width: 120rpx;
  14 + height: 48rpx; font-size: 28rpx; line-height: 48rpx;
  15 + text-align: center; border-radius: 20rpx;
  16 + }
0 17 \ No newline at end of file
... ...
components/qr_code/qr_code.wxss
... ... @@ -57,10 +57,11 @@ left: 0rpx;
57 57 .barcode {
58 58 height:150rpx;
59 59 width: 620rpx;
60   -
61 60 text-align:center;
62 61 position:absolute;
63   - left: 30rpx
  62 + left: 30rpx;
  63 + top: -6rpx;
  64 +
64 65 }
65 66 canvas{
66 67 width:100%;
... ... @@ -83,6 +84,7 @@ display:flex;
83 84 flex-direction:column;
84 85 position: absolute;
85 86 left: 75rpx;
  87 +top: 5rpx;
86 88  
87 89 }
88 90 .qrcode{
... ...
packageA/pages/cardList/cardList.wxml
... ... @@ -10,13 +10,13 @@
10 10 <view class="flex bg-white ">
11 11 <view>
12 12 <image class="image" src="{{imghost}}{{item.imgUrl && item.imgUrl!=''?item.imgUrl:'/miniapp/images/default_g_img.gif'}}"
13   - lazy-load="true" binderror="bind_bnerr" data-errorimg="list.pageData[{{index}}].imgUrl"
  13 + lazy-load="true" binderror="bind_bnerr" data-errorimg="list.pageData[{{index}}].imgUrl"
14 14 />
15 15 </view>
16 16 <view class="flex fdc space-bt f1 pdl20">
17 17 <view>
18 18 <view class="pdv20 fs28"><text class="ellipsis-2">{{item.serviceName}}</text></view>
19   - <view class="fs24 c7b">有效天数:{{item.validDays?item.validDays:'不限'}}</view>
  19 + <view class="fs24 c7b">有效天数:{{item.validDays?item.validDays:0}}</view>
20 20 </view>
21 21 <view class="flex space-bt ali-c">
22 22 <view class="price">{{item.money}}</view>
... ... @@ -36,7 +36,7 @@
36 36 style="margin-bottom: 20rpx;">
37 37 <view style="width: 100%;">
38 38 <image style="width: 100%;" lazy-load="true" binderror="bind_bnerr" data-errorimg="list.pageData[{{index}}].imgUrl"
39   - src="{{imghost}}{{item.imgUrl && item.imgUrl!=''?item.imgUrl:'/miniapp/images/default_g_img.gif'}}" mode="{{object.column=='1'?'widthFix':'aspectFit'}}"/></view>
  39 + src="{{imghost}}{{item.imgUrl && item.imgUrl!=''?item.imgUrl:'/miniapp/images/default_g_img.gif'}}" mode="aspectFill"/></view>
40 40 <view class="flex fdc space-bt f1 pdl20">
41 41 <view>
42 42 <view class="pdv20 fs28"><text class="ellipsis-2">{{item.serviceName}}</text></view>
... ... @@ -58,11 +58,9 @@
58 58  
59 59 <block wx:else>
60 60 <view class="page">
61   - <block wx:if="{{banner}}">
62   - <swiper class="swiper" autoplay indicator-dots circular easing-function="easeOutCubic">
63   - <swiper-item wx:for="{{banner}}"><image src="{{item.ad_code ? item.ad_code : (imghost + default_img)}}" class="swiper-img"/></swiper-item>
64   - </swiper>
65   - </block>
  61 + <swiper class="swiper" autoplay indicator-dots circular easing-function="easeOutCubic">
  62 + <swiper-item wx:for="{{banner}}"><image src="{{item.ad_code ? item.ad_code : (imghost + default_img)}}" class="swiper-img"/></swiper-item>
  63 + </swiper>
66 64 <scroll-view class="scroll-view" scroll-y>
67 65 <view class="bg-white">
68 66 <view class="flex pd20" wx:for="{{list.pageData}}" bindtap="go_goods" data-gid="{{item.id}}">
... ...
packageA/pages/cart2_ser/cart2_ser.js
... ... @@ -38,8 +38,8 @@ Page({
38 38 bn_pickname: "", //选择的门店名称
39 39  
40 40 /*------------------------*/
41   - //判断页面是返回回来的还是 首次进入的
42 41 yuer:0,
  42 + is_cart:0, //是不是购物车进来的购买
43 43 },
44 44 onLoad: function(t) {
45 45 wx.setNavigationBarTitle({
... ... @@ -48,7 +48,11 @@ Page({
48 48  
49 49 var appD=getApp().globalData.service_now;
50 50 this.data.postdata=appD;
51   - this.data.param=t;
  51 + this.data.param=t;
  52 + if(t.is_cart){
  53 + this.setData({is_cart:1});
  54 + }
  55 +
52 56 var th=this;
53 57  
54 58 getApp().promiseGet("/api/wx/weappSendlist/page", {
... ... @@ -71,7 +75,6 @@ Page({
71 75 to.auth.get_u(func);
72 76 },
73 77  
74   -
75 78 //----------------展示页面,是再获取用户信息之后--------------
76 79 show_page:function(){
77 80 var th=this;
... ... @@ -84,7 +87,15 @@ Page({
84 87 getApp().globalData.userInfo = e.data.data;
85 88 th.setData({userinfo:e.data.data});
86 89 //获取立即购买的商品信息
87   - th.get_buy_goods();
  90 + if(th.data.is_cart){
  91 + //读取门店
  92 + to.get_allsto(function (e) {
  93 + th.setData({ allsto: e });
  94 + th.get_cart();
  95 + })
  96 + }else{
  97 + th.get_buy_goods();
  98 + }
88 99  
89 100 //获取提现金额
90 101 getApp().request.get("/api/weshop/withdrawals/summoney", {
... ... @@ -101,6 +112,75 @@ Page({
101 112 });
102 113 },
103 114  
  115 + //-----获取购物车,入口--------
  116 + get_cart: function () {
  117 + var th = this,app=getApp();
  118 + a.get("/api/weshop/cartService/page", {
  119 + data: {
  120 + user_id: to.globalData.user_id, selected:1,
  121 + store_id: oo.stoid, pageSize: 600 },
  122 + success:async function (su) {
  123 + //按门店分类的数组
  124 + var arr = new Array();
  125 + var carr = su.data.data.pageData;
  126 + th.data.cartlist_y = carr; //存储原始购物车列表
  127 +
  128 + //---是不是购买等级卡成功的返回---等级卡显示的判断---
  129 + var is_card_back=getApp().globalData.is_card_back;
  130 +
  131 +
  132 + //在分组的时候,就不要再调用接口,await
  133 + for (var i = 0; i < carr.length; i++) {
  134 + var good=null;
  135 + var item = carr[i];
  136 + await getApp().request.promiseGet("/api/weshop/serviceCard/get/" + oo.stoid + "/" + item.service_id, {}).then(res => {
  137 + good = res.data.data;
  138 + })
  139 +
  140 + item.img_url = oo.imghost + good.imgUrl;
  141 + item.erpItemID=good.erpItemID;
  142 +
  143 + /*----接口要弄出来的,先顶着-----*/
  144 + var pcid = item.pick_id;
  145 + var find = 0;
  146 + //----如果有就加进去,没有就新增一个----
  147 + //-----------循环查找门店-------------
  148 + if (arr.length > 0) {
  149 + for (var j = 0; j < arr.length; j++) {
  150 + if (arr[j].pickup_id == pcid) {
  151 + arr[j].goods.push(item);
  152 + find = 1;break;
  153 + }
  154 + }
  155 + }
  156 + //------如果没有找到-----
  157 + if (find == 0) {
  158 + var pikname = '',sto=null;
  159 + //----找到门店名称-----
  160 + for (var k = 0; k < th.data.allsto.length; k++) {
  161 + if (pcid == th.data.allsto[k].pickup_id) {
  162 + pikname = th.data.allsto[k].pickup_name; sto = th.data.allsto[k]; break;
  163 + }
  164 + }
  165 + var narr = new Array(); narr.push(item);
  166 + var ie = {
  167 + pickup_id: pcid, pname: pikname, goods: narr,keyid:sto.keyid,
  168 + goods_price: 0, shipping_price: 0, user_money: 0, total_amount: 0, order_amount: 0};
  169 + arr.push(ie);
  170 +
  171 + }
  172 + }
  173 +
  174 + //深拷贝
  175 + th.data.old_cartlist= JSON.parse(JSON.stringify(arr));
  176 + th.setData({
  177 + cartlist: arr,
  178 + });
  179 + th.calculatePrice();
  180 + }
  181 + });
  182 + },
  183 +
104 184 //-----获取立即购买的商品信息----
105 185 get_buy_goods: function (){
106 186 var th=this,a=getApp().request;
... ... @@ -147,7 +227,117 @@ Page({
147 227 invoiceToggle: !this.data.invoiceToggle
148 228 });
149 229 },
150   -
  230 +
  231 +
  232 + //-------------------计算购物车订单价格-------------------
  233 + calculatePrice: function() {
  234 + var th = this;
  235 + to.getConfig2(async function(ee){
  236 + wx.showLoading({
  237 + title:"处理中."
  238 + })
  239 + var all_price=0; //所有的商品总价
  240 + var all_shipping_m= 0; //所有的物流总价
  241 + var all_total_m = 0; //所有的订单应付总价
  242 + var all_order_m = 0; //所有的订单应付总价
  243 + var all_user_m=0; //所有的订单用户使用金额
  244 + var all_coupon_price_m=0; //所有的订单用户使用优惠券价格
  245 + var all_cutprice=0; //所有的优惠减件
  246 + var all_order_prom=0; //所有的订单优惠
  247 +
  248 + var umoney = th.data.userinfo.user_money - th.data.txmon - (th.data.userinfo.frozen_money?th.data.userinfo.frozen_money:0);
  249 + var freight_free = ee.freight_free; //全场满多少包邮
  250 + var no_ex_id=ee.no_ex_id;
  251 + var no_ex_good=null;
  252 + var by_qc={};
  253 + var c_arr=JSON.parse(JSON.stringify(th.data.old_cartlist));
  254 +
  255 + //---循环购物车---
  256 + for(var i in c_arr){
  257 +
  258 + var cart_item=c_arr[i]; //就是每一单的意思
  259 + var pickid=cart_item.pickup_id;
  260 + var o_price=0;
  261 + var o_shipping_price=0,goods_weight=-1, goods_piece=-1;
  262 + var item=c_arr[i].goods; //就是每一单的从表的意思
  263 +
  264 + //---如果有选择优惠券的情况下---
  265 + var quan_price=0;
  266 + var coupon_price=0;
  267 + var quan_no= null;
  268 +
  269 + //--------循环计算总价-----------
  270 + for(var j=0;j<item.length;j++){
  271 + o_price += item[j].money * item[j].goods_num;
  272 + }
  273 + var f_o_price=o_price;
  274 + cart_item.goods_price = f_o_price.toFixed(2); //商品总费用,用f_o_price来计算
  275 + //计算物流费用
  276 + cart_item.shipping_price = 0;
  277 +
  278 + //总价计算,总价不包含运费
  279 + cart_item.order_amount= (o_price -quan_price).toFixed(2);
  280 + cart_item.total_amount= f_o_price.toFixed(2);
  281 +
  282 + var order_prom_amount=0; var order_prom_id=0; var o_condition=cart_item.order_amount;
  283 + var order_m=0;
  284 + cart_item.order_prom_amount=0;
  285 + coupon_price=quan_price;
  286 +
  287 +
  288 + cart_item.total_amount= parseFloat(cart_item.total_amount)+parseFloat(cart_item.shipping_price); //总金额
  289 + cart_item.order_amount=parseFloat(cart_item.order_amount)+parseFloat(cart_item.shipping_price); //总金额
  290 + cart_item.total_amount= cart_item.total_amount.toFixed(2);
  291 + cart_item.order_amount=cart_item.order_amount.toFixed(2);
  292 +
  293 + //搭配购在使用余额
  294 + if(th.data.bn_use_money==1 && th.data.is_b_now==1){
  295 +
  296 + if (umoney > cart_item.order_amount) {
  297 + cart_item.user_money = cart_item.order_amount;
  298 + umoney = umoney - cart_item.order_amount;
  299 + }else {
  300 + cart_item.user_money = umoney;
  301 + umoney=0;
  302 + }
  303 +
  304 + }else{
  305 + //--------------如果使用余额,购物车购买---------------------
  306 + if (th.data.js_use_money == 1) {
  307 + if (umoney > cart_item.order_amount) {
  308 + cart_item.user_money = cart_item.order_amount;
  309 + umoney = umoney - cart_item.order_amount;
  310 + }else {
  311 + cart_item.user_money = umoney;
  312 + umoney=0;
  313 + }
  314 + }else{
  315 + cart_item.user_money=0;
  316 + }
  317 + }
  318 + all_price += parseFloat(f_o_price);
  319 + all_total_m += parseFloat(cart_item.total_amount);
  320 + all_shipping_m += parseFloat(cart_item.shipping_price);
  321 + all_order_m += parseFloat(cart_item.order_amount);
  322 + }
  323 +
  324 +
  325 + all_total_m = parseFloat(all_total_m).toFixed(2);
  326 + all_order_m = parseFloat(all_order_m).toFixed(2);
  327 + all_price = parseFloat(all_price).toFixed(2);
  328 + all_total_m = parseFloat(all_total_m).toFixed(2);
  329 +
  330 + var atxt = "formData.total_amount";
  331 + var atxt1 = "formData.order_amount";
  332 + var atxt2 = "formData.all_price";
  333 +
  334 + th.setData({ [atxt]: all_total_m, [atxt1]: all_order_m,
  335 + [atxt2]: all_price,show_submit:1
  336 + })
  337 + th.data.order_prom_list_cart=c_arr;
  338 + wx.hideLoading();
  339 + });
  340 + },
151 341  
152 342 //---------计算立即购买----------
153 343 calculatePrice2: function () {
... ... @@ -186,38 +376,73 @@ Page({
186 376 if(this.data.is_summit_ing==1) return false; //--提交中退出--
187 377 this.data.is_summit_ing=1;
188 378 var th=this,pdata=new Array();
189   - var ff=true;
  379 +
190 380 var item={
191   - 'user_id': to.globalData.user_id,
192   - 'account': th.data.formData.order_amount, //使用余额
193   - 'store_id':oo.stoid, //商家
194   - 'list':new Array(),
195   - };
196   - var gg = getApp().globalData.service_now;
197   - var goods={
198   - 'card_id': th.data.bn_goods.id,
199   - 'itemid': th.data.bn_goods.erpItemID,
200   - 'qty': gg.goods_num,
201   - 'price': th.data.formData.order_amount,
202   - 'pickup_id':gg.pick_id,
203   - 'pickup_keyid':gg.keyid,
204   - };
205   -
206   - //--导购分享过来的id--
207   - if(gg.guide_id){
208   - goods.guide_id=gg.guide_id;
209   - goods.guide_type=gg.guide_type;
210   - //调用接口判断是不是会员
211   - await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{
212   - if(res.data.code==0){
213   - goods.guide_name=res.data.data.salesman;
214   - goods.guide_sn=res.data.data.salesman_no;
215   - }
216   - })
  381 + 'user_id': to.globalData.user_id,
  382 + 'account': th.data.formData.order_amount, //使用余额
  383 + 'store_id':oo.stoid, //商家
  384 + 'list':new Array(),
  385 + };
  386 +
  387 + //判断是不是购物车购买还是立即购买
  388 + if(this.data.is_cart){
  389 + var list= th.data.cartlist;
  390 + for(var i in list){
  391 + var gglist = list[i].goods;
  392 + for(var j in gglist){
  393 + var gg=gglist[j];
  394 + var goods={
  395 + 'card_id': gg.service_id,
  396 + 'itemid': gg.erpItemID,
  397 + 'qty': gg.goods_num,
  398 + 'price': gg.money,
  399 + 'pickup_id':gg.pick_id,
  400 + 'pickup_keyid':list[i].keyid,
  401 + };
  402 + //--导购分享过来的id--
  403 + if(gg.guide_id){
  404 + goods.guide_id=gg.guide_id;
  405 + goods.guide_type=gg.guide_type;
  406 + //调用接口判断是不是会员
  407 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{
  408 + if(res.data.code==0){
  409 + goods.guide_name=res.data.data.salesman;
  410 + goods.guide_sn=res.data.data.salesman_no;
  411 + }
  412 + })
  413 + }
  414 + item.list.push(goods);
  415 + }
  416 + }
  417 + }else{
  418 +
  419 + var gg = getApp().globalData.service_now;
  420 + var goods={
  421 + 'card_id': th.data.bn_goods.id,
  422 + 'itemid': th.data.bn_goods.erpItemID,
  423 + 'qty': gg.goods_num,
  424 + 'price': th.data.formData.order_amount,
  425 + 'pickup_id':gg.pick_id,
  426 + 'pickup_keyid':gg.keyid,
  427 + };
  428 +
  429 + //--导购分享过来的id--
  430 + if(gg.guide_id){
  431 + goods.guide_id=gg.guide_id;
  432 + goods.guide_type=gg.guide_type;
  433 + //调用接口判断是不是会员
  434 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{
  435 + if(res.data.code==0){
  436 + goods.guide_name=res.data.data.salesman;
  437 + goods.guide_sn=res.data.data.salesman_no;
  438 + }
  439 + })
  440 + }
  441 + item.list.push(goods);
217 442 }
218   - item.list.push(goods);
  443 +
  444 +
219 445 pdata=item;
220   -
221 446 var str = JSON.stringify(pdata);
222 447 console.log("支付数据");
223 448 console.log(str);
... ... @@ -236,7 +461,13 @@ Page({
236 461 if (res.statusCode == 200) {
237 462 var data=res.data;
238 463 if(data.code==0){
239   -
  464 + if(th.data.is_cart){
  465 + var list = th.data.cartlist_y;
  466 + for (var i = 0; i < list.length; i++) {
  467 + //删除购物车
  468 + a.delete("/api/weshop/cartService/del/" + oo.stoid + "/" + list[i].id, {});
  469 + }
  470 + }
240 471 var order_amount = pdata.account;
241 472 //要进行判断,如果是用微信支付,就要跳转到支付界面
242 473 if (order_amount > 0) {
... ... @@ -254,7 +485,7 @@ Page({
254 485 getApp().showWarning("购买成功");
255 486 setTimeout(function () {
256 487 wx.reLaunch({
257   - url: "/packageA/pages/cardList/cardList",
  488 + url: "/pages/user/my_service/i_service",
258 489 })
259 490 },1000)
260 491 }, function () {
... ...
packageA/pages/cart2_ser/cart2_ser.wxml
1 1 <wxs module="filters" src="../../../utils/filter.wxs"></wxs>
2 2 <form bindsubmit="submitForm">
3 3 <view class="container">
4   -
  4 +
  5 + <!---------------------购物车进来,有可能多单---------------------->
  6 + <block wx:if="{{is_cart}}">
  7 + <view wx:for="{{cartlist}}" wx:for-index="pidx">
  8 + <view class="use-item bfff bdr_t-14 mgt20">
  9 + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'></image>
  10 + <!-- <view>门店:{{item.pname}}</view> -->
  11 + <view>{{item.pname}}</view>
  12 + </view>
  13 + <view class="order-detail" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items">
  14 + <!----商品图片----->
  15 + <view class="goods-img" style="position: relative">
  16 + <image wx:if="{{items.is_gift}}" src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image>
  17 + <image class="wh100 bdr14" src="{{items.img_url}}" binderror='cart_set_err' data-err='cartlist[{{pidx}}].goods[{{idx}}].img_url'></image>
  18 + </view>
  19 + <!----商品名称规格---->
  20 + <navigator class="order-cont" url="/packageA/pages/goodsInfo/goodsInfo?goods_id={{items.service_id}}">
  21 + <view class="goods-name ellipsis-2">{{items.service_name}}</view>
  22 + <!-----商品名称规格------>
  23 + <view class="order-num flex-space-between">
  24 + <view class="co-red">¥<text class="fs36">{{filters.toFix(items.money,2)}}</text></view>
  25 + <view class="goods-num">x{{items.goods_num}}</view>
  26 + </view>
  27 + </navigator>
  28 + </view>
  29 + </view>
  30 + </block>
  31 +
5 32 <!------立即购买-------->
6   - <block>
  33 + <block wx:else>
7 34 <view class="use-item bfff bdr_t-14 mgt20">
8 35 <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> <view>{{bn_pickname}}</view></view>
9 36 <view class="order-detail">
... ... @@ -24,14 +51,12 @@
24 51 </view>
25 52 </navigator>
26 53 </view>
27   - </block>
28   - <!--
29   - <view class="coupon-mes flex-vertical">
30   - <view>留言</view>
31   - <view class="leave-word">
32   - <input placeholder-class="fs28" placeholder='给商家留言,最多100字'bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="100" name="user_note"></input>
33   - </view>
34   - </view>-->
  54 + </block>
  55 +
  56 +
  57 +
  58 +
  59 +
35 60  
36 61 <view class="information bdr14">
37 62 <view class="item">
... ...
packageA/pages/goodsInfo/goodsInfo.js
... ... @@ -400,8 +400,9 @@ Page({
400 400 'data.goods_id': t.data.data.id,
401 401 'data.id': t.data.data.id,
402 402 'data.sales_sum': t.data.data.sales_sum,
403   - 'data.storageId':t.data.data.storageId
404   - });
  403 + 'data.storageId':t.data.data.storageId,
  404 + 'data.service_sn':t.data.data.serviceSn,
  405 + });
405 406  
406 407  
407 408 //-----商品详情---
... ... @@ -522,9 +523,77 @@ Page({
522 523 newd['pick_name'] = th.data.sto_sele_name;
523 524 newd['guide_id'] = getApp().globalData.guide_id;
524 525 newd['guide_type']=0;
525   -
526 526 th.buyNow(newd);
527   - }
  527 + }else{
  528 +
  529 + var newd = {
  530 + service_id: th.data.data.id,
  531 + service_sn:th.data.data.service_sn,
  532 + service_name:th.data.data.goods_name,
  533 + goods_num: th.data.goodsInputNum,
  534 + pick_id: th.data.sto_sele_id,
  535 + user_id:oo.user_id,
  536 + store_id:os.stoid,
  537 + money:th.data.data.shop_price
  538 + };
  539 + if(getApp().globalData.guide_id){
  540 + newd['guide_id'] = getApp().globalData.guide_id;
  541 + newd['guide_type']=0;
  542 + }
  543 +
  544 + //----先看会员在购物车中是否加入了该商品-----
  545 + getApp().request.get("/api/weshop/cartService/page", {
  546 + data: {
  547 + store_id: os.stoid,
  548 + user_id: oo.user_id,
  549 + service_id: th.data.data.id,
  550 + pick_id: th.data.sto_sele_id,
  551 + },
  552 + success: function(re) {
  553 +
  554 + //-------如果购物车中有相关的数据---------
  555 + if (re.data.data.total > 0) {
  556 + var item = re.data.data.pageData[0];
  557 + var updata = {
  558 + id: item.id,
  559 + goods_num: th.data.goodsInputNum + item.goods_num,
  560 + money: th.data.data.shop_price,
  561 + store_id: os.stoid,
  562 + };
  563 +
  564 + if (getApp().globalData.guide_id) {
  565 + updata['guide_id'] = getApp().globalData.guide_id;
  566 + updata['guide_type'] = 1;
  567 + }
  568 + getApp().request.put("/api/weshop/cartService/update", {
  569 + data: updata,
  570 + success: function(t) {
  571 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  572 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  573 + th.setData({
  574 + cartGoodsNum: c_num
  575 + });
  576 + th.closeSpecModal();
  577 + }
  578 + });
  579 + } else {
  580 +
  581 + getApp().request.post("/api/weshop/cartService/save", {
  582 + data: newd,
  583 + success: function(t) {
  584 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  585 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  586 + th.setData({
  587 + cartGoodsNum: c_num
  588 + });
  589 + th.closeSpecModal();
  590 + }
  591 + });
  592 + }
  593 + }
  594 + });
  595 +
  596 + }
528 597  
529 598  
530 599 },
... ... @@ -682,9 +751,26 @@ Page({
682 751 for (var i = 0; i < e.data.data.pageData.length; i++) {
683 752 num += e.data.data.pageData[i].goods_num;
684 753 }
  754 +
  755 + /*--
685 756 t.setData({
686 757 cartGoodsNum: num
687   - });
  758 + });--*/
  759 +
  760 + //-- 读取服务卡的数量 --
  761 + getApp().promiseGet("/api/weshop/cartService/page",{
  762 + data:{
  763 + store_id: s.globalData.setting.stoid,
  764 + user_id: s.globalData.user_id,
  765 + }
  766 + }).then(res=>{
  767 + for (var i = 0; i < res.data.data.pageData.length; i++) {
  768 + num += res.data.data.pageData[i].goods_num;
  769 + }
  770 + t.setData({cartGoodsNum:num});
  771 + })
  772 +
  773 +
688 774 }
689 775 });
690 776 },
... ...
packageA/pages/goodsInfo/goodsInfo.wxml
... ... @@ -76,7 +76,7 @@
76 76 <block wx:else>
77 77 <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(未找到门店)</view>
78 78 <block wx:else>
79   - <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(该门店无此项目)</view>
  79 + <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(配送不匹配)</view>
80 80 </block>
81 81 </block>
82 82  
... ... @@ -160,8 +160,8 @@
160 160 </view>
161 161  
162 162 <block>
163   - <!-- <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> -->
164   - <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn" style="width: 64%; border-radius: 56rpx;">立即购买</view>
  163 + <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>
  164 + <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view>
165 165 </block>
166 166  
167 167 </view>
... ... @@ -211,7 +211,7 @@
211 211 <block wx:else>
212 212 <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
213 213 <block wx:else>
214   - <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(该门店无此项目)</view>
  214 + <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>
215 215 <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>
216 216 </block>
217 217 </block>
... ... @@ -234,7 +234,7 @@
234 234  
235 235 <view class="spec-cart-btns">
236 236 <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add"
237   - style="background-color: #dcdcdc;color: #999;">该门店无此项目</view>
  237 + style="background-color: #dcdcdc;color: #999;">配送不匹配</view>
238 238 <block wx:else>
239 239  
240 240 <!-- 根本就找不到门店 -->
... ...
packageA/pages/hongBao/hongBao.js
... ... @@ -34,9 +34,15 @@ Page({
34 34 .then(function(data) {
35 35 self.data.hongBaoData = data.data.data;
36 36 self.countDown();
37   - self.setData({
38   - storeName: app.globalData.config.store_name
39   - });
  37 + setTimeout(function (){
  38 + if(app.globalData.config && app.globalData.config.store_name){
  39 + self.setData({
  40 + storeName: app.globalData.config.store_name
  41 + });
  42 + }
  43 +
  44 + },1000)
  45 +
40 46 });
41 47  
42 48 });
... ...
packageA/pages/libao_payment/payment.js 0 → 100644
  1 +var e = getApp();
  2 +var regeneratorRuntime = require('../../../utils/runtime.js');
  3 +Page({
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 + url: e.globalData.setting.imghost,
  9 + resourceUrl: e.globalData.setting.resourceUrl,
  10 + iurl: e.globalData.setting.imghost,
  11 + type:0
  12 + },
  13 +
  14 + /**
  15 + * 生命周期函数--监听页面加载
  16 + */
  17 + onLoad: function (options) {
  18 + wx.setNavigationBarTitle({
  19 + title: '支付成功',
  20 + });
  21 + this.setData({type:options.type});
  22 +
  23 + },
  24 +
  25 + goto: function () {
  26 + var url = '/pages/index/index/index';
  27 + getApp().goto(url)
  28 + },
  29 +})
0 30 \ No newline at end of file
... ...
packageA/pages/libao_payment/payment.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "支付成功",
  3 + "usingComponents": {}
  4 +}
0 5 \ No newline at end of file
... ...
packageA/pages/libao_payment/payment.wxml 0 → 100644
  1 +<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
  2 +<view>
  3 + <!-- 支付成功提示 -->
  4 + <view class="payradio">
  5 + <!-- 提示框 -->
  6 + <view class="Success_box flex-center">
  7 + <view>
  8 + <view class="flex-center">
  9 + <image src="{{url}}miniapp/images/pay/paysuccess.png"></image>
  10 + </view>
  11 +
  12 + <view class="show_title" wx:if="{{type==1}}">积分兑换成功,点击我的礼包查看!</view>
  13 + <view class="show_title" wx:if="{{type==2}}">购买成功,点击我的礼包查看!</view>
  14 + </view>
  15 + </view>
  16 + </view>
  17 +
  18 + <!-- 跳转链接 -->
  19 + <view>
  20 + <!-- 链接 -->
  21 + <view class="fs32">
  22 + <view class="flex-center">
  23 + <navigator class="pay_order flex-center" url="/packageA/pages/myGift/myGift?index=1">
  24 + <view>我的礼包</view>
  25 + </navigator>
  26 + </view>
  27 + <view class="flex-center">
  28 + <navigator class="pay_home flex-center" bindtap="goto">
  29 + <view>回到首页</view>
  30 + </navigator>
  31 + </view>
  32 + </view>
  33 + </view>
  34 +</view>
0 35 \ No newline at end of file
... ...
packageA/pages/libao_payment/payment.wxss 0 → 100644
  1 +page {
  2 + border-top: 2rpx solid rgb(245, 245, 245);
  3 +}
  4 +.line {
  5 + border-top: 2rpx solid rgb(245, 245, 245);
  6 + width: 700rpx;
  7 +}
  8 +
  9 +.payradio .Success_box {
  10 + padding-top: 45rpx;
  11 + padding-bottom: 45rpx;
  12 +}
  13 +
  14 +.payradio .Success_box .Success_box_title {
  15 + margin-top: 45rpx;
  16 + color: rgb(8, 8, 8);
  17 +}
  18 +
  19 +.payradio image {
  20 + width: 140rpx;
  21 + height: 140rpx;
  22 + display: flex;
  23 +}
  24 +
  25 +.payitem_max {
  26 + padding: 0rpx 55rpx;
  27 + color: rgb(104, 104, 104);
  28 + padding-bottom: 30rpx;
  29 +}
  30 +
  31 +.payitem_max .payitem {
  32 + margin-top: 30rpx;
  33 +}
  34 +
  35 +.payitem_max .payitem .pay_nam {
  36 + width: 200rpx;
  37 +}
  38 +
  39 +.payitem_max .payitem view {
  40 + margin-right: 50rpx;
  41 +}
  42 +.pay_order {
  43 + margin-top: 15rpx;
  44 + color: rgb(104, 104, 104);
  45 + width: 560rpx;
  46 + height: 62rpx;
  47 + border-radius: 30rpx;
  48 + border: 3rpx solid rgb(209, 209, 209);
  49 +}
  50 +
  51 +.pay_home {
  52 + margin-top: 35rpx;
  53 + color: rgb(255, 255, 255);
  54 + width: 566rpx;
  55 + height: 68rpx;
  56 + border-radius: 30rpx;
  57 + background-color: rgb(219, 27, 52);
  58 +}
  59 +.address{
  60 + width: 470rpx;
  61 +}
  62 +
  63 +.show_title{ margin-top: 90rpx; font-size: 34rpx;}
0 64 \ No newline at end of file
... ...
packageA/pages/myGift/myGift.js 0 → 100644
  1 +// packageA//pages/myGift/myGift.js
  2 +const app = getApp();
  3 +let self = null;
  4 +var os = app.globalData.setting;
  5 +
  6 +Page({
  7 +
  8 + /**
  9 + * 页面的初始数据
  10 + */
  11 + data: {
  12 + tabArr: ['礼包列表', '我的礼包'],
  13 + currentIndex: 0,
  14 +
  15 + list: null,
  16 + isLoading: false, // 检测是否已经发送请求,防止重复发送请求
  17 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
  18 + pageNum: 1, // 当前页数
  19 + },
  20 +
  21 + clickTab(e) {
  22 + let index = e.target.dataset.index;
  23 + let url = '';
  24 + let data = {
  25 + store_id: app.globalData.setting.stoid,
  26 + user_id: app.globalData.user_id,
  27 + };
  28 +
  29 + this.setData({
  30 + list: null,
  31 + pageNum: 1,
  32 + noMore: false,
  33 + currentIndex: index,
  34 + });
  35 +
  36 + if(index == 0) {
  37 + url = '/api/weshop/libao/libaoForm/page';
  38 + } else if(index == 1) {
  39 + url = '/api/weshop/libao/libaoFormvip/page';
  40 + };
  41 +
  42 + this.getData(true, url, data);
  43 + },
  44 +
  45 + /**
  46 + * 生命周期函数--监听页面加载
  47 + */
  48 + onLoad: function (options) {
  49 + self = this;
  50 + if(options.index){
  51 + this.setData({currentIndex:1}); //查看我的礼包
  52 + }
  53 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  54 + self.setData({
  55 + userInfo: data,
  56 + });
  57 + });
  58 + },
  59 +
  60 + /**
  61 + * 生命周期函数--监听页面初次渲染完成
  62 + */
  63 + onReady: function () {},
  64 +
  65 + /**
  66 + * 生命周期函数--监听页面显示
  67 + */
  68 + onShow: function () {
  69 + if(app.globalData.userInfo) {
  70 + if(!this.data.isLogin) {
  71 + this.setData({
  72 + userInfo: app.globalData.userInfo,
  73 + imghost: app.globalData.setting.imghost,
  74 + isLogin: true,
  75 + });
  76 +
  77 + var index=this.data.currentIndex;
  78 + let url = '';
  79 + let data = {
  80 + store_id: app.globalData.setting.stoid,
  81 + user_id: app.globalData.user_id,
  82 + };
  83 + this.setData({
  84 + list: null,
  85 + pageNum: 1,
  86 + noMore: false,
  87 + });
  88 +
  89 + if(index == 0) {
  90 + url = '/api/weshop/libao/libaoForm/page';
  91 + } else if(index == 1) {
  92 + url = '/api/weshop/libao/libaoFormvip/page';
  93 + };
  94 +
  95 + this.getData(true, url, data);
  96 + };
  97 + };
  98 + },
  99 +
  100 + /**
  101 + * 生命周期函数--监听页面隐藏
  102 + */
  103 + onHide: function () {
  104 +
  105 + },
  106 +
  107 + /**
  108 + * 生命周期函数--监听页面卸载
  109 + */
  110 + onUnload: function () {
  111 +
  112 + },
  113 +
  114 + /**
  115 + * 页面相关事件处理函数--监听用户下拉动作
  116 + */
  117 + onPullDownRefresh: function () {
  118 +
  119 + },
  120 +
  121 + /**
  122 + * 页面上拉触底事件的处理函数
  123 + */
  124 + onReachBottom: function () {
  125 + this.scrollToLower('/api/weshop/libao/libaoFormvip/page', {
  126 + store_id: app.globalData.setting.stoid,
  127 + user_id: app.globalData.user_id,
  128 + });
  129 + },
  130 +
  131 + /**
  132 + * 用户点击右上角分享
  133 + */
  134 + onShareAppMessage: function () {
  135 +
  136 + },
  137 +
  138 + /**
  139 + * 请求数据
  140 + */
  141 + getData: function(isInit, url, data) {
  142 + app.request.promiseGet(url, {
  143 + data: data,
  144 + isShowLoading: true,
  145 + })
  146 + .then(function(res) {
  147 + if(res.data.code == 0) {
  148 +
  149 + self.setData({
  150 + isLoading: false
  151 + });
  152 +
  153 + if(isInit) {// 第一次加载
  154 + self.setData({
  155 + list: res.data.data
  156 + });
  157 + } else {
  158 + self.setData({
  159 + 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData)
  160 + });
  161 + };
  162 +
  163 + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) {
  164 + self.setData({
  165 + noMore: true
  166 + });
  167 + };
  168 +
  169 + } else {
  170 + self.setData({
  171 + 'list.pageData': []
  172 + });
  173 + };
  174 +
  175 + })
  176 + .catch(function(err) {
  177 + console.log('出错拉!!!!',err);
  178 + self.setData({
  179 + 'list.pageData': []
  180 + });
  181 + });
  182 + },
  183 +
  184 +
  185 + /**
  186 + * 上拉加载
  187 + */
  188 + scrollToLower(url, requestData) {
  189 + // 数据总量
  190 + let total = this.data.list.total;
  191 + // 单页最大数据量
  192 + let pageSize = this.data.list.pageSize;
  193 + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’
  194 + if((total != 0)&&(total <= pageSize)) {
  195 + this.setData({
  196 + noMore: true
  197 + });
  198 + };
  199 +
  200 + if(!this.data.isLoading && !this.data.noMore) {
  201 + this.setData({
  202 + isLoading: true,
  203 + pageNum: this.data.pageNum + 1
  204 + });
  205 + requestData.page = this.data.pageNum;
  206 + this.getData(false, url, requestData);
  207 + };
  208 + },
  209 +
  210 + /**
  211 + * 点击跳转
  212 + */
  213 + goto(e) {
  214 + let url = '';
  215 + if(e.target.dataset.url) {
  216 + url = e.target.dataset.url;
  217 + } else {
  218 + url = e.currentTarget.dataset.url;
  219 + }
  220 + app.goto(url);
  221 + },
  222 +
  223 +
  224 + //-- 礼包购买 --
  225 + GetBuyPrice: function(e) {
  226 + var th = this,that=th;
  227 + var index=e.currentTarget.dataset.index;
  228 + var item=that.data.list.pageData[index];
  229 +
  230 + var id = item.id; //活动id
  231 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  232 + var user=getApp().globalData.userInfo;
  233 +
  234 + my_confirm.open(
  235 + "是否确定购买该礼包",
  236 + "取消",
  237 + "确定",
  238 + function() {
  239 + my_confirm.open_cancel(0);
  240 + },
  241 + function() {
  242 + my_confirm.open_cancel(0);
  243 + var json = {
  244 + "lbid": id, //活动Id
  245 + "paytype": 2, //1=积分兑换 2=购买
  246 + "store_id": os.stoid, //商家Id
  247 + "user_id": user.user_id, //用户ID
  248 + };
  249 + var url = "/api/weshop/libao/libaoFormvip/libaoOrder";
  250 + getApp().request.post(url,
  251 + {
  252 + data:json,
  253 + success:function(res) {
  254 + if (res.data.code == 0 && res.data.data) {
  255 + res = res.data.data;
  256 + wx.requestPayment({
  257 + timeStamp: String(res.timeStamp),
  258 + nonceStr: res.nonceStr,
  259 + package: res.packageValue,
  260 + signType: res.signType,
  261 + paySign: res.paySign,
  262 + success: function(res) {
  263 + getApp().my_warnning("支付成功", 1, th);
  264 + },
  265 + fail: function(res) {
  266 + getApp().my_warnning("取消支付", 0, th);
  267 + }
  268 + });
  269 + } else {
  270 + getApp().my_warnning(res.data.msg, 0, th);
  271 + }
  272 + }
  273 + })
  274 + })
  275 + },
  276 +
  277 + //-- 积分兑换 --
  278 + GetBuyIntegral: function(e) {
  279 + var th = this,that=th;
  280 + var index=e.currentTarget.dataset.index;
  281 + var item=that.data.list.pageData[index];
  282 +
  283 + var id = item.id; //活动id
  284 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  285 + var user=getApp().globalData.userInfo;
  286 + my_confirm.open(
  287 + "是否确定兑换该礼包",
  288 + "取消",
  289 + "确定",
  290 + function() {
  291 + my_confirm.open_cancel(0);
  292 + },
  293 + function() {
  294 + my_confirm.open_cancel(0);
  295 + var json = {
  296 + "lbid": id, //活动Id
  297 + "paytype": 1, //1=积分兑换 2=购买
  298 + "store_id": os.stoid, //商家Id
  299 + "user_id": user.user_id, //用户ID
  300 + };
  301 + var url = "/api/weshop/libao/libaoFormvip/libaoOrder";
  302 + getApp().request.post(url,{
  303 + data:json,
  304 + success:function(res) {
  305 + if (res.data.code == 0) {
  306 + getApp().my_warnning("兑换成功!", 1, th);
  307 + } else {
  308 + getApp().my_warnning(res.data.msg, 0, th);
  309 + }
  310 + },
  311 + })
  312 +
  313 + })
  314 + },
  315 +
  316 +})
0 317 \ No newline at end of file
... ...
packageA/pages/myGift/myGift.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "我的礼包",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "warn": "/components/long_warn/long_warn",
  6 + "nav_b": "/components/nav_b/nav_b",
  7 + "my_confirm": "/components/my_confirm/my_confirm",
  8 + "nodata": "/components/nodata/nodata"
  9 + }
  10 +}
0 11 \ No newline at end of file
... ...
packageA/pages/myGift/myGift.wxml 0 → 100644
  1 +<wxs module="filter" src="../../../utils/filter.wxs"></wxs>
  2 +<view>
  3 + <view class="tab-title" bindtap="clickTab">
  4 + <view class="tab-title-item {{currentIndex == index ? 'active':''}}" wx:for="{{tabArr}}" data-index="{{index}}">{{item}}</view>
  5 + </view>
  6 + <view class="tab-content">
  7 + <block wx:if="{{currentIndex == 0}}">
  8 + <view class="tab-item" wx:for="{{list.pageData}}">
  9 + <view bindtap="goto" data-url="{{'/packageA/pages/myGiftDetails/myGiftDetails?index=0&id=' + item.id}}">
  10 + <!-- 图片 -->
  11 + <view class="img-container"><image src="{{imghost + (item.lburl ? item.lburl:'miniapp/images/default_g_img.gif')}}" class="img" mode="widthFix"/></view>
  12 + <view class="desc-container">
  13 + <!-- 标题 -->
  14 + <view class="mgb10 ellipsis-2 lh taj">{{item.lbtitle}}</view>
  15 + <!-- 价格 -->
  16 + <view class="flex jc_sb ai-center pdb10">
  17 + <view class="flex ai-center">
  18 + <view class="c-red fs28"><text class="rmb">{{item.lbprice}}</text>/{{item.lbintegral}}积分</view>
  19 + <view class="fs22 c-a4 line-through mgl10">零售价{{item.oldprice}}</view>
  20 + </view>
  21 + <view class="fs24 c-a4">已售{{item.salenum}}件</view>
  22 + </view>
  23 + <!-- 时间 -->
  24 + <view class="date">活动截止日期 {{filter.format_time(item.expdate)}}</view>
  25 + <!-- 按钮 -->
  26 + </view>
  27 + </view>
  28 + <view class="btn-container pd20">
  29 + <view bindtap="GetBuyIntegral" data-index="{{index}}" class="btn red">立即兑换</view>
  30 + <view bindtap="GetBuyPrice" data-index="{{index}}" class="btn pink">立即购买</view>
  31 + </view>
  32 + </view>
  33 + </block>
  34 +
  35 + <block wx:else>
  36 + <view class="tab-item flex pd20" wx:for="{{list.pageData}}" bindtap="goto" data-url="{{'/packageA/pages/myGiftDetails/myGiftDetails?index=1&id=' + item.lbvipid}}">
  37 + <view class="img-container2"><image src="{{imghost + (item.lburl ? item.lburl:'miniapp/images/default_g_img.gif')}}" class="img" mode="widthFix" data-index="{{index}}"/></view>
  38 + <view class="flex fdc jc_sb">
  39 + <view>
  40 + <!-- 标题 -->
  41 + <view class="mgb10 ellipsis-2 lh taj">{{item.lbtitle}}</view>
  42 + <!-- 时间 -->
  43 + <view class="date pdb20">活动截止日期 {{filter.format_time(item.endtime)}}</view>
  44 + </view>
  45 + <!-- 说明 -->
  46 + <view class="c-red fs24">*请到线下门店兑换</view>
  47 + </view>
  48 + </view>
  49 + </block>
  50 +
  51 + <nodata nodataContainer="t-c" wx:if="{{list.pageData.length == 0}}"></nodata>
  52 + <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">—— 已经到底了 ——</view>
  53 + </view>
  54 +</view>
  55 +
  56 +<!-- 引入提示组件 -->
  57 +<warn id="warn"></warn>
  58 +<my_confirm id="my_confirm"></my_confirm>
... ...
packageA/pages/myGift/myGift.wxss 0 → 100644
  1 +@charset "utf-8";
  2 +
  3 +.c-a4 {
  4 + color: #a4a4a4;
  5 +}
  6 +
  7 +.c-red {
  8 + color: #FF6768;
  9 +}
  10 +
  11 +.h88 {
  12 + height: 88rpx;
  13 +}
  14 +
  15 +
  16 +page {
  17 + background-color: #f0f0f0;
  18 +}
  19 +
  20 +.tab-title {
  21 + display: flex;
  22 + position: sticky;
  23 + background-color: white;
  24 + top: 0;
  25 + font-size: 30rpx;
  26 + z-index: 999;
  27 +}
  28 +
  29 +.tab-title::after {
  30 + position: absolute;
  31 + content: '';
  32 + width: 2rpx;
  33 + height: 40%;
  34 + background-color: #f0f0f0;
  35 + top: 0;
  36 + bottom: 0;
  37 + left: 0;
  38 + right: 0;
  39 + margin: auto;
  40 +}
  41 +
  42 +.tab-title-item {
  43 + flex: 1;
  44 + text-align: center;
  45 + padding-top: 20rpx;
  46 + padding-bottom: 20rpx;
  47 + position: relative;
  48 +}
  49 +
  50 +.tab-title-item.active {
  51 + color: #FF6768;
  52 + font-weight: bold;
  53 +
  54 +}
  55 +
  56 +.tab-title-item::after {
  57 + position: absolute;
  58 + content: '';
  59 + left: 100%;
  60 + bottom: 0;
  61 + width: 0;
  62 + border-bottom: 2rpx solid #FF6768;
  63 + /* height: 3rpx; */
  64 + transition: 0.2s all linear;
  65 +}
  66 +
  67 +.tab-title-item.active::after {
  68 + /* left: 100%; */
  69 + width: 100%;
  70 + left: 0;
  71 + /* background-color: #FF6768; */
  72 + /* transition-delay: 0.1s; */
  73 +}
  74 +
  75 +.tab-title-item.active ~ .tab-title-item::after {
  76 + /* width: 100%; */
  77 + left: 0;
  78 +}
  79 +
  80 +.tab-content {
  81 + padding-top: 20rpx;
  82 + padding-left: 20rpx;
  83 + padding-right: 20rpx;
  84 +}
  85 +
  86 +.tab-item {
  87 + background-color: white;
  88 + border-radius: 10rpx;
  89 + overflow: hidden;
  90 +}
  91 +
  92 +.tab-item ~ .tab-item {
  93 + margin-top: 20rpx;
  94 +}
  95 +
  96 +.img-container {
  97 + background-color: #dedede;
  98 + /* height: 300rpx; */
  99 +}
  100 +
  101 +.img-container2 {
  102 + width: 200rpx;
  103 + height: 200rpx;
  104 + background-color: #dedede;
  105 + margin-right: 20rpx;
  106 + flex-shrink: 0;
  107 + display: flex;
  108 + align-items: center;
  109 + position: relative;
  110 +}
  111 +
  112 +.img-container2.error::before {
  113 + font-family: iconfont;
  114 + position: absolute;
  115 + content: '\e8c1';
  116 +}
  117 +
  118 +.img {
  119 + display: block;
  120 + width: 100%;
  121 + height: 100%;
  122 +}
  123 +
  124 +.desc-container {
  125 + padding: 20rpx;
  126 +}
  127 +
  128 +
  129 +
  130 +.rmb::before {
  131 + content: '¥';
  132 +}
  133 +
  134 +.date {
  135 + color: #a4a4a4;
  136 + font-size: 24rpx;
  137 +}
  138 +
  139 +.btn-container {
  140 + display: flex;
  141 + justify-content: space-around;
  142 + font-size: 26rpx;
  143 +}
  144 +
  145 +.btn {
  146 + padding: 20rpx;
  147 + flex: 1;
  148 + text-align: center;
  149 +}
  150 +
  151 +.btn.red {
  152 + background-color: #FF6768;
  153 + color: white;
  154 +}
  155 +
  156 +.btn.pink {
  157 + background-color: #FACAD6;
  158 + color: #FF6768;
  159 +}
  160 +
  161 +.noMore {
  162 + padding: 20rpx;
  163 + color: #bbb;
  164 + text-align: center;
  165 + font-size: 22rpx;
  166 +}
0 167 \ No newline at end of file
... ...
packageA/pages/myGiftDetails/myGiftDetails.js 0 → 100644
  1 +// packageA//pages/myGiftDetails/myGiftDetails.js
  2 +const app = getApp();
  3 +let self = null;
  4 +var os = app.globalData.setting;
  5 +
  6 +Page({
  7 +
  8 + /**
  9 + * 页面的初始数据
  10 + */
  11 + data: {
  12 + qr_code_object: {
  13 + val: "12121",
  14 + content: "请将二维码展示给核销员,服务更快捷!"
  15 + },
  16 + },
  17 +
  18 + /**
  19 + * 生命周期函数--监听页面加载
  20 + */
  21 + onLoad: function (options) {
  22 + self = this;
  23 + this.setData({
  24 + id: options.id,
  25 + index: options.index,
  26 + })
  27 +
  28 + // console.log('options', options);
  29 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  30 + self.setData({
  31 + userInfo: data,
  32 + });
  33 + });
  34 + },
  35 +
  36 + /**
  37 + * 生命周期函数--监听页面初次渲染完成
  38 + */
  39 + onReady: function () {
  40 +
  41 + },
  42 +
  43 + /**
  44 + * 生命周期函数--监听页面显示
  45 + */
  46 + onShow: function () {
  47 + if(app.globalData.userInfo) {
  48 + if(!this.data.isLogin) {
  49 + this.setData({
  50 + userInfo: app.globalData.userInfo,
  51 + imghost: app.globalData.setting.imghost,
  52 + isLogin: true,
  53 + });
  54 +
  55 + let url = '';
  56 + // let data = {
  57 + // store_id: app.globalData.setting.stoid,
  58 + // user_id: app.globalData.user_id,
  59 + // };
  60 +
  61 + if(this.data.index == 0) {
  62 + // data.lbid = this.data.id;
  63 + // 请求数据
  64 + app.request.promiseGet('/api/weshop/libao/libaoForm/page', {
  65 + data: {
  66 + store_id: app.globalData.setting.stoid,
  67 + id: this.data.id,
  68 + },
  69 + isShowLoading: true,
  70 + }).then(function(res) {
  71 + self.setData({
  72 + details: res.data.data.pageData[0],
  73 + });
  74 + });
  75 +
  76 + app.request.promiseGet('/api/weshop/libao/libaoList/page', {
  77 + data: {
  78 + store_id: app.globalData.setting.stoid,
  79 + lbid: this.data.id,
  80 + },
  81 + isShowLoading: true,
  82 + }).then(function(res) {
  83 + self.setData({
  84 + list: res.data.data.pageData,
  85 + });
  86 + });
  87 + } else if(this.data.index == 1) {
  88 + app.request.promiseGet('/api/weshop/libao/libaoFormvip/page', {
  89 + data: {
  90 + store_id: app.globalData.setting.stoid,
  91 + user_id: app.globalData.user_id,
  92 + id: this.data.id,
  93 + },
  94 + isShowLoading: true,
  95 + }).then(function(res) {
  96 + // console.log('res3-->', res);
  97 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  98 + self.setData({
  99 + details: res.data.data.pageData[0],
  100 + });
  101 + }
  102 + });
  103 +
  104 + app.request.promiseGet('/api/weshop/libao/libaoListvip/page', {
  105 + data: {
  106 + store_id: app.globalData.setting.stoid,
  107 + lbvipid: this.data.id,
  108 + },
  109 + isShowLoading: true,
  110 + }).then(function(res) {
  111 + // console.log('res4-->', res);
  112 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0) {
  113 + var list_arr=res.data.data.pageData;
  114 + for(var i in list_arr){
  115 + list_arr[i].alsonum= list_arr[i]['goods_num'] - list_arr[i]['usenum'];//剩余次数
  116 + }
  117 + self.setData({
  118 + list: res.data.data.pageData,
  119 + });
  120 + }
  121 + });
  122 + };
  123 +
  124 +
  125 + };
  126 + };
  127 + },
  128 +
  129 + /**
  130 + * 用户点击右上角分享
  131 + */
  132 + onShareAppMessage: function () {
  133 +
  134 + },
  135 +
  136 + //-- 礼包购买 --
  137 + GetBuyPrice: function(e) {
  138 + var th = this,that=th;
  139 + var item=th.data.details;
  140 + var id = item.id; //活动id
  141 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  142 + var user=getApp().globalData.userInfo;
  143 +
  144 + my_confirm.open(
  145 + "是否确定购买该礼包",
  146 + "取消",
  147 + "确定",
  148 + function() {
  149 + my_confirm.open_cancel(0);
  150 + },
  151 + function() {
  152 + my_confirm.open_cancel(0);
  153 + var json = {
  154 + "lbid": id, //活动Id
  155 + "paytype": 2, //1=积分兑换 2=购买
  156 + "store_id": os.stoid, //商家Id
  157 + "user_id": user.user_id, //用户ID
  158 + };
  159 + var url = "/api/weshop/libao/libaoFormvip/libaoOrder";
  160 + getApp().request.post(url,
  161 + {
  162 + data:json,
  163 + success:function(res) {
  164 + if (res.data.code == 0 && res.data.data) {
  165 + res = res.data.data;
  166 + wx.requestPayment({
  167 + timeStamp: String(res.timeStamp),
  168 + nonceStr: res.nonceStr,
  169 + package: res.packageValue,
  170 + signType: res.signType,
  171 + paySign: res.paySign,
  172 + success: function(res) {
  173 + getApp().my_warnning("支付成功", 1, th);
  174 + setTimeout(function (){
  175 + getApp().goto("/packageA/pages/libao_payment/payment?type=2");
  176 + },1000)
  177 + },
  178 + fail: function(res) {
  179 + getApp().my_warnning("取消支付", 0, th);
  180 + }
  181 + });
  182 + } else {
  183 + getApp().my_warnning(res.data.msg, 0, th);
  184 + }
  185 + }
  186 + })
  187 + })
  188 + },
  189 +
  190 + //-- 积分兑换 --
  191 + GetBuyIntegral: function(e) {
  192 + var th = this,that=th;
  193 + var item=th.data.details;
  194 +
  195 + var id = item.id; //活动id
  196 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  197 + var user=getApp().globalData.userInfo;
  198 + my_confirm.open(
  199 + "是否确定兑换该礼包",
  200 + "取消",
  201 + "确定",
  202 + function() {
  203 + my_confirm.open_cancel(0);
  204 + },
  205 + function() {
  206 + my_confirm.open_cancel(0);
  207 + var json = {
  208 + "lbid": id, //活动Id
  209 + "paytype": 1, //1=积分兑换 2=购买
  210 + "store_id": os.stoid, //商家Id
  211 + "user_id": user.user_id, //用户ID
  212 + };
  213 + var url = "/api/weshop/libao/libaoFormvip/libaoOrder";
  214 + getApp().request.post(url,{
  215 + data:json,
  216 + success:function(res) {
  217 + if (res.data.code == 0) {
  218 + getApp().my_warnning("兑换成功!", 1, th);
  219 + setTimeout(function (){
  220 + getApp().goto("/packageA/pages/libao_payment/payment?type=1");
  221 + },1000)
  222 + } else {
  223 + getApp().my_warnning(res.data.msg, 0, th);
  224 + }
  225 + },
  226 + })
  227 +
  228 + })
  229 + },
  230 +
  231 + //显示二维码,进行核销
  232 + show_hxm:function (e){
  233 + var th=this;
  234 + var type=e.currentTarget.dataset.type;
  235 + var data={};
  236 + data.store_id=os.stoid;
  237 + data.user_id=getApp().globalData.user_id;
  238 +
  239 + if(type && parseInt(type)==1){
  240 + data.id=this.data.id;
  241 + data.type=1;
  242 + }else{
  243 + var index=e.currentTarget.dataset.index;
  244 + var item=this.data.list[index];
  245 + data.id=item.id;
  246 + data.type=2;
  247 + }
  248 +
  249 + //获取二维码
  250 + getApp().request.get("/api/weshop/libao/libaoListvip/getLibaoCode",{
  251 + data:data,
  252 + success:function (res){
  253 + if(res.data.code==0){
  254 + th.data.qr_code_object.val=res.data.data;
  255 + var qc_com = th.selectComponent("#qrcode"); //组件的id
  256 + qc_com.open(th.data.qr_code_object)
  257 + }else{
  258 + wx.showToast({
  259 + title: res.data.msg,
  260 + icon: 'none',
  261 + duration: 2000
  262 + })
  263 +
  264 +
  265 +
  266 + }
  267 + }
  268 + })
  269 +
  270 + }
  271 +
  272 +
  273 +})
0 274 \ No newline at end of file
... ...
packageA/pages/myGiftDetails/myGiftDetails.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "礼包详情",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "warn": "/components/long_warn/long_warn",
  6 + "nav_b": "/components/nav_b/nav_b",
  7 + "my_confirm": "/components/my_confirm/my_confirm",
  8 + "qrcode":"/components/qr_code/qr_code"
  9 + }
  10 +}
0 11 \ No newline at end of file
... ...
packageA/pages/myGiftDetails/myGiftDetails.wxml 0 → 100644
  1 +<wxs module="filter" src="../../../utils/filter.wxs"></wxs>
  2 +<view class="pdb80">
  3 + <!-- 图片 -->
  4 + <view><image src="{{imghost + (details.lburl ? details.lburl:'miniapp/images/default_g_img.gif')}}" class="img" mode="widthFix"/></view>
  5 + <!-- 描述-->
  6 + <view class="desc-container">
  7 + <!-- 标题 -->
  8 + <view class="mgb10 ellipsis-2 lh taj">{{details.lbtitle}}</view>
  9 + <!-- 价格 -->
  10 + <view class="flex jc_sb ai-center pdb10">
  11 + <view class="flex ai-center">
  12 + <view class="c-red fs36"><text class="rmb">{{details.lbprice}}</text>/{{details.lbintegral}}积分</view>
  13 + <view class="fs22 c-a4 line-through mgl10">零售价{{details.oldprice}}</view>
  14 + </view>
  15 + <view class="fs24 c-a4">已售{{details.salenum}}件</view>
  16 + </view>
  17 + <!-- 时间 -->
  18 + <view class="date">活动截止日期 {{details.expdate ? filter.format_time(details.expdate):filter.format_time(details.endtime)}}</view>
  19 + </view>
  20 + <!-- 单品 -->
  21 + <view class="goods-container">
  22 + <view class="pd20 bold bdb">可到线下门店兑换以下单品</view>
  23 + <view wx:if="{{index==1 && details.codetype==1}}" class="">
  24 + <view class="flex pd20 jc_sb">
  25 + <view style="width: 35%">单品名称</view>
  26 + <view style="width: 25%;text-align: center">总数量</view>
  27 + <view style="width: 25%;text-align: center">剩余数量</view>
  28 + <view style="width: 15%;"></view>
  29 + </view>
  30 + <view class="flex pd20 jc_sb" wx:for="{{list}}">
  31 + <view style="width: 35%">{{item.goods_name}}</view>
  32 + <view style="width: 25%;text-align:center" class="c-a4">x{{item.goods_num}}</view>
  33 + <view style="width: 25%;text-align:center" class="c-a4">x{{item.alsonum}}</view>
  34 + <view bindtap="show_hxm" data-index="{{index}}" style="width: 15%;text-align: center" wx:if="{{item.alsonum>0}}" >
  35 + <text class="ling_btn">使用</text>
  36 + </view>
  37 + <view style="width: 15%;text-align: center" wx:else >
  38 + <text class="ling_btn c_a">已领</text>
  39 + </view>
  40 + </view>
  41 + </view>
  42 +
  43 +
  44 + <view wx:else class="">
  45 + <view class="flex pd20 jc_sb">
  46 + <view>单品名称</view>
  47 + <view>数量</view>
  48 + </view>
  49 + <view class="flex pd20 jc_sb" wx:for="{{list}}">
  50 + <view>{{item.goods_name}}</view>
  51 + <view class="c-a4">x{{item.goods_num}}</view>
  52 + </view>
  53 + </view>
  54 + </view>
  55 +
  56 + <!-- 按钮 -->
  57 + <view class="btn-container">
  58 + <block wx:if="{{index == 0}}">
  59 + <view bindtap="GetBuyIntegral" class="btn red">立即兑换</view>
  60 + <view bindtap="GetBuyPrice" class="btn pink">立即购买</view>
  61 + </block>
  62 + <view wx:else bindtap="show_hxm" data-type="1" class="btn red">立即使用</view>
  63 + </view>
  64 +</view>
  65 +
  66 +<!-- 引入提示组件 -->
  67 +<warn id="warn"></warn>
  68 +<my_confirm id="my_confirm"></my_confirm>
  69 +<qrcode id="qrcode" ></qrcode>
  70 +
... ...
packageA/pages/myGiftDetails/myGiftDetails.wxss 0 → 100644
  1 +@charset "utf-8";
  2 +
  3 +.c-a4 {
  4 + color: #a4a4a4;
  5 +}
  6 +
  7 +.c-red {
  8 + color: #FF6768;
  9 +}
  10 +
  11 +page {
  12 + background-color: #f0f0f0;
  13 +}
  14 +
  15 +.pdb80 {
  16 + padding-bottom: 80rpx;
  17 +}
  18 +
  19 +.img-container {
  20 + background-color: #dedede;
  21 +}
  22 +
  23 +.img {
  24 + display: block;
  25 + width: 100%;
  26 +}
  27 +
  28 +
  29 +.desc-container {
  30 + padding: 20rpx;
  31 + background-color: white;
  32 +}
  33 +
  34 +
  35 +.rmb::before {
  36 + content: '¥';
  37 +}
  38 +
  39 +
  40 +.date {
  41 + color: #a4a4a4;
  42 + font-size: 24rpx;
  43 +}
  44 +
  45 +
  46 +.goods-container {
  47 + margin-top: 20rpx;
  48 + background-color: white;
  49 + font-size: 28rpx;
  50 +}
  51 +
  52 +
  53 +
  54 +
  55 +
  56 +
  57 +.btn-container {
  58 + position: fixed;
  59 + width: 100%;
  60 + bottom: 0;
  61 + display: flex;
  62 + font-size: 30rpx;
  63 +}
  64 +
  65 +.btn {
  66 + padding: 20rpx;
  67 + flex: 1;
  68 + text-align: center;
  69 +}
  70 +
  71 +.btn.red {
  72 + background-color: #FF6768;
  73 + color: white;
  74 +}
  75 +
  76 +.btn.pink {
  77 + background-color: #FACAD6;
  78 + color: #FF6768;
  79 +}
  80 +
  81 +.ling_btn{ background: #c0283a; color: #fff; width: 100rpx; height: 50rpx;
  82 + display: inline-block; line-height: 50rpx; border-radius: 10rpx}
  83 +
  84 +.ling_btn.c_a{ background: darkgrey}
0 85 \ No newline at end of file
... ...
packageA/pages/my_service/i_service.js
... ... @@ -50,11 +50,8 @@ Page({
50 50 */
51 51 onShow: function() {
52 52 var th = this;
53   - setTimeout(function (){
54   - var my_confirm = th.selectComponent("#my_confirm"); //组件的id
55   - my_confirm.open_cancel(0);
56   - },1000);
57   -
  53 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  54 + my_confirm.open_cancel(0);
58 55 },
59 56  
60 57 onReachBottom: function() {
... ...
packageA/pages/my_service2/appment_main.js 0 → 100644
  1 +var e = getApp(),
  2 + a = e.globalData.setting,
  3 + os = a,
  4 + t = e.request,
  5 + d = e.globalData;
  6 +Page({
  7 +
  8 + /**
  9 + * 页面的初始数据
  10 + */
  11 + data: {
  12 + inurl: a.url, //接口网址
  13 + iurl: a.imghost, //服务器网址
  14 + store: 0, //是否显示服务门店列表
  15 + beautician: 0, //是否显示美容师列表
  16 + beautician_name: "", //选中的美容师名称
  17 + beauticianID: "", //美容师id
  18 + bea_index: "", //美容师列表下标
  19 + placeholder: "填写备注", //备注为空的placeholder
  20 + store_list: [], //门店列表
  21 + beautician_list: [], //美容师列表
  22 + store_name: "", //选择的服务门店
  23 + fir_pick_index: 0, //选择的门店下标
  24 + curpage: 1, //当前分页数
  25 + pageSize: 8, //页大小
  26 + total: 0,
  27 + ismore: 0, //是否加载完毕
  28 + itemId: "", //服务id
  29 + project_id: "", //项目id
  30 + isScroll: true, //scroll-y是否可以滑动
  31 + key_word: "", //是否按门店文字查询
  32 + is_service_read: 0, //是否调用过门店接口
  33 + is_search: 0, //是否通过key_word调用接口
  34 + is_success: 0, //是否提交成功
  35 + remarks: "", //备注
  36 + storageId: "", //线下门店id
  37 + url: "/packageA/pages/my_service/appment_main", //本页面地址路径用于选择时间页面跳转回来
  38 + buyType: "", //项目类型
  39 + time: "", //选择预约时间
  40 + tment_count: "", //可预约人数
  41 + lat: "", //纬度坐标
  42 + lon: "", //经度坐标
  43 + is_gps: 1, //是否开启gps
  44 + validay: "", //服务项目有效期
  45 + is_sub: 0, //判断是否重复提交
  46 + is_textea: 1, //备注是否是可输入
  47 +
  48 + // 拖拽参数
  49 + writePosition: [], //默认定位参数
  50 + writesize: [0, 0],// X Y 定位
  51 + window: [0, 0], //屏幕尺寸
  52 + write: [0, 0], //定位参数
  53 + scrolltop: 0,//据顶部距离
  54 + v:{},
  55 +
  56 + project: ['项目1', '项目2', '项目3', '项目4', '项目5', '项目6', '项目7'],
  57 + md: [{name:'美导1',time:'08:30-22:00'},{name:'美导2',time:'09:30-18:00'},],
  58 + timeList: [],
  59 + deltaX: 0,
  60 + col_arr:[],
  61 + },
  62 + //控制备注输入
  63 + check_text: function() {
  64 + var th = this;
  65 + var is_textea = th.data.is_textea;
  66 + th.setData({
  67 + is_textea: 1,
  68 + beautician: 0
  69 + })
  70 + },
  71 + onclickstore: function() {
  72 + var th = this;
  73 + var store = th.data.store;
  74 + if (store) {
  75 + th.setData({
  76 + store: 0,
  77 + is_textea: 1
  78 + })
  79 + } else {
  80 + th.setData({
  81 + beautician: 0,
  82 + store: 1,
  83 + is_textea: 0
  84 + })
  85 + if (th.data.store_list.length < 1) {
  86 + wx.showLoading({
  87 + title: '加载中',
  88 + })
  89 + th.query_store();
  90 + }
  91 + }
  92 + },
  93 + //输入的备注
  94 + input_remarks: function(e) {
  95 + var remarks = e.detail.value;
  96 + this.setData({
  97 + remarks: remarks
  98 + })
  99 + },
  100 + //提交成功及发送模版代码
  101 + success: function() {
  102 + var th = this;
  103 + var store = th.data.store_name; //门店名称
  104 + var bea_name = th.data.beautician_name; //美容师名称
  105 + var time = th.data.time; //预约时间
  106 + var is_sub = th.data.is_sub; //是否重复提交
  107 + var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/insert"; //接口路径
  108 + var serviceId = th.data.itemId; //服务id
  109 + var beauticianID = th.data.beauticianID; //美容师id
  110 + var buyType = th.data.buyType; //服务项目类型
  111 + var storeId = a.stoid; //商家id
  112 + var storageId = th.data.storageId; //门店id
  113 + var userId = th.data.options.userid; //用户id
  114 + var remarks = th.data.remarks; //用户备注
  115 + var project_id = th.data.project_id; //项目id
  116 + var validay = th.data.validay;
  117 + var json = {
  118 + "arrangeTime": time + ":00",
  119 + "beauticianId": beauticianID,
  120 + "buyType": buyType,
  121 + "effectiveDay": "",
  122 + "number": "",
  123 + "projectId": project_id,
  124 + "remark": remarks,
  125 + "serviceId": serviceId,
  126 + "states": 0,
  127 + "storageId": storageId,
  128 + "storeId": storeId,
  129 + "userId": userId,
  130 + "validay": validay,
  131 + "isxz": 1
  132 +
  133 + }
  134 + var data = JSON.stringify(json);
  135 + wx.request({
  136 + url: url,
  137 + data: json,
  138 + method: 'post',
  139 + header: {
  140 + 'content-type': 'application/json'
  141 + }, // 设置请求的 header
  142 + success: function(res) {
  143 + th.setData({
  144 + is_sub: 0
  145 + })
  146 + wx.hideLoading();
  147 + if (res.data.code == 0) {
  148 + getApp().my_warnning("预约成功", 1, th);
  149 + // var store_name = th.data.store_name; //预约门店
  150 + var number = res.data.data.Number;
  151 + // var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口
  152 + //var userinfo = getApp().globalData.userInfo;
  153 + //var name = d.userInfo.nickname;
  154 + // var json = {
  155 + // // "formId": formid,
  156 + // "keyWord": [{
  157 + // "keyword": res.data.data.ServiceName
  158 + // },
  159 + // {
  160 + // "keyword": time.substring(0, 16)
  161 + // }, {
  162 + // "keyword": res.data.data.BeauticianName
  163 + // }, {
  164 + // "keyword": res.data.data.StorageName
  165 + // }, {
  166 + // "keyword": res.data.data.Address
  167 + // }
  168 + // ],
  169 + // "page": "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+th.data.options.userid,
  170 + // "storeId": a.stoid,
  171 + // "typeId": "1011",
  172 + // "userId": th.data.options.userid
  173 + // };
  174 + // var data = JSON.stringify(json);
  175 + // //调用发送预约成功模版接口
  176 + // wx.request({
  177 + // url: th.data.inurl + temp_url,
  178 + // data: data,
  179 + // method: 'post',
  180 + // header: {
  181 + // 'content-type': 'application/json'
  182 + // }, // 设置请求的 header
  183 + // success: function(data) {}
  184 + // })
  185 +
  186 + wx.redirectTo({
  187 + url: "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+th.data.options.userid,
  188 + });
  189 +
  190 + } else {
  191 + getApp().my_warnning(res.data.msg, 0, th);
  192 + th.settime();
  193 + }
  194 + }
  195 + })
  196 +
  197 + },
  198 + //定时显示texteat
  199 + settime: function() {
  200 + var th = this;
  201 + setTimeout(function() {
  202 + th.setData({
  203 + is_textea: 1
  204 + })
  205 + }, 2000);
  206 + },
  207 + //提交预约
  208 + sub_success: function(e) {
  209 + var th = this;
  210 + var temp_url = th.data.inurl + "/api/wx/weappSendlist/page";
  211 + var template_id = "";
  212 + if (th.data.is_sub == 1) {
  213 + return false;
  214 + }
  215 + var store = th.data.store_name; //门店名称
  216 + var bea_name = th.data.beautician_name; //美容师名称
  217 + var time = th.data.time; //预约时间
  218 + var is_sub = th.data.is_sub; //是否重复提交
  219 + th.setData({
  220 + is_textea: 0,
  221 + is_sub: 1
  222 + })
  223 + //提交预约前的判断
  224 + if (store == "") {
  225 + getApp().my_warnning("请选择服务门店", 0, th);
  226 + th.setData({
  227 + is_sub: 0
  228 + })
  229 + th.settime();
  230 + return false;
  231 + } else if (bea_name == "") {
  232 + getApp().my_warnning("请选择美容师", 0, th);
  233 + th.setData({
  234 + is_sub: 0
  235 + })
  236 + th.settime();
  237 + return false;
  238 + } else if (time == undefined || time == '') {
  239 + getApp().my_warnning("请选择预约时间", 0, th);
  240 + th.setData({
  241 + is_sub: 0
  242 + })
  243 + th.settime();
  244 + return false;
  245 + } else {
  246 + var version ="";
  247 + //判断微信版本是否达到预约成功订阅的要求
  248 + wx.getSystemInfo({
  249 + success(res) {
  250 + version = res.version;
  251 + }
  252 + })
  253 + wx.showLoading({
  254 + title: '加载中',
  255 + })
  256 +
  257 + th.success();
  258 + // if (th.ver(version, '7.0.4') >= 0) {
  259 + // //获取模版id
  260 + // getApp().request.promiseGet(temp_url, {
  261 + // data: {
  262 + // store_id: a.stoid,
  263 + // typeid: "1011"
  264 + // }
  265 + // }).then(res => {
  266 + // if (res.data.code == 0 && res.data.data.pageData.length > 0) {
  267 + // template_id = res.data.data.pageData[0].template_id;
  268 + // // //授权订阅
  269 + // wx.requestSubscribeMessage({
  270 + // tmplIds: [template_id],
  271 + // success(res) {
  272 + // th.success();
  273 + // },
  274 + // fail(res) {
  275 + // th.success();
  276 + // }
  277 + // })
  278 + // } else {
  279 + // th.success();
  280 + // }
  281 + // })
  282 + // } else {
  283 + // // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
  284 + // wx.showModal({
  285 + // title: '提示',
  286 + // content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
  287 + // })
  288 + // th.setData({
  289 + // is_sub: 0
  290 + // })
  291 + // }
  292 +
  293 + }
  294 + },
  295 + //版本判断
  296 + ver:function(v1,v2){
  297 + v1 = v1.split('.')
  298 + v2 = v2.split('.')
  299 + var num1 = "" ;
  300 + var num2 = "";
  301 + var len = Math.max(v1.length, v2.length)
  302 +
  303 + while (v1.length < len) {
  304 + v1.push('0')
  305 + }
  306 + while (v2.length < len) {
  307 + v2.push('0')
  308 + }
  309 +
  310 + for (let i = 0; i < len; i++) {
  311 + num1 = parseInt(v1[i])
  312 + num2 = parseInt(v2[i])
  313 +
  314 + if (num1 > num2) {
  315 + return 1
  316 + } else if (num1 < num2) {
  317 + return -1
  318 + }
  319 + }
  320 + return 0
  321 + },
  322 + goto: function(e) {
  323 + var th = this;
  324 + th.setData({
  325 + beautician: 0,
  326 + is_textea: 0
  327 + })
  328 + if (th.data.store_name == "") {
  329 + getApp().my_warnning("请选择服务门店", 0, th);
  330 + th.settime();
  331 + } else if (th.data.beautician_name == "") {
  332 + getApp().my_warnning("请选择美容师", 0, th);
  333 + th.settime();
  334 + } else {
  335 + th.setData({
  336 + is_textea: 1
  337 + })
  338 + var url = e.currentTarget.dataset.url;
  339 + getApp().goto(url);
  340 + }
  341 + },
  342 + //点击选择门店
  343 + choose_for_store: function(e) {
  344 + var th = this;
  345 + var index_c = e.currentTarget.dataset.ind;
  346 + var fir_pick_index = th.data.fir_pick_index;
  347 + //判断是否点击选中的门店,防止重复点击重复设置选中下标
  348 + if (index_c == fir_pick_index) {
  349 + return false;
  350 + } else {
  351 + th.setData({
  352 + fir_pick_index: index_c,
  353 + beautician_name: "",
  354 + time: "",
  355 + tment_count: ""
  356 + })
  357 + }
  358 + },
  359 + //确认选择门店
  360 + choice_store: function() {
  361 + var th = this;
  362 + var index = th.data.fir_pick_index;
  363 + var store_name = th.data.store_list[index].StorageName;
  364 + var Id = th.data.store_list[index].Id;
  365 + th.setData({
  366 + store: 0,
  367 + store_name: store_name,
  368 + storageId: Id,
  369 + is_textea: 1
  370 + })
  371 + },
  372 + onReachBottom: function() {
  373 + var th = this;
  374 + if (this.data.total <= th.data.pageSize) return;
  375 + if (this.data.ismore) return;
  376 +
  377 + wx.showLoading({
  378 + title: '加载中...',
  379 + })
  380 + th.query_store();
  381 + },
  382 + //分页查询门店信息
  383 + query_store: function() {
  384 + var th = this;
  385 + th.setData({
  386 + is_textea: 0
  387 + })
  388 + var itemId = th.data.itemId; //服务id
  389 + var url = "/api/weshop/marketing/reservation/storage/pagenew";
  390 + var key_word = th.data.key_word;
  391 + key_word = key_word.replace(/\s+/g, "");
  392 + getApp().request.promiseGet(url, {
  393 + data: {
  394 + userId: th.data.options.userid,
  395 + storeId: a.stoid,
  396 + serviceId: itemId,
  397 + latitude: th.data.lat,
  398 + longitude: th.data.lon,
  399 + page: th.data.curpage,
  400 + pageSize: th.data.pageSize,
  401 + keyWord: key_word
  402 + }
  403 + }).then(res => {
  404 + wx.hideLoading();
  405 + if (res.data.code == 0) {
  406 + th.data.curpage++;
  407 + var arr1 = th.data.store_list;
  408 + var arr2 = res.data.data.pageData;
  409 + var arr3 = [...arr1, ...arr2];
  410 + var ismore = 0;
  411 + if (arr3.length == res.data.data.total) ismore = 1
  412 + th.setData({
  413 + store_list: arr3,
  414 + total: res.data.data.total,
  415 + ismore: ismore,
  416 + is_service_read: 1,
  417 + }), wx.stopPullDownRefresh(); //停止下拉刷新
  418 + if (key_word != "" && res.data.data.pageData.length < 1) {
  419 + th.setData({
  420 + is_search: 1
  421 + })
  422 + }
  423 + } else {
  424 + getApp().my_warnning(res.data.msg, 0, th);
  425 + th.settime();
  426 + }
  427 + })
  428 + },
  429 + //查询
  430 + query_beautician: function() {
  431 + var th = this;
  432 + th.setData({
  433 + is_textea: 0
  434 + });
  435 +
  436 + if (th.data.store_name == "") {
  437 + getApp().my_warnning("请选择服务门店", 0, th);
  438 + th.settime();
  439 + } else {
  440 + wx.showLoading({
  441 + title: '加载中',
  442 + })
  443 + var itemid = th.data.itemId; //正式使用的项目id
  444 + var storageId = th.data.storageId; //正式使用的线下门店id
  445 + var url = "/api/weshop/marketing/reservation/staff/pagenew"; //接口地址
  446 +
  447 + getApp().request.promiseGet(url, {
  448 + data: {
  449 + storeId: a.stoid,
  450 + userId: th.data.options.userid,
  451 + serviceId: itemid,
  452 + storageId: storageId
  453 + }
  454 + }).then(res => {
  455 + wx.hideLoading();
  456 + if (res.data.code == 0) {
  457 + th.setData({
  458 + beautician_list: res.data.data
  459 + })
  460 + if (res.data.data.length < 1) {
  461 + getApp().my_warnning("暂无美容师", 0, th);
  462 + th.settime();
  463 + } else {
  464 + if (th.data.beautician == 0) {
  465 + th.setData({
  466 + beautician: 1,
  467 + })
  468 + } else {
  469 + th.setData({
  470 + beautician: 0,
  471 + })
  472 + }
  473 + }
  474 + } else {
  475 + getApp().my_warnning(res.data.msg, 0, th);
  476 + th.settime();
  477 + }
  478 + })
  479 + }
  480 + },
  481 +
  482 + choice_beautician: function(e) {
  483 + var th = this;
  484 + var bea_index = e.currentTarget.dataset.baaindex;
  485 + var bea_name = th.data.beautician_list[bea_index].StaffName;
  486 + var BeauticianID = th.data.beautician_list[bea_index].staffid;
  487 + var StorageId=th.data.beautician_list[bea_index].StorageId
  488 +
  489 + th.setData({
  490 + beautician_name: bea_name,
  491 + beautician: 0,
  492 + bea_index: bea_index,
  493 + beauticianID: BeauticianID,
  494 + time: "",
  495 + tment_count: "",
  496 + is_textea: 1,
  497 + StorageId:StorageId
  498 + })
  499 +
  500 + },
  501 + //获取搜索门店输入的值
  502 + input_store: function(e) {
  503 + this.setData({
  504 + key_word: e.detail.value
  505 + })
  506 + },
  507 + //搜索门店
  508 + search_store: function() {
  509 + var th = this;
  510 + var key_word = th.data.key_word;
  511 + var store_list = th.data.store_list;
  512 + th.setData({
  513 + curpage: 1,
  514 + is_search: 0,
  515 + store_list: []
  516 + })
  517 + wx.showLoading({
  518 + title: '加载中',
  519 + })
  520 + th.query_store();
  521 + },
  522 + //美容师预约跳转页面
  523 + nav_bea: function() {
  524 + var th = this;
  525 + th.setData({
  526 + beautician: 0
  527 + })
  528 + var storageId = th.data.storageId; //线下门店id
  529 + var itemId = th.data.itemId; //服务id
  530 + var project_id = th.data.project_id;
  531 + if (storageId == "") {
  532 + getApp().my_warnning("请选择服务门店", 0, th);
  533 + th.settime();
  534 + } else {
  535 + th.setData({
  536 + is_textea: 1
  537 + })
  538 + console.log('optionsxxx===>', this.data.options);
  539 + // console.log('1-->', "/pages/user/my_service/cosmetology_list?userid=" + th.data.options.userid + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id);
  540 + wx.navigateTo({
  541 + url: "/packageA/pages/my_service/cosmetology_list?userid=" + this.data.options.userid + '&storageId=' + storageId + '&itemId=' + itemId + "&projectId=" + project_id
  542 + });
  543 +
  544 + }
  545 + },
  546 + /**
  547 + * 生命周期函数--监听页面加载
  548 + */
  549 + onLoad: function(options) {
  550 +
  551 + this.getTimeList(23, 30);
  552 + var th = this;
  553 + th.setData({
  554 + options,
  555 + itemId: options.service_id,
  556 + buyType: options.BuyType,
  557 + project_id: options.ProjectID,
  558 + validay: options.Validay
  559 + });
  560 + wx.getLocation({
  561 + type: 'gcj02',
  562 + success: function(res) {
  563 + th.data.lat = res.latitude;
  564 + th.data.lon = res.longitude;
  565 + th.data.is_get_local_ok = 1;
  566 + th.setData({
  567 + is_gps: 1
  568 + });
  569 + },
  570 + fail: function(res) {
  571 + if (res.errCode == 2) {
  572 + th.setData({
  573 + is_gps: 0
  574 + });
  575 + if (th.data.is_gps == 0) {
  576 + getApp().confirmBox("请开启GPS定位", null, 25000, !1);
  577 + th.settime();
  578 + }
  579 + } else {
  580 + th.setData({
  581 + is_gps: "3"
  582 + });
  583 + }
  584 +
  585 + th.data.is_get_local_ok = 1;
  586 + }
  587 + });
  588 +
  589 + // 获取当前默认导购信息及归属门店信息
  590 + if(options.firstleader) {
  591 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+a.stoid+"/"+options.firstleader,{}).then(res=>{
  592 + if(res.data.code==0){
  593 + getApp().globalData.guide_id=res.data.data.id;
  594 +
  595 + getApp().request.promiseGet('/api/weshop/shoppingGuide/geIdStaffInfo', {
  596 + data: {
  597 + store_id: a.stoid,
  598 + guide_id: e.globalData.guide_id,
  599 + UserCode: th.data.options.usercode,
  600 + }
  601 + }).then(res => {
  602 + console.log('res==>', a.stoid, e.globalData.guide_id, th.data.options.usercode);
  603 + if(res.data.data.Tech) {
  604 +
  605 + var data={
  606 + store_name: res.data.data.StorageName,
  607 + beautician_name: res.data.data.StaffName,
  608 + beauticianID: res.data.data.StaffId,
  609 + StorageId: res.data.data.StorageId,
  610 + }
  611 + th.check_firleader(data);
  612 + }
  613 + });
  614 +
  615 +
  616 + };
  617 + });
  618 + };
  619 +
  620 +
  621 + },
  622 + //查询剩下可预约人数
  623 + query_more: function() {
  624 + var th = this;
  625 + var url = "/api/weshop/marketing/reservation/can/reservation/countnew";
  626 + var beauticianID = th.data.beauticianID; //美容师id
  627 + var projectID = th.data.itemId; //服务id
  628 + var seekTime = th.data.time; //预约日期
  629 + var storageId = th.data.storageId; //门店id
  630 + var storeId = a.stoid; //商家id
  631 + getApp().request.promiseGet(url, {
  632 + data: {
  633 + beauticianId: beauticianID,
  634 + seekTime: seekTime,
  635 + serviceId: projectID,
  636 + storageId: storageId,
  637 + storeId: storeId
  638 + }
  639 + }).then(res => {
  640 + if (res.data.code == 0) {
  641 + var tment_count = res.data.data.CanReservation;
  642 + th.setData({
  643 + tment_count: tment_count
  644 + })
  645 + } else {
  646 + getApp().my_warnning(res.data.msg, 0, th);
  647 + th.settime();
  648 + }
  649 + })
  650 +
  651 + },
  652 + /**
  653 + * 生命周期函数--监听页面显示
  654 + */
  655 + onShow: function() {
  656 + var th = this;
  657 + var seekTime = th.data.time; //预约日期
  658 + if (seekTime != "") {
  659 + th.query_more();
  660 + }
  661 + th.setData({
  662 + time: th.data.time.substring(0, 16),
  663 + is_textea: 1
  664 + })
  665 + th.query_project();
  666 +
  667 + th.queryMultipleNodes();
  668 + },
  669 + //获取单个服务项目信息
  670 + query_project: function() {
  671 + var th = this;
  672 + var url = "/api/weshop/marketing/reservation/sm/page"; //获取服务项目接口
  673 + var project_id = th.data.project_id; //服务项目id
  674 + getApp().request.promiseGet(url, {
  675 + data: {
  676 + storeId: a.stoid,
  677 + userId: th.data.options.userid,
  678 + projectId: project_id
  679 + }
  680 + }).then(res => {
  681 + if (res.data.code == 0) {
  682 + th.setData({
  683 + validay: res.data.data.pageData[0].Validay
  684 + })
  685 + } else {
  686 + getApp().my_warnning(res.data.msg, 0, th);
  687 + th.settime();
  688 + }
  689 + })
  690 + },
  691 + //关闭导航
  692 + // close: function() {
  693 + // var th = this;
  694 + // var nav_b = th.selectComponent("#nav_b"); //组件的id
  695 + // nav_b.close_box();
  696 + // }
  697 +
  698 + //判断分享的导购是不是有门店,是不是该门店下又该会员
  699 + check_firleader(data){
  700 + var th=this;
  701 + var itemId = this.data.itemId; //服务id
  702 + var url = "/api/weshop/marketing/reservation/storage/pagenew";
  703 + var key_word = data.store_name;
  704 + key_word = key_word.replace(/\s+/g, "");
  705 + getApp().request.promiseGet(url, {
  706 + data: {
  707 + userId: th.data.options.userid,
  708 + storeId: os.stoid,
  709 + serviceId: itemId,
  710 + latitude: th.data.lat,
  711 + longitude: th.data.lon,
  712 + page: 1,
  713 + pageSize: 1000,
  714 + keyWord: key_word
  715 + }
  716 + }).then(res => {
  717 + //-- 如果是门店的话 --
  718 + if (res.data.code == 0 && res.data.data && res.data.data.pageData) {
  719 + var store_data=null;
  720 + for(var i in res.data.data.pageData){
  721 + var it=res.data.data.pageData[i];
  722 + if(it.Id==data.StorageId){
  723 + store_data={
  724 + store_name: data.store_name,
  725 + StorageId: data.StorageId,
  726 + };
  727 + break;
  728 + }
  729 + }
  730 + if(!store_data) return false;
  731 + th.setData(store_data)
  732 +
  733 + }else{
  734 + return false;
  735 + }
  736 +
  737 + //导购接口地址
  738 + var url = "/api/weshop/marketing/reservation/staff/pagenew";
  739 + return getApp().request.promiseGet(url, {
  740 + isShowLoading:1,
  741 + data: {
  742 + storeId: os.stoid,
  743 + userId: th.data.options.userid,
  744 + serviceId: itemId,
  745 + storageId: data.StorageId
  746 + }
  747 + })
  748 + }).then(res=>{
  749 + if (res && res.data && res.data.code == 0) {
  750 + var beautician_list=res.data.data;
  751 + for(var i in beautician_list){
  752 + var item=beautician_list[i];
  753 + if(item.staffid==data.beauticianID){
  754 + th.setData({
  755 + beautician_name:data.beautician_name,
  756 + beauticianID:data.beauticianID,
  757 + })
  758 + break;
  759 + }
  760 + }
  761 +
  762 + }
  763 + })
  764 + },
  765 +
  766 +
  767 + //开始拖拽
  768 + touchmove: function (e) {
  769 + if(!this.data.copy_btn) return false;
  770 + var that = this;
  771 + var position = [e.touches[0].pageX + this.data.deltaX-15, e.touches[0].pageY-15];
  772 + that.setData({
  773 + write: position
  774 + });
  775 + },
  776 + touchend:function(e){
  777 + var that = this,th=that;
  778 + if(!that.data.copy_btn) return false;
  779 + var position =th.data.write;
  780 + var arr=th.data.col_arr;
  781 + for(var i=0;i<this.data.md.length;i++){//i是列
  782 + var item=this.data.md[i];
  783 + var nd=new Date();
  784 + var d_str=nd.getFullYear()+"-"+(nd.getMonth()+1)+"-"+nd.getDate()+" ";
  785 + var d_arr=item.time.split("-");
  786 + var t1=new Date(d_str+d_arr[0])
  787 + var t2=d_arr.length>1?new Date(d_str+d_arr[1]):0;
  788 +
  789 + for(var j=0; j<this.data.timeArr.length;j++){//j是行
  790 + if(arr.indexOf(j)!=-1) continue;
  791 + var tn=new Date(d_str+this.data.timeArr[j]);
  792 + //小于开始时间
  793 + if(tn<t1) continue;
  794 + //大于结束时间
  795 + if(tn>t2 && t2>0) continue;
  796 + //如果坐标在网格内
  797 + if( position[0]>th.data.f_x+i*th.data.f_width && position[0]<th.data.f_x+ (i+1)*th.data.f_width &&
  798 + position[1]>th.data.f_y +j*th.data.f_hei && position[1]<th.data.f_y+(j+1)*th.data.f_hei){
  799 +
  800 + var txt="v["+i+"]["+j+"]";
  801 + arr.push(j);
  802 + th.setData({
  803 + [txt]: th.data.projectName,
  804 + col_arr:arr
  805 + });
  806 + break;
  807 + }
  808 +
  809 + }
  810 + }
  811 + th.setData({copy_btn:0})
  812 + },
  813 +
  814 +
  815 + close_this:function (e){
  816 + var txt=e.currentTarget.dataset.txt;
  817 + var sindex=parseInt(e.currentTarget.dataset.sindex);
  818 + var arr=this.data.col_arr;
  819 + var ind=arr.indexOf(sindex);
  820 + arr.splice(ind,1)
  821 + this.setData({[txt]:null,col_arr:arr})
  822 + },
  823 +
  824 + onPageScroll(e) {
  825 + // console.log('滚动距离', e);
  826 + this.data.scrolltop = e.scrollTop;
  827 + },
  828 +
  829 +
  830 + //声明节点查询的方法
  831 + queryMultipleNodes: function() {
  832 + var th=this;
  833 + const query = wx.createSelectorQuery() // 创建节点查询器 query
  834 + query.select('.content_view').boundingClientRect() // 这段代码的意思是选择Id=productServe的节点,获取节点位置信息的查询请求
  835 + query.selectViewport().scrollOffset() // 这段代码的意思是获取页面滑动位置的查询请求
  836 + query.exec(res => {
  837 + console.log(res);
  838 + th.data.f_x=res[0].left;
  839 + th.data.f_y=res[0].top;
  840 + th.data.f_hei=res[0].height;
  841 + th.data.f_width=res[0].width;
  842 +
  843 + })
  844 + },
  845 +
  846 + getcopy(e) {
  847 + var that=this;
  848 + console.log('e', e);
  849 + var x=e.currentTarget.dataset.offsetLeft;
  850 + var y=e.currentTarget.dataset.offsetTop;
  851 + var position = [x, y];
  852 + that.setData({
  853 + write: position,copy_btn:1
  854 + });
  855 +
  856 + },
  857 +
  858 + getName(e) {
  859 + // console.log('e1', e);
  860 + let name = e.currentTarget.dataset.name;
  861 + this.setData({
  862 + projectName: name,
  863 + });
  864 + },
  865 +
  866 +
  867 + // 生成时间段
  868 + getTimeList(hours,step) {
  869 + var minutes=60;
  870 + var timeArr = [];
  871 + hours = hours;
  872 + step = step;
  873 +
  874 + for(var i = 8; i < hours; i++){
  875 + var str = '';
  876 + if(i < 10) {
  877 + str = 0 + '' + i;
  878 + } else {
  879 + str = '' + i;
  880 + };
  881 +
  882 + for(var j = 0; j < minutes; j++) {
  883 + if(j % step == 0){
  884 + var s = j < 10 ? ':' + 0 + '' + j : ':' + j;
  885 + s = str + s;
  886 + timeArr.push(s);
  887 + };
  888 + };
  889 + };
  890 +
  891 + // console.log('timeArr', timeArr);
  892 + this.setData({
  893 + timeArr,
  894 + });
  895 +
  896 + },
  897 +
  898 +
  899 +
  900 + scroll(e) {
  901 + // console.log('e', e.detail.deltaX);
  902 + let deltaX = e.detail.deltaX;
  903 + // if(deltaX < 0) {
  904 + // deltaX = -deltaX;
  905 + // };
  906 + this.data.deltaX = -deltaX;
  907 + },
  908 +
  909 +
  910 +
  911 +
  912 +})
0 913 \ No newline at end of file
... ...
packageA/pages/my_service2/appment_main.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "预约服务",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "warn": "/components/long_warn/long_warn",
  6 + "nav_b": "/components/nav_b/nav_b"
  7 + }
  8 +}
0 9 \ No newline at end of file
... ...
packageA/pages/my_service2/appment_main.wxml 0 → 100644
  1 +<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
  2 +<wxs module="fil" src="g_filter.wxs"></wxs>
  3 +
  4 +<!-- <view class="btn-container">
  5 + <navigator class="btn" url="/pages/user/my_service/tment_order_list">
  6 + <view>我的预约</view>
  7 + </navigator>
  8 + <form report-submit='true' bindtap="sub_success">
  9 + <button form-type="submit" class="btn">
  10 + <view>提交预约</view>
  11 + </button>
  12 + </form>
  13 + </view> -->
  14 +
  15 +<view class="card" bindlongtap="getcopy">
  16 + <view class="t-c c-c7">
  17 + <text class="iconfont icon-sandian"></text>
  18 + </view>
  19 + <block wx:for="{{project}}">
  20 + <view class="t-c pd20" hover-class="hover" bindtouchmove="touchmove" bindtouchend="touchend" catch:touchmove data-name="{{item}}" bindlongtap="getName">
  21 + <text class="iconfont icon-meirong fs40"></text>
  22 + <view class="fs24">{{item}}</view>
  23 + </view>
  24 + </block>
  25 +</view>
  26 +
  27 +<image class="main" src="{{iurl}}/miniapp/images/yyservice/main.png"></image>
  28 +
  29 +<view class="pdb100">
  30 + <!-- 选择门店 -->
  31 + <view class="flex-vertical pdv20 jc-center">
  32 + <!-- 门店 -->
  33 + <view class="flex-vertical-between head fs30">
  34 + <view>门</view>
  35 + <view>店</view>
  36 + </view>
  37 +
  38 + <!-- 选择门店 -->
  39 + <view class="flex-vertical-between fs26 select" bindtap="onclickstore">
  40 + <view class="{{store_name==''?'color':''}} value ellipsis-1">{{store_name==""?'选择服务门店':store_name}}</view>
  41 + <view class="angle">∟</view>
  42 + </view>
  43 + </view>
  44 + <view class="table flex fs26" style="width: 100%;height: 100%;">
  45 + <view class="left t-c">
  46 + <view class="td pr" style="width: 120rpx">
  47 + <view class="time-box" bindtap="pickTime"><view class="time">时间</view></view>
  48 + <view class="md-box"><view class="md">美导</view></view>
  49 + </view>
  50 + <view class="td" style="width: 120rpx" wx:for="{{timeArr}}">{{item}}</view>
  51 + </view>
  52 + <scroll-view scroll-x class="right" bindscroll="scroll">
  53 + <view class="flex t-c">
  54 + <!-- <view>
  55 + <view class="td bg-pink">张三</view>
  56 + <view class="td" wx:for="{{timeArr.length}}"></view>
  57 + </view> -->
  58 + <view wx:for="{{md}}">
  59 + <view class="td bg-pink">{{item.name}}</view>
  60 + <!-- <view class="td content_view {{v[0][0]?'121':''}}">{{v[0][0]}}</view> -->
  61 + <block wx:for="{{timeArr.length}}" wx:for-item="subitem" wx:for-index="subindex">
  62 + <view class="td content_view {{v[index][subindex] && v[index][subindex]? 'active':''}} {{filters.in_arr(subindex,col_arr) || fil.is_no_time(item,subindex,timeArr) ?'notactive':''}}">
  63 + {{v[index][subindex]?v[index][subindex]:''}}
  64 + <text wx:if="{{v[index][subindex]}}" catchtap="close_this" data-txt="v[{{index}}][{{subindex}}]" data-sindex="{{subindex}}" class="close_this">×</text>
  65 + </view>
  66 + </block>
  67 + </view>
  68 + </view>
  69 + </scroll-view>
  70 +
  71 +
  72 +
  73 +
  74 +
  75 + <!-- 选择美容师 -->
  76 + <!-- <view class="flex-vertical mabot"> -->
  77 + <!-- 门店 -->
  78 + <!-- <view class="flex-vertical-between head fs30">
  79 + <view>美</view>
  80 + <view>容</view>
  81 + <view>师</view>
  82 + </view> -->
  83 +
  84 + <!-- 选择美容师 -->
  85 + <!-- <view class="rel fs26"> -->
  86 + <!-- <view class="flex-vertical-between Cosmetology" bindtap="query_beautician">
  87 + <view class="{{beautician_name==''?'color':''}} value ellipsis-1">{{beautician_name==''?'选择美容师':beautician_name}}</view>
  88 + <view class="angle">∟</view>
  89 + </view> -->
  90 + <!-- 美容师下拉列表 -->
  91 + <!-- <view class="beauticians abs" wx:if="{{beautician}}"> -->
  92 + <!-- 到时候要做判断如果是index==循环的最后一个则把下边线去掉:(beaclone去掉的css) -->
  93 + <!-- <view class="beautician flex-vertical fs26" wx:for="{{beautician_list}}" bindtap="choice_beautician" data-baaindex="{{key}}" wx:for-index="key">
  94 + <view class="StaffName ellipsis-1">{{item.StaffName}}</view>
  95 + </view>
  96 + <view>
  97 + </view>
  98 + </view> -->
  99 + <!-- </view> -->
  100 + <!-- <view class="flex-center users" bindtap="nav_bea">
  101 + <image class="user" src="{{iurl}}/miniapp/images/yyservice/user.png"></image>
  102 + </view> -->
  103 + <!-- </view> -->
  104 +
  105 + <!-- 选择时间 -->
  106 + <!-- <view class="flex-vertical mabot"> -->
  107 + <!-- 门店 -->
  108 + <!-- <view class="head fs30">
  109 + <view>预约时间</view>
  110 + </view> -->
  111 +
  112 + <!-- 选择时间 -->
  113 + <!-- <view class="flex-vertical-between fs26 select" data-url="/packageA/pages/my_service/beauty_deta?url={{url}}&StorageId={{StorageId}}&BeauticianID={{beauticianID}}&itemId={{itemId}}&modify=0&projectId={{project_id}}" bindtap="goto">
  114 + <view class="{{time==''?'color':''}}">{{time==""?'选择时间':time}}</view>
  115 + <view class="angle angler">∟</view>
  116 + </view> -->
  117 + <!-- </view> -->
  118 +
  119 + <!-- 备注 -->
  120 + <!-- <view class="flex Remarks"> -->
  121 + <!-- 门店 -->
  122 + <!-- <view class="flex-space-between head fs30">
  123 + <view>备</view>
  124 + <view>注</view>
  125 + </view>
  126 + <view class="flex fs26">
  127 + <block wx:if="{{is_textea==1}}">
  128 + <textarea class="textarea" placeholder="{{remarks==''?'填写备注':remarks}}" placeholder-class="fs26 color" value="{{remarks}}" bindinput="input_remarks" maxlength="100">
  129 + </textarea>
  130 + </block>
  131 + <block wx:else>
  132 + <view class="textarea {{remarks==''?'color':''}}" bindtap="check_text">{{remarks==''?'填写备注':remarks}}
  133 + </view>
  134 + </block>
  135 + </view> -->
  136 + <!-- </view>
  137 + <view wx:if="{{tment_count!=''}}" class="notes flex-level-right fs24 color">
  138 + <view>注:剩余可预约人数{{tment_count}}人</view>
  139 + </view> -->
  140 +
  141 +
  142 + </view>
  143 +</view>
  144 +
  145 +<view class="btn-box fs32">
  146 + <navigator class="appment flex-center" url="/pages/user/my_service/tment_order_list">
  147 + <view>我的预约</view>
  148 + </navigator>
  149 + <form report-submit='true' bindtap="sub_success">
  150 + <button form-type="submit" class="sub_appment flex-center">帮你预约</button>
  151 + </form>
  152 +</view>
  153 +
  154 +
  155 +<!-- 门店列表显示 -->
  156 +<view wx:if="{{store}}" class="storeList fixed">
  157 + <view class="choice flex-vertical-between fs32 storeListpadd">
  158 + <view>选择服务门店</view>
  159 + <icon bindtap="onclickstore" color="black" size="22" type="cancel"></icon>
  160 + </view>
  161 + <view class="searchbar flex-vertical-between storeListpadd">
  162 + <input class="inputstore fs28" placeholder="{{key_word==''?'输入要搜索的门店':key_word}}" placeholder-class="fs28" maxlength="16" bindinput="input_store" bindconfirm="search_store" />
  163 + <view class="search flex-center" bindtap="search_store">
  164 + <view class="fs28">搜索</view>
  165 + </view>
  166 + </view>
  167 + <!-- 选择门店 -->
  168 + <scroll-view class="stores" scroll-y="{{isScroll}}" enable-back-to-top="true" bindscrolltolower="onReachBottom">
  169 + <view class="store flex-vertical" wx:for="{{store_list}}" bindtap="choose_for_store" data-ind="{{index}}">
  170 + <block wx:if="{{index==fir_pick_index}}">
  171 + <icon class="icon" type="success" color="red" size="20"></icon>
  172 + </block>
  173 + <block wx:else>
  174 + <view class="circular"></view>
  175 + </block>
  176 + <view class="store_name_dis">
  177 + <view class="name_dis flex-vertical-between">
  178 + <view class="store_name fs28 ellipsis-1">{{item.StorageName}}</view>
  179 + <view wx:if="{{item.Distance!=1000000}}" class="store_dis flex fs22">
  180 + <view class="ellipsis-1">距您:{{item.Distance}}km</view>
  181 + </view>
  182 + </view>
  183 + <view class="store_address fs24 ellipsis-2">{{item.Address}}</view>
  184 + </view>
  185 + </view>
  186 + <!-- 通过搜索的时候没有找到的提示语 -->
  187 + <view wx:if="{{store_list.length<1 && is_search==1}}" class="flex-center fs28 notstore">
  188 + <view>没有找到{{key_word}}门店</view>
  189 + </view>
  190 +
  191 + <!-- 数据加载完毕 -->
  192 + <view wx:if="{{ismore && store_list.length>1}}" class="flex-center fs28 notstore">
  193 + <view>数据加载完毕</view>
  194 + </view>
  195 + </scroll-view>
  196 + <!-- sub -->
  197 + <view class="flex-center fs32" bindtap="choice_store">
  198 + <view class="determine flex-center">
  199 + <view>确定</view>
  200 + </view>
  201 + </view>
  202 +</view>
  203 +<!-- 蒙尘 -->
  204 +<view wx:if="{{store}}" class="disgraceful" bindtap="onclickstore"></view>
  205 +<warn id="warn"></warn>
  206 +
  207 +<!-- 制作一个圆球导航 -->
  208 +<!-- <nav_b id="nav_b"></nav_b> -->
  209 +
  210 +<view class="copy" wx:if="{{copy_btn}}" style="position:absolute;left:{{write[0]}}px;top:{{write[1]}}px;">
  211 + <text class="iconfont icon-meirong fs40"></text>
  212 + <view class="fs24">{{projectName}}</view>
  213 +</view>
0 214 \ No newline at end of file
... ...
packageA/pages/my_service2/appment_main.wxss 0 → 100644
  1 +page,
  2 +.area {
  3 + width: 100%;
  4 + height: 100%;
  5 +}
  6 +
  7 +
  8 +
  9 +
  10 +/* .container {
  11 + border-top: 7rpx solid rgb(245, 245, 245);
  12 + justify-content: baseline;
  13 +} */
  14 +
  15 +.main {
  16 + width: 100%;
  17 + height: 305rpx;
  18 +}
  19 +
  20 +.angle {
  21 + transform: rotate(-45deg);
  22 + margin-right: 15rpx;
  23 + margin-bottom: 10rpx;
  24 + font-size: 26rpx;
  25 + color: rgb(142, 142, 142);
  26 +}
  27 +.StaffName{
  28 + max-width: 350rpx;
  29 +}
  30 +.angler {
  31 + transform: rotate(227deg);
  32 + margin-bottom: 0rpx;
  33 +}
  34 +
  35 +.users {
  36 + background-color: rgb(255, 255, 255);
  37 +}
  38 +
  39 +.user {
  40 + width: 40rpx;
  41 + height: 40rpx;
  42 + margin-left: 15rpx;
  43 +}
  44 +
  45 +.Fram {
  46 + padding: 0rpx 60rpx;
  47 + margin-top: 60rpx;
  48 + background-color: rgb(255, 255, 255);
  49 +}
  50 +
  51 +.subSuccess {
  52 + position: fixed;
  53 + z-index: 3;
  54 + top: 420rpx;
  55 + left: 110rpx;
  56 + width: 540rpx;
  57 + height: 315rpx;
  58 + background-color: rgb(155, 155, 155);
  59 + text-align: center;
  60 + border-radius: 20rpx;
  61 + color: rgb(255, 255, 255);
  62 + font-weight: bold;
  63 +}
  64 +
  65 +.Success {
  66 + width: 110rpx;
  67 + height: 110rpx;
  68 + margin-top: 70rpx;
  69 + margin-bottom: 30rpx;
  70 +}
  71 +
  72 +.appment, .sub_appment {
  73 + width: 270rpx;
  74 + height: 60rpx;
  75 + line-height: 55rpx;
  76 + border-radius: 40rpx;
  77 +}
  78 +
  79 +button {
  80 + height: 100%;
  81 + background-color: rgb(214, 1, 33);
  82 +}
  83 +
  84 +.appment {
  85 + background-color: rgb(238, 238, 238);
  86 +}
  87 +
  88 +.sub_appment {
  89 + background-color: rgb(214, 1, 33);
  90 + color: rgb(255, 255, 255);
  91 +}
  92 +
  93 +.head {
  94 + width: 122rpx;
  95 + margin-right: 40rpx;
  96 + height: 50rpx;
  97 + line-height: 50rpx;
  98 +}
  99 +
  100 +.textarea {
  101 + width: 420rpx;
  102 + background-color: rgb(238, 238, 238);
  103 + border-radius: 6rpx;
  104 + height: 130rpx;
  105 + padding-left: 40rpx;
  106 + padding-right: 15rpx;
  107 + padding-top: 15rpx;
  108 + padding-bottom: 15rpx;
  109 +}
  110 +
  111 +.mabot {
  112 + margin-bottom: 35rpx;
  113 +}
  114 +
  115 +.select {
  116 + width: 420rpx;
  117 + height: 55rpx;
  118 + line-height: 55rpx;
  119 + background-color: rgb(238, 238, 238);
  120 + border-radius: 6rpx;
  121 + padding-left: 40rpx;
  122 + padding-right: 15rpx;
  123 +}
  124 +
  125 +.Cosmetology {
  126 + padding-left: 40rpx;
  127 + padding-right: 15rpx;
  128 + width: 365rpx;
  129 + background-color: rgb(238, 238, 238);
  130 + height: 50rpx;
  131 + line-height: 50rpx;
  132 + border-radius: 6rpx;
  133 +}
  134 +
  135 +.beauticians {
  136 + width: 407rpx;
  137 + z-index: 3;
  138 + top: 45rpx;
  139 + left: -1rpx;
  140 + padding: 0rpx 5rpx;
  141 + border: 2rpx solid rgb(238, 238, 238);
  142 + background-color: rgb(255, 255, 255);
  143 + padding-bottom: 5rpx;
  144 + height: 279rpx;
  145 + overflow-x: scroll;
  146 + overflow-y: scroll;
  147 +}
  148 +
  149 +.beautician {
  150 + height: 70rpx;
  151 + border-bottom: 2rpx solid rgb(238, 238, 238);
  152 + padding-left: 25rpx;
  153 +}
  154 +
  155 +.beaclone {
  156 + border-bottom: 0rpx;
  157 +}
  158 +
  159 +.notes {
  160 + margin-top: 15rpx;
  161 + margin-bottom: 60rpx;
  162 + margin-right: 8rpx;
  163 +}
  164 +
  165 +.color {
  166 + color: rgb(172, 172, 172);
  167 +}
  168 +
  169 +.submitMax {
  170 + margin-top: 50rpx;
  171 + padding: 0rpx 15rpx;
  172 +}
  173 +
  174 +.Remarks {
  175 + margin-top: 15rpx;
  176 +}
  177 +
  178 +/* 蒙尘 */
  179 +
  180 +.disgraceful {
  181 + position: fixed;
  182 + z-index: 4;
  183 + width: 100%;
  184 + height: 100%;
  185 + top: 0rpx;
  186 + left: 0rpx;
  187 + background-color: rgba(0, 0, 0, 0.4);
  188 +}
  189 +
  190 +.storeList {
  191 + z-index: 5;
  192 + left: 0rpx;
  193 + border-top-left-radius: 25rpx;
  194 + border-top-right-radius: 25rpx;
  195 + background-color: rgb(255, 255, 255);
  196 + width: 100%;
  197 + padding: 45rpx 0rpx;
  198 +}
  199 +
  200 +.storeListpadd {
  201 + padding: 0rpx 31rpx;
  202 +}
  203 +
  204 +.choice {
  205 + margin-bottom: 5rpx;
  206 +}
  207 +
  208 +.inputstore {
  209 + width: 510rpx;
  210 + height: 43rpx;
  211 + line-height: 43rpx;
  212 + border-radius: 30rpx;
  213 + border: 2rpx solid rgb(238, 238, 238);
  214 + padding-left: 30rpx;
  215 +}
  216 +
  217 +.searchbar {
  218 + height: 95rpx;
  219 + border-bottom: 2rpx solid rgb(238, 238, 238);
  220 +}
  221 +
  222 +.search {
  223 + width: 125rpx;
  224 + height: 45rpx;
  225 + line-height: 45rpx;
  226 + background-color: rgb(219, 27, 52);
  227 + border-radius: 30rpx;
  228 + color: rgb(255, 255, 255);
  229 +}
  230 +
  231 +.stores {
  232 + height: 500rpx;
  233 + overflow-y: scroll;
  234 +}
  235 +
  236 +.store {
  237 + margin: 0rpx 16rpx;
  238 + padding-right: 15rpx;
  239 + border-bottom: 2rpx solid rgb(238, 238, 238);
  240 + padding: 20rpx 0rpx;
  241 +}
  242 +
  243 +.icon {
  244 + padding: 0rpx 15rpx;
  245 +}
  246 +
  247 +.circular {
  248 + width: 37rpx;
  249 + height: 37rpx;
  250 + border-radius: 50%;
  251 + border: 2rpx solid rgb(52, 52, 52);
  252 + margin: 0rpx 15rpx;
  253 +}
  254 +
  255 +.store_name_dis {
  256 + width: 90%;
  257 +}
  258 +
  259 +.name_dis {
  260 + margin-bottom: 5rpx;
  261 +}
  262 +
  263 +.store_name {
  264 + max-width: 420rpx;
  265 +}
  266 +
  267 +.store_dis {
  268 + height: 30rpx;
  269 + line-height: 30rpx;
  270 + padding: 5rpx 15rpx;
  271 + background-color: rgb(227, 227, 227);
  272 + border-radius: 25rpx;
  273 + margin-right: 20rpx;
  274 + color: rgb(159, 159, 159);
  275 + max-width: 200rpx;
  276 +}
  277 +
  278 +.store_address {
  279 + color: rgb(159, 159, 159);
  280 +}
  281 +
  282 +.determine {
  283 + background-color: rgb(196, 24, 26);
  284 + width: 500rpx;
  285 + border-radius: 35rpx;
  286 + height: 60rpx;
  287 + color: rgb(255, 255, 255);
  288 + margin: 20rpx 0rpx;
  289 +}
  290 +
  291 +.value {
  292 + max-width: 300rpx;
  293 +}
  294 +
  295 +.notstore {
  296 + height: 80rpx;
  297 + color: rgb(159, 159, 159);
  298 +}
  299 +
  300 +
  301 +.table {
  302 + background-color: white;
  303 + /* border-top: 2rpx solid rgba(218, 217, 217, 1);
  304 + border-left: 2rpx solid rgba(218, 217, 217, 1); */
  305 +}
  306 +.blue {
  307 + background: rgba(241, 252, 255, 1);
  308 +}
  309 +.bg-pink {
  310 + background-color: #FFDEF0;
  311 +}
  312 +.td {
  313 + width: 140rpx;
  314 + height: 120rpx;
  315 + display: flex;
  316 + align-items: center;
  317 + justify-content: center;
  318 + border-right: 2rpx solid rgba(218, 217, 217, 1);
  319 + border-bottom: 2rpx solid rgba(218, 217, 217, 1);
  320 + position: relative;
  321 +}
  322 +
  323 +.td.active {
  324 + background-color: #FFE5F5 !important;
  325 +}
  326 +.td.notactive {
  327 + background-color: #f0f0f0;
  328 +}
  329 +
  330 +.left {
  331 + box-shadow: 4px 0px 6px #e7e9eb;
  332 +}
  333 +
  334 +.right {
  335 + width: calc(100% - 102rpx);
  336 + /* padding-right: 102rpx; */
  337 + box-sizing: border-box;
  338 +}
  339 +
  340 +.card {
  341 + position: fixed;
  342 + width: 110rpx;
  343 + top: 50%;
  344 + right: 0;
  345 + /* min-height: 400rpx; */
  346 + max-height: 700rpx;
  347 + overflow-y: auto;
  348 + transform: translateY(-50%);
  349 + background-color: white;
  350 + border-radius: 10rpx;
  351 + box-shadow: -2px 0px 6px #aaa;
  352 + z-index: 1000;
  353 +}
  354 +
  355 +.icon-meirong {
  356 + color: pink;
  357 +}
  358 +
  359 +
  360 +
  361 +.time-box {
  362 + width: 0;
  363 + height: 0;
  364 + border-width: 50rpx;
  365 + border-style: solid;
  366 + border-color: transparent transparent white white;
  367 + position: absolute;
  368 + left: 0;
  369 + bottom: 0;
  370 +}
  371 +.time {
  372 + position: absolute;
  373 + bottom: -22px;
  374 + width: 53rpx;
  375 + z-index: 999;
  376 + left: -22px;
  377 + font-size: 12px;
  378 +}
  379 +
  380 +.md-box {
  381 + width: 0;
  382 + height: 0;
  383 + border-width: 62rpx;
  384 + border-style: solid;
  385 + border-color: #FFDEF0 #FFDEF0 transparent transparent;
  386 + position: absolute;
  387 + right: 0;
  388 + top: 0;
  389 +}
  390 +.md {
  391 + position: absolute;
  392 + top: -30rpx;
  393 + width: 53rpx;
  394 + z-index: 999;
  395 + right: -52rpx;
  396 + font-size: 24rpxpx;
  397 +}
  398 +
  399 +.hover {
  400 + background-color: #e0e0e0;
  401 +}
  402 +
  403 +.copy {
  404 + padding: 10rpx;
  405 + text-align: center;
  406 + background-color: #f0f0f0;
  407 + z-index: 9999;
  408 +}
  409 +
  410 +.btn-container {
  411 + position: absolute;
  412 + width: 100%;
  413 + display: flex;
  414 + justify-content: space-between;
  415 + padding: 20rpx;
  416 + box-sizing: border-box;
  417 +}
  418 +
  419 +.btn {
  420 + color: white;
  421 + background-color: transparent;
  422 + line-height: 1;
  423 + font-size: 26rpx;
  424 +}
  425 +.close_this{ position: absolute; width: 40rpx; display: flex;right: 0; top: 0; border-radius: 50%;
  426 + justify-content: center;align-items: center;
  427 + height: 40rpx; border: 1rpx solid #adadad; }
  428 +
  429 +
  430 +.btn-box {
  431 + background-color: white;
  432 + position: fixed;
  433 + bottom: 0;
  434 + width: 100%;
  435 + display: flex;
  436 + justify-content: space-around;
  437 + padding: 20rpx 0;
  438 + box-shadow: 1px 0px 6px #aaa;
  439 +}
  440 +
  441 +.pdb100 {
  442 + padding-bottom: 100rpx;
  443 +}
  444 +
  445 +
... ...
packageA/pages/my_service2/g_filter.wxs 0 → 100644
  1 +var g_filters = {
  2 + is_no_time:function(item,subindex,timeArr){
  3 + var t_time=timeArr[subindex];
  4 + var time_arr=item.time.split("-");
  5 +
  6 + var t_date=getDate();
  7 + var t_date_str=t_date.getFullYear()+"-"+(t_date.getMonth() + 1)+"-"+t_date.getDate()+" "
  8 +
  9 + var this_time =t_date_str+t_time.substring(0, 19);
  10 + var reg = getRegExp("-", "g");
  11 + this_time = this_time.replace(reg, '/');
  12 + var t1 = getDate(this_time);
  13 +
  14 + var fmt1 =t_date_str+time_arr[0].substring(0, 19);
  15 + var reg = getRegExp("-", "g");
  16 + var fmt2 = fmt1.replace(reg, '/');
  17 + var t2 = getDate(fmt2);
  18 +
  19 + if(t1<t2) return true;
  20 + if(time_arr.length>1){
  21 + var ft1 =t_date_str+time_arr[1].substring(0, 19);
  22 + var reg = getRegExp("-", "g");
  23 + var ft2 = ft1.replace(reg, '/');
  24 + var t3 = getDate(ft2);
  25 + if(t1>t3) return true;
  26 + }
  27 + return false;
  28 + },
  29 +
  30 +}
  31 +module.exports = {
  32 + is_no_time: g_filters.is_no_time,
  33 +
  34 +}
0 35 \ No newline at end of file
... ...
packageA/pages/profile/profile.js
... ... @@ -93,21 +93,16 @@ Page({
93 93 }).then(res => {
94 94 if (res.data.code == 0) {
95 95 var data = res.data.data;
96   - var VipLabel = th.data.VipLabel; //通过id标签找到已选择的标签
97   - if(VipLabel){
98   - var dateList = data.VipLabel.split(",");
99   - var arr=[];
100   - for (var i in dateList) {
101   - if (dateList[i] != "") {
102   - arr.push(dateList[i]);
103   - }
104   - }
105   - th.setData({
106   - check_label: arr
107   - })
  96 + var VipLabel = th.data.check_label; //通过id标签找到已选择的标签
  97 + var dateList = data.VipLabel.split(",");
  98 + for (var i in dateList) {
  99 + if (dateList[i] != "") {
  100 + VipLabel.push(dateList[i]);
  101 + }
108 102 }
109   -
110   -
  103 + th.setData({
  104 + check_label: VipLabel
  105 + })
111 106 } else {
112 107 getApp().my_warnning("系统繁忙,请稍后再试", 0, th);
113 108 }
... ... @@ -536,6 +531,10 @@ Page({
536 531 if(!user) return false;
537 532  
538 533 //-- 赋予默认值 --
  534 + if(user['idcard']) this.data.id=user['idcard'];
  535 + if(user['vipname']) this.data.name=user['vipname'];
  536 + if(user['address']) this.data.address=user['address'];
  537 +
539 538 app.request.get(url1, {
540 539 success: function(res) {
541 540 console.log('x-->', res.data.code, res.data.data.reg_type, res.data.data.reg_info);
... ... @@ -568,13 +567,18 @@ Page({
568 567 if(res.data.code == 0) {
569 568 console.log('url3', res.data.data.birthday);
570 569 let data = res.data.data;
571   - if(data['idcard']) self.data.id=data['idcard'];
572   - if(data['vipname']) self.data.name=data['vipname'];
573   - if(data['address']) self.data.address=data['address'];
574   -
  570 +
575 571 if(data.birthday){
576 572 data.birthday= ut.formar_no_full(data.birthday);
577 573 }
  574 +
  575 + if(user['sex'] && !data.sex){
  576 + data.sex=user['sex'];
  577 + }
  578 + if(user['birthday'] && !data.birthday){
  579 + data.birthday= ut.formar_no_full(user['birthday']);
  580 + }
  581 +
578 582 if(!data.pickup_name){
579 583 data.pickup_name="";
580 584 }
... ... @@ -582,21 +586,44 @@ Page({
582 586 data.pickup_id=0;
583 587 }
584 588 //-- 获取门店 --
585   - self.setData({
586   - isGender: data.sex,
587   - isLunar: data.islunar,
588   - datet: data.birthday,
589   - stoname: data.pickup_name,
590   - sto_sele_id: data.pickup_id,
591   - vip_user:data
592   - });
593   -
  589 + if(user['pickup_id'] && !data.pickup_id){
  590 + getApp().promiseGet("/api/weshop/pickup/get/"+r.stoid+"/"+user['pickup_id']).then(res=>{
  591 + if(res.data.code==0 && res.data.data){
  592 + data.pickup_name=res.data.data.pickup_name;
  593 + data.pickup_id=res.data.data.pickup_id;
  594 +
  595 + self.setData({
  596 + isGender: data.sex,
  597 + isLunar: data.islunar,
  598 + datet: data.birthday,
  599 + stoname: data.pickup_name,
  600 + sto_sele_id: data.pickup_id,
  601 + });
  602 + }
  603 + else{
  604 + self.setData({
  605 + isGender: data.sex,
  606 + isLunar: data.islunar,
  607 + datet: data.birthday,
  608 + stoname: data.pickup_name,
  609 + sto_sele_id: data.pickup_id,
  610 + });
  611 + }
  612 + })
  613 + }else{
  614 + self.setData({
  615 + isGender: data.sex,
  616 + isLunar: data.islunar,
  617 + datet: data.birthday,
  618 + stoname: data.pickup_name,
  619 + sto_sele_id: data.pickup_id,
  620 + });
  621 + }
594 622 };
595 623 }
596 624 });
597 625  
598   - if(user){
599   - getApp().promiseGet("/api/weshop/users/getAndUpdateUser/" + r.stoid + "/" + user.user_id,{});
  626 + if(user){
600 627 self.setData({user:user})
601 628 }
602 629  
... ...
packageA/pages/profile/profile.wxml
... ... @@ -28,9 +28,9 @@
28 28 <!-- 如果需要接骚人信息 -->
29 29 <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.introducer_state}}">
30 30 <view class="user-name-txt">推荐人:</view>
31   - <input bindinput="getReferee" bindblur="" value="{{vip_user['fromuser_id']?vip_user['fromuser_id']:''}}" data-name="推荐人" class="user-txt-right f1 pdl20 t-r" placeholder="请输入推荐人手机号码或卡号"/>
  31 + <input bindinput="getReferee" bindblur="" value="{{user['fromuser_id']?user['fromuser_id']:''}}" data-name="推荐人" class="user-txt-right f1 pdl20 t-r" placeholder="请输入推荐人手机号码或卡号"/>
32 32  
33   - <block wx:if="{{!vip_user['fromuser_id']}}">
  33 + <block wx:if="{{!user['fromuser_id']}}">
34 34 <view class="c-red pdl20 fs24" wx:if="{{reg_info.introducer && (reg_info.introducer_type == 0)}}">+{{reg_info.introducer}}积分</view>
35 35 <view class="c-red pdl20 fs24" wx:elif="{{reg_info.introducer && (reg_info.introducer_type == 1)}}">+{{reg_info.introducer}}成长值</view>
36 36 </block>
... ... @@ -39,8 +39,8 @@
39 39 <!-- 如果需要接姓名信息 -->
40 40 <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.name_state}}">
41 41 <view class="user-name-txt">姓名:</view>
42   - <input bindinput="getName" bindblur="" value="{{vip_user['vipname']?vip_user['vipname']:''}}" data-name="姓名" class="user-txt-right f1 pdl20 t-r" placeholder="请输入您的真实姓名"/>
43   - <block wx:if="{{!vip_user['vipname']}}">
  42 + <input bindinput="getName" bindblur="" value="{{user['vipname']?user['vipname']:''}}" data-name="姓名" class="user-txt-right f1 pdl20 t-r" placeholder="请输入您的真实姓名"/>
  43 + <block wx:if="{{!user['vipname']}}">
44 44 <view class="c-red pdl20 fs24" wx:if="{{reg_info.name && (reg_info.name_val_type == 0)}}">+{{reg_info.name}}积分</view>
45 45 <view class="c-red pdl20 fs24" wx:elif="{{reg_info.name && (reg_info.name_val_type == 1)}}">+{{reg_info.name}}成长值</view>
46 46 </block>
... ... @@ -69,7 +69,7 @@
69 69 </view>
70 70 </view>
71 71  
72   - <block wx:if="{{!vip_user['sex']}}">
  72 + <block wx:if="{{!user['sex']}}">
73 73 <view class="c-red pdl20 fs24" wx:if="{{reg_info.sex && (reg_info.sex_state_type == 0)}}">+{{reg_info.sex}}积分</view>
74 74 <view class="c-red pdl20 fs24" wx:elif="{{reg_info.sex && (reg_info.sex_state_type == 1)}}">+{{reg_info.sex}}成长值</view>
75 75 </block>
... ... @@ -92,7 +92,7 @@
92 92 </view>
93 93 </view>
94 94  
95   - <block wx:if="{{!vip_user['birthday']}}">
  95 + <block wx:if="{{!user['birthday']}}">
96 96 <view class="c-red pdl20 fs24 shrink0" wx:if="{{reg_info.birthday && (reg_info.birthday_type == 0)}}">+{{reg_info.birthday}}积分</view>
97 97 <view class="c-red pdl20 fs24 shrink0" wx:elif="{{reg_info.birthday && (reg_info.birthday_type == 1)}}">+{{reg_info.birthday}}成长值</view>
98 98 </block>
... ... @@ -101,8 +101,8 @@
101 101  
102 102 <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.idcard_state}}">
103 103 <view class="user-name-txt shrink0">身份证:</view>
104   - <input bindinput="getId" bindblur="IdentityIDCard" value="{{vip_user.idcard}}" class="user-txt-right pdl20 f1 t-r" placeholder="请输入身份证号码"></input>
105   - <block wx:if="{{!vip_user.idcard}}">
  104 + <input bindinput="getId" bindblur="IdentityIDCard" value="{{user.idcard}}" class="user-txt-right pdl20 f1 t-r" placeholder="请输入身份证号码"></input>
  105 + <block wx:if="{{!user.idcard}}">
106 106 <view class="c-red pdl20 fs24" wx:if="{{reg_info.idcard && (reg_info.idcard_type == 0)}}">+{{reg_info.idcard}}积分</view>
107 107 <view class="c-red pdl20 fs24" wx:elif="{{reg_info.idcard && (reg_info.idcard_type == 1)}}">+{{reg_info.idcard}}成长值</view>
108 108 </block>
... ... @@ -111,8 +111,8 @@
111 111  
112 112 <view class="user-name flex-vertical" data-type="mobile" wx:if="{{reg_info.address_state}}">
113 113 <view class="user-name-txt">地址:</view>
114   - <input bindinput="getAddress" bindblur="" value="{{vip_user.address?vip_user.address:''}}" data-name="姓名" class="user-txt-right f1" placeholder="请输入详细地址" style="text-align:right" />
115   - <block wx:if="{{!vip_user.address}}">
  114 + <input bindinput="getAddress" bindblur="" value="{{user.address?user.address:''}}" data-name="姓名" class="user-txt-right f1" placeholder="请输入详细地址" style="text-align:right" />
  115 + <block wx:if="{{!user.address}}">
116 116 <view class="c-red pdl20 fs24" wx:if="{{reg_info.address && (reg_info.address_type == 0)}}">+{{reg_info.address}}积分</view>
117 117 <view class="c-red pdl20 fs24" wx:elif="{{reg_info.address && (reg_info.address_type == 1)}}">+{{reg_info.address}}成长值</view>
118 118 </block>
... ... @@ -127,7 +127,7 @@
127 127 <view class="angle">∟</view>
128 128 </view>
129 129  
130   - <block wx:if="{{!vip_user.pickup_id}}">
  130 + <block wx:if="{{!user.pickup_id}}">
131 131 <view class="c-red pdl20 fs24" wx:if="{{reg_info.pick && (reg_info.pick_type == 0)}}">+{{reg_info.pick}}积分</view>
132 132 <view class="c-red pdl20 fs24" wx:elif="{{reg_info.pick && (reg_info.pick_type == 1)}}">+{{reg_info.pick}}成长值</view>
133 133 </block>
... ...
packageA/pages/quan_list/quan_list.js
... ... @@ -25,26 +25,21 @@ Page({
25 25 onLoad: function(t) {
26 26 var th=this;
27 27 getApp().getConfig2(function (conf) {
28   - if(conf.couponset)
29   - conf.couponset=conf.couponset.replace(/\<img/g,'<img style="width:100%;height:auto;display:block"');
  28 + if(conf.couponset) conf.couponset=conf.couponset.replace(/\<img/g,'<img style="width:100%;height:auto;display:block"');
30 29 th.setData({config2:conf});
31 30 })
32   -
33   - var usr=getApp().globalData.userInfo;
34   - if(!usr){
35   - getApp().goto("/pages/togoin/togoin");
36   - return false;
37   - }
38 31 },
39 32 //---展示---
40 33 onShow: function() {
  34 +
  35 + console.log("onShow:1");
41 36 this.data.curpage=1;
42 37 this.setData({dataList:null});
  38 + console.log("onShow:2");
43 39 this.get_quan_list();
44 40 //券的模拟数据
45 41 //var data = [{ is_get:0,money:50,condition:500,id:1,name: "券名字", endtype: 0, use_start_time: 1579596090, use_end_time: 1611218490, everyone_num: 2,interval_time:1,color:"red"}];
46 42 //th.setData({dataList: data});
47   -
48 43 this.setData({getcurday:ut.gettimestamp()});
49 44 },
50 45  
... ... @@ -54,20 +49,31 @@ Page({
54 49  
55 50 //--券的列表页面的函数--
56 51 get_quan_list:function(){
  52 + console.log("onShow:3");
57 53 var th=this;
58 54 if(th.data.loading) return false;
59 55 th.data.loading=1;
60 56 var user_id=getApp().globalData.user_id;
61   - getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", {
62   - data:{store_id:os.stoid,type:1,pageSize:10,page:th.data.curpage,user_id:user_id,is_share:0}
63   - }).then(res => {
64   - th.data.loading=0;
65   - if(res.data.code==0){
66   - if(!th.data.dataList) th.data.dataList=new Array();
67   - th.data.dataList=th.data.dataList.concat(res.data.data.pageData);
68   - th.data.curpage++;
69   - th.setData({dataList:th.data.dataList});
70   - }
  57 + console.log("onShow:4");
  58 + var data={store_id:os.stoid,type:1,pageSize:10,page:th.data.curpage,user_id:user_id,is_share:0};
  59 + console.log(data);
  60 + getApp().request.get("/api/weshop/prom/coupon/pageCouponList", {
  61 + data:data,
  62 + success:function (res){
  63 + console.log("onShow:5");
  64 + console.log(res);
  65 + th.data.loading=0;
  66 + if(res.data.code==0){
  67 + if(!th.data.dataList) th.data.dataList=new Array();
  68 + th.data.dataList=th.data.dataList.concat(res.data.data.pageData);
  69 + th.data.curpage++;
  70 + th.setData({dataList:th.data.dataList});
  71 + }
  72 + },
  73 + fail:function (e){
  74 + console.log("onShow:6");
  75 + console.log(e);
  76 + }
71 77 });
72 78 },
73 79  
... ...
packageA/pages/quan_list/quan_list.wxml
... ... @@ -2,9 +2,11 @@
2 2 <wxs module="g_filters" src="g_filter.wxs"></wxs>
3 3 <wxs module="tool" src="filter.wxs"></wxs>
4 4  
5   -<view class="header">
6   - <rich-text nodes="{{config2.couponset}}" class="r_txt fs26"></rich-text>
7   -</view>
  5 +<block wx:if="{{config2.couponset}}">
  6 + <view class="header">
  7 + <rich-text nodes="{{config2.couponset}}" class="r_txt fs26"></rich-text>
  8 + </view>
  9 +</block>
8 10 <view class="content">
9 11 <view bindtap="go_detail" data-ind="{{index}}" class="quan_item flex fs30" wx:for="{{dataList}}">
10 12 <!-- 左边 -->
... ...
packageA/pages/service_share/service_share.js
... ... @@ -145,7 +145,7 @@ Page({
145 145 var item=this.data.share_good;
146 146 var price = item.money;
147 147 var title= item.serviceName;
148   - var img=this.data.url+item.imgUrl;
  148 + var img=this.data.url+item.original_img;
149 149  
150 150 var url="/packageA/pages/goodsInfo/goodsInfo?goods_id=" + item.id;
151 151 if(getApp().globalData.user_id){
... ... @@ -777,7 +777,7 @@ Page({
777 777 var ee = this;
778 778 //获取商品是分享图信息
779 779 wx.getImageInfo({
780   - src: ee.data.url+ee.data.share_good.imgUrl,
  780 + src: ee.data.url+ee.data.share_good.original_img,
781 781 success: function(res) {
782 782 //res.path是网络图片的本地地址
783 783 ee.data.share_goods_img = res.path;
... ...
packageA/pages/service_share/service_share.wxml
... ... @@ -45,7 +45,7 @@
45 45 </view>
46 46 <view class="details">
47 47 <view class="ellipsis-2 fs28 name">{{item.serviceName}}</view>
48   - <view class="fs26 pdt10">有效天数:{{item.validDays?item.validDays:'不限'}}</view>
  48 + <view class="fs26 pdt10">有效天数:{{item.validDays}}</view>
49 49 <view class="flex ai-center pdt14 jc_sb">
50 50 <view class="red fs26">¥{{item.money}}</view>
51 51 <view class="gray fs24">已售:<text class="red">{{item.sales_sum}}</text></view>
... ...
packageA/pages/user/my_service2/appment_main.js 0 → 100644
  1 +// packageA//pages/user/my_service2/appment_main.js
  2 +Page({
  3 +
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 +
  9 + },
  10 +
  11 + /**
  12 + * 生命周期函数--监听页面加载
  13 + */
  14 + onLoad: function (options) {
  15 +
  16 + },
  17 +
  18 + /**
  19 + * 生命周期函数--监听页面初次渲染完成
  20 + */
  21 + onReady: function () {
  22 +
  23 + },
  24 +
  25 + /**
  26 + * 生命周期函数--监听页面显示
  27 + */
  28 + onShow: function () {
  29 +
  30 + },
  31 +
  32 + /**
  33 + * 生命周期函数--监听页面隐藏
  34 + */
  35 + onHide: function () {
  36 +
  37 + },
  38 +
  39 + /**
  40 + * 生命周期函数--监听页面卸载
  41 + */
  42 + onUnload: function () {
  43 +
  44 + },
  45 +
  46 + /**
  47 + * 页面相关事件处理函数--监听用户下拉动作
  48 + */
  49 + onPullDownRefresh: function () {
  50 +
  51 + },
  52 +
  53 + /**
  54 + * 页面上拉触底事件的处理函数
  55 + */
  56 + onReachBottom: function () {
  57 +
  58 + },
  59 +
  60 + /**
  61 + * 用户点击右上角分享
  62 + */
  63 + onShareAppMessage: function () {
  64 +
  65 + }
  66 +})
0 67 \ No newline at end of file
... ...
packageA/pages/user/my_service2/appment_main.json 0 → 100644
  1 +{
  2 + "usingComponents": {}
  3 +}
0 4 \ No newline at end of file
... ...
packageA/pages/user/my_service2/appment_main.wxml 0 → 100644
  1 +<!--packageA//pages/user/my_service2/appment_main.wxml-->
  2 +<text>packageA//pages/user/my_service2/appment_main.wxml</text>
... ...
packageA/pages/user/my_service2/appment_main.wxss 0 → 100644
  1 +/* packageA//pages/user/my_service2/appment_main.wxss */
0 2 \ No newline at end of file
... ...
pages/user/add_comment/add_comment.js renamed to packageB/pages/user/add_comment/add_comment.js
1   -var t = getApp(), oo = t.globalData, a = t.globalData.setting, os = a, e = t.request, s = require("../../../utils/util.js"),
2   - i = require("../../../utils/selectFiles.js");
3   -var regeneratorRuntime = require('../../../utils/runtime.js');
  1 +var t = getApp(), oo = t.globalData, a = t.globalData.setting, os = a, e = t.request, s = require("../../../../utils/util.js"),
  2 + i = require("../../../../utils/selectFiles.js");
  3 +var regeneratorRuntime = require('../../../../utils/runtime.js');
4 4  
5 5 Page({
6 6 data: {
... ... @@ -88,8 +88,8 @@ Page({
88 88 var a = this;
89 89 if (!a.data.service_rank || !a.data.goods_rank || !a.data.deliver_rank)
90 90 return getApp().my_warnning("请先打分",0,a);
91   - if(a.data.content=="")
92   - return getApp().my_warnning("请填写评价内容",0,a);
  91 + // if(a.data.content=="")
  92 + // return getApp().my_warnning("请填写评价内容",0,a);
93 93  
94 94 //this.uploadPhotos(function () {
95 95 var p_data= {
... ...
pages/user/add_comment/add_comment.json renamed to packageB/pages/user/add_comment/add_comment.json
pages/user/add_comment/add_comment.wxml renamed to packageB/pages/user/add_comment/add_comment.wxml
... ... @@ -106,7 +106,7 @@
106 106 </view>
107 107  
108 108 <view class="Submission flex-level ">
109   - <view class="fs30 flex-level white " bindtap="submitComment" data-url="/pages/user/view_comment/view_comment?goods_id={{goods_id}}&order_id={{order_id}}">提交评价</view>
  109 + <view class="fs30 flex-level white " bindtap="submitComment" data-url="/packageB/pages/user/view_comment/view_comment?goods_id={{goods_id}}&order_id={{order_id}}">提交评价</view>
110 110 </view>
111 111 </view>
112 112  
... ...
pages/user/add_comment/add_comment.wxss renamed to packageB/pages/user/add_comment/add_comment.wxss
packageB/pages/user/buyDetails/buyDetails.js 0 → 100644
  1 +const app = getApp();
  2 +let self = null;
  3 +
  4 +Page({
  5 +
  6 + /**
  7 + * 页面的初始数据
  8 + */
  9 + data: {
  10 + tabArr: ['购买', '续费'],
  11 + currentIndex: 0,
  12 +
  13 + list: null,
  14 + isLoading: false, // 检测是否已经发送请求,防止重复发送请求
  15 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
  16 + pageNum: 1, // 当前页数
  17 + },
  18 +
  19 +
  20 + /**
  21 + * 生命周期函数--监听页面加载
  22 + */
  23 + onLoad: function (options) {
  24 + self = this;
  25 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  26 + self.setData({
  27 + userInfo: data,
  28 + });
  29 + });
  30 + },
  31 +
  32 + /**
  33 + * 生命周期函数--监听页面初次渲染完成
  34 + */
  35 + onReady: function () {
  36 +
  37 + },
  38 +
  39 + /**
  40 + * 生命周期函数--监听页面显示
  41 + */
  42 + onShow: function () {
  43 + if(app.globalData.userInfo) {
  44 + if(!this.data.isLogin) {
  45 + this.setData({
  46 + userInfo: app.globalData.userInfo,
  47 + imghost: app.globalData.setting.imghost,
  48 + isLogin: true,
  49 + });
  50 +
  51 + // this.getData(true, '/api/weshop/plus/vip/mem/listBuyRecord', {
  52 + // storeId: app.globalData.setting.stoid,
  53 + // userId: app.globalData.user_id,
  54 + // });
  55 +
  56 +
  57 + app.request.promiseGet('/api/weshop/plus/vip/mem/listBuyRecord', {
  58 + data: {
  59 + storeId: app.globalData.setting.stoid,
  60 + userId: app.globalData.user_id,
  61 + },
  62 + isShowLoading: true,
  63 + }).then(function(res) {
  64 + self.setData({
  65 + list: res.data.data,
  66 + });
  67 + });
  68 +
  69 +
  70 +
  71 + };
  72 + };
  73 + },
  74 +
  75 + /**
  76 + * 生命周期函数--监听页面隐藏
  77 + */
  78 + onHide: function () {
  79 +
  80 + },
  81 +
  82 + /**
  83 + * 生命周期函数--监听页面卸载
  84 + */
  85 + onUnload: function () {
  86 +
  87 + },
  88 +
  89 + /**
  90 + * 页面相关事件处理函数--监听用户下拉动作
  91 + */
  92 + onPullDownRefresh: function () {
  93 +
  94 + },
  95 +
  96 + /**
  97 + * 页面上拉触底事件的处理函数
  98 + */
  99 + onReachBottom: function () {
  100 + this.scrollToLower('/api/weshop/plus/vip/mem/listBuyRecord', {
  101 + store_id: app.globalData.setting.stoid,
  102 + user_id: app.globalData.user_id,
  103 + });
  104 + },
  105 +
  106 + /**
  107 + * 用户点击右上角分享
  108 + */
  109 + onShareAppMessage: function () {
  110 +
  111 + },
  112 +
  113 +})
0 114 \ No newline at end of file
... ...
packageB/pages/user/buyDetails/buyDetails.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "购卡明细",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "nodata": "/components/nodata/nodata"
  6 + }
  7 +}
0 8 \ No newline at end of file
... ...
packageB/pages/user/buyDetails/buyDetails.wxml 0 → 100644
  1 +<wxs module="filter" src="../../../../utils/filter.wxs"></wxs>
  2 +<view class="list">
  3 + <view class="item" wx:for="{{list}}">
  4 + <view class="pd20 bdb">
  5 + <view class="fs24 c-a4">支付流水号 {{item.PayNo}}</view>
  6 + </view>
  7 + <view class="flex jc_sa t-c pd20">
  8 + <view class="w33 flex fdc">
  9 + <view class="fs24 c-a4 pdb10">PLUS卡名</view>
  10 + <view class="fs28 f1 flex ai_c jc-center"><text class="ellipsis-2">{{item.CardName}}</text></view>
  11 + </view>
  12 + <view class="w33 flex fdc">
  13 + <view class="fs24 c-a4 pdb10">有效期</view>
  14 + <view class="fs28 f1 flex ai_c jc-center">{{filter.show_default(item.EffectiveDate)}}</view>
  15 + </view>
  16 + <view class="w33 flex fdc">
  17 + <view class="fs24 c-a4 pdb10">提交时间</view>
  18 + <view class="fs28 f1 flex ai_c jc-center">{{item.BillDate}}</view>
  19 + </view>
  20 + </view>
  21 + <view class="bg-f8 pdh20 pdv10 flex jc_sb ai_c">
  22 + <text class="fs24 c-a4">类型:{{item.Buytype == 1 ? '购买':'续费'}}</text>
  23 + <text class="rmb c-red">{{item.CardFee}}</text>
  24 + </view>
  25 + </view>
  26 +
  27 +
  28 +
  29 + <nodata nodataContainer="t-c" wx:if="{{list.length == 0}}"></nodata>
  30 +</view>
  31 +
  32 +
  33 +
... ...
packageB/pages/user/buyDetails/buyDetails.wxss 0 → 100644
  1 +@charset "utf-8";
  2 +
  3 +.noMore {
  4 + padding: 20rpx;
  5 + color: #bbb;
  6 + text-align: center;
  7 + font-size: 22rpx;
  8 +}
  9 +
  10 +.c-a4 {
  11 + color: #a4a4a4;
  12 +}
  13 +
  14 +.c-red {
  15 + color: #FF6768;
  16 +}
  17 +
  18 +page {
  19 + background-color: #f0f0f0;
  20 +}
  21 +
  22 +
  23 +.list {
  24 + padding: 20rpx 20rpx 0 20rpx;
  25 +}
  26 +
  27 +.item {
  28 + background-color: white;
  29 + border-radius: 8rpx;
  30 + overflow: hidden;
  31 +}
  32 +
  33 +.item ~ .item {
  34 + margin-top: 20rpx;
  35 +}
  36 +
  37 +.rmb::before {
  38 + content: '¥';
  39 +}
0 40 \ No newline at end of file
... ...
pages/user/collect_list/collect_list.js renamed to packageB/pages/user/collect_list/collect_list.js
... ... @@ -2,13 +2,13 @@ var t = function(t) {
2 2 return t && t.__esModule ? t : {
3 3 default: t
4 4 };
5   - }(require("../../../utils/LoadMore.js")),
  5 + }(require("../../../../utils/LoadMore.js")),
6 6 e = getApp(),
7 7 a = e.request,
8 8 o = new t.default();
9 9 var oo = e.globalData.setting,
10 10 app_d = e.globalData;
11   -var ut = require('../../../utils/util.js');
  11 +var ut = require('../../../../utils/util.js');
12 12  
13 13 Page({
14 14 data: {
... ... @@ -29,6 +29,7 @@ Page({
29 29 isdelete: 0
30 30 },
31 31 onLoad: function() {
  32 +
32 33 o.init(this, "", "collects"),
33 34 this.requestCollectList();
34 35 },
... ... @@ -50,8 +51,11 @@ Page({
50 51 is_goods: 1
51 52 })
52 53 var goods_list = th.selectComponent("#goods_recommend"); //组件的id
53   - goods_list.init();
54   - setTimeout(function () { goods_list.get_list(); }, 300)
  54 + if (goods_list)
  55 + {
  56 + goods_list.init();
  57 + setTimeout(function () { goods_list.get_list(); }, 300)
  58 + }
55 59 }
56 60 });
57 61 },
... ... @@ -130,9 +134,8 @@ Page({
130 134  
131 135  
132 136 goto: function(ee) {
133   - wx.navigateTo({
134   - url: '/pages/index/index/index',
135   - })
  137 + getApp().goto("/pages/index/index/index");
  138 +
136 139 },
137 140 //编辑商品显示
138 141 editcollects: function() {
... ...
pages/user/collect_list/collect_list.json renamed to packageB/pages/user/collect_list/collect_list.json
pages/user/collect_list/collect_list.wxml renamed to packageB/pages/user/collect_list/collect_list.wxml
pages/user/collect_list/collect_list.wxss renamed to packageB/pages/user/collect_list/collect_list.wxss
pages/user/comment/comment.js renamed to packageB/pages/user/comment/comment.js
1   -var ut = require("../../../utils/util.js");
  1 +var ut = require("../../../../utils/util.js");
2 2 var t = function(t) {
3 3 return t && t.__esModule ? t : {
4 4 default: t
5 5 };
6   - }(require("../../../utils/LoadMore.js")),
  6 + }(require("../../../../utils/LoadMore.js")),
7 7 e = getApp(),
8 8 rq = e.request,
9 9 a = new t.default(),
10   - s = require("../../../utils/util.js"),
  10 + s = require("../../../../utils/util.js"),
11 11 oo = e.globalData,
12 12 os = e.globalData.setting;
13   -var regeneratorRuntime = require('../../../utils/runtime.js');
  13 +var regeneratorRuntime = require('../../../../utils/runtime.js');
14 14  
15 15 Page({
16 16 data: {
... ... @@ -117,7 +117,7 @@ Page({
117 117 var n = "?order_id=" + a[s].order_id;
118 118 n += "&goods_id=" + a[s].goods_id, n += "&price=" + a[s].goods_price;
119 119 wx.navigateTo({
120   - url: "/pages/user/add_comment/add_comment" + n
  120 + url: "/packageB/pages/user/add_comment/add_comment" + n
121 121 });
122 122 }
123 123 },
... ...
pages/user/comment/comment.json renamed to packageB/pages/user/comment/comment.json
pages/user/comment/comment.wxml renamed to packageB/pages/user/comment/comment.wxml
1   -<wxs module="filter" src="../../../utils/filter.wxs"></wxs>
  1 +<wxs module="filter" src="../../../../utils/filter.wxs"></wxs>
2 2 <view class="container">
3 3 <view class="type-navbar padding">
4 4 <view class="type-box fs28 type-navbar-item {{activeStatus==item.status?'type-item-on':''}}" data-status="{{item.status}}" wx:for="{{categories}}" wx:key="{{index}}">
... ... @@ -110,11 +110,11 @@
110 110 <view>查看订单</view>
111 111 </navigator>
112 112  
113   - <navigator wx:if="{{item.comment_id}}" class="commodity_To_evaluate flex-level comment_go" url="/pages/user/view_comment/view_comment?goods_id={{item.goods_id}}&order_id={{item.order_id}}">
  113 + <navigator wx:if="{{item.comment_id}}" class="commodity_To_evaluate flex-level comment_go" url="/packageB/pages/user/view_comment/view_comment?goods_id={{item.goods_id}}&order_id={{item.order_id}}">
114 114 <view>查看评价</view>
115 115 </navigator>
116 116  
117   - <navigator wx:if="{{!item.comment_id}}" bindtap="comment" data-recid="{{item.rec_id}}" class="commodity_To_evaluate flex-level comment_go" url="{{item.comment_id>0?'/pages/user/add_comment/add_comment?goods_id={{item.goods_id}}&order_id={{item.order_id}}':''}}">
  117 + <navigator wx:if="{{!item.comment_id}}" bindtap="comment" data-recid="{{item.rec_id}}" class="commodity_To_evaluate flex-level comment_go" url="{{item.comment_id>0?'/packageB/pages/user/add_comment/add_comment?goods_id={{item.goods_id}}&order_id={{item.order_id}}':''}}">
118 118 <view class="fs24">去评价</view>
119 119 </navigator>
120 120 </view>
... ...
pages/user/comment/comment.wxss renamed to packageB/pages/user/comment/comment.wxss
pages/user/user_coupon/c_filter.wxs renamed to packageB/pages/user/user_coupon/c_filter.wxs
packageB/pages/user/user_coupon/filter.wxs 0 → 100644
  1 +var format = function (text) {
  2 + if (!text) {
  3 + return
  4 + }
  5 + var reg = getRegExp('\\\\n', 'g')
  6 + return text.replace(reg, '\n')
  7 +}
  8 +
  9 +module.exports = {
  10 + format: format
  11 +}
... ...
pages/user/user_coupon/user_coupon.js renamed to packageB/pages/user/user_coupon/user_coupon.js
1   -// pages/user/user_coupon/user_coupon.js
2 1 var e = getApp(),os = e.globalData.setting;
3   -var utils = require('../../../utils/util.js');
4   -var regeneratorRuntime = require('../../../utils/runtime.js');
  2 +var utils = require('../../../../utils/util.js');
  3 +var regeneratorRuntime = require('../../../../utils/runtime.js');
5 4  
6 5 Page({
7 6 /**
... ...
pages/user/user_coupon/user_coupon.json renamed to packageB/pages/user/user_coupon/user_coupon.json
pages/user/user_coupon/user_coupon.wxml renamed to packageB/pages/user/user_coupon/user_coupon.wxml
pages/user/user_coupon/user_coupon.wxss renamed to packageB/pages/user/user_coupon/user_coupon.wxss
pages/user/view_comment/view_comment.js renamed to packageB/pages/user/view_comment/view_comment.js
1   -var i = require("../../../utils/util.js"),
  1 +var i = require("../../../../utils/util.js"),
2 2 ut = i;
3 3 var e = getApp(),
4 4 a = e.globalData.setting,
... ...
pages/user/view_comment/view_comment.json renamed to packageB/pages/user/view_comment/view_comment.json
pages/user/view_comment/view_comment.wxml renamed to packageB/pages/user/view_comment/view_comment.wxml
... ... @@ -93,7 +93,7 @@
93 93 <!-- 是否匿名评价 -->
94 94 <view class="Whether" wx:if="{{comment.length>0}}">
95 95 <view class="Submission flex-level ">
96   - <view class="fs30 flex-level white " bindtap="goto" data-url="/pages/user/comment/comment">评价其他</view>
  96 + <view class="fs30 flex-level white " bindtap="goto" data-url="/packageB/pages/user/comment/comment">评价其他</view>
97 97 </view>
98 98 <view class="flex-level" wx:if="{{is_act}}">
99 99 <view class="fs30 flex-level white receive" data-url="/pages/giftpack/evaluategift/evaluategift?actId={{actId}}&orderNumber={{order_id}}&orderGoodsId={{goods_id}}&giftBagId={{giftBagId}}" bindtap="goto">点击领取礼品</view>
... ...
pages/user/view_comment/view_comment.wxss renamed to packageB/pages/user/view_comment/view_comment.wxss
pages/cart/cart/cart.js
... ... @@ -29,6 +29,8 @@ Page({
29 29 card_field:"",
30 30 bconf:null,
31 31 btn_click:1,
  32 +
  33 + service_data:null,
32 34 },
33 35 onLoad: function() {
34 36 var a = this,ee=a;
... ... @@ -124,10 +126,7 @@ Page({
124 126 }
125 127 })
126 128  
127   -
128   -
129   -
130   -
  129 +
131 130 },
132 131  
133 132 onHide(){
... ... @@ -147,9 +146,11 @@ Page({
147 146 allsto: e
148 147 });
149 148 th.get_cart();
  149 + th.get_ser_cart();
150 150 })
151 151 } else {
152 152 th.get_cart();
  153 + th.get_ser_cart();
153 154 }
154 155  
155 156 //要获取会员是不是等级会员
... ... @@ -172,10 +173,18 @@ Page({
172 173 }
173 174 }
174 175 })
175   -
176   -
  176 + if( (!this.data.requestData || this.data.requestData.length==0) && (!this.data.service_data || this.data.service_data.length==0)) {
  177 + setTimeout(function () {
  178 + var goods_list = th.selectComponent("#goods_list"); //组件的id
  179 + if(goods_list){
  180 + goods_list.init();
  181 + goods_list.get_list();
  182 + }
  183 + }, 800)
  184 + }
177 185 },
178   - //-----真的获取购物车--------
  186 +
  187 + //-----真的获取购物车--------
179 188 get_cart: function() {
180 189 var th = this;
181 190 var rd = Math.random().toString(36).substr(2, 15);
... ... @@ -328,13 +337,7 @@ Page({
328 337 }
329 338 }
330 339  
331   - if(arr.length==0) {
332   - setTimeout(function () {
333   - var goods_list = th.selectComponent("#goods_list"); //组件的id
334   - goods_list.init();
335   - goods_list.get_list();
336   - }, 800)
337   - }
  340 +
338 341  
339 342 if(th.data.is_open_offline && th.data.is_open_offline>0){
340 343 //-- 此时要实时更新线下取价价格 --
... ... @@ -357,6 +360,106 @@ Page({
357 360 });
358 361 },
359 362  
  363 + //-----真的获取购物车--------
  364 + get_ser_cart: function() {
  365 + var th = this;
  366 + var rd = Math.random().toString(36).substr(2, 15);
  367 + getApp().request.get("/api/weshop/cartService/page", {
  368 + data: {
  369 + user_id: app.globalData.user_id,
  370 + rd: rd,
  371 + store_id: oo.stoid,
  372 + pageSize: 600,
  373 + },
  374 + success:async function(su) {
  375 + //按门店分类的数组
  376 + var arr = new Array(),
  377 + carr = su.data.data.pageData;
  378 + var all_num = 0;
  379 +
  380 + if(carr && carr.length>0) {
  381 + for (var i = 0; i < carr.length; i++) {
  382 + var item = carr[i];
  383 + var good = null;
  384 +
  385 + await getApp().request.promiseGet("/api/weshop/serviceCard/get/" + oo.stoid + "/" + item.service_id, {}).then(res => {
  386 + good = res.data.data;
  387 + })
  388 + if(!good){
  389 + var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  390 + getApp().request.delete(url, {
  391 + success: function (t) {
  392 + }
  393 + });
  394 + continue;
  395 + }
  396 +
  397 +
  398 + //如果商品下架了,或者商品是赠品,一开始都要清除
  399 + if (good.is_show == 0) {
  400 + var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  401 + getApp().request.delete(url, {
  402 + success: function (t) {
  403 + }
  404 + });
  405 + //商品已经下架
  406 + continue;
  407 + }
  408 +
  409 + all_num += item.goods_num;
  410 + item.img_url = oo.imghost + good.imgUrl;
  411 + item.selected = 0;
  412 +
  413 +
  414 + var pcid = item.pick_id;
  415 + var find = 0;
  416 + //---------循环查找门店---
  417 + if (arr.length > 0) {
  418 + for (var j = 0; j < arr.length; j++) {
  419 + if (arr[j].pid == pcid) {
  420 + arr[j].goods.push(item);
  421 + find = 1;
  422 + break;
  423 + }
  424 + }
  425 + }
  426 +
  427 + //------如果没有找到-----
  428 + if (find == 0) {
  429 + var pikname = '';
  430 + //找到门店名称
  431 + for (var k = 0; k < th.data.allsto.length; k++) {
  432 + if (pcid == th.data.allsto[k].pickup_id) {
  433 + pikname = th.data.allsto[k].pickup_name;
  434 + break;
  435 + }
  436 + }
  437 + var narr = new Array();
  438 + narr.push(item);
  439 + var ie = {
  440 + pid: pcid,
  441 + pname: pikname,
  442 + goods: narr,
  443 + selected: 0
  444 + };
  445 + arr.push(ie);
  446 + }
  447 + }
  448 + }
  449 +
  450 +
  451 + th.setData({
  452 + service_data: arr,
  453 + all_num2: all_num,
  454 + is_edit: 0
  455 + }),
  456 + th.doCheckAll(), wx.stopPullDownRefresh();
  457 +
  458 + }
  459 + });
  460 + },
  461 +
  462 +
360 463 //设置莫个门店的所有线下价格
361 464 async set_offline(list){
362 465 var th=this;
... ... @@ -444,7 +547,6 @@ Page({
444 547 };
445 548 th.postCardList(s, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
446 549 }
447   -
448 550 },
449 551  
450 552 //-------------加数量---------------------
... ... @@ -464,7 +566,6 @@ Page({
464 566 goods_id: a.goods_id,
465 567 store_id: oo.stoid
466 568 };
467   - isShowLoading: 0;
468 569 this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
469 570 } else {
470 571 wx.showModal({
... ... @@ -500,66 +601,180 @@ Page({
500 601 this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
501 602 }
502 603 },
503   - //---------------全选,全选的时候要判断是否门店的匹配方式一致--------------
  604 +
  605 +
  606 + //-----------------点击输入修改商品数量---------------
  607 + valueToNum_ser: function(t) {
  608 + if(!this.data.is_load) return false;
  609 + //控制住,避免事件响应冲突,只有input有输入的时候,才刷新
  610 + if(this.data.btn_click){
  611 + return false;
  612 + }
  613 + this.data.btn_click=1;
  614 +
  615 + var a = t.currentTarget.dataset.item;
  616 + var b = t.currentTarget.dataset.pitems;
  617 + a = this.data.service_data[b].goods[a];
  618 + var e = a;
  619 + var th=this;
  620 +
  621 + if (a = isNaN(t.detail.value) || t.detail.value < 1 ? 1 : parseInt(t.detail.value)) {
  622 + var s = {
  623 + goods_num: a,
  624 + goods_id: e.goods_id,
  625 + id: e.id,
  626 + store_id: oo.stoid
  627 + };
  628 + th.postCardList_ser(s, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
  629 + }
  630 + },
  631 + //-------------加数量---------------------
  632 + addNum_ser: function(t) {
  633 + if(!this.data.is_load) return false;
  634 + if (this.data.up_dating == 1) return false;
  635 + this.data.up_dating = 1;
  636 +
  637 + var a = t.currentTarget.dataset.item;
  638 + var b = t.currentTarget.dataset.pitems;
  639 + a = this.data.service_data[b].goods[a];
  640 +
  641 + var e = {
  642 + goods_num: a.goods_num + 1,
  643 + id: a.id,
  644 + goods_id: a.goods_id,
  645 + store_id: oo.stoid
  646 + };
  647 + this.postCardList_ser(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
  648 +
  649 + },
  650 + //-------------减数量---------------------
  651 + subNum_ser: function(t) {
  652 + if(!this.data.is_load) return false;
  653 + if (this.data.up_dating == 1) return false;
  654 + this.data.up_dating = 1;
  655 +
  656 + var a = t.currentTarget.dataset.item;
  657 + var b = t.currentTarget.dataset.pitems;
  658 + a = this.data.service_data[b].goods[a];
  659 + this.data.btn_click=1;
  660 +
  661 + if (a.goods_num - 1 < 0){
  662 + this.data.up_dating = 0;
  663 + return false;
  664 + }
  665 +
  666 + if (1 != a.goods_num) {
  667 + var e = {
  668 + goods_num: a.goods_num - 1,
  669 + id: a.id,
  670 + goods_id: a.goods_id,
  671 + store_id: oo.stoid
  672 + };
  673 + this.postCardList_ser(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
  674 + }
  675 + },
  676 +
  677 +
  678 + //---------------全选,全选的时候要判断是否门店的匹配方式一致--------------
504 679 checkAll: function() {
505 680 var e = this,
506 681 dda = e.data.requestData,
  682 + sdda = e.data.service_data,
507 683 tfeel = 0,
508 684 t_num = 0,
509 685 text_arr = "";
  686 +
  687 + if(e.data.requestData && e.data.requestData.length>0
  688 + && e.data.service_data && e.data.service_data.length>0){
  689 + wx.showModal({
  690 + title: '提示',
  691 + content: '服务卡项目不能和商品一起选择'
  692 + });
  693 + return false;
  694 + }
  695 +
510 696 this.data.btn_click=1;
511 697  
512   - for (var i = 0; i < dda.length; i++) {
513   - var item = dda[i].goods;
514   - if (!e.data.checkAllToggle) {
515   - var txt = "requestData[" + i + "].selected";
516   - e.setData({
517   - [txt]: 0,
518   - });
519   - }
520   - var fir = 0;
521   - for (var j = 0; j < item.length; j++) {
522   - if(item[j].is_gift) continue;
523   - if (fir == 0) {
524   - fir = item[j].distr_type;
525   - } else {
526   - //如果同一门店有不同门店的商品,不能同一配送
527   - if (fir != item[j].distr_type && !e.data.checkAllToggle && item[j].distr_type != 0) {
528   - text_arr += item[j].goods_name + " ";
529   - break;
  698 + if(dda && dda.length>0){
  699 + for (var i = 0; i < dda.length; i++) {
  700 + var item = dda[i].goods;
  701 + if (!e.data.checkAllToggle) {
  702 + var txt = "requestData[" + i + "].selected";
  703 + e.setData({
  704 + [txt]: 0,
  705 + });
  706 + }
  707 + var fir = 0;
  708 + for (var j = 0; j < item.length; j++) {
  709 + if(item[j].is_gift) continue;
  710 + if (fir == 0) {
  711 + fir = item[j].distr_type;
  712 + } else {
  713 + //如果同一门店有不同门店的商品,不能同一配送
  714 + if (fir != item[j].distr_type && !e.data.checkAllToggle && item[j].distr_type != 0) {
  715 + text_arr += item[j].goods_name + " ";
  716 + break;
  717 + }
  718 + }
  719 + var txt = "requestData[" + i + "].goods[" + j + "].selected"
  720 + e.setData({
  721 + [txt]: !e.data.checkAllToggle,
  722 + })
  723 + if (!e.data.checkAllToggle) {
  724 + tfeel += item[j].goods_num * item[j].goods_price;
  725 + t_num += item[j].goods_num;
530 726 }
531 727 }
532   - var txt = "requestData[" + i + "].goods[" + j + "].selected"
  728 + }
  729 +
  730 + if (text_arr != "") {
  731 + wx.showModal({
  732 + title: '提示',
  733 + content: text_arr + '不能与门店中其他商品一起结算,配送方式不一致'
  734 + });
  735 + return false;
  736 + } else {
533 737 e.setData({
534   - [txt]: !e.data.checkAllToggle,
535   - })
536   - if (!e.data.checkAllToggle) {
537   - tfeel += item[j].goods_num * item[j].goods_price;
538   - t_num += item[j].goods_num;
  738 + checkAllToggle: !e.data.checkAllToggle,
  739 + total_fee: tfeel.toFixed(2),
  740 + total_num: t_num,
  741 + });
  742 +
  743 + for(var i in e.data.requestData){
  744 + e.check_prom_activity(i)
539 745 }
540 746 }
541 747 }
542 748  
543   - if (text_arr != "") {
544   - wx.showModal({
545   - title: '提示',
546   - content: text_arr + '不能与门店中其他商品一起结算,配送方式不一致'
547   - });
548   - return false;
549   - } else {
  749 + if(sdda && sdda.length>0){
  750 + for (var i = 0; i < sdda.length; i++) {
  751 + var item = sdda[i].goods;
  752 + if (!e.data.checkAllToggle) {
  753 + var txt = "service_data[" + i + "].selected";
  754 + e.setData({
  755 + [txt]: 0,
  756 + });
  757 + }
  758 + var fir = 0;
  759 + for (var j = 0; j < item.length; j++) {
  760 + var txt = "service_data[" + i + "].goods[" + j + "].selected"
  761 + e.setData({
  762 + [txt]: !e.data.checkAllToggle,
  763 + })
  764 + if (!e.data.checkAllToggle) {
  765 + tfeel += item[j].goods_num * item[j].money;
  766 + t_num += item[j].goods_num;
  767 + }
  768 + }
  769 + }
550 770 e.setData({
551 771 checkAllToggle: !e.data.checkAllToggle,
552 772 total_fee: tfeel.toFixed(2),
553 773 total_num: t_num,
554 774 });
555   -
556   - for(var i in e.data.requestData){
557   - e.check_prom_activity(i)
558   - }
559   -
560 775 }
561   - },
562 776  
  777 + },
563 778 //------门店全选按钮,要判断是否门店的匹配方式一致---------
564 779 check_th_all_item:async function(ele) {
565 780 var e = this,
... ... @@ -567,10 +782,32 @@ Page({
567 782 item = this.data.requestData[pitems].goods,
568 783 sele = this.data.requestData[pitems].selected;
569 784 this.data.btn_click=1;
  785 + var garr=e.data.service_data;
570 786  
571 787 var isok = 1,
572 788 fir = 0,
573 789 iarr = item;
  790 +
  791 + if(!sele){
  792 + var check_is_service_selected=0;
  793 + for (var ii in garr){
  794 + for (var ij in garr[ii].goods){
  795 + if( garr[ii].goods[ij].selected){
  796 + check_is_service_selected=1;
  797 + break;
  798 + }
  799 + }
  800 + }
  801 +
  802 + if(check_is_service_selected){
  803 + wx.showModal({
  804 + title: '提示',
  805 + content: '服务卡项目不能和商品一起选择'
  806 + });
  807 + return false;
  808 + }
  809 + }
  810 +
574 811 if (!sele && item.length > 0) {
575 812 for (var i = 0; i < iarr.length; i++) {
576 813 if(iarr[i].is_gift==1) continue;
... ... @@ -612,7 +849,6 @@ Page({
612 849 }
613 850 this.doCheckAll();
614 851 },
615   -
616 852 //---------------单选,也要判断门店的配送方式是否一致--------------
617 853 check_th_item: async function(t) {
618 854 var e = this,
... ... @@ -622,13 +858,32 @@ Page({
622 858 var isok = 1,fir = 0;
623 859 var iarr = e.data.requestData[pitems].goods;
624 860 this.data.btn_click=1;
625   -
  861 + var garr= e.data.service_data;
  862 +
  863 + if (!a.selected) {
  864 + var check_is_service_selected = 0;
  865 + for (var ii in garr) {
  866 + for (var ij in garr[ii].goods) {
  867 + if (garr[ii].goods[ij].selected) {
  868 + check_is_service_selected = 1;
  869 + break;
  870 + }
  871 + }
  872 + }
  873 + if (check_is_service_selected) {
  874 + wx.showModal({
  875 + title: '提示',
  876 + content: '服务卡项目不能和商品一起选择'
  877 + });
  878 + return false;
  879 + }
  880 + }
626 881  
627 882 //当数量大于1,且是选择的时候
628 883 if (iarr.length > 1 && !a.selected) {
  884 +
629 885 for (var i = 0; i < iarr.length; i++) {
630 886 if(iarr[i].is_gift==1) continue;
631   -
632 887 //---当不是本身选择项目----
633 888 var sel = iarr[i].selected;
634 889 if (iarr[i].distr_type != 0 && (sel || iarr[i].id == a.id)) {
... ... @@ -662,10 +917,93 @@ Page({
662 917 if(i!=pitems) await e.check_prom_activity(i);
663 918 }
664 919 }
665   -
666 920 this.doCheckAll();
667 921 }
668 922 },
  923 +
  924 + //------门店全选按钮,要判断是否门店的匹配方式一致---------
  925 + check_th_all_item_ser:async function(ele) {
  926 + var e = this,
  927 + pitems = ele.currentTarget.dataset.pitems,
  928 + item = this.data.service_data[pitems].goods,
  929 + sele = this.data.service_data[pitems].selected;
  930 + this.data.btn_click=1;
  931 + var garr= e.data.requestData;
  932 +
  933 + var isok = 1,
  934 + fir = 0,
  935 + iarr = item;
  936 +
  937 + if(!sele){
  938 + var check_is_goods_selected=0;
  939 + for (var ii in garr){
  940 + for (var ij in garr[ii].goods){
  941 + if( garr[ii].goods[ij].selected){
  942 + check_is_goods_selected=1;
  943 + break;
  944 + }
  945 + }
  946 + }
  947 + if(check_is_goods_selected){
  948 + wx.showModal({
  949 + title: '提示',
  950 + content: '服务卡项目不能和商品一起选择'
  951 + });
  952 + return false;
  953 + }
  954 + }
  955 +
  956 + for (var i = 0; i < item.length; i++) {
  957 + var txt = "service_data[" + pitems + "].goods[" + i + "].selected";
  958 + e.setData({
  959 + [txt]: Number(!sele),
  960 + });
  961 + }
  962 + var txt = "service_data[" + pitems + "].selected";
  963 + e.setData({
  964 + [txt]: Number(!sele),
  965 + });
  966 + this.doCheckAll();
  967 + },
  968 + //---------------单选,也要判断门店的配送方式是否一致--------------
  969 + check_th_item_ser: async function(t) {
  970 + var e = this,
  971 + item = t.currentTarget.dataset.item,
  972 + pitems = t.currentTarget.dataset.pitems;
  973 + a = this.data.service_data[pitems].goods[item];
  974 + var isok = 1,fir = 0;
  975 + var iarr = e.data.service_data[pitems].goods;
  976 + this.data.btn_click=1;
  977 +
  978 + var garr= e.data.requestData;
  979 +
  980 + if(!a.selected){
  981 + var check_is_goods_selected=0;
  982 + for (var ii in garr){
  983 + for (var ij in garr[ii].goods){
  984 + if( garr[ii].goods[ij].selected){
  985 + check_is_goods_selected=1;
  986 + break;
  987 + }
  988 + }
  989 + }
  990 +
  991 + if(check_is_goods_selected){
  992 + wx.showModal({
  993 + title: '提示',
  994 + content: '服务卡项目不能和商品一起选择'
  995 + });
  996 + return false;
  997 + }
  998 + }
  999 +
  1000 + var txt = "service_data[" + pitems + "].goods[" + item + "].selected";
  1001 + e.setData({
  1002 + [txt]: Number(!a.selected),
  1003 + });
  1004 + this.doCheckAll();
  1005 + },
  1006 +
669 1007 //----------检查是否全选---------
670 1008 doCheckAll: function() {
671 1009 var th = this,
... ... @@ -673,49 +1011,80 @@ Page({
673 1011 t_num = 0,
674 1012 ischeck = 1,
675 1013 car = this.data.requestData,
  1014 + car2 = this.data.service_data,
676 1015 all_num = 0;
677 1016  
678   - for (var a = 0; a < car.length; a++) {
679   - var c_item=car[a];
680   - var item = car[a].goods,
681   - is_s_sele = 1;
682   - var offline_price=0;
683   - var offline_num=0;
684   - for (var c = 0; c < item.length; c++) {
685   - if(item[c].is_gift) continue;
686   - all_num += item[c].goods_num;
687   - if (item[c].selected == 0) {
688   - ischeck = 0;
689   - is_s_sele = 0;
690   - } else {
691   - tfeel += item[c].goods_num * item[c].goods_price;
692   - t_num += item[c].goods_num;
  1017 + //-- 购物车 --
  1018 + if(car && car.length>0){
  1019 + for (var a = 0; a < car.length; a++) {
  1020 + var c_item=car[a];
  1021 + var item = car[a].goods,
  1022 + is_s_sele = 1;
  1023 + var offline_price=0;
  1024 + var offline_num=0;
  1025 + for (var c = 0; c < item.length; c++) {
  1026 + if(item[c].is_gift) continue;
  1027 + all_num += item[c].goods_num;
  1028 + if (item[c].selected == 0) {
  1029 + ischeck = 0;
  1030 + is_s_sele = 0;
  1031 + } else {
  1032 + tfeel += item[c].goods_num * item[c].goods_price;
  1033 + t_num += item[c].goods_num;
  1034 + }
  1035 +
  1036 + //-- 如果这个商品是线下取价的时候 --
  1037 + if(item[c].is_offline){
  1038 + offline_price+= (item[c].goods_price-item[c].offline_price)*item[c].goods_num;
  1039 + offline_num+=item[c].goods_num;
  1040 + }
  1041 +
693 1042 }
694 1043  
695   - //-- 如果这个商品是线下取价的时候 --
696   - if(item[c].is_offline){
697   - offline_price+= (item[c].goods_price-item[c].offline_price)*item[c].goods_num;
698   - offline_num+=item[c].goods_num;
  1044 + var txt = "requestData[" + a + "].selected";
  1045 + th.setData({
  1046 + [txt]: Number(is_s_sele)
  1047 + });
  1048 +
  1049 + //当有线下取价的时候
  1050 + if(offline_price){
  1051 + var txt1= "requestData[" + a + "].offline_price";
  1052 + var txt2= "requestData[" + a + "].offline_num";
  1053 + th.setData({
  1054 + [txt1]: offline_price.toFixed(2),
  1055 + [txt2]: offline_num,
  1056 + });
699 1057 }
700 1058  
701 1059 }
  1060 + }
702 1061  
703   - var txt = "requestData[" + a + "].selected";
704   - th.setData({
705   - [txt]: Number(is_s_sele)
706   - });
  1062 + //-- 服务卡 --
  1063 + if(car2 && car2.length>0){
  1064 + for (var a = 0; a < car2.length; a++) {
  1065 + var c_item=car2[a];
  1066 + var item = car2[a].goods, is_s_sele = 1;
  1067 +
  1068 + for (var c = 0; c < item.length; c++) {
  1069 + if(item[c].is_gift) continue;
  1070 + all_num += item[c].goods_num;
  1071 + if (item[c].selected == 0) {
  1072 + ischeck = 0;
  1073 + is_s_sele = 0;
  1074 + } else {
  1075 + tfeel += item[c].goods_num * item[c].money;
  1076 + t_num += item[c].goods_num;
  1077 + }
  1078 +
  1079 + }
707 1080  
708   - //当有线下取价的时候
709   - if(offline_price){
710   - var txt1= "requestData[" + a + "].offline_price";
711   - var txt2= "requestData[" + a + "].offline_num";
  1081 + var txt = "service_data[" + a + "].selected";
712 1082 th.setData({
713   - [txt1]: offline_price.toFixed(2),
714   - [txt2]: offline_num,
  1083 + [txt]: Number(is_s_sele)
715 1084 });
716 1085 }
717   -
718 1086 }
  1087 +
719 1088 this.setData({
720 1089 checkAllToggle: ischeck,
721 1090 total_fee: tfeel.toFixed(2),
... ... @@ -904,6 +1273,20 @@ Page({
904 1273 });
905 1274 },
906 1275  
  1276 + //----------------------更新购物数量,加减,调用接口---------------------
  1277 + postCardList_ser: function(t, item, pitem) {
  1278 + var e = this,th=e;
  1279 + var user_id = getApp().globalData.user_id;
  1280 + var txt = "service_data[" + pitem + "].goods[" + item + "].goods_num";
  1281 + e.setData({
  1282 + [txt]: t.goods_num
  1283 + });
  1284 + e.doCheckAll();
  1285 + e.update_cart_ser(t, pitem, item);
  1286 + },
  1287 +
  1288 +
  1289 +
907 1290 //---检验线下库存的数量---
908 1291 async check_down_line(t, pitem, item,erpwareid){
909 1292 var ob={},th=this;
... ... @@ -993,6 +1376,25 @@ Page({
993 1376 });
994 1377 },
995 1378  
  1379 + //--更新购物车---
  1380 + update_cart_ser: function(t, pitem, item) {
  1381 + var e = this;
  1382 + getApp().request.put("/api/weshop/cartService/update", {
  1383 + data: t,
  1384 + success:async function(ee) {
  1385 + var txt = "service_data[" + pitem + "].goods[" + item + "].goods_num";
  1386 + e.setData({
  1387 + [txt]: t.goods_num,
  1388 + });
  1389 + e.doCheckAll();
  1390 + getApp().requestCardNum(e);
  1391 + }
  1392 + });
  1393 + },
  1394 +
  1395 +
  1396 +
  1397 +
996 1398 //-------下拉刷新---------
997 1399 onPullDownRefresh: function(t) {
998 1400 this.getCardList();
... ... @@ -1008,259 +1410,293 @@ Page({
1008 1410 })
1009 1411 }
1010 1412  
1011   - var glist = ""; //用逗号隔开的
1012   - var map = new Map(); //使用map值键进行运算
1013   - var map_limit = new Map(); //使用map值键进行存储限购
1014   - var g_arr = new Array(); //已选的商品列表
1015   - var user_id = getApp().globalData.user_id;
1016   - var th = this;
1017   - //用于判断是不是积分购的普通购买
1018   - var normal_arr={};
1019   - var ab = 0; //选中
1020   - wx.showLoading();
1021   - for (var i = 0; i < this.data.requestData.length; i++) {
1022   - var i_arr = this.data.requestData[i].goods;
1023   - for (var j = 0; j < i_arr.length; j++) {
1024   - if (i_arr[j].selected && i_arr[j].is_gift!=1) {
1025   -
1026   - if(i_arr[j].is_pd_normal) {
1027   - normal_arr[i_arr[j].goods_id]=1;
1028   - }
1029   - //map 的key是不会重复,会覆盖,,
1030   - var ie = {
1031   - goods_id: i_arr[j].goods_id,
1032   - id: i_arr[j].id,
1033   - goods_price: i_arr[j].goods_price,
1034   - };
1035   - //判断是不是线下取价
1036   - if(i_arr[j].is_offline){
1037   - ie.is_offline=i_arr[j].is_offline;
1038   - ie.offline_price=i_arr[j].offline_price;
1039   - ie.pricing_type=i_arr[j].pricing_type;
1040   - }
1041   - g_arr.push(ie);
1042   -
1043   - if (map.has(i_arr[j].goods_id + "")) {
1044   - var num11 = map.get(i_arr[j].goods_id + "");
1045   - var num22 = parseInt(i_arr[j].goods_num) + parseInt(num11);
1046   - map.set(i_arr[j].goods_id + "", num22);
1047   - } else {
1048   - map.set(i_arr[j].goods_id + "", i_arr[j].goods_num);
  1413 + var garr=this.data.requestData;
  1414 + var check_is_goods_selected=0;
  1415 + if(garr) {
  1416 + for (var ii in garr) {
  1417 + for (var ij in garr[ii].goods) {
  1418 + if (garr[ii].goods[ij].selected) {
  1419 + check_is_goods_selected = 1;
  1420 + break;
1049 1421 }
1050   - glist += i_arr[j].goods_id + ",";
1051   - ab = 1;
1052   - //--普通商品,如果有开启线下库存的功能,要调用线下库存进行计算,赠品不要进行调用线下库存---
1053   - if((i_arr[j].prom_type==0 || i_arr[j].prom_type==3 || i_arr[j].prom_type==5) && th.data.sales_rules==2 && i_arr[j].is_gift!=1){
1054   - //--获取商品的线下商品ID--
1055   - var gd=null;
1056   - await getApp().request.promiseGet("/api/weshop/goods/get/" + oo.stoid + "/" + i_arr[j].goods_id,{}).then(res=>{
1057   - if(res.data.code==0) gd=res.data.data;
1058   - })
1059   - //--判断商品是线下库存--
1060   - var ob={}
1061   - await th.check_down_line_next(i_arr[j],i,j,gd.erpwareid,function(rs){
1062   - ob=rs;
1063   - });
1064   - if(ob.code==-1){
1065   - t.my_warnning(gd.goods_name+"门店库存不足", 0, th);
1066   - wx.hideLoading();
1067   - return false;
  1422 + }
  1423 + }
  1424 + }
  1425 + //-- 如果是商品的结算 --
  1426 + if(check_is_goods_selected) {
  1427 + var glist = ""; //用逗号隔开的
  1428 + var map = new Map(); //使用map值键进行运算
  1429 + var map_limit = new Map(); //使用map值键进行存储限购
  1430 + var g_arr = new Array(); //已选的商品列表
  1431 + var user_id = getApp().globalData.user_id;
  1432 + var th = this;
  1433 + //用于判断是不是积分购的普通购买
  1434 + var normal_arr = {};
  1435 + var ab = 0; //选中
  1436 + wx.showLoading();
  1437 + for (var i = 0; i < this.data.requestData.length; i++) {
  1438 + var i_arr = this.data.requestData[i].goods;
  1439 + for (var j = 0; j < i_arr.length; j++) {
  1440 + if (i_arr[j].selected && i_arr[j].is_gift != 1) {
  1441 +
  1442 + if (i_arr[j].is_pd_normal) {
  1443 + normal_arr[i_arr[j].goods_id] = 1;
1068 1444 }
1069   -
1070   - var is_ok=1;
1071   - //如果是优惠活动话,要看活动有没有过期
1072   - if(i_arr[j].prom_type==3){
1073   - //判断有没有活动
1074   - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+i_arr[j].goods_id+"/1", {}).then(res => {
1075   - if(res.data.code==0){
1076   - if(!res.data.data.promGoodsLists){
1077   - t.my_warnning(i_arr[j].goods_name+"优惠活动已经过期", 0, th);
1078   - wx.hideLoading();
1079   - is_ok=0;
1080   - }
1081   - }
1082   - })
  1445 + //map 的key是不会重复,会覆盖,,
  1446 + var ie = {
  1447 + goods_id: i_arr[j].goods_id,
  1448 + id: i_arr[j].id,
  1449 + goods_price: i_arr[j].goods_price,
  1450 + };
  1451 + //判断是不是线下取价
  1452 + if (i_arr[j].is_offline) {
  1453 + ie.is_offline = i_arr[j].is_offline;
  1454 + ie.offline_price = i_arr[j].offline_price;
  1455 + ie.pricing_type = i_arr[j].pricing_type;
1083 1456 }
1084   - if(!is_ok){return false;}
1085   - }
  1457 + g_arr.push(ie);
  1458 +
  1459 + if (map.has(i_arr[j].goods_id + "")) {
  1460 + var num11 = map.get(i_arr[j].goods_id + "");
  1461 + var num22 = parseInt(i_arr[j].goods_num) + parseInt(num11);
  1462 + map.set(i_arr[j].goods_id + "", num22);
  1463 + } else {
  1464 + map.set(i_arr[j].goods_id + "", i_arr[j].goods_num);
  1465 + }
  1466 + glist += i_arr[j].goods_id + ",";
  1467 + ab = 1;
  1468 + //--普通商品,如果有开启线下库存的功能,要调用线下库存进行计算,赠品不要进行调用线下库存---
  1469 + if ((i_arr[j].prom_type == 0 || i_arr[j].prom_type == 3 || i_arr[j].prom_type == 5) && th.data.sales_rules == 2 && i_arr[j].is_gift != 1) {
  1470 + //--获取商品的线下商品ID--
  1471 + var gd = null;
  1472 + await getApp().request.promiseGet("/api/weshop/goods/get/" + oo.stoid + "/" + i_arr[j].goods_id, {}).then(res => {
  1473 + if (res.data.code == 0) gd = res.data.data;
  1474 + })
  1475 + //--判断商品是线下库存--
  1476 + var ob = {}
  1477 + await th.check_down_line_next(i_arr[j], i, j, gd.erpwareid, function (rs) {
  1478 + ob = rs;
  1479 + });
  1480 + if (ob.code == -1) {
  1481 + t.my_warnning(gd.goods_name + "门店库存不足", 0, th);
  1482 + wx.hideLoading();
  1483 + return false;
  1484 + }
1086 1485  
1087   - } else {
1088   - if(i_arr[j].is_gift==1) continue;
1089   - rq.put("/api/weshop/cart/update", {
1090   - data: {
1091   - id: i_arr[j].id,
1092   - selected: 0,
1093   - store_id: oo.stoid
1094   - },
1095   - success: function(ee) {
1096   - console.log(ee);
  1486 + var is_ok = 1;
  1487 + //如果是优惠活动话,要看活动有没有过期
  1488 + if (i_arr[j].prom_type == 3) {
  1489 + //判断有没有活动
  1490 + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + i_arr[j].goods_id + "/1", {}).then(res => {
  1491 + if (res.data.code == 0) {
  1492 + if (!res.data.data.promGoodsLists) {
  1493 + t.my_warnning(i_arr[j].goods_name + "优惠活动已经过期", 0, th);
  1494 + wx.hideLoading();
  1495 + is_ok = 0;
  1496 + }
  1497 + }
  1498 + })
  1499 + }
  1500 + if (!is_ok) {
  1501 + return false;
  1502 + }
1097 1503 }
1098   - });
1099   - }
1100   - }
1101   - }
1102   - if (ab == 0) {
1103   - t.my_warnning("未选择商品", 0, th);
1104   - wx.hideLoading();
1105   - return false;
1106   - }
1107 1504  
1108   - glist = glist.substring(0, glist.length - 1);
1109   - //--取一下商品的限购 以及活动的限购,redis数量--
1110   - rq.get("/api/weshop/goods/getGoodsListNum", {
1111   - data: {
1112   - goodsidlist: glist,
1113   - store_id: oo.stoid
1114   - },
1115   - async success(ee) {
1116   - console.log(ee);
1117   - if (ee.data.code == 0) {
1118   - var ddata = ee.data.data,
1119   - isok = 1,
1120   - gname = "",
1121   - err = "";
1122   - //--组装--
1123   - for (var ij = 0; ij < ddata.length; ij++) {
1124   - var val = ddata[ij];
1125   - var obj = map_limit.get(val.goods_id + "");
1126   - if (obj) continue;
1127   -
1128   - var promgoodsbuynum = 0;
1129   - var goodsbuynum = 0;
1130   - //--要获得商品,该用户买了多少件,同步应用--
1131   - await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
  1505 + } else {
  1506 + if (i_arr[j].is_gift == 1) continue;
  1507 + rq.put("/api/weshop/cart/update", {
1132 1508 data: {
1133   - store_id: oo.stoid,
1134   - user_id: user_id,
1135   - goods_id: val.goods_id,
1136   - prom_type: val.prom_type,
1137   - prom_id: val.prom_id
  1509 + id: i_arr[j].id,
  1510 + selected: 0,
  1511 + store_id: oo.stoid
1138 1512 },
1139   - }).then(res => {
1140   - var buy_num_data = res.data.data;
1141   - if (buy_num_data.promgoodsbuynum) promgoodsbuynum = buy_num_data.promgoodsbuynum;
1142   - goodsbuynum = buy_num_data.goodsbuynum;
1143   - })
1144   - var ie= {
1145   - promgoodsbuynum: promgoodsbuynum,
1146   - goodsbuynum: goodsbuynum
1147   - };
1148   - map_limit.set(val.goods_id + "", ie);
  1513 + success: function (ee) {
  1514 + console.log(ee);
  1515 + }
  1516 + });
1149 1517 }
  1518 + }
  1519 + }
  1520 + if (ab == 0) {
  1521 + t.my_warnning("未选择商品", 0, th);
  1522 + wx.hideLoading();
  1523 + return false;
  1524 + }
1150 1525  
1151   - try {
1152   - for(var ind in ddata) {
1153   - var val=ddata[ind];
1154   - var num = map.get(val.goods_id + "");
1155   - if (num <= 0) {
1156   - isok = 0;
1157   - gname = val.goods_name;
1158   - throw "购买数量不能为0";
1159   - return false;
1160   - }
  1526 + glist = glist.substring(0, glist.length - 1);
  1527 + //--取一下商品的限购 以及活动的限购,redis数量--
  1528 + rq.get("/api/weshop/goods/getGoodsListNum", {
  1529 + data: {
  1530 + goodsidlist: glist,
  1531 + store_id: oo.stoid
  1532 + },
  1533 + async success(ee) {
  1534 + console.log(ee);
  1535 + if (ee.data.code == 0) {
  1536 + var ddata = ee.data.data,
  1537 + isok = 1,
  1538 + gname = "",
  1539 + err = "";
  1540 + //--组装--
  1541 + for (var ij = 0; ij < ddata.length; ij++) {
  1542 + var val = ddata[ij];
  1543 + var obj = map_limit.get(val.goods_id + "");
  1544 + if (obj) continue;
  1545 +
  1546 + var promgoodsbuynum = 0;
  1547 + var goodsbuynum = 0;
  1548 + //--要获得商品,该用户买了多少件,同步应用--
  1549 + await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
  1550 + data: {
  1551 + store_id: oo.stoid,
  1552 + user_id: user_id,
  1553 + goods_id: val.goods_id,
  1554 + prom_type: val.prom_type,
  1555 + prom_id: val.prom_id
  1556 + },
  1557 + }).then(res => {
  1558 + var buy_num_data = res.data.data;
  1559 + if (buy_num_data.promgoodsbuynum) promgoodsbuynum = buy_num_data.promgoodsbuynum;
  1560 + goodsbuynum = buy_num_data.goodsbuynum;
  1561 + })
  1562 + var ie = {
  1563 + promgoodsbuynum: promgoodsbuynum,
  1564 + goodsbuynum: goodsbuynum
  1565 + };
  1566 + map_limit.set(val.goods_id + "", ie);
  1567 + }
1161 1568  
1162   - if(val.prom_type==1 || val.prom_type==6){
1163   - if (num > val.store_count) {
  1569 + try {
  1570 + for (var ind in ddata) {
  1571 + var val = ddata[ind];
  1572 + var num = map.get(val.goods_id + "");
  1573 + if (num <= 0) {
1164 1574 isok = 0;
1165 1575 gname = val.goods_name;
1166   - throw "超出库存";
  1576 + throw "购买数量不能为0";
1167 1577 return false;
1168 1578 }
1169   - }
1170 1579  
1171   - if(th.data.sales_rules!=2){
1172   - if (num > val.store_count) {
  1580 + if (val.prom_type == 1 || val.prom_type == 6) {
  1581 + if (num > val.store_count) {
  1582 + isok = 0;
  1583 + gname = val.goods_name;
  1584 + throw "超出库存";
  1585 + return false;
  1586 + }
  1587 + }
  1588 +
  1589 + if (th.data.sales_rules != 2) {
  1590 + if (num > val.store_count) {
  1591 + isok = 0;
  1592 + gname = val.goods_name;
  1593 + throw "超出库存";
  1594 + return false;
  1595 + }
  1596 + }
  1597 +
  1598 + if (num > val.redisnum && val.redisnum && !normal_arr[val.goods_id]) {
1173 1599 isok = 0;
1174 1600 gname = val.goods_name;
1175   - throw "超出库存";
  1601 + throw "超出活动库存";
  1602 + return false;
  1603 + }
  1604 + if (num > val.goods_num - val.buy_num && val.goods_num && !normal_arr[val.goods_id]) {
  1605 + isok = 0;
  1606 + gname = val.goods_name;
  1607 + throw "超出活动库存";
1176 1608 return false;
1177 1609 }
1178   - }
1179   -
1180   - if (num > val.redisnum && val.redisnum && !normal_arr[val.goods_id]) {
1181   - isok = 0;
1182   - gname = val.goods_name;
1183   - throw "超出活动库存";
1184   - return false;
1185   - }
1186   - if (num > val.goods_num - val.buy_num && val.goods_num && !normal_arr[val.goods_id]) {
1187   - isok = 0;
1188   - gname = val.goods_name;
1189   - throw "超出活动库存";
1190   - return false;
1191   - }
1192   -
1193   - var buyed = map_limit.get(val.goods_id + "");
1194   - if (num + buyed.goodsbuynum > val.viplimited && val.viplimited > 0) {
1195   - isok = 0;
1196   - gname = val.goods_name;
1197   - throw "超出商品限购";
1198   - return false;
1199   - }
1200   -
1201   - if (num + buyed.promgoodsbuynum > val.buy_limit && val.buy_limit > 0 && !normal_arr[val.goods_id]) {
1202   - isok = 0;
1203   - gname = val.goods_name;
1204   - throw "超出活动限购";
1205   - return false;
1206   - }
1207 1610  
  1611 + var buyed = map_limit.get(val.goods_id + "");
  1612 + if (num + buyed.goodsbuynum > val.viplimited && val.viplimited > 0) {
  1613 + isok = 0;
  1614 + gname = val.goods_name;
  1615 + throw "超出商品限购";
  1616 + return false;
  1617 + }
1208 1618  
1209   - var card_field=th.data.card_field;
1210   - for (var i = 0; i < g_arr.length; i++) {
1211   - if (g_arr[i].goods_id == val.goods_id) {
  1619 + if (num + buyed.promgoodsbuynum > val.buy_limit && val.buy_limit > 0 && !normal_arr[val.goods_id]) {
  1620 + isok = 0;
  1621 + gname = val.goods_name;
  1622 + throw "超出活动限购";
  1623 + return false;
  1624 + }
1212 1625  
1213   - //如果会员是等级会员,商品有等级价,且不是活动商品
1214   - if(card_field && val[card_field]>0 && (val.prom_type==0 || val.prom_type==3 || val.prom_type==4 || val.prom_type==5 || normal_arr[val.goods_id]) ){
1215   - if (g_arr[i].goods_price != val[card_field]){
1216   - isok = 0;
1217   - gname = val.goods_name;
1218   - throw "商品价格已经变化";
1219   - }
1220   - }else{
1221   - if (g_arr[i].goods_price != val.shop_price && g_arr[i].goods_price != val.prom_price) {
1222   - isok = 0;
1223   - gname = val.goods_name;
1224   - throw "商品价格已经变化";
  1626 + var card_field = th.data.card_field;
  1627 + for (var i = 0; i < g_arr.length; i++) {
  1628 + if (g_arr[i].goods_id == val.goods_id) {
  1629 +
  1630 + //如果会员是等级会员,商品有等级价,且不是活动商品
  1631 + if (card_field && val[card_field] > 0 && (val.prom_type == 0 || val.prom_type == 3 || val.prom_type == 4 || val.prom_type == 5 || normal_arr[val.goods_id])) {
  1632 + if (g_arr[i].goods_price != val[card_field]) {
  1633 + isok = 0;
  1634 + gname = val.goods_name;
  1635 + throw "商品价格已经变化";
  1636 + }
  1637 + } else {
  1638 + if (g_arr[i].goods_price != val.shop_price && g_arr[i].goods_price != val.prom_price) {
  1639 + isok = 0;
  1640 + gname = val.goods_name;
  1641 + throw "商品价格已经变化";
  1642 + }
1225 1643 }
1226   - }
1227 1644  
1228   - //-- 数据的更新 --
1229   - var data={
1230   - id: g_arr[i].id,
1231   - selected: 1,
1232   - store_id: oo.stoid
1233   - };
1234   - //-- 如果有线下取价的时候 --
1235   - if(g_arr[i].is_offline){
1236   - data.pricing_type=g_arr[i].pricing_type;
1237   - data.offline_price=g_arr[i].offline_price;
1238   - }
1239   - rq.put("/api/weshop/cart/update", {
1240   - data: data,
1241   - success: function(ee) {
1242   - console.log(ee);
  1645 + //-- 数据的更新 --
  1646 + var data = {
  1647 + id: g_arr[i].id,
  1648 + selected: 1,
  1649 + store_id: oo.stoid
  1650 + };
  1651 + //-- 如果有线下取价的时候 --
  1652 + if (g_arr[i].is_offline) {
  1653 + data.pricing_type = g_arr[i].pricing_type;
  1654 + data.offline_price = g_arr[i].offline_price;
1243 1655 }
1244   - });
  1656 + rq.put("/api/weshop/cart/update", {
  1657 + data: data,
  1658 + success: function (ee) {
  1659 + console.log(ee);
  1660 + }
  1661 + });
  1662 + }
1245 1663 }
1246   - }
1247 1664  
  1665 + }
  1666 + } catch (e) {
  1667 + err = e;
  1668 + }
  1669 + if (isok == 0) {
  1670 + t.confirmBox(gname + ":" + err);
  1671 + wx.hideLoading();
  1672 + return false;
1248 1673 }
1249   - } catch (e) {
1250   - err = e;
1251   - }
1252   - if (isok == 0) {
1253   - t.confirmBox(gname + ":" + err);
1254 1674 wx.hideLoading();
1255   - return false;
  1675 + wx.navigateTo({
  1676 + url: "/pages/cart/cart2/cart2"
  1677 + });
  1678 + }
  1679 + }
  1680 + });
  1681 + }else{
  1682 + //-- 开始服务卡的购物车购买 --
  1683 + for (var i = 0; i < this.data.service_data.length; i++) {
  1684 + var i_arr = this.data.service_data[i].goods;
  1685 + for (var j = 0; j < i_arr.length; j++) {
  1686 + if (i_arr[j].selected) {
  1687 + await rq.promisePut("/api/weshop/cartService/update", {
  1688 + data: {
  1689 + id: i_arr[j].id,
  1690 + selected: 1,
  1691 + store_id: oo.stoid
  1692 + }
  1693 + });
1256 1694 }
1257   - wx.hideLoading();
1258   - wx.navigateTo({
1259   - url: "/pages/cart/cart2/cart2"
1260   - });
1261 1695 }
1262 1696 }
1263   - });
  1697 + wx.hideLoading();
  1698 + getApp().goto("/packageA/pages/cart2_ser/cart2_ser?is_cart=1");
  1699 + }
1264 1700 },
1265 1701  
1266 1702 //结算到最后一个商品
... ... @@ -1302,11 +1738,12 @@ Page({
1302 1738  
1303 1739 //--多个删除购物车商品---
1304 1740 check_del: function() {
1305   - var glist = ""; //用逗号隔开的
  1741 + var glist = "",slist=''; //用逗号隔开的
1306 1742 var user_id = getApp().globalData.user_id;
1307 1743 var th = this;
1308 1744  
1309 1745 var ab = 0; //选中
  1746 + var abc=0; //
1310 1747 for (var i = 0; i < this.data.requestData.length; i++) {
1311 1748 var i_arr = this.data.requestData[i].goods;
1312 1749 for (var j = 0; j < i_arr.length; j++) {
... ... @@ -1317,18 +1754,42 @@ Page({
1317 1754 }
1318 1755 }
1319 1756  
1320   - if (ab == 0) {
1321   - t.my_warnning("未选择商品", 0, th);
  1757 + for (var ii = 0; ii < this.data.service_data.length; ii++) {
  1758 + var i_arr = this.data.service_data[ii].goods;
  1759 + for (var jj = 0; jj < i_arr.length; jj++) {
  1760 + if (i_arr[jj].selected) {
  1761 + slist += i_arr[jj].id + ",";
  1762 + abc = 1;
  1763 + }
  1764 + }
  1765 + }
  1766 +
  1767 + if (ab == 0 && abc==0) {
  1768 + t.my_warnning("未选择商品或者服务卡", 0, th);
1322 1769 return false;
1323 1770 }
1324   - glist = glist.substring(0, glist.length - 1);
1325   - //要删除购物车中的商品
1326   - var url = '/api/weshop/cart/delIds/' + oo.stoid + '/' + user_id + "/" + glist;
1327   - getApp().request.delete(url, {
1328   - success: function(t) {
1329   - th.getCardList();
1330   - }
1331   - });
  1771 +
  1772 + if(ab){
  1773 + glist = glist.substring(0, glist.length - 1);
  1774 + //要删除购物车中的商品
  1775 + var url = '/api/weshop/cart/delIds/' + oo.stoid + '/' + user_id + "/" + glist;
  1776 + getApp().request.delete(url, {
  1777 + success: function(t) {
  1778 + th.getCardList();
  1779 + }
  1780 + });
  1781 + }
  1782 + if(abc){
  1783 + slist = slist.substring(0, slist.length - 1);
  1784 + //要删除购物车中的商品
  1785 + var url = '/api/weshop/cartService/delIds/' + oo.stoid + '/' + user_id + "/" + slist;
  1786 + getApp().request.delete(url, {
  1787 + success: function(t) {
  1788 + th.getCardList();
  1789 + }
  1790 + });
  1791 + }
  1792 +
1332 1793 },
1333 1794 //跳到首页
1334 1795 goto: function(e) {
... ... @@ -1338,7 +1799,7 @@ Page({
1338 1799  
1339 1800 //---加载更多是靠这个函数----
1340 1801 onReachBottom: function() {
1341   - if(this.data.requestData.length==0) {
  1802 + if(this.data.requestData && this.data.requestData.length==0) {
1342 1803 var goods_list = this.selectComponent("#goods_list"); //组件的id
1343 1804 if (goods_list) goods_list.get_list();
1344 1805 }
... ...
pages/cart/cart/cart.wxml
... ... @@ -13,19 +13,22 @@
13 13  
14 14  
15 15  
16   -<view class="container" wx:if="{{requestData.length>0}}">
  16 +<view class="container" wx:if="{{(requestData && requestData.length>0) || (service_data && service_data.length>0) }}">
17 17 <!-- 购物车商品框架 -->
18 18 <view class="login-in">
19 19 <!-- 编辑 -->
20 20 <view class="padding flex-vertical-between fs30 Storenum store">
21 21 <view class="flex">
22   - <view>商品数量:</view>
  22 + <view>数量:</view>
23 23 <view class="goods_num">{{all_num}}</view>
24 24 </view>
25 25 <view wx:if="{{is_edit==0}}" bindtap="edit_cart" data-type="1">编辑</view>
26 26 <view wx:else bindtap="edit_cart" data-type="0">完成</view>
27 27 </view>
28   - <block wx:for="{{requestData}}" wx:key="{{index}}" wx:for-index="pidx">
  28 +
  29 + <!-- 商品的列表 -->
  30 + <block wx:if="{{requestData && requestData.length>0}}">
  31 + <block wx:for="{{requestData}}" wx:key="{{index}}" wx:for-index="pidx">
29 32 <!-- 门店底下的商品 -->
30 33 <view class="store">
31 34 <view class="shmd_m">
... ... @@ -123,8 +126,73 @@
123 126 <view style="margin:10rpx 0; padding: 0 30rpx;color: #999" wx:if="{{item.offline_price}}" class="fs28">
124 127 当前<text class="red_c">{{item.offline_num}}</text>件商品,可使用<text class="red_c">{{item.offline_price}}</text>元店铺优惠
125 128 </view>
126   -
  129 + </block>
127 130 </block>
  131 +
  132 + <!-- 服务卡项的列表 -->
  133 + <block wx:if="{{service_data && service_data.length>0}}">
  134 + <block wx:for="{{service_data}}" wx:key="{{index}}" wx:for-index="pidx">
  135 + <!-- 门店以及门店底下的服务卡 -->
  136 + <view class="store">
  137 + <view class="shmd_m">
  138 +
  139 + <icon wx:if="{{checkAllToggle||item.selected}}" class="order-raido flex-center" bindtap="check_th_all_item_ser" data-pitems="{{pidx}}"
  140 + color="red" size="20" type="success"></icon>
  141 + <view wx:else class="icon_no_sele2" bindtap="check_th_all_item_ser" data-pitems="{{pidx}}"></view>
  142 +
  143 + <view class="flex-center">
  144 + <image src="{{iurl}}miniapp/images/stores/store.png"></image>
  145 + <view class="shmd fs30">{{item.pname}}</view>
  146 + </view>
  147 +
  148 + </view>
  149 + <view class="order-item" data-item="{{idx}}" wx:for="{{item.goods}}" wx:for-item="items" wx:for-index="idx" wx:key="{{index}}">
  150 + <block>
  151 + <view bindtap="check_th_item_ser" class="order-raido flex-vertical " data-check="{{items.selected}}" data-item="{{idx}}" data-pitems="{{pidx}}">
  152 + <!--<radio color="red" checked="{{checkAllToggle||items.selected}}"></radio>-->
  153 + <icon wx:if="{{checkAllToggle||items.selected}}" color="red" size="20" type="success"></icon>
  154 + <text wx:else class="icon_no_sele"></text>
  155 + </view>
  156 + </block>
  157 +
  158 +
  159 + <navigator class="goods-img rel" url="/packageA/pages/goodsInfo/goodsInfo?goods_id={{items.service_id}}">
  160 + <image class="wh100" src="{{items.img_url}}" binderror="bind_bnerr2" data-errorimg="service_data[{{pidx}}].goods[{{idx}}].img_url" data-url="{{items.img_url}}"></image>
  161 +
  162 + </navigator>
  163 + <view class="goods-cont">
  164 + <view class="goods-name">
  165 + <navigator class="ellipsis-2 fs30" url="/packageA/pages/goodsInfo/goodsInfo?goods_id={{items.service_id}}">{{items.service_name}}</navigator>
  166 + <block wx:if="{{items.is_gift}}">
  167 + <view>{{items.goods_num}}件</view>
  168 + </block>
  169 + </view>
  170 +
  171 + <block wx:if="{{!items.is_gift}}">
  172 + <view class="flex alend jc_sb">
  173 + <view class="goods-price co-red baseline ellipsis-1">
  174 + <view class="fs20">¥</view>
  175 + <view class="fs28">{{items.money}}</view>
  176 + </view>
  177 + <view class="count">
  178 + <view bindtap="subNum_ser" class="sub fs28" data-pitems="{{pidx}}" data-item="{{idx}}">一</view>
  179 + <input class="goodadd" bindblur="valueToNum_ser" data-pitems="{{pidx}}" data-item="{{idx}}"
  180 + bindinput="refresh_input"
  181 + type="number" value="{{items.goods_num}}"></input>
  182 + <view class="add" bindtap="addNum_ser" data-pitems="{{pidx}}" data-item="{{idx}}">+</view>
  183 + </view>
  184 + </view>
  185 + </block>
  186 +
  187 + </view>
  188 + </view>
  189 + </view>
  190 +
  191 +
  192 + </block>
  193 + </block>
  194 +
  195 +
128 196 </view>
129 197 <view class="pay-for flex-vertical-between">
130 198 <view class="allradio flex-vertical-between">
... ... @@ -156,7 +224,7 @@
156 224 </view>
157 225  
158 226 <!-- 购物车为空 -->
159   -<view class="empty_order" wx:if="{{(!requestData|| requestData.length==0) && is_load}}">
  227 +<view class="empty_order" wx:if="{{(!requestData|| requestData.length==0) && (!service_data|| service_data.length==0) && is_load}}">
160 228 <view class="flex-level">
161 229 <image src="{{iurl}}miniapp/images/stores/nocart.png"></image>
162 230 </view>
... ... @@ -169,7 +237,7 @@
169 237 </view>
170 238  
171 239 <!-- 好物推荐 -->
172   -<view class="title" style="margin-top: 60rpx; margin-bottom:{{isTabBar == true ? '50px' : '0'}}" wx:if="{{(!requestData|| requestData.length==0) && is_load}}">
  240 +<view class="title" style="margin-top: 60rpx; margin-bottom:{{isTabBar == true ? '50px' : '0'}}" wx:if="{{(!requestData|| requestData.length==0) && (!service_data|| service_data.length==0) && is_load}}">
173 241 <!-- 标题 -->
174 242 <view>
175 243 <!-- 中文名标题 -->
... ...
pages/cart/cart/cart.wxss
... ... @@ -352,3 +352,4 @@ page {
352 352 }
353 353 .quan_color{ background-color: #ff5306; height: 40rpx;color: #fff; padding: 0 10rpx; border-radius: 10rpx; margin-left: 10rpx}
354 354 .red_c{color:#ff5306}
  355 +.title_show{ margin: 10rpx 0 10px 0;padding: 0 20rpx}
... ...
pages/cart/cart2/cart2.js
... ... @@ -222,6 +222,7 @@ Page({
222 222 //先获取是否有关闭使用优惠券
223 223 getApp().getConfig2(function (ee) {
224 224 var json_d = JSON.parse(ee.switch_list);
  225 + th.data.json_d=json_d;
225 226 th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
226 227 th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch});
227 228  
... ... @@ -266,7 +267,7 @@ Page({
266 267 th.get_wuliu(th.get_info(th.show_page));
267 268 }
268 269  
269   - })
  270 + },1);
270 271  
271 272 //值在这里换
272 273 getApp().globalData.plus_buy_back=0;
... ... @@ -442,7 +443,10 @@ Page({
442 443 }
443 444 var e_t=0
444 445 switch (arr[j].distr_t) {
445   - case 0: e_t = 1; break;
  446 + case 0:
  447 + e_t = 1;
  448 + if(th.data.json_d.pickupway && th.data.json_d.pickupway==1) e_t=0;
  449 + break;
446 450 case 1: e_t = 1; break;
447 451 case 2: e_t = 0; break;
448 452 }
... ... @@ -472,7 +476,11 @@ Page({
472 476 dis_t = item.distr_type ;
473 477 }
474 478 switch (dis_t) {
475   - case 0: e_t = 1; break;
  479 + case 0:
  480 + e_t = 1;
  481 + //-- 系统后台有设置要默认的 --
  482 + if(th.data.json_d.pickupway && th.data.json_d.pickupway==1) e_t=0;
  483 + break;
476 484 case 1: e_t = 1; break;
477 485 case 2: e_t = 0; break;
478 486 }
... ... @@ -571,8 +579,13 @@ Page({
571 579 }else{
572 580 distr_t = t.data.data.distr_type;
573 581 }
  582 +
574 583 switch (distr_t){
575   - case 0: et=1; break;
  584 + case 0:
  585 + et=1;
  586 + //-- 系统后台有设置要默认的 --
  587 + if(th.data.json_d.pickupway && th.data.json_d.pickupway==1) et=0;
  588 + break;
576 589 case 1: et = 1; break;
577 590 case 2: et = 0; break;
578 591 }
... ... @@ -3023,7 +3036,7 @@ Page({
3023 3036 arr[ind].check_quan_price_list=check_quan_price_list;
3024 3037  
3025 3038 //是否关闭使用优惠券
3026   - if (th.data.is_close_quan != 1 && !is_xz_yh && check_quan_ware_list && check_quan_ware_list!="") {
  3039 + if (th.data.is_close_quan != 1 && !is_xz_yh) {
3027 3040 //--调用接口,获取优惠券的列表,3秒钟内控制接口请求--
3028 3041 var url="/api/weshop/couponList/getUseCouponList";
3029 3042 await app.request.promiseGet(url,{ data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:ckeck_quan_price,WareIds:check_quan_ware_list,pageSize:100}}).then(res=>{
... ... @@ -3059,7 +3072,7 @@ Page({
3059 3072 th.data.ckeck_quan_price=good.offline_price; //如果有线下取价,就用线下价
3060 3073 }
3061 3074 //--如果商家后台没有限制使用优惠券,同时商品的优惠活动没有限制使用优惠券--
3062   - if(th.data.is_close_quan != 1 && th.data.bn_goods.is_xz_yh!=1 && th.data.check_quan_ware_list && th.data.check_quan_ware_list!='')
  3075 + if(th.data.is_close_quan != 1 && th.data.bn_goods.is_xz_yh!=1)
3063 3076 {
3064 3077 var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id;
3065 3078 var url="/api/weshop/couponList/getUseCouponList";
... ...
pages/cart/cart2_inte/cart2_inte.js
... ... @@ -92,6 +92,7 @@ Page({
92 92 //先获取是否有关闭使用优惠券
93 93 getApp().getConfig2(function (ee) {
94 94 var json_d = JSON.parse(ee.switch_list);
  95 + th.data.json_d=json_d;
95 96 th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
96 97 th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch});
97 98  
... ... @@ -135,7 +136,7 @@ Page({
135 136 //-----先获取物流,再获取用户信息,再展示页面-----
136 137 th.get_wuliu(th.get_info(th.show_page));
137 138 }
138   - })
  139 + },1);
139 140  
140 141  
141 142 },
... ... @@ -302,7 +303,11 @@ Page({
302 303 distr_t = t.data.data.distr_type;
303 304 }
304 305 switch (distr_t){
305   - case 0: et=1; break;
  306 + case 0:
  307 + et=1;
  308 + //-- 系统后台有设置要默认的 --
  309 + if(th.data.json_d.pickupway && th.data.json_d.pickupway==1) et=0;
  310 + break;
306 311 case 1: et = 1; break;
307 312 case 2: et = 0; break;
308 313 }
... ...
pages/cart/cart2_pt/cart2_pt.js
... ... @@ -177,6 +177,8 @@ Page({
177 177 switch (distr_t) {
178 178 case 0:
179 179 et = 1;
  180 + //-- 系统后台有设置要默认的 --
  181 + if(th.data.json_d.pickupway && th.data.json_d.pickupway==1) et=0;
180 182 break;
181 183 case 1:
182 184 et = 1;
... ... @@ -302,6 +304,7 @@ Page({
302 304 //先获取是否有关闭使用优惠券
303 305 getApp().getConfig2(function (ee) {
304 306 var json_d = JSON.parse(ee.switch_list);
  307 + th.data.json_d=json_d;
305 308 th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
306 309 th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch});
307 310  
... ... @@ -345,7 +348,7 @@ Page({
345 348 //-----先获取物流,再获取用户信息,再展示页面-----
346 349 th.get_wuliu(th.get_info(th.show_page));
347 350 }
348   - })
  351 + },1)
349 352  
350 353  
351 354 },
... ...
pages/cart/cart_wk/cart_wk.js
... ... @@ -54,7 +54,12 @@ Page({
54 54 var th = this;
55 55 this.data.order_id = options.order_id;
56 56 //--初始化--
57   - this.get_wuliu(th.get_info(th.show_page));
  57 + getApp().getConfig2(function (e){
  58 + var json_d = JSON.parse(e.switch_list);
  59 + th.data.json_d=json_d;
  60 + th.get_wuliu(th.get_info(th.show_page));
  61 + },1)
  62 +
58 63 },
59 64 /**
60 65 * 生命周期函数--监听页面显示
... ... @@ -240,9 +245,12 @@ Page({
240 245 switch (distr_type) {
241 246 case 0:
242 247 exp_type = 1;
  248 + //-- 系统后台有设置要默认的 --
  249 + if(th.data.json_d.pickupway && th.data.json_d.pickupway==1) exp_type=0;
243 250 break; //自选
244 251 case 1:
245 252 exp_type = 1;
  253 +
246 254 break //自提
247 255 case 2:
248 256 exp_type = 0;
... ...
pages/giftpack/buygiftpack/giftpackbuy.js
... ... @@ -30,13 +30,8 @@ Page({
30 30 onLoad: function(options) {
31 31  
32 32 var th = this;
33   - setTimeout(function (){
34   - var my_confirm = th.selectComponent("#my_confirm"); //组件的id
35   - my_confirm.open_cancel(0);
36   - },1000)
37   -
38   -
39   -
  33 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  34 + my_confirm.open_cancel(0);
40 35 th.setData({
41 36 getStorageID: a.stoid,
42 37 getUserID: d.user_id
... ... @@ -163,7 +158,7 @@ Page({
163 158 var json = {
164 159 "actId": '', //活动Id
165 160 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
166   - "buyType": '1', //1=积分兑换 2=余额购买
  161 + "buyType": '1', //1=积分兑换 2=余额购买 3=免费领取
167 162 "giftBagId": id, //礼包Id
168 163 "storeId": that.getStorageID, //商家Id
169 164 "userId": that.getUserID, //用户ID
... ... @@ -174,8 +169,7 @@ Page({
174 169 if(getApp().globalData.guide_id){
175 170 json.guide_id=getApp().globalData.guide_id;
176 171 }
177   -
178   -
  172 +
179 173 var data = JSON.stringify(json);
180 174 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
181 175 getApp().request.json_post(url, json,
... ... @@ -186,15 +180,53 @@ Page({
186 180 getApp().my_warnning(res.data.msg, 0, th);
187 181 }
188 182 },
189   - function(res) {
190   -
191   - }
192   -
193   - )
  183 + function(res) {})
194 184  
195 185 })
196 186  
197 187 },
  188 + //免费领取
  189 + GetFree:function (e){
  190 + var that = this.data;
  191 + var th = this;
  192 + var id = e.currentTarget.dataset.id; //活动id
  193 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  194 + my_confirm.open(
  195 + "是否确定领取该礼包",
  196 + "取消",
  197 + "确定",
  198 + function() {
  199 + my_confirm.open_cancel(0);
  200 + },
  201 + function() {
  202 + my_confirm.open_cancel(0);
  203 + var json = {
  204 + "actId": '', //活动Id
  205 + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
  206 + "buyType": '3', //1=积分兑换 2=余额购买 3=免费领取
  207 + "giftBagId": id, //礼包Id
  208 + "storeId": that.getStorageID, //商家Id
  209 + "userId": that.getUserID, //用户ID
  210 + "buyFrom": 2
  211 + };
  212 + //-- 分享导购要记录 --
  213 + if(getApp().globalData.guide_id){
  214 + json.guide_id=getApp().globalData.guide_id;
  215 + }
  216 + var data = JSON.stringify(json);
  217 + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
  218 + getApp().request.json_post(url, json,
  219 + function(res) {
  220 + if (res.data.code == 0) {
  221 + getApp().my_warnning("领取成功!", 1, th);
  222 + } else {
  223 + getApp().my_warnning(res.data.msg, 0, th);
  224 + }
  225 + },
  226 + function(res) {})
  227 + })
  228 + },
  229 +
198 230 getList: function(e) {
199 231 var th = this;
200 232 getApp().request.get('/api/weshop/marketing/giftbag/page', {
... ...
pages/giftpack/buygiftpack/giftpackbuy.wxml
... ... @@ -84,6 +84,12 @@
84 84 </view>
85 85 </block>
86 86 </block>
  87 + <block wx:if="{{!items.payMoney && !items.payIntegral}}">
  88 + <view class="flex" bindtap="GetFree" data-id="{{items.lbId}}">
  89 + <button class="box_button_dui box_button_buy">免费领取</button>
  90 + </view>
  91 + </block>
  92 +
87 93 </view>
88 94 </view>
89 95 </view>
... ...
pages/giftpack/giftpacklist/giftpacklist.js
... ... @@ -202,6 +202,7 @@ Page({
202 202  
203 203  
204 204 },
  205 +
205 206 GetMyGiftList: function() {
206 207 var _this = this;
207 208 var th = this;
... ... @@ -419,6 +420,61 @@ Page({
419 420 }
420 421 },
421 422  
  423 + //免费领取
  424 + GetFree: function(e) {
  425 + var that = this.data;
  426 + var th = this;
  427 +
  428 + //如果还没有开始的话
  429 + if(th.data.isStart!=1){
  430 + getApp().my_warnning("活动还没有开始", 0, th);
  431 + return false;
  432 + }
  433 + // var id = e.currentTarget.dataset.id;//活动id
  434 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  435 + my_confirm.open(
  436 + "是否确定领取该礼包",
  437 + "取消",
  438 + "确定",
  439 + function() {
  440 + my_confirm.open_cancel(0);
  441 + },
  442 + function() {
  443 + my_confirm.open_cancel(0);
  444 + var json = {
  445 + "actId": '', //活动Id
  446 + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
  447 + "buyType": '3', //1=积分兑换 2=余额购买
  448 + "giftBagId": that.getGiftID, //礼包Id
  449 + "storeId": a.stoid, //商家ID
  450 + "userId": d.user_id, //用户ID
  451 + "buyFrom":2
  452 + };
  453 +
  454 + //-- 分享导购要记录 --
  455 + if(getApp().globalData.guide_id){
  456 + json.guide_id=getApp().globalData.guide_id;
  457 + }
  458 +
  459 +
  460 + var data = JSON.stringify(json);
  461 + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
  462 + getApp().request.json_post(url, json,
  463 + function(res) {
  464 + if (res.data.code == 0) {
  465 + getApp().my_warnning("领取成功!", 1, th);
  466 + } else {
  467 + getApp().my_warnning(res.data.msg, 0, th);
  468 + }
  469 + },
  470 + function(res) {}
  471 +
  472 + )
  473 + })
  474 +
  475 +
  476 + },
  477 +
422 478  
423 479  
424 480 });
425 481 \ No newline at end of file
... ...
pages/giftpack/giftpacklist/giftpacklist.wxml
... ... @@ -117,12 +117,10 @@
117 117 <block wx:if="{{isBuy==1 && giftTitle}}">
118 118 <block wx:if="{{isStart==1}}">
119 119 <view class="foot_button data-v-3a5b7e36">
120   - <block wx:if="{{giftPrice>0&&giftIntegral>0}}">
  120 + <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
121 121 <view class="foot_button_left data-v-3a5b7e36 " data-money="{{giftPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice">
122 122 <text class="data-v-3a5b7e36 ">立即购买</text>
123 123 </view>
124   - </block>
125   - <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
126 124 <view class="foot_button_right data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}">
127 125 <text class="data-v-3a5b7e36">立即兑换</text>
128 126 </view>
... ... @@ -137,6 +135,14 @@
137 135 <text class="data-v-3a5b7e36">立即兑换</text>
138 136 </view>
139 137 </block>
  138 +
  139 + <block wx:if="{{giftPrice<=0 && giftIntegral<=0}}">
  140 + <view class="foot_button_intalge data-v-3a5b7e36 " bindtap="GetFree" data-id="{{lbId}}">
  141 + <text class="data-v-3a5b7e36">免费领取</text>
  142 + </view>
  143 + </block>
  144 +
  145 +
140 146 </view>
141 147 </block>
142 148 <block wx:else>
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -63,7 +63,7 @@ Page({
63 63 name: "详情",
64 64 id: 1
65 65 }, {
66   - name: "评",
  66 + name: "评",
67 67 id: 2
68 68 }],
69 69 activeCategoryId2: 0,
... ... @@ -1439,6 +1439,7 @@ Page({
1439 1439 }
1440 1440 }
1441 1441 });
  1442 +
1442 1443 }
1443 1444 //else "exchange" == t.currentTarget.dataset.action ? this.exchange(d) : this.buyNow(d);
1444 1445 else {
... ... @@ -1719,18 +1720,63 @@ Page({
1719 1720 }
1720 1721  
1721 1722 var ind = t.currentTarget.dataset.ind;
1722   - this.setData({
1723   - openSpecModal: !0,
1724   - openSpecModal_ind: ind,
1725   - });
1726   -
1727   - var is_open=th.data.config
1728   -
1729   -
1730   - this.get_off_price();
1731 1723  
  1724 + //回调。判断是不是优惠促销
  1725 + th.check_is_prom_goods(function (){
  1726 + th.setData({
  1727 + openSpecModal: !0,
  1728 + openSpecModal_ind: ind,
  1729 + });
  1730 + //var is_open=th.data.config
  1731 + th.get_off_price();
  1732 + })
  1733 + },
  1734 +
  1735 + //判断是不是优惠促销
  1736 + check_is_prom_goods:function(callback){
  1737 + var th=this;
  1738 + var usr=getApp().globalData.userInfo;
  1739 + if(this.data.sele_g.prom_type!=0 && this.data.sele_g.prom_type!=3){
  1740 + callback();
  1741 + }else{
  1742 + //-- 判断有没有优惠活动 --
  1743 + getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+th.data.sele_g.goods_id+"/0", {}).then(res => {
  1744 + if(res.data.code==0){
  1745 + var r_data=res.data.data;
  1746 + th.data.prom_goods=r_data.promGoodsLists;
  1747 + if(!th.data.prom_goods){
  1748 + callback();
  1749 + return false;
  1750 + }
  1751 +
  1752 + ///api/weshop/order/getWPayOrder?store_id=1&user_id=5682366&prom_id=1&goods_id=1
  1753 + getApp().promiseGet("/api/weshop/order/getWPayOrder",{
  1754 + data:{store_id:os.stoid,user_id:usr.user_id,goods_id:th.data.sele_g.goods_id,prom_id:th.data.prom_goods[0].prom_id}
  1755 + }).then(res=>{
  1756 + if(res.data.code==0){
  1757 + wx.showToast({
  1758 + title: "您已经购买了该商品待支付中",
  1759 + icon: 'none',
  1760 + duration: 2000
  1761 + })
  1762 + setTimeout(function (){
  1763 + getApp().goto("/pages/user/order_detail/order_detail?order_id=" + res.data.data.order_id,)
  1764 + },1000)
  1765 + }
  1766 + //未找到相关记录
  1767 + else{
  1768 + callback();
  1769 + }
  1770 + })
  1771 + }
  1772 +
  1773 + })
  1774 +
  1775 + }
1732 1776 },
1733 1777  
  1778 +
  1779 +
1734 1780 //----获取线下价格-------
1735 1781 get_off_price(){
1736 1782 var th=this;
... ... @@ -1881,9 +1927,19 @@ Page({
1881 1927 for (var i = 0; i < e.data.data.pageData.length; i++) {
1882 1928 num += e.data.data.pageData[i].goods_num;
1883 1929 }
1884   - t.setData({
1885   - cartGoodsNum: num
1886   - });
  1930 +
  1931 + //-- 读取服务卡的数量 --
  1932 + getApp().promiseGet("/api/weshop/cartService/page",{
  1933 + data:{
  1934 + store_id: s.globalData.setting.stoid,
  1935 + user_id: s.globalData.user_id,
  1936 + }
  1937 + }).then(res=>{
  1938 + for (var i = 0; i < res.data.data.pageData.length; i++) {
  1939 + num += res.data.data.pageData[i].goods_num;
  1940 + }
  1941 + t.setData({cartGoodsNum:num});
  1942 + })
1887 1943 }
1888 1944 });
1889 1945 },
... ... @@ -1945,9 +2001,12 @@ Page({
1945 2001 }
1946 2002 var title= th.data.data.goods_name;
1947 2003 var img=th.data.data.original_img;
1948   - if(th.data.prom_type==6){
  2004 + if(th.data.prom_type==6 || th.data.prom_type==1){
  2005 +
1949 2006 title=th.data.prom_act.share_title;
1950   - img=th.data.iurl+th.data.prom_act.share_imgurl;
  2007 + if(!title) title=th.data.prom_act.title;
  2008 + if(th.data.prom_act.share_imgurl)
  2009 + img=th.data.iurl+th.data.prom_act.share_imgurl;
1951 2010 }
1952 2011  
1953 2012  
... ... @@ -3038,7 +3097,8 @@ Page({
3038 3097 pageSize: 3,
3039 3098 page: 1,
3040 3099 state: 2,
3041   - team_id: prom_id
  3100 + team_id: prom_id,
  3101 + ordernum:1
3042 3102 }
3043 3103 }).then(res => {
3044 3104 teamgroup = res.data.data.pageData;
... ... @@ -3917,14 +3977,19 @@ Page({
3917 3977 context.setFillStyle("white");
3918 3978 context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 75 * unit);
3919 3979 }
3920   -
3921   -
  3980 +
  3981 + var share_title=th.data.data.goods_name;
  3982 + if(th.data.prom_type==1 || th.data.prom_type==4){
  3983 + share_title=th.data.prom_act.share_title;
  3984 + if(!share_title) share_title=th.data.prom_act.title;
  3985 + }
  3986 +
3922 3987 //---产品名称---
3923 3988 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
3924 3989 if(type!=4){
3925 3990 context.setFillStyle("black");
3926 3991 context.setFontSize(21.3 * unit)
3927   - th.draw_Text(context, th.data.data.goods_name,
  3992 + th.draw_Text(context, share_title,
3928 3993 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit);
3929 3994 //------产品的价格-------
3930 3995 context.setFontSize(23 * unit)
... ... @@ -4385,18 +4450,23 @@ Page({
4385 4450 tt();
4386 4451 return false;
4387 4452 }
  4453 +
  4454 + var img_url=ee.data.data.original_img;
  4455 + if((this.data.prom_type==1 && this.data.prom_type==6) || this.data.prom_act.share_imgurl){
  4456 + img_url=this.data.iurl+this.data.prom_act.share_imgurl;
  4457 + }
  4458 +
4388 4459 //获取商品是分享图信息
4389 4460 wx.getImageInfo({
4390   - src: ee.data.data.original_img,
  4461 + src: img_url,
4391 4462 success: function(res) {
4392   - //res.path是网络图片的本地地址
4393   - ee.data.share_goods_img = res.path;
4394   - tt();
  4463 + //res.path是网络图片的本地地址
  4464 + ee.data.share_goods_img = res.path;
  4465 + tt();
4395 4466 },
4396 4467 fail: function(res) {
4397   -
4398   - ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的
4399   - tt();
  4468 + ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的
  4469 + tt();
4400 4470 }
4401 4471 });
4402 4472 },
... ... @@ -4916,13 +4986,16 @@ Page({
4916 4986 var arr = [1219, 2089, 3031];
4917 4987 var new_arr = new Array();
4918 4988 var card_name_map=new Map();
4919   - for (var i = 0; i < plusCard.length; i++) {
4920   - if((user.card_field==null || user.card_field=="") && plusCard[i].IsStopBuy==true) continue;
  4989 +
  4990 + var list=[];
  4991 + for (var i = 0; i < plusCard.length; i++) {
  4992 + if((!user || user.card_field==null || user.card_field=="") && plusCard[i].IsStopBuy==true) continue;
4921 4993 var name="card"+plusCard[i].CorrPrice.toLowerCase();
4922 4994 card_name_map.set(name,plusCard[i].CardName);
  4995 + list.push(plusCard[i]);
4923 4996 }
4924   -
4925   - var ob={"card_list":plusCard,"name_map":card_name_map};
  4997 +
  4998 + var ob={"card_list":list,"name_map":card_name_map};
4926 4999 func(ob);
4927 5000 })
4928 5001 },
... ...
pages/goods/goodsInfo/goodsInfo.wxml
... ... @@ -298,7 +298,7 @@
298 298  
299 299 <!-- 不是秒杀 -->
300 300 <!-- 等级卡的价格,不是等级卡会员,且商品又有设置等级级价,商家后台有开通升级卡同能 -->
301   - <view class="flex ai_and" wx:if="{{!card_field && g_filters.is_has_rank(rank_switch,data) && prom_type!=1 }}">
  301 + <view class="flex ai_and" wx:if="{{!card_field && g_filters.is_has_rank(rank_switch,data) && prom_type!=1 && card_list && card_list.length>0}}">
302 302  
303 303 <view class="flex ai-center grade-card-frame card-frame" >
304 304 <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>
... ... @@ -315,7 +315,7 @@
315 315 <block wx:if="{{g_filters.is_has_rank(rank_switch,data)}}">
316 316  
317 317 <!-- 不是秒杀,且会员不是等级会员 -->
318   - <view wx:if="{{!card_field && prom_type!=1 }}">
  318 + <view wx:if="{{!card_field && prom_type!=1 && card_list && card_list.length>0}}">
319 319 <view class="beauty-makeup-frame flex ai-center">
320 320 <view class="left flex ai-center">
321 321 <view class="flex ai-center grade-card-frame card-frame advert-card">
... ... @@ -578,7 +578,7 @@
578 578 </view>
579 579 </view>
580 580 <view class="xc_comment-font pj_word_size ellipsis-2">
581   - {{item.content?item.content:''}}
  581 + {{item.content?item.content:'此用户没有填写评价。'}}
582 582 </view>
583 583 <view class="xc_comment-val">
584 584 <view class="xc_comment-time">{{item.add_time}}</view>
... ... @@ -795,7 +795,7 @@
795 795 </view>
796 796 <view class="xc-pirces">
797 797 <view class="middle-font {{item.seeMore==true?'ellipsis-3':''}}" >
798   - {{item.content?item.content:''}}
  798 + {{item.content?item.content:'此用户没有填写评价。'}}
799 799 </view>
800 800 </view>
801 801 <view wx:if='{{item.seeMore}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleHandler'>全部显示</view>
... ...
pages/index/index/index.js
... ... @@ -90,7 +90,13 @@ Page({
90 90 var th = this;
91 91 var first_leader=tt.first_leader;
92 92 if(!first_leader && tt.scene){
93   - first_leader= decodeURIComponent(tt.scene);
  93 + var first_leader_str= decodeURIComponent(tt.scene);
  94 + var f_arr=first_leader_str.split("_");
  95 + first_leader=f_arr[0] && parseFloat(f_arr[0])>0?f_arr[0]:null;
  96 + //注册门店
  97 + if(f_arr[1] && parseFloat(f_arr[1])>0){
  98 + getApp().globalData.store_number=f_arr[1];
  99 + }
94 100 }
95 101  
96 102 getApp().getConfig(function(e){
... ... @@ -107,8 +113,7 @@ Page({
107 113 });
108 114  
109 115  
110   - var th = this;
111   -
  116 + var th = this;
112 117 getApp().getConfig2(function(config2){
113 118 if(config2 && config2.is_overdue==1){
114 119 getApp().promiseGet("/store/storemoduleendtime/page?store_id=" +os.stoid + "&type=5",{}).then(res=>{
... ... @@ -346,14 +351,10 @@ Page({
346 351 //当隐藏的时候就关闭计时器
347 352 onHide: function() {
348 353 this.data.is_timer = 0;
349   - clearInterval(this.data.pt_timer);
350   - clearInterval(this.data.w_holiday_pop);
351   - clearInterval(this.data.full_screen);
352   -
  354 + if(this.data.pt_timer) clearInterval(this.data.pt_timer);
  355 + if(this.data.w_holiday_pop) clearInterval(this.data.w_holiday_pop);
  356 + if(this.data.full_screen) clearInterval(this.data.full_screen);
353 357 this.data.w_holiday_pop=0;
354   - for(var i = 1; i < 100; i++) {
355   - clearInterval(i);
356   - }
357 358  
358 359 },
359 360  
... ...
pages/index/index/index.json
... ... @@ -18,6 +18,7 @@
18 18 "mvideo": "/components/diy_video/diy_video",
19 19 "service": "/components/diy_service/diy_service",
20 20 "scan": "/components/diy_scan/diy_scan",
  21 + "full_screen": "/components/full_screen/full_screen",
21 22 "store_select": "/components/diy_store_select/diy_store_select"
22 23 },
23 24 "enablePullDownRefresh": false
... ...
pages/team/team_more/team_more.js
... ... @@ -62,7 +62,7 @@ Page({
62 62 //获取活动从表信息team_id
63 63 await getApp().request.promiseGet("/api/weshop/teamgroup/page", {
64 64 data: { store_id: os.stoid, pageSize:6,page:ee.data.currentPage,
65   - state: 2, team_id: team_id }
  65 + state: 2, team_id: team_id,ordernum:1 }
66 66 }).then(res => {
67 67 teamgroup = res.data.data.pageData;
68 68 console.log(teamgroup);
... ...
pages/togoin/togoin.js
... ... @@ -172,6 +172,11 @@ Page({
172 172 dd.guide_id=getApp().globalData.guide_id;
173 173 }
174 174  
  175 + //门店的扫描识别码
  176 + if(getApp().globalData.store_number){
  177 + dd.SunCode=encodeURIComponent(getApp().globalData.store_number.trim());
  178 + }
  179 +
175 180 console.log("-----会员注册的信息-------");
176 181 console.log(dd);
177 182 app.request.get("/api/weshop/users/thirdLogin", {
... ... @@ -183,51 +188,28 @@ Page({
183 188 } else {
184 189 return app.showWarning("授权登入失败!"+e.data.msg);
185 190 }
186   -
  191 +
  192 +
187 193 var need_go=0;
188   - var tuser=e.data.data;
  194 + var t_user=e.data.data;
  195 +
189 196 wx.setStorageSync("userinfo",e.data.data);
190 197 wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(a.globalData.userInfo.head_pic);
191   - //获取一下线下的真实资料
192   - let url3 = '/api/weshop/users/getERPUser/';
193   - url3 += os.stoid + "/" +tuser.user_id;
194   - getApp().promiseGet(url3,{}).then(res=>{
195   -
196   - if(res.data.code == 0) {
197   - let t_user = res.data.data;
198   - //如果有需要完善的信息没有完善,就需要跳转
199   - if (!t_user['vipname'] && th.data.name_need_go) {
200   - need_go = 1;
201   - }
202   - if (!t_user['birthday'] && th.data.birth_need_go) {
203   - need_go = 1;
204   - }
205   - if (!t_user['idcard'] && th.data.idcard_need_go) {
206   - need_go = 1;
207   - }
208   - if (!t_user['address'] && th.data.address_need_go) {
209   - need_go = 1;
210   - }
211   - if (!t_user['pickup_id'] && th.data.pick_need_go) {
212   - need_go = 1;
213   - }
214   - if (!t_user['sex'] && th.data.sex_need_go) {
215   - need_go = 1;
216   - }
217   - if (!t_user['fromuser_id'] && th.data.introducer_need_go) {
218   - need_go = 1;
219   - }
220   -
221   - if (need_go) {
222   - getApp().goto("/packageA/pages/profile/profile");
223   - } else {
224   - wx.navigateBack({delta: 1})
225   - }
226   - }
227   - })
228   -
229 198  
230   -
  199 + //如果有需要完善的信息没有完善,就需要跳转
  200 + if(!t_user['vipname'] && th.data.name_need_go){ need_go=1;}
  201 + if(!t_user['birthday'] && th.data.birth_need_go){ need_go=1;}
  202 + if(!t_user['idcard'] && th.data.idcard_need_go){ need_go=1;}
  203 + if(!t_user['address'] && th.data.address_need_go){ need_go=1;}
  204 + if(!t_user['pickup_id'] && th.data.pick_need_go){ need_go=1;}
  205 + if(!t_user['sex'] && th.data.sex_need_go){ need_go=1;}
  206 + if(!t_user['fromuser_id'] && th.data.introducer_need_go){ need_go=1;}
  207 +
  208 + if(need_go){
  209 + getApp().goto("/packageA/pages/profile/profile");
  210 + }else{
  211 + wx.navigateBack({ delta: 1})
  212 + }
231 213  
232 214 },
233 215 failStatus: function (t) {
... ...
pages/togoin/togoin.wxml
... ... @@ -19,7 +19,7 @@
19 19 <block wx:if="{{canIUseGetUserProfile}}">
20 20 <button hidden="{{user}}" class="getPhoneNumber" bindtap="bindGetUserInfo">
21 21 <view class="flex flex-center ali-c">
22   - <image class="we_chat" src="/images/we_chat.png"></image>
  22 + <image class="we_chat" src="{{imghots}}/miniapp/images/we_chat.png"></image>
23 23 <view>微信账号快捷登录</view>
24 24 </view>
25 25 </button>
... ... @@ -29,7 +29,7 @@
29 29 <!-- 授权获取基础信息 -->
30 30 <button hidden="{{user}}" class="getPhoneNumber" open-type="getUserInfo" bindgetuserinfo="bindUserInfo">
31 31 <view class="flex flex-center ali-c">
32   - <image class="we_chat" src="/images/we_chat.png"></image>
  32 + <image class="we_chat" src="{{imghots}}/miniapp/images/we_chat.png"></image>
33 33 <view>微信账号快捷登录</view>
34 34 </view>
35 35 </button>
... ...
pages/user/cardinfo/cardinfo.js
... ... @@ -876,7 +876,21 @@ Page({
876 876 //显示弹出框
877 877 show_change:function () { this.setData({is_show_change_pop:1}); },
878 878 //关闭弹出框
879   - close_card_change_pop:function () { this.setData({is_show_change_pop:0}); }
  879 + close_card_change_pop:function () { this.setData({is_show_change_pop:0}); },
  880 +
  881 +
  882 + /**
  883 + * 点击跳转
  884 + */
  885 + goto(e) {
  886 + let url = '';
  887 + if(e.target.dataset.url) {
  888 + url = e.target.dataset.url;
  889 + } else {
  890 + url = e.currentTarget.dataset.url;
  891 + }
  892 + t.goto(url);
  893 + },
880 894  
881 895  
882 896  
... ...
pages/user/cardinfo/cardinfo.wxml
... ... @@ -28,6 +28,7 @@
28 28 <!-- 要判断是不是最高级的卡 -->
29 29 <view wx:if="{{cardid!=big_card.CardId}}" bindtap="show_change" class="renew fs28" style="background:{{user_card.CardColor}}">卡类升级</view>
30 30 </block>
  31 + <view bindtap="goto" class="renew fs28" style="background:{{user_card.CardColor}}" data-url="/packageB/pages/user/buyDetails/buyDetails">购卡明细</view>
31 32 </view>
32 33  
33 34  
... ...
pages/user/index/index.js
... ... @@ -95,6 +95,15 @@ Page({
95 95 * 生命周期函数--监听页面显示
96 96 */
97 97 onShow: function() {
  98 + var th=this;
  99 + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + os.stoid, {}).then(res => {
  100 + if(res.data.code==0){
  101 + var plusCard = res.data.data;
  102 + for (var i = 0; i < plusCard.length; i++) {
  103 + if(!plusCard[i].IsStopBuy) { th.setData({show_buy_plus:1}); break; }
  104 + }
  105 + }
  106 + })
98 107  
99 108 if (typeof this.getTabBar === 'function' && this.getTabBar()) {
100 109 var index=getApp().getPageIndex(this);
... ... @@ -595,7 +604,7 @@ Page({
595 604  
596 605 switch (no) {
597 606 case "01":
598   - getApp().goto("/pages/user/user_coupon/user_coupon?img=" +
  607 + getApp().goto("/packageB/pages/user/user_coupon/user_coupon?img=" +
599 608 url + "&gradeId=" + th.data.gradeId + "&FormId=" + item.Id);
600 609 break;
601 610 case "02":
... ...
pages/user/index/index.wxml
... ... @@ -66,7 +66,7 @@
66 66 </image>
67 67  
68 68 </view>
69   - <view class="xc-add-member-frame flex-level rel addplus" wx:if="{{is_dengji==2}}">
  69 + <view class="xc-add-member-frame flex-level rel addplus" wx:if="{{is_dengji==2 && show_buy_plus}}">
70 70 <view class="xc-add-member flex-center-around ">
71 71 <view class="flex jc-center ai-center">
72 72 <image class="xc-icon" src="{{iurl}}/miniapp/images/user/user_vip.png"></image>
... ... @@ -78,7 +78,7 @@
78 78 </view>
79 79 </view>
80 80  
81   - <view class="xc-add-member-frame flex-level rel addplus" wx:if="{{is_dengji==3}}">
  81 + <view class="xc-add-member-frame flex-level rel addplus" wx:if="{{is_dengji==3 && show_buy_plus}}">
82 82 <view class="xc-add-member flex-center-around ">
83 83 <view class="flex jc-center ai-center">
84 84 <image class="xc-icon" src="{{iurl}}/miniapp/images/user/user_vip.png"></image>
... ...
pages/user/labels/labels.js
... ... @@ -117,7 +117,7 @@ Page({
117 117 })
118 118 th.query_checklabels();
119 119 } else {
120   - getApp().my_warnning("系统未设置兴趣标签集合", 0, th);
  120 + getApp().my_warnning("系统繁忙,请稍后再试", 0, th);
121 121 th.setData({
122 122 isread: 1
123 123 })
... ... @@ -136,7 +136,7 @@ Page({
136 136 storeId: a.stoid
137 137 }
138 138 }).then(res => {
139   - if (res.data.code == 0 && res.data.data && res.data.data.VipLabelId) {
  139 + if (res.data.code == 0) {
140 140 var data = res.data.data;
141 141 var arr = [];
142 142 var VipLabelId = []; //通过id标签找到已选择的标签
... ... @@ -165,7 +165,7 @@ Page({
165 165 interest_lables: interest_lables
166 166 })
167 167 } else {
168   - //getApp().my_warnning("系统繁忙,请稍后再试", 0, th);
  168 + getApp().my_warnning("系统繁忙,请稍后再试", 0, th);
169 169 return false;
170 170 }
171 171 })
... ...
pages/user/my_service/appment_main.js
... ... @@ -560,6 +560,9 @@ Page({
560 560 th.data.is_get_local_ok = 1;
561 561 }
562 562 })
  563 + //获取上一次的预约
  564 + this.get_fir_service();
  565 +
563 566 },
564 567 //查询剩下可预约人数
565 568 query_more: function() {
... ... @@ -633,5 +636,98 @@ Page({
633 636 var th = this;
634 637 var nav_b = th.selectComponent("#nav_b"); //组件的id
635 638 nav_b.close_box();
  639 + },
  640 +
  641 + //判断分享的导购是不是有门店,是不是该门店下又该会员
  642 + check_firleader(data){
  643 + var th=this;
  644 + var itemId = this.data.itemId; //服务id
  645 + var url = "/api/weshop/marketing/reservation/storage/pagenew";
  646 + var key_word = data.store_name;
  647 + key_word = key_word.replace(/\s+/g, "");
  648 + var usr=getApp().globalData.userInfo;
  649 + getApp().request.promiseGet(url, {
  650 + data: {
  651 + userId: usr.user_id,
  652 + storeId: os.stoid,
  653 + serviceId: itemId,
  654 + page: 1,
  655 + pageSize: 1000,
  656 + keyWord: key_word
  657 + }
  658 + }).then(res => {
  659 + //-- 如果是门店的话 --
  660 + if (res.data.code == 0 && res.data.data && res.data.data.pageData) {
  661 + var store_data=null;
  662 + for(var i in res.data.data.pageData){
  663 + var it=res.data.data.pageData[i];
  664 + if(it.Id==data.StorageId){
  665 + store_data={
  666 + store_name: data.store_name,
  667 + storageId: data.StorageId,
  668 + };
  669 + break;
  670 + }
  671 + }
  672 + if(!store_data) return false;
  673 + th.setData(store_data)
  674 +
  675 + }else{
  676 + return false;
  677 + }
  678 +
  679 + //导购接口地址
  680 + var url = "/api/weshop/marketing/reservation/staff/pagenew";
  681 + return getApp().request.promiseGet(url, {
  682 + isShowLoading:1,
  683 + data: {
  684 + storeId: os.stoid,
  685 + userId: usr.user_id,
  686 + serviceId: itemId,
  687 + storageId: data.StorageId
  688 + }
  689 + })
  690 + }).then(res=>{
  691 + if (res && res.data && res.data.code == 0) {
  692 + var beautician_list=res.data.data;
  693 + for(var i in beautician_list){
  694 + var item=beautician_list[i];
  695 + if(item.staffid==data.beauticianID){
  696 + th.setData({
  697 + beautician_name:data.beautician_name,
  698 + beauticianID:data.beauticianID,
  699 + })
  700 + break;
  701 + }
  702 + }
  703 +
  704 + }
  705 + })
  706 + },
  707 +
  708 + //获取上一次预约的信息
  709 + get_fir_service:function (){
  710 + var th=this;
  711 + var usr=getApp().globalData.userInfo;
  712 + if(!usr) return false;
  713 +
  714 + getApp().promiseGet("/api/weshop/marketing/reservation/reservation/page",{
  715 + data:{storeId:os.stoid,userId:usr.user_id,projectId:th.data.project_id}
  716 + }).then(res=>{
  717 + if(res.data.code==0 && res.data.data && res.data.data.pageData ){
  718 + var ppdata= res.data.data.pageData[0];
  719 + var data={
  720 + store_name:ppdata.StorageName,
  721 + beautician_name:ppdata.BeauticianName,
  722 + beauticianID:ppdata.BeauticianID,
  723 + StorageId:ppdata.StorageID,
  724 + }
  725 + //检查门店和导购能不能默认使用
  726 + th.check_firleader(data);
  727 + };
  728 + })
636 729 }
  730 +
  731 +
  732 +
637 733 })
638 734 \ No newline at end of file
... ...
pages/user/my_service/i_service.js
... ... @@ -45,11 +45,8 @@ Page({
45 45 */
46 46 onShow: function() {
47 47 var th = this;
48   - setTimeout(function (){
49   - var my_confirm = th.selectComponent("#my_confirm"); //组件的id
50   - my_confirm.open_cancel(0);
51   - },1000)
52   -
  48 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  49 + my_confirm.open_cancel(0);
53 50 },
54 51 onReachBottom: function() {
55 52 var th = this;
... ...
pages/user/order_detail/order_detail.js
... ... @@ -418,7 +418,8 @@ Page({
418 418 return false;
419 419 }
420 420 }else{
421   - if((gg.prom_type==1 || gg.prom_type==3 || gg.prom_type==5 || gg.prom_type==6 || gg.prom_type==4) && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) {
  421 + if((gg.prom_type==1 || gg.prom_type==3 || gg.prom_type==5 || gg.prom_type==6 || gg.prom_type==4)
  422 + && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) {
422 423 var prom=null;
423 424 //---如果是活动的时候---
424 425 var prom=null,th=this;
... ... @@ -461,21 +462,25 @@ Page({
461 462 }
462 463 }
463 464 else{
464   - var t_ok=1;
465   - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => {
466   - if(res.data.code==0){
467   - var r_data=res.data.data;
468   - //-- 参加了全局的优惠活动 --
469   - if(r_data.promGoodsLists){
470   - wx.showModal({
471   - title: '提示',
472   - content: gg.goods_name+'商品的活动发生了变化'
473   - });
474   - t_ok=0;
475   - }
476   - }
477   - })
478   - if(!t_ok) return false;
  465 + //不是赠品的时候
  466 + if(!good.is_gift){
  467 + var t_ok=1;
  468 + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => {
  469 + if(res.data.code==0){
  470 + var r_data=res.data.data;
  471 + //-- 参加了全局的优惠活动 --
  472 + if(r_data.promGoodsLists){
  473 + wx.showModal({
  474 + title: '提示',
  475 + content: gg.goods_name+'商品的活动发生了变化'
  476 + });
  477 + t_ok=0;
  478 + }
  479 + }
  480 + })
  481 + if(!t_ok) return false;
  482 + }
  483 +
479 484 //-- 如果有参加线下取价 --
480 485 if(good.offline_cut>0) wlist+=encodeURIComponent(gg.erpwareid)+",";
481 486 }
... ...
pages/user/order_detail/order_detail.wxml
... ... @@ -164,9 +164,9 @@
164 164  
165 165 <block wx:if="{{order.order_status==2 && order.is_zsorder!=4}}">
166 166 <navigator wx:if="{{order.order_goods.length>1}}" class="tips-btn"
167   - url="/pages/user/comment/comment?status=0&order_id={{order.order_id}}">评价</navigator>
  167 + url="/packageB/pages/user/comment/comment?status=0&order_id={{order.order_id}}">评价</navigator>
168 168 <navigator wx:else class="tips-btn"
169   - url="/pages/user/add_comment/add_comment?goods_id={{order.order_goods[0].goods_id}}&order_id={{order.order_id}}}">去评价</navigator>
  169 + url="/packageB/pages/user/add_comment/add_comment?goods_id={{order.order_goods[0].goods_id}}&order_id={{order.order_id}}}">去评价</navigator>
170 170 </block>
171 171 <!-- 积分购 拼团 搭配购没有有再来一单 -->
172 172 <block wx:if="{{ (order.pay_status==1 || order.order_status==3) && order.pt_prom_id<=0 && order.integral<=0 && order.order_goods[0].prom_type!=5}}">
... ...
pages/user/order_list/order_list.js
... ... @@ -537,7 +537,8 @@ Page({
537 537 }
538 538  
539 539 }else{
540   - if((gg.prom_type==1 || gg.prom_type==3 || gg.prom_type==5 || gg.prom_type==6 || gg.prom_type==4) && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) {
  540 + if((gg.prom_type==1 || gg.prom_type==3 || gg.prom_type==5 || gg.prom_type==6 || gg.prom_type==4)
  541 + && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) {
541 542 var prom=null;
542 543 //---如果是活动的时候---
543 544 var prom=null,th=this;
... ... @@ -580,21 +581,23 @@ Page({
580 581 }
581 582 }
582 583 else{
583   - var t_ok=1;
584   - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => {
585   - if(res.data.code==0){
586   - var r_data=res.data.data;
587   - //-- 参加了全局的优惠活动 --
588   - if(r_data.promGoodsLists){
589   - wx.showModal({
590   - title: '提示',
591   - content: gg.goods_name+'商品的活动发生了变化'
592   - });
593   - t_ok=0;
594   - }
595   - }
596   - })
597   - if(!t_ok) return false;
  584 + if(!good.is_gift ){
  585 + var t_ok=1;
  586 + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => {
  587 + if(res.data.code==0){
  588 + var r_data=res.data.data;
  589 + //-- 参加了全局的优惠活动 --
  590 + if(r_data.promGoodsLists){
  591 + wx.showModal({
  592 + title: '提示',
  593 + content: gg.goods_name+'商品的活动发生了变化'
  594 + });
  595 + t_ok=0;
  596 + }
  597 + }
  598 + })
  599 + if(!t_ok) return false;
  600 + }
598 601 //-- 如果有参加线下取价 --
599 602 if(good.offline_cut>0) wlist+=encodeURIComponent(gg.erpwareid)+",";
600 603 }
... ...