Commit aab09c93 authored by JingChao's avatar JingChao

金额过滤器

parent d521e0c5
......@@ -44,7 +44,7 @@
max-width: 14em;
min-height: 3em !important;
top: 38% !important;
border-radius: 0.3rem !important;
border-radius: 0.15rem !important;
}
.weui-toast.vux-toast-top {
......
......@@ -5,7 +5,7 @@
<template>
<h-view title="HFile">
<h-header>
<h-header :has-border="false" class="bar-custom">
<div slot="left" class="h-header-btn" @click="$routeGo()">
<i class="ion-ios-arrow-back"/>
</div>
......
......@@ -23,7 +23,7 @@
<tab-item>涉诉公告</tab-item>
<tab-item>司法协助</tab-item>
</s-tab>
<scroll class="has-footer">
<h-content :listen-scroll="true" class="has-footer" @scroll="scrollListen">
<h-button class="button-class" type="primary" @click.native="showLoading">showLoading</h-button>
<h-button class="button-class" type="primary" @click.native="hideLoading">hideLoading</h-button>
<h-button class="button-class" type="primary" @click.native="showLongTop">showLongTop</h-button>
......@@ -239,7 +239,7 @@
</div>
<h2 class="item-title">Modal</h2>
<h-button class="button-class" type="primary" @click.native="showModal">Modal</h-button>
</scroll>
</h-content>
<bottom-tab :show-divider="true">
<tab-button cusClass="button-exit" @click.native="showConfirm"><img
......@@ -326,6 +326,9 @@ export default {
}) */
},
methods: {
scrollListen (e) {
console.log('scroll listen:' + JSON.stringify(e,'',2))
},
stab () {
console.log('tab-click')
},
......@@ -369,13 +372,13 @@ export default {
this.hlsPopup.hideLoading()
},
showLongTop () {
this.hlsPopup.showLongTop('操作成功操作成功')
this.hlsPopup.showLongTop('操作成功操作成功操作成功操作成功操作成功操作成功')
},
showLongCenter () {
this.hlsPopup.showLongCenter('操作成功操作成功')
this.hlsPopup.showLongCenter('操作成功操作成功操作成功操作成功操作成功操作成功')
},
showLongBottom () {
this.hlsPopup.showLongBottom('操作成功操作成功')
this.hlsPopup.showLongBottom('操作成功操作成功操作成功操作成功操作成功操作成功')
},
showSuccess () {
this.hlsPopup.showSuccess('操作成功')
......
......@@ -16,6 +16,10 @@
<section slot="name">姓名</section>
<input slot="content" type="text">
</item>
<item>
<section slot="name">金额</section>
<div slot="content">{{ number | currency }}</div>
</item>
<item>
<section slot="name">年龄</section>
<input slot="content" type="text">
......@@ -86,6 +90,7 @@
export default {
data () {
return {
number: 0.48,
arrarRight: require('../assets/image/right-arrow@2x.png'),
userImg: window.localStorage.userImg || '',
message: [{
......
......@@ -2,9 +2,8 @@ export default (Vue) => {
Vue.filter('currency', function (val) {
if (!val) return '0.00'
var intPart = Number(val).toFixed(0) // 获取整数部分
var intPart = parseInt(Number(val)) // 获取整数部分
var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断
var floatPart = '.00' // 预定义小数部分
var value2Array = (val + '').split('.')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment