Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
meihua-island-book
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2023-12-27 16:33:24 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8e29b4e8d2ce662bbe7f972efc5482ff08b23f6d
8e29b4e8
1 parent
5c24886c
控制可订房间数量的最大值
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
src/pages/confirm/index.vue
src/pages/confirm/index.vue
View file @
8e29b4e
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-27 1
4:20:17
* @LastEditTime: 2023-12-27 1
5:11:58
* @FilePath: /meihuaApp/src/pages/confirm/index.vue
* @Description: 确认订单页面
-->
...
...
@@ -24,7 +24,7 @@
<view style="font-weight: bold; color: #0B0B0B; font-size: 1rem;">预定房间数</view>
</nut-col>
<nut-col :span="8" style="text-align: center;">
<nut-input-number v-model="book_count" min="1" button-size="30" input-width="50" @blur="onBookCountBlur" @change="onBookCountChange" />
<nut-input-number v-model="book_count" min="1"
:max="state.roomInfo.num"
button-size="30" input-width="50" @blur="onBookCountBlur" @change="onBookCountChange" />
</nut-col>
</nut-row>
</view>
...
...
@@ -193,19 +193,16 @@ const onBookCountChange = (count) => {
const use_type = ref('1'); // 本人入住或者帮别人订
const onChange = (v) => {
if (v === '2') {
formData = {
name: '',
tel: '',
note: ''
}
}
const onChange = async (type) => {
formData.name = type !== '2' ? formData.wxapp_user_name : '';
formData.tel = type !== '2' ? formData.wxapp_user_phone : '';
};
const formData = reactive({
name: '',
tel: '',
wxapp_user_name: '',
wxapp_user_phone: '',
note: ''
});
...
...
@@ -254,6 +251,8 @@ onMounted(async () => {
if (myInfoData.code) {
formData.name = myInfoData.data.wxapp_user_name;
formData.tel = myInfoData.data.wxapp_user_phone;
formData.wxapp_user_name = myInfoData.data.wxapp_user_name;
formData.wxapp_user_phone = myInfoData.data.wxapp_user_phone;
}
});
...
...
@@ -275,7 +274,7 @@ const goPay = async () => {
} else {
let params = getCurrentPageParam();
// 保存订房信息
const { code, data } = await addOrderAPI({ id: params.id, contact_name: formData.name, contact_phone: formData.tel, order_remark: formData.note, plan_in: params.start_date, plan_out: params.end_date, room_type: params.room_type })
const { code, data } = await addOrderAPI({ id: params.id,
num: book_count.value,
contact_name: formData.name, contact_phone: formData.tel, order_remark: formData.note, plan_in: params.start_date, plan_out: params.end_date, room_type: params.room_type })
if (code) {
show_pay.value = true;
payData.value.id = data.order_id;
...
...
Please
register
or
login
to post a comment