Sherry 1 год назад
Родитель
Сommit
b787f63d57

+ 20
- 3
src/fe/css/all.css Просмотреть файл

10805
   border: #747474 0.15em solid;
10805
   border: #747474 0.15em solid;
10806
   border-radius: 0.8em;
10806
   border-radius: 0.8em;
10807
   padding: 0.8em 0.55em;
10807
   padding: 0.8em 0.55em;
10808
+  background-color: #ffffff;
10808
 }
10809
 }
10809
 .tags .tags__item-md {
10810
 .tags .tags__item-md {
10810
   width: 30%;
10811
   width: 30%;
10958
   border-radius: 1em;
10959
   border-radius: 1em;
10959
   padding: 1em 1.5em;
10960
   padding: 1em 1.5em;
10960
   margin-bottom: 1.8em;
10961
   margin-bottom: 1.8em;
10962
+  background-color: #ffffff;
10961
 }
10963
 }
10962
 .form__input input, .form__input select {
10964
 .form__input input, .form__input select {
10963
   width: 100%;
10965
   width: 100%;
11255
     padding-bottom: 9.4375em;
11257
     padding-bottom: 9.4375em;
11256
   }
11258
   }
11257
 }
11259
 }
11258
-.register {
11259
-  padding-top: 3.5em;
11260
-  padding-bottom: 3em;
11260
+.register .section__container {
11261
+  width: 100%;
11262
+  padding: 3.5em 2.2em 3em;
11263
+  background: linear-gradient(to bottom, #A8E2FF 0%, rgba(191, 230, 246, 0) 100%);
11264
+}
11265
+.register .section__container::before {
11266
+  content: "";
11267
+  display: block;
11268
+  position: absolute;
11269
+  top: 0;
11270
+  left: 0;
11271
+  width: 100%;
11272
+  height: 100%;
11273
+  background: url(../images/register-bg.png) no-repeat center center/contain;
11274
+  opacity: 0.5;
11275
+}
11276
+.register .form {
11277
+  position: relative;
11261
 }
11278
 }
11262
 
11279
 
11263
 .passport {
11280
 .passport {

+ 1
- 1
src/fe/css/all.css.map
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 1
- 1
src/fe/css/component/_button.scss Просмотреть файл

7
     p {
7
     p {
8
         text-align: center;
8
         text-align: center;
9
         font-size: 1.6em;
9
         font-size: 1.6em;
10
-        color: $c-whiite;
10
+        color: $c-white;
11
         margin-bottom: 0;
11
         margin-bottom: 0;
12
     }
12
     }
13
     &.disable {
13
     &.disable {

+ 2
- 1
src/fe/css/component/_form.scss Просмотреть файл

78
                 display: none;
78
                 display: none;
79
                 flex: 0 0 auto;
79
                 flex: 0 0 auto;
80
                 &:checked + .label__checkbox {
80
                 &:checked + .label__checkbox {
81
-                    background-color: $c-whiite;
81
+                    background-color: $c-white;
82
                     &::before {
82
                     &::before {
83
                         display: block;
83
                         display: block;
84
                     }
84
                     }
111
         border-radius: 1em;
111
         border-radius: 1em;
112
         padding: 1em 1.5em;
112
         padding: 1em 1.5em;
113
         margin-bottom: 1.8em;
113
         margin-bottom: 1.8em;
114
+        background-color: $c-white;
114
         input, select {
115
         input, select {
115
             width: 100%;
116
             width: 100%;
116
             border: none;
117
             border: none;

+ 1
- 1
src/fe/css/component/_modal.scss Просмотреть файл

72
             p {
72
             p {
73
                 font-size: 1.8em;
73
                 font-size: 1.8em;
74
                 font-weight: 300;
74
                 font-weight: 300;
75
-                color: $c-whiite;
75
+                color: $c-white;
76
             }
76
             }
77
             &:after {
77
             &:after {
78
                 display: none;
78
                 display: none;

+ 1
- 0
src/fe/css/component/_tag.scss Просмотреть файл

8
         border: $c-gray 0.15em solid;
8
         border: $c-gray 0.15em solid;
9
         border-radius: 0.8em;
9
         border-radius: 0.8em;
10
         padding: 0.8em 0.55em;
10
         padding: 0.8em 0.55em;
11
+        background-color: $c-white;
11
         &-md {
12
         &-md {
12
             width: 30%;
13
             width: 30%;
13
             margin-right: 5%;
14
             margin-right: 5%;

+ 3
- 3
src/fe/css/page/_passport.scss Просмотреть файл

38
             }
38
             }
39
         }
39
         }
40
         &__content {
40
         &__content {
41
-            color: $c-whiite;
41
+            color: $c-white;
42
         }
42
         }
43
         &__nickname {
43
         &__nickname {
44
             margin-bottom: 0.1em;
44
             margin-bottom: 0.1em;
93
                 background: url(../images/arrow-down.png) no-repeat center center/contain;
93
                 background: url(../images/arrow-down.png) no-repeat center center/contain;
94
             }
94
             }
95
             p {
95
             p {
96
-                color: $c-whiite;
96
+                color: $c-white;
97
                 text-align: center;
97
                 text-align: center;
98
                 margin-bottom: 0;
98
                 margin-bottom: 0;
99
                 font-size: 1.6em;
99
                 font-size: 1.6em;
102
             }
102
             }
103
         }
103
         }
104
         &__body {
104
         &__body {
105
-            background-color: $c-whiite;
105
+            background-color: $c-white;
106
             padding: 1.5em 1.5em 0;
106
             padding: 1.5em 1.5em 0;
107
             .tags {
107
             .tags {
108
                 &__item {
108
                 &__item {

+ 19
- 2
src/fe/css/page/_register.scss Просмотреть файл

1
 @charset "UTF-8";
1
 @charset "UTF-8";
2
 .register {
2
 .register {
3
-    padding-top: 3.5em;
4
-    padding-bottom: 3em;
3
+    .section__container {
4
+        width: 100%;
5
+        padding: 3.5em 2.2em 3em;
6
+        background: linear-gradient(to bottom, #A8E2FF 0%, rgba(191, 230, 246, 0) 100%);
7
+        &::before {
8
+            content: "";
9
+            display: block;
10
+            position: absolute;
11
+            top: 0;
12
+            left: 0;
13
+            width: 100%;
14
+            height: 100%;
15
+            background: url(../images/register-bg.png) no-repeat center center/contain;
16
+            opacity: 0.5;
17
+        }
18
+    }
19
+    .form {
20
+        position: relative;
21
+    }
5
 }
22
 }

+ 1
- 1
src/fe/css/variable/_base.scss Просмотреть файл

16
 
16
 
17
 $c-blue-bright: #2AACE2;
17
 $c-blue-bright: #2AACE2;
18
 
18
 
19
-$c-whiite: #ffffff;
19
+$c-white: #ffffff;
20
 
20
 
21
 $c-black: #1E2846;
21
 $c-black: #1E2846;
22
 
22
 

Двоичные данные
src/fe/images/register-bg.png Просмотреть файл


+ 3
- 3
src/fe/index.html Просмотреть файл

286
                     <input id="healthAgeOption_1" type="radio" value="tag-bjbXSt2gi" name="healthAge">
286
                     <input id="healthAgeOption_1" type="radio" value="tag-bjbXSt2gi" name="healthAge">
287
                     <label for="healthAgeOption_1">
287
                     <label for="healthAgeOption_1">
288
                         <p>
288
                         <p>
289
-                          20歲以下
289
+                          19歲以下
290
                         </p>
290
                         </p>
291
                     </label>
291
                     </label>
292
                   </div>
292
                   </div>
326
                     <input id="healthAgeOption_6" type="radio" value="tag-pAxHnckQs" name="healthAge">
326
                     <input id="healthAgeOption_6" type="radio" value="tag-pAxHnckQs" name="healthAge">
327
                     <label for="healthAgeOption_6">
327
                     <label for="healthAgeOption_6">
328
                         <p>
328
                         <p>
329
-                          59歲以上
329
+                          60歲以上
330
                         </p>
330
                         </p>
331
                     </label>
331
                     </label>
332
                   </div>
332
                   </div>
353
                     <option value="">請選擇性別</option>
353
                     <option value="">請選擇性別</option>
354
                     <option value="tag-8HwqQuQ43">女性</option>
354
                     <option value="tag-8HwqQuQ43">女性</option>
355
                     <option value="tag-F8Me8-UGg">男性</option>
355
                     <option value="tag-F8Me8-UGg">男性</option>
356
-                    <option value="tag-8HwqQuQ43">不提供</option>
356
+                    <option value="tag-8HwqQuQ43">其他</option>
357
                   </select>
357
                   </select>
358
                 </div>
358
                 </div>
359
               </fieldset>
359
               </fieldset>

+ 1
- 9
src/fe/js/base.js Просмотреть файл

38
 
38
 
39
 					console.log("userData: ",userData)
39
 					console.log("userData: ",userData)
40
 					
40
 					
41
-					if(Object.keys(userData).length === 0) {
41
+					if(userData === null) {
42
 						sectionFadeIn(".register");
42
 						sectionFadeIn(".register");
43
 					}else {
43
 					}else {
44
 						sectionFadeIn(".passport");
44
 						sectionFadeIn(".passport");
45
 						passport.buildPassportHandler(userData)
45
 						passport.buildPassportHandler(userData)
46
 					}
46
 					}
47
 				})
47
 				})
48
-				.catch(err => {
49
-					console.log(err)
50
-					$(".wapper-loading").remove();
51
-					gsap.to(".wrapper", {
52
-						duration: 0.5,
53
-						autoAlpha: 1
54
-					});
55
-				})
56
 		})
48
 		})
57
 
49
 
58
 		// 返回表單頁
50
 		// 返回表單頁

+ 7
- 6
src/fe/js/passport.js Просмотреть файл

41
 
41
 
42
 		setTimeout(()=>{
42
 		setTimeout(()=>{
43
 
43
 
44
-			let getHealthAction = convertMultipleTag('healthAction', data.healthAction);
45
-			let gethealthTopic = convertMultipleTag('healthTopic', data.healthTopic);
46
-			let getHealthAge = convertSingleTag('healthAge', data.healthAge);
47
-			let getHealthGender= convertSingleTag('healthGender', data.healthGender);
48
-			convertData.headSticker = data.headSticker;
49
-			convertData.healthNickname = data.healthNickname;
44
+			let getHealthAction = convertMultipleTag('healthAction', data.filler_content.healthAction);
45
+			let gethealthTopic = convertMultipleTag('healthTopic', data.filler_content.healthTopic);
46
+			let getHealthAge = convertSingleTag('healthAge', data.filler_content.healthAge);
47
+			let getHealthGender= convertSingleTag('healthGender', data.filler_content.healthGender);
48
+			convertData.headSticker = data.head_sticker;
49
+			convertData.healthNickname = data.nickname;
50
 			
50
 			
51
 			Promise.all([getHealthAction ,gethealthTopic, getHealthAge, getHealthGender]).then((res) => {
51
 			Promise.all([getHealthAction ,gethealthTopic, getHealthAge, getHealthGender]).then((res) => {
52
 				console.log(convertData); // [3, 1337, "foo"]
52
 				console.log(convertData); // [3, 1337, "foo"]
53
 				buildTagHtml();
53
 				buildTagHtml();
54
 			});
54
 			});
55
+
55
 		}, 200);
56
 		}, 200);
56
 
57
 
57
 	}
58
 	}

+ 24
- 11
src/fe/js/register.js Просмотреть файл

143
 					LinePicHandler(linePicUrl);
143
 					LinePicHandler(linePicUrl);
144
 				}
144
 				}
145
 				if(fileInput.id == 'fileInput2') {
145
 				if(fileInput.id == 'fileInput2') {
146
-					// console.log(finalase64Data)
147
-					sendBase64DataToApi(finalase64Data);
146
+					setTimeout(()=>{
147
+						console.log(finalase64Data)
148
+						sendBase64DataToApi(finalase64Data);
149
+					}, 200);
150
+					
148
 				}
151
 				}
149
 			});
