Commit a3e89263289ce30dd1e66bd8e4a45cc91f141b4d
1 parent
7b06cbe8
幸运大转盘修改
Showing
2 changed files
with
34 additions
and
17 deletions
packageB/pages/luckactivity/luckinfo/luckinfo.js
| @@ -828,6 +828,10 @@ Page({ | @@ -828,6 +828,10 @@ Page({ | ||
| 828 | }, | 828 | }, |
| 829 | 829 | ||
| 830 | start () { | 830 | start () { |
| 831 | + // self.data.start = true; | ||
| 832 | + if(this.data.start) return; | ||
| 833 | + this.data.start = true; | ||
| 834 | + | ||
| 831 | if(!this.data.luckInfo) { | 835 | if(!this.data.luckInfo) { |
| 832 | wx.showToast({ | 836 | wx.showToast({ |
| 833 | title: this.data.msg, | 837 | title: this.data.msg, |
| @@ -836,7 +840,7 @@ Page({ | @@ -836,7 +840,7 @@ Page({ | ||
| 836 | return; | 840 | return; |
| 837 | }; | 841 | }; |
| 838 | 842 | ||
| 839 | - if(self.data.luckInfo.msgInfo) { | 843 | + if(this.data.luckInfo.msgInfo) { |
| 840 | wx.showToast({ | 844 | wx.showToast({ |
| 841 | title: self.data.luckInfo.msgInfo, | 845 | title: self.data.luckInfo.msgInfo, |
| 842 | icon: 'none', | 846 | icon: 'none', |
| @@ -860,6 +864,9 @@ Page({ | @@ -860,6 +864,9 @@ Page({ | ||
| 860 | wx.showToast({ | 864 | wx.showToast({ |
| 861 | title: res.data.msg, | 865 | title: res.data.msg, |
| 862 | icon: 'none', | 866 | icon: 'none', |
| 867 | + success: function() { | ||
| 868 | + self.data.start = false; | ||
| 869 | + } | ||
| 863 | }); | 870 | }); |
| 864 | return; | 871 | return; |
| 865 | }; | 872 | }; |
| @@ -869,8 +876,8 @@ Page({ | @@ -869,8 +876,8 @@ Page({ | ||
| 869 | if(self.data.luckInfo.user_LuckNumDay > 0 || self.data.luckInfo.vip_act_num == 0) { | 876 | if(self.data.luckInfo.user_LuckNumDay > 0 || self.data.luckInfo.vip_act_num == 0) { |
| 870 | // console.log('start choujiang'); | 877 | // console.log('start choujiang'); |
| 871 | // let start = false; | 878 | // let start = false; |
| 872 | - if(!self.data.start) { | ||
| 873 | - self.data.start = true; | 879 | + if(self.data.start) { |
| 880 | + // self.data.start = true; | ||
| 874 | // 获取抽奖组件实例 | 881 | // 获取抽奖组件实例 |
| 875 | const $lucky = self.selectComponent('#myLucky'); | 882 | const $lucky = self.selectComponent('#myLucky'); |
| 876 | // 调用play方法开始旋转 | 883 | // 调用play方法开始旋转 |
| @@ -910,10 +917,14 @@ Page({ | @@ -910,10 +917,14 @@ Page({ | ||
| 910 | let random = Math.random() * indexArr.length >> 0; | 917 | let random = Math.random() * indexArr.length >> 0; |
| 911 | // console.log('random', random); | 918 | // console.log('random', random); |
| 912 | let index = indexArr[random]; | 919 | let index = indexArr[random]; |
| 913 | - setTimeout(() => { | ||
| 914 | - $lucky.stop(index); | ||
| 915 | - self.data.start = false; | ||
| 916 | - }, 3000); | 920 | + |
| 921 | + $lucky.stop(index); | ||
| 922 | + // setTimeout(() => { | ||
| 923 | + // Promise.resolve($lucky.stop(index)).then(()=>{ | ||
| 924 | + // self.data.start = false; | ||
| 925 | + // }); | ||
| 926 | + | ||
| 927 | + // }, 2000); | ||
| 917 | 928 | ||
| 918 | 929 | ||
| 919 | //获取兑奖记录 | 930 | //获取兑奖记录 |
| @@ -942,10 +953,12 @@ Page({ | @@ -942,10 +953,12 @@ Page({ | ||
| 942 | const index = thxIndexArr[random]; | 953 | const index = thxIndexArr[random]; |
| 943 | // console.log('谢谢参与数组', thxIndexArr); | 954 | // console.log('谢谢参与数组', thxIndexArr); |
| 944 | // console.log('请求出错产生谢谢参与的随机数', index); | 955 | // console.log('请求出错产生谢谢参与的随机数', index); |
| 945 | - setTimeout(() => { | ||
| 946 | - $lucky.stop(index); | ||
| 947 | - self.data.start = false; | ||
| 948 | - }, 3000); | 956 | + $lucky.stop(index); |
| 957 | + // setTimeout(() => { | ||
| 958 | + // Promise.resolve($lucky.stop(index)).then(()=>{ | ||
| 959 | + // self.data.start = false; | ||
| 960 | + // }); | ||
| 961 | + // }, 2000); | ||
| 949 | 962 | ||
| 950 | 963 | ||
| 951 | 964 | ||
| @@ -982,10 +995,12 @@ Page({ | @@ -982,10 +995,12 @@ Page({ | ||
| 982 | let thxIndexArr = self.data.thxIndexArr; | 995 | let thxIndexArr = self.data.thxIndexArr; |
| 983 | const random = Math.random() * thxIndexArr.length >> 0; | 996 | const random = Math.random() * thxIndexArr.length >> 0; |
| 984 | const index = thxIndexArr[random]; | 997 | const index = thxIndexArr[random]; |
| 985 | - setTimeout(() => { | ||
| 986 | - $lucky.stop(index); | ||
| 987 | - self.data.start = false; | ||
| 988 | - }, 3000); | 998 | + $lucky.stop(index); |
| 999 | + // setTimeout(() => { | ||
| 1000 | + // Promise.resolve($lucky.stop(index)).then(()=>{ | ||
| 1001 | + // self.data.start = false; | ||
| 1002 | + // }); | ||
| 1003 | + // }, 2000); | ||
| 989 | }, | 1004 | }, |
| 990 | 1005 | ||
| 991 | 1006 | ||
| @@ -1012,8 +1027,9 @@ Page({ | @@ -1012,8 +1027,9 @@ Page({ | ||
| 1012 | 1027 | ||
| 1013 | }, | 1028 | }, |
| 1014 | end (event) { | 1029 | end (event) { |
| 1030 | + | ||
| 1015 | // 中奖奖品详情 | 1031 | // 中奖奖品详情 |
| 1016 | - console.log('抽奖结果:',event.detail); | 1032 | + // console.log('抽奖结果:',event.detail); |
| 1017 | let no_luck_urltype = this.data.luckInfo.no_luck_urltype; | 1033 | let no_luck_urltype = this.data.luckInfo.no_luck_urltype; |
| 1018 | let lbtype = null; | 1034 | let lbtype = null; |
| 1019 | // let good_id = null; | 1035 | // let good_id = null; |
| @@ -1148,6 +1164,7 @@ Page({ | @@ -1148,6 +1164,7 @@ Page({ | ||
| 1148 | showResult: false, | 1164 | showResult: false, |
| 1149 | showMask: false, | 1165 | showMask: false, |
| 1150 | hiddenCanvas: false, | 1166 | hiddenCanvas: false, |
| 1167 | + start: false, | ||
| 1151 | }); | 1168 | }); |
| 1152 | }, | 1169 | }, |
| 1153 | 1170 |
packageB/pages/luckactivity/luckinfo/luckinfo.wxml
| @@ -130,7 +130,7 @@ | @@ -130,7 +130,7 @@ | ||
| 130 | <view class="circle-container gift {{((record && record.length != 0) || isActive) ? 'active':''}}" bindtap="showPopup"><text class="iconfont icon-liwu"></text></view> | 130 | <view class="circle-container gift {{((record && record.length != 0) || isActive) ? 'active':''}}" bindtap="showPopup"><text class="iconfont icon-liwu"></text></view> |
| 131 | 131 | ||
| 132 | <!-- 弹窗 --> | 132 | <!-- 弹窗 --> |
| 133 | -<view class="popup-container" wx:if="{{showPopup}}"> | 133 | +<view class="popup-container" wx:if="{{showPopup}}" catchtouchmove="true"> |
| 134 | <scroll-view class="popup-list" scroll-y bindscrolltolower="loadmore"> | 134 | <scroll-view class="popup-list" scroll-y bindscrolltolower="loadmore"> |
| 135 | <view class="popup-item" wx:for="{{list.pageData}}"> | 135 | <view class="popup-item" wx:for="{{list.pageData}}"> |
| 136 | <view class="img-container"> | 136 | <view class="img-container"> |