Commit 4122903769e83832e02c3585504e585321b74502

Authored by wangfan
1 parent 6d2687ca

customer

Component({
properties:{
},
data:{
reduceToast:true,
action_title:'',
action_so:'',
icon:true,
imgurl:''
},
methods:{
show:function(title,so,icon,imgurl='',autoclose=0){
console.log('66666',title,so,icon,imgurl,autoclose)
this.setData({
reduceToast:false,
action_title:title,
action_so:so,
icon:icon,
imgurl:imgurl
})
if(autoclose>1000){
let that=this;
setTimeout(function(){
that.close();
},autoclose)
}
},
close:function () {
this.setData({
reduceToast:true
})
}
}
})
\ No newline at end of file
... ...
{
"component": true
}
\ No newline at end of file
... ...
<view class="define-toast-mask" wx:if="{{reduceToast==false}}"></view>
<view class="reduce-toast flex-vc {{reduceToast==false ? 'reduce-toast-active' : ''}}">
<block wx:if="{{icon==true}}">
<icon type="success_no_circle" class="icon-success" color="#fff" size="40"></icon>
</block>
<block wx:else>
<image src="http://qn.colorcun.com/custom/lite/image/{{imgurl}}" class="reminder-image"></image>
</block>
<view class="white smooth fsize16" style="line-height:1.2;margin-top:{{icon==true ? '-10rpx' : '20rpx'}};padding: 0 10px;text-align: center;">{{action_title}}</view>
<view class="white smooth fsize16" style="line-height:1.2;margin-top:10rpx;">{{action_so}}</view>
</view>
<slot></slot>
\ No newline at end of file
... ...
@import '../../app.wxss';
.reduce-toast{
width:310rpx;
max-width: 50%;
height:310rpx;
background:rgba(0,0,0,.8);
position:fixed;
left:0;
right:0;
top:0;
bottom:0;
margin:auto;
padding:30rpx 0;
box-sizing:border-box;
border-radius:15rpx;
transform:scale(0);
opacity:0;
transition:opacity .5s ease-in .1s;
z-index: 99;
color:#fff;
}
.reduce-toast-active{
transform:scale(1);
opacity:1;
}
.reminder-image{
width:40px;
height:40px;
}
.define-toast-mask{
position: fixed;
background: rgba(55,99,100,.2);
width:100%;
height: 100%;
padding-bottom: 100%;
top:0;
left:0;
z-index: 98;
}
\ No newline at end of file
... ...
// components/manager/manager.js
Component({
/**
* 组件的属性列表
*/
properties: {
manager:Object
},
/**
* 组件的初始数据
*/
data: {
hasOpen:false,
},
ready(){
},
/**
* 组件的方法列表
*/
methods: {
makePhoneCall(){
console.log('this.data.manager',this.data.manager);
wx.makePhoneCall({
phoneNumber: this.data.manager.cusman_phone
})
},
setClipboardData(){
console.log('this.data.manager',this.data.manager);
wx.setClipboardData({
data: this.data.manager.cusman_account,
success:(res)=> {
// this.selectComponent('#toast')
// .show('复制成功','去微信添加好友',true,'',2500);
},
fail:(res)=>{
// this.selectComponent('#toast')
// .show('复制失败','请手动添加微信好友',false,'info-toast.png',2500);
}
})
},
close(){
this.setData({
hasOpen:false,
})
},
show(){
this.setData({
hasOpen:true,
})
}
}
})
... ...
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
... ...
<block wx:if="{{hasOpen}}">
<view class="mask" bindtap="close"></view>
<view class="opt flex-vc">
<view bindtap="makePhoneCall" class="item">
<view class="one">
呼叫电话 <text>{{manager.cusman_phone}}</text>
</view>
</view>
<view bindtap="setClipboardData" class="item">
<view class="one">
复制微信 <text>{{manager.cusman_account}}</text>
</view>
</view>
<view bindtap="close" class="item">取 消</view>
</view>
</block>
\ No newline at end of file
... ...
/* components/manager/manager.wxss */
@import '../../app.wxss';
.mask{
position: fixed;
height: 100%;
background-color: rgba(20,20,20,.5);
top:0;
width:100%;
}
.opt{
position: fixed;
bottom: 0;
background: #fff;
width:100%;
}
.opt .item{
width:100%;
line-height: 140rpx;
border-bottom: 2rpx solid #ccc;
text-align: center;
}
.opt .item .one{
width:60%;
text-align: left;
margin: 0 20%;
}
\ No newline at end of file
... ...
... ... @@ -80,6 +80,15 @@ Page({
detail.tableSubInfo='等'+(detail.tables.length)+'个'
+(detail.tables[0].tid==2?'包间':'');
}
if(!detail.cusman){
detail.cusman='vking';
detail.cusman_phone='15877556369';
detail.cusman_account='wx:vking';
}
return detail;
}
},
showManager(){
this.selectComponent('#manager').show();
},
})
\ No newline at end of file
... ...
... ... @@ -3,6 +3,7 @@
"navigationBarTextStyle": "black",
"navigationBarTitleText":"订座详情",
"usingComponents": {
"userinfo": "/components/userinfo/userinfo"
"userinfo": "/components/userinfo/userinfo",
"manager": "/components/manager/manager"
}
}
\ No newline at end of file
... ...
... ... @@ -44,7 +44,7 @@
</view>
<view class="flex-lr" wx:if="{{detail.cusman}}" style="margin-top: 24rpx;">
<view></view>
<view class="detail-info-right">联系客户经理</view>
<view class="detail-info-right" style="text-decoration: underline" bindtap="showManager">联系客户经理</view>
</view>
</view>
<view class="hr" style="margin-top: 56rpx;margin-bottom: 50rpx;"></view>
... ... @@ -63,3 +63,4 @@
</view>
</view>
</view>
<manager manager="{{detail}}" id="manager"></manager>
... ...
/* pages/customer/detail_owner.wxss */
page{
.page{
width: 94%;
margin: 0 3%;
color:#353535;
... ...