瀏覽代碼

New Changes

Sai Sudheer 2 年之前
父節點
當前提交
24ebe8e8bd
共有 7 個檔案被更改,包括 197 行新增140 行删除
  1. 11
    15
      assets/css/list.page.css
  2. 30
    9
      assets/js/base.js
  3. 7
    0
      assets/js/bootstrap/bootstrap.bundle.min.js
  4. 43
    0
      assets/js/list.index.js
  5. 96
    96
      assets/js/login.js
  6. 9
    19
      authentication/index.html
  7. 1
    1
      index.html

+ 11
- 15
assets/css/list.page.css 查看文件

8
     --prmBgColor: rgb(244, 244, 221);
8
     --prmBgColor: rgb(244, 244, 221);
9
     --secdBgColor: #fafaf3;
9
     --secdBgColor: #fafaf3;
10
     --secdSubColor: #f4f4f3;
10
     --secdSubColor: #f4f4f3;
11
+    --lstPgArc: 15px;
11
 }
12
 }
12
 
13
 
13
 body {
14
 body {
24
     margin-right: 0px;
25
     margin-right: 0px;
25
     padding-left: 0px;
26
     padding-left: 0px;
26
     padding-right: 0px;
27
     padding-right: 0px;
28
+    list-style: none;
27
 }
29
 }
28
 
30
 
29
 .list-page {
31
 .list-page {
43
     align-items: center;
45
     align-items: center;
44
     padding-left: 0px !important;
46
     padding-left: 0px !important;
45
     padding-right: 0px !important;
47
     padding-right: 0px !important;
48
+    z-index: 1000;
46
 }
49
 }
47
 
50
 
48
 ul.tp-bar li {
51
 ul.tp-bar li {
137
     height: inherit;
140
     height: inherit;
138
     margin: 0px 20px;
141
     margin: 0px 20px;
139
     background-color: var(--secdSubColor);
142
     background-color: var(--secdSubColor);
143
+    border-top-left-radius: var(--lstPgArc);
144
+    border-top-right-radius: var(--lstPgArc);
140
 }
145
 }
141
 
146
 
142
 .srch-bar {
147
 .srch-bar {
170
     color: black;
175
     color: black;
171
 }
176
 }
172
 
177
 
178
+.icn-circle:hover {
179
+    color: white;
180
+}
181
+
173
 .icn-circle {
182
 .icn-circle {
174
     background-color: firebrick;
183
     background-color: firebrick;
175
     color: white;
184
     color: white;
176
     padding: 10px;
185
     padding: 10px;
186
+    text-decoration: none;
177
 }
187
 }
178
 
188
 
179
 .hdr {
189
 .hdr {
184
     background-color: #e3e3e3;
194
     background-color: #e3e3e3;
185
 }
195
 }
186
 
196
 
187
-.bdy {
188
-    font-size: 16px;
189
-    padding: 10px 5px;
190
-    font-weight: 400;
191
-    text-transform: capitalize;
192
-    border-bottom: 1px solid white;
193
-    align-items: center;
194
-}
195
-
196
 .mnNvIcn,
197
 .mnNvIcn,
197
 .mnNvIcn:focus {
198
 .mnNvIcn:focus {
198
     box-shadow: none !important;
199
     box-shadow: none !important;
260
 }
261
 }
261
 
262
 
262
 
263
 
263
-/* Scroll bar End Here */
264
-
265
-.pgnt {
266
-    border-top-left-radius: 50px;
267
-    border-top-right-radius: 50px;
268
-}
264
+/* Scroll bar End Here */

+ 30
- 9
assets/js/base.js 查看文件

