Browse Source

style(mp): match school violation action bar

apple 4 weeks ago
parent
commit
6c246888ee
2 changed files with 15 additions and 8 deletions
  1. 15 8
      web/page/mp/mp_objInp.html
  2. 0 0
      web/page/mp/mp_xxwjjl_inp.html

+ 15 - 8
web/page/mp/mp_objInp.html

@@ -223,17 +223,24 @@
             contentWrap.style.height = `calc(100vh - ${bottomHeight}px)`;
         };
 
-        // 功能说明:学校违纪录入使用其他移动端入口一致的默认底部按钮样式
+        // 功能说明:学校违纪录入使用其他移动端入口一致的默认底部按钮和文案
+        const isSchoolViolationEntry = (serviceName = '', objName = '') => {
+            const service = String(serviceName || state.service || getUrlParams().service || '').trim();
+            const objectName = String(objName || state.ssObjName || '').trim();
+            return objectName === 'xxwjjl' || service.startsWith('xxwjjl_');
+        };
+
+        const makeCloseBottomButton = (serviceName = '', objName = '') => ({
+            text: isSchoolViolationEntry(serviceName, objName) ? '取消' : '关闭',
+            action: 'close'
+        });
+
         const makeSubmitBottomButton = (text, serviceName = '', objName = '') => {
             const button = {
                 text: text || '保存并提交',
                 action: 'saveSubmit'
             };
-            const service = String(serviceName || state.service || getUrlParams().service || '').trim();
-            const objectName = String(objName || state.ssObjName || '').trim();
-            const useStandardStyle =
-                objectName === 'xxwjjl' || service.startsWith('xxwjjl_');
-            if (!useStandardStyle) {
+            if (!isSchoolViolationEntry(serviceName, objName)) {
                 button.backgroundColor = '#575d6d';
                 button.color = '#fff';
             }
@@ -243,7 +250,7 @@
         const updateBottomButtons = (submitTitle) => {
             if (!state.vm) return;
             state.vm.bottomButtons = [
-                { text: '关闭', action: 'close' },
+                makeCloseBottomButton(state.service, state.ssObjName),
                 makeSubmitBottomButton(submitTitle, state.service, state.ssObjName)
             ];
             setTimeout(updateContentHeight, 0);
@@ -497,7 +504,7 @@
                     showBottom: true,
                     showSubmitConfirm: false,
                     bottomButtons: [
-                        { text: '关闭', action: 'close' },
+                        makeCloseBottomButton(getUrlParams().service),
                         makeSubmitBottomButton('保存并提交', getUrlParams().service)
                     ]
                 }

+ 0 - 0
web/page/mp_xxwjjl_inp.html → web/page/mp/mp_xxwjjl_inp.html