Commit 998cabb2dfc90587ee42f060a6cda8fa4478f410
1 parent
4c09a945
首页抢红包
Showing
4 changed files
with
104 additions
and
11 deletions
app.wxss
| ... | ... | @@ -446,12 +446,12 @@ background: #ffe3e2; |
| 446 | 446 | /* 图标字体(ty) */ |
| 447 | 447 | @font-face { |
| 448 | 448 | font-family: 'iconfont'; /* project id 2054717 */ |
| 449 | - src: url('//at.alicdn.com/t/font_2054717_ntayyd8f2u.eot'); | |
| 450 | - src: url('//at.alicdn.com/t/font_2054717_ntayyd8f2u.eot?#iefix') format('embedded-opentype'), | |
| 451 | - url('//at.alicdn.com/t/font_2054717_ntayyd8f2u.woff2') format('woff2'), | |
| 452 | - url('//at.alicdn.com/t/font_2054717_ntayyd8f2u.woff') format('woff'), | |
| 453 | - url('//at.alicdn.com/t/font_2054717_ntayyd8f2u.ttf') format('truetype'), | |
| 454 | - url('//at.alicdn.com/t/font_2054717_ntayyd8f2u.svg#iconfont') format('svg'); | |
| 449 | + src: url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.eot'); | |
| 450 | + src: url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.eot?#iefix') format('embedded-opentype'), | |
| 451 | + url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.woff2') format('woff2'), | |
| 452 | + url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.woff') format('woff'), | |
| 453 | + url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.ttf') format('truetype'), | |
| 454 | + url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.svg#iconfont') format('svg'); | |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | .iconfont { |
| ... | ... | @@ -462,6 +462,10 @@ background: #ffe3e2; |
| 462 | 462 | -moz-osx-font-smoothing: grayscale; |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | +.icon-riqi:before { | |
| 466 | + content: "\e64c"; | |
| 467 | +} | |
| 468 | + | |
| 465 | 469 | .icon-shanchu:before { |
| 466 | 470 | content: "\e61b"; |
| 467 | 471 | } | ... | ... |
pages/index/index/index.js
| ... | ... | @@ -75,6 +75,8 @@ Page({ |
| 75 | 75 | new_nav: "", //新人页面跳转地址 |
| 76 | 76 | w_holiday_pop:0, |
| 77 | 77 | |
| 78 | + showHongbao: true, | |
| 79 | + showHongbaoSmall: false, | |
| 78 | 80 | }, |
| 79 | 81 | |
| 80 | 82 | onLoad: async function(tt) { |
| ... | ... | @@ -94,7 +96,26 @@ Page({ |
| 94 | 96 | } |
| 95 | 97 | }) |
| 96 | 98 | } |
| 97 | - | |
| 99 | + | |
| 100 | + // 判断是否有红包活动 | |
| 101 | + getApp().request.promiseGet('/api/weshop/redmoney/redConfig/get/'+getApp().globalData.setting.stoid, { | |
| 102 | + data: {} | |
| 103 | + }).then(function(data) { | |
| 104 | + // console.log('909090909090----->', data.data.code); | |
| 105 | + let code = data.data.code; | |
| 106 | + if(code == 0) { | |
| 107 | + showHongbao: true, | |
| 108 | + th.setData({ | |
| 109 | + }); | |
| 110 | + } else if(code == -1) { | |
| 111 | + th.setData({ | |
| 112 | + showHongbao: false, | |
| 113 | + }); | |
| 114 | + }; | |
| 115 | + }); | |
| 116 | + | |
| 117 | + | |
| 118 | + // console.log(9090909); | |
| 98 | 119 | |
| 99 | 120 | |
| 100 | 121 | //看一下商家是否开通了权益 |
| ... | ... | @@ -185,7 +206,9 @@ Page({ |
| 185 | 206 | }) |
| 186 | 207 | |
| 187 | 208 | |
| 188 | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 189 | 212 | }, |
| 190 | 213 | //关闭新用户领取广告 |
| 191 | 214 | close_disgraceful: function() { |
| ... | ... | @@ -251,6 +274,7 @@ Page({ |
| 251 | 274 | } |
| 252 | 275 | }) |
| 253 | 276 | |
| 277 | + | |
| 254 | 278 | |
| 255 | 279 | //--首页的问题-- |
| 256 | 280 | if (getApp().globalData.config && getApp().globalData.config.store_name != undefined && getApp().globalData.config.store_name != null) { |
| ... | ... | @@ -261,7 +285,10 @@ Page({ |
| 261 | 285 | wx.setNavigationBarTitle({ |
| 262 | 286 | title: getApp().globalData.setting.appName, |
| 263 | 287 | }); |
| 264 | - } | |
| 288 | + }; | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 265 | 292 | }, |
| 266 | 293 | //---读取数据内容--- |
| 267 | 294 | async init_fir() { |
| ... | ... | @@ -898,6 +925,14 @@ Page({ |
| 898 | 925 | title: '首页-' + getApp().globalData.config.store_name, |
| 899 | 926 | } |
| 900 | 927 | }, |
| 901 | - | |
| 928 | + | |
| 929 | + | |
| 930 | + // 关闭首页抢红包主弹窗,显示侧边栏抢红包小图标 | |
| 931 | + closeHongbao() { | |
| 932 | + this.setData({ | |
| 933 | + showHongbao: false, //关闭抢红包主弹窗 | |
| 934 | + showHongbaoSmall: true, //显示抢红包小图标 | |
| 935 | + }); | |
| 936 | + }, | |
| 902 | 937 | |
| 903 | 938 | }); |
| 904 | 939 | \ No newline at end of file | ... | ... |
pages/index/index/index.wxml
| ... | ... | @@ -287,8 +287,23 @@ |
| 287 | 287 | <!-- 商品列表 --> |
| 288 | 288 | |
| 289 | 289 | </view> |
| 290 | + | |
| 291 | + <!-- 抢红包 --> | |
| 292 | + <block wx:if="{{showHongbao}}"> | |
| 293 | + <view class="hongbao-container" bindtap="nav_goto" data-url="/packageA/pages/hongBao/hongBao"> | |
| 294 | + <view class="hongbao"> | |
| 295 | + <image src="{{url + 'miniapp/images/redmoney/hongBao.png'}}" class="hongbao-img"></image> | |
| 296 | + <image src="{{url + 'miniapp/images/redmoney/xlose.png'}}" class="close" catchtap="closeHongbao"></image> | |
| 297 | + </view> | |
| 298 | + </view> | |
| 299 | + </block> | |
| 300 | + | |
| 301 | + <block wx:if="{{showHongbaoSmall}}"> | |
| 302 | + <image src="{{url + 'miniapp/images/redmoney/hongbao_sm.gif'}}" class="hongbao_sm-img" bindtap="nav_goto" data-url="/packageA/pages/hongBao/hongBao"></image> | |
| 303 | + </block> | |
| 290 | 304 | |
| 291 | 305 | </view> |
| 306 | + | |
| 292 | 307 | <!--是否是自定义--> |
| 293 | 308 | <view class="container" wx:if="{{isTemplate}}" style="background-color:{{bgcolor_t}}"> |
| 294 | 309 | <block wx:for="{{template_arr}}" wx:key="{{index}}"> |
| ... | ... | @@ -381,3 +396,5 @@ |
| 381 | 396 | |
| 382 | 397 | |
| 383 | 398 | |
| 399 | + | |
| 400 | + | ... | ... |
pages/index/index/index.wxss
| ... | ... | @@ -925,4 +925,41 @@ page { |
| 925 | 925 | overflow-x: hidden; |
| 926 | 926 | padding-bottom: 120rpx; |
| 927 | 927 | } |
| 928 | -.container{ overflow: hidden;} | |
| 929 | 928 | \ No newline at end of file |
| 929 | +.container{ overflow: hidden;} | |
| 930 | + | |
| 931 | + | |
| 932 | +.hongbao-container { | |
| 933 | + position: fixed; | |
| 934 | + width: 100%; | |
| 935 | + height: 100%; | |
| 936 | + background-color: rgba(0,0,0,.5); | |
| 937 | + z-index: 10001; | |
| 938 | +} | |
| 939 | + | |
| 940 | +.hongbao { | |
| 941 | + position: absolute; | |
| 942 | + top: 50%; | |
| 943 | + left: 50%; | |
| 944 | + transform: translate(-50%, -50%); | |
| 945 | +} | |
| 946 | + | |
| 947 | +.hongbao-img { | |
| 948 | + width: 440rpx; | |
| 949 | + height: 640rpx; | |
| 950 | +} | |
| 951 | + | |
| 952 | +.close { | |
| 953 | + position: absolute; | |
| 954 | + top: 0; | |
| 955 | + right: 0; | |
| 956 | +} | |
| 957 | + | |
| 958 | +.hongbao_sm-img { | |
| 959 | + width: 124rpx; | |
| 960 | + height: 170rpx; | |
| 961 | + position: fixed; | |
| 962 | + top: 50%; | |
| 963 | + right: 0; | |
| 964 | + /* transform: translateY(-50%); */ | |
| 965 | + z-index: 10000; | |
| 966 | +} | |
| 930 | 967 | \ No newline at end of file | ... | ... |