1
-function getDataObj(obj) {
1
+const serverUrl = 'https://test.bizgaze.app/';
2
+let _baseUserInfo = atob(document.cookie.split('=')[1]);
3
+let baseUserInfo = JSON.parse(_baseUserInfo).result;
4
+let baseSessionId = baseUserInfo.sessionId;
2
 
5
 
3
-}
4
-
5
-function getData() {
6
-
7
-}
8
-
9
-function postDataObj(obj) {
6
+function getData(url) {
7
+    var datastr = null;
8
+    var method = "GET";
9
+    let serviceurl = serverUrl + url;
10
 
10
 
11
+    return $.ajax({
12
+        type: method,
13
+        url: serviceurl,
14
+        crossDomain: true,
15
+        contentType: "application/json",
16
+        cache: true,
17
+        jsonp: false,
18
+        data: datastr,
19
+        beforeSend: function(xhr) {
20
+            if (baseUserInfo != undefined && baseUserInfo != null) {
21
+                xhr.setRequestHeader("Authorization", "Basic " + baseSessionId);
22
+                xhr.setRequestHeader('geoposition', 0 + ':' + 0);
23
+            }
24
+        }
25
+    });
11
 }
26
 }
12
 
27
 
13
-function postData() {
28
+function formatLocal(dateTime) {
29
+    var date = moment.utc(dateTime).local();
30
+    var difmonths = moment().diff(date, 'months');
14
 
31
 
32
+    if (difmonths == 0) {
33
+        return this.formatPeriod(date);
34
+    }
35
+    return date.format("DD MMM, YYYY HH:mm");
15
 }
36
 }

+ 7
- 0
assets/js/bootstrap/bootstrap.bundle.min.js
文件差異過大導致無法顯示
查看文件


+ 43
- 0
assets/js/list.index.js 查看文件

1
+/*Data  loading  start here*/
2
+
3
+let _userInfo = atob(document.cookie.split('=')[1]);
4
+let userInfo = JSON.parse(_userInfo).result;
5
+let sessionId = userInfo.sessionId;
6
+
7
+let usrinfoHTML = `<li><a class="dropdown-item" href="javascript:void(0);">${userInfo.name}</a></li>
8
+<li><a class="dropdown-item" href="javascript:void(0);">Cloud Settings</a></li>
9
+<li><a class="dropdown-item" href="javascript:void(0);">Help</a></li>
10
+                    <li><a class="dropdown-item" href="javascript:void(0);">Logoff</a></li>`;
11
+$('.icn-circle').text(userInfo.name.charAt(0).toUpperCase())
12
+$('.uindtls').html(usrinfoHTML)
13
+
14
+// List Page loading
15
+getData('apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/6/PageSize/20').then(function(result) {
16
+    let response = JSON.parse(result.result);
17
+    let bdyUI = '';
18
+    for (var i = 0; i < response.length; i++) {
19
+        bdyUI += `<li class="d-flex flex-row m-0 p-0 bg-white border-bottom" data-installedAppId="${response[i].RedirectOptions.InstalledAppId}" data-formId="${response[i].RedirectOptions.CreateFormId}">
20
+                    <img src="../assets/imgs/notification.png" class="img-fluid h-75 p-1" >
21
+                    <div class="d-flex flex-column">
22
+                        <div class="d-flex justify-content-between">
23
+                            <div class="d-flex flex-column">
24
+                                <span>${response[i].Subject}</span>
25
+                                <span>${response[i].Message}</span>
26
+                            </div>
27
+                            <input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
28
+                        </div>
29
+                        <div class="d-flex justify-content-between mt-2">
30
+                            <span>21 days</span>
31
+                            <span>Mark as read</span>
32
+                        </div>
33
+                    </div>
34
+                </li>`;
35
+    }
36
+    $('.bdy-ul').html(bdyUI);
37
+})
38
+
39
+/*Data  loading  start here*/
40
+$('.mnNvIcn').click(function() {
41
+    $('.lft-nav-bar').toggleClass('lft-nav-bar-Wrap');
42
+    $('.ctr-lst-pge').toggleClass('lft-nav-bar-Wrap');
43
+});

+ 96
- 96
assets/js/login.js 查看文件

1
-const serverUrl = 'http://localhost:3088/';
1
+const serverUrl = 'https://test.bizgaze.app/';
2
 const emailInputEl = document.getElementById('email');
2
 const emailInputEl = document.getElementById('email');
3
 const passwordInputEl = document.getElementById('password');
3
 const passwordInputEl = document.getElementById('password');
4
 const emailErrEl = document.getElementById('emailErrMsg');
