Browse Source

修改关闭

lex 1 năm trước cách đây
mục cha
commit
2bf8a2c3d6

BIN
src/common/images/message-close.png


+ 11 - 0
src/components/m-message-tip/index.module.less

@@ -62,4 +62,15 @@
     color: #FFFFFF;
     border: none;
   }
+
+  .iconClose {
+    position: absolute;
+    top: 16px;
+    right: 16px;
+    display: inline-block;
+    background: url('../../common/images/message-close.png') no-repeat top center;
+    background-size: cover;
+    width: 18px;
+    height: 18px;
+  }
 }

+ 10 - 1
src/components/m-message-tip/index.tsx

@@ -52,9 +52,14 @@ export default defineComponent({
     confirmButtonColor: {
       type: String,
       default: ''
+    },
+    /** 是否有关闭按钮 */
+    showCloseButton: {
+      type: Boolean,
+      default: true
     }
   },
-  emits: ['confirm', 'cancel'],
+  emits: ['confirm', 'cancel', 'close'],
   setup(props, { emit }) {
     const showPopup = ref(false);
     onMounted(() => {
@@ -82,6 +87,10 @@ export default defineComponent({
           closeOnClickOverlay={false}
           class={styles.wxPopupDialog}>
           <div class={styles.popupContainer}>
+            {props.showCloseButton && (
+              <i class={styles.iconClose} onClick={() => emit('close')}></i>
+            )}
+
             <p class={styles.title1} v-html={props.title}></p>
             <p
               class={styles.popupTips}

+ 6 - 0
src/views/student-register/index.tsx

@@ -186,6 +186,7 @@ export default defineComponent({
 
     const otherParams = reactive({
       showOtherSchool: false,
+      showCloseButton: true, // 是否显示关闭按钮
       showOtherMessage: '',
       /**  limit 超限制,change 更换学生,nickname 名称不一致  */
       otherType: '' as 'limit' | 'change' | 'nickname',
@@ -477,6 +478,7 @@ export default defineComponent({
           '学生姓名与上次提交信息不一致,请确认修改学生信息或创建新的学生账号';
         otherParams.showOtherSchool = true;
         otherParams.showCancelButton = true;
+        otherParams.showCloseButton = true;
         otherParams.cancelButtonColor =
           'linear-gradient( 224deg, #3FE1E6 0%, #00CDD4 100%)';
         otherParams.cancelButtonText = '新建学生';
@@ -496,6 +498,7 @@ export default defineComponent({
         otherParams.showOtherMessage = `同一手机号最多创建${forms.multi_user_limit}个学生`;
         otherParams.showOtherSchool = true;
         otherParams.showCancelButton = false;
+        otherParams.showCloseButton = true;
         otherParams.confirmButtonColor =
           'linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)';
         otherParams.confirmButtonText = '我知道了';
@@ -516,6 +519,7 @@ export default defineComponent({
           forms.studentItem?.schoolName
         }】,是否确认提交?`;
         otherParams.showOtherSchool = true;
+        otherParams.showCloseButton = false;
         otherParams.showCancelButton = true;
         otherParams.cancelButtonColor = '';
         otherParams.cancelButtonText = '取消';
@@ -1851,6 +1855,7 @@ export default defineComponent({
 
         <MMessageTip
           show={otherParams.showOtherSchool}
+          showCloseButton={otherParams.showCloseButton}
           messageAlign={otherParams.messageAlign}
           message={otherParams.showOtherMessage}
           showCancelButton={otherParams.showCancelButton}
@@ -1858,6 +1863,7 @@ export default defineComponent({
           cancelButtonText={otherParams.cancelButtonText}
           confirmButtonColor={otherParams.confirmButtonColor}
           confirmButtonText={otherParams.confirmButtonText}
+          onClose={() => (otherParams.showOtherSchool = false)}
           onCancel={() => {
             otherParams.showOtherSchool = false;
             if (otherParams.otherType === 'nickname') {

+ 6 - 0
src/views/student-register/register-member/index.tsx

@@ -110,6 +110,7 @@ export default defineComponent({
     });
     const otherParams = reactive({
       showOtherSchool: false,
+      showCloseButton: true, // 是否显示关闭按钮
       showOtherMessage: '',
       /**  limit 超限制,change 更换学生,nickname 名称不一致  */
       otherType: '' as 'limit' | 'change' | 'nickname',
@@ -305,6 +306,7 @@ export default defineComponent({
           '学生姓名与上次提交信息不一致,请确认修改学生信息或创建新的学生账号';
         otherParams.showOtherSchool = true;
         otherParams.showCancelButton = true;
+        otherParams.showCloseButton = true;
         otherParams.cancelButtonColor =
           'linear-gradient( 224deg, #3FE1E6 0%, #00CDD4 100%)';
         otherParams.cancelButtonText = '新建学生';
@@ -324,6 +326,7 @@ export default defineComponent({
         otherParams.showOtherMessage = `同一手机号最多创建${forms.multi_user_limit}个学生`;
         otherParams.showOtherSchool = true;
         otherParams.showCancelButton = false;
+        otherParams.showCloseButton = true;
         otherParams.confirmButtonColor =
           'linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)';
         otherParams.confirmButtonText = '我知道了';
@@ -345,6 +348,7 @@ export default defineComponent({
         }】,是否确认提交?`;
         otherParams.showOtherSchool = true;
         otherParams.showCancelButton = true;
+        otherParams.showCloseButton = false;
         otherParams.cancelButtonColor = '';
         otherParams.cancelButtonText = '取消';
         otherParams.confirmButtonColor = '';
@@ -741,6 +745,7 @@ export default defineComponent({
 
         <MMessageTip
           show={otherParams.showOtherSchool}
+          showCloseButton={otherParams.showCloseButton}
           messageAlign={otherParams.messageAlign}
           message={otherParams.showOtherMessage}
           showCancelButton={otherParams.showCancelButton}
@@ -748,6 +753,7 @@ export default defineComponent({
           cancelButtonText={otherParams.cancelButtonText}
           confirmButtonColor={otherParams.confirmButtonColor}
           confirmButtonText={otherParams.confirmButtonText}
+          onClose={() => (otherParams.showOtherSchool = false)}
           onCancel={() => {
             otherParams.showOtherSchool = false;
             if (otherParams.otherType === 'nickname') {

+ 6 - 0
src/views/student-register/register-new/index.tsx

@@ -111,6 +111,7 @@ export default defineComponent({
     });
     const otherParams = reactive({
       showOtherSchool: false,
+      showCloseButton: true, // 是否显示关闭按钮
       showOtherMessage: '',
       /**  limit 超限制,change 更换学生,nickname 名称不一致  */
       otherType: '' as 'limit' | 'change' | 'nickname',
@@ -279,6 +280,7 @@ export default defineComponent({
           '学生姓名与上次提交信息不一致,请确认修改学生信息或创建新的学生账号';
         otherParams.showOtherSchool = true;
         otherParams.showCancelButton = true;
+        otherParams.showCloseButton = true;
         otherParams.cancelButtonColor =
           'linear-gradient( 224deg, #3FE1E6 0%, #00CDD4 100%)';
         otherParams.cancelButtonText = '新建学生';
@@ -298,6 +300,7 @@ export default defineComponent({
         otherParams.showOtherMessage = `同一手机号最多创建${forms.multi_user_limit}个学生`;
         otherParams.showOtherSchool = true;
         otherParams.showCancelButton = false;
+        otherParams.showCloseButton = true;
         otherParams.confirmButtonColor =
           'linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)';
         otherParams.confirmButtonText = '我知道了';
@@ -319,6 +322,7 @@ export default defineComponent({
         }】,是否确认提交?`;
         otherParams.showOtherSchool = true;
         otherParams.showCancelButton = true;
+        otherParams.showCloseButton = false;
         otherParams.cancelButtonColor = '';
         otherParams.cancelButtonText = '取消';
         otherParams.confirmButtonColor = '';
@@ -807,6 +811,7 @@ export default defineComponent({
 
         <MMessageTip
           show={otherParams.showOtherSchool}
+          showCloseButton={otherParams.showCloseButton}
           messageAlign={otherParams.messageAlign}
           message={otherParams.showOtherMessage}
           showCancelButton={otherParams.showCancelButton}
@@ -814,6 +819,7 @@ export default defineComponent({
           cancelButtonText={otherParams.cancelButtonText}
           confirmButtonColor={otherParams.confirmButtonColor}
           confirmButtonText={otherParams.confirmButtonText}
+          onClose={() => (otherParams.showOtherSchool = false)}
           onCancel={() => {
             otherParams.showOtherSchool = false;
             if (otherParams.otherType === 'nickname') {