no message
This commit is contained in:
28
components/vehicle-number/index.js
Normal file
28
components/vehicle-number/index.js
Normal file
@@ -0,0 +1,28 @@
|
||||
var t = require("../../common/vendor.js"),
|
||||
e = {
|
||||
__name: "index",
|
||||
props: {
|
||||
data: { type: String, default: "" },
|
||||
fontSize: { type: String, default: "28rpx" },
|
||||
},
|
||||
setup: function (e) {
|
||||
return function (a, r) {
|
||||
return t.e(
|
||||
{ a: e.data.trim().length < 7 },
|
||||
e.data.trim().length < 7
|
||||
? { b: t.t(e.data.trim()) }
|
||||
: {
|
||||
c: t.t(e.data.trim().substring(0, 2)),
|
||||
d: t.t(e.data.trim().substring(2)),
|
||||
},
|
||||
{
|
||||
e: e.data.trim().length > 7 ? 1 : "",
|
||||
f: e.data.trim().length < 7 ? 1 : "",
|
||||
g: e.fontSize,
|
||||
}
|
||||
);
|
||||
};
|
||||
},
|
||||
},
|
||||
a = t._export_sfc(e, [["__scopeId", "data-v-78f4d0b2"]]);
|
||||
wx.createComponent(a);
|
||||
1
components/vehicle-number/index.json
Normal file
1
components/vehicle-number/index.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "component": true, "usingComponents": {} }
|
||||
7
components/vehicle-number/index.wxml
Normal file
7
components/vehicle-number/index.wxml
Normal file
@@ -0,0 +1,7 @@
|
||||
<view
|
||||
class="{{['number','data-v-78f4d0b2',e&&'new',f&&'abnormal']}}"
|
||||
style="{{'font-size:'+g}}"
|
||||
>
|
||||
<view class="data-v-78f4d0b2" wx:if="{{a}}">{{b}}</view>
|
||||
<view class="data-v-78f4d0b2" wx:else>{{c}}·{{d}}</view>
|
||||
</view>
|
||||
15
components/vehicle-number/index.wxss
Normal file
15
components/vehicle-number/index.wxss
Normal file
@@ -0,0 +1,15 @@
|
||||
.number.data-v-78f4d0b2 {
|
||||
background: #2862c7;
|
||||
border-radius: 8rpx;
|
||||
color: #fff;
|
||||
padding: 5rpx 10rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.number.new.data-v-78f4d0b2 {
|
||||
background: linear-gradient(180deg, #ebebe7, #03b022);
|
||||
color: #000;
|
||||
}
|
||||
.number.abnormal.data-v-78f4d0b2 {
|
||||
background: #dbdbdb;
|
||||
color: #000;
|
||||
}
|
||||
Reference in New Issue
Block a user