Commit 77640a4888fb47e7bf276adbd1d1193d656eacdb

Authored by yvan.ni
1 parent c6a8fc29

到体验测试关注公众号

pages/index/index/index.js
... ... @@ -87,7 +87,16 @@ Page({
87 87 },
88 88  
89 89 onLoad: async function (tt) {
90   - var th = this;
  90 + // onLoad生命周期内判断
  91 + let obj = wx.getLaunchOptionsSync()
  92 + if (obj.scene === 1011 ||
  93 + obj.scene === 1047 ||
  94 + obj.scene === 1089 ||
  95 + obj.scene === 1038) {
  96 + this.setData({is_ok_h5:1})
  97 + }
  98 +
  99 + var th = this;
91 100 var first_leader = tt.first_leader;
92 101 if (!first_leader && tt.scene) {
93 102 var first_leader_str = decodeURIComponent(tt.scene);
... ... @@ -383,6 +392,7 @@ Page({
383 392 var json_d = JSON.parse(e.switch_list);
384 393 th.setData({ is_closecoupon: json_d.is_closecoupon })
385 394 th.setData({ is_topstore: json_d.is_show_storeselect })
  395 + th.setData({is_gz_h5:json_d.is_gz_h5})
386 396 }, 1)
387 397  
388 398 if (typeof this.getTabBar === 'function' && this.getTabBar()) {
... ... @@ -616,14 +626,7 @@ Page({
616 626 });
617 627 }
618 628 })
619   -
620   -
621   -
622   -
623   -
624   -
625   -
626   -
  629 +
627 630 //---调用信息---
628 631 // this.requestRecommend();
629 632 this.setData({
... ...
pages/index/index/index.wxml
1 1 <!-- <view hidden="{{f_hidden}}" class="full_screen" style="background-color: #fff;"></view> -->
2 2 <!-- <full_screen id="full_screen"></full_screen> -->
3 3  
4   -<official-account></official-account>
5   -
6   -
7 4 <!-- 全屏控制 -->
8 5 <view wx:if="{{is_full_screen_show}}" class="full_screen" bindtap="go_full_ad" style="background-image: url('{{url+full_ad.ad_code}}');">
9 6 <view catchtap="close_full_screen" class="skip_box">跳过 <text>{{sec_show}}</text></view>
... ... @@ -14,14 +11,17 @@
14 11  
15 12 <view class="container rel nor" wx:if="{{ishow}}">
16 13 <block wx:if="{{banner}}">
17   - <image class="xc-top-img abs" src="{{url}}/miniapp/images/top-img.png"></image>
  14 + <image class="xc-top-img abs" src="{{url}}/miniapp/images/top-img.png"></image><!-- 红色背景 -->
18 15 </block>
19   - <view class="top-bar">
  16 +
  17 + <view class="top-bar">
  18 + <!-- 顶部关注公众号 -->
  19 + <view wx:if="{{is_gz_h5 && is_ok_h5}}"><official-account></official-account></view>
  20 +
20 21 <!-- 控制要不要显示顶部门店选择 -->
21 22 <block wx:if="{{is_topstore}}">
22 23 <store_select style="z-index: 999;"></store_select>
23 24 </block>
24   -
25 25 <!--搜索框-->
26 26 <!-- <view class="search-box {{scrollTop>10?'search-fixed':''}} flex-center white " style="top:{{is_topstore?88:0}}rpx"> -->
27 27 <view class="search-box flex-center white">
... ... @@ -409,6 +409,9 @@
409 409 <view class="container" wx:if="{{isTemplate}}" style="background-color:{{bgcolor_t}}; padding-bottom: 10rpx">
410 410 <!-- 置顶层 -->
411 411 <view class="dis_top">
  412 + <!-- 关注公众号的显示 -->
  413 + <view wx:if="{{is_gz_h5 && is_ok_h5}}"><official-account></official-account></view>
  414 +
412 415 <block wx:for="{{template_arr}}" >
413 416 <block wx:if="{{item.content.is_top==1}}">
414 417 <!--如果是搜索框的时候 -->
... ... @@ -423,6 +426,8 @@
423 426 </view>
424 427 <!-- 撑开层 -->
425 428 <view>
  429 + <!-- 关注层的撑开 -->
  430 + <view wx:if="{{is_gz_h5 && is_ok_h5}}" style="height: 84px"></view>
426 431 <block wx:for="{{template_arr}}" >
427 432 <block wx:if="{{item.content.is_top==1 && item.ename=='searchbox'}}">
428 433 <view wx:if="{{item.content.style==1}}" style="height: 115rpx;"></view>
... ...