Showing
5 changed files
with
39 additions
and
13 deletions
| @@ -48,6 +48,9 @@ Component({ | @@ -48,6 +48,9 @@ Component({ | ||
| 48 | }); | 48 | }); |
| 49 | break; | 49 | break; |
| 50 | case 2: | 50 | case 2: |
| 51 | + if(!this.data.bookInfo.hasOwner){ | ||
| 52 | + return util.toast('只有记录人可以拨打','none'); | ||
| 53 | + } | ||
| 51 | if(this.data.bookInfo.phone.length<3){ | 54 | if(this.data.bookInfo.phone.length<3){ |
| 52 | return util.toast('号码错误','none'); | 55 | return util.toast('号码错误','none'); |
| 53 | } | 56 | } |
| @@ -55,6 +55,9 @@ Page({ | @@ -55,6 +55,9 @@ Page({ | ||
| 55 | }; | 55 | }; |
| 56 | }, | 56 | }, |
| 57 | getcall:function(){ | 57 | getcall:function(){ |
| 58 | + if(!this.detailData.hasOwner){ | ||
| 59 | + return util.toast('只有记录人可以拨打','none'); | ||
| 60 | + } | ||
| 58 | if(this.data.bookInfo.phone.length<3){ | 61 | if(this.data.bookInfo.phone.length<3){ |
| 59 | return util.toast('号码错误','none'); | 62 | return util.toast('号码错误','none'); |
| 60 | } | 63 | } |
| @@ -109,14 +112,26 @@ Page({ | @@ -109,14 +112,26 @@ Page({ | ||
| 109 | App.Reserve.SellerInfo(util.cache('enter_params'),true); | 112 | App.Reserve.SellerInfo(util.cache('enter_params'),true); |
| 110 | }, | 113 | }, |
| 111 | detailData:null, | 114 | detailData:null, |
| 112 | - getDetail(id,force=false){ | ||
| 113 | - App.Reserve.Detail({rid:id,openid:''},force).then(res=>{ | ||
| 114 | - res.data.rdateStr=util.unixtoTime(res.data.ddate,"MM月DD日 HH:II") | ||
| 115 | - this.detailData=res.data; | ||
| 116 | - this.setData({ | ||
| 117 | - tables:res.data.tables, | ||
| 118 | - bookInfo:res.data, | ||
| 119 | - }) | 115 | + async getDetail(id,force=false){ |
| 116 | + let res=await App.Reserve.Detail({rid:id,openid:''},force); | ||
| 117 | + res.data.rdateStr=util.unixtoTime(res.data.ddate,"MM月DD日 HH:II") | ||
| 118 | + res.data.phoneStr=res.data.phone; | ||
| 119 | + let enter_params=util.cache('enter_params'); | ||
| 120 | + let sc=(await App.Reserve.SellerInfo(enter_params)).data | ||
| 121 | + let note_openid=enter_params.seller_openid; | ||
| 122 | + res.data.hasOwner=false; | ||
| 123 | + if(note_openid==res.data.note_openid || sc.seller_user.role_name=='管理员'){ | ||
| 124 | + res.data.hasOwner=true; | ||
| 125 | + } | ||
| 126 | + if(res.data.hasOwner){ | ||
| 127 | + res.data.phoneStr=res.data.phoneStr.replace(/(\d{2})(.{5})(\d{3})/,function($0,$1,$2,$3){ | ||
| 128 | + return $1+'**'+$3; | ||
| 129 | + }) | ||
| 130 | + } | ||
| 131 | + this.detailData=res.data; | ||
| 132 | + this.setData({ | ||
| 133 | + tables:res.data.tables, | ||
| 134 | + bookInfo:res.data, | ||
| 120 | }) | 135 | }) |
| 121 | }, | 136 | }, |
| 122 | gotoModify(){ | 137 | gotoModify(){ |
| @@ -15,10 +15,10 @@ | @@ -15,10 +15,10 @@ | ||
| 15 | </view> | 15 | </view> |
| 16 | <view class="flex-lr order-desk"> | 16 | <view class="flex-lr order-desk"> |
| 17 | <view class="gray-deep-font font30r"></view> | 17 | <view class="gray-deep-font font30r"></view> |
| 18 | - <view class="flex-re" style="width:80%;flex-wrap:wrap;"> | 18 | + <view class="flex-re" style="width:100%;flex-wrap:wrap;"> |
| 19 | <block wx:for="{{tables}}"> | 19 | <block wx:for="{{tables}}"> |
| 20 | <board width="160" height="180" board="{{item}}" className="noBottom" | 20 | <board width="160" height="180" board="{{item}}" className="noBottom" |
| 21 | - style="margin-left:20rpx;zoom: 0.8"></board> | 21 | + style="margin-left:20rpx;zoom: 0.8; margin-bottom: 20rpx;"></board> |
| 22 | </block> | 22 | </block> |
| 23 | </view> | 23 | </view> |
| 24 | </view> | 24 | </view> |
| @@ -28,7 +28,7 @@ | @@ -28,7 +28,7 @@ | ||
| 28 | </view> | 28 | </view> |
| 29 | <view class="flex-lr order-detail"> | 29 | <view class="flex-lr order-detail"> |
| 30 | <view class="gray-deep-font font30r">手机号码</view> | 30 | <view class="gray-deep-font font30r">手机号码</view> |
| 31 | - <view class="black-font font34r" bindtap="getcall">{{bookInfo.phone||''}}</view> | 31 | + <view class="black-font font34r" bindtap="getcall">{{bookInfo.phoneStr||''}}</view> |
| 32 | </view> | 32 | </view> |
| 33 | <block wx:if="{{bookInfo.cusdem!='' && bookInfo.cusdem!='null'}}"> | 33 | <block wx:if="{{bookInfo.cusdem!='' && bookInfo.cusdem!='null'}}"> |
| 34 | <view class="flex-lr order-detail"> | 34 | <view class="flex-lr order-detail"> |
| @@ -68,7 +68,13 @@ Page({ | @@ -68,7 +68,13 @@ Page({ | ||
| 68 | }, | 68 | }, |
| 69 | buy(){ | 69 | buy(){ |
| 70 | if(!this.data.form.meal_id) return; | 70 | if(!this.data.form.meal_id) return; |
| 71 | - App.Reserve.SmsBuy(this.data.form).then(res=>{ | 71 | + let prarms={ |
| 72 | + sellerid: this.data.form.seller_id, | ||
| 73 | + price:this.data.form.price, | ||
| 74 | + id:this.data.form.meal_id, | ||
| 75 | + openid:getApp().openid, | ||
| 76 | + } | ||
| 77 | + App.Reserve.SmsBuy(prarms).then(res=>{ | ||
| 72 | let pay=res.data; | 78 | let pay=res.data; |
| 73 | wx.requestPayment({ | 79 | wx.requestPayment({ |
| 74 | 'timeStamp': pay.timeStamp, | 80 | 'timeStamp': pay.timeStamp, |
-
Please register or login to post a comment