Commit 4621df77015bf2efb2d835b775d3c58c4251eed8
1 parent
3fe575bf
幸运大转盘的优化
Showing
4 changed files
with
51 additions
and
33 deletions
packageB/pages/luckactivity/luckinfo/luckinfo.js
| @@ -1161,8 +1161,7 @@ Page({ | @@ -1161,8 +1161,7 @@ Page({ | ||
| 1161 | // 'list.pageData': this.data.record, | 1161 | // 'list.pageData': this.data.record, |
| 1162 | // // record: self.data.list.pageData, | 1162 | // // record: self.data.list.pageData, |
| 1163 | // }); | 1163 | // }); |
| 1164 | - | ||
| 1165 | - | 1164 | + |
| 1166 | }, | 1165 | }, |
| 1167 | 1166 | ||
| 1168 | closePopup() { | 1167 | closePopup() { |
packageB/pages/luckactivity/luckinfo/luckinfo.wxml
| @@ -187,7 +187,6 @@ | @@ -187,7 +187,6 @@ | ||
| 187 | </view> | 187 | </view> |
| 188 | </view> | 188 | </view> |
| 189 | 189 | ||
| 190 | - | ||
| 191 | <!-- 海报 --> | 190 | <!-- 海报 --> |
| 192 | <view class="poster-container" wx:if="{{showPoster}}"> | 191 | <view class="poster-container" wx:if="{{showPoster}}"> |
| 193 | <view class="t-r pdb20 white2"><text class="iconfont icon-close fs40" bindtap="closePoster"></text></view> | 192 | <view class="t-r pdb20 white2"><text class="iconfont icon-close fs40" bindtap="closePoster"></text></view> |
pages/user/index/index.js
| @@ -47,6 +47,9 @@ Page({ | @@ -47,6 +47,9 @@ Page({ | ||
| 47 | add_card_data: '', //等级卡的内容 | 47 | add_card_data: '', //等级卡的内容 |
| 48 | getusercode_vailtime:10,//会员二维码时效 | 48 | getusercode_vailtime:10,//会员二维码时效 |
| 49 | hiddenCS: true, | 49 | hiddenCS: true, |
| 50 | + | ||
| 51 | + is_show_recommend:false | ||
| 52 | + | ||
| 50 | }, | 53 | }, |
| 51 | goto_nav: function (e) { | 54 | goto_nav: function (e) { |
| 52 | var th = this; | 55 | var th = this; |
| @@ -152,24 +155,7 @@ Page({ | @@ -152,24 +155,7 @@ Page({ | ||
| 152 | }) | 155 | }) |
| 153 | var th = this; | 156 | var th = this; |
| 154 | 157 | ||
| 155 | - // 判断是否开启美业 | ||
| 156 | - getApp().promiseGet('/api/weshop/store/getTabSys/' + os.stoid, {}).then(res => { | ||
| 157 | - if (res.data.code == 0) { | ||
| 158 | - th.setData({ | ||
| 159 | - enableMeiye: res.data.data.EnableMeiye, | ||
| 160 | - }); | ||
| 161 | - }; | ||
| 162 | - }); | ||
| 163 | - | ||
| 164 | 158 | ||
| 165 | - getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + os.stoid, {}).then(res => { | ||
| 166 | - if (res.data.code == 0) { | ||
| 167 | - var plusCard = res.data.data; | ||
| 168 | - for (var i = 0; i < plusCard.length; i++) { | ||
| 169 | - if (!plusCard[i].IsStopBuy) { th.setData({ show_buy_plus: 1 }); break; } | ||
| 170 | - } | ||
| 171 | - } | ||
| 172 | - }) | ||
| 173 | 159 | ||
| 174 | if (typeof this.getTabBar === 'function' && this.getTabBar()) { | 160 | if (typeof this.getTabBar === 'function' && this.getTabBar()) { |
| 175 | var index = getApp().getPageIndex(this); | 161 | var index = getApp().getPageIndex(this); |
| @@ -189,6 +175,26 @@ Page({ | @@ -189,6 +175,26 @@ Page({ | ||
| 189 | var e = getApp().globalData.userInfo; | 175 | var e = getApp().globalData.userInfo; |
| 190 | if (e != undefined && e != null && e.mobile) { | 176 | if (e != undefined && e != null && e.mobile) { |
| 191 | 177 | ||
| 178 | + | ||
| 179 | + // 判断是否开启美业 | ||
| 180 | + getApp().promiseGet('/api/weshop/store/getTabSys/' + os.stoid, {}).then(res => { | ||
| 181 | + if (res.data.code == 0) { | ||
| 182 | + th.setData({ | ||
| 183 | + enableMeiye: res.data.data.EnableMeiye, | ||
| 184 | + }); | ||
| 185 | + }; | ||
| 186 | + }); | ||
| 187 | + | ||
| 188 | + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + os.stoid, {}).then(res => { | ||
| 189 | + if (res.data.code == 0) { | ||
| 190 | + var plusCard = res.data.data; | ||
| 191 | + for (var i = 0; i < plusCard.length; i++) { | ||
| 192 | + if (!plusCard[i].IsStopBuy) { th.setData({ show_buy_plus: 1 }); break; } | ||
| 193 | + } | ||
| 194 | + } | ||
| 195 | + }) | ||
| 196 | + | ||
| 197 | + | ||
| 192 | this.birthday(); | 198 | this.birthday(); |
| 193 | this.is_assistance(); | 199 | this.is_assistance(); |
| 194 | 200 | ||
| @@ -451,15 +457,22 @@ Page({ | @@ -451,15 +457,22 @@ Page({ | ||
| 451 | } | 457 | } |
| 452 | }) | 458 | }) |
| 453 | //th.requestRecommend(); | 459 | //th.requestRecommend(); |
| 460 | + | ||
| 461 | + //自定义组件一定要等到页面加载完了,才来调用selectComponnent | ||
| 462 | + setTimeout(function () { | ||
| 463 | + | ||
| 464 | + th.setData({ is_show_recommend:true }) | ||
| 465 | + | ||
| 466 | + if (getApp().globalData.user_id) getApp().requestCardNum(th); | ||
| 467 | + var goods_list = th.selectComponent("#goods_recommend"); //组件的id | ||
| 468 | + goods_list.init(); | ||
| 469 | + goods_list.get_list(); | ||
| 470 | + }, 800) | ||
| 454 | } | 471 | } |
| 455 | 472 | ||
| 456 | - //自定义组件一定要等到页面加载完了,才来调用selectComponnent | ||
| 457 | - setTimeout(function () { | ||
| 458 | - if (getApp().globalData.user_id) getApp().requestCardNum(th); | ||
| 459 | - var goods_list = th.selectComponent("#goods_recommend"); //组件的id | ||
| 460 | - goods_list.init(); | ||
| 461 | - goods_list.get_list(); | ||
| 462 | - }, 800) | 473 | + |
| 474 | + | ||
| 475 | + | ||
| 463 | }, | 476 | }, |
| 464 | 477 | ||
| 465 | //判断会员是后有改服务项目 | 478 | //判断会员是后有改服务项目 |
| @@ -498,11 +511,14 @@ Page({ | @@ -498,11 +511,14 @@ Page({ | ||
| 498 | */ | 511 | */ |
| 499 | onReachBottom: function () { | 512 | onReachBottom: function () { |
| 500 | //!this.nomore && this.requestRecommend(); | 513 | //!this.nomore && this.requestRecommend(); |
| 501 | - var goods_list = this.selectComponent("#goods_recommend"); //组件的id | ||
| 502 | - goods_list.init(); | ||
| 503 | - setTimeout(function () { | ||
| 504 | - goods_list.get_list(); | ||
| 505 | - }, 300) | 514 | + var e = getApp().globalData.userInfo; |
| 515 | + if (e != undefined && e != null && e.mobile) { | ||
| 516 | + var goods_list = this.selectComponent("#goods_recommend"); //组件的id | ||
| 517 | + goods_list.init(); | ||
| 518 | + setTimeout(function () { | ||
| 519 | + goods_list.get_list(); | ||
| 520 | + }, 300) | ||
| 521 | + } | ||
| 506 | }, | 522 | }, |
| 507 | 523 | ||
| 508 | /** | 524 | /** |
pages/user/index/index.wxml
| @@ -296,7 +296,9 @@ | @@ -296,7 +296,9 @@ | ||
| 296 | 296 | ||
| 297 | </view> | 297 | </view> |
| 298 | </view> | 298 | </view> |
| 299 | - <view style='width:100%;height:73rpx;'> | 299 | + |
| 300 | + <!-- 显示推荐 --> | ||
| 301 | + <view style='width:100%;height:73rpx;' wx:if="{{is_show_recommend}}"> | ||
| 300 | <view class="xc-recommend-goods flex-center"> | 302 | <view class="xc-recommend-goods flex-center"> |
| 301 | 303 | ||
| 302 | <view class="circle xc-small"> | 304 | <view class="circle xc-small"> |
| @@ -318,7 +320,9 @@ | @@ -318,7 +320,9 @@ | ||
| 318 | 320 | ||
| 319 | <!-- 显示商品 --> | 321 | <!-- 显示商品 --> |
| 320 | <!-- 好物推荐 --> | 322 | <!-- 好物推荐 --> |
| 323 | + <block wx:if="{{is_show_recommend}}"> | ||
| 321 | <goods_recommend id="goods_recommend"></goods_recommend> | 324 | <goods_recommend id="goods_recommend"></goods_recommend> |
| 325 | + </block> | ||
| 322 | 326 | ||
| 323 | <!-- 技术支持 --> | 327 | <!-- 技术支持 --> |
| 324 | <view class="logo-container t-c"> | 328 | <view class="logo-container t-c"> |