Pārlūkot izejas kodu

改为兼容性更好的checkbox

master
leiyun pirms 2 nedēļām
vecāks
revīzija
d5546a699b
2 mainītis faili ar 41 papildinājumiem un 7 dzēšanām
  1. +33
    -4
      pages/myinfo/myinfo.vue
  2. +8
    -3
      pages/sample-info/sample-info.vue

+ 33
- 4
pages/myinfo/myinfo.vue Parādīt failu

@@ -139,10 +139,10 @@

<!-- 提交按钮 -->
<view class="btn-wrap">
<view v-if="!isInfoApproved" class="agree-row" @tap="agreed = !agreed">
<u-checkbox-group>
<u-checkbox :checked="agreed" shape="circle" activeColor="#0E63E3" size="18" @change="agreed = !agreed" />
</u-checkbox-group>
<view v-if="!isInfoApproved" class="agree-row" @tap="toggleAgree">
<view :class="['agree-checkbox', agreed ? 'checked' : '']">
<text v-if="agreed" class="agree-check-icon">✓</text>
</view>
<text class="agree-text">请阅读并同意</text>
<text class="agree-link" @tap.stop="openNotice">《患者告知书》</text>
</view>
@@ -535,6 +535,10 @@ const openNotice = () => {
uni.navigateTo({ url: '/pages/content/content?key=patient_information_sheet' })
}

const toggleAgree = () => {
agreed.value = !agreed.value
}

const handleSubmit = async () => {
if (isInfoApproved.value) return showApprovedTip()
if (!agreed.value) {
@@ -925,6 +929,31 @@ const doSubmit = async () => {
padding-left: 4rpx;
}

.agree-checkbox {
width: 36rpx;
height: 36rpx;
border: 2rpx solid #dcdfe6;
border-radius: 50%;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
background: #fff;
}

.agree-checkbox.checked {
border-color: #0e63e3;
background: #0e63e3;
}

.agree-check-icon {
font-size: 24rpx;
line-height: 1;
color: #fff;
font-weight: 600;
}

.agree-text {
font-size: 24rpx;
color: #666;


+ 8
- 3
pages/sample-info/sample-info.vue Parādīt failu

@@ -130,9 +130,9 @@
<!-- 提交按钮 -->
<view class="btn-wrap">
<view class="agree-row" @tap="toggleAgree">
<u-checkbox-group>
<u-checkbox :checked="agreed" :disabled="isSampleInfoLocked" shape="circle" activeColor="#0E63E3" size="18" />
</u-checkbox-group>
<view :class="['agree-checkbox', agreed ? 'checked' : '', isSampleInfoLocked ? 'disabled' : '']">
<text v-if="agreed" class="agree-check-icon">✓</text>
</view>
<text class="agree-text">请阅读并同意</text>
<text class="agree-link" @tap.stop="openNotice">《患者告知书》</text>
</view>
@@ -652,6 +652,11 @@ const handleSubmit = async () => {
.upload-text { font-size: 22rpx; color: #999; margin-top: 4rpx; }
.btn-wrap { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; padding: 20rpx 32rpx; padding-bottom: calc(20rpx + env(safe-area-inset-bottom)); box-shadow: 0 -4rpx 16rpx rgba(0,0,0,0.06); z-index: 100; }
.agree-row { display: flex; align-items: center; margin-bottom: 16rpx; padding-left: 4rpx; }
.agree-checkbox { width: 36rpx; height: 36rpx; border: 2rpx solid #dcdfe6; border-radius: 50%; box-sizing: border-box; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #fff; }
.agree-checkbox.checked { border-color: #0e63e3; background: #0e63e3; }
.agree-checkbox.disabled { border-color: #dcdfe6; background: #f5f7fa; }
.agree-checkbox.checked.disabled { border-color: #c0c4cc; background: #c0c4cc; }
.agree-check-icon { font-size: 24rpx; line-height: 1; color: #fff; font-weight: 600; }
.agree-text { font-size: 24rpx; color: #666; margin-left: 8rpx; }
.agree-link { font-size: 24rpx; color: #0e63e3; }
.apply-popup { width: 100%; box-sizing: border-box; background: #fff; border-radius: 24rpx 24rpx 0 0; padding: 36rpx 32rpx 24rpx; }


Notiek ielāde…
Atcelt
Saglabāt