Commit 804fd0c20e7358b4b0354a8d2b9f5aeccfb47346

Authored by vking
1 parent 46b74bd6

收藏调整

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