Commit 77640a4888fb47e7bf276adbd1d1193d656eacdb

Authored by yvan.ni
1 parent c6a8fc29

到体验测试关注公众号

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