Showing
9 changed files
with
36 additions
and
19 deletions
| @@ -5,11 +5,19 @@ Component({ | @@ -5,11 +5,19 @@ Component({ | ||
| 5 | item:Object | 5 | item:Object |
| 6 | }, | 6 | }, |
| 7 | data:{ | 7 | data:{ |
| 8 | - | 8 | + vitem:null |
| 9 | + }, | ||
| 10 | + attached(){ | ||
| 11 | + let item=this.data.item; | ||
| 12 | + item.table_ids=item.tid.split(','); | ||
| 13 | + item.phone_mask=item.phone.replace(/(\d{2})(.{5})(\d{3})/,function($0,$1,$2,$3){ | ||
| 14 | + return $1+'**'+$3; | ||
| 15 | + }) | ||
| 16 | + this.setData({vitem:item}) | ||
| 9 | }, | 17 | }, |
| 10 | methods:{ | 18 | methods:{ |
| 11 | detail:function(e){ | 19 | detail:function(e){ |
| 12 | - var obj=e.currentTarget.dataset.obj; | 20 | + var obj=this.data.vitem; |
| 13 | var path=''; | 21 | var path=''; |
| 14 | var i=0; | 22 | var i=0; |
| 15 | for (var key in obj){ | 23 | for (var key in obj){ |
| 1 | -<view class="book-list-tds flex-lr font30r black-font" data-obj="{{item}}" bindtap="detail"> | ||
| 2 | - <view class="book-list-td flex-cc"> | ||
| 3 | - <view class="book-list-info font-more-two" style="display:block;">{{item.name}}</view> | 1 | +<view class="book-list-tds flex-lr font30r black-font" bindtap="detail"> |
| 2 | + <view class="book-list-td flex-vc"> | ||
| 3 | + <view class="Medium" style="font-size: 30rpx;">{{vitem.name}}</view> | ||
| 4 | + <view class="Medium" style="font-size: 28rpx;" wx:if="{{vitem.table_ids.length>1}}">等{{vitem.table_ids.length}}桌</view> | ||
| 4 | </view> | 5 | </view> |
| 5 | - <view class="book-list-td flex-cc">{{item.order_time}}</view> | ||
| 6 | - <view class="book-list-td flex-cc"> | ||
| 7 | - <block wx:if="{{item.status==1}}">已预订</block> | ||
| 8 | - <block wx:if="{{item.status==2}}">点餐中</block> | 6 | + <view class="book-list-td flex-cc">{{vitem.order_time}}</view> |
| 7 | + <view class="book-list-td flex-vc"> | ||
| 8 | + <view class="Medium">{{vitem.rname}}</view> | ||
| 9 | + <view class="Medium">{{vitem.phone_mask}}</view> | ||
| 9 | </view> | 10 | </view> |
| 10 | - <view class="book-list-td flex-rr green-font">查看详情</view> | 11 | + <view class="book-list-td flex-rr green-font">通知订座人</view> |
| 11 | </view> | 12 | </view> |
| @@ -37,7 +37,7 @@ Component({ | @@ -37,7 +37,7 @@ Component({ | ||
| 37 | if(e.detail.errMsg=='getUserInfo:ok'){ | 37 | if(e.detail.errMsg=='getUserInfo:ok'){ |
| 38 | var userInfo = e.detail.userInfo //avatarUrl nickName gender; | 38 | var userInfo = e.detail.userInfo //avatarUrl nickName gender; |
| 39 | console.log('xxxxx',userInfo) | 39 | console.log('xxxxx',userInfo) |
| 40 | - | 40 | + util.cache('userInfo',userInfo); |
| 41 | App.Reserve.AddUser({ | 41 | App.Reserve.AddUser({ |
| 42 | openid: getApp().openid, | 42 | openid: getApp().openid, |
| 43 | avatar: userInfo.avatarUrl, | 43 | avatar: userInfo.avatarUrl, |
| @@ -87,8 +87,11 @@ Page({ | @@ -87,8 +87,11 @@ Page({ | ||
| 87 | duration:2000, | 87 | duration:2000, |
| 88 | success:function(){ | 88 | success:function(){ |
| 89 | setTimeout(function () { | 89 | setTimeout(function () { |
| 90 | - wx.navigateBack({ | ||
| 91 | - delta: 2 | 90 | + // wx.navigateBack({ |
| 91 | + // delta: 2 | ||
| 92 | + // }) | ||
| 93 | + wx.reLaunch({ | ||
| 94 | + url:util.http_build_query(json.data,'b_detail') | ||
| 92 | }) | 95 | }) |
| 93 | },2500) | 96 | },2500) |
| 94 | } | 97 | } |
| 1 | { | 1 | { |
| 2 | "navigationBarBackgroundColor": "#ffffff", | 2 | "navigationBarBackgroundColor": "#ffffff", |
| 3 | "navigationBarTextStyle": "black", | 3 | "navigationBarTextStyle": "black", |
| 4 | - "navigationBarTitleText":"定个座儿", | 4 | + "navigationBarTitleText":"订个座儿", |
| 5 | 5 | ||
| 6 | "backgroundTextStyle": "light", | 6 | "backgroundTextStyle": "light", |
| 7 | "usingComponents": { | 7 | "usingComponents": { |
| @@ -100,8 +100,12 @@ Page({ | @@ -100,8 +100,12 @@ Page({ | ||
| 100 | topic:this.topicVal | 100 | topic:this.topicVal |
| 101 | }) | 101 | }) |
| 102 | } | 102 | } |
| 103 | + let nickname=""; | ||
| 104 | + try{ | ||
| 105 | + nickname='"'+util.cache('userInfo').nickName+'"'; | ||
| 106 | + }catch(e){} | ||
| 103 | return { | 107 | return { |
| 104 | - title: this.topicVal, | 108 | + title: nickname+'给你发送了一个订座信息,点击查看详情', |
| 105 | path: '/pages/customer/index?id='+this.id+'&fromid='+getApp().openid, | 109 | path: '/pages/customer/index?id='+this.id+'&fromid='+getApp().openid, |
| 106 | } | 110 | } |
| 107 | } | 111 | } |
| 1 | { | 1 | { |
| 2 | "navigationBarBackgroundColor": "#ffffff", | 2 | "navigationBarBackgroundColor": "#ffffff", |
| 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 | "formids":"/components/formids/formids" | 7 | "formids":"/components/formids/formids" |
| @@ -30,13 +30,14 @@ | @@ -30,13 +30,14 @@ | ||
| 30 | "list": [] | 30 | "list": [] |
| 31 | }, | 31 | }, |
| 32 | "miniprogram": { | 32 | "miniprogram": { |
| 33 | - "current": 10, | 33 | + "current": 0, |
| 34 | "list": [ | 34 | "list": [ |
| 35 | { | 35 | { |
| 36 | "id": 0, | 36 | "id": 0, |
| 37 | "name": "预定本", | 37 | "name": "预定本", |
| 38 | "pathName": "pages/book/b_index", | 38 | "pathName": "pages/book/b_index", |
| 39 | - "query": "sellerid=1" | 39 | + "query": "seller_id=1&seller_openid=o9pcQ0cbjRKnRWczcOJaaSRGP1lE", |
| 40 | + "scene": "1001" | ||
| 40 | }, | 41 | }, |
| 41 | { | 42 | { |
| 42 | "id": 1, | 43 | "id": 1, |
| @@ -740,7 +740,7 @@ module.exports = { | @@ -740,7 +740,7 @@ module.exports = { | ||
| 740 | http_build_query(obj,url=''){ | 740 | http_build_query(obj,url=''){ |
| 741 | let ps=[] | 741 | let ps=[] |
| 742 | for(let i in obj){ | 742 | for(let i in obj){ |
| 743 | - if(typeof obj[i]=='undefined') continue; | 743 | + if(typeof obj[i]=='undefined' || obj[i]==null) continue; |
| 744 | ps.push(i+'='+obj[i].toString()) | 744 | ps.push(i+'='+obj[i].toString()) |
| 745 | } | 745 | } |
| 746 | ps=ps.join('&'); | 746 | ps=ps.join('&'); |
-
Please register or login to post a comment