JacquesLu 6 سال پیش
والد
کامیت
7d378a4dda

+ 80 - 23
sourcecode/h5app/vue/src/components/schoolCard.vue

@@ -5,11 +5,23 @@
                 <h3><strong>校卡审核</strong></h3>
             </van-col>
             <van-col span="8">
-               <p :style="{ color: statusColor[2] }">{{statusString[2]}}</p>
+               <p :style="{ color: statusColor }">{{statusString}}</p>
             </van-col>
         </van-row>
-        <add-photo @uploadPhoto="onReadPhoto"/>
-        <p>活动仅允许深大学生参与,请上传正面校卡照片审核~</p>
+        <div v-if="status===30 || status === 500">
+            <add-photo :photoURL="imgUrl" @onRead="onRead"/>
+            <p>活动仅允许深大学生参与,请上传正面校卡照片审核~</p>
+            <van-button
+                    type="primary"
+                    class="submit_button"
+                    @click="schoolPresent"
+                    :loading="loading"
+            >保存
+            </van-button>
+        </div>
+        <div v-else>
+            <img :src="schoolpic" style="max-width: 100%"/>
+        </div>
 
 
     </div>
@@ -27,40 +39,41 @@
         },
         data() {
             return {
-                statusString: ['审核中', '未上传校卡', '审核通过', '审核失败'],
-                statusColor: ['#f43736', '#00ff00', '#00fa9a', '#ff0000'],
+                statusColor:'',
+                statusString:'-----',
                 photo: null,
+                loading:false,
+                status:0,
+                imgage: null,
+                imgDo:{},
+                schoolpic:"",
+                IMGPREFIX:"http://gift.fogice.com"
+
             }
         },
         methods: {
-            publishPresent() {
+            schoolPresent() {
                 // 检验输入
-
+                this.loading=true;
                 if (this.photo === null) {
                     Toast.fail('请上传礼物照片');
+                    this.loading=false;
                     return;
                 }
-                // post_present()
-                let present = {
-                    photo: this.photo
-                };
-                console.log(present);
-                //FIXME : wrong address given !
-                BasicFunction.get_data("ajaxpostpresent", function (response) {
-                    console.log("------ Data Rcvd in School Card --------");
+                this.imgDo.userSchoolCardPic=this.imgUrl;
+                let that = this;
+                BasicFunction.get_data("smartIdentity/updateBatch", function (response) {
+                    console.log("------ Data Rcvd in uploadphotoChange --------");
                     console.log(response);
-                    if(response.ret === "10000"){
-                        // 不需要 设置 SessionID, 已经自动保存在jSessionID中
-                        this.$router.push('index');
+                    if (response.ret === "10000") {
+                        Toast.success("上传成功")
                     } else {
-                        // 注册失败的处理
                         Toast.fail("上传失败,请检查网络");
                     }
-                }, {});
-                // this.$router.push('index');
+                }, [this.imgDo]);
             },
-            onReadPhoto(file) {
-                this.photo = file;
+            onRead: function (e) {
+                this.photo = e;
             }
         },
         created: function () {
@@ -68,6 +81,38 @@
                 this.$router.push('login');
                 return;
             }
+            let userid = localStorage.getItem('frontend-userid');
+            let that = this;
+            BasicFunction.get_data('smartIdentity/list?userId=' + userid, function (res) {
+                console.log(res);
+                if (res.ret === '10000') {
+                    var t=res.model.list;
+                    that.status=t[0].userReviewStatus;
+                    that.imgDo=t[0];
+                    console.log(that);
+                    if(that.status === 30){
+                        that.statusColor='#c5c5c5';
+                        that.statusString='未上传校卡';
+                        that.$router.push('verify');
+                        return;
+                    } else if (that.status === 0|| that.status === 1000) {
+                        that.schoolpic=that.IMGPREFIX+t[0].userSchoolCardPic;
+                        if(that.status === 0)
+                        {
+                            that.statusColor='#c5c530';
+                            that.statusString='审核中'
+                        }
+
+                        if(that.status === 1000) {
+                            that.statusColor = '#00ff00';
+                            that.statusString='审核通过'
+                        }
+                    } else {
+                        that.statusColor='#ff0000';
+                        that.statusString='审核未通过'
+                    }
+                }
+            }, {});
         }
     }
 </script>
@@ -90,4 +135,16 @@
         padding: 15px;
         text-align: left;
     }
+    .submit_button {
+        margin-bottom: 10px;
+        margin-left: auto;
+        margin-right: auto;
+        position: fixed;
+        bottom: 0;
+        left: 0;
+        right: 0;
+        background-color: #fd6740;
+        border-color: #fd6740;
+        width: 85%;
+    }
 </style>

+ 1 - 1
sourcecode/h5app/vue/src/views/Assess.vue

@@ -135,7 +135,7 @@
         background-color: red;
         border-color: red;
         margin: auto;
-        width: 10%;
+        width: 50%;
     }
     .van-rate{
         margin: auto;

+ 0 - 11
sourcecode/h5app/vue/src/views/share.vue

@@ -118,17 +118,6 @@
                         }
                     })
                 });
-
-
-                /*  wx.config({
-                      debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-                      appId: '', // 必填,公众号的唯一标识
-                      timestamp:, // 必填,生成签名的时间戳
-                      nonceStr: '', // 必填,生成签名的随机串
-                      signature: '',// 必填,签名
-                      jsApiList: [] // 必填,需要使用的JS接口列表
-                  });*/
-
             },{});
         }
     };