Commit 1e25e51f57e44c98ceda6d90a6f4412d5eb8fe71

Authored by wangfan
1 parent 68edc7b2

首页地图页 & 添加到我的小程序

// components/tips/add-to-lite.js
import util from '../../utils/util'
const cache_key='ADD-TO-LINE'
Component({
/**
* 组件的属性列表
*/
properties: {
bgColor:{
type:String,
value:'#C8B16D',
}
},
/**
* 组件的初始数据
*/
data: {
hidden:true,
statusBarHeightFull:0,
},
attached(){
let ca=util.cache(cache_key);
if(ca){
this.hide();
}else{
this.show();
}
},
/**
* 组件的方法列表
*/
methods: {
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;
}else{
pt = systemInfo.statusBarHeight;
h = 48;
}
this.setData({
hidden:false,
statusBarHeightFull:pt+h,
})
if(!this.timeInterval){
this.timeIntervalNum=0;
this.timeInterval=setInterval(()=>{
this.hasClose();
},1000)
}
},
hasClose(){
if(this.timeIntervalNum>=10){
this.hide();
clearInterval(this.timeInterval);
return;
}
this.timeIntervalNum++;
},
hide(){
this.triggerEvent("hide");
util.cache(cache_key,cache_key);
this.setData({
hidden:true,
})
},
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--components/tips/add-to-lite.wxml-->
<cover-view class="mask" bindtap="hide" hidden="{{hidden}}">
<cover-view class="tip" style="top:{{statusBarHeightFull}}px;">
<cover-view class="jiao" style="background-color: {{bgColor}};"></cover-view>
<cover-view class="text" style="background-color: {{bgColor}};">添加到我的小程序,即想即用</cover-view>
</cover-view>
</cover-view>
... ...
/* components/tips/add-to-lite.wxss */
@import "../../app.wxss";
.tip{
position: fixed;
width: 460rpx;
right:40rpx;
top:200rpx;
font-size: 32rpx;
color:#FFFFFF;
}
.text{
border-radius: 10rpx;
line-height: 80rpx;
height: 80rpx;
overflow: hidden;
background-color: #C8B16D;
margin-top: -15rpx;
text-align: center;
}
.jiao{
background-color: #C8B16D;
width: 30rpx;
height: 30rpx;
transform:rotate(45deg);
margin-left: 340rpx;
margin-top: 10rpx;
}
\ No newline at end of file
... ...
... ... @@ -10,6 +10,7 @@
"searchList":"/components/searchlist/searchlist",
"calendar": "plugin://bmCalendar/calendar",
"board":"/components/book/board/board",
"formids":"/components/formids/formids"
"formids":"/components/formids/formids",
"a2l":"/components/tips/add-to-lite"
}
}
\ No newline at end of file
... ...
... ... @@ -273,4 +273,5 @@
data-value="{{item.often_use}}">{{item.often_use}}</view>
</view>
</view>
</view>
\ No newline at end of file
</view>
<a2l bgColor="#199095"></a2l>
\ No newline at end of file
... ...
... ... @@ -63,7 +63,7 @@ Page({
}
}
//console.log('this.enter_params',this.enter_params)
let url = '/pages/customer/list';
let url = '/pages/reserve/index';
if (opt.id > 0 || opt.sms_code) {
if(opt.invite_name){
let invite_names=wx.getStorageSync('invite_names') ||{};
... ... @@ -136,7 +136,7 @@ Page({
},
redirectTo(red){
console.log('this.redirectTo',red);
if(red.url.indexOf('list')>0){
if(red.url.indexOf('list')>0 || red.url.indexOf('reserve/index')>0){
wx.switchTab(red);
}else{
wx.redirectTo(red);
... ...
... ... @@ -538,4 +538,10 @@ Page({
url:'/pages/reserve/detail?id='+util.attr(e,'sid')
})
},
a2lshow(){
//wx.hideTabBar();
},
a2lhide(){
//wx.showTabBar();
},
})
\ No newline at end of file
... ...
... ... @@ -6,6 +6,7 @@
"formids":"/components/formids/formids",
"nav":"/components/nav/nav",
"showModal":"/components/showModal/showModal",
"sb-tr":"/components/reserve/seller-box-transverse/seller-box"
"sb-tr":"/components/reserve/seller-box-transverse/seller-box",
"a2l":"/components/tips/add-to-lite"
}
}
\ No newline at end of file
... ...
... ... @@ -67,4 +67,4 @@
<showModal id="showModal" confirmText="去授权" bindshowModal="showModal"></showModal>
<seller-box id="seller-box" bindevent="sellerBoxEvent"></seller-box>
<cover-view class="tab-patch"></cover-view>
<a2l bindshow="a2lshow" bindhide="a2lhide"></a2l>
... ...