hookehuyr

价格显示优化

...@@ -22,6 +22,7 @@ declare module '@vue/runtime-core' { ...@@ -22,6 +22,7 @@ declare module '@vue/runtime-core' {
22 NutInput: typeof import('@nutui/nutui-taro')['Input'] 22 NutInput: typeof import('@nutui/nutui-taro')['Input']
23 NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber'] 23 NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber']
24 NutPopup: typeof import('@nutui/nutui-taro')['Popup'] 24 NutPopup: typeof import('@nutui/nutui-taro')['Popup']
25 + NutPrice: typeof import('@nutui/nutui-taro')['Price']
25 NutRadio: typeof import('@nutui/nutui-taro')['Radio'] 26 NutRadio: typeof import('@nutui/nutui-taro')['Radio']
26 NutRadioGroup: typeof import('@nutui/nutui-taro')['RadioGroup'] 27 NutRadioGroup: typeof import('@nutui/nutui-taro')['RadioGroup']
27 NutRow: typeof import('@nutui/nutui-taro')['Row'] 28 NutRow: typeof import('@nutui/nutui-taro')['Row']
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
18 <nut-row> 18 <nut-row>
19 <nut-col span="18"> 19 <nut-col span="18">
20 <view class="order-card-price-text"> 20 <view class="order-card-price-text">
21 - <text class="left"><text style="font-size: 30rpx;">¥</text>980</text> 21 + <text class="left"><nut-price :price="980" size="normal" /></text>
22 - <text class="right">¥1280</text> 22 + <text class="right"><nut-price :price="1280" size="small" strike-through style="color: #7D7C7C;" /></text>
23 </view> 23 </view>
24 </nut-col> 24 </nut-col>
25 <nut-col span="6" class="order-card-price-num"> 25 <nut-col span="6" class="order-card-price-num">
......
1 <!-- 1 <!--
2 * @Date: 2023-12-20 14:11:11 2 * @Date: 2023-12-20 14:11:11
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-12-20 16:25:26 4 + * @LastEditTime: 2023-12-25 07:08:02
5 * @FilePath: /meihuaApp/src/components/payCard.vue 5 * @FilePath: /meihuaApp/src/components/payCard.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -97,6 +97,38 @@ const goToPay = () => { ...@@ -97,6 +97,38 @@ const goToPay = () => {
97 Taro.navigateTo({ 97 Taro.navigateTo({
98 url: '/pages/payInfo/index?id=123', 98 url: '/pages/payInfo/index?id=123',
99 }); 99 });
100 + // this.$parent.sdk.post('c/app/prepay', {
101 + // id: this.params.id
102 + // }).then(res => {
103 + // if (res.data.ret === 'OK') {
104 + // let pay = res.data.content.payargs;
105 + // wx.requestPayment({
106 + // timeStamp: pay.timeStamp,
107 + // nonceStr: pay.nonceStr,
108 + // package: pay.package,
109 + // signType: pay.signType,
110 + // paySign: pay.paySign,
111 + // success: (result) => {
112 + // that.$parent.sdk.post('c/order/paySuccess', {
113 + // id: that.params.id
114 + // }).then(pRes => {
115 + // if (pRes.data.ret === 'OK') {
116 + // that.Toast('success', '感谢您的捐赠', 3000)
117 + // wx.navigateBack({
118 + // delta: 1
119 + // });
120 + // } else {
121 + // that.Toast('fail', pRes.data.err, 3000);
122 + // }
123 + // }).catch(err => {
124 + // console.error(err)
125 + // })
126 + // }
127 + // });
128 + // } else {
129 + // this.Toast('fail', res.data.msg, 3000);
130 + // }
131 + // })
100 } 132 }
101 </script> 133 </script>
102 134
......
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-25 11:04:56 4 + * @LastEditTime: 2023-12-25 12:49:46
5 * @FilePath: /meihuaApp/src/components/roomCard.vue 5 * @FilePath: /meihuaApp/src/components/roomCard.vue
6 * @Description: 房间详情组件 6 * @Description: 房间详情组件
7 --> 7 -->
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
15 <view class="room-info-desc">两室 宜住3人</view> 15 <view class="room-info-desc">两室 宜住3人</view>
16 </nut-col> 16 </nut-col>
17 <nut-col span="6" class="room-info-right"> 17 <nut-col span="6" class="room-info-right">
18 - <view class="room-info-discount"><text style="font-size: 25rpx;">¥</text>980</view> 18 + <view class="room-info-discount"><nut-price :price="980" size="normal" /></view>
19 - <view class="room-info-price">¥1280</view> 19 + <view class="room-info-price"><nut-price :price="1280" size="small" strike-through style="color: #7D7C7C;" /></view>
20 </nut-col> 20 </nut-col>
21 </nut-row> 21 </nut-row>
22 </view> 22 </view>
...@@ -160,10 +160,6 @@ onMounted(() => { ...@@ -160,10 +160,6 @@ onMounted(() => {
160 } 160 }
161 .room-info-price { 161 .room-info-price {
162 float: right; 162 float: right;
163 - color: #7D7C7C;
164 - // font-weight: bold;
165 - font-size: 0.8rem;
166 - text-decoration: line-through;
167 } 163 }
168 } 164 }
169 } 165 }
......
...@@ -150,10 +150,8 @@ ...@@ -150,10 +150,8 @@
150 font-weight: bold; 150 font-weight: bold;
151 } 151 }
152 .price-text-right { 152 .price-text-right {
153 - color: #7d7c7c; 153 + margin-left: 5rpx;
154 - text-decoration: line-through; 154 + margin-top: 8rpx;
155 - font-size: 0.85rem;
156 - margin-left: 5px;
157 } 155 }
158 } 156 }
159 .confirm-btn { 157 .confirm-btn {
......
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 10:57:42 4 + * @LastEditTime: 2023-12-25 12:48:26
5 * @FilePath: /meihuaApp/src/pages/confirm/index.vue 5 * @FilePath: /meihuaApp/src/pages/confirm/index.vue
6 * @Description: 确认订单页面 6 * @Description: 确认订单页面
7 --> 7 -->
...@@ -130,8 +130,8 @@ ...@@ -130,8 +130,8 @@
130 <nut-row> 130 <nut-row>
131 <nut-col :span="18"> 131 <nut-col :span="18">
132 <view class="price"> 132 <view class="price">
133 - <text class="price-text-left"><text style="font-size: 32rpx;">¥</text>{{ room_price_info.discount * book_count * booking_info.days }}</text> 133 + <view class="price-text-left"><nut-price :price="price_discount" size="large" /></view>
134 - <text class="price-text-right">¥{{ room_price_info.price * book_count * booking_info.days }}</text> 134 + <view class="price-text-right"><nut-price :price="price_old" size="small" strike-through style="color: #7D7C7C;" /></view>
135 </view> 135 </view>
136 </nut-col> 136 </nut-col>
137 <nut-col :span="6"> 137 <nut-col :span="6">
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
145 145
146 <script setup> 146 <script setup>
147 import Taro from '@tarojs/taro' 147 import Taro from '@tarojs/taro'
148 -import { ref, reactive, onMounted } from "vue"; 148 +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'
...@@ -167,8 +167,16 @@ const booking_info = ref({ ...@@ -167,8 +167,16 @@ const booking_info = ref({
167 }); 167 });
168 168
169 const room_price_info = ref({ 169 const room_price_info = ref({
170 - discount: 980, 170 + discount: 980.18,
171 - price: 1280, 171 + price: 1280.25,
172 +});
173 +
174 +const price_discount = computed(() => {
175 + return ((room_price_info.value.discount * book_count.value * booking_info.value.days) * 100) / 100;
176 +});
177 +
178 +const price_old = computed(() => {
179 + return ((room_price_info.value.price * book_count.value * booking_info.value.days) * 100) / 100;
172 }); 180 });
173 181
174 const book_count = ref(1); // 预定房间数 182 const book_count = ref(1); // 预定房间数
......
...@@ -48,7 +48,8 @@ ...@@ -48,7 +48,8 @@
48 color: #EB2E2E; font-size: 1.3rem; font-weight: bold; 48 color: #EB2E2E; font-size: 1.3rem; font-weight: bold;
49 } 49 }
50 .old-price { 50 .old-price {
51 - color: #7D7C7C; text-decoration: line-through; font-size: 0.85rem; margin-left: 5px; 51 + margin-left: 5rpx;
52 + margin-top: 8rpx;
52 } 53 }
53 } 54 }
54 .book-btn { 55 .book-btn {
......
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 10:56:14 4 + * @LastEditTime: 2023-12-25 12:42:48
5 * @FilePath: /meihuaApp/src/pages/detail/index.vue 5 * @FilePath: /meihuaApp/src/pages/detail/index.vue
6 * @Description: 房间详情页面 6 * @Description: 房间详情页面
7 --> 7 -->
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
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 - <text class="price"><text style="font-size: 32rpx;">¥</text>980</text> 33 + <view class="price"><nut-price :price="980" size="large" /></view>
34 - <text class="old-price">¥1280</text> 34 + <view class="old-price"><nut-price :price="1280" 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">
......