CAA按钮变灰

本文介绍了如何通过CATAfrGetCommandHeader函数根据名字获取Command,随后调用SetVisibility和BecomeUnavailable方法来设置按钮不可被用户自定义使用及不可用变成灰色。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

    CATCommandHeader* pHeader = NULL;
    CATAfrGetCommandHeader("Test",pHeader);//根据名字获取到Command
    pHeader -> SetVisibility(0);//设置按钮不可被用户自定义使用
    pHeader ->BecomeUnavailable();//设置按钮不可用变成灰色

<template> <view :class="{ inComeItemWrap: true, lastDomWrap: lastDom }"> <view :class="{ dot: true, activeC: data.approveState == 1 }" /> <view class="time-status-container"> <view class="time-text">{{ formatDate(data.checkDate) }}</view> <view :class="['status-badge', `status-${data.approveState}`]"> {{ getStatusText(data.approveState) }} </view> </view> <view class="con"> <view class="conItem1"> <text class="label">失败原因</text> <text class="value">{{ data.remark }}</text> </view> </view> </view> </template> <script> export default { name: "inComeItem", props: { data: { type: Object, default: () => { return {}; }, }, lastDom: { type: Boolean, default: false, }, }, data() { return {}; }, methods: { formatMoney(amount) { return amount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") }, formatDate(dateStr) { return dateStr // 实际项目中可添加日期格式化逻辑 }, getStatusText(state) { const statusMap = { 0: '未提交', 1: '审批中', 2: '审批通过', 3: '审批失败' } return statusMap[state] || '' } } }; </script> <style lang="scss" scoped> .inComeItemWrap { position: relative; // margin-left: 20rpx; padding-top: 40rpx; padding-bottom: 36rpx; padding-left: 20rpx; border-left: 4rpx solid #05c4c8;; } .lastDomWrap { border-left: 1px dashed #f3f5f8; } .dot { position: absolute; left: -13rpx; top: 0; width: 20rpx; height: 20rpx; border-radius: 20rpx; background: #05c4c8; // 改为绿色背景 border-color: #05c4c8; // 改为绿色边框 } .time { position: absolute; left: 16rpx; top: -12rpx; font-size: 28rpx; color: #000; font-weight: bold; } .activeC { background: #05c4c8; } .con { padding-left: 30rpx; display: flex; .conItem1 { flex: 1; } .conItem2 { width: 60%; } .conItemT { margin-bottom: 4rpx; white-space: nowrap; color: #7c7c7c; font-size: 24rpx; } .conItemV { color: #000; font-weight: bold; font-size: 30rpx; } } .status1 { display: flex; align-content: center; align-items: center; font-weight: normal; font-size: 24rpx; padding: 0 8rpx; margin-left: 8rpx; color: #fff; background: #caa658; border-radius: 40rpx; } .status2 { display: flex; align-items: center; align-content: center; justify-content: center; font-weight: normal; padding: 0 12rpx; margin-left: 8rpx; background: #05c4c8; color: #fff; border-radius: 40upx; font-size: 24rpx; } .status3 { font-weight: normal; margin-left: 8rpx; position: relative; width: 204upx; /* 按钮宽度 */ height: 40upx; /* 按钮高度 */ border-radius: 40upx; /* 圆角 */ overflow: hidden; /* 隐藏超出边界的部分 */ } .status3::before, .status3::after { content: ""; position: absolute; width: 100%; height: 100%; } .statusText { display: flex; justify-content: center; align-items: center; position: absolute; left: 0; right: 0; top: 0; bottom: 0; text-align: center; font-size: 24rpx; z-index: 1; } /* 左侧颜色部分 */ .status3::before { background-color: #00d3d6; /* 青色 */ clip-path: polygon(0 0, 54% 0, 46% 100%, 0 100%); } /* 右侧颜色部分 */ .status3::after { background-color: #ffe6e6; /* 粉色 */ clip-path: polygon(54% 0, 100% 0, 100% 100%, 46% 100%); } .time-status-container { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24rpx; width: 100%; .time-text { font-size: 32rpx; color: #333;; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .status-badge { font-size: 26rpx; height: 44rpx; line-height: 44rpx; border-radius: 44rpx; padding: 0 24rpx; margin-left: 20rpx; box-shadow: 0 4rpx 8rpx rgba(0,0,0,0.05); color: white; text-align: center; min-width: 120rpx; flex-shrink: 0; &.status-0 { background: linear-gradient(135deg, #caa658, darken(#caa658, 10%)); } &.status-1, &.status-2, &.status-3 { background: linear-gradient(135deg, #05c4c8, darken(#05c4c8, 10%)); } } } </style> 步骤条居中线正常链接
最新发布
07-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值