152
 			});
150
 		});
153
 		});
266
 		GameService.getInstanse().userRegister(registerData)
269
 		GameService.getInstanse().userRegister(registerData)
267
 			.then(_res => {
270
 			.then(_res => {
268
 				console.log(_res);
271
 				console.log(_res);
269
-				base.sectionFadeOut(".register");
270
-				base.sectionFadeIn(".passport");
271
-				$(".register .form-submit").removeClass("disable");
272
-                $(".register .form-submit p").text("下一步");
273
-				// 清除表單
274
-				resetRegister();
275
-				// 再次載入取得資料
276
-				GameService.getInstanse().userLogin();
277
-				passport.buildPassportHandler(registerData);
272
+				if(_res.result === 'successed') {
273
+					$(".register .form-submit").removeClass("disable");
274
+					$(".register .form-submit p").text("下一步");
275
+					// 清除表單
276
+					resetRegister();
277
+					// 再次載入取得資料
278
+					GameService.getInstanse().userLogin().then(_res => {
279
+						console.log("_res: ",_res);
280
+	
281
+						userData = GameService.getInstanse().getUserData();
282
+	
283
+						console.log("userData: ",userData)
284
+						
285
+						base.sectionFadeOut(".register");
286
+						base.sectionFadeIn(".passport");
287
+						passport.buildPassportHandler(userData)
288
+					})
289
+				}
290
+				
278
 			})
291
 			})
