瀏覽代碼

add try-catch

StephenArk30 6 年之前
父節點
當前提交
7d7fb161d4
共有 60 個文件被更改,包括 372 次插入270 次删除
  1. 0 1
      sourcecode/h5app/deploy/css/app.d53306c0.css
  2. 0 0
      sourcecode/h5app/deploy/css/chunk-00bf1ced.f03bf99a.css
  3. 0 1
      sourcecode/h5app/deploy/css/chunk-0a87134c.db3d42d0.css
  4. 0 0
      sourcecode/h5app/deploy/css/chunk-2daee58c.e9fee990.css
  5. 0 0
      sourcecode/h5app/deploy/css/chunk-2e4ee564.14731c4e.css
  6. 0 0
      sourcecode/h5app/deploy/css/chunk-3dd51d56.46a62a1f.css
  7. 0 0
      sourcecode/h5app/deploy/css/chunk-51d92932.a0f27f3f.css
  8. 0 0
      sourcecode/h5app/deploy/css/chunk-53fd9c66.bbe6189d.css
  9. 0 0
      sourcecode/h5app/deploy/css/chunk-6bbe4703.232f0874.css
  10. 0 0
      sourcecode/h5app/deploy/css/chunk-6c980380.eddeec05.css
  11. 0 0
      sourcecode/h5app/deploy/css/chunk-88ecd442.e8d4ee8f.css
  12. 0 1
      sourcecode/h5app/deploy/css/chunk-ac1b7f92.fa1f1080.css
  13. 0 0
      sourcecode/h5app/deploy/css/chunk-c44757a0.05f1e4df.css
  14. 0 0
      sourcecode/h5app/deploy/css/chunk-vendors.1a36ffd2.css
  15. 二進制
      sourcecode/h5app/deploy/favicon.ico
  16. 二進制
      sourcecode/h5app/deploy/img/1.5b888dce.png
  17. 二進制
      sourcecode/h5app/deploy/img/2.79d0b9d0.png
  18. 二進制
      sourcecode/h5app/deploy/img/3.8586201f.png
  19. 二進制
      sourcecode/h5app/deploy/img/4.8782a450.png
  20. 二進制
      sourcecode/h5app/deploy/img/post.bafd5f9a.png
  21. 0 0
      sourcecode/h5app/deploy/index.html
  22. 0 0
      sourcecode/h5app/deploy/js/app.db87050b.js
  23. 0 0
      sourcecode/h5app/deploy/js/app.db87050b.js.map
  24. 0 0
      sourcecode/h5app/deploy/js/chunk-00bf1ced.21b103d3.js
  25. 0 0
      sourcecode/h5app/deploy/js/chunk-00bf1ced.21b103d3.js.map
  26. 0 0
      sourcecode/h5app/deploy/js/chunk-0a87134c.d6f6a721.js
  27. 0 0
      sourcecode/h5app/deploy/js/chunk-0a87134c.d6f6a721.js.map
  28. 0 0
      sourcecode/h5app/deploy/js/chunk-2daee58c.715a9570.js
  29. 0 0
      sourcecode/h5app/deploy/js/chunk-2daee58c.715a9570.js.map
  30. 0 0
      sourcecode/h5app/deploy/js/chunk-2e4ee564.c91ed899.js
  31. 0 0
      sourcecode/h5app/deploy/js/chunk-2e4ee564.c91ed899.js.map
  32. 0 0
      sourcecode/h5app/deploy/js/chunk-3dd51d56.fac6e801.js
  33. 0 0
      sourcecode/h5app/deploy/js/chunk-3dd51d56.fac6e801.js.map
  34. 0 0
      sourcecode/h5app/deploy/js/chunk-488c01eb.f134952a.js
  35. 0 0
      sourcecode/h5app/deploy/js/chunk-488c01eb.f134952a.js.map
  36. 0 0
      sourcecode/h5app/deploy/js/chunk-51d92932.11f18c0d.js
  37. 0 0
      sourcecode/h5app/deploy/js/chunk-51d92932.11f18c0d.js.map
  38. 0 2
      sourcecode/h5app/deploy/js/chunk-53fd9c66.a0fbea28.js
  39. 0 0
      sourcecode/h5app/deploy/js/chunk-53fd9c66.a0fbea28.js.map
  40. 0 0
      sourcecode/h5app/deploy/js/chunk-6bbe4703.ccca3686.js
  41. 0 0
      sourcecode/h5app/deploy/js/chunk-6bbe4703.ccca3686.js.map
  42. 0 0
      sourcecode/h5app/deploy/js/chunk-6c980380.f794e0fd.js
  43. 0 0
      sourcecode/h5app/deploy/js/chunk-6c980380.f794e0fd.js.map
  44. 0 0
      sourcecode/h5app/deploy/js/chunk-88ecd442.ada59606.js
  45. 0 0
      sourcecode/h5app/deploy/js/chunk-88ecd442.ada59606.js.map
  46. 0 0
      sourcecode/h5app/deploy/js/chunk-ac1b7f92.aff6a880.js
  47. 0 0
      sourcecode/h5app/deploy/js/chunk-ac1b7f92.aff6a880.js.map
  48. 0 0
      sourcecode/h5app/deploy/js/chunk-c44757a0.e930cbbb.js
  49. 0 0
      sourcecode/h5app/deploy/js/chunk-c44757a0.e930cbbb.js.map
  50. 0 0
      sourcecode/h5app/deploy/js/chunk-vendors.c3b76ac6.js
  51. 0 0
      sourcecode/h5app/deploy/js/chunk-vendors.c3b76ac6.js.map
  52. 55 50
      sourcecode/h5app/vue/src/components/schoolCard.vue
  53. 18 13
      sourcecode/h5app/vue/src/components/schoolidCard.vue
  54. 3 9
      sourcecode/h5app/vue/src/views/Assess.vue
  55. 60 55
      sourcecode/h5app/vue/src/views/PresentRegister.vue
  56. 85 48
      sourcecode/h5app/vue/src/views/SecurityVerify.vue
  57. 47 36
      sourcecode/h5app/vue/src/views/giftDetail.vue
  58. 78 38
      sourcecode/h5app/vue/src/views/index.vue
  59. 16 9
      sourcecode/h5app/vue/src/views/login.vue
  60. 10 7
      sourcecode/h5app/vue/src/views/me.vue

