Commit 2a1c2aeee445445a8c25e3285d06a40c4f5ecf5d

Authored by wangfan
1 parent b0628020

C端调整

  1 +// components/tips/add-to-lite.js
  2 +import util from '../../utils/util'
  3 +Component({
  4 + /**
  5 + * 组件的属性列表
  6 + */
  7 + properties: {
  8 +
  9 + },
  10 +
  11 + /**
  12 + * 组件的初始数据
  13 + */
  14 + data: {
  15 + hidden:false,
  16 + },
  17 + attached(){
  18 + this.show();
  19 + },
  20 + /**
  21 + * 组件的方法列表
  22 + */
  23 + methods: {
  24 + show(){
  25 + this.triggerEvent("show");
  26 + //导航栏自适应
  27 + let systemInfo = wx.getSystemInfoSync();
  28 + let reg = /ios/i;
  29 + let pt = 20;//导航状态栏上内边距
  30 + let h = 44;//导航状态栏高度
  31 + if(reg.test(systemInfo.system)){
  32 + pt = systemInfo.statusBarHeight;
  33 + h = 44;
  34 + }else{
  35 + pt = systemInfo.statusBarHeight;
  36 + h = 48;
  37 + }
  38 + this.setData({
  39 + hidden:false,
  40 + statusBarHeightFull:pt+h,
  41 + })
  42 + },
  43 + hide(){
  44 + this.setData({
  45 + hidden:true,
  46 + })
  47 + },
  48 + }
  49 +})
  1 +{
  2 + "component": true,
  3 + "usingComponents": {}
  4 +}
  1 +<!--components/tips/add-to-lite.wxml-->
  2 +<cover-view class="discount" style="top:{{statusBarHeightFull+40}}px;" bindtap="gotoDiscount">
  3 + <cover-view style="position: relative;height: 100%;">
  4 + <cover-image class="discount-img" src="http://qn.colorcun.com/reserve/images/%E6%83%A0-%E5%85%A5%E5%8F%A3.png"></cover-image>
  5 + <cover-view style="position: relative;" wx:if="{{!hidden}}">
  6 + <cover-image src="http://qn.colorcun.com/reserve/images/%E4%BC%98%E6%83%A0.png"></cover-image>
  7 + <cover-view class="discount-view">
  8 + <cover-view class="text">平台预订即可享受超值优惠</cover-view>
  9 + <cover-view class="close" catchtap="hide"></cover-view>
  10 + </cover-view>
  11 + </cover-view>
  12 + </cover-view>
  13 +</cover-view>
  1 +/* components/tips/discount.wxss */
  2 +@import "../../app.wxss";
  3 +.discount{
  4 + position: fixed;
  5 + width: 720rpx;
  6 + height: 122rpx;
  7 + left:20rpx;
  8 + top:200rpx;
  9 + font-size: 32rpx;
  10 + color:#FFFFFF;
  11 + z-index: 99;
  12 +}
  13 +.discount .text{
  14 + position: absolute;
  15 + font-size: 32rpx;
  16 + color: #F8E6C4;
  17 + left: 120rpx;
  18 + top: 50rpx;
  19 + height: 44rpx;
  20 + line-height: 44rpx;
  21 +}
  22 +.discount .close{
  23 + position: absolute;
  24 + min-width: 100rpx;
  25 + width: 100rpx;
  26 + height: 122rpx;
  27 + right:0;
  28 + top: 0;
  29 +}
  30 +.discount-view{
  31 + position: absolute;
  32 + top:0;
  33 + left:0;
  34 + width: 720rpx;
  35 + height: 122rpx;
  36 +}
  37 +.discount-img{
  38 + position: absolute;
  39 + top:28rpx;
  40 + left:0;
  41 + width: 88rpx;
  42 + height: 88rpx;
  43 +}
@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 "nav":"/components/nav/nav", 7 "nav":"/components/nav/nav",
8 "getpos":"/components/userinfo/getpos", 8 "getpos":"/components/userinfo/getpos",
9 "sb-tr":"/components/reserve/seller-box-transverse/seller-box", 9 "sb-tr":"/components/reserve/seller-box-transverse/seller-box",
10 - "a2l":"/components/tips/add-to-lite" 10 + "a2l":"/components/tips/add-to-lite",
  11 + "ds":"/components/tips/discount"
11 } 12 }
12 } 13 }
@@ -68,3 +68,4 @@ @@ -68,3 +68,4 @@
68 <seller-box id="seller-box" bindevent="sellerBoxEvent"></seller-box> 68 <seller-box id="seller-box" bindevent="sellerBoxEvent"></seller-box>
69 <cover-view class="tab-patch"></cover-view> 69 <cover-view class="tab-patch"></cover-view>
70 <a2l bindshow="a2lshow" bindhide="a2lhide"></a2l> 70 <a2l bindshow="a2lshow" bindhide="a2lhide"></a2l>
  71 +<ds></ds>