279
 			.catch(_err => {
292
 			.catch(_err => {
280
 				console.log(_err);
293
 				console.log(_err);

+ 32
- 39
src/fe/js/services/index.js
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 5
- 6
src/fe/js/services/userModel.js Просмотреть файл

10
    * @returns {TypeUserResponse} Promise
10
    * @returns {TypeUserResponse} Promise
11
    */
11
    */
12
   function loginUser () {
12
   function loginUser () {
13
-    return POST('/api/JWPokeGame/getUserInfo.ashx', {
14
-      lineUserId: m_lineUserId,
15
-    });
13
+    return GET('/api/survey/healthyPassPort/profile?lineUserId='+m_lineUserId);
16
   }
14
   }
17
 
15
 
18
   /**
16
   /**
21
    * @returns {TypeResponse} Promise
19
    * @returns {TypeResponse} Promise
22
    */
20
    */
23
   function registerUser (_formdata) {
21
   function registerUser (_formdata) {
24
-    return POST('/api/JWPokeGame/saveUserInfo.ashx', {
22
+    return POST('/api/survey/healthyPassPort/post', {
25
       lineUserId: m_lineUserId,
23
       lineUserId: m_lineUserId,
26
       ..._formdata,
24
       ..._formdata,
27
     }).catch((error)=> {
25
     }).catch((error)=> {
35
   * @returns {TypeUserResponse} Promise
33
   * @returns {TypeUserResponse} Promise
36
   */
34
   */
37
     function updatePhoto(base64Image) {
35
     function updatePhoto(base64Image) {
38
-      return POST('/api/JWPokeGame/getUserInfo.ashx', {
39
-        lineUserPhoto: base64Image,
36
+      return POST('/api/survey/healthyPassPort/stickerUpdate', {
37
+        lineUserId: m_lineUserId,
38
+        headSticker: base64Image,
40
       });
39
       });
41
     }
40
     }
42
   
41
   

+ 20
- 19
src/fe/js/utlis.js Просмотреть файл

15
 
15
 
16
 switch (window.location.host.toLowerCase()) {
16
 switch (window.location.host.toLowerCase()) {
17
 
17
 
18
-  case 'mortlach-com.diageoplatform.com':
18
+  case 'infra.cecmartech.com:8077':
19
     isLIVE = false;
19
     isLIVE = false;
20
     break;
20
     break;
21
 
21
 
154
 
154
 
155
 function POST(theUrl, theData) {
155
 function POST(theUrl, theData) {
156
   const _url = API__DOMAIN + theUrl;
156
   const _url = API__DOMAIN + theUrl;
157
+  // console.log(JSON.stringify(theData))
157
   return fetch(_url, {
158
   return fetch(_url, {
158
     method: 'POST',
159
     method: 'POST',
159
     headers: {
160
     headers: {
164
   .then((response) => {
165
   .then((response) => {
165
     return response.json(); 
166
     return response.json(); 
166
   }).then((jsonData) => {
167
   }).then((jsonData) => {
167
-    const { success, msg } = jsonData;
168
-    if (!success) {
169
-      throw new Error(msg);
170
-    }
168
+    // const { success, msg } = jsonData;
169
+    // if (!success) {
170
+    //   throw new Error(msg);
171
+    // }
172
+    console.log(jsonData)
171
     return jsonData;
173
     return jsonData;
172
-  }).catch((err) => {
173
-    throw new Error(err);
174
-  });
174
+  })
175
+  // .catch((err) => {
176
+  //   throw new Error(err);
177
+  // });
175
 }
178
 }
176
 
179
 
177
-function GET(theUrl, theData) {
178
-  const _url = API__DOMAIN + theUrl +'?' + serialize(theData);
180
+function GET(theUrl) {
181
+  const _url = API__DOMAIN + theUrl;
179
   return fetch(_url, {})
182
   return fetch(_url, {})
180
     .then((response) => {
183
     .then((response) => {
181
       return response.json(); 
184
       return response.json(); 
182
     }).then((jsonData) => {
185
     }).then((jsonData) => {
183
-      const { success, msg } = jsonData;
184
-      if (!success) {
185
-        throw new Error(msg);
186
-      }
186
+      console.log(jsonData)
187
       return jsonData;
187
       return jsonData;
188
-    }).catch((err) => {
189
-      throw new Error(err);
190
-  });
188
+    })
189
+    // .catch((err) => {
190
+    //   throw new Error(err);
191
+    // });
191
 }
192
 }
192
 
193
 
193
 const PRE__LIFFID = '2000769399-lGpVNobN'; // 測試liffId待定
194
 const PRE__LIFFID = '2000769399-lGpVNobN'; // 測試liffId待定
225
   });
226
   });
226
 }
227
 }
227
 
228
 
228
-const _PRE__HOST = 'mortlach-com.diageoplatform.com';
229
+const _PRE__HOST = 'infra.cecmartech.com:8077';
229
 const _PRO__HOST = 'line.maltssociety.com.tw';
230
 const _PRO__HOST = 'line.maltssociety.com.tw';
230
 const _URL = location.hostname;
231
 const _URL = location.hostname;
231
 const _host = (_URL.indexOf(_PRO__HOST) != -1) ? _PRO__HOST : _PRE__HOST;
232
 const _host = (_URL.indexOf(_PRO__HOST) != -1) ? _PRO__HOST : _PRE__HOST;
232
-const API__DOMAIN = 'https://' + _host;
233
+const API__DOMAIN = location.protocol+'//' + _host;
233
 
234
 
234
 
235
 
235
 var isIE = false;
236
 var isIE = false;