+ 0 - 1
sourcecode/h5app/deploy/css/app.d53306c0.css

@@ -1 +0,0 @@
-#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50}body{background-color:#fff6e3}

文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/css/chunk-00bf1ced.f03bf99a.css


+ 0 - 1
sourcecode/h5app/deploy/css/chunk-0a87134c.db3d42d0.css

@@ -1 +0,0 @@
-.van-button[data-v-4c0fa4a9]{background-color:#fd6740;border-color:#fd6740;margin:10px 0 10px;width:55%}div[data-v-4c0fa4a9]{margin-top:10px;background-color:#fff;border:1px solid;padding:10px}

文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/css/chunk-2daee58c.e9fee990.css


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/css/chunk-2e4ee564.14731c4e.css


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/css/chunk-3dd51d56.46a62a1f.css


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/css/chunk-51d92932.a0f27f3f.css


+ 0 - 0
sourcecode/h5app/deploy/css/chunk-53fd9c66.bbe6189d.css


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/css/chunk-6bbe4703.232f0874.css


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/css/chunk-6c980380.eddeec05.css


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/css/chunk-88ecd442.e8d4ee8f.css


+ 0 - 1
sourcecode/h5app/deploy/css/chunk-ac1b7f92.fa1f1080.css

@@ -1 +0,0 @@
-.c[data-v-1022046d]{height:25px;margin-left:10px;margin-right:5px}p[data-v-1022046d]{margin:0;font-size:80%}.gift_card[data-v-1022046d]{margin:20px 20px;background-color:#fff;padding:10px}.van-nav-bar{height:46px;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;line-height:46px;background-color:#fff}.van-nav-bar .van-icon{color:#1989fa;vertical-align:middle}.van-nav-bar__arrow{min-width:1em;font-size:16px}.van-nav-bar__arrow+.van-nav-bar__text{margin-left:-20px;padding-left:25px}.van-nav-bar--fixed{top:0;left:0;width:100%;position:fixed}.van-nav-bar__title{margin:0 auto;max-width:60%;font-size:16px;font-weight:500}.van-nav-bar__left,.van-nav-bar__right{bottom:0;font-size:14px;position:absolute}.van-nav-bar__left{left:15px}.van-nav-bar__right{right:15px}.van-nav-bar__text{color:#1989fa;margin:0 -15px;padding:0 15px;display:inline-block;vertical-align:middle}.van-nav-bar__text:active{background-color:#e8e8e8}.letter[data-v-0ee1d1e0]{background-color:#fff;margin:20px 20px;border:1px solid #e4e4e4;padding:0 15px;text-align:left}

文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/css/chunk-c44757a0.05f1e4df.css


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/css/chunk-vendors.1a36ffd2.css


二進制
sourcecode/h5app/deploy/favicon.ico


二進制
sourcecode/h5app/deploy/img/1.5b888dce.png


二進制
sourcecode/h5app/deploy/img/2.79d0b9d0.png


二進制
sourcecode/h5app/deploy/img/3.8586201f.png


二進制
sourcecode/h5app/deploy/img/4.8782a450.png


二進制
sourcecode/h5app/deploy/img/post.bafd5f9a.png


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/index.html


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/app.db87050b.js


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/app.db87050b.js.map


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-00bf1ced.21b103d3.js


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-00bf1ced.21b103d3.js.map


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-0a87134c.d6f6a721.js


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-0a87134c.d6f6a721.js.map


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-2daee58c.715a9570.js


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-2daee58c.715a9570.js.map


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-2e4ee564.c91ed899.js


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-2e4ee564.c91ed899.js.map


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-3dd51d56.fac6e801.js


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-3dd51d56.fac6e801.js.map


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-488c01eb.f134952a.js


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-488c01eb.f134952a.js.map


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-51d92932.11f18c0d.js


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-51d92932.11f18c0d.js.map


+ 0 - 2
sourcecode/h5app/deploy/js/chunk-53fd9c66.a0fbea28.js

@@ -1,2 +0,0 @@
-(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-53fd9c66"],{4611:function(n,e,c){"use strict";c.r(e);var t=function(){var n=this,e=n.$createElement;n._self._c;return n._m(0)},r=[function(){var n=this,e=n.$createElement,c=n._self._c||e;return c("div",[c("p",[n._v("请前往关注公众号“深大换换”,回复“1”注册")])])}],i=(c("cadf"),c("551c"),c("097d"),{name:"noUserWarning"}),a=i,f=(c("dcf9"),c("2877")),s=Object(f["a"])(a,t,r,!1,null,"92f34f7c",null);s.options.__file="noUserWarning.vue";e["default"]=s.exports},8065:function(n,e,c){},dcf9:function(n,e,c){"use strict";var t=c("8065"),r=c.n(t);r.a}}]);
-//# sourceMappingURL=chunk-53fd9c66.a0fbea28.js.map

文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-53fd9c66.a0fbea28.js.map


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-6bbe4703.ccca3686.js


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-6bbe4703.ccca3686.js.map


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-6c980380.f794e0fd.js


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-6c980380.f794e0fd.js.map


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-88ecd442.ada59606.js


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-88ecd442.ada59606.js.map


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-ac1b7f92.aff6a880.js


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-ac1b7f92.aff6a880.js.map


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-c44757a0.e930cbbb.js


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-c44757a0.e930cbbb.js.map


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-vendors.c3b76ac6.js


文件差異過大導致無法顯示
+ 0 - 0
sourcecode/h5app/deploy/js/chunk-vendors.c3b76ac6.js.map


+ 55 - 50
sourcecode/h5app/vue/src/components/schoolCard.vue

@@ -67,33 +67,36 @@
                 let formData = new FormData();
                 formData.append('file', this.photo);
                 BasicFunction.get_data("http://gift.fogice.com/server/fileserver/upload?sign=abcdefg", function (res) {
-                    if (res.model === undefined || res.model.length === 0) {
-                        Toast.fail('上传失败,请重试');
-                        return;
-                    }
-                    if (res.ret === '10000') {
+                    // if (res.model === undefined || res.model.length === 0) {
+                    //     Toast.fail('上传失败,请重试');
+                    //     return;
+                    // }
+                    try {
                         let photoURL = res.model;
-                        let userid = localStorage.getItem('frontend-userid');
-                        BasicFunction.get_data('smartIdentity/list?userId=' + userid, function (res) {
-                            // console.log('----- User Identity -----');
-                            // console.log(res);
-                            if (res.ret === '10000') {
-                                let t = res.model.list[0];
-                                t.userSchoolCardPic = photoURL;
-                                t.userReviewStatus = 100;
-                                t.reviewerNote = "未审核";
-                                t.reviewerNoteToUser = "未审核";
-                                BasicFunction.get_data('smartIdentity/updateBatch', function (res) {
-                                    if (res.ret === '10000') {
-                                        Toast.success('上传成功');
-                                        location.reload();
-                                    }
-                                    else Toast.fail('上传失败,请重试');
-                                }, [t]);
-                            } else Toast.fail('访问失败,请重试');
-                        }, {});
-                    } else {
-                        Toast.fail('上传失败');
+                        if (res.ret === '10000') {
+                            let userid = localStorage.getItem('frontend-userid');
+                            BasicFunction.get_data('smartIdentity/list?userId=' + userid, function (res) {
+                                // console.log('----- User Identity -----');
+                                // console.log(res);
+                                if (res.ret === '10000') {
+                                    let t = res.model.list[0];
+                                    t.userSchoolCardPic = photoURL;
+                                    t.userReviewStatus = 100;
+                                    t.reviewerNote = "未审核";
+                                    t.reviewerNoteToUser = "未审核";
+                                    BasicFunction.get_data('smartIdentity/updateBatch', function (res) {
+                                        if (res.ret === '10000') {
+                                            Toast.success('上传成功');
+                                            location.reload();
+                                        }
+                                        else Toast.fail('上传失败,请重试');
+                                    }, [t]);
+                                } else Toast.fail('访问失败,请重试');
+                            }, {});
+                        } else Toast.fail('上传失败,请重试');
+                    } catch (e) {
+                        console.warn(e);
+                        Toast.fail('上传失败,请重试');
                     }
                 }, formData);
             },
@@ -112,31 +115,33 @@
                 // console.log('----- User Identity -----');
                 // console.log(res);
                 if (res.ret === '10000') {
-                    var t=res.model.list;
-                    that.status=t[0].userReviewStatus;
-                    that.imgDo=t[0];
-                    that.note = t[0].reviewerNoteToUser;
-                    // console.log(that);
-                    if (res.model.list.length === 0 || that.status === 30) {
-                        that.statusColor='#c5c5c5';
-                        that.statusString='未上传校卡';
-                        that.$router.push('verify');
-                        return;
-                    } else if (that.status === 100 || that.status === 1000) {
-                        that.schoolpic=that.IMGPREFIX+t[0].userSchoolCardPic;
-                        if (that.status === 100)
-                        {
-                            that.statusColor='#c5c530';
-                            that.statusString='审核中'
-                        }
-
-                        if(that.status === 1000) {
-                            that.statusColor = '#00ff00';
-                            that.statusString='审核通过'
+                    try {
+                        let t = res.model.list;
+                        that.status = t[0].userReviewStatus;
+                        that.imgDo = t[0];
+                        that.note = t[0].reviewerNoteToUser;
+                        // console.log(that);
+                        if (res.model.list.length === 0 || that.status === 30) {
+                            that.statusColor = '#c5c5c5';
+                            that.statusString = '未上传校卡';
+                            that.$router.push('verify');
+                        } else if (that.status === 100 || that.status === 1000) {
+                            that.schoolpic = that.IMGPREFIX + t[0].userSchoolCardPic;
+                            if (that.status === 100) {
+                                that.statusColor = '#c5c530';
+                                that.statusString = '审核中'
+                            }
+                            if (that.status === 1000) {
+                                that.statusColor = '#00ff00';
+                                that.statusString = '审核通过'
+                            }
+                        } else {
+                            that.statusColor = '#ff0000';
+                            that.statusString = '审核未通过'
                         }
-                    } else {
-                        that.statusColor='#ff0000';
-                        that.statusString='审核未通过'
+                    } catch (e) {
+                        console.warn(e);
+                        Toast.fail('获取用户信息失败');
                     }
                 }
             }, {});

+ 18 - 13
sourcecode/h5app/vue/src/components/schoolidCard.vue

@@ -151,13 +151,15 @@
                 BasicFunction.get_data("smartUsers/list?uid=" + userId, function (response) {
                     // console.log("------ Data Rcvd in getIdentityInfo --------");
                     // console.log(response);
-                    if (response.ret === "10000") {
+                    try {
                         let t = response.model.list;
-                        that.personName = t[0].name; // 左侧是vue页面内的变量名字, 右侧是后台数据里的变量名称
-                        that.userDo = t[0];
-                    } else {
-                        // 注册失败的处理
-                        Toast.fail("获取失败,请检查网络");
+                        if (response.ret === "10000") {
+                            that.personName = t[0].name; // 左侧是vue页面内的变量名字, 右侧是后台数据里的变量名称
+                            that.userDo = t[0];
+                        } else Toast.fail("获取信息失败,请检查网络");
+                    } catch (e) {
+                        console.warn(e);
+                        Toast.fail("获取信息失败,请检查网络");
                     }
                 }, [{}]);
             },
@@ -171,13 +173,16 @@
                 BasicFunction.get_data("smartIdentity/list?userId=" + userId, function (response) {
                     // console.log("------ Data Rcvd in getReviewInfo --------");
                     // console.log(response);
-                    if (response.ret === "10000") {
-                        var t = response.model.list;
-                        that.gender = ""+t[0].userSex; // 左侧是vue页面内的变量名字, 右侧是后台数据里的变量名称
-                        that.dormDistrict = t[0].dormDistrict.toString(); //TODO: 请注意文本数字转换
-                        that.reviewDo = t[0];
-                        that.weixinName = t[0].userWxAccount;
-                    } else {
+                    try {
+                        let t = response.model.list;
+                        if (response.ret === "10000") {
+                            that.gender = "" + t[0].userSex; // 左侧是vue页面内的变量名字, 右侧是后台数据里的变量名称
+                            that.dormDistrict = t[0].dormDistrict.toString(); //TODO: 请注意文本数字转换
+                            that.reviewDo = t[0];
+                            that.weixinName = t[0].userWxAccount;
+                        } else Toast.fail("获取失败,请检查网络");
+                    } catch (e) {
+                        console.warn(e);
                         Toast.fail("获取失败,请检查网络");
                     }
                 }, [{}]);

+ 3 - 9
sourcecode/h5app/vue/src/views/Assess.vue

@@ -90,10 +90,7 @@
                         // console.log(response);
                     if(response.ret === "10000"){
                         Toast.success("上传成功");
-                    } else {
-                        // 评价失败的处理
-                        Toast.fail("上传失败,请检查网络");
-                    }
+                    } else Toast.fail("上传失败,请检查网络");
                 }, [this.assessDo]
                 );
 
@@ -114,12 +111,9 @@
                 // console.log("------ Data Rcvd in assessPersent --------");
                 // console.log(response);
                     if(response.ret === "10000"){
-                        var t=response.model.list;
+                        let t = response.model.list;
                         that.assessDo=t[0];
-                    } else {
-                        // 评价失败的处理
-                        Toast.fail("读取失败,请检查网络");
-                    }
+                    } else Toast.fail("读取失败,请检查网络");
                 }, [{}]
             );
         }

