소스 검색

添加操作反馈

seamong 7 년 전
부모
커밋
1bbffe4f7a

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
www/webapp/moonclub_new/home/static/css/app.css


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
www/webapp/moonclub_new/home/static/js/app.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
www/webapp/moonclub_new/home/static/js/app.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
www/webapp/moonclub_new/home/static/js/manifest.js.map


+ 16 - 5
www/webapp/moonclub_new/src/view/exchange/index.vue

@@ -133,11 +133,16 @@ export default {
         weui.alert("请输入兑换码!");
         return;
       }
-      // 验证兑换码编号
+      // 兑换码编号不为空
       if (self.code.num == null) {
         weui.alert("请输入兑换码编号!");
         return;
       }
+      // 验证兑换码编号
+      if (isNaN(self.code.num)) {
+        weui.alert("您输入的编号有误,请重新输入!");
+        return;
+      }
       axios
         .get(
           `${_.apiPath}/j/JRecord/Record&user_id=${_.userId}&name=${
@@ -147,11 +152,17 @@ export default {
           }&coding_num=${self.code.num}`
         )
         .then(data => {
+          if (!data.data.success) {
+            weui.alert(data.data.message);
+            return;
+          } else {
+            weui.alert(`您已成功兑换${data.data.data.gift.title}`, function() {
+              // self.$router.push("/");
+            });
+            return;
+          }
+          console.log(data);
           // weui.alert('兑换成功!');
-          weui.alert(`您已成功兑换${data.data.data.gift.title}`, function() {
-            self.$router.push("/");
-          });
-          return;
           // console.log(data);
           // console.log(data.data.data.gift.desc);
           // console.log(data.data.data.gift.title);

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.