Commit 804fd0c20e7358b4b0354a8d2b9f5aeccfb47346

Authored by vking
1 parent 46b74bd6

收藏调整

1 // components/tips/add-to-lite.js 1 // components/tips/add-to-lite.js
2 import util from '../../utils/util' 2 import util from '../../utils/util'
3 -const cache_key='ADD-TO-LINE' 3 +const cache_key='A2L-'
4 Component({ 4 Component({
5 /** 5 /**
6 * 组件的属性列表 6 * 组件的属性列表
@@ -9,7 +9,13 @@ Component({ @@ -9,7 +9,13 @@ Component({
9 bgColor:{ 9 bgColor:{
10 type:String, 10 type:String,
11 value:'rgba(0,0,0,0.6)', 11 value:'rgba(0,0,0,0.6)',
12 - } 12 + },
  13 + key:String,
  14 + type:{
  15 + type:String,
  16 + value:'yellow',
  17 + },
  18 + hitStr:String,
13 }, 19 },
14 20
15 /** 21 /**
@@ -20,11 +26,15 @@ Component({ @@ -20,11 +26,15 @@ Component({
20 statusBarHeightFull:0, 26 statusBarHeightFull:0,
21 }, 27 },
22 attached(){ 28 attached(){
23 - let ca=util.cache(cache_key); 29 + let cacheKey=cache_key+this.data.key
  30 + let ca=util.cache(cacheKey);
24 if(ca){ 31 if(ca){
25 this.hide(); 32 this.hide();
26 }else{ 33 }else{
27 - this.show(); 34 + let p=getCurrentPages()
  35 + if(p.length==1){
  36 + this.show();
  37 + }
28 } 38 }
29 39
30 }, 40 },
@@ -35,21 +45,28 @@ Component({ @@ -35,21 +45,28 @@ Component({
35 show(){ 45 show(){
36 this.triggerEvent("show"); 46 this.triggerEvent("show");
37 //导航栏自适应 47 //导航栏自适应
38 - let systemInfo = wx.getSystemInfoSync();  
39 - let reg = /ios/i;  
40 - let pt = 20;//导航状态栏上内边距  
41 - let h = 44;//导航状态栏高度  
42 - if(reg.test(systemInfo.system)){  
43 - pt = systemInfo.statusBarHeight;  
44 - h = 44; 48 + if(this.data.type=='yellow'){
  49 + let systemInfo = wx.getSystemInfoSync();
  50 + let reg = /ios/i;
  51 + let pt = 20;//导航状态栏上内边距
  52 + let h = 44;//导航状态栏高度
  53 + if(reg.test(systemInfo.system)){
  54 + pt = systemInfo.statusBarHeight;
  55 + h = 44;
  56 + }else{
  57 + pt = systemInfo.statusBarHeight;
  58 + h = 48;
  59 + }
  60 + this.setData({
  61 + hidden:false,
  62 + statusBarHeightFull:(pt+h-5),
  63 + })
45 }else{ 64 }else{
46 - pt = systemInfo.statusBarHeight;  
47 - h = 48; 65 + this.setData({
  66 + hidden:false,
  67 + statusBarHeightFull:0,
  68 + })
48 } 69 }
49 - this.setData({  
50 - hidden:false,  
51 - statusBarHeightFull:pt+h,  
52 - })  
53 if(!this.timeInterval){ 70 if(!this.timeInterval){
54 this.timeIntervalNum=0; 71 this.timeIntervalNum=0;
55 this.timeInterval=setInterval(()=>{ 72 this.timeInterval=setInterval(()=>{
@@ -67,7 +84,8 @@ Component({ @@ -67,7 +84,8 @@ Component({
67 }, 84 },
68 hide(){ 85 hide(){
69 this.triggerEvent("hide"); 86 this.triggerEvent("hide");
70 - util.cache(cache_key,cache_key); 87 + let cacheKey=cache_key+this.data.key
  88 + util.cache(cacheKey,cacheKey);
71 this.setData({ 89 this.setData({
72 hidden:true, 90 hidden:true,
73 }) 91 })
1 <!--components/tips/add-to-lite.wxml--> 1 <!--components/tips/add-to-lite.wxml-->
2 -<cover-view class="tip" style="top:{{statusBarHeightFull}}px;" bindtap="hide" hidden="{{hidden}}">  
3 - <cover-view class="jiao"></cover-view>  
4 - <cover-view class="text">点这里可以收藏小程序</cover-view>  
5 -</cover-view> 2 +<view class="tip {{type}}" style="top:{{statusBarHeightFull}}px;" bindtap="hide" hidden="{{hidden}}">
  3 + <view class="jian"></view>
  4 + <view class="content flex-lr" bindtap="hide">
  5 + <view class="flex-vc" wx:if="{{type=='yellow'}}">
  6 + <view class="flex-ll text">
  7 + 点击
  8 + <view class="more"></view>
  9 + 添加到我的小程序
  10 + </view>
  11 + <view class="text flex-ll">微信下拉即可快速
  12 + <view class="Semibold">订包间</view>
  13 + </view>
  14 + </view>
  15 + <view class="flex-ll" wx:else="">
  16 + <view class="flex-ll text">
  17 + 点击
  18 + <view class="more"></view>
  19 + 添加到我的小程序,微信下拉即可快速
  20 + <view class="Semibold">{{hitStr||'查空房'}}</view>
  21 + </view>
  22 + </view>
  23 + <view class="close"></view>
  24 + </view>
  25 +</view>
6 26
7 27
1 /* components/tips/add-to-lite.wxss */ 1 /* components/tips/add-to-lite.wxss */
2 @import "../../app.wxss"; 2 @import "../../app.wxss";
3 .tip{ 3 .tip{
  4 + position:relative;
  5 +}
  6 +.tip .content{
  7 + height:88rpx;
  8 + line-height: 88rpx;
  9 + box-sizing: border-box;
  10 + padding: 0 20rpx 0;
  11 +}
  12 +.tip .text{
  13 + line-height:28rpx;
  14 + height: 28rpx;
  15 + width: 100%;
  16 + text-align: left;
  17 +}
  18 +.tip .more{
  19 + width: 32rpx;
  20 + height: 10rpx;
  21 + background-size: 100% 100%;
  22 + margin: 0 10rpx 0;
  23 + min-width: 32rpx;
  24 +}
  25 +.tip .close{
  26 + width: 20rpx;
  27 + height: 20rpx;
  28 + background-size: 100% 100%;
  29 + min-width: 20rpx;
  30 +}
  31 +.tip .jian{
  32 + background-size: 100% 100%;
  33 + width: 32rpx;
  34 + height: 36rpx;
  35 + margin-left: 200rpx;
  36 +}
  37 +
  38 +.tip.yellow{
  39 + width:334rpx;
  40 + right: 40rpx;
  41 + font-size:20rpx;
  42 + font-weight:500;
4 position: fixed; 43 position: fixed;
5 - width: 460rpx;  
6 - right:40rpx;  
7 - top:200rpx;  
8 - font-size: 32rpx;  
9 - color:#FFFFFF;  
10 z-index: 99; 44 z-index: 99;
11 } 45 }
12 -.text{  
13 - border-radius: 40rpx;  
14 - line-height: 80rpx;  
15 - height: 80rpx;  
16 - overflow: hidden;  
17 - background-color: rgb(0,0,0,0.6);  
18 - margin-top: -15rpx;  
19 - text-align: center;  
20 -}  
21 -.jiao{  
22 - background-color: rgba(0,0,0,0.6);  
23 - width: 30rpx;  
24 - height: 30rpx;  
25 - transform:rotate(45deg);  
26 - margin-left: 340rpx;  
27 - margin-top: 10rpx; 46 +.tip.yellow .content{
  47 + height:100rpx;
  48 + line-height: 100rpx;
  49 + background:rgba(236,217,183,1);
  50 + border-radius:10rpx;
  51 + color:rgba(121,79,40,1);
  52 +}
  53 +.tip.yellow .more{
  54 + background-image: url("http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911181208295.png");
  55 +}
  56 +.tip.yellow .close{
  57 + background-image: url("http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20191118120829.png");
  58 +}
  59 +.tip.yellow .jian{
  60 + background-image: url("http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911181208293.png");
  61 +}
  62 +
  63 +.tip.black{
  64 + background-color: rgba(245,245,245,1);
  65 + height: 95rpx;
  66 + padding-top: 6rpx;
  67 +}
  68 +.tip.black .content{
  69 + background-color: #ffffff;
  70 + width: 100%;
  71 + height: 88rpx;
  72 + line-height: 88rpx;
  73 + font-size:24rpx;
  74 + font-weight:500;
  75 + color:rgba(53,53,53,1);
  76 + padding-left:50rpx;
  77 + padding-right:50rpx;
  78 +}
  79 +.tip.black .jian{
  80 + position: absolute;
  81 + top:-14rpx;
  82 + right:150rpx;
  83 + margin-left: 0;
  84 + z-index: 9999;
  85 + background-image: url("http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911181208292.png");
  86 +}
  87 +.tip.black .close{
  88 + background-image: url("http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911181208291.png");
  89 +}
  90 +.tip.black .more{
  91 + background-image: url("http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911181208294.png");
28 } 92 }
@@ -9,7 +9,6 @@ @@ -9,7 +9,6 @@
9 "searchList":"/components/searchlist/searchlist", 9 "searchList":"/components/searchlist/searchlist",
10 "calendar": "plugin://bmCalendar/calendar", 10 "calendar": "plugin://bmCalendar/calendar",
11 "board":"../../components/book/board/board", 11 "board":"../../components/book/board/board",
12 - "formids":"/components/formids/formids",  
13 - "a2l":"/components/tips/add-to-lite" 12 + "formids":"/components/formids/formids"
14 } 13 }
15 } 14 }
@@ -273,5 +273,4 @@ @@ -273,5 +273,4 @@
273 data-value="{{item.often_use}}">{{item.often_use}}</view> 273 data-value="{{item.often_use}}">{{item.often_use}}</view>
274 </view> 274 </view>
275 </view> 275 </view>
276 -</view>  
277 -<a2l bgColor="#199095"></a2l>  
  276 +</view>
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "board":"../../components/book/board/board", 8 "board":"../../components/book/board/board",
9 "cancel":"../../components/book/reserveCancel/cancel", 9 "cancel":"../../components/book/reserveCancel/cancel",
10 "nav":"/components/nav/nav", 10 "nav":"/components/nav/nav",
  11 + "a2l":"/components/tips/add-to-lite",
