gxd-uni-library-editx 1.0.148 → 1.0.150
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.
- package/package.json +1 -1
- package/src/components/XdUnit/XdUnit.vue +32 -10
- package/src/utils/helper.js +9 -9
package/package.json
CHANGED
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
<view
|
|
3
3
|
class="xd-unit"
|
|
4
4
|
:style="{height: fontSize *1.5 + 'rpx'}"
|
|
5
|
-
:class="{'xd-unit__show': !(uiIcon &&
|
|
5
|
+
:class="{'xd-unit__show': !(uiIcon && showIcon)}"
|
|
6
6
|
v-if="show"
|
|
7
7
|
>
|
|
8
|
-
<view class="xd-unit__price" :style="[priceStyleComp]">
|
|
8
|
+
<view class="xd-unit__price" :style="[priceStyleComp]">
|
|
9
|
+
<view v-if="showRMB">¥</view>
|
|
10
|
+
{{uiPrice}}
|
|
11
|
+
</view>
|
|
9
12
|
<view v-if="range" :style="[rangeStyleComp]">{{range}}</view>
|
|
10
|
-
<view class="xd-unit__image" v-if="uiIcon &&
|
|
13
|
+
<view class="xd-unit__image" v-if="uiIcon && showIcon && (unit === null)">
|
|
11
14
|
<xd-image :is-gray="isGray" :src="uiIcon" :size="iconSize || iocnSize"></xd-image>
|
|
12
15
|
</view>
|
|
13
16
|
<template v-else>
|
|
14
|
-
<template v-if="unit
|
|
17
|
+
<template v-if="unit">
|
|
15
18
|
<view
|
|
16
19
|
class="xd-unit__unit"
|
|
17
20
|
:style=" {
|
|
@@ -19,7 +22,9 @@
|
|
|
19
22
|
fontSize: unitFontSize > 0 ? (unitFontSize + 'rpx') :(fontSize - 8) + 'rpx',
|
|
20
23
|
color: isGray?'#999':uiColor
|
|
21
24
|
}"
|
|
22
|
-
v-if="unit">
|
|
25
|
+
v-if="unit">
|
|
26
|
+
{{unit}}
|
|
27
|
+
</view>
|
|
23
28
|
<view v-else>
|
|
24
29
|
<xd-coins :size="iconSize || iocnSize"></xd-coins>
|
|
25
30
|
</view>
|
|
@@ -70,8 +75,8 @@
|
|
|
70
75
|
},
|
|
71
76
|
|
|
72
77
|
isShowIcon: {
|
|
73
|
-
type: Boolean,
|
|
74
|
-
default:
|
|
78
|
+
type: Boolean|String,
|
|
79
|
+
default: '',
|
|
75
80
|
},
|
|
76
81
|
price: {
|
|
77
82
|
type: String | Number,
|
|
@@ -122,7 +127,7 @@
|
|
|
122
127
|
|
|
123
128
|
},
|
|
124
129
|
computed: {
|
|
125
|
-
...mapState(['webUnitIcon','brandInfo']),
|
|
130
|
+
...mapState(['webUnitIcon','brandInfo','siteInfo']),
|
|
126
131
|
|
|
127
132
|
rangeStyleComp(){
|
|
128
133
|
let size = this.fontSize*(1/2) < 20?20:this.fontSize*(1/2);
|
|
@@ -150,7 +155,9 @@
|
|
|
150
155
|
uiIcon: null, //金额显示icon
|
|
151
156
|
uiPrice: null, //金额
|
|
152
157
|
show: false,
|
|
153
|
-
fixedNum: null
|
|
158
|
+
fixedNum: null,
|
|
159
|
+
showIcon: true,
|
|
160
|
+
showRMB: false
|
|
154
161
|
}
|
|
155
162
|
},
|
|
156
163
|
watch:{
|
|
@@ -164,7 +171,6 @@
|
|
|
164
171
|
async created() {
|
|
165
172
|
|
|
166
173
|
|
|
167
|
-
|
|
168
174
|
//配置中获取
|
|
169
175
|
let optionsIcon = null;
|
|
170
176
|
if (this.webSetting['unitIcon']) {
|
|
@@ -205,6 +211,17 @@
|
|
|
205
211
|
if(this.unit === null) {
|
|
206
212
|
this.uiIcon = projectIcon || brandIncon || optionsIcon;
|
|
207
213
|
}
|
|
214
|
+
|
|
215
|
+
if(this.siteInfo&&this.siteInfo.mapping&&this.siteInfo.mapping.coin_type&&this.siteInfo.mapping.coin_type==='rmb'){
|
|
216
|
+
this.showIcon = false;
|
|
217
|
+
this.showRMB = true;
|
|
218
|
+
} else {
|
|
219
|
+
this.showIcon = true;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if(typeof this.isShowIcon === 'boolean'){
|
|
223
|
+
this.showIcon = this.isShowIcon;
|
|
224
|
+
}
|
|
208
225
|
|
|
209
226
|
//设置显示数字
|
|
210
227
|
this.initPrice();
|
|
@@ -254,6 +271,11 @@
|
|
|
254
271
|
&__price {
|
|
255
272
|
margin-right: unit(12, rpx);
|
|
256
273
|
font-weight: normal;
|
|
274
|
+
display: flex;
|
|
275
|
+
align-items: baseline;
|
|
276
|
+
& > view:first-child {
|
|
277
|
+
font-size: 24rpx;
|
|
278
|
+
}
|
|
257
279
|
}
|
|
258
280
|
|
|
259
281
|
&__image {
|
package/src/utils/helper.js
CHANGED
|
@@ -397,15 +397,15 @@ class Helpers {
|
|
|
397
397
|
params = this.cloneDeep(params);
|
|
398
398
|
let paramsStr = '';
|
|
399
399
|
let count = 0;
|
|
400
|
-
this.
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
paramsStr += `&${key}=${params[key]}`;
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}
|
|
400
|
+
if (this.checkVarType(params) === 'array'
|
|
401
|
+
|| this.checkVarType(params) === 'object'
|
|
402
|
+
) {
|
|
403
|
+
Object.keys(params).map(key=>{
|
|
404
|
+
if(count === 0) paramsStr = `${key}=${params[key]}`;
|
|
405
|
+
else paramsStr += `&${key}=${params[key]}`;
|
|
406
|
+
count++;
|
|
407
|
+
})
|
|
408
|
+
}
|
|
409
409
|
return paramsStr;
|
|
410
410
|
}
|
|
411
411
|
|