Commit 81c7ef61054afb9fc15ada10ed101a24ae203407

Authored by Yolanda
1 parent ec911267

短信测试

Showing 97 changed files with 90 additions and 4534 deletions

Too many changes to show.

To preserve performance only 97 of 97+ files are displayed.

  1 +{
  2 + "permissions": {
  3 + "openapi": [
  4 + "urlscheme.generate"
  5 + ]
  6 + }
  7 +}
  1 +//云函数入口文件
  2 +const cloud = require('wx-server-sdk')
  3 +
  4 +cloud.init();
  5 +
  6 +// 云函数入口函数
  7 +exports.main = async (event, context) => {
  8 + const wxContext = cloud.getWXContext()
  9 + console.log(event,'tttttttt')
  10 + switch (event.action) {
  11 + case 'getUrlScheme': {
  12 + return getUrlScheme(event);
  13 + }
  14 + }
  15 + return 'action not found'
  16 +}
  17 +
  18 +async function getUrlScheme(event) {
  19 + return cloud.openapi.urlscheme.generate({
  20 + jumpWxa: {
  21 + path: event.path,
  22 + query: event.query,
  23 + }
  24 + })
  25 +}
  1 +{
  2 + "name": "common",
  3 + "version": "1.0.0",
  4 + "description": "",
  5 + "main": "index.js",
  6 + "scripts": {
  7 + "test": "echo \"Error: no test specified\" && exit 1"
  8 + },
  9 + "author": "",
  10 + "license": "ISC",
  11 + "dependencies": {
  12 + "wx-server-sdk": "~2.4.0"
  13 + }
  14 +}
