Commit a3e89263289ce30dd1e66bd8e4a45cc91f141b4d

Authored by taiyuan
1 parent 7b06cbe8

幸运大转盘修改

packageB/pages/luckactivity/luckinfo/luckinfo.js
... ... @@ -828,6 +828,10 @@ Page({
828 828 },
829 829  
830 830 start () {
  831 + // self.data.start = true;
  832 + if(this.data.start) return;
  833 + this.data.start = true;
  834 +
831 835 if(!this.data.luckInfo) {
832 836 wx.showToast({
833 837 title: this.data.msg,
... ... @@ -836,7 +840,7 @@ Page({
836 840 return;
837 841 };
838 842  
839   - if(self.data.luckInfo.msgInfo) {
  843 + if(this.data.luckInfo.msgInfo) {
840 844 wx.showToast({
841 845 title: self.data.luckInfo.msgInfo,
842 846 icon: 'none',
... ... @@ -860,6 +864,9 @@ Page({
860 864 wx.showToast({
861 865 title: res.data.msg,
862 866 icon: 'none',
  867 + success: function() {
  868 + self.data.start = false;
  869 + }
863 870 });
864 871 return;
865 872 };
... ... @@ -869,8 +876,8 @@ Page({
869 876 if(self.data.luckInfo.user_LuckNumDay > 0 || self.data.luckInfo.vip_act_num == 0) {
870 877 // console.log('start choujiang');
871 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 882 const $lucky = self.selectComponent('#myLucky');
876 883 // 调用play方法开始旋转
... ... @@ -910,10 +917,14 @@ Page({
910 917 let random = Math.random() * indexArr.length >> 0;
911 918 // console.log('random', random);
912 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 953 const index = thxIndexArr[random];
943 954 // console.log('谢谢参与数组', thxIndexArr);
944 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 995 let thxIndexArr = self.data.thxIndexArr;
983 996 const random = Math.random() * thxIndexArr.length >> 0;
984 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 1027  
1013 1028 },
1014 1029 end (event) {
  1030 +
1015 1031 // 中奖奖品详情
1016   - console.log('抽奖结果:',event.detail);
  1032 + // console.log('抽奖结果:',event.detail);
1017 1033 let no_luck_urltype = this.data.luckInfo.no_luck_urltype;
1018 1034 let lbtype = null;
1019 1035 // let good_id = null;
... ... @@ -1148,6 +1164,7 @@ Page({
1148 1164 showResult: false,
1149 1165 showMask: false,
1150 1166 hiddenCanvas: false,
  1167 + start: false,
1151 1168 });
1152 1169 },
1153 1170  
... ...
packageB/pages/luckactivity/luckinfo/luckinfo.wxml
... ... @@ -130,7 +130,7 @@
130 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 134 <scroll-view class="popup-list" scroll-y bindscrolltolower="loadmore">
135 135 <view class="popup-item" wx:for="{{list.pageData}}">
136 136 <view class="img-container">
... ...