11 "formids":"/components/formids/formids" 12 "formids":"/components/formids/formids"
12 } 13 }
13 } 14 }
1 <nav hasHome>订座详情</nav> 1 <nav hasHome>订座详情</nav>
  2 +<a2l bindshow="a2lshow" bindhide="a2lshow" key="BOOK-DETAIL" type="black" hitStr="通知客户"></a2l>
2 <!--订单信息--> 3 <!--订单信息-->
3 <view class="order-info"> 4 <view class="order-info">
4 <view class="flex-lr order-detail"> 5 <view class="flex-lr order-detail">
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "nav":"/components/nav/nav", 8 "nav":"/components/nav/nav",
9 "tabBar":"../../components/book/tabBar/tabBar", 9 "tabBar":"../../components/book/tabBar/tabBar",
10 "calendar": "plugin://bmCalendar/calendar", 10 "calendar": "plugin://bmCalendar/calendar",
  11 + "a2l":"/components/tips/add-to-lite",
11 "formids":"/components/formids/formids" 12 "formids":"/components/formids/formids"
12 } 13 }
13 } 14 }
1 <nav id="nav">订座</nav> 1 <nav id="nav">订座</nav>
  2 +<a2l bindshow="a2lshow" bindhide="a2lshow" key="BOOK-INDEX" type="black" hitStr="查空房"></a2l>
