Commit fa028c576d6779f32af1ffc9ca0127fb674f26cb

Authored by yvan.ni
2 parents 6b82ce5c 3f589afa

Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev

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,14 +840,16 @@ Page({ @@ -836,14 +840,16 @@ 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',
843 }); 847 });
844 return; 848 return;
845 }; 849 };
846 - 850 + wx.showLoading({
  851 + title: '准备抽奖中'
  852 + });
847 // 获取积分 853 // 获取积分
848 app.request.promisePost('/api/weshop/marketing/marketingLuckForm/startLuckIntegral', { 854 app.request.promisePost('/api/weshop/marketing/marketingLuckForm/startLuckIntegral', {
849 isShowLoading: false, 855 isShowLoading: false,
@@ -860,6 +866,9 @@ Page({ @@ -860,6 +866,9 @@ Page({
860 wx.showToast({ 866 wx.showToast({
861 title: res.data.msg, 867 title: res.data.msg,
862 icon: 'none', 868 icon: 'none',
  869 + success: function() {
  870 + self.data.start = false;
  871 + }
863 }); 872 });
864 return; 873 return;
865 }; 874 };
@@ -869,13 +878,13 @@ Page({ @@ -869,13 +878,13 @@ Page({
869 if(self.data.luckInfo.user_LuckNumDay > 0 || self.data.luckInfo.vip_act_num == 0) { 878 if(self.data.luckInfo.user_LuckNumDay > 0 || self.data.luckInfo.vip_act_num == 0) {
870 // console.log('start choujiang'); 879 // console.log('start choujiang');
871 // let start = false; 880 // let start = false;
872 - if(!self.data.start) {  
873 - self.data.start = true; 881 + if(self.data.start) {
  882 + // self.data.start = true;
874 // 获取抽奖组件实例 883 // 获取抽奖组件实例
875 const $lucky = self.selectComponent('#myLucky'); 884 const $lucky = self.selectComponent('#myLucky');
876 // 调用play方法开始旋转 885 // 调用play方法开始旋转
877 $lucky.play(); 886 $lucky.play();
878 - 887 + wx.hideLoading();
879 // 获取抽奖结果 888 // 获取抽奖结果
880 app.request.post('/api/weshop/marketing/marketingLuckForm/startLuck', { 889 app.request.post('/api/weshop/marketing/marketingLuckForm/startLuck', {
881 isShowLoading: false, 890 isShowLoading: false,
@@ -910,10 +919,14 @@ Page({ @@ -910,10 +919,14 @@ Page({
910 let random = Math.random() * indexArr.length >> 0; 919 let random = Math.random() * indexArr.length >> 0;
911 // console.log('random', random); 920 // console.log('random', random);
912 let index = indexArr[random]; 921 let index = indexArr[random];
913 - setTimeout(() => {  
914 - $lucky.stop(index);  
915 - self.data.start = false;  
916 - }, 3000); 922 +
  923 + $lucky.stop(index);
  924 + // setTimeout(() => {
  925 + // Promise.resolve($lucky.stop(index)).then(()=>{
  926 + // self.data.start = false;
  927 + // });
  928 +
  929 + // }, 2000);
917 930
918 931
919 //获取兑奖记录 932 //获取兑奖记录
@@ -942,10 +955,12 @@ Page({ @@ -942,10 +955,12 @@ Page({
942 const index = thxIndexArr[random]; 955 const index = thxIndexArr[random];
943 // console.log('谢谢参与数组', thxIndexArr); 956 // console.log('谢谢参与数组', thxIndexArr);
944 // console.log('请求出错产生谢谢参与的随机数', index); 957 // console.log('请求出错产生谢谢参与的随机数', index);
945 - setTimeout(() => {  
946 - $lucky.stop(index);  
947 - self.data.start = false;  
948 - }, 3000); 958 + $lucky.stop(index);
  959 + // setTimeout(() => {
  960 + // Promise.resolve($lucky.stop(index)).then(()=>{
  961 + // self.data.start = false;
  962 + // });
  963 + // }, 2000);
949 964
950 965
951 966
@@ -982,10 +997,12 @@ Page({ @@ -982,10 +997,12 @@ Page({
982 let thxIndexArr = self.data.thxIndexArr; 997 let thxIndexArr = self.data.thxIndexArr;
983 const random = Math.random() * thxIndexArr.length >> 0; 998 const random = Math.random() * thxIndexArr.length >> 0;
984 const index = thxIndexArr[random]; 999 const index = thxIndexArr[random];
985 - setTimeout(() => {  
986 - $lucky.stop(index);  
987 - self.data.start = false;  
988 - }, 3000); 1000 + $lucky.stop(index);
  1001 + // setTimeout(() => {
  1002 + // Promise.resolve($lucky.stop(index)).then(()=>{
  1003 + // self.data.start = false;
  1004 + // });
  1005 + // }, 2000);
989 }, 1006 },
990 1007
991 1008
@@ -1012,8 +1029,9 @@ Page({ @@ -1012,8 +1029,9 @@ Page({
1012 1029
1013 }, 1030 },
1014 end (event) { 1031 end (event) {
  1032 +
1015 // 中奖奖品详情 1033 // 中奖奖品详情
1016 - console.log('抽奖结果:',event.detail); 1034 + // console.log('抽奖结果:',event.detail);
1017 let no_luck_urltype = this.data.luckInfo.no_luck_urltype; 1035 let no_luck_urltype = this.data.luckInfo.no_luck_urltype;
1018 let lbtype = null; 1036 let lbtype = null;
1019 // let good_id = null; 1037 // let good_id = null;
@@ -1148,6 +1166,7 @@ Page({ @@ -1148,6 +1166,7 @@ Page({
1148 showResult: false, 1166 showResult: false,
1149 showMask: false, 1167 showMask: false,
1150 hiddenCanvas: false, 1168 hiddenCanvas: false,
  1169 + start: false,
1151 }); 1170 });
1152 }, 1171 },
1153 1172
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">