Commit d0054f0c2e485ea59316cf5db9020aa1a5dadc5b

Authored by vking
1 parent 86b58be9

master-activity

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