hookehuyr

订房页面,房间详情页API联调

1 /* 1 /*
2 * @Date: 2023-12-22 10:29:37 2 * @Date: 2023-12-22 10:29:37
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-12-26 09:40:57 4 + * @LastEditTime: 2023-12-26 16:09:24
5 * @FilePath: /meihuaApp/src/api/index.js 5 * @FilePath: /meihuaApp/src/api/index.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
...@@ -14,6 +14,7 @@ const Api = { ...@@ -14,6 +14,7 @@ const Api = {
14 SAVE_CUSTOMER_INFO: '/srv/?a=room_order&t=save_customer_info', 14 SAVE_CUSTOMER_INFO: '/srv/?a=room_order&t=save_customer_info',
15 SYS_PARAM: '/srv/?a=room_order&t=sys_param', 15 SYS_PARAM: '/srv/?a=room_order&t=sys_param',
16 GET_LIST: '/srv/?a=room_data&t=get_list', 16 GET_LIST: '/srv/?a=room_data&t=get_list',
17 + GET_ROOM: '/srv/?a=room_data&t=get_room',
17 } 18 }
18 19
19 /** 20 /**
...@@ -59,3 +60,12 @@ export const sysParamAPI = (params) => fn(fetch.get(Api.SYS_PARAM, params)); ...@@ -59,3 +60,12 @@ export const sysParamAPI = (params) => fn(fetch.get(Api.SYS_PARAM, params));
59 * @returns 60 * @returns
60 */ 61 */
61 export const getListAPI = (params) => fn(fetch.get(Api.GET_LIST, params)); 62 export const getListAPI = (params) => fn(fetch.get(Api.GET_LIST, params));
63 +
64 +/**
65 + * @description: 获取房间详情
66 + * @param start_date 入住时间
67 + * @param end_date 离店时间
68 + * @param room_type floor/room
69 + * @returns
70 + */
71 +export const getRoomAPI = (params) => fn(fetch.get(Api.GET_ROOM, params));
......
1 <!-- 1 <!--
2 * @Date: 2023-12-13 13:42:23 2 * @Date: 2023-12-13 13:42:23
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-12-26 10:47:49 4 + * @LastEditTime: 2023-12-26 16:14:35
5 * @FilePath: /meihuaApp/src/components/roomCard.vue 5 * @FilePath: /meihuaApp/src/components/roomCard.vue
6 * @Description: 房间详情组件 6 * @Description: 房间详情组件
7 --> 7 -->
...@@ -105,7 +105,6 @@ watch( ...@@ -105,7 +105,6 @@ watch(
105 const dates = getTodayAndTomorrow(); 105 const dates = getTodayAndTomorrow();
106 106
107 const handleTap = () => { 107 const handleTap = () => {
108 - let id = 'abc';
109 if (!startDate.value) { 108 if (!startDate.value) {
110 startDate.value = dates.today; 109 startDate.value = dates.today;
111 } 110 }
...@@ -113,10 +112,11 @@ const handleTap = () => { ...@@ -113,10 +112,11 @@ const handleTap = () => {
113 endDate.value = dates.tomorrow; 112 endDate.value = dates.tomorrow;
114 } 113 }
115 Taro.navigateTo({ 114 Taro.navigateTo({
116 - url: `../detail/index?id=${id}&start_date=${startDate.value}&end_date=${endDate.value}`, 115 + url: `../detail/index?id=${id.value}&room_type=${room_type.value}&start_date=${startDate.value}&end_date=${endDate.value}`,
117 }); 116 });
118 } 117 }
119 118
119 +const id = ref(''); // 房间id
120 const cover = ref(''); // 封面图 120 const cover = ref(''); // 封面图
121 const title = ref(''); // 标题 121 const title = ref(''); // 标题
122 const original_price = ref(''); // 原价 122 const original_price = ref(''); // 原价
...@@ -124,8 +124,10 @@ const discount_price = ref(''); // 优惠价 ...@@ -124,8 +124,10 @@ const discount_price = ref(''); // 优惠价
124 const capacity = ref(''); // 能住几个人 124 const capacity = ref(''); // 能住几个人
125 const num = ref(''); // 可售数量 125 const num = ref(''); // 可售数量
126 const room_num = ref(''); // 房间描述 两室 126 const room_num = ref(''); // 房间描述 两室
127 +const room_type = ref(''); //
127 128
128 onMounted(() => { 129 onMounted(() => {
130 + id.value = props.data.id;
129 cover.value = props.data.cover ? props.data.cover : 'https://cdn.ipadbiz.cn/meihua/img1@2x.png'; 131 cover.value = props.data.cover ? props.data.cover : 'https://cdn.ipadbiz.cn/meihua/img1@2x.png';
130 title.value = props.data.title; 132 title.value = props.data.title;
131 room_num.value = props.data.room_num; 133 room_num.value = props.data.room_num;
...@@ -133,6 +135,7 @@ onMounted(() => { ...@@ -133,6 +135,7 @@ onMounted(() => {
133 num.value = props.data.num; 135 num.value = props.data.num;
134 original_price.value = props.data.original_price; 136 original_price.value = props.data.original_price;
135 discount_price.value = props.data.discount_price; 137 discount_price.value = props.data.discount_price;
138 + room_type.value = props.data.room_type;
136 }); 139 });
137 140
138 </script> 141 </script>
......
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-25 12:48:26 4 + * @LastEditTime: 2023-12-26 17:21:40
5 * @FilePath: /meihuaApp/src/pages/confirm/index.vue 5 * @FilePath: /meihuaApp/src/pages/confirm/index.vue
6 * @Description: 确认订单页面 6 * @Description: 确认订单页面
7 --> 7 -->
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
10 <view class="book-info-desc"> 10 <view class="book-info-desc">
11 <nut-row> 11 <nut-row>
12 <nut-col :span="16"> 12 <nut-col :span="16">
13 - <view style="font-weight: bold; color: #0B0B0B; font-size: 1.15rem;">非凡魅力豪华总统套房</view> 13 + <view style="font-weight: bold; color: #0B0B0B; font-size: 1.15rem;">{{ state.roomInfo.title }}</view>
14 - <view style="color: #7D7C7C; font-size: 0.8rem; margin-top: 0.15rem;">两室 宜住3人</view> 14 + <view style="color: #7D7C7C; font-size: 0.8rem; margin-top: 0.15rem;">{{ state.roomInfo.room_num }}室 宜住{{ state.roomInfo.capacity }}人</view>
15 </nut-col> 15 </nut-col>
16 <nut-col :span="8"> 16 <nut-col :span="8">
17 - <image style="width: 100%; height: 50px; border-radius: 0.25rem;" mode="aspectFill" src="https://cdn.ipadbiz.cn/meihua/img1@2x.png" /> 17 + <image style="width: 100%; height: 50px; border-radius: 0.25rem;" mode="aspectFill" :src="state.roomInfo.cover" />
18 </nut-col> 18 </nut-col>
19 </nut-row> 19 </nut-row>
20 </view> 20 </view>
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
53 <view class="check-in-text">入住时间</view> 53 <view class="check-in-text">入住时间</view>
54 </nut-col> 54 </nut-col>
55 <nut-col span="12"> 55 <nut-col span="12">
56 - <view class="check-in-time">{{ booking_info.check_in.month }}月{{ booking_info.check_in.day }}日 14:00 后</view> 56 + <view class="check-in-time">{{ booking_info.check_in.month }}月{{ booking_info.check_in.day }}日 {{ state.sysInfo.check_in_time }} 后</view>
57 </nut-col> 57 </nut-col>
58 </nut-row> 58 </nut-row>
59 <nut-row> 59 <nut-row>
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
61 <view class="check-out-text">退房日期</view> 61 <view class="check-out-text">退房日期</view>
62 </nut-col> 62 </nut-col>
63 <nut-col span="12"> 63 <nut-col span="12">
64 - <view class="check-out-time">{{ booking_info.check_out.month }}月{{ booking_info.check_out.day }}日 12:00 前</view> 64 + <view class="check-out-time">{{ booking_info.check_out.month }}月{{ booking_info.check_out.day }}日 {{ state.sysInfo.check_out_time }} 前</view>
65 </nut-col> 65 </nut-col>
66 </nut-row> 66 </nut-row>
67 <nut-row> 67 <nut-row>
...@@ -69,12 +69,12 @@ ...@@ -69,12 +69,12 @@
69 <view class="meal-text">早餐</view> 69 <view class="meal-text">早餐</view>
70 </nut-col> 70 </nut-col>
71 <nut-col span="12"> 71 <nut-col span="12">
72 - <view class="meal-count">{{ booking_info.days }} 份</view> 72 + <view class="meal-count">{{ state.roomInfo.capacity }} 份</view>
73 </nut-col> 73 </nut-col>
74 </nut-row> 74 </nut-row>
75 <view class="tip"> 75 <view class="tip">
76 <view class="tip-red">*</view> 76 <view class="tip-red">*</view>
77 - <view class="tip-text">{{ booking_info.check_in.month }}月{{ booking_info.check_in.day }}日 20:00后未入住,订单将被取消</view> 77 + <view class="tip-text">{{ booking_info.check_in.month }}月{{ booking_info.check_in.day }}日 {{ state.sysInfo.last_check_time }}后未入住,订单将被取消</view>
78 </view> 78 </view>
79 </view> 79 </view>
80 <view class="space-line"></view> 80 <view class="space-line"></view>
...@@ -149,6 +149,7 @@ import { ref, reactive, onMounted, computed } from "vue"; ...@@ -149,6 +149,7 @@ import { ref, reactive, onMounted, computed } from "vue";
149 import { getCurrentPageParam } from "@/utils/weapp"; 149 import { getCurrentPageParam } from "@/utils/weapp";
150 import { IconFont } from '@nutui/icons-vue-taro'; 150 import { IconFont } from '@nutui/icons-vue-taro';
151 import payCard from '@/components/payCard.vue' 151 import payCard from '@/components/payCard.vue'
152 +import { getRoomAPI, showMyInfoAPI, sysParamAPI } from '@/api/index'
152 153
153 const booking_info = ref({ 154 const booking_info = ref({
154 days: 1, // 入住天数 155 days: 1, // 入住天数
...@@ -167,8 +168,8 @@ const booking_info = ref({ ...@@ -167,8 +168,8 @@ const booking_info = ref({
167 }); 168 });
168 169
169 const room_price_info = ref({ 170 const room_price_info = ref({
170 - discount: 980.18, 171 + discount: 0,
171 - price: 1280.25, 172 + price: 0,
172 }); 173 });
173 174
174 const price_discount = computed(() => { 175 const price_discount = computed(() => {
...@@ -193,15 +194,21 @@ const onBookCountChange = (count) => { ...@@ -193,15 +194,21 @@ const onBookCountChange = (count) => {
193 const use_type = ref('1'); // 本人入住或者帮别人订 194 const use_type = ref('1'); // 本人入住或者帮别人订
194 195
195 const formData = reactive({ 196 const formData = reactive({
196 - name: '11', 197 + name: '',
197 - tel: '1', 198 + tel: '',
198 note: '' 199 note: ''
199 }); 200 });
200 201
202 +const state = reactive({
203 + cover: '',
204 + roomInfo: {},
205 + sysInfo: {},
206 +});
207 +
201 const show_pay = ref(false); 208 const show_pay = ref(false);
202 const payData = ref({}); 209 const payData = ref({});
203 210
204 -onMounted(() => { 211 +onMounted(async () => {
205 const { id, start_date, end_date, between_date, start_date_week, end_date_week } = getCurrentPageParam(); 212 const { id, start_date, end_date, between_date, start_date_week, end_date_week } = getCurrentPageParam();
206 booking_info.value.days = between_date; 213 booking_info.value.days = between_date;
207 let check_in = start_date.split('-'); 214 let check_in = start_date.split('-');
...@@ -219,6 +226,25 @@ onMounted(() => { ...@@ -219,6 +226,25 @@ onMounted(() => {
219 day: check_out[2], 226 day: check_out[2],
220 day_of_week: end_date_week ? JSON.parse(end_date_week) : '' 227 day_of_week: end_date_week ? JSON.parse(end_date_week) : ''
221 } 228 }
229 + // 获取房间详情
230 + let params = getCurrentPageParam();
231 + const roomData = await getRoomAPI({ i: params.id, start_date: params.start_date, end_date: params.end_date, room_type: params.room_type });
232 + if (roomData.code) {
233 + state.roomInfo = roomData.data;
234 + room_price_info.value.discount = +roomData.data.discount_price;
235 + room_price_info.value.price = +roomData.data.original_price;
236 + }
237 + // 获取系统参数
238 + const sysData = await sysParamAPI();
239 + if (sysData.code) {
240 + state.sysInfo = sysData.data;
241 + }
242 + // 获取用户信息
243 + const myInfoData = await showMyInfoAPI();
244 + if (myInfoData.code) {
245 + formData.name = myInfoData.data.wxapp_user_name;
246 + formData.tel = myInfoData.data.wxapp_user_phone;
247 + }
222 }); 248 });
223 249
224 const goPay = () => { 250 const goPay = () => {
...@@ -237,22 +263,25 @@ const goPay = () => { ...@@ -237,22 +263,25 @@ const goPay = () => {
237 }); 263 });
238 return; 264 return;
239 } else { 265 } else {
240 - // TODO: 保存订房信息 266 + // TODO: 保存订房信息
241 console.warn('保存订房信息', formData); 267 console.warn('保存订房信息', formData);
242 - // TODO: 跳转支付页面 268 + // TODO: 订房成功后,弹出支付页面
269 + // let params = getCurrentPageParam();
243 setTimeout(() => { 270 setTimeout(() => {
244 show_pay.value = true; 271 show_pay.value = true;
245 - payData.value.id = '123'; 272 + payData.value.id = '订单ID';
246 payData.value.price = room_price_info.value.discount * book_count.value * booking_info.value.days; 273 payData.value.price = room_price_info.value.discount * book_count.value * booking_info.value.days;
247 - payData.value.remain_time = '1000'; 274 + payData.value.remain_time = '1000'; // 支付失效秒数
248 }, 1000); 275 }, 1000);
249 } 276 }
250 } 277 }
251 278
279 +// 单击支付弹框关闭回调
252 const onPayClose = () => { 280 const onPayClose = () => {
253 show_pay.value = false; 281 show_pay.value = false;
282 + // 订房成功页面,不一定支付了
254 Taro.navigateTo({ 283 Taro.navigateTo({
255 - url: '/pages/payInfo/index?id=123', 284 + url: '/pages/payInfo/index',
256 }); 285 });
257 } 286 }
258 </script> 287 </script>
......
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-25 16:09:56 4 + * @LastEditTime: 2023-12-26 17:11:50
5 * @FilePath: /meihuaApp/src/pages/detail/index.vue 5 * @FilePath: /meihuaApp/src/pages/detail/index.vue
6 * @Description: 房间详情页面 6 * @Description: 房间详情页面
7 --> 7 -->
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
13 </nut-swiper-item> 13 </nut-swiper-item>
14 </nut-swiper> 14 </nut-swiper>
15 <view class="detail-info-wrapper"> 15 <view class="detail-info-wrapper">
16 - <view class="detail-info-title">非凡魅力豪华总统套房</view> 16 + <view class="detail-info-title">{{ state.roomInfo.title }}</view>
17 - <view class="detail-info-content">两室 宜住3人</view> 17 + <view class="detail-info-content">{{ state.roomInfo.room_num }}室 宜住{{ state.roomInfo.capacity }}人</view>
18 </view> 18 </view>
19 <!-- 日历选择器 --> 19 <!-- 日历选择器 -->
20 <view v-if="showBook" class="book-cal"> 20 <view v-if="showBook" class="book-cal">
...@@ -22,16 +22,16 @@ ...@@ -22,16 +22,16 @@
22 </view> 22 </view>
23 <view v-else class="no-calendar-border"></view> 23 <view v-else class="no-calendar-border"></view>
24 <!-- END --> 24 <!-- END -->
25 - <view class="detail-introduce-title">房间介绍</view> 25 + <view v-if="state.roomInfo.description" class="detail-introduce-title">房间介绍</view>
26 <view class="detail-introduce-html"> 26 <view class="detail-introduce-html">
27 - <view id="taro_html" v-html="taro_html" class="taro_html"></view> 27 + <view id="taro_html" v-html="state.roomInfo.description" class="taro_html"></view>
28 </view> 28 </view>
29 <view v-if="showBook" class="book-bar"> 29 <view v-if="showBook" class="book-bar">
30 <nut-row> 30 <nut-row>
31 <nut-col :span="18"> 31 <nut-col :span="18">
32 <view class="book-price"> 32 <view class="book-price">
33 - <view class="price"><nut-price :price="980" size="large" /></view> 33 + <view class="price"><nut-price :price="state.roomInfo.discount_price" size="large" /></view>
34 - <view class="old-price"><nut-price :price="1280" size="small" strike-through style="color: #7D7C7C;" /></view> 34 + <view class="old-price"><nut-price :price="state.roomInfo.original_price" size="small" strike-through style="color: #7D7C7C;" /></view>
35 </view> 35 </view>
36 </nut-col> 36 </nut-col>
37 <nut-col :span="6"> 37 <nut-col :span="6">
...@@ -48,6 +48,7 @@ import Taro from '@tarojs/taro' ...@@ -48,6 +48,7 @@ import Taro from '@tarojs/taro'
48 import { ref, computed, reactive, onMounted } from "vue"; 48 import { ref, computed, reactive, onMounted } from "vue";
49 import calendarSelect from '@/components/calendarSelect.vue' 49 import calendarSelect from '@/components/calendarSelect.vue'
50 import { getCurrentPageParam } from "@/utils/weapp"; 50 import { getCurrentPageParam } from "@/utils/weapp";
51 +import { getRoomAPI, showMyInfoAPI } from '@/api/index'
51 52
52 /** 53 /**
53 * 获取日期星期几 54 * 获取日期星期几
...@@ -106,76 +107,100 @@ const getDayDifference = (startDate, endDate) => { ...@@ -106,76 +107,100 @@ const getDayDifference = (startDate, endDate) => {
106 return dayDiff; 107 return dayDiff;
107 } 108 }
108 109
109 -const taro_html = ref('<div>123</div>'); 110 +// 是否可以订房
110 -
111 -// TODO: 到时候根据后端实际字段修改
112 -// const book_status = ref('已约满');
113 -const book_status = ref('');
114 -
115 const showBook = computed(() => { 111 const showBook = computed(() => {
116 - return book_status.value !== '已约满' 112 + return state.roomInfo.num > 0;
117 }); 113 });
118 114
115 +const page = ref('1'); // banner图索引
116 +
119 const start_date = ref(''); 117 const start_date = ref('');
120 const end_date = ref(''); 118 const end_date = ref('');
121 const between_date = ref(''); 119 const between_date = ref('');
122 const start_date_week = ref(''); 120 const start_date_week = ref('');
123 const end_date_week = ref(''); 121 const end_date_week = ref('');
124 122
125 -const onDatesChange = ({ startDate, endDate, betweenDate, startDateWeek, endDateWeek }) => { 123 +// 日期选择回调
124 +const onDatesChange = async ({ startDate, endDate, betweenDate, startDateWeek, endDateWeek }) => {
126 start_date.value = startDate; 125 start_date.value = startDate;
127 end_date.value = endDate; 126 end_date.value = endDate;
128 start_date_week.value = startDateWeek; 127 start_date_week.value = startDateWeek;
129 end_date_week.value = endDateWeek; 128 end_date_week.value = endDateWeek;
130 between_date.value = betweenDate; 129 between_date.value = betweenDate;
130 + // 获取房间详情
131 + let params = getCurrentPageParam();
132 + const { code, data } = await getRoomAPI({ i: params.id, start_date: start_date.value, end_date: end_date.value, room_type: params.room_type });
133 + if (code) {
134 + state.roomInfo = data;
135 + // 轮播图
136 + if (state.roomInfo.banner.length) {
137 + state.roomInfo.banner.forEach(item => {
138 + state.imgData.push({
139 + src: item
140 + })
141 + });
142 + }
143 + }
131 } 144 }
132 145
133 -onMounted(() => { 146 +const state = reactive({
147 + showPreview: false,
148 + imgData: [],
149 + roomInfo: {},
150 + phone: '',
151 +});
152 +
153 +onMounted(async () => {
134 let params = getCurrentPageParam(); 154 let params = getCurrentPageParam();
135 - console.warn('id', params.id); 155 + // 日历控件日期初始化
136 - console.warn('start_date', params.start_date);
137 - console.warn('end_date', params.end_date);
138 start_date.value = params.start_date; 156 start_date.value = params.start_date;
139 end_date.value = params.end_date; 157 end_date.value = params.end_date;
140 between_date.value = getDayDifference(params.start_date, params.end_date); 158 between_date.value = getDayDifference(params.start_date, params.end_date);
141 start_date_week.value = JSON.stringify(getDayOfWeek(params.start_date)); 159 start_date_week.value = JSON.stringify(getDayOfWeek(params.start_date));
142 end_date_week.value = JSON.stringify(getDayOfWeek(params.end_date)); 160 end_date_week.value = JSON.stringify(getDayOfWeek(params.end_date));
161 + // 获取房间详情
162 + const roomData = await getRoomAPI({ i: params.id, start_date: params.start_date, end_date: params.end_date, room_type: params.room_type });
163 + if (roomData.code) {
164 + state.roomInfo = roomData.data;
165 + // 轮播图
166 + if (state.roomInfo.banner.length) {
167 + state.roomInfo.banner.forEach(item => {
168 + state.imgData.push({
169 + src: item
170 + })
171 + });
172 + }
173 + }
143 }); 174 });
144 175
145 -const page = ref(1); 176 +// 预定房间
146 - 177 +const goToConfirm = async () => {
147 -const goToConfirm = () => { 178 + // 获取用户信息
148 - // TODO: 需要查询个人信息是否留了手机号码 179 + const myInfoData = await showMyInfoAPI();
149 - let tel = '123'; 180 + if (myInfoData.code) {
150 - if (tel) { 181 + state.phone = myInfoData.data.wxapp_user_phone;
182 + }
183 + let params = getCurrentPageParam();
184 + if (state.phone) {
151 Taro.navigateTo({ 185 Taro.navigateTo({
152 - url: `/pages/confirm/index?id=123&start_date=${start_date.value}&end_date=${end_date.value}&between_date=${between_date.value}&start_date_week=${start_date_week.value}&end_date_week=${end_date_week.value}`, 186 + url: `/pages/confirm/index?id=${params.id}&start_date=${start_date.value}&end_date=${end_date.value}&between_date=${between_date.value}&start_date_week=${start_date_week.value}&end_date_week=${end_date_week.value}&room_type=${params.room_type}`,
153 }); 187 });
154 - } else { 188 + } else { // 没有手机号记录,需要绑定手机号后再预定房间
155 - Taro.navigateTo({ 189 + Taro.showToast({
156 - url: `/pages/login/index?page=detail`, 190 + title: '请先绑定手机号',
191 + icon: 'none',
192 + duration: 2000,
193 + success: () => {
194 + setTimeout(() => {
195 + Taro.navigateTo({
196 + url: `/pages/login/index?page=detail`,
197 + });
198 + }, 1000);
199 + },
157 }); 200 });
158 } 201 }
159 } 202 }
160 203
161 -const state = reactive({
162 - showPreview: false,
163 - imgData: [
164 - {
165 - src: 'https://cdn.ipadbiz.cn/meihua/img1@2x.png'
166 - },
167 - {
168 - src: 'https://cdn.ipadbiz.cn/meihua/banner1@2x.png'
169 - },
170 - {
171 - src: 'https://cdn.ipadbiz.cn/meihua/img1@2x.png'
172 - },
173 - {
174 - src: 'https://cdn.ipadbiz.cn/meihua/img1@2x.png'
175 - }
176 - ]
177 -});
178 -
179 const showFn = () => { 204 const showFn = () => {
180 state.showPreview = true; 205 state.showPreview = true;
181 }; 206 };
...@@ -197,7 +222,7 @@ export default { ...@@ -197,7 +222,7 @@ export default {
197 // 设置菜单中的转发按钮触发转发事件时的转发内容 222 // 设置菜单中的转发按钮触发转发事件时的转发内容
198 var shareObj = { 223 var shareObj = {
199 title: "梅花岛-房间详情", // 默认是小程序的名称(可以写slogan等) 224 title: "梅花岛-房间详情", // 默认是小程序的名称(可以写slogan等)
200 - path: `pages/detail/index?id=${params.id}&start_date=${params.start_date}&end_date=${params.end_date}`, // 默认是当前页面,必须是以‘/'开头的完整路径 225 + path: `pages/detail/index?id=${params.id}&start_date=${params.start_date}&end_date=${params.end_date}&room_type=${params.room_type}`, // 默认是当前页面,必须是以‘/'开头的完整路径
201 imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4 226 imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
202 success: function (res) { 227 success: function (res) {
203 // 转发成功之后的回调 228 // 转发成功之后的回调
......
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-26 11:15:51 4 + * @LastEditTime: 2023-12-26 16:11:45
5 * @FilePath: /meihuaApp/src/pages/index/index.vue 5 * @FilePath: /meihuaApp/src/pages/index/index.vue
6 * @Description: 首页 6 * @Description: 首页
7 --> 7 -->
...@@ -129,7 +129,7 @@ export default { ...@@ -129,7 +129,7 @@ export default {
129 const navHeight = await $('#navbar-page').height(); 129 const navHeight = await $('#navbar-page').height();
130 this.indexCoverHeight = windowHeight - navHeight; 130 this.indexCoverHeight = windowHeight - navHeight;
131 }, 500); 131 }, 500);
132 - // 132 + // 获取系统参数
133 const { code, data } = await sysParamAPI(); 133 const { code, data } = await sysParamAPI();
134 if (code) { 134 if (code) {
135 this.banner_url = data.home_banner ? data.home_banner : 'https://cdn.ipadbiz.cn/meihua/banner1@2x.png'; 135 this.banner_url = data.home_banner ? data.home_banner : 'https://cdn.ipadbiz.cn/meihua/banner1@2x.png';
...@@ -168,10 +168,10 @@ export default { ...@@ -168,10 +168,10 @@ export default {
168 this.page = this.page + 1; 168 this.page = this.page + 1;
169 this.flag = true; 169 this.flag = true;
170 } else { 170 } else {
171 - Taro.showToast({ 171 + // Taro.showToast({
172 - title: '没有更多了', 172 + // title: '没有更多了',
173 - icon: 'none' 173 + // icon: 'none'
174 - }); 174 + // });
175 } 175 }
176 } 176 }
177 }, 177 },
......