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 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,14 +840,16 @@ 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',
843 847 });
844 848 return;
845 849 };
846   -
  850 + wx.showLoading({
  851 + title: '准备抽奖中'
  852 + });
847 853 // 获取积分
848 854 app.request.promisePost('/api/weshop/marketing/marketingLuckForm/startLuckIntegral', {
849 855 isShowLoading: false,
... ... @@ -860,6 +866,9 @@ Page({
860 866 wx.showToast({
861 867 title: res.data.msg,
862 868 icon: 'none',
  869 + success: function() {
  870 + self.data.start = false;
  871 + }
863 872 });
864 873 return;
865 874 };
... ... @@ -869,13 +878,13 @@ Page({
869 878 if(self.data.luckInfo.user_LuckNumDay > 0 || self.data.luckInfo.vip_act_num == 0) {
870 879 // console.log('start choujiang');
871 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 884 const $lucky = self.selectComponent('#myLucky');
876 885 // 调用play方法开始旋转
877 886 $lucky.play();
878   -
  887 + wx.hideLoading();
879 888 // 获取抽奖结果
880 889 app.request.post('/api/weshop/marketing/marketingLuckForm/startLuck', {
881 890 isShowLoading: false,
... ... @@ -910,10 +919,14 @@ Page({
910 919 let random = Math.random() * indexArr.length >> 0;
911 920 // console.log('random', random);
912 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 955 const index = thxIndexArr[random];
943 956 // console.log('谢谢参与数组', thxIndexArr);
944 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 997 let thxIndexArr = self.data.thxIndexArr;
983 998 const random = Math.random() * thxIndexArr.length >> 0;
984 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 1029  
1013 1030 },
1014 1031 end (event) {
  1032 +
1015 1033 // 中奖奖品详情
1016   - console.log('抽奖结果:',event.detail);
  1034 + // console.log('抽奖结果:',event.detail);
1017 1035 let no_luck_urltype = this.data.luckInfo.no_luck_urltype;
1018 1036 let lbtype = null;
1019 1037 // let good_id = null;
... ... @@ -1148,6 +1166,7 @@ Page({
1148 1166 showResult: false,
1149 1167 showMask: false,
1150 1168 hiddenCanvas: false,
  1169 + start: false,
1151 1170 });
1152 1171 },
1153 1172  
... ...
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">
... ...