Closed
Merge Request #692 · created by 后端研发-苏明海


Qa


From qa into master

Closed by 后端研发-苏明海

Changes were not merged into target branch

1 participants




















Too many changes.

To preserve performance only 100 of 141 files are displayed.

app.js
... ... @@ -72,7 +72,7 @@ App({
72 72  
73 73 room_id:null, //直播间分享的房间ID
74 74 room_goods_id:null, //直播间分享的商品ID
75   -
  75 +
76 76 },
77 77 auth: o,
78 78 request: a,
... ... @@ -106,7 +106,12 @@ App({
106 106 app.globalData.user_id= user.user_id;
107 107 }
108 108 wx.setStorageSync("userinfo",user);
109   - }
  109 + }else{
  110 + user=null;
  111 + app.globalData.userInfo=null;
  112 + app.globalData.user_id= 0;
  113 + wx.setStorageSync("userinfo",null);
  114 + }
110 115 })
111 116 }
112 117 }
... ... @@ -246,6 +251,7 @@ App({
246 251  
247 252 //----------------获取商家开启的物流--------------------
248 253 getwuliu: function (t, o){
  254 + this.globalData.wuliu=null;
249 255 var th = this, st = this.globalData.setting;
250 256 this.globalData.wuliu && !o ?
251 257 "function" == typeof t && t(this.globalData.wuliu) : a.get("/api/weshop/storeshipping/list", {
... ... @@ -612,9 +618,7 @@ App({
612 618 this.globalData.config2=null; //清除config2的缓存
613 619 this.globalData.config=null; //清除config的缓存
614 620 this.globalData.gr_index=0; //商品分组的序列
615   - for(var i = 1; i < 50; i++) {
616   - clearInterval(i);
617   - }
  621 +
618 622 },
619 623  
620 624 clear_word:function (word) {
... ... @@ -716,7 +720,7 @@ App({
716 720 });
717 721 },
718 722  
719   -
  723 +
720 724  
721 725  
722 726 });
... ...
app.json
... ... @@ -154,7 +154,11 @@
154 154 "pages/user/view_comment/view_comment",
155 155 "pages/user/add_comment/add_comment",
156 156 "pages/user/user_coupon/user_coupon",
157   - "pages/user/buyDetails/buyDetails"
  157 + "pages/user/buyDetails/buyDetails",
  158 + "pages/evaluate/evaluate",
  159 + "pages/evaluate_list/evaluate_list",
  160 + "pages/luckactivity/luckinfo/luckinfo",
  161 + "pages/luckactivity/index/index"
158 162 ]
159 163  
160 164 }
... ...
app.wxss
... ... @@ -16,6 +16,12 @@
16 16 .pdt20 {
17 17 padding-top: 20rpx;
18 18 }
  19 +.pdt30 {
  20 + padding-top: 30rpx;
  21 +}
  22 +.pdt40 {
  23 + padding-top: 40rpx;
  24 +}
19 25 .pdb0 {
20 26 padding-bottom: 0 !important;
21 27 }
... ... @@ -25,6 +31,9 @@
25 31 .pdt10 {
26 32 padding-top: 10rpx;
27 33 }
  34 +.pdt12 {
  35 + padding-top: 12rpx;
  36 +}
28 37 .pdb10 {
29 38 padding-bottom: 10rpx;
30 39 }
... ... @@ -84,6 +93,11 @@
84 93 padding-right: 40rpx;
85 94 }
86 95  
  96 +.w20 {
  97 + width: 20%;
  98 + box-sizing: border-box;
  99 +}
  100 +
87 101 .w25 {
88 102 width: 25%;
89 103 box-sizing: border-box;
... ... @@ -117,6 +131,10 @@
117 131 color: #c7c7c7;
118 132 }
119 133  
  134 +.c-7b {
  135 + color: #7b7b7b;
  136 +}
  137 +
120 138 .c-d {
121 139 color: #ddd;
122 140 }
... ... @@ -129,7 +147,7 @@
129 147 color: #555;
130 148 }
131 149  
132   -.c7b {
  150 +.c-7b {
133 151 color: #7b7b7b;
134 152 }
135 153  
... ... @@ -165,6 +183,7 @@
165 183 margin-left: 20rpx;
166 184 }
167 185  
  186 +
168 187 .mgb20 {
169 188 margin-bottom: 20rpx;
170 189 }
... ... @@ -179,6 +198,10 @@
179 198 margin-right: 20rpx;
180 199 }
181 200  
  201 +.mgt30 {
  202 + margin-top: 30rpx;
  203 +}
  204 +
182 205 .h68 {
183 206 height: 68rpx;
184 207 }
... ... @@ -282,10 +305,18 @@ button {
282 305 .t-c {
283 306 text-align: center;
284 307 }
  308 +.img-block {
  309 + width: 100%;
  310 + height: 100%;
  311 + display: block;
  312 +}
285 313  
286 314 .ai_and{
287 315 align-items: flex-end;
288 316 }
  317 +.ai_end{
  318 + align-items: flex-end;
  319 +}
289 320 .cover-layer {
290 321 position: fixed;
291 322 left: 0;
... ... @@ -561,9 +592,7 @@ background: #b9b9b9;
561 592 color: #333;
562 593 }
563 594  
564   -.xc-black3{
565   -color: #333;
566   -}
  595 +
567 596  
568 597 .xc-fixed{
569 598 position: fixed;
... ... @@ -598,7 +627,7 @@ background: #ffe3e2;
598 627 font-size: 22rpx;
599 628 }
600 629 .fs24{
601   - font-size: 24rpx;
  630 + font-size: 24rpx !important;
602 631 }
603 632  
604 633 .fs26{
... ... @@ -627,6 +656,9 @@ background: #ffe3e2;
627 656 .fs40 {
628 657 font-size: 40rpx !important;
629 658 }
  659 +.fs50 {
  660 + font-size: 50rpx !important;
  661 +}
630 662 .ai_c {
631 663 align-items: center;
632 664 }
... ... @@ -634,12 +666,12 @@ background: #ffe3e2;
634 666 align-items: flex-end;
635 667 }
636 668 .fs45{
637   - font-size: 45rpx;
  669 + font-size: 45rpx !important;
638 670 }
639 671 .fs50{
640   - font-size: 50rpx;
  672 + font-size: 50rpx !important;
641 673 }
642   -.fs60{ font-size:60rpx;}
  674 +.fs60{ font-size:60rpx !important;}
643 675 .fs80 {font-size: 80rpx;}
644 676 .flex-wrap,
645 677 .wrap {
... ... @@ -671,9 +703,9 @@ background: #ffe3e2;
671 703 /* 图标字体(ty) */
672 704 @font-face {
673 705 font-family: 'iconfont'; /* Project id 2054717 */
674   - src: url('//at.alicdn.com/t/font_2054717_vx6pr6zmhth.woff2?t=1623117016358') format('woff2'),
675   - url('//at.alicdn.com/t/font_2054717_vx6pr6zmhth.woff?t=1623117016358') format('woff'),
676   - url('//at.alicdn.com/t/font_2054717_vx6pr6zmhth.ttf?t=1623117016358') format('truetype');
  706 + src: url('//at.alicdn.com/t/font_2054717_nzwl8grylfi.woff2?t=1627287108388') format('woff2'),
  707 + url('//at.alicdn.com/t/font_2054717_nzwl8grylfi.woff?t=1627287108388') format('woff'),
  708 + url('//at.alicdn.com/t/font_2054717_nzwl8grylfi.ttf?t=1627287108388') format('truetype');
677 709 }
678 710  
679 711 .iconfont {
... ... @@ -684,6 +716,40 @@ background: #ffe3e2;
684 716 -moz-osx-font-smoothing: grayscale;
685 717 }
686 718  
  719 +.icon-guan:before {
  720 + content: "\e612";
  721 +}
  722 +
  723 +.icon-gouwuche:before {
  724 + content: "\e617";
  725 +}
  726 +
  727 +.icon-zhuanfa:before {
  728 + content: "\e611";
  729 +}
  730 +
  731 +
  732 +
  733 +.icon-zhuanpan:before {
  734 + content: "\e642";
  735 +}
  736 +
  737 +.icon-tel:before {
  738 + content: "\e610";
  739 +}
  740 +
  741 +.icon-liwu:before {
  742 + content: "\e64e";
  743 +}
  744 +
  745 +.icon-share:before {
  746 + content: "\e785";
  747 +}
  748 +
  749 +.icon-shuangjiantouxia:before {
  750 + content: "\e660";
  751 +}
  752 +
687 753 .icon-plyy:before {
688 754 content: "\e729";
689 755 }
... ...
components/diy_notice/diy_notice.wxml
... ... @@ -3,7 +3,7 @@
3 3 <block wx:if="{{g_filter.has_char(object.wxapp_url,'plugin')>=0}}">
4 4 <navigator url="{{object.wxapp_url}}" class="s1_gk_a1 pd_top10" style="background-color: {{object.notice_bgcolor}}">
5 5 <view class="big_border">
6   - <image class="image_c" src="/public/static/images/model/notice.png"></image>
  6 + <image class="image_c" src="{{imghost}}/miniapp/images/notice.png"></image>
7 7 <view class="marquee">
8 8 <view class="content">
9 9 <text style="color: {{object.notice_color}}">{{object.noticetxt}}</text> <text style="display: inline-block; width: 590rpx;line-height:30rpx;"></text>
... ... @@ -18,7 +18,7 @@
18 18 <block wx:else>
19 19 <view data-url="{{object.wxapp_url}}" class="s1_gk_a1 pd_top10" bindtap="go_url" style="background-color: {{object.notice_bgcolor}}">
20 20 <view class="big_border">
21   - <image class="image_c" src="/public/static/images/model/notice.png"></image>
  21 + <image class="image_c" src="{{imghost}}/miniapp/images/notice.png"></image>
22 22 <view class="marquee">
23 23 <view class="content">
24 24 <text style="color: {{object.notice_color}}">{{object.noticetxt}}</text> <text style="display: inline-block; width: 590rpx;line-height:30rpx;"></text>
... ...
components/diy_pingd_buy/diy_pingd_buy.wxml
... ... @@ -94,7 +94,7 @@
94 94 <view class='sp_jgx_p'>¥{{aitem.market_price}}</view>
95 95 </view>
96 96 <view class="o1_sj_p" wx:if="{{aitem.end_time>newTime}}">
97   - <image class="time_img" src="/public/static/images/model/time.png"></image>
  97 + <image class="time_img" src="{{iurl}}/miniapp/images/time.png"></image>
98 98 <block wx:if="{{aitem.djs.day>0 }}">{{aitem.djs.day}}天</block>{{aitem.djs.hou}}时{{aitem.djs.min}}分{{aitem.djs.sec}}秒
99 99 </view>
100 100  
... ...
components/diy_store_select/diy_store_select.wxss
1   -.store_sele{width: 100%;z-index: 8; height: 88rpx; padding: 0 15rpx;position: fixed; color: white;
2   - top: 0; left: 0; background-color: #ff7295; font-size: 30rpx; }
3   -
4   - .store_sele1{ height: 100rpx; padding: 0 15rpx; color: #666;background-color: #fff; font-size: 32rpx;}
5   -
6   -
7   -.logo_box{ width: 64rpx; height:64rpx;margin-right: 15rpx; }
  1 +.store_sele {
  2 + width: 100%;
  3 + z-index: 8;
  4 + height: 60rpx;
  5 + padding: 0 15rpx;
  6 + /* position: fixed; */
  7 + color: white;
  8 + /* top: 0;
  9 + left: 0; */
  10 + background-color: #ff7295;
  11 + font-size: 26rpx;
  12 + box-sizing: border-box;
  13 +}
  14 +
  15 +.store_sele1 {
  16 + height: 100rpx;
  17 + padding: 0 15rpx;
  18 + color: #666;
  19 + background-color: #fff;
  20 + font-size: 32rpx;
  21 +}
  22 +
  23 +
  24 +.logo_box {
  25 + width: 48rpx;
  26 + height: 48rpx;
  27 + margin-right: 10rpx;
  28 +}
  29 +
8 30 .pd-view {
9   - height: 80rpx;
  31 + /* height: 80rpx; */
  32 +}
  33 +
  34 +.circle {
  35 + border-radius: 50%;
10 36 }
11 37  
12   -.circle{ border-radius: 50%;}
13 38 /*-- 门店选择 --*/
14 39 /* 选择门店的弹窗 */
15   -.mongolia-layer{
16   -position: fixed;
17   -left: 0;
18   -top: 0;
19   -right: 0;
20   -bottom: 0;
21   -z-index: 11;
22   -background: rgba(0,0,0,0.4);
23   -width: 100%;
24   -height: 91.9%;
25   -
26   -}
27   -
28   -.popup-frame{
29   -position: fixed;
30   -bottom:110rpx;
31   -z-index: 20;
32   -background: white;
33   -width: 100%;
34   -border-radius: 20rpx 20rpx 0 0;
35   -height: 72%;
36   -
37   -}
38   -.popup-top{
39   - border-bottom: 1rpx solid #eee;
40   - height: 155rpx;
41   - width: 95%;
42   - margin: auto;
43   - line-height: 155rpx;
44   -
45   -}
46   -.bg_rights{
47   - border-top: 2rpx solid ;
48   - border-right: 2rpx solid ;
49   - transform: rotate(45deg);
50   - display:inline-block;
51   - width:15rpx;height:15rpx;
52   - border-color:#da0b31;
  40 +.mongolia-layer {
  41 + position: fixed;
  42 + left: 0;
  43 + top: 0;
  44 + right: 0;
  45 + bottom: 0;
  46 + z-index: 11;
  47 + background: rgba(0, 0, 0, 0.4);
  48 + width: 100%;
  49 + height: 91.9%;
  50 +
  51 +}
  52 +
  53 +.popup-frame {
  54 + position: fixed;
  55 + bottom: 110rpx;
  56 + z-index: 20;
  57 + background: white;
  58 + width: 100%;
  59 + border-radius: 20rpx 20rpx 0 0;
  60 + height: auto;
  61 +
  62 +}
  63 +
  64 +.popup-top {
  65 + border-bottom: 1rpx solid #eee;
  66 + height: 155rpx;
  67 + width: 95%;
  68 + margin: auto;
  69 + line-height: 155rpx;
  70 +
  71 +}
  72 +
  73 +.bg_rights {
  74 + border-top: 2rpx solid;
  75 + border-right: 2rpx solid;
  76 + transform: rotate(45deg);
  77 + display: inline-block;
  78 + width: 15rpx;
  79 + height: 15rpx;
  80 + border-color: #da0b31;
53 81 }
  82 +
54 83 .modal-closes {
55   - position: absolute;
56   - right: 30rpx;
57   - top: -15rpx;
58   - height: 25rpx;
59   -
60   -}
61   -.choose_more{
62   - margin-top: 40rpx;
63   - margin-right: 20rpx;
64   -
65   -}
66   -.choose_mores{
67   - margin-top: 30rpx;
68   - margin-right: 15rpx;
69   -
70   -}
71   -.store-list{
72   - width: 95%;
73   - height: 72%;
74   - overflow-y: scroll;
75   - margin: auto;
76   -}
77   -.store-list .store_choose{
78   - width: 100%;
79   - height: 120rpx;
80   - line-height: 125rpx;
81   - border-bottom: 1rpx solid #eee;
82   -
83   -}
84   -.store-list .store_choose .store{
85   -width: 100%;
86   -margin: auto;
87   -line-height: 37rpx;
88   -padding-left: 20rpx;
89   -
90   -}
91   -.xc-hook{
92   - width: 35rpx;
93   - height: 35rpx;
94   - transform: rotate(-145deg);
95   -line-height: 37rpx;
96   -text-align: center;
97   -}
98   - .xc-hooks{
99   - width: 30rpx;
100   - height: 30rpx;
101   - border: 1rpx solid #999;
102   - }
103   - .address-frame{
104   - width: 93%;
105   -margin-left: 7rpx;
106   -
107   - }
108   - .nearby_store{
109   -margin-left: 17rpx;
110   - }
111   - .address_name{
112   - margin-right: 10rpx;
113   -
114   - }
115   - .address-val{
116   - height: 38rpx;
117   -line-height: 38rpx;
118   -
119   - }
120   - .store-bottom{
121   - width: 85%;
122   - margin: auto;
123   - height: 70rpx;
124   - }
125   - .determine{
126   - width: 260rpx;
127   - height: 55rpx;
128   - border-radius: 50rpx;
129   - line-height: 55rpx;
130   - }
131   - .default{
132   - width: 260rpx;
133   - height: 55rpx;
134   - border:3rpx solid #c8c8c8;
135   - border-radius: 50rpx;
136   - line-height: 55rpx;
137   - }
138   - .store-bottom-frame{
139   - width: 95%;
140   - margin: auto;
141   - }
142   -
143   -
144   - /* 门店分类列表 */
145   - .sort_store_list{
146   - height: 82%;
147   - overflow: hidden;
148   - overflow-y: scroll;
149   - width: 95%;
150   - margin: auto;
151   - }
152   - .sort_store_list .sort-store-frame{
153   - width: 100%;
154   - height: 100rpx;
155   - line-height:100rpx;
156   - border-bottom: 1rpx solid #eee;
157   -
158   - }
159   - .sort_store_list .sort-store-frame .sort-store{
160   - width: 94.5%;
161   - margin: auto;
162   - }
163   - .ai_center{ align-items: center;}
164 84 \ No newline at end of file
  85 + position: absolute;
  86 + right: 30rpx;
  87 + top: -15rpx;
  88 + height: 25rpx;
  89 +
  90 +}
  91 +
  92 +.choose_more {
  93 + margin-top: 40rpx;
  94 + margin-right: 20rpx;
  95 +
  96 +}
  97 +
  98 +.choose_mores {
  99 + margin-top: 30rpx;
  100 + margin-right: 15rpx;
  101 +
  102 +}
  103 +
  104 +.store-list {
  105 + width: 95%;
  106 + max-height: 610rpx;
  107 + overflow-y: scroll;
  108 + margin: auto;
  109 + min-height: 300rpx;
  110 +}
  111 +
  112 +.store-list .store_choose {
  113 + width: 100%;
  114 + height: 120rpx;
  115 + line-height: 125rpx;
  116 + border-bottom: 1rpx solid #eee;
  117 +
  118 +}
  119 +
  120 +.store-list .store_choose .store {
  121 + width: 100%;
  122 + margin: auto;
  123 + line-height: 37rpx;
  124 + padding-left: 20rpx;
  125 +
  126 +}
  127 +
  128 +.xc-hook {
  129 + width: 35rpx;
  130 + height: 35rpx;
  131 + transform: rotate(-145deg);
  132 + line-height: 37rpx;
  133 + text-align: center;
  134 +}
  135 +
  136 +.xc-hooks {
  137 + width: 30rpx;
  138 + height: 30rpx;
  139 + border: 1rpx solid #999;
  140 +}
  141 +
  142 +.address-frame {
  143 + width: 93%;
  144 + margin-left: 7rpx;
  145 +
  146 +}
  147 +
  148 +.nearby_store {
  149 + margin-left: 17rpx;
  150 +}
  151 +
  152 +.address_name {
  153 + margin-right: 10rpx;
  154 +
  155 +}
  156 +
  157 +.address-val {
  158 + height: 38rpx;
  159 + line-height: 38rpx;
  160 +
  161 +}
  162 +
  163 +.store-bottom {
  164 + width: 85%;
  165 + margin: auto;
  166 + height: 90rpx;
  167 +}
  168 +
  169 +.determine {
  170 + width: 260rpx;
  171 + height: 55rpx;
  172 + border-radius: 50rpx;
  173 + line-height: 55rpx;
  174 +}
  175 +
  176 +.default {
  177 + width: 260rpx;
  178 + height: 55rpx;
  179 + border: 3rpx solid #c8c8c8;
  180 + border-radius: 50rpx;
  181 + line-height: 55rpx;
  182 +}
  183 +
  184 +.store-bottom-frame {
  185 + width: 95%;
  186 + margin: auto;
  187 +}
  188 +
  189 +
  190 +/* 门店分类列表 */
  191 +.sort_store_list {
  192 + height: 82%;
  193 + overflow: hidden;
  194 + overflow-y: scroll;
  195 + width: 95%;
  196 + margin: auto;
  197 +}
  198 +
  199 +.sort_store_list .sort-store-frame {
  200 + width: 100%;
  201 + height: 100rpx;
  202 + line-height: 100rpx;
  203 + border-bottom: 1rpx solid #eee;
  204 +
  205 +}
  206 +
  207 +.sort_store_list .sort-store-frame .sort-store {
  208 + width: 94.5%;
  209 + margin: auto;
  210 +}
  211 +
  212 +.ai_center {
  213 + align-items: center;
  214 +}
... ...
components/goods_list/goods_list.wxml
... ... @@ -4,31 +4,34 @@
4 4 <view class="collects">
5 5 <view class="hang ">
6 6 <!-- 商品详情 -->
7   - <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">
8   - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">
  7 + <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}">
  8 + <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}" hover-class="none">
9 9 <!-- 商品图⽚ -->
10   - <image class="sp" src="{{url+item.original_img}}" mode="scaleToFill" binderror="bind_bnerr_xc" data-url="{{url+item.original_img}}" data-errorimg="recommend[{{index}}].original_img"></image>
  10 + <image class="sp" src="{{url+item.original_img}}" mode="aspectFill" binderror="bind_bnerr_xc" data-url="{{url+item.original_img}}" data-errorimg="recommend[{{index}}].original_img"></image>
11 11 <view class="bottom">
12 12 <!-- 商品名称 -->
13 13 <view class="goods_name ellipsis-2 fs28">{{item.goods_name}}</view>
14 14 <!-- 判断是否有活动价 -->
15 15 <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}">
16   - <view class="money flex xc-wc" >
17   - <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text>
18   - <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
19   - <!-- 活动价 -->
20   - <view class="flex xc-wc" wx:if="{{item.prom_price}}">
21   - <view class="fs24">¥</view>
22   - <view class="fs35">{{item.prom_price}}</view>
23   - </view>
24   - </view>
25   - <view class="flex" style="line-height: 28rpx;">
26   - <!-- 原价 -->
27   - <view class="price flex xc-ash line_th">
28   - <view class="fs22">¥</view>
29   - <view class="fs22">{{item.market_price}}</view>
30   - </view>
31   - </view>
  16 + <view class="pdt10">
  17 + <view class="money flex xc-wc" >
  18 + <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text>
  19 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  20 + <!-- 活动价 -->
  21 + <view class="flex xc-wc" wx:if="{{item.prom_price}}">
  22 + <view class="fs24">¥</view>
  23 + <view class="fs35">{{item.prom_price}}</view>
  24 + </view>
  25 + </view>
  26 + <view class="flex">
  27 + <!-- 原价 -->
  28 + <view class="price flex xc-ash line_th">
  29 + <view class="fs22">¥</view>
  30 + <view class="fs22">{{item.market_price}}</view>
  31 + </view>
  32 + </view>
  33 + </view>
  34 +
32 35 </block>
33 36 <block wx:else>
34 37 <!-- 商品价格,先判断下是后⼜等级价-->
... ... @@ -48,7 +51,7 @@
48 51 </view>
49 52 </view>
50 53 </view>
51   - <view class="flex" style="line-height: 28rpx;">
  54 + <view class="flex">
52 55 <!-- 原价 -->
53 56 <view class="price flex xc-ash line_th">
54 57 <view class="fs22">¥</view>
... ... @@ -64,7 +67,7 @@
64 67 <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
65 68 </view>
66 69 </view>
67   - <view class="flex" style="line-height: 28rpx;">
  70 + <view class="flex">
68 71 <!-- 原价 -->
69 72 <view class="price flex xc-ash line_th">
70 73 <view class="fs22">¥</view>
... ... @@ -108,7 +111,7 @@
108 111 <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
109 112 </view>
110 113 </view>
111   - <view class="flex" style="line-height: 28rpx;">
  114 + <view class="flex">
112 115 <!-- 原价 -->
113 116 <view class="price flex xc-ash line_th">
114 117 <view class="fs22">¥</view>
... ... @@ -119,7 +122,7 @@
119 122 </block>
120 123 </block>
121 124 <!-- 商品压根就没有等级价 -->
122   - <block wx:else>
  125 + <view class="pdt10" wx:else>
123 126 <view class="money flex">
124 127 <!-- 办卡价 -->
125 128 <view class="flex xc-wc">
... ... @@ -127,14 +130,14 @@
127 130 <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
128 131 </view>
129 132 </view>
130   - <view class="flex" style="line-height: 28rpx;">
  133 + <view class="flex" style="">
131 134 <!-- 原价 -->
132 135 <view class="price flex xc-ash line_th">
133 136 <view class="fs22">¥</view>
134 137 <view class="fs22">{{item.market_price}}</view>
135 138 </view>
136 139 </view>
137   - </block>
  140 + </view>
138 141 </block>
139 142 </view>
140 143 </navigator>
... ...
components/goods_list/goods_list.wxss
1 1 .collects {
2   - margin-top: 40rpx;
3   - margin-bottom: 40rpx;
  2 + /* margin-top: 40rpx; */
  3 + /* margin-bottom: 40rpx; */
  4 +}
  5 +
  6 +.pdt10 {
  7 + padding-top: 10rpx;
4 8 }
5 9  
6 10 .ai-center{
... ... @@ -82,40 +86,54 @@
82 86  
83 87 .goods_name {
84 88 height: 62rpx;
85   - margin-top: 6rpx;
86   - line-height: 30rpx;
  89 + /* margin-top: 6rpx; */
  90 + line-height: 1.2;
  91 + margin-bottom: 10rpx;
87 92 }
88 93  
89 94 .hang {
90   - width: 100%;
91   - margin: auto;
92   - padding-left: 21rpx;
  95 + /* width: 100%; */
  96 + /* margin: auto;
  97 + padding-left: 21rpx; */
  98 + display: flex;
  99 + flex-wrap: wrap;
  100 + /* margin: 0 auto; */
  101 + padding: 0 20rpx;
  102 + box-sizing: border-box;
  103 + /* justify-content: space-evenly; */
93 104 }
94 105  
95 106 .hang .collect {
96   - width: 347rpx;
97   - height: 520rpx;
  107 + width: calc((100% - 20rpx) / 2);
  108 + /* height: 520rpx; */
98 109 border-radius: 25rpx;
99   - border: 1rpx solid rgb(214, 214, 214);
  110 + border: 2rpx solid #ebedf0;
100 111 overflow: hidden;
101   - margin-right: 14rpx;
102   - margin-bottom: 5rpx;
  112 + box-sizing: border-box;
  113 + margin-top: 20rpx;
  114 + /* margin-right: 14rpx;
  115 + margin-bottom: 5rpx; */
  116 +}
  117 +
  118 +.hang .collect:nth-child(2n+1) {
  119 + margin-right: 20rpx;
103 120 }
104 121  
105 122 .collect .bottom {
106   - padding: 0rpx 20rpx;
  123 + padding: 20rpx;
107 124 }
108 125  
109 126 .collect .sp {
110 127 width: 100%;
111   - height: 326rpx;
  128 + height: 340rpx;
  129 + display: block;
112 130 }
113 131  
114 132 .collect .money {
115   - margin-top: 28rpx;
  133 + /* margin-top: 28rpx;
116 134 margin-bottom: 8rpx;
117 135 line-height: 28rpx;
118   - align-items: baseline;
  136 + align-items: baseline; */
119 137 }
120 138  
121 139 .collect .money view {
... ... @@ -177,7 +195,7 @@
177 195 .nothing .Foil {
178 196 width: 80rpx;
179 197 height: 2rpx;
180   - background-color: rgb(138, 138, 138);
  198 + background-color: #ebedf0;
181 199 }
182 200  
183 201 .line_th {
... ...
components/my-qrcode/my-qrcode.js 0 → 100644
  1 +// pages/user/yhq/qr_code/qr_code.js
  2 +const {
  3 + barcode,
  4 + qrcode
  5 +} = require('../../utils/index.js')
  6 +
  7 +Component({
  8 + data: {
  9 + q_show:0,
  10 + object:null,
  11 + index:0,
  12 + is_fw:0,
  13 +
  14 + barcode_canvas:null,
  15 + qrcode_canvas:null,
  16 + },
  17 + properties: {
  18 + // 这里定义了innerText属性,属性值可以在组件使用时指定
  19 + },
  20 + ready: function () {
  21 + },
  22 +
  23 + methods: {
  24 + //关闭
  25 + close: function (e) {
  26 + this.setData({q_show: 0,barcode_canvas:null,qrcode_canvas:null });
  27 + this.triggerEvent('close',{},{bubbles: true});
  28 + },
  29 +
  30 + //打开
  31 + open:function (e) {
  32 + this.data.index++;
  33 + var list=[{index:this.data.index }];
  34 +
  35 + this.setData({q_show: 1,object:e,barcode_canvas:list,qrcode_canvas:list,is_fw:e.is_fw });
  36 + var val=e.val;
  37 +
  38 + // barcode('barcode'+this.data.index,val, 620, 160,this);
  39 + qrcode('qrcode'+this.data.index, val, 520, 520,this);
  40 + }
  41 + },
  42 +
  43 +
  44 +
  45 +
  46 +})
0 47 \ No newline at end of file
... ...
components/full_screen/full_screen.json renamed to components/my-qrcode/my-qrcode.json
1 1 {
2   - "component": true,
3   - "usingComponents": {}
  2 + "component": true,
  3 + "usingComponents": {}
4 4 }
5 5 \ No newline at end of file
... ...
components/my-qrcode/my-qrcode.wxml 0 → 100644
  1 +<view class="xc-pop-up" wx:if="{{q_show}}" catchtouchmove='true'>
  2 + <view class="shut"><text class="iconfont icon-close" bindtap="close"></text></view>
  3 + <view class="barqrcode">
  4 + <canvas class="qrcode" canvas-id="qrcode{{item.index}}" wx:for="{{barcode_canvas}}"/>
  5 + <view class="q_code fs28">兑换码:{{object.val}}</view>
  6 + <view class="c-9 pdt10">请向店员出示二维码核销兑换</view>
  7 + </view>
  8 +</view>
  9 +
... ...
components/my-qrcode/my-qrcode.wxss 0 → 100644
  1 +@import '../../app.wxss';
  2 +
  3 +.xc-pop-up{
  4 + position:fixed;
  5 + z-index:5;
  6 + top: 50%;
  7 + left: 50%;
  8 + transform: translate(-50%, -50%);
  9 +}
  10 +
  11 +
  12 +.xc-obscuration{
  13 + position: fixed;
  14 + left: 0;
  15 + top: 0;
  16 + right: 0;
  17 + bottom: 0;
  18 + z-index: 11;
  19 + background: rgba(0,0,0,0.4);
  20 + width: 100%;
  21 + height: 100%;
  22 +
  23 +
  24 +
  25 +}
  26 +
  27 + /* Y */
  28 +.xc-qr-frame{
  29 + /* width:90%;
  30 + min-height: 696rpx;
  31 + background: #fff;
  32 + z-index: 55;
  33 + position: fixed;
  34 + top:180rpx; */
  35 + /* height: auto; */
  36 + /* padding-bottom:20rpx; */
  37 + /* left:35rpx; */
  38 + /* overflow: hidden;
  39 + border-radius: 16rpx; */
  40 +}
  41 +
  42 +/* 二维码和条形码的边框Y */
  43 +.barqrcode{
  44 + background-color: white;
  45 + border-radius: 16rpx;
  46 + padding: 0 40rpx 40rpx;
  47 + text-align: center;
  48 +}
  49 +/* 点击条形Y */
  50 +.barcode {
  51 + /* background-color: white;
  52 + border-radius: 12rpx; */
  53 +}
  54 +canvas{
  55 + width:100%;
  56 + height:55px;
  57 +display:block;
  58 +
  59 +}
  60 +.q_code{
  61 + color: #333;
  62 +}
  63 +
  64 +
  65 +/* 二维码边框Y*/
  66 +.qrcode_rim {
  67 + width: 550rpx;
  68 + height:544rpx;
  69 +display:flex;
  70 +flex-direction:column;
  71 +position: absolute;
  72 +left: 75rpx;
  73 +top: 5rpx;
  74 +
  75 +}
  76 +.qrcode{
  77 + width: 520rpx;
  78 + height: 520rpx;
  79 +}
  80 +.r-code{
  81 + /* font-size:28rpx;
  82 + padding-left: 25rpx; */
  83 + /* margin-top: -5.5rpx; */
  84 +
  85 +}
  86 +
  87 +.shut{
  88 + color: white;
  89 + text-align: right;
  90 + padding-bottom: 30rpx;
  91 + position: relative;
  92 +}
  93 +
  94 +
  95 +.icon-close {
  96 + font-size: 48rpx;
  97 +}
  98 +
  99 +.shut::after {
  100 + content: '';
  101 + width: 2rpx;
  102 + height: 32rpx;
  103 + background-color: white;
  104 + position: absolute;
  105 + bottom: 0;
  106 + right: 24rpx;
  107 +}
  108 +
  109 +.mt{ margin-top:130rpx}
  110 +.mts{ margin-top:70rpx}
  111 +.flex{
  112 + display: flex;
  113 + justify-content:center;
  114 +}
  115 +
  116 +.code_show{
  117 + text-align: center;position: relative; left: -20rpx;
  118 +}
  119 +
  120 +.c-9 {
  121 + color: #999;
  122 +}
0 123 \ No newline at end of file
... ...
components/share/share.js
... ... @@ -12,7 +12,10 @@ Component({
12 12 },
13 13 set_type(type){
14 14 this.setData({type:type})
15   - }
  15 + },
  16 + send() {
  17 + this.triggerEvent('send',{},{bubbles: true});
  18 + },
16 19  
17 20 }
18 21 })
19 22 \ No newline at end of file
... ...
components/share/share.wxml
... ... @@ -2,7 +2,7 @@
2 2 <view class="container-wrap animated slideInUp">
3 3 <view class="flex">
4 4 <block wx:if="{{type==0}}">
5   - <button open-type="share" class="btn">
  5 + <button open-type="share" class="btn" bindtap="send">
6 6 <view class="icon-container bg-green"><view class="iconfont icon-weixin"></view></view>
7 7 <view class="title">发送给好友</view>
8 8 </button>
... ...
custom-tab-bar/index.wxss
1   -.main_bar{
2   - width:100%; border-top: 1rpx solid #ebebeb; position: fixed; bottom: 0; left: 0; z-index: 10000;
3   - display: flex; justify-content: space-around;
  1 +.main_bar {
  2 + width: 100%;
  3 + border-top: 1rpx solid #ebebeb;
  4 + position: fixed;
  5 + bottom: 0;
  6 + left: 0;
  7 + z-index: 10000;
  8 + display: flex;
  9 + justify-content: space-around;
4 10 }
5   -.tabbar_item{
6   - position:relative;height:100%;float:left;text-align:center;padding:0px 0;
  11 +
  12 +.tabbar_item {
  13 + position: relative;
  14 + height: 100%;
  15 + float: left;
  16 + text-align: center;
  17 + padding: 0px 0;
7 18 }
8   -.tab_img{display: flex; justify-content: center;align-items: center}
9   -.nav_imgage{
10   - height: 58rpx; width: 58rpx;background-position: center;background-repeat: no-repeat;background-size: auto 92%;
  19 +
  20 +.tab_img {
  21 + display: flex;
  22 + justify-content: center;
  23 + align-items: center
  24 +}
  25 +
  26 +.nav_imgage {
  27 + height: 52rpx;
  28 + width: 52rpx;
  29 + background-position: center;
  30 + background-repeat: no-repeat;
  31 + background-size: 100%;
  32 +}
  33 +
  34 +.cart_num {
  35 + top: 0;
  36 + background-color: red;
  37 + color: #fff;
  38 + font-size: 20rpx;
  39 + border-radius: 50%;
  40 + width: 40rpx;
  41 + line-height: 40rpx;
  42 + height: 40rpx;
  43 + position: absolute;
  44 + z-index: 100;
  45 + right: 30rpx;
11 46 }
12   -.cart_num{
13   - top:0;background-color: red;color: #fff;font-size: 20rpx;border-radius: 50%;width: 40rpx;line-height:40rpx;height: 40rpx;position: absolute;z-index: 100;right:30rpx;
14   -}
15 47 \ No newline at end of file
... ...
packageA/images/1.jpg deleted

181 KB

packageA/images/cloud.jpg deleted

12 KB

packageA/pages/goodsInfo/goodsInfo.js
... ... @@ -199,8 +199,10 @@ Page({
199 199 //------初始化加载----------
200 200 onLoad: function(t) {
201 201  
202   - console.log("--服务卡项--");
203   - console.log(t);
  202 + // console.log("--服务卡项--");
  203 + // console.log('fdsfasfasf111111111111111====================',t);
  204 +
  205 +
204 206  
205 207 var ee = this,
206 208 that = ee,
... ... @@ -320,7 +322,7 @@ Page({
320 322 //如果有开启近距离的话,同时距离优不一样了
321 323 if (that.data.lat != null) {
322 324 //如果经纬度有变化的话
323   - if( appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){
  325 + if(e && appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){
324 326 that.data.fir_def_store=e;
325 327 that.setData({
326 328 def_pick_store: e,
... ... @@ -884,7 +886,7 @@ Page({
884 886 data: dd,
885 887 }).then(res => {
886 888 var e = res;
887   - if (e.data.code == 0) {
  889 + if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length>0) {
888 890 //--普通门店排版--
889 891 setTimeout(function(){
890 892 var sto_list=th.data.data.storageId;
... ... @@ -1078,12 +1080,16 @@ Page({
1078 1080 });
1079 1081 //-----如果没有默认门店,要取第一个门店作为默认店------
1080 1082 if (!th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage) {
1081   - th.setData({
1082   - def_pick_store:e.data.data.pageData[0],
1083   - sto_sele_name: e.data.data.pageData[0].pickup_name,
1084   - sto_sele_id: e.data.data.pageData[0].pickup_id,
1085   - sto_sele_distr: e.data.data.pageData[0].distr_type
1086   - })
  1083 +
  1084 + if(e.data.data && e.data.data.pageData && e.data.data.pageData.length>0){
  1085 + th.setData({
  1086 + def_pick_store:e.data.data.pageData[0],
  1087 + sto_sele_name: e.data.data.pageData[0].pickup_name,
  1088 + sto_sele_id: e.data.data.pageData[0].pickup_id,
  1089 + sto_sele_distr: e.data.data.pageData[0].distr_type
  1090 + })
  1091 + }
  1092 +
1087 1093 }
1088 1094 }
1089 1095 },
... ... @@ -1857,7 +1863,8 @@ Page({
1857 1863 });
1858 1864 return false;
1859 1865 }
1860   -
  1866 +
  1867 + if(!item) return false;
1861 1868  
1862 1869 th.setData({
1863 1870 def_pick_store: item,
... ... @@ -1961,6 +1968,9 @@ Page({
1961 1968 }
1962 1969 });
1963 1970  
  1971 +
  1972 + if(!item) return false;
  1973 +
1964 1974 th.setData({
1965 1975 def_pick_store: item,
1966 1976 sto_sele_name: item.pickup_name,
... ... @@ -2175,6 +2185,14 @@ Page({
2175 2185 imageUrl:this.data.gallery[0].image_url,
2176 2186 }
2177 2187 },
  2188 +
  2189 +
  2190 +
  2191 + clickCollapse() {
  2192 + this.setData({
  2193 + flag: !this.data.flag,
  2194 + })
  2195 + },
2178 2196  
2179 2197  
2180 2198  
... ...
packageA/pages/goodsInfo/goodsInfo.wxml
... ... @@ -39,7 +39,7 @@
39 39 <view class="goods-title"> <view class="goods-name elli">{{data.goods_name}}</view></view>
40 40 </view>
41 41  
42   - <view class="goods-num" style="margin-bottom: 10rpx;">
  42 + <view class="goods-num">
43 43 <view class="sales">销量:{{data.sales_sum}}</view>
44 44 <view class="sales">有效天数:{{data.validDays?data.validDays:'不限'}}</view>
45 45 </view>
... ... @@ -55,7 +55,7 @@
55 55 <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
56 56 <view class="fs30" style="color:black;">选择门店</view>
57 57 </view>
58   - <view class="red_bb fs30">
  58 + <view class="red_bb fs26">
59 59 更多门店
60 60 <text class="bg_jj"></text>
61 61 </view>
... ... @@ -86,28 +86,42 @@
86 86  
87 87 </view>
88 88  
89   - <view class="bz_view flex ai-center bdt16" wx:if="{{store_config}}" style="line-height: 36rpx">
90   - <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image>
91   - <view class="bz-content">{{store_config.service_bz}}</view>
92   - </view>
  89 + <view class="bz_view flex bdt16" wx:if="{{store_config}}">
  90 + <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image>
  91 + <view class="flex f1 ai_c rel">
  92 + <view class="bz-content {{flag ? '':'ellipsis-1'}} f1">{{store_config.service_bz}}</view>
  93 + <view bindtap="clickCollapse" class="cx-obtain-coupon wsize arrow">
  94 + <text class="bg_jj {{flag?'down1':''}}"></text>
  95 + </view>
  96 + <!-- <text class="bg_jj" bindtap="clickCollapse"></text> -->
  97 + <!-- <text class="iconfont icon-shuangjiantouxia c-db"></text> -->
  98 + </view>
  99 + </view>
  100 +
  101 +
  102 +
  103 +
  104 +
  105 +
  106 +
93 107 <!-- 图文详情 -->
94   - <view>
95   - <view class="tuwen_title">
  108 + <view class="pd20">
  109 + <!-- <view class="tuwen_title">
96 110 <view class="g_line"></view>
97 111 <view class="center_s">
98 112 <image src="{{iurl}}/miniapp/images/tuwen_c.png"></image><text>详情</text>
99 113 </view>
100   - </view>
  114 + </view> -->
101 115  
102 116 <view wx:if="{{service_list}}">
103   - <view class="goods-num" style="font-size: 26rpx; background-color: #f6f5f4;">
  117 + <view class="goods-num pdv20 t-c" style="font-size: 26rpx; background-color: #f6f5f4;">
104 118 <view class="stock">项目名称</view>
105 119 <view class="stock">耗时(分)</view>
106 120 <view class="stock">手工费</view>
107 121 <view class="stock">次数</view>
108 122 </view>
109 123 <block wx:for="{{service_list}}">
110   - <view class="goods-num" style="margin-bottom: 10rpx;font-size: 22rpx;">
  124 + <view class="goods-num pdv20 t-c" style="margin-bottom: 10rpx;font-size: 22rpx;">
111 125 <view class="stock">{{item.projectName}}</view>
112 126 <view class="stock">{{item.timeConsuming}}</view>
113 127 <view class="stock">{{item.money}}</view>
... ... @@ -143,29 +157,33 @@
143 157 </view>
144 158  
145 159 <!-- 底部按钮 -->
146   - <view class="join-cart">
147   - <!-- bindtap="contactService" -->
148   - <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
149   - <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
150   - <view>客服</view>
151   - </button>
152   - <view wx:else class="custom-service cart-ico new_split" bindtap="contactService">
153   - <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
154   - <view>客服</view>
155   - </view>
156   -
157   - <view class="shopping-cart cart-ico new_split">
158   - <navigator open-type="switchTab" url="/pages/cart/cart/cart">
159   - <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image>
160   - <view class="cart-num ellipsis-1"> {{cartGoodsNum}} </view>
161   - <view>购物车</view>
162   - </navigator>
163   - </view>
  160 + <view class="join-cart jc_sb">
  161 + <!-- bindtap="contactService" -->
  162 + <view class="flex">
  163 + <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
  164 + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
  165 + <view>客服</view>
  166 + </button>
  167 + <view wx:else class="custom-service cart-ico new_split" bindtap="contactService">
  168 + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
  169 + <view>客服</view>
  170 + </view>
  171 +
  172 + <view class="shopping-cart cart-ico new_split">
  173 + <navigator open-type="switchTab" url="/pages/cart/cart/cart">
  174 + <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image>
  175 + <view class="cart-num ellipsis-1"> {{cartGoodsNum}} </view>
  176 + <view>购物车</view>
  177 + </navigator>
  178 + </view>
  179 + </view>
  180 +
164 181  
165   - <block>
166   - <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>
167   - <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view>
168   - </block>
  182 + <view class="flex f1 pdh20">
  183 +
  184 + <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn f1">加入购物车</view>
  185 + <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn f1">立即购买</view>
  186 + </view>
169 187  
170 188 </view>
171 189  
... ... @@ -227,7 +245,7 @@
227 245 <view class="b_num">
228 246 <view>购买数量</view>
229 247 <view class="count">
230   - <view bindtap="subCartNum" class="sub">-</view>
  248 + <view bindtap="subCartNum" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view>
231 249 <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>
232 250 <view bindtap="addCartNum" class="add">+</view>
233 251 </view>
... ...
packageA/pages/goodsInfo/goodsInfo.wxss
... ... @@ -9,15 +9,19 @@ image {
9 9 display: flex;
10 10 justify-content: center;
11 11 width: 100%;
  12 + position: fixed;
  13 + top: 0;
  14 + z-index: 999;
12 15 /* height: 80rpx; */
13 16 /* margin-bottom: 20rpx; */
14 17 background-color: #fff;
  18 + border-top: 2rpx solid #ebedf0;
15 19 /* border-bottom: 1rpx #fafafa solid; */
16 20 }
17 21 .type-box {
18 22 width: 25%;
19 23 box-sizing: border-box;
20   - font-size: 28rpx;
  24 + font-size: 32rpx;
21 25 line-height: 76rpx;
22 26 padding: 0 20rpx;
23 27 text-align: center;
... ... @@ -29,12 +33,14 @@ image {
29 33 display: flex;
30 34 justify-content: center;
31 35 width: 100%;
  36 + font-size: 26rpx;
32 37 }
33 38 .type-item-on {
34 39 color: #F95D74;
35 40 font-weight: bold;
36 41 /* border-bottom: 4rpx solid #F95D74; */
37 42 position: relative;
  43 + font-size: 30rpx;
38 44 }
39 45 .type-item-on:after {
40 46 content: '';
... ... @@ -53,19 +59,21 @@ image {
53 59 }
54 60 .goods-title {
55 61 display: flex;
56   - justify-content: space-between; overflow: hidden;
  62 + justify-content: space-between;
  63 + /* overflow: hidden; */
57 64 /* height: 108rpx; */
58 65 }
59 66 .goods-name {
60   - width: 560rpx;
61   - line-height: 46rpx;
  67 + /* width: 560rpx; */
  68 + /* line-height: 46rpx; */
62 69 font-size: 32rpx;
63 70 font-weight: bold;
64 71 color: #333;
65   - margin-top: 30rpx;
66   - margin-bottom:30rpx;
  72 + /* margin-top: 30rpx;
  73 + margin-bottom:30rpx; */
67 74 flex: 1;
68 75 text-align: justify;
  76 + margin: 10rpx 0 20rpx;
69 77 }
70 78  
71 79 .goods-collect {
... ... @@ -89,13 +97,13 @@ image {
89 97 .goods-price {
90 98 font-size: 60rpx;
91 99 /* padding: 20rpx 34rpx; */
92   - padding:0rpx 34rpx;
  100 + /* padding:0rpx 34rpx; */
93 101 /* line-height: 60rpx; */
94 102 color: #999;
95   -
  103 + padding: 20rpx;
96 104 /* margin-top: 46rpx; */
97   - margin-top:26rpx;
98   - padding-bottom:20rpx;
  105 + /* margin-top:26rpx;
  106 + padding-bottom:20rpx; */
99 107 }
100 108  
101 109 .prom-info {
... ... @@ -111,13 +119,13 @@ image {
111 119 border-radius: 4rpx;
112 120 }
113 121 .market-price {
114   - display: flex;
115   - margin-left: -5rpx;
  122 + /* display: flex;
  123 + margin-left: -5rpx; */
116 124 }
117 125  
118 126 .market-price .yuan{
119   - top:24rpx;
120   - font-size: 36rpx
  127 + /* top:24rpx; */
  128 + font-size: 30rpx
121 129 }
122 130  
123 131 .market-price>view>text {
... ... @@ -125,7 +133,8 @@ image {
125 133 }
126 134  
127 135 .market-price>.yj{
128   - color: #999999; font-size: 26rpx;margin-left: 16rpx;position: relative;top:30rpx;
  136 + color: #999999; font-size: 24rpx;/* margin-left: 16rpx;position: relative;top:30rpx; */
  137 + display: inline-block;
129 138 }
130 139  
131 140 .goods-price>.tm{ color: #999999; font-size: 26rpx;margin-top: 10rpx;}
... ... @@ -134,6 +143,7 @@ image {
134 143 display: flex;
135 144 font-size: 24rpx;
136 145 justify-content: space-between;
  146 +
137 147 }
138 148  
139 149 .goods-detail .twen{
... ... @@ -348,11 +358,11 @@ image {
348 358 }
349 359  
350 360 .join-cart>view {
351   - width: 32%;
  361 + width: 29%;
352 362 }
353 363  
354 364 .join-cart>.new_split {
355   - width: 17%;
  365 + width: 13%;
356 366 text-align: center;
357 367 padding: 0;
358 368 margin: 0;
... ... @@ -551,29 +561,28 @@ border-radius: 0 56rpx 55rpx 0;
551 561 /* padding: 0 30rpx; */
552 562 font-size: 32rpx;
553 563 box-sizing: border-box;
554   - border-radius: 20rpx;
  564 + border-radius: 20rpx 20rpx 0 0;
555 565 /* height: 72%; */
556 566 }
557 567  
558   -.spec-model .pding{padding: 0 30rpx;}
  568 +.spec-model .pding{padding: 0 20rpx;}
559 569  
560 570 .spec-goods {
561 571 padding: 30rpx 0 20rpx;
562 572 /* float: left; */
563   - display: flex;
564 573 width: 100%;
565   - border-bottom:2rpx solid #eee;
  574 + /* border-bottom:2rpx solid #eee; */
566 575 }
567 576  
568 577 .spec-img {
569   - /* float: left; */
  578 + float: left;
570 579 height: 186rpx;
571 580 width: 186rpx;
572 581 border: 4rpx solid #eee
573 582 }
574 583  
575 584 .spec-goods-info {
576   - /* float: left; */
  585 + float: left;
577 586 padding: 0 25rpx;
578 587 width: 400rpx;
579 588 }
... ... @@ -608,17 +617,17 @@ border-radius: 0 56rpx 55rpx 0;
608 617  
609 618 .quhuo{font-size: 30rpx; color: #000}
610 619 .b_num{
611   - display: flex;
612   - font-size: 30rpx;
613   - color: #333;
  620 + display: flex;font-size: 30rpx; color: #333;
  621 + justify-content: space-between;
  622 + align-items: center;
614 623 padding: 20rpx;
615 624 }
616 625  
617 626 .count {
618   - position: fixed;
  627 + /* position: fixed; */
619 628 display: flex;
620 629 height: 50rpx;
621   - border: 1rpx solid #000;
  630 + /* border: 1rpx solid #000; */
622 631 font-size: 28rpx;
623 632 right: 30rpx;
624 633 }
... ... @@ -636,11 +645,29 @@ border-radius: 0 56rpx 55rpx 0;
636 645 }
637 646 .spec_bt.act{background: #d60021;color: #fff;border: 1rpx solid #d60021;}
638 647 .sub {
639   - border-right: 1px solid #000;
  648 + /* border-right: 1px solid #000; */
  649 +}
  650 +.sub.active {
  651 + /* background-color: #ddd; */
  652 + color: #ccc;
  653 +}
  654 +
  655 +.sub, .add, .count>input {
  656 + /* border-right: 1px solid #000; */
  657 + background-color: #f8f8f8;
  658 + border-radius: 8rpx;
  659 +}
  660 +.sub.active {
  661 + /* background-color: #ddd; */
  662 + color: #ccc;
  663 +}
  664 +.count>input {
  665 + margin: 0 10rpx;
  666 + line-height: normal;
640 667 }
641 668  
642 669 .add {
643   - border-left: 1px solid #000;
  670 + /* border-left: 1px solid #000; */
644 671 }
645 672  
646 673 .spec-btn {
... ... @@ -662,14 +689,15 @@ border-radius: 0 56rpx 55rpx 0;
662 689 }
663 690  
664 691 .spec-cart-btns {
665   - width: 92%;
  692 + /* width: 92%; */
666 693 line-height: 70rpx;
667   - margin: 20rpx auto;
668   - /* margin-top: 160rpx; */
669   - border-radius: 20rpx;
670   -/* position: fixed;
671   -bottom: 50rpx;
672   -left: 4%; */
  694 + /* margin: 0rpx auto;
  695 + margin-top: 160rpx; */
  696 + /* border-radius: 20rpx; */
  697 +/* position: fixed; */
  698 +/* bottom: 50rpx; */
  699 +/* left: 4%; */
  700 + padding: 20rpx;
673 701 }
674 702  
675 703 .spec-cart-btn {
... ... @@ -763,8 +791,8 @@ left:31rpx;}
763 791 /*------拼单------*/
764 792 .pt_view{ text-align: center; width: 100%; height: 100rpx; line-height: 100rpx; font-size: 26rpx}
765 793 .pt_view .secondkill-img{width: 100%;height: 100%;}
766   -.pt_fir{ background: #fff;margin-bottom: 10rpx; }
767   -.pt_fir .pt_fir_title{display: flex; align-items: center; margin-left: 10rpx; margin-top: 20rpx; font-size: 28rpx; position: relative;}
  794 +.pt_fir{ background: #fff;/* margin-bottom: 10rpx; */}
  795 +.pt_fir .pt_fir_title{display: flex; align-items: center; /* margin-left: 10rpx; margin-top: 20rpx; */ font-size: 28rpx; position: relative;}
768 796 .pt_fir .pt_fir_title .kt_type{ color: #fff;background:#e9030d; width: 100rpx; line-height: 40rpx; border-radius: 6rpx; margin: 0 10rpx;
769 797 height: 40rpx; font-size: 24rpx; text-align: center;}
770 798 .pt_fir .pt_fir_title .price{color: #e9030d;font-size: 26rpx;}
... ... @@ -786,7 +814,7 @@ left:31rpx;}
786 814 .t_gz{padding: 10rpx 20rpx; font-size:28rpx }
787 815  
788 816 .pt_fir.se1{height: auto; margin: 0}
789   -.pt_fir.se2{height: auto; margin: 0;border-top:6rpx solid #eeeeee;border-bottom:2rpx solid #eeeeee;}
  817 +.pt_fir.se2{height: auto; margin: 0;/* border-top:6rpx solid #eeeeee;border-bottom:2rpx solid #eeeeee; */}
790 818  
791 819 .pt_hb{height:78rpx; line-height: 75rpx; position: relative; font-size: 32rpx;overflow: hidden;width:695rpx;margin-left:28rpx;
792 820 border-bottom: 1rpx solid #E5E5E5 }
... ... @@ -808,14 +836,14 @@ left:31rpx;}
808 836 .pt_fir .pt_fir_title.no-mar-b{margin-bottom: 0;padding-bottom: 10rpx; margin-left: 20rpx}
809 837 .pt_fir .pt_fir_title.boder-1{border-bottom: 1rpx #e7e7e7 solid}
810 838  
811   -.jie_price{padding: 10rpx 30rpx;}
  839 +.jie_price{/* padding: 10rpx 30rpx; */}
812 840 .jie_price_title{font-size: 30rpx; color: #a26270; margin-bottom: 10rpx}
813 841 .price_list{display: flex; width: 100%;}
814 842 .price_item{width: 25%;font-size: 28rpx; color: #4c336c}
815 843  
816   -.pt_fir.se2 .zzk-1{margin-top: 23rpx; font-size: 30rpx;position: relative; margin-bottom: 30rpx; border-left:4rpx solid red;margin-left:14rpx;height:30rpx;line-height:30rpx;padding-left:5rpx;}
817   -.ckgd{position: absolute;top:0;right:57rpx; color:#d70025; font-size: 32rpx;}
818   -.ckgd .arrow-one{width:18rpx;height:18rpx;border-color:#da0b31;margin-top:5rpx;}
  844 +.pt_fir.se2 .zzk-1{/* margin-top: 23rpx; */ font-size: 30rpx;position: relative; /* margin-bottom: 30rpx; */ border-left:4rpx solid red;/* margin-left:14rpx; */height:30rpx;line-height:30rpx;/* padding-left:5rpx; */}
  845 +.ckgd{/* position: absolute;top:0;right:57rpx; */ color:#d70025; font-size: 26rpx;}
  846 +.ckgd .arrow-one{width:14rpx;height:14rpx;border-color:#da0b31;/* margin-top:5rpx; */ margin:auto;}
819 847 .bview{
820 848 position: fixed; top:0; left:0; width: 100%; height: 100%;
821 849 background-color: rgba(0, 0, 0, 0.5);
... ... @@ -842,65 +870,71 @@ left:31rpx;}
842 870  
843 871 /*---多少人参加团--*/
844 872 .group {
845   - padding-top:25rpx;
846   - width: 91%;
847   - min-height: 92rpx;
848   - border-bottom:2rpx solid #eee;
849   - padding-bottom:25rpx;
  873 + padding-top:20rpx;
  874 + padding-bottom:20rpx;
  875 + width: 100%;
  876 + /* min-height: 92rpx; */
  877 + border-bottom: 2rpx solid #ebedf0;
850 878  
851 879 }
852 880  
853 881 .group .group-list {
854   -
855   - height: 90rpx;
856   - padding: 0 130rpx 0 100rpx;
857   - width: 470rpx;
  882 + display: flex;
  883 + align-items: center;
  884 + justify-content: space-around;
  885 + /* height: 90rpx; */
  886 + /* padding: 0 130rpx 0 100rpx; */
  887 + /* width: 470rpx;
858 888  
859   - position: absolute;
  889 + position: absolute; */
860 890 }
861 891  
862 892 .group .group-list .gtou {
863   - width: 80rpx;
864   - height: 80rpx;
865   - float: left;
  893 + width: 70rpx;
  894 + height: 70rpx;
  895 + /* float: left;
866 896 position: relative;
867 897 top: 6rpx;
868   - left: -96rpx;
  898 + left: -96rpx; */
869 899 }
870 900  
871 901 .group .group-list .gtou image {
872   - width: 80rpx;
873   - height: 80rpx;
874   - border-radius: 200rpx;
875   - background-color: green;
  902 + display: block;
  903 + width: 100%;
  904 + height: 100%;
  905 + border-radius: 50%;
  906 + background-color: #f0f0f0;
876 907 }
877 908  
878 909 .group .group-list .gdn {
879   - float: left;
  910 + width: 140rpx;
  911 + text-align: center;
  912 + /* float: left; */
880 913 font-size: 26rpx;
881   - line-height: 48rpx;
  914 + /* padding-left: 20rpx; */
  915 + /* line-height: 48rpx;
882 916 height: 48rpx;
883 917 width: 168rpx;
884 918 position: relative;
885 919 left: -80rpx;
886   - top:20rpx;
887   - font-weight:600;
  920 + top:20rpx; */
  921 + font-weight:bold;
888 922 }
889 923  
890 924 .group .group-list .ghaicha {
891   - width:300rpx;
  925 + /* width:300rpx; */
892 926 font-size: 27rpx;
893   - margin-left:180rpx;
  927 + /* margin-left:180rpx;
894 928 top:13rpx;
895   - left:-3rpx;
896   - font-weight:600;
  929 + left:-3rpx; */
  930 + font-weight: bold;
897 931  
898 932  
899 933 }
900 934  
901 935 .group .group-list .ghaicha .gred {
902   - height: 48rpx;
903   - width: 300rpx;
  936 + /* height: 48rpx;
  937 + width: 300rpx; */
904 938 }
905 939  
906 940 .gsj {
... ... @@ -911,9 +945,9 @@ left:31rpx;}
911 945 .group .group-list .cjt {
912 946 height:42rpx;
913 947 width: 137rpx;
914   - position: absolute;
  948 + /* position: absolute;
915 949 right: 4rpx;
916   - top:25rpx;
  950 + top:25rpx; */
917 951 line-height: 42rpx;
918 952 font-size: 24rpx;
919 953 color: #fff;
... ... @@ -926,7 +960,7 @@ left:31rpx;}
926 960 .gbody {
927 961 background-color: white;
928 962 }
929   -.t_show{overflow: hidden; display: flex; width: 300rpx; color: #292929; line-height: 36rpx;font-size:26rpx;
  963 +.t_show{/* overflow: hidden; */ display: flex; /* width: 300rpx; */ color: #292929; /* line-height: 36rpx; */font-size:26rpx;
930 964 }
931 965 .join-cart>view.set_width {
932 966 width:58%;
... ... @@ -955,8 +989,8 @@ left:31rpx;}
955 989 white-space:nowrap;
956 990 }
957 991  
958   -.tuwen_title{ height: 86rpx; background-color:#eeeeee; margin-bottom: 32rpx; position: relative;
959   - display: flex; justify-content: center;align-items: center; }
  992 +.tuwen_title{ /* height: 86rpx; */ background-color:#eeeeee; /* margin-bottom: 32rpx; */ position: relative;
  993 + display: flex; justify-content: center;align-items: center; padding: 20rpx;}
960 994  
961 995 .tuwen_title .g_line{
962 996 width:496rpx;
... ... @@ -968,27 +1002,28 @@ left:31rpx;}
968 1002 overflow: hidden; justify-content: center;align-items: center;
969 1003 }
970 1004 .tuwen_title .center_s image{ width: 34rpx; height: 26rpx; margin-right: 10rpx}
971   -.t_g_info{ margin: 0 34rpx;margin-bottom: 20rpx; display: flex; align-items: center }
  1005 +.t_g_info{ /* margin: 0 34rpx;margin-bottom: 20rpx; */ display: flex; align-items: center;padding: 20rpx; }
972 1006 .red_shu{ width: 10rpx; height: 36rpx; background-color:#da0035; margin-right: 8rpx; }
973 1007  
974   -.tb-l{ line-height: 96rpx;}
975   -.table_s{ border:#e4e4e4 1rpx solid; width: 682rpx; margin: 0 34rpx;font-size: 30rpx;}
976   -.tb_item{display: flex; height: 96rpx; border-bottom: 1rpx solid #e4e4e4 }
977   -.item_left{width: 214rpx; height: 100%; background: #f9f9f9 ;border-right:1rpx solid #e4e4e4} .item_left text{ margin-left: 44rpx;}
978   -.item_right{width: 468rpx; height: 100%; overflow : hidden;white-space:nowrap;
979   - text-overflow: ellipsis;}
980   -.item_right text{ margin-left: 66rpx;}
  1008 +.tb-l{ /* line-height: 96rpx; */}
  1009 +.table_s{ border:#e4e4e4 1rpx solid; box-sizing: border-box;font-size: 26rpx;}
  1010 +.tb_item{display: flex; /* height: 96rpx; */ border-bottom: 1rpx solid #e4e4e4 }
  1011 +.item_left{width: 210rpx; height: 100%; box-sizing:border-box; text-align: center;padding: 20rpx; background: #f9f9f9 ;border-right:2rpx solid #e4e4e4} .item_left text{ /* margin-left: 44rpx; */}
  1012 +.item_right{flex:1; height: 100%; overflow : hidden;white-space:nowrap;text-overflow: ellipsis; padding: 20rpx;}
  1013 +.item_right text{ /* margin-left: 66rpx; */}
981 1014  
982   -.bzfu_img{ width: 164rpx; height:34rpx; margin-right: 18rpx; margin-left: 12rpx }
983   - .bz_view{ height:100rpx; padding: 0 34rpx 0 13rpx; color: #333; font-size: 28rpx;
  1015 +.table_s .tb-l:last-child {border-bottom: none;}
  1016 +
  1017 +.bzfu_img{ width: 164rpx; height:34rpx; /* margin-right: 18rpx; margin-left: 12rpx */ }
  1018 + .bz_view{ /* height:100rpx; padding: 0 34rpx 0 13rpx; */ color: #333; font-size: 28rpx; padding: 20rpx 20rpx 20rpx 10rpx;
984 1019 /* border-bottom: 3rpx solid #eee; */
985 1020 /* border-top: 3rpx solid #eee; */}
986   - .bz_view view{ width: 460rpx; max-height: 70rpx; overflow: hidden;}
  1021 + .bz_view view{ width: 460rpx; /* max-height: 70rpx; */ /* overflow: hidden; */}
987 1022  
988   -.bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 0 34rpx; color: #333;
989   - font-size: 30rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx }
990   -.red_bb{ color: #d70026; min-width:158rpx;width: auto;}
991   -.bg_jj{ width: 18rpx; height:18rpx;
  1023 +.bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 20rpx; color: #333;
  1024 + font-size: 30rpx; /* height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx */ }
  1025 +.red_bb{ color: #d70026; /* min-width:158rpx;width: auto; */}
  1026 +.bg_jj{ width: 14rpx; height:14rpx;
992 1027 border-top: 2rpx solid #d70026;
993 1028 border-right: 2rpx solid #d70026;
994 1029 transform: rotate(45deg);display:inline-block;
... ... @@ -999,6 +1034,7 @@ left:31rpx;}
999 1034 .bz-content {
1000 1035 flex-grow: 1;
1001 1036 text-align: justify;
  1037 + padding: 0 30rpx 0 20rpx;
1002 1038 }
1003 1039  
1004 1040 /* 顶部边框 */
... ... @@ -1199,20 +1235,23 @@ left:31rpx;}
1199 1235  
1200 1236 .xc_comment{
1201 1237 display: flex;
  1238 + justify-content: space-around;
1202 1239 width: 100%;
1203   - height: 42rpx;
1204   - padding-left: 34rpx;
  1240 + box-sizing: border-box;
  1241 + padding: 10rpx 20rpx;
  1242 + /* height: 42rpx;
  1243 + padding-left: 34rpx; */
1205 1244 color: #333;
1206 1245  
1207 1246 }
1208 1247 .xc_comment-have-pictures{
1209 1248 width: 153rpx;
1210   - height: 42rpx;
  1249 + /* height: 42rpx; */
1211 1250 line-height: 42rpx;
1212 1251 text-align: center;
1213 1252 background: #ffe3e2;
1214 1253 color: 28rpx;
1215   - border-radius:20rpx;
  1254 + border-radius:21rpx;
1216 1255 font-size: 24rpx;
1217 1256 }
1218 1257 .xc_comment-discuss{
... ... @@ -1229,22 +1268,25 @@ left:31rpx;}
1229 1268  
1230 1269 .xc_comment-detail{
1231 1270 display: flex;
1232   - margin-top: 40rpx;
1233   - width: 524rpx;
1234   - margin-left: 34rpx;
1235   - border-radius: 25rpx;
1236   - border: 2rpx solid #d6d4d5;
1237   - overflow: hidden;
  1271 + /* margin-top: 40rpx; */
  1272 + /* width: 524rpx; */
  1273 + /* margin-left: 34rpx; */
  1274 + border-radius: 24rpx;
  1275 + border: 2rpx solid #ebedf0;
  1276 + margin-left: 20rpx;
  1277 + box-sizing: border-box;
  1278 + /* overflow: hidden; */
1238 1279 }
1239 1280  
1240 1281 .xc_user-img{
1241   - border-radius:50%;
  1282 + border-radius:50%;
  1283 + margin: auto 0;
1242 1284 }
1243 1285  
1244 1286 .xc_comment-user{
1245 1287 display: flex;
1246   - margin-top: 22rpx;
1247   - margin-left: 22rpx;
  1288 + /* margin-top: 22rpx;
  1289 + margin-left: 22rpx; */
1248 1290 }
1249 1291 .xc_user{
1250 1292 width: 170rpx;
... ... @@ -1252,34 +1294,34 @@ left:31rpx;}
1252 1294 margin-left: 6rpx;
1253 1295 overflow: hidden;
1254 1296 }
1255   -.xc_user-name{ height: 25rpx;}
  1297 +.xc_user-name{ /* height: 25rpx; */}
1256 1298 .xc_comment-img{
1257 1299 width: 22rpx;
1258 1300 height: 22rpx;
1259   - margin-top: 14rpx;
  1301 + /* margin-top: 14rpx; */
1260 1302 margin-right: 5rpx
1261 1303 }
1262 1304 .xc_comment-font{
1263   - height: 75rpx;
1264   - margin-left: 22rpx;
  1305 + /* height: 75rpx; */
  1306 + /* margin-left: 22rpx; */
1265 1307 white-space:normal;
1266 1308 overflow: hidden;
1267   - margin-top: 8rpx;
1268   - line-height: 38rpx;
  1309 + /* margin-top: 8rpx;
  1310 + line-height: 38rpx; */
1269 1311  
1270 1312 }
1271 1313 .xc_comment-val{
1272   - width: 88%;
  1314 + /* width: 88%;
1273 1315 height: 30rpx;
1274 1316 margin-left: 22rpx;
1275 1317 display: flex;
1276 1318 margin-top: 15rpx;
1277   - margin-bottom:15rpx;
  1319 + margin-bottom:15rpx; */
1278 1320 }
1279 1321  
1280 1322 .xc_comment-time{
1281   - height: 30rpx;
1282   - font-size: 24rpx;
  1323 + /* height: 30rpx; */
  1324 + font-size: 22rpx;
1283 1325 color: #a5a5a5;
1284 1326 overflow: hidden;
1285 1327 }
... ... @@ -1290,14 +1332,17 @@ left:31rpx;}
1290 1332 .xc_comment-left{
1291 1333 display:inline-block;
1292 1334 width: 312rpx;
  1335 + padding: 20rpx;
1293 1336 }
1294 1337 .xc_goods-img-frame{
1295   - display:inline-block;
1296   - width: 40%;
  1338 + border-radius: 0 22rpx 22rpx 0;
  1339 + overflow: hidden;
  1340 + /* display:inline-block; */
  1341 + /* width: 40%;
1297 1342 height: 90%;
1298 1343 text-align: center;
1299 1344 padding-top: 30rpx;
1300   - vertical-align: top;
  1345 + vertical-align: top; */
1301 1346 }
1302 1347 .xc_imgs{
1303 1348 width: 50rpx;
... ... @@ -1308,11 +1353,13 @@ left:31rpx;}
1308 1353  
1309 1354 .pj_word_size{ font-size: 28rpx}
1310 1355 .pj_scroll{
1311   - white-space: nowrap;
  1356 + /* white-space: nowrap; */
1312 1357 /* height: 324rpx; */
1313   - margin-bottom: 50rpx;
  1358 + /* margin-bottom: 50rpx; */
1314 1359 display: flex;
1315 1360 align-items: center;
  1361 + padding: 20rpx 0;
  1362 + /* box-sizing: border-box; */
1316 1363 /* box-shadow: 0 8px 12px #e7e9eb; */
1317 1364 }
1318 1365  
... ... @@ -1326,57 +1373,61 @@ left:31rpx;}
1326 1373 }
1327 1374 .cx-frame{
1328 1375 /* border-top:3rpx solid #eee; */
1329   - width:99%;
  1376 + /* width:99%;
1330 1377 height: 95rpx;
1331 1378 line-height: 95rpx;
1332   - padding-left:24rpx;
1333   -
1334   -
  1379 + padding-left:24rpx; */
  1380 + padding: 20rpx;
1335 1381 }
1336 1382 .cx-frame .cx-sizs{
1337   - width: 68rpx;
1338   - height: 100%;
1339   - line-height: 100rpx;
1340   - overflow: hidden;
1341   - margin-left: 10rpx;
  1383 + /* width: 68rpx; */
  1384 + /* height: 100%; */
  1385 + /* line-height: 100rpx; */
  1386 + /* overflow: hidden; */
  1387 + /* margin-left: 10rpx; */
1342 1388 }
1343 1389 .xc-coupon-fram{
1344 1390 position: relative;
1345   - width:200rpx;
1346   - padding-top:30rpx;
  1391 + margin-right: 16rpx;
  1392 + /* width:200rpx; */
  1393 + /* padding-top:30rpx; */
1347 1394  
1348 1395 }
1349 1396 .xc-coupon-fram .xc-coupon{
1350   - width:175rpx ;
  1397 + /* width:175rpx ;
1351 1398 height: 40rpx;
1352   - line-height: 40rpx;
  1399 + line-height: 40rpx; */
1353 1400 background-color:#d60021 ;
1354   - margin:0 auto;
  1401 + /* margin:0 auto; */
1355 1402 color:#fff;
1356   -
  1403 + padding: 6rpx 20rpx;
1357 1404  
1358 1405 }
1359 1406 .xc-coupon-fram .xc-circular{
1360   - width: 22rpx;
1361   - height:22rpx;
1362   - background-color:#fff;
  1407 + width: 16rpx;
  1408 + height:16rpx;
  1409 + background-color: white;
1363 1410 position:absolute;
1364   - top: 40rpx;
  1411 + top: 50%;
  1412 + /* left: -10rpx; */
  1413 + transform: translateY(-50%);
1365 1414 }
1366 1415 .xc-coupon-fram .xc-one{
1367   - left:3rpx;
  1416 + left: -8rpx;
1368 1417 }
1369 1418 .xc-coupon-fram .xc-two{
1370   - left: 178rpx;
  1419 + right: -8rpx;
1371 1420 }
1372 1421  
1373 1422 .cx-obtain-coupon{
1374   - width: 65rpx;
  1423 + /* width: 65rpx;
1375 1424 height: 100%;
1376   - padding-left:15rpx;
  1425 + padding-left:15rpx; */
1377 1426 color: #d70025;
1378   - position: absolute;
1379   - right: 5rpx;
  1427 + display: flex;
  1428 + align-items: center;
  1429 + /* position: absolute;
  1430 + right: 5rpx; */
1380 1431 }
1381 1432  
1382 1433 /* 自定义弹出窗口 */
... ... @@ -1391,18 +1442,20 @@ left:31rpx;}
1391 1442 }
1392 1443  
1393 1444 .cx-popup .top{
1394   - width: 90%;
1395   - height:85rpx;
1396   - border-bottom: 4rpx solid #d5d5d5;
1397   - padding-top: 50rpx;
1398   - font-weight:600;
  1445 + /* width: 90%;
  1446 + height:85rpx; */
  1447 + font-size: 32rpx;
  1448 + padding: 20rpx 0;
  1449 + border-bottom: 2rpx solid #ebedf0;
  1450 + /* padding-top: 50rpx;
  1451 + font-weight:600; */
1399 1452  
1400 1453 }
1401 1454 .cx-popup .top-frame{
1402   - width: 100%;
  1455 + /* width: 100%;
1403 1456 display: flex;
1404 1457 justify-content: center;
1405   - overflow: hidden;
  1458 + overflow: hidden; */
1406 1459 }
1407 1460 .xc-valid-coupon{
1408 1461 width: 90%;
... ... @@ -1413,41 +1466,52 @@ left:31rpx;}
1413 1466 .xc-frame{
1414 1467 position: relative;
1415 1468 }
1416   -.xc-coupon-frame{
1417   - width: 90%;
  1469 +.xc-coupon-frame {
  1470 + width: 100%;
1418 1471 max-height: 560rpx;
1419 1472 overflow: auto;
1420 1473  
1421 1474 }
1422   -.xc-coupon-frame .coupon{
1423   - width:99%;
  1475 +.xc-coupon-frame .rel:not(:first-child) {
  1476 + margin-top: 20rpx;
  1477 +}
  1478 +.xc-coupon-frame .coupon {
  1479 + width:100%;
1424 1480 height: 168rpx;
1425 1481 border-radius: 25rpx;
1426   - border:3rpx solid #ffdcdc;
  1482 + border:2rpx solid #ffdcdc;
1427 1483 overflow: hidden;
1428   - margin-top:16rpx;
  1484 + /* margin-top:16rpx; */
  1485 + box-sizing: border-box;
1429 1486  
1430 1487 }
  1488 +/* .xc-coupon-frame .coupon ~ .coupon {
  1489 + margin-top:16rpx;
  1490 +} */
1431 1491 .xc-coupon-left{
1432 1492 width: 216rpx;
1433   - height: 100%;
  1493 + /* height: 100%; */
1434 1494 background-color: #ffeeef;
1435 1495 border-right: 4rpx dashed #ffdbd9;
1436 1496 overflow: hidden;
1437   - line-height: 100%;
1438   -
  1497 + /* line-height: 100%; */
  1498 + display: flex;
  1499 + flex-direction: column;
  1500 + justify-content: center;
  1501 + align-items: center;
  1502 + flex-shrink: 0;
1439 1503 }
1440 1504 .xc-money{
1441 1505 color: #f30026;
1442 1506 text-align:center;
1443 1507 }
1444 1508 .xc-rmb{
1445   - width:44rpx;
1446   - padding-top:7rpx;
  1509 + /* width:44rpx;
  1510 + padding-top:7rpx; */
1447 1511 }
1448 1512 .xc-money-frame{
1449   - margin-left:35rpx;
1450   - margin-top:48rpx;
  1513 + /* margin-left:35rpx;
  1514 + margin-top:48rpx; */
1451 1515  
1452 1516 }
1453 1517 .xc-spacing{
... ... @@ -1455,45 +1519,52 @@ left:31rpx;}
1455 1519 }
1456 1520 .xc-circular-one{
1457 1521 position: absolute;
1458   - top:-8rpx;
1459   - left:208rpx;
1460   - width: 27rpx;
  1522 + top:-15rpx;
  1523 + left:205rpx;
  1524 + width: 30rpx;
1461 1525 height: 30rpx;
1462 1526 background: #fff;
1463 1527 overflow: hidden;
1464 1528 }
1465 1529 .xc-circular-two{
1466 1530 position: absolute;
1467   - top:150rpx;
1468   - left:207rpx;
1469   - width: 27rpx;
  1531 + bottom: -15rpx;
  1532 + /* top:150rpx; */
  1533 + left:205rpx;
  1534 + width: 30rpx;
1470 1535 height:30rpx;
1471 1536 background: #fff;
1472 1537 }
1473 1538 .xc-detail-coupon{
1474   - margin-left: 22rpx;
  1539 + /* margin-left: 22rpx;
1475 1540 overflow: hidden;
1476   - padding-top: 43rpx;
1477   -
  1541 + padding-top: 43rpx; */
  1542 + /* display: flex;
  1543 + align-items: center; */
1478 1544 }
1479 1545 .xc-coupon-right{
1480   - width: 455rpx;
1481   - height: 100%;
  1546 + /* width: 455rpx;
  1547 + height: 100%; */
1482 1548 background: #fffaf9;
  1549 + padding: 20rpx;
  1550 + box-sizing: border-box;
  1551 + width: 100%;
  1552 + justify-content: space-between;
  1553 + align-items: center;
1483 1554 }
1484 1555 .xc-below{
1485   - margin-top:22rpx;
  1556 + margin-top:20rpx;
1486 1557  
1487 1558 }
1488 1559 .xc-get{
1489 1560  
1490   - width: 132rpx;
1491   - height: 48rpx;
  1561 + width: 140rpx;
  1562 + /* height: 48rpx; */
1492 1563 color: #fff;
1493 1564 text-align: center;
1494   - border-radius:20rpx;
1495   - line-height:48rpx;
1496   - margin-left:20rpx;
  1565 + border-radius:27rpx;
  1566 + line-height:54rpx;
  1567 + /* margin-left:20rpx; */
1497 1568 }
1498 1569  
1499 1570 .background{
... ... @@ -1511,16 +1582,19 @@ left:31rpx;}
1511 1582  
1512 1583 .cx-confirm{
1513 1584 width: 100%;
1514   - height: 160rpx;
  1585 + padding: 20rpx;
  1586 + box-sizing: border-box;
  1587 + /* height: 160rpx; */
1515 1588  
1516 1589 }
1517 1590 .cx-confirm .confirm{
1518   - width: 372rpx;
1519   - height: 60rpx;
1520   - background: #f40026;
  1591 + /* width: 372rpx;
  1592 + height: 60rpx; */
  1593 + background-color: #f40026;
1521 1594 color: #fff;
1522   - border-radius:20rpx;
1523   - line-height:60rpx;
  1595 + border-radius:10rpx;
  1596 + line-height: 80rpx;
  1597 + font-size: 28rpx;
1524 1598  
1525 1599 }
1526 1600  
... ... @@ -1531,17 +1605,21 @@ left:31rpx;}
1531 1605  
1532 1606  
1533 1607 /* 分享 */
  1608 +.icon-share {
  1609 + font-size: 46rpx;
  1610 + color: #d60021;
  1611 +}
1534 1612 .xc-share-frame{
1535   - width: 129rpx;
  1613 + /* width: 129rpx;
1536 1614 height: 48rpx;
1537 1615 border-top-left-radius: 18rpx;
1538   - border-bottom-left-radius: 18rpx;
1539   - background: #d60021;
1540   - position:absolute;
  1616 + border-bottom-left-radius: 18rpx; */
  1617 + /* background: #d60021; */
  1618 + /* position:absolute;
1541 1619 left:622rpx;
1542 1620 top:-37rpx;
1543 1621 line-height:50rpx;
1544   - margin-top:52rpx;
  1622 + margin-top:52rpx; */
1545 1623 }
1546 1624 .xc-share-frame-jieti{
1547 1625 width: 129rpx;
... ... @@ -1559,6 +1637,7 @@ left:31rpx;}
1559 1637  
1560 1638 }
1561 1639  
  1640 +
1562 1641 .xc-share-frame .share-frame,.xc-share-frame-jieti .share-frame{
1563 1642 width: 30rpx;
1564 1643 height: 30rpx;
... ... @@ -1779,10 +1858,10 @@ xc-ensure-div{
1779 1858 padding-top: 24rpx;
1780 1859 overflow: hidden;
1781 1860 }
1782   -.xc-frame{
1783   - width: 100%;
1784   - margin-top:20rpx;
1785   -
  1861 +.xc-frame {
  1862 + /* width: 100%;
  1863 + margin-top:20rpx; */
  1864 + padding: 20rpx;
1786 1865 }
1787 1866  
1788 1867 .xc-frame .list-frame{
... ... @@ -1817,7 +1896,7 @@ xc-ensure-div{
1817 1896 }
1818 1897  
1819 1898 .xc-money-frame{
1820   - margin-left:35rpx;
  1899 + /* margin-left:35rpx; */
1821 1900  
1822 1901 }
1823 1902 .xc-coupon-effect{
... ... @@ -1952,11 +2031,11 @@ xc-ensure-div{
1952 2031 }
1953 2032  
1954 2033 .xc-video{
1955   - width:100rpx;
1956   - height: 50rpx;
1957   - line-height: 50rpx;
  2034 + /* width:100rpx; */
  2035 + /* height: 50rpx;
  2036 + line-height: 50rpx; */
1958 2037 text-align: center;
1959   - margin-left:-30rpx;
  2038 + /* margin-left:-30rpx; */
1960 2039  
1961 2040  
1962 2041 }
... ... @@ -2030,7 +2109,7 @@ xc-ensure-div{
2030 2109  
2031 2110  
2032 2111 .wsize{font-size: 32rpx}
2033   -.five-level-word{font-size: 28rpx;}
  2112 +.five-level-word{font-size: 24rpx;}
2034 2113  
2035 2114  
2036 2115 /*-- 推荐商品 --*/
... ... @@ -2103,13 +2182,13 @@ padding-left:24rpx;
2103 2182  
2104 2183 .xc-linellae-frame{
2105 2184 width: 100%;
2106   - height: 60rpx;
  2185 + height: 80rpx;
2107 2186 background: #f2f2f2;
2108 2187 }
2109 2188 .xc-linellae-frame .xc-linellae{
2110 2189 width: 386rpx;
2111 2190 height: 1rpx;
2112   - border-bottom: 1rpx solid #a5a5a5;
  2191 + border-bottom: 1rpx solid #ebedf0;
2113 2192 }
2114 2193 .xc-recommend-frame{
2115 2194 background:#f2f2f2;
... ... @@ -2132,7 +2211,8 @@ margin-top: 1rpx;
2132 2211 }
2133 2212 .xc-price-frame{
2134 2213 color: #ec0022;
2135   -height:44rpx;
  2214 + align-items: baseline;
  2215 +/* height:44rpx; */
2136 2216 }
2137 2217 .xc-price-frame .sign{
2138 2218 margin-top:19rpx;
... ... @@ -2163,6 +2243,9 @@ padding-left:-4rpx;
2163 2243 .xc-explain{
2164 2244 color:#292929;
2165 2245 width:542rpx;
  2246 + margin: 10rpx 0 20rpx;
  2247 + width: 100%;
  2248 + font-weight: bold;
2166 2249 }
2167 2250 .xc-item{width: 16%; font-size: 26rpx; color: #666;margin-right:5rpx;}
2168 2251 .xc-item .yuan{
... ... @@ -2268,15 +2351,16 @@ margin-top:5rpx;
2268 2351 }
2269 2352 .xc-goods-explain{
2270 2353 width:100%;
2271   - padding-left:30rpx;
  2354 + /* padding-left:30rpx;
2272 2355 margin-left:-9rpx;
2273   - height: 150rpx
  2356 + height: 150rpx */
2274 2357 }
2275 2358 .xc-partner-frame{
2276 2359 border-bottom:2rpx solid #eee;
2277 2360 width:100%;
2278   -padding:0 20rpx;
2279   -height:56rpx;
  2361 +padding:20rpx;
  2362 +/* height:56rpx; */
  2363 +box-sizing: border-box;
2280 2364 }
2281 2365 .xc-person-number{
2282 2366 width:120rpx;
... ... @@ -2298,41 +2382,43 @@ right:17rpx; top:55rpx;
2298 2382 /* border-top:1rpx solid #eee; */
2299 2383 width: 100%;
2300 2384 height: auto;
  2385 + padding: 20rpx;
  2386 + box-sizing: border-box;
2301 2387 }
2302 2388 .on_height{
2303 2389 height: 90rpx;
2304 2390 }
2305 2391 .sn_height{
2306   - min-height: 170rpx; height: auto;padding: 10rpx 0;
  2392 + /* min-height: 170rpx; height: auto;padding: 10rpx 0; */
2307 2393 }
2308 2394 .xc-address_frame .address_frame{
2309   - width: 92%;
2310   -padding-left: 10rpx;
2311   -margin: auto;
  2395 + width: 100%;
  2396 +/* padding-left: 10rpx;
  2397 +margin: auto; */
2312 2398  
2313 2399 }
2314 2400 .shop_name{
2315 2401  
2316 2402 }
2317 2403 .stores-img{
2318   -width: 40rpx;
2319   - height: 35rpx;
  2404 + width: 28rpx;
  2405 + height: 28rpx;
2320 2406 margin-right: 10rpx;
2321 2407 }
2322 2408 .shop_name{
2323 2409 margin-right: 10rpx;
2324 2410 }
2325 2411 .address{
2326   - width: 87%;
  2412 + /* width: 100%;
2327 2413 margin-top: 5rpx;
2328   - margin-bottom: 5rpx;
  2414 + margin-bottom: 5rpx; */
2329 2415 }
2330 2416 .distance{
2331   - padding-left: 15rpx;
2332   - padding-right: 15rpx;
  2417 + padding-left: 20rpx;
  2418 + padding-right: 20rpx;
2333 2419 background: #eee;
2334 2420 border-radius: 20rpx;
2335   - margin-right: 5rpx;
  2421 + /* margin-right: 5rpx; */
2336 2422 color: #999;
2337 2423 height: 38rpx;
2338 2424 line-height: 38rpx;
... ... @@ -2518,8 +2604,8 @@ margin-top: 10rpx;
2518 2604 }
2519 2605 .xc-goods-attribute{
2520 2606 border-bottom: 1px solid #eee;
2521   -padding-bottom: 15px;
2522   -margin-bottom:40rpx;
  2607 +padding-bottom: 20rpx;
  2608 +/* margin-bottom:40rpx; */
2523 2609 }
2524 2610 .xc-val-fream{
2525 2611 width: 105rpx;
... ... @@ -2546,11 +2632,11 @@ border-radius: 55rpx;
2546 2632 .s_btn{ margin-top: 25rpx; }
2547 2633 /* 美妆价的样式 */
2548 2634 .beauty-makeup-frame{
2549   - width: 101.5%;
2550   - margin: auto;
  2635 + /* width: 101.5%;
  2636 + margin: auto; */
2551 2637 height: 120rpx;
2552 2638 border-radius: 15rpx;
2553   - margin-top: 18px;
  2639 + margin-top: 10px;
2554 2640  
2555 2641 }
2556 2642 .beauty-makeup-frame .left{
... ... @@ -2558,11 +2644,12 @@ border-radius: 55rpx;
2558 2644 height: 100%;
2559 2645 background:#f7f7f7;
2560 2646 border-radius: 20rpx 0rpx 0rpx 20rpx;
2561   - padding-left: 20rpx;
  2647 + /* padding: 0 10rpx; */
2562 2648 }
2563 2649 .card-frame{
2564   - margin-top: 0rpx; padding-right: 23rpx;
2565   - margin-right: 15rpx;
  2650 + margin-top: 0rpx;
  2651 + /* padding-right: 23rpx;
  2652 + margin-right: 15rpx; */
2566 2653 }
2567 2654 .advert-card{
2568 2655 margin-top: 0rpx!important;
... ... @@ -2576,13 +2663,13 @@ border-radius: 55rpx;
2576 2663 }
2577 2664 .grade-card-frame{
2578 2665  
2579   - height:45rpx ;
  2666 + /* height:45rpx ; */
2580 2667 background: #3c300a;
2581 2668 border-radius: 20rpx;
2582   - margin-top: 10px;
2583   - margin-left: 7rpx;
  2669 + /* margin-top: 10px;
  2670 + margin-left: 7rpx; */
2584 2671 justify-content: center;
2585   - padding: 0 15rpx;
  2672 + padding: 4rpx 12rpx;
2586 2673 }
2587 2674 .grade-card-frame .img{
2588 2675 width: 24rpx;
... ... @@ -2596,7 +2683,7 @@ border-radius: 55rpx;
2596 2683 max-width: 165rpx;
2597 2684 }
2598 2685 .card-effect{
2599   - margin-left: 15rpx;
  2686 + /* margin-left: 15rpx; */
2600 2687 }
2601 2688 .at_once_carde{
2602 2689 width:65rpx;
... ... @@ -2620,22 +2707,23 @@ button.custom-service::after{
2620 2707 border: 0;
2621 2708 }
2622 2709 .no_store{color:#d60021; font-size: 26rpx;}
2623   -.cx_show_view{ width: 580rpx; line-height: 30rpx; margin-bottom: 6rpx; }
  2710 +.cx_show_view{ width: 580rpx; /* line-height: 30rpx; margin-bottom: 6rpx; */ }
2624 2711 .cx_show_view .word{ width: 400rpx}
2625 2712 .prom_condition {
2626 2713 color: #d60021;
2627   - width: 180rpx;
2628   - height: 30rpx;
  2714 + /* width: 180rpx; */
  2715 + /* height: 30rpx; */
2629 2716 font-size: 20rpx;
2630   - padding-top: 0.01rpx;
2631   - display: flex;
  2717 + /* padding-top: 0.01rpx; */
  2718 + /* display: flex;
2632 2719 justify-content: center;
2633   - align-items: center;
2634   - border: #d60021 solid 1rpx;
  2720 + align-items: center; */
  2721 + border: 2rpx solid #d60021;
2635 2722 border-radius: 10rpx;
2636 2723 margin-right:10rpx ;
2637   - margin-left: 10rpx;
2638   -
  2724 + /* margin-left: 10rpx; */
  2725 + font-size: 24rpx;
  2726 + padding: 0 10rpx;
2639 2727 }
2640 2728 .hui_img{ width: 44rpx; height: 44rpx; margin-right: 8rpx}
2641 2729 .order_hui{color: #444; width: 420rpx}
... ... @@ -2733,4 +2821,25 @@ button.custom-service::after{
2733 2821 .quan_price{
2734 2822 background-color: #ff4700; color: #fff; padding: 10rpx 25rpx; margin-left: 10rpx; border-radius: 30rpx;
2735 2823 }
2736   -.stock{ width: 25%; height: 60rpx; border: 1rpx solid #eee; text-align: center; line-height: 60rpx;}
2737 2824 \ No newline at end of file
  2825 +
  2826 +/*--闪白屏--*/
  2827 +.g_img_box{
  2828 + background-position: center center;
  2829 + background-repeat: no-repeat;
  2830 + -webkit-background-size: cover;
  2831 + -moz-background-size: cover;
  2832 + background-size: cover;
  2833 +}
  2834 +
  2835 +
  2836 +
  2837 +.arrow {
  2838 + width: auto !important;
  2839 + position: absolute;
  2840 + right: 0;
  2841 + top: 10rpx;
  2842 +}
  2843 +
  2844 +.stock {
  2845 + flex: 1;
  2846 +}
2738 2847 \ No newline at end of file
... ...
packageA/pages/jfbuy/jfbuy.js
... ... @@ -416,7 +416,7 @@ Page({
416 416 viewItemDetails:function(e){
417 417 var index=e.currentTarget.dataset.index;
418 418 var item=this.data.list2[index];
419   - var url="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id;
  419 + var url="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&title="+item.goods_name;
420 420 getApp().goto(url);
421 421 },
422 422  
... ...
packageA/pages/jfbuy/jfbuy.wxml
... ... @@ -51,8 +51,8 @@
51 51 <text>{{item.integral}}积分 + ¥{{item.addmoney}}</text>
52 52 </view>
53 53 <view class="pdt14 fs22 gray flex jc_sb">
54   - <view>零售价:¥{{item.shop_price}}</view>
55   - <view>销量:{{item.sales_sum}}</view>
  54 + <view>零售价:¥{{item.market_price}}</view>
  55 + <view>销量:{{item.buy_num}}</view>
56 56 </view>
57 57 </view>
58 58 </view>
... ...
packageA/pages/myGift/myGift.wxml
... ... @@ -15,8 +15,20 @@
15 15 <!-- 价格 -->
16 16 <view class="flex jc_sb ai-center pdb10">
17 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>
  18 + <view class="c-red fs28">
  19 + <block wx:if="{{item.lbprice>0 && item.lbintegral}}">
  20 + <text class="rmb">{{filter.toFix(item.lbprice,2)}}</text>/{{item.lbintegral}}积分
  21 + </block>
  22 + <block wx:elif="{{item.lbprice>0 || item.lbintegral}}">
  23 + <block wx:if="{{item.lbprice>0}}" >
  24 + <text class="rmb">{{filter.toFix(item.lbprice,2) }}</text>
  25 + </block>
  26 + <block wx:if="{{item.lbintegral>0}}">
  27 + {{item.lbintegral}}积分
  28 + </block>
  29 + </block>
  30 + </view>
  31 + <view class="fs22 c-a4 line-through mgl10">零售价{{filter.toFix(item.oldprice,2)}}</view>
20 32 </view>
21 33 <view class="fs24 c-a4">已售{{item.salenum}}件</view>
22 34 </view>
... ... @@ -26,8 +38,8 @@
26 38 </view>
27 39 </view>
28 40 <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>
  41 + <view wx:if="{{item.lbintegral>0}}" bindtap="GetBuyIntegral" data-index="{{index}}" class="btn red">立即兑换</view>
  42 + <view wx:if="{{item.lbprice>0}}" bindtap="GetBuyPrice" data-index="{{index}}" class="btn pink">立即购买</view>
31 43 </view>
32 44 </view>
33 45 </block>
... ...
packageA/pages/myGift/myGift.wxss
... ... @@ -138,7 +138,7 @@ page {
138 138  
139 139 .btn-container {
140 140 display: flex;
141   - justify-content: space-around;
  141 + /*justify-content: space-around;*/
142 142 font-size: 26rpx;
143 143 }
144 144  
... ... @@ -146,6 +146,7 @@ page {
146 146 padding: 20rpx;
147 147 flex: 1;
148 148 text-align: center;
  149 + max-width: 50%;
149 150 }
150 151  
151 152 .btn.red {
... ...
packageA/pages/myGiftDetails/myGiftDetails.js
... ... @@ -57,7 +57,7 @@ Page({
57 57 // store_id: app.globalData.setting.stoid,
58 58 // user_id: app.globalData.user_id,
59 59 // };
60   -
  60 + //购买的时候是0,购买后是1
61 61 if(this.data.index == 0) {
62 62 // data.lbid = this.data.id;
63 63 // 请求数据
... ... @@ -68,60 +68,100 @@ Page({
68 68 },
69 69 isShowLoading: true,
70 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   - });
  71 +
  72 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  73 + var da= res.data.data.pageData[0]
  74 + self.setData({ details:da, });
  75 +
  76 + //礼包有俩种类型
  77 + if(da.lbtype==1){
  78 + app.request.promiseGet('/api/weshop/libao/libaoList/page', {
  79 + data: {
  80 + store_id: app.globalData.setting.stoid,
  81 + lbid: self.data.id,pageSize:500
  82 + },
  83 + isShowLoading: true,
  84 + }).then(function(res) {
  85 + self.setData({
  86 + list: res.data.data.pageData,
  87 + });
  88 + });
  89 + }else{
  90 + app.request.promiseGet('/api/weshop/libao/libaoList/listLQ', {
  91 + data: {
  92 + store_id: app.globalData.setting.stoid,
  93 + lbid: self.data.id,
  94 + },
  95 + isShowLoading: true,
  96 + }).then(function(res) {
  97 + if(res.data.code==0){
  98 + self.setData({
  99 + list: res.data.data,
  100 + });
  101 + }
  102 + });
  103 + }
  104 +
  105 + }
86 106 });
  107 +
87 108 } else if(this.data.index == 1) {
88 109 app.request.promiseGet('/api/weshop/libao/libaoFormvip/page', {
89 110 data: {
90 111 store_id: app.globalData.setting.stoid,
91 112 user_id: app.globalData.user_id,
92   - id: this.data.id,
  113 + id: this.data.id
93 114 },
94 115 isShowLoading: true,
95 116 }).then(function(res) {
96 117 // console.log('res3-->', res);
97 118 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  119 +
  120 + var da= res.data.data.pageData[0]
98 121 self.setData({
99   - details: res.data.data.pageData[0],
  122 + details:da,
100 123 });
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'];//剩余次数
  124 +
  125 + if(da.lbtype==1){
  126 + app.request.promiseGet('/api/weshop/libao/libaoListvip/page', {
  127 + data: {
  128 + store_id: app.globalData.setting.stoid,
  129 + lbvipid: self.data.id,pageSize:500
  130 + },
  131 + isShowLoading: true,
  132 + }).then(function(res) {
  133 + // console.log('res4-->', res);
  134 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0) {
  135 + var list_arr=res.data.data.pageData;
  136 + for(var i in list_arr){
  137 + list_arr[i].alsonum= list_arr[i]['goods_num'] - list_arr[i]['usenum'];//剩余次数
  138 + }
  139 + self.setData({
  140 + list: res.data.data.pageData,
  141 + });
  142 + }
  143 + });
  144 + }else{
  145 + app.request.promiseGet('/api/weshop/libao/libaoListvip/listLQ', {
  146 + data: {
  147 + store_id: app.globalData.setting.stoid,
  148 + lbvipid: self.data.id,
  149 + user_id:app.globalData.user_id
  150 + },
  151 + isShowLoading: true,
  152 + }).then(function(res) {
  153 + // console.log('res4-->', res);
  154 + if(res.data.code==0 && res.data.data) {
  155 + self.setData({
  156 + list: res.data.data,
  157 + });
  158 + }
  159 + });
116 160 }
117   - self.setData({
118   - list: res.data.data.pageData,
119   - });
  161 +
120 162 }
121 163 });
122 164 };
123   -
124   -
125 165 };
126 166 };
127 167 },
... ... @@ -260,14 +300,38 @@ Page({
260 300 icon: 'none',
261 301 duration: 2000
262 302 })
263   -
264   -
265   -
  303 +
266 304 }
267 305 }
268 306 })
269 307  
270   - }
  308 + },
  309 +
  310 + //一键领取券
  311 + show_get_quan:function (e) {
  312 + var th=this;
  313 + var json = {
  314 + store_id:os.stoid,
  315 + user_id:getApp().globalData.user_id,
  316 + id:this.data.id
  317 + };
  318 + var url = "/api/weshop/libao/libaoFormvip/saveLibaoQuan";
  319 + getApp().request.post(url,{
  320 + data:json,
  321 + success:function(res) {
  322 + if (res.data.code == 0) {
  323 + th.setData({'details.isget':1});
  324 + } else {
  325 + wx.showToast({
  326 + title: res.data.msg,
  327 + icon: 'none',
  328 + duration: 2000
  329 + })
  330 + }
  331 + },
  332 + })
  333 +
  334 + }
271 335  
272 336  
273 337 })
274 338 \ No newline at end of file
... ...
packageA/pages/myGiftDetails/myGiftDetails.wxml
... ... @@ -2,6 +2,8 @@
2 2 <view class="pdb80">
3 3 <!-- 图片 -->
4 4 <view><image src="{{imghost + (details.lburl ? details.lburl:'miniapp/images/default_g_img.gif')}}" class="img" mode="widthFix"/></view>
  5 +
  6 + <view wx:if="{{index==1}}" class="fs26 exp_title">兑换结束时间:{{filter.format_time(details.expdate,1)}}</view>
5 7 <!-- 描述-->
6 8 <view class="desc-container">
7 9 <!-- 标题 -->
... ... @@ -9,16 +11,32 @@
9 11 <!-- 价格 -->
10 12 <view class="flex jc_sb ai-center pdb10">
11 13 <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 class="c-red fs36">
  15 + <block wx:if="{{details.lbprice>0 && details.lbintegral>0 }}">
  16 + <text class="rmb">{{filter.toFix(details.lbprice,2)}}</text>/{{details.lbintegral}}积分
  17 + </block>
  18 + <block wx:elif="{{details.lbprice>0 || details.lbintegral>0 }}">
  19 + <block wx:if="{{details.lbprice>0}}" >
  20 + <text class="rmb">{{filter.toFix(details.lbprice,2)}}</text>
  21 + </block>
  22 + <block wx:if="{{details.lbintegral>0}}" >
  23 + {{details.lbintegral}}积分
  24 + </block>
  25 + </block>
  26 +
  27 + </view>
  28 + <view class="fs22 c-a4 line-through mgl10">零售价{{filter.toFix(details.oldprice,2)}}</view>
14 29 </view>
15 30 <view class="fs24 c-a4">已售{{details.salenum}}件</view>
16 31 </view>
17 32 <!-- 时间 -->
18 33 <view class="date">活动截止日期 {{details.expdate ? filter.format_time(details.expdate):filter.format_time(details.endtime)}}</view>
19 34 </view>
  35 +
  36 +
  37 + <!-- 领券和兑换商品 -->
20 38 <!-- 单品 -->
21   - <view class="goods-container">
  39 + <view class="goods-container" wx:if="{{details.lbtype==1}}">
22 40 <view class="pd20 bold bdb">可到线下门店兑换以下单品</view>
23 41 <view wx:if="{{index==1 && details.codetype==1}}" class="">
24 42 <view class="flex pd20 jc_sb">
... ... @@ -40,7 +58,6 @@
40 58 </view>
41 59 </view>
42 60  
43   -
44 61 <view wx:else class="">
45 62 <view class="flex pd20 jc_sb">
46 63 <view>单品名称</view>
... ... @@ -52,15 +69,48 @@
52 69 </view>
53 70 </view>
54 71 </view>
55   -
  72 +
  73 + <view wx:if="{{details.lbtype==2}}" class="flex" style="flex-wrap: wrap;">
  74 + <block wx:for="{{list}}">
  75 + <block wx:for="{{item.goods_num-0}}" wx:for-item="nitem" wx:for-index="idx">
  76 + <view class="lb_quan" style="background-image: url({{imghost}}/miniapp/images/yhq_{{index%2+1}}.png)">
  77 + <view class="flex fs28 fir_view">
  78 + <view>满1000.00使用</view>
  79 + <view class="fs38" style="text-align: right">¥1000</view>
  80 + </view>
  81 + <view style="font-size: 16rpx; text-align: center">活动结束日期: 2022-06-02 00:00:00 </view>
  82 + </view>
  83 + </block>
  84 + </block>
  85 + </view>
  86 +
  87 + <view style="height: 20rpx"></view>
56 88 <!-- 按钮 -->
57   - <view class="btn-container">
  89 + <view class="btn-container" wx:if="{{details.lbtype==1}}">
58 90 <block wx:if="{{index == 0}}">
59   - <view bindtap="GetBuyIntegral" class="btn red">立即兑换</view>
60   - <view bindtap="GetBuyPrice" class="btn pink">立即购买</view>
  91 + <view wx:if="{{details.lbintegral>0}}" bindtap="GetBuyIntegral" class="btn red">立即兑换</view>
  92 + <view wx:if="{{details.lbprice>0}}" bindtap="GetBuyPrice" class="btn pink">立即购买</view>
  93 + </block>
  94 +
  95 + <block wx:else>
  96 + <view wx:if="{{details.isget}}" data-type="1" class="btn" style="background-color:#aaa;color: #fff">
  97 + 已领取{{list[0].freebh}}
  98 + </view>
  99 + <view wx:elif="{{details.codetype!=1}}" bindtap="show_hxm" data-type="1" class="btn red">立即使用</view>
61 100 </block>
62   - <view wx:else bindtap="show_hxm" data-type="1" class="btn red">立即使用</view>
63 101 </view>
  102 +
  103 + <view class="btn-container" wx:if="{{details.lbtype==2}}">
  104 + <block wx:if="{{index == 0}}">
  105 + <view wx:if="{{details.lbintegral>0}}" bindtap="GetBuyIntegral" class="btn red">立即兑换</view>
  106 + <view wx:if="{{details.lbprice>0}}" bindtap="GetBuyPrice" class="btn pink">立即购买</view>
  107 + </block>
  108 + <block wx:else>
  109 + <view wx:if="{{details.isget}}" data-type="1" class="btn" style="background-color:#aaa;color: #fff">已领</view>
  110 + <view wx:else bindtap="show_get_quan" data-type="1" class="btn red">一键领取优惠券→</view>
  111 + </block>
  112 + </view>
  113 +
64 114 </view>
65 115  
66 116 <!-- 引入提示组件 -->
... ...
packageA/pages/myGiftDetails/myGiftDetails.wxss
... ... @@ -81,4 +81,21 @@ page {
81 81 .ling_btn{ background: #c0283a; color: #fff; width: 100rpx; height: 50rpx;
82 82 display: inline-block; line-height: 50rpx; border-radius: 10rpx}
83 83  
84   -.ling_btn.c_a{ background: darkgrey}
85 84 \ No newline at end of file
  85 +.ling_btn.c_a{ background: darkgrey}
  86 +
  87 +.lb_quan{
  88 + width: 48%;
  89 + height: 120rpx;
  90 + background-size: 100% 100%;
  91 + background-position: center;
  92 + background-repeat: no-repeat;
  93 + color: #fff;
  94 + font-size: 22rpx;
  95 + text-align: center;
  96 + margin-top:20rpx;
  97 + margin-left:10rpx;
  98 +}
  99 +.fir_view{
  100 + justify-content: space-between; height: 98rpx; line-height: 98rpx; padding: 0 8rpx;
  101 +}
  102 +.exp_title{text-align: center;height: 60rpx; line-height: 60rpx;background-color: #cccdce;color: #c0283a}
86 103 \ No newline at end of file
... ...
packageA/pages/my_service2/appment_main.js
... ... @@ -3,6 +3,8 @@ var e = getApp(),
3 3 os = a,
4 4 t = e.request,
5 5 d = e.globalData;
  6 + var ut = require("../../../utils/util.js");
  7 +
6 8 Page({
7 9 /**
8 10 * 页面的初始数据
... ... @@ -11,21 +13,17 @@ Page({
11 13 inurl: a.url, //接口网址
12 14 iurl: a.imghost, //服务器网址
13 15 store: 0, //是否显示服务门店列表
14   - beautician: 0, //是否显示美容师列表
15   - beautician_name: "", //选中的美容师名称
16   - beauticianID: "", //美容师id
17   - bea_index: "", //美容师列表下标
  16 +
18 17 placeholder: "填写备注", //备注为空的placeholder
19 18 store_list: [], //门店列表
20   - beautician_list: [], //美容师列表
21   - store_name: "", //选择的服务门店
  19 +
  20 + store_name: "", //选择的服务门店
22 21 fir_pick_index: 0, //选择的门店下标
23 22 curpage: 1, //当前分页数
24 23 pageSize: 8, //页大小
25 24 total: 0,
26 25 ismore: 0, //是否加载完毕
27   - itemId: "", //服务id
28   - project_id: "", //项目id
  26 +
29 27 isScroll: true, //scroll-y是否可以滑动
30 28 key_word: "", //是否按门店文字查询
31 29 is_service_read: 0, //是否调用过门店接口
... ... @@ -34,8 +32,7 @@ Page({
34 32 remarks: "", //备注
35 33 storageId: "", //线下门店id
36 34 url: "/packageA/pages/my_service/appment_main", //本页面地址路径用于选择时间页面跳转回来
37   - buyType: "", //项目类型
38   - time: "", //选择预约时间
  35 +
39 36 tment_count: "", //可预约人数
40 37 lat: "", //纬度坐标
41 38 lon: "", //经度坐标
... ... @@ -44,19 +41,22 @@ Page({
44 41 is_sub: 0, //判断是否重复提交
45 42 is_textea: 1, //备注是否是可输入
46 43  
47   - // 拖拽参数
48   - writePosition: [], //默认定位参数
49   - writesize: [0, 0],// X Y 定位
50   - window: [0, 0], //屏幕尺寸
51   - write: [0, 0], //定位参数
52   - scrolltop: 0,//据顶部距离
53   - v:{},
54   -
55   - project: ['项目1', '项目2', '项目3', '项目4', '项目5', '项目6', '项目7'],
56   - md: [{name:'美导1',time:'08:30-22:00'},{name:'美导2',time:'09:30-18:00'},],
57   - timeList: [],
58   - deltaX: 0,
59   - col_arr:[],
  44 + write: [0, 0], //定位参数
  45 + scrolltop: 0,//据顶部距离
  46 + v:{},
  47 +
  48 + //project: ['项目1', '项目2', '项目3', '项目4', '项目5', '项目6', '项目7'],
  49 + //md: [{name:'美导1',time:'08:30-22:00'},{name:'美导2',time:'09:30-18:00'},],
  50 + timeList: [],
  51 + deltaX: 0,
  52 + col_arr:[],
  53 + wp:[],
  54 + datet:null,
  55 + s_top:0,
  56 +
  57 + cur_sele_i:-1,
  58 + cur_sele_j:-1
  59 +
60 60 },
61 61 //控制备注输入
62 62 check_text: function() {
... ... @@ -67,6 +67,7 @@ Page({
67 67 beautician: 0
68 68 })
69 69 },
  70 +
70 71 onclickstore: function() {
71 72 var th = this;
72 73 var store = th.data.store;
... ... @@ -85,6 +86,8 @@ Page({
85 86 wx.showLoading({
86 87 title: '加载中',
87 88 })
  89 +
  90 + //获取门店
88 91 th.query_store();
89 92 }
90 93 }
... ... @@ -96,104 +99,82 @@ Page({
96 99 remarks: remarks
97 100 })
98 101 },
99   - //提交成功及发送模版代码
  102 +
  103 +
  104 + //单个预约的提交成功及发送模版代码
100 105 success: function() {
  106 + var user_id=getApp().globalData.userInfo.user_id;
  107 + wx.showLoading({ title: '加载中', });
101 108 var th = this;
102 109 var store = th.data.store_name; //门店名称
103   - var bea_name = th.data.beautician_name; //美容师名称
104   - var time = th.data.time; //预约时间
105   - var is_sub = th.data.is_sub; //是否重复提交
106   - var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/insert"; //接口路径
107   - var serviceId = th.data.itemId; //服务id
108   - var beauticianID = th.data.beauticianID; //美容师id
109   - var buyType = th.data.buyType; //服务项目类型
110   - var storeId = a.stoid; //商家id
111   - var storageId = th.data.storageId; //门店id
112   - var userId = th.data.options.userid; //用户id
113   - var remarks = th.data.remarks; //用户备注
114   - var project_id = th.data.project_id; //项目id
115   - var validay = th.data.validay;
116   - var json = {
117   - "arrangeTime": time + ":00",
118   - "beauticianId": beauticianID,
119   - "buyType": buyType,
120   - "effectiveDay": "",
121   - "number": "",
122   - "projectId": project_id,
123   - "remark": remarks,
124   - "serviceId": serviceId,
125   - "states": 0,
126   - "storageId": storageId,
127   - "storeId": storeId,
128   - "userId": userId,
129   - "validay": validay,
130   - "isxz": 1
131   -
132   - }
133   - var data = JSON.stringify(json);
  110 + var datet = th.data.datet; //预约时间
  111 + //接口路径
  112 + var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/batchinsert";
  113 + var req_arr={
  114 + "storageId": th.data.storageId,
  115 + "storeId": a.stoid,
  116 + "userId": user_id,
  117 + "remark": '',
  118 + "isxz": 1,
  119 + "states": 0,
  120 + "list":[]
  121 + };
  122 + for(var i in this.data.v){
  123 + for(var j in this.data.v[i]){
  124 + var item=this.data.v[i][j];
  125 + var md=this.data.md[i];
  126 + var tn=this.data.timeArr[j];
  127 + var json = {
  128 + "arrangeTime":datet+' '+ tn + ":00",
  129 + "beauticianId":encodeURIComponent(md.staffid) ,
  130 + "buyType": item.BuyType,
  131 + //"effectiveDay": "",
  132 + //"number": "",
  133 + "projectId": item.ProjectID,
  134 + "serviceId": item.ServiceID,
  135 + "validay": item.Validay,
  136 + }
  137 + req_arr.list.push(json);
  138 + }
  139 + }
  140 + console.log(req_arr);
  141 + //return false;
  142 + var js_data = JSON.stringify(req_arr);
134 143 wx.request({
135 144 url: url,
136   - data: json,
  145 + data: js_data,
137 146 method: 'post',
138 147 header: {
139 148 'content-type': 'application/json'
140 149 }, // 设置请求的 header
141 150 success: function(res) {
142   - th.setData({
143   - is_sub: 0
144   - })
  151 + th.setData({ is_sub: 0})
145 152 wx.hideLoading();
146 153 if (res.data.code == 0) {
147   - getApp().my_warnning("预约成功", 1, th);
148   - // var store_name = th.data.store_name; //预约门店
149   - var number = res.data.data.Number;
150   - // var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口
151   - //var userinfo = getApp().globalData.userInfo;
152   - //var name = d.userInfo.nickname;
153   - // var json = {
154   - // // "formId": formid,
155   - // "keyWord": [{
156   - // "keyword": res.data.data.ServiceName
157   - // },
158   - // {
159   - // "keyword": time.substring(0, 16)
160   - // }, {
161   - // "keyword": res.data.data.BeauticianName
162   - // }, {
163   - // "keyword": res.data.data.StorageName
164   - // }, {
165   - // "keyword": res.data.data.Address
166   - // }
167   - // ],
168   - // "page": "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+th.data.options.userid,
169   - // "storeId": a.stoid,
170   - // "typeId": "1011",
171   - // "userId": th.data.options.userid
172   - // };
173   - // var data = JSON.stringify(json);
174   - // //调用发送预约成功模版接口
175   - // wx.request({
176   - // url: th.data.inurl + temp_url,
177   - // data: data,
178   - // method: 'post',
179   - // header: {
180   - // 'content-type': 'application/json'
181   - // }, // 设置请求的 header
182   - // success: function(data) {}
183   - // })
184   -
185   - wx.redirectTo({
186   - url: "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+th.data.options.userid,
187   - });
188   -
  154 + getApp().my_warnning("预约成功", 1, th);
  155 +
  156 + if(res.data.data.length>1){
  157 + var number = res.data.data[0].Number;
  158 + wx.redirectTo({
  159 + url: "/packageA/pages/my_service/tment_order_list?number=" + number+"&userid="+user_id,
  160 + });
  161 +
  162 + }else{
  163 + var number = res.data.data[0].Number;
  164 + wx.redirectTo({
  165 + url: "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+user_id,
  166 + });
  167 + }
  168 +
189 169 } else {
190 170 getApp().my_warnning(res.data.msg, 0, th);
191 171 th.settime();
192 172 }
193 173 }
194 174 })
195   -
196 175 },
  176 +
  177 +
197 178 //定时显示texteat
198 179 settime: function() {
199 180 var th = this;
... ... @@ -203,141 +184,59 @@ Page({
203 184 })
204 185 }, 2000);
205 186 },
206   - //提交预约
  187 +
  188 +
  189 + //-- 提交预约 --
207 190 sub_success: function(e) {
208 191 var th = this;
209   - var temp_url = th.data.inurl + "/api/wx/weappSendlist/page";
  192 + //和推送消息有关系
  193 + var temp_url = th.data.inurl + "/api/wx/weappSendlist/page";
210 194 var template_id = "";
211   - if (th.data.is_sub == 1) {
212   - return false;
213   - }
214   - var store = th.data.store_name; //门店名称
215   - var bea_name = th.data.beautician_name; //美容师名称
216   - var time = th.data.time; //预约时间
217   - var is_sub = th.data.is_sub; //是否重复提交
218   - th.setData({
219   - is_textea: 0,
220   - is_sub: 1
221   - })
  195 +
  196 + //门店名称
  197 + var store = th.data.store_name;
222 198 //提交预约前的判断
223 199 if (store == "") {
224   - getApp().my_warnning("请选择服务门店", 0, th);
225   - th.setData({
226   - is_sub: 0
227   - })
228   - th.settime();
229   - return false;
230   - } else if (bea_name == "") {
231   - getApp().my_warnning("请选择美容师", 0, th);
232   - th.setData({
233   - is_sub: 0
234   - })
235   - th.settime();
236   - return false;
237   - } else if (time == undefined || time == '') {
238   - getApp().my_warnning("请选择预约时间", 0, th);
239   - th.setData({
240   - is_sub: 0
241   - })
242   - th.settime();
243   - return false;
244   - } else {
245   - var version ="";
246   - //判断微信版本是否达到预约成功订阅的要求
247   - wx.getSystemInfo({
248   - success(res) {
249   - version = res.version;
250   - }
251   - })
252   - wx.showLoading({
253   - title: '加载中',
254   - })
255   -
256   - th.success();
257   - // if (th.ver(version, '7.0.4') >= 0) {
258   - // //获取模版id
259   - // getApp().request.promiseGet(temp_url, {
260   - // data: {
261   - // store_id: a.stoid,
262   - // typeid: "1011"
263   - // }
264   - // }).then(res => {
265   - // if (res.data.code == 0 && res.data.data.pageData.length > 0) {
266   - // template_id = res.data.data.pageData[0].template_id;
267   - // // //授权订阅
268   - // wx.requestSubscribeMessage({
269   - // tmplIds: [template_id],
270   - // success(res) {
271   - // th.success();
272   - // },
273   - // fail(res) {
274   - // th.success();
275   - // }
276   - // })
277   - // } else {
278   - // th.success();
279   - // }
280   - // })
281   - // } else {
282   - // // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
283   - // wx.showModal({
284   - // title: '提示',
285   - // content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
286   - // })
287   - // th.setData({
288   - // is_sub: 0
289   - // })
290   - // }
291   -
292   - }
293   - },
294   - //版本判断
295   - ver:function(v1,v2){
296   - v1 = v1.split('.')
297   - v2 = v2.split('.')
298   - var num1 = "" ;
299   - var num2 = "";
300   - var len = Math.max(v1.length, v2.length)
301   -
302   - while (v1.length < len) {
303   - v1.push('0')
304   - }
305   - while (v2.length < len) {
306   - v2.push('0')
307   - }
308   -
309   - for (let i = 0; i < len; i++) {
310   - num1 = parseInt(v1[i])
311   - num2 = parseInt(v2[i])
312   -
313   - if (num1 > num2) {
314   - return 1
315   - } else if (num1 < num2) {
316   - return -1
317   - }
318   - }
319   - return 0
320   - },
321   - goto: function(e) {
322   - var th = this;
323   - th.setData({
324   - beautician: 0,
325   - is_textea: 0
326   - })
327   - if (th.data.store_name == "") {
328   - getApp().my_warnning("请选择服务门店", 0, th);
329   - th.settime();
330   - } else if (th.data.beautician_name == "") {
331   - getApp().my_warnning("请选择美容师", 0, th);
332   - th.settime();
333   - } else {
334   - th.setData({
335   - is_textea: 1
336   - })
337   - var url = e.currentTarget.dataset.url;
338   - getApp().goto(url);
339   - }
  200 + getApp().my_warnning("请选择服务门店", 0, th);
  201 + return false;
  202 + }
  203 +
  204 + if(Object.keys(th.data.v).length === 0){
  205 + getApp().my_warnning("请选择美导和预约时间", 0, th);
  206 + return false;
  207 + }
  208 +
  209 + if(th.data.is_sub) return false;
  210 + th.setData({ is_sub: 1});
  211 +
  212 +
  213 + //获取模版id
  214 + getApp().request.get(temp_url, {
  215 + data: {
  216 + store_id: a.stoid,
  217 + typeid: "1011"
  218 + },
  219 + success:function(res){
  220 + if (res.data.code == 0 && res.data.data.pageData.length > 0) {
  221 + template_id = res.data.data.pageData[0].template_id;
  222 + // //授权订阅
  223 + wx.requestSubscribeMessage({
  224 + tmplIds: [template_id],
  225 + success(res) {
  226 + th.success();
  227 + },
  228 + fail(res) {
  229 + th.success();
  230 + }
  231 + })
  232 + } else {
  233 + th.success();
  234 + }
  235 + }
  236 + })
  237 +
340 238 },
  239 +
341 240 //点击选择门店
342 241 choose_for_store: function(e) {
343 242 var th = this;
... ... @@ -355,6 +254,7 @@ Page({
355 254 })
356 255 }
357 256 },
  257 +
358 258 //确认选择门店
359 259 choice_store: function() {
360 260 var th = this;
... ... @@ -367,8 +267,51 @@ Page({
367 267 storageId: Id,
368 268 is_textea: 1
369 269 })
  270 +
  271 + th.get_project_guide();
  272 +
370 273 },
371   - onReachBottom: function() {
  274 +
  275 + //获取美导和项目
  276 + get_project_guide(){
  277 + var th=this,user=getApp().globalData.userInfo;
  278 + var req={
  279 + storeId:os.stoid,
  280 + userId:user.user_id,
  281 + StorageId:encodeURIComponent(this.data.storageId),
  282 + }
  283 + getApp().request.get("/api/weshop/marketing/reservation/sm/pageNew",{
  284 + data:req,
  285 + success:function(res){
  286 + if(ut.ajax_ok(res)){
  287 + th.setData({project:res.data.data.pageData})
  288 + }
  289 + }
  290 + })
  291 +
  292 + req.SeekTime=this.data.datet;
  293 + getApp().request.get("/api/weshop/marketing/reservation/listStaffAndTime",{
  294 + data:req,
  295 + success:function(res){
  296 + if(ut.ajax_ok2(res)){
  297 + th.setData({v:{},col_arr:[]})
  298 + //-- 有些时间是全部没有的 --
  299 + th.setTimeShow(res.data.data)
  300 + }else{
  301 + th.setData({md:[]});
  302 + }
  303 + }
  304 + })
  305 +
  306 + //获取第一个元素的位置
  307 + setTimeout(function(){
  308 + th.queryMultipleNodes();
  309 + },1000)
  310 +
  311 + },
  312 +
  313 +
  314 + onGetBottom: function() {
372 315 var th = this;
373 316 if (this.data.total <= th.data.pageSize) return;
374 317 if (this.data.ismore) return;
... ... @@ -378,6 +321,7 @@ Page({
378 321 })
379 322 th.query_store();
380 323 },
  324 +
381 325 //分页查询门店信息
382 326 query_store: function() {
383 327 var th = this;
... ... @@ -385,14 +329,13 @@ Page({
385 329 is_textea: 0
386 330 })
387 331 var itemId = th.data.itemId; //服务id
388   - var url = "/api/weshop/marketing/reservation/storage/pagenew";
  332 + var url = "/api/weshop/marketing/reservation/service/storage/page";
389 333 var key_word = th.data.key_word;
390 334 key_word = key_word.replace(/\s+/g, "");
391 335 getApp().request.promiseGet(url, {
392 336 data: {
393   - userId: th.data.options.userid,
  337 + userId: getApp().globalData.user_id,
394 338 storeId: a.stoid,
395   - serviceId: itemId,
396 339 latitude: th.data.lat,
397 340 longitude: th.data.lon,
398 341 page: th.data.curpage,
... ... @@ -401,7 +344,7 @@ Page({
401 344 }
402 345 }).then(res => {
403 346 wx.hideLoading();
404   - if (res.data.code == 0) {
  347 + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0) {
405 348 th.data.curpage++;
406 349 var arr1 = th.data.store_list;
407 350 var arr2 = res.data.data.pageData;
... ... @@ -534,8 +477,9 @@ Page({
534 477 th.setData({
535 478 is_textea: 1
536 479 })
537   - console.log('optionsxxx===>', this.data.options);
538   - // console.log('1-->', "/pages/user/my_service/cosmetology_list?userid=" + th.data.options.userid + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id);
  480 +
  481 + console.log('optionsxxx===>', this.data.options);
  482 + // console.log('1-->', "/pages/user/my_service/cosmetology_list?userid=" + th.data.options.userid + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id);
539 483 wx.navigateTo({
540 484 url: "/packageA/pages/my_service/cosmetology_list?userid=" + this.data.options.userid + '&storageId=' + storageId + '&itemId=' + itemId + "&projectId=" + project_id
541 485 });
... ... @@ -546,15 +490,30 @@ Page({
546 490 * 生命周期函数--监听页面加载
547 491 */
548 492 onLoad: function(options) {
  493 +
  494 +
  495 + // 如果数值位数为1,则补0
  496 + function appendZero(obj) {
  497 + if (obj < 10) {
  498 + return "0" + "" + obj;
  499 + } else {
  500 + return obj;
  501 + }
  502 + };
549 503  
550 504 this.getTimeList(23, 30);
551 505 var th = this;
  506 + var now_date = new Date();
  507 + var md = now_date.getFullYear()+"-"+appendZero(now_date.getMonth() + 1) + "-" + appendZero(now_date.getDate());
  508 +
552 509 th.setData({
553   - options,
  510 + options,
554 511 itemId: options.service_id,
555 512 buyType: options.BuyType,
556 513 project_id: options.ProjectID,
557   - validay: options.Validay
  514 + validay: options.Validay,
  515 + datet:md,
  516 + nowDate:md
558 517 });
559 518 wx.getLocation({
560 519 type: 'gcj02',
... ... @@ -584,87 +543,30 @@ Page({
584 543 th.data.is_get_local_ok = 1;
585 544 }
586 545 });
587   -
588   - // 获取当前默认导购信息及归属门店信息
589   - if(options.firstleader) {
590   - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+a.stoid+"/"+options.firstleader,{}).then(res=>{
591   - if(res.data.code==0){
592   - getApp().globalData.guide_id=res.data.data.id;
593   -
594   - getApp().request.promiseGet('/api/weshop/shoppingGuide/geIdStaffInfo', {
595   - data: {
596   - store_id: a.stoid,
597   - guide_id: e.globalData.guide_id,
598   - UserCode: th.data.options.usercode,
599   - }
600   - }).then(res => {
601   - console.log('res==>', a.stoid, e.globalData.guide_id, th.data.options.usercode);
602   - if(res.data.data.Tech) {
603   -
604   - var data={
605   - store_name: res.data.data.StorageName,
606   - beautician_name: res.data.data.StaffName,
607   - beauticianID: res.data.data.StaffId,
608   - StorageId: res.data.data.StorageId,
609   - }
610   - th.check_firleader(data);
611   - }
612   - });
613   -
614   -
615   - };
616   - });
617   - };
618   -
619   -
  546 +
  547 + //--先判断会员状态--
  548 + var user_info = getApp().globalData.userInfo;
  549 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  550 + wx.navigateTo({
  551 + url: '/pages/togoin/togoin',
  552 + })
  553 + return false;
  554 + }
620 555 },
621   - //查询剩下可预约人数
622   - query_more: function() {
623   - var th = this;
624   - var url = "/api/weshop/marketing/reservation/can/reservation/countnew";
625   - var beauticianID = th.data.beauticianID; //美容师id
626   - var projectID = th.data.itemId; //服务id
627   - var seekTime = th.data.time; //预约日期
628   - var storageId = th.data.storageId; //门店id
629   - var storeId = a.stoid; //商家id
630   - getApp().request.promiseGet(url, {
631   - data: {
632   - beauticianId: beauticianID,
633   - seekTime: seekTime,
634   - serviceId: projectID,
635   - storageId: storageId,
636   - storeId: storeId
637   - }
638   - }).then(res => {
639   - if (res.data.code == 0) {
640   - var tment_count = res.data.data.CanReservation;
641   - th.setData({
642   - tment_count: tment_count
643   - })
644   - } else {
645   - getApp().my_warnning(res.data.msg, 0, th);
646   - th.settime();
647   - }
648   - })
  556 +
649 557  
650   - },
651 558 /**
652 559 * 生命周期函数--监听页面显示
653 560 */
654 561 onShow: function() {
655 562 var th = this;
656   - var seekTime = th.data.time; //预约日期
657   - if (seekTime != "") {
658   - th.query_more();
659   - }
660 563 th.setData({
661   - time: th.data.time.substring(0, 16),
662 564 is_textea: 1
663 565 })
664   - th.query_project();
665   -
666   - th.queryMultipleNodes();
  566 +
667 567 },
  568 +
  569 +
668 570 //获取单个服务项目信息
669 571 query_project: function() {
670 572 var th = this;
... ... @@ -687,81 +589,17 @@ Page({
687 589 }
688 590 })
689 591 },
690   - //关闭导航
691   - // close: function() {
692   - // var th = this;
693   - // var nav_b = th.selectComponent("#nav_b"); //组件的id
694   - // nav_b.close_box();
695   - // }
696   -
697   - //判断分享的导购是不是有门店,是不是该门店下又该会员
698   - check_firleader(data){
699   - var th=this;
700   - var itemId = this.data.itemId; //服务id
701   - var url = "/api/weshop/marketing/reservation/storage/pagenew";
702   - var key_word = data.store_name;
703   - key_word = key_word.replace(/\s+/g, "");
704   - getApp().request.promiseGet(url, {
705   - data: {
706   - userId: th.data.options.userid,
707   - storeId: os.stoid,
708   - serviceId: itemId,
709   - latitude: th.data.lat,
710   - longitude: th.data.lon,
711   - page: 1,
712   - pageSize: 1000,
713   - keyWord: key_word
714   - }
715   - }).then(res => {
716   - //-- 如果是门店的话 --
717   - if (res.data.code == 0 && res.data.data && res.data.data.pageData) {
718   - var store_data=null;
719   - for(var i in res.data.data.pageData){
720   - var it=res.data.data.pageData[i];
721   - if(it.Id==data.StorageId){
722   - store_data={
723   - store_name: data.store_name,
724   - StorageId: data.StorageId,
725   - };
726   - break;
727   - }
728   - }
729   - if(!store_data) return false;
730   - th.setData(store_data)
731   -
732   - }else{
733   - return false;
734   - }
735   -
736   - //导购接口地址
737   - var url = "/api/weshop/marketing/reservation/staff/pagenew";
738   - return getApp().request.promiseGet(url, {
739   - isShowLoading:1,
740   - data: {
741   - storeId: os.stoid,
742   - userId: th.data.options.userid,
743   - serviceId: itemId,
744   - storageId: data.StorageId
745   - }
746   - })
747   - }).then(res=>{
748   - if (res && res.data && res.data.code == 0) {
749   - var beautician_list=res.data.data;
750   - for(var i in beautician_list){
751   - var item=beautician_list[i];
752   - if(item.staffid==data.beauticianID){
753   - th.setData({
754   - beautician_name:data.beautician_name,
755   - beauticianID:data.beauticianID,
756   - })
757   - break;
758   - }
759   - }
760   -
761   - }
762   - })
763   - },
  592 +
764 593  
  594 +
  595 + //开始拖拽项目列表
  596 + touchmove1: function (e) {
  597 + var that = this;
  598 + var position = [e.touches[0].pageX-15, e.touches[0].pageY-that.data.s_top];
  599 + that.setData({
  600 + wp: position
  601 + });
  602 + },
765 603  
766 604 //开始拖拽
767 605 touchmove: function (e) {
... ... @@ -772,59 +610,233 @@ Page({
772 610 write: position
773 611 });
774 612 },
775   - touchend:function(e){
776   - var that = this,th=that;
777   - if(!that.data.copy_btn) return false;
778   - var position =th.data.write;
779   - var arr=th.data.col_arr;
780   - for(var i=0;i<this.data.md.length;i++){//i是列
781   - var item=this.data.md[i];
782   - var nd=new Date();
783   - var d_str=nd.getFullYear()+"-"+(nd.getMonth()+1)+"-"+nd.getDate()+" ";
784   - var d_arr=item.time.split("-");
785   - var t1=new Date(d_str+d_arr[0])
786   - var t2=d_arr.length>1?new Date(d_str+d_arr[1]):0;
787   -
788   - for(var j=0; j<this.data.timeArr.length;j++){//j是行
789   - if(arr.indexOf(j)!=-1) continue;
790   - var tn=new Date(d_str+this.data.timeArr[j]);
791   - //小于开始时间
792   - if(tn<t1) continue;
793   - //大于结束时间
794   - if(tn>t2 && t2>0) continue;
795   - //如果坐标在网格内
796   - if( position[0]>th.data.f_x+i*th.data.f_width && position[0]<th.data.f_x+ (i+1)*th.data.f_width &&
797   - position[1]>th.data.f_y +j*th.data.f_hei && position[1]<th.data.f_y+(j+1)*th.data.f_hei){
798   -
799   - var txt="v["+i+"]["+j+"]";
  613 +
  614 + //-- 点击空格选择 --
  615 + sele_tab:function(e){
  616 + if(!this.data.sele_project){
  617 + wx.showToast({
  618 + title: "请选择要预约的项目",
  619 + icon: 'none',
  620 + duration: 2000
  621 + })
  622 + return false;
  623 + }
  624 +
  625 + var th=this;
  626 + var arr=this.data.col_arr;
  627 + var i=e.currentTarget.dataset.index;
  628 + var j=e.currentTarget.dataset.subindex;
  629 +
  630 + var item=this.data.md[i]; //获得美导
  631 + var tn=this.data.timeArr[j]; //获得时间
  632 +
  633 + //查看时间段能不能预约
  634 + if(!item.listtime[j].iskyy){
  635 + wx.showToast({
  636 + title: "该时间不可以预约",
  637 + icon: 'none',
  638 + duration: 2000
  639 + })
  640 + return false;
  641 + }
  642 + //查看时间有没有被预约了
  643 + if(this.data.v && this.data.v[i] && this.data.v[i][j]){
  644 + wx.showToast({
  645 + title: "该时间已被预约",
  646 + icon: 'none',
  647 + duration: 2000
  648 + })
  649 + return false;
  650 + }
  651 +
  652 + if(!item.listtime[j].itemids){
  653 + wx.showToast({
  654 + title: "该时间不可预约该项目",
  655 + icon: 'none',
  656 + duration: 1500
  657 + })
  658 + return false;
  659 + }
  660 +
  661 + var project_arr=item.listtime[j].itemids.split(',');
  662 +
  663 + if(project_arr.indexOf(this.data.sele_project.ServiceID)==-1){
  664 + wx.showToast({
  665 + title: "该时间不可预约该项目",
  666 + icon: 'none',
  667 + duration: 1500
  668 + })
  669 + return false;
  670 + }
  671 +
  672 + //同一美导同一项目,能选择两次,只要时间段不重复
  673 + if(this.data.v[i] && Object.keys(this.data.v[i]).length){
  674 + for(var sj in this.data.v[i]){
  675 + if(this.data.v[i][sj] && this.data.v[i][sj].ProjectID==this.data.sele_project.ProjectID){
  676 + th.checK_is_can_yy(item,tn,function(res){
  677 + if(res){
  678 + if(res>1){
  679 + wx.showToast({
  680 + title: '当前项目预约次数已超出项目剩余数,请先修改', icon: 'none', duration: 2000
  681 + });
  682 + return false;
  683 + }
  684 + wx.showModal({
  685 + title: "当前项目已有预约是否修改?",
  686 + success: function (res) {
  687 + if(res.confirm){
  688 + delete th.data.v[i][sj];
  689 + if(!th.data.v[i])
  690 + th.data.v[i]={}
  691 + th.data.v[i][j]=th.data.sele_project;
  692 + var ind=arr.indexOf(sj);
  693 + arr.splice(ind, 1);
  694 + arr.push(j);
  695 + th.setData({
  696 + v: th.data.v,col_arr:arr
  697 + });
  698 +
  699 + }
  700 + }
  701 + })
  702 + return false;
  703 + }else{
  704 + var txt="v["+i+"]["+j+"]";
800 705 arr.push(j);
801 706 th.setData({
802   - [txt]: th.data.projectName,
  707 + [txt]: th.data.sele_project,
803 708 col_arr:arr
804   - });
805   - break;
806   - }
  709 + });
  710 + return false;
  711 + }
  712 + })
  713 +
  714 + }
  715 + }
  716 +
  717 + }
  718 +
  719 + th.checK_is_can_yy(item,tn,function(res){
  720 + if(res){
  721 + if(res>1){
  722 + wx.showToast({
  723 + title: '当前项目预约次数已超出项目剩余数,请先修改', icon: 'none', duration: 2000
  724 + });
  725 + return false;
  726 + }
  727 +
  728 + wx.showModal({
  729 + title: "当前项目已有预约是否修改?",
  730 + success: function (res) {
  731 + if(res.confirm){
  732 +
  733 + var ii=th.data.cur_sele_i;
  734 + var jj=th.data.cur_sele_j;
  735 + delete th.data.v[ii][jj];
  736 + if(!th.data.v[i])
  737 + th.data.v[i]={}
  738 + th.data.v[i][j]=th.data.sele_project;
  739 + var ind=arr.indexOf(jj);
  740 + arr.splice(ind, 1);
  741 + arr.push(j);
  742 + th.setData({
  743 + v: th.data.v,col_arr:arr
  744 + });
  745 + }
  746 + }
  747 + })
  748 +
  749 + }else{
  750 + var txt="v["+i+"]["+j+"]";
  751 + arr.push(j);
  752 + th.setData({
  753 + [txt]: th.data.sele_project,
  754 + col_arr:arr
  755 + });
  756 + }
  757 +
807 758  
808   - }
809   - }
810   - th.setData({copy_btn:0})
  759 +
  760 + });
811 761 },
812 762  
813 763  
  764 +
  765 +
  766 +
  767 + //删除响应的预约
814 768 close_this:function (e){
815 769 var txt=e.currentTarget.dataset.txt;
816 770 var sindex=parseInt(e.currentTarget.dataset.sindex);
817   - var arr=this.data.col_arr;
818   - var ind=arr.indexOf(sindex);
  771 + var arr=this.data.col_arr;
  772 + var ind=arr.indexOf(sindex);
819 773 arr.splice(ind,1)
820 774 this.setData({[txt]:null,col_arr:arr})
821 775 },
822 776  
823   - onPageScroll(e) {
824   - // console.log('滚动距离', e);
825   - this.data.scrolltop = e.scrollTop;
826   - },
  777 + //计算滚蛋的距离
  778 + onPageScroll(e) { this.data.scrolltop = e.scrollTop;},
  779 +
  780 + //确认有没有预约
  781 + checK_is_can_yy(item, tn, back) {
  782 + var th = this;
  783 + var req = {
  784 + beauticianId: encodeURIComponent(item.staffid),
  785 + seekTime: this.data.datet + " " + tn + ":00",
  786 + serviceId: encodeURIComponent(this.data.sele_project.ServiceID),
  787 + storageId: encodeURIComponent(this.data.storageId),
  788 + storeId: os.stoid
  789 + }
  790 + getApp().request.get("/api/weshop/marketing/reservation/can/reservation/countnew", {
  791 + data: req,
  792 + success: function (res) {
  793 + th.setData({ copy_btn: 0 });
  794 + if (res.data.code == 0) {
  795 + if (!res.data.data.CanReservation && parseInt(res.data.data.canReservation) <= 0) {
  796 + wx.showToast({
  797 + title: '该项目不可以预约', icon: 'none', duration: 2000
  798 + });
  799 + return false;
  800 + }
  801 +
  802 + if (!th.data.v) { back(); return false; }
  803 +
  804 + var arr = Object.keys(th.data.v);
  805 + if (arr.length == 0) { back(); return false; }
  806 +
  807 + var num = 0;
  808 + var sele_arr=[];
  809 + for (var i in th.data.v) {
  810 + if (!th.data.v[i]) continue;
  811 + for (var j in th.data.v[i]) {
  812 + if (th.data.v[i][j] && th.data.v[i][j].ServiceID == th.data.sele_project.ServiceID) {
  813 + num++;
  814 + th.data.cur_sele_i=i;
  815 + th.data.cur_sele_j=j;
  816 + }
  817 + }
  818 + }
  819 +
  820 + if (!num) { back(); return false; }
827 821  
  822 + //如果已经超出次数的时候,就不能预约了
  823 + if (num >= parseInt(res.data.data.CanReservation)) {
  824 +
  825 + back(num);
  826 + return false;
  827 + }
  828 + back();
  829 +
  830 + } else {
  831 + wx.showToast({
  832 + title: res.data.msg,
  833 + icon: 'none',
  834 + duration: 2000
  835 + })
  836 + }
  837 + }
  838 + })
  839 + },
828 840  
829 841 //声明节点查询的方法
830 842 queryMultipleNodes: function() {
... ... @@ -833,16 +845,24 @@ Page({
833 845 query.select('.content_view').boundingClientRect() // 这段代码的意思是选择Id=productServe的节点,获取节点位置信息的查询请求
834 846 query.selectViewport().scrollOffset() // 这段代码的意思是获取页面滑动位置的查询请求
835 847 query.exec(res => {
  848 + if(!res || res.length==0) return false;
  849 + if(!res[0]) return false;
  850 +
836 851 console.log(res);
837 852 th.data.f_x=res[0].left;
838 853 th.data.f_y=res[0].top;
839 854 th.data.f_hei=res[0].height;
840 855 th.data.f_width=res[0].width;
841   -
842 856 })
  857 +
843 858 },
844 859  
  860 + /*--
845 861 getcopy(e) {
  862 +
  863 + },--*/
  864 + //项目元素点击后的效果
  865 + getName(e) {
846 866 var that=this;
847 867 console.log('e', e);
848 868 var x=e.currentTarget.dataset.offsetLeft;
... ... @@ -850,52 +870,74 @@ Page({
850 870 var position = [x, y];
851 871 that.setData({
852 872 write: position,copy_btn:1
853   - });
854   -
855   - },
856   -
857   - getName(e) {
858   - // console.log('e1', e);
859   - let name = e.currentTarget.dataset.name;
  873 + });
  874 + // console.log('e1', e);
  875 + let index = e.currentTarget.dataset.index;
  876 + let name = this.data.project[index];
  877 +
  878 +
860 879 this.setData({
861   - projectName: name,
  880 + sele_project: name,prj_index:index
862 881 });
  882 +
  883 + },
  884 +
  885 + //-- 项目列表长按 --
  886 + setmove1(){
  887 + this.setData({move1:1});
863 888 },
864 889  
865   -
866   - // 生成时间段
867   - getTimeList(hours,step) {
868   - var minutes=60;
  890 + //-- 生成时间段 --
  891 + getTimeList(hours,step) {
  892 + var minutes=60;
869 893 var timeArr = [];
870 894 hours = hours;
871 895 step = step;
  896 +
  897 + // 如果数值位数为1,则补0
  898 + function appendZero(obj) {
  899 + if (obj < 10) {
  900 + return "0" + "" + obj;
  901 + } else {
  902 + return obj;
  903 + }
  904 + };
  905 +
  906 + var now_date=new Date();
  907 + var md = now_date.getFullYear()+"-"+appendZero(now_date.getMonth() + 1) + "-" + appendZero(now_date.getDate());
872 908  
873   - for(var i = 8; i < hours; i++){
874   - var str = '';
875   - if(i < 10) {
876   - str = 0 + '' + i;
877   - } else {
878   - str = '' + i;
879   - };
880   -
881   - for(var j = 0; j < minutes; j++) {
882   - if(j % step == 0){
883   - var s = j < 10 ? ':' + 0 + '' + j : ':' + j;
884   - s = str + s;
885   - timeArr.push(s);
886   - };
887   - };
888   - };
889   -
890   - // console.log('timeArr', timeArr);
891   - this.setData({
892   - timeArr,
893   - });
  909 + for(var i = 8; i < hours; i++){
  910 + var str = '';
  911 + if(i < 10) {
  912 + str = 0 + '' + i;
  913 + } else {
  914 + str = '' + i;
  915 + };
  916 +
  917 + for(var j = 0; j < minutes; j++) {
  918 + if(j % step == 0){
  919 + var s = ':' + appendZero(j);
  920 + s = str + s;
  921 + //-- 不是当天 --
  922 + if(this.data.datet && this.data.datet!=md){
  923 + timeArr.push(s);
  924 + }else{
  925 + var d1=md+" "+s;
  926 + var date1=new Date(d1);
  927 + //必须是大于
  928 + if(date1.getTime()>now_date.getTime()){
  929 + timeArr.push(s);
  930 + }
  931 + }
  932 +
  933 + };
  934 + };
  935 + };
  936 +
  937 + this.setData({timeArr,});
894 938  
895 939 },
896   -
897   -
898   -
  940 +
899 941 scroll(e) {
900 942 // console.log('e', e.detail.deltaX);
901 943 let deltaX = e.detail.deltaX;
... ... @@ -904,8 +946,104 @@ Page({
904 946 // };
905 947 this.data.deltaX = -deltaX;
906 948 },
907   -
  949 +
  950 + pickerTap:function() {
  951 + var date = new Date();
  952 + var monthDay = ['今天','明天'];
  953 + // 月-日
  954 + for (var i = 2; i <= 14; i++) {
  955 + var date1 = new Date(date);
  956 + date1.setDate(date.getDate() + i);
  957 + var md = (date1.getFullYear()+"-"+date1.getMonth() + 1) + "-" + date1.getDate();
  958 + monthDay.push(md);
  959 + }
  960 + this.setData(monthDay);
  961 + },
  962 +
  963 +
  964 + //-- 选择时间的时候 --
  965 + bindDateChenge: function(e) {
  966 + var th=this;
  967 + var nd=new Date(this.data.nowDate);
  968 + var nd1=new Date(e.detail.value);
  969 + if(nd1.getTime()<nd.getTime()){
  970 + wx.showToast({
  971 + title: "选择的日期不能小于今天",
  972 + icon: 'none',
  973 + duration: 2000
  974 + })
  975 + return false;
  976 + }
  977 +
  978 + this.setData({
  979 + datet: e.detail.value
  980 + });
  981 + this.getTimeList(23, 30);
  982 + //当时间变化的时候
  983 + if(this.data.storageId){
  984 + var req={
  985 + storeId:os.stoid,
  986 + userId:getApp().globalData.userInfo.user_id,
  987 + StorageId:encodeURIComponent(this.data.storageId),
  988 + }
  989 + req.SeekTime=this.data.datet;
  990 + getApp().request.get("/api/weshop/marketing/reservation/listStaffAndTime",{
  991 + data:req,
  992 + success:function(res){
  993 + if(ut.ajax_ok2(res)){
  994 + th.setData({v:{},col_arr:[]})
  995 + //-- 有些时间是全部没有的 --
  996 + th.setTimeShow(res.data.data)
  997 + }else{
  998 + th.setData({md:[]});
  999 + }
  1000 + }
  1001 + })
  1002 + }
  1003 + },
908 1004  
909   -
910   -
  1005 + onPageScroll: function(e) {
  1006 + this.data.s_top=e.scrollTop;
  1007 + },
  1008 +
  1009 + //-- 时间段有些不显示,出来的时间和显示的对应 --
  1010 + setTimeShow:function(data){
  1011 + // 如果数值位数为1,则补0
  1012 + function appendZero(obj) {
  1013 + if (obj < 10) {
  1014 + return "0" + "" + obj;
  1015 + } else {
  1016 + return obj;
  1017 + }
  1018 + };
  1019 +
  1020 + var now_date=new Date();
  1021 + var md = now_date.getFullYear()+"-"+appendZero(now_date.getMonth() + 1)+ "-" + appendZero(now_date.getDate());
  1022 +
  1023 + if(this.data.datet && this.data.datet!=md){
  1024 + this.setData({md:data});
  1025 + return false;
  1026 + }
  1027 +
  1028 + for (var i in data) {
  1029 + var ti_time_arr = data[i].listtime;
  1030 + var arr = [];
  1031 + for (var j in ti_time_arr) {
  1032 + var d1 = md + " " + ti_time_arr[j].stime;
  1033 + var date1 = new Date(d1);
  1034 + //必须是大于
  1035 + if (date1.getTime() > now_date.getTime()) {
  1036 + arr.push(ti_time_arr[j]);
  1037 + }
  1038 + }
  1039 + data[i].listtime = arr;
  1040 + }
  1041 + this.setData({md:data});
  1042 +
  1043 +
  1044 +
  1045 + },
  1046 +
  1047 +
  1048 +
911 1049 })
912 1050 \ No newline at end of file
... ...
packageA/pages/my_service2/appment_main.json
... ... @@ -3,6 +3,8 @@
3 3 "enablePullDownRefresh": false,
4 4 "usingComponents": {
5 5 "warn": "/components/long_warn/long_warn",
6   - "nav_b": "/components/nav_b/nav_b"
  6 + "nav_b": "/components/nav_b/nav_b",
  7 + "nodata": "/components/nodata/nodata"
  8 +
7 9 }
8 10 }
9 11 \ No newline at end of file
... ...
packageA/pages/my_service2/appment_main.wxml
1 1 <wxs module="filters" src="../../../utils/filter.wxs"></wxs>
2 2 <wxs module="fil" src="g_filter.wxs"></wxs>
3 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>
  4 +
  5 +<!-- 项目的拖动 -->
  6 +<view wx:if="{{!store && project && md && md.length>0}}" class="card" catchtouchmove='true' style="left:{{wp[0]}}px;top:{{wp[1]}}px;">
  7 + <view class="cp_btn t-c c-c7" bindtouchend="touchend1" bindtouchmove="touchmove1" catch:touchmove1 style="padding: 15rpx 0;" >
  8 + <text class="iconfont icon-sandian" style="font-size: 40rpx;"></text>
18 9 </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>
  10 + <view style="overflow-y: auto; max-height:600rpx;">
  11 + <block wx:for="{{project}}">
  12 + <view class="t-c pd20 {{prj_index==index?'hover':''}}" data-index="{{index}}" catchtap="getName">
  13 + <text class="iconfont icon-meirong fs40"></text>
  14 + <view class="fs24">{{item.ServiceName}}</view>
  15 + </view>
  16 +
24 17 </block>
  18 + </view>
25 19 </view>
26 20  
27 21 <image class="main" src="{{iurl}}/miniapp/images/yyservice/main.png"></image>
28   -
29 22 <view class="pdb100">
30   - <!-- 选择门店 -->
  23 +
  24 + <!-- 选择日期 -->
  25 + <picker class='pi' mode="date" value='{{datet}}' start="2019-1-1" bindchange='bindDateChenge'>
  26 + <view class="flex-vertical pdv20 jc-center">
  27 + <!-- 门店 -->
  28 + <view class="flex-vertical-between head fs30">
  29 + <view>日</view>
  30 + <view>期</view>
  31 + </view>
  32 +
  33 + <view class="flex-vertical-between fs26 select">
  34 + <view class="{{datet==''?'color':''}} value ellipsis-1">{{datet==""?'选择日期':datet}}</view>
  35 + <view class="angle">∟</view>
  36 + </view>
  37 +
  38 + </view>
  39 + </picker>
  40 + <!-- 选择门店 -->
31 41 <view class="flex-vertical pdv20 jc-center">
32 42 <!-- 门店 -->
33 43 <view class="flex-vertical-between head fs30">
... ... @@ -40,8 +50,11 @@
40 50 <view class="{{store_name==''?'color':''}} value ellipsis-1">{{store_name==""?'选择服务门店':store_name}}</view>
41 51 <view class="angle">∟</view>
42 52 </view>
43   - </view>
44   - <view class="table flex fs26" style="width: 100%;height: 100%;">
  53 + </view>
  54 +
  55 +
  56 + <!-- 拖入的田框,主内容 -->
  57 + <view wx:if="{{md && md.length>0}}" class="table flex fs26" style="width: 100%;height: auto; overflow: hidden; margin-bottom: 10rpx;">
45 58 <view class="left t-c">
46 59 <view class="td pr" style="width: 120rpx">
47 60 <view class="time-box" bindtap="pickTime"><view class="time">时间</view></view>
... ... @@ -56,89 +69,21 @@
56 69 <view class="td" wx:for="{{timeArr.length}}"></view>
57 70 </view> -->
58 71 <view wx:for="{{md}}">
59   - <view class="td bg-pink">{{item.name}}</view>
  72 + <view class="td bg-pink">{{item.StaffName}}</view>
60 73 <!-- <view class="td content_view {{v[0][0]?'121':''}}">{{v[0][0]}}</view> -->
61 74 <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>
  75 + <view bindtap="sele_tab" data-index="{{index}}" data-subindex="{{subindex}}"
  76 + class="td content_view {{v[index][subindex] && v[index][subindex]? 'active':''}} {{fil.is_no_time(item,subindex,timeArr,sele_project) ?'notactive':''}}">
  77 + <!-- 当项目是当前选中的项目的时候 -->
  78 + <block wx:if="{{v[index][subindex] && v[index][subindex].ProjectID==sele_project.ProjectID}}">
  79 + <text>{{v[index][subindex]?v[index][subindex].ServiceName:''}}</text>
  80 + <text catchtap="close_this" data-txt="v[{{index}}][{{subindex}}]" data-sindex="{{subindex}}" class="close_this">×</text>
  81 + </block>
65 82 </view>
66 83 </block>
67 84 </view>
68 85 </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   -
  86 + </scroll-view>
142 87 </view>
143 88 </view>
144 89  
... ... @@ -146,9 +91,10 @@
146 91 <navigator class="appment flex-center" url="/pages/user/my_service/tment_order_list">
147 92 <view>我的预约</view>
148 93 </navigator>
149   - <form report-submit='true' bindtap="sub_success">
150   - <button form-type="submit" class="sub_appment flex-center">帮你预约</button>
151   - </form>
  94 + <form report-submit='true' bindtap="sub_success">
  95 + <button wx:if="{{is_sub}}" class="sub_appment flex-center">预约中..</button>
  96 + <button wx:else form-type="submit" class="sub_appment flex-center">提交预约</button>
  97 + </form>
152 98 </view>
153 99  
154 100  
... ... @@ -165,7 +111,7 @@
165 111 </view>
166 112 </view>
167 113 <!-- 选择门店 -->
168   - <scroll-view class="stores" scroll-y="{{isScroll}}" enable-back-to-top="true" bindscrolltolower="onReachBottom">
  114 + <scroll-view class="stores" scroll-y="{{isScroll}}" enable-back-to-top="true" bindscrolltolower="onGetBottom">
169 115 <view class="store flex-vertical" wx:for="{{store_list}}" bindtap="choose_for_store" data-ind="{{index}}">
170 116 <block wx:if="{{index==fir_pick_index}}">
171 117 <icon class="icon" type="success" color="red" size="20"></icon>
... ... @@ -206,8 +152,11 @@
206 152  
207 153 <!-- 制作一个圆球导航 -->
208 154 <!-- <nav_b id="nav_b"></nav_b> -->
209   -
  155 +<!--
210 156 <view class="copy" wx:if="{{copy_btn}}" style="position:absolute;left:{{write[0]}}px;top:{{write[1]}}px;">
211 157 <text class="iconfont icon-meirong fs40"></text>
212   - <view class="fs24">{{projectName}}</view>
  158 + <view class="fs24">{{sele_project.ServiceName}}</view>
  159 +</view>-->
  160 +<view class="flex ai-center jc-center">
  161 + <nodata wx:if="{{md && md.length==0}}" />
213 162 </view>
214 163 \ No newline at end of file
... ...
packageA/pages/my_service2/appment_main.wxss
1 1 page,
2 2 .area {
3 3 width: 100%;
4   - height: 100%;
  4 + height: 100%;
  5 + position: relative;
5 6 }
6 7  
7   -
8   -
9   -
10 8 /* .container {
11 9 border-top: 7rpx solid rgb(245, 245, 245);
12 10 justify-content: baseline;
... ... @@ -188,7 +186,7 @@ button {
188 186 }
189 187  
190 188 .storeList {
191   - z-index: 5;
  189 + z-index: 1500;
192 190 left: 0rpx;
193 191 border-top-left-radius: 25rpx;
194 192 border-top-right-radius: 25rpx;
... ... @@ -301,7 +299,8 @@ button {
301 299 .table {
302 300 background-color: white;
303 301 /* border-top: 2rpx solid rgba(218, 217, 217, 1);
304   - border-left: 2rpx solid rgba(218, 217, 217, 1); */
  302 + border-left: 2rpx solid rgba(218, 217, 217, 1); */
  303 + width: 100%;height: auto; overflow: hidden; margin-bottom: 20rpx;
305 304 }
306 305 .blue {
307 306 background: rgba(241, 252, 255, 1);
... ... @@ -339,17 +338,17 @@ button {
339 338  
340 339 .card {
341 340 position: fixed;
342   - width: 110rpx;
343   - top: 50%;
  341 + width: 130rpx;
  342 + /* top: 50%; */
344 343 right: 0;
345 344 /* min-height: 400rpx; */
346   - max-height: 700rpx;
347   - overflow-y: auto;
348   - transform: translateY(-50%);
  345 + /* max-height: 700rpx; */
  346 + /* transform: translateY(-50%); */
349 347 background-color: white;
350 348 border-radius: 10rpx;
351 349 box-shadow: -2px 0px 6px #aaa;
352   - z-index: 1000;
  350 + z-index: 1000;
  351 + top:160rpx
353 352 }
354 353  
355 354 .icon-meirong {
... ... @@ -443,3 +442,6 @@ button {
443 442 }
444 443  
445 444  
  445 +
  446 +
  447 +
... ...
packageA/pages/my_service2/g_filter.wxs
1 1 var g_filters = {
2   - is_no_time:function(item,subindex,timeArr){
  2 + is_no_time:function(item,subindex,timeArr,sele_project){
  3 + if(!sele_project || !sele_project.ServiceID) return false;
3 4 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;
  5 + var time_arr=item.listtime;
  6 +
  7 + for(var i=0;i<time_arr.length;i++){
  8 + if(t_time==time_arr[i].stime && time_arr[i].iskyy==true){
  9 + //如果没有项目的话
  10 + if(time_arr[i].itemids){
  11 + var project_arr=time_arr[i].itemids.split(',');
  12 + //如果没有相应的项目的话
  13 + if(project_arr && project_arr.indexOf(sele_project.ServiceID)!=-1) return false;
  14 +
  15 + }
  16 + }
  17 + }
  18 +
  19 + return true;
28 20 },
29 21  
30 22 }
... ...
packageA/pages/parseHtml/parseHtml.js
1 1 var WxParse = require('../../../utils/wxParse/wxParse.js');
2 2  
3   -const app = getApp();
  3 +const app = getApp();
4 4 let self = null;
5 5 let content_privacy = `<div>
6 6 <p class="tac font16"><b>隐私政策</b><br /><br /></p>
... ... @@ -235,117 +235,126 @@ let content_use = `&lt;div&gt;
235 235  
236 236 Page({
237 237  
238   - /**
239   - * 页面的初始数据
240   - */
241   - data: {
242   - list: null,
243   - isLoading: false, // 检测是否已经发送请求,防止重复发送请求
244   - noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
245   - pageNum: 1, // 当前页数
246   - },
  238 + /**
  239 + * 页面的初始数据
  240 + */
  241 + data: {
  242 + list: null,
  243 + isLoading: false, // 检测是否已经发送请求,防止重复发送请求
  244 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
  245 + pageNum: 1, // 当前页数
  246 + },
247 247  
248   - /**
249   - * 生命周期函数--监听页面加载
250   - */
251   - onLoad: function (options) {
252   - self = this;
253   - let title = '';
254   - let content = '';
255   - if(options.t == 0) {
256   - title = '用户使用协议';
257   - content = content_use;
258   - } else if(options.t == 1) {
259   - title = '隐私政策';
260   - content = content_privacy;
261   - };
262   - wx.setNavigationBarTitle({
263   - title: title,
264   - });
  248 + /**
  249 + * 生命周期函数--监听页面加载
  250 + */
  251 + onLoad: function (options) {
  252 + self = this;
  253 + //-- 获取一下基础参数 --
  254 + getApp().getConfig2(function (res) {
  255 + if(res.reg_rule){ content_use=res.reg_rule; }
  256 + if(res.reg_privacy){ content_privacy=res.reg_privacy; }
265 257  
266   - WxParse.wxParse('content', 'html', content, self);
267   -
268   - },
  258 + let title = '';
  259 + let content = '';
  260 + if (options.t == 0) {
  261 + title = '用户使用协议';
  262 + content = content_use;
  263 + } else if (options.t == 1) {
  264 + title = '隐私政策';
  265 + content = content_privacy;
  266 + }
  267 + ;
  268 + wx.setNavigationBarTitle({
  269 + title: title,
  270 + });
269 271  
270   - /**
271   - * 生命周期函数--监听页面初次渲染完成
272   - */
273   - onReady: function () {
  272 + WxParse.wxParse('content', 'html', content, self);
274 273  
275   - },
  274 + }, 1)
276 275  
277   - /**
278   - * 生命周期函数--监听页面显示
279   - */
280   - onShow: function () {
  276 + },
281 277  
282   - },
  278 + /**
  279 + * 生命周期函数--监听页面初次渲染完成
  280 + */
  281 + onReady: function () {
283 282  
284   - /**
285   - * 生命周期函数--监听页面隐藏
286   - */
287   - onHide: function () {
  283 + },
288 284  
289   - },
  285 + /**
  286 + * 生命周期函数--监听页面显示
  287 + */
  288 + onShow: function () {
290 289  
291   - /**
292   - * 生命周期函数--监听页面卸载
293   - */
294   - onUnload: function () {
  290 + },
295 291  
296   - },
  292 + /**
  293 + * 生命周期函数--监听页面隐藏
  294 + */
  295 + onHide: function () {
297 296  
298   - /**
299   - * 页面相关事件处理函数--监听用户下拉动作
300   - */
301   - onPullDownRefresh: function () {
  297 + },
302 298  
303   - },
  299 + /**
  300 + * 生命周期函数--监听页面卸载
  301 + */
  302 + onUnload: function () {
304 303  
305   - /**
306   - * 页面上拉触底事件的处理函数
307   - */
308   - onReachBottom: function () {
  304 + },
309 305  
310   - },
  306 + /**
  307 + * 页面相关事件处理函数--监听用户下拉动作
  308 + */
  309 + onPullDownRefresh: function () {
311 310  
312   - /**
313   - * 用户点击右上角分享
314   - */
315   - onShareAppMessage: function () {
  311 + },
  312 +
  313 + /**
  314 + * 页面上拉触底事件的处理函数
  315 + */
  316 + onReachBottom: function () {
  317 +
  318 + },
  319 +
  320 + /**
  321 + * 用户点击右上角分享
  322 + */
  323 + onShareAppMessage: function () {
  324 +
  325 + },
  326 +
  327 + /**
  328 + * get请求数据
  329 + */
  330 + get(url, data) {
  331 + app.request.get(url + '/' + data.store_id, {
  332 + success: function (res) {
  333 + if (res.data.code == 0) {
  334 + console.log('success~~~~~~~~~~~', res);
  335 + self.setData({
  336 + content: res.data.data.distriRule,
  337 + });
  338 + /**
  339 + * WxParse.wxParse(bindName , type, data, target,imagePadding)
  340 + * 1.bindName绑定的数据名(必填)
  341 + * 2.type可以为html或者md(必填)
  342 + * 3.data为传入的具体数据(必填)
  343 + * 4.target为Page对象,一般为this(必填)
  344 + * 5.imagePadding为当图片自适应是左右的单一padding(默认为0,可选)
  345 + */
  346 + WxParse.wxParse('content', 'html', self.data.content, self);
  347 + } else {
  348 + wx.showToast({
  349 + title: "网络繁忙,请重试",
  350 + icon: 'none',
  351 + duration: 2000
  352 + })
  353 + }
  354 + },
  355 + fail: function () {
  356 + },
  357 + });
  358 + },
316 359  
317   - },
318   -
319   - /**
320   - * get请求数据
321   - */
322   - get(url, data) {
323   - app.request.get(url + '/' + data.store_id, {
324   - success: function(res) {
325   - if(res.data.code == 0){
326   - console.log('success~~~~~~~~~~~',res);
327   - self.setData({
328   - content: res.data.data.distriRule,
329   - });
330   - /**
331   - * WxParse.wxParse(bindName , type, data, target,imagePadding)
332   - * 1.bindName绑定的数据名(必填)
333   - * 2.type可以为html或者md(必填)
334   - * 3.data为传入的具体数据(必填)
335   - * 4.target为Page对象,一般为this(必填)
336   - * 5.imagePadding为当图片自适应是左右的单一padding(默认为0,可选)
337   - */
338   - WxParse.wxParse('content', 'html', self.data.content, self);
339   - }else{
340   - wx.showToast({
341   - title: "网络繁忙,请重试",
342   - icon: 'none',
343   - duration: 2000
344   - })
345   - }
346   - },
347   - fail: function() {},
348   - });
349   - },
350   -
351 360 })
352 361 \ No newline at end of file
... ...
packageA/pages/profile/profile.js
... ... @@ -169,6 +169,8 @@ Page({
169 169 var index = th.data.sec_pick_index;
170 170 item = th.data.sec_sto.s_arr[index];
171 171 }
  172 +
  173 + if(!item) return false;
172 174 th.setData({
173 175 def_pick_store: item,
174 176 stoname: item.pickup_name,
... ... @@ -255,7 +257,7 @@ Page({
255 257 data: dd,
256 258 success:function(res){
257 259 var e = res;
258   - if (e.data.code == 0) {
  260 + if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length>0) {
259 261 //-- 如果有默认选择门店的时候,要把默认门店放在第一位 --
260 262 if (th.data.def_pick_store) {
261 263 for (var k = 0; k < e.data.data.pageData.length; k++) {
... ...
packageA/pages/profile/profile.wxss
... ... @@ -411,7 +411,6 @@ input {
411 411 background: white;
412 412 width: 100%;
413 413 border-radius: 20rpx 20rpx 0 0;
414   - height: 72%;
415 414 }
416 415  
417 416 .popup-top {
... ... @@ -452,7 +451,8 @@ input {
452 451  
453 452 .store-list {
454 453 width: 95%;
455   - height: 72%;
  454 + min-height: 300rpx;
  455 + max-height: 610rpx;
456 456 overflow-y: scroll;
457 457 margin: auto;
458 458 }
... ... @@ -506,7 +506,7 @@ input {
506 506 .store-bottom {
507 507 width: 85%;
508 508 margin: auto;
509   - height: 70rpx;
  509 + height: 90rpx;
510 510 }
511 511  
512 512 .determine {
... ...
packageA/pages/prom_list/prom_list.js
... ... @@ -722,7 +722,9 @@ Page({
722 722 get_sto(e) {
723 723 var th = this,that=this;
724 724 var timer_get = setInterval(function() {
725   - if (th.data.is_get_local_ok == 0) return false;
  725 + if (th.data.is_get_local_ok == 0) return false;
  726 + if(!th.data.data) return false;
  727 +
726 728 var dd = null,
727 729 c_list=th.data.collocationList,
728 730 i = getApp().request;
... ...
packageA/pages/prom_list/prom_list.wxml
... ... @@ -137,7 +137,7 @@
137 137 <view class="b_num">
138 138 <view>购买数量</view>
139 139 <view class="count">
140   - <view bindtap="subCartNum" class="sub">-</view>
  140 + <view bindtap="subCartNum" class="sub {{goodsInputNum<=1?'gray':''}}">-</view>
141 141 <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>
142 142 <view bindtap="addCartNum" class="add">+</view>
143 143 </view>
... ...
packageA/pages/prom_list/prom_list.wxss
... ... @@ -30,7 +30,6 @@
30 30 font-size: 32rpx;
31 31 box-sizing: border-box;
32 32 border-radius: 20rpx;
33   - height: 72%;
34 33 }
35 34  
36 35 .spec-model .pding{padding: 0 30rpx;}
... ... @@ -138,12 +137,10 @@
138 137 .spec-cart-btns {
139 138 width: 92%;
140 139 line-height: 70rpx;
141   - margin: 0rpx auto;
142   - margin-top: 160rpx;
  140 + margin-top: 40rpx;
  141 + margin-bottom: 20rpx;
143 142 border-radius: 20rpx;
144   - position: fixed;
145   - bottom: 50rpx;
146   - left: 4%;
  143 + margin-left: 4%;
147 144 }
148 145  
149 146 .spec-cart-btn {
... ... @@ -362,4 +359,5 @@
362 359 .join-cart>view.no_store {
363 360 width: 58%; background-color: #adadad;
364 361 }
365   -.no_store{color:#d60021; font-size: 26rpx;}
366 362 \ No newline at end of file
  363 +.no_store{color:#d60021; font-size: 26rpx;}
  364 +.gray{color: #ccc;}
367 365 \ No newline at end of file
... ...
packageB/images/luckDraw/badge.png 0 → 100644

2.86 KB

packageB/images/luckDraw/bg.png 0 → 100644

739 KB

packageB/images/luckDraw/coupon.png 0 → 100644

4.83 KB

packageB/images/luckDraw/czz.png 0 → 100644

7.21 KB

packageB/images/luckDraw/gift.png 0 → 100644

14.1 KB

packageB/images/luckDraw/jf.png 0 → 100644

23.8 KB

packageB/images/luckDraw/lb.png 0 → 100644

60 KB

packageB/images/luckDraw/logo.png 0 → 100644

1.51 KB

packageB/images/luckDraw/money.png 0 → 100644

6.63 KB

packageB/images/luckDraw/mr.png 0 → 100644

27.7 KB

packageB/images/luckDraw/mr1.png 0 → 100644

18.5 KB

packageB/images/luckDraw/pointer.png 0 → 100644

23.3 KB

packageB/images/luckDraw/weel.png 0 → 100644

69.5 KB

packageB/images/luckDraw/yhq.png 0 → 100644

19.1 KB

packageB/images/luckDraw/zp.png 0 → 100644

33.2 KB

packageB/miniprogram_npm/lucky-canvas/index.js 0 → 100644
  1 +module.exports = (function() {
  2 +var __MODS__ = {};
  3 +var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
  4 +var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
  5 +var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
  6 +var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
  7 +__DEFINE__(1625793648862, function(require, module, exports) {
  8 +module.exports = require('./dist/lucky-canvas.cjs.min.js')
  9 +
  10 +}, function(modId) {var map = {"./dist/lucky-canvas.cjs.min.js":1625793648863}; return __REQUIRE__(map[modId], modId); })
  11 +__DEFINE__(1625793648863, function(require, module, exports) {
  12 +Object.defineProperty(exports,"__esModule",{value:!0});
  13 +/*! *****************************************************************************
  14 +Copyright (c) Microsoft Corporation.
  15 +
  16 +Permission to use, copy, modify, and/or distribute this software for any
  17 +purpose with or without fee is hereby granted.
  18 +
  19 +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  20 +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  21 +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  22 +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  23 +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  24 +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  25 +PERFORMANCE OF THIS SOFTWARE.
  26 +***************************************************************************** */
  27 +var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};function e(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function n(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function r(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function o(t,e){for(var i=0,n=e.length,r=t.length;i<n;i++,r++)t[r]=e[i];return t}String.prototype.includes||(String.prototype.includes=function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var n=arguments[1],r=0;r<i;){var o=e[r];if(t.call(n,o,r,e))return o;r++}}});var s=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.some((function(e){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()===e}))},a=function(t){return[].filter.call(t,(function(t){return"\n"!==t})).join("")},u=function(t){if("string"!=typeof t)return!1;if("transparent"===(t=t.toLocaleLowerCase().trim()))return!1;if(/^rgba/.test(t)){var e=/([^\s,]+)\)$/.exec(t);if(0===(null===(i=e)?0:"object"==typeof i?NaN:"number"==typeof i?i:"string"==typeof i?"%"===i[i.length-1]?Number(i.slice(0,-1))/100:Number(i):NaN))return!1}var i;return!0},h=function(){function t(){this.subs=[]}return t.prototype.addSub=function(t){this.subs.includes(t)||this.subs.push(t)},t.prototype.notify=function(){this.subs.forEach((function(t){t.update()}))},t}(),c="__proto__"in{};function l(t,e,i,n){Object.defineProperty(t,e,{value:i,enumerable:!!n,writable:!0,configurable:!0})}var f=Array.prototype,d=Object.create(f);["push","pop","shift","unshift","sort","splice","reverse"].forEach((function(t){d[t]=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=f[t].apply(this,e),r=this.__luckyOb__;return["push","unshift","splice"].includes(t)&&r.walk(this),r.dep.notify(),n}}));var p=function(){function t(t){this.dep=new h,l(t,"__luckyOb__",this),Array.isArray(t)&&(c?t.__proto__=d:Object.getOwnPropertyNames(d).forEach((function(e){l(t,e,d[e])}))),this.walk(t)}return t.prototype.walk=function(t){Object.keys(t).forEach((function(e){m(t,e,t[e])}))},t}();function g(t){if(t&&"object"==typeof t)return"__luckyOb__"in t?t.__luckyOb__:new p(t)}function m(t,e,i){var n=new h,r=Object.getOwnPropertyDescriptor(t,e);if(!r||!1!==r.configurable){var o=r&&r.get,s=r&&r.set;o&&!s||2!==arguments.length||(i=t[e]);var a=g(i);Object.defineProperty(t,e,{get:function(){var e=o?o.call(t):i;return h.target&&(n.addSub(h.target),a&&a.dep.addSub(h.target)),e},set:function(e){e!==i&&(i=e,o&&!s||(s?s.call(t,e):i=e,a=g(e),n.notify()))}})}}var v=0,b=function(){function t(t,e,i,n){void 0===n&&(n={}),this.id=v++,this.$lucky=t,this.expr=e,this.deep=!!n.deep,this.getter="function"==typeof e?e:function(t){t+=".";for(var e=[],i="",n=0;n<t.length;n++){var r=t[n];if(/\[|\./.test(r))e.push(i),i="";else{if(/\W/.test(r))continue;i+=r}}return function(t){return e.reduce((function(t,e){return t[e]}),t)}}(e),this.cb=i,this.value=this.get()}return t.prototype.get=function(){h.target=this;var t=this.getter.call(this.$lucky,this.$lucky);return this.deep&&function(t){var e=function(t){s(t,"array","object")&&Object.keys(t).forEach((function(i){var n=t[i];e(n)}))};e(t)}(t),h.target=null,t},t.prototype.update=function(){var t=this.get(),e=this.value;this.value=t,this.cb.call(this.$lucky,t,e)},t}(),y=function(){function t(t){var e=this;this.htmlFontSize=16,this.rAF=function(){},this.boxWidth=0,this.boxHeight=0,this.setHTMLFontSize(),"string"==typeof t?t={el:t}:1===t.nodeType&&(t={el:"",divElement:t}),t=t,this.config=t,this.setDpr(),this.initWindowFunction(),t.flag||(t.flag="WEB"),Object.prototype.hasOwnProperty.call(t,"ob")||(t.ob=!0),t.el&&(t.divElement=document.querySelector(t.el)),t.divElement&&(t.canvasElement=document.createElement("canvas"),t.divElement.appendChild(t.canvasElement)),this.resetWidthAndHeight(),t.canvasElement&&(t.ctx=t.canvasElement.getContext("2d"),t.canvasElement.setAttribute("package","lucky-canvas@1.5.4"),t.canvasElement.addEventListener("click",(function(t){return e.handleClick(t)})),t.canvasElement.addEventListener("mousemove",(function(t){return e.handleMouseMove(t)})),t.canvasElement.addEventListener("mousedown",(function(t){return e.handleMouseDown(t)})),t.canvasElement.addEventListener("mouseup",(function(t){return e.handleMouseUp(t)}))),this.ctx=t.ctx,t.ctx?this.boxWidth&&this.boxHeight||console.error("无法获取到宽度或高度"):console.error("无法获取到 CanvasContext2D")}return t.prototype.init=function(t){this.setDpr(),this.setHTMLFontSize(),this.resetWidthAndHeight(),this.zoomCanvas()},t.prototype.handleClick=function(t){},t.prototype.handleMouseDown=function(t){},t.prototype.handleMouseUp=function(t){},t.prototype.handleMouseMove=function(t){},t.prototype.conversionAxis=function(t,e){return[0,0]},t.prototype.setDpr=function(){var t=this.config;t.dpr||(window?window.dpr=t.dpr=window.devicePixelRatio||1:t.dpr||console.error(t,"未传入 dpr 可能会导致绘制异常"))},t.prototype.setHTMLFontSize=function(){window&&(this.htmlFontSize=+window.getComputedStyle(document.documentElement).fontSize.slice(0,-2))},t.prototype.resetWidthAndHeight=function(){var t=this.config,e=0,i=0;t.divElement&&(e=t.divElement.offsetWidth,i=t.divElement.offsetHeight),this.boxWidth=this.getLength(t.width)||e,this.boxHeight=this.getLength(t.height)||i,t.divElement&&(t.divElement.style.overflow="hidden",t.divElement.style.width=this.boxWidth+"px",t.divElement.style.height=this.boxHeight+"px")},t.prototype.initWindowFunction=function(){var t=this.config;if(window)return this.rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},t.setTimeout=window.setTimeout,t.setInterval=window.setInterval,t.clearTimeout=window.clearTimeout,void(t.clearInterval=window.clearInterval);if(t.rAF)this.rAF=t.rAF;else if(t.setTimeout){var e=t.setTimeout;this.rAF=function(t){return e(t,16.7)}}else this.rAF=function(t){return setTimeout(t,16.7)}},t.prototype.zoomCanvas=function(){var t=this.config,e=this.ctx,i=t.canvasElement,n=t.dpr,r=[this.boxWidth*n,this.boxHeight*n],o=r[0],s=r[1],a=function(t){return(t*n-t)/(t*n)*(n/2)*100};i&&(i.width=o,i.height=s,i.style.width=o+"px",i.style.height=s+"px",i.style.transform="scale("+1/n+") translate("+-a(o)+"%, "+-a(s)+"%)",e.scale(n,n))},t.prototype.loadImg=function(t,e,i){var n=this;return void 0===i&&(i="$resolve"),new Promise((function(r,o){if(t||o("=> '"+e.src+"' 不能为空或不合法"),"WEB"===n.config.flag){var s=new Image;s.src=t,s.onload=function(){return r(s)},s.onerror=function(){return o("=> '"+e.src+"' 图片加载失败")}}else e[i]=r}))},t.prototype.drawImage=function(t,e,i,n,r){var o,s=this.config,a=this.ctx;return["WEB","MP-WX"].includes(s.flag)?o=t:["UNI-H5","UNI-MP","TARO-H5","TARO-MP"].includes(s.flag)&&(o=t.path),a.drawImage(o,e,i,n,r)},t.prototype.getLength=function(t){return s(t,"number")?t:s(t,"string")?this.changeUnits(t):0},t.prototype.changeUnits=function(t,e){var i=this;return void 0===e&&(e=1),Number(t.replace(/^([-]*[0-9.]*)([a-z%]*)$/,(function(t,n,r){var o={"%":function(t){return t*(e/100)},px:function(t){return 1*t},rem:function(t){return t*i.htmlFontSize}}[r];if(o)return o(n);var s=i.config.unitFunc;return s?s(n,r):n})))},t.prototype.$set=function(t,e,i){t&&"object"==typeof t&&m(t,e,i)},t.prototype.$computed=function(t,e,i){var n=this;Object.defineProperty(t,e,{get:function(){return i.call(n)}})},t.prototype.$watch=function(t,e,i){void 0===i&&(i={}),"object"==typeof e&&(e=(i=e).handler);var n=new b(this,t,e,i);return i.immediate&&e.call(this,n.value),function(){}},t}(),w=function(t){return Math.PI/180*t},x=function(t,e){return[+(Math.cos(t)*e).toFixed(8),+(Math.sin(t)*e).toFixed(8)]},z=function(t,e){var i=-t/e;return[i,-i*t+e]},I=function(t,e,i,n,r,o){var s;if(void 0===o&&(o=!0),Math.abs(r-n).toFixed(8)>=w(180).toFixed(8)){var a=(r+n)/2;return o?(I(t,e,i,n,a,o),I(t,e,i,a,r,o)):(I(t,e,i,a,r,o),I(t,e,i,n,a,o)),!1}o||(n=(s=[r,n])[0],r=s[1]);var u=x(n,i),h=u[0],c=u[1],l=x(r,i),f=l[0],d=l[1],p=z(h,c),g=p[0],m=p[1],v=z(f,d),b=v[0],y=v[1],k=(y-m)/(g-b),S=(b*m-g*y)/(b-g);isNaN(k)&&(Math.abs(h)===+i.toFixed(8)&&(k=h),Math.abs(f)===+i.toFixed(8)&&(k=f)),g===1/0||g===-1/0?S=b*k+y:b!==1/0&&b!==-1/0||(S=g*k+m),e.lineTo(h,c),t.indexOf("MP")>0?e.quadraticCurveTo(k,S,f,d):e.arcTo(k,S,f,d,i)},k=function(t,e,i,n,r,o,s,a){i||(i=s);var u=w(90/Math.PI/n*s),h=w(90/Math.PI/i*s),c=r+u,l=o-u,f=r+h,d=o-h;e.beginPath(),e.fillStyle=a,e.moveTo.apply(e,x(c,n)),I(t,e,n,c,l,!0),d>f?I(t,e,i,f,d,!1):e.lineTo.apply(e,x((r+o)/2,s/2/Math.abs(Math.sin((r-o)/2)))),e.closePath(),e.fill()},S=function(t,e,i,n,r,o,s){var a=Math.min(n,r);o>a/2&&(o=a/2),t.beginPath(),t.fillStyle=s,t.moveTo(e+o,i),t.lineTo(e+o,i),t.lineTo(e+n-o,i),t.quadraticCurveTo(e+n,i,e+n,i+o),t.lineTo(e+n,i+r-o),t.quadraticCurveTo(e+n,i+r,e+n-o,i+r),t.lineTo(e+o,i+r),t.quadraticCurveTo(e,i+r,e,i+r-o),t.lineTo(e,i+o),t.quadraticCurveTo(e,i,e+o,i),t.closePath(),t.fill()},C={easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*(t/=n)*(t-2)+e}},T={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*Math.cos(t/n*(Math.PI/2))+i+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sin(t/n*(Math.PI/2))+e}},W={easeIn:function(t,e,i,n){return t>=n&&(t=n),0==t?e:i*Math.pow(2,10*(t/n-1))+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),t==n?e+i:i*(1-Math.pow(2,-10*t/n))+e}},O={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*(Math.sqrt(1-(t/=n)*t)-1)+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sqrt(1-(t=t/n-1)*t)+e}},_=Object.freeze({__proto__:null,quad:C,cubic:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t+1)+e}},quart:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*((t=t/n-1)*t*t*t-1)+e}},quint:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t*t*t+1)+e}},sine:T,expo:W,circ:O}),E=function(t){function o(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;return r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:"0px",offsetDegree:0,speed:20,speedFunction:"quad",accelerationTime:2500,decelerationTime:2500,stopRange:.8},r.defaultStyle={},r._defaultStyle={fontSize:"18px",fontColor:"#000",fontStyle:"sans-serif",fontWeight:"400",lineHeight:"",background:"rgba(0,0,0,0)",wordWrap:!0,lengthLimit:"90%"},r.Radius=0,r.prizeRadius=0,r.prizeDeg=0,r.prizeRadian=0,r.rotateDeg=0,r.maxBtnRadius=0,r.startTime=0,r.endTime=0,r.stopDeg=0,r.endDeg=0,r.FPS=16.6,r.blockImgs=[[]],r.prizeImgs=[[]],r.btnImgs=[[]],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:r.buttons.map((function(t){return t.imgs}))}),r}return e(o,t),o.prototype.initData=function(t){this.$set(this,"blocks",t.blocks||[]),this.$set(this,"prizes",t.prizes||[]),this.$set(this,"buttons",t.buttons||[]),this.$set(this,"defaultConfig",t.defaultConfig||{}),this.$set(this,"defaultStyle",t.defaultStyle||{}),this.$set(this,"startCallback",t.start),this.$set(this,"endCallback",t.end)},o.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",(function(){return i({gutter:"0px",offsetDegree:0,speed:20,speedFunction:"quad",accelerationTime:2500,decelerationTime:2500,stopRange:.8},t.defaultConfig)})),this.$computed(this,"_defaultStyle",(function(){return i({fontSize:"18px",fontColor:"#000",fontStyle:"sans-serif",fontWeight:"400",background:"rgba(0,0,0,0)",wordWrap:!0,lengthLimit:"90%"},t.defaultStyle)}))},o.prototype.initWatch=function(){var t=this;this.$watch("blocks",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("prizes",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("buttons",(function(e){return t.init({btnImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("defaultConfig",(function(){return t.draw()}),{deep:!0}),this.$watch("defaultStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("startCallback",(function(){return t.init({})})),this.$watch("endCallback",(function(){return t.init({})}))},o.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this.config,s=this.ctx;this.Radius=Math.min(this.boxWidth,this.boxHeight)/2,null===(i=o.beforeInit)||void 0===i||i.call(this),s.translate(this.Radius,this.Radius),this.draw(),this.draw(),Object.keys(e).forEach((function(t){var i=t,n={blockImgs:"blocks",prizeImgs:"prizes",btnImgs:"buttons"}[i],o=e[i];o&&o.forEach((function(t,e){t&&t.forEach((function(t,o){r.loadAndCacheImg(n,e,i,o,(function(){r.draw()}))}))}))})),null===(n=o.afterInit)||void 0===n||n.call(this)},o.prototype.handleClick=function(t){var e,i=this.ctx;i.beginPath(),i.arc(0,0,this.maxBtnRadius,0,2*Math.PI,!1),i.isPointInPath(t.offsetX,t.offsetY)&&(this.startTime||null===(e=this.startCallback)||void 0===e||e.call(this,t))},o.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u=this;return r(this,(function(r){return(n=this[t][e])&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),this.loadImg(a.src,a).then((function(t){u[i][e][o]=t,s.call(u)})).catch((function(i){console.error(t+"["+e+"].imgs["+o+"] "+i)})),[2]):[2]}))}))},o.prototype.computedWidthAndHeight=function(t,e,i,n){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var r=this.getWidth(e.width,i);return[r,t.height*(r/t.width)]}if(!e.width&&e.height){var o=this.getHeight(e.height,n);return[t.width*(o/t.height),o]}return[this.getWidth(e.width,i),this.getHeight(e.height,n)]},o.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,o=n.ctx,s=n._defaultConfig,h=n._defaultStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,o),o.clearRect(-this.Radius,-this.Radius,2*this.Radius,2*this.Radius),this.prizeRadius=this.blocks.reduce((function(t,e,n){return u(e.background)&&(o.beginPath(),o.fillStyle=e.background,o.arc(0,0,t,0,2*Math.PI,!1),o.fill()),e.imgs&&e.imgs.forEach((function(e,r){if(i.blockImgs[n]){var s=i.blockImgs[n][r];if(s){var a=i.computedWidthAndHeight(s,e,2*t,2*t),u=a[0],h=a[1],c=[i.getOffsetX(u),i.getHeight(e.top,2*t)-t],l=c[0],f=c[1];o.save(),e.rotate&&o.rotate(w(i.rotateDeg)),i.drawImage(s,l,f,u,h),o.restore()}}})),t-i.getLength(e.padding&&e.padding.split(" ")[0])}),this.Radius),this.prizeDeg=360/this.prizes.length,this.prizeRadian=w(this.prizeDeg);var c=w(-90+this.rotateDeg+s.offsetDegree),l=function(t){return i.getOffsetX(o.measureText(t).width)},f=function(t,e,n){var r=t.lineHeight||h.lineHeight||t.fontSize||h.fontSize;return i.getHeight(t.top,e)+(n+1)*i.getLength(r)};o.save(),this.prizes.forEach((function(t,e){var n=c+e*i.prizeRadian,d=i.prizeRadius-i.maxBtnRadius,p=t.background||h.background;u(p)&&function(t,e,i,n,r,o,s,a){s?k(t,e,i,n,r,o,s,a):(e.beginPath(),e.fillStyle=a,e.moveTo(0,0),e.arc(0,0,n,r,o,!1),e.closePath(),e.fill())}(r.flag,o,i.maxBtnRadius,i.prizeRadius,n-i.prizeRadian/2,n+i.prizeRadian/2,i.getLength(s.gutter),p);var g=Math.cos(n)*i.prizeRadius,m=Math.sin(n)*i.prizeRadius;o.translate(g,m),o.rotate(n+w(90)),t.imgs&&t.imgs.forEach((function(t,n){if(i.prizeImgs[e]){var r=i.prizeImgs[e][n];if(r){var o=i.computedWidthAndHeight(r,t,i.prizeRadian*i.prizeRadius,d),s=o[0],a=o[1],u=[i.getOffsetX(s),i.getHeight(t.top,d)],h=u[0],c=u[1];i.drawImage(r,h,c,s,a)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,n=t.fontWeight||h.fontWeight,r=i.getLength(t.fontSize||h.fontSize),u=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=n+" "+(r>>0)+"px "+u;var c=[],p=String(t.text);if(Object.prototype.hasOwnProperty.call(t,"wordWrap")?t.wordWrap:h.wordWrap){p=a(p);for(var g="",m=0;m<p.length;m++){g+=p[m];var v=o.measureText(g).width,b=(i.prizeRadius-f(t,d,c.length))*Math.tan(i.prizeRadian/2)*2-i.getLength(s.gutter);v>i.getWidth(t.lengthLimit||h.lengthLimit,b)&&(c.push(g.slice(0,-1)),g=p[m])}g&&c.push(g),c.length||c.push(p)}else c=p.split("\n");c.filter((function(t){return!!t})).forEach((function(e,i){o.fillText(e,l(e),f(t,d,i))}))})),o.rotate(w(360)-n-w(90)),o.translate(-g,-m)})),o.restore(),this.buttons.forEach((function(t,e){var n=i.getHeight(t.radius);i.maxBtnRadius=Math.max(i.maxBtnRadius,n),u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.arc(0,0,n,0,2*Math.PI,!1),o.fill()),t.pointer&&u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.moveTo(-n,0),o.lineTo(n,0),o.lineTo(0,2*-n),o.closePath(),o.fill()),t.imgs&&t.imgs.forEach((function(t,r){if(i.btnImgs[e]){var o=i.btnImgs[e][r];if(o){var s=i.computedWidthAndHeight(o,t,2*n,2*n),a=s[0],u=s[1],h=[i.getOffsetX(a),i.getHeight(t.top,n)],c=h[0],l=h[1];i.drawImage(o,c,l,a,u)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,r=t.fontWeight||h.fontWeight,s=i.getLength(t.fontSize||h.fontSize),a=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=r+" "+(s>>0)+"px "+a,String(t.text).split("\n").forEach((function(e,i){o.fillText(e,l(e),f(t,n,i))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,o)},o.prototype.play=function(){this.startTime||(this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},o.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.rotateDeg=this.prizeDeg/2-this._defaultConfig.offsetDegree,this.draw())},o.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.prizeFlag,r=e.prizeDeg,o=e.rotateDeg,s=e._defaultConfig,a=Date.now()-this.startTime;if(a>=s.accelerationTime&&void 0!==n){this.FPS=a/t,this.endTime=Date.now(),this.stopDeg=o;for(var u=(Math.random()*r-r/2)*this.getLength(s.stopRange),h=0;++h;){var c=360*h-n*r-o-s.offsetDegree+u;if(_[s.speedFunction].easeOut(this.FPS,this.stopDeg,c,s.decelerationTime)-this.stopDeg>s.speed){this.endDeg=c;break}}return this.slowDown()}this.rotateDeg=(o+_[s.speedFunction].easeIn(a,0,s.speed,s.accelerationTime))%360,this.draw(),i(this.run.bind(this,t+1))},o.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopDeg,a=e.endDeg,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>=u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.rotateDeg=_[u.speedFunction].easeOut(h,s,a,u.decelerationTime)%360,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},o.prototype.getWidth=function(t,e){return void 0===e&&(e=this.prizeRadian*this.prizeRadius),s(t,"number")?t:s(t,"string")?this.changeUnits(t,e):0},o.prototype.getHeight=function(t,e){return void 0===e&&(e=this.prizeRadius),s(t,"number")?t:s(t,"string")?this.changeUnits(t,e):0},o.prototype.getOffsetX=function(t){return-t/2},o.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr-this.Radius,e/i.dpr-this.Radius]},o}(y),P=function(t){function h(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;r.rows=3,r.cols=3,r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},r.defaultStyle={},r._defaultStyle={borderRadius:20,fontColor:"#000",fontSize:"18px",fontStyle:"sans-serif",fontWeight:"400",lineHeight:"",background:"rgba(0,0,0,0)",shadow:"",wordWrap:!0,lengthLimit:"90%"},r.activeStyle={},r._activeStyle={background:"#ffce98",shadow:"",fontStyle:"",fontWeight:"",fontSize:"",lineHeight:"",fontColor:""},r.cellWidth=0,r.cellHeight=0,r.startTime=0,r.endTime=0,r.currIndex=0,r.stopIndex=0,r.endIndex=0,r.demo=!1,r.timer=0,r.FPS=16.6,r.prizeFlag=-1,r.cells=[],r.blockImgs=[[]],r.btnImgs=[[]],r.prizeImgs=[],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r);var o=r.buttons.map((function(t){return t.imgs}));return r.button&&o.push(r.button.imgs),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:o}),r}return e(h,t),h.prototype.initData=function(t){this.$set(this,"rows",Number(t.rows)||3),this.$set(this,"cols",Number(t.cols)||3),this.$set(this,"blocks",t.blocks||[]),this.$set(this,"prizes",t.prizes||[]),this.$set(this,"buttons",t.buttons||[]),this.$set(this,"button",t.button),this.$set(this,"defaultConfig",t.defaultConfig||{}),this.$set(this,"defaultStyle",t.defaultStyle||{}),this.$set(this,"activeStyle",t.activeStyle||{}),this.$set(this,"startCallback",t.start),this.$set(this,"endCallback",t.end)},h.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",(function(){var e=i({gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},t.defaultConfig);return e.gutter=t.getLength(e.gutter),e.speed=e.speed/40,e})),this.$computed(this,"_defaultStyle",(function(){return i({borderRadius:20,fontColor:"#000",fontSize:"18px",fontStyle:"sans-serif",fontWeight:"400",background:"rgba(0,0,0,0)",shadow:"",wordWrap:!0,lengthLimit:"90%"},t.defaultStyle)})),this.$computed(this,"_activeStyle",(function(){return i({background:"#ffce98",shadow:""},t.activeStyle)}))},h.prototype.initWatch=function(){var t=this;this.$watch("blocks",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("prizes",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("buttons",(function(e){var i=e.map((function(t){return t.imgs}));return t.button&&i.push(t.button.imgs),t.init({btnImgs:i})}),{deep:!0}),this.$watch("button",(function(){var e=t.buttons.map((function(t){return t.imgs}));return t.button&&e.push(t.button.imgs),t.init({btnImgs:e})}),{deep:!0}),this.$watch("rows",(function(){return t.init({})})),this.$watch("cols",(function(){return t.init({})})),this.$watch("defaultConfig",(function(){return t.draw()}),{deep:!0}),this.$watch("defaultStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("activeStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("startCallback",(function(){return t.init({})})),this.$watch("endCallback",(function(){return t.init({})}))},h.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this,s=o.config;o.ctx,o.button,null===(i=s.beforeInit)||void 0===i||i.call(this),this.draw(),Object.keys(e).forEach((function(t){var i=t,n=e[i],o={blockImgs:"blocks",prizeImgs:"prizes",btnImgs:"buttons"}[i];n&&n.forEach((function(t,e){t&&t.forEach((function(t,n){r.loadAndCacheImg(o,e,i,n,(function(){r.draw()}))}))}))})),null===(n=s.afterInit)||void 0===n||n.call(this)},h.prototype.handleClick=function(t){var e=this,i=this.ctx;o(o([],this.buttons),[this.button]).forEach((function(n){var r;if(n){var o=e.getGeometricProperty([n.x,n.y,n.col||1,n.row||1]),s=o[0],a=o[1],u=o[2],h=o[3];i.beginPath(),i.rect(s,a,u,h),i.isPointInPath(t.offsetX,t.offsetY)&&(e.startTime||("function"==typeof n.callback&&n.callback.call(e,n),null===(r=e.startCallback)||void 0===r||r.call(e,t,n)))}}))},h.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u,h=this;return r(this,(function(r){return n=this[t][e],"buttons"===t&&!this.buttons.length&&this.button&&(n=this.button),n&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),u=[this.loadImg(a.src,a),a.activeSrc&&this.loadImg(a.activeSrc,a,"$activeResolve")],Promise.all(u).then((function(t){var n=t[0],r=t[1];h[i][e][o]={defaultImg:n,activeImg:r},s.call(h)})).catch((function(i){console.error(t+"["+e+"].imgs["+o+"] "+i)})),[2]):[2]}))}))},h.prototype.computedWidthAndHeight=function(t,e,i){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var n=this.getWidth(e.width,i.col);return[n,t.height*(n/t.width)]}if(!e.width&&e.height){var r=this.getHeight(e.height,i.row);return[t.width*(r/t.height),r]}return[this.getWidth(e.width,i.col),this.getHeight(e.height,i.row)]},h.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,h=n.ctx,c=n._defaultConfig,l=n._defaultStyle,f=n._activeStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,h),h.clearRect(0,0,this.boxWidth,this.boxHeight),this.cells=o(o([],this.prizes),this.buttons),this.button&&this.cells.push(this.button),this.cells.forEach((function(t){t.col=t.col||1,t.row=t.row||1})),this.prizeArea=this.blocks.reduce((function(t,e){var n=t.x,r=t.y,o=t.w,a=t.h,c=function(t){var e,i=(null===(e=t.padding)||void 0===e?void 0:e.replace(/px/g,"").split(" ").map((function(t){return~~t})))||[0],n=0,r=0,o=0,a=0;switch(i.length){case 1:n=r=o=a=i[0];break;case 2:n=r=i[0],o=a=i[1];break;case 3:n=i[0],o=a=i[1],r=i[2];break;default:n=i[0],r=i[1],o=i[2],a=i[3]}var u={paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:a};for(var h in u)u[h]=Object.prototype.hasOwnProperty.call(t,h)&&s(t[h],"string","number")?~~String(t[h]).replace(/px/g,""):u[h];return[n,r,o,a]}(e),f=c[0],d=c[1],p=c[2],g=c[3],m=e.borderRadius?i.getLength(e.borderRadius):0,v=e.background||l.background;return u(v)&&S(h,n,r,o,a,m,i.handleBackground(n,r,o,a,v)),{x:n+p,y:r+f,w:o-p-g,h:a-f-d}}),{x:0,y:0,w:this.boxWidth,h:this.boxHeight}),this.cellWidth=(this.prizeArea.w-c.gutter*(this.cols-1))/this.cols,this.cellHeight=(this.prizeArea.h-c.gutter*(this.rows-1))/this.rows,this.cells.forEach((function(t,e){var n=i.getGeometricProperty([t.x,t.y,t.col,t.row]),o=n[0],s=n[1],c=n[2],d=n[3],p=!1;(void 0===i.prizeFlag||i.prizeFlag>-1)&&(p=e===i.currIndex%i.prizes.length>>0);var g=p?f.background:t.background||l.background;if(u(g)){var m=(p?f.shadow:t.shadow||l.shadow).replace(/px/g,"").split(",")[0].split(" ").map((function(t,e){return e<3?Number(t):t}));4===m.length&&(h.shadowColor=m[3],h.shadowOffsetX=m[0]*r.dpr,h.shadowOffsetY=m[1]*r.dpr,h.shadowBlur=m[2],m[0]>0?c-=m[0]:(c+=m[0],o-=m[0]),m[1]>0?d-=m[1]:(d+=m[1],s-=m[1])),S(h,o,s,c,d,i.getLength(t.borderRadius?t.borderRadius:l.borderRadius),i.handleBackground(o,s,c,d,g)),h.shadowColor="rgba(0, 0, 0, 0)",h.shadowOffsetX=0,h.shadowOffsetY=0,h.shadowBlur=0}var v="prizeImgs";e>=i.prizes.length&&(v="btnImgs",e-=i.prizes.length),t.imgs&&t.imgs.forEach((function(n,r){if(i[v][e]){var a=i[v][e][r];if(a){var u=p&&a.activeImg||a.defaultImg;if(u){var h=i.computedWidthAndHeight(u,n,t),c=h[0],l=h[1],f=[o+i.getOffsetX(c,t.col),s+i.getHeight(n.top,t.row)],d=f[0],g=f[1];i.drawImage(u,d,g,c,l)}}}})),t.fonts&&t.fonts.forEach((function(e){var n=p&&f.fontStyle?f.fontStyle:e.fontStyle||l.fontStyle,r=p&&f.fontWeight?f.fontWeight:e.fontWeight||l.fontWeight,u=p&&f.fontSize?i.getLength(f.fontSize):i.getLength(e.fontSize||l.fontSize),c=p&&f.lineHeight?f.lineHeight:e.lineHeight||l.lineHeight||e.fontSize||l.fontSize;h.font=r+" "+(u>>0)+"px "+n,h.fillStyle=p&&f.fontColor?f.fontColor:e.fontColor||l.fontColor;var d=[],g=String(e.text);if(Object.prototype.hasOwnProperty.call(e,"wordWrap")?e.wordWrap:l.wordWrap){g=a(g);for(var m="",v=0;v<g.length;v++){m+=g[v],h.measureText(m).width>i.getWidth(e.lengthLimit||l.lengthLimit,t.col)&&(d.push(m.slice(0,-1)),m=g[v])}m&&d.push(m),d.length||d.push(g)}else d=g.split("\n");d.forEach((function(n,r){h.fillText(n,o+i.getOffsetX(h.measureText(n).width,t.col),s+i.getHeight(e.top,t.row)+(r+1)*i.getLength(c))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,h)},h.prototype.handleBackground=function(t,e,i,n,r){var o=this.ctx;return r.includes("linear-gradient")&&(r=function(t,e,i,n,r,o){var s=/linear-gradient\((.+)\)/.exec(o)[1].split(",").map((function(t){return t.trim()})),a=s.shift(),u=[0,0,0,0];if(a.includes("deg")){var h=function(t){return Math.tan(t/180*Math.PI)};(a=a.slice(0,-3)%360)>=0&&a<45?u=[e,i+r,e+n,i+r-n*h(a-0)]:a>=45&&a<90?u=[e,i+r,e+n-r*h(a-45),i]:a>=90&&a<135?u=[e+n,i+r,e+n-r*h(a-90),i]:a>=135&&a<180?u=[e+n,i+r,e,i+n*h(a-135)]:a>=180&&a<225?u=[e+n,i,e,i+n*h(a-180)]:a>=225&&a<270?u=[e+n,i,e+r*h(a-225),i+r]:a>=270&&a<315?u=[e,i,e+r*h(a-270),i+r]:a>=315&&a<360&&(u=[e,i,e+n,i+r-n*h(a-315)])}else a.includes("top")?u=[e,i+r,e,i]:a.includes("bottom")?u=[e,i,e,i+r]:a.includes("left")?u=[e+n,i,e,i]:a.includes("right")&&(u=[e,i,e+n,i]);var c=t.createLinearGradient.apply(t,u.map((function(t){return t>>0})));return s.reduce((function(t,e,i){var n=e.split(" ");return 1===n.length?t.addColorStop(i,n[0]):2===n.length&&t.addColorStop.apply(t,n),t}),c)}(o,t,e,i,n,r)),r},h.prototype.play=function(){var t=this.config.clearInterval;this.startTime||(t(this.timer),this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},h.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.currIndex=0,this.draw())},h.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.currIndex,r=e.prizes,o=e.prizeFlag,s=e.startTime,a=e._defaultConfig,u=Date.now()-s;if(u>=a.accelerationTime&&void 0!==o){this.FPS=u/t,this.endTime=Date.now(),this.stopIndex=n;for(var h=0;++h;){var c=r.length*h+o-(n>>0);if(C.easeOut(this.FPS,this.stopIndex,c,a.decelerationTime)-this.stopIndex>a.speed){this.endIndex=c;break}}return this.slowDown()}this.currIndex=(n+C.easeIn(u,.1,a.speed,a.accelerationTime))%r.length,this.draw(),i(this.run.bind(this,t+1))},h.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopIndex,a=e.endIndex,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.currIndex=C.easeOut(h,s,a,u.decelerationTime)%r.length,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},h.prototype.walk=function(){var t=this,e=this.config,i=e.setInterval;(0,e.clearInterval)(this.timer),this.timer=i((function(){t.currIndex+=1,t.draw()}),1300)},h.prototype.getGeometricProperty=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=this.cellWidth,s=this.cellHeight,a=this._defaultConfig.gutter,u=[this.prizeArea.x+(o+a)*e,this.prizeArea.y+(s+a)*i];return n&&r&&u.push(o*n+a*(n-1),s*r+a*(r-1)),u},h.prototype.getWidth=function(t,e){return void 0===e&&(e=1),s(t,"number")?t:s(t,"string")?this.changeUnits(t,this.cellWidth*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getHeight=function(t,e){return void 0===e&&(e=1),s(t,"number")?t:s(t,"string")?this.changeUnits(t,this.cellHeight*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getOffsetX=function(t,e){return void 0===e&&(e=1),(this.cellWidth*e+this._defaultConfig.gutter*(e-1)-t)/2},h.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr,e/i.dpr]},h}(y);exports.LuckyGrid=P,exports.LuckyWheel=E;
  28 +
  29 +}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
  30 +return __REQUIRE__(1625793648862);
  31 +})()
  32 +//miniprogram-npm-outsideDeps=[]
  33 +//# sourceMappingURL=index.js.map
0 34 \ No newline at end of file
... ...
packageB/miniprogram_npm/lucky-canvas/index.js.map 0 → 100644
  1 +{"version":3,"sources":["index.js","dist/lucky-canvas.cjs.min.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["module.exports = require('./dist/lucky-canvas.cjs.min.js')\r\n","Object.defineProperty(exports,\"__esModule\",{value:!0});\n/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\nvar t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};function e(e,i){if(\"function\"!=typeof i&&null!==i)throw new TypeError(\"Class extends value \"+String(i)+\" is not a constructor or null\");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function n(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function r(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError(\"Generator is already executing.\");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function o(t,e){for(var i=0,n=e.length,r=t.length;i<n;i++,r++)t[r]=e[i];return t}String.prototype.includes||(String.prototype.includes=function(t,e){return\"number\"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),Array.prototype.find||Object.defineProperty(Array.prototype,\"find\",{value:function(t){if(null==this)throw new TypeError('\"this\" is null or not defined');var e=Object(this),i=e.length>>>0;if(\"function\"!=typeof t)throw new TypeError(\"predicate must be a function\");for(var n=arguments[1],r=0;r<i;){var o=e[r];if(t.call(n,o,r,e))return o;r++}}});var s=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.some((function(e){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()===e}))},a=function(t){return[].filter.call(t,(function(t){return\"\\n\"!==t})).join(\"\")},u=function(t){if(\"string\"!=typeof t)return!1;if(\"transparent\"===(t=t.toLocaleLowerCase().trim()))return!1;if(/^rgba/.test(t)){var e=/([^\\s,]+)\\)$/.exec(t);if(0===(null===(i=e)?0:\"object\"==typeof i?NaN:\"number\"==typeof i?i:\"string\"==typeof i?\"%\"===i[i.length-1]?Number(i.slice(0,-1))/100:Number(i):NaN))return!1}var i;return!0},h=function(){function t(){this.subs=[]}return t.prototype.addSub=function(t){this.subs.includes(t)||this.subs.push(t)},t.prototype.notify=function(){this.subs.forEach((function(t){t.update()}))},t}(),c=\"__proto__\"in{};function l(t,e,i,n){Object.defineProperty(t,e,{value:i,enumerable:!!n,writable:!0,configurable:!0})}var f=Array.prototype,d=Object.create(f);[\"push\",\"pop\",\"shift\",\"unshift\",\"sort\",\"splice\",\"reverse\"].forEach((function(t){d[t]=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=f[t].apply(this,e),r=this.__luckyOb__;return[\"push\",\"unshift\",\"splice\"].includes(t)&&r.walk(this),r.dep.notify(),n}}));var p=function(){function t(t){this.dep=new h,l(t,\"__luckyOb__\",this),Array.isArray(t)&&(c?t.__proto__=d:Object.getOwnPropertyNames(d).forEach((function(e){l(t,e,d[e])}))),this.walk(t)}return t.prototype.walk=function(t){Object.keys(t).forEach((function(e){m(t,e,t[e])}))},t}();function g(t){if(t&&\"object\"==typeof t)return\"__luckyOb__\"in t?t.__luckyOb__:new p(t)}function m(t,e,i){var n=new h,r=Object.getOwnPropertyDescriptor(t,e);if(!r||!1!==r.configurable){var o=r&&r.get,s=r&&r.set;o&&!s||2!==arguments.length||(i=t[e]);var a=g(i);Object.defineProperty(t,e,{get:function(){var e=o?o.call(t):i;return h.target&&(n.addSub(h.target),a&&a.dep.addSub(h.target)),e},set:function(e){e!==i&&(i=e,o&&!s||(s?s.call(t,e):i=e,a=g(e),n.notify()))}})}}var v=0,b=function(){function t(t,e,i,n){void 0===n&&(n={}),this.id=v++,this.$lucky=t,this.expr=e,this.deep=!!n.deep,this.getter=\"function\"==typeof e?e:function(t){t+=\".\";for(var e=[],i=\"\",n=0;n<t.length;n++){var r=t[n];if(/\\[|\\./.test(r))e.push(i),i=\"\";else{if(/\\W/.test(r))continue;i+=r}}return function(t){return e.reduce((function(t,e){return t[e]}),t)}}(e),this.cb=i,this.value=this.get()}return t.prototype.get=function(){h.target=this;var t=this.getter.call(this.$lucky,this.$lucky);return this.deep&&function(t){var e=function(t){s(t,\"array\",\"object\")&&Object.keys(t).forEach((function(i){var n=t[i];e(n)}))};e(t)}(t),h.target=null,t},t.prototype.update=function(){var t=this.get(),e=this.value;this.value=t,this.cb.call(this.$lucky,t,e)},t}(),y=function(){function t(t){var e=this;this.htmlFontSize=16,this.rAF=function(){},this.boxWidth=0,this.boxHeight=0,this.setHTMLFontSize(),\"string\"==typeof t?t={el:t}:1===t.nodeType&&(t={el:\"\",divElement:t}),t=t,this.config=t,this.setDpr(),this.initWindowFunction(),t.flag||(t.flag=\"WEB\"),Object.prototype.hasOwnProperty.call(t,\"ob\")||(t.ob=!0),t.el&&(t.divElement=document.querySelector(t.el)),t.divElement&&(t.canvasElement=document.createElement(\"canvas\"),t.divElement.appendChild(t.canvasElement)),this.resetWidthAndHeight(),t.canvasElement&&(t.ctx=t.canvasElement.getContext(\"2d\"),t.canvasElement.setAttribute(\"package\",\"lucky-canvas@1.5.4\"),t.canvasElement.addEventListener(\"click\",(function(t){return e.handleClick(t)})),t.canvasElement.addEventListener(\"mousemove\",(function(t){return e.handleMouseMove(t)})),t.canvasElement.addEventListener(\"mousedown\",(function(t){return e.handleMouseDown(t)})),t.canvasElement.addEventListener(\"mouseup\",(function(t){return e.handleMouseUp(t)}))),this.ctx=t.ctx,t.ctx?this.boxWidth&&this.boxHeight||console.error(\"无法获取到宽度或高度\"):console.error(\"无法获取到 CanvasContext2D\")}return t.prototype.init=function(t){this.setDpr(),this.setHTMLFontSize(),this.resetWidthAndHeight(),this.zoomCanvas()},t.prototype.handleClick=function(t){},t.prototype.handleMouseDown=function(t){},t.prototype.handleMouseUp=function(t){},t.prototype.handleMouseMove=function(t){},t.prototype.conversionAxis=function(t,e){return[0,0]},t.prototype.setDpr=function(){var t=this.config;t.dpr||(window?window.dpr=t.dpr=window.devicePixelRatio||1:t.dpr||console.error(t,\"未传入 dpr 可能会导致绘制异常\"))},t.prototype.setHTMLFontSize=function(){window&&(this.htmlFontSize=+window.getComputedStyle(document.documentElement).fontSize.slice(0,-2))},t.prototype.resetWidthAndHeight=function(){var t=this.config,e=0,i=0;t.divElement&&(e=t.divElement.offsetWidth,i=t.divElement.offsetHeight),this.boxWidth=this.getLength(t.width)||e,this.boxHeight=this.getLength(t.height)||i,t.divElement&&(t.divElement.style.overflow=\"hidden\",t.divElement.style.width=this.boxWidth+\"px\",t.divElement.style.height=this.boxHeight+\"px\")},t.prototype.initWindowFunction=function(){var t=this.config;if(window)return this.rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},t.setTimeout=window.setTimeout,t.setInterval=window.setInterval,t.clearTimeout=window.clearTimeout,void(t.clearInterval=window.clearInterval);if(t.rAF)this.rAF=t.rAF;else if(t.setTimeout){var e=t.setTimeout;this.rAF=function(t){return e(t,16.7)}}else this.rAF=function(t){return setTimeout(t,16.7)}},t.prototype.zoomCanvas=function(){var t=this.config,e=this.ctx,i=t.canvasElement,n=t.dpr,r=[this.boxWidth*n,this.boxHeight*n],o=r[0],s=r[1],a=function(t){return(t*n-t)/(t*n)*(n/2)*100};i&&(i.width=o,i.height=s,i.style.width=o+\"px\",i.style.height=s+\"px\",i.style.transform=\"scale(\"+1/n+\") translate(\"+-a(o)+\"%, \"+-a(s)+\"%)\",e.scale(n,n))},t.prototype.loadImg=function(t,e,i){var n=this;return void 0===i&&(i=\"$resolve\"),new Promise((function(r,o){if(t||o(\"=> '\"+e.src+\"' 不能为空或不合法\"),\"WEB\"===n.config.flag){var s=new Image;s.src=t,s.onload=function(){return r(s)},s.onerror=function(){return o(\"=> '\"+e.src+\"' 图片加载失败\")}}else e[i]=r}))},t.prototype.drawImage=function(t,e,i,n,r){var o,s=this.config,a=this.ctx;return[\"WEB\",\"MP-WX\"].includes(s.flag)?o=t:[\"UNI-H5\",\"UNI-MP\",\"TARO-H5\",\"TARO-MP\"].includes(s.flag)&&(o=t.path),a.drawImage(o,e,i,n,r)},t.prototype.getLength=function(t){return s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t):0},t.prototype.changeUnits=function(t,e){var i=this;return void 0===e&&(e=1),Number(t.replace(/^([-]*[0-9.]*)([a-z%]*)$/,(function(t,n,r){var o={\"%\":function(t){return t*(e/100)},px:function(t){return 1*t},rem:function(t){return t*i.htmlFontSize}}[r];if(o)return o(n);var s=i.config.unitFunc;return s?s(n,r):n})))},t.prototype.$set=function(t,e,i){t&&\"object\"==typeof t&&m(t,e,i)},t.prototype.$computed=function(t,e,i){var n=this;Object.defineProperty(t,e,{get:function(){return i.call(n)}})},t.prototype.$watch=function(t,e,i){void 0===i&&(i={}),\"object\"==typeof e&&(e=(i=e).handler);var n=new b(this,t,e,i);return i.immediate&&e.call(this,n.value),function(){}},t}(),w=function(t){return Math.PI/180*t},x=function(t,e){return[+(Math.cos(t)*e).toFixed(8),+(Math.sin(t)*e).toFixed(8)]},z=function(t,e){var i=-t/e;return[i,-i*t+e]},I=function(t,e,i,n,r,o){var s;if(void 0===o&&(o=!0),Math.abs(r-n).toFixed(8)>=w(180).toFixed(8)){var a=(r+n)/2;return o?(I(t,e,i,n,a,o),I(t,e,i,a,r,o)):(I(t,e,i,a,r,o),I(t,e,i,n,a,o)),!1}o||(n=(s=[r,n])[0],r=s[1]);var u=x(n,i),h=u[0],c=u[1],l=x(r,i),f=l[0],d=l[1],p=z(h,c),g=p[0],m=p[1],v=z(f,d),b=v[0],y=v[1],k=(y-m)/(g-b),S=(b*m-g*y)/(b-g);isNaN(k)&&(Math.abs(h)===+i.toFixed(8)&&(k=h),Math.abs(f)===+i.toFixed(8)&&(k=f)),g===1/0||g===-1/0?S=b*k+y:b!==1/0&&b!==-1/0||(S=g*k+m),e.lineTo(h,c),t.indexOf(\"MP\")>0?e.quadraticCurveTo(k,S,f,d):e.arcTo(k,S,f,d,i)},k=function(t,e,i,n,r,o,s,a){i||(i=s);var u=w(90/Math.PI/n*s),h=w(90/Math.PI/i*s),c=r+u,l=o-u,f=r+h,d=o-h;e.beginPath(),e.fillStyle=a,e.moveTo.apply(e,x(c,n)),I(t,e,n,c,l,!0),d>f?I(t,e,i,f,d,!1):e.lineTo.apply(e,x((r+o)/2,s/2/Math.abs(Math.sin((r-o)/2)))),e.closePath(),e.fill()},S=function(t,e,i,n,r,o,s){var a=Math.min(n,r);o>a/2&&(o=a/2),t.beginPath(),t.fillStyle=s,t.moveTo(e+o,i),t.lineTo(e+o,i),t.lineTo(e+n-o,i),t.quadraticCurveTo(e+n,i,e+n,i+o),t.lineTo(e+n,i+r-o),t.quadraticCurveTo(e+n,i+r,e+n-o,i+r),t.lineTo(e+o,i+r),t.quadraticCurveTo(e,i+r,e,i+r-o),t.lineTo(e,i+o),t.quadraticCurveTo(e,i,e+o,i),t.closePath(),t.fill()},C={easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*(t/=n)*(t-2)+e}},T={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*Math.cos(t/n*(Math.PI/2))+i+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sin(t/n*(Math.PI/2))+e}},W={easeIn:function(t,e,i,n){return t>=n&&(t=n),0==t?e:i*Math.pow(2,10*(t/n-1))+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),t==n?e+i:i*(1-Math.pow(2,-10*t/n))+e}},O={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*(Math.sqrt(1-(t/=n)*t)-1)+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sqrt(1-(t=t/n-1)*t)+e}},_=Object.freeze({__proto__:null,quad:C,cubic:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t+1)+e}},quart:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*((t=t/n-1)*t*t*t-1)+e}},quint:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t*t*t+1)+e}},sine:T,expo:W,circ:O}),E=function(t){function o(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;return r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:\"0px\",offsetDegree:0,speed:20,speedFunction:\"quad\",accelerationTime:2500,decelerationTime:2500,stopRange:.8},r.defaultStyle={},r._defaultStyle={fontSize:\"18px\",fontColor:\"#000\",fontStyle:\"sans-serif\",fontWeight:\"400\",lineHeight:\"\",background:\"rgba(0,0,0,0)\",wordWrap:!0,lengthLimit:\"90%\"},r.Radius=0,r.prizeRadius=0,r.prizeDeg=0,r.prizeRadian=0,r.rotateDeg=0,r.maxBtnRadius=0,r.startTime=0,r.endTime=0,r.stopDeg=0,r.endDeg=0,r.FPS=16.6,r.blockImgs=[[]],r.prizeImgs=[[]],r.btnImgs=[[]],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:r.buttons.map((function(t){return t.imgs}))}),r}return e(o,t),o.prototype.initData=function(t){this.$set(this,\"blocks\",t.blocks||[]),this.$set(this,\"prizes\",t.prizes||[]),this.$set(this,\"buttons\",t.buttons||[]),this.$set(this,\"defaultConfig\",t.defaultConfig||{}),this.$set(this,\"defaultStyle\",t.defaultStyle||{}),this.$set(this,\"startCallback\",t.start),this.$set(this,\"endCallback\",t.end)},o.prototype.initComputed=function(){var t=this;this.$computed(this,\"_defaultConfig\",(function(){return i({gutter:\"0px\",offsetDegree:0,speed:20,speedFunction:\"quad\",accelerationTime:2500,decelerationTime:2500,stopRange:.8},t.defaultConfig)})),this.$computed(this,\"_defaultStyle\",(function(){return i({fontSize:\"18px\",fontColor:\"#000\",fontStyle:\"sans-serif\",fontWeight:\"400\",background:\"rgba(0,0,0,0)\",wordWrap:!0,lengthLimit:\"90%\"},t.defaultStyle)}))},o.prototype.initWatch=function(){var t=this;this.$watch(\"blocks\",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"prizes\",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"buttons\",(function(e){return t.init({btnImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"defaultConfig\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"defaultStyle\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"startCallback\",(function(){return t.init({})})),this.$watch(\"endCallback\",(function(){return t.init({})}))},o.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this.config,s=this.ctx;this.Radius=Math.min(this.boxWidth,this.boxHeight)/2,null===(i=o.beforeInit)||void 0===i||i.call(this),s.translate(this.Radius,this.Radius),this.draw(),this.draw(),Object.keys(e).forEach((function(t){var i=t,n={blockImgs:\"blocks\",prizeImgs:\"prizes\",btnImgs:\"buttons\"}[i],o=e[i];o&&o.forEach((function(t,e){t&&t.forEach((function(t,o){r.loadAndCacheImg(n,e,i,o,(function(){r.draw()}))}))}))})),null===(n=o.afterInit)||void 0===n||n.call(this)},o.prototype.handleClick=function(t){var e,i=this.ctx;i.beginPath(),i.arc(0,0,this.maxBtnRadius,0,2*Math.PI,!1),i.isPointInPath(t.offsetX,t.offsetY)&&(this.startTime||null===(e=this.startCallback)||void 0===e||e.call(this,t))},o.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u=this;return r(this,(function(r){return(n=this[t][e])&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),this.loadImg(a.src,a).then((function(t){u[i][e][o]=t,s.call(u)})).catch((function(i){console.error(t+\"[\"+e+\"].imgs[\"+o+\"] \"+i)})),[2]):[2]}))}))},o.prototype.computedWidthAndHeight=function(t,e,i,n){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var r=this.getWidth(e.width,i);return[r,t.height*(r/t.width)]}if(!e.width&&e.height){var o=this.getHeight(e.height,n);return[t.width*(o/t.height),o]}return[this.getWidth(e.width,i),this.getHeight(e.height,n)]},o.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,o=n.ctx,s=n._defaultConfig,h=n._defaultStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,o),o.clearRect(-this.Radius,-this.Radius,2*this.Radius,2*this.Radius),this.prizeRadius=this.blocks.reduce((function(t,e,n){return u(e.background)&&(o.beginPath(),o.fillStyle=e.background,o.arc(0,0,t,0,2*Math.PI,!1),o.fill()),e.imgs&&e.imgs.forEach((function(e,r){if(i.blockImgs[n]){var s=i.blockImgs[n][r];if(s){var a=i.computedWidthAndHeight(s,e,2*t,2*t),u=a[0],h=a[1],c=[i.getOffsetX(u),i.getHeight(e.top,2*t)-t],l=c[0],f=c[1];o.save(),e.rotate&&o.rotate(w(i.rotateDeg)),i.drawImage(s,l,f,u,h),o.restore()}}})),t-i.getLength(e.padding&&e.padding.split(\" \")[0])}),this.Radius),this.prizeDeg=360/this.prizes.length,this.prizeRadian=w(this.prizeDeg);var c=w(-90+this.rotateDeg+s.offsetDegree),l=function(t){return i.getOffsetX(o.measureText(t).width)},f=function(t,e,n){var r=t.lineHeight||h.lineHeight||t.fontSize||h.fontSize;return i.getHeight(t.top,e)+(n+1)*i.getLength(r)};o.save(),this.prizes.forEach((function(t,e){var n=c+e*i.prizeRadian,d=i.prizeRadius-i.maxBtnRadius,p=t.background||h.background;u(p)&&function(t,e,i,n,r,o,s,a){s?k(t,e,i,n,r,o,s,a):(e.beginPath(),e.fillStyle=a,e.moveTo(0,0),e.arc(0,0,n,r,o,!1),e.closePath(),e.fill())}(r.flag,o,i.maxBtnRadius,i.prizeRadius,n-i.prizeRadian/2,n+i.prizeRadian/2,i.getLength(s.gutter),p);var g=Math.cos(n)*i.prizeRadius,m=Math.sin(n)*i.prizeRadius;o.translate(g,m),o.rotate(n+w(90)),t.imgs&&t.imgs.forEach((function(t,n){if(i.prizeImgs[e]){var r=i.prizeImgs[e][n];if(r){var o=i.computedWidthAndHeight(r,t,i.prizeRadian*i.prizeRadius,d),s=o[0],a=o[1],u=[i.getOffsetX(s),i.getHeight(t.top,d)],h=u[0],c=u[1];i.drawImage(r,h,c,s,a)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,n=t.fontWeight||h.fontWeight,r=i.getLength(t.fontSize||h.fontSize),u=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=n+\" \"+(r>>0)+\"px \"+u;var c=[],p=String(t.text);if(Object.prototype.hasOwnProperty.call(t,\"wordWrap\")?t.wordWrap:h.wordWrap){p=a(p);for(var g=\"\",m=0;m<p.length;m++){g+=p[m];var v=o.measureText(g).width,b=(i.prizeRadius-f(t,d,c.length))*Math.tan(i.prizeRadian/2)*2-i.getLength(s.gutter);v>i.getWidth(t.lengthLimit||h.lengthLimit,b)&&(c.push(g.slice(0,-1)),g=p[m])}g&&c.push(g),c.length||c.push(p)}else c=p.split(\"\\n\");c.filter((function(t){return!!t})).forEach((function(e,i){o.fillText(e,l(e),f(t,d,i))}))})),o.rotate(w(360)-n-w(90)),o.translate(-g,-m)})),o.restore(),this.buttons.forEach((function(t,e){var n=i.getHeight(t.radius);i.maxBtnRadius=Math.max(i.maxBtnRadius,n),u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.arc(0,0,n,0,2*Math.PI,!1),o.fill()),t.pointer&&u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.moveTo(-n,0),o.lineTo(n,0),o.lineTo(0,2*-n),o.closePath(),o.fill()),t.imgs&&t.imgs.forEach((function(t,r){if(i.btnImgs[e]){var o=i.btnImgs[e][r];if(o){var s=i.computedWidthAndHeight(o,t,2*n,2*n),a=s[0],u=s[1],h=[i.getOffsetX(a),i.getHeight(t.top,n)],c=h[0],l=h[1];i.drawImage(o,c,l,a,u)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,r=t.fontWeight||h.fontWeight,s=i.getLength(t.fontSize||h.fontSize),a=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=r+\" \"+(s>>0)+\"px \"+a,String(t.text).split(\"\\n\").forEach((function(e,i){o.fillText(e,l(e),f(t,n,i))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,o)},o.prototype.play=function(){this.startTime||(this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},o.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.rotateDeg=this.prizeDeg/2-this._defaultConfig.offsetDegree,this.draw())},o.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.prizeFlag,r=e.prizeDeg,o=e.rotateDeg,s=e._defaultConfig,a=Date.now()-this.startTime;if(a>=s.accelerationTime&&void 0!==n){this.FPS=a/t,this.endTime=Date.now(),this.stopDeg=o;for(var u=(Math.random()*r-r/2)*this.getLength(s.stopRange),h=0;++h;){var c=360*h-n*r-o-s.offsetDegree+u;if(_[s.speedFunction].easeOut(this.FPS,this.stopDeg,c,s.decelerationTime)-this.stopDeg>s.speed){this.endDeg=c;break}}return this.slowDown()}this.rotateDeg=(o+_[s.speedFunction].easeIn(a,0,s.speed,s.accelerationTime))%360,this.draw(),i(this.run.bind(this,t+1))},o.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopDeg,a=e.endDeg,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>=u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.rotateDeg=_[u.speedFunction].easeOut(h,s,a,u.decelerationTime)%360,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},o.prototype.getWidth=function(t,e){return void 0===e&&(e=this.prizeRadian*this.prizeRadius),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,e):0},o.prototype.getHeight=function(t,e){return void 0===e&&(e=this.prizeRadius),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,e):0},o.prototype.getOffsetX=function(t){return-t/2},o.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr-this.Radius,e/i.dpr-this.Radius]},o}(y),P=function(t){function h(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;r.rows=3,r.cols=3,r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},r.defaultStyle={},r._defaultStyle={borderRadius:20,fontColor:\"#000\",fontSize:\"18px\",fontStyle:\"sans-serif\",fontWeight:\"400\",lineHeight:\"\",background:\"rgba(0,0,0,0)\",shadow:\"\",wordWrap:!0,lengthLimit:\"90%\"},r.activeStyle={},r._activeStyle={background:\"#ffce98\",shadow:\"\",fontStyle:\"\",fontWeight:\"\",fontSize:\"\",lineHeight:\"\",fontColor:\"\"},r.cellWidth=0,r.cellHeight=0,r.startTime=0,r.endTime=0,r.currIndex=0,r.stopIndex=0,r.endIndex=0,r.demo=!1,r.timer=0,r.FPS=16.6,r.prizeFlag=-1,r.cells=[],r.blockImgs=[[]],r.btnImgs=[[]],r.prizeImgs=[],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r);var o=r.buttons.map((function(t){return t.imgs}));return r.button&&o.push(r.button.imgs),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:o}),r}return e(h,t),h.prototype.initData=function(t){this.$set(this,\"rows\",Number(t.rows)||3),this.$set(this,\"cols\",Number(t.cols)||3),this.$set(this,\"blocks\",t.blocks||[]),this.$set(this,\"prizes\",t.prizes||[]),this.$set(this,\"buttons\",t.buttons||[]),this.$set(this,\"button\",t.button),this.$set(this,\"defaultConfig\",t.defaultConfig||{}),this.$set(this,\"defaultStyle\",t.defaultStyle||{}),this.$set(this,\"activeStyle\",t.activeStyle||{}),this.$set(this,\"startCallback\",t.start),this.$set(this,\"endCallback\",t.end)},h.prototype.initComputed=function(){var t=this;this.$computed(this,\"_defaultConfig\",(function(){var e=i({gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},t.defaultConfig);return e.gutter=t.getLength(e.gutter),e.speed=e.speed/40,e})),this.$computed(this,\"_defaultStyle\",(function(){return i({borderRadius:20,fontColor:\"#000\",fontSize:\"18px\",fontStyle:\"sans-serif\",fontWeight:\"400\",background:\"rgba(0,0,0,0)\",shadow:\"\",wordWrap:!0,lengthLimit:\"90%\"},t.defaultStyle)})),this.$computed(this,\"_activeStyle\",(function(){return i({background:\"#ffce98\",shadow:\"\"},t.activeStyle)}))},h.prototype.initWatch=function(){var t=this;this.$watch(\"blocks\",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"prizes\",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"buttons\",(function(e){var i=e.map((function(t){return t.imgs}));return t.button&&i.push(t.button.imgs),t.init({btnImgs:i})}),{deep:!0}),this.$watch(\"button\",(function(){var e=t.buttons.map((function(t){return t.imgs}));return t.button&&e.push(t.button.imgs),t.init({btnImgs:e})}),{deep:!0}),this.$watch(\"rows\",(function(){return t.init({})})),this.$watch(\"cols\",(function(){return t.init({})})),this.$watch(\"defaultConfig\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"defaultStyle\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"activeStyle\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"startCallback\",(function(){return t.init({})})),this.$watch(\"endCallback\",(function(){return t.init({})}))},h.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this,s=o.config;o.ctx,o.button,null===(i=s.beforeInit)||void 0===i||i.call(this),this.draw(),Object.keys(e).forEach((function(t){var i=t,n=e[i],o={blockImgs:\"blocks\",prizeImgs:\"prizes\",btnImgs:\"buttons\"}[i];n&&n.forEach((function(t,e){t&&t.forEach((function(t,n){r.loadAndCacheImg(o,e,i,n,(function(){r.draw()}))}))}))})),null===(n=s.afterInit)||void 0===n||n.call(this)},h.prototype.handleClick=function(t){var e=this,i=this.ctx;o(o([],this.buttons),[this.button]).forEach((function(n){var r;if(n){var o=e.getGeometricProperty([n.x,n.y,n.col||1,n.row||1]),s=o[0],a=o[1],u=o[2],h=o[3];i.beginPath(),i.rect(s,a,u,h),i.isPointInPath(t.offsetX,t.offsetY)&&(e.startTime||(\"function\"==typeof n.callback&&n.callback.call(e,n),null===(r=e.startCallback)||void 0===r||r.call(e,t,n)))}}))},h.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u,h=this;return r(this,(function(r){return n=this[t][e],\"buttons\"===t&&!this.buttons.length&&this.button&&(n=this.button),n&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),u=[this.loadImg(a.src,a),a.activeSrc&&this.loadImg(a.activeSrc,a,\"$activeResolve\")],Promise.all(u).then((function(t){var n=t[0],r=t[1];h[i][e][o]={defaultImg:n,activeImg:r},s.call(h)})).catch((function(i){console.error(t+\"[\"+e+\"].imgs[\"+o+\"] \"+i)})),[2]):[2]}))}))},h.prototype.computedWidthAndHeight=function(t,e,i){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var n=this.getWidth(e.width,i.col);return[n,t.height*(n/t.width)]}if(!e.width&&e.height){var r=this.getHeight(e.height,i.row);return[t.width*(r/t.height),r]}return[this.getWidth(e.width,i.col),this.getHeight(e.height,i.row)]},h.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,h=n.ctx,c=n._defaultConfig,l=n._defaultStyle,f=n._activeStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,h),h.clearRect(0,0,this.boxWidth,this.boxHeight),this.cells=o(o([],this.prizes),this.buttons),this.button&&this.cells.push(this.button),this.cells.forEach((function(t){t.col=t.col||1,t.row=t.row||1})),this.prizeArea=this.blocks.reduce((function(t,e){var n=t.x,r=t.y,o=t.w,a=t.h,c=function(t){var e,i=(null===(e=t.padding)||void 0===e?void 0:e.replace(/px/g,\"\").split(\" \").map((function(t){return~~t})))||[0],n=0,r=0,o=0,a=0;switch(i.length){case 1:n=r=o=a=i[0];break;case 2:n=r=i[0],o=a=i[1];break;case 3:n=i[0],o=a=i[1],r=i[2];break;default:n=i[0],r=i[1],o=i[2],a=i[3]}var u={paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:a};for(var h in u)u[h]=Object.prototype.hasOwnProperty.call(t,h)&&s(t[h],\"string\",\"number\")?~~String(t[h]).replace(/px/g,\"\"):u[h];return[n,r,o,a]}(e),f=c[0],d=c[1],p=c[2],g=c[3],m=e.borderRadius?i.getLength(e.borderRadius):0,v=e.background||l.background;return u(v)&&S(h,n,r,o,a,m,i.handleBackground(n,r,o,a,v)),{x:n+p,y:r+f,w:o-p-g,h:a-f-d}}),{x:0,y:0,w:this.boxWidth,h:this.boxHeight}),this.cellWidth=(this.prizeArea.w-c.gutter*(this.cols-1))/this.cols,this.cellHeight=(this.prizeArea.h-c.gutter*(this.rows-1))/this.rows,this.cells.forEach((function(t,e){var n=i.getGeometricProperty([t.x,t.y,t.col,t.row]),o=n[0],s=n[1],c=n[2],d=n[3],p=!1;(void 0===i.prizeFlag||i.prizeFlag>-1)&&(p=e===i.currIndex%i.prizes.length>>0);var g=p?f.background:t.background||l.background;if(u(g)){var m=(p?f.shadow:t.shadow||l.shadow).replace(/px/g,\"\").split(\",\")[0].split(\" \").map((function(t,e){return e<3?Number(t):t}));4===m.length&&(h.shadowColor=m[3],h.shadowOffsetX=m[0]*r.dpr,h.shadowOffsetY=m[1]*r.dpr,h.shadowBlur=m[2],m[0]>0?c-=m[0]:(c+=m[0],o-=m[0]),m[1]>0?d-=m[1]:(d+=m[1],s-=m[1])),S(h,o,s,c,d,i.getLength(t.borderRadius?t.borderRadius:l.borderRadius),i.handleBackground(o,s,c,d,g)),h.shadowColor=\"rgba(0, 0, 0, 0)\",h.shadowOffsetX=0,h.shadowOffsetY=0,h.shadowBlur=0}var v=\"prizeImgs\";e>=i.prizes.length&&(v=\"btnImgs\",e-=i.prizes.length),t.imgs&&t.imgs.forEach((function(n,r){if(i[v][e]){var a=i[v][e][r];if(a){var u=p&&a.activeImg||a.defaultImg;if(u){var h=i.computedWidthAndHeight(u,n,t),c=h[0],l=h[1],f=[o+i.getOffsetX(c,t.col),s+i.getHeight(n.top,t.row)],d=f[0],g=f[1];i.drawImage(u,d,g,c,l)}}}})),t.fonts&&t.fonts.forEach((function(e){var n=p&&f.fontStyle?f.fontStyle:e.fontStyle||l.fontStyle,r=p&&f.fontWeight?f.fontWeight:e.fontWeight||l.fontWeight,u=p&&f.fontSize?i.getLength(f.fontSize):i.getLength(e.fontSize||l.fontSize),c=p&&f.lineHeight?f.lineHeight:e.lineHeight||l.lineHeight||e.fontSize||l.fontSize;h.font=r+\" \"+(u>>0)+\"px \"+n,h.fillStyle=p&&f.fontColor?f.fontColor:e.fontColor||l.fontColor;var d=[],g=String(e.text);if(Object.prototype.hasOwnProperty.call(e,\"wordWrap\")?e.wordWrap:l.wordWrap){g=a(g);for(var m=\"\",v=0;v<g.length;v++){m+=g[v],h.measureText(m).width>i.getWidth(e.lengthLimit||l.lengthLimit,t.col)&&(d.push(m.slice(0,-1)),m=g[v])}m&&d.push(m),d.length||d.push(g)}else d=g.split(\"\\n\");d.forEach((function(n,r){h.fillText(n,o+i.getOffsetX(h.measureText(n).width,t.col),s+i.getHeight(e.top,t.row)+(r+1)*i.getLength(c))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,h)},h.prototype.handleBackground=function(t,e,i,n,r){var o=this.ctx;return r.includes(\"linear-gradient\")&&(r=function(t,e,i,n,r,o){var s=/linear-gradient\\((.+)\\)/.exec(o)[1].split(\",\").map((function(t){return t.trim()})),a=s.shift(),u=[0,0,0,0];if(a.includes(\"deg\")){var h=function(t){return Math.tan(t/180*Math.PI)};(a=a.slice(0,-3)%360)>=0&&a<45?u=[e,i+r,e+n,i+r-n*h(a-0)]:a>=45&&a<90?u=[e,i+r,e+n-r*h(a-45),i]:a>=90&&a<135?u=[e+n,i+r,e+n-r*h(a-90),i]:a>=135&&a<180?u=[e+n,i+r,e,i+n*h(a-135)]:a>=180&&a<225?u=[e+n,i,e,i+n*h(a-180)]:a>=225&&a<270?u=[e+n,i,e+r*h(a-225),i+r]:a>=270&&a<315?u=[e,i,e+r*h(a-270),i+r]:a>=315&&a<360&&(u=[e,i,e+n,i+r-n*h(a-315)])}else a.includes(\"top\")?u=[e,i+r,e,i]:a.includes(\"bottom\")?u=[e,i,e,i+r]:a.includes(\"left\")?u=[e+n,i,e,i]:a.includes(\"right\")&&(u=[e,i,e+n,i]);var c=t.createLinearGradient.apply(t,u.map((function(t){return t>>0})));return s.reduce((function(t,e,i){var n=e.split(\" \");return 1===n.length?t.addColorStop(i,n[0]):2===n.length&&t.addColorStop.apply(t,n),t}),c)}(o,t,e,i,n,r)),r},h.prototype.play=function(){var t=this.config.clearInterval;this.startTime||(t(this.timer),this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},h.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.currIndex=0,this.draw())},h.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.currIndex,r=e.prizes,o=e.prizeFlag,s=e.startTime,a=e._defaultConfig,u=Date.now()-s;if(u>=a.accelerationTime&&void 0!==o){this.FPS=u/t,this.endTime=Date.now(),this.stopIndex=n;for(var h=0;++h;){var c=r.length*h+o-(n>>0);if(C.easeOut(this.FPS,this.stopIndex,c,a.decelerationTime)-this.stopIndex>a.speed){this.endIndex=c;break}}return this.slowDown()}this.currIndex=(n+C.easeIn(u,.1,a.speed,a.accelerationTime))%r.length,this.draw(),i(this.run.bind(this,t+1))},h.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopIndex,a=e.endIndex,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.currIndex=C.easeOut(h,s,a,u.decelerationTime)%r.length,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},h.prototype.walk=function(){var t=this,e=this.config,i=e.setInterval;(0,e.clearInterval)(this.timer),this.timer=i((function(){t.currIndex+=1,t.draw()}),1300)},h.prototype.getGeometricProperty=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=this.cellWidth,s=this.cellHeight,a=this._defaultConfig.gutter,u=[this.prizeArea.x+(o+a)*e,this.prizeArea.y+(s+a)*i];return n&&r&&u.push(o*n+a*(n-1),s*r+a*(r-1)),u},h.prototype.getWidth=function(t,e){return void 0===e&&(e=1),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,this.cellWidth*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getHeight=function(t,e){return void 0===e&&(e=1),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,this.cellHeight*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getOffsetX=function(t,e){return void 0===e&&(e=1),(this.cellWidth*e+this._defaultConfig.gutter*(e-1)-t)/2},h.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr,e/i.dpr]},h}(y);exports.LuckyGrid=P,exports.LuckyWheel=E;\n"]}
0 2 \ No newline at end of file
... ...
packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.js 0 → 100644
  1 +module.exports =
  2 +/******/ (function(modules) { // webpackBootstrap
  3 +/******/ // The module cache
  4 +/******/ var installedModules = {};
  5 +/******/
  6 +/******/ // The require function
  7 +/******/ function __webpack_require__(moduleId) {
  8 +/******/
  9 +/******/ // Check if module is in cache
  10 +/******/ if(installedModules[moduleId]) {
  11 +/******/ return installedModules[moduleId].exports;
  12 +/******/ }
  13 +/******/ // Create a new module (and put it into the cache)
  14 +/******/ var module = installedModules[moduleId] = {
  15 +/******/ i: moduleId,
  16 +/******/ l: false,
  17 +/******/ exports: {}
  18 +/******/ };
  19 +/******/
  20 +/******/ // Execute the module function
  21 +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22 +/******/
  23 +/******/ // Flag the module as loaded
  24 +/******/ module.l = true;
  25 +/******/
  26 +/******/ // Return the exports of the module
  27 +/******/ return module.exports;
  28 +/******/ }
  29 +/******/
  30 +/******/
  31 +/******/ // expose the modules object (__webpack_modules__)
  32 +/******/ __webpack_require__.m = modules;
  33 +/******/
  34 +/******/ // expose the module cache
  35 +/******/ __webpack_require__.c = installedModules;
  36 +/******/
  37 +/******/ // define getter function for harmony exports
  38 +/******/ __webpack_require__.d = function(exports, name, getter) {
  39 +/******/ if(!__webpack_require__.o(exports, name)) {
  40 +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41 +/******/ }
  42 +/******/ };
  43 +/******/
  44 +/******/ // define __esModule on exports
  45 +/******/ __webpack_require__.r = function(exports) {
  46 +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47 +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48 +/******/ }
  49 +/******/ Object.defineProperty(exports, '__esModule', { value: true });
  50 +/******/ };
  51 +/******/
  52 +/******/ // create a fake namespace object
  53 +/******/ // mode & 1: value is a module id, require it
  54 +/******/ // mode & 2: merge all properties of value into the ns
  55 +/******/ // mode & 4: return value when already ns object
  56 +/******/ // mode & 8|1: behave like require
  57 +/******/ __webpack_require__.t = function(value, mode) {
  58 +/******/ if(mode & 1) value = __webpack_require__(value);
  59 +/******/ if(mode & 8) return value;
  60 +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61 +/******/ var ns = Object.create(null);
  62 +/******/ __webpack_require__.r(ns);
  63 +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64 +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65 +/******/ return ns;
  66 +/******/ };
  67 +/******/
  68 +/******/ // getDefaultExport function for compatibility with non-harmony modules
  69 +/******/ __webpack_require__.n = function(module) {
  70 +/******/ var getter = module && module.__esModule ?
  71 +/******/ function getDefault() { return module['default']; } :
  72 +/******/ function getModuleExports() { return module; };
  73 +/******/ __webpack_require__.d(getter, 'a', getter);
  74 +/******/ return getter;
  75 +/******/ };
  76 +/******/
  77 +/******/ // Object.prototype.hasOwnProperty.call
  78 +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79 +/******/
  80 +/******/ // __webpack_public_path__
  81 +/******/ __webpack_require__.p = "";
  82 +/******/
  83 +/******/
  84 +/******/ // Load entry module and return exports
  85 +/******/ return __webpack_require__(__webpack_require__.s = 2);
  86 +/******/ })
  87 +/************************************************************************/
  88 +/******/ ([
  89 +/* 0 */
  90 +/***/ (function(module, exports, __webpack_require__) {
  91 +
  92 +"use strict";
  93 +Object.defineProperty(exports,"__esModule",{value:!0});
  94 +/*! *****************************************************************************
  95 +Copyright (c) Microsoft Corporation.
  96 +
  97 +Permission to use, copy, modify, and/or distribute this software for any
  98 +purpose with or without fee is hereby granted.
  99 +
  100 +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  101 +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  102 +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  103 +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  104 +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  105 +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  106 +PERFORMANCE OF THIS SOFTWARE.
  107 +***************************************************************************** */
  108 +var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};function e(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function n(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function r(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function o(t,e){for(var i=0,n=e.length,r=t.length;i<n;i++,r++)t[r]=e[i];return t}String.prototype.includes||(String.prototype.includes=function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var n=arguments[1],r=0;r<i;){var o=e[r];if(t.call(n,o,r,e))return o;r++}}});var s=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.some((function(e){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()===e}))},a=function(t){return[].filter.call(t,(function(t){return"\n"!==t})).join("")},u=function(t){if("string"!=typeof t)return!1;if("transparent"===(t=t.toLocaleLowerCase().trim()))return!1;if(/^rgba/.test(t)){var e=/([^\s,]+)\)$/.exec(t);if(0===(null===(i=e)?0:"object"==typeof i?NaN:"number"==typeof i?i:"string"==typeof i?"%"===i[i.length-1]?Number(i.slice(0,-1))/100:Number(i):NaN))return!1}var i;return!0},h=function(){function t(){this.subs=[]}return t.prototype.addSub=function(t){this.subs.includes(t)||this.subs.push(t)},t.prototype.notify=function(){this.subs.forEach((function(t){t.update()}))},t}(),c="__proto__"in{};function l(t,e,i,n){Object.defineProperty(t,e,{value:i,enumerable:!!n,writable:!0,configurable:!0})}var f=Array.prototype,d=Object.create(f);["push","pop","shift","unshift","sort","splice","reverse"].forEach((function(t){d[t]=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=f[t].apply(this,e),r=this.__luckyOb__;return["push","unshift","splice"].includes(t)&&r.walk(this),r.dep.notify(),n}}));var p=function(){function t(t){this.dep=new h,l(t,"__luckyOb__",this),Array.isArray(t)&&(c?t.__proto__=d:Object.getOwnPropertyNames(d).forEach((function(e){l(t,e,d[e])}))),this.walk(t)}return t.prototype.walk=function(t){Object.keys(t).forEach((function(e){m(t,e,t[e])}))},t}();function g(t){if(t&&"object"==typeof t)return"__luckyOb__"in t?t.__luckyOb__:new p(t)}function m(t,e,i){var n=new h,r=Object.getOwnPropertyDescriptor(t,e);if(!r||!1!==r.configurable){var o=r&&r.get,s=r&&r.set;o&&!s||2!==arguments.length||(i=t[e]);var a=g(i);Object.defineProperty(t,e,{get:function(){var e=o?o.call(t):i;return h.target&&(n.addSub(h.target),a&&a.dep.addSub(h.target)),e},set:function(e){e!==i&&(i=e,o&&!s||(s?s.call(t,e):i=e,a=g(e),n.notify()))}})}}var v=0,b=function(){function t(t,e,i,n){void 0===n&&(n={}),this.id=v++,this.$lucky=t,this.expr=e,this.deep=!!n.deep,this.getter="function"==typeof e?e:function(t){t+=".";for(var e=[],i="",n=0;n<t.length;n++){var r=t[n];if(/\[|\./.test(r))e.push(i),i="";else{if(/\W/.test(r))continue;i+=r}}return function(t){return e.reduce((function(t,e){return t[e]}),t)}}(e),this.cb=i,this.value=this.get()}return t.prototype.get=function(){h.target=this;var t=this.getter.call(this.$lucky,this.$lucky);return this.deep&&function(t){var e=function(t){s(t,"array","object")&&Object.keys(t).forEach((function(i){var n=t[i];e(n)}))};e(t)}(t),h.target=null,t},t.prototype.update=function(){var t=this.get(),e=this.value;this.value=t,this.cb.call(this.$lucky,t,e)},t}(),y=function(){function t(t){var e=this;this.htmlFontSize=16,this.rAF=function(){},this.boxWidth=0,this.boxHeight=0,this.setHTMLFontSize(),"string"==typeof t?t={el:t}:1===t.nodeType&&(t={el:"",divElement:t}),t=t,this.config=t,this.setDpr(),this.initWindowFunction(),t.flag||(t.flag="WEB"),Object.prototype.hasOwnProperty.call(t,"ob")||(t.ob=!0),t.el&&(t.divElement=document.querySelector(t.el)),t.divElement&&(t.canvasElement=document.createElement("canvas"),t.divElement.appendChild(t.canvasElement)),this.resetWidthAndHeight(),t.canvasElement&&(t.ctx=t.canvasElement.getContext("2d"),t.canvasElement.setAttribute("package","lucky-canvas@1.5.4"),t.canvasElement.addEventListener("click",(function(t){return e.handleClick(t)})),t.canvasElement.addEventListener("mousemove",(function(t){return e.handleMouseMove(t)})),t.canvasElement.addEventListener("mousedown",(function(t){return e.handleMouseDown(t)})),t.canvasElement.addEventListener("mouseup",(function(t){return e.handleMouseUp(t)}))),this.ctx=t.ctx,t.ctx?this.boxWidth&&this.boxHeight||console.error("无法获取到宽度或高度"):console.error("无法获取到 CanvasContext2D")}return t.prototype.init=function(t){this.setDpr(),this.setHTMLFontSize(),this.resetWidthAndHeight(),this.zoomCanvas()},t.prototype.handleClick=function(t){},t.prototype.handleMouseDown=function(t){},t.prototype.handleMouseUp=function(t){},t.prototype.handleMouseMove=function(t){},t.prototype.conversionAxis=function(t,e){return[0,0]},t.prototype.setDpr=function(){var t=this.config;t.dpr||(window?window.dpr=t.dpr=window.devicePixelRatio||1:t.dpr||console.error(t,"未传入 dpr 可能会导致绘制异常"))},t.prototype.setHTMLFontSize=function(){window&&(this.htmlFontSize=+window.getComputedStyle(document.documentElement).fontSize.slice(0,-2))},t.prototype.resetWidthAndHeight=function(){var t=this.config,e=0,i=0;t.divElement&&(e=t.divElement.offsetWidth,i=t.divElement.offsetHeight),this.boxWidth=this.getLength(t.width)||e,this.boxHeight=this.getLength(t.height)||i,t.divElement&&(t.divElement.style.overflow="hidden",t.divElement.style.width=this.boxWidth+"px",t.divElement.style.height=this.boxHeight+"px")},t.prototype.initWindowFunction=function(){var t=this.config;if(window)return this.rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},t.setTimeout=window.setTimeout,t.setInterval=window.setInterval,t.clearTimeout=window.clearTimeout,void(t.clearInterval=window.clearInterval);if(t.rAF)this.rAF=t.rAF;else if(t.setTimeout){var e=t.setTimeout;this.rAF=function(t){return e(t,16.7)}}else this.rAF=function(t){return setTimeout(t,16.7)}},t.prototype.zoomCanvas=function(){var t=this.config,e=this.ctx,i=t.canvasElement,n=t.dpr,r=[this.boxWidth*n,this.boxHeight*n],o=r[0],s=r[1],a=function(t){return(t*n-t)/(t*n)*(n/2)*100};i&&(i.width=o,i.height=s,i.style.width=o+"px",i.style.height=s+"px",i.style.transform="scale("+1/n+") translate("+-a(o)+"%, "+-a(s)+"%)",e.scale(n,n))},t.prototype.loadImg=function(t,e,i){var n=this;return void 0===i&&(i="$resolve"),new Promise((function(r,o){if(t||o("=> '"+e.src+"' 不能为空或不合法"),"WEB"===n.config.flag){var s=new Image;s.src=t,s.onload=function(){return r(s)},s.onerror=function(){return o("=> '"+e.src+"' 图片加载失败")}}else e[i]=r}))},t.prototype.drawImage=function(t,e,i,n,r){var o,s=this.config,a=this.ctx;return["WEB","MP-WX"].includes(s.flag)?o=t:["UNI-H5","UNI-MP","TARO-H5","TARO-MP"].includes(s.flag)&&(o=t.path),a.drawImage(o,e,i,n,r)},t.prototype.getLength=function(t){return s(t,"number")?t:s(t,"string")?this.changeUnits(t):0},t.prototype.changeUnits=function(t,e){var i=this;return void 0===e&&(e=1),Number(t.replace(/^([-]*[0-9.]*)([a-z%]*)$/,(function(t,n,r){var o={"%":function(t){return t*(e/100)},px:function(t){return 1*t},rem:function(t){return t*i.htmlFontSize}}[r];if(o)return o(n);var s=i.config.unitFunc;return s?s(n,r):n})))},t.prototype.$set=function(t,e,i){t&&"object"==typeof t&&m(t,e,i)},t.prototype.$computed=function(t,e,i){var n=this;Object.defineProperty(t,e,{get:function(){return i.call(n)}})},t.prototype.$watch=function(t,e,i){void 0===i&&(i={}),"object"==typeof e&&(e=(i=e).handler);var n=new b(this,t,e,i);return i.immediate&&e.call(this,n.value),function(){}},t}(),w=function(t){return Math.PI/180*t},x=function(t,e){return[+(Math.cos(t)*e).toFixed(8),+(Math.sin(t)*e).toFixed(8)]},z=function(t,e){var i=-t/e;return[i,-i*t+e]},I=function(t,e,i,n,r,o){var s;if(void 0===o&&(o=!0),Math.abs(r-n).toFixed(8)>=w(180).toFixed(8)){var a=(r+n)/2;return o?(I(t,e,i,n,a,o),I(t,e,i,a,r,o)):(I(t,e,i,a,r,o),I(t,e,i,n,a,o)),!1}o||(n=(s=[r,n])[0],r=s[1]);var u=x(n,i),h=u[0],c=u[1],l=x(r,i),f=l[0],d=l[1],p=z(h,c),g=p[0],m=p[1],v=z(f,d),b=v[0],y=v[1],k=(y-m)/(g-b),S=(b*m-g*y)/(b-g);isNaN(k)&&(Math.abs(h)===+i.toFixed(8)&&(k=h),Math.abs(f)===+i.toFixed(8)&&(k=f)),g===1/0||g===-1/0?S=b*k+y:b!==1/0&&b!==-1/0||(S=g*k+m),e.lineTo(h,c),t.indexOf("MP")>0?e.quadraticCurveTo(k,S,f,d):e.arcTo(k,S,f,d,i)},k=function(t,e,i,n,r,o,s,a){i||(i=s);var u=w(90/Math.PI/n*s),h=w(90/Math.PI/i*s),c=r+u,l=o-u,f=r+h,d=o-h;e.beginPath(),e.fillStyle=a,e.moveTo.apply(e,x(c,n)),I(t,e,n,c,l,!0),d>f?I(t,e,i,f,d,!1):e.lineTo.apply(e,x((r+o)/2,s/2/Math.abs(Math.sin((r-o)/2)))),e.closePath(),e.fill()},S=function(t,e,i,n,r,o,s){var a=Math.min(n,r);o>a/2&&(o=a/2),t.beginPath(),t.fillStyle=s,t.moveTo(e+o,i),t.lineTo(e+o,i),t.lineTo(e+n-o,i),t.quadraticCurveTo(e+n,i,e+n,i+o),t.lineTo(e+n,i+r-o),t.quadraticCurveTo(e+n,i+r,e+n-o,i+r),t.lineTo(e+o,i+r),t.quadraticCurveTo(e,i+r,e,i+r-o),t.lineTo(e,i+o),t.quadraticCurveTo(e,i,e+o,i),t.closePath(),t.fill()},C={easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*(t/=n)*(t-2)+e}},T={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*Math.cos(t/n*(Math.PI/2))+i+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sin(t/n*(Math.PI/2))+e}},W={easeIn:function(t,e,i,n){return t>=n&&(t=n),0==t?e:i*Math.pow(2,10*(t/n-1))+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),t==n?e+i:i*(1-Math.pow(2,-10*t/n))+e}},O={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*(Math.sqrt(1-(t/=n)*t)-1)+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sqrt(1-(t=t/n-1)*t)+e}},_=Object.freeze({__proto__:null,quad:C,cubic:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t+1)+e}},quart:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*((t=t/n-1)*t*t*t-1)+e}},quint:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t*t*t+1)+e}},sine:T,expo:W,circ:O}),E=function(t){function o(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;return r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:"0px",offsetDegree:0,speed:20,speedFunction:"quad",accelerationTime:2500,decelerationTime:2500,stopRange:.8},r.defaultStyle={},r._defaultStyle={fontSize:"18px",fontColor:"#000",fontStyle:"sans-serif",fontWeight:"400",lineHeight:"",background:"rgba(0,0,0,0)",wordWrap:!0,lengthLimit:"90%"},r.Radius=0,r.prizeRadius=0,r.prizeDeg=0,r.prizeRadian=0,r.rotateDeg=0,r.maxBtnRadius=0,r.startTime=0,r.endTime=0,r.stopDeg=0,r.endDeg=0,r.FPS=16.6,r.blockImgs=[[]],r.prizeImgs=[[]],r.btnImgs=[[]],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:r.buttons.map((function(t){return t.imgs}))}),r}return e(o,t),o.prototype.initData=function(t){this.$set(this,"blocks",t.blocks||[]),this.$set(this,"prizes",t.prizes||[]),this.$set(this,"buttons",t.buttons||[]),this.$set(this,"defaultConfig",t.defaultConfig||{}),this.$set(this,"defaultStyle",t.defaultStyle||{}),this.$set(this,"startCallback",t.start),this.$set(this,"endCallback",t.end)},o.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",(function(){return i({gutter:"0px",offsetDegree:0,speed:20,speedFunction:"quad",accelerationTime:2500,decelerationTime:2500,stopRange:.8},t.defaultConfig)})),this.$computed(this,"_defaultStyle",(function(){return i({fontSize:"18px",fontColor:"#000",fontStyle:"sans-serif",fontWeight:"400",background:"rgba(0,0,0,0)",wordWrap:!0,lengthLimit:"90%"},t.defaultStyle)}))},o.prototype.initWatch=function(){var t=this;this.$watch("blocks",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("prizes",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("buttons",(function(e){return t.init({btnImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("defaultConfig",(function(){return t.draw()}),{deep:!0}),this.$watch("defaultStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("startCallback",(function(){return t.init({})})),this.$watch("endCallback",(function(){return t.init({})}))},o.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this.config,s=this.ctx;this.Radius=Math.min(this.boxWidth,this.boxHeight)/2,null===(i=o.beforeInit)||void 0===i||i.call(this),s.translate(this.Radius,this.Radius),this.draw(),this.draw(),Object.keys(e).forEach((function(t){var i=t,n={blockImgs:"blocks",prizeImgs:"prizes",btnImgs:"buttons"}[i],o=e[i];o&&o.forEach((function(t,e){t&&t.forEach((function(t,o){r.loadAndCacheImg(n,e,i,o,(function(){r.draw()}))}))}))})),null===(n=o.afterInit)||void 0===n||n.call(this)},o.prototype.handleClick=function(t){var e,i=this.ctx;i.beginPath(),i.arc(0,0,this.maxBtnRadius,0,2*Math.PI,!1),i.isPointInPath(t.offsetX,t.offsetY)&&(this.startTime||null===(e=this.startCallback)||void 0===e||e.call(this,t))},o.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u=this;return r(this,(function(r){return(n=this[t][e])&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),this.loadImg(a.src,a).then((function(t){u[i][e][o]=t,s.call(u)})).catch((function(i){console.error(t+"["+e+"].imgs["+o+"] "+i)})),[2]):[2]}))}))},o.prototype.computedWidthAndHeight=function(t,e,i,n){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var r=this.getWidth(e.width,i);return[r,t.height*(r/t.width)]}if(!e.width&&e.height){var o=this.getHeight(e.height,n);return[t.width*(o/t.height),o]}return[this.getWidth(e.width,i),this.getHeight(e.height,n)]},o.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,o=n.ctx,s=n._defaultConfig,h=n._defaultStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,o),o.clearRect(-this.Radius,-this.Radius,2*this.Radius,2*this.Radius),this.prizeRadius=this.blocks.reduce((function(t,e,n){return u(e.background)&&(o.beginPath(),o.fillStyle=e.background,o.arc(0,0,t,0,2*Math.PI,!1),o.fill()),e.imgs&&e.imgs.forEach((function(e,r){if(i.blockImgs[n]){var s=i.blockImgs[n][r];if(s){var a=i.computedWidthAndHeight(s,e,2*t,2*t),u=a[0],h=a[1],c=[i.getOffsetX(u),i.getHeight(e.top,2*t)-t],l=c[0],f=c[1];o.save(),e.rotate&&o.rotate(w(i.rotateDeg)),i.drawImage(s,l,f,u,h),o.restore()}}})),t-i.getLength(e.padding&&e.padding.split(" ")[0])}),this.Radius),this.prizeDeg=360/this.prizes.length,this.prizeRadian=w(this.prizeDeg);var c=w(-90+this.rotateDeg+s.offsetDegree),l=function(t){return i.getOffsetX(o.measureText(t).width)},f=function(t,e,n){var r=t.lineHeight||h.lineHeight||t.fontSize||h.fontSize;return i.getHeight(t.top,e)+(n+1)*i.getLength(r)};o.save(),this.prizes.forEach((function(t,e){var n=c+e*i.prizeRadian,d=i.prizeRadius-i.maxBtnRadius,p=t.background||h.background;u(p)&&function(t,e,i,n,r,o,s,a){s?k(t,e,i,n,r,o,s,a):(e.beginPath(),e.fillStyle=a,e.moveTo(0,0),e.arc(0,0,n,r,o,!1),e.closePath(),e.fill())}(r.flag,o,i.maxBtnRadius,i.prizeRadius,n-i.prizeRadian/2,n+i.prizeRadian/2,i.getLength(s.gutter),p);var g=Math.cos(n)*i.prizeRadius,m=Math.sin(n)*i.prizeRadius;o.translate(g,m),o.rotate(n+w(90)),t.imgs&&t.imgs.forEach((function(t,n){if(i.prizeImgs[e]){var r=i.prizeImgs[e][n];if(r){var o=i.computedWidthAndHeight(r,t,i.prizeRadian*i.prizeRadius,d),s=o[0],a=o[1],u=[i.getOffsetX(s),i.getHeight(t.top,d)],h=u[0],c=u[1];i.drawImage(r,h,c,s,a)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,n=t.fontWeight||h.fontWeight,r=i.getLength(t.fontSize||h.fontSize),u=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=n+" "+(r>>0)+"px "+u;var c=[],p=String(t.text);if(Object.prototype.hasOwnProperty.call(t,"wordWrap")?t.wordWrap:h.wordWrap){p=a(p);for(var g="",m=0;m<p.length;m++){g+=p[m];var v=o.measureText(g).width,b=(i.prizeRadius-f(t,d,c.length))*Math.tan(i.prizeRadian/2)*2-i.getLength(s.gutter);v>i.getWidth(t.lengthLimit||h.lengthLimit,b)&&(c.push(g.slice(0,-1)),g=p[m])}g&&c.push(g),c.length||c.push(p)}else c=p.split("\n");c.filter((function(t){return!!t})).forEach((function(e,i){o.fillText(e,l(e),f(t,d,i))}))})),o.rotate(w(360)-n-w(90)),o.translate(-g,-m)})),o.restore(),this.buttons.forEach((function(t,e){var n=i.getHeight(t.radius);i.maxBtnRadius=Math.max(i.maxBtnRadius,n),u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.arc(0,0,n,0,2*Math.PI,!1),o.fill()),t.pointer&&u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.moveTo(-n,0),o.lineTo(n,0),o.lineTo(0,2*-n),o.closePath(),o.fill()),t.imgs&&t.imgs.forEach((function(t,r){if(i.btnImgs[e]){var o=i.btnImgs[e][r];if(o){var s=i.computedWidthAndHeight(o,t,2*n,2*n),a=s[0],u=s[1],h=[i.getOffsetX(a),i.getHeight(t.top,n)],c=h[0],l=h[1];i.drawImage(o,c,l,a,u)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,r=t.fontWeight||h.fontWeight,s=i.getLength(t.fontSize||h.fontSize),a=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=r+" "+(s>>0)+"px "+a,String(t.text).split("\n").forEach((function(e,i){o.fillText(e,l(e),f(t,n,i))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,o)},o.prototype.play=function(){this.startTime||(this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},o.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.rotateDeg=this.prizeDeg/2-this._defaultConfig.offsetDegree,this.draw())},o.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.prizeFlag,r=e.prizeDeg,o=e.rotateDeg,s=e._defaultConfig,a=Date.now()-this.startTime;if(a>=s.accelerationTime&&void 0!==n){this.FPS=a/t,this.endTime=Date.now(),this.stopDeg=o;for(var u=(Math.random()*r-r/2)*this.getLength(s.stopRange),h=0;++h;){var c=360*h-n*r-o-s.offsetDegree+u;if(_[s.speedFunction].easeOut(this.FPS,this.stopDeg,c,s.decelerationTime)-this.stopDeg>s.speed){this.endDeg=c;break}}return this.slowDown()}this.rotateDeg=(o+_[s.speedFunction].easeIn(a,0,s.speed,s.accelerationTime))%360,this.draw(),i(this.run.bind(this,t+1))},o.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopDeg,a=e.endDeg,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>=u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.rotateDeg=_[u.speedFunction].easeOut(h,s,a,u.decelerationTime)%360,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},o.prototype.getWidth=function(t,e){return void 0===e&&(e=this.prizeRadian*this.prizeRadius),s(t,"number")?t:s(t,"string")?this.changeUnits(t,e):0},o.prototype.getHeight=function(t,e){return void 0===e&&(e=this.prizeRadius),s(t,"number")?t:s(t,"string")?this.changeUnits(t,e):0},o.prototype.getOffsetX=function(t){return-t/2},o.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr-this.Radius,e/i.dpr-this.Radius]},o}(y),P=function(t){function h(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;r.rows=3,r.cols=3,r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},r.defaultStyle={},r._defaultStyle={borderRadius:20,fontColor:"#000",fontSize:"18px",fontStyle:"sans-serif",fontWeight:"400",lineHeight:"",background:"rgba(0,0,0,0)",shadow:"",wordWrap:!0,lengthLimit:"90%"},r.activeStyle={},r._activeStyle={background:"#ffce98",shadow:"",fontStyle:"",fontWeight:"",fontSize:"",lineHeight:"",fontColor:""},r.cellWidth=0,r.cellHeight=0,r.startTime=0,r.endTime=0,r.currIndex=0,r.stopIndex=0,r.endIndex=0,r.demo=!1,r.timer=0,r.FPS=16.6,r.prizeFlag=-1,r.cells=[],r.blockImgs=[[]],r.btnImgs=[[]],r.prizeImgs=[],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r);var o=r.buttons.map((function(t){return t.imgs}));return r.button&&o.push(r.button.imgs),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:o}),r}return e(h,t),h.prototype.initData=function(t){this.$set(this,"rows",Number(t.rows)||3),this.$set(this,"cols",Number(t.cols)||3),this.$set(this,"blocks",t.blocks||[]),this.$set(this,"prizes",t.prizes||[]),this.$set(this,"buttons",t.buttons||[]),this.$set(this,"button",t.button),this.$set(this,"defaultConfig",t.defaultConfig||{}),this.$set(this,"defaultStyle",t.defaultStyle||{}),this.$set(this,"activeStyle",t.activeStyle||{}),this.$set(this,"startCallback",t.start),this.$set(this,"endCallback",t.end)},h.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",(function(){var e=i({gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},t.defaultConfig);return e.gutter=t.getLength(e.gutter),e.speed=e.speed/40,e})),this.$computed(this,"_defaultStyle",(function(){return i({borderRadius:20,fontColor:"#000",fontSize:"18px",fontStyle:"sans-serif",fontWeight:"400",background:"rgba(0,0,0,0)",shadow:"",wordWrap:!0,lengthLimit:"90%"},t.defaultStyle)})),this.$computed(this,"_activeStyle",(function(){return i({background:"#ffce98",shadow:""},t.activeStyle)}))},h.prototype.initWatch=function(){var t=this;this.$watch("blocks",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("prizes",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("buttons",(function(e){var i=e.map((function(t){return t.imgs}));return t.button&&i.push(t.button.imgs),t.init({btnImgs:i})}),{deep:!0}),this.$watch("button",(function(){var e=t.buttons.map((function(t){return t.imgs}));return t.button&&e.push(t.button.imgs),t.init({btnImgs:e})}),{deep:!0}),this.$watch("rows",(function(){return t.init({})})),this.$watch("cols",(function(){return t.init({})})),this.$watch("defaultConfig",(function(){return t.draw()}),{deep:!0}),this.$watch("defaultStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("activeStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("startCallback",(function(){return t.init({})})),this.$watch("endCallback",(function(){return t.init({})}))},h.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this,s=o.config;o.ctx,o.button,null===(i=s.beforeInit)||void 0===i||i.call(this),this.draw(),Object.keys(e).forEach((function(t){var i=t,n=e[i],o={blockImgs:"blocks",prizeImgs:"prizes",btnImgs:"buttons"}[i];n&&n.forEach((function(t,e){t&&t.forEach((function(t,n){r.loadAndCacheImg(o,e,i,n,(function(){r.draw()}))}))}))})),null===(n=s.afterInit)||void 0===n||n.call(this)},h.prototype.handleClick=function(t){var e=this,i=this.ctx;o(o([],this.buttons),[this.button]).forEach((function(n){var r;if(n){var o=e.getGeometricProperty([n.x,n.y,n.col||1,n.row||1]),s=o[0],a=o[1],u=o[2],h=o[3];i.beginPath(),i.rect(s,a,u,h),i.isPointInPath(t.offsetX,t.offsetY)&&(e.startTime||("function"==typeof n.callback&&n.callback.call(e,n),null===(r=e.startCallback)||void 0===r||r.call(e,t,n)))}}))},h.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u,h=this;return r(this,(function(r){return n=this[t][e],"buttons"===t&&!this.buttons.length&&this.button&&(n=this.button),n&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),u=[this.loadImg(a.src,a),a.activeSrc&&this.loadImg(a.activeSrc,a,"$activeResolve")],Promise.all(u).then((function(t){var n=t[0],r=t[1];h[i][e][o]={defaultImg:n,activeImg:r},s.call(h)})).catch((function(i){console.error(t+"["+e+"].imgs["+o+"] "+i)})),[2]):[2]}))}))},h.prototype.computedWidthAndHeight=function(t,e,i){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var n=this.getWidth(e.width,i.col);return[n,t.height*(n/t.width)]}if(!e.width&&e.height){var r=this.getHeight(e.height,i.row);return[t.width*(r/t.height),r]}return[this.getWidth(e.width,i.col),this.getHeight(e.height,i.row)]},h.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,h=n.ctx,c=n._defaultConfig,l=n._defaultStyle,f=n._activeStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,h),h.clearRect(0,0,this.boxWidth,this.boxHeight),this.cells=o(o([],this.prizes),this.buttons),this.button&&this.cells.push(this.button),this.cells.forEach((function(t){t.col=t.col||1,t.row=t.row||1})),this.prizeArea=this.blocks.reduce((function(t,e){var n=t.x,r=t.y,o=t.w,a=t.h,c=function(t){var e,i=(null===(e=t.padding)||void 0===e?void 0:e.replace(/px/g,"").split(" ").map((function(t){return~~t})))||[0],n=0,r=0,o=0,a=0;switch(i.length){case 1:n=r=o=a=i[0];break;case 2:n=r=i[0],o=a=i[1];break;case 3:n=i[0],o=a=i[1],r=i[2];break;default:n=i[0],r=i[1],o=i[2],a=i[3]}var u={paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:a};for(var h in u)u[h]=Object.prototype.hasOwnProperty.call(t,h)&&s(t[h],"string","number")?~~String(t[h]).replace(/px/g,""):u[h];return[n,r,o,a]}(e),f=c[0],d=c[1],p=c[2],g=c[3],m=e.borderRadius?i.getLength(e.borderRadius):0,v=e.background||l.background;return u(v)&&S(h,n,r,o,a,m,i.handleBackground(n,r,o,a,v)),{x:n+p,y:r+f,w:o-p-g,h:a-f-d}}),{x:0,y:0,w:this.boxWidth,h:this.boxHeight}),this.cellWidth=(this.prizeArea.w-c.gutter*(this.cols-1))/this.cols,this.cellHeight=(this.prizeArea.h-c.gutter*(this.rows-1))/this.rows,this.cells.forEach((function(t,e){var n=i.getGeometricProperty([t.x,t.y,t.col,t.row]),o=n[0],s=n[1],c=n[2],d=n[3],p=!1;(void 0===i.prizeFlag||i.prizeFlag>-1)&&(p=e===i.currIndex%i.prizes.length>>0);var g=p?f.background:t.background||l.background;if(u(g)){var m=(p?f.shadow:t.shadow||l.shadow).replace(/px/g,"").split(",")[0].split(" ").map((function(t,e){return e<3?Number(t):t}));4===m.length&&(h.shadowColor=m[3],h.shadowOffsetX=m[0]*r.dpr,h.shadowOffsetY=m[1]*r.dpr,h.shadowBlur=m[2],m[0]>0?c-=m[0]:(c+=m[0],o-=m[0]),m[1]>0?d-=m[1]:(d+=m[1],s-=m[1])),S(h,o,s,c,d,i.getLength(t.borderRadius?t.borderRadius:l.borderRadius),i.handleBackground(o,s,c,d,g)),h.shadowColor="rgba(0, 0, 0, 0)",h.shadowOffsetX=0,h.shadowOffsetY=0,h.shadowBlur=0}var v="prizeImgs";e>=i.prizes.length&&(v="btnImgs",e-=i.prizes.length),t.imgs&&t.imgs.forEach((function(n,r){if(i[v][e]){var a=i[v][e][r];if(a){var u=p&&a.activeImg||a.defaultImg;if(u){var h=i.computedWidthAndHeight(u,n,t),c=h[0],l=h[1],f=[o+i.getOffsetX(c,t.col),s+i.getHeight(n.top,t.row)],d=f[0],g=f[1];i.drawImage(u,d,g,c,l)}}}})),t.fonts&&t.fonts.forEach((function(e){var n=p&&f.fontStyle?f.fontStyle:e.fontStyle||l.fontStyle,r=p&&f.fontWeight?f.fontWeight:e.fontWeight||l.fontWeight,u=p&&f.fontSize?i.getLength(f.fontSize):i.getLength(e.fontSize||l.fontSize),c=p&&f.lineHeight?f.lineHeight:e.lineHeight||l.lineHeight||e.fontSize||l.fontSize;h.font=r+" "+(u>>0)+"px "+n,h.fillStyle=p&&f.fontColor?f.fontColor:e.fontColor||l.fontColor;var d=[],g=String(e.text);if(Object.prototype.hasOwnProperty.call(e,"wordWrap")?e.wordWrap:l.wordWrap){g=a(g);for(var m="",v=0;v<g.length;v++){m+=g[v],h.measureText(m).width>i.getWidth(e.lengthLimit||l.lengthLimit,t.col)&&(d.push(m.slice(0,-1)),m=g[v])}m&&d.push(m),d.length||d.push(g)}else d=g.split("\n");d.forEach((function(n,r){h.fillText(n,o+i.getOffsetX(h.measureText(n).width,t.col),s+i.getHeight(e.top,t.row)+(r+1)*i.getLength(c))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,h)},h.prototype.handleBackground=function(t,e,i,n,r){var o=this.ctx;return r.includes("linear-gradient")&&(r=function(t,e,i,n,r,o){var s=/linear-gradient\((.+)\)/.exec(o)[1].split(",").map((function(t){return t.trim()})),a=s.shift(),u=[0,0,0,0];if(a.includes("deg")){var h=function(t){return Math.tan(t/180*Math.PI)};(a=a.slice(0,-3)%360)>=0&&a<45?u=[e,i+r,e+n,i+r-n*h(a-0)]:a>=45&&a<90?u=[e,i+r,e+n-r*h(a-45),i]:a>=90&&a<135?u=[e+n,i+r,e+n-r*h(a-90),i]:a>=135&&a<180?u=[e+n,i+r,e,i+n*h(a-135)]:a>=180&&a<225?u=[e+n,i,e,i+n*h(a-180)]:a>=225&&a<270?u=[e+n,i,e+r*h(a-225),i+r]:a>=270&&a<315?u=[e,i,e+r*h(a-270),i+r]:a>=315&&a<360&&(u=[e,i,e+n,i+r-n*h(a-315)])}else a.includes("top")?u=[e,i+r,e,i]:a.includes("bottom")?u=[e,i,e,i+r]:a.includes("left")?u=[e+n,i,e,i]:a.includes("right")&&(u=[e,i,e+n,i]);var c=t.createLinearGradient.apply(t,u.map((function(t){return t>>0})));return s.reduce((function(t,e,i){var n=e.split(" ");return 1===n.length?t.addColorStop(i,n[0]):2===n.length&&t.addColorStop.apply(t,n),t}),c)}(o,t,e,i,n,r)),r},h.prototype.play=function(){var t=this.config.clearInterval;this.startTime||(t(this.timer),this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},h.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.currIndex=0,this.draw())},h.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.currIndex,r=e.prizes,o=e.prizeFlag,s=e.startTime,a=e._defaultConfig,u=Date.now()-s;if(u>=a.accelerationTime&&void 0!==o){this.FPS=u/t,this.endTime=Date.now(),this.stopIndex=n;for(var h=0;++h;){var c=r.length*h+o-(n>>0);if(C.easeOut(this.FPS,this.stopIndex,c,a.decelerationTime)-this.stopIndex>a.speed){this.endIndex=c;break}}return this.slowDown()}this.currIndex=(n+C.easeIn(u,.1,a.speed,a.accelerationTime))%r.length,this.draw(),i(this.run.bind(this,t+1))},h.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopIndex,a=e.endIndex,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.currIndex=C.easeOut(h,s,a,u.decelerationTime)%r.length,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},h.prototype.walk=function(){var t=this,e=this.config,i=e.setInterval;(0,e.clearInterval)(this.timer),this.timer=i((function(){t.currIndex+=1,t.draw()}),1300)},h.prototype.getGeometricProperty=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=this.cellWidth,s=this.cellHeight,a=this._defaultConfig.gutter,u=[this.prizeArea.x+(o+a)*e,this.prizeArea.y+(s+a)*i];return n&&r&&u.push(o*n+a*(n-1),s*r+a*(r-1)),u},h.prototype.getWidth=function(t,e){return void 0===e&&(e=1),s(t,"number")?t:s(t,"string")?this.changeUnits(t,this.cellWidth*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getHeight=function(t,e){return void 0===e&&(e=1),s(t,"number")?t:s(t,"string")?this.changeUnits(t,this.cellHeight*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getOffsetX=function(t,e){return void 0===e&&(e=1),(this.cellWidth*e+this._defaultConfig.gutter*(e-1)-t)/2},h.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr,e/i.dpr]},h}(y);exports.LuckyGrid=P,exports.LuckyWheel=E;
  109 +
  110 +
  111 +/***/ }),
  112 +/* 1 */
  113 +/***/ (function(module, exports, __webpack_require__) {
  114 +
  115 +"use strict";
  116 +
  117 +
  118 +exports.__esModule = true;
  119 +exports.getImage = getImage;
  120 +var windowWidth = wx.getSystemInfoSync().windowWidth;
  121 +
  122 +var rpx2px = exports.rpx2px = function rpx2px(value) {
  123 + if (typeof value === 'string') value = Number(value.replace(/[a-z]*/g, ''));
  124 + return windowWidth / 750 * value;
  125 +};
  126 +
  127 +var changeUnits = exports.changeUnits = function changeUnits(value) {
  128 + return Number(value.replace(/^(\-*[0-9.]*)([a-z%]*)$/, function (value, num, unit) {
  129 + switch (unit) {
  130 + case 'px':
  131 + num *= 1;
  132 + break;
  133 + case 'rpx':
  134 + num = rpx2px(num);
  135 + break;
  136 + default:
  137 + num *= 1;
  138 + break;
  139 + }
  140 + return num;
  141 + }));
  142 +};
  143 +
  144 +var resolveImage = exports.resolveImage = function resolveImage(e, img, canvas) {
  145 + var srcName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'src';
  146 + var resolveName = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : '$resolve';
  147 +
  148 + var imgObj = canvas.createImage();
  149 + imgObj.onload = function () {
  150 + img[resolveName](imgObj);
  151 + };
  152 + imgObj.src = img[srcName];
  153 +};
  154 +
  155 +function getImage() {
  156 + var _this = this;
  157 +
  158 + return new Promise(function (resolve, reject) {
  159 + wx.canvasToTempFilePath({
  160 + canvas: _this.canvas,
  161 + success: function success(res) {
  162 + return resolve(res);
  163 + },
  164 + fail: function fail(err) {
  165 + return reject(err);
  166 + }
  167 + });
  168 + });
  169 +}
  170 +
  171 +/***/ }),
  172 +/* 2 */
  173 +/***/ (function(module, exports, __webpack_require__) {
  174 +
  175 +"use strict";
  176 +
  177 +
  178 +var _luckyCanvasCjs = __webpack_require__(0);
  179 +
  180 +var _utils = __webpack_require__(1);
  181 +
  182 +Component({
  183 + properties: {
  184 + hiddenCanvas: { type: Boolean, value: false},
  185 + width: { type: String, value: '600rpx' },
  186 + height: { type: String, value: '600rpx' },
  187 + blocks: { type: Array, value: [] },
  188 + prizes: { type: Array, value: [] },
  189 + buttons: { type: Array, value: [] },
  190 + defaultConfig: { type: Object, value: {} },
  191 + defaultStyle: { type: Object, value: {} },
  192 + start: { type: Function, value: function value() {} },
  193 + end: { type: Function, value: function value() {} }
  194 + },
  195 + data: {
  196 + isShow: false,
  197 + luckyImg: '',
  198 + showCanvas: true
  199 + },
  200 + observers: {
  201 + 'blocks.**': function blocks(newData, oldData) {
  202 + this.$lucky && (this.$lucky.blocks = newData);
  203 + },
  204 + 'prizes.**': function prizes(newData, oldData) {
  205 + this.$lucky && (this.$lucky.prizes = newData);
  206 + },
  207 + 'buttons.**': function buttons(newData, oldData) {
  208 + this.$lucky && (this.$lucky.buttons = newData);
  209 + }
  210 + },
  211 + ready: function ready() {
  212 + var _this = this;
  213 +
  214 + wx.createSelectorQuery().in(this).select('#lucky-wheel').fields({
  215 + node: true, size: true
  216 + }).exec(function (res) {
  217 + if (!res[0] || !res[0].node) {
  218 + return console.error('lucky-canvas 获取不到 canvas 标签');
  219 + }
  220 + var canvas = _this.canvas = res[0].node;
  221 + var dpr = _this.dpr = wx.getSystemInfoSync().pixelRatio;
  222 + var ctx = _this.ctx = canvas.getContext('2d');
  223 + var data = _this.data;
  224 + canvas.width = res[0].width * dpr;
  225 + canvas.height = res[0].height * dpr;
  226 + ctx.scale(dpr, dpr);
  227 + _this.$lucky = new _luckyCanvasCjs.LuckyWheel({
  228 + flag: 'MP-WX',
  229 + ctx: ctx,
  230 + dpr: dpr,
  231 + width: res[0].width,
  232 + height: res[0].height,
  233 + // rAF: canvas.requestAnimationFrame, // 帧动画真机调试会报错!
  234 + setTimeout: setTimeout,
  235 + clearTimeout: clearTimeout,
  236 + setInterval: setInterval,
  237 + clearInterval: clearInterval,
  238 + beforeCreate: function beforeCreate() {
  239 + var Radius = Math.min(this.config.width, this.config.height) / 2;
  240 + // 设置坐标轴
  241 + ctx.translate(Radius, Radius);
  242 + },
  243 + beforeInit: function beforeInit() {
  244 + // 重置坐标轴
  245 + ctx.translate(-this.Radius, -this.Radius);
  246 + },
  247 + unitFunc: function unitFunc(num, unit) {
  248 + return (0, _utils.changeUnits)(num + unit);
  249 + }
  250 + }, {
  251 + blocks: data.blocks,
  252 + prizes: data.prizes,
  253 + buttons: data.buttons,
  254 + defaultConfig: data.defaultConfig,
  255 + defaultStyle: data.defaultStyle,
  256 + start: function start() {
  257 + for (var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++) {
  258 + rest[_key] = arguments[_key];
  259 + }
  260 +
  261 + _this.triggerEvent.apply(_this, ['start'].concat(rest));
  262 + },
  263 + end: function end() {
  264 + for (var _len2 = arguments.length, rest = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  265 + rest[_key2] = arguments[_key2];
  266 + }
  267 +
  268 + _this.triggerEvent.apply(_this, ['end'].concat(rest));
  269 + _utils.getImage.call(_this).then(function (res) {
  270 + _this.setData({ luckyImg: res.tempFilePath });
  271 + });
  272 + }
  273 + });
  274 + // 为了保证 onload 回调准确
  275 + _this.setData({ isShow: true });
  276 + });
  277 + },
  278 +
  279 + methods: {
  280 + imgBindload: function imgBindload(e) {
  281 + var _e$currentTarget$data = e.currentTarget.dataset,
  282 + name = _e$currentTarget$data.name,
  283 + index = _e$currentTarget$data.index,
  284 + i = _e$currentTarget$data.i;
  285 +
  286 + var img = this.data[name][index].imgs[i];
  287 + (0, _utils.resolveImage)(e, img, this.canvas);
  288 + },
  289 + luckyImgLoad: function luckyImgLoad() {
  290 + this.showCanvas = false;
  291 + },
  292 + handleClickOfImg: function handleClickOfImg(e) {
  293 + var _this2 = this;
  294 +
  295 + var _e$changedTouches$ = e.changedTouches[0],
  296 + x = _e$changedTouches$.clientX,
  297 + y = _e$changedTouches$.clientY;
  298 +
  299 + wx.createSelectorQuery().in(this).select('.lucky-img').fields({
  300 + rect: true
  301 + }).exec(function (res) {
  302 + var _res$ = res[0],
  303 + left = _res$.left,
  304 + top = _res$.top;
  305 +
  306 + _this2.toPlay(x - left, y - top);
  307 + });
  308 + },
  309 + handleClickOfCanvas: function handleClickOfCanvas(e) {
  310 + var _e$changedTouches$2 = e.changedTouches[0],
  311 + x = _e$changedTouches$2.x,
  312 + y = _e$changedTouches$2.y;
  313 +
  314 + this.toPlay(x, y);
  315 + },
  316 + toPlay: function toPlay(x, y) {
  317 + var ctx = this.ctx;
  318 + ctx.beginPath();
  319 + ctx.arc(0, 0, this.$lucky.maxBtnRadius, 0, Math.PI * 2, false);
  320 + if (!ctx.isPointInPath(x * this.dpr, y * this.dpr)) return;
  321 + // 隐藏图片并显示canvas
  322 + this.showCanvas = true;
  323 + this.setData({ luckyImg: '' });
  324 + // 触发 lucky-canvas 的抽奖逻辑
  325 + this.$lucky.startCallback();
  326 + },
  327 + play: function play() {
  328 + var _$lucky;
  329 +
  330 + (_$lucky = this.$lucky).play.apply(_$lucky, arguments);
  331 + },
  332 + stop: function stop() {
  333 + var _$lucky2;
  334 +
  335 + (_$lucky2 = this.$lucky).stop.apply(_$lucky2, arguments);
  336 + }
  337 + }
  338 +});
  339 +
  340 +/***/ })
  341 +/******/ ]);
  342 +//# sourceMappingURL=index.js.map
0 343 \ No newline at end of file
... ...
packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.js.map 0 → 100644
  1 +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/lucky-canvas/dist/lucky-canvas.cjs.min.js","webpack:///./src/utils.js","webpack:///./src/lucky-wheel/index.js"],"names":["getImage","windowWidth","wx","getSystemInfoSync","rpx2px","value","Number","replace","changeUnits","num","unit","resolveImage","e","img","canvas","srcName","resolveName","imgObj","createImage","onload","src","Promise","resolve","reject","canvasToTempFilePath","success","res","fail","err","Component","properties","width","type","String","height","blocks","Array","prizes","buttons","defaultConfig","Object","defaultStyle","start","Function","end","data","isShow","luckyImg","showCanvas","observers","newData","oldData","$lucky","ready","createSelectorQuery","in","select","fields","node","size","exec","console","error","dpr","pixelRatio","ctx","getContext","scale","LuckyWheel","flag","setTimeout","clearTimeout","setInterval","clearInterval","beforeCreate","Radius","Math","min","config","translate","beforeInit","unitFunc","rest","triggerEvent","call","then","setData","tempFilePath","methods","imgBindload","currentTarget","dataset","name","index","i","imgs","luckyImgLoad","handleClickOfImg","changedTouches","x","clientX","y","clientY","rect","left","top","toPlay","handleClickOfCanvas","beginPath","arc","maxBtnRadius","PI","isPointInPath","startCallback","play","stop"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFa,4CAA4C,SAAS;AAClE;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iCAAiC,aAAa,gCAAgC,cAAc,gBAAgB,sEAAsE,QAAQ,gBAAgB,wHAAwH,aAAa,mBAAmB,6EAA6E,iBAAiB,oCAAoC,iCAAiC,IAAI,uFAAuF,SAAS,yBAAyB,oBAAoB,0CAA0C,cAAc,IAAI,aAAa,SAAS,MAAM,cAAc,IAAI,cAAc,SAAS,MAAM,cAAc,MAAM,iEAAiE,KAAK,cAAc,+BAA+B,GAAG,gBAAgB,eAAe,wBAAwB,qBAAqB,YAAY,iBAAiB,UAAU,iCAAiC,2DAA2D,YAAY,IAAI,cAAc,mBAAmB,mBAAmB,4DAA4D,KAAK,EAAE,KAAK,kHAAkH,yCAAyC,kBAAkB,MAAM,yBAAyB,oBAAoB,8BAA8B,SAAS,kCAAkC,SAAS,0EAA0E,IAAI,SAAS,yCAAyC,aAAa,MAAM,2BAA2B,iBAAiB,MAAM,oBAAoB,2BAA2B,MAAM,+BAA+B,SAAS,cAAc,SAAS,YAAY,QAAQ,MAAM,qBAAqB,OAAO,gCAAgC,UAAU,gBAAgB,kCAAkC,IAAI,kBAAkB,SAAS,oEAAoE,kFAAkF,sEAAsE,kBAAkB,mEAAmE,kCAAkC,4EAA4E,2BAA2B,IAAI,EAAE,WAAW,4BAA4B,MAAM,EAAE,kBAAkB,iBAAiB,mBAAmB,wBAAwB,2BAA2B,uEAAuE,GAAG,eAAe,oCAAoC,eAAe,YAAY,eAAe,+BAA+B,6DAA6D,oBAAoB,6BAA6B,4JAA4J,MAAM,SAAS,cAAc,aAAa,aAAa,sCAAsC,yCAAyC,+BAA+B,+BAA+B,WAAW,GAAG,GAAG,qBAAqB,oBAAoB,2BAA2B,mDAAmD,EAAE,yCAAyC,gFAAgF,gBAAgB,iBAAiB,mBAAmB,sBAAsB,4CAA4C,8EAA8E,GAAG,iBAAiB,cAAc,6HAA6H,YAAY,iBAAiB,oCAAoC,oCAAoC,YAAY,GAAG,GAAG,GAAG,cAAc,wEAAwE,kBAAkB,mDAAmD,4BAA4B,0BAA0B,sCAAsC,WAAW,2BAA2B,eAAe,oBAAoB,kEAAkE,iBAAiB,2DAA2D,GAAG,qBAAqB,oBAAoB,iBAAiB,0GAA0G,OAAO,sBAAsB,WAAW,KAAK,WAAW,kCAAkC,KAAK,yBAAyB,MAAM,mBAAmB,+BAA+B,YAAY,MAAM,oCAAoC,kCAAkC,cAAc,gDAAgD,8BAA8B,kBAAkB,2DAA2D,WAAW,KAAK,IAAI,KAAK,oBAAoB,+BAA+B,8BAA8B,2CAA2C,GAAG,gBAAgB,cAAc,WAAW,0CAA0C,+EAA+E,KAAK,qBAAqB,mBAAmB,+eAA+e,wBAAwB,6DAA6D,4BAA4B,6DAA6D,4BAA4B,2DAA2D,0BAA0B,2HAA2H,oCAAoC,kFAAkF,sCAAsC,0CAA0C,wCAAwC,0CAA0C,0CAA0C,YAAY,+BAA+B,kBAAkB,wGAAwG,wCAAwC,oGAAoG,4CAA4C,0BAA0B,0SAA0S,2CAA2C,kBAAkB,yIAAyI,4BAA4B,+IAA+I,wBAAwB,sBAAsB,mBAAmB,qBAAqB,kBAAkB,0BAA0B,2BAA2B,mCAAmC,wHAAwH,+BAA+B,uJAAuJ,qCAAqC,WAAW,6DAA6D,0DAA0D,gBAAgB,4BAA4B,YAAY,sBAAsB,mCAAmC,YAAY,GAAG,2CAA2C,+BAA+B,uIAAuI,mCAAmC,2DAA2D,uCAAuC,WAAW,sFAAsF,OAAO,gBAAgB,iBAAiB,gBAAgB,WAAW,iBAAiB,yBAAyB,IAAI,iBAAiB,wBAAwB,kBAAkB,IAAI,kCAAkC,gCAAgC,uCAAuC,WAAW,2BAA2B,eAAe,kBAAkB,EAAE,oCAAoC,iBAAiB,wCAAwC,wBAAwB,sDAAsD,GAAG,iBAAiB,qBAAqB,iBAAiB,gEAAgE,iBAAiB,WAAW,iBAAiB,yBAAyB,MAAM,mEAAmE,cAAc,4EAA4E,2BAA2B,gIAAgI,wNAAwN,6BAA6B,SAAS,oEAAoE,6KAA6K,2BAA2B,oBAAoB,kTAAkT,IAAI,yBAAyB,gCAAgC,2BAA2B,sCAAsC,IAAI,yBAAyB,oDAAoD,2BAA2B,kDAAkD,IAAI,yBAAyB,qDAAqD,2BAA2B,yDAAyD,IAAI,yBAAyB,kDAAkD,2BAA2B,iDAAiD,kBAAkB,6BAA6B,yBAAyB,kCAAkC,2BAA2B,0CAA0C,QAAQ,yBAAyB,oCAAoC,2BAA2B,6CAA6C,QAAQ,yBAAyB,sCAAsC,2BAA2B,8CAA8C,sBAAsB,gBAAgB,gBAAgB,MAAM,iBAAiB,EAAE,2BAA2B,8DAA8D,mBAAmB,mHAAmH,kBAAkB,kBAAkB,gJAAgJ,mTAAmT,oCAAoC,cAAc,uCAAuC,cAAc,sCAAsC,cAAc,GAAG,IAAI,+CAA+C,sKAAsK,kDAAkD,8EAA8E,qCAAqC,WAAW,iDAAiD,UAAU,mHAAmH,kBAAkB,mDAAmD,UAAU,kIAAkI,iBAAiB,GAAG,kCAAkC,WAAW,kCAAkC,eAAe,6BAA6B,cAAc,GAAG,EAAE,GAAG,QAAQ,oCAAoC,eAAe,6BAA6B,cAAc,GAAG,EAAE,GAAG,QAAQ,qCAAqC,eAAe,2BAA2B,cAAc,GAAG,EAAE,GAAG,QAAQ,0CAA0C,gBAAgB,GAAG,QAAQ,yCAAyC,gBAAgB,GAAG,QAAQ,0CAA0C,gBAAgB,EAAE,yCAAyC,gBAAgB,EAAE,GAAG,8BAA8B,eAAe,4BAA4B,6BAA6B,wMAAwM,WAAW,wDAAwD,WAAW,4BAA4B,4BAA4B,sCAAsC,SAAS,GAAG,GAAG,GAAG,oDAAoD,qCAAqC,iBAAiB,4KAA4K,iDAAiD,wCAAwC,eAAe,2BAA2B,iHAAiH,uBAAuB,sBAAsB,0CAA0C,YAAY,GAAG,GAAG,sDAAsD,gDAAgD,uBAAuB,+BAA+B,+BAA+B,uBAAuB,iCAAiC,+BAA+B,4DAA4D,6BAA6B,8EAA8E,4KAA4K,4IAA4I,mBAAmB,wBAAwB,MAAM,qHAAqH,iFAAiF,qDAAqD,sFAAsF,yDAAyD,4CAA4C,mBAAmB,yDAAyD,kDAAkD,4CAA4C,oFAAoF,gCAAgC,4GAA4G,oGAAoG,4DAA4D,yEAAyE,mBAAmB,wBAAwB,MAAM,uIAAuI,yBAAyB,yCAAyC,6HAA6H,0CAA0C,0BAA0B,6EAA6E,OAAO,iBAAiB,WAAW,KAAK,QAAQ,iHAAiH,6EAA6E,iCAAiC,qBAAqB,sBAAsB,UAAU,0BAA0B,4BAA4B,GAAG,+CAA+C,mDAAmD,4BAA4B,yTAAyT,iBAAiB,sBAAsB,MAAM,iHAAiH,yBAAyB,yCAAyC,6HAA6H,4FAA4F,4BAA4B,GAAG,GAAG,sDAAsD,6BAA6B,6EAA6E,8BAA8B,8IAA8I,6BAA6B,kBAAkB,2GAA2G,sCAAsC,oDAAoD,gEAAgE,IAAI,EAAE,mCAAmC,gGAAgG,cAAc,OAAO,uBAAuB,wHAAwH,iCAAiC,kHAAkH,WAAW,+GAA+G,uBAAuB,aAAa,MAAM,gHAAgH,sBAAsB,oCAAoC,+GAA+G,qCAAqC,8FAA8F,oCAAoC,WAAW,0CAA0C,kBAAkB,gDAAgD,GAAG,kBAAkB,gBAAgB,MAAM,iBAAiB,EAAE,2BAA2B,yEAAyE,mBAAmB,8DAA8D,kBAAkB,kBAAkB,0KAA0K,iBAAiB,iBAAiB,iGAAiG,+SAA+S,iCAAiC,cAAc,GAAG,+CAA+C,oCAAoC,cAAc,uCAAuC,cAAc,aAAa,IAAI,+CAA+C,0RAA0R,kDAAkD,gDAAgD,8EAA8E,qCAAqC,WAAW,iDAAiD,SAAS,8DAA8D,kBAAkB,2DAA2D,mDAAmD,UAAU,4JAA4J,iBAAiB,kDAAkD,UAAU,+BAA+B,gBAAgB,GAAG,kCAAkC,WAAW,kCAAkC,eAAe,6BAA6B,cAAc,GAAG,EAAE,GAAG,QAAQ,oCAAoC,eAAe,6BAA6B,cAAc,GAAG,EAAE,GAAG,QAAQ,qCAAqC,yBAAyB,cAAc,GAAG,+CAA+C,UAAU,EAAE,GAAG,QAAQ,mCAAmC,iCAAiC,cAAc,GAAG,+CAA+C,UAAU,EAAE,GAAG,QAAQ,iCAAiC,gBAAgB,EAAE,kCAAkC,gBAAgB,EAAE,2CAA2C,gBAAgB,GAAG,QAAQ,yCAAyC,gBAAgB,GAAG,QAAQ,wCAAwC,gBAAgB,GAAG,QAAQ,0CAA0C,gBAAgB,EAAE,yCAAyC,gBAAgB,EAAE,GAAG,8BAA8B,eAAe,4BAA4B,sBAAsB,iHAAiH,kBAAkB,wDAAwD,IAAI,4BAA4B,4BAA4B,sCAAsC,SAAS,GAAG,GAAG,GAAG,oDAAoD,qCAAqC,sBAAsB,yDAAyD,MAAM,MAAM,sFAAsF,gMAAgM,GAAG,iDAAiD,wCAAwC,iBAAiB,2BAA2B,iQAAiQ,kBAAkB,YAAY,yBAAyB,WAAW,sBAAsB,0CAA0C,YAAY,GAAG,GAAG,oDAAoD,gDAAgD,uBAAuB,mCAAmC,+BAA+B,uBAAuB,qCAAqC,+BAA+B,oEAAoE,6BAA6B,+FAA+F,yNAAyN,8BAA8B,oDAAoD,0CAA0C,iGAAiG,UAAU,yBAAyB,iBAAiB,oBAAoB,MAAM,yBAAyB,MAAM,8BAA8B,MAAM,oCAAoC,OAAO,2DAA2D,+HAA+H,gBAAgB,4GAA4G,2DAA2D,6BAA6B,GAAG,yCAAyC,2KAA2K,qFAAqF,+EAA+E,gDAAgD,SAAS,oGAAoG,uBAAuB,GAAG,sWAAsW,kBAAkB,2FAA2F,YAAY,iBAAiB,MAAM,mCAAmC,MAAM,yHAAyH,0BAA0B,yCAAyC,kRAAkR,4FAA4F,0BAA0B,6EAA6E,OAAO,iBAAiB,WAAW,KAAK,8GAA8G,iCAAiC,qBAAqB,yBAAyB,2GAA2G,GAAG,GAAG,sDAAsD,kDAAkD,eAAe,+DAA+D,uEAAuE,gBAAgB,2BAA2B,sBAAsB,kBAAkB,gCAAgC,qVAAqV,8IAA8I,wDAAwD,YAAY,IAAI,iCAAiC,mBAAmB,qFAAqF,KAAK,iBAAiB,6BAA6B,gCAAgC,2FAA2F,8BAA8B,+FAA+F,6BAA6B,kBAAkB,0GAA0G,sCAAsC,sDAAsD,YAAY,IAAI,EAAE,0BAA0B,mFAAmF,gBAAgB,OAAO,uBAAuB,6GAA6G,iCAAiC,sHAAsH,WAAW,8GAA8G,uBAAuB,aAAa,MAAM,oGAAoG,sBAAsB,6BAA6B,yCAAyC,yDAAyD,wBAAwB,QAAQ,8CAA8C,sJAAsJ,+CAA+C,oCAAoC,+HAA+H,qCAAqC,gIAAgI,sCAAsC,iFAAiF,0CAA0C,kBAAkB,wBAAwB,GAAG,IAAI;;;;;;;;;;;QCiBpo/BA,Q,GAAAA,Q;AAhChB,IAAMC,cAAcC,GAAGC,iBAAH,GAAuBF,WAA3C;;AAEO,IAAMG,0BAAS,SAATA,MAAS,CAACC,KAAD,EAAW;AAC/B,MAAI,OAAOA,KAAP,KAAiB,QAArB,EAA+BA,QAAQC,OAAOD,MAAME,OAAN,CAAc,SAAd,EAAyB,EAAzB,CAAP,CAAR;AAC/B,SAAON,cAAc,GAAd,GAAoBI,KAA3B;AACD,CAHM;;AAKA,IAAMG,oCAAc,SAAdA,WAAc,CAACH,KAAD,EAAW;AACpC,SAAOC,OAAOD,MAAME,OAAN,CAAc,yBAAd,EAAyC,UAACF,KAAD,EAAQI,GAAR,EAAaC,IAAb,EAAsB;AAC3E,YAAQA,IAAR;AACE,WAAK,IAAL;AACED,eAAO,CAAP;AACA;AACF,WAAK,KAAL;AACEA,cAAML,OAAOK,GAAP,CAAN;AACA;AACF;AACEA,eAAO,CAAP;AACA;AATJ;AAWA,WAAOA,GAAP;AACD,GAba,CAAP,CAAP;AAcD,CAfM;;AAiBA,IAAME,sCAAe,SAAfA,YAAe,CAACC,CAAD,EAAIC,GAAJ,EAASC,MAAT,EAA+D;AAAA,MAA9CC,OAA8C,uEAApC,KAAoC;AAAA,MAA7BC,WAA6B,uEAAf,UAAe;;AACzF,MAAIC,SAASH,OAAOI,WAAP,EAAb;AACAD,SAAOE,MAAP,GAAgB,YAAM;AACpBN,QAAIG,WAAJ,EAAiBC,MAAjB;AACD,GAFD;AAGAA,SAAOG,GAAP,GAAaP,IAAIE,OAAJ,CAAb;AACD,CANM;;AAQA,SAASf,QAAT,GAAqB;AAAA;;AAC1B,SAAO,IAAIqB,OAAJ,CAAY,UAACC,OAAD,EAAUC,MAAV,EAAqB;AACtCrB,OAAGsB,oBAAH,CAAwB;AACtBV,cAAQ,MAAKA,MADS;AAEtBW,eAAS;AAAA,eAAOH,QAAQI,GAAR,CAAP;AAAA,OAFa;AAGtBC,YAAM;AAAA,eAAOJ,OAAOK,GAAP,CAAP;AAAA;AAHgB,KAAxB;AAKD,GANM,CAAP;AAOD,C;;;;;;;;;ACxCD;;AACA;;AAEAC,UAAU;AACRC,cAAY;AACVC,WAAO,EAAEC,MAAMC,MAAR,EAAgB5B,OAAO,QAAvB,EADG;AAEV6B,YAAQ,EAAEF,MAAMC,MAAR,EAAgB5B,OAAO,QAAvB,EAFE;AAGV8B,YAAQ,EAAEH,MAAMI,KAAR,EAAe/B,OAAO,EAAtB,EAHE;AAIVgC,YAAQ,EAAEL,MAAMI,KAAR,EAAe/B,OAAO,EAAtB,EAJE;AAKViC,aAAS,EAAEN,MAAMI,KAAR,EAAe/B,OAAO,EAAtB,EALC;AAMVkC,mBAAe,EAAEP,MAAMQ,MAAR,EAAgBnC,OAAO,EAAvB,EANL;AAOVoC,kBAAc,EAAET,MAAMQ,MAAR,EAAgBnC,OAAO,EAAvB,EAPJ;AAQVqC,WAAO,EAAEV,MAAMW,QAAR,EAAkBtC,OAAO,iBAAM,CAAE,CAAjC,EARG;AASVuC,SAAK,EAAEZ,MAAMW,QAAR,EAAkBtC,OAAO,iBAAM,CAAE,CAAjC;AATK,GADJ;AAYRwC,QAAM;AACJC,YAAQ,KADJ;AAEJC,cAAU,EAFN;AAGJC,gBAAY;AAHR,GAZE;AAiBRC,aAAW;AACT,iBAAa,gBAASC,OAAT,EAAkBC,OAAlB,EAA2B;AACtC,WAAKC,MAAL,KAAgB,KAAKA,MAAL,CAAYjB,MAAZ,GAAqBe,OAArC;AACD,KAHQ;AAIT,iBAAa,gBAASA,OAAT,EAAkBC,OAAlB,EAA2B;AACtC,WAAKC,MAAL,KAAgB,KAAKA,MAAL,CAAYf,MAAZ,GAAqBa,OAArC;AACD,KANQ;AAOT,kBAAc,iBAASA,OAAT,EAAkBC,OAAlB,EAA2B;AACvC,WAAKC,MAAL,KAAgB,KAAKA,MAAL,CAAYd,OAAZ,GAAsBY,OAAtC;AACD;AATQ,GAjBH;AA4BRG,OA5BQ,mBA4BA;AAAA;;AACNnD,OAAGoD,mBAAH,GAAyBC,EAAzB,CAA4B,IAA5B,EAAkCC,MAAlC,CAAyC,cAAzC,EAAyDC,MAAzD,CAAgE;AAC9DC,YAAM,IADwD,EAClDC,MAAM;AAD4C,KAAhE,EAEGC,IAFH,CAEQ,UAAClC,GAAD,EAAS;AACf,UAAI,CAACA,IAAI,CAAJ,CAAD,IAAW,CAACA,IAAI,CAAJ,EAAOgC,IAAvB,EAA6B;AAC3B,eAAOG,QAAQC,KAAR,CAAc,6BAAd,CAAP;AACD;AACD,UAAMhD,SAAS,MAAKA,MAAL,GAAcY,IAAI,CAAJ,EAAOgC,IAApC;AACA,UAAMK,MAAM,MAAKA,GAAL,GAAW7D,GAAGC,iBAAH,GAAuB6D,UAA9C;AACA,UAAMC,MAAM,MAAKA,GAAL,GAAWnD,OAAOoD,UAAP,CAAkB,IAAlB,CAAvB;AACA,UAAMrB,OAAO,MAAKA,IAAlB;AACA/B,aAAOiB,KAAP,GAAeL,IAAI,CAAJ,EAAOK,KAAP,GAAegC,GAA9B;AACAjD,aAAOoB,MAAP,GAAgBR,IAAI,CAAJ,EAAOQ,MAAP,GAAgB6B,GAAhC;AACAE,UAAIE,KAAJ,CAAUJ,GAAV,EAAeA,GAAf;AACA,YAAKX,MAAL,GAAc,IAAIgB,0BAAJ,CAAe;AAC3BC,cAAM,OADqB;AAE3BJ,gBAF2B;AAG3BF,gBAH2B;AAI3BhC,eAAOL,IAAI,CAAJ,EAAOK,KAJa;AAK3BG,gBAAQR,IAAI,CAAJ,EAAOQ,MALY;AAM3B;AACAoC,8BAP2B;AAQ3BC,kCAR2B;AAS3BC,gCAT2B;AAU3BC,oCAV2B;AAW3BC,sBAAc,wBAAY;AACxB,cAAMC,SAASC,KAAKC,GAAL,CAAS,KAAKC,MAAL,CAAY/C,KAArB,EAA4B,KAAK+C,MAAL,CAAY5C,MAAxC,IAAkD,CAAjE;AACA;AACA+B,cAAIc,SAAJ,CAAcJ,MAAd,EAAsBA,MAAtB;AACD,SAf0B;AAgB3BK,oBAAY,sBAAY;AACtB;AACAf,cAAIc,SAAJ,CAAc,CAAC,KAAKJ,MAApB,EAA4B,CAAC,KAAKA,MAAlC;AACD,SAnB0B;AAoB3BM,kBAAU,kBAACxE,GAAD,EAAMC,IAAN;AAAA,iBAAe,wBAAYD,MAAMC,IAAlB,CAAf;AAAA;AApBiB,OAAf,EAqBX;AACDyB,gBAAQU,KAAKV,MADZ;AAEDE,gBAAQQ,KAAKR,MAFZ;AAGDC,iBAASO,KAAKP,OAHb;AAIDC,uBAAeM,KAAKN,aAJnB;AAKDE,sBAAcI,KAAKJ,YALlB;AAMDC,eAAO,iBAAa;AAAA,4CAATwC,IAAS;AAATA,gBAAS;AAAA;;AAClB,gBAAKC,YAAL,eAAkB,OAAlB,SAA8BD,IAA9B;AACD,SARA;AASDtC,aAAK,eAAa;AAAA,6CAATsC,IAAS;AAATA,gBAAS;AAAA;;AAChB,gBAAKC,YAAL,eAAkB,KAAlB,SAA4BD,IAA5B;AACAlF,0BAASoF,IAAT,CAAc,KAAd,EAAoBC,IAApB,CAAyB,eAAO;AAC9B,kBAAKC,OAAL,CAAa,EAAEvC,UAAUrB,IAAI6D,YAAhB,EAAb;AACD,WAFD;AAGD;AAdA,OArBW,CAAd;AAqCA;AACA,YAAKD,OAAL,CAAa,EAAExC,QAAQ,IAAV,EAAb;AACD,KApDD;AAqDD,GAlFO;;AAmFR0C,WAAS;AACPC,eADO,uBACM7E,CADN,EACS;AAAA,kCACaA,EAAE8E,aAAF,CAAgBC,OAD7B;AAAA,UACNC,IADM,yBACNA,IADM;AAAA,UACAC,KADA,yBACAA,KADA;AAAA,UACOC,CADP,yBACOA,CADP;;AAEd,UAAMjF,MAAM,KAAKgC,IAAL,CAAU+C,IAAV,EAAgBC,KAAhB,EAAuBE,IAAvB,CAA4BD,CAA5B,CAAZ;AACA,+BAAalF,CAAb,EAAgBC,GAAhB,EAAqB,KAAKC,MAA1B;AACD,KALM;AAMPkF,gBANO,0BAMS;AACd,WAAKhD,UAAL,GAAkB,KAAlB;AACD,KARM;AASPiD,oBATO,4BASWrF,CATX,EASc;AAAA;;AAAA,+BACgBA,EAAEsF,cAAF,CAAiB,CAAjB,CADhB;AAAA,UACFC,CADE,sBACXC,OADW;AAAA,UACUC,CADV,sBACCC,OADD;;AAEnBpG,SAAGoD,mBAAH,GAAyBC,EAAzB,CAA4B,IAA5B,EAAkCC,MAAlC,CAAyC,YAAzC,EAAuDC,MAAvD,CAA8D;AAC5D8C,cAAM;AADsD,OAA9D,EAEG3C,IAFH,CAEQ,UAAClC,GAAD,EAAS;AAAA,oBACOA,IAAI,CAAJ,CADP;AAAA,YACP8E,IADO,SACPA,IADO;AAAA,YACDC,GADC,SACDA,GADC;;AAEf,eAAKC,MAAL,CAAYP,IAAIK,IAAhB,EAAsBH,IAAII,GAA1B;AACD,OALD;AAMD,KAjBM;AAkBPE,uBAlBO,+BAkBc/F,CAlBd,EAkBiB;AAAA,gCACLA,EAAEsF,cAAF,CAAiB,CAAjB,CADK;AAAA,UACdC,CADc,uBACdA,CADc;AAAA,UACXE,CADW,uBACXA,CADW;;AAEtB,WAAKK,MAAL,CAAYP,CAAZ,EAAeE,CAAf;AACD,KArBM;AAsBPK,UAtBO,kBAsBCP,CAtBD,EAsBIE,CAtBJ,EAsBO;AACZ,UAAMpC,MAAM,KAAKA,GAAjB;AACAA,UAAI2C,SAAJ;AACA3C,UAAI4C,GAAJ,CAAQ,CAAR,EAAW,CAAX,EAAc,KAAKzD,MAAL,CAAY0D,YAA1B,EAAwC,CAAxC,EAA2ClC,KAAKmC,EAAL,GAAU,CAArD,EAAwD,KAAxD;AACA,UAAI,CAAC9C,IAAI+C,aAAJ,CAAkBb,IAAI,KAAKpC,GAA3B,EAAgCsC,IAAI,KAAKtC,GAAzC,CAAL,EAAoD;AACpD;AACA,WAAKf,UAAL,GAAkB,IAAlB;AACA,WAAKsC,OAAL,CAAa,EAAEvC,UAAU,EAAZ,EAAb;AACA;AACA,WAAKK,MAAL,CAAY6D,aAAZ;AACD,KAhCM;AAiCPC,QAjCO,kBAiCO;AAAA;;AACZ,sBAAK9D,MAAL,EAAY8D,IAAZ;AACD,KAnCM;AAoCPC,QApCO,kBAoCO;AAAA;;AACZ,uBAAK/D,MAAL,EAAY+D,IAAZ;AACD;AAtCM;AAnFD,CAAV,E","file":"lucky-wheel\\index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:!0});\n/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\nvar t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};function e(e,i){if(\"function\"!=typeof i&&null!==i)throw new TypeError(\"Class extends value \"+String(i)+\" is not a constructor or null\");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function n(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function r(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError(\"Generator is already executing.\");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function o(t,e){for(var i=0,n=e.length,r=t.length;i<n;i++,r++)t[r]=e[i];return t}String.prototype.includes||(String.prototype.includes=function(t,e){return\"number\"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),Array.prototype.find||Object.defineProperty(Array.prototype,\"find\",{value:function(t){if(null==this)throw new TypeError('\"this\" is null or not defined');var e=Object(this),i=e.length>>>0;if(\"function\"!=typeof t)throw new TypeError(\"predicate must be a function\");for(var n=arguments[1],r=0;r<i;){var o=e[r];if(t.call(n,o,r,e))return o;r++}}});var s=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.some((function(e){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()===e}))},a=function(t){return[].filter.call(t,(function(t){return\"\\n\"!==t})).join(\"\")},u=function(t){if(\"string\"!=typeof t)return!1;if(\"transparent\"===(t=t.toLocaleLowerCase().trim()))return!1;if(/^rgba/.test(t)){var e=/([^\\s,]+)\\)$/.exec(t);if(0===(null===(i=e)?0:\"object\"==typeof i?NaN:\"number\"==typeof i?i:\"string\"==typeof i?\"%\"===i[i.length-1]?Number(i.slice(0,-1))/100:Number(i):NaN))return!1}var i;return!0},h=function(){function t(){this.subs=[]}return t.prototype.addSub=function(t){this.subs.includes(t)||this.subs.push(t)},t.prototype.notify=function(){this.subs.forEach((function(t){t.update()}))},t}(),c=\"__proto__\"in{};function l(t,e,i,n){Object.defineProperty(t,e,{value:i,enumerable:!!n,writable:!0,configurable:!0})}var f=Array.prototype,d=Object.create(f);[\"push\",\"pop\",\"shift\",\"unshift\",\"sort\",\"splice\",\"reverse\"].forEach((function(t){d[t]=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=f[t].apply(this,e),r=this.__luckyOb__;return[\"push\",\"unshift\",\"splice\"].includes(t)&&r.walk(this),r.dep.notify(),n}}));var p=function(){function t(t){this.dep=new h,l(t,\"__luckyOb__\",this),Array.isArray(t)&&(c?t.__proto__=d:Object.getOwnPropertyNames(d).forEach((function(e){l(t,e,d[e])}))),this.walk(t)}return t.prototype.walk=function(t){Object.keys(t).forEach((function(e){m(t,e,t[e])}))},t}();function g(t){if(t&&\"object\"==typeof t)return\"__luckyOb__\"in t?t.__luckyOb__:new p(t)}function m(t,e,i){var n=new h,r=Object.getOwnPropertyDescriptor(t,e);if(!r||!1!==r.configurable){var o=r&&r.get,s=r&&r.set;o&&!s||2!==arguments.length||(i=t[e]);var a=g(i);Object.defineProperty(t,e,{get:function(){var e=o?o.call(t):i;return h.target&&(n.addSub(h.target),a&&a.dep.addSub(h.target)),e},set:function(e){e!==i&&(i=e,o&&!s||(s?s.call(t,e):i=e,a=g(e),n.notify()))}})}}var v=0,b=function(){function t(t,e,i,n){void 0===n&&(n={}),this.id=v++,this.$lucky=t,this.expr=e,this.deep=!!n.deep,this.getter=\"function\"==typeof e?e:function(t){t+=\".\";for(var e=[],i=\"\",n=0;n<t.length;n++){var r=t[n];if(/\\[|\\./.test(r))e.push(i),i=\"\";else{if(/\\W/.test(r))continue;i+=r}}return function(t){return e.reduce((function(t,e){return t[e]}),t)}}(e),this.cb=i,this.value=this.get()}return t.prototype.get=function(){h.target=this;var t=this.getter.call(this.$lucky,this.$lucky);return this.deep&&function(t){var e=function(t){s(t,\"array\",\"object\")&&Object.keys(t).forEach((function(i){var n=t[i];e(n)}))};e(t)}(t),h.target=null,t},t.prototype.update=function(){var t=this.get(),e=this.value;this.value=t,this.cb.call(this.$lucky,t,e)},t}(),y=function(){function t(t){var e=this;this.htmlFontSize=16,this.rAF=function(){},this.boxWidth=0,this.boxHeight=0,this.setHTMLFontSize(),\"string\"==typeof t?t={el:t}:1===t.nodeType&&(t={el:\"\",divElement:t}),t=t,this.config=t,this.setDpr(),this.initWindowFunction(),t.flag||(t.flag=\"WEB\"),Object.prototype.hasOwnProperty.call(t,\"ob\")||(t.ob=!0),t.el&&(t.divElement=document.querySelector(t.el)),t.divElement&&(t.canvasElement=document.createElement(\"canvas\"),t.divElement.appendChild(t.canvasElement)),this.resetWidthAndHeight(),t.canvasElement&&(t.ctx=t.canvasElement.getContext(\"2d\"),t.canvasElement.setAttribute(\"package\",\"lucky-canvas@1.5.4\"),t.canvasElement.addEventListener(\"click\",(function(t){return e.handleClick(t)})),t.canvasElement.addEventListener(\"mousemove\",(function(t){return e.handleMouseMove(t)})),t.canvasElement.addEventListener(\"mousedown\",(function(t){return e.handleMouseDown(t)})),t.canvasElement.addEventListener(\"mouseup\",(function(t){return e.handleMouseUp(t)}))),this.ctx=t.ctx,t.ctx?this.boxWidth&&this.boxHeight||console.error(\"无法获取到宽度或高度\"):console.error(\"无法获取到 CanvasContext2D\")}return t.prototype.init=function(t){this.setDpr(),this.setHTMLFontSize(),this.resetWidthAndHeight(),this.zoomCanvas()},t.prototype.handleClick=function(t){},t.prototype.handleMouseDown=function(t){},t.prototype.handleMouseUp=function(t){},t.prototype.handleMouseMove=function(t){},t.prototype.conversionAxis=function(t,e){return[0,0]},t.prototype.setDpr=function(){var t=this.config;t.dpr||(window?window.dpr=t.dpr=window.devicePixelRatio||1:t.dpr||console.error(t,\"未传入 dpr 可能会导致绘制异常\"))},t.prototype.setHTMLFontSize=function(){window&&(this.htmlFontSize=+window.getComputedStyle(document.documentElement).fontSize.slice(0,-2))},t.prototype.resetWidthAndHeight=function(){var t=this.config,e=0,i=0;t.divElement&&(e=t.divElement.offsetWidth,i=t.divElement.offsetHeight),this.boxWidth=this.getLength(t.width)||e,this.boxHeight=this.getLength(t.height)||i,t.divElement&&(t.divElement.style.overflow=\"hidden\",t.divElement.style.width=this.boxWidth+\"px\",t.divElement.style.height=this.boxHeight+\"px\")},t.prototype.initWindowFunction=function(){var t=this.config;if(window)return this.rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},t.setTimeout=window.setTimeout,t.setInterval=window.setInterval,t.clearTimeout=window.clearTimeout,void(t.clearInterval=window.clearInterval);if(t.rAF)this.rAF=t.rAF;else if(t.setTimeout){var e=t.setTimeout;this.rAF=function(t){return e(t,16.7)}}else this.rAF=function(t){return setTimeout(t,16.7)}},t.prototype.zoomCanvas=function(){var t=this.config,e=this.ctx,i=t.canvasElement,n=t.dpr,r=[this.boxWidth*n,this.boxHeight*n],o=r[0],s=r[1],a=function(t){return(t*n-t)/(t*n)*(n/2)*100};i&&(i.width=o,i.height=s,i.style.width=o+\"px\",i.style.height=s+\"px\",i.style.transform=\"scale(\"+1/n+\") translate(\"+-a(o)+\"%, \"+-a(s)+\"%)\",e.scale(n,n))},t.prototype.loadImg=function(t,e,i){var n=this;return void 0===i&&(i=\"$resolve\"),new Promise((function(r,o){if(t||o(\"=> '\"+e.src+\"' 不能为空或不合法\"),\"WEB\"===n.config.flag){var s=new Image;s.src=t,s.onload=function(){return r(s)},s.onerror=function(){return o(\"=> '\"+e.src+\"' 图片加载失败\")}}else e[i]=r}))},t.prototype.drawImage=function(t,e,i,n,r){var o,s=this.config,a=this.ctx;return[\"WEB\",\"MP-WX\"].includes(s.flag)?o=t:[\"UNI-H5\",\"UNI-MP\",\"TARO-H5\",\"TARO-MP\"].includes(s.flag)&&(o=t.path),a.drawImage(o,e,i,n,r)},t.prototype.getLength=function(t){return s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t):0},t.prototype.changeUnits=function(t,e){var i=this;return void 0===e&&(e=1),Number(t.replace(/^([-]*[0-9.]*)([a-z%]*)$/,(function(t,n,r){var o={\"%\":function(t){return t*(e/100)},px:function(t){return 1*t},rem:function(t){return t*i.htmlFontSize}}[r];if(o)return o(n);var s=i.config.unitFunc;return s?s(n,r):n})))},t.prototype.$set=function(t,e,i){t&&\"object\"==typeof t&&m(t,e,i)},t.prototype.$computed=function(t,e,i){var n=this;Object.defineProperty(t,e,{get:function(){return i.call(n)}})},t.prototype.$watch=function(t,e,i){void 0===i&&(i={}),\"object\"==typeof e&&(e=(i=e).handler);var n=new b(this,t,e,i);return i.immediate&&e.call(this,n.value),function(){}},t}(),w=function(t){return Math.PI/180*t},x=function(t,e){return[+(Math.cos(t)*e).toFixed(8),+(Math.sin(t)*e).toFixed(8)]},z=function(t,e){var i=-t/e;return[i,-i*t+e]},I=function(t,e,i,n,r,o){var s;if(void 0===o&&(o=!0),Math.abs(r-n).toFixed(8)>=w(180).toFixed(8)){var a=(r+n)/2;return o?(I(t,e,i,n,a,o),I(t,e,i,a,r,o)):(I(t,e,i,a,r,o),I(t,e,i,n,a,o)),!1}o||(n=(s=[r,n])[0],r=s[1]);var u=x(n,i),h=u[0],c=u[1],l=x(r,i),f=l[0],d=l[1],p=z(h,c),g=p[0],m=p[1],v=z(f,d),b=v[0],y=v[1],k=(y-m)/(g-b),S=(b*m-g*y)/(b-g);isNaN(k)&&(Math.abs(h)===+i.toFixed(8)&&(k=h),Math.abs(f)===+i.toFixed(8)&&(k=f)),g===1/0||g===-1/0?S=b*k+y:b!==1/0&&b!==-1/0||(S=g*k+m),e.lineTo(h,c),t.indexOf(\"MP\")>0?e.quadraticCurveTo(k,S,f,d):e.arcTo(k,S,f,d,i)},k=function(t,e,i,n,r,o,s,a){i||(i=s);var u=w(90/Math.PI/n*s),h=w(90/Math.PI/i*s),c=r+u,l=o-u,f=r+h,d=o-h;e.beginPath(),e.fillStyle=a,e.moveTo.apply(e,x(c,n)),I(t,e,n,c,l,!0),d>f?I(t,e,i,f,d,!1):e.lineTo.apply(e,x((r+o)/2,s/2/Math.abs(Math.sin((r-o)/2)))),e.closePath(),e.fill()},S=function(t,e,i,n,r,o,s){var a=Math.min(n,r);o>a/2&&(o=a/2),t.beginPath(),t.fillStyle=s,t.moveTo(e+o,i),t.lineTo(e+o,i),t.lineTo(e+n-o,i),t.quadraticCurveTo(e+n,i,e+n,i+o),t.lineTo(e+n,i+r-o),t.quadraticCurveTo(e+n,i+r,e+n-o,i+r),t.lineTo(e+o,i+r),t.quadraticCurveTo(e,i+r,e,i+r-o),t.lineTo(e,i+o),t.quadraticCurveTo(e,i,e+o,i),t.closePath(),t.fill()},C={easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*(t/=n)*(t-2)+e}},T={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*Math.cos(t/n*(Math.PI/2))+i+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sin(t/n*(Math.PI/2))+e}},W={easeIn:function(t,e,i,n){return t>=n&&(t=n),0==t?e:i*Math.pow(2,10*(t/n-1))+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),t==n?e+i:i*(1-Math.pow(2,-10*t/n))+e}},O={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*(Math.sqrt(1-(t/=n)*t)-1)+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sqrt(1-(t=t/n-1)*t)+e}},_=Object.freeze({__proto__:null,quad:C,cubic:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t+1)+e}},quart:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*((t=t/n-1)*t*t*t-1)+e}},quint:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t*t*t+1)+e}},sine:T,expo:W,circ:O}),E=function(t){function o(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;return r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:\"0px\",offsetDegree:0,speed:20,speedFunction:\"quad\",accelerationTime:2500,decelerationTime:2500,stopRange:.8},r.defaultStyle={},r._defaultStyle={fontSize:\"18px\",fontColor:\"#000\",fontStyle:\"sans-serif\",fontWeight:\"400\",lineHeight:\"\",background:\"rgba(0,0,0,0)\",wordWrap:!0,lengthLimit:\"90%\"},r.Radius=0,r.prizeRadius=0,r.prizeDeg=0,r.prizeRadian=0,r.rotateDeg=0,r.maxBtnRadius=0,r.startTime=0,r.endTime=0,r.stopDeg=0,r.endDeg=0,r.FPS=16.6,r.blockImgs=[[]],r.prizeImgs=[[]],r.btnImgs=[[]],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:r.buttons.map((function(t){return t.imgs}))}),r}return e(o,t),o.prototype.initData=function(t){this.$set(this,\"blocks\",t.blocks||[]),this.$set(this,\"prizes\",t.prizes||[]),this.$set(this,\"buttons\",t.buttons||[]),this.$set(this,\"defaultConfig\",t.defaultConfig||{}),this.$set(this,\"defaultStyle\",t.defaultStyle||{}),this.$set(this,\"startCallback\",t.start),this.$set(this,\"endCallback\",t.end)},o.prototype.initComputed=function(){var t=this;this.$computed(this,\"_defaultConfig\",(function(){return i({gutter:\"0px\",offsetDegree:0,speed:20,speedFunction:\"quad\",accelerationTime:2500,decelerationTime:2500,stopRange:.8},t.defaultConfig)})),this.$computed(this,\"_defaultStyle\",(function(){return i({fontSize:\"18px\",fontColor:\"#000\",fontStyle:\"sans-serif\",fontWeight:\"400\",background:\"rgba(0,0,0,0)\",wordWrap:!0,lengthLimit:\"90%\"},t.defaultStyle)}))},o.prototype.initWatch=function(){var t=this;this.$watch(\"blocks\",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"prizes\",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"buttons\",(function(e){return t.init({btnImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"defaultConfig\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"defaultStyle\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"startCallback\",(function(){return t.init({})})),this.$watch(\"endCallback\",(function(){return t.init({})}))},o.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this.config,s=this.ctx;this.Radius=Math.min(this.boxWidth,this.boxHeight)/2,null===(i=o.beforeInit)||void 0===i||i.call(this),s.translate(this.Radius,this.Radius),this.draw(),this.draw(),Object.keys(e).forEach((function(t){var i=t,n={blockImgs:\"blocks\",prizeImgs:\"prizes\",btnImgs:\"buttons\"}[i],o=e[i];o&&o.forEach((function(t,e){t&&t.forEach((function(t,o){r.loadAndCacheImg(n,e,i,o,(function(){r.draw()}))}))}))})),null===(n=o.afterInit)||void 0===n||n.call(this)},o.prototype.handleClick=function(t){var e,i=this.ctx;i.beginPath(),i.arc(0,0,this.maxBtnRadius,0,2*Math.PI,!1),i.isPointInPath(t.offsetX,t.offsetY)&&(this.startTime||null===(e=this.startCallback)||void 0===e||e.call(this,t))},o.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u=this;return r(this,(function(r){return(n=this[t][e])&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),this.loadImg(a.src,a).then((function(t){u[i][e][o]=t,s.call(u)})).catch((function(i){console.error(t+\"[\"+e+\"].imgs[\"+o+\"] \"+i)})),[2]):[2]}))}))},o.prototype.computedWidthAndHeight=function(t,e,i,n){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var r=this.getWidth(e.width,i);return[r,t.height*(r/t.width)]}if(!e.width&&e.height){var o=this.getHeight(e.height,n);return[t.width*(o/t.height),o]}return[this.getWidth(e.width,i),this.getHeight(e.height,n)]},o.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,o=n.ctx,s=n._defaultConfig,h=n._defaultStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,o),o.clearRect(-this.Radius,-this.Radius,2*this.Radius,2*this.Radius),this.prizeRadius=this.blocks.reduce((function(t,e,n){return u(e.background)&&(o.beginPath(),o.fillStyle=e.background,o.arc(0,0,t,0,2*Math.PI,!1),o.fill()),e.imgs&&e.imgs.forEach((function(e,r){if(i.blockImgs[n]){var s=i.blockImgs[n][r];if(s){var a=i.computedWidthAndHeight(s,e,2*t,2*t),u=a[0],h=a[1],c=[i.getOffsetX(u),i.getHeight(e.top,2*t)-t],l=c[0],f=c[1];o.save(),e.rotate&&o.rotate(w(i.rotateDeg)),i.drawImage(s,l,f,u,h),o.restore()}}})),t-i.getLength(e.padding&&e.padding.split(\" \")[0])}),this.Radius),this.prizeDeg=360/this.prizes.length,this.prizeRadian=w(this.prizeDeg);var c=w(-90+this.rotateDeg+s.offsetDegree),l=function(t){return i.getOffsetX(o.measureText(t).width)},f=function(t,e,n){var r=t.lineHeight||h.lineHeight||t.fontSize||h.fontSize;return i.getHeight(t.top,e)+(n+1)*i.getLength(r)};o.save(),this.prizes.forEach((function(t,e){var n=c+e*i.prizeRadian,d=i.prizeRadius-i.maxBtnRadius,p=t.background||h.background;u(p)&&function(t,e,i,n,r,o,s,a){s?k(t,e,i,n,r,o,s,a):(e.beginPath(),e.fillStyle=a,e.moveTo(0,0),e.arc(0,0,n,r,o,!1),e.closePath(),e.fill())}(r.flag,o,i.maxBtnRadius,i.prizeRadius,n-i.prizeRadian/2,n+i.prizeRadian/2,i.getLength(s.gutter),p);var g=Math.cos(n)*i.prizeRadius,m=Math.sin(n)*i.prizeRadius;o.translate(g,m),o.rotate(n+w(90)),t.imgs&&t.imgs.forEach((function(t,n){if(i.prizeImgs[e]){var r=i.prizeImgs[e][n];if(r){var o=i.computedWidthAndHeight(r,t,i.prizeRadian*i.prizeRadius,d),s=o[0],a=o[1],u=[i.getOffsetX(s),i.getHeight(t.top,d)],h=u[0],c=u[1];i.drawImage(r,h,c,s,a)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,n=t.fontWeight||h.fontWeight,r=i.getLength(t.fontSize||h.fontSize),u=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=n+\" \"+(r>>0)+\"px \"+u;var c=[],p=String(t.text);if(Object.prototype.hasOwnProperty.call(t,\"wordWrap\")?t.wordWrap:h.wordWrap){p=a(p);for(var g=\"\",m=0;m<p.length;m++){g+=p[m];var v=o.measureText(g).width,b=(i.prizeRadius-f(t,d,c.length))*Math.tan(i.prizeRadian/2)*2-i.getLength(s.gutter);v>i.getWidth(t.lengthLimit||h.lengthLimit,b)&&(c.push(g.slice(0,-1)),g=p[m])}g&&c.push(g),c.length||c.push(p)}else c=p.split(\"\\n\");c.filter((function(t){return!!t})).forEach((function(e,i){o.fillText(e,l(e),f(t,d,i))}))})),o.rotate(w(360)-n-w(90)),o.translate(-g,-m)})),o.restore(),this.buttons.forEach((function(t,e){var n=i.getHeight(t.radius);i.maxBtnRadius=Math.max(i.maxBtnRadius,n),u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.arc(0,0,n,0,2*Math.PI,!1),o.fill()),t.pointer&&u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.moveTo(-n,0),o.lineTo(n,0),o.lineTo(0,2*-n),o.closePath(),o.fill()),t.imgs&&t.imgs.forEach((function(t,r){if(i.btnImgs[e]){var o=i.btnImgs[e][r];if(o){var s=i.computedWidthAndHeight(o,t,2*n,2*n),a=s[0],u=s[1],h=[i.getOffsetX(a),i.getHeight(t.top,n)],c=h[0],l=h[1];i.drawImage(o,c,l,a,u)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,r=t.fontWeight||h.fontWeight,s=i.getLength(t.fontSize||h.fontSize),a=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=r+\" \"+(s>>0)+\"px \"+a,String(t.text).split(\"\\n\").forEach((function(e,i){o.fillText(e,l(e),f(t,n,i))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,o)},o.prototype.play=function(){this.startTime||(this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},o.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.rotateDeg=this.prizeDeg/2-this._defaultConfig.offsetDegree,this.draw())},o.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.prizeFlag,r=e.prizeDeg,o=e.rotateDeg,s=e._defaultConfig,a=Date.now()-this.startTime;if(a>=s.accelerationTime&&void 0!==n){this.FPS=a/t,this.endTime=Date.now(),this.stopDeg=o;for(var u=(Math.random()*r-r/2)*this.getLength(s.stopRange),h=0;++h;){var c=360*h-n*r-o-s.offsetDegree+u;if(_[s.speedFunction].easeOut(this.FPS,this.stopDeg,c,s.decelerationTime)-this.stopDeg>s.speed){this.endDeg=c;break}}return this.slowDown()}this.rotateDeg=(o+_[s.speedFunction].easeIn(a,0,s.speed,s.accelerationTime))%360,this.draw(),i(this.run.bind(this,t+1))},o.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopDeg,a=e.endDeg,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>=u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.rotateDeg=_[u.speedFunction].easeOut(h,s,a,u.decelerationTime)%360,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},o.prototype.getWidth=function(t,e){return void 0===e&&(e=this.prizeRadian*this.prizeRadius),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,e):0},o.prototype.getHeight=function(t,e){return void 0===e&&(e=this.prizeRadius),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,e):0},o.prototype.getOffsetX=function(t){return-t/2},o.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr-this.Radius,e/i.dpr-this.Radius]},o}(y),P=function(t){function h(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;r.rows=3,r.cols=3,r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},r.defaultStyle={},r._defaultStyle={borderRadius:20,fontColor:\"#000\",fontSize:\"18px\",fontStyle:\"sans-serif\",fontWeight:\"400\",lineHeight:\"\",background:\"rgba(0,0,0,0)\",shadow:\"\",wordWrap:!0,lengthLimit:\"90%\"},r.activeStyle={},r._activeStyle={background:\"#ffce98\",shadow:\"\",fontStyle:\"\",fontWeight:\"\",fontSize:\"\",lineHeight:\"\",fontColor:\"\"},r.cellWidth=0,r.cellHeight=0,r.startTime=0,r.endTime=0,r.currIndex=0,r.stopIndex=0,r.endIndex=0,r.demo=!1,r.timer=0,r.FPS=16.6,r.prizeFlag=-1,r.cells=[],r.blockImgs=[[]],r.btnImgs=[[]],r.prizeImgs=[],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r);var o=r.buttons.map((function(t){return t.imgs}));return r.button&&o.push(r.button.imgs),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:o}),r}return e(h,t),h.prototype.initData=function(t){this.$set(this,\"rows\",Number(t.rows)||3),this.$set(this,\"cols\",Number(t.cols)||3),this.$set(this,\"blocks\",t.blocks||[]),this.$set(this,\"prizes\",t.prizes||[]),this.$set(this,\"buttons\",t.buttons||[]),this.$set(this,\"button\",t.button),this.$set(this,\"defaultConfig\",t.defaultConfig||{}),this.$set(this,\"defaultStyle\",t.defaultStyle||{}),this.$set(this,\"activeStyle\",t.activeStyle||{}),this.$set(this,\"startCallback\",t.start),this.$set(this,\"endCallback\",t.end)},h.prototype.initComputed=function(){var t=this;this.$computed(this,\"_defaultConfig\",(function(){var e=i({gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},t.defaultConfig);return e.gutter=t.getLength(e.gutter),e.speed=e.speed/40,e})),this.$computed(this,\"_defaultStyle\",(function(){return i({borderRadius:20,fontColor:\"#000\",fontSize:\"18px\",fontStyle:\"sans-serif\",fontWeight:\"400\",background:\"rgba(0,0,0,0)\",shadow:\"\",wordWrap:!0,lengthLimit:\"90%\"},t.defaultStyle)})),this.$computed(this,\"_activeStyle\",(function(){return i({background:\"#ffce98\",shadow:\"\"},t.activeStyle)}))},h.prototype.initWatch=function(){var t=this;this.$watch(\"blocks\",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"prizes\",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"buttons\",(function(e){var i=e.map((function(t){return t.imgs}));return t.button&&i.push(t.button.imgs),t.init({btnImgs:i})}),{deep:!0}),this.$watch(\"button\",(function(){var e=t.buttons.map((function(t){return t.imgs}));return t.button&&e.push(t.button.imgs),t.init({btnImgs:e})}),{deep:!0}),this.$watch(\"rows\",(function(){return t.init({})})),this.$watch(\"cols\",(function(){return t.init({})})),this.$watch(\"defaultConfig\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"defaultStyle\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"activeStyle\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"startCallback\",(function(){return t.init({})})),this.$watch(\"endCallback\",(function(){return t.init({})}))},h.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this,s=o.config;o.ctx,o.button,null===(i=s.beforeInit)||void 0===i||i.call(this),this.draw(),Object.keys(e).forEach((function(t){var i=t,n=e[i],o={blockImgs:\"blocks\",prizeImgs:\"prizes\",btnImgs:\"buttons\"}[i];n&&n.forEach((function(t,e){t&&t.forEach((function(t,n){r.loadAndCacheImg(o,e,i,n,(function(){r.draw()}))}))}))})),null===(n=s.afterInit)||void 0===n||n.call(this)},h.prototype.handleClick=function(t){var e=this,i=this.ctx;o(o([],this.buttons),[this.button]).forEach((function(n){var r;if(n){var o=e.getGeometricProperty([n.x,n.y,n.col||1,n.row||1]),s=o[0],a=o[1],u=o[2],h=o[3];i.beginPath(),i.rect(s,a,u,h),i.isPointInPath(t.offsetX,t.offsetY)&&(e.startTime||(\"function\"==typeof n.callback&&n.callback.call(e,n),null===(r=e.startCallback)||void 0===r||r.call(e,t,n)))}}))},h.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u,h=this;return r(this,(function(r){return n=this[t][e],\"buttons\"===t&&!this.buttons.length&&this.button&&(n=this.button),n&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),u=[this.loadImg(a.src,a),a.activeSrc&&this.loadImg(a.activeSrc,a,\"$activeResolve\")],Promise.all(u).then((function(t){var n=t[0],r=t[1];h[i][e][o]={defaultImg:n,activeImg:r},s.call(h)})).catch((function(i){console.error(t+\"[\"+e+\"].imgs[\"+o+\"] \"+i)})),[2]):[2]}))}))},h.prototype.computedWidthAndHeight=function(t,e,i){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var n=this.getWidth(e.width,i.col);return[n,t.height*(n/t.width)]}if(!e.width&&e.height){var r=this.getHeight(e.height,i.row);return[t.width*(r/t.height),r]}return[this.getWidth(e.width,i.col),this.getHeight(e.height,i.row)]},h.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,h=n.ctx,c=n._defaultConfig,l=n._defaultStyle,f=n._activeStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,h),h.clearRect(0,0,this.boxWidth,this.boxHeight),this.cells=o(o([],this.prizes),this.buttons),this.button&&this.cells.push(this.button),this.cells.forEach((function(t){t.col=t.col||1,t.row=t.row||1})),this.prizeArea=this.blocks.reduce((function(t,e){var n=t.x,r=t.y,o=t.w,a=t.h,c=function(t){var e,i=(null===(e=t.padding)||void 0===e?void 0:e.replace(/px/g,\"\").split(\" \").map((function(t){return~~t})))||[0],n=0,r=0,o=0,a=0;switch(i.length){case 1:n=r=o=a=i[0];break;case 2:n=r=i[0],o=a=i[1];break;case 3:n=i[0],o=a=i[1],r=i[2];break;default:n=i[0],r=i[1],o=i[2],a=i[3]}var u={paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:a};for(var h in u)u[h]=Object.prototype.hasOwnProperty.call(t,h)&&s(t[h],\"string\",\"number\")?~~String(t[h]).replace(/px/g,\"\"):u[h];return[n,r,o,a]}(e),f=c[0],d=c[1],p=c[2],g=c[3],m=e.borderRadius?i.getLength(e.borderRadius):0,v=e.background||l.background;return u(v)&&S(h,n,r,o,a,m,i.handleBackground(n,r,o,a,v)),{x:n+p,y:r+f,w:o-p-g,h:a-f-d}}),{x:0,y:0,w:this.boxWidth,h:this.boxHeight}),this.cellWidth=(this.prizeArea.w-c.gutter*(this.cols-1))/this.cols,this.cellHeight=(this.prizeArea.h-c.gutter*(this.rows-1))/this.rows,this.cells.forEach((function(t,e){var n=i.getGeometricProperty([t.x,t.y,t.col,t.row]),o=n[0],s=n[1],c=n[2],d=n[3],p=!1;(void 0===i.prizeFlag||i.prizeFlag>-1)&&(p=e===i.currIndex%i.prizes.length>>0);var g=p?f.background:t.background||l.background;if(u(g)){var m=(p?f.shadow:t.shadow||l.shadow).replace(/px/g,\"\").split(\",\")[0].split(\" \").map((function(t,e){return e<3?Number(t):t}));4===m.length&&(h.shadowColor=m[3],h.shadowOffsetX=m[0]*r.dpr,h.shadowOffsetY=m[1]*r.dpr,h.shadowBlur=m[2],m[0]>0?c-=m[0]:(c+=m[0],o-=m[0]),m[1]>0?d-=m[1]:(d+=m[1],s-=m[1])),S(h,o,s,c,d,i.getLength(t.borderRadius?t.borderRadius:l.borderRadius),i.handleBackground(o,s,c,d,g)),h.shadowColor=\"rgba(0, 0, 0, 0)\",h.shadowOffsetX=0,h.shadowOffsetY=0,h.shadowBlur=0}var v=\"prizeImgs\";e>=i.prizes.length&&(v=\"btnImgs\",e-=i.prizes.length),t.imgs&&t.imgs.forEach((function(n,r){if(i[v][e]){var a=i[v][e][r];if(a){var u=p&&a.activeImg||a.defaultImg;if(u){var h=i.computedWidthAndHeight(u,n,t),c=h[0],l=h[1],f=[o+i.getOffsetX(c,t.col),s+i.getHeight(n.top,t.row)],d=f[0],g=f[1];i.drawImage(u,d,g,c,l)}}}})),t.fonts&&t.fonts.forEach((function(e){var n=p&&f.fontStyle?f.fontStyle:e.fontStyle||l.fontStyle,r=p&&f.fontWeight?f.fontWeight:e.fontWeight||l.fontWeight,u=p&&f.fontSize?i.getLength(f.fontSize):i.getLength(e.fontSize||l.fontSize),c=p&&f.lineHeight?f.lineHeight:e.lineHeight||l.lineHeight||e.fontSize||l.fontSize;h.font=r+\" \"+(u>>0)+\"px \"+n,h.fillStyle=p&&f.fontColor?f.fontColor:e.fontColor||l.fontColor;var d=[],g=String(e.text);if(Object.prototype.hasOwnProperty.call(e,\"wordWrap\")?e.wordWrap:l.wordWrap){g=a(g);for(var m=\"\",v=0;v<g.length;v++){m+=g[v],h.measureText(m).width>i.getWidth(e.lengthLimit||l.lengthLimit,t.col)&&(d.push(m.slice(0,-1)),m=g[v])}m&&d.push(m),d.length||d.push(g)}else d=g.split(\"\\n\");d.forEach((function(n,r){h.fillText(n,o+i.getOffsetX(h.measureText(n).width,t.col),s+i.getHeight(e.top,t.row)+(r+1)*i.getLength(c))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,h)},h.prototype.handleBackground=function(t,e,i,n,r){var o=this.ctx;return r.includes(\"linear-gradient\")&&(r=function(t,e,i,n,r,o){var s=/linear-gradient\\((.+)\\)/.exec(o)[1].split(\",\").map((function(t){return t.trim()})),a=s.shift(),u=[0,0,0,0];if(a.includes(\"deg\")){var h=function(t){return Math.tan(t/180*Math.PI)};(a=a.slice(0,-3)%360)>=0&&a<45?u=[e,i+r,e+n,i+r-n*h(a-0)]:a>=45&&a<90?u=[e,i+r,e+n-r*h(a-45),i]:a>=90&&a<135?u=[e+n,i+r,e+n-r*h(a-90),i]:a>=135&&a<180?u=[e+n,i+r,e,i+n*h(a-135)]:a>=180&&a<225?u=[e+n,i,e,i+n*h(a-180)]:a>=225&&a<270?u=[e+n,i,e+r*h(a-225),i+r]:a>=270&&a<315?u=[e,i,e+r*h(a-270),i+r]:a>=315&&a<360&&(u=[e,i,e+n,i+r-n*h(a-315)])}else a.includes(\"top\")?u=[e,i+r,e,i]:a.includes(\"bottom\")?u=[e,i,e,i+r]:a.includes(\"left\")?u=[e+n,i,e,i]:a.includes(\"right\")&&(u=[e,i,e+n,i]);var c=t.createLinearGradient.apply(t,u.map((function(t){return t>>0})));return s.reduce((function(t,e,i){var n=e.split(\" \");return 1===n.length?t.addColorStop(i,n[0]):2===n.length&&t.addColorStop.apply(t,n),t}),c)}(o,t,e,i,n,r)),r},h.prototype.play=function(){var t=this.config.clearInterval;this.startTime||(t(this.timer),this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},h.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.currIndex=0,this.draw())},h.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.currIndex,r=e.prizes,o=e.prizeFlag,s=e.startTime,a=e._defaultConfig,u=Date.now()-s;if(u>=a.accelerationTime&&void 0!==o){this.FPS=u/t,this.endTime=Date.now(),this.stopIndex=n;for(var h=0;++h;){var c=r.length*h+o-(n>>0);if(C.easeOut(this.FPS,this.stopIndex,c,a.decelerationTime)-this.stopIndex>a.speed){this.endIndex=c;break}}return this.slowDown()}this.currIndex=(n+C.easeIn(u,.1,a.speed,a.accelerationTime))%r.length,this.draw(),i(this.run.bind(this,t+1))},h.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopIndex,a=e.endIndex,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.currIndex=C.easeOut(h,s,a,u.decelerationTime)%r.length,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},h.prototype.walk=function(){var t=this,e=this.config,i=e.setInterval;(0,e.clearInterval)(this.timer),this.timer=i((function(){t.currIndex+=1,t.draw()}),1300)},h.prototype.getGeometricProperty=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=this.cellWidth,s=this.cellHeight,a=this._defaultConfig.gutter,u=[this.prizeArea.x+(o+a)*e,this.prizeArea.y+(s+a)*i];return n&&r&&u.push(o*n+a*(n-1),s*r+a*(r-1)),u},h.prototype.getWidth=function(t,e){return void 0===e&&(e=1),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,this.cellWidth*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getHeight=function(t,e){return void 0===e&&(e=1),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,this.cellHeight*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getOffsetX=function(t,e){return void 0===e&&(e=1),(this.cellWidth*e+this._defaultConfig.gutter*(e-1)-t)/2},h.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr,e/i.dpr]},h}(y);exports.LuckyGrid=P,exports.LuckyWheel=E;\n","const windowWidth = wx.getSystemInfoSync().windowWidth\r\n\r\nexport const rpx2px = (value) => {\r\n if (typeof value === 'string') value = Number(value.replace(/[a-z]*/g, ''))\r\n return windowWidth / 750 * value\r\n}\r\n\r\nexport const changeUnits = (value) => {\r\n return Number(value.replace(/^(\\-*[0-9.]*)([a-z%]*)$/, (value, num, unit) => {\r\n switch (unit) {\r\n case 'px':\r\n num *= 1\r\n break\r\n case 'rpx':\r\n num = rpx2px(num)\r\n break\r\n default:\r\n num *= 1\r\n break\r\n }\r\n return num\r\n }))\r\n}\r\n\r\nexport const resolveImage = (e, img, canvas, srcName = 'src', resolveName = '$resolve') => {\r\n let imgObj = canvas.createImage()\r\n imgObj.onload = () => {\r\n img[resolveName](imgObj)\r\n }\r\n imgObj.src = img[srcName]\r\n}\r\n\r\nexport function getImage () {\r\n return new Promise((resolve, reject) => {\r\n wx.canvasToTempFilePath({\r\n canvas: this.canvas,\r\n success: res => resolve(res),\r\n fail: err => reject(err)\r\n });\r\n })\r\n}\r\n","import { LuckyWheel } from '../../node_modules/lucky-canvas/dist/lucky-canvas.cjs.min'\r\nimport { changeUnits, resolveImage, getImage } from '../utils'\r\n\r\nComponent({\r\n properties: {\r\n width: { type: String, value: '600rpx' },\r\n height: { type: String, value: '600rpx' },\r\n blocks: { type: Array, value: [] },\r\n prizes: { type: Array, value: [] },\r\n buttons: { type: Array, value: [] },\r\n defaultConfig: { type: Object, value: {} },\r\n defaultStyle: { type: Object, value: {} },\r\n start: { type: Function, value: () => {} },\r\n end: { type: Function, value: () => {} },\r\n },\r\n data: {\r\n isShow: false,\r\n luckyImg: '',\r\n showCanvas: true,\r\n },\r\n observers: {\r\n 'blocks.**': function(newData, oldData) {\r\n this.$lucky && (this.$lucky.blocks = newData)\r\n },\r\n 'prizes.**': function(newData, oldData) {\r\n this.$lucky && (this.$lucky.prizes = newData)\r\n },\r\n 'buttons.**': function(newData, oldData) {\r\n this.$lucky && (this.$lucky.buttons = newData)\r\n },\r\n },\r\n ready() {\r\n wx.createSelectorQuery().in(this).select('#lucky-wheel').fields({\r\n node: true, size: true\r\n }).exec((res) => {\r\n if (!res[0] || !res[0].node) {\r\n return console.error('lucky-canvas 获取不到 canvas 标签')\r\n }\r\n const canvas = this.canvas = res[0].node\r\n const dpr = this.dpr = wx.getSystemInfoSync().pixelRatio\r\n const ctx = this.ctx = canvas.getContext('2d')\r\n const data = this.data\r\n canvas.width = res[0].width * dpr\r\n canvas.height = res[0].height * dpr\r\n ctx.scale(dpr, dpr)\r\n this.$lucky = new LuckyWheel({\r\n flag: 'MP-WX',\r\n ctx,\r\n dpr,\r\n width: res[0].width,\r\n height: res[0].height,\r\n // rAF: canvas.requestAnimationFrame, // 帧动画真机调试会报错!\r\n setTimeout,\r\n clearTimeout,\r\n setInterval,\r\n clearInterval,\r\n beforeCreate: function () {\r\n const Radius = Math.min(this.config.width, this.config.height) / 2\r\n // 设置坐标轴\r\n ctx.translate(Radius, Radius)\r\n },\r\n beforeInit: function () {\r\n // 重置坐标轴\r\n ctx.translate(-this.Radius, -this.Radius)\r\n },\r\n unitFunc: (num, unit) => changeUnits(num + unit),\r\n }, {\r\n blocks: data.blocks,\r\n prizes: data.prizes,\r\n buttons: data.buttons,\r\n defaultConfig: data.defaultConfig,\r\n defaultStyle: data.defaultStyle,\r\n start: (...rest) => {\r\n this.triggerEvent('start', ...rest)\r\n },\r\n end: (...rest) => {\r\n this.triggerEvent('end', ...rest)\r\n getImage.call(this).then(res => {\r\n this.setData({ luckyImg: res.tempFilePath })\r\n })\r\n },\r\n })\r\n // 为了保证 onload 回调准确\r\n this.setData({ isShow: true })\r\n })\r\n },\r\n methods: {\r\n imgBindload (e) {\r\n const { name, index, i } = e.currentTarget.dataset\r\n const img = this.data[name][index].imgs[i]\r\n resolveImage(e, img, this.canvas)\r\n },\r\n luckyImgLoad () {\r\n this.showCanvas = false\r\n },\r\n handleClickOfImg (e) {\r\n const { clientX: x, clientY: y } = e.changedTouches[0]\r\n wx.createSelectorQuery().in(this).select('.lucky-img').fields({\r\n rect: true\r\n }).exec((res) => {\r\n const { left, top } = res[0]\r\n this.toPlay(x - left, y - top)\r\n })\r\n },\r\n handleClickOfCanvas (e) {\r\n const { x, y } = e.changedTouches[0]\r\n this.toPlay(x, y)\r\n },\r\n toPlay (x, y) {\r\n const ctx = this.ctx\r\n ctx.beginPath()\r\n ctx.arc(0, 0, this.$lucky.maxBtnRadius, 0, Math.PI * 2, false)\r\n if (!ctx.isPointInPath(x * this.dpr, y * this.dpr)) return\r\n // 隐藏图片并显示canvas\r\n this.showCanvas = true\r\n this.setData({ luckyImg: '' })\r\n // 触发 lucky-canvas 的抽奖逻辑\r\n this.$lucky.startCallback()\r\n },\r\n play(...rest) {\r\n this.$lucky.play(...rest)\r\n },\r\n stop(...rest) {\r\n this.$lucky.stop(...rest)\r\n },\r\n },\r\n})\r\n"],"sourceRoot":""}
0 2 \ No newline at end of file
... ...
packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.json 0 → 100644
  1 +{
  2 + "component": true,
  3 + "usingComponents": {}
  4 +}
0 5 \ No newline at end of file
... ...
packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.wxml 0 → 100644
  1 +<view class="lucky-box" style="width: {{width}}; height: {{height}}">
  2 +
  3 + <canvas
  4 + hidden="{{hiddenCanvas}}"
  5 + type="2d"
  6 + id="lucky-wheel"
  7 + canvas-id="lucky-wheel"
  8 + bindtouchstart="handleClickOfCanvas"
  9 + style="width: {{width}}; height: {{height}}; visibility: {{showCanvas ? 'visible' : 'hidden'}}; "
  10 + ></canvas>
  11 + <image
  12 + wx:if="{{luckyImg}}"
  13 + src="{{luckyImg}}"
  14 + class="lucky-img"
  15 + mode="scaleToFill"
  16 + bindload="luckyImgLoad"
  17 + bindtouchstart="handleClickOfImg"
  18 + style="width: {{width}}; height: {{height}}"
  19 + ></image>
  20 +
  21 +
  22 + <view>
  23 + <view wx:if="{{isShow}}" wx:for="{{blocks}}" wx:key="index" wx:for-index="index" wx:for-item="block" style="visibility: hidden; height: 0">
  24 + <view wx:for="{{block.imgs}}" wx:key="i" wx:for-index="i" wx:for-item="img">
  25 + <image src="{{img.src}}" data-name="blocks" data-index="{{index}}" data-i="{{i}}" bindload="imgBindload"></image>
  26 + </view>
  27 + </view>
  28 + </view>
  29 + <view>
  30 + <view wx:if="{{isShow}}" wx:for="{{prizes}}" wx:key="index" wx:for-index="index" wx:for-item="prize" style="visibility: hidden; height: 0">
  31 + <view wx:for="{{prize.imgs}}" wx:key="i" wx:for-index="i" wx:for-item="img">
  32 + <image src="{{img.src}}" data-name="prizes" data-index="{{index}}" data-i="{{i}}" bindload="imgBindload"></image>
  33 + </view>
  34 + </view>
  35 + </view>
  36 + <view>
  37 + <view wx:if="{{isShow}}" wx:for="{{buttons}}" wx:key="index" wx:for-index="index" wx:for-item="button" style="visibility: hidden; height: 0">
  38 + <view wx:for="{{button.imgs}}" wx:key="i" wx:for-index="i" wx:for-item="img">
  39 + <image src="{{img.src}}" data-name="buttons" data-index="{{index}}" data-i="{{i}}" bindload="imgBindload"></image>
  40 + </view>
  41 + </view>
  42 + </view>
  43 +</view>
... ...
packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.wxss 0 → 100644
  1 +/* mini-luck-draw/lucky-wheel/index.wxss */
  2 +.lucky-box {
  3 + position: relative;
  4 + /* overflow: hidden; */
  5 + margin: 0 auto;
  6 +}
  7 +.lucky-img {
  8 + position: absolute;
  9 + left: 0;
  10 + top: 0;
  11 + z-index: 0;
  12 +}
  13 +#lucky-wheel {
  14 + /* position: relative;
  15 + z-index: 99; */
  16 +}
... ...
packageB/pages/evaluate/evaluate.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 + url: a.url, //接口网址
  13 + iurl: a.imghost,
  14 + defimgurl: "/miniapp/images/no-head.jpg",
  15 + stars_index: -1, //当前点击的星星下标
  16 + labels: [], //星级标签数组
  17 + sub_evaluate: 0, //是否评价成功
  18 + proposal: "", //用户输入的建议
  19 + proposal_size: 100, //评价意见和建议限定字数
  20 + number: "", //订单单号
  21 + beautician: "", //美容师信息
  22 + fromType: "服务评价", //评价来源
  23 + arrangeTime: "", //服务日期
  24 + is_evaluate: 0, //是否评价
  25 + EvaluateDatetime: "", //评价时间
  26 + is_act:0, //是否能购获取图片
  27 + actId:0, //活动ID
  28 + giftBagId:0, //礼包ID
  29 +
  30 + },
  31 + //点击星级
  32 + check_stars: function(e) {
  33 + var th = this;
  34 + var is_evaluate = th.data.is_evaluate; //0可点击
  35 + if (is_evaluate == 0) {
  36 + var index = e.currentTarget.dataset.index;
  37 + var stars_index = th.data.stars_index;
  38 + if (index != stars_index) {
  39 + var url = "/api/weshop/marketing/reservation/star/label/list";
  40 + getApp().request.promiseGet(url, {
  41 + data: {
  42 + Star: index + 1,
  43 + storeId: a.stoid
  44 + }
  45 + }).then(res => {
  46 + if (res.data.code == 0) {
  47 + th.setData({
  48 + labels: res.data.data
  49 + })
  50 + } else {
  51 + getApp().my_warnning(res.data.msg, 0, th);
  52 + return;
  53 + }
  54 + })
  55 + th.setData({
  56 + stars_index: index
  57 + })
  58 + }
  59 + }
  60 + },
  61 + //输入评价意见和建议
  62 + input_proposal: function(e) {
  63 + var th = this;
  64 + var value = e.detail.value;
  65 + th.setData({
  66 + proposal: value
  67 + })
  68 + },
  69 + //图片失败,默认图片
  70 + bind_bnerr1: function (e) {
  71 + var th = this;
  72 + var _errImg = e.target.dataset.errorimg;
  73 + var _Img = e.target.dataset.img;
  74 + if (_Img != undefined) {
  75 + var _errObj = {};
  76 + _errObj[_errImg] = "/miniapp/images/no-head.jpg";
  77 + th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  78 + }
  79 + },
  80 + //选择标签
  81 + check_label: function(e) {
  82 + var th = this;
  83 + var evaluate = th.data.is_evaluate; //0为未评价,未评价才可点击标签
  84 + if (evaluate == 0) {
  85 + var index = e.currentTarget.dataset.index;
  86 + var label_id = th.data.labels[index].check;
  87 + var labels = 'labels[' + index + '].check';
  88 + if (label_id) {
  89 + label_id = 0
  90 + } else {
  91 + label_id = 1
  92 + }
  93 + th.setData({
  94 + [labels]: label_id
  95 + })
  96 + }
  97 + },
  98 +
  99 + //查询美导信息
  100 + query_bea: function() {
  101 + var th = this;
  102 + var url = "/api/weshop/order/pagePosOrder";
  103 + var number = th.data.number; //订单编号
  104 + getApp().request.promiseGet(url, {
  105 + data: {
  106 + store_id: a.stoid,
  107 + user_id: d.user_id,
  108 + No: number
  109 + }
  110 + }).then(res => {
  111 + if (res.data.code == 0) {
  112 + var data = res.data.data.pageData;
  113 + var arrangeTime = data[0].ArrangeTime;
  114 + th.setData({
  115 + beautician: data,
  116 + arrangeTime: arrangeTime
  117 + })
  118 + } else {
  119 + getApp().my_warnning(res.data.msg, 0, th);
  120 + }
  121 + })
  122 + },
  123 +
  124 + //获取预约评价
  125 + evaluate_get: function() {
  126 + var th = this;
  127 + var url = "/api/weshop/evaluation/evaluate/get";
  128 + getApp().request.promiseGet(url, {
  129 + data: {
  130 + number: th.data.number,
  131 + storeId: a.stoid
  132 + }
  133 + }).then(res => {
  134 + if (res.data.code == 0) {
  135 + var list=[];
  136 + res.data.data.BillDate=res.data.data.BillDate.replace(".0",'');
  137 + list.push(res.data.data);
  138 +
  139 + th.setData({
  140 + stars_index: res.data.data.Star-1,
  141 + labels: res.data.data.EvaluationList,
  142 + proposal: res.data.data.Remark,
  143 + EvaluateDatetime: res.data.data.EvaluateDatetime.substring(0, 19),
  144 + beautician:list,
  145 + })
  146 + } else {
  147 + getApp().my_warnning(res.data.msg, 0, th);
  148 + }
  149 + })
  150 + },
  151 + //提交评价
  152 + evaluate_save: function() {
  153 + var th = this;
  154 + var stars = th.data.stars_index; //评价星级
  155 + var proposal = th.data.proposal;
  156 + //判断是否评级
  157 + if (stars < 0) {
  158 + getApp().my_warnning("请进行评分", 0, th);
  159 + return false;
  160 + } else if (proposal == "") {
  161 + getApp().my_warnning("给点建议呗", 0, th);
  162 + return false;
  163 + }
  164 + wx.showLoading({
  165 + title: '加载中',
  166 + })
  167 + var labels = th.data.labels; //星级标签数组
  168 + var evaLabList = []; //用户选择的评价标签
  169 + // 查询评价标签
  170 + for (var i = 0; i < labels.length; i++) {
  171 + if (labels[i].check) {
  172 + evaLabList.push(labels[i].LabelName);
  173 + }
  174 + }
  175 + var url = th.data.url + "/api/weshop/evaluation/evaluate/insert";
  176 + var posNo = th.data.number; //收银单号
  177 + var proposal = th.data.proposal; //用户建议内容
  178 + var fromType = th.data.fromType; //评价来源
  179 + var json = {
  180 + "evaLabList": evaLabList,
  181 + "fromType": 1,
  182 + "number": posNo,
  183 + "remark": proposal,
  184 + "star": stars + 1,
  185 + "storeId": a.stoid
  186 + };
  187 + var data = JSON.stringify(json); //转换成json格式
  188 + wx.request({
  189 + url: url,
  190 + data: data,
  191 + method: 'POST',
  192 + header: {
  193 + 'content-type': 'application/json'
  194 + }, // 设置请求的 header
  195 + success: function(res) {
  196 + wx.hideLoading();
  197 + if (res.data.code == 0) {
  198 + getApp().my_warnning("评价成功", 1, th);
  199 + var namber=th.data.number;
  200 + setTimeout(function() {
  201 + wx.redirectTo({
  202 + url: "/packageB/pages/evaluate_list/evaluate_list?IsEvaluate=1"
  203 + });
  204 + }, 2000);
  205 + } else {
  206 + getApp().my_warnning(res.data.msg, 0, th);
  207 + }
  208 + }
  209 + })
  210 + },
  211 +
  212 + /**
  213 + * 生命周期函数--监听页面加载
  214 + */
  215 + onLoad: function(options) {
  216 + var th = this;
  217 + th.setData({
  218 + number: options.number,
  219 + //is_evaluate: options.evaluate
  220 + })
  221 + //th.query_bea();
  222 + //th.judge_act();
  223 + var userinfo=getApp().globalData.userInfo;
  224 + console.log("userinfo",userinfo)
  225 +
  226 + if(!userinfo){
  227 + getApp().goto("/pages/togoin/togoin");
  228 + }
  229 +
  230 +
  231 + },
  232 +
  233 + /**
  234 + * 生命周期函数--监听页面显示
  235 + */
  236 + onShow: function() {
  237 + //var th = this;
  238 + //var is_evaluate = th.data.is_evaluate;
  239 + //if (is_evaluate == 1) {
  240 + // th.evaluate_get();
  241 + //}
  242 + //判断有没有评价
  243 + this.check_is_pj();
  244 + },
  245 +
  246 +
  247 + //评价其他跳转
  248 + evaluate_qt:function(e){
  249 + var status=e.currentTarget.dataset.status;
  250 + if(!status) status=0;
  251 + wx.redirectTo({
  252 + url: "/packageB/pages/evaluate_list/evaluate_list?IsEvaluate="+status
  253 + });
  254 + },
  255 +
  256 +
  257 +
  258 + //点击领取礼包
  259 + clike_lb:function(){
  260 +
  261 + var id=this.data.actId;
  262 + var gifbagid = this.data.gifbagid;
  263 + console.log(id,"订单", this.data.number),
  264 + wx.redirectTo({
  265 + url: "/pages/giftpack/evaluategift/evaluategift?actId="+id+ "&orderType=2&orderNumber="+this.data.number
  266 + });
  267 +
  268 + },
  269 +
  270 + //--评价有礼判断---
  271 + judge_act: function () {
  272 + var th = this;
  273 + var url = "/api/weshop/marketing/comment/act/judge";
  274 + getApp().request.promiseGet(url, {
  275 + data: {
  276 + orderNumber: th.data.number,
  277 + orderType: 2,
  278 + storeId: a.stoid,
  279 + userId: d.user_id
  280 + }
  281 + }).then(res => {
  282 + if (res.data.code == 0) {
  283 + var id = res.data.data.id;
  284 + var giftbagid = res.data.data.giftbagid;
  285 + th.setData({
  286 + is_act: 1,
  287 + actId: id,
  288 + giftBagId: giftbagid
  289 + })
  290 + } else{
  291 + th.setData({
  292 + is_act:0
  293 + })
  294 + }
  295 + })
  296 + },
  297 +
  298 + //判断是不是已经评价了
  299 + check_is_pj:function(){
  300 + var th=this;
  301 + var chekc_data={};
  302 + chekc_data['storeId'] = a.stoid;
  303 + chekc_data['number'] =this.data.number;
  304 + getApp().request.get("/api/weshop/evaluation/evaluate/check",{
  305 + data:chekc_data,
  306 + success:function(res){
  307 + if(res.data.code==0){
  308 + //没有评价的情况下
  309 + if(res.data.data==='0'){
  310 + th.query_bea();
  311 + th.setData({is_get:1})
  312 + }else if(res.data.data==="1"){
  313 + th.evaluate_get();
  314 + th.setData({is_evaluate:1,is_get:1})
  315 + }
  316 + }else{
  317 + getApp().my_warnning(res.data.msg, 0, th);
  318 + }
  319 + }
  320 + })
  321 +
  322 + },
  323 +
  324 + //跳转到链接地址
  325 + goto:function(e){
  326 + var url=e.currentTarget.dataset.url;
  327 + getApp().goto(url);
  328 + },
  329 +
  330 + //弹出显示商品
  331 + show_goods:function(e){
  332 + var index=e.currentTarget.dataset.index;
  333 + var item=this.data.beautician[index];
  334 + var show_goods_list=item.list;
  335 + this.setData({
  336 + show_goods_list:show_goods_list,
  337 + sh_pop:1
  338 + })
  339 + },
  340 +
  341 + //关闭弹出
  342 + close_pop:function(){
  343 + this.setData({
  344 + show_goods_list:null,sh_pop:0
  345 + })
  346 + }
  347 +
  348 +})
0 349 \ No newline at end of file
... ...
packageB/pages/evaluate/evaluate.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "导购评价",
  3 + "usingComponents": {
  4 + "qr_code": "/components/qr_code/qr_code",
  5 + "warn": "/components/long_warn/long_warn"
  6 + }
  7 +}
0 8 \ No newline at end of file
... ...
packageB/pages/evaluate/evaluate.wxml 0 → 100644
  1 +<view class="container" wx:for="{{beautician}}" wx:if="{{index<1}}" wx:for-item="it">
  2 + <!-- 头像 -->
  3 + <view class="flex-center head">
  4 + <image class="headimg" src="{{!it.PhotoUrl || it.PhotoUrl==''?iurl+defimgurl:it.PhotoUrl}}" lazy-load="true"
  5 + data-errorimg="beautician[{{index}}].PhotoUrl"
  6 + binderror="bind_bnerr1" data-img="beautician[{{index}}].PhotoUrl"></image>
  7 + </view>
  8 +
  9 + <!-- 姓名 -->
  10 + <view class="flex-level item">
  11 + <view class="itemlf flex-level-right">
  12 + <view class="fs32">导购名称:</view>
  13 + </view>
  14 + <view class="itemlr fs30 ellipsis-1">{{it.StaffName?it.StaffName:'无'}}</view>
  15 + </view>
  16 +
  17 + <!-- 项目 -->
  18 + <view class="flex-center item" bindtap="show_goods" data-index="{{index}}">
  19 + <view class="itemlf fs32 flex-level-right">购买商品:</view>
  20 + <view class="itemlr fs30 ellipsis-1 go_right">{{it.list[0].WareName}}</view>
  21 + </view>
  22 +
  23 + <!-- 时间 -->
  24 + <view class="flex-center item">
  25 + <view class="itemlf fs32 flex-level-right">购买时间:</view>
  26 + <view class="itemlr fs30">{{it.BillDate}}</view>
  27 + </view>
  28 +
  29 + <!-- 评价时间 -->
  30 + <view class="flex-center" wx:if="{{is_evaluate==1}}">
  31 + <view class="itemlf fs32 flex-level-right">评价时间:</view>
  32 + <view class="itemlr fs30">{{EvaluateDatetime}}</view>
  33 + </view>
  34 +
  35 + <!-- 设置虚线 -->
  36 + <view class="flex-center">
  37 + <view class="starss">
  38 + <image class="stars" src="{{iurl}}{{key<=stars_index?'/miniapp/images/StarsredCk.png':'/miniapp/images/StarswhiteUnCk.png'}}" wx:for="{{5}}" bindtap="check_stars" data-index="{{key}}" wx:for-index="key"></image>
  39 + </view>
  40 + </view>
  41 + <view class="tea_labs">
  42 + <view class="flex-center fs26">
  43 + <block wx:if="{{is_evaluate==0}}">
  44 + <textarea class="rel textarea" placeholder="写其他意见和建议" placeholder-class="fs24" maxlength="{{proposal_size}}" bindinput="input_proposal" value="{{proposal}}">
  45 + <!-- 提示已输入多少数字 -->
  46 + <view if="{{is_evaluate==0}}" class="proposal abs">{{proposal.length}}/{{proposal_size}}</view>
  47 + </textarea>
  48 + </block>
  49 + <block wx:else>
  50 + <view wx:if="{{proposal!=''}}" class="textarea">
  51 + {{proposal}}
  52 + </view>
  53 + </block>
  54 + </view>
  55 +
  56 + <view wx:if="{{labels.length>0 && is_evaluate==0}}" class="labels flex fs24 ellipsis-3">
  57 + <view class="label {{item.check==1?'checklabel':''}} flex-center" wx:for="{{labels}}" bindtap="check_label" data-index="{{key}}" wx:for-index="key">
  58 + <view class="ellipsis-1">{{item.LabelName}}</view>
  59 + </view>
  60 +
  61 + </view>
  62 + <view wx:if="{{labels.length>0 && is_evaluate==1}}" class="{{labels.length==1 || labels.length==2?'flex-center':''}}" style="width:100%;">
  63 + <view class="labels flex fs24 ellipsis-3">
  64 + <view class="label checklabel flex-center" wx:for="{{labels}}" bindtap="check_label" data-index="{{key}}" wx:for-index="key">
  65 + <view class="ellipsis-1">{{item.LabelName}}</view>
  66 + </view>
  67 +
  68 + </view>
  69 + </view>
  70 +
  71 + </view>
  72 +
  73 + <view wx:if="{{is_evaluate==0}}" class="feedback flex-center fs28">
  74 + <view>满意的话请打五星噢,谢谢您的支持!</view>
  75 + </view>
  76 +
  77 + <block wx:if="{{sub_evaluate}}">
  78 + <view class="subSuccess">
  79 + <view class="flex-center">
  80 + <image class="Success" src="{{iurl}}/miniapp/images/yyservice/Success.png"></image>
  81 + </view>
  82 + <view class="fs36 flex-center">
  83 + <view>评价成功</view>
  84 + </view>
  85 + </view>
  86 + </block>
  87 +</view>
  88 +
  89 +<block wx:if="{{is_get}}">
  90 +<navigator wx:if="{{is_evaluate==0}}" class="Subs fs32 flex-center">
  91 + <view class="Submission flex-center" bindtap="evaluate_save">
  92 + <view>确认提交</view>
  93 + </view>
  94 +</navigator>
  95 +<view wx:else>
  96 +
  97 +
  98 + <view style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center" bindtap="evaluate_qt">
  99 + <view>评价其他</view>
  100 + </view>
  101 + <view style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center" bindtap="evaluate_qt" data-status="1">
  102 + <view>查看已评价的订单</view>
  103 + </view>
  104 +
  105 + <!-- 显示来个图标 -->
  106 + <view class="show_icon" style="margin-top: 60rpx;">
  107 + <view class="icon_item" bindtap="goto" data-url="/pages/index/index/index">
  108 + <view>
  109 + <image style="width: 60rpx; height: 50rpx;" src="{{iurl}}/miniapp/images/evaluate/store.png"></image>
  110 + <view>溜街</view>
  111 + </view>
  112 + </view>
  113 + <view class="icon_item" bindtap="goto" data-url="/packageA/pages/quan_list/quan_list">
  114 + <view>
  115 + <image style="width: 70rpx; height: 50rpx;" src="{{iurl}}/miniapp/images/evaluate/lq.png"></image>
  116 + <view>领券</view>
  117 + </view>
  118 + </view>
  119 + </view>
  120 +
  121 + <view style="height: 60rpx;"></view>
  122 + <view wx:if="{{is_act==1}}" style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center yellow-b" bindtap="clike_lb">
  123 + <view>点击领取礼品</view>
  124 + </view>
  125 + </view>
  126 +<warn id="warn"></warn>
  127 +</block>
  128 +
  129 +
  130 +<view hidden="{{!sh_pop}}">
  131 + <view class="cover-layer" bindtap="close_pop"></view>
  132 + <view class="show_pop_div">
  133 + <view class="title">商品详情</view>
  134 + <view style="padding: 0 20rpx;">
  135 + <view class="flex jc_sb fs30" style="margin-top: 20rpx;" wx:for="{{show_goods_list}}">
  136 + <view>{{item.WareName}}</view>
  137 + <view>{{item.Qty}}</view>
  138 + </view>
  139 + </view>
  140 + </view>
  141 +</view>
  142 +
... ...
packageB/pages/evaluate/evaluate.wxss 0 → 100644
  1 +.container {
  2 + border-top: 7rpx solid rgb(245, 245, 245);
  3 + padding-bottom: 100rpx;
  4 + background-color: rgb(255, 255, 255);
  5 +}
  6 +
  7 +.head {
  8 + height: 270rpx;
  9 +}
  10 +
  11 +.headimg {
  12 + width: 190rpx;
  13 + height: 190rpx;
  14 + border-radius: 50%;
  15 +}
  16 +
  17 +.item {
  18 + margin-bottom: 20rpx;
  19 +}
  20 +
  21 +.itemlf {
  22 + width: 195rpx;
  23 +}
  24 +
  25 +.itemlr {
  26 + width: 360rpx;
  27 +}
  28 +
  29 +.starss {
  30 + margin-top: 15rpx;
  31 + border-top: 3rpx dashed rgb(203, 203, 203);
  32 + padding-top: 25rpx;
  33 + padding-left: 15rpx;
  34 +}
  35 +
  36 +.stars {
  37 + width: 50rpx;
  38 + height: 50rpx;
  39 + margin-right: 20rpx;
  40 +}
  41 +
  42 +.datetime {
  43 + width: 190rpx;
  44 +}
  45 +
  46 +.tea_labs {
  47 + padding: 0rpx 56rpx;
  48 + margin-top: 20rpx;
  49 +}
  50 +
  51 +.proposal {
  52 + right: 20rpx;
  53 + bottom: 20rpx;
  54 + color: rgb(152, 152, 152);
  55 +}
  56 +
  57 +.textarea {
  58 + width: 100%;
  59 + height: 200rpx;
  60 + margin-top: 70rpx;
  61 + border: 2rpx solid rgb(203, 203, 203);
  62 + border-radius: 13rpx;
  63 + padding-top: 25rpx;
  64 + padding-left: 30rpx;
  65 + margin-bottom: 30rpx;
  66 + padding-right: 15rpx;
  67 + padding-bottom: 20rpx;
  68 +}
  69 +
  70 +.labels {
  71 + display: inline-block;
  72 + max-height: 240rxp;
  73 + line-height: 50rpx;
  74 + padding-left: 15rpx;
  75 +}
  76 +
  77 +.label {
  78 + padding: 0rpx 10rpx;
  79 + height: 48rpx;
  80 + line-height: 48rpx;
  81 + border: 2rpx solid rgb(218, 218, 218);
  82 + color: rgb(152, 152, 152);
  83 + border-radius: 5rpx;
  84 + margin-right: 20rpx;
  85 + width: 165rpx;
  86 + display: inline-block;
  87 + text-align: center;
  88 + margin-bottom: 10rpx;
  89 +}
  90 +
  91 +/* 选择标签的样式 */
  92 +
  93 +.checklabel {
  94 + border: 2rpx solid rgb(214, 1, 33);
  95 + background-color: rgb(255, 231, 235);
  96 + color: rgb(214, 1, 33);
  97 +}
  98 +
  99 +.feedback {
  100 + color: rgb(152, 152, 152);
  101 + margin-bottom: 70rpx;
  102 +}
  103 +
  104 +.Subs {
  105 + background-color: rgb(255, 255, 255);
  106 + position: fixed;
  107 + width: 100%;
  108 + bottom: 40rpx;
  109 +}
  110 +
  111 +.Submission {
  112 + width: 400rpx;
  113 + height: 65rpx;
  114 + border-radius: 60rpx;
  115 + background-color: rgb(214, 1, 33);
  116 + color: rgb(255, 255, 255);
  117 +}
  118 +.Submission.yellow-b{
  119 + background-color: #ffb03f;
  120 +
  121 +}
  122 +
  123 +.clonri {
  124 + margin: 0rpx;
  125 +}
  126 +
  127 +.subSuccess {
  128 + position: fixed;
  129 + z-index: 3;
  130 + top: 435rpx;
  131 + left: 66rpx;
  132 + background-color: #a6a6a6a4;
  133 + width: 615rpx;
  134 + height: 315rpx;
  135 + border-radius: 20rpx;
  136 + color: rgb(255, 255, 255);
  137 +}
  138 +
  139 +.Success {
  140 + width: 110rpx;
  141 + height: 110rpx;
  142 + margin-top: 50rpx;
  143 + margin-bottom: 45rpx;
  144 +}
  145 +
  146 +.show_icon{
  147 + width: 50%;
  148 + margin: 0 auto;
  149 + display: flex; justify-content: space-between;
  150 +}
  151 +
  152 +.icon_item{
  153 + display: flex;align-items: center; justify-content: center; font-size: 26rpx; text-align: center;
  154 + width: 140rpx; height: 140rpx; border: 1rpx solid #eee; border-radius: 50%; line-height: 34rpx;
  155 +}
  156 +
  157 +.go_right::after{
  158 + content: '';
  159 + display: inline-block;
  160 + width: 20rpx;
  161 + height: 20rpx;
  162 + border-top:1rpx solid #999 ;
  163 + border-right: 1rpx solid #999;
  164 + transform: rotate(45deg);
  165 +}
  166 +
  167 +.show_pop_div{
  168 + position: fixed; max-height:50%; left: 0;top:50%; transform: translateY(-50%); overflow-y: auto;
  169 + background-color: #fff; text-align: center; z-index: 100000; width: 100%; min-height: 300rpx;
  170 +}
  171 +
  172 +.show_pop_div .title{
  173 + height: 100rpx; line-height: 100rpx; border-bottom: 1rpx solid #eee; font-size: 34rpx;
  174 +}
... ...
packageB/pages/evaluate_list/evaluate_list.js 0 → 100644
  1 + var e = getApp(),
  2 + os = e.globalData.setting,
  3 + t = e.request,
  4 + d = e.globalData;
  5 +Page({
  6 + /**
  7 + * 页面的初始数据
  8 + */
  9 + data: {
  10 + url: os.url, //接口网址
  11 + iurl: os.imghost,
  12 + defimgurl: "/miniapp/images/no-head.jpg",
  13 + list:[],
  14 + },
  15 +
  16 + //图片失败,默认图片
  17 + bind_bnerr1: function (e) {
  18 + var th = this;
  19 + var _errImg = e.target.dataset.errorimg;
  20 + var _Img = e.target.dataset.img;
  21 + if (_Img != undefined) {
  22 + var _errObj = {};
  23 + _errObj[_errImg] = "/miniapp/images/no-head.jpg";
  24 + th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  25 + }
  26 + },
  27 +
  28 + /**
  29 + * 生命周期函数--监听页面加载
  30 + */
  31 + onLoad: function(options) {
  32 + var th=this;
  33 + getApp().getConfig(function(e){
  34 + th.setData({img:e.store_logo});
  35 + })
  36 +
  37 + var IsEvaluate=options.IsEvaluate?options.IsEvaluate:0;
  38 + this.setData({IsEvaluate:parseInt(IsEvaluate) });
  39 + this.get_list();
  40 + },
  41 +
  42 + /**
  43 + * 生命周期函数--监听页面显示
  44 + */
  45 + onShow: function() {
  46 +
  47 + },
  48 +
  49 + get_list:function(){
  50 + var th=this;
  51 + var req={
  52 + storeId:os.stoid,
  53 + VIPId:getApp().globalData.userInfo.erpvipid,
  54 + IsEvaluate:0
  55 + }
  56 + if(parseInt(this.data.IsEvaluate)){
  57 + req.IsEvaluate=1;
  58 + }
  59 +
  60 + var url="/api/weshop/evaluation/FormListNew/page"; //获取评价列表
  61 + getApp().request.get(url,{
  62 + data:req,
  63 + success:function(res){
  64 + console.log(res);
  65 + th.setData({is_get:1});
  66 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  67 + th.setData({list:res.data.data.pageData});
  68 + }
  69 + },
  70 + })
  71 + },
  72 +
  73 + go_evaluate(e){
  74 + var idx=e.currentTarget.dataset.index;
  75 + var item=this.data.list[idx];
  76 + var posno=item.PosNo;
  77 + getApp().goto("/packageB/pages/evaluate/evaluate?number="+posno);
  78 + },
  79 +
  80 + //弹出显示商品详情
  81 + show_pop:function(e){
  82 + var idx=e.currentTarget.dataset.index;
  83 + var item=this.data.list[idx];
  84 + var posno=item.PosNo;
  85 + var th=this;
  86 + //获取商品详情
  87 + var url="/api/weshop/evaluation/Evaluatewares/page";
  88 + getApp().request.get(url,{
  89 + isShowLoading:true,
  90 + data:{storeId:os.stoid,POSNo:posno},
  91 + success:function(res){
  92 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  93 + th.setData({show_goods_list:res.data.data.pageData,sh_pop:1});
  94 + }
  95 + }
  96 + })
  97 + },
  98 +
  99 + //关闭弹出
  100 + close_pop:function(){
  101 + this.setData({
  102 + show_goods_list:null,sh_pop:0
  103 + })
  104 + }
  105 +
  106 +
  107 +
  108 +
  109 +
  110 +})
0 111 \ No newline at end of file
... ...
packageB/pages/evaluate_list/evaluate_list.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "评价列表",
  3 + "usingComponents": {
  4 + "qr_code": "/components/qr_code/qr_code",
  5 + "warn": "/components/long_warn/long_warn"
  6 + }
  7 +}
0 8 \ No newline at end of file
... ...
packageB/pages/evaluate_list/evaluate_list.wxml 0 → 100644
  1 +
  2 +<block wx:if="{{list.length==0 && is_get}}">
  3 + <view class="fs30" style="text-align: center;">
  4 + <image mode="widthFix" style="width: 360rpx;" src="{{iurl}}/miniapp/images/user/nodistribut.png"></image>
  5 + <view style="margin-top: 30rpx;">暂无订单或未设置评价信息</view>
  6 + </view>
  7 +</block>
  8 +<block wx:else>
  9 + <view class="item flex fs26 ai-center" style="line-height: 34rpx;" wx:for="{{list}}">
  10 + <view class="show_img" style="width: 26%; text-align: center;">
  11 + <image class="logo" mode="aspectFit" src="{{iurl+img}}"></image>
  12 + </view>
  13 + <view style="width: 74%; padding-right: 6rpx;padding-left: 18rpx;">
  14 + <view>
  15 + <view class="line_item flex ai-center fs28">
  16 + <image style="width: 60rpx;" mode="widthFix" src="{{iurl}}/miniapp/images/evaluate/idcard.png"></image>
  17 + <image style="width: 30rpx; height: 30rpx; margin-left: 20rpx; margin-right: 10rpx;" src="{{iurl}}/miniapp/images/evaluate/starlit.png"></image>4.9
  18 + </view>
  19 + <view class="line_item flex jc_sb ai-center" style="margin-top: 18rpx;">
  20 + <view class="ellipsis-1" style="max-width: 90%;">{{item.WareName}}</view>
  21 + <view bindtap="show_pop" data-index="{{index}}" class="go_right"></view>
  22 + </view>
  23 + <view class="line_item flex jc_sb ai-center" style="margin-top: 14rpx;">
  24 + <view class="fs24" style="color: #999;">消费时间:{{item.BillDate}}</view>
  25 + <view bindtap="go_evaluate" data-index="{{index}}" wx:if="{{IsEvaluate}}" class="btn">查看评价</view>
  26 + <view bindtap="go_evaluate" data-index="{{index}}" wx:else class="btn">去评价</view>
  27 + </view>
  28 +
  29 + </view>
  30 + </view>
  31 + </view>
  32 +
  33 +
  34 +</block>
  35 +
  36 +
  37 +<warn id="warn"></warn>
  38 +<!-- 显示商品列表 -->
  39 +<view hidden="{{!sh_pop}}">
  40 + <view class="cover-layer" bindtap="close_pop"></view>
  41 + <view class="show_pop_div">
  42 + <view class="title">商品详情</view>
  43 + <view style="padding: 0 20rpx;">
  44 + <view class="flex jc_sb fs30" style="margin-top: 20rpx;" wx:for="{{show_goods_list}}">
  45 + <view>{{item.WareName}}</view>
  46 + <view>{{item.Qty}}</view>
  47 + </view>
  48 + </view>
  49 + </view>
  50 +</view>
  51 +
... ...
packageB/pages/evaluate_list/evaluate_list.wxss 0 → 100644
  1 +.item{ padding:10rpx 20rpx; border-bottom: 20rpx solid #ebeced}
  2 +.line_item{ height: 36rpx;}
  3 +.logo{
  4 + width: 160rpx; height: 160rpx; border-radius: 50%; border: 1rpx solid #eee;
  5 +}
  6 +.go_right{position: relative;top:-10rpx;right: 10rpx;}
  7 +.go_right::after{
  8 + content: '';
  9 + display: inline-block;
  10 + width: 20rpx;
  11 + height: 20rpx;
  12 + border-top:1rpx solid #333 ;
  13 + border-right: 1rpx solid #333;
  14 + transform: rotate(45deg);
  15 +}
  16 +.btn{
  17 + padding: 10rpx 16rpx; border: 1rpx solid #c4182e; color: #c4182e; border-radius: 8rpx;
  18 +}
  19 +
  20 +
  21 +.show_pop_div{
  22 + width: 96%; margin-left: 2%; position: fixed; max-height:50%; left: 0;top:50%; transform: translateY(-50%); overflow-y: auto;
  23 + background-color: #fff; text-align: center; z-index: 100000; min-height: 300rpx;
  24 +}
  25 +
  26 +.show_pop_div .title{
  27 + height: 100rpx; line-height: 100rpx; border-bottom: 1rpx solid #eee; font-size: 34rpx;
  28 +}
... ...
packageB/pages/luckactivity/index/g_filter.wxs 0 → 100644
  1 +var g_filters = {
  2 + has_char:function(url,key){
  3 + if(!url) return -1;
  4 + return url.indexOf(key);
  5 + },
  6 + beg_time:function(beg_date){
  7 + var fmt1 = beg_date.substring(0, 19);
  8 + var reg = getRegExp("-", "g");
  9 + var fmt2 = fmt1.replace(reg, '/');
  10 + var t1 = getDate(fmt2);
  11 + var tnow=getDate();
  12 + if(t1<=tnow) return 1;
  13 + return 0;
  14 + },
  15 + end_time:function(end_date){
  16 + var fmt1 = end_date.substring(0, 19);
  17 + var reg = getRegExp("-", "g");
  18 + var fmt2 = fmt1.replace(reg, '/');
  19 + var t1 = getDate(fmt2);
  20 + var tnow=getDate();
  21 + if(t1>=tnow) return 1;
  22 + return 0;
  23 + },
  24 + btnText: function(userlbtype) {
  25 + switch(userlbtype) {
  26 + case 1: {
  27 + return '去兑换';
  28 + };
  29 + case 2: {
  30 + return '已兑换';
  31 + };
  32 + case 3: {
  33 + return '已到期';
  34 + };
  35 + case 4: {
  36 + return '查看';
  37 + };
  38 + };
  39 + },
  40 +}
  41 +module.exports = {
  42 + has_char: g_filters.has_char,
  43 + beg_time: g_filters.beg_time,
  44 + end_time: g_filters.end_time,
  45 + btnText: g_filters.btnText,
  46 +}
0 47 \ No newline at end of file
... ...
packageB/pages/luckactivity/index/index.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 = '/api/weshop/marketing/marketingLuckForm/page';
  24 + let data = {
  25 + store_id: app.globalData.setting.stoid,
  26 + user_id: app.globalData.userInfo.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 + data.is_end = 0;
  38 + } else if(index == 1) {
  39 + data.is_end = 1;
  40 + };
  41 +
  42 + this.getData(true, url, data).then(function() {
  43 + self.setData({
  44 + currentData: data,
  45 + });
  46 + });
  47 + },
  48 +
  49 + /**
  50 + * 生命周期函数--监听页面加载
  51 + */
  52 + onLoad: function (options) {
  53 + self = this;
  54 +
  55 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  56 + self.setData({
  57 + userInfo: data,
  58 + });
  59 + });
  60 + },
  61 +
  62 + /**
  63 + * 生命周期函数--监听页面初次渲染完成
  64 + */
  65 + onReady: function () {},
  66 +
  67 + /**
  68 + * 生命周期函数--监听页面显示
  69 + */
  70 + onShow: function () {
  71 + if(app.globalData.userInfo) {
  72 + if(!this.data.isLogin) {
  73 + this.setData({
  74 + userInfo: app.globalData.userInfo,
  75 + imghost: app.globalData.setting.imghost,
  76 + isLogin: true,
  77 + });
  78 +
  79 +
  80 + let url = '/api/weshop/marketing/marketingLuckForm/page';
  81 + let data = {
  82 + store_id: app.globalData.setting.stoid,
  83 + user_id: app.globalData.userInfo.user_id,
  84 + is_end: 0,
  85 + };
  86 +
  87 + this.setData({
  88 + list: null,
  89 + pageNum: 1,
  90 + noMore: false,
  91 + });
  92 +
  93 + this.getData(true, url, data).then(function() {
  94 + self.setData({
  95 + currentData: data,
  96 + });
  97 + });
  98 +
  99 + // 获取广告
  100 + app.request.promiseGet("/api/weshop/ad/page", {
  101 + data: {
  102 + pid: 1201,
  103 + store_id: app.globalData.setting.stoid,
  104 + enabled: 1
  105 + }
  106 + }).then(res => {
  107 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  108 + var a = res.data.data.pageData;
  109 + var narr=[];
  110 + for(var i in a){
  111 + var tt = {
  112 + 'ad_code': os.imghost + a[i].ad_code,
  113 + 'media_link': '',
  114 + 'ad_weapplink':a[i].ad_weapplink
  115 + };
  116 + narr.push(tt);
  117 + }
  118 +
  119 + self.setData({
  120 + ad_data: narr,
  121 + });
  122 + }
  123 + })
  124 +
  125 +
  126 + };
  127 + };
  128 +
  129 +
  130 +
  131 +
  132 + },
  133 +
  134 + /**
  135 + * 生命周期函数--监听页面隐藏
  136 + */
  137 + onHide: function () {
  138 +
  139 + },
  140 +
  141 + /**
  142 + * 生命周期函数--监听页面卸载
  143 + */
  144 + onUnload: function () {
  145 +
  146 + },
  147 +
  148 + /**
  149 + * 页面相关事件处理函数--监听用户下拉动作
  150 + */
  151 + onPullDownRefresh: function () {
  152 +
  153 + },
  154 +
  155 + /**
  156 + * 页面上拉触底事件的处理函数
  157 + */
  158 + onReachBottom: function () {
  159 + let data = this.data.currentData;
  160 + console.log('触底!', data);
  161 + this.scrollToLower('/api/weshop/marketing/marketingLuckForm/page', data);
  162 + },
  163 +
  164 + /**
  165 + * 用户点击右上角分享
  166 + */
  167 + onShareAppMessage: function () {
  168 +
  169 + },
  170 +
  171 + /**
  172 + * 请求数据
  173 + */
  174 + getData: function(isInit, url, data) {
  175 + let p = app.request.promiseGet(url, {
  176 + data: data,
  177 + isShowLoading: true,
  178 + })
  179 + .then(function(res) {
  180 + if(res.data.code == 0) {
  181 +
  182 + self.setData({
  183 + isLoading: false
  184 + });
  185 +
  186 + if(isInit) {// 第一次加载
  187 + self.setData({
  188 + list: res.data.data
  189 + });
  190 + } else {
  191 + self.setData({
  192 + 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData)
  193 + });
  194 + };
  195 +
  196 + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) {
  197 + self.setData({
  198 + noMore: true
  199 + });
  200 + };
  201 +
  202 + } else {
  203 + self.setData({
  204 + 'list.pageData': []
  205 + });
  206 + };
  207 +
  208 + });
  209 +
  210 + return p;
  211 + },
  212 +
  213 +
  214 + /**
  215 + * 上拉加载
  216 + */
  217 + scrollToLower(url, requestData) {
  218 + // 数据总量
  219 + let total = this.data.list.total;
  220 + // 单页最大数据量
  221 + let pageSize = this.data.list.pageSize;
  222 + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’
  223 + if((total != 0)&&(total <= pageSize)) {
  224 + this.setData({
  225 + noMore: true
  226 + });
  227 + };
  228 +
  229 + if(!this.data.isLoading && !this.data.noMore) {
  230 + this.setData({
  231 + isLoading: true,
  232 + pageNum: this.data.pageNum + 1
  233 + });
  234 + requestData.page = this.data.pageNum;
  235 + this.getData(false, url, requestData);
  236 + };
  237 + },
  238 +
  239 + /**
  240 + * 点击跳转
  241 + */
  242 + goto(e) {
  243 + // let url = '';
  244 + // if(e.target.dataset.url) {
  245 + // url = e.target.dataset.url;
  246 + // } else {
  247 + // url = e.currentTarget.dataset.url;
  248 + // }
  249 + let id = e.currentTarget.dataset.id;
  250 + let title = e.currentTarget.dataset.title;
  251 + let url = `/packageB/pages/luckactivity/luckinfo/luckinfo?id=${id}&title=${title}`;
  252 + app.goto(url);
  253 + },
  254 +
  255 +
  256 +
  257 +})
0 258 \ No newline at end of file
... ...
packageB/pages/luckactivity/index/index.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
... ...
packageB/pages/luckactivity/index/index.wxml 0 → 100644
  1 +<wxs module="filter" src="../../../../utils/filter.wxs"></wxs>
  2 +<wxs module="g_filter" src="g_filter.wxs"></wxs>
  3 +<view>
  4 + <swiper class="swiper" circular="true" autoplay="true" indicator-dots="true" interval="2500" wx:if="{{ad_data}}" indicator-active-color="rgba(255,255,255,.8)">
  5 + <!-- <swiper class="swiper" circular="true" autoplay="true" indicator-dots="true" interval="2500"> -->
  6 + <block wx:for="{{ad_data}}">
  7 + <swiper-item>
  8 + <!-- <navigator url="{{item.ad_weapplink}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.ad_weapplink,'plugin')>=0}}"> -->
  9 + <navigator url="{{item.ad_weapplink}}" style="height: 100%;" hover-class="none" open-type="reLaunch">
  10 + <image src="{{item.ad_code}}" class="img" bindload="imageLoad" data-index="{{index}}" mode="scaleToFill" lazy-load="true"/>
  11 + </navigator>
  12 + </swiper-item>
  13 + </block>
  14 + </swiper>
  15 + <view class="tab-title" bindtap="clickTab">
  16 + <view class="tab-title-item {{currentIndex == index ? 'active':''}}" wx:for="{{tabArr}}" data-index="{{index}}">{{item}}</view>
  17 + </view>
  18 + <view class="tab-content">
  19 +
  20 + <block wx:for="{{list.pageData}}">
  21 + <view class="tab-item" bindtap="goto" data-id="{{item.id}}" data-title="{{item.act_name}}">
  22 + <view class="img-container">
  23 + <image wx:if="{{item.imageurl}}" src="{{imghost + item.imageurl}}" class="img"></image>
  24 + <text class="iconfont icon-zhuanpan" wx:else></text>
  25 + </view>
  26 + <view class="desc-container">
  27 + <view class="">
  28 + <!-- 标题 -->
  29 + <view class="ellipsis-1x taj fs28">{{item.act_name}}</view>
  30 + <!-- 时间 -->
  31 + <view class="date pdt10 pdb20" wx:if="{{currentIndex == 0}}">活动时间:{{filter.format_time(item.begindate) + ' 至 ' + filter.format_time(item.enddate)}}</view>
  32 + <view class="date pdt10 pdb20" wx:else>兑换时间:{{filter.format_time(item.begindate) + ' 至 ' + filter.format_time(item.enddate)}}</view>
  33 + </view>
  34 + <!-- 按钮 -->
  35 + <view class="btn-container">
  36 + <view class="btn red" wx:if="{{currentIndex == 0}}">立即参与</view>
  37 + <view class="btn {{item.userlbtype == 1 ? 'red':'gray'}}" wx:else>{{g_filter.btnText(item.userlbtype)}}</view>
  38 + </view>
  39 + </view>
  40 + </view>
  41 + </block>
  42 +
  43 +
  44 +
  45 + <nodata nodataContainer="t-c" wx:if="{{list.pageData.length == 0}}"></nodata>
  46 + <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">—— 已经到底了 ——</view>
  47 + </view>
  48 +</view>
  49 +
  50 +<!-- 引入提示组件 -->
  51 +<warn id="warn"></warn>
  52 +<my_confirm id="my_confirm"></my_confirm>
... ...
packageB/pages/luckactivity/index/index.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 + padding: 20rpx;
  88 + background-color: white;
  89 + border-radius: 10rpx;
  90 + overflow: hidden;
  91 + display: flex;
  92 + align-items: center;
  93 +}
  94 +
  95 +.tab-item ~ .tab-item {
  96 + margin-top: 20rpx;
  97 +}
  98 +
  99 +.icon-zhuanpan {
  100 + font-size: 120rpx;
  101 + color: #FF6768;
  102 +}
  103 +
  104 +.img-container {
  105 + /* background-color: #dedede; */
  106 + /* height: 300rpx; */
  107 + width: 160rpx;
  108 + height: 160rpx;
  109 + line-height: 160rpx;
  110 + text-align: center;
  111 +}
  112 +
  113 +.img-container2 {
  114 + /* width: 200rpx;
  115 + height: 200rpx;
  116 + background-color: #dedede;
  117 + margin-right: 20rpx;
  118 + flex-shrink: 0;
  119 + display: flex;
  120 + align-items: center;
  121 + justify-content: center;
  122 + position: relative; */
  123 +}
  124 +
  125 +.img-container2.error::before {
  126 + /* font-family: iconfont;
  127 + position: absolute;
  128 + content: '\e8c1'; */
  129 +}
  130 +
  131 +.img {
  132 + display: block;
  133 + width: 100%;
  134 + height: 100%;
  135 +}
  136 +
  137 +.desc-container {
  138 + /* padding: 20rpx; */
  139 + padding-left: 20rpx;
  140 + flex: 1;
  141 +}
  142 +
  143 +
  144 +
  145 +.rmb::before {
  146 + content: '¥';
  147 +}
  148 +
  149 +.date {
  150 + color: #a4a4a4;
  151 + font-size: 24rpx;
  152 +}
  153 +
  154 +.btn-container {
  155 + display: flex;
  156 + justify-content: flex-end;
  157 + font-size: 26rpx;
  158 +}
  159 +
  160 +.btn {
  161 + font-size: 28rpx;
  162 + padding: 12rpx 30rpx;
  163 + border-radius: 8rpx;
  164 + text-align: center;
  165 + display: inline-block;
  166 + text-align: right;
  167 +}
  168 +
  169 +.btn.red {
  170 + background-color: #FF6768;
  171 + color: white;
  172 +}
  173 +
  174 +.btn.pink {
  175 + background-color: #FACAD6;
  176 + color: #FF6768;
  177 +}
  178 +
  179 +.noMore {
  180 + padding: 20rpx;
  181 + color: #bbb;
  182 + text-align: center;
  183 + font-size: 22rpx;
  184 +}
  185 +
  186 +.btn.gray {
  187 + background-color: #aaa;
  188 + color: white;
  189 +}
0 190 \ No newline at end of file
... ...
packageB/pages/luckactivity/luckinfo/luckinfo.js 0 → 100644
  1 +var WxParse = require('../../../../utils/wxParse/wxParse.js');
  2 +const app = getApp();
  3 +let imghost = app.globalData.setting.imghost;
  4 +let self = null;
  5 +
  6 +Page({
  7 + data: {
  8 + start: false,
  9 + list: null,
  10 + isLoading: false, // 检测是否已经发送请求,防止重复发送请求
  11 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
  12 + pageNum: 1, // 当前页数
  13 + imghost: imghost,
  14 + num: 3,
  15 +
  16 + prizes: [],
  17 + defaultConfig: {
  18 + offsetDegree: 22.5,
  19 + },
  20 + // defaultStyle: {
  21 + // fontColor: '#d64737',
  22 + // fontSize: '14px'
  23 + // },
  24 + blocks: [ //背景图
  25 + // { padding: '13px', background: '#d64737', top: '20rpx' }
  26 + {
  27 + padding: '76rpx',
  28 + // background: 'pink',
  29 + imgs: [{
  30 + src: imghost + 'miniapp/images/luckDraw/weel.png',
  31 + width: '700rpx',
  32 + height: '700rpx',
  33 + rotate: true,
  34 + }]
  35 + }
  36 + ],
  37 + buttons: [
  38 + // { radius: '50px', background: '#d64737' },
  39 + // { radius: '45px', background: '#fff' },
  40 + // { radius: '41px', background: '#f6c66f', pointer: true },
  41 + // {
  42 + // radius: '35px', background: '#ffdea0',
  43 + // fonts: [{ text: '开始\n抽奖', fontSize: '18px', top: -18 }]
  44 + // }
  45 + {
  46 + radius: '60rpx',
  47 + // background: 'black',
  48 + // pointer: true,
  49 + imgs: [{
  50 + src: imghost + 'miniapp/images/luckDraw/pointer.png',
  51 + width: '188rpx',
  52 + height: '230rpx',
  53 + top: '-130rpx',
  54 + }],
  55 + }
  56 + ],
  57 + },
  58 +
  59 + onLoad(options) {
  60 + // console.log('imghost+++++', imghost);
  61 + self = this;
  62 + this.data.options = options;
  63 + // this.setData({
  64 + // options,
  65 + // imghost,
  66 + // });
  67 + // console.log('this data', this.data.imghost);
  68 + wx.setNavigationBarTitle({
  69 + title: options.title,
  70 + });
  71 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  72 + self.setData({
  73 + userInfo: data,
  74 + // imghost,
  75 + });
  76 + });
  77 + },
  78 +
  79 + onShow() {
  80 + if(app.globalData.userInfo) {
  81 + if(!this.data.isLogin) {
  82 +
  83 + this.setData({
  84 + userInfo: app.globalData.userInfo,
  85 + isLogin: true,
  86 + });
  87 +
  88 + // console.log('imghost', this.data.imghost);
  89 + let user_id = app.globalData.userInfo.user_id;
  90 + let store_id = app.globalData.setting.stoid;
  91 + let id = this.data.options.id;
  92 + let url = `/api/weshop/marketing/marketingLuckForm/getLuckInfo/${store_id}/${id}/${user_id}`;
  93 +
  94 +
  95 + app.request.get(url, {
  96 + success: function(res) {
  97 + if(res.data.code == 0) {
  98 + self.setData({
  99 + luckInfo: res.data.data,
  100 + });
  101 + WxParse.wxParse('content', 'html', self.data.luckInfo.remark, self);
  102 + } else {
  103 + wx.showToast({
  104 + title: res.data.msg,
  105 + icon: 'none',
  106 + });
  107 + self.data.msg = res.data.msg;
  108 + };
  109 +
  110 + // console.log('luckInfo', res.data.data);
  111 + let luckInfo = res.data.data;
  112 +
  113 +
  114 + if(luckInfo && luckInfo.template_type != null && luckInfo.template_type == 1) { //获取模板
  115 + let url = `/api/weshop/marketing/marketingLuckTemplate/get/${store_id}/${luckInfo.template_id}`;
  116 + app.request.get(url, {
  117 + success: function(res) {
  118 + // console.log('prizes//////', res.data.data);
  119 + self.setData({
  120 + template: res.data.data,
  121 + bannerUrl: imghost + (res.data.data.bannerUrl ? res.data.data.bannerUrl:'miniapp/images/luckDraw/bg.png'), //背景图
  122 + 'blocks[0].imgs[0].src': imghost + (res.data.data.wheelBaseUrl ? res.data.data.wheelBaseUrl:'miniapp/images/luckDraw/weel.png'), //转盘
  123 + 'buttons[0].imgs[0].src': imghost + (res.data.data.wheelPointerUrl ? res.data.data.wheelPointerUrl:'miniapp/images/luckDraw/pointer.png'), //指针
  124 + });
  125 + },
  126 + });
  127 + } else {
  128 + if(luckInfo && luckInfo.store_bannerUrl) {
  129 + self.setData({
  130 + bannerUrl: imghost + luckInfo.store_bannerUrl,
  131 + });
  132 + };
  133 +
  134 + };
  135 +
  136 +
  137 + if(self.data.luckInfo.msgInfo) {
  138 + wx.showToast({
  139 + title: self.data.luckInfo.msgInfo,
  140 + icon: 'none',
  141 + });
  142 + // return;
  143 + };
  144 +
  145 + },
  146 + });
  147 +
  148 + // 获取奖品展示的奖品
  149 + app.request.get('/api/weshop/marketing/marketingLuckList/page', {
  150 + data: {
  151 + store_id,
  152 + luck_formid: id,
  153 + },
  154 + success: function(res) {
  155 +
  156 + let award = res.data.data.pageData;
  157 + self.setData({
  158 + award,
  159 + });
  160 + console.log('award', award);
  161 + self.prizeLayout(award);
  162 +
  163 + },
  164 + });
  165 +
  166 +
  167 + //获取兑奖记录
  168 + app.request.get('/api/weshop/marketing/marketingLuckRecord/page', {
  169 + isShowLoading: false,
  170 + data: {
  171 + store_id: app.globalData.setting.stoid,
  172 + user_id: app.globalData.userInfo.user_id,
  173 + luck_formid: this.data.options.id,
  174 + luck_state: 1
  175 + },
  176 + success: function(res) {
  177 + if(res.data.code == 0) {
  178 + self.setData({
  179 + record: res.data.data.pageData,
  180 + });
  181 + };
  182 + },
  183 + });
  184 +
  185 +
  186 + //获取中奖人员名单
  187 + app.request.get('/api/weshop/marketing/marketingLuckRecord/page', {
  188 + isShowLoading: false,
  189 + data: {
  190 + store_id: app.globalData.setting.stoid,
  191 + luck_formid: this.data.options.id,
  192 + luck_state: 1,
  193 + pageSize: 20,
  194 + },
  195 + success: function(res) {
  196 + if(res.data.code == 0) {
  197 + self.setData({
  198 + nameList: res.data.data.pageData,
  199 + });
  200 + };
  201 + },
  202 + });
  203 +
  204 + };
  205 + };
  206 + },
  207 +
  208 + // 设置转盘奖品布局
  209 + prizeLayout(award) {
  210 + let prizes = [];
  211 + // let length = award.length;
  212 + if(award) {
  213 + var length = award.length;
  214 + } else {
  215 + wx.showToast({
  216 + title: '请设置奖品',
  217 + icon: 'none',
  218 + });
  219 + return;
  220 + };
  221 +
  222 + let thx = {fonts: [{ text: '谢谢\n参与', top: '18%', wordWrap:false, fontColor: 'rgba(255,255,255,.6)'}]};
  223 +
  224 + if(length == 1) {
  225 + [0,2,4,6].map(function(item, index) {
  226 + prizes[item] = {
  227 + id: award[0].id,
  228 + lbtype: award[0].lbtype,
  229 + fonts: [{ text: award[0].luck_goods_name + ' x' + award[0].num, top: '18%', wordWrap:false, fontColor: 'transparent'}],
  230 + imgs: [
  231 + {
  232 + src: self.prizeSrc(award[0].lbtype) ? self.prizeSrc(award[0].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'),
  233 + width: '135rpx',
  234 + height: '107rpx',
  235 + top: '12%',
  236 + }
  237 + ],
  238 + };
  239 + });
  240 +
  241 + [1,3,5,7].map(function(item, index) {
  242 + prizes[item] = thx;
  243 + });
  244 +
  245 + this.data.thxIndexArr = [1,3,5,7];
  246 + };
  247 +
  248 + if(length == 2) {
  249 + [0,4].map(function(item, index) {
  250 + prizes[item] = {
  251 + id: award[0].id,
  252 + lbtype: award[0].lbtype,
  253 + fonts: [{ text: award[0].luck_goods_name + ' x' + award[0].num, top: '18%', wordWrap:false, fontColor: 'transparent'}],
  254 + imgs: [
  255 + {
  256 + src: self.prizeSrc(award[0].lbtype) ? self.prizeSrc(award[0].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'),
  257 + width: '135rpx',
  258 + height: '107rpx',
  259 + top: '12%',
  260 + }
  261 + ],
  262 + };
  263 + });
  264 +
  265 + [2,6].map(function(item, index) {
  266 + prizes[item] = {
  267 + id: award[1].id,
  268 + lbtype: award[1].lbtype,
  269 + fonts: [{ text: award[1].luck_goods_name + ' x' + award[1].num, top: '18%', wordWrap:false, fontColor: 'transparent'}],
  270 + imgs: [
  271 + {
  272 + src: self.prizeSrc(award[1].lbtype) ? self.prizeSrc(award[1].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'),
  273 + width: '135rpx',
  274 + height: '107rpx',
  275 + top: '12%',
  276 + }
  277 + ],
  278 + };
  279 + });
  280 +
  281 + [1,3,5,7].map(function(item, index) {
  282 + prizes[item] = thx;
  283 + });
  284 + this.data.thxIndexArr = [1,3,5,7];
  285 + };
  286 +
  287 +
  288 + if(length == 3) {
  289 + [0,4].map(function(item, index) {
  290 + prizes[item] = {
  291 + id: award[0].id,
  292 + lbtype: award[0].lbtype,
  293 + fonts: [{ text: award[0].luck_goods_name + ' x' + award[0].num, top: '18%', wordWrap:false, fontColor: 'transparent'}],
  294 + imgs: [
  295 + {
  296 + src: self.prizeSrc(award[0].lbtype) ? self.prizeSrc(award[0].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'),
  297 + width: '135rpx',
  298 + height: '107rpx',
  299 + top: '12%',
  300 + }
  301 + ],
  302 + };
  303 + });
  304 +
  305 + [1,5].map(function(item, index) {
  306 + prizes[item] = {
  307 + id: award[1].id,
  308 + lbtype: award[1].lbtype,
  309 + fonts: [{ text: award[1].luck_goods_name + ' x' + award[1].num, top: '18%', wordWrap:false, fontColor: 'transparent'}],
  310 + imgs: [
  311 + {
  312 + src: self.prizeSrc(award[1].lbtype) ? self.prizeSrc(award[1].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'),
  313 + width: '135rpx',
  314 + height: '107rpx',
  315 + top: '12%',
  316 + }
  317 + ],
  318 + };
  319 + });
  320 +
  321 + [2,6].map(function(item, index) {
  322 + prizes[item] = {
  323 + id: award[2].id,
  324 + lbtype: award[2].lbtype,
  325 + fonts: [{ text: award[2].luck_goods_name + ' x' + award[2].num, top: '18%', wordWrap:false, fontColor: 'transparent'}],
  326 + imgs: [
  327 + {
  328 + src: self.prizeSrc(award[2].lbtype) ? self.prizeSrc(award[2].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'),
  329 + width: '135rpx',
  330 + height: '107rpx',
  331 + top: '12%',
  332 + }
  333 + ],
  334 + };
  335 + });
  336 +
  337 + [3,7].map(function(item, index) {
  338 + prizes[item] = thx;
  339 + });
  340 +
  341 + this.data.thxIndexArr = [3,7];
  342 + };
  343 +
  344 +
  345 + if(length == 4) {
  346 + [0,2,4,6].map(function(item, index) {
  347 + prizes[item] = {
  348 + id: award[index].id,
  349 + lbtype: award[index].lbtype,
  350 + fonts: [{ text: award[index].luck_goods_name + ' x' + award[index].num, top: '18%', wordWrap:false, fontColor: 'transparent'}],
  351 + imgs: [
  352 + {
  353 + src: self.prizeSrc(award[index].lbtype) ? self.prizeSrc(award[index].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'),
  354 + width: '135rpx',
  355 + height: '107rpx',
  356 + top: '12%',
  357 + }
  358 + ],
  359 + };
  360 + });
  361 +
  362 + [1,3,5,7].map(function(item, index) {
  363 + prizes[item] = thx;
  364 + });
  365 +
  366 + this.data.thxIndexArr = [1,3,5,7];
  367 + };
  368 +
  369 + if(length == 5) {
  370 + [0,2,3,5,6].map(function(item, index) {
  371 + prizes[item] = {
  372 + id: award[index].id,
  373 + lbtype: award[index].lbtype,
  374 + fonts: [{ text: award[index].luck_goods_name + ' x' + award[index].num, top: '18%', wordWrap:false, fontColor: 'transparent'}],
  375 + imgs: [
  376 + {
  377 + src: self.prizeSrc(award[index].lbtype) ? self.prizeSrc(award[index].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'),
  378 + width: '135rpx',
  379 + height: '107rpx',
  380 + top: '12%',
  381 + }
  382 + ],
  383 + };
  384 + });
  385 +
  386 + [1,4,7].map(function(item, index) {
  387 + prizes[item] = thx;
  388 + });
  389 +
  390 + this.data.thxIndexArr = [1,4,7];
  391 + };
  392 +
  393 + if(length == 6) {
  394 + prizes = award.map(function(item, index) {
  395 + return {
  396 + id: item.id,
  397 + lbtype: item.lbtype,
  398 + fonts: [{ text: item.luck_goods_name + ' x' + item.num, top: '18%', wordWrap:false, fontColor: 'transparent'}],
  399 + imgs: [
  400 + {
  401 + src: self.prizeSrc(item.lbtype) ? self.prizeSrc(item.lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'),
  402 + width: '135rpx',
  403 + height: '107rpx',
  404 + top: '12%',
  405 + }
  406 + ],
  407 + };
  408 + });
  409 +
  410 + prizes.push(thx);
  411 + prizes.splice(3, 0, thx);
  412 +
  413 + this.data.thxIndexArr = [3,7];
  414 + };
  415 +
  416 + // console.log('prizes', prizes);
  417 +
  418 + this.setData({
  419 + prizes,
  420 + });
  421 + },
  422 +
  423 + // 根据lbtype指定奖品类别图标
  424 + prizeSrc(lbtype) {
  425 + let src = '';
  426 + // let imghost = this.data.imghost;
  427 + switch(lbtype) {
  428 + case 1: { //积分
  429 + src = imghost + 'miniapp/images/luckDraw/jf.png';
  430 + break;
  431 + };
  432 + case 2: { //成长值
  433 + src = imghost + 'miniapp/images/luckDraw/czz.png';
  434 + break;
  435 + };
  436 + case 3: { //优惠券
  437 + src = imghost + 'miniapp/images/luckDraw/yhq.png';
  438 + break;
  439 + };
  440 + case 4: { //服务项目
  441 + src = imghost + 'miniapp/images/luckDraw/fw.png';
  442 + break;
  443 + };
  444 + case 5: { //赠品
  445 + src = imghost + 'miniapp/images/luckDraw/zp.png';
  446 + break;
  447 + };
  448 + case 6: { //礼包
  449 + src = imghost + 'miniapp/images/luckDraw/lb.png';
  450 + break;
  451 + };
  452 + };
  453 + return src;
  454 + },
  455 +
  456 + // 获取抽奖结果匹配对应奖品在奖品列表里的所有索引号
  457 + luckyIndex(arr, target) {
  458 + var results=[],
  459 + len = arr.length,
  460 + pos = 0;
  461 + while(pos < len){
  462 + // pos = arr[pos].indexOf(target, pos);
  463 + if(arr[pos].id == target) {
  464 + results.push(pos);//找到就存储索引
  465 +
  466 + };
  467 + pos += 1;//并从下个位置开始搜索
  468 + // if(pos === -1){//未找到就退出循环完成搜索
  469 + // break;
  470 + // };
  471 +
  472 + }
  473 + // console.log('当前奖品列表', this.data.prizes);
  474 + // console.log('中奖结果在当前奖品列表中的索引', results);
  475 +
  476 + return results;
  477 + },
  478 +
  479 + start () {
  480 + if(!this.data.luckInfo) {
  481 + wx.showToast({
  482 + title: this.data.msg,
  483 + icon: 'none',
  484 + });
  485 + return;
  486 + };
  487 +
  488 + if(self.data.luckInfo.msgInfo) {
  489 + wx.showToast({
  490 + title: self.data.luckInfo.msgInfo,
  491 + icon: 'none',
  492 + });
  493 + return;
  494 + };
  495 +
  496 +
  497 + if(this.data.luckInfo.user_LuckNumDay > 0 || this.data.luckInfo.vip_act_num == 0) {
  498 + // console.log('start choujiang');
  499 + // let start = false;
  500 + if(!this.data.start) {
  501 + this.data.start = true;
  502 + // 获取抽奖组件实例
  503 + const $lucky = this.selectComponent('#myLucky');
  504 + // 调用play方法开始旋转
  505 + $lucky.play();
  506 +
  507 + // 获取抽奖结果
  508 + app.request.post('/api/weshop/marketing/marketingLuckForm/startLuck', {
  509 + isShowLoading: false,
  510 + data: {
  511 + storeId: app.globalData.setting.stoid,
  512 + userId: app.globalData.userInfo.user_id,
  513 + LuckId: this.data.options.id,
  514 + },
  515 + success: function(res) {
  516 +
  517 + if(res.data.code == 0) {
  518 + console.log('开始摇奖', res.data.data);
  519 + if(self.data.luckInfo.vip_act_num != 0) {
  520 + self.setData({
  521 + 'luckInfo.user_LuckNumDay': self.data.luckInfo.user_LuckNumDay - 1,
  522 + // isActive: true,
  523 + });
  524 + };
  525 +
  526 + self.setData({
  527 + // 'luckInfo.user_LuckNumDay': self.data.luckInfo.user_LuckNumDay - 1,
  528 + isActive: true,
  529 + });
  530 + // console.log('请求成功', res.data.data);
  531 + let luckyId = res.data.data.id;
  532 + let indexArr = self.luckyIndex(self.data.prizes, luckyId);
  533 + // console.log('抽奖奖品id', luckyId);
  534 + // console.log('奖品列表', self.data.prizes);
  535 + // console.log('奖品对应的索引数组', indexArr);
  536 + let random = Math.random() * indexArr.length >> 0;
  537 + // console.log('random', random);
  538 + let index = indexArr[random];
  539 + setTimeout(() => {
  540 + $lucky.stop(index);
  541 + self.data.start = false;
  542 + }, 3000);
  543 +
  544 +
  545 + //获取兑奖记录
  546 + // app.request.get('/api/weshop/marketing/marketingLuckRecord/page', {
  547 + // isShowLoading: false,
  548 + // data: {
  549 + // store_id: app.globalData.setting.stoid,
  550 + // user_id: app.globalData.userInfo.user_id,
  551 + // luck_formid: self.data.options.id,
  552 + // luck_state: 1
  553 + // },
  554 + // success: function(res) {
  555 + // if(res.data.code == 0) {
  556 + // // console.log('res===>', res.data.data.pageData);
  557 + // self.setData({
  558 + // record: res.data.data.pageData,
  559 + // });
  560 + // };
  561 + // },
  562 + // });
  563 +
  564 +
  565 + } else {
  566 + // console.log('请求出错');
  567 + if(self.data.luckInfo.vip_act_num != 0) {
  568 + self.setData({
  569 + 'luckInfo.user_LuckNumDay': self.data.luckInfo.user_LuckNumDay - 1,
  570 + });
  571 + };
  572 +
  573 + let thxIndexArr = self.data.thxIndexArr;
  574 + const random = Math.random() * thxIndexArr.length >> 0;
  575 + const index = thxIndexArr[random];
  576 + // console.log('谢谢参与数组', thxIndexArr);
  577 + // console.log('请求出错产生谢谢参与的随机数', index);
  578 + setTimeout(() => {
  579 + $lucky.stop(index);
  580 + self.data.start = false;
  581 + }, 3000);
  582 + };
  583 + },
  584 +
  585 + fail: function(res) {
  586 + // console.log('出错');
  587 + wx.showToast({
  588 + title: '数据请求失败',
  589 + icon: 'error',
  590 + });
  591 + let thxIndexArr = self.data.thxIndexArr;
  592 + const random = Math.random() * thxIndexArr.length >> 0;
  593 + const index = thxIndexArr[random];
  594 + setTimeout(() => {
  595 + $lucky.stop(index);
  596 + self.data.start = false;
  597 + }, 3000);
  598 + },
  599 +
  600 + });
  601 +
  602 + }
  603 +
  604 +
  605 + } else {
  606 + wx.showToast({
  607 + title: '你今天的抽奖次数已用完啦!~',
  608 + icon: 'none',
  609 + });
  610 + };
  611 +
  612 + },
  613 + end (event) {
  614 + // 中奖奖品详情
  615 + // console.log('zjiangla~~',event.detail.lbtype);
  616 + let no_luck_urltype = this.data.luckInfo.no_luck_urltype;
  617 + let lbtype;
  618 + let resultTitle = event.detail.fonts[0].text.replace('\n','');
  619 + if(event.detail.lbtype == 5) {
  620 + lbtype = 5;
  621 + } else {
  622 + lbtype = -1;
  623 + };
  624 + this.setData({
  625 + num: 3,
  626 + hiddenCanvas: true,
  627 + showResult: true,
  628 + showMask: true,
  629 + resultTitle,
  630 + currentLbtype: lbtype,
  631 + });
  632 +
  633 +
  634 +
  635 +
  636 + if(no_luck_urltype == 1) {
  637 + if(this.data.luckInfo.no_luck_weappurl) {
  638 + let num = this.data.num;
  639 + let url = this.data.luckInfo.no_luck_weappurl;
  640 + self.timer = setInterval(function() {
  641 + if(num == 0) {
  642 + clearInterval(self.timer);
  643 + app.goto(url);
  644 + } else {
  645 + self.setData({
  646 + num: --num,
  647 + });
  648 + }
  649 + }, 1000);
  650 +
  651 + };
  652 + };
  653 +
  654 + },
  655 +
  656 + showPopup() {
  657 + this.setData({
  658 + list: null,
  659 + pageNum: 1,
  660 + noMore: false,
  661 + });
  662 + this.getData(true, '/api/weshop/marketing/marketingLuckRecord/page', {
  663 + store_id: app.globalData.setting.stoid,
  664 + user_id: app.globalData.userInfo.user_id,
  665 + luck_formid: this.data.options.id,
  666 + luck_state: 1,
  667 + }).then(function(res) {
  668 + self.setData({
  669 + showPopup: true,
  670 + showMask: true,
  671 + hiddenCanvas: true,
  672 + });
  673 + });
  674 +
  675 + // this.setData({
  676 + // showPopup: true,
  677 + // showMask: true,
  678 + // hiddenCanvas: true,
  679 + // 'list.pageData': this.data.record,
  680 + // // record: self.data.list.pageData,
  681 + // });
  682 +
  683 +
  684 + },
  685 +
  686 + closePopup() {
  687 + this.setData({
  688 + showPopup: false,
  689 + showMask: false,
  690 + hiddenCanvas: false,
  691 + });
  692 + },
  693 +
  694 + /**
  695 + * 关闭中奖结果
  696 + */
  697 + closeResult() {
  698 + clearInterval(this.timer);
  699 + this.setData({
  700 + num: 3,
  701 + showResult: false,
  702 + showMask: false,
  703 + hiddenCanvas: false,
  704 + });
  705 + },
  706 +
  707 + loadmore() {
  708 + this.scrollToLower('/api/weshop/marketing/marketingLuckRecord/page', {
  709 + store_id: app.globalData.setting.stoid,
  710 + user_id: app.globalData.userInfo.user_id,
  711 + luck_formid: this.data.options.id,
  712 + luck_state: 1,
  713 + });
  714 + },
  715 +
  716 +
  717 + /**
  718 + * 请求数据
  719 + */
  720 + getData: function(isInit, url, data) {
  721 + let p = app.request.promiseGet(url, {
  722 + data: data,
  723 + isShowLoading: true,
  724 + })
  725 + .then(function(res) {
  726 + if(res.data.code == 0) {
  727 +
  728 + self.setData({
  729 + isLoading: false
  730 + });
  731 +
  732 + if(isInit) {// 第一次加载
  733 + self.setData({
  734 + list: res.data.data
  735 + });
  736 + } else {
  737 + self.setData({
  738 + 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData)
  739 + });
  740 + };
  741 +
  742 + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) {
  743 + self.setData({
  744 + noMore: true
  745 + });
  746 + };
  747 +
  748 + } else {
  749 + self.setData({
  750 + 'list.pageData': []
  751 + });
  752 + };
  753 +
  754 + });
  755 +
  756 + return p;
  757 + },
  758 +
  759 +
  760 + /**
  761 + * 上拉加载
  762 + */
  763 + scrollToLower(url, requestData) {
  764 + // 数据总量
  765 + let total = this.data.list.total;
  766 + // 单页最大数据量
  767 + let pageSize = this.data.list.pageSize;
  768 + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’
  769 + if((total != 0)&&(total <= pageSize)) {
  770 + this.setData({
  771 + noMore: true
  772 + });
  773 + };
  774 +
  775 + if(!this.data.isLoading && !this.data.noMore) {
  776 + this.setData({
  777 + isLoading: true,
  778 + pageNum: this.data.pageNum + 1
  779 + });
  780 + requestData.page = this.data.pageNum;
  781 + this.getData(false, url, requestData);
  782 + };
  783 + },
  784 +
  785 +
  786 + goto(e) {
  787 + let url = '';
  788 + let type = e.currentTarget.dataset.type;
  789 + switch(type) {
  790 + case 1: {
  791 + url = '/pages/user/integral/integral';
  792 + break;
  793 + };
  794 + case 2: {
  795 + url = '/pages/user/grow_value/grow_value';
  796 + break;
  797 + };
  798 + case 3: {
  799 + url = '/pages/user/coupons/coupons';
  800 + break;
  801 + };
  802 + case 4: {
  803 + url = '/pages/user/my_service/i_service';
  804 + break;
  805 + };
  806 + case 6: {
  807 + url = '/packageA/pages/myGift/myGift';
  808 + break;
  809 + };
  810 + };
  811 + app.goto(url);
  812 + },
  813 +
  814 + showQr(e) {
  815 + let store_id = app.globalData.setting.stoid;
  816 + let id = e.currentTarget.dataset.id;
  817 + let url = `/api/weshop/marketing/marketingLuckList/updateGoodsVerifyCode/${store_id}/${id}`;
  818 + app.request.put(url, {
  819 + success: function(res) {
  820 + if(res.data.code == 0) {
  821 + let data = res.data.data;
  822 + console.log('data!!!!', data);
  823 + let barcode = self.selectComponent("#qrcode");
  824 + barcode.open({val: data});
  825 + self.setData({
  826 + hiddenCanvas: true,
  827 + showPopup: false,
  828 + });
  829 + };
  830 + },
  831 +
  832 + });
  833 + },
  834 +
  835 + closeQr() {
  836 + this.setData({
  837 + hiddenCanvas: false,
  838 + showMask: false,
  839 + });
  840 + },
  841 +
  842 + clickReceive() {
  843 + this.setData({
  844 + showResult: false,
  845 + });
  846 + this.showPopup();
  847 + },
  848 +})
0 849 \ No newline at end of file
... ...
packageB/pages/luckactivity/luckinfo/luckinfo.json 0 → 100644
  1 +{
  2 + "usingComponents": {
  3 + "lucky-wheel":"/packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index",
  4 + "qrcode": "/components/my-qrcode/my-qrcode",
  5 + "nodata": "/components/nodata/nodata"
  6 + },
  7 + "enablePullDownRefresh": false,
  8 + "navigationBarTitleText": "幸运大转盘"
  9 +}
0 10 \ No newline at end of file
... ...
packageB/pages/luckactivity/luckinfo/luckinfo.wxml 0 → 100644
  1 +<wxs module="filter" src="../../../../utils/filter.wxs"></wxs>
  2 +<wxs module="tool" src="./tool.wxs"></wxs>
  3 +<view class="luck-container" style="background: {{template.colorCode ? template.colorCode:'#8102FD'}} url({{bannerUrl ? bannerUrl:(imghost + 'miniapp/images/luckDraw/bg.png')}}) no-repeat;">
  4 +<!-- <view class="luck-container" style="background: url({{ bannerUrl}}) no-repeat;"> -->
  5 + <!-- 中奖人员 -->
  6 + <view class="swiper-container" wx:if="{{nameList && nameList.length != 0}}">
  7 + <swiper class="swiper" autoplay="true" circular="true" vertical="true" interval="3000">
  8 + <swiper-item class="swiper-item" wx:for="{{nameList}}">
  9 + <view class="item">
  10 + <view class="avatar-container">
  11 + <image src="{{item.head_pic}}" class="img-block"></image>
  12 + </view>
  13 + <view class="flex ai_c pdr10">
  14 + <view class="nickname ellipsis-1x">{{item.nickname}}</view>
  15 + <view style="flex-shrink: 0;">获得了"{{item.luck_goods_name}}"</view>
  16 + </view>
  17 + </view>
  18 + </swiper-item>
  19 + </swiper>
  20 + </view>
  21 + <!-- 大转盘 -->
  22 + <view class="weel-container">
  23 + <view>
  24 + <lucky-wheel
  25 + class="myLucky"
  26 + id="myLucky"
  27 + width="700rpx"
  28 + height="700rpx"
  29 + blocks="{{blocks}}"
  30 + prizes="{{prizes}}"
  31 + buttons="{{buttons}}"
  32 + defaultConfig="{{defaultConfig}}"
  33 + defaultStyle="{{defaultStyle}}"
  34 + bindstart="start"
  35 + bindend="end"
  36 + hiddenCanvas="{{hiddenCanvas}}"
  37 + />
  38 + </view>
  39 + <view class="fs28 white t-c pdt10" wx:if="{{luckInfo.vip_act_num == 0}}">今天你有 <text class="fs50 c-yellow">不限次</text> 抽奖机会</view>
  40 + <view class="fs28 white t-c pdt10" wx:else>今天你还有 <text class="fs50 c-yellow">{{filter.show_default(luckInfo.user_LuckNumDay, '0')}}</text> 次抽奖机会</view>
  41 + <view class="tip-to-down expand-transition">
  42 + <text></text>
  43 + <text></text>
  44 + </view>
  45 + </view>
  46 + <!-- 奖品展示 -->
  47 + <view wx:if="{{award}}">
  48 + <view class="badge-container"><image src="{{imghost + 'miniapp/images/luckDraw/badge.png'}}" class="badge prizes" lazy-load></image></view>
  49 + <view class="list br12 bg-white">
  50 + <view class="list-item" wx:for="{{award}}">
  51 + <view class="img-container">
  52 + <image wx:if="{{item.luck_goods_img}}" src="{{imghost + item.luck_goods_img}}" class="img" mode="aspectFit"></image>
  53 + <image src="{{imghost + tool.showDefaultImg(item.lbtype)}}" class="img" mode="aspectFit" wx:else></image>
  54 + </view>
  55 + <view class="item-r">
  56 + <view class="fs28">{{item.luck_goods_name}}</view>
  57 + <view class="flex jc_sb fs26 c9">
  58 + <view>价值:<text class="rmb">{{item.luck_goods_price}}</text></view>
  59 + <view>数量:{{item.num}}</view>
  60 + </view>
  61 + </view>
  62 + </view>
  63 + </view>
  64 + </view>
  65 + <!-- 活动展示 -->
  66 + <view wx:if="{{luckInfo.remark}}">
  67 + <view class="badge-container"><image src="{{imghost + 'miniapp/images/luckDraw/badge.png'}}" class="badge activity" lazy-load></image></view>
  68 + <view class="bg-white br12 pd20 fs28">
  69 + <!-- {{luckInfo.remark}} -->
  70 + <import src="../../../../utils/wxParse/wxParse.wxml"/>
  71 + <template is="wxParse" data="{{wxParseData:content.nodes}}"/>
  72 + <!-- 时间 -->
  73 + <!-- <view class="bdb">
  74 + <view class="">
  75 + <view class="txt-red">活动时间:</view>
  76 + <view class="fs28 pdv20">187606546456</view>
  77 + </view>
  78 + <view>
  79 + <view class="txt-red">兑换时间:</view>
  80 + <view class="fs28 pdv20">-</view>
  81 + </view>
  82 + </view> -->
  83 + <!-- 规则 -->
  84 + <!-- <view class="bdb">
  85 + <view class="txt-red pdt20">活动规则:</view>
  86 + <view class="fs28 pdv20">-</view>
  87 + </view> -->
  88 + <!-- 电话 -->
  89 + <!-- <view class="bdb">
  90 + <view class="txt-red pdt20">联系电话:</view>
  91 + <view class="fs28 pdv20">-</view>
  92 + </view> -->
  93 + <!-- 地址 -->
  94 + <!-- <view>
  95 + <view class="txt-red pdv20">门店兑换地址:</view>
  96 + <view class="pdv20">
  97 + <view class="fs28">化妆门店2(芊婕化妆品)</view>
  98 + <view class="pdt10 fs24">福建泉州市田安北路明鑫花苑110号</view>
  99 + <view class="tel pdt10">
  100 + <text class="iconfont icon-tel"></text>
  101 + <text class="text-underline">1380000000</text>
  102 + </view>
  103 + </view>
  104 + <view class="pdv20">
  105 + <view class="fs28">化妆门店2(芊婕化妆品)</view>
  106 + <view class="pdt10 fs24">福建泉州市田安北路明鑫花苑110号</view>
  107 + <view class="tel pdt10">
  108 + <text class="iconfont icon-tel"></text>
  109 + <text class="text-underline">1380000000</text>
  110 + </view>
  111 + </view>
  112 + </view> -->
  113 + </view>
  114 + </view>
  115 + <!-- 二维码 -->
  116 + <!-- <view class="qrcode-container">
  117 + <image src="../../../images/luckDraw/badge.png" class="qrcode"></image>
  118 + <view class="pdt20 fs24 c-7b">
  119 + <view>长按二维码关注我们订阅更多优惠</view>
  120 + <view>信息更多优惠等你来拿哦</view>
  121 + </view>
  122 + </view> -->
  123 + <!-- 技术支持 -->
  124 + <view class="t-c">
  125 + <!-- <view class="pdt20 fs26 text-underline">帮美店免费开通这个玩法</view> -->
  126 + <view class="flex ai_c fs24 jc-center pdv20 white"><image src="{{imghost + 'miniapp/images/luckDraw/logo.png'}}" class="logo" lazy-load></image>提供技术支持</view>
  127 + </view>
  128 +</view>
  129 +
  130 +<!-- 悬浮按钮 -->
  131 +<view class="gift-container {{((record && record.length != 0) || isActive) ? 'active':''}}" bindtap="showPopup"><text class="iconfont icon-liwu"></text></view>
  132 +
  133 +<!-- 弹窗 -->
  134 +<view class="popup-container" wx:if="{{showPopup}}">
  135 + <scroll-view class="popup-list" scroll-y bindscrolltolower="loadmore">
  136 + <view class="popup-item" wx:for="{{list.pageData}}">
  137 + <view class="img-container">
  138 + <image wx:if="{{item.luck_goods_img}}" src="{{imghost + item.luck_goods_img}}" class="img" mode="aspectFit"></image>
  139 + <image wx:else src="{{imghost + tool.showDefaultImg(item.luck_type)}}" class="img" mode="aspectFit"></image>
  140 + </view>
  141 + <view class="flex fdc f1">
  142 + <view class="ellipsis-2 fs28">{{item.luck_name}}</view>
  143 + <view class="pdt20">
  144 + <view class="fs26 xc-black3">价值:<text class="rmb">{{item.luck_goods_price}}</text></view>
  145 + <view class="flex ai_c jc_fe fs26 xc-black3 ">
  146 + <!-- <view style="visibility: {{item.luck_type == 5 ? 'visible':'hidden'}};">兑换状态:{{item.state == 0 ? '未兑换':'已兑换'}}</view> -->
  147 + <!-- <view style="">兑换状态:{{item.state == 0 ? '未兑换':'已兑换'}}</view> -->
  148 + <view class="btn" bindtap="{{item.luck_type == 5 ? (item.state == 0 ? 'showQr':''):'goto'}}" data-type="{{item.luck_type}}" data-id="{{item.id}}">{{item.luck_type == 5 ? (item.state == 1 ? '已兑换':'兑换'):'查看'}}</view>
  149 + </view>
  150 + </view>
  151 + </view>
  152 + </view>
  153 + <nodata nodataContainer="t-c" wx:if="{{list.pageData.length == 0}}"></nodata>
  154 + <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">—— 已经到底了 ——</view>
  155 + </scroll-view>
  156 + <view class="close-container" bindtap="closePopup"><text class="iconfont icon-close"></text></view>
  157 +</view>
  158 +
  159 +
  160 +<view class="popup-container2" wx:if="{{showResult}}">
  161 + <view class="t-r"><text class="iconfont icon-close white" bindtap="closeResult"></text></view>
  162 + <view class="popup">
  163 + <view class="t-c">
  164 + <block wx:if="{{resultTitle == '谢谢参与'}}">
  165 + <view class="bold c-tb fs40">{{luckInfo.no_luck_name}}</view>
  166 + <view class="pdt10">{{luckInfo.no_luck_remark}}</view>
  167 + <view class="img-container2"><image src="{{imghost + (luckInfo.no_luck_img ? luckInfo.no_luck_img:'miniapp/images/luckDraw/gift.png')}}" class="img" mode="aspectFit"></image></view>
  168 + <view class="pdt40 fs26 c9" wx:if="{{luckInfo.no_luck_urltype == 1 && luckInfo.no_luck_weappurl}}">{{num}}s后自动跳转...</view>
  169 + </block>
  170 + <block wx:else>
  171 + <view class="bold c-tb fs40">恭喜你获得</view>
  172 + <view class="pdt10">{{resultTitle}} </view>
  173 + <view class="img-container2"><image src="{{imghost + 'miniapp/images/luckDraw/gift.png'}}" class="img" mode="aspectFit"></image></view>
  174 + </block>
  175 + </view>
  176 +
  177 + <view class="pdt40" wx:if="{{currentLbtype == 5}}">
  178 + <view class="btn btn2" bindtap="clickReceive">立即领取</view>
  179 + </view>
  180 + <!-- <view class="note">注:未领取就关闭弹窗视为主动放弃奖品。</view> -->
  181 + </view>
  182 +</view>
  183 +
  184 +
  185 +<!-- 遮罩层 -->
  186 +<view class="mask" wx:if="{{showMask}}"></view>
  187 +
  188 +<qrcode id="qrcode" bind:close="closeQr"></qrcode>
0 189 \ No newline at end of file
... ...
packageB/pages/luckactivity/luckinfo/luckinfo.wxss 0 → 100644
  1 +/* packageB//pages/luckactivity/index/index.wxss */
  2 +
  3 +page {
  4 + /* background-color: rgb(129, 2, 253); */
  5 +}
  6 +
  7 +page,
  8 +.luck-container {
  9 + /* height: 100%; */
  10 +}
  11 +
  12 +
  13 +
  14 +.luck-container {
  15 + background-size: 100% auto !important;
  16 + padding: 50% 20rpx 0;
  17 +}
  18 +
  19 +.weel-container {
  20 + padding-bottom: 80rpx;
  21 +}
  22 +
  23 +.badge {
  24 + display: block;
  25 + width: 362rpx;
  26 + height: 57rpx;
  27 + margin: 30rpx auto;
  28 + position: relative;
  29 + font-size: 26rpx;
  30 + color: white;
  31 +}
  32 +
  33 +.badge::before {
  34 + position: absolute;
  35 + top: 50%;
  36 + left: 50%;
  37 + transform: translate(-50%, -50%);
  38 +}
  39 +
  40 +.badge.prizes::before {
  41 + content: '奖品展示';
  42 +}
  43 +
  44 +.badge.activity::before {
  45 + content: '活动展示';
  46 +}
  47 +
  48 +.prize-container {
  49 + width: 62rpx;
  50 + height: 64rpx;
  51 + border: 2rpx solid #eeedf0;
  52 +}
  53 +
  54 +.list {
  55 + /* padding: 0 20rpx; */
  56 +}
  57 +
  58 +.list-item {
  59 + display: flex;
  60 + padding: 20rpx;
  61 +}
  62 +
  63 +.list-item ~ .list-item {
  64 + border-top: 2rpx solid #ebedf0;
  65 +}
  66 +
  67 +.img-container {
  68 + width: 140rpx;
  69 + height: 140rpx;
  70 + margin-right: 20rpx;
  71 + background-color: #f5f5f5;
  72 +}
  73 +
  74 +.img {
  75 + display: block;
  76 + width: 100%;
  77 + height: 100%;
  78 +}
  79 +
  80 +.item-r {
  81 + display: flex;
  82 + flex-direction: column;
  83 + justify-content: space-between;
  84 + flex: 1;
  85 +}
  86 +
  87 +.tel {
  88 + display: flex;
  89 + align-items: center;
  90 + color: #00a0e0;
  91 + font-size: 28rpx;
  92 +}
  93 +.icon-tel {
  94 + font-size: 28rpx;
  95 + margin-right: 6rpx;
  96 +}
  97 +
  98 +.qrcode-container {
  99 + background-color: white;
  100 + border-radius: 12rpx;
  101 + margin-top: 40rpx;
  102 + padding: 20rpx;
  103 + text-align: center;
  104 + /* display: block;
  105 + width: 100%;
  106 + height: 100%; */
  107 +}
  108 +
  109 +.qrcode {
  110 + width: 200rpx;
  111 + height: 200rpx;
  112 + background-color: gray;
  113 +}
  114 +
  115 +.logo {
  116 + width: 120rpx;
  117 + height: 40rpx;
  118 + margin-right: 10rpx;
  119 +}
  120 +
  121 +.gift-container {
  122 + background-color: rgba(44, 44, 44, 0.2);
  123 + width: 100rpx;
  124 + height: 100rpx;
  125 + border-radius: 50%;
  126 + color: white;
  127 + position: fixed;
  128 + right: 20rpx;
  129 + bottom: 20rpx;
  130 + display: flex;
  131 + justify-content: center;
  132 + align-items: center;
  133 + z-index: 1;
  134 +}
  135 +
  136 +.gift-container.active::after {
  137 + content: '';
  138 + position: absolute;
  139 + width: 14rpx;
  140 + height: 14rpx;
  141 + background-color: #f74c31;
  142 + border: 2rpx solid #fff;
  143 + border-radius: 50%;
  144 + top: 6rpx;
  145 + right: 10rpx;
  146 +}
  147 +
  148 +.icon-liwu {
  149 + font-size: 40rpx;
  150 +}
  151 +
  152 +
  153 +
  154 +
  155 +.tip-to-down {
  156 + position: relative;
  157 + /* display: block;
  158 + text-align: center;
  159 + margin: auto;
  160 + margin-top: .4rem;
  161 + width: 6rem;
  162 + z-index: 2;
  163 + -webkit-transform: translate(0, -50%); */
  164 + transform: translate(0, -50%);
  165 + /* color: #fff;
  166 + font: normal 400 20px/1 'Josefin Sans', sans-serif;
  167 + letter-spacing: .1em;
  168 + text-decoration: none;
  169 + -webkit-transition: opacity .3s; */
  170 + transition: opacity .3s;
  171 +}
  172 +.tip-to-down text {
  173 + position: absolute;
  174 + top: 0;
  175 + left: 50%;
  176 + width: 1rem;
  177 + height: 1rem;
  178 + margin-left: -12px;
  179 + border-left: 1px solid #fff;
  180 + border-bottom: 1px solid #fff;
  181 + -webkit-transform: rotate(-45deg);
  182 + transform: rotate(-45deg);
  183 + -webkit-animation: sdb07 2s infinite;
  184 + animation: sdb07 2s infinite;
  185 + opacity: 0;
  186 + box-sizing: border-box;
  187 +}
  188 +.tip-to-down text:nth-of-type(1) {
  189 + -webkit-animation-delay: 0s;
  190 + animation-delay: 0s;
  191 +}
  192 +.tip-to-down text:nth-of-type(2) {
  193 + top: 16px;
  194 + -webkit-animation-delay: .15s;
  195 + animation-delay: .15s;
  196 +}
  197 +
  198 +@-webkit-keyframes sdb07 {
  199 + 0% {
  200 + opacity: 0;
  201 + }
  202 + 50% {
  203 + opacity: 1;
  204 + }
  205 + 100% {
  206 + opacity: 0;
  207 + }
  208 +}
  209 +@keyframes sdb07 {
  210 + 0% {
  211 + opacity: 0;
  212 + }
  213 + 50% {
  214 + opacity: 1;
  215 + }
  216 + 100% {
  217 + opacity: 0;
  218 + }
  219 +}
  220 +
  221 +
  222 +.popup-container {
  223 + position: fixed;
  224 + width: 100%;
  225 + bottom: 0;
  226 + background-color: white;
  227 + z-index: 1;
  228 + padding: 0 20rpx;
  229 + box-sizing: border-box;
  230 + z-index: 998;
  231 +}
  232 +
  233 +.popup-container .img-container {
  234 + width: 140rpx;
  235 + height: 140rpx;
  236 + flex-shrink: 0;
  237 +}
  238 +
  239 +.popup-list {
  240 + max-height: 79vh;
  241 + overflow: auto;
  242 +}
  243 +
  244 +.popup-item {
  245 + padding: 20rpx 0;
  246 + display: flex;
  247 + align-items: center;
  248 + /* flex: 1; */
  249 +}
  250 +
  251 +.popup-item ~ .popup-item {
  252 + border-top: 2rpx solid #ebedf0;
  253 +}
  254 +
  255 +.rmb::before {
  256 + content: '¥';
  257 + font-size: 24rpx;
  258 +}
  259 +
  260 +.btn {
  261 + color: #ff2d4b;
  262 + border: 2rpx solid #ff2d4b;
  263 + border-radius: 8rpx;
  264 + padding: 6rpx 20rpx;
  265 +}
  266 +
  267 +.btn2 {
  268 + font-size: 26rpx;
  269 + color: white;
  270 + background-color: #ff2d4b;
  271 + padding: 20rpx 40rpx;
  272 + text-align: center;
  273 +}
  274 +
  275 +.close-container {
  276 + color: white;
  277 + position: absolute;
  278 + right: 20rpx;
  279 + top: -80rpx;
  280 +}
  281 +.icon-close {
  282 + font-size: 40rpx;
  283 +}
  284 +
  285 +.close-container::after {
  286 + content: '';
  287 + position: absolute;
  288 + width: 2rpx;
  289 + height: 40rpx;
  290 + background-color: white;
  291 + left: 50%;
  292 + top: 42rpx;
  293 + transform: translateX(-50%);
  294 +}
  295 +
  296 +
  297 +
  298 +
  299 +
  300 +
  301 +
  302 +.br12 {
  303 + border-radius: 12rpx;
  304 +}
  305 +
  306 +.text-underline {
  307 + text-decoration:underline;
  308 +}
  309 +
  310 +.txt-red {
  311 + color: #ff2d4b;
  312 +}
  313 +
  314 +.bdb {
  315 + border-bottom: 2rpx solid #ebedf0;
  316 +}
  317 +
  318 +.c-yellow {
  319 + color: yellow;
  320 +}
  321 +
  322 +
  323 +
  324 +
  325 +.mask {
  326 + position: fixed;
  327 + width: 100%;
  328 + height: 100%;
  329 + top: 0;
  330 + background-color: rgba(0,0,0,.5);
  331 + z-index: 1;
  332 +}
  333 +
  334 +
  335 +.popup-container2 {
  336 + position: fixed;
  337 + top: 50%;
  338 + left: 50%;
  339 + transform: translate(-50%, -50%);
  340 + z-index: 999;
  341 + width: 85%;
  342 +}
  343 +
  344 +.popup {
  345 + background-color: white;
  346 + border-radius: 12rpx;
  347 + padding: 60rpx;
  348 + margin-top: 20rpx;
  349 +}
  350 +
  351 +.block {
  352 + display: block;
  353 +}
  354 +
  355 +.img-container2 {
  356 + width: 300rpx;
  357 + height: 200rpx;
  358 + margin: 60rpx auto 0;
  359 +}
  360 +
  361 +.note {
  362 + font-size: 24rpx;
  363 + white-space: nowrap;
  364 + color: #7b7b7b;
  365 +}
  366 +
  367 +.c-tb {
  368 + color: #ff6200;
  369 +}
  370 +
  371 +.noMore {
  372 + padding: 20rpx;
  373 + color: #bbb;
  374 + text-align: center;
  375 + font-size: 22rpx;
  376 +}
  377 +
  378 +.my-qrcode {
  379 + /* background-color: red; */
  380 +}
  381 +
  382 +.swiper-container {
  383 + position: absolute;
  384 + top: 0;
  385 + left: 0;
  386 + padding: 20rpx 10rpx;
  387 + width: 100%;
  388 + box-sizing: border-box;
  389 +}
  390 +
  391 +.swiper {
  392 + height: 60rpx;
  393 + color: white;
  394 + font-size: 26rpx;
  395 +}
  396 +
  397 +.swiper-item {
  398 + /* width: auto !important;
  399 + background-color: rgba(0,0,0,.4);
  400 + border-radius: 60rpx; */
  401 + position: relative;
  402 +}
  403 +
  404 +.item {
  405 + position: absolute;
  406 + display: flex;
  407 + align-items: center;
  408 + border-radius: 60rpx;
  409 + background-color: rgba(0,0,0,.4);
  410 +}
  411 +
  412 +.avatar-container {
  413 + width: 60rpx;
  414 + height: 60rpx;
  415 + border-radius: 50%;
  416 + overflow: hidden;
  417 + flex-shrink: 0;
  418 +}
  419 +
  420 +.img-block {
  421 + width: 100%;
  422 + height: 100%;
  423 + display: block;
  424 +}
  425 +
  426 +.nickname {
  427 + color: #FFE12F;
  428 + padding: 0 10rpx;
  429 +}
  430 +
... ...
packageB/pages/luckactivity/luckinfo/tool.wxs 0 → 100644
  1 +var tools = {
  2 + showDefaultImg: function(type) {
  3 + var src = '';
  4 + switch(type) {
  5 + case 1: { //积分
  6 + src = 'miniapp/images/luckDraw/jf.png';
  7 + break;
  8 + };
  9 + case 2: { //成长值
  10 + src = 'miniapp/images/luckDraw/czz.png';
  11 + break;
  12 + };
  13 + case 3: { //优惠券
  14 + src = 'miniapp/images/luckDraw/yhq.png';
  15 + break;
  16 + };
  17 + case 4: { //服务项目
  18 + src = 'miniapp/images/luckDraw/fw.png';
  19 + break;
  20 + };
  21 + case 5: { //赠品
  22 + src = 'miniapp/images/luckDraw/zp.png';
  23 + break;
  24 + };
  25 + case 6: { //礼包
  26 + src = 'miniapp/images/luckDraw/lb.png';
  27 + break;
  28 + };
  29 + };
  30 + return src;
  31 + },
  32 +};
  33 +
  34 +module.exports = {
  35 + showDefaultImg: tools.showDefaultImg,
  36 +}
0 37 \ No newline at end of file
... ...
pages/user/Change_phone/Change_phone.js renamed to packageB/pages/user/Change_phone/Change_phone.js
... ... @@ -2,8 +2,8 @@ var a = getApp(),
2 2 o = a.globalData,
3 3 r = a.globalData.setting,
4 4 t = a.request,
5   - s = require("../../../utils/common.js"),
6   - util = require("../../../utils/util.js");
  5 + s = require("../../../../utils/common.js"),
  6 + util = require("../../../../utils/util.js");
7 7 Page({
8 8  
9 9 /**
... ...
pages/user/Change_phone/Change_phone.json renamed to packageB/pages/user/Change_phone/Change_phone.json
pages/user/Change_phone/Change_phone.wxml renamed to packageB/pages/user/Change_phone/Change_phone.wxml
pages/user/Change_phone/Change_phone.wxss renamed to packageB/pages/user/Change_phone/Change_phone.wxss
packageB/pages/user/collect_list/collect_list.wxml
... ... @@ -5,7 +5,7 @@
5 5 </view>
6 6 <view class="flex-level fs30 xc-ash">当前暂无收藏</view>
7 7 <view class="flex-level">
8   - <navigator url="/pages/index/index/index" bindtap="goto">
  8 + <navigator bindtap="go_to" data-url="/pages/index/index/index" bindtap="goto">
9 9 <view class="flex-center fs28 white">去首页逛逛</view>
10 10 </navigator>
11 11 </view>
... ...
packageB/pages/user/comment/comment.js
... ... @@ -154,5 +154,9 @@ Page({
154 154 url: '/pages/index/index/index',
155 155 })
156 156 },
  157 + go_url(e){
  158 + var url=e.currentTarget.dataset.url;
  159 + getApp().goto(url);
  160 + }
157 161  
158 162 });
159 163 \ No newline at end of file
... ...
packageB/pages/user/comment/comment.wxml
... ... @@ -14,7 +14,7 @@
14 14 </view>
15 15 <view class="flex-level fs30 xc-ash">当前暂无评价</view>
16 16 <view class="flex-level">
17   - <navigator url="/pages/index/index/index" bindtap="goto">
  17 + <navigator bindtap="go_url" data-url="/pages/index/index/index">
18 18 <view class="flex-center fs28 white">去首页逛逛</view>
19 19 </navigator>
20 20 </view>
... ...
pages/cart/cart/cart.js
... ... @@ -2066,5 +2066,10 @@ Page({
2066 2066 if (hei< viewHeight) {
2067 2067 this.setData({ max_sw_height: viewHeight });
2068 2068 }
2069   - }
  2069 + },
  2070 +
  2071 + go_url(e){
  2072 + var url=e.currentTarget.dataset.url;
  2073 + getApp().goto(url);
  2074 + }
2070 2075 });
2071 2076 \ No newline at end of file
... ...
pages/cart/cart/cart.wxml
... ... @@ -114,7 +114,7 @@
114 114  
115 115 </view>
116 116 <view class="count">
117   - <view bindtap="subNum" class="sub fs28" data-pitems="{{pidx}}" data-item="{{idx}}">一</view>
  117 + <view bindtap="{{items.goods_num <= 1 ? '':'subNum'}}" class="sub fs28 {{items.goods_num <= 1 ? 'active':''}}" data-pitems="{{pidx}}" data-item="{{idx}}">一</view>
118 118 <input class="goodadd" bindblur="valueToNum" data-pitems="{{pidx}}" data-item="{{idx}}"
119 119 bindinput="refresh_input"
120 120 type="number" value="{{items.goods_num}}"></input>
... ... @@ -252,7 +252,7 @@
252 252 </view>
253 253 <view class="flex-level fs32 xc-ash">购物车竟然是空的</view>
254 254 <view class="flex-level">
255   - <navigator url="/pages/index/index/index" bindtap="goto">
  255 + <navigator bindtap="go_url" data-url="/pages/index/index/index" bindtap="goto">
256 256 <view class="flex-center fs30 white">去首页逛逛</view>
257 257 </navigator>
258 258 </view>
... ...
pages/cart/cart/cart.wxss
... ... @@ -104,7 +104,7 @@ radio {
104 104 .count {
105 105 display: flex;
106 106 bottom: 5rpx;
107   - border: 2rpx solid rgb(236, 236, 236);
  107 + /* border: 2rpx solid rgb(236, 236, 236); */
108 108 margin-bottom: 3rpx;
109 109 }
110 110  
... ... @@ -129,12 +129,23 @@ radio {
129 129 font-size: 32rpx;
130 130 }
131 131  
132   -.sub {
133   - border-right: 2rpx solid rgb(236, 236, 236);
  132 +.sub, .add, .count>input {
  133 + /* border-right: 1px solid #000; */
  134 + background-color: #f8f8f8;
  135 + border-radius: 8rpx;
  136 +}
  137 +.sub.active {
  138 + /* background-color: #ddd; */
  139 + color: #ccc;
  140 +}
  141 +.count>input {
  142 + margin: 0 10rpx;
  143 + line-height: normal;
134 144 }
135 145  
136 146 .add {
137   - border-left: 2rpx solid rgb(236, 236, 236);
  147 + /* background-color: #f8f8f8; */
  148 + /* border-left: 1px solid #000; */
138 149 }
139 150  
140 151 .pay-for {
... ... @@ -362,3 +373,8 @@ page {
362 373 padding: 0;
363 374 vertical-align: top;
364 375 }
  376 +
  377 +.sub.active {
  378 + /* background-color: #ddd; */
  379 + color: #ccc;
  380 +}
... ...
pages/cart/cart2/c_filter.wxs
1 1 var filters = {
2 2 toFix:function(val,count){
  3 + if(!val) return parseFloat(0).toFixed(count);
3 4 return val.toFixed(count)
4 5 },
5 6 format_time:function(ts,isFull) {
... ...
pages/cart/cart2/cart2.js
... ... @@ -108,14 +108,17 @@ Page({
108 108 order_prom_list_cart:null,
109 109  
110 110 ispt_goods:0, //是否平摊至单品,0要平摊 1不平摊
111   - rank_switch:0, //是不是开同等级卡
112   - show_card:null, //显示的等级卡
113   - card_name:'', //显示的卡的名称
114   - card_cut_price:null,//减价多少钱
115   -
116   - show_submit:0, //提交按钮变正常显示
117   - is_get_offline:1,
  111 +
  112 + rank_switch:0, //是不是开同等级卡
  113 + show_card:null, //显示的等级卡
  114 + card_name:'', //显示的卡的名称
  115 + card_cut_price:null,//减价多少钱
  116 +
  117 + show_submit:0, //提交按钮变正常显示
  118 + is_get_offline:1,
118 119  
  120 + tabs: ['门店自提','快递邮寄'],
  121 + currentTabIndex: 1,
119 122 },
120 123 onLoad: function(t) {
121 124 wx.setNavigationBarTitle({ title: "填写订单",})
... ... @@ -223,8 +226,10 @@ Page({
223 226 getApp().getConfig2(function (ee) {
224 227 var json_d = JSON.parse(ee.switch_list);
225 228 th.data.json_d=json_d;
226   - th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
227   - th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch});
  229 + th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
  230 + var is_default_logistics=json_d.is_default_logistics;
  231 +
  232 + th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch,is_default_logistics:is_default_logistics});
228 233  
229 234 var rank_switch=json_d.rank_switch;
230 235 var max_price=-1;
... ... @@ -276,8 +281,15 @@ Page({
276 281 //-------------------获取物流---------------
277 282 get_wuliu(func) {
278 283 var th = this;
279   - to.getwuliu(function (e) {
280   - th.setData({ wu_arr: e })
  284 + to.getwuliu(function (e) {
  285 + //系统是是否开启了默认的物流
  286 + if(th.data.is_default_logistics){
  287 + //如果第一个不是开启默认,说明要让用户自己选
  288 + if(!e[0].is_default){
  289 + th.setData({is_default_logistics:0});
  290 + }
  291 + }
  292 + th.setData({ wu_arr: e })
281 293 typeof func == "function" && func();
282 294 })
283 295 },
... ... @@ -489,9 +501,9 @@ Page({
489 501  
490 502 var narr = new Array(); narr.push(item);
491 503  
492   - //-----------拼装购物车结算的数组,如果有默认物流时要用默认物流编号-----------------
  504 + //-----------拼装购物车结算的数组,如果有默认物流时要用默认物流编号,计算默认的物流,不管是不是自提都算一下-----------------
493 505 var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code;
494   - if(e_t==0 && def_exp_code){
  506 + if(def_exp_code){
495 507 for(var k=0;k<th.data.wu_arr.length;k++){
496 508 var item=th.data.wu_arr[k]; if(def_exp_code==item.code){ m_wind=k; }
497 509 }
... ... @@ -571,6 +583,8 @@ Page({
571 583 a.get("/api/weshop/goods/get/" + oo.stoid+"/"+e, {
572 584 success:async function (t) {
573 585 var gd = t.data.data;
  586 + if(!gd) return false;
  587 +
574 588 t.data.data.original_img = oo.imghost + t.data.data.original_img;
575 589 t.data.data['buynum'] = gg.goods_num;
576 590 var distr_t=0,et=0
... ... @@ -734,7 +748,13 @@ Page({
734 748 distr_t=dis_t;
735 749 }
736 750 }
737   -
  751 +
  752 + //自选的时候,系统配置了默认的配送方式是物流的时候
  753 + if(distr_t==0 && th.data.json_d.pickupway && th.data.json_d.pickupway==1 ){
  754 + et=0;
  755 + }
  756 +
  757 +
738 758 var ie = {
739 759 pickup_id: gg.pick_id, pname: gg.pick_name, goods: narr, exp_type: et, wind: m_wind, distr_t: distr_t,bn_t_exp_t: distr_t,
740 760 goods_price: 0, shipping_price: 0, user_money: 0, total_amount: 0, order_amount: 0, user_note:0};
... ... @@ -1624,6 +1644,10 @@ Page({
1624 1644  
1625 1645 total_m= parseFloat( total_m)+ parseFloat( th.data.formData.shipping_price);
1626 1646 order_m = parseFloat(order_m)+ parseFloat( th.data.formData.shipping_price);
  1647 +
  1648 + total_m=total_m.toFixed(2);
  1649 + order_m=order_m.toFixed(2);
  1650 +
1627 1651 var atxt= "formData.total_amount";
1628 1652 th.setData({ [atxt]: total_m, })
1629 1653  
... ... @@ -1634,10 +1658,10 @@ Page({
1634 1658 //--------------如果使用余额---------------------
1635 1659 if (th.data.bn_use_money == 1) {
1636 1660 if (amoney> order_m) {
1637   - order_m = order_m.toFixed(2);
  1661 + order_m = parseFloat(order_m).toFixed(2);
1638 1662 th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price,show_submit:1 })
1639 1663 }else{
1640   - order_m =parseFloat(order_m - amoney);
  1664 + order_m =parseFloat(order_m) - parseFloat(amoney);
1641 1665 order_m = order_m.toFixed(2);
1642 1666 th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price,show_submit:1 })
1643 1667 }
... ... @@ -1672,6 +1696,10 @@ Page({
1672 1696 total_m= parseFloat( total_m)+ parseFloat( th.data.formData.shipping_price);
1673 1697 order_m = parseFloat(order_m)+ parseFloat( th.data.formData.shipping_price);
1674 1698 var atxt= "formData.total_amount";
  1699 +
  1700 + total_m=total_m.toFixed(2);
  1701 + order_m=order_m.toFixed(2);
  1702 +
1675 1703 th.setData({ [atxt]: total_m, })
1676 1704  
1677 1705 var txt = "formData.user_money";
... ... @@ -1681,10 +1709,10 @@ Page({
1681 1709 //--------------如果使用余额---------------------
1682 1710 if (th.data.bn_use_money == 1) {
1683 1711 if (amoney> order_m) {
1684   - order_m = order_m.toFixed(2);
  1712 + order_m = parseFloat(order_m).toFixed(2);
1685 1713 th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price,show_submit:1 })
1686 1714 }else{
1687   - order_m =parseFloat(order_m - amoney);
  1715 + order_m =parseFloat(order_m) - parseFloat(amoney);
1688 1716 order_m = order_m.toFixed(2);
1689 1717 th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price,show_submit:1 })
1690 1718 }
... ... @@ -1868,7 +1896,10 @@ Page({
1868 1896  
1869 1897 //积分购,先要带is_integral_normal=1
1870 1898 if(gg.is_integral_normal) goods.is_integral_normal=1;
1871   -
  1899 +
  1900 + //先要带is_pd_normal=1
  1901 + if(gg.is_pd_normal) goods.is_pd_normal=1;
  1902 +
1872 1903 //如果不立即购买或者秒杀,如果是线下库存购买的时候
1873 1904 if(goods.prom_type!=1 && goods.prom_type!=6 && th.data.sales_rules==2){
1874 1905 var isok=1;
... ... @@ -3423,7 +3454,9 @@ Page({
3423 3454 //是不是线下
3424 3455 var is_get_offline=item.is_offline;
3425 3456 this.setData({pop_offline_index:index,is_offline_show:1,show_off_price:off_price.toFixed(2),is_get_offline:is_get_offline});
3426   - }
  3457 + },
  3458 +
  3459 +
3427 3460  
3428 3461  
3429 3462  
... ...
pages/cart/cart2/cart2.wxml
... ... @@ -4,18 +4,52 @@
4 4  
5 5 <form bindsubmit="submitForm">
6 6 <view class="container">
  7 +
  8 + <!-- 立即购买的时候 -->
  9 + <block wx:if="{{is_b_now==1}}">
  10 + <view class="tab-container">
  11 + <view class="tab-wrapper">
  12 + <view hidden="{{bn_t_exp_t==2}}" bindtap='setexptype' data-t='1' class="tab {{bn_exp_type == 1? 'active':''}}"
  13 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>
  14 +
  15 + <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}"
  16 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>
  17 +
  18 + </view>
  19 + </view>
  20 + </block>
  21 + <!-- 购物购买只有一单的时候 -->
  22 + <block wx:if="{{is_b_now==0 && cartlist.length==1}}">
  23 + <view class="tab-container">
  24 + <view class="tab-wrapper">
  25 + <view hidden="{{cartlist[0].distr_t==2}}" bindtap='setexptype_w' data-ind="0" data-t='1' class="tab {{cartlist[0].exp_type == 1? 'active':''}}"
  26 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>
  27 +
  28 + <view hidden="{{cartlist[0].distr_t==1}}" bindtap='setexptype_w' data-ind="0" data-t='0' class="tab {{cartlist[0].exp_type== 0 ? 'active':''}}"
  29 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>
  30 +
  31 + </view>
  32 + </view>
  33 + </block>
  34 +
  35 +
7 36 <!--要进行判断地址是否显示---->
8 37 <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'>
9 38 <!---默认地址显示------>
10 39 <block wx:if="{{user_addr!=null}}">
11 40  
12 41 <view class="user-contact">
13   - <text>收货人:</text>{{user_addr.consignee}}{{'  '}}{{user_addr.mobile}}</view>
  42 + <text class="bold fs36 pdr20">{{user_addr.consignee}}</text>
  43 + <text class="fs28">{{user_addr.mobile}}</text>
  44 + </view>
14 45 <view class="location">
15   - <view class="address">{{user_addr.more_address}}{{' '}}{{user_addr.address}}</view>
16   - <view class="pos-icon">
17   - <image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image>
  46 + <view class="address fs26 pdt20">
  47 + <view class="pos-icon">
  48 + <image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image>
  49 + </view>
  50 + {{user_addr.more_address}}{{' '}}{{user_addr.address}}
18 51 </view>
  52 +
19 53 </view>
20 54 <view class="update-logistics">
21 55 <!-- <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/new_position.png"></image> -->
... ... @@ -33,7 +67,7 @@
33 67 </view> -->
34 68 </view>
35 69  
36   - <!---------------------购物车进来,有可能多单---------------------->
  70 + <!-- -------------------购物车进来,有可能多单-------------------- -->
37 71 <block wx:if="{{is_b_now==0}}">
38 72 <!-- <view class="xc-border main-top"></view> -->
39 73 <view wx:for="{{cartlist}}" wx:for-index="pidx">
... ... @@ -112,13 +146,14 @@
112 146 <icon color="#f23030" size="16" type="info"></icon>
113 147 {{order.store_prom}}
114 148 </view>
115   - <view class="use-item flex-space-between">
116   - <view class="flex-vertical">
117   - <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="padding-right:26rpx;display:{{item.distr_t==2?'none':'flex;align-items: center'}};">
  149 +
  150 + <!-- 当是物流很多单的时候 -->
  151 + <view class="use-item flex-space-between" wx:if="{{cartlist.length>1}}">
  152 + <view class="flex-vertical" >
  153 + <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type'
  154 + style="padding-right:26rpx;display:{{item.distr_t==2?'none':'flex;align-items: center'}};">
118 155 <!-- <icon bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' color="{{item.exp_type==1?'red':'gray'}}" size="16" type="success"></icon> -->
119   -
120   -
121   -
  156 +
122 157 <block wx:if="{{item.exp_type==1}}">
123 158 <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> -->
124 159 <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon>
... ... @@ -128,7 +163,7 @@
128 163 </block>
129 164 <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">门店自提</view>
130 165 </view>
131   -
  166 +
132 167 <view data-t='0' data-txt='cartlist[{{pidx}}].exp_type' data-ind="{{pidx}}" bindtap="setexptype_w" style="display:{{item.distr_t==1?'none':'flex;align-items: center'}};">
133 168 <!-- <icon bindtap='setexptype_w' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="{{item.exp_type==0?'red':'gray'}}" size="16" type="success"></icon> -->
134 169 <block wx:if="{{item.exp_type==0}}">
... ... @@ -138,26 +173,35 @@
138 173 <block wx:else>
139 174 <view class="circle xc-hookts on"></view>
140 175 </block>
141   -
  176 +
142 177 <view bindtap='setexptype_w' data-t='0' data-ind="{{pidx}}" data-txt='cartlist[{{pidx}}].exp_type' data-wl_txt='cartlist[{{pidx}}].wind'
143 178 class="yu_er">快递邮寄</view>
144 179 </view>
145 180 </view>
146   - <block wx:if="{{item.exp_type==0}}">
147   - <!-- 点击显示物流选择 -->
  181 +
  182 +
  183 + <!-- 点击显示物流选择,如果是默认使用的情况不成立 -->
  184 + <view wx:if="{{!is_default_logistics && item.exp_type!=1}}" class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;">
  185 + <view>{{wu_arr[item.wind].name}}</view>
  186 + <view class="xc-right"></view>
  187 + </view>
  188 +
  189 + </view>
  190 +
  191 + <!-- 当是物流,只有一单的时候 -->
  192 + <block wx:else >
  193 + <view class="use-item flex-space-between" wx:if="{{item.exp_type==0 && !is_default_logistics}}">
  194 + <view class="flex jc_sb" style="width: 100%; padding: 0 13rpx;">
  195 + <view>选择物流</view>
148 196 <view class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;">
149 197 <view>{{wu_arr[item.wind].name}}</view>
150 198 <view class="xc-right"></view>
151 199 </view>
152   - </block>
153   - </view>
154   -
155   - <!-- <view bindtap="express_name" class="use-item" hidden='{{item.exp_type==1}}'>
156   - <view>选择物流:</view> -->
157   - <!-- <picker bindchange="bindPickerChange_w" data-txt='cartlist[{{pidx}}].wind' value="{{item.wind}}" range="{{wu_arr}}" range-key="name">
158   - <view >{{wu_arr[item.wind].name}}</view>
159   - </picker> -->
160   - <!-- </view> -->
  200 + </view>
  201 + </view>
  202 + </block>
  203 +
  204 +
161 205 </view>
162 206  
163 207 <!-- 留言 -->
... ... @@ -188,7 +232,7 @@
188 232  
189 233 </view>
190 234  
191   - <!-----使用余额------>
  235 + <!-- ---使用余额---- -->
192 236 <view class="set-mes bdr_t-14" wx:if="{{yuer>0}}">
193 237 <view class="use-item" bindtap='set_js_useyuer'>
194 238 <icon color="{{js_use_money?'red':'gray'}}" size="16" type="success"></icon>
... ... @@ -198,7 +242,7 @@
198 242  
199 243 </block>
200 244  
201   - <!------立即购买-------->
  245 + <!-- ----立即购买------ -->
202 246 <!-- <view class="xc-border xc-border"></view> -->
203 247 <block wx:if="{{is_b_now==1}}">
204 248 <view class="use-item bfff bdr_t-14 mgt20">
... ... @@ -224,7 +268,7 @@
224 268 </view>
225 269 </view>
226 270  
227   - <!-----商品名称规格------>
  271 + <!-- ---商品名称规格---- -->
228 272 <view class="order-num flex-space-between">
229 273 <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view>
230 274 <view class="goods-num">x{{bn_goods.buynum}}</view>
... ... @@ -247,7 +291,7 @@
247 291 <block><text>{{filters.show_gui_ge(buy_now_gift_goods.goods_spec,buy_now_gift_goods.goods_color)}}</text></block>
248 292 </view>
249 293 </view>
250   - <!-----商品名称规格------>
  294 + <!-- ---商品名称规格---- -->
251 295 <view class="order-num flex-space-between">
252 296 <view class="co-red">¥<text class="fs36">0</text></view>
253 297 <view class="goods-num">x{{buy_now_gift_goods.buynum}}</view>
... ... @@ -270,7 +314,7 @@
270 314 <block><text>{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</text></block>
271 315 </view>
272 316 </view>
273   - <!-----商品名称规格------>
  317 + <!-- ---商品名称规格---- -->
274 318 <view class="order-num flex-space-between">
275 319 <view class="co-red">¥<text class="fs36">{{item.price}}</text></view>
276 320 <view class="goods-num">x{{item.goods_num}}</view>
... ... @@ -319,23 +363,14 @@
319 363 </view>
320 364 </view>
321 365  
322   - <view class="use-item flex-space-between">
323   - <view class="flex">
324   - <view bindtap='setexptype' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="padding-right:26rpx;display:{{bn_t_exp_t==2?'none':'flex;align-items:center;'}};">
325   - <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon>
326   - <view class="yu_er">门店自提</view>
327   - </view>
328   - <view bindtap='setexptype' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' style="display:{{bn_t_exp_t==1?'none':'flex;align-items:center;'}};">
329   - <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon>
330   - <view class="yu_er">快递邮寄</view>
331   - </view>
332   - </view>
333   - <block wx:if="{{bn_exp_type==0}}">
334   - <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index'>
335   - <view class="logistics-name">{{wu_arr[index].name}}</view>
336   - <view class="xc-right"></view>
  366 + <view class="xc-coupon-frame" wx:if="{{bn_exp_type==0 && !is_default_logistics}}">
  367 + <view class="flex-space-between" style="padding: 20rpx 25rpx; font-size: 30rpx;">
  368 + <view>选择物流</view>
  369 + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 12rpx;">
  370 + <view class="logistics-name">{{wu_arr[index].name}}</view>
  371 + <view class="xc-right"></view>
337 372 </view>
338   - </block>
  373 + </view>
339 374 </view>
340 375 </view>
341 376 <!-- 留言 -->
... ... @@ -406,7 +441,7 @@
406 441  
407 442 <view class="btn-wrap shadow-1" wx:if="{{show_submit}}">
408 443 <view class="pay-amount">
409   - <view class="payable">应付金额:<text class="co-red">{{formData.order_amount}}</text></view>
  444 + <view class="payable">应付金额:<text class="co-red"><text class="fs24">¥</text>{{formData.order_amount}}</text></view>
410 445 <!-- <view class="co-red big"></view> -->
411 446 </view>
412 447 <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button>
... ...
pages/cart/cart2/cart2.wxss
... ... @@ -20,6 +20,8 @@
20 20 }
21 21  
22 22  
  23 +
  24 +
23 25 page {
24 26 /* background-color: #FAFAFA; */
25 27 background-color: #F0F0F0;
... ... @@ -31,6 +33,32 @@ page {
31 33 /* padding-top: 28rpx; */
32 34 padding-bottom: 120rpx;
33 35 }
  36 +
  37 +.tab-container {
  38 + font-size: 28rpx;
  39 + margin-top: 20rpx;
  40 + display: flex;
  41 +}
  42 +
  43 +.tab-wrapper {
  44 + background-color: #ccc;
  45 + display: flex;
  46 + border-radius: 40rpx;
  47 + overflow: hidden;
  48 +}
  49 +
  50 +.tab {
  51 + padding: 20rpx 30rpx;
  52 +
  53 +}
  54 +
  55 +
  56 +.tab.active {
  57 + background-color: white;
  58 + border-radius: 40rpx;
  59 +}
  60 +
  61 +
34 62 .user-mes {
35 63 position: relative;
36 64 background-color: #fff;
... ... @@ -38,23 +66,25 @@ page {
38 66 color: #444;
39 67 /* margin-top: 28rpx; */
40 68 border-radius: 14rpx;
  69 + padding: 20rpx 70rpx 20rpx 20rpx;
41 70 }
42 71 .user-contact {
43   - padding: 24rpx 26rpx;
44   - font-weight: 600;
  72 + /* padding: 24rpx 26rpx;
  73 + font-weight: 600; */
45 74 }
46 75  
47 76 .location {
48 77 position: relative;
49   - padding: 0 70rpx 24rpx;
  78 + /* padding: 0 70rpx 24rpx; */
50 79 }
51 80  
52 81 .pos-icon {
53   - position: absolute;
54   - left: 28rpx;
55   - top: 6rpx;
56   - width: 30rpx;
57   - height: 36rpx;
  82 + /* position: absolute; */
  83 + /* left: 28rpx;
  84 + top: 6rpx; */
  85 + width: 20rpx;
  86 + height: 24rpx;
  87 + display: inline-block;
58 88 }
59 89  
60 90 .border-img {
... ... @@ -132,12 +162,12 @@ page {
132 162 .use-item{
133 163 display: flex;
134 164 align-items: center;
135   - height: 80rpx;
  165 + /* height: 80rpx; */
136 166 /* border-bottom: 1px solid #ddd; */
137   - font-size: 30rpx;
  167 + font-size: 26rpx;
138 168 /* width:95%;
139 169 margin:auto; */
140   - padding: 0 26rpx;
  170 + padding: 20rpx;
141 171 }
142 172 .use-item>view{
143 173 display: flex;
... ... @@ -148,9 +178,9 @@ margin:auto; */
148 178 }
149 179 .use-item .dp{
150 180 display: block;
151   - width: 50rpx;
152   - height: 50rpx;
153   - margin-left: -6rpx;
  181 + width: 40rpx;
  182 + height: 40rpx;
  183 + /* margin-left: -6rpx; */
154 184 }
155 185  
156 186 .set-item {
... ... @@ -182,11 +212,11 @@ margin:auto; */
182 212  
183 213 .coupon-mes {
184 214 /* box-sizing: border-box; */
185   - height:95rpx;
186   - padding: 0 26rpx;
  215 + /* height:95rpx; */
  216 + padding: 20rpx;
187 217 background-color: #fff;
188 218 font-size: 30rpx;
189   - color: #444;
  219 + /* color: #444; */
190 220 /* width: 100%; */
191 221 border-radius: 14rpx;
192 222 margin-top: 20rpx;
... ... @@ -225,9 +255,9 @@ margin:auto; */
225 255 .word-box {
226 256 font-size: 26rpx;
227 257 /* width: 600rpx; */
228   - padding: 10rpx;
  258 + /* padding: 10rpx;
229 259 height: 28rpx;
230   - line-height: 40rpx;
  260 + line-height: 40rpx; */
231 261 }
232 262  
233 263 .max-word {
... ... @@ -237,7 +267,7 @@ margin:auto; */
237 267 }
238 268  
239 269 .information {
240   - padding: 0 26rpx;
  270 + /* padding: 20rpx; */
241 271 background-color: #fff;
242 272 /* margin-bottom: 120rpx; */
243 273 }
... ... @@ -245,10 +275,11 @@ margin:auto; */
245 275 .information .item {
246 276 display: flex;
247 277 justify-content: space-between;
248   - height: 60rpx;
249   - line-height: 60rpx;
250   - font-size: 26rpx;
251   - color: #777;
  278 + /* height: 60rpx;
  279 + line-height: 60rpx; */
  280 + font-size: 24rpx;
  281 + /* color: #333; */
  282 + padding: 20rpx;
252 283 }
253 284  
254 285 .btn-wrap {
... ... @@ -364,12 +395,13 @@ margin:auto; */
364 395 background-color: white;
365 396 }
366 397 .xc-right{
367   - width:20rpx;
368   - height:20rpx;
  398 + width:12rpx;
  399 + height:12rpx;
369 400 border-top:2rpx solid #000;
370 401 border-right:2rpx solid #000;
371 402 transform:rotate(45deg);
372 403 display:inline-block;
  404 + margin-left: 10rpx;
373 405 }
374 406  
375 407 .xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; }
... ... @@ -904,7 +936,7 @@ margin-left: 20rpx;
904 936 .plus_buy{
905 937 background-color: #fff;
906 938 margin:15rpx 0;
907   - padding: 20rpx 10rpx;
  939 + padding: 20rpx;
908 940 position: relative;
909 941 }
910 942  
... ...
pages/cart/cart2_inte/cart2_inte.js
... ... @@ -93,8 +93,9 @@ Page({
93 93 getApp().getConfig2(function (ee) {
94 94 var json_d = JSON.parse(ee.switch_list);
95 95 th.data.json_d=json_d;
96   - th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
97   - th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch});
  96 + th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
  97 + var is_default_logistics=json_d.is_default_logistics;
  98 + th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch,is_default_logistics:is_default_logistics});
98 99  
99 100 var rank_switch=json_d.rank_switch;
100 101 var max_price=-1;
... ... @@ -204,8 +205,14 @@ Page({
204 205 get_wuliu(func) {
205 206 var th = this;
206 207 to.getwuliu(function (e) {
207   - th.setData({ wu_arr: e })
208   - typeof func == "function" && func();
  208 + if(th.data.is_default_logistics){
  209 + //如果第一个不是开启默认,说明要让用户自己选
  210 + if(!e[0].is_default){
  211 + th.setData({is_default_logistics:0});
  212 + }
  213 + }
  214 + th.setData({ wu_arr: e })
  215 + typeof func == "function" && func();
209 216 })
210 217 },
211 218 //------获取会员信息-----先获取用户信息,在进行下一步---
... ... @@ -294,6 +301,8 @@ Page({
294 301 a.get("/api/weshop/goods/get/" + oo.stoid+"/"+e, {
295 302 success:async function (t) {
296 303 var gd = t.data.data;
  304 + if(!gd) return false;
  305 +
297 306 t.data.data.original_img = oo.imghost + t.data.data.original_img;
298 307 t.data.data['buynum'] = gg.goods_num;
299 308 var distr_t=0,et=0
... ... @@ -1030,9 +1039,10 @@ Page({
1030 1039 if (rse.data.code==0){
1031 1040 getApp().globalData.userInfo.def_exp_code=is_shipping_code;
1032 1041 th.setData({ open_express: 0 });
1033   - //----计算此时购物车的价格----
1034   - if(th.data.is_b_now==1) th.calculatePrice2();
1035   - else th.calculatePrice();
  1042 + //----计算此时购物车的价格,这个页面没有calculatePrice(),2021.7.19--------
  1043 + //if(th.data.is_b_now==1) th.calculatePrice2();
  1044 + //else th.calculatePrice();
  1045 + th.calculatePrice2();
1036 1046 }
1037 1047 }
1038 1048 })
... ...
pages/cart/cart2_inte/cart2_inte.wxml
... ... @@ -4,6 +4,19 @@
4 4  
5 5 <form bindsubmit="submitForm">
6 6 <view class="container">
  7 +
  8 + <view class="tab-container">
  9 + <view class="tab-wrapper">
  10 + <view hidden="{{bn_t_exp_t==2}}" bindtap='setexptype' data-t='1' class="tab {{bn_exp_type == 1? 'active':''}}"
  11 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>
  12 +
  13 + <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}"
  14 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>
  15 +
  16 + </view>
  17 + </view>
  18 +
  19 +
7 20 <!--要进行判断地址是否显示---->
8 21 <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'>
9 22 <!---默认地址显示------>
... ... @@ -90,24 +103,18 @@
90 103 </view>
91 104 </view>
92 105  
93   - <view class="use-item flex-space-between">
94   - <view class="flex">
95   - <view bindtap='setexptype' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="padding-right:26rpx;display:{{bn_t_exp_t==2?'none':'flex;align-items:center;'}};">
96   - <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon>
97   - <view class="yu_er">门店自提</view>
98   - </view>
99   - <view bindtap='setexptype' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' style="display:{{bn_t_exp_t==1?'none':'flex;align-items:center;'}};">
100   - <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon>
101   - <view class="yu_er">快递邮寄</view>
102   - </view>
103   - </view>
104   - <block wx:if="{{bn_exp_type==0}}">
105   - <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index'>
106   - <view class="logistics-name">{{wu_arr[index].name}}</view>
107   - <view class="xc-right"></view>
  106 +
  107 +
  108 + <block wx:if="{{bn_exp_type==0 && !is_default_logistics}}">
  109 + <view class="use-item flex-space-between">
  110 + <view>选择物流</view>
  111 + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 8rpx;">
  112 + <view class="logistics-name">{{wu_arr[index].name}}</view>
  113 + <view class="xc-right"></view>
  114 + </view>
108 115 </view>
109 116 </block>
110   - </view>
  117 +
111 118 </view>
112 119  
113 120 <view class="coupon-mes flex-vertical">
... ...