hookehuyr

支付功能模块显示优化

...@@ -18,6 +18,7 @@ declare module '@vue/runtime-core' { ...@@ -18,6 +18,7 @@ declare module '@vue/runtime-core' {
18 NutCalendar: typeof import('@nutui/nutui-taro')['Calendar'] 18 NutCalendar: typeof import('@nutui/nutui-taro')['Calendar']
19 NutCol: typeof import('@nutui/nutui-taro')['Col'] 19 NutCol: typeof import('@nutui/nutui-taro')['Col']
20 NutConfigProvider: typeof import('@nutui/nutui-taro')['ConfigProvider'] 20 NutConfigProvider: typeof import('@nutui/nutui-taro')['ConfigProvider']
21 + NutCountdown: typeof import('@nutui/nutui-taro')['Countdown']
21 NutImagePreview: typeof import('@nutui/nutui-taro')['ImagePreview'] 22 NutImagePreview: typeof import('@nutui/nutui-taro')['ImagePreview']
22 NutInput: typeof import('@nutui/nutui-taro')['Input'] 23 NutInput: typeof import('@nutui/nutui-taro')['Input']
23 NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber'] 24 NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber']
...@@ -33,6 +34,7 @@ declare module '@vue/runtime-core' { ...@@ -33,6 +34,7 @@ declare module '@vue/runtime-core' {
33 NutTag: typeof import('@nutui/nutui-taro')['Tag'] 34 NutTag: typeof import('@nutui/nutui-taro')['Tag']
34 NutTextarea: typeof import('@nutui/nutui-taro')['Textarea'] 35 NutTextarea: typeof import('@nutui/nutui-taro')['Textarea']
35 OrderCard: typeof import('./src/components/orderCard.vue')['default'] 36 OrderCard: typeof import('./src/components/orderCard.vue')['default']
37 + PayCard: typeof import('./src/components/payCard.vue')['default']
36 Picker: typeof import('./src/components/time-picker-data/picker.vue')['default'] 38 Picker: typeof import('./src/components/time-picker-data/picker.vue')['default']
37 PosterBuilder: typeof import('./src/components/PosterBuilder/index.vue')['default'] 39 PosterBuilder: typeof import('./src/components/PosterBuilder/index.vue')['default']
38 RoomCard: typeof import('./src/components/roomCard.vue')['default'] 40 RoomCard: typeof import('./src/components/roomCard.vue')['default']
......
...@@ -59,12 +59,14 @@ ...@@ -59,12 +59,14 @@
59 </nut-col> 59 </nut-col>
60 </nut-row> 60 </nut-row>
61 </view> 61 </view>
62 - <!-- <view v-if="flag" style="display: flex; justify-content: flex-end; font-size: 20rpx; margin-bottom: 1rem;"> 62 + <!-- <view v-if="flag" style="display: flex; justify-content: flex-end; font-size: 20rpx; margin-bottom: 1rem;"> -->
63 + <view style="display: flex; justify-content: flex-end; font-size: 20rpx; margin-bottom: 1rem;">
63 <text>支付剩余时间</text>&nbsp; 64 <text>支付剩余时间</text>&nbsp;
64 - <nut-countdown v-model="resetTime" :end-time="end" @end="onEnd('id')"> 65 + <!-- <nut-countdown v-model="resetTime" :end-time="end" @end="onEnd('id')">
65 <text style="font-size: 20rpx; color: red;">{{ resetTime.m }}:{{ resetTime.s }}</text> 66 <text style="font-size: 20rpx; color: red;">{{ resetTime.m }}:{{ resetTime.s }}</text>
66 - </nut-countdown> 67 + </nut-countdown> -->
67 - </view> --> 68 + <text style="font-size: 20rpx; color: red;">30:00</text>
69 + </view>
68 <view v-if="show_info"> 70 <view v-if="show_info">
69 <view style="border-bottom: 1px dashed #979797; padding: 0.5rem;"> 71 <view style="border-bottom: 1px dashed #979797; padding: 0.5rem;">
70 <nut-row> 72 <nut-row>
...@@ -118,14 +120,6 @@ ...@@ -118,14 +120,6 @@
118 </nut-row> 120 </nut-row>
119 </view> 121 </view>
120 </view> 122 </view>
121 - <!-- <nut-action-sheet v-model:visible="visible" title="">
122 - <view style="padding: 2rem 1rem; text-align: center;">
123 - <view style="font-size: 32rpx;">实付金额</view>
124 - <view style="color: red; margin: 10rpx 0;"><text style="font-size: 50rpx;"></text><text style="font-size: 80rpx;">980</text></view>
125 - <view style="font-size: 28rpx; margin-bottom: 20rpx;">支付剩余时间 <text style="color: red;">29:59</text></view>
126 - <nut-button block color="#6A4925">立即支付</nut-button>
127 - </view>
128 - </nut-action-sheet> -->
129 </view> 123 </view>
130 </template> 124 </template>
131 125
......
1 +<!--
2 + * @Date: 2023-12-20 14:11:11
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2023-12-20 14:56:37
5 + * @FilePath: /meihuaApp/src/components/payCard.vue
6 + * @Description: 文件描述
7 +-->
8 +<template>
9 + <div class="pay-card">
10 + <nut-action-sheet v-model:visible="props.visible" title="" @close="onClose">
11 + <view style="padding: 2rem 1rem; text-align: center;">
12 + <view style="font-size: 32rpx;">实付金额</view>
13 + <view style="color: red; margin: 10rpx 0;"><text style="font-size: 50rpx;">¥</text><text style="font-size: 80rpx;">{{ price }}</text></view>
14 + <view style="font-size: 28rpx; margin-bottom: 20rpx;">支付剩余时间 <text style="color: red;">{{ remain_time }}</text></view>
15 + <nut-button block color="#6A4925" @tap="goToPay">立即支付</nut-button>
16 + </view>
17 + </nut-action-sheet>
18 + </div>
19 +</template>
20 +
21 +<script setup>
22 +import Taro from '@tarojs/taro'
23 +import { ref, watch, onMounted } from 'vue'
24 +
25 +const props = defineProps({
26 + visible: {
27 + type: Boolean,
28 + default: false,
29 + },
30 + data: {
31 + type: Object,
32 + default: {},
33 + },
34 +});
35 +
36 +const emit = defineEmits(['close']);
37 +
38 +const onClose = () => {
39 + emit('close');
40 +}
41 +
42 +const id = ref('');
43 +const price = ref('');
44 +const remain_time = ref('');
45 +
46 +watch(
47 + () => props.visible,
48 + (val) => {
49 + if (val) {
50 + id.value = props.data.id;
51 + price.value = props.data.price;
52 + remain_time.value = props.data.remain_time;
53 + } else {
54 +
55 + }
56 + }
57 +)
58 +
59 +onMounted(() => {
60 +})
61 +
62 +const goToPay = () => {
63 + Taro.navigateTo({
64 + url: '/pages/payInfo/index?id=123',
65 + });
66 +}
67 +</script>
68 +
69 +<style lang="less">
70 +
71 +</style>
1 <!-- 1 <!--
2 * @Date: 2022-09-19 14:11:06 2 * @Date: 2022-09-19 14:11:06
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-12-20 13:35:22 4 + * @LastEditTime: 2023-12-20 15:13:49
5 * @FilePath: /meihuaApp/src/pages/confirm/index.vue 5 * @FilePath: /meihuaApp/src/pages/confirm/index.vue
6 * @Description: 确认订单页面 6 * @Description: 确认订单页面
7 --> 7 -->
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
24 <view style="font-weight: bold; color: #0B0B0B; font-size: 1rem;">预定房间数</view> 24 <view style="font-weight: bold; color: #0B0B0B; font-size: 1rem;">预定房间数</view>
25 </nut-col> 25 </nut-col>
26 <nut-col :span="8" style="text-align: center;"> 26 <nut-col :span="8" style="text-align: center;">
27 - <nut-input-number v-model="book_count" min="1" button-size="30" input-width="50" @blur="onBookCountBlur" /> 27 + <nut-input-number v-model="book_count" min="1" button-size="30" input-width="50" @blur="onBookCountBlur" @change="onBookCountChange" />
28 </nut-col> 28 </nut-col>
29 </nut-row> 29 </nut-row>
30 </view> 30 </view>
...@@ -32,14 +32,18 @@ ...@@ -32,14 +32,18 @@
32 <nut-row gutter="10"> 32 <nut-row gutter="10">
33 <nut-col span="9" class="calendar-select-left"> 33 <nut-col span="9" class="calendar-select-left">
34 <view class="text">入住日期</view> 34 <view class="text">入住日期</view>
35 - <view class="date">2023.12.07 星期四</view> 35 + <view class="date">
36 + {{ booking_info.check_in.year }}.{{ booking_info.check_in.month }}.{{ booking_info.check_in.day }} 星期{{ booking_info.check_in.day_of_week }}
37 + </view>
36 </nut-col> 38 </nut-col>
37 <nut-col span="5" class="calendar-select-center"> 39 <nut-col span="5" class="calendar-select-center">
38 - <view>共1晚</view> 40 + <view>共{{ booking_info.days }}晚</view>
39 </nut-col> 41 </nut-col>
40 <nut-col span="9" class="calendar-select-right"> 42 <nut-col span="9" class="calendar-select-right">
41 <view class="text">退房日期</view> 43 <view class="text">退房日期</view>
42 - <view class="date">2023.12.08 星期五</view> 44 + <view class="date">
45 + {{ booking_info.check_out.year }}.{{ booking_info.check_out.month }}.{{ booking_info.check_out.day }} 星期{{ booking_info.check_out.day_of_week }}
46 + </view>
43 </nut-col> 47 </nut-col>
44 </nut-row> 48 </nut-row>
45 </view> 49 </view>
...@@ -49,7 +53,7 @@ ...@@ -49,7 +53,7 @@
49 <view class="check-in-text">入住时间</view> 53 <view class="check-in-text">入住时间</view>
50 </nut-col> 54 </nut-col>
51 <nut-col span="12"> 55 <nut-col span="12">
52 - <view class="check-in-time">12月7日 14:00后</view> 56 + <view class="check-in-time">{{ booking_info.check_in.month }}月{{ booking_info.check_in.day }}日 14:00后</view>
53 </nut-col> 57 </nut-col>
54 </nut-row> 58 </nut-row>
55 <nut-row> 59 <nut-row>
...@@ -57,7 +61,7 @@ ...@@ -57,7 +61,7 @@
57 <view class="check-out-text">退房日期</view> 61 <view class="check-out-text">退房日期</view>
58 </nut-col> 62 </nut-col>
59 <nut-col span="12"> 63 <nut-col span="12">
60 - <view class="check-out-time">12月8日 12:00前</view> 64 + <view class="check-out-time">{{ booking_info.check_out.month }}月{{ booking_info.check_out.day }}日 12:00前</view>
61 </nut-col> 65 </nut-col>
62 </nut-row> 66 </nut-row>
63 <nut-row> 67 <nut-row>
...@@ -65,17 +69,17 @@ ...@@ -65,17 +69,17 @@
65 <view class="meal-text">早餐</view> 69 <view class="meal-text">早餐</view>
66 </nut-col> 70 </nut-col>
67 <nut-col span="12"> 71 <nut-col span="12">
68 - <view class="meal-count">3份</view> 72 + <view class="meal-count">{{ booking_info.days }}份</view>
69 </nut-col> 73 </nut-col>
70 </nut-row> 74 </nut-row>
71 <view class="tip"> 75 <view class="tip">
72 <view class="tip-red">*</view> 76 <view class="tip-red">*</view>
73 - <view class="tip-text">12月7日 20:00后未入住,订单将被取消</view> 77 + <view class="tip-text">{{ booking_info.check_in.month }}月{{ booking_info.check_in.day }}日 20:00后未入住,订单将被取消</view>
74 </view> 78 </view>
75 </view> 79 </view>
76 <view class="space-line"></view> 80 <view class="space-line"></view>
77 <view class="select-user"> 81 <view class="select-user">
78 - <nut-radio-group v-model="radioVal" direction="horizontal"> 82 + <nut-radio-group v-model="use_type" direction="horizontal">
79 <nut-radio label="1"> 83 <nut-radio label="1">
80 本人入住 84 本人入住
81 <template #icon><IconFont name="checked" color="gray"></IconFont></template> 85 <template #icon><IconFont name="checked" color="gray"></IconFont></template>
...@@ -95,7 +99,7 @@ ...@@ -95,7 +99,7 @@
95 </nut-col> 99 </nut-col>
96 <nut-col :span="18"> 100 <nut-col :span="18">
97 <view class="form-input"> 101 <view class="form-input">
98 - <nut-input v-model="basicData.name" class="nut-input-text" placeholder="请输入联系人" type="text" :border="false" /> 102 + <nut-input v-model="formData.name" class="nut-input-text" placeholder="请输入联系人" type="text" :border="false" />
99 </view> 103 </view>
100 </nut-col> 104 </nut-col>
101 </nut-row> 105 </nut-row>
...@@ -105,7 +109,7 @@ ...@@ -105,7 +109,7 @@
105 </nut-col> 109 </nut-col>
106 <nut-col :span="18"> 110 <nut-col :span="18">
107 <view class="form-input"> 111 <view class="form-input">
108 - <nut-input v-model="basicData.tel" class="nut-input-text" placeholder="请输入联系电话" type="number" :border="false" /> 112 + <nut-input v-model="formData.tel" class="nut-input-text" placeholder="请输入联系电话" type="number" :border="false" />
109 </view> 113 </view>
110 </nut-col> 114 </nut-col>
111 </nut-row> 115 </nut-row>
...@@ -115,18 +119,17 @@ ...@@ -115,18 +119,17 @@
115 </nut-col> 119 </nut-col>
116 <nut-col :span="18"> 120 <nut-col :span="18">
117 <view class="form-input"> 121 <view class="form-input">
118 - <nut-textarea v-model="basicData.note" class="nut-input-text" placeholder="如有其他需求,请在此填写" :autosize="{ maxHeight: 100, minHeight: 50 }" /> 122 + <nut-textarea v-model="formData.note" class="nut-input-text" placeholder="如有其他需求,请在此填写" :autosize="{ maxHeight: 100, minHeight: 50 }" />
119 </view> 123 </view>
120 </nut-col> 124 </nut-col>
121 </nut-row> 125 </nut-row>
122 - <nut-number-keyboard v-model:visible="visible" v-model="basicData.tel" maxlength="11" @close="close"> </nut-number-keyboard>
123 </view> 126 </view>
124 <view class="confirm-bar"> 127 <view class="confirm-bar">
125 <nut-row> 128 <nut-row>
126 <nut-col :span="18"> 129 <nut-col :span="18">
127 <view class="price"> 130 <view class="price">
128 - <text class="price-text-left">¥980</text> 131 + <text class="price-text-left">¥{{ room_price_info.discount * book_count * booking_info.days }}</text>
129 - <text class="price-text-right">¥1280</text> 132 + <text class="price-text-right">¥{{ room_price_info.price * book_count * booking_info.days }}</text>
130 </view> 133 </view>
131 </nut-col> 134 </nut-col>
132 <nut-col :span="6"> 135 <nut-col :span="6">
...@@ -134,6 +137,7 @@ ...@@ -134,6 +137,7 @@
134 </nut-col> 137 </nut-col>
135 </nut-row> 138 </nut-row>
136 </view> 139 </view>
140 + <payCard :visible="show_pay" :data="payData" @close="onPayClose"/>
137 </view> 141 </view>
138 </template> 142 </template>
139 143
...@@ -142,38 +146,85 @@ import Taro from '@tarojs/taro' ...@@ -142,38 +146,85 @@ import Taro from '@tarojs/taro'
142 import { ref, reactive, onMounted } from "vue"; 146 import { ref, reactive, onMounted } from "vue";
143 import { getCurrentPageParam } from "@/utils/weapp"; 147 import { getCurrentPageParam } from "@/utils/weapp";
144 import { IconFont } from '@nutui/icons-vue-taro'; 148 import { IconFont } from '@nutui/icons-vue-taro';
145 -const radioVal = ref('1'); 149 +import payCard from '@/components/payCard.vue'
146 -const book_count = ref(1); 150 +
147 -const visible = ref(false); 151 +const booking_info = ref({
148 -const basicData = reactive({ 152 + days: 1, // 入住天数
149 - name: '', 153 + check_in: {
150 - tel: '', 154 + year: '2023',
155 + month: '12',
156 + day: '07',
157 + day_of_week: '四'
158 + },
159 + check_out: {
160 + year: '2023',
161 + month: '12',
162 + day: '08',
163 + day_of_week: '五'
164 + },
165 +});
166 +
167 +const room_price_info = ref({
168 + discount: 980,
169 + price: 1280,
170 +});
171 +
172 +const book_count = ref(1); // 预定房间数
173 +
174 +const onBookCountBlur = (evt) => {
175 + if (isNaN(evt.detail.value)){
176 + book_count.value = 1;
177 + }
178 +}
179 +const onBookCountChange = (count) => {
180 + console.warn(count);
181 +}
182 +
183 +const use_type = ref('1'); // 本人入住或者帮别人订
184 +
185 +const formData = reactive({
186 + name: '11',
187 + tel: '1',
151 note: '' 188 note: ''
152 }); 189 });
153 190
191 +const show_pay = ref(false);
192 +const payData = ref({});
193 +
154 onMounted(() => { 194 onMounted(() => {
155 const { id } = getCurrentPageParam(); 195 const { id } = getCurrentPageParam();
156 console.log(id); 196 console.log(id);
157 }); 197 });
158 198
159 const goPay = () => { 199 const goPay = () => {
160 - Taro.navigateTo({ 200 + if (!formData.name) {
161 - url: '/pages/payInfo/index?id=123', 201 + Taro.showToast({
202 + title: '请填写联系人',
203 + icon: 'none',
204 + duration: 1000
162 }); 205 });
163 -} 206 + return;
207 + } else if (!formData.tel) {
208 + Taro.showToast({
209 + title: '请填写联系电话',
210 + icon: 'none',
211 + duration: 1000
212 + });
213 + return;
214 + } else {
164 215
165 -function showKeyBoard() { 216 + show_pay.value = true;
166 - console.warn(1); 217 + payData.value.id = '123';
167 - visible.value = true; 218 + payData.value.price = room_price_info.value.discount * book_count.value * booking_info.value.days;
168 -} 219 + payData.value.remain_time = '30:00';
169 -function close() { 220 + }
170 - visible.value = false;
171 } 221 }
172 222
173 -const onBookCountBlur = (evt) => { 223 +const onPayClose = () => {
174 - if (isNaN(evt.detail.value)){ 224 + show_pay.value = false;
175 - book_count.value = 1; 225 + Taro.navigateTo({
176 - } 226 + url: '/pages/payInfo/index?id=123',
227 + });
177 } 228 }
178 </script> 229 </script>
179 230
......
1 <!-- 1 <!--
2 * @Date: 2023-12-13 11:13:13 2 * @Date: 2023-12-13 11:13:13
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-12-19 16:57:41 4 + * @LastEditTime: 2023-12-20 15:12:46
5 * @FilePath: /meihuaApp/src/pages/my/index.vue 5 * @FilePath: /meihuaApp/src/pages/my/index.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -36,15 +36,10 @@ ...@@ -36,15 +36,10 @@
36 </nut-tabs> 36 </nut-tabs>
37 </view> 37 </view>
38 </view> 38 </view>
39 - <nut-action-sheet v-model:visible="visible" title=""> 39 +
40 - <view style="padding: 2rem 1rem; text-align: center;">
41 - <view style="font-size: 32rpx;">实付金额</view>
42 - <view style="color: red; margin: 10rpx 0;"><text style="font-size: 50rpx;">¥</text><text style="font-size: 80rpx;">980</text></view>
43 - <view style="font-size: 28rpx; margin-bottom: 20rpx;">支付剩余时间 <text style="color: red;">29:59</text></view>
44 - <nut-button block color="#6A4925" @tap="goToPay">立即支付</nut-button>
45 - </view>
46 - </nut-action-sheet>
47 <nav-bar activated="my" /> 40 <nav-bar activated="my" />
41 +
42 + <payCard :visible="show_pay" :data="payData" @close="onPayClose"/>
48 </view> 43 </view>
49 </template> 44 </template>
50 45
...@@ -54,6 +49,7 @@ import { ref } from "vue"; ...@@ -54,6 +49,7 @@ import { ref } from "vue";
54 import { IconFont } from '@nutui/icons-vue-taro'; 49 import { IconFont } from '@nutui/icons-vue-taro';
55 import navBar from '@/components/navBar.vue' 50 import navBar from '@/components/navBar.vue'
56 import orderCard from '@/components/orderCard.vue' 51 import orderCard from '@/components/orderCard.vue'
52 +import payCard from '@/components/payCard.vue'
57 53
58 const refScrollView = ref(null); 54 const refScrollView = ref(null);
59 55
...@@ -72,21 +68,24 @@ const tabList = ref([{ ...@@ -72,21 +68,24 @@ const tabList = ref([{
72 key: '3', 68 key: '3',
73 }]); 69 }]);
74 70
75 -const visible = ref(false); 71 +
72 +const show_pay = ref(false);
73 +const payData = ref({});
76 const onPay = (id) => { 74 const onPay = (id) => {
77 - visible.value = !visible.value;
78 console.warn(id); 75 console.warn(id);
79 // Taro.showToast({ 76 // Taro.showToast({
80 // title: '支付已超时', 77 // title: '支付已超时',
81 // icon: 'error', 78 // icon: 'error',
82 // duration: 2000 79 // duration: 2000
83 // }); 80 // });
81 + show_pay.value = true;
82 + payData.value.id = '123';
83 + payData.value.price = 1200;
84 + payData.value.remain_time = '30:00';
84 } 85 }
85 -const goToPay = () => { 86 +
86 - visible.value = false; 87 +const onPayClose = () => {
87 - Taro.navigateTo({ 88 + show_pay.value = false;
88 - url: '/pages/payInfo/index?id=123',
89 - });
90 } 89 }
91 </script> 90 </script>
92 91
......