瀏覽代碼

Merge branch 'test' of git.oschina.net:yiguanjia/php into test

north 7 年之前
父節點
當前提交
c7c9835ba2

+ 1 - 1
www/protected/modules/moonclub/views/web/index.php

@@ -27,7 +27,7 @@
   <?php $host = 'http://common.yiguanjia.me/'; ?>
   <!-- vue~资源版本号 -->
   <?php $newVersion = time() /*时间戳*/ ?>
-  <?php $newVersion = 2018062001 ?>
+  <?php $newVersion = 2018070102 ?>
   <link rel=stylesheet href=https://res.wx.qq.com/open/libs/weui/1.1.2/weui.min.css>
   <script type=text/javascript src=https://res.wx.qq.com/open/libs/weuijs/1.1.2/weui.min.js></script>
   <link href=<?php echo $host ?>webapp/moonclub_new/home/static/css/app.css?v=<?php echo $newVersion ?> rel=stylesheet>

文件差異過大導致無法顯示
+ 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


+ 39 - 28
www/webapp/moonclub_new/src/view/exchange/index.vue

@@ -85,29 +85,29 @@
   </div>
 </template>
 <script>
-import axios from 'axios';
-import qs from 'qs';
-import _ from '@/config';
+import axios from "axios";
+import qs from "qs";
+import _ from "@/config";
 export default {
   data() {
     return {
       user: {
         name: null,
         mobile: null,
-        address: null,
+        address: null
       },
       Vcode: {
         create: this.createCode(),
         enter: null,
         sms: {
           create: null,
-          enter: null,
-        },
+          enter: null
+        }
       },
       code: {
         num: null,
-        pwd: null,
-      },
+        pwd: null
+      }
     };
   },
   methods: {
@@ -115,43 +115,54 @@ export default {
       let self = this;
       // 验证姓名
       if (self.user.name == null) {
-        weui.alert('请重新输入姓名!');
+        weui.alert("请重新输入姓名!");
         return;
       }
       // 验证地址
       if (self.user.address == null) {
-        weui.alert('收货地址不为空!');
+        weui.alert("收货地址不为空!");
         return;
       }
       // 验证手机
       if (self.Vcode.sms.create != self.Vcode.sms.enter) {
-        weui.alert('手机验证失败,请重新验证!');
+        weui.alert("手机验证失败,请重新验证!");
         return;
       }
       // 验证兑换码
       if (self.code.pwd == null) {
-        weui.alert('请输入兑换码!');
+        weui.alert("请输入兑换码!");
         return;
       }
-      /*     // 验证兑换码密码
+      // 兑换码编号不为空
       if (self.code.num == null) {
-        weui.alert("请输入兑换码密码!");
+        weui.alert("请输入兑换码编号!");
+        return;
+      }
+      // 验证兑换码编号
+      if (isNaN(self.code.num)) {
+        weui.alert("您输入的编号有误,请重新输入!");
         return;
-      } */
+      }
       axios
         .get(
           `${_.apiPath}/j/JRecord/Record&user_id=${_.userId}&name=${
             self.user.name
           }&mobile=${self.user.mobile}&address=${self.user.address}&pwd=${
             self.code.pwd
-          }`,
+          }&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);
@@ -169,22 +180,22 @@ export default {
       let self = this;
       // 检验手机号码
       if (!/^1[34578]\d{9}$/.test(self.user.mobile) || self.user.mobile === 0) {
-        weui.alert('输入的手机号码有误,请重新输入');
+        weui.alert("输入的手机号码有误,请重新输入");
         return;
       }
       // 验证码检测
       if (self.Vcode.enter == null || self.Vcode.enter != self.Vcode.create) {
-        weui.alert('您输入验证码有误,请重新输入');
+        weui.alert("您输入验证码有误,请重新输入");
         return;
       } else {
         axios
           .get(
             `${_.apiPath}/moonclub/reserve/code&type=2&mobile=${
               self.user.mobile
-            }`,
+            }`
           )
           .then(data => {
-            weui.alert('短信已发送,请留意查收!');
+            weui.alert("短信已发送,请留意查收!");
             self.Vcode.sms.create = data.data.data.code;
             console.log(data.data.data.code);
             return;
@@ -192,7 +203,7 @@ export default {
       }
     },
     createCode() {
-      let code = '';
+      let code = "";
       let random = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; // 随机数
       for (let i = 0; i < 4; i++) {
         // 循环操作
@@ -203,9 +214,9 @@ export default {
     },
     back() {
       console.log(170);
-      this.$router.push('/');
-    },
-  },
+      this.$router.push("/");
+    }
+  }
 };
 </script>
 

部分文件因文件數量過多而無法顯示