|
|
|
@ -50,11 +50,12 @@ |
|
|
|
|
<view class="yue_xuzhi"> |
|
|
|
|
<radio-group> |
|
|
|
|
<label class="radio"> |
|
|
|
|
<radio :checked="agreementChecked" @click="radioChange"/> |
|
|
|
|
<radio :checked="agreementChecked" @click="radioChange" /> |
|
|
|
|
</label>我已阅读并同意<text @click="gotoNotice">《游客须知》</text> |
|
|
|
|
</radio-group> |
|
|
|
|
</radio-group> |
|
|
|
|
</view> |
|
|
|
|
<button form-type="submit" class="yue_fm_btn yue_e_bun" :class="agreementChecked?'active':''" @click="saveReserve('dynamicForm')"> |
|
|
|
|
<button form-type="submit" class="yue_fm_btn yue_e_bun" :class="agreementChecked?'active':''" |
|
|
|
|
@click="saveReserve('dynamicForm')"> |
|
|
|
|
预约 |
|
|
|
|
</button> |
|
|
|
|
</view> |
|
|
|
@ -70,6 +71,7 @@ |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
agreementChecked: false, |
|
|
|
|
|
|
|
|
|
formData: { |
|
|
|
|
name: {}, |
|
|
|
|
phone: {}, |
|
|
|
@ -151,12 +153,13 @@ |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
radioChange: function(e) { |
|
|
|
|
this.agreementChecked = !this.agreementChecked;}, |
|
|
|
|
gotoNotice: function() { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/sunPackIndex/scenic/subscribe/yuyue/yue-notice' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
this.agreementChecked = !this.agreementChecked; |
|
|
|
|
}, |
|
|
|
|
gotoNotice: function() { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/sunPackIndex/scenic/subscribe/yuyue/yue-notice' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//创建预约人 |
|
|
|
|
addReserve: function() { |
|
|
|
|
if (this.isAdd) { |
|
|
|
@ -184,21 +187,33 @@ |
|
|
|
|
}, |
|
|
|
|
//预约按钮 |
|
|
|
|
saveReserve: function() { |
|
|
|
|
if(this.agreementChecked){ |
|
|
|
|
let errList = [] |
|
|
|
|
const promises = this.dynamicLists.map((item, index) => { |
|
|
|
|
return new Promise(resolve => { |
|
|
|
|
this.$refs.form[index].validate(err => { |
|
|
|
|
errList = err |
|
|
|
|
}) |
|
|
|
|
let that = this |
|
|
|
|
let promise = new Promise(function(resolve, reject) { |
|
|
|
|
let state = [] |
|
|
|
|
that.dynamicLists.map((item, index) => { |
|
|
|
|
that.$refs.form[index].validate().then(res => { |
|
|
|
|
state[index] = '1' |
|
|
|
|
}).catch(err => { |
|
|
|
|
state[index] = '0' |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
setTimeout(() => { |
|
|
|
|
if (errList == null) { |
|
|
|
|
this.postReserve() |
|
|
|
|
setTimeout(function() { |
|
|
|
|
let reState = state.every((item, index) => { |
|
|
|
|
return item == '1' |
|
|
|
|
}) |
|
|
|
|
if (reState) { |
|
|
|
|
resolve('success'); |
|
|
|
|
} |
|
|
|
|
}, 500) |
|
|
|
|
} |
|
|
|
|
}, 1000); |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
promise.then(value => { |
|
|
|
|
if (value == 'success') { |
|
|
|
|
this.postReserve() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
//传输数据 |
|
|
|
|
postReserve: function() { |
|
|
|
@ -298,4 +313,4 @@ |
|
|
|
|
.yue_xuzhi text { |
|
|
|
|
color: rgb(22, 119, 255); |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|
</style> |