2 <view class="page"> 3 <view class="page">
3 <block wx:if="{{isloading==true}}"> 4 <block wx:if="{{isloading==true}}">
4 <view class="book-page bg_white"> 5 <view class="book-page bg_white">
@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 "userinfo": "/components/userinfo/userinfo", 6 "userinfo": "/components/userinfo/userinfo",
7 "nav":"/components/nav/nav", 7 "nav":"/components/nav/nav",
8 "formids":"/components/formids/formids", 8 "formids":"/components/formids/formids",
  9 + "a2l":"/components/tips/add-to-lite",
9 "userinfo-share": "/components/userinfo/share" 10 "userinfo-share": "/components/userinfo/share"
10 } 11 }
11 } 12 }
@@ -79,3 +79,4 @@ @@ -79,3 +79,4 @@
79 <template name="tpl-2"> 79 <template name="tpl-2">
80 <template is="tpl-wenxin" data="{{...seller,options}}"></template> 80 <template is="tpl-wenxin" data="{{...seller,options}}"></template>
81 </template> 81 </template>
  82 +<a2l bindshow="a2lshow" bindhide="a2lshow" key="INVIT"></a2l>
@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 "nav":"/components/nav/nav", 7 "nav":"/components/nav/nav",
8 "formids":"/components/formids/formids", 8 "formids":"/components/formids/formids",
9 "ddate":"/components/reserve/invitation/ddate", 9 "ddate":"/components/reserve/invitation/ddate",
  10 + "a2l":"/components/tips/add-to-lite",
