Commit 26fb8fd0dbce4d32964b386633d615c3df694069

Authored by wangfan
1 parent 394f0e83

快速预定

@@ -78,7 +78,8 @@ Page({ @@ -78,7 +78,8 @@ Page({
78 initOrder(){ 78 initOrder(){
79 App.Advance.CreateOrder({ 79 App.Advance.CreateOrder({
80 rid: this.data.options.rid, 80 rid: this.data.options.rid,
81 - identity:this.data.options.identity 81 + identity:this.data.options.identity,
  82 + status:1,
82 }).then(res => { 83 }).then(res => {
83 res.data.cdateStr=util.unixtoTime(res.data.cdate,'YYYY-MM-DD') 84 res.data.cdateStr=util.unixtoTime(res.data.cdate,'YYYY-MM-DD')
84 let cookbooklist={}; 85 let cookbooklist={};
@@ -127,17 +127,22 @@ Page({ @@ -127,17 +127,22 @@ Page({
127 return obj; 127 return obj;
128 }, 128 },
129 cookbook(){ 129 cookbook(){
130 - App.Advance.CreateOrder({  
131 - rid:this.id,  
132 - identity:1,  
133 - status:'0,1'  
134 - }).then(res=>{  
135 - if(res.ret!=200){  
136 - return util.toast(res.msg,'none')  
137 - } 130 + if(this.data.detail.order && this.data.detail.order.cookbooklist.length>0){
138 wx.navigateTo({ 131 wx.navigateTo({
139 - url:util.http_build_query({rid:this.id,oid:res.data.id,identity:1},'/pack-cookbook/pages/index') 132 + url:util.http_build_query({rid:this.id,oid:res.data.id,identity:1},'/pack-cookbook/pages/success')
140 }); 133 });
141 - }) 134 + }else{
  135 + App.Advance.CreateOrder({
  136 + rid:this.id,
  137 + }).then(res=>{
  138 + if(res.ret!=200){
  139 + return util.toast(res.msg,'none')
  140 + }
  141 + wx.navigateTo({
  142 + url:util.http_build_query({rid:this.id,oid:res.data.id,identity:1},'/pack-cookbook/pages/index')
  143 + });
  144 + })
  145 + }
  146 +
142 }, 147 },
143 }) 148 })