+ 60 - 55
sourcecode/h5app/vue/src/views/PresentRegister.vue

@@ -192,65 +192,70 @@
                 else {
                     let formData = new FormData();
                     formData.append('file', this.photo);
-                    let imgURL = '';
                     // 先上传图片
                     BasicFunction.get_data("fileserver/upload?sign=abcdefg", function (res) {
                         // console.log('----- upload photo result -----');
                         // console.log(res);
-                        if (res.model === undefined || res.model.length === 0) {
-                            Toast.fail('上传失败,请重试');
-                            return;
-                        }
-                        if (res.ret === '10000') {
-                            imgURL = res.model;
-                            // console.log('img:' + imgURL);
-                            let present = [{
-                                goodid: that.presentId,
-                                name: that.presentName,
-                                goodsNo: "0",
-                                modelId: "0",
-                                ownerId: userId.toString(),
-                                goodFirstKind: gender,
-                                goodSecondKind: tag.toString(),
-                                sellPrice: "0.0",
-                                marketPrice: "0.0",
-                                costPrice: "0.0",
-                                upTime: getNowFormatDate(),
-                                downTime: getNowFormatDate(),
-                                createTime: getNowFormatDate(),
-                                storeNums: "0",
-                                img: imgURL,
-                                isDel: "0",
-                                content: "none",
-                                keywords: "none",
-                                description: that.desc,
-                                searchWords: "",
-                                weight: "0.0",
-                                point: "0",
-                                unit: "0",
-                                brandId: "0",
-                                visit: "0",
-                                favorite: "0",
-                                sort: "0",
-                                listImg: "xx.jpg",
-                                smallImg: "xx.jpg",
-                                specArray: "{}",
-                                exp: "0"
-                            }];
-                            // console.log(present);
-                            let url = "updateBatch";
-                            if (that.presentId === '') url = "saveBatch";
-                            BasicFunction.get_data("smartGoods/" + url, function (response) {
-                                // console.log("------ Data Rcvd in PresentReg --------");
-                                // console.log(response);
-                                if (response.ret === "10000") {
-                                    that.$router.push('share');
-                                } else {
-                                    Toast.fail("上传失败,请检查网络");
-                                    that.loading = false;
-                                }
-                            }, present);
-                        } else {
+                        // if (res.model === undefined || res.model.length === 0) {
+                        //     Toast.fail('上传失败,请重试');
+                        //     return;
+                        // }
+                        try {
+                            let imgURL = res.model;
+                            if (res.ret === '10000') {
+                                // console.log('img:' + imgURL);
+                                let present = [{
+                                    goodid: that.presentId,
+                                    name: that.presentName,
+                                    goodsNo: "0",
+                                    modelId: "0",
+                                    ownerId: userId.toString(),
+                                    goodFirstKind: gender,
+                                    goodSecondKind: tag.toString(),
+                                    sellPrice: "0.0",
+                                    marketPrice: "0.0",
+                                    costPrice: "0.0",
+                                    upTime: getNowFormatDate(),
+                                    downTime: getNowFormatDate(),
+                                    createTime: getNowFormatDate(),
+                                    storeNums: "0",
+                                    img: imgURL,
+                                    isDel: "0",
+                                    content: "none",
+                                    keywords: "none",
+                                    description: that.desc,
+                                    searchWords: "",
+                                    weight: "0.0",
+                                    point: "0",
+                                    unit: "0",
+                                    brandId: "0",
+                                    visit: "0",
+                                    favorite: "0",
+                                    sort: "0",
+                                    listImg: "xx.jpg",
+                                    smallImg: "xx.jpg",
+                                    specArray: "{}",
+                                    exp: "0"
+                                }];
+                                // console.log(present);
+                                let url = "updateBatch";
+                                if (that.presentId === '') url = "saveBatch";
+                                BasicFunction.get_data("smartGoods/" + url, function (response) {
+                                    // console.log("------ Data Rcvd in PresentReg --------");
+                                    // console.log(response);
+                                    if (response.ret === "10000") {
+                                        that.$router.push('share');
+                                    } else {
+                                        Toast.fail("上传失败,请检查网络");
+                                        that.loading = false;
+                                    }
+                                }, present);
+                            } else {
+                                Toast.fail('上传图片失败,请检查网络');
+                                that.loading = false;
+                            }
+                        } catch (e) {
+                            console.warn(e);
                             Toast.fail('上传图片失败,请检查网络');
                             that.loading = false;
                         }

+ 85 - 48
sourcecode/h5app/vue/src/views/SecurityVerify.vue

@@ -139,11 +139,21 @@
                     this.phoneError = true;
                     this.loading = false;
                     return;
+                } else if (!isNumber(this.phone)) {
+                    Toast.fail("请输入正确格式的手机号");
+                    this.phoneError = true;
+                    this.loading = false;
+                    return;
+                } else if (isEmojiCharacter(this.username)) {
+                    Toast.fail('不支持表情哦');
+                    this.usernameError = true;
+                    this.loading = false;
+                    return;
                 } else if (this.username.length < 1) {
                     this.usernameError = true;
                     this.loading = false;
                     return;
-                } else if (this.wechat.length < 6) {
+                } else if (isEmojiCharacter(this.wechat) || this.wechat.length < 6) {
                     this.wechatError = true;
                     Toast.fail('请输入正确格式的微信号');
                     this.loading = false;
@@ -166,62 +176,81 @@
                 BasicFunction.get_data("http://gift.fogice.com/server/fileserver/upload?sign=abcdefg", function (res) {
                     // console.log('----- upload photo result -----');
                     // console.log(res);
-                    if (res.model === undefined || res.model.length === 0) {
-                        Toast.fail('上传失败,请重试');
-                        return;
-                    }
-                    if (res.ret === '10000') {
-                        let imgURL = res.model; // TODO: 把imgurl也加入用户信息
-                        let userId = localStorage.getItem('frontend-userid');
-                        // console.log('----- User Identity -----');
-                        BasicFunction.get_data("smartIdentity/list?userId=" + userId, function (res) {
-                            if (res.ret === '10000') {
-                                let useridentity = res.model.list[0];
-                                useridentity.userWxAccount = that.wechat;
-                                useridentity.dormDistrict = that.dorId;
-                                useridentity.userSex = parseInt(that.radio);
-                                useridentity.userSchoolCardPic = imgURL;
-                                useridentity.userReviewStatus = 100;
-                                useridentity.reviewerNote = "未审核";
-                                useridentity.reviewerNoteToUser = "未审核";
-                                BasicFunction.get_data("smartIdentity/updateBatch", function (response) {
-                                    // console.log(useridentity);
-                                    // console.log(response);
-                                    if (response.ret === "10000") {
-                                        // console.log('----- User Info -----');
-                                        BasicFunction.get_data('smartUsers/list?uid=' + userId, function (res) {
-                                            // console.log(res);
-                                            if (res.ret === '10000') {
-                                                let user = res.model.list[0];
-                                                user.name = that.username;
-                                                user.phone = that.phone;
-                                                // console.log('----- Update User Info -----');
-                                                // console.log(user);
-                                                BasicFunction.get_data('smartUsers/updateBatch', function (res) {
+                    // if (res.model === undefined || res.model.length === 0) {
+                    //     Toast.fail('上传失败,请重试');
+                    //     return;
+                    // }
+                    try {
+                        let imgURL = res.model;
+                        if (res.ret === '10000') {
+                            let userId = localStorage.getItem('frontend-userid');
+                            // console.log('----- User Identity -----');
+                            BasicFunction.get_data("smartIdentity/list?userId=" + userId, function (res) {
+                                try {
+                                    let useridentity = res.model.list[0];
+                                    if (res.ret === '10000') {
+                                        useridentity.userWxAccount = that.wechat;
+                                        useridentity.dormDistrict = that.dorId;
+                                        useridentity.userSex = parseInt(that.radio);
+                                        useridentity.userSchoolCardPic = imgURL;
+                                        useridentity.userReviewStatus = 100;
+                                        useridentity.reviewerNote = "未审核";
+                                        useridentity.reviewerNoteToUser = "未审核";
+                                        BasicFunction.get_data("smartIdentity/updateBatch", function (response) {
+                                            // console.log(useridentity);
+                                            // console.log(response);
+                                            if (response.ret === "10000") {
+                                                // console.log('----- User Info -----');
+                                                BasicFunction.get_data('smartUsers/list?uid=' + userId, function (res) {
                                                     // console.log(res);
-                                                    if (res.ret === '10000') {
-                                                        Toast.success("注册成功");
-                                                        that.$router.push('presentRegister');
-                                                    } else {
-                                                        Toast.fail('注册失败');
+                                                    try {
+                                                        let user = res.model.list[0];
+                                                        if (res.ret === '10000') {
+                                                            user.name = that.username;
+                                                            user.phone = that.phone;
+                                                            // console.log('----- Update User Info -----');
+                                                            // console.log(user);
+                                                            BasicFunction.get_data('smartUsers/updateBatch', function (res) {
+                                                                // console.log(res);
+                                                                if (res.ret === '10000') {
+                                                                    Toast.success("注册成功");
+                                                                    that.$router.push('presentRegister');
+                                                                } else {
+                                                                    Toast.fail('注册失败');
+                                                                    that.loading = false;
+                                                                }
+                                                            }, [user]);
+                                                        } else {
+                                                            Toast.fail('获取用户信息失败');
+                                                            that.loading = false;
+                                                        }
+                                                    } catch (e) {
+                                                        console.warn(e);
+                                                        Toast.fail('获取用户信息失败');
                                                         that.loading = false;
                                                     }
-                                                }, [user]);
+                                                }, {});
                                             } else {
-                                                Toast.fail('获取用户信息失败');
+                                                Toast.fail("注册失败,请检查网络");
                                                 that.loading = false;
                                             }
-                                        }, {});
+                                        }, [useridentity]);
                                     } else {
-                                        Toast.fail("注册失败,请检查网络");
+                                        Toast.fail('获取信息失败');
                                         that.loading = false;
                                     }
-                                }, [useridentity]);
-                            } else {
-                                Toast.fail('获取信息失败');
-                            }
-                        }, {});
-                    } else {
+                                } catch (e) {
+                                    console.warn(e);
+                                    Toast.fail('获取信息失败');
+                                    that.loading = false;
+                                }
+                            }, {});
+                        } else {
+                            Toast.fail('上传图片失败,请检查网络');
+                            that.loading = false;
+                        }
+                    } catch (e) {
+                        console.warn(e);
                         Toast.fail('上传图片失败,请检查网络');
                         that.loading = false;
                     }
@@ -284,6 +313,14 @@
             }
         }
     }
+
+    // 判断是否是数字
+    function isNumber(str) {
+        for (let i = 0; i < str.length; i++) {
+            if (str[i] < '0' || str[i] > '9') return false;
+        }
+        return true;
+    }
 </script>
 
 <style scoped>

+ 47 - 36
sourcecode/h5app/vue/src/views/giftDetail.vue

@@ -120,22 +120,24 @@
                     BasicFunction.get_data("smartGoods/list?goodid=" + this.myPresent.id, function (response) {
                         // console.log("------ Data Rcvd in detail --------");
                         // console.log(response);
-                        if (response.ret === "10000") {
+                        try {
                             let list = response.model.list;
-                            // if (list !== undefined || list.length > 0) console.warn(list);
-                            list[0].isDel = 1;
-                            // console.log(list);
-                            BasicFunction.get_data("smartGoods/updateBatch", function (response) {
-                                // console.log(response);
-                                if (response.ret === '10000') {
-                                    Toast.success('删除成功');
-                                    that.$router.push('index');
-                                } else {
-                                    Toast.fail('删除失败,请检查网络');
-                                }
-                            }, list)
-                        } else {
-                            // console.warn("获取资源失败");
+                            if (response.ret === "10000") {
+                                list[0].isDel = 1;
+                                // console.log(list);
+                                BasicFunction.get_data("smartGoods/updateBatch", function (response) {
+                                    // console.log(response);
+                                    if (response.ret === '10000') {
+                                        Toast.success('删除成功');
+                                        that.$router.push('index');
+                                    } else {
+                                        Toast.fail('删除失败,请检查网络');
+                                    }
+                                }, list)
+                            } else Toast.fail('获取资源失败');
+                        } catch (e) {
+                            console.warn(e);
+                            Toast.fail('获取资源失败');
                         }
                     }, {});
                 }).catch(() => {
@@ -157,27 +159,36 @@
             present.comment = '';
             BasicFunction.get_data('smartIdentity/list?userId=' + userid, function (res) {
                 // console.log(res);
-                if (res.ret === '10000') {
-                    present.placeId = res.model.list[0].dormDistrict;
-                    present.wechat = res.model.list[0].userWxAccount;
-                    that.myPresent = present;
-                    // console.log(that.myPresent);
-                    if (present.status === 3) BasicFunction.get_data('smartOrderFeedback/list?goodId=' + present.id, function (res) {
-                        // console.log(res);
-                        if (res.ret === '10000') {
-                            if (res.model.list.length === 0) that.myPresent.comment = '暂未收到';
-                            else that.myPresent.comment = res.model.list[0].content;
-                            // console.log(that.myPresent);
-                        }
-                    }, {});
-
-                    if (present.status === 4) BasicFunction.get_data('smartGoodReview/list?goodId=' + present.id, function (res) {
-                        // console.log(res);
-                        if (res.ret === '10000') {
-                            if (res.model.list.length !== 0) that.reason = res.model.list[0].displayNote;
-                        }
-                    }, {});
-                    // console.log(that.myPresent);
+                try {
+                    let identity = res.model.list[0];
+                    if (res.ret === '10000') {
+                        present.placeId = identity.dormDistrict;
+                        present.wechat = identity.userWxAccount;
+                        that.myPresent = present;
+                        // console.log(that.myPresent);
+                        if (present.status === 3) BasicFunction.get_data('smartOrderFeedback/list?goodId=' + present.id, function (res) {
+                            // console.log(res);
+                            try {
+                                let comment = res.model.list[0];
+                                if (res.ret === '10000') {
+                                    if (comment.length === 0) that.myPresent.comment = '暂未收到';
+                                    else that.myPresent.comment = comment.content;
+                                } else Toast.fail('获取信息失败');
+                            } catch (e) {
+                                console.warn(e);
+                                Toast.fail('获取信息失败');
+                            }
+                        }, {});
+                        if (present.status === 4) BasicFunction.get_data('smartGoodReview/list?goodId=' + present.id, function (res) {
+                            // console.log(res);
+                            if (res.ret === '10000') {
+                                if (res.model.list.length !== 0) that.reason = res.model.list[0].displayNote;
+                            } else Toast.fail('获取信息失败');
+                        }, {});
+                    } else Toast.fail('获取信息失败');
+                } catch (e) {
+                    console.warn(e);
+                    Toast.fail('获取信息失败');
                 }
             }, {});
         }

+ 78 - 38
sourcecode/h5app/vue/src/views/index.vue

@@ -98,6 +98,7 @@
                     '获得匹配',
                     '线下交换'
                 ],
+                userStatus: 100
             }
         },
         methods: {
@@ -110,15 +111,41 @@
                 this.$router.push('share')
             },
             toDetail(i) {
-                Toast.loading({
-                    mask: true,
-                    message: '加载中...',
-                    duration: 1000
-                });
-                let present = this.presents[i];
-                this.$router.push({
-                    path: 'giftDetail', query: {present: present}
-                });
+                if (this.userStatus === 500) {
+                    Dialog.confirm({
+                        message: '您的校卡审核未通过!请前往【我的】页面重新上传校卡,否则将不会为您审核礼物哦',
+                        confirmButtonText: '查看校卡信息',
+                        cancelButtonText: '查看礼物'
+                    }).then(() => {
+
+                        Toast.loading({
+                            mask: true,
+                            message: '加载中...',
+                            duration: 500
+                        });
+                        this.$router.push('me');
+                    }).catch(() => {
+                        Toast.loading({
+                            mask: true,
+                            message: '加载中...',
+                            duration: 1000
+                        });
+                        let present = this.presents[i];
+                        this.$router.push({
+                            path: 'giftDetail', query: {present: present}
+                        });
+                    });
+                } else {
+                    Toast.loading({
+                        mask: true,
+                        message: '加载中...',
+                        duration: 1000
+                    });
+                    let present = this.presents[i];
+                    this.$router.push({
+                        path: 'giftDetail', query: {present: present}
+                    });
+                }
             },
             Desc(i) {
                 switch (i) {
@@ -171,38 +198,51 @@
             let b_a = true;
             let h_p = false;
             let that = this;
-            BasicFunction.get_data("smartGoods/list?isDel=0&ownerId=" + userid, function (response) {
-                // console.log("------ Data Rcvd in Index --------");
-                // console.log(response);
-                if (response.ret === "10000") {
-                    let list = response.model.list;
-                    if (list.length !== 0) h_p = true;
-                    that.hasPresent = h_p;
-                    list.forEach(gift => {
-                        let temp = {};
-                        temp.id = gift.goodid;
-                        temp.imgUrl = 'http://gift.fogice.com' + gift.img;
-                        temp.name = gift.name;
-                        if (gift.description.length > 45) {
-                            temp.desc = gift.description.substring(0, 30);
-                            temp.desc += "..."
-                        }
-                        else temp.desc = gift.description;
-                        temp.desc_long = gift.description;
-                        temp.time = gift.createTime.substring(0, 9);
-                        temp.status = gift.sort;
-                        if (gift.sort !== 4) b_a = false; // 限制上传1个礼物
-                        temp.gender = gift.goodFirstKind;
-                        temp.tags = gift.goodSecondKind;
-                        presentList.push(temp);
-                    });
-                    that.button_active = b_a;
-                } else {
-                    // 失败的处理
-                    // console.warn("获取资源失败");
+            BasicFunction.get_data("smartIdentity/list?userId=" + userid, function (res) {
+                // if(res.model === undefined || res.model.length === 0) {
+                //     Toast.fail('无法获取用户信息,请退出重试');
+                //     return;
+                // }
+                try {
+                    let identity = res.model.list[0];
+                    if (res.ret === '10000') {
+                        that.userStatus = identity.userReviewStatus;
+                        BasicFunction.get_data("smartGoods/list?isDel=0&ownerId=" + userid, function (response) {
+                            // console.log("------ Data Rcvd in Index --------");
+                            // console.log(response);
+                            if (response.ret === "10000") {
+                                let list = response.model.list;
+                                if (list.length !== 0) h_p = true;
+                                that.hasPresent = h_p;
+                                list.forEach(gift => {
+                                    let temp = {};
+                                    temp.id = gift.goodid;
+                                    temp.imgUrl = 'http://gift.fogice.com' + gift.img;
+                                    temp.name = gift.name;
+                                    if (gift.description.length > 45) {
+                                        temp.desc = gift.description.substring(0, 30);
+                                        temp.desc += "..."
+                                    }
+                                    else temp.desc = gift.description;
+                                    temp.desc_long = gift.description;
+                                    temp.time = gift.createTime.substring(0, 9);
+                                    temp.status = gift.sort;
+                                    if (gift.sort !== 4) b_a = false; // 限制上传1个礼物
+                                    temp.gender = gift.goodFirstKind;
+                                    temp.tags = gift.goodSecondKind;
+                                    presentList.push(temp);
+                                });
+                                that.button_active = b_a;
+                            } else Toast.fail('获取礼物列表失败');
+                        }, {});
+                    } else Toast.fail('获取信息失败');
+                } catch (e) {
+                    console.warn(e);
+                    Toast.fail('无法获取用户信息,请退出重试');
                 }
             }, {});
 
+
             // console.log("presents:");
             // console.log(presentList);
             this.presents = presentList;

+ 16 - 9
sourcecode/h5app/vue/src/views/login.vue

@@ -36,22 +36,29 @@
 
             if (otp === null) {
                 // no-otp
-                Toast.fail("链接失效!请回到公众号重新获取链接");
+                Toast.fail('链接失效!请回到公众号重新获取链接');
+                that.$router.push('warning');
                 return;
             }
             let that = this;
             BasicFunction.get_data("ajaxotplogin?otp=" + otp.toString(), function (response) {
                 // console.log("------ User Info login --------");
                 // console.log(response);
-                if (response.ret === "10000") {
+                try {
                     let user = response.model;
-                    userid = user.userId;
-                    localStorage.setItem('frontend-userid', userid);
-                    Toast.success('登录成功');
-                    that.$router.push('index');
-                } else {
-                    // 失败的处理
-                    // console.warn("获取用户信息失败");
+                    if (response.ret === "10000") {
+                        userid = user.userId;
+                        localStorage.setItem('frontend-userid', userid);
+                        Toast.success('登录成功');
+                        that.$router.push('index');
+                    } else {
+                        // 失败的处理
+                        // console.warn("获取用户信息失败");
+                        Toast.fail('链接失效!请回到公众号重新获取链接');
+                        that.$router.push('warning');
+                    }
+                } catch (e) {
+                    console.warn(e);
                     Toast.fail('链接失效!请回到公众号重新获取链接');
                     that.$router.push('warning');
                 }

+ 10 - 7
sourcecode/h5app/vue/src/views/me.vue

@@ -40,14 +40,17 @@
             BasicFunction.get_data("smartGoods/list?isDel=0&ownerId=" + userid, function (response) {
                 // console.log("------ Data Rcvd in me --------");
                 // console.log(response);
-                if (response.ret === "10000") {
+                try {
                     let list = response.model.list;
-                    list.forEach(gift => {
-                        if (gift.sort !== 4) b_a = false; // 限制上传1个礼物
-                    });
-                    that.button_active = b_a;
-                } else {
-                    // console.warn("获取资源失败");
+                    if (response.ret === "10000") {
+                        list.forEach(gift => {
+                            if (gift.sort !== 4) b_a = false; // 限制上传1个礼物
+                        });
+                        that.button_active = b_a;
+                    } else that.button_active = true;
+                } catch (e) {
+                    console.warn(e);
+                    that.button_active = true;
                 }
             }, {});
         },

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