Commit 626e438ffd2827d7af62c862eca69ee4f592dba7

Authored by vking
1 parent c33ebec3

global layout get formid

@@ -17,7 +17,7 @@ Page({ @@ -17,7 +17,7 @@ Page({
17 detail:null, 17 detail:null,
18 user:_u, 18 user:_u,
19 }, 19 },
20 - 20 + hasSubmit:true,
21 /** 21 /**
22 * 生命周期函数--监听页面加载 22 * 生命周期函数--监听页面加载
23 */ 23 */
@@ -109,12 +109,14 @@ Page({ @@ -109,12 +109,14 @@ Page({
109 } 109 }
110 }, 110 },
111 saved() { 111 saved() {
  112 + if(!this.hasSubmit) return;
112 if(!this.user.name){ 113 if(!this.user.name){
113 return util.toast('请填写姓名','none') 114 return util.toast('请填写姓名','none')
114 } 115 }
115 if(!this.user.phone){ 116 if(!this.user.phone){
116 return util.toast('请填写手机','none') 117 return util.toast('请填写手机','none')
117 } 118 }
  119 + this.hasSubmit=false;
118 App.Customer.SetReserveInfo({ 120 App.Customer.SetReserveInfo({
119 sid:this.options.sid, 121 sid:this.options.sid,
120 pnum:this.options.pnum, 122 pnum:this.options.pnum,
@@ -126,6 +128,7 @@ Page({ @@ -126,6 +128,7 @@ Page({
126 cusdem:this.user.remark||'', 128 cusdem:this.user.remark||'',
127 }).then(res=>{ 129 }).then(res=>{
128 if(res.ret!=200){ 130 if(res.ret!=200){
  131 + this.hasSubmit=true;
129 return util.toast(res.msg,'none'); 132 return util.toast(res.msg,'none');
130 } 133 }
131 if(res.data.hasSetUserInfo){ 134 if(res.data.hasSetUserInfo){
1 <!--pages/reserve/submit.wxml--> 1 <!--pages/reserve/submit.wxml-->
  2 +<layout>
2 <nav hasBack>预订详情</nav> 3 <nav hasBack>预订详情</nav>
3 <view class="pages"> 4 <view class="pages">
4 <card hasShowStatus hasAddress="{{false}}" bindevent="cardEvent" 5 <card hasShowStatus hasAddress="{{false}}" bindevent="cardEvent"
@@ -72,3 +73,4 @@ @@ -72,3 +73,4 @@
72 <view class="share-but">提交预订</view> 73 <view class="share-but">提交预订</view>
73 </formids> 74 </formids>
74 </view> 75 </view>
  76 +</layout>