1 { 1 {
2 "permissions": { 2 "permissions": {
3 "openapi": [ 3 "openapi": [
  4 + "urlscheme.generate"
4 ] 5 ]
5 } 6 }
6 } 7 }
@@ -6,21 +6,21 @@ cloud.init() @@ -6,21 +6,21 @@ cloud.init()
6 // 云函数入口函数 6 // 云函数入口函数
7 exports.main = async (event, context) => { 7 exports.main = async (event, context) => {
8 const wxContext = cloud.getWXContext() 8 const wxContext = cloud.getWXContext()
9 - 9 + console.log(event,'tttttttt')
10 switch (event.action) { 10 switch (event.action) {
11 case 'getUrlScheme': { 11 case 'getUrlScheme': {
12 - return getUrlScheme() 12 + return getUrlScheme(event)
13 } 13 }
14 } 14 }
15 15
16 return 'action not found' 16 return 'action not found'
17 } 17 }
18 18
19 -async function getUrlScheme() { 19 +async function getUrlScheme(event) {
20 return cloud.openapi.urlscheme.generate({ 20 return cloud.openapi.urlscheme.generate({
21 jumpWxa: { 21 jumpWxa: {
22 - path: 'weixin://dl/business/?t=GC8I0gF6Bad', // <!-- replace -->  
23 - query: '', 22 + path: event.path, // <!-- replace -->
  23 + query: event.query,
24 }, 24 },
25 // 如果想不过期则置为 false,并可以存到数据库 25 // 如果想不过期则置为 false,并可以存到数据库
26 isExpire: false, 26 isExpire: false,
  1 +{
  2 + "permissions": {
  3 + "openapi": [
  4 + "cloudbase.sendSms"
  5 + ]
  6 + }
  7 +}
  1 +const cloud = require('wx-server-sdk');
  2 +console.log('gggggggg')
  3 +cloud.init();
  4 +exports.main = async (event, context) => {
  5 + console.log(event,'ttttt');
  6 + try {
  7 + const result = await cloud.openapi.cloudbase.sendSms({
  8 + env: 'suzi-714ca6',
  9 + content: event.content,
  10 + path: event.path,
  11 + phoneNumberList: event.phoneNumberList,
  12 + })
  13 + return result
  14 + } catch (err) {
  15 + return err
  16 + }
  17 +}
  1 +{
  2 + "name": "sms",
  3 + "version": "1.0.0",
  4 + "description": "",
  5 + "main": "index.js",
  6 + "scripts": {
  7 + "test": "echo \"Error: no test specified\" && exit 1"
  8 + },
  9 + "author": "",
  10 + "license": "ISC",
  11 + "dependencies": {
  12 + "wx-server-sdk": "~2.4.0"
  13 + }
  14 +}
painter @ ef9e4373
1 -Subproject commit ef9e437398fb26868088b85a71dfc3076605cfd4  
1 -// components/reserve/search/how/hv/date.js  
2 -var myBehavior = require('hv_behavior')  
3 -const items=(function(){  
4 - let today=parseInt(new Date()/1000);  
5 - let ds=[]  
6 - for(let i=0;i<15;i++){  
7 - ds.push(today+86400*i)  
8 - }  
9 - return ds  
10 -})()  
11 -Component({  
12 - behaviors: [myBehavior],  
13 - data:{  
14 - items:items,  
15 - },  
16 - lifetimes: {  
17 - created: function () {  
18 - // 在组件实例进入页面节点树时执行  
19 - this.type='date'  
20 - },  
21 - detached: function () {  
22 - // 在组件实例被从页面节点树移除时执行  
23 - },  
24 - },  
25 - /**  
26 - * 组件的方法列表  
27 - */  
28 - methods: {  
29 -  
30 - }  
31 -})  
1 -{  
2 - "component": true,  
3 - "usingComponents": {}  
4 -}  
1 -<!--components/reserve/search/how/hv/date.wxml-->  
2 -<wxs src="../../../../utils/util.wxs" module="util" />  
3 -<swiper previous-margin="35rpx" next-margin="45rpx"  
4 - class="tabs" current="{{current}}"  
5 - display-multiple-items="5">  
6 - <swiper-item wx:for="{{items}}" wx:key="items">  
7 - <view class="item {{spi==index?'active':''}} flex-vc" bindtap="checked" data-index="{{index}}" data-val="{{item}}" data-type="date">  
8 - <view class="name">{{util.unixtoTime(item,'DAY')||util.unixtoTime(item,'周WW')}}</view>  
9 - <view class="mmdd">{{util.unixtoTime(item,'MM.DD')}}</view>  
10 - </view>  
11 - </swiper-item>  
12 -</swiper>  
1 -// components/reserve/search/how/hv/pnum.js  
2 -var myBehavior = require('hv_behavior')  
3 -const items=[  
4 - {id:1,label:'早餐'},  
5 - {id:2,label:'午餐'},  
6 - {id:3,label:'晚餐'},  
7 - {},  
8 - {},  
9 -]  
10 -Component({  
11 - behaviors: [myBehavior],  
12 - data:{  
13 - items:items,  
14 - },  
15 - lifetimes: {  
16 - created: function () {  
17 - // 在组件实例进入页面节点树时执行  
18 - this.type='dur'  
19 - },  
20 - detached: function () {  
21 - // 在组件实例被从页面节点树移除时执行  
22 - },  
23 - },  
24 -  
25 - /**  
26 - * 组件的方法列表  
27 - */  
28 - methods: {  
29 -  
30 - }  
31 -})  
1 -{  
2 - "component": true,  
3 - "usingComponents": {}  
4 -}  
1 -<!--components/reserve/search/how/dur.wxml-->  
2 -<swiper previous-margin="35rpx" next-margin="45rpx"  
3 - class="tabs"  
4 - display-multiple-items="5">  
5 - <swiper-item wx:for="{{items}}" wx:key="items">  
6 - <view class="item {{spi==index?'active':''}} flex-vc"  
7 - bindtap="{{index>2?'':'checked'}}"  
8 - data-index="{{index}}"  
9 - data-val="{{item.id}}"  
10 - data-type="dur">  
11 - <view class="name">{{item.label}}</view>  
12 - </view>  
13 - </swiper-item>  
14 -</swiper>  
1 -/* components/reserve/search/how/dur.wxss */  
2 -@import "hv_behavior.wxss";  
1 -// components/reserve/search/how/hv.js  
2 -import util from '../../../../utils/util'  
3 -module.exports = Behavior({  
4 - properties: {  
5 - ckdata:{  
6 - type:Object,  
7 - val:null,  
8 - },  
9 - },  
10 - data: {  
11 - spi:-1  
12 - },  
13 - observers: {  
14 - 'ckdata': function() {  
15 - this.checkedDefEvent()  
16 - }  
17 - },  
18 - methods: {  
19 - checked(e,hasCurrent=false){  
20 - let index=util.attr(e,'index')  
21 - let val=util.attr(e,'val')  
22 - let type=util.attr(e,'type')  
23 - let obj={  
24 - spi:index,  
25 - }  
26 - if(hasCurrent){  
27 - let current=index-2  
28 - if(type=='date'){  
29 - current=current>10?10:current  
30 - }else if(type=='pnum'){  
31 - current=current>26?26:current  
32 - }  
33 - obj.current=current>-1?current:0  
34 - }  
35 - this.setData(obj)  
36 - this.triggerEvent('event',{index,val,type})  
37 - },  
38 - checkedDefEvent(){  
39 - console.log('this.type',this.type)  
40 - let type=this.type  
41 - let ckdata = {}  
42 - if (!this.data.ckdata) {//初始化值  
43 - if(type == 'dur') return;  
44 - let index, val  
45 - if (type == 'pnum') {  
46 - index = 3  
47 - val = this.data.items[index]  
48 - } else if (type == 'date') {  
49 - index = 0  
50 - val = this.data.items[index]  
51 - }  
52 - ckdata = {index, val, type}  
53 - }else{  
54 - ckdata = this.data.ckdata  
55 - }  
56 - this.checked({currentTarget:{dataset:ckdata}},true)  
57 - },  
58 - }  
59 -})  
1 -/* components/reserve/search/how/hv.wxss */  
2 -@import "../../../../app.wxss";  
3 -.tabs {  
4 - height: 100rpx;  
5 -}  
6 -.tabs .item{  
7 - width:120rpx;  
8 - height:100rpx;  
9 - line-height: 100rpx;  
10 - border-radius:10rpx;  
11 - border:2rpx solid #fffff;  
12 - font-size:30rpx;  
13 - font-weight:600;  
14 - color:#353535;  
15 - text-align: center;  
16 - box-sizing: border-box;  
17 -}  
18 -.tabs .item.active{  
19 - border-radius:10rpx;  
20 - background:rgba(255,245,235,1);  
21 - border:2px solid rgba(195,165,108,1);  
22 - color:rgba(192,163,105,1);  
23 -}  
1 -// components/reserve/search/how/index.js  
2 -import util from '../../../../utils/util'  
3 -Component({  
4 - /**  
5 - * 组件的属性列表  
6 - */  
7 - properties: {  
8 - hasPage:{  
9 - type:Boolean,  
10 - value:false,  
11 - },  
12 - findSellerData:{  
13 - type:Object,  
14 - value:{},  
15 - }  
16 - },  
17 -  
18 - /**  
19 - * 组件的初始数据  
20 - */  
21 - data: {  
22 - hidden:true,  
23 - },  
24 - created(){  
25 - this.params={}  
26 - },  
27 - attached(){  
28 - this.setData({  
29 - hidden:!this.data.hasPage  
30 - })  
31 - },  
32 - observers: {  
33 - 'findSellerData': function(findSellerData) {  
34 - console.log('page=>findSellerData',findSellerData)  
35 - }  
36 - },  
37 - /**  
38 - * 组件的方法列表  
39 - */  
40 - methods: {  
41 - paramEvent(e){  
42 - console.log('paramEvent',e.detail.type,e.detail)  
43 - this.params[e.detail.type]=e.detail  
44 - },  
45 - submit(){  
46 - console.log(this.params)  
47 - let paramObj={}  
48 - if(this.params['date']){  
49 - paramObj.when_date=util.unixtoTime(this.params['date'].val,'YYYY-MM-DD')  
50 - }  
51 - if(this.params['pnum']){  
52 - paramObj.several=this.params['pnum'].val  
53 - }  
54 - if(this.params['dur'] && this.params['dur'].val>=0){  
55 - paramObj.daily=this.params['dur'].val  
56 - }  
57 - this.triggerEvent('event',{  
58 - params:this.params,  
59 - paramObj:paramObj,  
60 - })  
61 - },  
62 - show(){  
63 - this.setData({  
64 - hidden:false  
65 - })  
66 - },  
67 - hide(){  
68 - this.setData({  
69 - hidden:true  
70 - })  
71 - },  
72 - }  
73 -})  
1 -<!--components/reserve/search/how/index.wxml-->  
2 -<view hidden="{{hidden}}">  
3 - <view class="mask" wx:if="{{!hasPage}}" bindtap="hide"></view>  
4 - <view class="{{hasPage?'pages':'pages-window'}}">  
5 - <view class="title flex-lr">  
6 - <view class="title-name">您好,几位,什么时候</view>  
7 - <view class="close" bindtap="hide"></view>  
8 - </view>  
9 - <view>  
10 - <pnum bindevent="paramEvent"  
11 - ckdata="{{findSellerData.params.pnum}}"></pnum>  
12 - <view style="margin: 60rpx 0">  
13 - <date bindevent="paramEvent" ckdata="{{findSellerData.params.date}}"></date>  
14 - </view>  
15 - <dur bindevent="paramEvent" ckdata="{{findSellerData.params.dur}}"></dur>  
16 - </view>  
17 - <view class="submit" bindtap="submit">查找餐厅</view>  
18 - </view>  
19 -</view>  
1 -/* components/reserve/search/how/index.wxss */  
2 -@import "../../../../app.wxss";  
3 -.pages{  
4 - padding: 20rpx 0;  
5 -}  
6 -.pages-window{  
7 - padding: 58rpx 0;  
8 - border-radius:20rpx 20rpx 0 0;  
9 - position: fixed;  
10 - bottom: 0;  
11 - background-color: #fff;  
12 - width: 100%;  
13 - z-index: 9999;  
14 - height: 870rpx;  
15 - box-sizing: border-box;  
16 -}  
17 -.pages .close{  
18 - display: none;  
19 -}  
20 -.title{  
21 - height:48rpx;  
22 - font-size:34rpx;  
23 - font-weight:600;  
24 - color:rgba(53,53,53,1);  
25 - line-height:48rpx;  
26 - padding: 0 40rpx;  
27 - width: calc(100% - 80rpx);  
28 - margin-bottom: 60rpx;  
29 -}  
30 -.close{  
31 - background-image: url("http://nosqn.colorcun.com/reserve/images/close.png");  
32 - background-size: 100% 100%;  
33 - width: 32rpx;  
34 - height: 32rpx;  
35 -}  
36 -.submit{  
37 - height:80rpx;  
38 - background:rgba(192,163,105,1);  
39 - border-radius:10rpx;  
40 - font-size:32rpx;  
41 - font-weight:500;  
42 - color:rgba(255,255,255,1);  
43 - line-height:80rpx;  
44 - text-align: center;  
45 - margin: 0 40rpx;  
46 - width: calc(100% - 80rpx);  
47 - position: fixed;  
48 - bottom: 80rpx;  
49 -}  
1 -// components/reserve/search/how/hv/pnum.js  
2 -var myBehavior = require('hv_behavior')  
3 -const items=(function(){  
4 - let today=1;  
5 - let ds=[]  
6 - for(let i=0;i<=30;i++){  
7 - ds.push(today+i)  
8 - }  
9 - return ds  
10 -})()  
11 -Component({  
12 - behaviors: [myBehavior],  
13 - data:{  
14 - items:items,  
15 - current:0,  
16 - },  
17 - lifetimes: {  
18 - created: function () {  
19 - // 在组件实例进入页面节点树时执行  
20 - this.type='pnum'  
21 - },  
22 - detached: function () {  
23 - // 在组件实例被从页面节点树移除时执行  
24 - },  
25 - },  
26 -  
27 - /**  
28 - * 组件的方法列表  
29 - */  
30 - methods: {  
31 -  
32 - }  
33 -})  
1 -{  
2 - "component": true,  
3 - "usingComponents": {}  
4 -}  
1 -<!--components/reserve/search/how/hv/pnum.wxml-->  
2 -<swiper previous-margin="35rpx" next-margin="45rpx"  
3 - class="tabs" current="{{current}}"  
4 - display-multiple-items="5">  
5 - <swiper-item wx:for="{{items}}" wx:key="items">  
6 - <view class="item {{spi==index?'active':''}} flex-vc"  
7 - bindtap="checked" data-index="{{index}}"  
8 - data-val="{{item}}" data-type="pnum">  
9 - <view class="name">{{item>30?'30位以上':item+' 位'}}</view>  
10 - </view>  
11 - </swiper-item>  
12 -</swiper>  
1 -// components/reserve/search/item.js  
2 -import App from '../../../utils/api';  
3 -Component({  
4 - /**  
5 - * 组件的属性列表  
6 - */  
7 - properties: {  
8 - item:{  
9 - type:Object,  
10 - value:{}  
11 - },  
12 - keyword:{  
13 - type:String,  
14 - value:"",  
15 - },  
16 - hasHistory:{  
17 - type:Boolean,  
18 - value:false,  
19 - },  
20 - },  
21 -  
22 - /**  
23 - * 组件的初始数据  
24 - */  
25 - data: {  
26 -  
27 - },  
28 -  
29 - /**  
30 - * 组件的方法列表  
31 - */  
32 - methods: {  
33 - detailGo(){  
34 - this.SetHistorySearch();  
35 - this.triggerEvent('click',{act:'detail',data:this.data.item})  
36 - },  
37 - reserveGo(){  
38 - this.SetHistorySearch();  
39 - this.triggerEvent('click',{act:'reserve',data:this.data.item})  
40 - },  
41 - SetHistorySearch() {  
42 - let item=this.data.item  
43 - console.log('SetHistorySearch',item)  
44 - let params={  
45 - keyword:this.data.keyword,  
46 - type:item.type==-1?1:2,  
47 - sid:item.id,  
48 - name:item.title,  
49 - openid:'',  
50 - longitude:item.longitude,  
51 - latitude:item.latitude,  
52 - }  
53 - App.Customer.SetHistorySearch(params)  
54 - App.Customer.GetHistorySearch({},'clear')  
55 - },  
56 - }  
57 -})  
1 -{  
2 - "component": true,  
3 - "usingComponents": {}  
4 -}  
1 -<!--components/reserve/search/item.wxml-->  
2 -<wxs src="../../../utils/util.wxs" module="util" />  
3 -<view class="history flex-lr" bindtap="detailGo" wx:if="{{hasHistory}}">  
4 - <view class="icon icon{{item.type}}"></view>  
5 - <view class="text">{{item.title}}</view>  
6 -</view>  
7 -<view class="item item{{item.type}} flex-ll" bindtap="detailGo" wx:else="">  
8 - <view class="icon"></view>  
9 - <view class="flex-lr item-info">  
10 - <view class="info">  
11 - <view class="title {{item.activity.length>0?'activity':''}}">  
12 - <block wx:if="{{item.titles}}">  
13 - <text>{{item.titles[1]}}</text>  
14 - <text class="light">{{item.titles[2]}}</text>  
15 - <text>{{item.titles[3]}}</text>  
16 - </block>  
17 - <text wx:else="">{{item.title}}</text>  
18 - </view>  
19 - <view class="addr flex-ll" wx:if="{{item.type==-1}}">  
20 - <view class="txt" wx:if="{{item.category}}">{{item.category}}</view>  
21 - <view class="txt" wx:if="{{item.distance!=''}}">{{util.distance(item.distance)}}</view>  
22 - </view>  
23 - <view class="addr" wx:else="">{{item.addr}}</view>  
24 - </view>  
25 - <view class="reserve-but" wx:if="{{item.is_online_reserve==1}}" catchtap="reserveGo">包间预订</view>  
26 - </view>  
27 -</view>  
1 -/* components/reserve/search/item.wxss */  
2 -@import "../../../app.wxss";  
3 -.item{  
4 - width: 100%;  
5 - box-sizing: border-box;  
6 - margin-bottom: 40rpx;  
7 -}  
8 -.item-1{  
9 - margin-bottom: 20rpx;  
10 -}  
11 -.item .item-info,.item-1 .item-info{  
12 - width: calc(100% - 60rpx);  
13 - max-width: calc(100% - 60rpx);  
14 - box-sizing: border-box;  
15 -}  
16 -.item .info{  
17 - max-width:100%;  
18 -}  
19 -.item .title{  
20 - font-size: 28rpx;  
21 - height: 40rpx;  
22 - line-height: 40rpx;  
23 - white-space:nowrap;  
24 - overflow: hidden;  
25 - text-overflow:ellipsis;  
26 -}  
27 -.item .addr{  
28 - font-size: 24rpx;  
29 - height: 34rpx;  
30 - line-height: 34rpx;  
31 - margin-top: 4rpx;  
32 - white-space:nowrap;  
33 - overflow: hidden;  
34 - text-overflow:ellipsis;  
35 - max-width: 100%;  
36 -}  
37 -.item .addr .txt{  
38 - border-right: 2rpx solid #979797;  
39 - margin-right: 10rpx;  
40 - padding-right: 10rpx;  
41 - height: 24rpx;  
42 - line-height: 24rpx;  
43 -}  
44 -.item .addr .txt:last-child{  
45 - border-right-width: 0;  
46 -}  
47 -.item .icon{  
48 - margin-right: 20rpx;  
49 - width: 22rpx;  
50 - height:26rpx;  
51 - background-image: url("http://nosqn.colorcun.com/reserve/images/addr.png");  
52 - background-size: 100% 100%;  
53 - min-width: 22rpx;  
54 -}  
55 -.item-1 .info{  
56 - width: calc(100% - 140rpx);  
57 - max-width: calc(100% - 140rpx);  
58 -}  
59 -.item-1{  
60 - background:rgba(255,255,255,1);  
61 - box-shadow:0 0 8rpx 0 rgba(196,196,196,0.5);  
62 - border-radius:10rpx;  
63 - padding: 20rpx;  
64 -}  
65 -.item-1 .icon {  
66 - background-image: url("http://nosqn.colorcun.com/reserve/images/sea-se.png");  
67 - width: 36rpx;  
68 - height: 36rpx;  
69 - min-width: 36rpx;  
70 -}  
71 -.reserve-but{  
72 - width:120rpx;  
73 - height:40rpx;  
74 - background:linear-gradient(360deg,rgba(131,131,131,1) 0%,rgba(76,76,76,1) 100%);  
75 - border-radius:25rpx;  
76 - font-size:24rpx;  
77 - font-weight:500;  
78 - color:rgba(240,206,161,1);  
79 - line-height:40rpx;  
80 - text-shadow:0rpx 2rpx 6rpx rgba(80,80,80,1);  
81 - text-align: center;  
82 - min-width: 120rpx;  
83 - margin-left: 20rpx;  
84 -}  
85 -  
86 -.history{  
87 - line-height: 50rpx;  
88 - font-size: 28rpx;  
89 - height:50rpx;  
90 - background:rgba(245,245,245,1);  
91 - border-radius:4px;  
92 - float: left;  
93 - padding: 0 10rpx;  
94 - margin-right: 20rpx;  
95 - margin-bottom: 20rpx;  
96 -}  
97 -.history .icon{  
98 - background-size: 100% 100%;  
99 - margin-right: 10rpx;  
100 - width: 20rpx;  
101 - height: 24rpx;  
102 - min-width: 20rpx;  
103 - background-image: url("http://nosqn.colorcun.com/reserve/images/addr.png");  
104 -}  
105 -.history .icon-1{  
106 - width: 24rpx;  
107 - height: 18rpx;  
108 - min-width: 24rpx;  
109 - background-image: url("http://nosqn.colorcun.com/reserve/images/his-se.png");  
110 -}  
111 -.activity{  
112 - position: relative;  
113 -}  
114 -.activity:after{  
115 - content: "";  
116 - position:absolute;  
117 - height: 32rpx;  
118 - width: 32rpx;  
119 - margin-left: 10rpx;  
120 - min-width: 32rpx;  
121 - background-image: url("http://nosqn.colorcun.com/reserve/images/huizi.png");  
122 - background-size: 100% 100%;  
123 - top:4rpx;  
124 -}  
125 -.title .light{  
126 - color: #C0A369;  
127 -}  
1 -<view class="section flex-lr">  
2 - <block wx:for="{{sectionlist}}" wx:key="{{index}}">  
3 - <view class="flex-vc section-single {{item.isselected ? 'bg-yellow' : ''}}" style="width:{{690/sectionlist.length}}rpx;" data-section="{{item.section}}" data-index="{{index}}" catchtap="{{item.overdate ? '' : 'selectsection'}}">  
4 - <view class="{{item.overdate ? 'gray-font' : (item.isselected ? 'blue-font' : '')}} font30r Semibold">{{item.showmark}}</view>  
5 - <view class="{{item.overdate ? 'gray-font' : (item.isselected ? 'blue-font' : '')}} font24r" style="line-height:34rpx;">{{item.sectiondur}}</view>  
6 - </view>  
7 - </block>  
8 -</view>  
1 -@import "../../../app.wxss";  
2 -.section{  
3 - width:100%;  
4 - height:90rpx;  
5 - border-radius:10rpx;  
6 - /*box-shadow: 0 0 8rpx rgba(166,166,166,.5);*/  
7 - margin:0 auto;  
8 - border: 2rpx solid #CCCCCC;  
9 - box-sizing: border-box;  
10 -}  
11 -.section-single{  
12 - height:calc(100% + 4rpx);  
13 - border-radius:10rpx;  
14 - box-sizing: border-box;  
15 -}  
16 -.section-single.bg-yellow{  
17 - background: #F4FAFF;  
18 - border: 2rpx solid #42A5FF;  
19 -}  
1 -import App from '../../../utils/api';  
2 -import util from '../../../utils/util';  
3 -Component({  
4 - properties:{  
5 - seller:Object,  
6 - date:{  
7 - type:String,  
8 - value:util.unixtoTime(new Date()/1000,'YYYY-MM-DD')  
9 - },  
10 - section:String,  
11 - seletroomlist:{  
12 - type:Array,  
13 - value:[]  
14 - }  
15 - },  
16 - data:{  
17 - },  
18 - attached(){  
19 - this.room=this.selectComponent('#room');  
20 - console.log('xxxxx',this.data.seller);  
21 - },  
22 - methods:{  
23 - selectroom(e){  
24 - console.log(e)  
25 - let _target=e.detail;  
26 - let seletroomlist=this.data.seletroomlist;  
27 - if(e.detail.action=='cancel'){  
28 - seletroomlist.forEach((v,i)=>{  
29 - if(v.id==_target.id){  
30 - seletroomlist.splice(i,1)  
31 - }  
32 - })  
33 - }else{  
34 - let obj={  
35 - id:_target.id,  
36 - name:_target.name  
37 - }  
38 - seletroomlist.push(obj);  
39 - }  
40 - this.setData({  
41 - seletroomlist:this.data.seletroomlist  
42 - })  
43 - this.triggerEvent('changeroom',{selectroom:this.data.seletroomlist})  
44 - },  
45 - cancelroom(e){  
46 - let _target=e.currentTarget.dataset;  
47 - this.data.seletroomlist.splice(_target.index,1);  
48 - this.setData({  
49 - seletroomlist:this.data.seletroomlist  
50 - })  
51 - this.room.cancelroom(_target.id);  
52 - this.triggerEvent('changeroom',{selectroom:this.data.seletroomlist});  
53 - },  
54 -  
55 - }  
56 -})  
1 -<view class="select-rooms flex-rs">  
2 - <view class="select-rooms-title black-font font-bold font36r flex-ll">已选包间</view>  
3 - <block wx:for="{{seletroomlist}}" wx:key="{{index}}">  
4 - <view class="select-rooms-item flex-vc" data-index="{{index}}" data-id="{{item.id}}" catchtap="cancelroom">  
5 - <view class="font-bold font30r" style="width:100%;block;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;text-align:center; color:#42A5FF;">{{item.name}}</view>  
6 - <image src="http://nosqn.colorcun.com/detail/x%20%2814%29.png" class="select-rooms-close"></image>  
7 - </view>  
8 - </block>  
9 -</view>  
10 -<room bindselectroom="selectroom" seller="{{seller}}" date="{{date}}" section="{{section}}" id="room" seletroomlist="{{seletroomlist}}"></room>  
1 -@import "../../../app.wxss";  
2 -.select-rooms{  
3 - width:100%;  
4 - padding:70rpx 0 4rpx 40rpx;  
5 - box-sizing: border-box;  
6 -}  
7 -.select-rooms-title{  
8 - margin-right:30rpx;  
9 - height:70rpx;  
10 - margin-bottom:20rpx;  
11 -}  
12 -.select-rooms-item{  
13 - width:150rpx;  
14 - height:70rpx;  
15 - margin-right:20rpx;  
16 - background: #F4FAFF;  
17 - border: 2rpx solid #42A5FF;  
18 - border-radius:10rpx;  
19 - position: relative;  
20 - margin-bottom:20rpx;  
21 - padding:0 12rpx;  
22 - box-sizing: border-box;  
23 -}  
24 -.select-rooms-close{  
25 - width:36rpx;  
26 - height:36rpx;  
27 - background: #C1C0C0;  
28 - border-radius:50%;  
29 - position: absolute;  
30 - right:-18rpx;  
31 - top:-18rpx;  
32 -}  
33 -.close-icon{  
34 - width:14rpx;  
35 - height:14rpx;  
36 -}  
1 -// components/reserve/caixi.js  
2 -import util from '../../../utils/util';  
3 -import App from '../../../utils/api';  
4 -const {regeneratorRuntime} = global  
5 -Component({  
6 - /**  
7 - * 组件的属性列表  
8 - */  
9 - properties: {  
10 - multiArray:{  
11 - type:Array,  
12 - value:[]  
13 - },  
14 - multiIndex: {  
15 - type:Array,  
16 - value:[]  
17 - },  
18 - tags: {  
19 - type:Array,  
20 - value:[]  
21 - },  
22 - },  
23 -  
24 - /**  
25 - * 组件的初始数据  
26 - */  
27 - data: {  
28 - hidden:true,  
29 - statusBarHeight: 20,  
30 - titleBarHeight:44,  
31 - markers:[],  
32 - hasMore:true,  
33 - },  
34 - attached(){  
35 - //导航栏自适应  
36 - let systemInfo = wx.getSystemInfoSync();  
37 - let reg = /ios/i;  
38 - let pt = 20;//导航状态栏上内边距  
39 - let h = 44;//导航状态栏高度  
40 - if(reg.test(systemInfo.system)){  
41 - pt = systemInfo.statusBarHeight;  
42 - }else{  
43 - pt = systemInfo.statusBarHeight;  
44 - h = 48;  
45 - }  
46 - this.setData({  
47 - statusBarHeight: pt,  
48 - titleBarHeight:h,  
49 - })  
50 - },  
51 - /**  
52 - * 组件的方法列表  
53 - */  
54 - methods: {  
55 - hide(){  
56 - this.setData({  
57 - hidden:true,  
58 - })  
59 - },  
60 - show(){  
61 - this.setData({  
62 - hidden:false,  
63 - })  
64 - },  
65 - getList(mapParam){  
66 - this.offset=1 //page  
67 - this.size=20 //page size  
68 - //计算视窗中心  
69 - let map=JSON.parse(mapParam.map);  
70 - let lat=map.northeast.latitude-(map.northeast.latitude-map.southwest.latitude)/2;  
71 - let lng=map.northeast.longitude-(map.northeast.longitude-map.southwest.longitude)/2;  
72 - this.param={  
73 - lat:lat,  
74 - lng:lng,  
75 - lat_extend:mapParam.lat,  
76 - lng_extend:mapParam.lng,  
77 - offset:this.offset,  
78 - size:this.size,  
79 - distance:50,  
80 - };  
81 - if(mapParam.centre_pos){  
82 - this.param.centre_pos=mapParam.centre_pos  
83 - }  
84 - if(mapParam.tags){  
85 - this.param.tags=mapParam.tags  
86 - }  
87 - if(mapParam.cuisine){  
88 - this.param.cuisine=mapParam.cuisine  
89 - }  
90 - if(mapParam.when_date){//日期  
91 - this.param.when_date=mapParam.when_date  
92 - }  
93 - if(mapParam.several){//人数  
94 - this.param.several=mapParam.several  
95 - }  
96 - if(mapParam.daily){//时段  
97 - this.param.daily=mapParam.daily  
98 - }  
99 - App.Customer.SellerLists(this.param).then(res=>{  
100 - // this.setData({  
101 - // hasMore:res.data.length==this.size,  
102 - // markers:res.data,  
103 - // })  
104 - this.triggerEvent('event',{type:'getListEnd',total:res.data.length})  
105 - })  
106 - },  
107 - getListMore(){  
108 - this.param.offset+=1;  
109 - let markers=this.data.markers;  
110 - App.Customer.SellerLists(this.param).then(res=>{  
111 - this.setData({  
112 - hasMore:res.data.length==this.size,  
113 - markers:markers.concat(res.data),  
114 - })  
115 - })  
116 - },  
117 - caixiShow(){  
118 - this.triggerEvent('event',{type:'caixiShow'})  
119 - },  
120 - tagsChange(e){  
121 - this.triggerEvent('event',{type:'tagsChange',e:e})  
122 - },  
123 - gotoDetail(e){  
124 - wx.navigateTo({  
125 - url:'/pages/reserve/detail?id='+util.attr(e,'sid')  
126 - })  
127 - },  
128 - }  
129 -})  
1 -<!--components/reserve/caixi.wxml-->  
2 -<!--  
3 -<cover-view class="mask" hidden="{{hidden}}">  
4 - <cover-view class="header flex-lr" style="height: {{titleBarHeight}}px;padding-top: {{statusBarHeight}}px;" catchtap="hide">  
5 - <cover-view class="searchList flex-ll">  
6 - <cover-image class="icon" src="http://nosqn.colorcun.com/reserve/images/hasMap.png"></cover-image>  
7 - <cover-view class="title">地图</cover-view>  
8 - </cover-view>  
9 - <cover-view class="title" style="line-height: {{titleBarHeight}}px;height:{{titleBarHeight}}px;">一键订</cover-view>  
10 - <cover-view class="icon"></cover-view>  
11 - </cover-view>  
12 - <cover-view class="transverse-search flex-ll">  
13 - <cover-view  
14 - bindtap="caixiShow"  
15 - class="tags {{multiIndex[0]>0?'active':''}}"  
16 - >  
17 - <cover-view class="picker flex-lr">  
18 - <cover-view class="input">  
19 - <block wx:if="{{multiIndex[0]==0}}">菜系</block>  
20 - <block wx:else="">{{multiArray[0][multiIndex[0]]}}</block>  
21 - </cover-view>  
22 - <cover-view class="more"></cover-view>  
23 - </cover-view>  
24 - </cover-view>  
25 - <block wx:for="{{tags}}" wx:key="tags.key">  
26 - <cover-view class="tags {{item.active?'active':''}}"  
27 - bindtap="tagsChange"  
28 - data-id="{{item.id}}">{{item.name}}</cover-view>  
29 - </block>  
30 - </cover-view>  
31 - <cover-view class="list" catchtap="" style="top:{{statusBarHeight+titleBarHeight+30}}px;">  
32 - <cover-view class="seller" bindtap="gotoDetail" data-sid="{{item.id}}"  
33 - wx:for="{{markers}}" wx:key="markers.key">  
34 - <sb-tr seller="{{item}}" hasActivityTags="{{true}}"></sb-tr>  
35 - </cover-view>  
36 - <cover-view class="seller flex-vc" style="width: 100%; height: 60rpx;" bindtap="{{hasMore?'getListMore':''}}">  
37 - <cover-view style="font-size: 28rpx;color:#999; ">{{hasMore?'点击加载更多商家':'没有更多商家了'}}</cover-view>  
38 - </cover-view>  
39 - </cover-view>  
40 -</cover-view>  
41 --->  
1 -/* components/reserve/caixi.wxss */  
2 -@import "../../../app.wxss";  
3 -.list{  
4 - background-color: #fefefe;  
5 - position: fixed;  
6 - bottom: 0;  
7 - width: 95%;  
8 - padding: 40rpx 0 40rpx 5%;  
9 - color: #353535;  
10 - overflow-y:scroll;  
11 -}  
12 -.seller{  
13 - margin-bottom: 40rpx;  
14 -}  
15 -.header{  
16 - background-color: #fefefe;  
17 - width: 100%;  
18 -  
19 -}  
20 -.header .title{  
21 - font-size: 34rpx;  
22 -}  
23 -.header .icon{  
24 - min-width: 100rpx;  
25 - width: 100rpx;  
26 -}  
27 -.searchList{  
28 - margin-left: 26rpx;  
29 - width: 100rpx;  
30 - height: 60rpx;  
31 - background-color: #fefefe;  
32 - border-radius: 30rpx;  
33 - line-height: 60rpx;  
34 - color:#C28C56;  
35 - box-shadow: 0 4rpx 8rpx 0 #E0E0E0;  
36 - border: 2rpx solid #E0E0E0;  
37 -}  
38 -.searchList .icon{  
39 - min-width: 24rpx;  
40 - width: 24rpx;  
41 - height: 24rpx;  
42 - margin: 0 8rpx 0 14rpx;  
43 -}  
44 -.searchList .title{  
45 - line-height: 60rpx;  
46 - height: 60rpx;  
47 - overflow: hidden;  
48 - width: 100%;  
49 - text-align: left;  
50 - font-size: 20rpx;  
51 -}  
52 -.transverse-search{  
53 - background-color: #fefefe;  
54 - height: 60rpx;  
55 - width: 100%;  
56 - margin: 0 auto;  
57 - font-size: 24rpx;  
58 - padding-left: 40rpx;  
59 -  
60 -}  
61 -.transverse-search .tags{  
62 - height: 50rpx;  
63 - line-height: 50rpx;  
64 - background-color: #F0F0F9;  
65 - border-radius: 4rpx;  
66 - margin-right: 30rpx;  
67 - padding: 0 16rpx;  
68 -}  
69 -.transverse-search .tags:last-child{  
70 - margin-right: 0;  
71 -}  
72 -.transverse-search .tags.active{  
73 - background-color: #F4DAB9;  
74 - color:#8B5318;  
75 - font-weight: 900;  
76 -}  
77 -  
78 -.picker{  
79 - height: 50rpx;  
80 - line-height: 50rpx;  
81 -}  
82 -.picker .input{  
83 - height: 50rpx;  
84 - line-height: 50rpx;  
85 - margin-right: 10rpx;  
86 -}  
87 -.picker .more{  
88 - background-image: url("http://nosqn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB.png");  
89 - width: 12rpx;  
90 - height: 16rpx;  
91 - min-width:12rpx;  
92 -}  
93 -.tags.active .picker .more{  
94 - background-image: url("http://nosqn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB%E9%80%89%E4%B8%AD.png");  
95 -}  
1 -// components/reserve/seller-box/seller-box.js  
2 -import util from '../../../utils/util';  
3 -import App from '../../../utils/api';  
4 -const {regeneratorRuntime} = global  
5 -Component({  
6 - /**  
7 - * 组件的属性列表  
8 - */  
9 - properties: {  
10 - seller: {  
11 - type: Object,  
12 - value: {},  
13 - },  
14 - hasStat: {  
15 - type: Boolean,  
16 - value: false,  
17 - },  
18 - hasAverage: {  
19 - type: Boolean,  
20 - value: true,  
21 - },  
22 - hasActivity: {//滚动优惠  
23 - type: Boolean,  
24 - value: false,  
25 - },  
26 - hasActivityTags: {//优惠标签  
27 - type: Boolean,  
28 - value: false,  
29 - },  
30 - hasSlogan: {  
31 - type: Boolean,  
32 - value: true,  
33 - },  
34 - sellerStyle: {//特殊样式  
35 - type: String,  
36 - value: '',  
37 - }  
38 - },  
39 -  
40 - /**  
41 - * 组件的初始数据  
42 - */  
43 - data: {},  
44 - attached(){  
45 - this.init()  
46 - },  
47 - /**  
48 - * 组件的方法列表  
49 - */  
50 - methods: {  
51 - init(){  
52 - let seller = this.data.seller  
53 - if(seller && seller.distance){  
54 - seller.distance = parseInt(seller.distance);  
55 - if (seller.distance > 1000) {  
56 - seller.distance = (seller.distance / 1000).toFixed(2) + '公里'  
57 - } else {  
58 - seller.distance += '米';  
59 - }  
60 - }  
61 - this.setData({  
62 - se: seller,  
63 - })  
64 - },  
65 - tapButton(e){  
66 - let type = util.attr(e, 'type');  
67 - if (type == 'oncall') {  
68 - let seller_tel = this.data.seller.seller_tel;  
69 - if (seller_tel.length < 1) {  
70 - seller_tel = [this.data.seller.phone]  
71 - }  
72 - if (seller_tel.length == 1) {  
73 - wx.makePhoneCall({  
74 - phoneNumber: seller_tel[0].replace(/[^\d]/g, '')  
75 - })  
76 - } else {  
77 - //wx.hideTabBar();  
78 - wx.showActionSheet({  
79 - itemList: seller_tel,  
80 - complete: () => {  
81 - //wx.showTabBar();  
82 - },  
83 - success: (res) => {  
84 - let phone = seller_tel[res.tapIndex]  
85 - wx.makePhoneCall({  
86 - phoneNumber: phone.replace(/[^\d]/g, '')  
87 - })  
88 - }  
89 - });  
90 - }  
91 -  
92 - } else {  
93 - util.toast('请打电话预订', 'none');  
94 - }  
95 - },  
96 - lookLocation: function () {  
97 - wx.openLocation({  
98 - latitude: Number(this.data.seller.lat),  
99 - longitude: Number(this.data.seller.long),  
100 - scale: 17,  
101 - address: this.data.seller.map_address,  
102 - success: function (res) {  
103 - console.log(res)  
104 - }  
105 - })  
106 - },  
107 - }  
108 -})  
1 -<!--components/showModal/showModal.wxml-->  
2 -<cover-view class="seller flex-ll {{sellerStyle}}" >  
3 - <cover-view class="image">  
4 - <cover-image mode="aspectFill"  
5 - src="{{seller.seller_image?seller.seller_image+'?imageView2/2/w/320/interlace/0/q/100':'http://nosqn.colorcun.com/custom/lite-online/image/seller-def.png'}}"></cover-image>  
6 - <view class="room_num" wx:if="{{seller.room_num>0}}">{{seller.room_num}}个包间</view>  
7 - </cover-view>  
8 - <cover-view class="info flex-tb">  
9 - <cover-view>  
10 - <cover-view class="name Semibold">{{seller.sellername}}</cover-view>  
11 - <cover-view wx:if="{{hasSlogan && seller.slogan}}" class="slogan">“{{seller.slogan}}”</cover-view>  
12 - <cover-view class="text flex-ll">  
13 - <cover-view class="text-item" wx:if="{{seller.cate[0].name}}">{{seller.cate[0].name}}</cover-view>  
14 - <cover-view class="text-item" wx:if="{{seller.distance}}">距当前位置{{se.distance}}</cover-view>  
15 - </cover-view>  
16 - <cover-view wx:if="{{hasStat}}" class="stat">  
17 - <stat stat="{{seller.score}}"></stat>  
18 - </cover-view>  
19 - <cover-view wx:if="{{hasActivity && seller.activity.length>0}}" class="activity-swiper">  
20 - <cover-view class="flex-ll">  
21 - <cover-view class="icon-hui"></cover-view>  
22 - <block wx:for="{{seller.activity}}" wx:key="seller.activity.key" >  
23 - <cover-view class="activity-item">  
24 - {{item.title}}  
25 - </cover-view>  
26 - </block>  
27 - </cover-view>  
28 - <cover-view class="activity-mask"></cover-view>  
29 - </cover-view>  
30 - <cover-view wx:if="{{hasActivityTags && seller.activity.length>0}}" class="activity flex-ll">  
31 - <cover-view wx:for="{{seller.activity}}" class="activity-item" wx:key="seller.activity.key" wx:if="{{index<3}}">{{['','满减','满赠','折扣','代金券','会员价'][item.type]}}</cover-view>  
32 - </cover-view>  
33 - </cover-view>  
34 - <cover-view class="price flex-lr">  
35 - <cover-view class="number Semibold">  
36 - <block wx:if="{{seller.average>0 && hasAverage}}">¥{{seller.average}}元/人</block>  
37 - </cover-view>  
38 - <cover-view class="phone flex-ll" id="reserve-button" catchtap="tapButton" data-type="oncall">  
39 - <cover-image src="http://nosqn.colorcun.com/custom/lite-online/image/phone.png"></cover-image>  
40 - <cover-view class="reserve-text">预订</cover-view>  
41 - </cover-view>  
42 - </cover-view>  
43 - </cover-view>  
44 -</cover-view>  
1 -/* components/reserve/seller-box/seller-box.wxss */  
2 -@import "../../../app.wxss";  
3 -.seller{  
4 - height: 300rpx;  
5 - overflow: hidden;  
6 - color: #353535;  
7 - width: 94%;  
8 - border: 2rpx solid #E0E0E0;  
9 - border-radius: 6rpx;  
10 - box-shadow: 0 4rpx 8rpx 0 #E0E0E0;  
11 -}  
12 -.seller.noborder{  
13 - border-width: 0;  
14 - box-shadow: none;  
15 -}  
16 -.seller cover-image{  
17 - width: 100%;  
18 - height: 100%;  
19 -}  
20 -.seller .image{  
21 - width: 200rpx;  
22 - height: 300rpx;  
23 - background-color: #4C4E4F;  
24 - min-width: 200rpx;  
25 - position: relative;  
26 -}  
27 -.seller .image .room_num{  
28 - height: 34rpx;  
29 - width: 120rpx;  
30 - line-height: 34rpx;  
31 - color: #fefefe;  
32 - background-color: rgba(248, 137, 68, 0.86);  
33 - border-radius: 18rpx;  
34 - text-align: center;  
35 - position: absolute;  
36 - top:10rpx;  
37 - left: 40rpx;  
38 - font-size: 24rpx;  
39 -}  
40 -.seller .info{  
41 - padding: 10rpx 3% 20rpx;  
42 - height: 270rpx;  
43 - width: 94%;  
44 - overflow: hidden;  
45 -}  
46 -.seller .name{  
47 - font-size: 32rpx;  
48 - height: 44rpx;  
49 - line-height: 44rpx;  
50 - overflow: hidden;  
51 - white-space:nowrap;  
52 -}  
53 -.seller .slogan{  
54 - font-size: 26rpx;  
55 - height: 36rpx;  
56 - line-height: 36rpx;  
57 - margin-top: 10rpx;  
58 - white-space:nowrap;  
59 - overflow: hidden;  
60 -}  
61 -.seller .text{  
62 - font-size: 28rpx;  
63 - color: #999999;  
64 - height: 40rpx;  
65 - line-height: 40rpx;  
66 - margin-top: 10rpx;  
67 - overflow: hidden;  
68 - white-space:nowrap;  
69 -}  
70 -.seller .text .text-item{  
71 - text-indent: 10rpx;  
72 - border-left: 2rpx solid #999999;  
73 - padding-right: 10rpx;  
74 - height: 30rpx;  
75 - line-height: 30rpx;  
76 - overflow: hidden;  
77 - white-space:nowrap;  
78 -}  
79 -.seller .text .text-item:first-child{  
80 - border-left-width: 0;  
81 - text-indent: 0;  
82 -}  
83 -.seller .text .text-item:last-child{  
84 - padding-right: 0;  
85 -}  
86 -.seller .price{  
87 - font-size: 30rpx;  
88 - color: #F05522;  
89 - height: 50rpx;  
90 - line-height: 50rpx;  
91 - width: 100%;  
92 -}  
93 -.seller .phone{  
94 - width: 140rpx;  
95 - height: 50rpx;  
96 - background:linear-gradient(to bottom, #838383, #4C4C4C);  
97 - background-color:#636363 ;  
98 - border-radius: 26rpx;  
99 - font-size: 26rpx;  
100 - color: #F0CEA1;  
101 - line-height: 50rpx;  
102 -}  
103 -.seller .phone cover-image{  
104 - width: 28rpx;  
105 - height: 26rpx;  
106 - margin-right: 8rpx;  
107 - margin-left: 24rpx;  
108 -}  
109 -  
110 -.stat{  
111 - font-size: 24rpx;  
112 - color:#999999;  
113 - height: 24rpx;  
114 - line-height: 24rpx;  
115 -}  
116 -.activity{  
117 - color: #F05522;  
118 - margin-top: 10rpx;  
119 -}  
120 -.activity .activity-item{  
121 - font-size: 24rpx;  
122 - height: 36rpx;  
123 - padding: 0 10rpx 0;  
124 - line-height: 36rpx;  
125 - overflow: hidden;  
126 - max-height: 36rpx;  
127 - border-radius: 6rpx;  
128 - margin-left: 10rpx;  
129 - text-align: center;  
130 - overflow: hidden;  
131 - white-space:nowrap;  
132 - background: linear-gradient(to right, #F98E47, #F05522);  
133 - background-color: #F37236;  
134 - text-shadow:0 2rpx 6rpx #C51B41;  
135 - color:#F8E6C4;  
136 -}  
137 -.activity .activity-item:first-child{  
138 - margin-left: 0;  
139 -}  
140 -  
141 -.activity-swiper{  
142 - font-size: 28rpx;  
143 - color: #F05025;  
144 - margin-top: 20rpx;  
145 - height: 32rpx;  
146 - overflow: hidden;  
147 - position: relative;  
148 -}  
149 -.activity-mask{  
150 - position: absolute;  
151 - top:0;  
152 - left: 0;  
153 - width: 100%;  
154 - height: 32rpx;  
155 -}  
156 -.activity-swiper swiper{  
157 - width: 100%;  
158 - height: 32rpx;  
159 -}  
160 -.activity-swiper .activity-item{  
161 - text-indent: 10rpx;  
162 - height: 32rpx;  
163 - width: 100%;  
164 - line-height: 32rpx;  
165 - overflow: hidden;  
166 - max-height: 32rpx;  
167 - overflow: hidden;  
168 - white-space:nowrap;  
169 -}  
170 -.activity-swiper .icon-hui{  
171 - background-image: url("http://nosqn.colorcun.com/reserve/images/%E6%83%A0.png");  
172 - background-size: 100% 100%;  
173 - height: 32rpx;  
174 - width: 32rpx;  
175 - min-width: 32rpx;  
176 -}  
177 -.reserve-text{  
178 - text-shadow:0 2rpx 6rpx #505050;  
179 -}  
1 -// components/reserve/seller-box/seller-box.js  
2 -import util from '../../../utils/util';  
3 -import App from '../../../utils/api';  
4 -  
5 -const {regeneratorRuntime} = global  
6 -Component({  
7 - /**  
8 - * 组件的属性列表  
9 - */  
10 - properties: {  
11 - seller: {  
12 - type: Object,  
13 - value: {},  
14 - },  
15 - hasStat: {  
16 - type: Boolean,  
17 - value: false,  
18 - },  
19 - hasAverage: {  
20 - type: Boolean,  
21 - value: true,  
22 - },  
23 - hasActivity: {//滚动优惠  
24 - type: Boolean,  
25 - value: false,  
26 - },  
27 - hasActivityTags: {//优惠标签  
28 - type: Boolean,  
29 - value: false,  
30 - },  
31 - hasActivityShort: {//店铺名后面的惠字  
32 - type: Boolean,  
33 - value: false,  
34 - },  
35 - hasSlogan: {  
36 - type: Boolean,  
37 - value: true,  
38 - },  
39 - hasBrand: {//店铺品牌  
40 - type: Boolean,  
41 - value: false,  
42 - },  
43 - hasActivityTese: {//店铺特色  
44 - type: Boolean,  
45 - value: false,  
46 - },  
47 - sellerStyle: {//特殊样式  
48 - type: String,  
49 - value: '',  
50 - },  
51 - hasSuggestion:{//是否有搜索目的地  
52 - type: Boolean,  
53 - value: false,  
54 - },  
55 - hasActivityRed:{//红包活动 tags  
56 - type: Boolean,  
57 - value: false,  
58 - },  
59 - hasNewActivityList:Boolean,//新的活动商家列表  
60 - hasInSwiper:Boolean,//是否在Swiper控件内,不能使用组件电话框,只能通知页面  
61 - hasShafa:Boolean,// 沙发按钮  
62 - hasPtActiving:Boolean,//是否有平台活动  
63 - },  
64 -  
65 - /**  
66 - * 组件的初始数据  
67 - */  
68 - data: {},  
69 - lifetimes: {  
70 - attached: function () {  
71 - },  
72 - moved: function () {  
73 - },  
74 - detached: function () {  
75 - },  
76 - },  
77 - observers: {  
78 - 'seller': function () {  
79 - this.init()  
80 - }  
81 - },  
82 - /**  
83 - * 组件的方法列表  
84 - */  
85 - methods: {  
86 - init() {  
87 - let seller = this.data.seller  
88 - seller.label_cstr=''  
89 - seller.label_carr=[]  
90 - if (seller && seller.label_c && seller.label_c.length > 0) {  
91 - let label_cstr = []  
92 - seller.label_c.forEach(l => {  
93 - label_cstr.push(l.name)  
94 - seller.label_carr.push({type:1,name:l.name})  
95 - })  
96 - seller.label_cstr = label_cstr.join(' | ')  
97 - }  
98 - if(seller.is_discount>0){  
99 - seller.label_carr.unshift({type:0,name:'商家补贴'})  
100 - }  
101 - if(seller.isopen_md==1 && this.data.hasPtActiving){  
102 - seller.label_carr.unshift({type:0,name:'瓜分百万'})  
103 - }  
104 - if(seller.label_carr.length>3){  
105 - seller.label_carr=seller.label_carr.slice(0,3)  
106 - }  
107 - this.setData({  
108 - location:getApp().location,  
109 - se: seller,  
110 - })  
111 - },  
112 - tapButton(e) {  
113 - //console.log('tapButton',e)  
114 - let type = util.attr(e, 'type');  
115 - if (type == 'oncall') {  
116 - console.log('has_online_reserve',this.data.seller.is_online_reserve,this.data.seller.is_tele)  
117 - if(this.data.seller.is_online_reserve==1){  
118 - let url=util.http_build_query({id:this.data.seller.id,activeTab:'reserve'},'/pages/reserve/reserve')  
119 - if(this.data.seller.findSellerParamObj){  
120 - let findSellerParamObj=this.data.seller.findSellerParamObj  
121 - findSellerParamObj={  
122 - date:findSellerParamObj.when_date,  
123 - pnum:findSellerParamObj.several,  
124 - }  
125 - if(findSellerParamObj.daily>-1){  
126 - findSellerParamObj.section=['','morning','noon','night',''][findSellerParamObj.daily]  
127 - }  
128 - url=util.http_build_query(findSellerParamObj,url)  
129 - }  
130 - if(this.data.hasShafa){  
131 - url=util.http_build_query({  
132 - classID:util.attr(e,'cid'),  
133 - className:util.attr(e,'cname'),  
134 - },url)  
135 - }  
136 - return wx.navigateTo({  
137 - url:url,  
138 - })  
139 - }  
140 - if(this.data.hasInSwiper){  
141 - this.triggerEvent('event',{act:type,seller:this.data.seller})  
142 - }else{  
143 - this.selectComponent('#as').show(this.data.seller);  
144 - }  
145 - } else {  
146 - util.toast('请打电话预订', 'none');  
147 - }  
148 - },  
149 - lookLocation: function () {  
150 - wx.openLocation({  
151 - latitude: Number(this.data.seller.lat),  
152 - longitude: Number(this.data.seller.long),  
153 - scale: 17,  
154 - address: this.data.seller.map_address,  
155 - success: function (res) {  
156 - console.log(res)  
157 - }  
158 - })  
159 - },  
160 - }  
161 -})  
1 -// components/reserve/seller-box-transverse/shafa.js  
2 -Component({  
3 - /**  
4 - * 组件的属性列表  
5 - */  
6 - properties: {  
7 -  
8 - },  
9 -  
10 - /**  
11 - * 组件的初始数据  
12 - */  
13 - data: {  
14 -  
15 - },  
16 -  
17 - /**  
18 - * 组件的方法列表  
19 - */  
20 - methods: {  
21 -  
22 - }  
23 -})  
1 -{  
2 - "component": true,  
3 - "usingComponents": {}  
4 -}  
1 -<!--components/reserve/seller-box-transverse/shafa.wxml-->  
2 -<view class="shafa flex-vc">  
3 - <view class="shafa-bei"><slot></slot></view>  
4 - <view class="shafa-dian"></view>  
5 - <view class="shafa-dian2"></view>  
6 - <view class="shafa-fushou flex-lr"></view>  
7 - <view class="shafa-tui flex-lr"></view>  
8 -</view>  
1 -/* components/reserve/seller-box-transverse/shafa.wxss */  
2 -@import "../../../app.wxss";  
3 -.shafa{  
4 - position: relative;  
5 - height: 66rpx;  
6 -}  
7 -.shafa-bei{  
8 - height:44rpx;  
9 - background:rgba(249,142,71,1);  
10 - border-radius:16rpx 16rpx 0 0;  
11 -  
12 - font-size:26rpx;  
13 - font-family:PingFangSC-Semibold,PingFang SC;  
14 - font-weight:600;  
15 - color:rgba(255,255,255,1);  
16 - line-height:44rpx;  
17 - text-align: center;  
18 -  
19 - padding: 0 16rpx;  
20 - margin: 0 8rpx;  
21 -}  
22 -.shafa-dian{  
23 - height:6rpx;  
24 - background:rgba(255,227,87,1);  
25 - width: calc(100% - 24rpx);  
26 -}  
27 -.shafa-dian2{  
28 - width: 100%;  
29 - height:10rpx;  
30 - background:rgba(255,201,170,1);  
31 - border-radius:0rpx 0rpx 4rpx 4rpx;  
32 -}  
33 -.shafa-fushou{  
34 - position: absolute;  
35 - bottom: 6rpx;  
36 - width: 100%;  
37 -}  
38 -.shafa-fushou:before,.shafa-fushou:after{  
39 - display: block;  
40 - content: "";  
41 - width:16rpx;  
42 - height:42rpx;  
43 - background:rgba(255,201,170,1);  
44 - border-radius:200rpx 200rpx 0rpx 6rpx;  
45 -}  
46 -.shafa-tui{  
47 - position: absolute;  
48 - bottom: 0rpx;  
49 - width: calc(100% - 16rpx);  
50 -}  
51 -.shafa-tui:before,.shafa-tui:after{  
52 - display: block;  
53 - content: "";  
54 - width:6rpx;  
55 - height:6rpx;  
56 - background:rgba(255,209,114,1);  
57 -}  
1 -Component({  
2 - properties:{  
3 - item:Object,  
4 - }  
5 -})  
1 -<view class="taocan-card bg-white flex-vc">  
2 - <navigator url="/pages/taocan/index?sid={{item.sid}}&pid={{item.id}}" hover-class="navigator-hover" class="flex-ll taocan-main">  
3 - <image mode="aspectFill"  
4 - src="{{item.main_url?item.main_url+'?imageView2/2/w/320/interlace/0/q/100':'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'}}" class="taocan-image"></image>  
5 - <view class="taocan-info flex-vl">  
6 - <view class="black-font font36r font-bold font-more" style="line-height: 50rpx;margin-bottom: 6rpx;width:100%;">{{item.name}}</view>  
7 - <view class="gray-deep-font font28r" style="line-height: 40rpx;margin-bottom: 6rpx;">{{item.service}}</view>  
8 - <view class="flex-ll" style="align-items: flex-end;">  
9 - <view class="text-orange" style="margin-right: 20rpx;">  
10 - <text class="font28r">¥</text>  
11 - <text class="font40r font-bold" style="line-height: 56rpx;">{{item.sale_price}}</text>  
12 - </view>  
13 - <view class="text-gray" style="text-decoration:line-through;margin-bottom: 4rpx; ">  
14 - <text class="font20r">¥</text>  
15 - <text class="font28r" style="line-height: 40rpx;">{{item.market_price}}</text>  
16 - </view>  
17 - </view>  
18 - <view class="view flex text-orange align-end" style="margin-top: 6rpx;" wx:if="{{item.discount>0}}">  
19 - <view class="view tag" style="margin-bottom: 6rpx;"></view>  
20 - <view class="view margin-left-xs txt-24-h">{{item.discount}}折</view>  
21 - </view>  
22 - <view class="button txt-28-h text-bold flex align-center justify-center">抢购</view>  
23 - </view>  
24 - </navigator>  
25 - <navigator url="./detail?id={{item.sid}}" hover-class="navigator-hover" class="taocan-seller flex-lr">  
26 - <view class="flex-ll">  
27 - <image mode="aspectFill" src="{{item.seller_image ? item.seller_image+'?imageView2/2/w/84/interlace/0/q/100' : 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'}}" style="width: 84rpx;height: 80rpx;border-radius:6rpx;"></image>  
28 - <view class="flex-vl seller-info">  
29 - <view class="font-bold font26r black-font font-more" style="line-height: 36rpx;margin-bottom: 6rpx;width:100%;">{{item.sellername}}</view>  
30 - <view class="gray-font font24r font-more" style="line-height: 34rpx;width:100%;">{{item.map_address}}</view>  
31 - </view>  
32 - </view>  
33 - <view class="more"></view>  
34 - </navigator>  
35 -</view>  
1 -@import "../../../app.wxss";  
2 -@import "../../../colorui/main.wxss";  
3 -.taocan-card{  
4 - width:710rpx;  
5 - padding: 30rpx;  
6 - border-radius:6rpx;  
7 - box-sizing: border-box;  
8 - box-shadow: 0 0 8rpx 0 #E0E0E0;  
9 - overflow: hidden;  
10 -}  
11 -.taocan-main{  
12 - width: 100%;  
13 - margin-bottom: 20rpx;  
14 -}  
15 -.taocan-image{  
16 - width: 200rpx;  
17 - height: 200rpx;  
18 - background-color: #4C4E4F;  
19 - min-width: 200rpx;  
20 - position: relative;  
21 - border-radius: 10rpx;  
22 -}  
23 -.taocan-info{  
24 - width: 450rpx;  
25 - height: 200rpx;  
26 - padding-left: 30rpx;  
27 - box-sizing: border-box;  
28 - position: relative;  
29 -}  
30 -.tag{  
31 - width: 22rpx;  
32 - height: 22rpx;  
33 - background-image: url("http://nosqn.colorcun.com/taocan/1%20%281%29.png");  
34 -}  
35 -.button{  
36 - position: absolute;  
37 - right: 0;  
38 - bottom: 0;  
39 - width: 124rpx;  
40 - height: 56rpx;  
41 - border-radius: 28rpx;  
42 - background: linear-gradient(#F98E47,#F05522);  
43 - color: #ffffff;  
44 -}  
45 -.taocan-seller{  
46 - width: 100%;  
47 - padding: 20rpx;  
48 - box-sizing: border-box;  
49 - background:#F8F8F8;  
50 - border-radius:10rpx;  
51 -}  
52 -.seller-info{  
53 - width: 496rpx;  
54 - padding-left: 20rpx;  
55 - box-sizing: border-box;  
56 - position: relative;  
57 -}  
1 -// components/reserve/seller-box/seller-box.js  
2 -import util from '../../../utils/util';  
3 -import App from '../../../utils/api';  
4 -const {regeneratorRuntime} = global  
5 -Component({  
6 - /**  
7 - * 组件的属性列表  
8 - */  
9 - properties: {  
10 -  
11 - },  
12 -  
13 - /**  
14 - * 组件的初始数据  
15 - */  
16 - data: {  
17 - hasShow:false,  
18 - seller:{},  
19 - },  
20 -  
21 - /**  
22 - * 组件的方法列表  
23 - */  
24 - methods: {  
25 - show(seller){  
26 - seller.distance=parseInt(seller.distance);  
27 - if(seller.distance>1000){  
28 - seller.distance=(seller.distance/1000).toFixed(2)+'公里'  
29 - }else{  
30 - seller.distance+='米';  
31 - }  
32 - this.setData({  
33 - hasShow:true,  
34 - seller:seller,  
35 - })  
36 - },  
37 - hide(){  
38 - this.setData({  
39 - hasShow:false,  
40 - })  
41 - this.triggerEvent('event',{type:'hide'});  
42 - },  
43 - tapButton(e){  
44 - let type=util.attr(e,'type');  
45 - if(type=='oncall'){  
46 - if(!this.data.seller.phone){  
47 - return util.toast('商家电话错误','none');  
48 - }  
49 - wx.makePhoneCall({  
50 - phoneNumber:this.data.seller.phone  
51 - })  
52 - }else{  
53 - util.toast('请打电话预订','none');  
54 - }  
55 - },  
56 - lookLocation:function(){  
57 - wx.openLocation({  
58 - latitude:Number(this.data.seller.lat),  
59 - longitude:Number(this.data.seller.long),  
60 - scale:17,  
61 - address:this.data.seller.map_address,  
62 - success:function (res) {  
63 - console.log(res)  
64 - }  
65 - })  
66 - },  
67 - }  
68 -})  
1 -{  
2 - "component": true,  
3 - "usingComponents": {}  
4 -}  
1 -<!--components/showModal/showModal.wxml-->  
2 -<cover-view class="mask flex-vr" hidden="{{!hasShow}}" bindtap="hide">  
3 - <cover-view class="showModal">  
4 - <cover-view class="header">  
5 - {{seller.sellername}}  
6 - </cover-view>  
7 - <cover-view class="tip flex-lr">  
8 - <cover-view class="ping flex-ll">★★★★★  
9 - <cover-view style="color: #353535; text-indent: 40rpx">¥50元/人</cover-view>  
10 - </cover-view>  
11 - <cover-view class="type">潮汕火锅</cover-view>  
12 - </cover-view>  
13 - <cover-view class="info flex-ll">  
14 - <cover-image src="http://nosqn.colorcun.com/custom/lite-yd/image/add-act.png" style="width: 30rpx; height: 30rpx; background-color: #F4A22A"></cover-image>  
15 - <cover-view class="type">在线订座买单8折起</cover-view>  
16 - </cover-view>  
17 - <cover-view class="info flex-ll">  
18 - <cover-view src="" style="width: 30rpx; height: 30rpx;"></cover-view>  
19 - <cover-view class="type">赠送精美小菜和饮品</cover-view>  
20 - </cover-view>  
21 - <cover-view class="info flex-ll" style="margin-top: 22rpx;">  
22 - <cover-image src="http://nosqn.colorcun.com/custom/lite-yd/image/gps-icon.png" style="width: 26rpx; height: 32rpx;"></cover-image>  
23 - <cover-view class="type" catchtap="lookLocation">{{seller.map_address}}</cover-view>  
24 - </cover-view>  
25 - <cover-view class="body"></cover-view>  
26 - </cover-view>  
27 - <cover-view class="footer flex-lr">  
28 - <cover-view class="flex-lr left">  
29 - 距离{{seller.distance}}  
30 - </cover-view>  
31 - <cover-view class="flex-lr right">  
32 - <button class="button-none online" plain  
33 - bindtap="tapButton" data-type="online"  
34 - style="color:{{opt.cancelColor}};">在线预订</button>  
35 - <button class="button-none oncall"  
36 - bindtap="tapButton" data-type="oncall"  
37 - style="color:{{opt.confirmColor}};">电话预订</button>  
38 - </cover-view>  
39 - </cover-view>  
40 -</cover-view>  
1 -/* components/reserve/seller-box/seller-box.wxss */  
2 -@import "../../../app.wxss";  
3 -.mask{  
4 - position: fixed;  
5 - width: 100%;  
6 - height: 100%;  
7 - background-color: rgba(0,0,0,.5);  
8 - top:0;  
9 - left: 0;  
10 -}  
11 -  
12 -.showModal{  
13 - width: 90%;  
14 - background-color: #fff;  
15 - padding: 20rpx 5% 0 5%;  
16 -/* border-top-left-radius:20rpx;  
17 - border-top-right-radius:20rpx;*/  
18 -}  
19 -.showModal .header{  
20 - font-size: 40rpx;  
21 - line-height: 60rpx;  
22 - height: 60rpx;  
23 -  
24 -}  
25 -.showModal .body{  
26 - font-size: 30rpx;  
27 - margin-bottom: 30rpx;  
28 -}  
29 -.footer{  
30 - border-top: 2rpx solid #ccc;  
31 - background-color: #fff;  
32 - width: 100%;  
33 -}  
34 -.footer .button-none{  
35 - margin: 30rpx 0;  
36 - font-size: 36rpx;  
37 - height: 82rpx;  
38 - line-height: 82rpx;  
39 - border-radius: 4rpx;  
40 - padding: 0 34rpx;  
41 -}  
42 -.footer .button-none.online{  
43 - border: 2rpx solid #393939;  
44 - color: #353535;  
45 - margin-right: 20rpx;  
46 -}  
47 -.footer .button-none.oncall{  
48 - border: 2rpx solid #393939;  
49 - background-color: #393939;  
50 - color: #FEFEFE;  
51 -}  
52 -.footer .left{  
53 - margin-left: 40rpx;  
54 - font-size: 30rpx;  
55 -}  
56 -.footer .right{  
57 - margin-right: 40rpx;  
58 - font-size: 36rpx;  
59 -}  
60 -  
61 -.tip{  
62 - font-size: 30rpx;  
63 - height: 42rpx;  
64 - line-height: 42rpx;  
65 - margin: 8rpx 0 2rpx;  
66 -}  
67 -.tip .ping{  
68 - color: #F4A22A;  
69 -}  
70 -.info{  
71 - font-size: 30rpx;  
72 - height: 42rpx;  
73 - line-height: 42rpx;  
74 - margin-bottom: 6rpx;  
75 -}  
76 -.info cover-view:last-child{  
77 - margin-left: 22rpx;  
78 -}  
1 -// components/reserve/discount.js  
2 -import App from '../../../utils/api'  
3 -Component({  
4 - /**  
5 - * 组件的属性列表  
6 - */  
7 - properties: {  
8 - cla:String,  
9 - hasPTactivity:Boolean,//平台红包开启状态  
10 - seller:{  
11 - type:Object,  
12 - value:{}  
13 - }  
14 - },  
15 -  
16 - /**  
17 - * 组件的初始数据  
18 - */  
19 - data: {  
20 - display:false,  
21 - hiddenAni:'',  
22 - mycards:[],  
23 - money:0,//最大优惠  
24 - red_envelopes_price:0,//获得金额  
25 - },  
26 - lifetimes: {  
27 - // 生命周期函数,可以为函数,或一个在methods段中定义的方法名  
28 - attached: function () {  
29 - App.Customer.SetCardRel({  
30 - sid:this.data.seller.id  
31 - }).then(res=>{  
32 - if(!res.data) return;  
33 - this.setData({  
34 - red_envelopes_price:res.data.red_envelopes_price,  
35 - money:res.data.money,  
36 - mycards:res.data.list,  
37 - })  
38 - if(res.data.red_envelopes_price>0){  
39 - setTimeout(()=>{  
40 - this.setData({  
41 - red_envelopes_price:0,  
42 - })  
43 - },3000)  
44 - }  
45 - })  
46 - },  
47 - moved: function () { },  
48 - detached: function () { },  
49 - },  
50 - /**  
51 - * 组件的方法列表  
52 - */  
53 - methods: {  
54 - hide(){  
55 - this.setData({  
56 - hiddenAni:'discountHide',  
57 - })  
58 - this.triggerEvent('hide')  
59 - setTimeout(()=>{  
60 - this.setData({  
61 - display:false,  
62 - hiddenAni:'',  
63 - })  
64 - },250)  
65 - },  
66 - show(){  
67 - this.setData({  
68 - display:true,  
69 - hiddenAni:'',  
70 - })  
71 - this.triggerEvent('show')  
72 - },  
73 - useCard(){  
74 - this.hide()  
75 - this.triggerEvent('event',{type:'gotoReserve'})  
76 - },  
77 - },  
78 -})  
1 -<!--components/reserve/discount.wxml-->  
2 -<wxs src="../../../utils/util.wxs" module="util" />  
3 -<view class="toast" wx:if="{{red_envelopes_price>0}}">  
4 - <view class="toast-view">  
5 - <view class="toast-text">店家送您</view>  
6 - <view class="toast-text"><text class="yellow">{{red_envelopes_price}}</text>元红包</view>  
7 - </view>  
8 -</view>  
9 -<view class="{{cla?cla:'tips reserve-detail'}}" wx:if="{{money>0 && red_envelopes_price==0 && seller.isopen_md==1}}">  
10 - <view class="msg">  
11 - {{money}}元  
12 - <view class="jiao"></view>  
13 - </view>  
14 -</view>  
15 -<view class="mask" bindtap="hide" wx:if="{{display}}">  
16 - <view class="discount {{hiddenAni}}" catchtap="">  
17 - <view class="discount-name Medium" bindtap="hide">  
18 - 优惠  
19 - <view class="close"></view>  
20 - </view>  
21 - <view class="discount-content">  
22 - <view class="activity">  
23 - <block wx:for="{{seller.activity}}" wx:key="activity">  
24 - <view class="flex-lr activity-item"  
25 - style="align-items: flex-start">  
26 - <view class="activity-left">{{util.activityName(item.type)}}</view>  
27 - <view class="activity-right">  
28 - {{item.title}}  
29 - <view class="activity-right-info" wx:if="{{item.desc}}">注:{{item.desc}}</view>  
30 - </view>  
31 - </view>  
32 - </block>  
33 - <view class="flex-lr activity-item" wx:if="{{seller.receive_condition_2}}"  
34 - style="align-items: flex-start">  
35 - <view class="activity-left">消费返</view>  
36 - <view class="activity-right">  
37 - 在线买单{{seller.receive_condition_str}}红包  
38 - <view class="activity-right-info">注:仅可以线上买单时使用</view>  
39 - </view>  
40 - </view>  
41 - <view class="flex-lr activity-item" wx:if="{{seller.isopen_md==1 && hasPTactivity}}"  
42 - style="align-items: flex-start">  
43 - <view class="activity-left">平台红包</view>  
44 - <view class="activity-right">可叠加使用平台红包</view>  
45 - </view>  
46 - </view>  
47 - <block wx:if="{{mycards.length>0}}">  
48 - <view class="mycards-txt">已领取的红包</view>  
49 - <view class="mycards">  
50 - <view class="mycards-item" wx:for="{{mycards}}" wx:key="mycards">  
51 - <quan quan="{{item}}">  
52 - <view class="button-use" bindtap="useCard">立即使用</view>  
53 - </quan>  
54 - <view class="quan-tips">仅可在预订包间、在线买单时使用</view>  
55 - </view>  
56 - </view>  
57 - </block>  
58 - </view>  
59 - </view>  
60 -</view>  
1 -/* components/reserve/discount.wxss */  
2 -@import "../../../app.wxss";  
3 -.discount{  
4 - position: fixed;  
5 - bottom: 0;  
6 - background-color: #fefefe;  
7 - border-radius: 40rpx 40rpx 0rpx 0rpx;  
8 - color: #353535;  
9 - width: 100%;  
10 - padding: 20rpx 40rpx 40rpx;  
11 - animation: discountShow 0.3s;  
12 - box-sizing: border-box;  
13 - min-height: 648rpx;  
14 -}  
15 -.discount-content{  
16 - max-height: 792rpx;  
17 - overflow-y: auto;  
18 - overflow-x: visible;  
19 - padding-bottom: 10rpx;  
20 -}  
21 -.discount.discountHide{  
22 - animation: discountHide 0.3s;  
23 -}  
24 -.discount view{  
25 - background-size: 100% 100%;  
26 -}  
27 -.discount-name{  
28 - font-size: 32rpx;  
29 - height: 84rpx;  
30 - line-height: 84rpx;  
31 - width: 100%;  
32 - position: relative;  
33 - text-align: center;  
34 -}  
35 -.discount-name .close{  
36 - background-image: url("http://nosqn.colorcun.com/sellerbaobao/close.png");  
37 - width: 28rpx;  
38 - height: 29rpx;  
39 - position: absolute;  
40 - right:0;  
41 - top:28rpx;  
42 -}  
43 -.activity{  
44 - margin-top: 40rpx;  
45 -}  
46 -.activity .txt{  
47 - width:60rpx;  
48 - height:42rpx;  
49 - font-size:30rpx;  
50 - font-family:PingFangSC-Regular,PingFang SC;  
51 - font-weight:400;  
52 - color:rgba(136,136,136,1);  
53 - line-height:42rpx;  
54 -}  
55 -.activity-item{  
56 - margin-top: 20rpx;  
57 -  
58 - background: #FFFFFF;  
59 - box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(228, 228, 228, 0.5);  
60 - border-radius: 10rpx;  
61 -  
62 - box-sizing: border-box;  
63 - padding: 24rpx 40rpx;  
64 -  
65 - width: calc(100% - 20rpx);  
66 - margin-left: 10rpx;  
67 -}  
68 -.activity-left{  
69 - height:28rpx;  
70 - border-radius:4rpx;  
71 - border:2rpx solid rgba(248,164,135,1);  
72 - font-size:20rpx;  
73 - font-family:PingFangSC-Medium,PingFang SC;  
74 - font-weight:500;  
75 - color:rgba(240,88,36,1);  
76 - line-height:28rpx;  
77 - padding: 0 6rpx;  
78 - /*min-width: 60rpx;*/  
79 - white-space:nowrap;  
80 - text-align: center;  
81 - position: relative;  
82 -}  
83 -.activity-right{  
84 - font-size: 28rpx;  
85 - font-family: PingFangSC-Medium, PingFang SC;  
86 - font-weight:500;  
87 - color:rgba(53,53,53,1);  
88 - line-height: 40rpx;  
89 - width: calc(100% - 112rpx);  
90 -}  
91 -.mycards-txt{  
92 - height:42rpx;  
93 - font-size:30rpx;  
94 - font-family:PingFangSC-Regular,PingFang SC;  
95 - font-weight:400;  
96 - color:rgba(136,136,136,1);  
97 - line-height:42rpx;  
98 - margin-top: 50rpx;  
99 -}  
100 -.mycards{  
101 - margin-top: 20rpx;  
102 - /*max-height: 430rpx;*/  
103 -}  
104 -.quan-tips{  
105 - height:50rpx;  
106 - background:rgba(245,245,245,1);  
107 - border-radius:0rpx 0rpx 10rpx 10rpx;  
108 - font-size:22rpx;  
109 - font-family:PingFangSC-Regular,PingFang SC;  
110 - font-weight:400;  
111 - color:rgba(136,136,136,1);  
112 - line-height:50rpx;  
113 - padding-left: 36rpx;  
114 - width: 100%;  
115 - box-sizing: border-box;  
116 -}  
117 -.mycards-item{  
118 - margin-bottom: 20rpx;  
119 -}  
120 -.button-use{  
121 - width:120rpx;  
122 - height:44rpx;  
123 - background:linear-gradient(180deg,rgba(231,66,88,1) 0%,rgba(243,53,78,1) 100%);  
124 - border-radius:6rpx;  
125 - font-size:24rpx;  
126 - font-family:PingFangSC-Medium,PingFang SC;  
127 - font-weight:500;  
128 - color:rgba(255,227,192,1);  
129 - line-height:44rpx;  
130 - text-align: center;  
131 -}  
132 -@keyframes discountShow  
133 -{  
134 - from {bottom: -876rpx;}  
135 - to {bottom: 0rpx;}  
136 -}  
137 -@keyframes discountHide  
138 -{  
139 - from {bottom: 0;}  
140 - to {bottom: -876rpx;}  
141 -}  
142 -  
143 -.toast{  
144 - background:rgba(255,82,76,1);  
145 - border-radius:10rpx;  
146 - box-sizing: border-box;  
147 - z-index: 9999;  
148 - position: fixed;  
149 - top:560rpx;  
150 - left:calc(50% - 150rpx);  
151 -}  
152 -.toast-view{  
153 - width:300rpx;  
154 - height:220rpx;  
155 - position: relative;  
156 - box-sizing: border-box;  
157 - overflow: hidden;  
158 - text-align: center;  
159 - padding-top: 92rpx;  
160 -}  
161 -.toast-view:before{  
162 - content: "";  
163 - display: block;  
164 - width:340rpx;  
165 - height:160rpx;  
166 - border:6rpx solid rgba(216,18,18,1);  
167 - position: absolute;  
168 - top:-80rpx;  
169 - left: -20rpx;  
170 - box-sizing: border-box;  
171 - border-radius: 50%;  
172 -}  
173 -.toast-text{  
174 - height:44rpx;  
175 - font-size:32rpx;  
176 - font-family:PingFangSC-Semibold,PingFang SC;  
177 - font-weight:600;  
178 - color:rgba(255,255,255,1);  
179 - line-height:44rpx;  
180 -}  
181 -.toast-text .yellow{  
182 - color:#FFF48D;  
183 -}  
184 -.tips{  
185 - position: fixed;  
186 - z-index: 9999;  
187 - background:rgba(84,83,84,0.8);  
188 - font-size:24rpx;  
189 - font-weight:500;  
190 - color:rgba(255,255,255,1);  
191 -}  
192 -.tips .msg{  
193 - height: 70rpx;  
194 - line-height: 70rpx;  
195 - padding: 0 24rpx;  
196 - position: relative;  
197 -}  
198 -.jiao{  
199 - width: 26rpx;  
200 - height: 10rpx;  
201 - background-image: url("http://nosqn.colorcun.com/activity/images/jiao2.png");  
202 - background-size: 100% 100%;  
203 - position: absolute;  
204 - bottom: -10rpx;  
205 - left:30rpx;  
206 -}  
207 -.tips.reserve-detail{  
208 - bottom:122rpx;  
209 - right:30rpx;  
210 -}  
211 -.tips.reserve-detail .jiao{  
212 - right:80rpx;  
213 - left:auto;  
214 -}  
215 -.tips.reserve-detail .msg{  
216 - color: #FEDE68;  
217 -}  
218 -.tips.reserve-detail .msg:before{  
219 - content: "预订买单,立即抵扣";  
220 - color:rgba(255,255,255,1);  
221 -}  
222 -  
223 -.detail_owner .jiao{  
224 - display: none;  
225 -}  
226 -.detail_owner .msg:after{  
227 - content: "红包待用";  
228 - text-indent: -4rpx;  
229 - display: inline-block;  
230 -}  
231 -  
232 -.money-tips{  
233 - min-width:184rpx;  
234 - height:34rpx;  
235 - padding: 0 20rpx;  
236 - background:rgba(240,85,34,1);  
237 - border-radius:16rpx 16rpx 16rpx 0rpx;  
238 -  
239 - font-size:20rpx;  
240 - font-weight:500;  
241 - color:rgba(255,255,255,1);  
242 - line-height:34rpx;  
243 -  
244 - position: absolute;  
245 - top:-28rpx;  
246 - right:-16rpx;  
247 -}  
248 -  
249 -.checkout-button-money-tips{  
250 - min-width:184rpx;  
251 - padding: 0 20rpx;  
252 - height:34rpx;  
253 - background:rgba(240,85,34,1);  
254 - border-radius:16rpx 16rpx 16rpx 0rpx;  
255 -  
256 - font-size:20rpx;  
257 - font-weight:500;  
258 - color:rgba(255,255,255,1);  
259 - line-height:34rpx;  
260 -  
261 - position: absolute;  
262 - top:-28rpx;  
263 - right:40rpx;  
264 -}  
265 -  
266 -.seller-reserve{  
267 - display: none;  
268 -}  
269 -  
270 -.activity-right-info{  
271 - font-size: 24rpx;  
272 - font-family: PingFangSC-Regular, PingFang SC;  
273 - font-weight: 400;  
274 - color: #999999;  
275 - line-height: 34rpx;  
276 - margin-top: 8rpx;  
277 -}  
1 -// components/reserve/seller/quan.js  
2 -Component({  
3 - /**  
4 - * 组件的属性列表  
5 - */  
6 - properties: {  
7 - quan:Object,  
8 - cla:String,  
9 - },  
10 -  
11 - /**  
12 - * 组件的初始数据  
13 - */  
14 - data: {  
15 -  
16 - },  
17 -  
18 - /**  
19 - * 组件的方法列表  
20 - */  
21 - methods: {  
22 -  
23 - }  
24 -})  
1 -{  
2 - "component": true,  
3 - "usingComponents": {}  
4 -}  
1 -<!--components/reserve/seller/quan.wxml-->  
2 -<wxs src="../../../utils/util.wxs" module="util" />  
3 -<view class="quan flex-lr {{cla}}">  
4 - <view class="money Semibold flex-cc money-{{util.toFixed(quan.price,0).length}}" style="align-items: flex-end">  
5 - <view class="dot">¥</view>  
6 - <view class="number">{{util.toFixed(quan.price,0)}}</view>  
7 - </view>  
8 - <view class="line"></view>  
9 - <view class="type">  
10 - <view class="card_title">{{quan.card_title}}</view>  
11 - <view class="card-date" wx:if="{{quan.start_time>0}}">  
12 - {{util.unixtoTime(quan.start_time,"YYYY.MM.DD")}}-{{util.unixtoTime(quan.end_time,"YYYY.MM.DD")}}  
13 - </view>  
14 - <view class="card-date" wx:else="">  
15 - 长期有效  
16 - </view>  
17 - </view>  
18 - <view class="opt">  
19 - <slot></slot>  
20 - </view>  
21 -</view>  
1 -/* components/reserve/seller/quan.wxss */  
2 -@import "/app.wxss";  
3 -.quan{  
4 - width:100%;  
5 - height:170rpx;  
6 - background:rgba(255,239,223,1);  
7 - box-sizing: border-box;  
8 - padding: 36rpx;  
9 - padding-right: 22rpx;  
10 - padding-left: 0;  
11 - border-radius:10rpx 10rpx 0rpx 0rpx;  
12 - border-right: 14rpx solid #fefefe;  
13 - position: relative;  
14 -}  
15 -.quan:after{  
16 - background-size: 100% 100%;  
17 - background-image: url("http://nosqn.colorcun.com/sellerbaobao/rp2.png");  
18 - position: absolute;  
19 - top:0;  
20 - right:-14rpx;  
21 - width: 16rpx;  
22 - height: 170rpx;  
23 - content: "";  
24 -}  
25 -.quan .money{  
26 - min-width: 186rpx;  
27 - width: 186rpx;  
28 - overflow: hidden;  
29 -}  
30 -.quan .money-4,.quan .money-5{  
31 - min-width: 226rpx;  
32 - width: 226rpx;  
33 - overflow: hidden;  
34 -}  
35 -.quan .type{  
36 - width: 80%;  
37 -}  
38 -.dot{  
39 - width:22rpx;  
40 - height:50rpx;  
41 - font-size:36rpx;  
42 - font-family:PingFangSC-Semibold,PingFang SC;  
43 - font-weight:600;  
44 - color:rgba(204,65,17,1);  
45 - line-height:50rpx;  
46 - margin-bottom: 10rpx;  
47 -}  
48 -.number{  
49 - height:90rpx;  
50 - font-size:64rpx;  
51 - font-family:PingFangSC-Semibold,PingFang SC;  
52 - font-weight:600;  
53 - color:rgba(204,65,17,1);  
54 - line-height:90rpx;  
55 - margin-left: 10rpx;  
56 -}  
57 -.line{  
58 - height: 100rpx;  
59 - width:2rpx;  
60 - margin-right: 38rpx;  
61 - background-image: url("http://nosqn.colorcun.com/sellerbaobao/l-o2.png");  
62 - background-size: 2rpx 16rpx;  
63 -}  
64 -.card_title{  
65 - height:40rpx;  
66 - font-size:28rpx;  
67 - font-family:PingFangSC-Medium,PingFang SC;  
68 - font-weight:500;  
69 - color:rgba(187,113,50,1);  
70 - line-height:40rpx;  
71 -}  
72 -.card-date{  
73 - height:32rpx;  
74 - font-size:22rpx;  
75 - font-family:PingFangSC-Regular,PingFang SC;  
76 - font-weight:400;  
77 - color:rgba(187,113,50,1);  
78 - line-height:32rpx;  
79 - margin-top: 10rpx;  
80 -}  
81 -  
82 -.quan-pt{  
83 - background:rgba(255,227,227,1);  
84 -}  
85 -.quan-pt:after{  
86 - background-image: url("http://nosqn.colorcun.com/sellerbaobao/rs2.png");  
87 -}  
88 -.quan-pt .dot,.quan-pt .number{  
89 - color:rgba(204,17,17,1);  
90 -}  
91 -.quan-pt .line{  
92 - background-image: url("http://nosqn.colorcun.com/sellerbaobao/l-r2.png");  
93 -}  
94 -.quan-pt .card_title,.quan-pt .card-date{  
95 - color:rgba(187,80,50,1);  
96 -}  
97 -  
98 -.quan.bg-f5f5f5{  
99 - border-right: 14rpx solid #f5f5f5;  
100 -}  
101 -  
102 -.quan-disabled{  
103 - background:rgba(245,245,245,1);  
104 -}  
105 -.quan-disabled:after{  
106 - background-image: url("http://nosqn.colorcun.com/sellerbaobao/rx2.png");  
107 -}  
108 -.quan-disabled .dot,.quan-disabled .number{  
109 - color:rgba(136,136,136,1);  
110 -}  
111 -.quan-disabled .line{  
112 - background-image: url("http://nosqn.colorcun.com/sellerbaobao/l-g2.png");  
113 -}  
114 -.quan-disabled .card_title,.quan-disabled .card-date{  
115 - color:rgba(136,136,136,1);  
116 -}  
1 -// components/reserve/share/share.js  
2 -import util from '../../../utils/util';  
3 -Component({  
4 - /**  
5 - * 组件的属性列表  
6 - */  
7 - properties: {  
8 - seller_id:String,  
9 - hasSellerShare:{  
10 - type:Boolean,  
11 - value:false,  
12 - },  
13 - seller:{  
14 - type:Object,  
15 - value:{},  
16 - },  
17 - },  
18 -  
19 - /**  
20 - * 组件的初始数据  
21 - */  
22 - data: {  
23 - hasShow:false,  
24 - product:null,  
25 - },  
26 - lifetimes: {  
27 - attached: function () {  
28 - this.formatProduct()  
29 - },  
30 - moved: function () {  
31 - },  
32 - detached: function () {  
33 - },  
34 - },  
35 - /**  
36 - * 组件的方法列表  
37 - */  
38 - methods: {  
39 - show(){  
40 - this.setData({  
41 - hasShow:true,  
42 - })  
43 - },  
44 - hide(){  
45 - this.setData({  
46 - hasShow:false,  
47 - })  
48 - },  
49 - shareDo(e){  
50 - this.hide()  
51 - let act=util.attr(e,'act');  
52 - if(!act) return;  
53 - console.log('shareDo.'+act,e);  
54 - wx.navigateTo({  
55 - url:util.http_build_query({  
56 - id:this.data.seller_id,  
57 - act:act,  
58 - hasSellerShare:this.data.hasSellerShare  
59 - },'/pages/reserve/share')  
60 - })  
61 - },  
62 - formatProduct(){  
63 - let seller=this.data.seller  
64 - let product= {  
65 - item_code:seller.id+"",  
66 - title:seller.sellername,  
67 - desc:seller.slogan,  
68 - category_list:(seller.cate && seller.cate.length>0)?seller.cate:['餐厅','饭店','餐饮','订包间','周到安排'],  
69 - image_list:seller.envi_image,  
70 - src_mini_program_path:'/pages/reserve/detail?id='+seller.id+'&from=haowu',  
71 - brand_info:{  
72 - name:seller.sellername,  
73 - logo:seller.seller_image,  
74 - phone:seller.seller_tel,  
75 - },  
76 - sku_list:[],  
77 - }  
78 - this.setData({  
79 - product:product,  
80 - })  
81 - },  
82 - }  
83 -})  
1 -<!--components/reserve/share/share.wxml-->  
2 -<view class="share mask" catchtap="hide" wx:if="{{hasShow}}">  
3 - <view class="share-view">  
4 - <view class="flex-lr" catchtap="catchtap">  
5 - <button class="button-none share-item flex-vc" open-type="share" catchtap="shareDo">  
6 - <image class="share-img wechat"></image>  
7 - <view class="share-name">微信</view>  
8 - </button>  
9 - <view class="share-item flex-vc" catchtap="shareDo" data-act="quanzi">  
10 - <image class="share-img quanzi"></image>  
11 - <view class="share-name">朋友圈</view>  
12 - </view>  
13 - <view class="share-item flex-vc" catchtap="shareDo" data-act="qrcode">  
14 - <image class="share-img qrcode"></image>  
15 - <view class="share-name">二维码</view>  
16 - </view>  
17 - <view class="share-item flex-vc">  
18 - <share-button type="3" fore-color="#dd6" product="{{product}}" style="height: 100rpx;">  
19 - <image class="share-img hwq"></image>  
20 - </share-button>  
21 - <view class="share-name">好物圈</view>  
22 - </view>  
23 - </view>  
24 - <view class="cancel">取消</view>  
25 - </view>  
26 -</view>  
1 -/* components/reserve/share/share.wxss */  
2 -@import "../../../app.wxss";  
3 -.share-view{  
4 - height: 390rpx;  
5 - background: #ffffff;  
6 - width: 100%;  
7 - padding: 50rpx 50rpx 0rpx;  
8 - position: fixed;  
9 - bottom: 0;  
10 - border-radius: 40rpx 40rpx 0px 0px;  
11 - box-sizing: border-box;  
12 -}  
13 -.share-img{  
14 - width: 100rpx;  
15 - height: 100rpx;  
16 - background-size: 100% 100%;  
17 -}  
18 -.share-img.wechat{  
19 - background-image: url("http://nosqn.colorcun.com/reserve/share/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201906251004331.png");  
20 -}  
21 -.share-img.quanzi{  
22 - background-image: url("http://nosqn.colorcun.com/reserve/share/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20190625100433.png");  
23 -}  
24 -.share-img.qrcode{  
25 - background-image: url("http://nosqn.colorcun.com/reserve/share/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201906251004332.png");  
26 -}  
27 -.share-img.hwq{  
28 - background-image: url("http://nosqn.colorcun.com/reserve/images/hwq.png");  
29 -}  
30 -.share-name{  
31 - height: 40rpx;  
32 - font-size: 28rpx;  
33 - font-family: PingFangSC-Regular, PingFang SC;  
34 - font-weight: 400;  
35 - color: #353535;  
36 - line-height: 40rpx;  
37 - margin-top: 20rpx;  
38 -}  
39 -.share-item{  
40 - min-width: 25%;  
41 - width: 25%;  
42 -}  
43 -.cancel{  
44 - width: 100%;  
45 - height: 80rpx;  
46 - background: #F5F5F5;  
47 - border-radius: 40rpx;  
48 - text-align: center;  
49 - line-height: 80rpx;  
50 - font-size: 34rpx;  
51 - font-family: PingFangSC-Regular, PingFang SC;  
52 - font-weight: 400;  
53 - color: #666666;  
54 - margin-top:60rpx;  
55 -  
56 -}  
1 -import util from '../../../utils/util';  
2 -import App from '../../../utils/api';  
3 -Component({  
4 - properties:{  
5 - seller:Object,  
6 - //选中日期  
7 - date:{  
8 - type:String,  
9 - value:util.unixtoTime(new Date()/1000,'YYYY-MM-DD'),  
10 - }  
11 - },  
12 - data:{  
13 - hidecalendar:true  
14 - },  
15 - attached(){  
16 - this.today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD');  
17 - this.setData({  
18 - showYearMonth:this.getshowmonth(this.data.date)  
19 - })  
20 - this.hasNowInToday();  
21 - this.getweeklist();  
22 - this.getdaylist();  
23 - this.getFullDate();  
24 - },  
25 - ready(){  
26 -  
27 - },  
28 - methods:{  
29 - //判断是否过了今天时段,并设置date  
30 - hasNowInToday(){  
31 - let daily=this.data.seller.daily  
32 - let maxDur='';  
33 - Object.keys(daily).forEach(k=>{  
34 - let dur=daily[k].split('-')  
35 - if(dur[1]>maxDur){  
36 - maxDur=dur[1]  
37 - }  
38 - })  
39 - let nowDur=util.unixtoTime(new Date()/1000,'HH:II')  
40 - let nowDate=this.data.date  
41 - if(nowDur>maxDur){  
42 - nowDate=util.unixtoTime(new Date()/1000+86400,'YYYY-MM-DD')  
43 - this.setData({  
44 - date:nowDate  
45 - })  
46 - }  
47 - //console.log('hasNowInToday',maxDur)  
48 - this.triggerEvent('selectdate',{date:nowDate,action:'defalut'})  
49 - },  
50 - //获取当前选中日期年月  
51 - getshowmonth(selecteddate){  
52 - let datearr=selecteddate.split('-');  
53 - return{  
54 - showyear:Number(datearr[0]),  
55 - showmonth:Number(datearr[1]),  
56 - }  
57 - },  
58 - //获得周列表  
59 - getweeklist(){  
60 - let week=['日','一','二','三','四','五','六'];  
61 - let weeklist=[];  
62 - for(let i=0;i<week.length;i++){  
63 - weeklist.push({  
64 - weekfont:week[i],  
65 - weeknum:i  
66 - })  
67 - }  
68 - this.setData({  
69 - weeklist:weeklist,  
70 - })  
71 - },  
72 - //获取日期列表  
73 - getdaylist(){  
74 - //选中时间时间戳  
75 - let selectedtime=Number(util.timetouUnix(this.data.date+' 00:00:00'));  
76 - //选中日期星期几  
77 - let selectedweek=new Date(this.data.date).getDay();  
78 - console.log('selectedweek',selectedweek)  
79 - let daylist=[],current=0;  
80 - //用于月历点击的时候判断是否改变周历列表  
81 - this.datelist={}  
82 - if(this.data.date==this.today){  
83 - selectedweek=0;  
84 - }  
85 - for(let i=0;i<14;i++){  
86 - let thistimestamp=selectedtime+(i-selectedweek)*86400;  
87 - let thisdate=new Date(thistimestamp*1000);  
88 - let thisdayobj={  
89 - year:thisdate.getFullYear(),  
90 - month:thisdate.getMonth()+1,  
91 - day:thisdate.getDate(),  
92 - week:thisdate.getDay(),  
93 - date:util.unixtoTime(thistimestamp,'YYYY-MM-DD'),  
94 - overdate:thistimestamp<=(new Date()/1000)-86400 ? true : false, //日期是否过期  
95 - istoday:false,  
96 - timestamp:thistimestamp,  
97 - }  
98 - //是否是今天  
99 - if(this.today==thisdayobj.date){  
100 - thisdayobj.istoday=true;  
101 - thisdayobj.mark='今'  
102 - }  
103 - if(util.unixtoTime(new Date()/1000+86400,'YYYY-MM-DD')==thisdayobj.date){  
104 - thisdayobj.mark='明'  
105 - }  
106 - thisdayobj.isselected=false  
107 - if(this.data.date==thisdayobj.date){  
108 - thisdayobj.isselected=true  
109 - current=i  
110 - }  
111 - thisdayobj.isselected=this.data.date==thisdayobj.date ? true : false;  
112 - //日期是否选中  
113 - daylist.push(thisdayobj);  
114 - this.datelist[thisdayobj.date]=Math.floor(i/7)+'-'+(i-Math.floor(i/7)*7)  
115 - }  
116 - this.setData({  
117 - current:this.getCurrentMax(current),  
118 - daylist:daylist  
119 - })  
120 - console.log('getdaylist.daylist',daylist,this.datelist)  
121 - },  
122 - //获取满房日期  
123 - getFullDate(){  
124 - let parmdata={  
125 - sid:this.data.seller.id,  
126 - type:'week',  
127 - date:this.data.daylist[0].date  
128 - }  
129 - App.Customer.GetHouseFullDate(parmdata).then((json)=>{  
130 - console.log(json)  
131 - if(json.ret==200){  
132 - if(json.data && json.data.length>0){  
133 - this.markFullHouse(json.data);  
134 - }  
135 - }  
136 - })  
137 - },  
138 - //标记满房  
139 - markFullHouse(fullHouseDate){  
140 - let daylist=this.data.daylist;  
141 - daylist.forEach((r,i)=>{  
142 - fullHouseDate.forEach((r1,n1)=>{  
143 - if(r1==r.date){  
144 - r.mark='满'  
145 - }  
146 - })  
147 - })  
148 - console.log('markFullHouse.daylist',daylist)  
149 - this.setData({  
150 - daylist:daylist  
151 - })  
152 - },  
153 - //选择日期  
154 - selectdate(e){  
155 - let _target=e.currentTarget.dataset;  
156 - this.changedatestyle(_target.date);  
157 - this.triggerEvent('selectdate',{date:_target.date,action:'click'});  
158 - this.setData({  
159 - date:_target.date,  
160 - showYearMonth:this.getshowmonth(_target.date),  
161 - current:this.getCurrentMax(_target.index-(_target.date==this.today?0:1)),  
162 - })  
163 - },  
164 - //日历组件---通知事件  
165 - tellselectdate(e){  
166 - console.log(e)  
167 - let _target=e.detail;  
168 - this.triggerEvent('selectdate',{date:_target.date,action:'click'});  
169 - this.setData({  
170 - date:_target.date,  
171 - showYearMonth:this.getshowmonth(_target.date),  
172 - hidecalendar:true  
173 - })  
174 - console.log('tellselectdate',_target.date , this.datelist,_target.date in this.datelist)  
175 - if(_target.date in this.datelist){  
176 - this.changedatestyle(_target.date)  
177 - }else{  
178 - this.getdaylist();  
179 - this.getFullDate();  
180 - }  
181 - },  
182 - //修改日期列表  
183 - changedatestyle(selecteddate){  
184 - let daylist=this.data.daylist;  
185 - let prevsingle,previndex,cursingle,curindex;  
186 - daylist.forEach((r,i)=>{  
187 - if(r.isselected){  
188 - prevsingle=i;  
189 - let prevkey='daylist['+prevsingle+'].isselected';  
190 - this.setData({  
191 - [prevkey]:false,  
192 - })  
193 - }  
194 - if(r.date==selecteddate){  
195 - cursingle=i;  
196 - }  
197 - })  
198 - let currentkey='daylist['+cursingle+'].isselected';  
199 - this.setData({  
200 - [currentkey]:true,  
201 - current:this.getCurrentMax(cursingle-(selecteddate==this.today?0:1)),  
202 - })  
203 - },  
204 - clickmore(){  
205 - this.setData({  
206 - hidecalendar:false  
207 - })  
208 - },  
209 - getCurrentMax(current){  
210 - return current>10?10:current;  
211 - },  
212 - closecalendar(){  
213 - this.setData({  
214 - hidecalendar:true  
215 - })  
216 - }  
217 - }  
218 -})  
1 -<wxs src="../../../utils/util.wxs" module="util" />  
2 -<view class="padding-lr-lg padding-top-lg">  
3 - <view class="flex justify-between align-center margin-bottom" catchtap="clickmore">  
4 - <view class="txt-36-h text-bold">预订日期</view>  
5 - <view class="flex align-center txt-24-h">  
6 - 更多  
7 - <view class="more margin-left-xs"></view>  
8 - </view>  
9 - </view>  
10 -</view>  
11 -<swiper previous-margin="35rpx" next-margin="45rpx"  
12 - class="tabs date" current="{{current}}"  
13 - display-multiple-items="4">  
14 - <swiper-item wx:for="{{daylist}}" wx:key="daylist">  
15 - <view class="item {{item.isselected?'active':''}} flex flex-direction justify-center"  
16 - catchtap="{{item.overdate ? '' : 'selectdate'}}"  
17 - data-index="{{index}}" data-date="{{item.date}}" data-type="date">  
18 - <view class="name">{{util.unixtoTime(item.timestamp,'DAY')||util.unixtoTime(item.timestamp,'周WW')}}</view>  
19 - <view class="mmdd">{{util.unixtoTime(item.timestamp,'MM月DD日')}}</view>  
20 - </view>  
21 - </swiper-item>  
22 -</swiper>  
23 -<!--  
24 -<view class="week-calendar">  
25 - <view class="week-calendar-content">  
26 - <block wx:for="{{daylist}}" wx:for-item="itemlist" wx:for-index="indexlist" wx:key="{{indexlist}}">  
27 - <view class="week-calendar-day-list flex flex-wrap">  
28 - <block wx:for="{{itemlist.list}}" wx:key="{{index}}">  
29 - <view class="{{item.overdate ? 'gray-font' : 'font-font'}} font30r Semibold week-calendar-day flex-cc {{item.istoday ? 'today' : ''}} {{item.isselected ? 'bg-yellow white-font' : ''}}" data-date="{{item.date}}" catchtap="{{item.overdate ? '' : 'selectdate'}}">{{item.mark ? item.mark : item.day}}</view>  
30 - </block>  
31 - </view>  
32 - </block>  
33 - </view>  
34 -</view>  
35 --->  
36 -<view class="calendar-mask" hidden="{{hidecalendar}}" catchtap="closecalendar"></view>  
37 -<view class="calendar-cover" hidden="{{hidecalendar}}">  
38 - <online-calendar seller="{{seller}}" date="{{date}}" hidecalendar="{{hidecalendar}}" bindtellselectdate="tellselectdate"></online-calendar>  
39 -</view>  
1 -@import "../../../colorui/main.wxss";  
2 -.tabs {  
3 - height: 100rpx;  
4 -}  
5 -.tabs .item{  
6 - width:120rpx;  
7 - height:100rpx;  
8 - line-height: 100rpx;  
9 - border-radius:10rpx;  
10 - border:2rpx solid #fffff;  
11 - font-size:28rpx;  
12 - font-weight:400;  
13 - color:#353535;  
14 - text-align: center;  
15 - box-sizing: border-box;  
16 -}  
17 -.tabs .item.active{  
18 - background: #F4FAFF;  
19 - border-radius: 10rpx;  
20 - border: 2rpx solid #42A5FF;  
21 - color:#42A5FF;  
22 - font-weight: bold;  
23 -}  
24 -.date .item{  
25 - width: 140rpx;  
26 - height: 100rpx;  
27 -}  
28 -.item .name{  
29 - height: 36rpx;  
30 - font-size: 26rpx;  
31 - line-height: 36rpx;  
32 -}  
33 -.item .mmdd{  
34 - height: 40rpx;  
35 - font-size: 28rpx;  
36 - line-height: 40rpx;  
37 -}  
38 -  
39 -.calendar-mask{  
40 - position: fixed;  
41 - left:0;  
42 - right:0;  
43 - top:0;  
44 - bottom:0;  
45 - z-index:10;  
46 - background:rgba(21,20,20,.5);  
47 -}  
48 -.calendar-cover{  
49 - position: fixed;  
50 - left:0;  
51 - right:0;  
52 - bottom:0;  
53 - background: #FFFFFF;  
54 - border-top-left-radius:40rpx;  
55 - border-top-right-radius:40rpx;  
56 - overflow: hidden;  
57 - z-index:11;  
58 -}  
1 -import util from '../../../utils/util';  
2 -import App from '../../../utils/api';  
3 -Component({  
4 - properties:{  
5 - seller:Object,  
6 - //选中日期  
7 - date:{  
8 - type:String,  
9 - value:util.unixtoTime(new Date()/1000,'YYYY-MM-DD'),  
10 - }  
11 - },  
12 - data:{  
13 - hidecalendar:true  
14 - },  
15 - attached(){  
16 - this.setData({  
17 - showYearMonth:this.getshowmonth(this.data.date)  
18 - })  
19 - this.hasNowInToday();  
20 - this.getweeklist();  
21 - this.getdaylist();  
22 - this.getFullDate();  
23 - },  
24 - ready(){  
25 -  
26 - },  
27 - methods:{  
28 - //判断是否过了今天时段,并设置date  
29 - hasNowInToday(){  
30 - let daily=this.data.seller.daily  
31 - let maxDur='';  
32 - Object.keys(daily).forEach(k=>{  
33 - let dur=daily[k].split('-')  
34 - if(dur[1]>maxDur){  
35 - maxDur=dur[1]  
36 - }  
37 - })  
38 - let nowDur=util.unixtoTime(new Date()/1000,'HH:II')  
39 - let nowDate=this.data.date  
40 - if(nowDur>maxDur){  
41 - nowDate=util.unixtoTime(new Date()/1000+86400,'YYYY-MM-DD')  
42 - this.setData({  
43 - date:nowDate  
44 - })  
45 - }  
46 - //console.log('hasNowInToday',maxDur)  
47 - this.triggerEvent('selectdate',{date:nowDate,action:'defalut'})  
48 - },  
49 - //获取当前选中日期年月  
50 - getshowmonth(selecteddate){  
51 - let datearr=selecteddate.split('-');  
52 - return{  
53 - showyear:Number(datearr[0]),  
54 - showmonth:Number(datearr[1]),  
55 - }  
56 - },  
57 - //获得周列表  
58 - getweeklist(){  
59 - let week=['日','一','二','三','四','五','六'];  
60 - let weeklist=[];  
61 - for(let i=0;i<week.length;i++){  
62 - weeklist.push({  
63 - weekfont:week[i],  
64 - weeknum:i  
65 - })  
66 - }  
67 - this.setData({  
68 - weeklist:weeklist,  
69 - })  
70 - },  
71 - //获取日期列表  
72 - getdaylist(){  
73 - //选中时间时间戳  
74 - let selectedtime=Number(util.timetouUnix(this.data.date+' 00:00:00'));  
75 - //选中日期星期几  
76 - let selectedweek=new Date(this.data.date).getDay();  
77 - //今天日期  
78 - let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD');  
79 - console.log('selectedweek',selectedweek)  
80 - let daylist=[{list:[]},{list:[]}];  
81 - //用于月历点击的时候判断是否改变周历列表  
82 - this.datelist={};  
83 - for(let i=0;i<14;i++){  
84 - let thistimestamp=selectedtime+(i-selectedweek)*86400;  
85 - let thisdate=new Date(thistimestamp*1000);  
86 - let thisdayobj={  
87 - year:thisdate.getFullYear(),  
88 - month:thisdate.getMonth()+1,  
89 - day:thisdate.getDate(),  
90 - week:thisdate.getDay(),  
91 - date:util.unixtoTime(thistimestamp,'YYYY-MM-DD'),  
92 - overdate:thistimestamp<=(new Date()/1000)-86400 ? true : false, //日期是否过期  
93 - istoday:false  
94 - }  
95 - //是否是今天  
96 - if(today==thisdayobj.date){  
97 - thisdayobj.istoday=true;  
98 - thisdayobj.mark='今'  
99 - }  
100 - if(util.unixtoTime(new Date()/1000+86400,'YYYY-MM-DD')==thisdayobj.date){  
101 - thisdayobj.mark='明'  
102 - }  
103 - thisdayobj.isselected=this.data.date==thisdayobj.date ? true : false;  
104 - //日期是否选中  
105 - daylist[Math.floor(i/7)].list.push(thisdayobj);  
106 - this.datelist[thisdayobj.date]=Math.floor(i/7)+'-'+(i-Math.floor(i/7)*7)  
107 - }  
108 - this.setData({  
109 - daylist:daylist  
110 - })  
111 - console.log(daylist,this.datelist)  
112 - },  
113 - //获取满房日期  
114 - getFullDate(){  
115 - let parmdata={  
116 - sid:this.data.seller.id,  
117 - type:'week',  
118 - date:this.data.daylist[0].list[0].date  
119 - }  
120 - App.Customer.GetHouseFullDate(parmdata).then((json)=>{  
121 - console.log(json)  
122 - if(json.ret==200){  
123 - if(json.data && json.data.length>0){  
124 - this.markFullHouse(json.data);  
125 - }  
126 - }  
127 - })  
128 - },  
129 - //标记满房  
130 - markFullHouse(fullHouseDate){  
131 - let daylist=this.data.daylist;  
132 - daylist.forEach((v,i)=>{  
133 - v.list.forEach((r,n)=>{  
134 - fullHouseDate.forEach((r1,n1)=>{  
135 - if(r1==r.date){  
136 - r.mark='满'  
137 - }  
138 - })  
139 - })  
140 - })  
141 - this.setData({  
142 - daylist:daylist  
143 - })  
144 - },  
145 - //选择日期  
146 - selectdate(e){  
147 - let _target=e.currentTarget.dataset;  
148 - this.changedatestyle(_target.date);  
149 - this.triggerEvent('selectdate',{date:_target.date,action:'click'});  
150 - this.setData({  
151 - date:_target.date,  
152 - showYearMonth:this.getshowmonth(_target.date)  
153 - })  
154 - },  
155 - //日历组件---通知事件  
156 - tellselectdate(e){  
157 - console.log(e)  
158 - let _target=e.detail;  
159 - this.triggerEvent('selectdate',{date:_target.date,action:'click'});  
160 - this.setData({  
161 - date:_target.date,  
162 - showYearMonth:this.getshowmonth(_target.date),  
163 - hidecalendar:true  
164 - })  
165 - if(_target.date in this.datelist){  
166 - this.changedatestyle(_target.date)  
167 - }else{  
168 - this.getdaylist();  
169 - this.getFullDate();  
170 - }  
171 - },  
172 - //修改日期列表  
173 - changedatestyle(selecteddate){  
174 - let daylist=this.data.daylist;  
175 - let prevsingle,previndex,cursingle,curindex;  
176 - daylist.forEach((v,i)=>{  
177 - v.list.forEach((r,n)=>{  
178 - if(r.isselected){  
179 - prevsingle=i;  
180 - previndex=n;  
181 - let prevkey='daylist['+prevsingle+'].list['+previndex+'].isselected';  
182 - this.setData({  
183 - [prevkey]:false,  
184 - })  
185 - }  
186 - if(r.date==selecteddate){  
187 - cursingle=i;  
188 - curindex=n;  
189 - }  
190 - })  
191 - })  
192 - let currentkey='daylist['+cursingle+'].list['+curindex+'].isselected';  
193 - this.setData({  
194 - [currentkey]:true  
195 - })  
196 - },  
197 - clickmore(){  
198 - this.setData({  
199 - hidecalendar:false  
200 - })  
201 - },  
202 - closecalendar(){  
203 - this.setData({  
204 - hidecalendar:true  
205 - })  
206 - }  
207 - }  
208 -})  
1 -{  
2 - "component": true,  
3 - "usingComponents": {  
4 - "online-calendar":"../online-calendar/online-calendar"  
5 - }  
6 -}  
1 -<view class="week-calendar">  
2 - <view class="week-calendar-header flex-lr">  
3 - <view class="week-calendar-header-title week-calendar-header-item black-font font30r Semibold">{{showYearMonth.showyear}}-{{showYearMonth.showmonth<10 ? '0'+showYearMonth.showmonth : showYearMonth.showmonth}}</view>  
4 - <view class="week-calendar-header-more week-calendar-header-item flex-rr" catchtap="clickmore">  
5 - <view class="black-font font24r">更多</view>  
6 - <image class="click-icon" src="/pages/image/click-icon.png"></image>  
7 - </view>  
8 - </view>  
9 - <view class="week-calendar-week flex-lr">  
10 - <block wx:for="{{weeklist}}" wx:key="{{index}}">  
11 - <view class="gray-font font30r Semibold" style="line-height:40rpx;">{{item.weekfont}}</view>  
12 - </block>  
13 - </view>  
14 - <view class="week-calendar-content">  
15 - <block wx:for="{{daylist}}" wx:for-item="itemlist" wx:for-index="indexlist" wx:key="{{indexlist}}">  
16 - <view class="week-calendar-day-list flex-lr">  
17 - <block wx:for="{{itemlist.list}}" wx:key="{{index}}">  
18 - <view class="{{item.overdate ? 'gray-font' : 'font-font'}} font30r Semibold week-calendar-day flex-cc {{item.istoday ? 'today' : ''}} {{item.isselected ? 'bg-yellow white-font' : ''}}" data-date="{{item.date}}" catchtap="{{item.overdate ? '' : 'selectdate'}}">{{item.mark ? item.mark : item.day}}</view>  
19 - </block>  
20 - </view>  
21 - </block>  
22 - </view>  
23 -</view>  
24 -  
25 -<view class="calendar-mask" hidden="{{hidecalendar}}" catchtap="closecalendar"></view>  
26 -<view class="calendar-cover" hidden="{{hidecalendar}}">  
27 - <online-calendar seller="{{seller}}" date="{{date}}" hidecalendar="{{hidecalendar}}" bindtellselectdate="tellselectdate"></online-calendar>  
28 -</view>  
1 -@import "../../../app.wxss";  
2 -.week-calendar{  
3 - width:100%;  
4 - height:336rpx;  
5 - background:#FFFBF2;  
6 - padding:0 40rpx;  
7 - box-sizing: border-box;  
8 -}  
9 -.week-calendar-header, .week-calendar-week{  
10 - width:100%;  
11 - padding:0 20rpx;  
12 - box-sizing: border-box;  
13 -}  
14 -.week-calendar-header-item{  
15 - padding:30rpx 0;  
16 -}  
17 -.week-calendar-content{  
18 - width:100%;  
19 - padding-top:16rpx;  
20 -}  
21 -.week-calendar-day-list{  
22 - width:100%;  
23 - margin-bottom:26rpx;  
24 -}  
25 -.week-calendar-day{  
26 - width:70rpx;  
27 - height:70rpx;  
28 - box-sizing: border-box;  
29 - border-radius:50%;  
30 -}  
31 -.week-calendar-day.today{  
32 - border:2rpx solid #C0A369;  
33 -}  
34 -.week-calendar-day.bg-yellow{  
35 - background: -webkit-linear-gradient(top, #F2D190, #C0A369); /* Safari 5.1 - 6.0 */  
36 - background: -o-linear-gradient(-45deg, #F2D190, #C0A369); /* Opera 11.1 - 12.0 */  
37 - background: -moz-linear-gradient(top, #F2D190, #C0A369); /* Firefox 3.6 - 15 */  
38 - background: linear-gradient(to bottom, #F2D190, #C0A369);  
39 - border-width:0;  
40 -}  
41 -.click-icon{  
42 - width:12rpx;  
43 - height:20rpx;  
44 - padding-left:10rpx;  
45 -}  
46 -.calendar-mask{  
47 - position: fixed;  
48 - left:0;  
49 - right:0;  
50 - top:0;  
51 - bottom:0;  
52 - z-index:10;  
53 - background:rgba(21,20,20,.5);  
54 -}  
55 -.calendar-cover{  
56 - position: fixed;  
57 - left:0;  
58 - right:0;  
59 - bottom:0;  
60 - background: #FFFBF2;  
61 - border-top-left-radius:20rpx;  
62 - border-top-right-radius:20rpx;  
63 - overflow: hidden;  
64 - z-index:11;  
65 -}  
1 -Component({  
2 - properties: {  
3 - searchlist: Array,  
4 - },  
5 - methods: {  
6 - selectphone: function (e) {  
7 - console.log(e)  
8 - var target = e.currentTarget.dataset;  
9 - this.triggerEvent('selectphone', {  
10 - phone: target.phone,  
11 - rname: target.rname,  
12 - cusdem: target.cusdem,  
13 - sex: target.sex  
14 - })  
15 - }  
16 - }  
17 -})  
1 -{  
2 - "component":true  
3 -}  
1 -<view class="search-react">  
2 - <view class="angel bg_white"></view>  
3 - <scroll-view class="search-list bg_white" scroll-y>  
4 - <block wx:for="{{searchlist}}">  
5 - <view class="list-single flex-lr black-font font30r" data-cusdem="{{item.cusdem}}" data-phone="{{item.phone}}" data-rname="{{item.rname}}" data-sex="{{item.sex}}" bindtap="selectphone" style="border-top:{{index==0 ? 0 : '1px solid #E0E0E0;'}}">  
6 - <view>{{item.phone}}</view>  
7 - <view>{{item.rname}}</view>  
8 - </view>  
9 - </block>  
10 - </scroll-view>  
11 -</view>  
1 -@import '../../app.wxss';  
2 -.search-react{  
3 - width:400rpx;  
4 - height:541rpx;  
5 - position: absolute;  
6 - left:0;  
7 - top:142rpx;  
8 - z-index:10;  
9 -}  
10 -.angel{  
11 - width:30rpx;  
12 - height:30rpx;  
13 - border-top:1px solid #E0E0E0;  
14 - border-left:1px solid #E0E0E0;  
15 - transform:rotate(45deg);  
16 - margin:0 auto;  
17 - position:relative;  
18 - z-index:10;  
19 -}  
20 -.search-list{  
21 - width:100%;  
22 - max-height:500rpx;  
23 - border:1px solid #E0E0E0;  
24 - border-radius:16rpx;  
25 - position:relative;  
26 - top:-16rpx;  
27 - box-shadow:0 0 4px rgba(0,0,0,.1);  
28 - overflow-y: auto;  
29 -}  
30 -.list-single{  
31 - width:100%;  
32 - height:100rpx;  
33 - padding:35rpx 30rpx 5rpx;  
34 - box-sizing:border-box;  
35 -}  
1 -// components/seller-card/seller-card.js  
2 -import util from '../../utils/util';  
3 -import RS from '../../utils/reserveStatus'  
4 -  
5 -Component({  
6 - options: {  
7 - multipleSlots: true // 在组件定义时的选项中启用多slot支持  
8 - },  
9 - /**  
10 - * 组件的属性列表  
11 - */  
12 - properties: {  
13 - seller: Object,  
14 - detail: {  
15 - type: Object,  
16 - value: {},  
17 - observer: function () {  
18 - //console.log('observer', arguments);  
19 - this.init();  
20 - }  
21 - },  
22 - hasMaster: { //预订人+手机  
23 - type: Boolean,  
24 - value: false  
25 - },  
26 - hasListShare: { //首页列表的预订人+分享  
27 - type: Boolean,  
28 - value: false  
29 - },  
30 - hasShowStatus: { //右上角显示状态  
31 - type: Boolean,  
32 - value: false  
33 - },  
34 - hasAddress: { //显示地址,默认显示  
35 - type: Boolean,  
36 - value: true  
37 - },  
38 - hasOnlineReserve:{ //是否为在线预订卡片  
39 - type: Boolean,  
40 - value: false  
41 - },  
42 - },  
43 -  
44 - /**  
45 - * 组件的初始数据  
46 - */  
47 - data: {  
48 - rdateStr: "",  
49 - tableSubInfo: "",  
50 - masterMan: "",  
51 - },  
52 - attached() {  
53 -  
54 - },  
55 - detached() {  
56 -  
57 - },  
58 - /**  
59 - * 组件的方法列表  
60 - */  
61 - methods: {  
62 - init() {  
63 - if (this.data.detail && this.data.detail.ddate) {  
64 - let masterMan = (this.data.detail.rname || '');  
65 - if (this.data.detail.phone) {  
66 - masterMan += ' (' +  
67 - this.data.detail.phone  
68 - .replace(/([\d]{2}).*([\d]{4})/, function ($0, $1, $2) {  
69 - return $1 + '*' + $2  
70 - })  
71 - + ')';  
72 - }  
73 - let tableSubInfo = ''  
74 - let tableFirst = '';  
75 - if (this.data.detail.tableFirst) {  
76 - tableSubInfo = (this.data.detail.tableFirst || '') + ' ' + (this.data.detail.tableSubInfo || '');  
77 - tableFirst = this.data.detail.tableFirst  
78 - } else if(this.data.detail.tables && this.data.detail.tables.length>0) {  
79 - tableFirst = this.data.detail.tables[0].name  
80 - tableSubInfo = this.data.detail.tables[0].name;  
81 - if (this.data.detail.tables.length > 1) {  
82 - tableSubInfo += ' 等' + (this.data.detail.tables.length) + '个'  
83 - + (this.data.detail.tables[0].tid == 2 ? '包间' : '');  
84 - tableFirst += '等';  
85 - }  
86 - }  
87 -  
88 - let obj = {  
89 - rdateStr: util.unixtoTime(this.data.detail.ddate, 'MM月DD日 HH:II'),  
90 - tableSubInfo: tableSubInfo,  
91 - tableFirst: tableFirst,  
92 - masterMan: masterMan,  
93 - }  
94 - if (this.data.hasShowStatus) {  
95 - obj.showStatusStr = RS.reserve(this.data.detail).getStatusStr;  
96 - }  
97 - this.setData(obj)  
98 - }  
99 - },  
100 - lookLocation: function () {  
101 - //console.log(this.data.seller.lat,this.data.seller.long,this.data.detail.map_address)  
102 - wx.openLocation({  
103 - latitude: Number(this.data.seller.lat),  
104 - longitude: Number(this.data.seller.long),  
105 - scale: 17,  
106 - address: this.data.seller.map_address,  
107 - success: function (res) {  
108 - console.log(res)  
109 - }  
110 - })  
111 - },  
112 - tapEvent(){  
113 - this.triggerEvent('event',{  
114 - act:'gotoDetail',  
115 - detail:this.data.detail,  
116 - })  
117 - },  
118 - }  
119 -})  
1 -{  
2 - "component": true,  
3 - "usingComponents": {  
4 - "formids": "/components/formids/formids"  
5 - }  
6 -}  
1 -<!--components/seller-card/seller-card.wxml-->  
2 -<wxs src="../../utils/util.wxs" module="util" />  
3 -<view class="card {{hasOnlineReserve?'online':''}}">  
4 - <formids url="{{hasOnlineReserve?'':('/pages/reserve/detail?id='+seller.id)}}" catchtap="">  
5 - <view class="seller flex-lr">  
6 - <view class="flex-ll" style="max-width: {{hasShowStatus?'80%':'94%'}};">  
7 - <view class="avatar" wx:if="{{seller.seller_image}}">  
8 - <image src="{{seller.seller_image}}"></image>  
9 - </view>  
10 - <view class="card-class name Medium">{{seller.sellername}}</view>  
11 - </view>  
12 - <view wx:if="{{hasShowStatus}}" style="font-size: 30rpx;">  
13 - {{showStatusStr}}  
14 - </view>  
15 - <view class="more" wx:else="">  
16 - <image src="http://nosqn.colorcun.com/custom/lite-yd/image/click.png"></image>  
17 - </view>  
18 - </view>  
19 - </formids>  
20 - <formids bindclick="tapEvent">  
21 - <view class="context flex-lr">  
22 - <view class="left info Medium">  
23 - <view class="label">时间</view>  
24 - <view class="value" wx:if="{{hasOnlineReserve || detail.hasUpdateDate}}">  
25 - <text wx:if="{{detail.ddate>0}}">{{util.unixtoTime(detail.ddate||'','MM月DD日')}} {{util.reserveTimeSpace(detail.ddate_solt||detail.section)}}</text>  
26 - </view>  
27 - <view class="value" wx:else="">{{detail.rdateStr}}</view>  
28 - </view>  
29 - <view class="line"></view>  
30 - <view class="right info Medium" wx:if="{{(detail.type==1 && (detail.status==4 || detail.status==0)) || hasOnlineReserve || detail.status==0 || detail.status==6}}">  
31 - <view class="label">包间</view>  
32 - <view class="value">{{util.getRoomName(detail.room_demand)}}</view>  
33 - </view>  
34 - <view class="right info Medium" wx:else="">  
35 - <view class="label">包间{{detail.tables.length>1?(" ("+detail.tables.length+"个)"):""}}</view>  
36 - <view class="value">{{tableFirst}}</view>  
37 - </view>  
38 - </view>  
39 - </formids>  
40 - <view class="seller address flex-ll" catchtap="lookLocation" wx:if="{{hasAddress}}">  
41 - <view class="gps-icon">  
42 - <image src="http://nosqn.colorcun.com/custom/lite-yd/image/gps-icon.png"></image>  
43 - </view>  
44 - <view class="address-txt">  
45 - {{seller.map_address}}  
46 - </view>  
47 - </view>  
48 - <view class="seller master flex-lr" wx:if="{{hasMaster}}">  
49 - <view class="master-label">  
50 - 预订人  
51 - </view>  
52 - <view class="master-man">  
53 - {{masterMan}}  
54 - </view>  
55 - </view>  
56 - <view class="seller master flex-lr" wx:if="{{hasListShare}}">  
57 - <view class="flex-ll">  
58 - <view class="master-label">  
59 - 预订人  
60 - </view>  
61 - <view class="master-man" style="margin-left: 20rpx;">{{detail.rname}}</view>  
62 - </view>  
63 - <view class="master-man">  
64 - <slot name="listshare"></slot>  
65 - </view>  
66 - </view>  
67 - <view>  
68 - <slot name="opt"></slot>  
69 - </view>  
70 -</view>  
1 -/* components/seller-card/seller-card.wxss */  
2 -@import "../../app.wxss";  
3 -.card{  
4 - border-radius: 10rpx;  
5 - box-shadow: 2rpx 2rpx 14rpx 6rpx rgba(231,228,228,.5);  
6 -}  
7 -.seller{  
8 - padding: 36rpx;  
9 - height: 50rpx;  
10 - line-height: 50rpx;  
11 -}  
12 -.seller .avatar{  
13 - width: 60rpx;  
14 - height: 60rpx;  
15 - min-width: 60rpx;  
16 - border-radius: 50%;  
17 - margin-right: 20rpx;  
18 - overflow: hidden;  
19 -}  
20 -.seller .more{  
21 - width: 14rpx;  
22 - height: 26rpx;  
23 - min-width: 14rpx;  
24 -  
25 -}  
26 -.seller image{  
27 - width: 100%;  
28 - height: 100%;  
29 - display: inherit;  
30 -}  
31 -.seller .name{  
32 - font-size: 36rpx;  
33 - color:#AD7644;  
34 - overflow: hidden;  
35 - text-overflow:ellipsis;  
36 - white-space:nowrap;  
37 -}  
38 -.context{  
39 - background-color: #E6EBEE;  
40 - width: 100%;  
41 - padding: 30rpx 0;  
42 - height: 160rpx;  
43 -}  
44 -.context .left,.context .right{  
45 - width: 49%;  
46 - min-width: 49%;  
47 -}  
48 -.context .line{  
49 - width: 2rpx;  
50 - background-color: #D8D6D6;  
51 - height: 160rpx;  
52 - color: #353535;  
53 -}  
54 -.info {  
55 - text-indent: 40rpx;  
56 - text-align: left;  
57 -}  
58 -.info .label{  
59 - font-size: 26rpx;  
60 - height: 36rpx;  
61 - line-height: 36rpx;  
62 -}  
63 -.info .value{  
64 - font-size: 36rpx;  
65 - height: 50rpx;  
66 - line-height: 50rpx;  
67 - margin-top: 6rpx;  
68 - font-weight: bold;  
69 - white-space:nowrap;  
70 - overflow: hidden;  
71 - text-overflow:ellipsis;  
72 -}  
73 -.address{  
74 - font-size: 30rpx;  
75 - color: #999999;  
76 - line-height: 70rpx;  
77 - height: 70rpx;  
78 -}  
79 -.gps-icon{  
80 - width: 28rpx;  
81 - height: 34rpx;  
82 - min-width: 28rpx;  
83 - margin-right: 20rpx;  
84 -}  
85 -.address-txt{  
86 - line-height: 40rpx;  
87 - overflow: hidden;  
88 - text-overflow:ellipsis;  
89 - white-space:nowrap;  
90 -}  
91 -  
92 -.master{  
93 - padding-top: 0;  
94 -}  
95 -.master-label{  
96 - font-size: 20rpx;  
97 - background-color: #C8B16D;  
98 - line-height: 30rpx;  
99 - height: 30rpx;  
100 - width: 70rpx;  
101 - padding: 5rpx 10rpx;  
102 - text-align: center;  
103 - color:#FEFEFE;  
104 -}  
105 -.master-man{  
106 - font-size: 26rpx;  
107 -}  
108 -.opt{  
109 - padding-top: 0;  
110 -}  
111 -  
112 -.online .seller .name{  
113 - color: #353535;  
114 -}  
115 -.online .context{  
116 - background-color: #F5F5F5;  
117 -}  
118 -.online .context .line{  
119 - background-color: #ECEBEB;  
120 -}  
1 -// components/showModal/showModal.js  
2 -import util from '../../utils/util'  
3 -const properties={  
4 - cancelText:{type:String,value:''},  
5 - cancelColor:{type:String,value:'#000'},  
6 - confirmText:{type:String,value:'确认'},  
7 - confirmColor:{type:String,value:'#393'},  
8 - header:{type:String,value:'确认信息'},  
9 - body:{type:String,value:'确认信息'},  
10 -};  
11 -Component({  
12 - /**  
13 - * 组件的属性列表  
14 - */  
15 - properties: properties,  
16 -  
17 - /**  
18 - * 组件的初始数据  
19 - */  
20 - data: {  
21 - hasShow:false,  
22 - },  
23 - attached(){  
24 - let opt={};  
25 - Object.keys(properties).forEach((k)=>{  
26 - opt[k]=this.data[k]  
27 - })  
28 - this.setData({  
29 - opt:opt  
30 - })  
31 - },  
32 - /**  
33 - * 组件的方法列表  
34 - */  
35 - methods: {  
36 - options(obj){  
37 - let opt=this.data.opt;  
38 - this.setData({  
39 - opt:{  
40 - ...opt,  
41 - ...obj  
42 - }  
43 - })  
44 - return this;  
45 - },  
46 - show(){  
47 - console.log(this.data.opt)  
48 - this.setData({  
49 - hasShow:true,  
50 - })  
51 - },  
52 - tapButton(e){  
53 - this.triggerEvent('showModal',{type:util.attr(e,'type')})  
54 - this.hide();  
55 - },  
56 - hide(){  
57 - this.setData({  
58 - hasShow:false,  
59 - })  
60 - }  
61 - }  
62 -})  
1 -{  
2 - "component": true,  
3 - "usingComponents": {}  
4 -}  
1 -<!--components/showModal/showModal.wxml-->  
2 -<view class="mask flex-vc" hidden="{{!hasShow}}">  
3 - <view class="showModal">  
4 - <view class="header">  
5 - {{opt.header}}  
6 - </view>  
7 - <view class="body">{{opt.body}}</view>  
8 - </view>  
9 - <view class="footer flex-cc">  
10 - <button class="button-none cancel" plain wx:if="{{opt.cancelText}}"  
11 - bindtap="tapButton" data-type="cancel"  
12 - style="color:{{opt.cancelColor}};">{{opt.cancelText}}</button>  
13 - <button class="button-none" plain  
14 - bindtap="tapButton" data-type="confirm"  
15 - style="color:{{opt.confirmColor}};">{{opt.confirmText}}</button>  
16 - </view>  
17 -</view>  
1 -/* components/showModal/showModal.wxss */  
2 -@import "../../app.wxss";  
3 -.mask{  
4 - position: fixed;  
5 - width: 100%;  
6 - height: 100%;  
7 - background-color: rgba(0,0,0,.5);  
8 - top:0;  
9 - left: 0;  
10 -}  
11 -.showModal{  
12 - width: 80%;  
13 - background-color: #fff;  
14 - padding: 20rpx 5% 0 5%;  
15 -}  
16 -.showModal .header{  
17 - font-size: 40rpx;  
18 - line-height: 120rpx;  
19 - height: 120rpx;  
20 -}  
21 -.showModal .body{  
22 - font-size: 30rpx;  
23 - margin-bottom: 30rpx;  
24 -}  
25 -.footer{  
26 - border-top: 2rpx solid #ccc;  
27 - background-color: #fff;  
28 - width: 90%;  
29 -}  
30 -.footer .button-none{  
31 - line-height: 120rpx;  
32 - height: 120rpx;  
33 - border-width: 0;  
34 -}  
35 -.footer .button-none.cancel{  
36 - border-right: 2rpx solid #ccc !important;  
37 -}  
1 -// components/stat/stat.js  
2 -Component({  
3 - /**  
4 - * 组件的属性列表  
5 - */  
6 - properties: {  
7 - stat: {  
8 - type: String,  
9 - value:"4.5",  
10 - },  
11 - color:{  
12 - type:String,  
13 - value:'',  
14 - },  
15 - hasShowText:{  
16 - type:Boolean,  
17 - value:true,  
18 - }  
19 - }  
20 - ,  
21 -  
22 - /**  
23 - * 组件的初始数据  
24 - */  
25 - data: {  
26 - statnum:90.21  
27 - },  
28 - observers: {  
29 - 'stat': function (stat) {  
30 - console.log('stat...',stat)  
31 - stat=parseFloat(stat)  
32 - let statnum=0;  
33 - statnum=(stat/5)  
34 - let px=(parseInt(stat)-1)*0.00070 //(5/(84*84))  
35 - statnum=(statnum+px)*100  
36 - this.setData({  
37 - statnum:statnum,  
38 - })  
39 - }  
40 - },  
41 - /**  
42 - * 组件的方法列表  
43 - */  
44 - methods: {}  
45 -})  
1 -{  
2 - "component": true,  
3 - "usingComponents": {}  
4 -}  
1 -<!--components/stat/stat.wxml-->  
2 -<view class="flex-ll">  
3 - <view class="stat">  
4 - <view class="bg" style="background-color: {{color}};width: {{statnum}}%"></view>  
5 - <image src="http://nosqn.colorcun.com/custom/lite-online/image/%E9%95%82%E7%A9%BA%E6%98%9F%E6%98%9F.png"></image>  
6 - </view>  
7 - <view class="stat-text" wx:if="{{hasShowText}}">{{stat}} 分</view>  
8 -</view>  
1 -/* components/stat/stat.wxss */  
2 -@import "../../app.wxss";  
3 -.stat{  
4 - width: 168rpx;  
5 - height: 30rpx;  
6 - position: relative;  
7 - background-color: #E0E0E0;  
8 - overflow: hidden;  
9 -}  
10 -.stat .bg{  
11 - position: absolute;  
12 - left: 2rpx;  
13 - width: 80%;  
14 - top:2rpx;  
15 - height: 98%;  
16 - background-color: #F05522;  
17 - z-index: 1;  
18 -}  
19 -.stat image{  
20 - width: 100%;  
21 - height: 100%;  
22 - position: absolute;  
23 - left: 0;  
24 - top:0;  
25 - z-index: 2;  
26 -}  
27 -.stat-text{  
28 - margin-left: 10rpx;  
29 -}  
1 -// component/zyslider/zyslider.js  
2 -var util = require('../../utils/util')  
3 -Component({  
4 - /**  
5 - * 组件的属性列表  
6 - */  
7 - properties: {  
8 - /** slider 最小值 */  
9 - cla:String,//额外样式名称  
10 - min: {  
11 - type: Number  
12 - },  
13 - /** slider 最大值 */  
14 - max: {  
15 - type: Number  
16 - },  
17 - /** 步进 (没做,有时间再说,项目里没用到撒) */  
18 - step: {  
19 - type: Number  
20 - },  
21 - /** 预选选择的小值*/  
22 - minValue: {  
23 - type: Number  
24 - },  
25 - /** 预选选择的大值 */  
26 - maxValue: {  
27 - type: Number  
28 - },  
29 - /** 滑块颜色 */  
30 - blockColor:{  
31 - type: String  
32 - },  
33 - /** 未选择进度条颜色 */  
34 - backgroundColor:{  
35 - type: String  
36 - },  
37 - /** 已选择进度条颜色 */  
38 - selectedColor:{  
39 - type: String  
40 - }  
41 - },  
42 -  
43 -  
44 - /**  
45 - * 组件的初始数据  
46 - */  
47 - data: {  
48 - min: 0,  
49 - max: 300,  
50 - leftValue: 0,  
51 - rightValue: 300,  
52 - totalLength: 0,  
53 - bigLength: 0,  
54 - ratio: 0.5,  
55 - sliderLength: 30,  
56 - containerLeft: 0, //标识整个组件,距离屏幕左边的距离  
57 - hideOption: '', //初始状态为显示组件  
58 - },  
59 -  
60 - /**  
61 - * 组件的方法列表  
62 - */  
63 - methods: {  
64 -  
65 - /**  
66 - * 设置左边滑块的值  
67 - */  
68 - _propertyLeftValueChange: function () {  
69 -  
70 - let minValue = this.data.minValue / this.data.max * this.data.bigLength  
71 - let min = this.data.min / this.data.max * this.data.bigLength  
72 - this.setData({  
73 - leftValue: minValue - min  
74 - })  
75 - },  
76 -  
77 - /**  
78 - * 设置右边滑块的值  
79 - */  
80 - _propertyRightValueChange: function () {  
81 - let right = this.data.maxValue / this.data.max * this.data.bigLength + this.data.sliderLength  
82 - this.setData({  
83 - rightValue: right  
84 - })  
85 - },  
86 -  
87 - /**  
88 - * 滑块滑动  
89 - * @param e  
90 - */  
91 - sliderMove(e){  
92 - this.sliderEvent=e  
93 - //console.log('sliderMove.changing',this.sliderMoving)  
94 - if(this.sliderMoving) return;//移动中  
95 - setTimeout(()=>{  
96 - let type=util.attr(this.sliderEvent,'type')  
97 - let pos=this.sliderEvent.changedTouches[0].pageX  
98 - let pagex = pos / this.data.ratio - this.data.containerLeft - this.data.sliderLength / 2  
99 - //console.log('changing',this.sliderEvent.changedTouches[0].pageX,pos);  
100 - let myEventDetail={}  
101 - if(type=='max'){  
102 - if (pagex <= (this.data.leftValue + this.data.sliderLength)) {  
103 - pagex = (this.data.leftValue + this.data.sliderLength)  
104 - } else if (pagex >= (this.data.totalLength - this.data.sliderLength)) {  
105 - pagex = (this.data.totalLength - this.data.sliderLength)  
106 - }  
107 - this.setData({  
108 - rightValue: pagex  
109 - })  
110 - pagex = pagex - this.data.sliderLength  
111 - let heighValue = parseInt(pagex / this.data.bigLength * (this.data.max - this.data.min) + this.data.min)  
112 -  
113 - myEventDetail = { type:'max',value: this.setStepValue(heighValue) }  
114 - }else{  
115 - if (pagex + this.data.sliderLength >= this.data.rightValue) {  
116 - pagex = this.data.rightValue - this.data.sliderLength  
117 - } else if (pagex <= 0) {  
118 - pagex = 0  
119 - }  
120 - this.setData({  
121 - leftValue: pagex  
122 - })  
123 - let lowValue = parseInt(pagex / this.data.bigLength * parseInt(this.data.max - this.data.min) + this.data.min)  
124 - myEventDetail = { type:'min',value: this.setStepValue(lowValue) }  
125 - }  
126 - //console.log('event',myEventDetail);  
127 - this.triggerEvent('event', myEventDetail)  
128 - this.sliderMoving=false  
129 - },0)  
130 - this.sliderMoving=true  
131 - },  
132 - setStepValue(val) {  
133 - let step = this.data.step || 1;  
134 - if (step == 1) return val;  
135 - let yus=val%step,sha=parseInt(val/step)  
136 - if(yus>step/2){  
137 - sha+=1;  
138 - }  
139 - return sha*step;  
140 - },  
141 - /**  
142 - * 隐藏组件  
143 - */  
144 - hide: function () {  
145 - this.setData({  
146 - hideOption: 'hide',  
147 - })  
148 - },  
149 - /**  
150 - * 显示组件  
151 - */  
152 - show: function () {  
153 - this.setData({  
154 - hideOption: '',  
155 - })  
156 - },  
157 - /**  
158 - * 重置  
159 - */  
160 - reset: function () {  
161 - this.setData({  
162 - rightValue: this.data.totalLength,  
163 - leftValue: 0,  
164 - })  
165 - },  
166 - changeVal(min,max) {  
167 - this.setData({  
168 - minValue: parseInt(min),  
169 - maxValue: parseInt(max),  
170 - })  
171 - this._propertyLeftValueChange()  
172 - this._propertyRightValueChange()  
173 - this.triggerEvent('event', { type:'once',min:min,max:max})  
174 - },  
175 - },  
176 -  
177 - ready: function () {  
178 - let that = this;  
179 - const getSystemInfo = util.wxPromisify(wx.getSystemInfo)  
180 - const queryContainer = util.wxPromisify(wx.createSelectorQuery().in(this).select(".container").boundingClientRect)  
181 - util.wxPromisify(wx.getSystemInfo)()  
182 - .then(res => {  
183 - let ratio = res.windowWidth / 750  
184 - that.setData({  
185 - ratio: ratio,  
186 - })  
187 - })  
188 - .then(() => {  
189 - var query = wx.createSelectorQuery().in(this)  
190 - query.select(".container").boundingClientRect(function (res) {  
191 - that.setData({  
192 - totalLength: res.width / that.data.ratio - that.data.sliderLength,  
193 - bigLength: res.width / that.data.ratio - that.data.sliderLength * 3,  
194 - rightValue: res.width / that.data.ratio - that.data.sliderLength,  
195 - containerLeft: res.left / that.data.ratio  
196 - })  
197 -  
198 - /**  
199 - * 设置初始滑块位置  
200 - */  
201 - that._propertyLeftValueChange()  
202 - that._propertyRightValueChange()  
203 - }).exec()  
204 - })  
205 - }  
206 -})  
1 -{  
2 - "component": true,  
3 - "usingComponents": {}  
4 -}  
1 -<!--component/zyslider.wxml-->  
2 -<slot></slot>  
3 -<view class="container {{cla}} {{hideOption}}">  
4 - <view class="slider-item min" style="left:{{leftValue}}rpx;background-color:{{blockColor}};" catchtouchmove="sliderMove" data-type="min"></view>  
5 - <view class="slider-item max" style="left:{{rightValue}}rpx;background-color:{{blockColor}};" catchtouchmove="sliderMove" data-type="max"></view>  
6 -  
7 - <view class="slider-body left" style="left:{{sliderLength}}rpx; width:{{leftValue}}rpx;background-color:{{backgroundColor}};"></view>  
8 - <view class="slider-body body" style="left:{{leftValue}}rpx; width:{{rightValue-leftValue}}rpx;background-color:{{selectedColor}};"></view>  
9 - <view class="slider-body right" style="left:{{rightValue}}rpx; width:{{totalLength - rightValue}}rpx;background-color:{{backgroundColor}};"></view>  
10 -</view>  
1 -/* component/zyslider.wxss */  
2 -.container {  
3 - /*height: 100%;*/  
4 - width: 100%;  
5 - position: relative;  
6 -}  
7 -  
8 -.slider-body {  
9 - height: 6rpx;  
10 - background: #D8D8D8;  
11 - border-radius: 3rpx;  
12 - position: relative;  
13 -}  
14 -  
15 -.body {  
16 - bottom: 60rpx;  
17 - height: 6rpx;  
18 - background: #E9BE94;  
19 - border-radius: 3rpx;  
20 - z-index: 0.3;  
21 -}  
22 -  
23 -.left {  
24 - bottom: 60rpx;  
25 - z-index: 0.1;  
26 -}  
27 -  
28 -.right {  
29 - z-index: 0.2;  
30 - bottom: 64rpx;  
31 -}  
32 -  
33 -.slider-item {  
34 - width: 60rpx;  
35 - height: 60rpx;  
36 - background: #FFFFFF;  
37 - box-shadow: 0px 4rpx 8rpx 0rpx #E6F3FF;  
38 - border: 2rpx solid #E6F3FF;  
39 - border-radius: 50%;  
40 - z-index: 2;  
41 -}  
42 -.slider20 .slider-item{  
43 - box-shadow: 0px 4prx 8rpx 0rpx #E6F3FF;  
44 - border: 2rpx solid #E6F3FF;  
45 -}  
46 -  
47 -.min {  
48 - position: relative;  
49 - top: 40rpx;  
50 - /*left: 100rpx;*/  
51 -}  
52 -  
53 -.max {  
54 - position: relative;  
55 - bottom: 22rpx;  
56 - /*left: 600rpx;*/  
57 -}  
58 -.hide{  
59 - display: none;  
60 -}  
1 -// components/tips/add-to-lite.js  
2 -import util from '../../utils/util'  
3 -const cache_key='A2L-'  
4 -Component({  
5 - /**  
6 - * 组件的属性列表  
7 - */  
8 - properties: {  
9 - bgColor:{  
10 - type:String,  
11 - value:'rgba(0,0,0,0.6)',  
12 - },  
13 - key:String,  
14 - type:{  
15 - type:String,  
16 - value:'yellow',  
17 - },  
18 - hitStr:String,  
19 - },  
20 -  
21 - /**  
22 - * 组件的初始数据  
23 - */  
24 - data: {  
25 - hidden:true,  
26 - statusBarHeightFull:0,  
27 - },  
28 - attached(){  
29 - let cacheKey=cache_key+this.data.key  
30 - let ca=util.cache(cacheKey);  
31 - if(ca){  
32 - this.hide();  
33 - }else{  
34 - let p=getCurrentPages()  
35 - console.log('add-to-lite.attached',p)  
36 - if(p.length==1){  
37 - this.show();  
38 - }  
39 - }  
40 -  
41 - },  
42 - /**  
43 - * 组件的方法列表  
44 - */  
45 - methods: {  
46 - show(){  
47 - this.triggerEvent("show");  
48 - //导航栏自适应  
49 - if(this.data.type=='black20'){  
50 - let systemInfo = wx.getSystemInfoSync();  
51 - let reg = /ios/i;  
52 - let pt = 20;//导航状态栏上内边距  
53 - let h = 44;//导航状态栏高度  
54 - if(reg.test(systemInfo.system)){  
55 - pt = systemInfo.statusBarHeight;  
56 - h = 44;  
57 - }else{  
58 - pt = systemInfo.statusBarHeight;  
59 - h = 48;  
60 - }  
61 - this.setData({  
62 - hidden:false,  
63 - statusBarHeightFull:(pt+h-5),  
64 - })  
65 - }else{  
66 - this.setData({  
67 - hidden:false,  
68 - statusBarHeightFull:0,  
69 - })  
70 - }  
71 - if(!this.timeInterval){  
72 - this.timeIntervalNum=0;  
73 - this.timeInterval=setInterval(()=>{  
74 - this.hasClose();  
75 - },1000)  
76 - }  
77 - },  
78 - hasClose(){  
79 - if(this.timeIntervalNum>=10){  
80 - this.hide();  
81 - clearInterval(this.timeInterval);  
82 - return;  
83 - }  
84 - this.timeIntervalNum++;  
85 - },  
86 - hide(){  
87 - this.triggerEvent("hide");  
88 - let cacheKey=cache_key+this.data.key  
89 - util.cache(cacheKey,cacheKey);  
90 - this.setData({  
91 - hidden:true,  
92 - })  
93 - },  
94 - }  
95 -})  
1 -{  
2 - "component": true,  
3 - "usingComponents": {}  
4 -}  
1 -<!--components/tips/add-to-lite.wxml-->  
2 -<view class="tip {{type}}" style="top:{{statusBarHeightFull}}px;" bindtap="hide" hidden="{{hidden}}">  
3 - <view class="jian"></view>  
4 - <view class="content flex-lr" bindtap="hide">  
5 - <view class="flex-vc" wx:if="{{type=='black20'}}">  
6 - <view class="flex-ll text title">  
7 - 点击  
8 - <view class="more"></view>  
9 - 添加到我的小程序  
10 - </view>  
11 - <view class="text">微信下拉即可快速订包间</view>  
12 - </view>  
13 - <view class="flex-ll" wx:else="">  
14 - <view class="flex-ll text">  
15 - 点击  
16 - <view class="more"></view>  
17 - 添加到我的小程序,微信下拉即可快速  
18 - <view class="Semibold">{{hitStr||'查空房'}}</view>  
19 - </view>  
20 - </view>  
21 - <view class="close"></view>  
22 - </view>  
23 -</view>  
24 -  
25 -  
1 -/* components/tips/add-to-lite.wxss */  
2 -@import "../../app.wxss";  
3 -.tip{  
4 - position:relative;  
5 -}  
6 -.tip .content{  
7 - height:88rpx;  
8 - line-height: 88rpx;  
9 - box-sizing: border-box;  
10 - padding: 0 20rpx 0;  
11 -}  
12 -.tip .text{  
13 - line-height:28rpx;  
14 - height: 28rpx;  
15 - width: 100%;  
16 - text-align: left;  
17 -}  
18 -.tip .more{  
19 - width: 32rpx;  
20 - height: 10rpx;  
21 - background-size: 100% 100%;  
22 - margin: 0 10rpx 0;  
23 - min-width: 32rpx;  
24 -}  
25 -.tip .close{  
26 - width: 20rpx;  
27 - height: 20rpx;  
28 - background-size: 100% 100%;  
29 - min-width: 20rpx;  
30 -}  
31 -.tip .jian{  
32 - background-size: 100% 100%;  
33 - width: 32rpx;  
34 - height: 36rpx;  
35 - margin-left: 200rpx;  
36 -}  
37 -  
38 -.tip.yellow{  
39 - width:334rpx;  
40 - right: 40rpx;  
41 - font-size:20rpx;  
42 - font-weight:500;  
43 - position: fixed;  
44 - z-index: 99;  
45 -}  
46 -.tip.yellow .content{  
47 - height:100rpx;  
48 - line-height: 100rpx;  
49 - background:rgba(236,217,183,1);  
50 - border-radius:10rpx;  
51 - color:rgba(121,79,40,1);  
52 -}  
53 -.tip.yellow .more{  
54 - background-image: url("http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911181208295.png");  
55 -}  
56 -.tip.yellow .close{  
57 - background-image: url("http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20191118120829.png");  
58 -}  
59 -.tip.yellow .jian{  
60 - background-image: url("http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911181208293.png");  
61 -}  
62 -  
63 -.tip.black{  
64 - background-color: rgba(245,245,245,1);  
65 - height: 95rpx;  
66 - padding-top: 6rpx;  
67 -}  
68 -.tip.black .content{  
69 - background-color: #ffffff;  
70 - width: 100%;  
71 - height: 88rpx;  
72 - line-height: 88rpx;  
73 - font-size:24rpx;  
74 - font-weight:500;  
75 - color:rgba(53,53,53,1);  
76 - padding-left:50rpx;  
77 - padding-right:50rpx;  
78 -}  
79 -.tip.black .jian{  
80 - position: absolute;  
81 - top:-14rpx;  
82 - right:150rpx;  
83 - margin-left: 0;  
84 - z-index: 9999;  
85 - background-image: url("http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911181208292.png");  
86 -}  
87 -.tip.black .close{  
88 - background-image: url("http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911181208291.png");  
89 -}  
90 -.tip.black .more{  
91 - background-image: url("http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911181208294.png");  
92 -}  
93 -  
94 -.tip.black20{  
95 - width: 436rpx;  
96 - right: 20rpx;  
97 - font-size:20rpx;  
98 - font-weight:500;  
99 - position: fixed;  
100 - z-index: 99;  
101 -}  
102 -.tip.black20 .content{  
103 - height:114rpx;  
104 - line-height: 100rpx;  
105 - background:rgba(0,0,0,0.7);  
106 - border-radius:20rpx;  
107 - color:#FFFFFF;  
108 -}  
109 -.tip.black20 .more{  
110 - background-image: url("http://nosqn.colorcun.com/2.0/home%20%282%29.png");  
111 - width: 32rpx;  
112 - height: 12rpx;  
113 -}  
114 -.tip.black20 .close{  
115 - background-image: url("http://nosqn.colorcun.com/2.0/home%20%283%29.png");  
116 - width: 20rpx;  
117 - height: 20rpx;  
118 -}  
119 -.tip.black20 .jian{  
120 - background-image: url("http://nosqn.colorcun.com/2.0/home%20%281%29.png");  
121 - width: 72rpx;  
122 - height: 54rpx;  
123 - margin-left: 230rpx;  
124 -}  
125 -.tip.black20 .text{  
126 - height: 32rpx;  
127 - font-size: 22rpx;  
128 - font-family: PingFangSC-Regular, PingFang SC;  
129 - font-weight: 400;  
130 - color: #FFFFFF;  
131 - line-height: 32rpx;  
132 -}  
133 -.tip.black20 .title{  
134 - height: 36rpx;  
135 - font-size: 26rpx;  
136 - font-family: PingFangSC-Semibold, PingFang SC;  
137 - font-weight: 600;  
138 - color: #FFFFFF;  
139 - line-height: 36rpx;  
140 - margin-bottom: 6rpx;  
141 -}  
1 -// components/tips/boost.js  
2 -const cacheKey='A2L-INDEX'  
3 -Component({  
4 - /**  
5 - * 组件的属性列表  
6 - */  
7 - properties: {  
8 -  
9 - },  
10 - lifetimes: {  
11 - attached: function() {  
12 - this.show()  
13 - },  
14 - },  
15 - /**  
16 - * 组件的初始数据  
17 - */  
18 - data: {  
19 - disp:false,  
20 - animation:'',  
21 - background:[{  
22 - url:'http://nosqn.colorcun.com/boots/1.png',  
23 - txt:'1.戳选地图上的商家,开始预订',  
24 - },{  
25 - url:'http://nosqn.colorcun.com/boots/3.png',  
26 - txt:'2.搜索商家或位置,开始预订',  
27 - }],  
28 - },  
29 -  
30 - /**  
31 - * 组件的方法列表  
32 - */  
33 - methods: {  
34 - show(){  
35 - wx.getStorage({  
36 - key:cacheKey,  
37 - fail:()=>{  
38 - this.setData({  
39 - disp:true,  
40 - })  
41 - setTimeout(()=>{  
42 - this.setData({  
43 - animation:'discountShow',  
44 - })  
45 - },300)  
46 - this.triggerEvent('event',{act:'show',txt:'新用户'})  
47 - //wx.setStorage({key:cacheKey, data:new Date().toISOString()})  
48 - },  
49 - success:()=>{  
50 - this.triggerEvent('event',{act:'hide',txt:'老用户'})  
51 - },  
52 - })  
53 - },  
54 - hide(){  
55 - this.setData({  
56 - animation:'discountHide',  
57 - })  
58 - this.triggerEvent('event',{act:'hide',txt:'新用户'})  
59 - setTimeout(()=>{  
60 - this.setData({  
61 - disp:false,  
62 - })  
63 - },300)  
64 - },  
65 - hasGoto:false,  
66 - bindtransition(e){  
67 - console.log(e)  
68 - if('change'==e.type){  
69 - this.hasGoto=false  
70 - }  
71 - if('animationfinish'==e.type){  
72 - if(this.hasGoto && (e.detail.current+1)==2){  
73 - this.hide()  
74 - return;  
75 - }else{  
76 - this.hasGoto=true  
77 - }  
78 - }  
79 - },  
80 - }  
81 -})  
1 -{  
2 - "component": true,  
3 - "usingComponents": {}  
4 -}  
1 -<!--components/tips/boost.wxml-->  
2 -<view class="mask" bindtap="hide" wx:if="{{disp}}" style="z-index: 99999">  
3 - <view class="boost {{animation}}" catchtap="catchtap" wx:if="{{animation}}">  
4 - <view class="header flex-lr" bindtap="hide">  
5 - <view> </view>  
6 - <view class="title">操作指引</view>  
7 - <view class="close">  
8 - <view class="close-max" catchtap="hide"></view>  
9 - </view>  
10 - </view>  
11 - <view class="content">  
12 - <swiper indicator-dots  
13 - bindchange="bindtransition" bindanimationfinish="bindtransition"  
14 - style="height:496rpx;">  
15 - <block wx:for="{{background}}" wx:key="*this">  
16 - <swiper-item style="text-align: center">  
17 - <image src="{{item.url}}" class="swiper-image"></image>  
18 - <view class="swiper-txt Medium">{{item.txt}}</view>  
19 - </swiper-item>  
20 - </block>  
21 - </swiper>  
22 - </view>  
23 - </view>  
24 -</view>  
1 -/* components/tips/boost.wxss */  
2 -@import "../../app.wxss";  
3 -@keyframes discountShow  
4 -{  
5 - from {bottom: -738rpx;}  
6 - to {bottom: 0rpx;}  
7 -}  
8 -@keyframes discountHide  
9 -{  
10 - from {bottom: 0rpx;}  
11 - to {bottom: -738rpx;}  
12 -}  
13 -.boost{  
14 - width:100%;  
15 - height:738rpx;  
16 - background:rgba(255,255,255,1);  
17 - border-radius:40rpx 40rpx 0rpx 0rpx;  
18 - padding: 40rpx 42rpx 0;  
19 - box-sizing: border-box;  
20 - position: fixed;  
21 - bottom: 0;  
22 -}  
23 -.boost.discountShow{  
24 - animation: discountShow 0.6s;  
25 -}  
26 -.boost.discountHide{  
27 - animation: discountHide 0.6s;  
28 - bottom: -738rpx;  
29 -}  
30 -.title{  
31 - height:42rpx;  
32 - font-size:30rpx;  
33 - font-family:PingFangSC-Regular,PingFang SC;  
34 - font-weight:400;  
35 - color:rgba(53,53,53,1);  
36 - line-height:42rpx;  
37 -}  
38 -.close{  
39 - width:28rpx;  
40 - height:29rpx;  
41 - background-size: 100% 100%;  
42 - background-image: url("http://nosqn.colorcun.com/sellerbaobao/close.png");  
43 - position: relative;  
44 -}  
45 -.close-max{  
46 - width: 120rpx;  
47 - height: 120rpx;  
48 - position: absolute;  
49 - top:-50rpx;  
50 - left:-50rpx;  
51 -}  
52 -.content{  
53 - margin-top: 80rpx;  
54 -}  
55 -.swiper-image{  
56 - width:468rpx;  
57 - height:290rpx;  
58 -}  
59 -.swiper-txt{  
60 - height:44rpx;  
61 - font-size:32rpx;  
62 - font-family:PingFangSC-Medium,PingFang SC;  
63 - font-weight:500;  
64 - color:rgba(53,53,53,1);  
65 - line-height:44rpx;  
66 - margin-top: 60rpx;  
67 -}