@jx3box/jx3box-common-ui 9.1.4 → 9.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ {
2
+ "cSpell.words": [
3
+ "zhuan"
4
+ ]
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "9.1.4",
3
+ "version": "9.1.6",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,19 +1,20 @@
1
1
  <template>
2
- <span class="c-game-price">
3
- <span v-if="formartPrice(price,'zhuan')">
4
- {{formartPrice(price,'zhuan')}}
2
+ <span class="c-game-price" :class="{ 'is-align': align }">
3
+ <span class="u-neg" v-if="price < 0">- </span>
4
+ <span class="u-zhuan" v-if="formatPrice(price, 'zhuan') || align">
5
+ <span class="u-value">{{ formatPrice(price, "zhuan") }}</span>
5
6
  <img src="../../assets/img/price/zhuan.png" alt="砖" />
6
7
  </span>
7
- <span v-if="formartPrice(price,'jin')">
8
- {{formartPrice(price,'jin')}}
8
+ <span class="u-jin" v-if="formatPrice(price, 'jin') || align">
9
+ <span class="u-value">{{ formatPrice(price, "jin") }}</span>
9
10
  <img src="../../assets/img/price/jin.png" alt="金" />
10
11
  </span>
11
- <span v-if="formartPrice(price,'yin')">
12
- {{formartPrice(price,'yin')}}
12
+ <span class="u-yin" v-if="formatPrice(price, 'yin') || align">
13
+ <span class="u-value">{{ formatPrice(price, "yin") }}</span>
13
14
  <img src="../../assets/img/price/yin.png" alt="银" />
14
15
  </span>
15
- <span v-if="formartPrice(price,'tong')">
16
- {{formartPrice(price,'tong')}}
16
+ <span class="u-tong" v-if="formatPrice(price, 'tong') || align">
17
+ <span class="u-value">{{ formatPrice(price, "tong") }}</span>
17
18
  <img src="../../assets/img/price/tong.png" alt="铜" />
18
19
  </span>
19
20
  </span>
@@ -22,16 +23,10 @@
22
23
  <script>
23
24
  export default {
24
25
  name: "GamePrice",
25
- props: ["price"],
26
- components: {},
27
- data: function () {
28
- return {
29
- };
30
- },
31
- computed: {},
32
- watch: {},
26
+ props: ["price", "align", "align-price"],
33
27
  methods: {
34
- formartPrice(price = 0, unit) {
28
+ formatPrice(price = 0, unit) {
29
+ if (price < 0) price = -price;
35
30
  let result = {
36
31
  zhuan: Math.floor(price * 0.01 * 0.01 * 0.0001) || 0,
37
32
  jin: Math.floor((price * 0.01 * 0.01) % 10000) || 0,
@@ -41,17 +36,41 @@ export default {
41
36
  return result[unit];
42
37
  },
43
38
  },
44
- filters: {},
45
- created: function () {},
46
- mounted: function () {},
47
39
  };
48
40
  </script>
49
41
 
50
42
  <style lang="less">
51
- .c-game-price{
52
- img{
53
- .y;
43
+ .c-game-price {
44
+ img {
45
+ .y;
46
+ }
47
+
48
+ &.is-align {
49
+ .u-jin {
50
+ .u-value {
51
+ display: inline-flex;
52
+ width: 4ch;
53
+ justify-content: flex-end;
54
+ overflow: hidden;
55
+ }
56
+ .u-value::before {
57
+ content: "0000";
58
+ color: #eee;
59
+ }
60
+ }
61
+ .u-yin,
62
+ .u-tong {
63
+ .u-value {
64
+ display: inline-flex;
65
+ width: 2ch;
66
+ justify-content: flex-end;
67
+ overflow: hidden;
68
+ }
69
+ .u-value::before {
70
+ content: "00";
71
+ color: #eee;
72
+ }
54
73
  }
55
74
  }
56
-
57
- </style>
75
+ }
76
+ </style>