Pārlūkot izejas kodu

style(mp): align school violation submit button

apple 3 nedēļas atpakaļ
vecāks
revīzija
d3b0000280
1 mainītis faili ar 19 papildinājumiem un 12 dzēšanām
  1. 19 12
      web/page/mp/mp_objInp.html

+ 19 - 12
web/page/mp/mp_objInp.html

@@ -223,16 +223,28 @@
             contentWrap.style.height = `calc(100vh - ${bottomHeight}px)`;
         };
 
+        // 功能说明:学校违纪录入使用其他移动端入口一致的默认底部按钮样式
+        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) {
+                button.backgroundColor = '#575d6d';
+                button.color = '#fff';
+            }
+            return button;
+        };
+
         const updateBottomButtons = (submitTitle) => {
             if (!state.vm) return;
             state.vm.bottomButtons = [
                 { text: '关闭', action: 'close' },
-                {
-                    text: submitTitle || '保存并提交',
-                    action: 'saveSubmit',
-                    backgroundColor: '#575d6d',
-                    color: '#fff'
-                }
+                makeSubmitBottomButton(submitTitle, state.service, state.ssObjName)
             ];
             setTimeout(updateContentHeight, 0);
         };
@@ -486,12 +498,7 @@
                     showSubmitConfirm: false,
                     bottomButtons: [
                         { text: '关闭', action: 'close' },
-                        {
-                            text: '保存并提交',
-                            action: 'saveSubmit',
-                            backgroundColor: '#575d6d',
-                            color: '#fff'
-                        }
+                        makeSubmitBottomButton('保存并提交', getUrlParams().service)
                     ]
                 }
             },