4
 const emailErrEl = document.getElementById('emailErrMsg');
14
 emailInputEl.focus();
14
 emailInputEl.focus();
15
 
15
 
16
 function showPasswordBox() {
16
 function showPasswordBox() {
17
-  const email = emailInputEl.value;
18
-  if (validateEmailOrPhone()) {
19
-    emailContainerEl.style.display = 'none';
20
-    passwordContainerEl.style.display = 'block';
21
-    document.getElementById('entered-email').innerHTML = email;
22
-    passwordInputEl.focus();
23
-    emailInputEl.classList.remove('error');
24
-    emailErrEl.innerText = '';
25
-  } else {
26
-    emailInputEl.classList.add('error');
27
-    emailErrEl.innerText = 'Please enter valid email or phone';
28
-  }
17
+    const email = emailInputEl.value;
18
+    if (validateEmailOrPhone()) {
19
+        emailContainerEl.style.display = 'none';
20
+        passwordContainerEl.style.display = 'block';
21
+        document.getElementById('entered-email').innerHTML = email;
22
+        passwordInputEl.focus();
23
+        emailInputEl.classList.remove('error');
24
+        emailErrEl.innerText = '';
25
+    } else {
26
+        emailInputEl.classList.add('error');
27
+        emailErrEl.innerText = 'Please enter valid email or phone';
28
+    }
29
 }
29
 }
30
 
30
 
31
 function validateEmailOrPhone() {
31
 function validateEmailOrPhone() {
32
-  const value = emailInputEl.value.trim();
33
-  const regx = /^[6-9]\d{9}$/;
34
-  if (value.includes('@') || regx.test(value)) {
35
-    return true;
36
-  }
37
-  return false;
32
+    const value = emailInputEl.value.trim();
33
+    const regx = /^[6-9]\d{9}$/;
34
+    if (value.includes('@') || regx.test(value)) {
35
+        return true;
36
+    }
37
+    return false;
38
 }
38
 }
39
 
39
 
40
 function togglePassword() {
40
 function togglePassword() {
41
-  const ele = document.getElementById('showPassword');
42
-  const password = passwordInputEl;
43
-
44
-  if (password.value.length > 0) {
45
-    passwordInputEl.value = password.value;
46
-    password.focus();
47
-    if (ele.checked) {
48
-      password.setAttribute('type', 'text');
49
-    } else {
50
-      password.setAttribute('type', 'password');
41
+    const ele = document.getElementById('showPassword');
42
+    const password = passwordInputEl;
43
+
44
+    if (password.value.length > 0) {
45
+        passwordInputEl.value = password.value;
46
+        password.focus();
47
+        if (ele.checked) {
48
+            password.setAttribute('type', 'text');
49
+        } else {
50
+            password.setAttribute('type', 'password');
51
+        }
51
     }
52
     }
52
-  }
53
 }
53
 }
54
 
54
 
55
 function onPasswordFocusOut() {
55
 function onPasswordFocusOut() {
56
-  const passwordLabel = document.getElementById('passwordLabel');
57
-  if (passwordInputEl.value.length > 0) {
58
-    passwordLabel.classList.add('password-fixed');
59
-  } else {
60
-    passwordLabel.classList.remove('password-fixed');
61
-  }
56
+    const passwordLabel = document.getElementById('passwordLabel');
57
+    if (passwordInputEl.value.length > 0) {
58
+        passwordLabel.classList.add('password-fixed');
59
+    } else {
60
+        passwordLabel.classList.remove('password-fixed');
61
+    }
62
 }
62
 }
63
 
63
 
64
 function onEmailFocusOut() {
64
 function onEmailFocusOut() {
65
-  const emailLabel = document.getElementById('emailLabel');
66
-  if (emailInputEl.value.trim()) {
67
-    emailLabel.classList.add('password-fixed');
68
-  } else {
69
-    emailLabel.classList.remove('password-fixed');
70
-  }
65
+    const emailLabel = document.getElementById('emailLabel');
66
+    if (emailInputEl.value.trim()) {
67
+        emailLabel.classList.add('password-fixed');
68
+    } else {
69
+        emailLabel.classList.remove('password-fixed');
70
+    }
71
 }
71
 }
