Commit 25a2b9d0449c9bd405796b46b91fdde9f319df69

Authored by vking
1 parent 075b711c

new 2.0

... ... @@ -17,24 +17,3 @@
</view>
</view>
</view>
<!--
<view class="mask flex-vc {{cla}}" hidden="{{!hasShow}}">
<view class="showModal">
<view class="header">
{{opt.header}}
</view>
<view class="body">
{{opt.body}}
<slot name="body"></slot>
</view>
<view class="footer flex-cc">
<button class="button-none cancel" plain wx:if="{{opt.cancelText}}"
bindtap="tapButton" data-type="cancel"
style="color:{{opt.cancelColor}};">{{opt.cancelText}}</button>
<button class="button-none confirm bg-brown" plain
bindtap="tapButton" data-type="confirm"
style="color:{{opt.confirmColor}};">{{opt.confirmText}}</button>
</view>
</view>
</view>
-->
... ...
// components/actionSheet/phone.js
import util from '../../../utils/util';
Component({
/**
* 组件的属性列表
*/
properties: {
//items: Array,//电话列表
//seller:Object,//商家信息
hasTip:{
type:Boolean,
value:true,
},
},
/**
* 组件的初始数据
*/
data: {
actionSheetHidden: true,
hasOnlineReserve:false,
},
/**
* 组件的方法列表
*/
methods: {
show(seller){
this.seller=seller
let seller_tel = this.seller.seller_tel;
// if(this.seller.is_online_reserve==1 && this.seller.is_tele==0){
// //开通在线预订,但无商家接单设备,拨打运营电话
// seller_tel = ['400-000-9690']
// }else{
// if (seller_tel.length < 1) {
// seller_tel = [this.seller.phone]
// }
// }
console.log('seller_tel',seller_tel)
if (seller_tel.length < 1) {
seller_tel = [this.seller.phone]
}
this.setData({
actionSheetHidden: false,
items:seller_tel,
hasOnlineReserve:this.seller.is_online_reserve==1
})
},
hide(){
this.setData({
actionSheetHidden: true,
})
},
bindItemTap(e){
this.hide();
let index=util.attr(e,'index')
if(index=='reserve'){//跳转到预订页
let pages=getCurrentPages();
let p=pages[pages.length-1];
if(p.route=='pages/reserve/detail'){
p.setData({
activeTab:'reserve'
})
}else{
let url=util.http_build_query({id:this.seller.id,activeTab:'reserve'},'/pages/reserve/detail')
wx.navigateTo({
url:url,
})
}
return;
}else{
let value=util.attr(e,'value')
wx.makePhoneCall({
phoneNumber: value.replace(/[^\d]/g, '')
})
}
},
actionSheetChange(){
this.hide();
}
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--components/actionSheet/phone.wxml-->
<view class="cu-modal bottom-modal {{!actionSheetHidden?'show':''}}" catchtap="hide">
<view class="cu-dialog bg-white" catchtap="catchtap" style="border-radius: 40rpx 40rpx 0rpx 0rpx">
<view class="view flex flex-direction justify-center align-center padding-lr-xl" >
<block wx:for="{{items}}" wx:key="itemskey">
<view class="view flex justify-center align-center phone-item" style="width: 100%;"
bindtap="bindItemTap" data-value="{{item}}" data-index="{{index}}">
<view class="view p2"></view>
<view class="margin-left-sm margin-tb-lg" style="font-size: 34rpx;">{{item}}</view>
</view>
</block>
<view class="action-sheet-cancel view" bindtap="hide">取消</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
/* components/actionSheet/phone.wxss */
@import "../../../colorui/main.wxss";
.p2{
background-image: url("http://nosqn.colorcun.com/2.0/home%20%2816%29.png");
width: 40rpx;
height: 40rpx;
}
.action-sheet-cancel{
height:80rpx;
background:#F5F5F5;
border-radius:42rpx;
width: 100%;
text-align: center;
font-size:34rpx;
font-weight:400;
color: #666666;
line-height:80rpx;
margin-top: 20rpx;
margin-bottom: 40rpx;
}
.phone-item+.phone-item{
border-top: 2rpx solid #E5E5E5;
}
... ...
// components/2.0/seller/card.js
import util from '../../../utils/util'
Component({
/**
* 组件的属性列表
... ... @@ -27,5 +28,22 @@ Component({
seller:seller,
})
},
reserve(e){
if(this.data.seller.is_online_reserve==1){
let url=util.http_build_query({id:this.data.seller.id,activeTab:'reserve'},'/pages/reserve/detail')
let cid=util.attr(e,'cid')
if(cid){
url=util.http_build_query({
classID:cid,
className:util.attr(e,'cname'),
},url)
}
return wx.navigateTo({
url:url,
})
}else{
this.triggerEvent('event',{type:'phone',seller:this.data.seller})
}
},
}
})
... ...
... ... @@ -31,11 +31,13 @@
<view class="view flex align-center justify-between margin-top-sm reserve-view" catchtap="catchtap">
<view class="view rooms flex-treble flex" style="overflow-x: auto">
<block wx:for="{{seller.class}}" wx:key="seclass">
<view class="cu-tag round line-blue text-blue view">{{item.name}}</view>
<view
bindtap="reserve" data-cid="{{item.id}}" data-cname="{{item.name}}"
class="cu-tag round line-blue text-blue view">{{item.name}}</view>
</block>
<view class="cu-tag round line-white text-blue view cu-tag-end"></view>
</view>
<view class="view button-view flex justify-end">
<view class="view button-view flex justify-end" bindtap="reserve">
<view class="cu-btn bg-blue text-white round reserve-button text-df text-bold view padding-xs">订包间</view>
</view>
</view>
... ...
... ... @@ -292,6 +292,11 @@ Page({
this.filterGroupData=e.detail
this.debounce(this.getSellers,500)
},
sellerCardEvent(e){
if(e.detail.type=='phone'){
this.selectComponent('#as').show(e.detail.seller);
}
},
back:function() {
/*
var mta = require('mta-wechat-analysis')
... ...
... ... @@ -8,6 +8,6 @@
"filter-group":"/components/2.0/filter/filter-group",
"seller-card":"/components/2.0/seller/card",
"chatbot":"/components/userinfo/chatbot",
"as-phone":"/components/actionSheet/phone"
"as-phone":"/components/2.0/dialog/phone"
}
}
\ No newline at end of file
... ...
... ... @@ -60,7 +60,7 @@
<navigator url="/pages/reserve/detail?id={{item.id}}" hover-class="navigator-hover">
<seller-card class="seller-card" id="seller-{{item.id}}"
activeSellerID="{{activeSellerID}}"
seller="{{item}}" ></seller-card>
seller="{{item}}" bindevent="sellerCardEvent" ></seller-card>
</navigator>
</block>
<view class="view" style="height: 192rpx;"></view>
... ... @@ -95,4 +95,5 @@
<as-phone id="as"></as-phone>
<filter id="filter" bindevent="filterEvent"></filter>
-->
<a2l bindshow="a2lshow" bindhide="a2lshow" key="INDEX" type="black20"></a2l>
\ No newline at end of file
<a2l bindshow="a2lshow" bindhide="a2lshow" key="INDEX" type="black20"></a2l>
<as-phone id="as"></as-phone>
\ No newline at end of file
... ...