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

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

@@ -10805,6 +10805,7 @@ button.swiper-pagination-bullet {
10805 10805
   border: #747474 0.15em solid;
10806 10806
   border-radius: 0.8em;
10807 10807
   padding: 0.8em 0.55em;
10808
+  background-color: #ffffff;
10808 10809
 }
10809 10810
 .tags .tags__item-md {
10810 10811
   width: 30%;
@@ -10958,6 +10959,7 @@ button.swiper-pagination-bullet {
10958 10959
   border-radius: 1em;
10959 10960
   padding: 1em 1.5em;
10960 10961
   margin-bottom: 1.8em;
10962
+  background-color: #ffffff;
10961 10963
 }
10962 10964
 .form__input input, .form__input select {
10963 10965
   width: 100%;
@@ -11255,9 +11257,24 @@ p {
11255 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 11280
 .passport {

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


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

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

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

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

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

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

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

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

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

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

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

@@ -1,5 +1,22 @@
1 1
 @charset "UTF-8";
2 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,7 +16,7 @@ $c-blue-active: #EAF2F8;
16 16
 
17 17
 $c-blue-bright: #2AACE2;
18 18
 
19
-$c-whiite: #ffffff;
19
+$c-white: #ffffff;
20 20
 
21 21
 $c-black: #1E2846;
22 22
 

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


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

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

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

@@ -38,21 +38,13 @@ base = function () {
38 38
 
39 39
 					console.log("userData: ",userData)
40 40
 					
41
-					if(Object.keys(userData).length === 0) {
41
+					if(userData === null) {
42 42
 						sectionFadeIn(".register");
43 43
 					}else {
44 44
 						sectionFadeIn(".passport");
45 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,17 +41,18 @@ passport = function () {
41 41
 
42 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 51
 			Promise.all([getHealthAction ,gethealthTopic, getHealthAge, getHealthGender]).then((res) => {
52 52
 				console.log(convertData); // [3, 1337, "foo"]
53 53
 				buildTagHtml();
54 54
 			});
55
+
55 56
 		}, 200);
56 57
 
57 58
 	}

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

@@ -143,8 +143,11 @@ register = function () {
143 143
 					LinePicHandler(linePicUrl);
144 144
 				}
145 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,15 +269,25 @@ register = function () {
266 269
 		GameService.getInstanse().userRegister(registerData)
267 270
 			.then(_res => {
268 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 292
 			.catch(_err => {
280 293
 				console.log(_err);

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


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

@@ -10,9 +10,7 @@ function UserModel(_lineUserId) {
10 10
    * @returns {TypeUserResponse} Promise
11 11
    */
12 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,7 +19,7 @@ function UserModel(_lineUserId) {
21 19
    * @returns {TypeResponse} Promise
22 20
    */
23 21
   function registerUser (_formdata) {
24
-    return POST('/api/JWPokeGame/saveUserInfo.ashx', {
22
+    return POST('/api/survey/healthyPassPort/post', {
25 23
       lineUserId: m_lineUserId,
26 24
       ..._formdata,
27 25
     }).catch((error)=> {
@@ -35,8 +33,9 @@ function UserModel(_lineUserId) {
35 33
   * @returns {TypeUserResponse} Promise
36 34
   */
37 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,7 +15,7 @@ isLIVE = false;
15 15
 
16 16
 switch (window.location.host.toLowerCase()) {
17 17
 
18
-  case 'mortlach-com.diageoplatform.com':
18
+  case 'infra.cecmartech.com:8077':
19 19
     isLIVE = false;
20 20
     break;
21 21
 
@@ -154,6 +154,7 @@ function eraseCookie(name) {
154 154
 
155 155
 function POST(theUrl, theData) {
156 156
   const _url = API__DOMAIN + theUrl;
157
+  // console.log(JSON.stringify(theData))
157 158
   return fetch(_url, {
158 159
     method: 'POST',
159 160
     headers: {
@@ -164,30 +165,30 @@ function POST(theUrl, theData) {
164 165
   .then((response) => {
165 166
     return response.json(); 
166 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 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 182
   return fetch(_url, {})
180 183
     .then((response) => {
181 184
       return response.json(); 
182 185
     }).then((jsonData) => {
183
-      const { success, msg } = jsonData;
184
-      if (!success) {
185
-        throw new Error(msg);
186
-      }
186
+      console.log(jsonData)
187 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 194
 const PRE__LIFFID = '2000769399-lGpVNobN'; // 測試liffId待定
@@ -225,11 +226,11 @@ function sleep(seconds) {
225 226
   });
226 227
 }
227 228
 
228
-const _PRE__HOST = 'mortlach-com.diageoplatform.com';
229
+const _PRE__HOST = 'infra.cecmartech.com:8077';
229 230
 const _PRO__HOST = 'line.maltssociety.com.tw';
230 231
 const _URL = location.hostname;
231 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 236
 var isIE = false;