Commit f97592b796cec98cc69465af3eba06fc897f8140
1 parent
7f00186f
plus会员开通
Showing
3 changed files
with
201 additions
and
74 deletions
pages/user/plus/plus.js
... | ... | @@ -38,6 +38,8 @@ Page({ |
38 | 38 | def_recommon: null, //分享人的手机号 |
39 | 39 | def_serviceman: null, //分享人的营业员 |
40 | 40 | fir_leader: 0, //分享人的ID |
41 | + staffNo_arr: [], //多个营业员 | |
42 | + is_select: false, //是否选择营业员过 | |
41 | 43 | }, |
42 | 44 | swiperChange: function (e) { |
43 | 45 | var currentId = e.detail.current; |
... | ... | @@ -280,6 +282,21 @@ Page({ |
280 | 282 | }) |
281 | 283 | } |
282 | 284 | }, |
285 | + | |
286 | + //选择营业员 | |
287 | + select_serviceman(e) { | |
288 | + let StaffNo = e.currentTarget.dataset.staffno; | |
289 | + // let {req_data,req} = this.data; | |
290 | + // if (StaffNo || StaffNo !== "") { | |
291 | + // req_data.staffNo = StaffNo; | |
292 | + // req.serviceman = StaffNo; | |
293 | + // }; | |
294 | + this.setData({ | |
295 | + is_select: 1, | |
296 | + staffNo_arr:[], | |
297 | + inp_serviceman:StaffNo, | |
298 | + }) | |
299 | + }, | |
283 | 300 | //--绑定邀请码的输入-- |
284 | 301 | b_input: function (e) { |
285 | 302 | var value = e.detail.value.trim(); |
... | ... | @@ -350,37 +367,85 @@ Page({ |
350 | 367 | req.userId = getApp().globalData.user_id; |
351 | 368 | //--如果有邀请码,和营业员的情况下-- |
352 | 369 | if (req.recommon || req.serviceman) { |
370 | + | |
353 | 371 | var req_data = { |
354 | 372 | storeId: os.stoid, |
355 | 373 | userId: req.userId |
356 | 374 | }; |
357 | 375 | if (req.recommon) req_data.inviteCode = req.recommon; |
358 | 376 | if (req.serviceman) req_data.staffNo = req.serviceman; |
377 | + th.setData({ | |
378 | + req_data, | |
379 | + req, | |
380 | + }) | |
359 | 381 | getApp().request.get("/api/weshop/plus/vip/mem/referee/code/check", { |
360 | 382 | data: req_data, |
361 | 383 | success: function (res) { |
362 | 384 | if (res.data.code == 0) { |
363 | - t_pay.pay(req, th.success, function () { | |
364 | - getApp().my_warnning("支付失败", 0, th); | |
365 | - }); | |
385 | + if(res.data.data.length > 1 && !th.data.is_select){ | |
386 | + th.setData({ | |
387 | + staffNo_arr:res.data.data | |
388 | + }) | |
389 | + }else{ | |
390 | + t_pay.pay(req, th.success, function () { | |
391 | + getApp().my_warnning("支付失败", 0, th); | |
392 | + th.setData({ | |
393 | + is_select:0, | |
394 | + }) | |
395 | + }); | |
396 | + } | |
366 | 397 | } else { |
367 | 398 | getApp().my_warnning(res.data.msg, 0, th); |
399 | + th.setData({ | |
400 | + is_select:0, | |
401 | + }) | |
368 | 402 | } |
369 | 403 | } |
370 | 404 | }) |
371 | 405 | } else { |
372 | 406 | t_pay.pay(req, th.success, function () { |
373 | 407 | getApp().my_warnning("支付失败", 0, th); |
408 | + th.setData({ | |
409 | + is_select:0, | |
410 | + }) | |
374 | 411 | }); |
375 | - } | |
412 | + } | |
376 | 413 | }, |
377 | 414 | //返回会员页面 |
378 | 415 | OpeningClose: function () { |
379 | 416 | this.setData({ |
380 | - open_yq: 0 | |
417 | + open_yq: 0, | |
381 | 418 | }); |
382 | 419 | }, |
383 | - | |
420 | + dialog_close() { | |
421 | + this.setData({ | |
422 | + staffNo_arr: [], | |
423 | + }); | |
424 | + }, | |
425 | + // check_serviceman(data,req) { | |
426 | + // let th = this; | |
427 | + // getApp().request.get("/api/weshop/plus/vip/mem/referee/code/check", { | |
428 | + // data, | |
429 | + // success: function (res) { | |
430 | + // if (res.data.code == 0) { | |
431 | + // if (res.data.data.length > 1 && !th.data.is_select) { | |
432 | + // th.setData({ | |
433 | + // staffNo_arr: res.data.data | |
434 | + // }) | |
435 | + // }else{ | |
436 | + // t_pay.pay(req, th.success, function () { | |
437 | + // getApp().my_warnning("支付失败", 0, th); | |
438 | + // }); | |
439 | + // } | |
440 | + // } else { | |
441 | + // getApp().my_warnning(res.data.msg, 0, th); | |
442 | + // } | |
443 | + // th.setData({ | |
444 | + // is_select:0, | |
445 | + // }) | |
446 | + // } | |
447 | + // }) | |
448 | + // }, | |
384 | 449 | //返回会员中心 |
385 | 450 | back_user: function () { |
386 | 451 | setTimeout(function () { | ... | ... |
pages/user/plus/plus.wxml
1 | 1 | <block wx:if="{{is_show && (fir_leader?is_fengxiang:1)}}"> |
2 | -<!-- 我的会员背景图片 --> | |
3 | -<import src="../../../utils/wxParse/wxParse.wxml"></import> | |
4 | -<view> | |
5 | - <image class="Member_bk" src="{{url}}/miniapp/images/plus/page_bk.png"></image> | |
6 | -</view> | |
7 | -<view class="plus"> | |
8 | - <!-- 开通会员模块 --> | |
2 | + <!-- 我的会员背景图片 --> | |
3 | + <import src="../../../utils/wxParse/wxParse.wxml"></import> | |
4 | + <view> | |
5 | + <image class="Member_bk" src="{{url}}/miniapp/images/plus/page_bk.png"></image> | |
6 | + </view> | |
7 | + <view class="plus"> | |
8 | + <!-- 开通会员模块 --> | |
9 | 9 | |
10 | - <block wx:if="{{is_plusCard}}"> | |
11 | - <view class="Opening_plus"> | |
12 | - <view class="Opening_bk"> | |
13 | - <image src="{{url}}/miniapp/images/plus/card_bk.png"></image> | |
14 | - </view> | |
15 | - <view class="swiper"> | |
10 | + <block wx:if="{{is_plusCard}}"> | |
11 | + <view class="Opening_plus"> | |
12 | + <view class="Opening_bk"> | |
13 | + <image src="{{url}}/miniapp/images/plus/card_bk.png"></image> | |
14 | + </view> | |
15 | + <view class="swiper"> | |
16 | 16 | <!-- 未开通会员swiper-item --> |
17 | 17 | <swiper current="{{currentId}}" current-item-id="{{currentId}}" next-margin="60rpx" previous-margin="60rpx" bindchange="swiperChange"> |
18 | 18 | <swiper-item class="flex" item-id="{{index}}" data-item-id="{{index}}" wx:for="{{is_plusCard}}"> |
19 | 19 | |
20 | - <view class="Membership {{currentId==index?'enlarge':''}}" style=" background-image: url({{item.CardImg}});color:{{item.CardColor}}"> | |
20 | + <view class="Membership {{currentId==index?'enlarge':''}}" style=" background-image: url({{item.CardImg}});color:{{item.CardColor}}"> | |
21 | 21 | <view class="flex-space-between Membership_go"> |
22 | 22 | <view> |
23 | 23 | <view class="fs36">{{item.CardName}}</view> |
... | ... | @@ -32,7 +32,7 @@ |
32 | 32 | |
33 | 33 | <view class="flex-vertical fs24" style="overflow:hidden"> |
34 | 34 | |
35 | - <view class="Member"style="background-image:url('{{url}}/miniapp/images/plus/privilege_o.png');filter: drop-shadow( 40rpx 0rpx 0rpx {{item.CardColor}});"></view> | |
35 | + <view class="Member" style="background-image:url('{{url}}/miniapp/images/plus/privilege_o.png');filter: drop-shadow( 40rpx 0rpx 0rpx {{item.CardColor}});"></view> | |
36 | 36 | <view style="margin-left:5rpx;white-space: nowrap;">按去年用户消费计算,开卡后一年预计省¥{{item.free}}元 |
37 | 37 | </view> |
38 | 38 | </view> |
... | ... | @@ -41,76 +41,80 @@ |
41 | 41 | |
42 | 42 | </swiper-item> |
43 | 43 | </swiper> |
44 | + </view> | |
44 | 45 | </view> |
45 | - </view> | |
46 | - </block> | |
46 | + </block> | |
47 | 47 | |
48 | - <!-- 会员礼遇 --> | |
49 | - <view class="Courtesy"> | |
48 | + <!-- 会员礼遇 --> | |
49 | + <view class="Courtesy"> | |
50 | + | |
51 | + <!-- 标题 --> | |
52 | + <view class="flex-center" style="width:100%;height:200rpx;"> | |
53 | + <view> | |
54 | + <view class="Courtesy_title flex-center fs36">开通PLUS会员尊享礼遇 | |
55 | + </view> | |
50 | 56 | |
51 | - <!-- 标题 --> | |
52 | - <view class="flex-center" style="width:100%;height:200rpx;"> | |
53 | - <view> | |
54 | - <view class="Courtesy_title flex-center fs36">开通PLUS会员尊享礼遇 | |
55 | - </view> | |
56 | - | |
57 | 57 | |
58 | 58 | |
59 | - <view class="flex-center"> | |
60 | - <image class="Courtesy_image" src="{{url}}/miniapp/images/plus/Courtesy.png"></image> | |
59 | + <view class="flex-center"> | |
60 | + <image class="Courtesy_image" src="{{url}}/miniapp/images/plus/Courtesy.png"></image> | |
61 | 61 | |
62 | - | |
63 | - <view class="Courtesy_can fs24">PLUS会员可享受以下特权 | |
62 | + | |
63 | + <view class="Courtesy_can fs24">PLUS会员可享受以下特权 | |
64 | + </view> | |
65 | + | |
66 | + <image class="Courtesy_image" src="{{url}}/miniapp/images/plus/Courtesy.png"></image> | |
64 | 67 | </view> |
68 | + </view> | |
69 | + </view> | |
70 | + | |
65 | 71 | |
66 | - <image class="Courtesy_image" src="{{url}}/miniapp/images/plus/Courtesy.png"></image> | |
72 | + | |
73 | + <!-- 会员权益内容 --> | |
74 | + <view class="Courtesy_comment " style="padding:0 20rpx" wx:if="{{is_card_rule!=null&&is_card_rule!=''}}"> | |
75 | + <view class="wxParse"> | |
76 | + <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> | |
67 | 77 | </view> |
68 | 78 | </view> |
69 | 79 | </view> |
70 | 80 | |
71 | - <!-- 会员权益内容 --> | |
72 | - <view class="Courtesy_comment " style="padding:0 20rpx" wx:if="{{is_card_rule!=null&&is_card_rule!=''}}"> | |
73 | - <view class="wxParse"> | |
74 | - <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> | |
75 | - </view> | |
76 | - </view> | |
77 | - </view> | |
81 | + <!-- 好物推荐 --> | |
82 | + <!-- 好物推荐 --> | |
83 | + <view class="title"> | |
84 | + <!-- 标题 --> | |
85 | + <view> | |
86 | + <!-- 中文名标题 --> | |
87 | + <view class="China flex-level"> | |
88 | + <view class="line flex-vertical"> | |
89 | + <view class="one"></view> | |
90 | + <view class="two"></view> | |
91 | + <view class="three"></view> | |
92 | + </view> | |
78 | 93 | |
79 | - <!-- 好物推荐 --> | |
80 | - <!-- 好物推荐 --> | |
81 | - <view class="title"> | |
82 | - <!-- 标题 --> | |
83 | - <view> | |
84 | - <!-- 中文名标题 --> | |
85 | - <view class="China flex-level"> | |
86 | - <view class="line flex-vertical"> | |
87 | - <view class="one"></view><view class="two"></view><view class="three"></view> | |
88 | - </view> | |
94 | + <view class="Recommend flex-level" bindtap="requestList">好物推荐</view> | |
89 | 95 | |
90 | - <view class="Recommend flex-level" bindtap="requestList">好物推荐</view> | |
96 | + <view class="line flex-vertical"> | |
97 | + <view class="three"></view> | |
98 | + <view class="two"></view> | |
99 | + <view class="one"></view> | |
100 | + </view> | |
101 | + </view> | |
91 | 102 | |
92 | - <view class="line flex-vertical"> | |
93 | - <view class="three"></view> | |
94 | - <view class="two"></view> | |
95 | - <view class="one"></view> | |
103 | + <!-- 英文标题 --> | |
104 | + <view class="english flex-center"> | |
105 | + <view class="silk"></view> | |
106 | + <view class="esh five-level-word">GOOD HOT THING</view> | |
107 | + <view class="silk"></view> | |
96 | 108 | </view> |
97 | - </view> | |
98 | 109 | |
99 | - <!-- 英文标题 --> | |
100 | - <view class="english flex-center"> | |
101 | - <view class="silk"></view> | |
102 | - <view class="esh five-level-word">GOOD HOT THING</view> | |
103 | - <view class="silk"></view> | |
104 | 110 | </view> |
111 | + <!-- 商品列表组件 --> | |
112 | + <goods_recommend id="goods_list"></goods_recommend> | |
113 | + <!-- 商品列表 --> | |
105 | 114 | |
106 | 115 | </view> |
107 | - <!-- 商品列表组件 --> | |
108 | - <goods_recommend id="goods_list"></goods_recommend> | |
109 | - <!-- 商品列表 --> | |
110 | 116 | |
111 | 117 | </view> |
112 | - | |
113 | -</view> | |
114 | 118 | </block> |
115 | 119 | |
116 | 120 | <!-- 开通会员弹窗 --> |
... | ... | @@ -127,7 +131,7 @@ |
127 | 131 | <view class="fs36 flex-level perfect">请完善下面信息</view> |
128 | 132 | <view class="fillin"> |
129 | 133 | <!-- 输入推荐人手机号 --> |
130 | - <view class="flex ai_and Enter_phone" wx:if="{{isyaoqingma}}" > | |
134 | + <view class="flex ai_and Enter_phone" wx:if="{{isyaoqingma}}"> | |
131 | 135 | <image class="phone_image" src="{{url}}/miniapp/images/plus/Invitation_code.png"></image> |
132 | 136 | <view class="phone"> |
133 | 137 | <input bindinput="b_input" data-name="inp_recommon" class="fs30" placeholder="请输入邀请码(推荐人手机号)" type="number" maxlength="20" /> |
... | ... | @@ -137,22 +141,44 @@ |
137 | 141 | <view class="flex ai_and enter_SalesClerk" wx:if="{{is_salesman}}"> |
138 | 142 | <image class="SalesClerk_image" src="{{url}}/miniapp/images/plus/Sales_Clerk.png"></image> |
139 | 143 | <view class="SalesClerk"> |
140 | - <input bindinput="b_input" class="fs30" data-name="inp_serviceman" placeholder="请输入营业员" maxlength="30" /> | |
144 | + <input bindinput="b_input" class="fs30" data-name="inp_serviceman" value="{{inp_serviceman}}" placeholder="请输入营业员" maxlength="30" /> | |
141 | 145 | </view> |
142 | 146 | </view> |
143 | 147 | <!-- 确认购买 --> |
144 | 148 | <view class="flex-center" bindtap="buy_card"> |
145 | - <view class="flex-center purchase" | |
146 | - style="background-image:url({{url}}/miniapp/images/plus/purchase_Bk.png);"> | |
149 | + <view class="flex-center purchase" style="background-image:url({{url}}/miniapp/images/plus/purchase_Bk.png);"> | |
147 | 150 | 确认购买 |
148 | 151 | </view> |
149 | 152 | </view> |
150 | 153 | </view> |
151 | 154 | </view> |
155 | + | |
152 | 156 | <view class="flex-level"> |
153 | 157 | <image class="purchaseClose" bindtap="OpeningClose" src="{{url}}/miniapp/images/plus/Close.png"></image> |
154 | 158 | </view> |
155 | 159 | </view> |
156 | 160 | |
157 | 161 | </view> |
162 | + | |
163 | +<view class="Disgraceful" wx:if="{{staffNo_arr.length>0}}"> | |
164 | + <view bindtap="OpeningClose"></view> | |
165 | + <view class="dialog_body"> | |
166 | + <view style="background-color: #fff;"> | |
167 | + <view class="dialog_choose"> | |
168 | + <text>请选择营业员</text> | |
169 | + <text class="dialog_close" bindtap="dialog_close">X</text> | |
170 | + </view> | |
171 | + <view class="dialog_name"> | |
172 | + <text>编号</text> | |
173 | + <text>姓名</text> | |
174 | + </view> | |
175 | + </view> | |
176 | + <view class="dialog_name" bindtap="select_serviceman" data-StaffNo="{{item.StaffNo}}" wx:for="{{staffNo_arr}}" wx:key="id" hover-class="weui-active" hover-start-time="200" style="background-color: #fff;"> | |
177 | + <view>{{item.StaffNo}}</view> | |
178 | + <view>{{item.StaffName}}</view> | |
179 | + </view> | |
180 | + </view> | |
181 | +</view> | |
182 | + | |
183 | + | |
158 | 184 | <warn id="warn"></warn> |
159 | 185 | \ No newline at end of file | ... | ... |
pages/user/plus/plus.wxss
... | ... | @@ -16,7 +16,43 @@ page { |
16 | 16 | width: 100%; |
17 | 17 | height: 100%; |
18 | 18 | } |
19 | - | |
19 | +.dialogful{ | |
20 | + position: fixed; | |
21 | + left: 0; | |
22 | + top: 15%; | |
23 | + right: 0; | |
24 | + bottom: 0; | |
25 | + z-index: 11; | |
26 | + background: rgba(0, 0, 0, 0.6); | |
27 | + width: 100%; | |
28 | + height: 100%; | |
29 | +} | |
30 | +.dialog_body { | |
31 | + margin:30% auto; | |
32 | + width: 660rpx; | |
33 | +} | |
34 | +.dialog_close{ | |
35 | + float: right; | |
36 | + width: 50rpx; | |
37 | + height: 50rpx; | |
38 | + text-align: right; | |
39 | +} | |
40 | +.dialog_choose{ | |
41 | + position: relative; | |
42 | + padding: 20rpx; | |
43 | + border-bottom: 1rpx solid #eee; | |
44 | +} | |
45 | +.dialog_name, | |
46 | +.dialog_content { | |
47 | + padding: 10rpx; | |
48 | + display: flex; | |
49 | + border-bottom: 1rpx solid #f7f7f7; | |
50 | + justify-content: space-around; | |
51 | +} | |
52 | +.weui-active{ | |
53 | + opacity: 0.9; | |
54 | + background: #f7f7f7; | |
55 | +} | |
20 | 56 | .Opening_bk image { |
21 | 57 | position: absolute; |
22 | 58 | z-index: 2; | ... | ... |