72
 
72
 
73
 function setCookie(name, value, days) {
73
 function setCookie(name, value, days) {
74
-  var expires = '';
75
-  if (days) {
76
-    var date = new Date();
77
-    date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
78
-    expires = '; expires=' + date.toUTCString();
79
-  }
80
-  document.cookie = name + '=' + (value || '') + expires + '; path=/';
74
+    var expires = '';
75
+    if (days) {
76
+        var date = new Date();
77
+        date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
78
+        expires = '; expires=' + date.toUTCString();
79
+    }
80
+    document.cookie = name + '=' + (value || '') + expires + '; path=/';
81
 }
81
 }
82
 
82
 
83
 function loginUser(email, password) {
83
 function loginUser(email, password) {
84
-  const postData = JSON.stringify({
85
-    UserName: email,
86
-    Password: password,
87
-    UnibaseId: '',
88
-    RememberMe: false,
89
-  });
90
-
91
-  const requestOptions = {
92
-    method: 'POST',
93
-    headers: {
94
-      'Content-Type': 'application/json',
95
-    },
96
-    body: postData,
97
-    redirect: 'follow',
98
-  };
99
-
100
-  fetch(serverUrl + 'account/login', requestOptions)
101
-    .then((response) => response.text())
102
-    .then((result) => {
103
-      const data = JSON.parse(result);
104
-      if (data.status === 0) {
105
-        setCookie('authentication', data.result.sessionId, 1);
106
-        window.location = '../authentication';
107
-      } else {
108
-        passwordErrEl.innerText = data.message;
109
-      }
110
-    })
111
-    .catch((error) => {
112
-      passwordErrEl.innerText = error;
84
+    const postData = JSON.stringify({
85
+        UserName: email,
86
+        Password: password,
87
+        UnibaseId: '',
88
+        RememberMe: false,
113
     });
89
     });
90
+
91
+    const requestOptions = {
92
+        method: 'POST',
93
+        headers: {
94
+            'Content-Type': 'application/json',
95
+        },
96
+        body: postData,
97
+        redirect: 'follow',
98
+    };
99
+
100
+    fetch(serverUrl + 'account/login', requestOptions)
101
+        .then((response) => response.text())
102
+        .then((result) => {
103
+            const data = JSON.parse(result);
104
+            if (data.status === 0) {
105
+                setCookie('_idty', btoa(result), 1);
106
+                window.location = '../authentication';
107
+            } else {
108
+                passwordErrEl.innerText = data.message;
109
+            }
110
+        })
111
+        .catch((error) => {
112
+            passwordErrEl.innerText = error;
113
+        });
114
 }
114
 }
115
 
115
 
116
 function validateLogin() {
116
 function validateLogin() {
117
-  const email = emailInputEl.value;
118
-  const password = passwordInputEl.value;
119
-  if (password.trim().length !== 0) {
120
-    loginUser(email, password);
121
-  } else {
122
-    passwordInputEl.classList.add('error');
123
-    passwordErrEl.innerText = 'Please enter valid password';
124
-  }
117
+    const email = emailInputEl.value;
118
+    const password = passwordInputEl.value;
119
+    if (password.trim().length !== 0) {
120
+        loginUser(email, password);
121
+    } else {
122
+        passwordInputEl.classList.add('error');
123
+        passwordErrEl.innerText = 'Please enter valid password';
124
+    }
125
 }
125
 }
126
 
126
 
127
 function reEnterEmailClickHandler() {
127
 function reEnterEmailClickHandler() {
128
-  emailContainerEl.style.display = 'block';
129
-  passwordContainerEl.style.display = 'none';
130
-  emailInputEl.focus();
128
+    emailContainerEl.style.display = 'block';
129
+    passwordContainerEl.style.display = 'none';
130
+    emailInputEl.focus();
131
 }
131
 }
132
 
132
 
