Commit 241d66ca942497b50f3b1201ec71a1093ac08db7

Authored by vking
1 parent 47c78720

boots

// components/tips/boost.js
const cacheKey='A2L-INDEX'
Component({
/**
* 组件的属性列表
*/
properties: {
},
lifetimes: {
attached: function() {
this.show()
},
},
/**
* 组件的初始数据
*/
data: {
disp:false,
background:[{
url:'http://nosqn.colorcun.com/boots/1.png',
txt:'1.戳选地图上的商家,开始预订',
},{
url:'http://nosqn.colorcun.com/boots/2.png',
txt:'2.搜索商家或位置,开始预订',
}]
},
/**
* 组件的方法列表
*/
methods: {
show(){
wx.getStorage({
key:cacheKey,
fail:()=>{
this.setData({
disp:true,
})
this.triggerEvent('event',{act:'show',txt:'新用户'})
//wx.setStorage({key:cacheKey, data:new Date().toISOString()})
},
success:()=>{
this.triggerEvent('event',{act:'hide',txt:'老用户'})
},
})
},
hide(){
this.setData({
disp:false,
})
this.triggerEvent('event',{act:'hide',txt:'新用户'})
},
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--components/tips/boost.wxml-->
<view class="mask" bindtap="hide" wx:if="{{disp}}">
<view class="boost" catchtap="catchtap">
<view class="header flex-lr" bindtap="hide">
<view> </view>
<view class="title">操作指引</view>
<view class="close"></view>
</view>
<view class="content">
<swiper indicator-dots style="height:496rpx;">
<block wx:for="{{background}}" wx:key="*this">
<swiper-item style="text-align: center">
<image src="{{item.url}}" class="swiper-image"></image>
<view class="swiper-txt Medium">{{item.txt}}</view>
</swiper-item>
</block>
</swiper>
</view>
</view>
</view>
... ...
/* components/tips/boost.wxss */
@import "../../app.wxss";
.boost{
width:100%;
height:738rpx;
background:rgba(255,255,255,1);
border-radius:40rpx 40rpx 0rpx 0rpx;
padding: 40rpx 42rpx 0;
box-sizing: border-box;
position: fixed;
bottom: 0;
}
.title{
height:42rpx;
font-size:30rpx;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(53,53,53,1);
line-height:42rpx;
}
.close{
width:28rpx;
height:29rpx;
background-size: 100% 100%;
background-image: url("http://nosqn.colorcun.com/sellerbaobao/close.png");
}
.content{
margin-top: 80rpx;
}
.swiper-image{
width:468rpx;
height:290rpx;
}
.swiper-txt{
height:44rpx;
font-size:32rpx;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:500;
color:rgba(53,53,53,1);
line-height:44rpx;
margin-top: 60rpx;
}
\ No newline at end of file
... ...
... ... @@ -908,4 +908,7 @@ Page({
}
})
},
boostEvent(e){
console.log('boostEvent',e)
},
})
\ No newline at end of file
... ...
... ... @@ -8,6 +8,7 @@
"getpos":"/components/userinfo/getpos",
"sb-tr":"/components/reserve/seller-box-transverse/seller-box",
"a2l":"/components/tips/add-to-lite",
"boost":"/components/tips/boost",
"ds":"/components/tips/discount",
"caixi":"/components/reserve/caixi",
"list":"/components/reserve/seller-box-transverse-cview/list",
... ...
... ... @@ -142,4 +142,5 @@
<caixi multiArray="{{multiArray}}" multiIndex="{{multiIndex}}"
bindactive="caixiActive" id="caixi"
></caixi>
<activity-enter hasInHome></activity-enter>
\ No newline at end of file
<activity-enter hasInHome></activity-enter>
<boost bindevent="boostEvent"></boost>
\ No newline at end of file
... ...