hookehuyr

价格显示优化

......@@ -22,6 +22,7 @@ declare module '@vue/runtime-core' {
NutInput: typeof import('@nutui/nutui-taro')['Input']
NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber']
NutPopup: typeof import('@nutui/nutui-taro')['Popup']
NutPrice: typeof import('@nutui/nutui-taro')['Price']
NutRadio: typeof import('@nutui/nutui-taro')['Radio']
NutRadioGroup: typeof import('@nutui/nutui-taro')['RadioGroup']
NutRow: typeof import('@nutui/nutui-taro')['Row']
......
......@@ -18,8 +18,8 @@
<nut-row>
<nut-col span="18">
<view class="order-card-price-text">
<text class="left"><text style="font-size: 30rpx;">¥</text>980</text>
<text class="right">¥1280</text>
<text class="left"><nut-price :price="980" size="normal" /></text>
<text class="right"><nut-price :price="1280" size="small" strike-through style="color: #7D7C7C;" /></text>
</view>
</nut-col>
<nut-col span="6" class="order-card-price-num">
......
<!--
* @Date: 2023-12-20 14:11:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-20 16:25:26
* @LastEditTime: 2023-12-25 07:08:02
* @FilePath: /meihuaApp/src/components/payCard.vue
* @Description: 文件描述
-->
......@@ -97,6 +97,38 @@ const goToPay = () => {
Taro.navigateTo({
url: '/pages/payInfo/index?id=123',
});
// this.$parent.sdk.post('c/app/prepay', {
// id: this.params.id
// }).then(res => {
// if (res.data.ret === 'OK') {
// let pay = res.data.content.payargs;
// wx.requestPayment({
// timeStamp: pay.timeStamp,
// nonceStr: pay.nonceStr,
// package: pay.package,
// signType: pay.signType,
// paySign: pay.paySign,
// success: (result) => {
// that.$parent.sdk.post('c/order/paySuccess', {
// id: that.params.id
// }).then(pRes => {
// if (pRes.data.ret === 'OK') {
// that.Toast('success', '感谢您的捐赠', 3000)
// wx.navigateBack({
// delta: 1
// });
// } else {
// that.Toast('fail', pRes.data.err, 3000);
// }
// }).catch(err => {
// console.error(err)
// })
// }
// });
// } else {
// this.Toast('fail', res.data.msg, 3000);
// }
// })
}
</script>
......
<!--
* @Date: 2023-12-13 13:42:23
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-25 11:04:56
* @LastEditTime: 2023-12-25 12:49:46
* @FilePath: /meihuaApp/src/components/roomCard.vue
* @Description: 房间详情组件
-->
......@@ -15,8 +15,8 @@
<view class="room-info-desc">两室 宜住3人</view>
</nut-col>
<nut-col span="6" class="room-info-right">
<view class="room-info-discount"><text style="font-size: 25rpx;">¥</text>980</view>
<view class="room-info-price">¥1280</view>
<view class="room-info-discount"><nut-price :price="980" size="normal" /></view>
<view class="room-info-price"><nut-price :price="1280" size="small" strike-through style="color: #7D7C7C;" /></view>
</nut-col>
</nut-row>
</view>
......@@ -160,10 +160,6 @@ onMounted(() => {
}
.room-info-price {
float: right;
color: #7D7C7C;
// font-weight: bold;
font-size: 0.8rem;
text-decoration: line-through;
}
}
}
......
......@@ -150,10 +150,8 @@
font-weight: bold;
}
.price-text-right {
color: #7d7c7c;
text-decoration: line-through;
font-size: 0.85rem;
margin-left: 5px;
margin-left: 5rpx;
margin-top: 8rpx;
}
}
.confirm-btn {
......
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-25 10:57:42
* @LastEditTime: 2023-12-25 12:48:26
* @FilePath: /meihuaApp/src/pages/confirm/index.vue
* @Description: 确认订单页面
-->
......@@ -130,8 +130,8 @@
<nut-row>
<nut-col :span="18">
<view class="price">
<text class="price-text-left"><text style="font-size: 32rpx;">¥</text>{{ room_price_info.discount * book_count * booking_info.days }}</text>
<text class="price-text-right">¥{{ room_price_info.price * book_count * booking_info.days }}</text>
<view class="price-text-left"><nut-price :price="price_discount" size="large" /></view>
<view class="price-text-right"><nut-price :price="price_old" size="small" strike-through style="color: #7D7C7C;" /></view>
</view>
</nut-col>
<nut-col :span="6">
......@@ -145,7 +145,7 @@
<script setup>
import Taro from '@tarojs/taro'
import { ref, reactive, onMounted } from "vue";
import { ref, reactive, onMounted, computed } from "vue";
import { getCurrentPageParam } from "@/utils/weapp";
import { IconFont } from '@nutui/icons-vue-taro';
import payCard from '@/components/payCard.vue'
......@@ -167,8 +167,16 @@ const booking_info = ref({
});
const room_price_info = ref({
discount: 980,
price: 1280,
discount: 980.18,
price: 1280.25,
});
const price_discount = computed(() => {
return ((room_price_info.value.discount * book_count.value * booking_info.value.days) * 100) / 100;
});
const price_old = computed(() => {
return ((room_price_info.value.price * book_count.value * booking_info.value.days) * 100) / 100;
});
const book_count = ref(1); // 预定房间数
......
......@@ -48,7 +48,8 @@
color: #EB2E2E; font-size: 1.3rem; font-weight: bold;
}
.old-price {
color: #7D7C7C; text-decoration: line-through; font-size: 0.85rem; margin-left: 5px;
margin-left: 5rpx;
margin-top: 8rpx;
}
}
.book-btn {
......
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-25 10:56:14
* @LastEditTime: 2023-12-25 12:42:48
* @FilePath: /meihuaApp/src/pages/detail/index.vue
* @Description: 房间详情页面
-->
......@@ -30,8 +30,8 @@
<nut-row>
<nut-col :span="18">
<view class="book-price">
<text class="price"><text style="font-size: 32rpx;">¥</text>980</text>
<text class="old-price">¥1280</text>
<view class="price"><nut-price :price="980" size="large" /></view>
<view class="old-price"><nut-price :price="1280" size="small" strike-through style="color: #7D7C7C;" /></view>
</view>
</nut-col>
<nut-col :span="6">
......