133
 function initializeEventListeners() {
133
 function initializeEventListeners() {
134
-  emailNextBtn.addEventListener('click', showPasswordBox);
134
+    emailNextBtn.addEventListener('click', showPasswordBox);
135
 
135
 
136
-  showPasswordChk.addEventListener('click', togglePassword);
136
+    showPasswordChk.addEventListener('click', togglePassword);
137
 
137
 
138
-  passwordInputEl.addEventListener('focusout', onPasswordFocusOut);
138
+    passwordInputEl.addEventListener('focusout', onPasswordFocusOut);
139
 
139
 
140
-  emailInputEl.addEventListener('focusout', onEmailFocusOut);
140
+    emailInputEl.addEventListener('focusout', onEmailFocusOut);
141
 
141
 
142
-  loginSubmitBtn.addEventListener('click', validateLogin);
142
+    loginSubmitBtn.addEventListener('click', validateLogin);
143
 
143
 
144
-  renterEmailLink.addEventListener('click', reEnterEmailClickHandler);
144
+    renterEmailLink.addEventListener('click', reEnterEmailClickHandler);
145
 }
145
 }
146
 
146
 
147
-initializeEventListeners();
147
+initializeEventListeners();

+ 9
- 19
authentication/index.html 查看文件

31
                 <span><i class="la la-question-circle"></i></span>
31
                 <span><i class="la la-question-circle"></i></span>
32
             </li>
32
             </li>
33
             <li>
33
             <li>
34
-                <span class="rounded-circle icn-circle">SS</span>
34
+                <a href="javascript:void(0);" class="rounded-circle icn-circle" data-bs-toggle="dropdown" aria-expanded="false">
35
+                    SS    
36
+                </a>
37
+                <ul class="dropdown-menu uindtls">
38
+                    <li><a class="dropdown-item" href="#">Action</a></li>
39
+
40
+                </ul>
35
             </li>
41
             </li>
36
         </ul>
42
         </ul>
37
         <div class="btm-bar">
43
         <div class="btm-bar">
60
                 </ul>
66
                 </ul>
61
             </div>
67
             </div>
62
             <div class="ctr-lst-pge">
68
             <div class="ctr-lst-pge">
63
-                <div class="row m-0 hdr">
64
-                    <div class="col-2">Code-1</div>
65
-                    <div class="col-3">
66
-                        name
67
-                    </div>
68
-                    <div class="col-4">Subject</div>
69
-                    <div class="col-2">Stages</div>
70
-                    <div class="col-1"></div>
71
-                </div>
72
-                <div class="row m-0 hdr">
73
-                    <div class="col-2">Code</div>
74
-                    <div class="col-3">
75
-                        name
76
-                    </div>
77
-                    <div class="col-4">Subject</div>
78
-                    <div class="col-2">Stages</div>
79
-                    <div class="col-1"></div>
80
-                </div>
69
+
81
                 <ul class="m-0 p-0 bdy-ul">
70
                 <ul class="m-0 p-0 bdy-ul">
82
                     <li class="row m-0 bdy">
71
                     <li class="row m-0 bdy">
83
                         <div class="col-2">TS10875</div>
72
                         <div class="col-2">TS10875</div>
122
     </section>
111
     </section>
123
 </body>
112
 </body>
124
 <script src="../assets/js/jquery/jquery-3.6.1.min.js"></script>
113
 <script src="../assets/js/jquery/jquery-3.6.1.min.js"></script>
114
+<script src="../assets/js/bootstrap/bootstrap.bundle.min.js"></script>
125
 <script src="../assets/js/base.js"></script>
115
 <script src="../assets/js/base.js"></script>
126
 <script src="../assets/js/list.index.js"></script>
116
 <script src="../assets/js/list.index.js"></script>
127
 
117
 

+ 1
- 1
index.html 查看文件

9
 </head>
9
 </head>
10
 
10
 
11
 <body>
11
 <body>
12
-    <script src="../assets/js/common.js"></script>
12
+    <script src="./assets/js/common.js"></script>
13
     <script>
13
     <script>
14
         if (isAuthenticated()) {
14
         if (isAuthenticated()) {
15
             window.location = './authentication';
15
             window.location = './authentication';

Loading…
取消
儲存