Commit a1e28b1cd2f822c49939e43e350b0816532dc276
1 parent
c5041549
幸运大转盘
Showing
11 changed files
with
704 additions
and
97 deletions
packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.js
@@ -181,6 +181,7 @@ var _utils = __webpack_require__(1); | @@ -181,6 +181,7 @@ var _utils = __webpack_require__(1); | ||
181 | 181 | ||
182 | Component({ | 182 | Component({ |
183 | properties: { | 183 | properties: { |
184 | + hiddenCanvas: { type: Boolean, value: false}, | ||
184 | width: { type: String, value: '600rpx' }, | 185 | width: { type: String, value: '600rpx' }, |
185 | height: { type: String, value: '600rpx' }, | 186 | height: { type: String, value: '600rpx' }, |
186 | blocks: { type: Array, value: [] }, | 187 | blocks: { type: Array, value: [] }, |
packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.wxml
1 | <view class="lucky-box" style="width: {{width}}; height: {{height}}"> | 1 | <view class="lucky-box" style="width: {{width}}; height: {{height}}"> |
2 | 2 | ||
3 | <canvas | 3 | <canvas |
4 | + hidden="{{hiddenCanvas}}" | ||
4 | type="2d" | 5 | type="2d" |
5 | id="lucky-wheel" | 6 | id="lucky-wheel" |
6 | canvas-id="lucky-wheel" | 7 | canvas-id="lucky-wheel" |
packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.wxss
packageB/pages/luckactivity/index/index.js
@@ -213,7 +213,8 @@ Page({ | @@ -213,7 +213,8 @@ Page({ | ||
213 | // url = e.currentTarget.dataset.url; | 213 | // url = e.currentTarget.dataset.url; |
214 | // } | 214 | // } |
215 | let id = e.currentTarget.dataset.id; | 215 | let id = e.currentTarget.dataset.id; |
216 | - let url = `/packageB/pages/luckactivity/luckinfo/luckinfo?id=${id}`; | 216 | + let title = e.currentTarget.dataset.title; |
217 | + let url = `/packageB/pages/luckactivity/luckinfo/luckinfo?id=${id}&title=${title}`; | ||
217 | app.goto(url); | 218 | app.goto(url); |
218 | }, | 219 | }, |
219 | 220 |
packageB/pages/luckactivity/index/index.wxml
@@ -19,8 +19,8 @@ | @@ -19,8 +19,8 @@ | ||
19 | </view> | 19 | </view> |
20 | <!-- 按钮 --> | 20 | <!-- 按钮 --> |
21 | <view class="btn-container"> | 21 | <view class="btn-container"> |
22 | - <view bindtap="goto" data-id="{{item.id}}" class="btn red" wx:if="{{currentIndex == 0}}">立即参与</view> | ||
23 | - <view bindtap="goto" data-id="{{item.id}}" class="btn red" wx:else>去兑换</view> | 22 | + <view bindtap="goto" data-id="{{item.id}}" data-title="{{item.act_name}}" class="btn red" wx:if="{{currentIndex == 0}}">立即参与</view> |
23 | + <view bindtap="goto" data-id="{{item.id}}" data-title="{{item.act_name}}" class="btn red" wx:else>去兑换</view> | ||
24 | </view> | 24 | </view> |
25 | </view> | 25 | </view> |
26 | </view> | 26 | </view> |
packageB/pages/luckactivity/index/index.wxss
packageB/pages/luckactivity/luckinfo/luckinfo.js
@@ -3,6 +3,12 @@ let self = null; | @@ -3,6 +3,12 @@ let self = null; | ||
3 | 3 | ||
4 | Page({ | 4 | Page({ |
5 | data: { | 5 | data: { |
6 | + start: false, | ||
7 | + list: null, | ||
8 | + isLoading: false, // 检测是否已经发送请求,防止重复发送请求 | ||
9 | + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 | ||
10 | + pageNum: 1, // 当前页数 | ||
11 | + | ||
6 | prizes: [ | 12 | prizes: [ |
7 | { fonts: [{ text: '积分', top: '18%', wordWrap:false, fontColor: 'transparent'}], | 13 | { fonts: [{ text: '积分', top: '18%', wordWrap:false, fontColor: 'transparent'}], |
8 | imgs: [ | 14 | imgs: [ |
@@ -97,8 +103,8 @@ Page({ | @@ -97,8 +103,8 @@ Page({ | ||
97 | // } | 103 | // } |
98 | { | 104 | { |
99 | radius: '60rpx', | 105 | radius: '60rpx', |
100 | - background: 'black', | ||
101 | - pointer: true, | 106 | + // background: 'black', |
107 | + // pointer: true, | ||
102 | imgs: [{ | 108 | imgs: [{ |
103 | src: 'http://201442.image.myqcloud.com/201442/0/b29290ec-aeb3-40e9-9444-8f15fd9acda3/original', | 109 | src: 'http://201442.image.myqcloud.com/201442/0/b29290ec-aeb3-40e9-9444-8f15fd9acda3/original', |
104 | width: '188rpx', | 110 | width: '188rpx', |
@@ -110,12 +116,15 @@ Page({ | @@ -110,12 +116,15 @@ Page({ | ||
110 | }, | 116 | }, |
111 | 117 | ||
112 | onLoad(options) { | 118 | onLoad(options) { |
113 | - console.log('options', options); | ||
114 | self = this; | 119 | self = this; |
115 | this.data.options = options; | 120 | this.data.options = options; |
121 | + wx.setNavigationBarTitle({ | ||
122 | + title: options.title, | ||
123 | + }); | ||
116 | app.isLogin().then(function(data) {//进入页面前已经授权登录成功 | 124 | app.isLogin().then(function(data) {//进入页面前已经授权登录成功 |
117 | self.setData({ | 125 | self.setData({ |
118 | userInfo: data, | 126 | userInfo: data, |
127 | + imghost: app.globalData.setting.imghost, | ||
119 | }); | 128 | }); |
120 | }); | 129 | }); |
121 | }, | 130 | }, |
@@ -124,44 +133,51 @@ Page({ | @@ -124,44 +133,51 @@ Page({ | ||
124 | if(app.globalData.userInfo) { | 133 | if(app.globalData.userInfo) { |
125 | if(!this.data.isLogin) { | 134 | if(!this.data.isLogin) { |
126 | 135 | ||
127 | - console.log('gl', app.globalData); | ||
128 | - | ||
129 | this.setData({ | 136 | this.setData({ |
130 | userInfo: app.globalData.userInfo, | 137 | userInfo: app.globalData.userInfo, |
131 | imghost: app.globalData.setting.imghost, | 138 | imghost: app.globalData.setting.imghost, |
132 | isLogin: true, | 139 | isLogin: true, |
133 | }); | 140 | }); |
134 | 141 | ||
142 | + console.log('imghost', this.data.imghost); | ||
135 | let user_id = app.globalData.userInfo.user_id; | 143 | let user_id = app.globalData.userInfo.user_id; |
136 | let store_id = app.globalData.setting.stoid; | 144 | let store_id = app.globalData.setting.stoid; |
137 | let id = this.data.options.id; | 145 | let id = this.data.options.id; |
138 | let url = `/api/weshop/marketing/marketingLuckForm/getLuckInfo/${store_id}/${id}/${user_id}`; | 146 | let url = `/api/weshop/marketing/marketingLuckForm/getLuckInfo/${store_id}/${id}/${user_id}`; |
139 | - console.log('url', url); | 147 | + |
148 | + | ||
140 | app.request.get(url, { | 149 | app.request.get(url, { |
141 | success: function(res) { | 150 | success: function(res) { |
142 | - // self.setData({ | ||
143 | - // details: res.data.data | ||
144 | - // }); | ||
145 | - console.log('res****', res.data.data); | ||
146 | - // let basic = res.data.data; | ||
147 | - | ||
148 | - // self.setData({ | ||
149 | - // basic, | ||
150 | - // }); | 151 | + if(res.data.code == 0) { |
152 | + self.setData({ | ||
153 | + luckInfo: res.data.data, | ||
154 | + }); | ||
155 | + } else { | ||
156 | + wx.showToast({ | ||
157 | + title: res.data.msg, | ||
158 | + icon: 'none', | ||
159 | + }); | ||
160 | + self.data.msg = res.data.msg; | ||
161 | + }; | ||
151 | 162 | ||
152 | - // if(basic.template_type == 1) { //获取模板 | ||
153 | - // let url = `/api/weshop/marketing/marketingLuckTemplate/get/${store_id}/${basic.template_id}`; | ||
154 | - // app.request.get(url, { | ||
155 | - | ||
156 | - // success: function(res) { | ||
157 | - // // console.log('prizes//////', res.data.data); | ||
158 | - // // self.setData({ | ||
159 | - // // prizes: res.data.data.pageData | ||
160 | - // // }); | ||
161 | - // }, | ||
162 | - | ||
163 | - // }); | ||
164 | - // }; | 163 | + console.log('luckInfo', res.data.data); |
164 | + let luckInfo = res.data.data; | ||
165 | + let imghost = self.data.imghost; | ||
166 | + if(luckInfo.template_type == 1) { //获取模板 | ||
167 | + let url = `/api/weshop/marketing/marketingLuckTemplate/get/${store_id}/${luckInfo.template_id}`; | ||
168 | + app.request.get(url, { | ||
169 | + success: function(res) { | ||
170 | + console.log('prizes//////', res.data.data); | ||
171 | + self.setData({ | ||
172 | + template: res.data.data, | ||
173 | + bannerUrl: imghost + res.data.data.bannerUrl, //背景图 | ||
174 | + 'blocks[0].imgs[0].src': imghost + res.data.data.wheelBaseUrl, //转盘 | ||
175 | + 'buttons[0].imgs[0].src': imghost + res.data.data.wheelPointerUrl, //指针 | ||
176 | + }); | ||
177 | + }, | ||
178 | + }); | ||
179 | + }; | ||
180 | + | ||
165 | }, | 181 | }, |
166 | }); | 182 | }); |
167 | 183 | ||
@@ -172,10 +188,14 @@ Page({ | @@ -172,10 +188,14 @@ Page({ | ||
172 | luck_formid: id, | 188 | luck_formid: id, |
173 | }, | 189 | }, |
174 | success: function(res) { | 190 | success: function(res) { |
175 | - // console.log('res//////', res.data.data.pageData); | 191 | + |
192 | + let award = res.data.data.pageData; | ||
176 | self.setData({ | 193 | self.setData({ |
177 | - prizes: res.data.data.pageData | 194 | + award, |
178 | }); | 195 | }); |
196 | + console.log('award', award); | ||
197 | + self.prizeLayout(award); | ||
198 | + | ||
179 | }, | 199 | }, |
180 | 200 | ||
181 | }); | 201 | }); |
@@ -183,33 +203,552 @@ Page({ | @@ -183,33 +203,552 @@ Page({ | ||
183 | }; | 203 | }; |
184 | }, | 204 | }, |
185 | 205 | ||
206 | + // 设置转盘奖品布局 | ||
207 | + prizeLayout(award) { | ||
208 | + let prizes = []; | ||
209 | + let length = award.length; | ||
210 | + let thx = {fonts: [{ text: '谢谢\n参与', top: '18%', wordWrap:false, fontColor: 'rgba(0,0,0,.5)'}]}; | ||
211 | + | ||
212 | + if(length == 1) { | ||
213 | + [0,2,4,6].map(function(item, index) { | ||
214 | + prizes[item] = { | ||
215 | + id: award[0].id, | ||
216 | + fonts: [{ text: award[0].luck_goods_name, top: '18%', wordWrap:false, fontColor: 'transparent'}], | ||
217 | + imgs: [ | ||
218 | + { | ||
219 | + src: self.prizeSrc(award[0].lbtype), | ||
220 | + width: '135rpx', | ||
221 | + height: '107rpx', | ||
222 | + top: '12%', | ||
223 | + } | ||
224 | + ], | ||
225 | + }; | ||
226 | + }); | ||
227 | + | ||
228 | + [1,3,5,7].map(function(item, index) { | ||
229 | + prizes[item] = thx; | ||
230 | + }); | ||
231 | + | ||
232 | + this.data.thxIndexArr = [1,3,5,7]; | ||
233 | + }; | ||
234 | + | ||
235 | + if(length == 2) { | ||
236 | + [0,4].map(function(item, index) { | ||
237 | + prizes[item] = { | ||
238 | + id: award[0].id, | ||
239 | + fonts: [{ text: award[0].luck_goods_name, top: '18%', wordWrap:false, fontColor: 'transparent'}], | ||
240 | + imgs: [ | ||
241 | + { | ||
242 | + src: self.prizeSrc(award[0].lbtype), | ||
243 | + width: '135rpx', | ||
244 | + height: '107rpx', | ||
245 | + top: '12%', | ||
246 | + } | ||
247 | + ], | ||
248 | + }; | ||
249 | + }); | ||
250 | + | ||
251 | + [2,6].map(function(item, index) { | ||
252 | + prizes[item] = { | ||
253 | + id: award[1].id, | ||
254 | + fonts: [{ text: award[1].luck_goods_name, top: '18%', wordWrap:false, fontColor: 'transparent'}], | ||
255 | + imgs: [ | ||
256 | + { | ||
257 | + src: self.prizeSrc(award[1].lbtype), | ||
258 | + width: '135rpx', | ||
259 | + height: '107rpx', | ||
260 | + top: '12%', | ||
261 | + } | ||
262 | + ], | ||
263 | + }; | ||
264 | + }); | ||
265 | + | ||
266 | + [1,3,5,7].map(function(item, index) { | ||
267 | + prizes[item] = thx; | ||
268 | + }); | ||
269 | + this.data.thxIndexArr = [1,3,5,7]; | ||
270 | + }; | ||
271 | + | ||
272 | + | ||
273 | + if(length == 3) { | ||
274 | + [0,4].map(function(item, index) { | ||
275 | + prizes[item] = { | ||
276 | + id: award[0].id, | ||
277 | + fonts: [{ text: award[0].luck_goods_name, top: '18%', wordWrap:false, fontColor: 'transparent'}], | ||
278 | + imgs: [ | ||
279 | + { | ||
280 | + src: self.prizeSrc(award[0].lbtype), | ||
281 | + width: '135rpx', | ||
282 | + height: '107rpx', | ||
283 | + top: '12%', | ||
284 | + } | ||
285 | + ], | ||
286 | + }; | ||
287 | + }); | ||
288 | + | ||
289 | + [1,5].map(function(item, index) { | ||
290 | + prizes[item] = { | ||
291 | + id: award[1].id, | ||
292 | + fonts: [{ text: award[1].luck_goods_name, top: '18%', wordWrap:false, fontColor: 'transparent'}], | ||
293 | + imgs: [ | ||
294 | + { | ||
295 | + src: self.prizeSrc(award[1].lbtype), | ||
296 | + width: '135rpx', | ||
297 | + height: '107rpx', | ||
298 | + top: '12%', | ||
299 | + } | ||
300 | + ], | ||
301 | + }; | ||
302 | + }); | ||
303 | + | ||
304 | + [2,6].map(function(item, index) { | ||
305 | + prizes[item] = { | ||
306 | + id: award[2].id, | ||
307 | + fonts: [{ text: award[2].luck_goods_name, top: '18%', wordWrap:false, fontColor: 'transparent'}], | ||
308 | + imgs: [ | ||
309 | + { | ||
310 | + src: self.prizeSrc(award[2].lbtype), | ||
311 | + width: '135rpx', | ||
312 | + height: '107rpx', | ||
313 | + top: '12%', | ||
314 | + } | ||
315 | + ], | ||
316 | + }; | ||
317 | + }); | ||
318 | + | ||
319 | + [3,7].map(function(item, index) { | ||
320 | + prizes[item] = thx; | ||
321 | + }); | ||
322 | + | ||
323 | + this.data.thxIndexArr = [3,7]; | ||
324 | + }; | ||
325 | + | ||
326 | + | ||
327 | + if(length == 4) { | ||
328 | + [0,2,4,6].map(function(item, index) { | ||
329 | + prizes[item] = { | ||
330 | + id: award[index].id, | ||
331 | + fonts: [{ text: award[index].luck_goods_name, top: '18%', wordWrap:false, fontColor: 'transparent'}], | ||
332 | + imgs: [ | ||
333 | + { | ||
334 | + src: self.prizeSrc(award[index].lbtype), | ||
335 | + width: '135rpx', | ||
336 | + height: '107rpx', | ||
337 | + top: '12%', | ||
338 | + } | ||
339 | + ], | ||
340 | + }; | ||
341 | + }); | ||
342 | + | ||
343 | + [1,3,5,7].map(function(item, index) { | ||
344 | + prizes[item] = thx; | ||
345 | + }); | ||
346 | + | ||
347 | + this.data.thxIndexArr = [1,3,5,7]; | ||
348 | + }; | ||
349 | + | ||
350 | + if(length == 5) { | ||
351 | + [0,2,3,5,6].map(function(item, index) { | ||
352 | + prizes[item] = { | ||
353 | + id: award[index].id, | ||
354 | + fonts: [{ text: award[index].luck_goods_name, top: '18%', wordWrap:false, fontColor: 'transparent'}], | ||
355 | + imgs: [ | ||
356 | + { | ||
357 | + src: self.prizeSrc(award[index].lbtype), | ||
358 | + width: '135rpx', | ||
359 | + height: '107rpx', | ||
360 | + top: '12%', | ||
361 | + } | ||
362 | + ], | ||
363 | + }; | ||
364 | + }); | ||
365 | + | ||
366 | + [1,4,7].map(function(item, index) { | ||
367 | + prizes[item] = thx; | ||
368 | + }); | ||
369 | + | ||
370 | + this.data.thxIndexArr = [1,4,7]; | ||
371 | + }; | ||
372 | + | ||
373 | + if(length == 6) { | ||
374 | + prizes = award.map(function(item, index) { | ||
375 | + return { | ||
376 | + id: item.id, | ||
377 | + fonts: [{ text: item.luck_goods_name, top: '18%', wordWrap:false, fontColor: 'transparent'}], | ||
378 | + imgs: [ | ||
379 | + { | ||
380 | + src: self.prizeSrc(item.lbtype), | ||
381 | + width: '135rpx', | ||
382 | + height: '107rpx', | ||
383 | + top: '12%', | ||
384 | + } | ||
385 | + ], | ||
386 | + }; | ||
387 | + }); | ||
388 | + | ||
389 | + prizes.push(thx); | ||
390 | + prizes.splice(3, 0, thx); | ||
391 | + | ||
392 | + this.data.thxIndexArr = [3,7]; | ||
393 | + }; | ||
394 | + | ||
395 | + console.log('prizes', prizes); | ||
396 | + | ||
397 | + this.setData({ | ||
398 | + prizes, | ||
399 | + }); | ||
400 | + }, | ||
401 | + | ||
402 | + // 根据lbtype指定奖品类别图标 | ||
403 | + prizeSrc(lbtype) { | ||
404 | + let src = ''; | ||
405 | + let imghost = this.data.imghost; | ||
406 | + switch(lbtype) { | ||
407 | + case 1: { //积分 | ||
408 | + src = imghost + 'miniapp/images/luckDraw/jf.png'; | ||
409 | + break; | ||
410 | + }; | ||
411 | + case 2: { //成长值 | ||
412 | + src = imghost + 'miniapp/images/luckDraw/czz.png'; | ||
413 | + break; | ||
414 | + }; | ||
415 | + case 3: { //优惠券 | ||
416 | + src = imghost + 'miniapp/images/luckDraw/yhq.png'; | ||
417 | + break; | ||
418 | + }; | ||
419 | + case 4: { //服务项目 | ||
420 | + src = imghost + 'miniapp/images/luckDraw/fw.png'; | ||
421 | + break; | ||
422 | + }; | ||
423 | + case 5: { //赠品 | ||
424 | + src = imghost + 'miniapp/images/luckDraw/zp.png'; | ||
425 | + break; | ||
426 | + }; | ||
427 | + case 6: { //礼包 | ||
428 | + src = imghost + 'miniapp/images/luckDraw/lb.png'; | ||
429 | + break; | ||
430 | + }; | ||
431 | + }; | ||
432 | + return src; | ||
433 | + }, | ||
434 | + | ||
435 | + // 获取抽奖结果匹配对应奖品在奖品列表里的所有索引号 | ||
436 | + luckyIndex(arr, target) { | ||
437 | + var results=[], | ||
438 | + len = arr.length, | ||
439 | + pos = 0; | ||
440 | + while(pos < len){ | ||
441 | + // pos = arr[pos].indexOf(target, pos); | ||
442 | + if(arr[pos].id == target) { | ||
443 | + results.push(pos);//找到就存储索引 | ||
444 | + | ||
445 | + }; | ||
446 | + pos+=1;//并从下个位置开始搜索 | ||
447 | + // if(pos === -1){//未找到就退出循环完成搜索 | ||
448 | + // break; | ||
449 | + // }; | ||
450 | + | ||
451 | + } | ||
452 | + // console.log('当前奖品列表', this.data.prizes); | ||
453 | + // console.log('中奖结果在当前奖品列表中的索引', results); | ||
454 | + | ||
455 | + return results; | ||
456 | + }, | ||
457 | + | ||
186 | start () { | 458 | start () { |
187 | - // 获取抽奖组件实例 | ||
188 | - const $lucky = this.selectComponent('#myLucky') | ||
189 | - // 调用play方法开始旋转 | ||
190 | - $lucky.play() | ||
191 | - // 用定时器模拟请求接口 | ||
192 | - setTimeout(() => { | ||
193 | - // 3s 后得到中奖索引 | ||
194 | - const index = Math.random() * 6 >> 0 | ||
195 | - // 调用stop方法然后缓慢停止 | ||
196 | - $lucky.stop(index) | ||
197 | - }, 3000) | 459 | + if(!this.data.luckInfo) { |
460 | + wx.showToast({ | ||
461 | + title: this.data.msg, | ||
462 | + icon: 'none', | ||
463 | + }); | ||
464 | + return; | ||
465 | + }; | ||
466 | + | ||
467 | + if(this.data.luckInfo.user_LuckNumDay != 0) { | ||
468 | + // console.log('start choujiang'); | ||
469 | + // let start = false; | ||
470 | + if(!this.data.start) { | ||
471 | + this.data.start = true; | ||
472 | + // 获取抽奖组件实例 | ||
473 | + const $lucky = this.selectComponent('#myLucky'); | ||
474 | + // 调用play方法开始旋转 | ||
475 | + $lucky.play(); | ||
476 | + | ||
477 | + // 获取抽奖结果 | ||
478 | + app.request.post('/api/weshop/marketing/marketingLuckForm/startLuck', { | ||
479 | + isShowLoading: false, | ||
480 | + data: { | ||
481 | + storeId: app.globalData.setting.stoid, | ||
482 | + userId: app.globalData.userInfo.user_id, | ||
483 | + LuckId: this.data.options.id, | ||
484 | + }, | ||
485 | + success: function(res) { | ||
486 | + | ||
487 | + // console.log('开始摇奖', res.data.data.id, res.data.data); | ||
488 | + if(res.data.code == 0) { | ||
489 | + self.setData({ | ||
490 | + 'luckInfo.user_LuckNumDay': self.data.luckInfo.user_LuckNumDay - 1 | ||
491 | + }); | ||
492 | + // console.log('请求成功', res.data.data); | ||
493 | + let luckyId = res.data.data.id; | ||
494 | + let indexArr = self.luckyIndex(self.data.prizes, luckyId); | ||
495 | + // console.log('抽奖奖品id', luckyId); | ||
496 | + // console.log('奖品列表', self.data.prizes); | ||
497 | + // console.log('奖品对应的索引数组', indexArr); | ||
498 | + let random = Math.random() * indexArr.length >> 0; | ||
499 | + // console.log('random', random); | ||
500 | + let index = indexArr[random]; | ||
501 | + setTimeout(() => { | ||
502 | + $lucky.stop(index); | ||
503 | + self.data.start = false; | ||
504 | + }, 3000); | ||
505 | + | ||
506 | + | ||
507 | + } else { | ||
508 | + console.log('请求出错'); | ||
509 | + let thxIndexArr = self.data.thxIndexArr; | ||
510 | + const random = Math.random() * thxIndexArr.length >> 0; | ||
511 | + const index = thxIndexArr[random]; | ||
512 | + // console.log('谢谢参与数组', thxIndexArr); | ||
513 | + // console.log('请求出错产生谢谢参与的随机数', index); | ||
514 | + setTimeout(() => { | ||
515 | + $lucky.stop(index); | ||
516 | + self.data.start = false; | ||
517 | + }, 3000); | ||
518 | + }; | ||
519 | + }, | ||
520 | + | ||
521 | + fail: function() { | ||
522 | + | ||
523 | + console.log('出错'); | ||
524 | + let thxIndexArr = self.data.thxIndexArr; | ||
525 | + const random = Math.random() * thxIndexArr.length >> 0; | ||
526 | + const index = thxIndexArr[random]; | ||
527 | + setTimeout(() => { | ||
528 | + $lucky.stop(index); | ||
529 | + self.data.start = false; | ||
530 | + }, 3000); | ||
531 | + }, | ||
532 | + | ||
533 | + }); | ||
534 | + | ||
535 | + } | ||
536 | + | ||
537 | + | ||
538 | + } else { | ||
539 | + wx.showToast({ | ||
540 | + title: '你今天的抽奖次数已用完啦!~', | ||
541 | + icon: 'none', | ||
542 | + }); | ||
543 | + }; | ||
544 | + | ||
198 | }, | 545 | }, |
199 | end (event) { | 546 | end (event) { |
200 | // 中奖奖品详情 | 547 | // 中奖奖品详情 |
201 | - console.log(event.detail) | 548 | + // console.log('zjiangla~~',event.detail.fonts[0].text.replace('\n','')); |
549 | + let resultTitle = event.detail.fonts[0].text.replace('\n',''); | ||
550 | + this.setData({ | ||
551 | + hiddenCanvas: true, | ||
552 | + showResult: true, | ||
553 | + showMask: true, | ||
554 | + resultTitle, | ||
555 | + }); | ||
202 | }, | 556 | }, |
203 | 557 | ||
204 | showPopup() { | 558 | showPopup() { |
205 | this.setData({ | 559 | this.setData({ |
206 | - showPopup: true, | 560 | + list: null, |
561 | + pageNum: 1, | ||
562 | + noMore: false, | ||
563 | + }); | ||
564 | + this.getData(true, '/api/weshop/marketing/marketingLuckRecord/page', { | ||
565 | + store_id: app.globalData.setting.stoid, | ||
566 | + user_id: app.globalData.userInfo.user_id, | ||
567 | + luck_formid: this.data.options.id, | ||
568 | + luck_state: 1, | ||
569 | + pageSize: 50, | ||
570 | + }).then(function(res) { | ||
571 | + self.setData({ | ||
572 | + showPopup: true, | ||
573 | + showMask: true, | ||
574 | + hiddenCanvas: true, | ||
575 | + // record: self.data.list.pageData, | ||
576 | + }); | ||
207 | }); | 577 | }); |
578 | + // app.request.get('/api/weshop/marketing/marketingLuckRecord/page', { | ||
579 | + // // isShowLoading: false, | ||
580 | + // data: { | ||
581 | + // store_id: app.globalData.setting.stoid, | ||
582 | + // user_id: app.globalData.userInfo.user_id, | ||
583 | + // luck_formid: this.data.options.id, | ||
584 | + // luck_state: 1 | ||
585 | + // }, | ||
586 | + // success: function(res) { | ||
587 | + // // console.log('中奖记录', res.data.data); | ||
588 | + // if(res.data.code == 0) { | ||
589 | + // self.setData({ | ||
590 | + // showPopup: true, | ||
591 | + // showMask: true, | ||
592 | + // hiddenCanvas: true, | ||
593 | + // record: self.data.list.pageData, | ||
594 | + // }); | ||
595 | + | ||
596 | + | ||
597 | + // }; | ||
598 | + // }, | ||
599 | + | ||
600 | + // }); | ||
601 | + | ||
208 | }, | 602 | }, |
209 | 603 | ||
210 | closePopup() { | 604 | closePopup() { |
211 | this.setData({ | 605 | this.setData({ |
212 | showPopup: false, | 606 | showPopup: false, |
607 | + showMask: false, | ||
608 | + hiddenCanvas: false, | ||
609 | + }); | ||
610 | + }, | ||
611 | + | ||
612 | + closeResult() { | ||
613 | + this.setData({ | ||
614 | + showResult: false, | ||
615 | + showMask: false, | ||
616 | + hiddenCanvas: false, | ||
617 | + }); | ||
618 | + }, | ||
619 | + | ||
620 | + loadmore() { | ||
621 | + this.scrollToLower('/api/weshop/marketing/marketingLuckRecord/page', { | ||
622 | + store_id: app.globalData.setting.stoid, | ||
623 | + user_id: app.globalData.userInfo.user_id, | ||
624 | + luck_formid: this.data.options.id, | ||
625 | + luck_state: 1, | ||
626 | + pageSize: 50, | ||
627 | + }); | ||
628 | + }, | ||
629 | + | ||
630 | + | ||
631 | + /** | ||
632 | + * 请求数据 | ||
633 | + */ | ||
634 | + getData: function(isInit, url, data) { | ||
635 | + let p = app.request.promiseGet(url, { | ||
636 | + data: data, | ||
637 | + isShowLoading: true, | ||
638 | + }) | ||
639 | + .then(function(res) { | ||
640 | + if(res.data.code == 0) { | ||
641 | + | ||
642 | + self.setData({ | ||
643 | + isLoading: false | ||
644 | + }); | ||
645 | + | ||
646 | + if(isInit) {// 第一次加载 | ||
647 | + self.setData({ | ||
648 | + list: res.data.data | ||
649 | + }); | ||
650 | + } else { | ||
651 | + self.setData({ | ||
652 | + 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData) | ||
653 | + }); | ||
654 | + }; | ||
655 | + | ||
656 | + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) { | ||
657 | + self.setData({ | ||
658 | + noMore: true | ||
659 | + }); | ||
660 | + }; | ||
661 | + | ||
662 | + } else { | ||
663 | + self.setData({ | ||
664 | + 'list.pageData': [] | ||
665 | + }); | ||
666 | + }; | ||
667 | + | ||
668 | + }); | ||
669 | + | ||
670 | + return p; | ||
671 | + }, | ||
672 | + | ||
673 | + | ||
674 | + /** | ||
675 | + * 上拉加载 | ||
676 | + */ | ||
677 | + scrollToLower(url, requestData) { | ||
678 | + // 数据总量 | ||
679 | + let total = this.data.list.total; | ||
680 | + // 单页最大数据量 | ||
681 | + let pageSize = this.data.list.pageSize; | ||
682 | + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’ | ||
683 | + if((total != 0)&&(total <= pageSize)) { | ||
684 | + this.setData({ | ||
685 | + noMore: true | ||
686 | + }); | ||
687 | + }; | ||
688 | + | ||
689 | + if(!this.data.isLoading && !this.data.noMore) { | ||
690 | + this.setData({ | ||
691 | + isLoading: true, | ||
692 | + pageNum: this.data.pageNum + 1 | ||
693 | + }); | ||
694 | + requestData.page = this.data.pageNum; | ||
695 | + this.getData(false, url, requestData); | ||
696 | + }; | ||
697 | + }, | ||
698 | + | ||
699 | + | ||
700 | + goto(e) { | ||
701 | + let url = ''; | ||
702 | + let type = e.currentTarget.dataset.type; | ||
703 | + switch(type) { | ||
704 | + case 1: { | ||
705 | + url = '/pages/user/integral/integral'; | ||
706 | + break; | ||
707 | + }; | ||
708 | + case 2: { | ||
709 | + url = '/pages/user/grow_value/grow_value'; | ||
710 | + break; | ||
711 | + }; | ||
712 | + case 3: { | ||
713 | + url = '/pages/user/coupons/coupons'; | ||
714 | + break; | ||
715 | + }; | ||
716 | + case 4: { | ||
717 | + url = '/pages/user/my_service/i_service'; | ||
718 | + break; | ||
719 | + }; | ||
720 | + case 6: { | ||
721 | + url = '/packageA/pages/myGift/myGift'; | ||
722 | + break; | ||
723 | + }; | ||
724 | + }; | ||
725 | + app.goto(url); | ||
726 | + }, | ||
727 | + | ||
728 | + showQr(e) { | ||
729 | + let store_id = app.globalData.setting.stoid; | ||
730 | + let id = e.currentTarget.dataset.id; | ||
731 | + let url = `/api/weshop/marketing/marketingLuckList/updateGoodsVerifyCode/${store_id}/${id}`; | ||
732 | + app.request.put(url, { | ||
733 | + success: function(res) { | ||
734 | + if(res.data.code == 0) { | ||
735 | + let data = res.data.data; | ||
736 | + let barcode = self.selectComponent("#qrcode"); | ||
737 | + barcode.open({val: data}); | ||
738 | + self.setData({ | ||
739 | + hiddenCanvas: true, | ||
740 | + showPopup: false, | ||
741 | + }); | ||
742 | + }; | ||
743 | + }, | ||
744 | + | ||
745 | + }); | ||
746 | + }, | ||
747 | + | ||
748 | + closeCode() { | ||
749 | + this.setData({ | ||
750 | + hiddenCanvas: false, | ||
751 | + showMask: false, | ||
213 | }); | 752 | }); |
214 | }, | 753 | }, |
215 | }) | 754 | }) |
216 | \ No newline at end of file | 755 | \ No newline at end of file |
packageB/pages/luckactivity/luckinfo/luckinfo.json
1 | { | 1 | { |
2 | "usingComponents": { | 2 | "usingComponents": { |
3 | - "lucky-wheel":"/packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index" | 3 | + "lucky-wheel":"/packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index", |
4 | + "qrcode": "/components/qr_code/qr_code", | ||
5 | + "nodata": "/components/nodata/nodata" | ||
4 | }, | 6 | }, |
5 | "enablePullDownRefresh": false, | 7 | "enablePullDownRefresh": false, |
6 | "navigationBarTitleText": "幸运大转盘" | 8 | "navigationBarTitleText": "幸运大转盘" |
packageB/pages/luckactivity/luckinfo/luckinfo.wxml
1 | +<wxs module="filter" src="../../../../utils/filter.wxs"></wxs> | ||
2 | +<wxs module="tool" src="./tool.wxs"></wxs> | ||
1 | <view class="luck-container" style="background: url('http://201442.image.myqcloud.com/201442/0/d7d0fc88-7e87-478e-a1a1-496198001521/original') no-repeat;"> | 3 | <view class="luck-container" style="background: url('http://201442.image.myqcloud.com/201442/0/d7d0fc88-7e87-478e-a1a1-496198001521/original') no-repeat;"> |
4 | +<!-- <view class="luck-container" style="background: url({{ bannerUrl}}) no-repeat;"> --> | ||
2 | <!-- 大转盘 --> | 5 | <!-- 大转盘 --> |
3 | <view class="weel-container"> | 6 | <view class="weel-container"> |
4 | - <!-- <lucky-wheel | ||
5 | - class="myLucky" | ||
6 | - id="myLucky" | ||
7 | - width="700rpx" | ||
8 | - height="700rpx" | ||
9 | - blocks="{{blocks}}" | ||
10 | - prizes="{{prizes}}" | ||
11 | - buttons="{{buttons}}" | ||
12 | - defaultConfig="{{defaultConfig}}" | ||
13 | - defaultStyle="{{defaultStyle}}" | ||
14 | - bindstart="start" | ||
15 | - bindend="end" | ||
16 | - /> --> | ||
17 | - <view class="fs28 white t-c pdv20">今天你还有 <text class="fs50 c-yellow">3</text> 次抽奖机会</view> | 7 | + <view> |
8 | + <lucky-wheel | ||
9 | + class="myLucky" | ||
10 | + id="myLucky" | ||
11 | + width="700rpx" | ||
12 | + height="700rpx" | ||
13 | + blocks="{{blocks}}" | ||
14 | + prizes="{{prizes}}" | ||
15 | + buttons="{{buttons}}" | ||
16 | + defaultConfig="{{defaultConfig}}" | ||
17 | + defaultStyle="{{defaultStyle}}" | ||
18 | + bindstart="start" | ||
19 | + bindend="end" | ||
20 | + hiddenCanvas="{{hiddenCanvas}}" | ||
21 | + /> | ||
22 | + </view> | ||
23 | + | ||
24 | + <view class="fs28 white t-c pdt10">今天你还有 <text class="fs50 c-yellow">{{filter.show_default(luckInfo.user_LuckNumDay, '0')}}</text> 次抽奖机会</view> | ||
18 | <view class="tip-to-down expand-transition"> | 25 | <view class="tip-to-down expand-transition"> |
19 | <text></text> | 26 | <text></text> |
20 | <text></text> | 27 | <text></text> |
21 | </view> | 28 | </view> |
22 | </view> | 29 | </view> |
23 | <!-- 奖品展示 --> | 30 | <!-- 奖品展示 --> |
24 | - <view wx:if="{{prizes.length != 0}}"> | ||
25 | - <view class="badge-container"><image src="../../../images/luckDraw/badge.png" class="badge prizes"></image></view> | 31 | + <view> |
32 | + <view class="badge-container"><image src="{{imghost + 'miniapp/images/luckDraw/badge.png'}}" class="badge prizes"></image></view> | ||
26 | <view class="list br12 bg-white"> | 33 | <view class="list br12 bg-white"> |
27 | - <view class="list-item" wx:for="{{prizes}}"> | 34 | + <view class="list-item" wx:for="{{award}}"> |
28 | <view class="img-container"> | 35 | <view class="img-container"> |
29 | <image wx:if="{{item.luck_goods_img}}" src="{{item.luck_goods_img}}" class="img" mode="aspectFit"></image> | 36 | <image wx:if="{{item.luck_goods_img}}" src="{{item.luck_goods_img}}" class="img" mode="aspectFit"></image> |
30 | - <image wx:else src="{{imghost + 'miniapp/images/default_g_img.gif'}}" class="img" mode="aspectFit"></image> | 37 | + <image wx:else src="{{imghost + tool.showDefaultImg(item.lbtype)}}" class="img" mode="aspectFit"></image> |
31 | </view> | 38 | </view> |
32 | <view class="item-r"> | 39 | <view class="item-r"> |
33 | - <view class="fs26">{{item.luck_goods_name}}</view> | ||
34 | - <view class="flex jc_sb fs24 c9"> | 40 | + <view class="fs28">{{item.luck_goods_name}}</view> |
41 | + <view class="flex jc_sb fs26 c9"> | ||
35 | <view>价值:<text class="rmb">{{item.luck_goods_price}}</text></view> | 42 | <view>价值:<text class="rmb">{{item.luck_goods_price}}</text></view> |
36 | <view>数量:{{item.luck_goods_qty}}</view> | 43 | <view>数量:{{item.luck_goods_qty}}</view> |
37 | </view> | 44 | </view> |
@@ -41,7 +48,7 @@ | @@ -41,7 +48,7 @@ | ||
41 | </view> | 48 | </view> |
42 | <!-- 活动展示 --> | 49 | <!-- 活动展示 --> |
43 | <view wx:if="{{basic.remark}}"> | 50 | <view wx:if="{{basic.remark}}"> |
44 | - <view class="badge-container"><image src="../../../images/luckDraw/badge.png" class="badge activity"></image></view> | 51 | + <view class="badge-container"><image src="{{imghost + 'miniapp/images/luckDraw/badge.png'}}" class="badge activity"></image></view> |
45 | <view class="bg-white br12 pd20"> | 52 | <view class="bg-white br12 pd20"> |
46 | {{basic.remark}} | 53 | {{basic.remark}} |
47 | <!-- 时间 --> | 54 | <!-- 时间 --> |
@@ -98,7 +105,7 @@ | @@ -98,7 +105,7 @@ | ||
98 | <!-- 技术支持 --> | 105 | <!-- 技术支持 --> |
99 | <view class="t-c"> | 106 | <view class="t-c"> |
100 | <!-- <view class="pdt20 fs26 text-underline">帮美店免费开通这个玩法</view> --> | 107 | <!-- <view class="pdt20 fs26 text-underline">帮美店免费开通这个玩法</view> --> |
101 | - <view class="flex ai_c fs24 jc-center pdv20"><image src="../../../images/luckDraw/logo.png" class="logo"></image>提供技术支持</view> | 108 | + <view class="flex ai_c fs24 jc-center pdv20 white"><image src="{{imghost + 'miniapp/images/luckDraw/logo.png'}}" class="logo"></image>提供技术支持</view> |
102 | </view> | 109 | </view> |
103 | </view> | 110 | </view> |
104 | 111 | ||
@@ -107,40 +114,52 @@ | @@ -107,40 +114,52 @@ | ||
107 | 114 | ||
108 | <!-- 弹窗 --> | 115 | <!-- 弹窗 --> |
109 | <view class="popup-container" wx:if="{{showPopup}}"> | 116 | <view class="popup-container" wx:if="{{showPopup}}"> |
110 | - <view class="popup-list"> | ||
111 | - <view class="popup-item"> | ||
112 | - <view class="img-container"><image src="../../../images/luckDraw/badge.png" class="img"></image></view> | ||
113 | - <view class="flex fdc"> | ||
114 | - <view class="ellipsis-2">我是标题我是标题我是标题我是标题我是标题我是标题我是标题我是标题我是标题我是标题我是标题</view> | 117 | + <scroll-view class="popup-list" scroll-y bindscrolltolower="loadmore"> |
118 | + <view class="popup-item" wx:for="{{list.pageData}}"> | ||
119 | + <view class="img-container"> | ||
120 | + <image wx:if="{{item.luck_goods_img}}" src="{{item.luck_goods_img}}" class="img" mode="aspectFit"></image> | ||
121 | + <image wx:else src="{{imghost + tool.showDefaultImg(item.luck_type)}}" class="img" mode="aspectFit"></image> | ||
122 | + </view> | ||
123 | + <view class="flex fdc f1"> | ||
124 | + <view class="ellipsis-2">{{item.luck_name}}</view> | ||
115 | <view class="pdt20"> | 125 | <view class="pdt20"> |
116 | - <view class="fs26 xc-black3">价值:<text class="rmb">1800</text></view> | ||
117 | - <view class="flex ai_c jc_sb fs26 xc-black3"> | ||
118 | - <view>兑换状态:未兑换</view> | ||
119 | - <view class="btn">兑换</view> | 126 | + <view class="fs26 xc-black3">价值:<text class="rmb">{{item.luck_goods_price}}</text></view> |
127 | + <view class="flex ai_c jc_sb fs26 xc-black3 "> | ||
128 | + <view style="visibility: {{item.luck_type == 5 ? 'visible':'hidden'}};">兑换状态:{{item.state == 0 ? '未兑换':'已兑换'}}</view> | ||
129 | + <view class="btn" bindtap="{{item.luck_type == 5 ? (item.state == 0 ? 'showQr':''):'goto'}}" data-type="{{item.luck_type}}" data-id="{{item.id}}">{{((item.luck_type == 5)&&(item.state == 1)) ? '已兑换':'兑换'}}</view> | ||
120 | </view> | 130 | </view> |
121 | </view> | 131 | </view> |
122 | </view> | 132 | </view> |
123 | </view> | 133 | </view> |
124 | - </view> | 134 | + <nodata nodataContainer="t-c" wx:if="{{list.pageData.length == 0}}"></nodata> |
135 | + <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">—— 已经到底了 ——</view> | ||
136 | + </scroll-view> | ||
125 | <view class="close-container" bindtap="closePopup"><text class="iconfont icon-close"></text></view> | 137 | <view class="close-container" bindtap="closePopup"><text class="iconfont icon-close"></text></view> |
126 | </view> | 138 | </view> |
127 | 139 | ||
128 | 140 | ||
129 | -<view class="popup-container2"> | ||
130 | - <view class="t-r"><text class="iconfont icon-close white"></text></view> | 141 | +<view class="popup-container2" wx:if="{{showResult}}"> |
142 | + <view class="t-r"><text class="iconfont icon-close white" bindtap="closeResult"></text></view> | ||
131 | <view class="popup"> | 143 | <view class="popup"> |
132 | <view class="t-c"> | 144 | <view class="t-c"> |
133 | - <view class="bold c-tb">恭喜你获得</view> | ||
134 | - <view class="pdt10">奖品名称</view> | ||
135 | - </view> | ||
136 | - <view class="img-container2"><image src="../../../images/luckDraw/gift.png" class="img"></image></view> | ||
137 | - <view class="flex jc-center mgt30 mgb20"> | ||
138 | - <view class="btn btn2">立即领取</view> | 145 | + <block wx:if="{{resultTitle == '谢谢参与'}}"> |
146 | + <view class="bold c-tb">{{resultTitle}}</view> | ||
147 | + </block> | ||
148 | + <block wx:else> | ||
149 | + <view class="bold c-tb">恭喜你获得</view> | ||
150 | + <view class="pdt10">{{resultTitle}}</view> | ||
151 | + </block> | ||
139 | </view> | 152 | </view> |
140 | - <view class="note">注:未领取就关闭弹窗视为主动放弃奖品。</view> | 153 | + <view class="img-container2"><image src="{{imghost + 'miniapp/images/luckDraw/gift.png'}}" class="img"></image></view> |
154 | + <!-- <view class="flex jc-center mgt30 mgb20"> | ||
155 | + <view class="btn btn2" bindtap="closeResult">再抽一次</view> | ||
156 | + </view> --> | ||
157 | + <!-- <view class="note">注:未领取就关闭弹窗视为主动放弃奖品。</view> --> | ||
141 | </view> | 158 | </view> |
142 | </view> | 159 | </view> |
143 | 160 | ||
144 | 161 | ||
145 | <!-- 遮罩层 --> | 162 | <!-- 遮罩层 --> |
146 | -<view class="mask" wx:if="{{showPopup}}"></view> | ||
147 | \ No newline at end of file | 163 | \ No newline at end of file |
164 | +<view class="mask" wx:if="{{showMask}}"></view> | ||
165 | + | ||
166 | +<qrcode id="qrcode" bindtap="closeCode"></qrcode> | ||
148 | \ No newline at end of file | 167 | \ No newline at end of file |
packageB/pages/luckactivity/luckinfo/luckinfo.wxss
@@ -68,7 +68,7 @@ page, | @@ -68,7 +68,7 @@ page, | ||
68 | width: 140rpx; | 68 | width: 140rpx; |
69 | height: 140rpx; | 69 | height: 140rpx; |
70 | margin-right: 20rpx; | 70 | margin-right: 20rpx; |
71 | - background-color: gray; | 71 | + /* background-color: gray; */ |
72 | } | 72 | } |
73 | 73 | ||
74 | .img { | 74 | .img { |
@@ -227,11 +227,12 @@ page, | @@ -227,11 +227,12 @@ page, | ||
227 | z-index: 1; | 227 | z-index: 1; |
228 | padding: 0 20rpx; | 228 | padding: 0 20rpx; |
229 | box-sizing: border-box; | 229 | box-sizing: border-box; |
230 | + z-index: 998; | ||
230 | } | 231 | } |
231 | 232 | ||
232 | .popup-container .img-container { | 233 | .popup-container .img-container { |
233 | - width: 200rpx; | ||
234 | - height: 200rpx; | 234 | + width: 140rpx; |
235 | + height: 140rpx; | ||
235 | flex-shrink: 0; | 236 | flex-shrink: 0; |
236 | } | 237 | } |
237 | 238 | ||
@@ -326,22 +327,22 @@ page, | @@ -326,22 +327,22 @@ page, | ||
326 | height: 100%; | 327 | height: 100%; |
327 | top: 0; | 328 | top: 0; |
328 | background-color: rgba(0,0,0,.5); | 329 | background-color: rgba(0,0,0,.5); |
329 | - /* z-index: 999; */ | 330 | + z-index: 1; |
330 | } | 331 | } |
331 | 332 | ||
332 | 333 | ||
333 | .popup-container2 { | 334 | .popup-container2 { |
334 | - display: none; | ||
335 | position: fixed; | 335 | position: fixed; |
336 | top: 50%; | 336 | top: 50%; |
337 | left: 50%; | 337 | left: 50%; |
338 | transform: translate(-50%, -50%); | 338 | transform: translate(-50%, -50%); |
339 | + z-index: 999; | ||
339 | } | 340 | } |
340 | 341 | ||
341 | .popup { | 342 | .popup { |
342 | background-color: white; | 343 | background-color: white; |
343 | border-radius: 12rpx; | 344 | border-radius: 12rpx; |
344 | - padding: 20rpx 40rpx; | 345 | + padding: 40rpx; |
345 | margin-top: 20rpx; | 346 | margin-top: 20rpx; |
346 | } | 347 | } |
347 | 348 | ||
@@ -363,4 +364,11 @@ page, | @@ -363,4 +364,11 @@ page, | ||
363 | 364 | ||
364 | .c-tb { | 365 | .c-tb { |
365 | color: #ff6200; | 366 | color: #ff6200; |
367 | +} | ||
368 | + | ||
369 | +.noMore { | ||
370 | + padding: 20rpx; | ||
371 | + color: #bbb; | ||
372 | + text-align: center; | ||
373 | + font-size: 22rpx; | ||
366 | } | 374 | } |
367 | \ No newline at end of file | 375 | \ No newline at end of file |
packageB/pages/luckactivity/luckinfo/tool.wxs
0 → 100644
1 | +var tools = { | ||
2 | + showDefaultImg: function(type) { | ||
3 | + var src = ''; | ||
4 | + switch(type) { | ||
5 | + case 1: { //积分 | ||
6 | + src = 'miniapp/images/luckDraw/jf.png'; | ||
7 | + break; | ||
8 | + }; | ||
9 | + case 2: { //成长值 | ||
10 | + src = 'miniapp/images/luckDraw/czz.png'; | ||
11 | + break; | ||
12 | + }; | ||
13 | + case 3: { //优惠券 | ||
14 | + src = 'miniapp/images/luckDraw/yhq.png'; | ||
15 | + break; | ||
16 | + }; | ||
17 | + case 4: { //服务项目 | ||
18 | + src = 'miniapp/images/luckDraw/fw.png'; | ||
19 | + break; | ||
20 | + }; | ||
21 | + case 5: { //赠品 | ||
22 | + src = 'miniapp/images/luckDraw/zp.png'; | ||
23 | + break; | ||
24 | + }; | ||
25 | + case 6: { //礼包 | ||
26 | + src = 'miniapp/images/luckDraw/lb.png'; | ||
27 | + break; | ||
28 | + }; | ||
29 | + }; | ||
30 | + return src; | ||
31 | + }, | ||
32 | +}; | ||
33 | + | ||
34 | +module.exports = { | ||
35 | + showDefaultImg: tools.showDefaultImg, | ||
36 | +} | ||
0 | \ No newline at end of file | 37 | \ No newline at end of file |