msb_beta
parent
89d389c9f2
commit
1e8d4645c2
@ -0,0 +1,69 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-04-21 09:54:15
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-04-21 10:59:21
|
||||||
|
* @Description: file content
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<view class="ui-money">
|
||||||
|
<text v-if="prefix" class="ui-money--prefix">¥</text>
|
||||||
|
<text class="ui-money--price">{{moneyStr}}</text>
|
||||||
|
<text v-if="flaot && suffix" class="ui-money--suffix">.{{moneyArr[1]}}</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props : {
|
||||||
|
money : {
|
||||||
|
type : Number | String,
|
||||||
|
default : '0'
|
||||||
|
},
|
||||||
|
flaot : {
|
||||||
|
type : Boolean,
|
||||||
|
default : false
|
||||||
|
},
|
||||||
|
prefix : {
|
||||||
|
type : Boolean,
|
||||||
|
default : false
|
||||||
|
},
|
||||||
|
suffix : {
|
||||||
|
type : Boolean,
|
||||||
|
default : false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed : {
|
||||||
|
moneyStr (){
|
||||||
|
let priceStr = '',
|
||||||
|
intNum = this.moneyArr[0],
|
||||||
|
floatNum = this.moneyArr[1];
|
||||||
|
// 前缀不需要缩小显示
|
||||||
|
if(!this.prefix){
|
||||||
|
priceStr = `¥${intNum}`;
|
||||||
|
}else{
|
||||||
|
priceStr = intNum;
|
||||||
|
}
|
||||||
|
// 后缀不需要缩小显示
|
||||||
|
if(!this.suffix){
|
||||||
|
priceStr += floatNum ? `.${floatNum}` : '';
|
||||||
|
}
|
||||||
|
return priceStr;
|
||||||
|
},
|
||||||
|
moneyArr (){
|
||||||
|
let moneyArr = this.money.toString().split('.');
|
||||||
|
// 如果需要补0 则整数时补00
|
||||||
|
if(this.flaot){
|
||||||
|
if(!moneyArr[1]){
|
||||||
|
moneyArr[1] = '00';
|
||||||
|
}else if(moneyArr[1] < 10){
|
||||||
|
moneyArr[1] = `0${moneyArr[1]}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return moneyArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
</style>
|
@ -1,2 +1,2 @@
|
|||||||
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>马士兵严选</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>马士兵严选</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
||||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.b5602bf5.js></script><script src=/static/js/index.fe63b50a.js></script></body></html>
|
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.b5602bf5.js></script><script src=/static/js/index.8a30f788.js></script></body></html>
|
Before Width: | Height: | Size: 539 B After Width: | Height: | Size: 619 B |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 539 B After Width: | Height: | Size: 619 B |
Loading…
Reference in new issue