Commit 4b1bde20ea0a6649eb847d711a887957a8b68749

Authored by vking
1 parent f5ac842b

master-activity

... ... @@ -7,6 +7,7 @@ Component({
*/
properties: {
hasInHome:Boolean,
floclass:String,
},
/**
... ... @@ -38,12 +39,18 @@ Component({
activity.task=res.data.task
let displayType=0//浮层
if(activity.status==1 && activity.starttime<time && time<activity.endtime){
if(activity.balance>1000 && activity.task.status!=2){
displayType=1//弹框
App.Task.SetTaskInfo({//领取任务
aid:activity.id,
tid:activity.task.id,
})
if(activity.balance>1000){
if(activity.task.status!=2){
displayType=1//弹框
App.Task.SetTaskInfo({//领取任务
aid:activity.id,
tid:activity.task.id,
})
}
}else{
if(!this.data.hasInHome){//非首页浮层也不显示
activity=null
}
}
this.setData({
displayType:displayType,
... ...
... ... @@ -26,7 +26,7 @@
</view>
<navigator wx:else="" hover-class="navigator-hover"
url="/pack-activity/pages/index?id={{activity.id}}" >
<view class="mask-tips"></view>
<view class="mask-tips {{floclass}}"></view>
</navigator>
</block>
... ...
// components/activity/tips.js
import util from '../../utils/util';
import App from '../../utils/api';
Component({
/**
* 组件的属性列表
*/
properties: {
pos:String,
str:String,
cla:String,
},
/**
* 组件的初始数据
*/
data: {
activity:null,
},
lifetimes: {
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
attached: function () { },
moved: function () { },
detached: function () { },
},
/**
* 组件的方法列表
*/
methods: {
hasActivity(e){//有通知就可以参加活动
console.log('hasActivity.enter',e)
this.getActivity()
},
getActivity(){
//hasInHome 金额少于1000 只显示小图
App.Task.GetTaskInfo({pos:this.data.pos}).then(res=>{
let time=new Date()/1000
let activity=res.data.activity
activity.task=res.data.task
if(activity.status==1 && activity.starttime<time && time<activity.endtime){
if(activity.balance>1000 && activity.task.status!=2){
//通知页面显示tips
this.setData({
activity:activity,
msg:this.data.str.replace("¥price","¥"+activity.task.price)
})
}
}
})
},
}
})
... ...
{
"component": true,
"usingComponents": {
"has":"./hasActivity"
}
}
\ No newline at end of file
... ...
<!--components/activity/tips.wxml-->
<has bindevent="hasActivity"></has>
<view class="tips {{cla}}" wx:if="{{activity}}">
<view class="msg">
{{msg}}
<view class="jiao"></view>
</view>
</view>
... ...
/* components/activity/tips.wxss */
.tips{
position: fixed;
z-index: 9999;
background:rgba(84,83,84,0.8);
font-size:24rpx;
font-weight:500;
color:rgba(255,255,255,1);
}
.tips.reserve-detail{
bottom:122rpx;
right:30rpx;
}
.tips .msg{
height: 70rpx;
line-height: 70rpx;
padding: 0 24rpx;
position: relative;
}
.jiao{
width: 26rpx;
height: 18rpx;
background-image: url("http://qn.colorcun.com/activity/images/jiao.png");
background-size: 100% 100%;
position: absolute;
bottom: -14rpx;
left:30rpx;
}
.tips.reserve-detail .jiao{
right:80rpx;
left:auto;
}
.tips.reserve-detail .msg{
color: #FEDE68;
}
.tips.reserve-detail .msg:before{
content: "现在预订即可获得";
color:rgba(255,255,255,1);
}
.tips.reserve-detail .msg:after{
content: "红包";
color:rgba(255,255,255,1);
}
\ No newline at end of file
... ...
... ... @@ -8,6 +8,7 @@
"nav":"/components/nav/nav",
"card":"/components/seller-card/seller-card",
"formids":"/components/formids/formids",
"userinfo-share": "/components/userinfo/share"
"userinfo-share": "/components/userinfo/share",
"activity-enter":"/components/activity/enter"
}
}
\ No newline at end of file
... ...
... ... @@ -46,4 +46,5 @@
</view>
</block>
</view>
<manager manager="{{detail}}" id="manager"></manager>
\ No newline at end of file
<manager manager="{{detail}}" id="manager"></manager>
<activity-enter floclass="detail_customer"></activity-enter>
\ No newline at end of file
... ...
... ... @@ -12,6 +12,7 @@
"sb-tr":"/components/reserve/seller-box-transverse/seller-box",
"getpos":"/components/userinfo/getpos",
"as":"/components/actionSheet/index",
"subscribe": "/components/userinfo/subscribe"
"subscribe": "/components/userinfo/subscribe",
"activity-enter":"/components/activity/enter"
}
}
\ No newline at end of file
... ...
... ... @@ -174,4 +174,5 @@
</view>
<manager manager="{{detail}}" id="manager"></manager>
<as id="as" items="{{detail.seller.seller_tel}}" bindclick="callSellerPhone">拨打电话</as>
<getpos bindpos="onpos" id="getpos" hasAllowFail hasAllowLoading="{{false}}"></getpos>
\ No newline at end of file
<getpos bindpos="onpos" id="getpos" hasAllowFail hasAllowLoading="{{false}}"></getpos>
<activity-enter floclass="detail_owner"></activity-enter>
\ No newline at end of file
... ...
... ... @@ -15,7 +15,8 @@
"people":"/components/reserve/people/people",
"dur":"/components/reserve/dur/dur",
"calendar":"/components/reserve/week-calendar/week-calendar",
"section":"/components/reserve/section/section",
"select-room":"/components/reserve/select-room/select-room"
"activity-tips":"/components/activity/tips",
"section":"/components/reserve/section/section",
"select-room":"/components/reserve/select-room/select-room"
}
}
\ No newline at end of file
... ...
<!--pages/reserve/detail.wxml-->
<layout>
<nav hasHome>{{seller.sellername}}</nav>
<!-- 包间预定 -->
<view class="tabs flex-lr" wx:if="{{hasOnlineReserve}}">
<view class="tabs-item flex-vc" bindtap="switchTabs" data-act="detail">
<view class="tabs-item-text {{activeTab=='detail'?'active':''}}">餐厅详情</view>
</view>
<view class="tabs-item flex-vc" bindtap="switchTabs" data-act="reserve">
<view class="tabs-item-text {{activeTab=='reserve'?'active':''}}">包间预订</view>
<nav hasHome>{{seller.sellername}}</nav>
<!-- 包间预定 -->
<view class="tabs flex-lr" wx:if="{{hasOnlineReserve}}">
<view class="tabs-item flex-vc" bindtap="switchTabs" data-act="detail">
<view class="tabs-item-text {{activeTab=='detail'?'active':''}}">餐厅详情</view>
</view>
<view class="tabs-item flex-vc" bindtap="switchTabs" data-act="reserve">
<view class="tabs-item-text {{activeTab=='reserve'?'active':''}}">包间预订</view>
</view>
</view>
</view>
<view hidden="{{activeTab!='detail'}}">
<view class="seller-banner" style="{{pagesHeight!='auto'?'position: fixed;':''}}{{hasOnlineReserve?'margin-top: 80rpx;':''}}">
<swiper
indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}"
interval="2000" duration="500"
previous-margin="{{0}}px" next-margin="{{0}}px"
current="{{current}}" bindchange="bindtransition" bindtap="reviweBanner">
<block wx:for="{{seller.envi_image}}" wx:key="sellers.key">
<swiper-item>
<image class="image" mode="aspectFill"
src="{{item}}?imageView2/2/w/860/interlace/0/q/100" ></image>
</swiper-item>
</block>
</swiper>
<view class="slogan" wx:if="{{seller.slogan}}">
<view class="slogan-view flex-ll">
<view class="dot"></view>
<view>{{seller.slogan}}</view>
<view hidden="{{activeTab!='detail'}}">
<view class="seller-banner" style="{{pagesHeight!='auto'?'position: fixed;':''}}{{hasOnlineReserve?'margin-top: 80rpx;':''}}">
<swiper
indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}"
interval="2000" duration="500"
previous-margin="{{0}}px" next-margin="{{0}}px"
current="{{current}}" bindchange="bindtransition" bindtap="reviweBanner">
<block wx:for="{{seller.envi_image}}" wx:key="sellers.key">
<swiper-item>
<image class="image" mode="aspectFill"
src="{{item}}?imageView2/2/w/860/interlace/0/q/100" ></image>
</swiper-item>
</block>
</swiper>
<view class="slogan" wx:if="{{seller.slogan}}">
<view class="slogan-view flex-ll">
<view class="dot"></view>
<view>{{seller.slogan}}</view>
</view>
</view>
<view class="swiper-num" wx:if="{{seller.envi_image.length>0}}">{{currentView}} / {{seller.envi_image.length}}</view>
</view>
<view class="swiper-num" wx:if="{{seller.envi_image.length>0}}">{{currentView}} / {{seller.envi_image.length}}</view>
</view>
<view class="pages" style="height: {{pagesHeight}};overflow:{{pagesHeight=='auto'?'visible':'hidden'}}">
<view class="seller">
<view class="base">
<view class="name Semibold flex-lr">
<view class="name-info">{{seller.sellername}}
<view class="broad" wx:if="{{seller.brand}}">
<view class="broad-1"></view>
<view class="broad-2">{{seller.brand.name}}</view>
<view class="broad-3"></view>
<view class="pages" style="height: {{pagesHeight}};overflow:{{pagesHeight=='auto'?'visible':'hidden'}}">
<view class="seller">
<view class="base">
<view class="name Semibold flex-lr">
<view class="name-info">{{seller.sellername}}
<view class="broad" wx:if="{{seller.brand}}">
<view class="broad-1"></view>
<view class="broad-2">{{seller.brand.name}}</view>
<view class="broad-3"></view>
</view>
</view>
<view class="average" wx:if="{{seller.average>0}}">¥{{seller.average}}/人</view>
</view>
<view class="ping flex-ll">
<view class="item" wx:if="{{seller.cate.length>0}}">{{seller.cate[0]}}</view>
<view class="item" wx:if="{{seller.is_belt_wine!=0}}">{{seller.is_belt_wine==1?'不可带酒水':'可自带酒水'}}</view>
<view class="item" wx:if="{{seller.is_parking==1}}">停车场</view>
<view class="item" wx:if="{{seller.room_num>0}}">{{seller.room_num}}个包间</view>
</view>
<view class="label_c" wx:if="{{seller.label_cstr}}">
<text class="label_text" >{{seller.label_cstr}}</text>
</view>
<view class="average" wx:if="{{seller.average>0}}">¥{{seller.average}}/人</view>
</view>
<view class="ping flex-ll">
<view class="item" wx:if="{{seller.cate.length>0}}">{{seller.cate[0]}}</view>
<view class="item" wx:if="{{seller.is_belt_wine!=0}}">{{seller.is_belt_wine==1?'不可带酒水':'可自带酒水'}}</view>
<view class="item" wx:if="{{seller.is_parking==1}}">停车场</view>
<view class="item" wx:if="{{seller.room_num>0}}">{{seller.room_num}}个包间</view>
</view>
<view class="label_c" wx:if="{{seller.label_cstr}}">
<text class="label_text" >{{seller.label_cstr}}</text>
</view>
</view>
<view style="display:{{pagesHeight=='auto'?'block':'none'}}">
<view class="addr flex-lr" wx:if="{{hasOnlineReserve}}">
<view class="addr-view" bindtap="lookLocation">
<view class="addr-text flex-ll">
<image src="http://qn.colorcun.com/custom/lite-online/image/%E5%AE%9A%E4%BD%8D.png"></image>
<view class="text">{{seller.real_address||seller.map_address}}</view>
<view style="display:{{pagesHeight=='auto'?'block':'none'}}">
<view class="addr flex-lr" wx:if="{{hasOnlineReserve}}">
<view class="addr-view" bindtap="lookLocation">
<view class="addr-text flex-ll">
<image src="http://qn.colorcun.com/custom/lite-online/image/%E5%AE%9A%E4%BD%8D.png"></image>
<view class="text">{{seller.real_address||seller.map_address}}</view>
</view>
<view class="addr-long">{{seller.distanceStr?'距您'+seller.distanceStr:''}}</view>
</view>
<view class="addr-long">{{seller.distanceStr?'距您'+seller.distanceStr:''}}</view>
<view class="more more-phone" bindtap="reserveEvent" data-act="phone"></view>
</view>
<view class="more more-phone" bindtap="reserveEvent" data-act="phone"></view>
</view>
<view class="addr flex-lr" bindtap="lookLocation" wx:else="" >
<view class="addr-view">
<view class="addr-text flex-ll">
<image src="http://qn.colorcun.com/custom/lite-online/image/%E5%AE%9A%E4%BD%8D.png"></image>
<view class="text">{{seller.real_address||seller.map_address}}</view>
<view class="addr flex-lr" bindtap="lookLocation" wx:else="" >
<view class="addr-view">
<view class="addr-text flex-ll">
<image src="http://qn.colorcun.com/custom/lite-online/image/%E5%AE%9A%E4%BD%8D.png"></image>
<view class="text">{{seller.real_address||seller.map_address}}</view>
</view>
<view class="addr-long">{{seller.distanceStr?'距您'+seller.distanceStr:''}}</view>
</view>
<view class="addr-long">{{seller.distanceStr?'距您'+seller.distanceStr:''}}</view>
<view class="more more-addr"></view>
</view>
<view class="more more-addr"></view>
</view>
</view>
</view>
<view style="display:{{pagesHeight=='auto'?'block':'none'}}">
<view class="black20line"></view>
<view class="seller" wx:if="{{seller.activity.length>0}}">
<formids bindclick="showDiscount">
<view class="activity-view-easy flex-lr" >
<view class="activity-left flex-ll">
<view class="icon"></view>
<block wx:for="{{seller.activity}}"
wx:key="seller.activity.key"
wx:if="{{index<2}}">
<view class="discount" >{{item.title}}</view>
</block>
</view>
<view class="flex-rr activity-right">
<view class="more-text">更多</view>
<view class="more"></view>
<view style="display:{{pagesHeight=='auto'?'block':'none'}}">
<view class="black20line"></view>
<view class="seller" wx:if="{{seller.activity.length>0}}">
<formids bindclick="showDiscount">
<view class="activity-view-easy flex-lr" >
<view class="activity-left flex-ll">
<view class="icon"></view>
<block wx:for="{{seller.activity}}"
wx:key="seller.activity.key"
wx:if="{{index<2}}">
<view class="discount" >{{item.title}}</view>
</block>
</view>
<view class="flex-rr activity-right">
<view class="more-text">更多</view>
<view class="more"></view>
</view>
</view>
</view>
</formids>
<!--
<formids wx:if="{{seller.activity.length>0}}" bindclick="showDiscount">
<view class="activity-view" >
<view class="activity" >
<view class="flex-lr">
<view class="activity-left">
<view class="activity-first flex-ll" style="align-items: flex-start">
<image src="http://qn.colorcun.com/custom/lite-online/image%E5%96%87%E5%8F%AD.png"></image>
<view class="flex-cc discount" wx:for="{{seller.activity}}"
wx:key="seller.activity.key"
wx:if="{{index<2}}">
<view class="discount-left"></view>
<view class="discount-text">{{item.title}}</view>
<view class="discount-right"></view>
</formids>
<!--
<formids wx:if="{{seller.activity.length>0}}" bindclick="showDiscount">
<view class="activity-view" >
<view class="activity" >
<view class="flex-lr">
<view class="activity-left">
<view class="activity-first flex-ll" style="align-items: flex-start">
<image src="http://qn.colorcun.com/custom/lite-online/image%E5%96%87%E5%8F%AD.png"></image>
<view class="flex-cc discount" wx:for="{{seller.activity}}"
wx:key="seller.activity.key"
wx:if="{{index<2}}">
<view class="discount-left"></view>
<view class="discount-text">{{item.title}}</view>
<view class="discount-right"></view>
</view>
</view>
</view>
<view class="activity-right flex-rr Semibold">
<view></view>
<view class="more"></view>
</view>
</view>
<view class="activity-right flex-rr Semibold">
<view></view>
<view class="more"></view>
<view class="activity-text">
该优惠仅适用于一键订平台预订客户
</view>
</view>
<view class="activity-text">
该优惠仅适用于一键订平台预订客户
</view>
</view>
</view>
</formids>
-->
</view>
<view class="black20line" wx:if="{{seller.activity.length>0}}"></view>
<view class="block" wx:if="{{seller.room_image.length>0}}">
<view class="header flex-ll">
<view class="line"></view>
<view class="name">包间环境</view>
</formids>
-->
</view>
<scroll-view
scroll-x
class="baos"
scroll-into-view="{{toView}}"
scroll-top="{{scrollTop}}"
>
<view class="black20line" wx:if="{{seller.activity.length>0}}"></view>
<view class="block" wx:if="{{seller.room_image.length>0}}">
<view class="header flex-ll">
<view class="line"></view>
<view class="name">包间环境</view>
</view>
<scroll-view
scroll-x
class="baos"
scroll-into-view="{{toView}}"
scroll-top="{{scrollTop}}"
>
<block wx:for="{{seller.room_image}}" wx:key="sellers.key">
<view class="image">
<image mode="aspectFill" bindtap="reviweRoomImage" data-current="{{item}}"
src="{{item}}?imageView2/2/w/640/interlace/0/q/100"></image>
</view>
</block>
<block wx:for="{{seller.room_image}}" wx:key="sellers.key">
<view class="image">
<image mode="aspectFill" bindtap="reviweRoomImage" data-current="{{item}}"
src="{{item}}?imageView2/2/w/640/interlace/0/q/100"></image>
</view>
</block>
</scroll-view>
</view>
<view class="block" wx:if="{{seller.dishes.length>0}}">
<view class="header flex-ll">
<view class="line"></view>
<view class="name">推荐菜品</view>
</scroll-view>
</view>
<scroll-view
scroll-x
class="cais"
scroll-into-view="{{toView}}"
scroll-top="{{scrollTop}}"
>
<block wx:for="{{seller.dishes}}" wx:key="sellers.key">
<view class="cais-views" wx:if="{{item.image}}">
<view class="image-view" >
<view class="image">
<image mode="aspectFill" bindtap="reviweDishesImage" data-current="{{item.image}}"
src="{{item.image}}?imageView2/2/w/640/interlace/0/q/100"></image>
<view class="block" wx:if="{{seller.dishes.length>0}}">
<view class="header flex-ll">
<view class="line"></view>
<view class="name">推荐菜品</view>
</view>
<scroll-view
scroll-x
class="cais"
scroll-into-view="{{toView}}"
scroll-top="{{scrollTop}}"
>
<block wx:for="{{seller.dishes}}" wx:key="sellers.key">
<view class="cais-views" wx:if="{{item.image}}">
<view class="image-view" >
<view class="image">
<image mode="aspectFill" bindtap="reviweDishesImage" data-current="{{item.image}}"
src="{{item.image}}?imageView2/2/w/640/interlace/0/q/100"></image>
</view>
<view class="text Semibold">{{item.name}}</view>
</view>
<view class="text Semibold">{{item.name}}</view>
</view>
</block>
</scroll-view>
<view class="cais-text">
<block wx:for="{{seller.dishes}}" wx:key="sellers.key">
<view wx:if="{{!item.image}}">{{item.name}}</view>
</block>
</view>
</block>
</scroll-view>
<view class="cais-text">
<block wx:for="{{seller.dishes}}" wx:key="sellers.key">
<view wx:if="{{!item.image}}">{{item.name}}</view>
</block>
</view>
</view>
</view>
</view>
<view class="footer flex-lr">
<view class="left flex-cc">
<formids class="flex-tb" url="/pages/customer/index">
<image src="http://qn.colorcun.com/custom/lite-online/image/%E9%A6%96%E9%A1%B5.png"></image>
<view class="text">首页</view>
</formids>
<userinfo class="follow flex-tb" binduserinfo="follow">
<image src="http://qn.colorcun.com/custom/lite-online/image/%E6%94%B6%E8%97%8F.png" wx:if="{{!IsCollectionSeller}}"></image>
<image src="http://qn.colorcun.com/custom/lite-online/image/%E5%B7%B2%E6%94%B6%E8%97%8F.png" wx:else=""></image>
<view class="text">收藏</view>
</userinfo>
<view class="footer flex-lr">
<view class="left flex-cc">
<formids class="flex-tb" url="/pages/customer/index">
<image src="http://qn.colorcun.com/custom/lite-online/image/%E9%A6%96%E9%A1%B5.png"></image>
<view class="text">首页</view>
</formids>
<userinfo class="follow flex-tb" binduserinfo="follow">
<image src="http://qn.colorcun.com/custom/lite-online/image/%E6%94%B6%E8%97%8F.png" wx:if="{{!IsCollectionSeller}}"></image>
<image src="http://qn.colorcun.com/custom/lite-online/image/%E5%B7%B2%E6%94%B6%E8%97%8F.png" wx:else=""></image>
<view class="text">收藏</view>
</userinfo>
</view>
<view class="reserve share flex-vc">
<userinfo class="flex-vc" style="width: 100%" binduserinfo="shareUserinfo">
<view class="text">分享</view>
</userinfo>
</view>
<view class="reserve reserve-click flex-vc">
<formids class="flex-vc" bindclick="reserveEvent" id="reserve-button">
<view class="text">{{hasOnlineReserve?'订包间':'联系餐厅'}}</view>
</formids>
</view>
</view>
<view class="reserve share flex-vc">
<userinfo class="flex-vc" style="width: 100%" binduserinfo="shareUserinfo">
<view class="text">分享</view>
</userinfo>
<as id="as" items="{{seller.seller_tel}}" bindclick="reservePhone" hasTip="{{false}}"></as>
<getpos bindpos="onpos" id="getpos" hasAllowLoading="{{false}}"></getpos>
<discount id="discount" seller="{{seller}}" bindhide="discountHide" bindshow="discountShow"></discount>
<share id="share" seller_id="{{seller.id}}" seller="{{seller}}" wx:if="{{seller.id}}"></share>
<activity-tips str="¥price" cla="reserve-detail" pos="pages/reserve/detail"></activity-tips>
</view>
<view hidden="{{activeTab!='reserve'}}" wx:if="{{seller.id}}">
<view class="olreserve bg_white">
<calendar seller="{{seller}}" bindselectdate="selectdate" date="{{reserveDate}}"></calendar>
<view class="reserve-time Semibold">预订时段</view>
<section seller="{{seller}}" date="{{reserveDate}}" bind:selectsection="selectsection" section="{{reserveSection}}"></section>
<block wx:if="{{reserveSection}}">
<select-room seller="{{seller}}" date="{{reserveDate}}" section="{{reserveSection}}" seletroomlist="{{seletroomlist}}" bindchangeroom="selectroom"></select-room>
</block>
</view>
<view class="reserve reserve-click flex-vc">
<formids class="flex-vc" bindclick="reserveEvent" id="reserve-button">
<view class="text">{{hasOnlineReserve?'订包间':'联系餐厅'}}</view>
</formids>
<view class="reserve-button-cover flex-cc">
<view class="white-font font32r reserve-button flex-cc" catchtap="complete">选好了</view>
</view>
</view>
<as id="as" items="{{seller.seller_tel}}" bindclick="reservePhone" hasTip="{{false}}"></as>
<getpos bindpos="onpos" id="getpos" hasAllowLoading="{{false}}"></getpos>
<discount id="discount" seller="{{seller}}" bindhide="discountHide" bindshow="discountShow"></discount>
<share id="share" seller_id="{{seller.id}}" seller="{{seller}}" wx:if="{{seller.id}}"></share>
</view>
<view hidden="{{activeTab!='reserve'}}" wx:if="{{seller.id}}">
<view class="olreserve bg_white">
<calendar seller="{{seller}}" bindselectdate="selectdate" date="{{reserveDate}}"></calendar>
<view class="reserve-time Semibold">预订时段</view>
<section seller="{{seller}}" date="{{reserveDate}}" bind:selectsection="selectsection" section="{{reserveSection}}"></section>
<block wx:if="{{reserveSection}}">
<select-room seller="{{seller}}" date="{{reserveDate}}" section="{{reserveSection}}" seletroomlist="{{seletroomlist}}" bindchangeroom="selectroom"></select-room>
</block>
</view>
<view class="reserve-button-cover flex-cc">
<view class="white-font font32r reserve-button flex-cc" catchtap="complete">选好了</view>
</view>
</view>
</layout>
\ No newline at end of file
... ...