更换版本
This commit is contained in:
18
graceUI/components/graceBoxBanner.js
Normal file
18
graceUI/components/graceBoxBanner.js
Normal file
@@ -0,0 +1,18 @@
|
||||
Component({
|
||||
properties: {
|
||||
items: { type: Array, value: [] },
|
||||
color: { type: Array, value: ["#333333", "#999999", "#999999"] },
|
||||
fontSize: { type: Array, value: ["36rpx", "24rpx", "24rpx"] },
|
||||
background: { type: String, value: "" },
|
||||
padding: { type: String, value: "25rpx" },
|
||||
border: { type: Array, value: ["none", "", ""] },
|
||||
borderRadius: { type: String, value: "10rpx" },
|
||||
lineHeight: { type: String, value: "1.5em" },
|
||||
},
|
||||
methods: {
|
||||
taped: function (e) {
|
||||
var r = e.currentTarget.dataset.index;
|
||||
this.triggerEvent("taped", r);
|
||||
},
|
||||
},
|
||||
});
|
||||
1
graceUI/components/graceBoxBanner.json
Normal file
1
graceUI/components/graceBoxBanner.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "component": true, "usingComponents": {} }
|
||||
11
graceUI/components/graceBoxBanner.wxml
Normal file
11
graceUI/components/graceBoxBanner.wxml
Normal file
@@ -0,0 +1,11 @@
|
||||
<view class="grace-box-banner" style="background:{{background}}; padding-top:{{padding}}; padding-bottom:{{padding}}; border-radius:{{borderRadius}};">
|
||||
<view catchtap="taped" class="grace-box-items" data-index="{{index}}" style="border-right:{{index+1>=items.length?'0rpx':border[0]+' '+border[1]+' '+border[2]}};" wx:for="{{items}}" wx:key="index">
|
||||
<view class="grace-box-banner-line" style="line-height:{{lineHeight}};">
|
||||
<text class="grace-box-banner-line-text1" style="color:{{color[0]}}; font-size:{{fontSize[0]}};">{{item[0]}}</text>
|
||||
<text class="grace-box-banner-line-text2" style="color:{{color[1]}}; font-size:{{fontSize[1]}};">{{item[1]}}</text>
|
||||
</view>
|
||||
<view class="grace-box-banner-line" style="padding-bottom:3px">
|
||||
<text style="color:{{color[2]}}; font-size:{{fontSize[2]}};">{{item[2]}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
22
graceUI/components/graceBoxBanner.wxss
Normal file
22
graceUI/components/graceBoxBanner.wxss
Normal file
@@ -0,0 +1,22 @@
|
||||
.grace-box-banner {
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
overflow: hidden;
|
||||
padding: 26rpx 0;
|
||||
}
|
||||
.grace-box-items {
|
||||
width: 100%;
|
||||
}
|
||||
.grace-box-banner-line {
|
||||
align-items: center;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
padding-top: 8rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.grace-box-banner-line-text2 {
|
||||
margin-left: 3px;
|
||||
}
|
||||
16
graceUI/components/graceSegmentedControl.js
Normal file
16
graceUI/components/graceSegmentedControl.js
Normal file
@@ -0,0 +1,16 @@
|
||||
Component({
|
||||
properties: {
|
||||
items: { type: Array, value: new Array() },
|
||||
height: { type: String, value: "60rpx" },
|
||||
bgColor: { type: String, default: "#F8F8F8" },
|
||||
color: { type: String, value: "#3688FF" },
|
||||
fontSize: { type: String, value: "26rpx" },
|
||||
current: { type: Number, value: 0 },
|
||||
},
|
||||
methods: {
|
||||
changeSC: function (e) {
|
||||
var t = Number(e.currentTarget.dataset.index);
|
||||
this.triggerEvent("change", t), this.setData({ current: t });
|
||||
},
|
||||
},
|
||||
});
|
||||
1
graceUI/components/graceSegmentedControl.json
Normal file
1
graceUI/components/graceSegmentedControl.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "component": true, "usingComponents": {} }
|
||||
3
graceUI/components/graceSegmentedControl.wxml
Normal file
3
graceUI/components/graceSegmentedControl.wxml
Normal file
@@ -0,0 +1,3 @@
|
||||
<view class="gui-segmented-Control" style="height:{{height}}; background:{{bgColor}};">
|
||||
<view catchtap="changeSC" class="gui-segmented-Control-item" data-index="{{index}}" style="height:{{height}}; line-height:{{height}}; color:{{current==index?'#FFFFFF':color}}; background:{{current==index?color:''}}; fontSize:{{fontSize}};" wx:for="{{items}}" wx:key="index">{{item}}</view>
|
||||
</view>
|
||||
15
graceUI/components/graceSegmentedControl.wxss
Normal file
15
graceUI/components/graceSegmentedControl.wxss
Normal file
@@ -0,0 +1,15 @@
|
||||
.gui-segmented-Control {
|
||||
background-color: #f5f6f8;
|
||||
border-radius: 10rpx;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
padding: 6rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.gui-segmented-Control-item {
|
||||
border-radius: 8rpx;
|
||||
text-align: center;
|
||||
width: 700rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user