Commit 4122903769e83832e02c3585504e585321b74502

Authored by wangfan
1 parent 6d2687ca

customer

  1 +Component({
  2 + properties:{
  3 + },
  4 + data:{
  5 + reduceToast:true,
  6 + action_title:'',
  7 + action_so:'',
  8 + icon:true,
  9 + imgurl:''
  10 +
  11 + },
  12 + methods:{
  13 + show:function(title,so,icon,imgurl='',autoclose=0){
  14 + console.log('66666',title,so,icon,imgurl,autoclose)
  15 + this.setData({
  16 + reduceToast:false,
  17 + action_title:title,
  18 + action_so:so,
  19 + icon:icon,
  20 + imgurl:imgurl
  21 + })
  22 + if(autoclose>1000){
  23 + let that=this;
  24 + setTimeout(function(){
  25 + that.close();
  26 + },autoclose)
  27 + }
  28 + },
  29 + close:function () {
  30 + this.setData({
  31 + reduceToast:true
  32 + })
  33 + }
  34 + }
  35 +})
  1 +{
  2 + "component": true
  3 +}
  1 +<view class="define-toast-mask" wx:if="{{reduceToast==false}}"></view>
  2 +<view class="reduce-toast flex-vc {{reduceToast==false ? 'reduce-toast-active' : ''}}">
  3 + <block wx:if="{{icon==true}}">
  4 + <icon type="success_no_circle" class="icon-success" color="#fff" size="40"></icon>
  5 + </block>
  6 + <block wx:else>
  7 + <image src="http://qn.colorcun.com/custom/lite/image/{{imgurl}}" class="reminder-image"></image>
  8 + </block>
  9 + <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>
  10 + <view class="white smooth fsize16" style="line-height:1.2;margin-top:10rpx;">{{action_so}}</view>
  11 +</view>
  12 +<slot></slot>
  1 +@import '../../app.wxss';
  2 +.reduce-toast{
  3 + width:310rpx;
  4 + max-width: 50%;
  5 + height:310rpx;
  6 + background:rgba(0,0,0,.8);
  7 + position:fixed;
  8 + left:0;
  9 + right:0;
  10 + top:0;
  11 + bottom:0;
  12 + margin:auto;
  13 + padding:30rpx 0;
  14 + box-sizing:border-box;
  15 + border-radius:15rpx;
  16 + transform:scale(0);
  17 + opacity:0;
  18 + transition:opacity .5s ease-in .1s;
  19 + z-index: 99;
  20 + color:#fff;
  21 +}
  22 +.reduce-toast-active{
  23 + transform:scale(1);
  24 + opacity:1;
  25 +}
  26 +.reminder-image{
  27 + width:40px;
  28 + height:40px;
  29 +}
  30 +.define-toast-mask{
  31 + position: fixed;
  32 + background: rgba(55,99,100,.2);
  33 + width:100%;
  34 + height: 100%;
  35 + padding-bottom: 100%;
  36 + top:0;
  37 + left:0;
  38 + z-index: 98;
  39 +}
  1 +// components/manager/manager.js
  2 +Component({
  3 + /**
  4 + * 组件的属性列表
  5 + */
  6 + properties: {
  7 + manager:Object
  8 + },
  9 +
  10 + /**
  11 + * 组件的初始数据
  12 + */
  13 + data: {
  14 + hasOpen:false,
  15 + },
  16 + ready(){
  17 +
  18 + },
  19 + /**
  20 + * 组件的方法列表
  21 + */
  22 + methods: {
  23 + makePhoneCall(){
  24 + console.log('this.data.manager',this.data.manager);
  25 + wx.makePhoneCall({
  26 + phoneNumber: this.data.manager.cusman_phone
  27 + })
  28 + },
  29 + setClipboardData(){
  30 + console.log('this.data.manager',this.data.manager);
  31 + wx.setClipboardData({
  32 + data: this.data.manager.cusman_account,
  33 + success:(res)=> {
  34 + // this.selectComponent('#toast')
  35 + // .show('复制成功','去微信添加好友',true,'',2500);
  36 + },
  37 + fail:(res)=>{
  38 + // this.selectComponent('#toast')
  39 + // .show('复制失败','请手动添加微信好友',false,'info-toast.png',2500);
  40 + }
  41 + })
  42 + },
  43 + close(){
  44 + this.setData({
  45 + hasOpen:false,
  46 + })
  47 + },
  48 + show(){
  49 + this.setData({
  50 + hasOpen:true,
  51 + })
  52 + }
  53 + }
  54 +})
  1 +{
  2 + "component": true,
  3 + "usingComponents": {
  4 + }
  5 +}
  1 +<block wx:if="{{hasOpen}}">
  2 + <view class="mask" bindtap="close"></view>
  3 + <view class="opt flex-vc">
  4 + <view bindtap="makePhoneCall" class="item">
  5 + <view class="one">
  6 + 呼叫电话 <text>{{manager.cusman_phone}}</text>
  7 + </view>
  8 + </view>
  9 + <view bindtap="setClipboardData" class="item">
  10 + <view class="one">
  11 + 复制微信 <text>{{manager.cusman_account}}</text>
  12 + </view>
  13 + </view>
  14 + <view bindtap="close" class="item">取 消</view>
  15 + </view>
  16 +</block>
  1 +/* components/manager/manager.wxss */
  2 +@import '../../app.wxss';
  3 +.mask{
  4 + position: fixed;
  5 + height: 100%;
  6 + background-color: rgba(20,20,20,.5);
  7 + top:0;
  8 + width:100%;
  9 +}
  10 +.opt{
  11 + position: fixed;
  12 + bottom: 0;
  13 + background: #fff;
  14 + width:100%;
  15 +}
  16 +.opt .item{
  17 + width:100%;
  18 + line-height: 140rpx;
  19 + border-bottom: 2rpx solid #ccc;
  20 + text-align: center;
  21 +}
  22 +.opt .item .one{
  23 + width:60%;
  24 + text-align: left;
  25 + margin: 0 20%;
  26 +}
