Commit db366d812b6a0ec3c8f2f6845e4270459b97955c
Merge branch 'dev' into 'test'
Dev See merge request !238
Showing
20 changed files
with
1534 additions
and
602 deletions
app.json
1 | 1 | { |
2 | 2 | "pages": [ |
3 | 3 | "pages/index/index/index", |
4 | + "pages/user/assistance/giftpacklist", | |
5 | + "pages/user/assistance/task_assistance", | |
6 | + "pages/user/share/share", | |
4 | 7 | "pages/giftpack/birthdaygift/birthdaygift", |
5 | 8 | "pages/user/comment/comment", |
6 | 9 | "pages/giftpack/evaluategift/evaluategift", |
... | ... | @@ -85,8 +88,7 @@ |
85 | 88 | "pages/user/my_service/tment_order_list", |
86 | 89 | "pages/user/my_service/beauty_deta", |
87 | 90 | "pages/user/labels/labels", |
88 | - "pages/user/view_comment/view_comment", | |
89 | - "pages/user/assistance/assistance", | |
91 | + "pages/user/view_comment/view_comment" | |
90 | 92 | ], |
91 | 93 | "permission": { |
92 | 94 | "scope.userLocation": { | ... | ... |
pages/giftpack/birthdaygift/birthdaygift.js
... | ... | @@ -32,24 +32,28 @@ Page({ |
32 | 32 | GetList: function () { |
33 | 33 | var th = this; |
34 | 34 | var url = "/api/weshop/marketing/giftbag/bound/get"; |
35 | + wx.showLoading({ | |
36 | + title: '加载中', | |
37 | + }) | |
35 | 38 | getApp().request.promiseGet(url, { |
36 | 39 | data: { |
37 | 40 | "actId": th.data.getActId, //活动id |
38 | - "actType":4, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 | |
41 | + "actType": 4, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 | |
39 | 42 | "giftBagId": th.data.giftID, //礼包ID |
40 | 43 | "storeId": a.stoid, //商家ID |
41 | 44 | "userId": d.user_id //用户ID |
42 | 45 | } |
43 | 46 | }).then(res => { |
47 | + wx.hideLoading(); | |
44 | 48 | if (res.data.code == 0) { |
45 | - if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons!=null) { | |
49 | + if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons != null) { | |
46 | 50 | //礼包内容--礼券 |
47 | 51 | th.setData({ |
48 | 52 | cardShow: true, |
49 | 53 | cards: res.data.data.lbCoupons |
50 | 54 | }) |
51 | 55 | } |
52 | - if (res.data.data.lbSM.length > 0 && res.data.data.lbSM!=nll) { | |
56 | + if (res.data.data.lbSM.length > 0 && res.data.data.lbSM != nll) { | |
53 | 57 | //礼包内容--服务项目 |
54 | 58 | th.setData({ |
55 | 59 | itemShow: true, |
... | ... | @@ -100,7 +104,8 @@ Page({ |
100 | 104 | if (res.data.data.actIntro != '') { |
101 | 105 | th.setData({ |
102 | 106 | textShow: true, |
103 | - textTitle: res.data.data.actIntro | |
107 | + textTitle: res.data.data.actIntro.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"').replace(/<section/g, '<div') | |
108 | + .replace(/\/section>/g, '\div>') | |
104 | 109 | }) |
105 | 110 | } |
106 | 111 | } else { |
... | ... | @@ -119,11 +124,7 @@ Page({ |
119 | 124 | th.GetList(); |
120 | 125 | }, |
121 | 126 | onShow: function onShow() { |
122 | - var th = this; | |
123 | - var textTitle = th.data.textTitle.replace(/<p><img/gi, "<p class='img'><img"); | |
124 | - th.setData({ | |
125 | - textTitle: textTitle | |
126 | - }) | |
127 | + | |
127 | 128 | }, |
128 | 129 | GetReceive: function () { |
129 | 130 | var th = this; |
... | ... | @@ -135,7 +136,9 @@ Page({ |
135 | 136 | th.setData({ |
136 | 137 | is_sub: 1 |
137 | 138 | }) |
138 | - | |
139 | + wx.showLoading({ | |
140 | + title: '加载中', | |
141 | + }) | |
139 | 142 | var json = { |
140 | 143 | "actId": th.data.getActId, //活动Id |
141 | 144 | "actType": 4, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
... | ... | @@ -153,6 +156,7 @@ Page({ |
153 | 156 | 'content-type': 'application/json' |
154 | 157 | }, // 设置请求的 header |
155 | 158 | success: function (res) { |
159 | + wx.hideLoading(); | |
156 | 160 | th.setData({ |
157 | 161 | is_sub: 0 |
158 | 162 | }) | ... | ... |
pages/giftpack/birthdaygift/birthdaygift.wxml
1 | 1 | <view> |
2 | - <view class="image_box"> | |
3 | - <image src="{{iurl+'/miniapp/images/giftbag/birth00.png'}}" lazy-load="true"></image> | |
4 | - </view> | |
5 | - <block wx:if="{{itemShow}}"> | |
6 | - <view class="top"> | |
7 | - <view class="top_box"> | |
8 | - <view class="top_box_text"> | |
9 | - <text>______</text> | |
10 | - </view> | |
11 | - <view class="top_box_text"> | |
12 | - <text>新人专享\n你的美丽我来缔造</text> | |
13 | - </view> | |
14 | - <view class="top_box_text"> | |
15 | - <text >______</text> | |
16 | - </view> | |
17 | - </view> | |
18 | - <block wx:for="{{itemWare}}" wx:for-item="item" wx:for-index="index" wx:key="index"> | |
19 | - <view class="top_item "> | |
20 | - <block wx:if="{{item.lbType==3}}"> | |
21 | - <view class="top_item_img"> | |
22 | - <image src="{{item.fromImage=='' || item.fromImage==null?iurl+'/miniapp/images/giftbag/gift02.png':iurl+item.fromImage}}" lazy-load="true" data-errorimg="itemWare[{{index}}].fromImage" binderror="bind_bnerr1" data-img="{{item.fromImage}}"></image> | |
23 | - </view> | |
24 | - </block> | |
25 | - <block wx:if="{{item.lbType==1}}"> | |
26 | - <view class="top_item_img "> | |
27 | - <image src="{{item.fromImage==''?iurl+'/miniapp/images/giftbag/empty.jpg':iurl+item.fromImage}}" lazy-load="true"></image> | |
28 | - </view> | |
29 | - </block> | |
30 | - <view class="top_item_center "> | |
31 | - <view class="top_item_center_title"> | |
32 | - <block wx:if="{{item.lbType==1}}"> | |
33 | - <text>免费领取</text> | |
34 | - </block> | |
35 | - <block wx:if="{{item.lbType==3}}"> | |
36 | - <text>{{item.fromName}}</text> | |
37 | - </block> | |
38 | - </view> | |
39 | - <view class="top_item_center_ramke "> | |
40 | - <block wx:if="{{item.lbType==1}}"> | |
41 | - <text>{{item.fromName}}</text> | |
42 | - </block> | |
43 | - <block wx:if="{{item.lbType==3}}"> | |
44 | - <text >{{"新人可免费享受专业"+item.fromName+",可以享受"+item.num+"次。"}}</text> | |
45 | - </block> | |
46 | - </view> | |
47 | - </view> | |
48 | - </view> | |
49 | - </block> | |
2 | + <view class="image_box"> | |
3 | + <image src="{{iurl+'/miniapp/images/giftbag/birth00.png'}}" lazy-load="true"></image> | |
4 | + </view> | |
5 | + <block wx:if="{{itemShow}}"> | |
6 | + <view class="top rel"> | |
7 | + <view class="top_box"> | |
8 | + <view class="top_box_text"> | |
9 | + <text>______</text> | |
50 | 10 | </view> |
51 | - </block> | |
52 | - <block wx:if="{{itemShow}}"> | |
53 | - <view > | |
54 | - <image style="width:10px;height:47px;float:left;top:-38px;left:55px;" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image> | |
55 | - <image style="width:10px;height:47px;float:right;top:-38px;right:55px;" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image> | |
11 | + <view class="top_box_text"> | |
12 | + <text>新人专享\n你的美丽我来缔造</text> | |
56 | 13 | </view> |
57 | - </block> | |
58 | - <block wx:if="{{cardShow}}"> | |
59 | - <view > | |
60 | - <view class="top "> | |
61 | - <view class="top_box "> | |
62 | - <view class="top_box_text "> | |
63 | - <text >———</text> | |
64 | - </view> | |
65 | - <view class="top_box_text "> | |
66 | - <text >新人专享优惠券</text> | |
67 | - </view> | |
68 | - <view class="top_box_text "> | |
69 | - <text >———</text> | |
70 | - </view> | |
71 | - </view> | |
72 | - <block wx:for="{{cards}}" wx:for-item="item" wx:for-index="index" wx:key="index"> | |
73 | - <view class="top_card "> | |
74 | - <view class="{{item.useObjectType==1?'top_card_box img1':item.useObjectType==2?'top_card_box img2':'top_card_box img3'}}"> | |
75 | - <!-- class="{{['',item.useObjectType==1?'top_card_box img1':item.useObjectType==2?'top_card_box img2':'top_card_box img3']}}" --> | |
76 | - <view class="top_card_tite_box "> | |
77 | - <block wx:if="{{item.useObjectType==0}}"> | |
78 | - <view class="top_card_tite_a">全场通用</view> | |
79 | - </block> | |
80 | - <block wx:if="{{item.useObjectType==1}}"> | |
81 | - <view class="top_card_tite_b">品牌限定</view> | |
82 | - </block> | |
83 | - <block wx:if="{{item.useObjectType==2}}"> | |
84 | - <view class="top_card_tite_c">品类限定</view> | |
85 | - </block> | |
86 | - <block wx:if="{{item.useObjectType==11}}"> | |
87 | - <view class="top_card_tite_a">用途限定</view> | |
88 | - </block> | |
89 | - <block wx:if="{{item.useObjectType==12}}"> | |
90 | - <view class="top_card_tite_a">分类限定</view> | |
91 | - </block> | |
92 | - </view> | |
93 | - <view class="top_card_counte ">{{item.sum+"元券"}}</view> | |
94 | - <view class="top_card_remak ">{{"满"+item.buySum+"元可以用"}}</view> | |
95 | - </view> | |
96 | - </view> | |
97 | - </block> | |
98 | - </view> | |
14 | + <view class="top_box_text"> | |
15 | + <text>______</text> | |
99 | 16 | </view> |
100 | - </block> | |
101 | - <block wx:if="{{cardShow}}"> | |
102 | - <view> | |
103 | - <view> | |
104 | - <image style="width:10px;height:47px;float:left;top:-38px;left:55px;" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image> | |
105 | - <image style="width:10px;height:47px;float:right;top:-38px;right:55px;" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image> | |
17 | + </view> | |
18 | + <block wx:for="{{itemWare}}" wx:for-item="item" wx:for-index="index" wx:key="index"> | |
19 | + <view class="top_item "> | |
20 | + <block wx:if="{{item.lbType==3}}"> | |
21 | + <view class="top_item_img"> | |
22 | + <image src="{{item.fromImage=='' || item.fromImage==null?iurl+'/miniapp/images/giftbag/gift02.png':iurl+item.fromImage}}" lazy-load="true" data-errorimg="itemWare[{{index}}].fromImage" binderror="bind_bnerr1" data-img="{{item.fromImage}}"></image> | |
106 | 23 | </view> |
107 | - </view> | |
108 | - </block> | |
109 | - <block wx:if="{{packShow}}"> | |
110 | - <view > | |
111 | - <view class="top "> | |
112 | - <view class="top_box "> | |
113 | - <view class="top_box_text "> | |
114 | - <text >———</text> | |
115 | - </view> | |
116 | - <view class="top_box_text "> | |
117 | - <text >新人专享福利</text> | |
118 | - </view> | |
119 | - <view class="top_box_text "> | |
120 | - <text >———</text> | |
121 | - </view> | |
122 | - </view> | |
123 | - <block wx:if="{{integralShow}}"> | |
124 | - <view> | |
125 | - <view class="top_box_image "> | |
126 | - <image src="{{iurl+'/miniapp/images/giftbag/vip06.jpg'}}" lazy-load="true"></image> | |
127 | - <button>{{integralTitle}}</button> | |
128 | - </view> | |
129 | - </view> | |
130 | - </block> | |
131 | - <block wx:if="{{growUpShow}}"> | |
132 | - <view > | |
133 | - <view class="top_box_image fs36"> | |
134 | - <image src="{{iurl+'/miniapp/images/giftbag/vip07.jpg'}}" lazy-load="true"></image> | |
135 | - <button>{{growUpTitle}}</button> | |
136 | - </view> | |
137 | - </view> | |
138 | - </block> | |
24 | + </block> | |
25 | + <block wx:if="{{item.lbType==1}}"> | |
26 | + <view class="top_item_img "> | |
27 | + <image src="{{item.fromImage==''?iurl+'/miniapp/images/giftbag/empty.jpg':iurl+item.fromImage}}" lazy-load="true"></image> | |
139 | 28 | </view> |
140 | - </view> | |
141 | - </block> | |
142 | - <block wx:if="{{textShow}}"> | |
143 | - <view class="foot_box"> | |
144 | - <view class="foot_box_title fs36"> | |
145 | - <text>活动规则:</text> | |
29 | + </block> | |
30 | + <view class="top_item_center "> | |
31 | + <view class="top_item_center_title"> | |
32 | + <block wx:if="{{item.lbType==1}}"> | |
33 | + <text>免费领取</text> | |
34 | + </block> | |
35 | + <block wx:if="{{item.lbType==3}}"> | |
36 | + <text>{{item.fromName}}</text> | |
37 | + </block> | |
146 | 38 | </view> |
147 | - <view class="foot_box_text"> | |
148 | - <rich-text nodes="{{textTitle}}"></rich-text> | |
39 | + <view class="top_item_center_ramke "> | |
40 | + <block wx:if="{{item.lbType==1}}"> | |
41 | + <text>{{item.fromName}}</text> | |
42 | + </block> | |
43 | + <block wx:if="{{item.lbType==3}}"> | |
44 | + <text>{{"新人可免费享受专业"+item.fromName+",可以享受"+item.num+"次。"}}</text> | |
45 | + </block> | |
46 | + <view class="num flex-level-right fs26"> | |
47 | + <view>数量:</view> | |
48 | + <view>{{item.num}}</view> | |
49 | + </view> | |
149 | 50 | </view> |
51 | + </view> | |
150 | 52 | </view> |
151 | - </block> | |
152 | - <view class="button_box"> | |
153 | - <view > | |
154 | - <button class="button" bindtap="goto" data-url="/pages/index/index/index">进入商城购物</button> | |
53 | + </block> | |
54 | + <block wx:if="{{itemShow}}"> | |
55 | + <view class="vips"> | |
56 | + <image class="lvip abs" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image> | |
57 | + <image class="rvip abs" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image> | |
155 | 58 | </view> |
156 | - <view class="button_text "> | |
157 | - <text >本活动最终解释权归公司所有,如果有问题请联系客服</text> | |
59 | + </block> | |
60 | + </view> | |
61 | + </block> | |
62 | + <block wx:if="{{cardShow}}"> | |
63 | + <view> | |
64 | + <view class="top rel"> | |
65 | + <view class="top_box "> | |
66 | + <view class="top_box_text "> | |
67 | + <text>———</text> | |
68 | + </view> | |
69 | + <view class="top_box_text "> | |
70 | + <text>新人专享优惠券</text> | |
71 | + </view> | |
72 | + <view class="top_box_text "> | |
73 | + <text>———</text> | |
74 | + </view> | |
158 | 75 | </view> |
76 | + <block wx:for="{{cards}}" wx:for-item="item" wx:for-index="index" wx:key="index"> | |
77 | + <view class="top_card "> | |
78 | + <view class="{{item.useObjectType==1?'top_card_box img1':item.useObjectType==2?'top_card_box img2':'top_card_box img3'}}"> | |
79 | + <!-- class="{{['',item.useObjectType==1?'top_card_box img1':item.useObjectType==2?'top_card_box img2':'top_card_box img3']}}" --> | |
80 | + <view class="top_card_tite_box "> | |
81 | + <block wx:if="{{item.useObjectType==0}}"> | |
82 | + <view class="top_card_tite_a">全场通用</view> | |
83 | + </block> | |
84 | + <block wx:if="{{item.useObjectType==1}}"> | |
85 | + <view class="top_card_tite_b">品牌限定</view> | |
86 | + </block> | |
87 | + <block wx:if="{{item.useObjectType==2}}"> | |
88 | + <view class="top_card_tite_c">品类限定</view> | |
89 | + </block> | |
90 | + <block wx:if="{{item.useObjectType==11}}"> | |
91 | + <view class="top_card_tite_a">用途限定</view> | |
92 | + </block> | |
93 | + <block wx:if="{{item.useObjectType==12}}"> | |
94 | + <view class="top_card_tite_a">分类限定</view> | |
95 | + </block> | |
96 | + </view> | |
97 | + <block wx:if="{{item.isPack!=null}}"> | |
98 | + <view class="top_card_counte">包邮券</view> | |
99 | + </block> | |
100 | + <block wx:else> | |
101 | + <view class="top_card_counte ">{{item.sum+"元券"}}</view> | |
102 | + <view class="top_card_remak ">{{"满"+item.buySum+"元可以用"}}</view> | |
103 | + </block> | |
104 | + </view> | |
105 | + </view> | |
106 | + </block> | |
107 | + <block wx:if="{{packShow}}"> | |
108 | + <view class="vips"> | |
109 | + <image class="lvip abs" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image> | |
110 | + <image class="rvip abs" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image> | |
111 | + </view> | |
112 | + </block> | |
113 | + </view> | |
159 | 114 | </view> |
160 | - <view class="foot_empty "></view> | |
161 | - <view class="foot_button"> | |
162 | - <view class="{{receiveState=='已领取'?'foot_button_notbuy':'foot_button_buy'}}" bindtap="GetReceive"> | |
163 | - <text>{{receiveState}}</text> | |
115 | + </block> | |
116 | + <block wx:if="{{packShow}}"> | |
117 | + <view> | |
118 | + <view class="top "> | |
119 | + <view class="top_box "> | |
120 | + <view class="top_box_text "> | |
121 | + <text>———</text> | |
122 | + </view> | |
123 | + <view class="top_box_text "> | |
124 | + <text>新人专享福利</text> | |
125 | + </view> | |
126 | + <view class="top_box_text "> | |
127 | + <text>———</text> | |
128 | + </view> | |
164 | 129 | </view> |
130 | + <block wx:if="{{integralShow}}"> | |
131 | + <view> | |
132 | + <view class="top_box_image "> | |
133 | + <image src="{{iurl+'/miniapp/images/giftbag/vip06.jpg'}}" lazy-load="true"></image> | |
134 | + <button>{{integralTitle}}</button> | |
135 | + </view> | |
136 | + </view> | |
137 | + </block> | |
138 | + <block wx:if="{{growUpShow}}"> | |
139 | + <view> | |
140 | + <view class="top_box_image fs36"> | |
141 | + <image src="{{iurl+'/miniapp/images/giftbag/vip07.jpg'}}" lazy-load="true"></image> | |
142 | + <button>{{growUpTitle}}</button> | |
143 | + </view> | |
144 | + </view> | |
145 | + </block> | |
146 | + </view> | |
147 | + </view> | |
148 | + </block> | |
149 | + <block wx:if="{{textShow}}"> | |
150 | + <view class="foot_box"> | |
151 | + <view class="foot_box_title fs36"> | |
152 | + <text>活动规则:</text> | |
153 | + </view> | |
154 | + <view class="foot_box_text"> | |
155 | + <rich-text nodes="{{textTitle}}" style="word-break:break-all;word-wrap:break-word"></rich-text> | |
156 | + </view> | |
157 | + </view> | |
158 | + </block> | |
159 | + <view class="button_box"> | |
160 | + <view> | |
161 | + <button class="button" bindtap="goto" data-url="/pages/index/index/index">进入商城购物</button> | |
162 | + </view> | |
163 | + <view class="button_text "> | |
164 | + <text>本活动最终解释权归公司所有,如果有问题请联系客服</text> | |
165 | + </view> | |
166 | + </view> | |
167 | + <view class="foot_empty "></view> | |
168 | + <view class="foot_button"> | |
169 | + <view class="{{receiveState=='已领取'?'foot_button_notbuy':'foot_button_buy'}}" bindtap="GetReceive"> | |
170 | + <text>{{receiveState}}</text> | |
165 | 171 | </view> |
172 | + </view> | |
166 | 173 | </view> |
167 | 174 | <!-- 引入提示组件 --> |
168 | 175 | <warn id="warn"></warn> | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.js
... | ... | @@ -33,8 +33,6 @@ Page({ |
33 | 33 | var th = this; |
34 | 34 | th.setData({ |
35 | 35 | isBuy: options.isBuy, |
36 | - getStorageID: a.stoid, | |
37 | - getUserID: d.user_id, | |
38 | 36 | getGiftID: options.lbId, |
39 | 37 | orderSn: options.orderSn |
40 | 38 | }) |
... | ... | @@ -43,9 +41,6 @@ Page({ |
43 | 41 | } else { |
44 | 42 | th.GetBuyGiftList(); |
45 | 43 | } |
46 | - th.setData({ | |
47 | - giftRemark: th.data.giftRemark.replace(/<p><img/gi, "<p class='img'><img") | |
48 | - }) | |
49 | 44 | th.close(); |
50 | 45 | }, |
51 | 46 | onShow: function() { |
... | ... | @@ -55,6 +50,7 @@ Page({ |
55 | 50 | var that = this.data; |
56 | 51 | var th = this; |
57 | 52 | // var id = e.currentTarget.dataset.id;//活动id |
53 | + var money = e.currentTarget.dataset.money; | |
58 | 54 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
59 | 55 | my_confirm.open( |
60 | 56 | "是否确定购买该礼包", |
... | ... | @@ -69,9 +65,9 @@ Page({ |
69 | 65 | "actId": '', //活动Id |
70 | 66 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
71 | 67 | "buyType": '2', //1=积分兑换 2=余额购买 |
72 | - "lbId": that.getGiftID, //礼包Id | |
73 | - "storeId": that.getStorageID, //商家Id | |
74 | - "userId": that.getUserID, //用户ID | |
68 | + "giftBagId": that.getGiftID, //礼包Id | |
69 | + "storeId": a.stoid, //商家Id | |
70 | + "userId": d.user_id, //用户ID | |
75 | 71 | "buyFrom": 2 |
76 | 72 | }; |
77 | 73 | var data = JSON.stringify(json); |
... | ... | @@ -85,18 +81,20 @@ Page({ |
85 | 81 | }, // 设置请求的 header |
86 | 82 | success: function(res) { |
87 | 83 | if (res.data.code == 0) { |
88 | - res = res.data.data; | |
84 | + var res = res.data.data; | |
85 | + var order_sn = res.orderSn; | |
86 | + var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; | |
89 | 87 | wx.requestPayment({ |
90 | - timeStamp: String(res.timeStamp), | |
91 | - nonceStr: res.nonceStr, | |
92 | - package: res.packageValue, | |
93 | - signType: res.signType, | |
94 | - paySign: res.paySign, | |
88 | + timeStamp: String(res.result.timeStamp), | |
89 | + nonceStr: res.result.nonceStr, | |
90 | + package: res.result.packageValue, | |
91 | + signType: res.result.signType, | |
92 | + paySign: res.result.paySign, | |
95 | 93 | success: function(n) { |
96 | - | |
94 | + getApp().goto(url); | |
97 | 95 | }, |
98 | 96 | fail: function(n) { |
99 | - | |
97 | + getApp().my_confirm("取消支付", 0, th); | |
100 | 98 | } |
101 | 99 | }); |
102 | 100 | } else { |
... | ... | @@ -130,9 +128,9 @@ Page({ |
130 | 128 | "actId": '', //活动Id |
131 | 129 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
132 | 130 | "buyType": '1', //1=积分兑换 2=余额购买 |
133 | - "lbId": that.getGiftID, //礼包Id | |
134 | - "storeId": that.getStorageID, //商家Id | |
135 | - "userId": that.getUserID //用户ID | |
131 | + "giftBagId": that.getGiftID, //礼包Id | |
132 | + "storeId": a.stoid, //商家ID | |
133 | + "userId": d.user_id, //用户ID | |
136 | 134 | }; |
137 | 135 | var data = JSON.stringify(json); |
138 | 136 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; |
... | ... | @@ -161,8 +159,8 @@ Page({ |
161 | 159 | var th = this; |
162 | 160 | getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { |
163 | 161 | data: { |
164 | - "storeId": th.data.getStorageID, //商家ID | |
165 | - "userId": th.data.getUserID, //用户ID | |
162 | + "storeId": a.stoid, //商家ID | |
163 | + "userId": d.user_id, //用户ID | |
166 | 164 | "orderSn": th.data.orderSn |
167 | 165 | }, |
168 | 166 | success: function success(res) { |
... | ... | @@ -177,7 +175,7 @@ Page({ |
177 | 175 | }) |
178 | 176 | } else { |
179 | 177 | th.setData({ |
180 | - giftRemark: res.data.data.giftRemark | |
178 | + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"') | |
181 | 179 | }) |
182 | 180 | } |
183 | 181 | |
... | ... | @@ -228,8 +226,8 @@ Page({ |
228 | 226 | var th = this.data; |
229 | 227 | getApp().request.get('/api/weshop/marketing/giftbag/detail/get', { |
230 | 228 | data: { |
231 | - "storeId": th.getStorageID, //商家ID | |
232 | - "userId": th.getUserID, //用户ID | |
229 | + "storeId": a.stoid, //商家ID | |
230 | + "userId": d.user_id, //用户ID | |
233 | 231 | "giftBagId": th.getGiftID |
234 | 232 | }, |
235 | 233 | success: function success(res) { |
... | ... | @@ -239,13 +237,12 @@ Page({ |
239 | 237 | giftTitle: res.data.data.giftTitle |
240 | 238 | }) |
241 | 239 | if (res.data.data.giftRemark == '') { |
242 | - | |
243 | 240 | _this2.setData({ |
244 | 241 | giftRemark: '暂无详情......' |
245 | 242 | }) |
246 | 243 | } else { |
247 | 244 | _this2.setData({ |
248 | - giftRemark: res.data.data.giftRemark | |
245 | + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"') | |
249 | 246 | }) |
250 | 247 | } |
251 | 248 | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.wxml
... | ... | @@ -95,14 +95,14 @@ |
95 | 95 | <text class="data-v-3a5b7e36">活动说明</text> |
96 | 96 | </view> |
97 | 97 | <view class="foot_box_remark data-v-3a5b7e36"> |
98 | - <rich-text nodes="{{giftRemark}}"></rich-text> | |
98 | + <rich-text nodes="{{giftRemark}}" style="word-break:break-all;word-wrap:break-word"></rich-text> | |
99 | 99 | </view> |
100 | 100 | </view> |
101 | 101 | <view class="foot_empty data-v-3a5b7e36"></view> |
102 | 102 | <block wx:if="{{isBuy==1}}"> |
103 | 103 | <view class="foot_button data-v-3a5b7e36"> |
104 | 104 | <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> |
105 | - <view class="foot_button_left data-v-3a5b7e36" data-id="{{lbId}}" bindtap="GetBuyPrice"> | |
105 | + <view class="foot_button_left data-v-3a5b7e36" data-money="{{giftPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice"> | |
106 | 106 | <text class="data-v-3a5b7e36">立即购买</text> |
107 | 107 | </view> |
108 | 108 | </block> |
... | ... | @@ -112,7 +112,7 @@ |
112 | 112 | </view> |
113 | 113 | </block> |
114 | 114 | <block wx:if="{{giftPrice>0 && giftIntegral<=0}}"> |
115 | - <view class="foot_button_buy data-v-3a5b7e36" bindtap="GetBuyPrice" data-id="{{lbId}}"> | |
115 | + <view class="foot_button_buy data-v-3a5b7e36" data-money="{{giftPrice}}" bindtap="GetBuyPrice" data-id="{{lbId}}"> | |
116 | 116 | <text class="data-v-3a5b7e36">立即购买</text> |
117 | 117 | </view> |
118 | 118 | </block> | ... | ... |
pages/user/assistance/assistance.js
... | ... | @@ -6,7 +6,7 @@ var t = getApp(), |
6 | 6 | ut = i, |
7 | 7 | s = require("../../../utils/common.js"); |
8 | 8 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
9 | -var oo = t.globalData.setting; | |
9 | +var oo = t.globalData.setting,os=oo, ut= require("../../../utils/util.js"); | |
10 | 10 | Page({ |
11 | 11 | |
12 | 12 | /** |
... | ... | @@ -24,6 +24,7 @@ Page({ |
24 | 24 | is_show_more: 0, //是否加载更多 |
25 | 25 | help_id:"",//助力活动的id |
26 | 26 | timer:"",//任务列表的定时器 |
27 | + s_num:"",//多少人已经领取任务 | |
27 | 28 | |
28 | 29 | }, |
29 | 30 | |
... | ... | @@ -50,29 +51,36 @@ Page({ |
50 | 51 | |
51 | 52 | }, |
52 | 53 | // 助力活动 |
53 | - async assistance() { | |
54 | + assistance() { | |
54 | 55 | var th=this; |
55 | 56 | var user_id = getApp().globalData.user_id; |
56 | 57 | var store_id = os.stoid; |
57 | 58 | |
58 | - await getApp().request.promiseGet("/api/weshop/marketing/help/act/judge", { | |
59 | + getApp().request.promiseGet("/api/weshop/marketing/help/act/judge", { | |
59 | 60 | data: { |
60 | 61 | storeId: store_id, |
61 | 62 | userId: user_id |
62 | 63 | } |
63 | 64 | }).then(res => { |
64 | 65 | if (res.data.code == 0) { |
65 | - | |
66 | + | |
66 | 67 | var help_data=res.data.data; |
67 | 68 | console.log(help_data.id,'数据', res.data.data); |
68 | - th.setData({ | |
69 | - zl_act:help_data, | |
70 | - help_id:help_data.id | |
71 | - }); | |
69 | + th.setData({ zl_act:help_data, help_id:help_data.id }); | |
70 | + return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { | |
71 | + data: { | |
72 | + helpId: help_data.id, storeId: store_id | |
73 | + } | |
74 | + }) | |
72 | 75 | |
73 | 76 | } |
74 | - }) | |
75 | - | |
77 | + return ut.null_promise(); | |
78 | + }).then(res=>{ | |
79 | + if(res.data.code==0) | |
80 | + th.setData({s_num:res.data.data.countAll}) | |
81 | + }) | |
82 | + | |
83 | + | |
76 | 84 | }, |
77 | 85 | |
78 | 86 | //--点击获取用户任务列表--会员的任务列表 | ... | ... |
pages/user/assistance/assistance.wxml
... | ... | @@ -76,10 +76,10 @@ |
76 | 76 | <view class="flex-center nothing" wx:if="{{is_load && zl_user_list.length==0}}"> |
77 | 77 | <view>暂无任务记录</view> |
78 | 78 | </view> |
79 | - <view class="flex-center receive"> | |
79 | + <view class="flex-center receive" wx:if="{{is_load && s_num}}"> | |
80 | 80 | <view class="flex-center"> |
81 | 81 | <view>已有</view> |
82 | - <view>{{zl_act.countAll}}</view> | |
82 | + <view>{{s_num}}</view> | |
83 | 83 | <view>人领取了任务</view> |
84 | 84 | </view> |
85 | 85 | ... | ... |
pages/user/assistance/assistance_success.js
1 | 1 | var auth = require("../../../utils/auth.js"), rq = require("../../../utils/request.js"); |
2 | 2 | var e = getApp(), app = e, s = e.globalData.setting, os = s, app_d = e.globalData; |
3 | 3 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
4 | +var ut = require("../../../utils/util.js"); | |
4 | 5 | Page({ |
5 | 6 | |
6 | 7 | /** |
... | ... | @@ -10,50 +11,53 @@ Page({ |
10 | 11 | iurl: s.imghost, |
11 | 12 | user:app_d.userInfo, |
12 | 13 | zl_act:null, //助力活动 |
14 | + s_num:0, //分享的人数 | |
13 | 15 | }, |
14 | 16 | |
15 | 17 | /** |
16 | 18 | * 生命周期函数--监听页面加载 |
17 | 19 | */ |
18 | 20 | onLoad: function (options) { |
19 | - | |
20 | - }, | |
21 | - | |
22 | - /** | |
23 | - * 生命周期函数--监听页面初次渲染完成 | |
24 | - */ | |
25 | - onReady: function () { | |
26 | - | |
21 | + //var helpid=options.helpid; | |
22 | + var helpid=23; | |
23 | + this.init(helpid); | |
27 | 24 | }, |
28 | - | |
29 | 25 | /** |
30 | 26 | * 生命周期函数--监听页面显示 |
31 | 27 | */ |
32 | - onShow: function () { | |
33 | - this.init(); | |
28 | + onShow: function (e) { | |
29 | + | |
34 | 30 | }, |
35 | 31 | |
36 | 32 | // ----初始化---- |
37 | - init:function() { | |
38 | - | |
33 | + init:function(helpid) { | |
39 | 34 | var user_id = getApp().globalData.user_id; |
40 | 35 | var store_id = os.stoid; |
41 | 36 | var th=this; |
42 | - getApp().request.promiseGet("http://172.20.3.102:8022/api/weshop/zl_act", { | |
37 | + | |
38 | + //链式调用接口,先获取活动,在获取参与活动的人数 | |
39 | + getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { | |
43 | 40 | data: { |
44 | - user_id: user_id, | |
45 | - store_id: store_id | |
41 | + storeId: store_id, | |
42 | + helpId: helpid | |
46 | 43 | } |
47 | 44 | }).then(res => { |
48 | - if(res.data.code==0) th.setData({zl_act:res.data.data}) | |
49 | - }) | |
50 | - | |
51 | - }, | |
52 | - | |
53 | - /** | |
54 | - * 生命周期函数--监听页面隐藏 | |
55 | - */ | |
56 | - onHide: function () { | |
45 | + if(res.data.code==0){ | |
46 | + th.setData({zl_act:res.data.data}); | |
47 | + return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { | |
48 | + data: { | |
49 | + storeId: store_id, | |
50 | + helpId: helpid | |
51 | + } | |
52 | + }) | |
53 | + } | |
54 | + return ut.null_promise(); | |
55 | + | |
56 | + }).then(res=>{ | |
57 | + if(res.data.code==0){ | |
58 | + th.setData({s_num:res.data.data.countAll}); | |
59 | + } | |
60 | + }) | |
57 | 61 | |
58 | 62 | }, |
59 | 63 | |
... | ... | @@ -65,10 +69,7 @@ Page({ |
65 | 69 | |
66 | 70 | }, |
67 | 71 | |
68 | - /** | |
69 | - * 用户点击右上角分享 | |
70 | - */ | |
71 | - onShareAppMessage: function () { | |
72 | - | |
72 | + cklie_button:function(){ | |
73 | + getApp().goto("/pages/user/assistance/assistance") | |
73 | 74 | } |
74 | 75 | }) |
75 | 76 | \ No newline at end of file | ... | ... |
pages/user/assistance/assistance_success.wxml
1 | - | |
1 | +<wxs module="filter" src="c_filter.wxs"></wxs> | |
2 | 2 | <view class="top-back" style="background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)"> |
3 | 3 | <view class="flex-vertical user_assis"> |
4 | 4 | <image class="circle user_img" src="{{user.head_pic}}"></image> |
... | ... | @@ -17,7 +17,7 @@ |
17 | 17 | </view> |
18 | 18 | </view> |
19 | 19 | <view class="cklie_button t-c flex-center" bindtap="cklie_button">我也要参加</view> |
20 | -<view class="fs26 white t-c">已有{{zl_act.qiang_num}}人领取礼盒</view> | |
20 | +<view class="fs26 white t-c" wx:if="{{s_num}}">已有{{s_num}}人领取礼盒</view> | |
21 | 21 | |
22 | 22 | <!-- 引入提示组件 --> |
23 | 23 | <warn id="warn"></warn> | ... | ... |
pages/user/assistance/friend_assistance.js
1 | -var auth = require("../../../utils/auth.js"), rq = require("../../../utils/request.js"); | |
2 | -var e = getApp(), app = e, s = e.globalData.setting, os = s, app_d = e.globalData; | |
1 | +var auth = require("../../../utils/auth.js"), | |
2 | + rq = require("../../../utils/request.js"); | |
3 | +var e = getApp(), | |
4 | + app = e, | |
5 | + s = e.globalData.setting, | |
6 | + os = s, | |
7 | + app_d = e.globalData; | |
3 | 8 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
9 | +var ut = require("../../../utils/util.js"); | |
10 | + | |
4 | 11 | Page({ |
12 | + /** | |
13 | + * 页面的初始数据 | |
14 | + */ | |
15 | + data: { | |
16 | + iurl: s.imghost, | |
17 | + is_show: 0, //显示弹框 | |
18 | + user: app_d.userInfo, | |
19 | + zl_act: null, //助力活动 | |
20 | + tasking: 0, //助力任务ID | |
21 | + userId: 0, //任务用户的ID | |
22 | + s_num: 0, //分享的人数 | |
23 | + taskId:0, //活动从表ID | |
24 | + }, | |
5 | 25 | |
6 | - /** | |
7 | - * 页面的初始数据 | |
8 | - */ | |
9 | - data: { | |
10 | - iurl: s.imghost, | |
11 | - is_show:0,//显示弹框 | |
12 | - user:app_d.userInfo, | |
13 | - zl_act:null, //助力活动 | |
14 | - task_id:0, //助力任务ID | |
15 | - userId:0, //任务用户的ID | |
16 | - }, | |
26 | + /** | |
27 | + * 生命周期函数--监听页面加载 | |
28 | + */ | |
29 | + onLoad: function(options) { | |
30 | + var th = this; | |
31 | + if (options.tasking) this.data.tasking = options.tasking; | |
32 | + if (options.userId) this.data.userId = options.userId; | |
33 | + //任务是不是为空 | |
34 | + if (this.data.tasking == 0 || this.data.tasking == undefined) { | |
35 | + //this.data.task_id = decodeURIComponent(options.scene); | |
36 | + this.data.tasking =1; | |
37 | + if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking != | |
38 | + 0) { | |
39 | + getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", { | |
40 | + data: { | |
41 | + id: th.data.tasking, | |
42 | + storeId: os.stoid | |
43 | + } | |
44 | + }).then(res => { | |
45 | + if (res.data.code == 0) { | |
46 | + th.data.userId = res.data.data.userId; | |
47 | + th.data.taskId = res.data.data.taskId; | |
48 | + //获取活动的时间 | |
49 | + return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { | |
50 | + data: { | |
51 | + helpId: res.data.data.helpFormId, | |
52 | + storeId: os.stoid | |
53 | + } | |
54 | + }) | |
55 | + } | |
56 | + return ut.null_promise(); | |
57 | + }).then(res => { | |
58 | + if (res.data.code == 0) { | |
59 | + th.setData({ | |
60 | + zl_act: res.data.data | |
61 | + }) | |
62 | + //获取活动的参与的人数 | |
63 | + return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { | |
64 | + data: { | |
65 | + helpId: res.data.data.id, | |
66 | + storeId: os.stoid | |
67 | + } | |
68 | + }) | |
69 | + } | |
70 | + return ut.null_promise(); | |
71 | + }).then(res => { | |
72 | + if (res.data.code == 0) { | |
73 | + th.setData({ | |
74 | + s_num: res.data.data.countAll | |
75 | + }); | |
76 | + } | |
77 | + }) | |
17 | 78 | |
18 | - /** | |
19 | - * 生命周期函数--监听页面加载 | |
20 | - */ | |
21 | - onLoad: function (options) { | |
22 | - var th=this; | |
23 | - if(options.task_id) this.data.task_id=options.task_id; | |
24 | - if(options.userId) this.data.userId=options.userId; | |
25 | - //任务是不是为空 | |
26 | - if(this.data.task_id==0 || this.data.task_id==undefined){ | |
27 | - this.data.task_id= decodeURIComponent(options.scene); | |
28 | - if(this.data.task_id!=null && this.data.task_id!='undefined' && this.data.task_id!="" && this.data.task_id!=0){ | |
29 | - getApp().request.get("http://172.20.3.102:8022/api/weshop/zl_act_user",{ | |
30 | - data:{}, | |
31 | - success:function(res){ | |
32 | - if(res.data.code==0){ | |
33 | - th.data.userId=res.data.data.user_id; | |
34 | - } | |
35 | - } | |
36 | - }) | |
37 | - | |
38 | - } | |
39 | - } | |
40 | - }, | |
79 | + } | |
80 | + } | |
81 | + }, | |
41 | 82 | |
42 | 83 | |
43 | - // 跳转到助力成功页 | |
44 | - participate_activity:function(){ | |
45 | - wx.navigateTo({ | |
46 | - url: '/pages/user/assistance/assistance_success', | |
47 | - }) | |
48 | - }, | |
49 | - | |
50 | - /** | |
51 | - * 生命周期函数--监听页面显示 | |
52 | - */ | |
53 | - onShow: function () { | |
54 | - this.init(); | |
55 | - }, | |
56 | - //点击开启礼盒 | |
57 | - cklie_button:function(){ | |
58 | - var th=this; | |
59 | - var t_user_id=app_d.user_id; | |
60 | - var data={id:this.data.task_id,storeId:os.stoid,userId:this.data.user_id, zlUserId:t_user_id}; | |
61 | - console.log(data); | |
62 | - getApp().request.json_post("/api/weshop/marketing/help/help/task/involve/insert", | |
63 | - data, //入参 | |
64 | - function(res){ //成功 | |
65 | - if(res.data.code==0) | |
66 | - this.setData({ is_show:1}); | |
67 | - else{ | |
68 | - getApp().my_warnning(res.data.msg,0,th) | |
69 | - } | |
70 | - }, | |
71 | - function(){//失败 | |
72 | - | |
73 | - } | |
74 | - ) | |
75 | - | |
76 | - | |
77 | - | |
78 | - }, | |
79 | - //点击关闭礼盒 | |
80 | - clike_none:function(){ | |
81 | - this.setData({ is_show:0}); | |
82 | - }, | |
83 | - //导航球 | |
84 | - close: function () { | |
85 | - var th = this; | |
86 | - var nav_b = th.selectComponent("#nav_b"); //组件的id | |
87 | - nav_b.close_box(); | |
88 | - nav_b.set_name("助力", ""); | |
89 | - }, | |
90 | - /** | |
91 | - * 生命周期函数--监听页面隐藏 | |
92 | - */ | |
93 | - onHide: function () { | |
84 | + // 跳转到助力成功页 | |
85 | + participate_activity: function() { | |
86 | + wx.navigateTo({ | |
87 | + url: '/pages/user/assistance/assistance_success', | |
88 | + }) | |
89 | + }, | |
94 | 90 | |
95 | - }, | |
91 | + /** | |
92 | + * 生命周期函数--监听页面显示 | |
93 | + */ | |
94 | + onShow: function() { | |
96 | 95 | |
97 | - /** | |
98 | - * 生命周期函数--监听页面卸载 | |
99 | - */ | |
100 | - onUnload: function () { | |
96 | + }, | |
97 | + //点击开启礼盒 | |
98 | + cklie_button: function() { | |
99 | + var th = this; | |
100 | + var t_user_id = app_d.user_id; | |
101 | + var data = { | |
102 | + id: this.data.tasking, | |
103 | + storeId: os.stoid, | |
104 | + userId: this.data.userId, | |
105 | + zlUserId: t_user_id | |
106 | + }; | |
107 | + console.log(data); | |
108 | + getApp().request.json_post("/api/weshop/marketing/help/help/task/involve/insert", | |
109 | + data, //入参 | |
110 | + function(res) { //成功 | |
111 | + if (res.data.code == 0) | |
112 | + th.setData({ | |
113 | + is_show: 1 | |
114 | + }); | |
115 | + else { | |
116 | + getApp().my_warnning(res.data.msg, 0, th) | |
117 | + } | |
118 | + }, | |
119 | + function() { //失败 | |
101 | 120 | |
102 | - }, | |
121 | + } | |
122 | + ) | |
103 | 123 | |
104 | - /** | |
105 | - * 页面相关事件处理函数--监听用户下拉动作 | |
106 | - */ | |
107 | - onPullDownRefresh: function () { | |
124 | + }, | |
125 | + //点击关闭礼盒 | |
126 | + clike_none: function() { | |
127 | + this.setData({is_show: 0}); | |
128 | + getApp().goto("/pages/user/assistance/assistance_success"); | |
129 | + }, | |
130 | + //导航球 | |
131 | + close: function() { | |
132 | + var th = this; | |
133 | + var nav_b = th.selectComponent("#nav_b"); //组件的id | |
134 | + nav_b.close_box(); | |
135 | + nav_b.set_name("助力", ""); | |
136 | + }, | |
108 | 137 | |
109 | - }, | |
138 | + /** | |
139 | + * 页面上拉触底事件的处理函数 | |
140 | + */ | |
141 | + onReachBottom: function() { | |
110 | 142 | |
111 | - /** | |
112 | - * 页面上拉触底事件的处理函数 | |
113 | - */ | |
114 | - onReachBottom: function () { | |
143 | + }, | |
115 | 144 | |
116 | - }, | |
145 | + /** | |
146 | + * 用户点击右上角分享 | |
147 | + */ | |
148 | + onShareAppMessage: function() { | |
117 | 149 | |
118 | - /** | |
119 | - * 用户点击右上角分享 | |
120 | - */ | |
121 | - onShareAppMessage: function () { | |
150 | + }, | |
122 | 151 | |
123 | - }, | |
124 | - | |
125 | - // ----初始化---- | |
126 | - init:function() { | |
127 | - | |
128 | - var user_id = getApp().globalData.user_id; | |
129 | - var store_id = os.stoid; | |
130 | - var th=this; | |
131 | - getApp().request.promiseGet("http://172.20.3.102:8022/api/weshop/zl_act", { | |
132 | - data: { | |
133 | - user_id: user_id, | |
134 | - store_id: store_id | |
135 | - } | |
136 | - }).then(res => { | |
137 | - if(res.data.code==0) th.setData({zl_act:res.data.data}) | |
138 | - }) | |
139 | - | |
140 | - }, | |
141 | -}) | |
142 | 152 | \ No newline at end of file |
153 | +}) | ... | ... |
pages/user/assistance/friend_assistance.wxml
... | ... | @@ -14,12 +14,12 @@ |
14 | 14 | </view> |
15 | 15 | <view class="flex jc-center"> |
16 | 16 | <view class="activity_time fs24 white"> |
17 | - 活动时间:{{filter.fm_time(zl_act.begindate)}}-{{filter.fm_time(zl_act.begindate)}} | |
17 | + 活动时间:{{filter.fm_time(zl_act.beginDate)}}-{{filter.fm_time(zl_act.beginDate)}} | |
18 | 18 | </view> |
19 | 19 | </view> |
20 | 20 | </view> |
21 | 21 | <view class="cklie_button t-c flex-center" bindtap="cklie_button">帮他拆礼盒</view> |
22 | -<view class="fs26 white t-c">已有{{zl_act.qiang_num}}人领取礼盒</view> | |
22 | +<view class="fs26 white t-c" wx:if="{{s_num}}">已有{{s_num}}人领取礼盒</view> | |
23 | 23 | <!-- 礼盒弹框 --> |
24 | 24 | <view class="cover-layer" wx:if='{{is_show!=0}}' bindtap="clike_none"></view> |
25 | 25 | <view class="libao_frame t-c" wx:if='{{is_show!=0}}'> | ... | ... |
pages/user/assistance/giftpacklist.js
0 → 100644
1 | +var e = getApp(), | |
2 | + a = e.globalData.setting, | |
3 | + os = a, | |
4 | + t = e.request, | |
5 | + d = e.globalData; | |
6 | +var ut = require("../../../utils/util.js"); | |
7 | + | |
8 | +Page({ | |
9 | + data: { | |
10 | + url: a.url, //接口网址 | |
11 | + iurl: a.imghost, //图片前缀网址 | |
12 | + isBuy: 0, | |
13 | + getGiftID: '', //礼包id | |
14 | + giftImage: '', | |
15 | + giftTitle: '', | |
16 | + giftDate: '', | |
17 | + giftPrice: '', | |
18 | + giftIntegral: '', | |
19 | + giftPosPrice: '', | |
20 | + giftQty: '', | |
21 | + giftRemark: '', | |
22 | + giftType: '', | |
23 | + actTitle: '', | |
24 | + getUrl: '', | |
25 | + wareCard: [], | |
26 | + orderSn: "", //订单编号 | |
27 | + lbId: "", | |
28 | + code: "", //核销码 | |
29 | + c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期 | |
30 | + is_lb: 0, //是否有礼包 | |
31 | + }, | |
32 | + onLoad: function (options) { | |
33 | + var th = this; | |
34 | + th.setData({ | |
35 | + isBuy: options.isBuy, | |
36 | + getStorageID: a.stoid, | |
37 | + getUserID: d.user_id, | |
38 | + getGiftID: options.lbId, | |
39 | + orderSn: options.orderSn | |
40 | + }) | |
41 | + if (options.isBuy == 0) { | |
42 | + th.GetMyGiftList(); | |
43 | + } else { | |
44 | + th.GetBuyGiftList(); | |
45 | + } | |
46 | + th.setData({ | |
47 | + giftRemark: th.data.giftRemark.replace(/<p><img/gi, "<p class='img'><img") | |
48 | + }) | |
49 | + th.close(); | |
50 | + }, | |
51 | + onShow: function () { | |
52 | + | |
53 | + }, | |
54 | + GetBuyPrice: function (e) { | |
55 | + var that = this.data; | |
56 | + var th = this; | |
57 | + // var id = e.currentTarget.dataset.id;//活动id | |
58 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | |
59 | + my_confirm.open( | |
60 | + "是否确定购买该礼包", | |
61 | + "取消", | |
62 | + "确定", | |
63 | + function () { | |
64 | + my_confirm.open_cancel(0); | |
65 | + }, | |
66 | + function () { | |
67 | + my_confirm.open_cancel(0); | |
68 | + var json = { | |
69 | + "actId": '', //活动Id | |
70 | + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | |
71 | + "buyType": '2', //1=积分兑换 2=余额购买 | |
72 | + "lbId": that.getGiftID, //礼包Id | |
73 | + "storeId": that.getStorageID, //商家Id | |
74 | + "userId": that.getUserID, //用户ID | |
75 | + "buyFrom": 2 | |
76 | + }; | |
77 | + var data = JSON.stringify(json); | |
78 | + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | |
79 | + wx.request({ | |
80 | + url: url, | |
81 | + data: data, | |
82 | + method: 'post', | |
83 | + header: { | |
84 | + 'content-type': 'application/json' | |
85 | + }, // 设置请求的 header | |
86 | + success: function (res) { | |
87 | + if (res.data.code == 0) { | |
88 | + res = res.data.data; | |
89 | + wx.requestPayment({ | |
90 | + timeStamp: String(res.timeStamp), | |
91 | + nonceStr: res.nonceStr, | |
92 | + package: res.packageValue, | |
93 | + signType: res.signType, | |
94 | + paySign: res.paySign, | |
95 | + success: function (n) { | |
96 | + | |
97 | + }, | |
98 | + fail: function (n) { | |
99 | + | |
100 | + } | |
101 | + }); | |
102 | + } else { | |
103 | + getApp().my_warnning(res.data.msg, 0, th); | |
104 | + } | |
105 | + } | |
106 | + }) | |
107 | + | |
108 | + } | |
109 | + | |
110 | + | |
111 | + ) | |
112 | + | |
113 | + | |
114 | + }, | |
115 | + GetBuyIntegral: function (e) { | |
116 | + var that = this.data; | |
117 | + var th = this; | |
118 | + // var id = e.currentTarget.dataset.id;//活动id | |
119 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | |
120 | + my_confirm.open( | |
121 | + "是否确定兑换该礼包", | |
122 | + "取消", | |
123 | + "确定", | |
124 | + function () { | |
125 | + my_confirm.open_cancel(0); | |
126 | + }, | |
127 | + function () { | |
128 | + my_confirm.open_cancel(0); | |
129 | + var json = { | |
130 | + "actId": '', //活动Id | |
131 | + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | |
132 | + "buyType": '1', //1=积分兑换 2=余额购买 | |
133 | + "lbId": that.getGiftID, //礼包Id | |
134 | + "storeId": that.getStorageID, //商家Id | |
135 | + "userId": that.getUserID //用户ID | |
136 | + }; | |
137 | + var data = JSON.stringify(json); | |
138 | + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | |
139 | + wx.request({ | |
140 | + url: url, | |
141 | + data: data, | |
142 | + method: 'post', | |
143 | + header: { | |
144 | + 'content-type': 'application/json' | |
145 | + }, // 设置请求的 header | |
146 | + success: function (res) { | |
147 | + if (res.data.code == 0) { | |
148 | + getApp().my_warnning("兑换成功!", 1, th); | |
149 | + } else { | |
150 | + getApp().my_warnning(res.data.msg, 0, th); | |
151 | + } | |
152 | + } | |
153 | + }) | |
154 | + | |
155 | + }) | |
156 | + | |
157 | + | |
158 | + }, | |
159 | + GetMyGiftList: function () { | |
160 | + var _this = this; | |
161 | + var th = this; | |
162 | + getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { | |
163 | + data: { | |
164 | + "storeId": th.data.getStorageID, //商家ID | |
165 | + "userId": th.data.getUserID, //用户ID | |
166 | + "orderSn": th.data.orderSn | |
167 | + }, | |
168 | + success: function success(res) { | |
169 | + if (res.data.code == 0) { | |
170 | + th.setData({ | |
171 | + giftImage: th.data.iurl + res.data.data.lbUrl, | |
172 | + giftTitle: res.data.data.giftTitle | |
173 | + }) | |
174 | + if (res.data.data.giftRemark == '') { | |
175 | + th.setData({ | |
176 | + giftRemark: '暂无详情......' | |
177 | + }) | |
178 | + } else { | |
179 | + th.setData({ | |
180 | + giftRemark: res.data.data.giftRemark | |
181 | + }) | |
182 | + } | |
183 | + | |
184 | + //---获取日期的时间戳--- | |
185 | + var t_endtime = res.data.data.endTime; | |
186 | + t_endtime = t_endtime.replace(/-/g, '/'); | |
187 | + var t_date = new Date(t_endtime) / 1000; | |
188 | + var t_now = ut.gettimestamp(); | |
189 | + | |
190 | + if (res.data.data.goodsUseState) th.setData({ | |
191 | + c_state: 1 | |
192 | + }) | |
193 | + else if (t_date <= t_now) | |
194 | + th.setData({ | |
195 | + c_state: 2 | |
196 | + }) | |
197 | + | |
198 | + th.setData({ | |
199 | + giftDate: res.data.data.endTime, | |
200 | + giftPosPrice: res.data.data.giftPosPrice, | |
201 | + giftQty: res.data.data.giftQty, | |
202 | + giftIntegral: res.data.data.payIntegral, | |
203 | + giftPrice: res.data.data.payMoney, | |
204 | + giftType: res.data.data.actType, | |
205 | + actTitle: res.data.data.actTitle, | |
206 | + wareCard: res.data.data.wareCard, | |
207 | + lbId: res.data.data.lbId | |
208 | + }) | |
209 | + //判断是否有礼包 | |
210 | + for (var i = 0; i < res.data.data.wareCard.length; i++) { | |
211 | + if (res.data.data.wareCard[i].lbType == 1) { | |
212 | + th.setData({ | |
213 | + is_lb: 1 | |
214 | + }) | |
215 | + break; | |
216 | + } | |
217 | + } | |
218 | + } else { | |
219 | + getApp().my_warnning("系统繁忙,请稍后再试", 0, th); | |
220 | + return false; | |
221 | + } | |
222 | + } | |
223 | + }); | |
224 | + | |
225 | + }, | |
226 | + GetBuyGiftList: function () { | |
227 | + var _this2 = this; | |
228 | + var th = this.data; | |
229 | + getApp().request.get('/api/weshop/marketing/giftbag/detail/get', { | |
230 | + data: { | |
231 | + "storeId": th.getStorageID, //商家ID | |
232 | + "userId": th.getUserID, //用户ID | |
233 | + "giftBagId": th.getGiftID | |
234 | + }, | |
235 | + success: function success(res) { | |
236 | + if (res.data.code == 0) { | |
237 | + _this2.setData({ | |
238 | + giftImage: th.iurl + res.data.data.lbUrl, | |
239 | + giftTitle: res.data.data.giftTitle | |
240 | + }) | |
241 | + if (res.data.data.giftRemark == '') { | |
242 | + | |
243 | + _this2.setData({ | |
244 | + giftRemark: '暂无详情......' | |
245 | + }) | |
246 | + } else { | |
247 | + _this2.setData({ | |
248 | + giftRemark: res.data.data.giftRemark | |
249 | + }) | |
250 | + } | |
251 | + | |
252 | + _this2.setData({ | |
253 | + giftDate: res.data.data.endTime, | |
254 | + giftPosPrice: res.data.data.giftPosPrice, | |
255 | + giftQty: res.data.data.giftQty, | |
256 | + giftIntegral: res.data.data.payIntegral, | |
257 | + giftPrice: res.data.data.payMoney, | |
258 | + giftType: res.data.data.actType, | |
259 | + actTitle: res.data.data.actTitle, | |
260 | + wareCard: res.data.data.wareCard | |
261 | + }) | |
262 | + } else { | |
263 | + getApp().my_warnning("系统繁忙,请稍后再试", 0, _this2); | |
264 | + return false; | |
265 | + } | |
266 | + } | |
267 | + }); | |
268 | + | |
269 | + }, | |
270 | + //显示核销码 | |
271 | + code_show: function (e) { | |
272 | + var th = this; | |
273 | + //--获取成功的时候-- | |
274 | + var no = th.data.code; | |
275 | + var qc_com = th.selectComponent("#qc_com"); //组件的id | |
276 | + var obj = { | |
277 | + val: no, | |
278 | + content: "请将二维码展示给核销员,收货更快捷" | |
279 | + }; | |
280 | + qc_com.open(obj) | |
281 | + }, | |
282 | + //获取核销码 | |
283 | + getcode: function () { | |
284 | + var th = this; | |
285 | + var orderSn = th.data.orderSn; //订单号 | |
286 | + var json = { | |
287 | + "storeId": a.stoid, | |
288 | + "orderSn": orderSn | |
289 | + }; | |
290 | + var data = JSON.stringify(json); | |
291 | + var url = th.data.url + "/api/weshop/marketing/gift/goods/verify/code/get"; //预约接口地址 | |
292 | + wx.request({ | |
293 | + url: url, | |
294 | + data: data, | |
295 | + method: 'put', | |
296 | + header: { | |
297 | + 'content-type': 'application/json' | |
298 | + }, // 设置请求的 header | |
299 | + success: function (res) { | |
300 | + if (res.data.code == 0) { | |
301 | + th.setData({ | |
302 | + code: res.data.data | |
303 | + }) | |
304 | + th.code_show(); | |
305 | + } else { | |
306 | + getApp().my_warnning(res.data.msg, 0, th); | |
307 | + } | |
308 | + } | |
309 | + }) | |
310 | + }, | |
311 | + //界面跳转 | |
312 | + goto: function (e) { | |
313 | + var th = this; | |
314 | + var url = e.currentTarget.dataset.url; | |
315 | + getApp().goto(url); | |
316 | + }, | |
317 | + //图片失败,默认图片 | |
318 | + bind_bnerr2: function (e) { | |
319 | + var _errImg = e.target.dataset.errorimg; | |
320 | + var _errObj = {}; | |
321 | + _errObj[_errImg] = "/public/images/empty.jpg"; | |
322 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
323 | + | |
324 | + }, | |
325 | + //关闭导航 | |
326 | + close: function () { | |
327 | + var th = this; | |
328 | + var nav_b = th.selectComponent("#nav_b"); //组件的id | |
329 | + nav_b.close_box(); | |
330 | + nav_b.set_name("礼包", "/pages/giftpack/buygiftpack/giftpackbuy"); | |
331 | + } | |
332 | +}); | |
0 | 333 | \ No newline at end of file | ... | ... |
pages/user/assistance/giftpacklist.json
0 → 100644
1 | +{ | |
2 | + "navigationBarTitleText": "助力详情", | |
3 | + "usingComponents": { | |
4 | + "warn": "/components/long_warn/long_warn", | |
5 | + "my_confirm": "/components/my_confirm/my_confirm", | |
6 | + "qr_code": "/components/qr_code/qr_code", | |
7 | + "nav_b": "/components/nav_b/nav_b" | |
8 | + } | |
9 | +} | |
0 | 10 | \ No newline at end of file | ... | ... |
pages/user/assistance/giftpacklist.wxml
0 → 100644
1 | +<view class="box data-v-3a5b7e36"> | |
2 | + <view class="box_top data-v-3a5b7e36"> | |
3 | + <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="giftImage"></image> | |
4 | + </view> | |
5 | + <view class="box_title data-v-3a5b7e36"> | |
6 | + <view class="top_title data-v-3a5b7e36"> | |
7 | + <text class="data-v-3a5b7e36 ellipsis-2">{{giftTitle}}</text> | |
8 | + </view> | |
9 | + <view class="top_time data-v-3a5b7e36"> | |
10 | + <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text> | |
11 | + </view> | |
12 | + <view class="top_price data-v-3a5b7e36"> | |
13 | + <block wx:if="{{giftPrice>0}}"> | |
14 | + <text class="data-v-3a5b7e36">{{"¥"+giftPrice}}</text> | |
15 | + </block> | |
16 | + <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> | |
17 | + <text class="data-v-3a5b7e36">/</text> | |
18 | + </block> | |
19 | + <block wx:if="{{giftIntegral>0}}"> | |
20 | + <text class="data-v-3a5b7e36">{{giftIntegral+"积分"}}</text> | |
21 | + </block> | |
22 | + <block wx:if="{{giftType>0}}"> | |
23 | + <text class="data-v-3a5b7e36">{{actTitle}}</text> | |
24 | + </block> | |
25 | + </view> | |
26 | + <view class="top_foot data-v-3a5b7e36"> | |
27 | + <view class="top_foot_price data-v-3a5b7e36"> | |
28 | + <text class="data-v-3a5b7e36">{{"原价:"+giftPosPrice+"元"}}</text> | |
29 | + </view> | |
30 | + <view class="top_foot_qty data-v-3a5b7e36"> | |
31 | + <text class="data-v-3a5b7e36">{{"已售:"+giftQty+"件"}}</text> | |
32 | + </view> | |
33 | + </view> | |
34 | + </view> | |
35 | + <view class="box_ware data-v-3a5b7e36"> | |
36 | + <view class="box_ware_title data-v-3a5b7e36"> | |
37 | + <text class="data-v-3a5b7e36">礼包内容</text> | |
38 | + </view> | |
39 | + <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> | |
40 | + <view class="box_ware_box data-v-3a5b7e36"> | |
41 | + <view class="box_ware_img data-v-3a5b7e36"> | |
42 | + <block wx:if="{{item.lbType==1}}"> | |
43 | + <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> | |
44 | + </block> | |
45 | + <block wx:if="{{item.lbType==2}}"> | |
46 | + <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> | |
47 | + </block> | |
48 | + <block wx:if="{{item.lbType==3}}"> | |
49 | + <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> | |
50 | + </block> | |
51 | + <block wx:if="{{item.lbType==4}}"> | |
52 | + <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> | |
53 | + </block> | |
54 | + <block wx:if="{{item.lbType==5}}"> | |
55 | + <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> | |
56 | + </block> | |
57 | + </view> | |
58 | + <view class="box_ware_item data-v-3a5b7e36"> | |
59 | + <view class="box_ware_item_title data-v-3a5b7e36"> | |
60 | + <text class="data-v-3a5b7e36">{{item.couponName}}</text> | |
61 | + </view> | |
62 | + <view class="box_ware_item_price data-v-3a5b7e36"> | |
63 | + <text class="data-v-3a5b7e36"></text> | |
64 | + </view> | |
65 | + <view class="box_ware_item_qty data-v-3a5b7e36"> | |
66 | + <text class="data-v-3a5b7e36 ellipsis-1">{{"数量:"+item.num}}</text> | |
67 | + </view> | |
68 | + <view class="box_ware_code data-v-3a5b7e36"> | |
69 | + <block wx:if="{{c_state==0}}"> | |
70 | + <block wx:if="{{isBuy==0&item.lbType==1}}"> | |
71 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" class="data-v-3a5b7e36"></image> | |
72 | + </block> | |
73 | + </block> | |
74 | + <block wx:else> | |
75 | + <block wx:if="{{isBuy==0&item.lbType==1}}"> | |
76 | + <image src="{{iurl+'/miniapp/images/giftbag/gift08.png'}}" lazy-load="true" class="data-v-3a5b7e36"></image> | |
77 | + </block> | |
78 | + </block> | |
79 | + <block wx:if="{{isBuy==0&item.lbType==2}}"> | |
80 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/coupons/coupons" bindtap="goto"></image> | |
81 | + </block> | |
82 | + <block wx:if="{{isBuy==0&item.lbType==3}}"> | |
83 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/my_service/i_service" bindtap="goto"></image> | |
84 | + </block> | |
85 | + <block wx:if="{{isBuy==0&item.lbType>3}}"> | |
86 | + <text class="data-v-3a5b7e36">奖励已发放</text> | |
87 | + </block> | |
88 | + </view> | |
89 | + </view> | |
90 | + </view> | |
91 | + </block> | |
92 | + </view> | |
93 | + <view class="foot_box data-v-3a5b7e36"> | |
94 | + <view class="foot_box_title data-v-3a5b7e36"> | |
95 | + <text class="data-v-3a5b7e36">活动说明</text> | |
96 | + </view> | |
97 | + <view class="foot_box_remark data-v-3a5b7e36"> | |
98 | + <rich-text nodes="{{giftRemark}}"></rich-text> | |
99 | + </view> | |
100 | + </view> | |
101 | + <view class="foot_empty data-v-3a5b7e36"></view> | |
102 | + <block wx:if="{{isBuy==1}}"> | |
103 | + <view class="foot_button data-v-3a5b7e36"> | |
104 | + <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> | |
105 | + <view class="foot_button_left data-v-3a5b7e36" data-id="{{lbId}}" bindtap="GetBuyPrice"> | |
106 | + <text class="data-v-3a5b7e36">立即购买</text> | |
107 | + </view> | |
108 | + </block> | |
109 | + <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> | |
110 | + <view class="foot_button_right data-v-3a5b7e36" bindtap="GetBuyIntegral" data-id="{{lbId}}"> | |
111 | + <text class="data-v-3a5b7e36">立即兑换</text> | |
112 | + </view> | |
113 | + </block> | |
114 | + <block wx:if="{{giftPrice>0 && giftIntegral<=0}}"> | |
115 | + <view class="foot_button_buy data-v-3a5b7e36" bindtap="GetBuyPrice" data-id="{{lbId}}"> | |
116 | + <text class="data-v-3a5b7e36">立即购买</text> | |
117 | + </view> | |
118 | + </block> | |
119 | + <block wx:if="{{giftPrice<=0 && giftIntegral>0}}"> | |
120 | + <view class="foot_button_intalge data-v-3a5b7e36" bindtap="GetBuyIntegral" data-id="{{lbId}}"> | |
121 | + <text class="data-v-3a5b7e36">立即兑换</text> | |
122 | + </view> | |
123 | + </block> | |
124 | + </view> | |
125 | + </block> | |
126 | + <block wx:if="{{isBuy==0}}"> | |
127 | + <view class="foot_button data-v-3a5b7e36"> | |
128 | + <block wx:if="{{is_lb!=1}}"> | |
129 | + <view class="foot_button_buy data-v-3a5b7e36 overdue"> | |
130 | + <text class="data-v-3a5b7e36">无核销商品</text> | |
131 | + </view> | |
132 | + </block> | |
133 | + <block wx:else> | |
134 | + <view wx:if="{{c_state==0}}" class="foot_button_buy data-v-3a5b7e36" bindtap="getcode"> | |
135 | + <text class="data-v-3a5b7e36">立即使用</text> | |
136 | + </view> | |
137 | + <view wx:if="{{c_state==1}}" class="foot_button_buy data-v-3a5b7e36 overdue"> | |
138 | + <text class="data-v-3a5b7e36">商品已核销</text> | |
139 | + </view> | |
140 | + <view wx:if="{{c_state==2}}" class="foot_button_buy data-v-3a5b7e36 overdue"> | |
141 | + <text class="data-v-3a5b7e36">商品兑换时间已过</text> | |
142 | + </view> | |
143 | + | |
144 | + </block> | |
145 | + </view> | |
146 | + </block> | |
147 | +</view> | |
148 | +<!-- 引入提示组件 --> | |
149 | +<warn id="warn"></warn> | |
150 | +<my_confirm id="my_confirm"></my_confirm> | |
151 | +<!-- 弹出框扫描 --> | |
152 | +<qr_code id="qc_com"></qr_code> | |
153 | +<!-- 制作一个圆球导航 --> | |
154 | +<nav_b id="nav_b"></nav_b> | |
0 | 155 | \ No newline at end of file | ... | ... |
pages/user/assistance/giftpacklist.wxss
0 → 100644
1 | +@charset "UTF-8"; | |
2 | + | |
3 | +/* Author XGQ | |
4 | + * 2019-12-12 | |
5 | + */ | |
6 | + | |
7 | +.box.data-v-3a5b7e36 { | |
8 | + -webkit-align-content: center; | |
9 | + align-content: center; | |
10 | + background-color: #e85f93; | |
11 | +} | |
12 | + | |
13 | +.box_top.data-v-3a5b7e36 { | |
14 | + width: 100%; | |
15 | +} | |
16 | + | |
17 | +.box_top image.data-v-3a5b7e36 { | |
18 | + width: 100%; | |
19 | + max-height: 540rpx; | |
20 | +} | |
21 | + | |
22 | +.box_title.data-v-3a5b7e36 { | |
23 | + margin: 10rpx 20rpx 20rpx 20rpx; | |
24 | + padding: 35rpx; | |
25 | + background-color: #fff; | |
26 | + border-radius: 40rpx; | |
27 | +} | |
28 | + | |
29 | +.top_title.data-v-3a5b7e36 { | |
30 | + font-size: 30rpx; | |
31 | + margin-bottom: 10rpx; | |
32 | +} | |
33 | + | |
34 | +.top_time.data-v-3a5b7e36 { | |
35 | + font-size: 27rpx; | |
36 | + color: #b9b5b5; | |
37 | +} | |
38 | + | |
39 | +.top_price.data-v-3a5b7e36 { | |
40 | + font-size: 35rpx; | |
41 | + color: #d61b30; | |
42 | + margin-top: 30rpx; | |
43 | + margin-bottom: 5rpx; | |
44 | +} | |
45 | + | |
46 | +.top_foot.data-v-3a5b7e36 { | |
47 | + display: -webkit-box; | |
48 | + display: -webkit-flex; | |
49 | + display: flex; | |
50 | +} | |
51 | + | |
52 | +.top_foot_price.data-v-3a5b7e36 { | |
53 | + font-size: 22rpx; | |
54 | + color: #b9b5b5; | |
55 | + width: 50%; | |
56 | + text-decoration: line-through; | |
57 | +} | |
58 | + | |
59 | +.top_foot_qty.data-v-3a5b7e36 { | |
60 | + font-size: 22rpx; | |
61 | + color: #b9b5b5; | |
62 | + width: 50%; | |
63 | + -webkit-align-content: flex-end; | |
64 | + align-content: flex-end; | |
65 | + text-align: right; | |
66 | +} | |
67 | + | |
68 | +.box_ware.data-v-3a5b7e36 { | |
69 | + margin: 10rpx 20rpx 20rpx 20rpx; | |
70 | + padding: 35rpx; | |
71 | + background-color: #fff; | |
72 | + border-radius: 40rpx; | |
73 | +} | |
74 | + | |
75 | +.box_ware_title.data-v-3a5b7e36 { | |
76 | + font-size: 35rpx; | |
77 | + margin: 5rpx 0rpx 30rpx 0rpx; | |
78 | +} | |
79 | + | |
80 | +.box_ware_box.data-v-3a5b7e36 { | |
81 | + display: -webkit-box; | |
82 | + display: -webkit-flex; | |
83 | + display: flex; | |
84 | + margin: 10rpx 0rpx 25rpx 0rpx; | |
85 | +} | |
86 | + | |
87 | +/* .box_ware_img.data-v-3a5b7e36 { | |
88 | + width: 30%; | |
89 | + height: 180rpx; | |
90 | + border: #999999 solid 1rpx; | |
91 | +} */ | |
92 | + | |
93 | +.box_ware_img image.data-v-3a5b7e36 { | |
94 | + /* width: 185rpx; | |
95 | + height: 190rpx; *//* background-color: rgba(138, 138, 138, 0.63); */ | |
96 | + border: 2rpx solid #999; | |
97 | + width: 120rpx; | |
98 | + height: 120rpx; | |
99 | +} | |
100 | + | |
101 | +.box_ware_item.data-v-3a5b7e36 { | |
102 | + width: 70%; | |
103 | + margin-left: 25rpx; | |
104 | + position: relative; | |
105 | +} | |
106 | + | |
107 | +.box_ware_item_title.data-v-3a5b7e36 { | |
108 | + font-size: 24rpx; | |
109 | + word-break: break-all; | |
110 | + text-overflow: ellipsis; | |
111 | + display: -webkit-box; | |
112 | + -webkit-box-orient: vertical; | |
113 | + -webkit-line-clamp: 2; | |
114 | + overflow: hidden; | |
115 | +} | |
116 | + | |
117 | +.box_ware_count.data-v-3a5b7e36 { | |
118 | + display: -webkit-box; | |
119 | + display: -webkit-flex; | |
120 | + display: flex; | |
121 | +} | |
122 | + | |
123 | +.box_ware_item_price.data-v-3a5b7e36 { | |
124 | + font-size: 25rpx; | |
125 | + color: #b9b5b5; | |
126 | + position: absolute; | |
127 | + bottom: 60rpx; | |
128 | + left: 0; | |
129 | +} | |
130 | + | |
131 | +.box_ware_item_qty.data-v-3a5b7e36 { | |
132 | + font-size: 22rpx; | |
133 | + position: absolute; | |
134 | + bottom: 15rpx; | |
135 | + left: 0; | |
136 | +} | |
137 | + | |
138 | +.box_ware_code.data-v-3a5b7e36 { | |
139 | + position: absolute; | |
140 | + right: 10rpx; | |
141 | + bottom: 10rpx; | |
142 | +} | |
143 | + | |
144 | +.box_ware_code image.data-v-3a5b7e36 { | |
145 | + width: 50rpx; | |
146 | + height: 50rpx; | |
147 | +} | |
148 | + | |
149 | +.box_ware_code text.data-v-3a5b7e36 { | |
150 | + font-size: 20rpx; | |
151 | +} | |
152 | + | |
153 | +.foot_box.data-v-3a5b7e36 { | |
154 | + margin: 10rpx 20rpx 50rpx 20rpx; | |
155 | + padding: 35rpx; | |
156 | + background-color: #fff; | |
157 | + border-radius: 40rpx; | |
158 | +} | |
159 | + | |
160 | +.foot_box_title.data-v-3a5b7e36 { | |
161 | + font-size: 35rpx; | |
162 | + margin-bottom: 30rpx; | |
163 | +} | |
164 | + | |
165 | +.foot_box_remark.data-v-3a5b7e36 { | |
166 | + font-size: 27rpx; | |
167 | + line-height: 40rpx; | |
168 | +} | |
169 | + | |
170 | +.foot_empty.data-v-3a5b7e36 { | |
171 | + height: 90rpx; | |
172 | +} | |
173 | + | |
174 | +.foot_button.data-v-3a5b7e36 { | |
175 | + display: -webkit-box; | |
176 | + display: -webkit-flex; | |
177 | + display: flex; | |
178 | + margin: 20rpx 0rpx 0rpx 0rpx; | |
179 | + padding: 25rpx 0rpx; | |
180 | + background: #fff; | |
181 | + text-align: center; | |
182 | + -webkit-box-pack: center; | |
183 | + -webkit-justify-content: center; | |
184 | + justify-content: center; | |
185 | + position: fixed; | |
186 | + bottom: 0; | |
187 | + left: 0; | |
188 | + width: 100%; | |
189 | +} | |
190 | + | |
191 | +.foot_button_left.data-v-3a5b7e36 { | |
192 | + background: #e4010c; | |
193 | + color: #fff; | |
194 | + width: 250rpx; | |
195 | + height: 70rpx; | |
196 | + font-size: 28rpx; | |
197 | + line-height: 70rpx; | |
198 | + border-radius: 40rpx; | |
199 | +} | |
200 | + | |
201 | +.foot_button_right.data-v-3a5b7e36 { | |
202 | + background: #ffbb42; | |
203 | + color: #fff; | |
204 | + width: 250rpx; | |
205 | + height: 70rpx; | |
206 | + font-size: 28rpx; | |
207 | + line-height: 70rpx; | |
208 | + border-radius: 40rpx; | |
209 | +} | |
210 | + | |
211 | +.foot_button_buy.data-v-3a5b7e36 { | |
212 | + background: #e4010c; | |
213 | + color: #fff; | |
214 | + width: 400rpx; | |
215 | + height: 70rpx; | |
216 | + font-size: 28rpx; | |
217 | + line-height: 70rpx; | |
218 | + border-radius: 40rpx; | |
219 | +} | |
220 | + | |
221 | +.foot_button_intalge.data-v-3a5b7e36 { | |
222 | + background: #ffbb42; | |
223 | + color: #fff; | |
224 | + width: 400rpx; | |
225 | + height: 70rpx; | |
226 | + font-size: 28rpx; | |
227 | + line-height: 70rpx; | |
228 | + border-radius: 40rpx; | |
229 | +} | |
230 | + | |
231 | +page.data-v-3a5b7e36 { | |
232 | + background-color: #e85f93; | |
233 | +} | |
234 | + | |
235 | +.foot_box_remark.data-v-3a5b7e36 ._img { | |
236 | + width: 100%; | |
237 | +} | |
238 | + | |
239 | +.foot_box_remark.data-v-3a5b7e36 .img { | |
240 | + line-height: 0; | |
241 | +} | |
242 | +.overdue.data-v-3a5b7e36{ | |
243 | + background-color: rgb(153,153,153); | |
244 | +} | |
0 | 245 | \ No newline at end of file | ... | ... |
pages/user/assistance/task_assistance.js
... | ... | @@ -17,9 +17,9 @@ Page({ |
17 | 17 | sw_index: 0, //轮播的下标控制 |
18 | 18 | url: s.url, //接口网址 |
19 | 19 | iurl: s.imghost, |
20 | - is_task: 0, //判断标题名是任务1还是2 | |
20 | + endDate:"",//活动结束时间 | |
21 | 21 | activity_data: "25:20:59", //活动剩余时间 |
22 | - task_number: 12, //任务数 | |
22 | + task_number:0, //任务数 | |
23 | 23 | is_task: 0, //历史记录与任务 |
24 | 24 | aitem: "", //活动的轮播图 |
25 | 25 | switch_head: 0, //0:我的任务,1:记录 |
... | ... | @@ -28,9 +28,10 @@ Page({ |
28 | 28 | shareImgPath: [], //生成的图片 |
29 | 29 | screenWidth: "", //用户的屏幕宽度 |
30 | 30 | gid: "", |
31 | - images: ["miniapp/images/friendhelp/help.png", "miniapp/images/friendhelp/background.png", "miniapp/images/friendhelp/gift.png", "miniapp/images/friendhelp/no_check.png", | |
32 | - "miniapp/images/friendhelp/check.png", "miniapp/images/friendhelp/check.png", "miniapp/images/friendhelp/unfinished.png", "miniapp/images/friendhelp/gift.png" | |
33 | - ] | |
31 | + timer: null,//全局的定时器 | |
32 | + user_task_list:null,//会员列表 | |
33 | + taskid:"",//任务id | |
34 | + usercount:0,//参与的人数 | |
34 | 35 | }, |
35 | 36 | |
36 | 37 | /** |
... | ... | @@ -38,7 +39,6 @@ Page({ |
38 | 39 | */ |
39 | 40 | onLoad: function(options) { |
40 | 41 | var help_id = options.help_id; |
41 | - console.log("是什么鬼", help_id); | |
42 | 42 | var th = this; |
43 | 43 | th.setData({ |
44 | 44 | help_id: help_id |
... | ... | @@ -50,57 +50,74 @@ Page({ |
50 | 50 | } |
51 | 51 | th.close(); |
52 | 52 | th.syinfo(); |
53 | - th.imageinfo(); | |
53 | + // th.imageinfo(); | |
54 | 54 | }, |
55 | - // 轮播图点击左边 | |
56 | - click_pre: function() { | |
57 | - var index = this.data.sw_index; | |
58 | - index--; | |
59 | - if (index < 0) return; | |
60 | - this.setData({ | |
61 | - sw_index: index | |
62 | - }) | |
55 | + | |
56 | + | |
57 | + //选中任务保存 | |
58 | + add_onlicke:function(e){ | |
59 | + var th=this; | |
60 | + var taskid=e.target.dataset.taskid; | |
61 | + var help_id = th.data.help_id; | |
62 | + var user_id = getApp().globalData.user_id; | |
63 | + var stoid=os.stoid | |
64 | + getApp().request.json_post("/api/weshop/marketing/help/help/task/insert" | |
65 | + ,{ | |
66 | + helpId:help_id, | |
67 | + userId:user_id, | |
68 | + storeId:stoid, | |
69 | + taskId: taskid | |
70 | + }, | |
71 | + function(res) { | |
72 | + if(res.data.code==0){ | |
73 | + console.log(res.data.data); | |
74 | + getApp().my_warnning("任务领取成功", 1, th); | |
75 | + }else{ | |
76 | + getApp().my_warnning(res.data.msg, 0, th); | |
77 | + } | |
78 | + } | |
79 | + | |
80 | + ) | |
63 | 81 | |
64 | 82 | }, |
65 | - //轮播图点击右边 | |
66 | - click_next: function() { | |
67 | - var index = this.data.sw_index; | |
68 | - index++; | |
69 | - if (index >= this.data.aitem.length) return; | |
70 | - this.setData({ | |
71 | - sw_index: index | |
72 | - }) | |
73 | 83 | |
74 | - }, | |
75 | - //任务领取 | |
76 | - onlicke: function() { | |
84 | + //帮拆记录的 | |
85 | + dismantle_record: function(e) { | |
86 | + console.log(); | |
77 | 87 | var th = this; |
78 | - th.shareFrends(); | |
79 | - th.setData({ | |
80 | - is_share:1 | |
81 | - }) | |
82 | - getApp().my_warnning("任务领取成功", 1, th); | |
83 | - }, | |
84 | - | |
85 | - //我的任务和帮拆记录的替换 | |
86 | - switch_head: function(e) { | |
87 | - var th = this; | |
88 | - var index = e.currentTarget.dataset.index; //获取当前选择的是任务还是活动说明 | |
89 | - var switch_head = th.data.switch_head; //0任务,1活动说明 | |
90 | - if (index != switch_head) { | |
88 | + var index =1; //获取当前选择的是任务还是活动说明 | |
89 | + var is_task= th.data.is_task; //0任务,1活动说明 | |
90 | + console.log(e, "这是标签的", is_task, "这是"); | |
91 | + | |
91 | 92 | th.setData({ |
92 | - switch_head: index, | |
93 | - is_task: index | |
93 | + is_task:1, | |
94 | + switch_head:1 | |
95 | + }); | |
96 | + rq.get("/api/weshop/marketing/help/help/task/involve/page", { | |
97 | + data: { | |
98 | + userId: user_id, | |
99 | + storeId: os.stoid | |
100 | + }, | |
101 | + success: function (res) {} | |
102 | + | |
94 | 103 | }) |
95 | - } | |
104 | + | |
105 | + | |
96 | 106 | }, |
107 | + | |
108 | + | |
97 | 109 | //划动的时候监听 |
98 | 110 | onSli: function(e) { |
99 | - | |
111 | + var th= this; | |
100 | 112 | var ind = e.detail.current; |
101 | - this.setData({ | |
102 | - sw_index: ind | |
113 | + var aitem = this.data.aitem; | |
114 | + | |
115 | + var task_number = aitem[ind].giftQty - aitem[ind].useGiftQty; | |
116 | + th.setData({ | |
117 | + sw_index: ind, | |
118 | + task_number: task_number | |
103 | 119 | }) |
120 | + console.log(th.data.sw_index,"滑动监听", ind); | |
104 | 121 | }, |
105 | 122 | //导航球 |
106 | 123 | close: function() { |
... | ... | @@ -121,18 +138,41 @@ Page({ |
121 | 138 | * 生命周期函数--监听页面显示 |
122 | 139 | */ |
123 | 140 | onShow: function() { |
141 | + this.data.is_timer = 1; | |
124 | 142 | var th = this; |
125 | 143 | var help_id = th.data.help_id; |
126 | - /*-----统计-----*/ | |
144 | + var user_id = getApp().globalData.user_id; | |
145 | + | |
146 | + /*-----助力活动(判断)-----*/ | |
147 | + rq.get("/api/weshop/marketing/help/act/judge", { | |
148 | + data: { | |
149 | + userId: user_id, | |
150 | + storeId: os.stoid | |
151 | + }, | |
152 | + success: function (res) { | |
153 | + if (res.data.code == 0) { | |
154 | + | |
155 | + var help_data = res.data.data; | |
156 | + console.log( '助力活动(判断)', res.data.data); | |
157 | + th.setData({ | |
158 | + endDate:help_data.endDate, | |
159 | + }); | |
160 | + | |
161 | + } | |
162 | + } | |
163 | + | |
164 | + | |
165 | + }); | |
166 | + | |
167 | + | |
168 | + /*-----获取助力活动的任务-----*/ | |
127 | 169 | rq.get("/api/weshop/marketing/help/help/task/page", { |
128 | 170 | data: { |
129 | 171 | helpId: help_id, |
130 | 172 | storeId: os.stoid |
131 | 173 | }, |
132 | 174 | success: function(su) { |
133 | - | |
134 | 175 | var data = su.data; |
135 | - console.log('waitlist5555555555' + data.code); | |
136 | 176 | if (data.code != 0) { |
137 | 177 | getApp().my_warnning(data.msg, 0, th); |
138 | 178 | return false; |
... | ... | @@ -142,21 +182,23 @@ Page({ |
142 | 182 | var data_aissa = data.data.pageData; |
143 | 183 | //当前时间戳 |
144 | 184 | var nt = ut.gettimestamp(); |
145 | - | |
185 | + | |
146 | 186 | data_aissa.forEach(function(val, ind) { |
147 | - console.log(nt, "当前时间", "结束时间", val.end_time, "开始时间"); | |
187 | + | |
148 | 188 | //已开始 |
149 | 189 | if (val.start_time < nt && val.end_time > nt) data_aissa[ind].status = 0; |
150 | 190 | //未开始 |
151 | 191 | else if (val.start_time > nt && val.end_time > nt) data_aissa[ind].status = 1; |
152 | 192 | //已结束 |
153 | - | |
154 | 193 | else if (val.start_time < nt && val.end_time < nt) data_aissa[ind].status = 2; |
155 | - | |
156 | 194 | }); |
157 | - | |
195 | + var task_number=data_aissa[0].giftQty - data_aissa[0].useGiftQty; | |
196 | + var taskid = data_aissa[0].id; | |
197 | + | |
158 | 198 | th.setData({ |
159 | - aitem: data_aissa | |
199 | + aitem: data_aissa, | |
200 | + task_number: task_number, | |
201 | + taskid:taskid | |
160 | 202 | }); |
161 | 203 | |
162 | 204 | |
... | ... | @@ -164,58 +206,97 @@ Page({ |
164 | 206 | |
165 | 207 | } |
166 | 208 | }) |
167 | - setTimeout(function() { | |
168 | - th.shareFrends(); | |
169 | - }, 1000) | |
170 | - | |
209 | + // 分享的 | |
210 | + // setTimeout(function() { | |
211 | + // th.shareFrends(); | |
212 | + // }, 1000) | |
213 | + //任务时间 设置全局定时器 | |
214 | + th.data.timer = setInterval(function () { | |
215 | + th.countDown(); | |
216 | + },1000); | |
217 | + //会员任务列表 | |
218 | + this.user_task_list(); | |
219 | + // 获取会员的参与的任务列表 我的任务 | |
220 | + this.get_user_task_num(); | |
171 | 221 | }, |
172 | - //----助力任务----- | |
173 | - countDown() { | |
174 | - if (!this.data.is_timer) return false; | |
175 | - var th = this; | |
176 | - // 获取当前时间,同时得到活动结束时间数组 | |
177 | - var newTime = ut.gettimestamp(); | |
178 | - var List = this.data.aitem; | |
179 | - for (var j = 0; j < List.length; j++) { | |
180 | - var endTimeList = List[j]; | |
181 | - // 对结束时间进行处理渲染到页面 | |
182 | - for (var i = 0; i < endTimeList.length; i++) { | |
183 | - var o = endTimeList[i]; | |
184 | - var endTime = o.end_time | |
185 | - if (o.status == 0) endTime = o.start_time | |
186 | - | |
187 | - var obj = null; | |
188 | - // 如果活动未结束,对时间进行处理 | |
189 | - if (endTime - newTime > 0) { | |
190 | - var time = (endTime - newTime); | |
191 | - // 获取天、时、分、秒 | |
192 | - var day = parseInt(time / (60 * 60 * 24)); | |
193 | - var hou = parseInt(time % (60 * 60 * 24) / 3600); | |
194 | - var min = parseInt(time % (60 * 60 * 24) % 3600 / 60); | |
195 | - var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); | |
196 | - obj = { | |
197 | - day: this.timeFormat(day), | |
198 | - hou: this.timeFormat(hou), | |
199 | - min: this.timeFormat(min), | |
200 | - sec: this.timeFormat(sec) | |
201 | - } | |
202 | - } else { | |
203 | - //活动已结束,全部设置为'00' | |
204 | - obj = { | |
205 | - day: '00', | |
206 | - hou: '00', | |
207 | - min: '00', | |
208 | - sec: '00' | |
209 | - } | |
210 | - } | |
211 | - var txt = "aitem[" + j + "][" + i + "].djs"; | |
222 | + // 获取会员的参与的任务列表 我的任务 | |
223 | + user_task_list:function(e){ | |
224 | + var th=this; | |
225 | + // var index = e.target.dataset.index; //获取当前选择的是任务还是活动说明 | |
226 | + var index =0; | |
227 | + var is_task = th.data.is_task; //0任务,1活动说明 | |
228 | + var help_id = th.data.help_id; | |
229 | + var user_id = getApp().globalData.user_id; | |
230 | + rq.get("/api/weshop/marketing/help/help/user/page", { | |
231 | + data: { | |
232 | + helpId: help_id, | |
233 | + storeId: os.stoid, | |
234 | + userId: user_id | |
235 | + }, | |
236 | + success: function (su) { | |
212 | 237 | th.setData({ |
213 | - [txt]: obj | |
238 | + is_task: index, | |
239 | + switch_head: index | |
214 | 240 | }); |
241 | + if (su.data.code == 0) { | |
242 | + var user_list=su.data.data.pageData; | |
243 | + console.log("会员列表",user_list); | |
244 | + th.setData({ | |
245 | + user_task_list: user_list | |
246 | + }); | |
247 | + }else{ | |
248 | + th.setData({ | |
249 | + user_task_list:null | |
250 | + }); | |
251 | + } | |
215 | 252 | } |
253 | + }) | |
254 | + }, | |
255 | + //获取助力活动参与的人数 | |
256 | + get_user_task_num(){ | |
257 | + var th=this; | |
258 | + var help_id=th.data.help_id; | |
259 | + rq.get("/api/weshop/marketing/help/involve/help/act/people/count", { | |
260 | + data: { | |
261 | + helpId: help_id, | |
262 | + storeId: os.stoid, | |
263 | + }, | |
264 | + success: function (su) { | |
265 | + console.log(su.data.code, "获取助力活动参与的人数",su.data) | |
266 | + if (su.data.code == 0) { | |
267 | + var usercount=su.data.data.countAll; | |
268 | + | |
269 | + th.setData({ usercount: usercount}); | |
270 | + } else { | |
271 | + | |
272 | + } | |
273 | + } | |
274 | + }) | |
275 | + | |
276 | + }, | |
277 | + // 轮播图点击左边 | |
278 | + click_pre: function () { | |
279 | + var index = this.data.sw_index; | |
280 | + index--; | |
281 | + if (index < 0) return; | |
282 | + var aitem = this.data.aitem; | |
283 | + var task_number = aitem[index].giftQty - aitem[index].useGiftQty; | |
284 | + this.setData({ | |
285 | + sw_index: index, | |
286 | + task_number: task_number | |
287 | + }) | |
216 | 288 | |
217 | - } | |
218 | - setTimeout(th.countDown, 1000); | |
289 | + }, | |
290 | + //轮播图点击右边 | |
291 | + click_next: function () { | |
292 | + var index = this.data.sw_index; | |
293 | + index++; | |
294 | + if (index >= this.data.aitem.length) return; | |
295 | + var aitem = this.data.aitem; | |
296 | + var task_number = aitem[index].giftQty - aitem[index].useGiftQty; | |
297 | + this.setData({ | |
298 | + sw_index: index, task_number: task_number | |
299 | + }) | |
219 | 300 | |
220 | 301 | }, |
221 | 302 | |
... | ... | @@ -223,7 +304,9 @@ Page({ |
223 | 304 | * 生命周期函数--监听页面隐藏 |
224 | 305 | */ |
225 | 306 | onHide: function() { |
226 | - | |
307 | + //--清理定时器-- | |
308 | + console.log("清理定时器"); | |
309 | + clearInterval(this.timer); | |
227 | 310 | }, |
228 | 311 | |
229 | 312 | /** |
... | ... | @@ -239,6 +322,63 @@ Page({ |
239 | 322 | onPullDownRefresh: function() { |
240 | 323 | |
241 | 324 | }, |
325 | + //----助力任务的时间----- | |
326 | + countDown() { | |
327 | + if (!this.data.is_timer) return false; | |
328 | + var th = this; | |
329 | + // 获取当前时间,同时得到活动结束时间数组 | |
330 | + var newTime = ut.gettimestamp(); | |
331 | + var List = this.data.aitem; | |
332 | + for (var j = 0; j < List.length; j++) { | |
333 | + var o = List[j]; | |
334 | + | |
335 | + // 对结束时间进行处理渲染到页面 | |
336 | + | |
337 | + // var o = endTimeList[i]; | |
338 | + var endTime = o.endDate | |
339 | + | |
340 | + // if (o.status == 0) endTime = o.start_time | |
341 | + | |
342 | + var obj = null; | |
343 | + // 如果活动未结束,对时间进行处理 | |
344 | + if (endTime - newTime > 0) { | |
345 | + | |
346 | + var time = (endTime - newTime); | |
347 | + // 获取天、时、分、秒 | |
348 | + var day = parseInt(time / (60 * 60 * 24)); | |
349 | + var hou = parseInt(time % (60 * 60 * 24) / 3600); | |
350 | + var min = parseInt(time % (60 * 60 * 24) % 3600 / 60); | |
351 | + var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); | |
352 | + obj = { | |
353 | + day: this.timeFormat(day), | |
354 | + hou: this.timeFormat(hou), | |
355 | + min: this.timeFormat(min), | |
356 | + sec: this.timeFormat(sec) | |
357 | + } | |
358 | + } else { | |
359 | + | |
360 | + //活动已结束,全部设置为'00' | |
361 | + obj = { | |
362 | + day: '00', | |
363 | + hou: '00', | |
364 | + min: '00', | |
365 | + sec: '00' | |
366 | + } | |
367 | + } | |
368 | + var txt = "aitem[" + j + "]djs"; | |
369 | + th.setData({ | |
370 | + [txt]: obj | |
371 | + }); | |
372 | + | |
373 | + | |
374 | + } | |
375 | + setTimeout(th.countDown, 1000); | |
376 | + | |
377 | + }, | |
378 | + //---小于10的格式化函数---- | |
379 | + timeFormat(param) { | |
380 | + return param < 10 ? '0' + param : param; | |
381 | + }, | |
242 | 382 | |
243 | 383 | /** |
244 | 384 | * 页面上拉触底事件的处理函数 |
... | ... | @@ -393,102 +533,103 @@ Page({ |
393 | 533 | } |
394 | 534 | }) |
395 | 535 | }, |
396 | - imageinfo: function() { | |
397 | - var th = this; | |
398 | - var images = th.data.images; | |
399 | - var iurl = th.data.iurl; | |
400 | - wx.getImageInfo({ | |
401 | - src: iurl + images[0], | |
402 | - success: function(res) { | |
403 | - console.log(res + i); | |
404 | - //res.path是网络图片的本地地址 | |
405 | - images[0] = res.path; | |
406 | - }, | |
407 | - fail: function(res) { | |
408 | - console.log(res.toString() + "" + i); | |
409 | - } | |
410 | - }); | |
411 | - wx.getImageInfo({ | |
412 | - src: iurl + images[1], | |
413 | - success: function(res) { | |
414 | - console.log(res + i); | |
415 | - //res.path是网络图片的本地地址 | |
416 | - images[1] = res.path; | |
417 | - }, | |
418 | - fail: function(res) { | |
419 | - console.log(res.toString() + "" + i); | |
420 | - } | |
421 | - }); | |
422 | - wx.getImageInfo({ | |
423 | - src: iurl + images[2], | |
424 | - success: function(res) { | |
425 | - console.log(res + i); | |
426 | - //res.path是网络图片的本地地址 | |
427 | - images[2] = res.path; | |
428 | - }, | |
429 | - fail: function(res) { | |
430 | - console.log(res.toString() + "" + i); | |
431 | - } | |
432 | - }); | |
433 | - wx.getImageInfo({ | |
434 | - src: iurl + images[3], | |
435 | - success: function(res) { | |
436 | - console.log(res + i); | |
437 | - //res.path是网络图片的本地地址 | |
438 | - images[3] = res.path; | |
439 | - }, | |
440 | - fail: function(res) { | |
441 | - console.log(res.toString() + "" + i); | |
442 | - } | |
443 | - }); | |
444 | - wx.getImageInfo({ | |
445 | - src: iurl + images[4], | |
446 | - success: function(res) { | |
447 | - console.log(res + i); | |
448 | - //res.path是网络图片的本地地址 | |
449 | - images[4] = res.path; | |
450 | - }, | |
451 | - fail: function(res) { | |
452 | - console.log(res.toString() + "" + i); | |
453 | - } | |
454 | - }); | |
455 | - wx.getImageInfo({ | |
456 | - src: iurl + images[5], | |
457 | - success: function(res) { | |
458 | - console.log(res + i); | |
459 | - //res.path是网络图片的本地地址 | |
460 | - images[5] = res.path; | |
461 | - }, | |
462 | - fail: function(res) { | |
463 | - console.log(res.toString() + "" + i); | |
464 | - } | |
465 | - }); | |
466 | - wx.getImageInfo({ | |
467 | - src: iurl + images[6], | |
468 | - success: function(res) { | |
469 | - console.log(res + i); | |
470 | - //res.path是网络图片的本地地址 | |
471 | - images[6] = res.path; | |
472 | - }, | |
473 | - fail: function(res) { | |
474 | - console.log(res.toString() + "" + i); | |
475 | - } | |
476 | - }); | |
477 | - | |
478 | - wx.getImageInfo({ | |
479 | - src: iurl + images[7], | |
480 | - success: function(res) { | |
481 | - console.log(res + i); | |
482 | - //res.path是网络图片的本地地址 | |
483 | - images[7] = res.path; | |
484 | - }, | |
485 | - fail: function(res) { | |
486 | - console.log(res.toString() + "" + i); | |
487 | - } | |
488 | - }) | |
489 | - th.setData({ | |
490 | - images: images | |
491 | - }) | |
492 | - | |
493 | - } | |
536 | + //分享图 | |
537 | + // imageinfo: function() { | |
538 | + // var th = this; | |
539 | + // var images = th.data.images; | |
540 | + // var iurl = th.data.iurl; | |
541 | + // wx.getImageInfo({ | |
542 | + // src: iurl + images[0], | |
543 | + // success: function(res) { | |
544 | + // console.log(res + i); | |
545 | + // //res.path是网络图片的本地地址 | |
546 | + // images[0] = res.path; | |
547 | + // }, | |
548 | + // fail: function(res) { | |
549 | + // console.log(res.toString() + "" + i); | |
550 | + // } | |
551 | + // }); | |
552 | + // wx.getImageInfo({ | |
553 | + // src: iurl + images[1], | |
554 | + // success: function(res) { | |
555 | + // console.log(res + i); | |
556 | + // //res.path是网络图片的本地地址 | |
557 | + // images[1] = res.path; | |
558 | + // }, | |
559 | + // fail: function(res) { | |
560 | + // console.log(res.toString() + "" + i); | |
561 | + // } | |
562 | + // }); | |
563 | + // wx.getImageInfo({ | |
564 | + // src: iurl + images[2], | |
565 | + // success: function(res) { | |
566 | + // console.log(res + i); | |
567 | + // //res.path是网络图片的本地地址 | |
568 | + // images[2] = res.path; | |
569 | + // }, | |
570 | + // fail: function(res) { | |
571 | + // console.log(res.toString() + "" + i); | |
572 | + // } | |
573 | + // }); | |
574 | + // wx.getImageInfo({ | |
575 | + // src: iurl + images[3], | |
576 | + // success: function(res) { | |
577 | + // console.log(res + i); | |
578 | + // //res.path是网络图片的本地地址 | |
579 | + // images[3] = res.path; | |
580 | + // }, | |
581 | + // fail: function(res) { | |
582 | + // console.log(res.toString() + "" + i); | |
583 | + // } | |
584 | + // }); | |
585 | + // wx.getImageInfo({ | |
586 | + // src: iurl + images[4], | |
587 | + // success: function(res) { | |
588 | + // console.log(res + i); | |
589 | + // //res.path是网络图片的本地地址 | |
590 | + // images[4] = res.path; | |
591 | + // }, | |
592 | + // fail: function(res) { | |
593 | + // console.log(res.toString() + "" + i); | |
594 | + // } | |
595 | + // }); | |
596 | + // wx.getImageInfo({ | |
597 | + // src: iurl + images[5], | |
598 | + // success: function(res) { | |
599 | + // console.log(res + i); | |
600 | + // //res.path是网络图片的本地地址 | |
601 | + // images[5] = res.path; | |
602 | + // }, | |
603 | + // fail: function(res) { | |
604 | + // console.log(res.toString() + "" + i); | |
605 | + // } | |
606 | + // }); | |
607 | + // wx.getImageInfo({ | |
608 | + // src: iurl + images[6], | |
609 | + // success: function(res) { | |
610 | + // console.log(res + i); | |
611 | + // //res.path是网络图片的本地地址 | |
612 | + // images[6] = res.path; | |
613 | + // }, | |
614 | + // fail: function(res) { | |
615 | + // console.log(res.toString() + "" + i); | |
616 | + // } | |
617 | + // }); | |
618 | + | |
619 | + // wx.getImageInfo({ | |
620 | + // src: iurl + images[7], | |
621 | + // success: function(res) { | |
622 | + // console.log(res + i); | |
623 | + // //res.path是网络图片的本地地址 | |
624 | + // images[7] = res.path; | |
625 | + // }, | |
626 | + // fail: function(res) { | |
627 | + // console.log(res.toString() + "" + i); | |
628 | + // } | |
629 | + // }) | |
630 | + // th.setData({ | |
631 | + // images: images | |
632 | + // }) | |
633 | + | |
634 | + // } | |
494 | 635 | }) |
495 | 636 | \ No newline at end of file | ... | ... |
pages/user/assistance/task_assistance.wxml
... | ... | @@ -2,10 +2,11 @@ |
2 | 2 | <!-- 助力活动头部 --> |
3 | 3 | <view class="top-frame"> |
4 | 4 | <view class="top-title white fs36 t-c"> |
5 | - {{aitem[sw_index].tite_name}} | |
5 | + {{sw_index}} | |
6 | + {{aitem[sw_index].helpTaskName}} | |
6 | 7 | </view> |
7 | 8 | <view class="activity-data t-c fs28 white"> |
8 | - 活动剩余时间: {{activity_data}} | |
9 | + 活动剩余时间:<text class='tui-conutdown-box'> {{aitem[0].djs.day}}</text>:<text class='tui-conutdown-box'>{{aitem[0].djs.hou}}</text>:<text class='tui-conutdown-box'>{{aitem[0].djs.min}}</text>:<text class='tui-conutdown-box tui-countdown-bg'>{{aitem[0].djs.sec}}</text> | |
9 | 10 | </view> |
10 | 11 | </view> |
11 | 12 | <!-- 图片的轮播图 --> |
... | ... | @@ -14,25 +15,27 @@ |
14 | 15 | <view class="bg_left xc-left bcolor"></view> |
15 | 16 | </view> |
16 | 17 | <swiper current="{{sw_index}}" style='width:82.7%; height:100%' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}"> |
17 | - | |
18 | 18 | <swiper-item wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx"> |
19 | - | |
20 | - <image class="xc-center-img " src="{{aitem.PrivilegeICOUrl}}"></image> | |
21 | - | |
19 | + <image class="xc-center-img " src="{{iurl+aitem.giftBagUrl}}"></image> | |
22 | 20 | </swiper-item> |
23 | - | |
24 | 21 | </swiper> |
25 | 22 | |
26 | 23 | <view bindtap="click_next"> |
27 | 24 | <view class="bg_right xc-right bcolor mt"></view> |
28 | 25 | </view> |
29 | 26 | </view> |
30 | - | |
27 | + <view class="plan-frame"> | |
28 | + <view class="plan_num rel"> | |
29 | + <view class="is_plam abs"></view> | |
30 | + </view> | |
31 | + <text class="white fs32">/</text> | |
32 | + | |
33 | + </view> | |
31 | 34 | <view class="task-number fs28 white t-c "> |
32 | 35 | 今天剩余可领{{task_number}}个任务 |
33 | 36 | </view> |
34 | 37 | |
35 | - <view class="task_clike fs40 t-c flex-center" bindtap="onlicke"> | |
38 | + <view class="task_clike fs40 t-c flex-center"data-taskid="{{taskid}}" bindtap="add_onlicke"> | |
36 | 39 | 就选它了 |
37 | 40 | </view> |
38 | 41 | </view> |
... | ... | @@ -41,26 +44,30 @@ |
41 | 44 | <!-- 标题 --> |
42 | 45 | |
43 | 46 | <view class="flex-vertical-between fs28 padding head"> |
44 | - <view class="flex-center lhead {{switch_head==0?'rhead':''}}" bindtap="switch_head" data-index="0"> | |
47 | + <view class="flex-center lhead {{switch_head==0?'rhead':''}}" bindtap="user_task_list" data-index="0"> | |
45 | 48 | <image class="unfinished" src="{{iurl}}miniapp/images/friendhelp/task.png" lazy-load="true"></image> |
46 | 49 | <view>我的任务</view> |
47 | 50 | </view> |
48 | - <view class="flex-center lhead {{switch_head==1?'rhead':''}}" bindtap="switch_head" data-index='1'> | |
51 | + <view class="flex-center lhead {{switch_head==1?'rhead':''}}" bindtap="dismantle_record" data-index='1'> | |
49 | 52 | <image class="unfinished" style="margin-top: 5rpx;" src="{{iurl}}miniapp/images/friendhelp/edit.png" lazy-load="true"></image> |
50 | 53 | <view>帮拆记录</view> |
51 | 54 | </view> |
52 | 55 | </view> |
53 | 56 | |
54 | 57 | <view class="white"> |
58 | + | |
55 | 59 | <view class="items" wx:if="{{is_task==0}}"> |
56 | - <view class="item fs26 flex-vertical-between padding" wx:for="{{5}}"> | |
60 | + | |
61 | + <view class="item fs26 flex-vertical-between padding" wx:for="{{user_task_list}}" > | |
57 | 62 | <view class="flex-center width"> |
58 | - <view class="ellipsis-1">豪华任务一 | |
63 | + <view class="ellipsis-1">{{item.helpTaskName}} | |
59 | 64 | </view> |
60 | 65 | </view> |
61 | - | |
62 | 66 | <view class="flex-center width state"> |
63 | - <view class="ellipsis-1">进行中 | |
67 | + <view class="ellipsis-1"> | |
68 | + <text wx:if="{{item.status==0&&item.zlHelpNum<item.helpNum}}">{{item.zlHelpNum}}/{{item.helpNum}}</text> | |
69 | + <text wx:if="{{item.status==2&&item.zlHelpNum==item.helpNum}}">查看详情</text> | |
70 | + <text wx:if="{{item.status==1&&time.zlHelpNum==item.helpNum}}">领取礼包 </text> | |
64 | 71 | </view> |
65 | 72 | </view> |
66 | 73 | |
... | ... | @@ -70,9 +77,7 @@ |
70 | 77 | |
71 | 78 | |
72 | 79 | <view class="items" wx:if="{{is_task==1}}"> |
73 | - | |
74 | - | |
75 | - <view class="item fs26 flex flex-vertical-between padding" wx:for="{{5}}"> | |
80 | + <view class="item fs26 flex flex-vertical-between padding" wx:for="{{}}"> | |
76 | 81 | <view class="flex white" style="justify-content: space-around; width: 90%;margin:auto"> |
77 | 82 | <image class="circle user_img" src="https://mshopimg.yolipai.net/public/upload/qyimg/temp/2019/08-14/0697f7277936a3b116a6ebc4f8f5e39a.png"></image> |
78 | 83 | <view class="ellipsis-1">豪华任务一 |
... | ... | @@ -84,30 +89,23 @@ |
84 | 89 | </view> |
85 | 90 | |
86 | 91 | </view> |
87 | - <view class="fs30" wx:if="{{1<0}}"> | |
88 | - <view class="flex-center nothing"> | |
92 | + <view class="fs30" wx:if="{{user_task_list==null || user_task_list==''}}"> | |
93 | + <view class="flex-center nothing white"> | |
89 | 94 | <view>暂无任务记录</view> |
90 | 95 | </view> |
91 | - <view class="flex-center receive"> | |
92 | - <view class="flex-center"> | |
93 | - <view>已有</view> | |
94 | - <view>126</view> | |
95 | - <view>人领取了任务</view> | |
96 | - </view> | |
97 | - </view> | |
98 | 96 | </view> |
99 | 97 | |
100 | 98 | </view> |
101 | 99 | <!-- 加载更多 --> |
102 | -<view class="fs32 "> | |
103 | - <view class="flex-center"> | |
100 | +<view class="fs32"> | |
101 | + <view class="flex-center" wx:if="{{user_task_list}}"> | |
104 | 102 | <view class="line"></view> |
105 | 103 | <view class="load white" bindtap="">点击加载更多</view> |
106 | 104 | <view class="line"></view> |
107 | 105 | </view> |
108 | 106 | <view class="flex-center white" style="margin-top: 20rpx;"> |
109 | 107 | <view>已有</view> |
110 | - <view>126</view> | |
108 | + <view>{{usercount}}</view> | |
111 | 109 | <view>人领取了任务</view> |
112 | 110 | </view> |
113 | 111 | </view> | ... | ... |
pages/user/assistance/task_assistance.wxss
... | ... | @@ -154,3 +154,19 @@ border-color: #fff; |
154 | 154 | width: 70rpx; |
155 | 155 | height: 70rpx; |
156 | 156 | } |
157 | +.plan-frame{ | |
158 | + width: 90%; | |
159 | + margin: auto; | |
160 | + | |
161 | +} | |
162 | +.plan-frame .plan_num{ | |
163 | + width: 90%; | |
164 | + background: #ffe7ab; | |
165 | + border-radius: 20rpx; | |
166 | + height: 32rpx; | |
167 | +} | |
168 | +.is_plam{ | |
169 | + height: 100%; | |
170 | + top: 0rpx; | |
171 | + left: 0rpx; | |
172 | +} | |
157 | 173 | \ No newline at end of file | ... | ... |
pages/user/index/index.js
... | ... | @@ -51,14 +51,15 @@ Page({ |
51 | 51 | * 生命周期函数--监听页面加载 |
52 | 52 | */ |
53 | 53 | onLoad: function (options) { |
54 | - this.birthday(); | |
55 | - this.is_assistance(); | |
54 | + this.birthday(); | |
56 | 55 | }, |
57 | 56 | |
58 | 57 | /** |
59 | 58 | * 生命周期函数--监听页面显示 |
60 | 59 | */ |
61 | 60 | onShow: function () { |
61 | + | |
62 | + this.is_assistance(); | |
62 | 63 | |
63 | 64 | var stoid = app_d.setting.stoid; |
64 | 65 | var s = this,th=s,need_money=0,cur_g_num=0; |
... | ... | @@ -128,10 +129,12 @@ Page({ |
128 | 129 | await getApp().request.promiseGet("/api/weshop/users/grade/aftervipinfo/get",{ |
129 | 130 | data:{ storeId:os.stoid,userId:app_d.user_id } |
130 | 131 | }).then(res=>{ |
131 | - gid=res.data.data.GradeId; | |
132 | - var cz_val = res.data.data.GradeSum; | |
133 | - cz_vals=parseInt(cz_val); | |
134 | - GradeName=res.data.data.GradeName; | |
132 | + if (res.data.code == 0 && res.data.data){ | |
133 | + gid=res.data.data.GradeId; | |
134 | + var cz_val = res.data.data.GradeSum; | |
135 | + cz_vals=parseInt(cz_val); | |
136 | + GradeName=res.data.data.GradeName; | |
137 | + } | |
135 | 138 | //th.setData({ cz_val: cz_vals, GradeName: res.data.data.GradeName, is_init: is_init, gradeId: gid}); |
136 | 139 | }) |
137 | 140 | var obj = { cz_val: cz_vals, GradeName:GradeName, is_init: is_init, gradeId: gid }; | ... | ... |
utils/util.js
1 | - | |
2 | 1 | function isString(str) { |
3 | 2 | return (typeof str == 'string') && str.constructor == String; |
4 | 3 | } |
... | ... | @@ -309,6 +308,11 @@ function draw_randon_rect(ctx,x,y,r,w,h){ |
309 | 308 | |
310 | 309 | } |
311 | 310 | |
311 | + | |
312 | +function null_promise(){ | |
313 | + var promise=new Promise(function(resolve, reject){ var ob={code:-1,data:null}; resolve(ob); }); return promise; | |
314 | +} | |
315 | + | |
312 | 316 | module.exports = { |
313 | 317 | formatTime: function(e, r) { |
314 | 318 | var t = e ? new Date(1e3 * e) : new Date(), n = t.getFullYear(), o = t.getMonth() + 1, a = t.getDate(), u = t.getHours(), i = t.getMinutes(), f = t.getSeconds(), s = function(e) { |
... | ... | @@ -400,5 +404,6 @@ module.exports = { |
400 | 404 | check_mobile: check_mobile,//验证手机 |
401 | 405 | get_rand_item:get_rand_item, //随机获取元素 |
402 | 406 | getDistance:getDistance, //获取俩个经纬网度之间的距离 |
403 | - draw_randon_rect:draw_randon_rect //画图画圆角矩形 | |
407 | + draw_randon_rect:draw_randon_rect ,//画图画圆角矩形 | |
408 | + null_promise:null_promise,//返回空的promise | |
404 | 409 | }; | ... | ... |