Showing
10 changed files
with
131 additions
and
6 deletions
components/tips/add-to-lite.js
0 → 100644
| 1 | +// components/tips/add-to-lite.js | ||
| 2 | +import util from '../../utils/util' | ||
| 3 | +const cache_key='ADD-TO-LINE' | ||
| 4 | +Component({ | ||
| 5 | + /** | ||
| 6 | + * 组件的属性列表 | ||
| 7 | + */ | ||
| 8 | + properties: { | ||
| 9 | + bgColor:{ | ||
| 10 | + type:String, | ||
| 11 | + value:'#C8B16D', | ||
| 12 | + } | ||
| 13 | + }, | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * 组件的初始数据 | ||
| 17 | + */ | ||
| 18 | + data: { | ||
| 19 | + hidden:true, | ||
| 20 | + statusBarHeightFull:0, | ||
| 21 | + }, | ||
| 22 | + attached(){ | ||
| 23 | + let ca=util.cache(cache_key); | ||
| 24 | + if(ca){ | ||
| 25 | + this.hide(); | ||
| 26 | + }else{ | ||
| 27 | + this.show(); | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + }, | ||
| 31 | + /** | ||
| 32 | + * 组件的方法列表 | ||
| 33 | + */ | ||
| 34 | + methods: { | ||
| 35 | + show(){ | ||
| 36 | + this.triggerEvent("show"); | ||
| 37 | + //导航栏自适应 | ||
| 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; | ||
| 45 | + }else{ | ||
| 46 | + pt = systemInfo.statusBarHeight; | ||
| 47 | + h = 48; | ||
| 48 | + } | ||
| 49 | + this.setData({ | ||
| 50 | + hidden:false, | ||
| 51 | + statusBarHeightFull:pt+h, | ||
| 52 | + }) | ||
| 53 | + if(!this.timeInterval){ | ||
| 54 | + this.timeIntervalNum=0; | ||
| 55 | + this.timeInterval=setInterval(()=>{ | ||
| 56 | + this.hasClose(); | ||
| 57 | + },1000) | ||
| 58 | + } | ||
| 59 | + }, | ||
| 60 | + hasClose(){ | ||
| 61 | + if(this.timeIntervalNum>=10){ | ||
| 62 | + this.hide(); | ||
| 63 | + clearInterval(this.timeInterval); | ||
| 64 | + return; | ||
| 65 | + } | ||
| 66 | + this.timeIntervalNum++; | ||
| 67 | + }, | ||
| 68 | + hide(){ | ||
| 69 | + this.triggerEvent("hide"); | ||
| 70 | + util.cache(cache_key,cache_key); | ||
| 71 | + this.setData({ | ||
| 72 | + hidden:true, | ||
| 73 | + }) | ||
| 74 | + }, | ||
| 75 | + } | ||
| 76 | +}) |
components/tips/add-to-lite.json
0 → 100644
components/tips/add-to-lite.wxml
0 → 100644
| 1 | +<!--components/tips/add-to-lite.wxml--> | ||
| 2 | +<cover-view class="mask" bindtap="hide" hidden="{{hidden}}"> | ||
| 3 | + <cover-view class="tip" style="top:{{statusBarHeightFull}}px;"> | ||
| 4 | + <cover-view class="jiao" style="background-color: {{bgColor}};"></cover-view> | ||
| 5 | + <cover-view class="text" style="background-color: {{bgColor}};">添加到我的小程序,即想即用</cover-view> | ||
| 6 | + </cover-view> | ||
| 7 | +</cover-view> | ||
| 8 | + | ||
| 9 | + |
components/tips/add-to-lite.wxss
0 → 100644
| 1 | +/* components/tips/add-to-lite.wxss */ | ||
| 2 | +@import "../../app.wxss"; | ||
| 3 | +.tip{ | ||
| 4 | + position: fixed; | ||
| 5 | + width: 460rpx; | ||
| 6 | + right:40rpx; | ||
| 7 | + top:200rpx; | ||
| 8 | + font-size: 32rpx; | ||
| 9 | + color:#FFFFFF; | ||
| 10 | +} | ||
| 11 | +.text{ | ||
| 12 | + border-radius: 10rpx; | ||
| 13 | + line-height: 80rpx; | ||
| 14 | + height: 80rpx; | ||
| 15 | + overflow: hidden; | ||
| 16 | + background-color: #C8B16D; | ||
| 17 | + margin-top: -15rpx; | ||
| 18 | + text-align: center; | ||
| 19 | +} | ||
| 20 | +.jiao{ | ||
| 21 | + background-color: #C8B16D; | ||
| 22 | + width: 30rpx; | ||
| 23 | + height: 30rpx; | ||
| 24 | + transform:rotate(45deg); | ||
| 25 | + margin-left: 340rpx; | ||
| 26 | + margin-top: 10rpx; | ||
| 27 | +} |
| @@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
| 10 | "searchList":"/components/searchlist/searchlist", | 10 | "searchList":"/components/searchlist/searchlist", |
| 11 | "calendar": "plugin://bmCalendar/calendar", | 11 | "calendar": "plugin://bmCalendar/calendar", |
| 12 | "board":"/components/book/board/board", | 12 | "board":"/components/book/board/board", |
| 13 | - "formids":"/components/formids/formids" | 13 | + "formids":"/components/formids/formids", |
| 14 | + "a2l":"/components/tips/add-to-lite" | ||
| 14 | } | 15 | } |
| 15 | } | 16 | } |
| @@ -63,7 +63,7 @@ Page({ | @@ -63,7 +63,7 @@ Page({ | ||
| 63 | } | 63 | } |
| 64 | } | 64 | } |
| 65 | //console.log('this.enter_params',this.enter_params) | 65 | //console.log('this.enter_params',this.enter_params) |
| 66 | - let url = '/pages/customer/list'; | 66 | + let url = '/pages/reserve/index'; |
| 67 | if (opt.id > 0 || opt.sms_code) { | 67 | if (opt.id > 0 || opt.sms_code) { |
| 68 | if(opt.invite_name){ | 68 | if(opt.invite_name){ |
| 69 | let invite_names=wx.getStorageSync('invite_names') ||{}; | 69 | let invite_names=wx.getStorageSync('invite_names') ||{}; |
| @@ -136,7 +136,7 @@ Page({ | @@ -136,7 +136,7 @@ Page({ | ||
| 136 | }, | 136 | }, |
| 137 | redirectTo(red){ | 137 | redirectTo(red){ |
| 138 | console.log('this.redirectTo',red); | 138 | console.log('this.redirectTo',red); |
| 139 | - if(red.url.indexOf('list')>0){ | 139 | + if(red.url.indexOf('list')>0 || red.url.indexOf('reserve/index')>0){ |
| 140 | wx.switchTab(red); | 140 | wx.switchTab(red); |
| 141 | }else{ | 141 | }else{ |
| 142 | wx.redirectTo(red); | 142 | wx.redirectTo(red); |
| @@ -538,4 +538,10 @@ Page({ | @@ -538,4 +538,10 @@ Page({ | ||
| 538 | url:'/pages/reserve/detail?id='+util.attr(e,'sid') | 538 | url:'/pages/reserve/detail?id='+util.attr(e,'sid') |
| 539 | }) | 539 | }) |
| 540 | }, | 540 | }, |
| 541 | + a2lshow(){ | ||
| 542 | + //wx.hideTabBar(); | ||
| 543 | + }, | ||
| 544 | + a2lhide(){ | ||
| 545 | + //wx.showTabBar(); | ||
| 546 | + }, | ||
| 541 | }) | 547 | }) |
| @@ -6,6 +6,7 @@ | @@ -6,6 +6,7 @@ | ||
| 6 | "formids":"/components/formids/formids", | 6 | "formids":"/components/formids/formids", |
| 7 | "nav":"/components/nav/nav", | 7 | "nav":"/components/nav/nav", |
| 8 | "showModal":"/components/showModal/showModal", | 8 | "showModal":"/components/showModal/showModal", |
| 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 | } | 11 | } |
| 11 | } | 12 | } |
| @@ -67,4 +67,4 @@ | @@ -67,4 +67,4 @@ | ||
| 67 | <showModal id="showModal" confirmText="去授权" bindshowModal="showModal"></showModal> | 67 | <showModal id="showModal" confirmText="去授权" bindshowModal="showModal"></showModal> |
| 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 | - | 70 | +<a2l bindshow="a2lshow" bindhide="a2lhide"></a2l> |
-
Please register or login to post a comment