Browse Source

添加操作反馈

seamong 7 years ago
parent
commit
1bbffe4f7a

File diff suppressed because it is too large
+ 0 - 0
www/webapp/moonclub_new/home/static/css/app.css


File diff suppressed because it is too large
+ 0 - 0
www/webapp/moonclub_new/home/static/js/app.js


File diff suppressed because it is too large
+ 0 - 0
www/webapp/moonclub_new/home/static/js/app.js.map


File diff suppressed because it is too large
+ 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);

Some files were not shown because too many files changed in this diff