10 "userinfo-share": "/components/userinfo/share" 11 "userinfo-share": "/components/userinfo/share"
11 } 12 }
12 } 13 }
@@ -56,3 +56,4 @@ @@ -56,3 +56,4 @@
56 <template is="tpl-wenxin" data="{{...seller,options}}"></template> 56 <template is="tpl-wenxin" data="{{...seller,options}}"></template>
57 </template> 57 </template>
58 <ddate id="ddate" order="{{detail}}" wx:if="{{detail}}" bindevent="ddateEvent"></ddate> 58 <ddate id="ddate" order="{{detail}}" wx:if="{{detail}}" bindevent="ddateEvent"></ddate>
  59 +<a2l bindshow="a2lshow" bindhide="a2lshow" key="INVIT-OWNER"></a2l>
@@ -122,7 +122,7 @@ @@ -122,7 +122,7 @@
122 <seller-box id="seller-box" bindevent="sellerBoxEvent"></seller-box> 122 <seller-box id="seller-box" bindevent="sellerBoxEvent"></seller-box>
123 <cover-view class="tab-patch"></cover-view> 123 <cover-view class="tab-patch"></cover-view>
124 <ds wx:if="{{hasSetActivity}}" map="{{map}}" id="ds"></ds> 124 <ds wx:if="{{hasSetActivity}}" map="{{map}}" id="ds"></ds>
125 -<a2l bindshow="a2lshow" bindhide="a2lshow"></a2l> 125 +<a2l bindshow="a2lshow" bindhide="a2lshow" key="INDEX"></a2l>
126 <list id="list" bindevent="listEvent" 126 <list id="list" bindevent="listEvent"
127 multiArray="{{multiArray}}" multiIndex="{{multiIndex}}" tags="{{tags}}"></list> 127 multiArray="{{multiArray}}" multiIndex="{{multiIndex}}" tags="{{tags}}"></list>
128 <caixi multiArray="{{multiArray}}" multiIndex="{{multiIndex}}" 128 <caixi multiArray="{{multiArray}}" multiIndex="{{multiIndex}}"