<template>
	<view class="container flex-row">
		<view>￥</view>
		<view class="integer-part">{{integerPart}}</view>
		<view style="font-size: 32rpx;">{{decimalPart}}</view>
	</view>
</template>

<script>
	var config = require('../../common/config.js');
	var common = require('../../common/common.js');
	var http = require('../../common/http.js');
	var storage = require('../../common/storage.js');
	export default {
		props: {
			amount: {
				default: 0
			}
		},
		data() {
			return {
				// integerPart: '',
				// decimalPart: '',
			};
		}
		/**
		 * 生命周期函数--监听页面加载
		 */
		,
		onLoad: function(options) {
			
		},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow: function() {
			
		},
		computed: {  
			formattedAmount() {
				const parts = String(this.amount).split('.');
				const integerPart = parts[0];
				const decimalPart = parts[1] ? `.${parts[1].slice(0, 2)}` : '.00';
				return {integerPart,decimalPart};
			},
			
			integerPart() {
				return this.formattedAmount.integerPart;
			},
			
			decimalPart() {
				return this.formattedAmount.decimalPart;
			}
		}, 
		methods: {
			
		}
	};
</script>

<style>
	@import './allPrice.css';
</style>