Commit d0054f0c2e485ea59316cf5db9020aa1a5dadc5b

Authored by vking
1 parent 86b58be9

master-activity

// components/activity/enter.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
activity:null,
},
/**
* 组件的方法列表
*/
methods: {
hasActivity(e){//有通知就可以参加活动
console.log('hasActivity.enter',e)
this.getActivity()
},
getActivity(){
//
this.setData({
activity:{
id:1,
background:'#F04866',
banner:'http://qn.colorcun.com/activity/images/banner.png',
task:{
id:1,
name:'开工专享红包',
desc:'开工福利,胡吃海喝',
money:'18.8',
icon:'http://qn.colorcun.com/activity/images/icon.png',
status:0,
},
}
})
},
}
})
... ...
{
"component": true,
"usingComponents": {
"has":"./hasActivity"
}
}
\ No newline at end of file
... ...
<!--components/activity/enter.wxml-->
<has bindevent="hasActivity"></has>
<view class="mask" wx:if="{{activity}}" bindtap="close">
<view class="close"></view>
<view class="activity" bindcatch="bindcatch">
<view class="enter">
</view>
<view class="money">
</view>
</view>
</view>
... ...
/* components/activity/enter.wxss */
@import "../../app.wxss";
.mask{
z-index: 99999;
}
.close{
width: 60rpx;
height: 60rpx;
background-image: url("http://qn.colorcun.com/activity/images/enter/close.png");
background-size: 100% 100%;
margin-top: 200rpx;
margin-left: calc(100% - 100rpx);
}
.activity{
position: relative;
margin-top: 20rpx;
}
.enter{
width: 564rpx;
height: 471.3rpx;
background-image: url("http://qn.colorcun.com/activity/images/enter/enter.png");
background-size: 100% 100%;
margin-left:calc(50% - 282rpx);
}
.money{
width: 400rpx;
height: 360rpx;
background-image: url("http://qn.colorcun.com/activity/images/enter/money.png");
background-size: 100% 100%;
margin-left:calc(50% - 200rpx + 13rpx);
margin-top: -143rpx;
}
\ No newline at end of file
... ...
// components/activity/hasActivity.js
const TSPOS={
latitude:[
39.8380681800,
39.4711852300,
],
longitude:[
117.9670715300,
118.4078979500,
]
}
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
lifetimes: {
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
attached: function () {
this.selectComponent('#getpos').getPos();
},
moved: function () { },
detached: function () { },
},
/**
* 组件的方法列表
*/
methods: {
onpos(e){
let location=e.detail
location.latitude=39.6242016100
location.longitude=118.1174469000
//console.log('hasActivity',location);
if(location.latitude && location.longitude){
TSPOS.latitude.push(location.latitude)
TSPOS.longitude.push(location.longitude)
TSPOS.latitude=TSPOS.latitude.sort(($1,$2)=>{ return $1-$2})
TSPOS.longitude=TSPOS.longitude.sort(($1,$2)=>{ return $1-$2})
console.log('hasActivity',TSPOS);
if(TSPOS.latitude[1]==location.latitude
&& TSPOS.longitude[1]==location.longitude){
//console.log('hasActivity.event',location);
this.triggerEvent('event',location)
}
}
},
}
})
... ...
{
"component": true,
"usingComponents": {
"getpos":"/components/userinfo/getpos"
}
}
\ No newline at end of file
... ...
<!--components/activity/hasActivity.wxml-->
<getpos bindpos="onpos" id="getpos" hasAllowLoading="{{false}}"></getpos>
... ...
/* components/activity/hasActivity.wxss */
... ...
<!--components/tips/add-to-lite.wxml-->
<cover-view class="discount" style="top:{{statusBarHeightFull+a2lHeight}}px;width:{{hidden?'100rpx':'720rpx'}};" bindtap="gotoDiscount">
<cover-view style="position: relative;height: 100%;">
<cover-image class="discount-img" src="http://qn.colorcun.com/reserve/images/%E6%83%A03.png"></cover-image>
<cover-view style="position: relative;" wx:if="{{!hidden}}">
<cover-image src="http://qn.colorcun.com/reserve/images/%E4%BC%98%E6%83%A0%E6%B4%BB%E5%8A%A83.png"></cover-image>
<cover-view class="discount-view">
<cover-view class="text">精选折扣,周到安排用户专享</cover-view>
<cover-view class="close" catchtap="hide"></cover-view>
</cover-view>
</cover-view>
</cover-view>
</cover-view>
\ No newline at end of file
<view class="discount" style="top:{{statusBarHeightFull+a2lHeight}}px;width:{{hidden?'100rpx':'720rpx'}};" bindtap="gotoDiscount">
<view style="position: relative;height: 100%;">
<image class="discount-img" src="http://qn.colorcun.com/reserve/images/%E6%83%A03.png"></image>
<view style="position: relative;" wx:if="{{!hidden}}">
<image class="discount-imgmax"
src="http://qn.colorcun.com/reserve/images/%E4%BC%98%E6%83%A0%E6%B4%BB%E5%8A%A83.png"></image>
<view class="discount-view">
<view class="text">精选折扣,周到安排用户专享</view>
<view class="close" catchtap="hide"></view>
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -40,4 +40,8 @@
left:0;
width: 88rpx;
height: 88rpx;
}
.discount-imgmax{
height: 122rpx;
width: 100%;
}
\ No newline at end of file
... ...
<!--pack-activity/pages/index.wxml-->
<nav hasHome>activity</nav>
<nav hasHome>周到安排</nav>
<view class="pages" style="background-color: {{activity.background}}">
<view class="banner">
<image mode="widthFix" src="{{activity.banner}}" style="width: 100%"></image>
... ...
... ... @@ -10,6 +10,7 @@
"a2l":"/components/tips/add-to-lite",
"ds":"/components/tips/discount",
"caixi":"/components/reserve/caixi",
"list":"/components/reserve/seller-box-transverse-cview/list"
"list":"/components/reserve/seller-box-transverse-cview/list",
"activity-enter":"/components/activity/enter"
}
}
\ No newline at end of file
... ...
... ... @@ -16,18 +16,18 @@
subkey="SDEBZ-I74W4-QLGUX-XXYXU-HIR23-3QFBJ"
style="width: 100%; height: {{map.height+60}}px;"></map>
<formids url="/pages/reserve/search" style="position: fixed;">
<cover-view
<view
class="flex-ll"
style="position:fixed;top:{{statusBarHeight}}px;left:0;height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px;">
<cover-view class="searchList flex-ll" catchtap="listShow">
<cover-image class="icon" src="http://qn.colorcun.com/reserve/images/hasList3.png"></cover-image>
<cover-view class="title">列表</cover-view>
</cover-view>
<cover-view class="searchAddr flex-ll">
<cover-image class="icon" src="http://qn.colorcun.com/custom/lite-online/image/search26.png"></cover-image>
<cover-view class="title">{{hasSuggestion?suggestion.title:'输入餐厅名或地名,快速订包间'}}</cover-view>
</cover-view>
</cover-view>
<view class="searchList flex-ll" catchtap="listShow">
<image class="icon" src="http://qn.colorcun.com/reserve/images/hasList3.png"></image>
<view class="title">列表</view>
</view>
<view class="searchAddr flex-ll">
<image class="icon" src="http://qn.colorcun.com/custom/lite-online/image/search26.png"></image>
<view class="title">{{hasSuggestion?suggestion.title:'输入餐厅名或地名,快速订包间'}}</view>
</view>
</view>
</formids>
</view>
<view class="seller-view {{(listMoreCount<1)?(hasSearchLimit?'disabled enabled':'disabled'):''}}">
... ... @@ -126,9 +126,9 @@
</view>
</view>
</view>
<cover-view bindtap="moveToLocation" class="moveToLocation">
<cover-image src="http://qn.colorcun.com/reserve/images/golocal.png"></cover-image>
</cover-view>
<view bindtap="moveToLocation" class="moveToLocation">
<image src="http://qn.colorcun.com/reserve/images/golocal.png"></image>
</view>
<getpos bindpos="onpos" id="getpos"></getpos>
<seller-box id="seller-box" bindevent="sellerBoxEvent"></seller-box>
<cover-view class="tab-patch"></cover-view>
... ... @@ -139,4 +139,5 @@
<caixi multiArray="{{multiArray}}" multiIndex="{{multiIndex}}"
bindactive="caixiActive" id="caixi"
></caixi>
<fb></fb>
\ No newline at end of file
<fb></fb>
<activity-enter></activity-enter>
\ No newline at end of file
... ...
... ... @@ -24,7 +24,7 @@ page{
width: 62rpx;
height: 62rpx;
}
.moveToLocation cover-image{
.moveToLocation image{
width: 62rpx;
height: 62rpx;
}
... ...