暂存充值审核
This commit is contained in:
@@ -5,7 +5,8 @@ Component({
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
list: Array
|
||||
list: Array,
|
||||
active: Number,
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -19,6 +20,13 @@ Component({
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
handleChange(e) {
|
||||
console.log(e, this.data.active)
|
||||
const { index } = e.currentTarget.dataset;
|
||||
if (index === this.data.active) {
|
||||
return;
|
||||
}
|
||||
this.triggerEvent("change", { index, name: this.data.list[index] })
|
||||
}
|
||||
}
|
||||
})
|
@@ -1,4 +1,12 @@
|
||||
<!--components/Segmented/index.wxml-->
|
||||
<view>
|
||||
<view wx:for="{{list}}" wx:key="index"></view>
|
||||
<view style="margin: 10rpx 20rpx">
|
||||
<view
|
||||
wx:for="{{list}}"
|
||||
wx:key="index"
|
||||
class="item {{index === active ? 'active' : ''}}"
|
||||
bind:tap="handleChange"
|
||||
data-index="{{index}}"
|
||||
>
|
||||
{{ item }}
|
||||
</view>
|
||||
</view>
|
@@ -1 +1,19 @@
|
||||
/* components/Segmented/index.wxss */
|
||||
/* components/Segmented/index.wxss */
|
||||
.item {
|
||||
display: inline-block;
|
||||
padding: 20rpx;
|
||||
border: 1rpx solid #ccc;
|
||||
border-right: 0rpx;
|
||||
font-size: 32rpx;
|
||||
min-width: 140rpx;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
.item:nth-last-child(1) {
|
||||
border-right: 1rpx solid #ccc;
|
||||
}
|
||||
|
||||
.active {
|
||||
background-color: var(--middle-green);
|
||||
}
|
||||
|
Reference in New Issue
Block a user