Commit 1d0fc3919ea362eaf069e6f075cdccf5f16f92d2
1 parent
1f931ea0
首页顶部的图片,要用广告的图片
Showing
2 changed files
with
25 additions
and
13 deletions
pages/user/index/index.js
| ... | ... | @@ -40,6 +40,7 @@ Page({ |
| 40 | 40 | actId: "", //生日活动的id |
| 41 | 41 | actImg: "", |
| 42 | 42 | is_assistance: 0, //助力活动 |
| 43 | + ad_img:"", | |
| 43 | 44 | }, |
| 44 | 45 | goto_nav: function(e) { |
| 45 | 46 | var th = this; |
| ... | ... | @@ -56,7 +57,18 @@ Page({ |
| 56 | 57 | * 生命周期函数--监听页面加载 |
| 57 | 58 | */ |
| 58 | 59 | onLoad: function(options) { |
| 60 | + var th=this; | |
| 59 | 61 | this.birthday(); |
| 62 | + getApp().request.promiseGet("/api/weshop/ad/list?pid=401&store_id=" + os.stoid, { | |
| 63 | + data: { | |
| 64 | + enabled: 1 | |
| 65 | + } | |
| 66 | + }).then(res => { | |
| 67 | + if(res.data.code==0 && res.data.data){ | |
| 68 | + var item=res.data.data[0]; | |
| 69 | + th.setData({ad_img:item.ad_code}) | |
| 70 | + } | |
| 71 | + }) | |
| 60 | 72 | }, |
| 61 | 73 | |
| 62 | 74 | /** |
| ... | ... | @@ -551,12 +563,12 @@ Page({ |
| 551 | 563 | }, |
| 552 | 564 | // 判断生日营销的页面是不是存在 |
| 553 | 565 | birthday: function() { |
| 554 | - | |
| 566 | + | |
| 555 | 567 | var th = this; |
| 556 | 568 | rq.get("/api/weshop/marketing/birthday/act/judge", { |
| 557 | 569 | data: { storeId: os.stoid, userId: app_d.user_id }, |
| 558 | 570 | success: function (res) { |
| 559 | - | |
| 571 | + | |
| 560 | 572 | var code = res.data.code; |
| 561 | 573 | if (code == 0) { |
| 562 | 574 | var giftbagid = res.data.data.giftBagId; |
| ... | ... | @@ -575,7 +587,7 @@ Page({ |
| 575 | 587 | var th = this; |
| 576 | 588 | var actId = th.data.actId; |
| 577 | 589 | var giftbagid = th.data.giftbagid; |
| 578 | - | |
| 590 | + | |
| 579 | 591 | if (actId != "" && giftbagid != "") { |
| 580 | 592 | |
| 581 | 593 | getApp().goto("/pages/giftpack/birthdaygift/birthdaygift?actId=" + actId + "&gifbagid=" + giftbagid + "&orderType=" + 3); |
| ... | ... | @@ -584,7 +596,7 @@ Page({ |
| 584 | 596 | getApp().showWarning("请稍后重试"); |
| 585 | 597 | } |
| 586 | 598 | }, |
| 587 | - // 判断助力活动是不是存在 | |
| 599 | + // 判断助力活动是不是存在 | |
| 588 | 600 | is_assistance: function() { |
| 589 | 601 | var th = this; |
| 590 | 602 | rq.get("/api/weshop/marketing/help/act/judge", { |
| ... | ... | @@ -607,4 +619,4 @@ Page({ |
| 607 | 619 | |
| 608 | 620 | |
| 609 | 621 | |
| 610 | -}) | |
| 611 | 622 | \ No newline at end of file |
| 623 | +}) | ... | ... |
pages/user/index/index.wxml
| 1 | 1 | <view class="xc-page"> |
| 2 | 2 | <view class="xc-user"> |
| 3 | - <view class="xc-head rel"> | |
| 4 | - <image class="xc-background" src="{{iurl}}/miniapp/images/user_index_powder.jpg"> | |
| 3 | + <view class="xc-head rel"> | |
| 4 | + <image class="xc-background" src="{{iurl}}{{ad_img?ad_img:'/miniapp/images/user_index_powder.jpg'}}"> | |
| 5 | 5 | <view class="flex-space-between abs xc-user-frame"> |
| 6 | 6 | <view class="xc-user-left flex" wx:if="{{userInfo}}"> |
| 7 | 7 | <image class="xc-user-img circle" bindtap="go_info" src="{{userInfo.head_pic?userInfo.head_pic:defaultAvatar}}"></image> |
| ... | ... | @@ -69,19 +69,19 @@ |
| 69 | 69 | <image class="xc-icon" src="{{iurl}}/miniapp/images/user/user_vip.png"></image> |
| 70 | 70 | <view class="member fs28 "> 加入plus会员预计可省3031元</view> |
| 71 | 71 | </view> |
| 72 | - <view class="xc-opening-button t-c" data-url="/pages/user/plus/plus" bindtap="goto"> | |
| 72 | + <view class="xc-opening-button t-c" data-url="/pages/user/plus/plus" bindtap="goto"> | |
| 73 | 73 | <view class="xc-opening fs28">立即开通</view> |
| 74 | 74 | </view> |
| 75 | 75 | </view> |
| 76 | 76 | </view> |
| 77 | - | |
| 77 | + | |
| 78 | 78 | <view class="xc-add-member-frame flex-level rel addplus" wx:if="{{is_dengji==3}}"> |
| 79 | 79 | <view class="xc-add-member flex-center-around "> |
| 80 | 80 | <view class="flex jc-center ai-center"> |
| 81 | 81 | <image class="xc-icon" src="{{iurl}}/miniapp/images/user/user_vip.png"></image> |
| 82 | 82 | <view class="member fs28 "> 加入plus会员预计可省3031元</view> |
| 83 | 83 | </view> |
| 84 | - <view class="xc-opening-button t-c" data-url="/pages/user/cardinfo/cardinfo" bindtap="goto"> | |
| 84 | + <view class="xc-opening-button t-c" data-url="/pages/user/cardinfo/cardinfo" bindtap="goto"> | |
| 85 | 85 | <view class="xc-opening fs28">立即续费</view> |
| 86 | 86 | </view> |
| 87 | 87 | </view> |
| ... | ... | @@ -232,7 +232,7 @@ |
| 232 | 232 | <view class="item t-c" data-url="/pages/user/assistance/assistance" bindtap="goto_nav"> |
| 233 | 233 | <image class="xc-center-img " src="{{iurl}}/miniapp/images/friendhelp/icon-zl.png"></image> |
| 234 | 234 | <view class="four-level-word">助力活动</view> |
| 235 | - </view> | |
| 235 | + </view> | |
| 236 | 236 | </block> |
| 237 | 237 | |
| 238 | 238 | </view> |
| ... | ... | @@ -262,7 +262,7 @@ |
| 262 | 262 | <!-- 显示商品 --> |
| 263 | 263 | <!-- 好物推荐 --> |
| 264 | 264 | <goods_recommend id="goods_recommend"></goods_recommend> |
| 265 | - | |
| 265 | + | |
| 266 | 266 | </view> |
| 267 | 267 | </view> |
| 268 | 268 | |
| ... | ... | @@ -290,4 +290,4 @@ |
| 290 | 290 | </view> |
| 291 | 291 | </view> |
| 292 | 292 | |
| 293 | -<pop_txt id="pop_txt"></pop_txt> | |
| 294 | 293 | \ No newline at end of file |
| 294 | +<pop_txt id="pop_txt"></pop_txt> | ... | ... |