JacquesLu 6 年之前
父節點
當前提交
b6092f0e3b

File diff suppressed because it is too large
+ 237 - 237
sourcecode/h5app/vue/package-lock.json


+ 11 - 7
sourcecode/h5app/vue/src/components/schoolidCard.vue

@@ -133,15 +133,19 @@
             },
             getIdentityInfo: function (obj) {
                 //this;
-                var userId = localStorage.getItem("frontend-userid");
-                window.schoolIdCard = this;
+                if (!localStorage.getItem('frontend-userid')) {
+                    this.$router.push('login');
+                    return;
+                }
+                let userId = localStorage.getItem("frontend-userid");
+                let that = this;
                 BasicFunction.get_data("smartUsers/list?uid=" + userId, function (response) {
                     console.log("------ Data Rcvd in getIdentityInfo --------");
                     console.log(response);
                     if (response.ret === "10000") {
                         var t = response.model.list;
-                        window.schoolIdCard.personName = t[0].name; // 左侧是vue页面内的变量名字, 右侧是后台数据里的变量名称
-                        window.schoolIdCard.userDo = t[0];
+                        that.personName = t[0].name; // 左侧是vue页面内的变量名字, 右侧是后台数据里的变量名称
+                        that.userDo = t[0];
                     } else {
                         // 注册失败的处理
                         Toast.fail("获取失败,请检查网络");
@@ -175,9 +179,9 @@
                 this.$router.push('login');
                 return;
             }
-            window.schoolIdCard = this;
-            this.getIdentityInfo(window.schoolIdCard);
-            this.getReviewInfo(window.schoolIdCard);
+            let that = this;
+            this.getIdentityInfo(that);
+            this.getReviewInfo(that);
         }
     }
 </script>

+ 38 - 26
sourcecode/h5app/vue/src/views/Assess.vue

@@ -1,7 +1,7 @@
 <template>
     <div>
         <div class="card">
-            <h3>交换成功!写一封感谢信送给ta吧~
+            <h3 > 交换成功!写一封感谢信送给ta吧~
             </h3>
             <van-cell-group>
                 <van-field
@@ -22,9 +22,6 @@
                         icon="like"
                         void-icon="like-o"
                 />
-                <p>
-                    请选择感动指数(对方不可见)
-                </p>
                 <van-button round type="primary" class='assess' @click="Assess">送出感谢信</van-button>
             </div>
 
@@ -40,8 +37,10 @@
     import {
         CellGroup, Field,
         Rate,
-        Button
+        Button,
+        Toast
     } from 'vant'
+    import {BasicFunction} from "../connector/basic-service";
 
     export default {
         name: "Assess",
@@ -51,38 +50,54 @@
         },
         data() {
             return {
-                value:4,
+                value:0,
                 assess: '',
                 assessError: false,
                 active: 0,
                 Assessimage: require('../assets/thanks.png'),
+
             }
         },
         methods: {
-            publishPresent() {
+            assessPresent : function () {
                 // 检验输入
-
+                let that=this;
                 if (this.assess.length <= 15) {
                     this.assessError = true;
-                    Toast.fail('请输入至少15个字的礼物评价');
+                    Toast.fail('请输入至少15个字的礼物评价!');
+                    return;
+                }
+                else if(this.assess.length > 300) {
+                    this.assessError = true;
+                    Toast.fail('最多输入300个字的礼物评价!');
                     return;
                 }
-                // post_present()
-                let present = {
-                    assess: this.assess,
-                };
+                if (!localStorage.getItem('frontend-userid')) {
+                    this.$router.push('login');
+                    return;
+                }
+                let orderId=BasicFunction.utils_get_param("orderId");
+                // assess_present()
                 console.log(present);
-                BasicFunction.get_data("ajaxpostpresent", function (response) {
-                    console.log("------ Data Rcvd in PresentReg --------");
+                BasicFunction.get_data("smartOrderFeedback/saveBatch?orderId="+orderId, function (response) {
+                    console.log("------ Data Rcvd in assessPersent --------");
                     console.log(response);
                     if(response.ret === "10000"){
-                        // 不需要 设置 SessionID, 已经自动保存在jSessionID中
-                        this.$router.push('index');
+
+
                     } else {
-                        // 注册失败的处理
+                        // 评价失败的处理
                         Toast.fail("上传失败,请检查网络");
                     }
-                }, [{}]);
+                }, [{"feedbackId":"",
+                    "orderId":"13",
+                    "goodId":"3",
+                    "ratingStatus":"1000",
+                    "ratingMajor":value,
+                    "ratingMinor":"4500",
+                    "content": assess,
+                    "ratingTime":"2018-12-10 01:01:01"}]
+                );
 
                 // this.$router.push('index');
             },
@@ -95,17 +110,14 @@
                 this.$router.push('login');
                 return;
             }
-            if(this.$route.query.present) {
-                let present = this.$route.query.present;
-                console.log(present);
-                this.assess = present.presentDesc;
-            }
+            let that=this;
+            let orderId=BasicFunction.utils_get_param("orderId");
         }
     }
 </script>
 
 <style scoped>
-    h2 {
+    h3 {
         color: #fd6740;
         text-align: left;
         padding: 5px;
@@ -118,7 +130,7 @@
         padding: 15px;
     }
 
-    .van-buttom {
+    .van-button {
         background-color: red;
         border-color: red;
         margin: auto;

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