Commit 9b0c24d5658df9face72fc6cb880f7ea6d59f618
1 parent
788879e6
生日营销
Showing
3 changed files
with
62 additions
and
4 deletions
pages/user/index/index.js
@@ -30,6 +30,9 @@ Page({ | @@ -30,6 +30,9 @@ Page({ | ||
30 | cz_val:0, | 30 | cz_val:0, |
31 | full_cz_val:0, | 31 | full_cz_val:0, |
32 | is_dengji:0, //是不是等级 | 32 | is_dengji:0, //是不是等级 |
33 | + is_banner:0,//是不是有生日活动 | ||
34 | + giftbagid:"", | ||
35 | + actId:"", | ||
33 | }, | 36 | }, |
34 | goto_nav: function (e) { | 37 | goto_nav: function (e) { |
35 | var th = this; | 38 | var th = this; |
@@ -46,7 +49,7 @@ Page({ | @@ -46,7 +49,7 @@ Page({ | ||
46 | * 生命周期函数--监听页面加载 | 49 | * 生命周期函数--监听页面加载 |
47 | */ | 50 | */ |
48 | onLoad: function (options) { | 51 | onLoad: function (options) { |
49 | - | 52 | + this.birthday(); |
50 | }, | 53 | }, |
51 | 54 | ||
52 | /** | 55 | /** |
@@ -448,7 +451,43 @@ Page({ | @@ -448,7 +451,43 @@ Page({ | ||
448 | 451 | ||
449 | jump: function () { | 452 | jump: function () { |
450 | getApp().goto("/pages/user/grow_value/grow_value") | 453 | getApp().goto("/pages/user/grow_value/grow_value") |
451 | - } | 454 | + }, |
455 | + // 判断生日营销的页面是不是存在 | ||
456 | + birthday:function(){ | ||
457 | + | ||
458 | + var t=this; | ||
459 | + rq.get("/api/weshop/marketing/birthday/act/judge", { | ||
460 | + data: { storeId: os.stoid, userId: app_d.user_id }, | ||
461 | + success: function (su) { | ||
462 | + var code=su.data.code; | ||
463 | + console.log(su, "生日有礼的数据", code); | ||
464 | + if (code==0){ | ||
465 | + var giftbagid = su.data.data.giftBagId; | ||
466 | + var actId = su.data.data.id; | ||
467 | + t.setData({ giftbagid: giftbagid, actId: actId}); | ||
468 | + } | ||
469 | + | ||
470 | + t.setData({is_banner:code}); | ||
471 | + } | ||
472 | + }) | ||
473 | + | ||
474 | + }, | ||
475 | + clike_banne:function(){ | ||
476 | + var actId=this.data.actId; | ||
477 | + var giftbagid=this.data.giftbagid; | ||
478 | + console.log(giftbagid, "生日有礼的数据55555", actId); | ||
479 | + if (actId != "" && giftbagid!=""){ | ||
480 | + | ||
481 | + wx.redirectTo({ | ||
482 | + url: "/pages/giftpack/birthdaygift/birthdaygift?actId=" + actId + "&gifbagid=" + giftbagid + "&orderType=" + 3 | ||
483 | + }); | ||
484 | + }else{ | ||
485 | + | ||
486 | + getApp().showWarning("请稍后重试"); | ||
487 | + } | ||
488 | + } | ||
489 | + | ||
490 | + | ||
452 | 491 | ||
453 | 492 | ||
454 | }) | 493 | }) |
455 | \ No newline at end of file | 494 | \ No newline at end of file |
pages/user/index/index.wxml
@@ -166,10 +166,18 @@ | @@ -166,10 +166,18 @@ | ||
166 | </view> | 166 | </view> |
167 | </view> | 167 | </view> |
168 | </view> | 168 | </view> |
169 | + <!-- 生日营销 is_banner--> | ||
170 | + <block wx:if="{{is_banner==0}}"> | ||
171 | + <view class="t-c banner-frame" bindtap="clike_banne"> | ||
172 | + <image class="banner-img" src="{{iurl}}/miniapp/images/banner-img.jpg"> | ||
173 | + </image> | ||
174 | + </view> | ||
175 | + </block> | ||
176 | + | ||
169 | <!-- 工具与服务 --> | 177 | <!-- 工具与服务 --> |
170 | <view class="xc-tool-service"> | 178 | <view class="xc-tool-service"> |
171 | <view class="xc-tool-service-title flex-vertical"> | 179 | <view class="xc-tool-service-title flex-vertical"> |
172 | - <image class="xc-tool-service-img" src="{{iurl}}/miniapp/images/gj.png"></image> | 180 | + <image class="xc-tool-service-img" src="{{iurl}}/miniapp/images/gj.png"></image> |
173 | <view class="three-level-word xc-tool-service-word">工具与服务</view> | 181 | <view class="three-level-word xc-tool-service-word">工具与服务</view> |
174 | </view> | 182 | </view> |
175 | <view class="xc-project-frame"> | 183 | <view class="xc-project-frame"> |
pages/user/index/index.wxss
@@ -344,7 +344,7 @@ | @@ -344,7 +344,7 @@ | ||
344 | .xc-tool-service .xc-tool-service-title { | 344 | .xc-tool-service .xc-tool-service-title { |
345 | width: 100%; | 345 | width: 100%; |
346 | height: 90rpx; | 346 | height: 90rpx; |
347 | - border: 2rpx solid #f2f2f2; | 347 | + |
348 | } | 348 | } |
349 | 349 | ||
350 | .xc-tool-service-img { | 350 | .xc-tool-service-img { |
@@ -699,3 +699,14 @@ | @@ -699,3 +699,14 @@ | ||
699 | margin-top: 8rpx; | 699 | margin-top: 8rpx; |
700 | margin-right: 5rpx; | 700 | margin-right: 5rpx; |
701 | } | 701 | } |
702 | +.banner-img{ | ||
703 | + width: 95%; | ||
704 | + height: 140rpx; | ||
705 | + border-radius: 10px 10px 0px 0px; | ||
706 | + margin-bottom: -5rpx; | ||
707 | + | ||
708 | +} | ||
709 | +.banner-frame{ | ||
710 | + width: 100%; | ||
711 | + background: #f2f2f2; | ||
712 | +} | ||
702 | \ No newline at end of file | 713 | \ No newline at end of file |