ljc пре 2 месеци
родитељ
комит
8275ca801d
3 измењених фајлова са 70 додато и 19 уклоњено
  1. 45 11
      components/IbInfo.vue
  2. 16 3
      components/cwg-popup.vue
  3. 9 5
      static/scss/global/global.scss

+ 45 - 11
components/IbInfo.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="IbInfo">
     <cwg-popup ref="dialogApplyIb" type="center" :title="t('Home.msg.ibTitle')" showFooterLine
-               :cancelText="t('Btn.Cancel')" :confirmText="confirmText" @close="closeIb" @confirm="confirmIb">
+               :cancelText="t('Btn.Cancel')" :confirmText="confirmText" @close="closeIb" @confirm="confirmIb" :slot-name="'agree'">
       <view class="dia-content" v-if="ibStatus.status == 0">
         <view
           class="content"
@@ -171,15 +171,22 @@
           </view>
         </view>
       </view>
-      <view class="agree" slot="footer">
-        <checkbox-group v-model="ibAgree">
-          <label class="checkbox">
-            <checkbox value="1" />
-            <text class="crm-cursor" style="text-decoration: underline;" @click="dialogCheckTip = true">{{
-                t('Home.msg.Agree1') }}</text>
-          </label>
-        </checkbox-group>
-      </view>
+      <template #agree>
+        <view>
+          <view class="agree" >
+            <checkbox-group v-model="ibAgree" @change="onAgreeChange">
+              <label class="checkbox">
+                <checkbox value="1" />
+                <text class="crm-cursor" style="text-decoration: underline;" @click="dialogCheckTip = true">{{
+                    t('Home.msg.Agree1') }}</text>
+              </label>
+            </checkbox-group>
+          </view>
+
+        </view>
+
+      </template>
+
     </cwg-popup>
   </view>
 </template>
@@ -256,6 +263,9 @@
   const closeIb = async () => {
     dialogApplyIb.value.close()
   }
+  const onAgreeChange = async (value) => {
+    ibAgree.value = (value?.detail?.value.length) || ''
+  }
   // 确认按钮
   const confirmIb = async () => {
     const status = ibStatus.value.status
@@ -278,6 +288,7 @@ icon: 'none'})
   }
   // 申请ib
   const applyIb = async () => {
+    console.log(ibAgree.value)
     if (!ibAgree.value) {
       uni.showToast({title: t("Msg.Read"),icon: 'none'})
       return
@@ -315,7 +326,7 @@ icon: 'none'})
 
   onMounted(() => {
     getLogin()
-    dialogApplyIb.value.open()
+    // dialogApplyIb.value.open()
   })
 
 
@@ -359,4 +370,27 @@ icon: 'none'})
       text-indent: 0;
     }
   }
+  .agree {
+    margin: px2rpx(24) 0;
+    display: flex;
+    align-items: flex-start;
+
+    .checkbox {
+      display: flex;
+      align-items: flex-start;
+      gap: px2rpx(8);
+
+      :deep(uni-checkbox .uni-checkbox-input) {
+        border-radius: px2rpx(4);
+        width: px2rpx(18);
+        height: px2rpx(18);
+      }
+
+      text {
+        font-size: px2rpx(13);
+        color: var(--color-zinc-500);
+        line-height: 1.5;
+      }
+    }
+  }
 </style>

+ 16 - 3
components/cwg-popup.vue

@@ -13,6 +13,10 @@
             </view>
             <!-- 底部按钮区域 - 支持多种模式 -->
             <view class="dialog-footer" v-if="props.showFooters">
+<!--              底部-额外自定义插槽 -->
+                <template v-if="slotName && slots[slotName]">
+                    <slot :name="slotName" />
+                </template>
                 <!-- 自定义底部插槽 -->
                 <template v-if="slots.footer">
                     <slot name="footer" />
@@ -26,19 +30,23 @@
 
                 <!-- 单按钮模式 -->
                 <template v-else-if="footerType === 'single'">
+                  <view class="btn-content">
                     <button class="single-btn" :class="singleBtnType" @click="handleSingleBtnClick">
-                        {{ singleBtnText || t('Common.Confirm') }}
+                      {{ singleBtnText || t('Common.Confirm') }}
                     </button>
+                  </view>
                 </template>
 
                 <!-- 双按钮模式(默认) -->
                 <template v-else>
+                  <view class="btn-content">
                     <button class="cancel-btn" @click="closeDialog">
-                        {{ cancelText || t('Common.Cancel') }}
+                      {{ cancelText || t('Common.Cancel') }}
                     </button>
                     <button class="confirm-btn" :class="confirmBtnType" @click="handleConfirm">
-                        {{ confirmText || t('Common.Confirm') }}
+                      {{ confirmText || t('Common.Confirm') }}
                     </button>
+                  </view>
                 </template>
             </view>
         </view>
@@ -108,6 +116,11 @@ const props = defineProps({
         type: Boolean,
         default: false
     },
+    // 自定义插槽名称
+    slotName: {
+        type: String,
+        default: ''
+    },
     // 分页信息(传递给父组件使用)
     pagerInfo: {
         type: Object,

+ 9 - 5
static/scss/global/global.scss

@@ -1215,18 +1215,22 @@ uni-content {
     padding: px2rpx(20) px2rpx(30) px2rpx(30);
     border-top: 1px solid #f0f0f0;
 
+  .btn-content{
     // 双按钮模式
     &:not(:has(button:only-child)):has(button) {
-        display: flex;
-        justify-content: center;
-        gap: px2rpx(20);
+      display: flex;
+      //justify-content: center;
+      justify-content: space-around;
+      gap: px2rpx(20);
     }
 
     // 单按钮模式
     &:has(button:only-child) {
-        display: flex;
-        justify-content: center;
+      display: flex;
+      justify-content: center;
     }
+  }
+
 
     .footer-line {
         height: 1px;