@@ -80,6 +80,15 @@ Page({ @@ -80,6 +80,15 @@ Page({
80 detail.tableSubInfo='等'+(detail.tables.length)+'个' 80 detail.tableSubInfo='等'+(detail.tables.length)+'个'
81 +(detail.tables[0].tid==2?'包间':''); 81 +(detail.tables[0].tid==2?'包间':'');
82 } 82 }
  83 + if(!detail.cusman){
  84 + detail.cusman='vking';
  85 + detail.cusman_phone='15877556369';
  86 + detail.cusman_account='wx:vking';
  87 + }
83 return detail; 88 return detail;
84 - } 89 + },
  90 + showManager(){
  91 + this.selectComponent('#manager').show();
  92 + },
  93 +
85 }) 94 })
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 "navigationBarTextStyle": "black", 3 "navigationBarTextStyle": "black",
4 "navigationBarTitleText":"订座详情", 4 "navigationBarTitleText":"订座详情",
5 "usingComponents": { 5 "usingComponents": {
6 - "userinfo": "/components/userinfo/userinfo" 6 + "userinfo": "/components/userinfo/userinfo",
  7 + "manager": "/components/manager/manager"
7 } 8 }
8 } 9 }
@@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
44 </view> 44 </view>
45 <view class="flex-lr" wx:if="{{detail.cusman}}" style="margin-top: 24rpx;"> 45 <view class="flex-lr" wx:if="{{detail.cusman}}" style="margin-top: 24rpx;">
46 <view></view> 46 <view></view>
47 - <view class="detail-info-right">联系客户经理</view> 47 + <view class="detail-info-right" style="text-decoration: underline" bindtap="showManager">联系客户经理</view>
48 </view> 48 </view>
49 </view> 49 </view>
50 <view class="hr" style="margin-top: 56rpx;margin-bottom: 50rpx;"></view> 50 <view class="hr" style="margin-top: 56rpx;margin-bottom: 50rpx;"></view>
@@ -63,3 +63,4 @@ @@ -63,3 +63,4 @@
63 </view> 63 </view>
64 </view> 64 </view>
65 </view> 65 </view>
  66 +<manager manager="{{detail}}" id="manager"></manager>
1 /* pages/customer/detail_owner.wxss */ 1 /* pages/customer/detail_owner.wxss */
2 -page{ 2 +.page{
3 width: 94%; 3 width: 94%;
4 margin: 0 3%; 4 margin: 0 3%;
5 color:#353535; 5 color:#353535;