Commit c4d77059b31c5f0c309ff5e4b287313040dfc98c
1 parent
0e77eba8
中奖提示组件
Showing
4 changed files
with
102 additions
and
0 deletions
components/show_encourage/show_encourage.js
0 → 100644
1 | +// components/show_encourage/show_encourage.js | ||
2 | +var setting = getApp().globalData.setting | ||
3 | + | ||
4 | +Component({ | ||
5 | + /** | ||
6 | + * 组件的属性列表 | ||
7 | + */ | ||
8 | + properties: { | ||
9 | + | ||
10 | + }, | ||
11 | + | ||
12 | + /** | ||
13 | + * 组件的初始数据 | ||
14 | + */ | ||
15 | + data: { | ||
16 | + url: setting.imghost, | ||
17 | + show:false, | ||
18 | + itemobj:null, | ||
19 | + }, | ||
20 | + pageLifetimes: { | ||
21 | + show: function() { | ||
22 | + // console.error('show'); | ||
23 | + // this.get_encourage() | ||
24 | + // 页面被展示 | ||
25 | + }, | ||
26 | + hide: function() { | ||
27 | + // 页面被隐藏 | ||
28 | + }, | ||
29 | + resize: function(size) { | ||
30 | + // 页面尺寸变化 | ||
31 | + } | ||
32 | + }, | ||
33 | + /** | ||
34 | + * 组件的方法列表 | ||
35 | + */ | ||
36 | + methods: { | ||
37 | + async get_encourage(){ | ||
38 | + let user_id = getApp().globalData.user_id; | ||
39 | + let store_id= getApp().globalData.setting.stoid | ||
40 | + console.error('获取大转盘'); | ||
41 | + if (!user_id) { | ||
42 | + return | ||
43 | + } | ||
44 | + await getApp().request.promiseGet(`/api/weshop/marketing/marketingLuckForm/getPayTopLuckInfo/${store_id}/${user_id}`, {}).then(res => { | ||
45 | + if (res.data.code==0 && res.data.data) { | ||
46 | + let gd_category = res.data.data; | ||
47 | + this.setData({ | ||
48 | + itemobj: gd_category, | ||
49 | + show:true, | ||
50 | + }); | ||
51 | + } | ||
52 | + }) | ||
53 | + }, | ||
54 | + close_disgraceful(){ | ||
55 | + this.setData({ | ||
56 | + show:false | ||
57 | + }) | ||
58 | + }, | ||
59 | + goto(){ | ||
60 | + let item = this.data.itemobj | ||
61 | + let id = item.id; | ||
62 | + let title = item.act_name; | ||
63 | + if (!id) { | ||
64 | + this.setData({ | ||
65 | + show:false | ||
66 | + }) | ||
67 | + return | ||
68 | + } | ||
69 | + let url = `/packageB/pages/luckactivity/luckinfo/luckinfo?id=${id}&title=${title}`; | ||
70 | + getApp().goto(url); | ||
71 | + } | ||
72 | + } | ||
73 | +}) |
components/show_encourage/show_encourage.json
0 → 100644
components/show_encourage/show_encourage.wxml
0 → 100644
1 | +<!--components/show_encourage/show_encourage.wxml--> | ||
2 | +<view class="encourage" wx:if="{{show}}"> | ||
3 | + <image catchtap="goto" src="{{url}}/miniapp/images/pay/encourage.gif" style="width: 600rpx;height: 575rpx;"></image> | ||
4 | + <image class="close" src="{{url}}/miniapp/images/plus/Close.png" catchtap="close_disgraceful" mode="" /> | ||
5 | +</view> |
components/show_encourage/show_encourage.wxss
0 → 100644
1 | +/* components/show_encourage/show_encourage.wxss */ | ||
2 | + | ||
3 | +.encourage{ | ||
4 | + position: fixed; | ||
5 | + top: 0; | ||
6 | + left: 0; | ||
7 | + width: 100vw; | ||
8 | + height: 100vh; | ||
9 | + z-index: 99999; | ||
10 | + display: flex; | ||
11 | + flex-direction: column; | ||
12 | + align-items: center; | ||
13 | + justify-content: center; | ||
14 | + background-color: rgba(0, 0, 0, .3); | ||
15 | +} | ||
16 | +.close { | ||
17 | + width: 60rpx; | ||
18 | + height: 60rpx; | ||
19 | + | ||
20 | +} | ||
0 | \ No newline at end of file | 21 | \ No newline at end of file |