Showing
6 changed files
with
85 additions
and
61 deletions
| @@ -21,13 +21,13 @@ Component({ | @@ -21,13 +21,13 @@ Component({ | ||
| 21 | detail:function(e){ | 21 | detail:function(e){ |
| 22 | var obj=this.data.vitem; | 22 | var obj=this.data.vitem; |
| 23 | wx.navigateTo({ | 23 | wx.navigateTo({ |
| 24 | - url:util.http_build_query(obj,'b_detail') | 24 | + url:util.http_build_query({id:obj.id},'b_detail') |
| 25 | }) | 25 | }) |
| 26 | }, | 26 | }, |
| 27 | invitation:function(e){ | 27 | invitation:function(e){ |
| 28 | var obj=this.data.vitem; | 28 | var obj=this.data.vitem; |
| 29 | wx.navigateTo({ | 29 | wx.navigateTo({ |
| 30 | - url:util.http_build_query(obj,'b_invitation') | 30 | + url:util.http_build_query({id:obj.id},'b_invitation') |
| 31 | }) | 31 | }) |
| 32 | }, | 32 | }, |
| 33 | changeitem:function () { | 33 | changeitem:function () { |
| @@ -47,7 +47,7 @@ Page({ | @@ -47,7 +47,7 @@ Page({ | ||
| 47 | //title: (nickname||'')+'给你发送了一个订座信息,点击查看详情', | 47 | //title: (nickname||'')+'给你发送了一个订座信息,点击查看详情', |
| 48 | title: '点击查看详情,发邀请函', | 48 | title: '点击查看详情,发邀请函', |
| 49 | path: path+'&hasInvitation=1&hasSellerShare=1', | 49 | path: path+'&hasInvitation=1&hasSellerShare=1', |
| 50 | - imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg', | 50 | + imageUrl:'http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E5%AE%9A%E5%AE%89%E6%8E%92-%E5%95%86%E5%8A%A1.jpg', |
| 51 | success: function (res) { | 51 | success: function (res) { |
| 52 | console.log(res,666666) | 52 | console.log(res,666666) |
| 53 | }, | 53 | }, |
| @@ -13,67 +13,48 @@ Page({ | @@ -13,67 +13,48 @@ Page({ | ||
| 13 | current: 0, | 13 | current: 0, |
| 14 | tpls: TP.tpls(), | 14 | tpls: TP.tpls(), |
| 15 | seller:{ | 15 | seller:{ |
| 16 | - name:'一键订示例餐厅', | ||
| 17 | - room:'天香阁', | 16 | + name:'', |
| 17 | + room:'', | ||
| 18 | date:util.unixtoTime(new Date()/1000,'YYYY/MM/DD 星期WW HH:II'), | 18 | date:util.unixtoTime(new Date()/1000,'YYYY/MM/DD 星期WW HH:II'), |
| 19 | - addr:'粤江西路啤酒文化创意艺术区B09', | 19 | + addr:'', |
| 20 | hasOwner:true, | 20 | hasOwner:true, |
| 21 | }, | 21 | }, |
| 22 | options:{}, | 22 | options:{}, |
| 23 | }, | 23 | }, |
| 24 | + detail:{}, | ||
| 24 | 25 | ||
| 25 | /** | 26 | /** |
| 26 | * 生命周期函数--监听页面加载 | 27 | * 生命周期函数--监听页面加载 |
| 27 | */ | 28 | */ |
| 28 | onLoad: function (options) { | 29 | onLoad: function (options) { |
| 30 | + options.tplid=options.tplid||1; | ||
| 29 | let param={ | 31 | let param={ |
| 30 | options:options, | 32 | options:options, |
| 31 | } | 33 | } |
| 32 | - if(options.rid){ | 34 | + if(true){ |
| 33 | param.tpls=[TP.tpls(options.tplid)] | 35 | param.tpls=[TP.tpls(options.tplid)] |
| 34 | } | 36 | } |
| 35 | this.setData(param) | 37 | this.setData(param) |
| 36 | this.initData(options); | 38 | this.initData(options); |
| 37 | }, | 39 | }, |
| 38 | initData(options){ | 40 | initData(options){ |
| 39 | - if(options.rid){ | ||
| 40 | - App.Invitation.Detail({id:options.rid}).then(res=>{ | ||
| 41 | - this.setData({ | ||
| 42 | - seller:{ | ||
| 43 | - name:res.data.seller_name, | ||
| 44 | - room:res.data.room_name, | ||
| 45 | - date:util.unixtoTime(res.data.arrival_time,this.data.tpls[this.data.current].timeStr), | ||
| 46 | - addr:res.data.seller_address, | ||
| 47 | - image:res.data.image_url, | ||
| 48 | - hasOwner:true, | ||
| 49 | - } | ||
| 50 | - }) | 41 | + App.Reserve.Detail({rid:options.id,openid:''}).then(res=>{ |
| 42 | + this.detail=res.data; | ||
| 43 | + let tables=[]; | ||
| 44 | + res.data.tables.forEach(t=>{ | ||
| 45 | + tables.push(t.name); | ||
| 51 | }) | 46 | }) |
| 52 | - }else{ | ||
| 53 | - App.Invitation.GetSellerList({ | ||
| 54 | - openid:getApp().openid | ||
| 55 | - }).then(res=>{ | ||
| 56 | - if(res.data.length>0){ | ||
| 57 | - let defi=0; | ||
| 58 | - for(let i=0;i<res.data.length;i++){ | ||
| 59 | - if(res.data[i].is_default==1){ | ||
| 60 | - defi=i; | ||
| 61 | - break; | ||
| 62 | - } | ||
| 63 | - } | ||
| 64 | - let sel=res.data[defi]; | ||
| 65 | - this.setData({ | ||
| 66 | - seller:{ | ||
| 67 | - name:sel.name, | ||
| 68 | - room:'', | ||
| 69 | - date:util.unixtoTime(new Date()/1000,this.data.tpls[this.data.current].timeStr), | ||
| 70 | - addr:sel.address, | ||
| 71 | - hasOwner:true, | ||
| 72 | - } | ||
| 73 | - }) | 47 | + this.setData({ |
| 48 | + seller:{ | ||
| 49 | + name:res.data.seller.sellername, | ||
| 50 | + room:tables.join('、'), | ||
| 51 | + date:util.unixtoTime(res.data.ddate,this.data.tpls[this.data.current].timeStr), | ||
| 52 | + addr:res.data.seller.real_address||res.data.seller.map_address, | ||
| 53 | + image:res.data.image_url, | ||
| 54 | + hasOwner:true, | ||
| 74 | } | 55 | } |
| 75 | }) | 56 | }) |
| 76 | - } | 57 | + }) |
| 77 | }, | 58 | }, |
| 78 | /** | 59 | /** |
| 79 | * 生命周期函数--监听页面初次渲染完成 | 60 | * 生命周期函数--监听页面初次渲染完成 |
| @@ -141,14 +122,8 @@ Page({ | @@ -141,14 +122,8 @@ Page({ | ||
| 141 | ...this.data.options, | 122 | ...this.data.options, |
| 142 | fromid:getApp().openid, | 123 | fromid:getApp().openid, |
| 143 | hasSellerShare:1, | 124 | hasSellerShare:1, |
| 125 | + hasInvitation:1, | ||
| 144 | },'/pages/manager-invitation/display') | 126 | },'/pages/manager-invitation/display') |
| 145 | - if(!this.data.options.rid){ | ||
| 146 | - return { | ||
| 147 | - title: '一键订,客户经理专用的拓客工具', | ||
| 148 | - path: '/pages/manager-invitation/index', | ||
| 149 | - imageUrl:this.data.tpls[this.data.current].shareFirstImage, | ||
| 150 | - } | ||
| 151 | - } | ||
| 152 | return { | 127 | return { |
| 153 | title: '点击查看详情,发邀请函', | 128 | title: '点击查看详情,发邀请函', |
| 154 | path: path, | 129 | path: path, |
| @@ -169,13 +144,21 @@ Page({ | @@ -169,13 +144,21 @@ Page({ | ||
| 169 | [`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr) | 144 | [`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr) |
| 170 | }) | 145 | }) |
| 171 | }, | 146 | }, |
| 172 | - goEditor(){ | ||
| 173 | - let param={ | ||
| 174 | - ...this.data.options, | ||
| 175 | - tplid:this.data.tpls[this.data.current].id, | 147 | + sendmsg(){ |
| 148 | + if (!this.detail.phone) { | ||
| 149 | + util.toast('未填写手机号码', 'none') | ||
| 150 | + return; | ||
| 151 | + } else if (!/^1\d{10}$/.test(this.detail.phone)) { | ||
| 152 | + util.toast('手机号码错误', 'none') | ||
| 153 | + return; | ||
| 176 | } | 154 | } |
| 177 | wx.navigateTo({ | 155 | wx.navigateTo({ |
| 178 | - url:util.http_build_query(param,'./editor') | ||
| 179 | - }) | 156 | + url: '/pages/book/b_sms?id=' + this.detail.id |
| 157 | + }); | ||
| 180 | }, | 158 | }, |
| 159 | + gotoDetail(){ | ||
| 160 | + wx.redirectTo({ | ||
| 161 | + url: '/pages/book/b_detail?id=' + this.detail.id | ||
| 162 | + }); | ||
| 163 | + } | ||
| 181 | }) | 164 | }) |
| @@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
| 4 | "navigationBarTextStyle":"white", | 4 | "navigationBarTextStyle":"white", |
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | "nav":"/components/nav/nav", | 6 | "nav":"/components/nav/nav", |
| 7 | - "formids":"/components/formids/formids" | 7 | + "formids":"/components/formids/formids", |
| 8 | + "userinfo-share": "/components/userinfo/share" | ||
| 8 | } | 9 | } |
| 9 | } | 10 | } |
| @@ -15,17 +15,28 @@ | @@ -15,17 +15,28 @@ | ||
| 15 | </swiper-item> | 15 | </swiper-item> |
| 16 | </block> | 16 | </block> |
| 17 | </swiper> | 17 | </swiper> |
| 18 | -<view wx:if="{{!options.rid}}" | ||
| 19 | - class="flex-vc" | 18 | +<view class="flex-vc" |
| 20 | style="position:fixed;top:{{statusBarHeight}}px;left:0;height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px;"> | 19 | style="position:fixed;top:{{statusBarHeight}}px;left:0;height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px;"> |
| 21 | <view class="tabs flex-ll"> | 20 | <view class="tabs flex-ll"> |
| 22 | - <block wx:for="{{tpls}}" wx:key="tpls.key"> | 21 | + <formids class="back" bindclick="gotoDetail" > |
| 22 | + <view style="min-width: 100rpx;" class="flex-ll"> | ||
| 23 | + <image class="back-image" | ||
| 24 | + src="http://qn.colorcun.com/custom/lite-yd/image/back-light.png"></image> | ||
| 25 | + </view> | ||
| 26 | + </formids> | ||
| 27 | + <block wx:if="{{false}}" wx:for="{{tpls}}" wx:key="tpls.key"> | ||
| 23 | <view class="item {{index==current?'active':''}}" bindtap="switchTabs" data-current="{{index}}">{{item.name}}</view> | 28 | <view class="item {{index==current?'active':''}}" bindtap="switchTabs" data-current="{{index}}">{{item.name}}</view> |
| 24 | </block> | 29 | </block> |
| 25 | </view> | 30 | </view> |
| 26 | </view> | 31 | </view> |
| 27 | -<nav wx:else="" backgroundColor="rgba(0,0,0,0)" style="position: fixed;"></nav> | ||
| 28 | - | 32 | +<view class="bottom flex-lr"> |
| 33 | + <formids bindclick="sendmsg" class="sendmsg"> | ||
| 34 | + 发短信 | ||
| 35 | + </formids> | ||
| 36 | + <userinfo-share binduserinfo="share" class="share Semibold"> | ||
| 37 | + 通知客户 | ||
| 38 | + </userinfo-share> | ||
| 39 | +</view> | ||
| 29 | <!--//商务--> | 40 | <!--//商务--> |
| 30 | <template name="tpl-1"> | 41 | <template name="tpl-1"> |
| 31 | <view class="flex-vc shangwu" bindtap="{{options.rid?'goEditor':''}}"> | 42 | <view class="flex-vc shangwu" bindtap="{{options.rid?'goEditor':''}}"> |
| @@ -23,4 +23,33 @@ | @@ -23,4 +23,33 @@ | ||
| 23 | image{ | 23 | image{ |
| 24 | width: 100%; | 24 | width: 100%; |
| 25 | height: 100%; | 25 | height: 100%; |
| 26 | +} | ||
| 27 | +.back{ | ||
| 28 | + margin-left: 40rpx; | ||
| 29 | +} | ||
| 30 | +.back-image{ | ||
| 31 | + height: 32rpx; | ||
| 32 | + width: 18rpx; | ||
| 33 | +} | ||
| 34 | +.bottom{ | ||
| 35 | + position: fixed; | ||
| 36 | + bottom: 0; | ||
| 37 | + height: 98rpx; | ||
| 38 | + line-height: 98rpx; | ||
| 39 | + border-top: 2rpx solid #ECD9B7; | ||
| 40 | + background-color: #ECD9B7; | ||
| 41 | + width: 100%; | ||
| 42 | +} | ||
| 43 | +.bottom .sendmsg{ | ||
| 44 | + background-color: #262628; | ||
| 45 | + width: 30%; | ||
| 46 | + min-width: 30%; | ||
| 47 | + color: #ECD9B7; | ||
| 48 | + font-size: 30rpx; | ||
| 49 | +} | ||
| 50 | +.bottom .share{ | ||
| 51 | + text-align: center; | ||
| 52 | + width: 70%; | ||
| 53 | + font-size: 36rpx; | ||
| 54 | + color: #794F28; | ||
| 26 | } | 55 | } |
-
Please register or login to post a comment