ソースを参照

schooldIdCard temp

jason.lu 6 年 前
コミット
dedb2d5ec6

+ 48 - 21
sourcecode/h5app/vue/src/components/schoolidCard.vue

@@ -13,7 +13,7 @@
            />
        </van-cell-group>
        <p>性别</p>
-       <van-radio-group v-model="radio1">
+       <van-radio-group v-model="gender">
            <van-radio name="0" checked-color="#fd6740" style="float: left; margin-right: 20px">男</van-radio>
            <van-radio name="1" checked-color="#fd6740">女</van-radio>
        </van-radio-group>
@@ -29,16 +29,12 @@
            />
        </van-cell-group>
        <p>宿舍区</p>
-       <van-radio-group v-model="radio2">
+       <van-radio-group v-model="dormDistrict">
            <van-radio name="0" checked-color="#fd6740" style="float: left; margin-right: 20px">南区</van-radio>
            <van-radio name="1" checked-color="#fd6740"  style="float: left; margin-right: 20px">西南</van-radio>
            <van-radio name="2" checked-color="#fd6740" style="float: left; margin-right: 20px">斋区</van-radio>
            <van-radio name="3" checked-color="#fd6740">西丽</van-radio>
-
        </van-radio-group>
-
-
-
    </div>
 </template>
 
@@ -47,6 +43,7 @@
         CellGroup, Field,
         RadioGroup, Radio,
     } from 'vant';
+    import {BasicFunction} from "../connector/basic-service";
     export default {
         name: "schoolidCard",
         components: {
@@ -56,8 +53,8 @@
         },
         data() {
             return {
-                radio1: '0',
-                radio2: '1',
+                gender: '0',
+                dormDistrict: '1',
                 personName: '',
                 personError: false,
                 weixinName: '',
@@ -65,8 +62,9 @@
             }
         },
         methods: {
-            publishPresent() {
+            savePage() {
                 // 检验输入
+                // var userId = localStorage.getItem(....
                 if (this.personName.length === 0) {
                     this.personError = true;
                     return;
@@ -76,34 +74,63 @@
                     return;
                 }
                 // post_present()
-                let present = {
-                    name: this.personName,
-                    gender: parseInt(this.radio1),
-                    weixinID: this.weixinName,
-                    dormDistrict: parseInt(this.radio2)
+                let objectToUpload = {
+                    "reviewId": "",
+                    "userId": userId,
+                    "dormDistrict": parseInt(this.dormDistrict),
+                    "userSex": parseInt(this.gender)
                 };
-                console.log(present);
-                BasicFunction.get_data("ajaxpostpresent", function (response) {
+                console.log(objectToUpload);
+                BasicFunction.get_data("smartIdentity/updateBatch", function (response) {
                     console.log("------ Data Rcvd in PresentReg --------");
                     console.log(response);
-                    if(response.ret === "10000"){
+                    if (response.ret === "10000") {
                         // 不需要 设置 SessionID, 已经自动保存在jSessionID中
                         this.$router.push('index');
                     } else {
                         // 注册失败的处理
                         Toast.fail("上传失败,请检查网络");
                     }
-                }, {});
+                }, [objectToUpload]);
                 // this.$router.push('index');
             },
 
+            getIndentityInfo: function (obj) {
+                //this;
+                window.schoolIdCard = this;
+                BasicFunction.get_data("", function (response) {
+                    console.log("------ Data Rcvd in PresentReg --------");
+                    console.log(response);
+                    if (response.ret === "10000") {
+                        var t = response.model.list;
+                        window.schoolIdCard.gender = t[0].gender; // 左侧是vue页面内的变量名字, 右侧是后台数据里的变量名称
+                    } else {
+                        // 注册失败的处理
+                        Toast.fail("上传失败,请检查网络");
+                    }
+                }, [{}]);
+            },
         },
+
         created: function () {
-            if(this.$route.query.present) {
+            window.schoolIdCard = this;
+            getIdentityInfo(window.schoolIdCard);
+            BasicFunction.get_data("", function (response) {
+                console.log("------ Data Rcvd in PresentReg --------");
+                console.log(response);
+                if (response.ret === "10000") {
+                    var t = response.model.list;
+                    window.schoolIdCard.weixinID = t[0].gender; // 左侧是vue页面内的变量名字, 右侧是后台数据里的变量名称
+                } else {
+                    // 注册失败的处理
+                    Toast.fail("上传失败,请检查网络");
+                }
+            }, [{}]);
+            if (this.$route.query.present) {
                 let present = this.$route.query.present;
                 console.log(present);
-                this.radio1 = present.gender.toString();
-                this.radio2 = present.dormDistrict.toString();
+                this.gender = present.gender.toString();
+                this.dormDistrict = present.dormDistrict.toString();
                 this.personName = present.name;
                 this.weixinName = present.weixinID;
             }

+ 10 - 25
sourcecode/h5app/vue/src/views/beTest.vue

@@ -96,6 +96,7 @@
                 })
             },
             testReadWxid(){
+
                 window.testvuepage = this;
                 BasicFunction.get_data("/list", function(response){
                     console.log(response);
@@ -110,38 +111,22 @@
                 })
             },
             testSaveStorage(){
-                window.testvuepage = this;
-                BasicFunction.get_data("/list", function(response){
-                    console.log(response);
-                    if(response.ret !== "10000"){
-                        this.testSuccess();
-                        return;
-                    }else{
-                        // Test fail
-                        this.testFailed();
-                        return;
-                    }
-                })
+                localStorage.setItem("xxx", "333");
+                this.testSuccess();
             },
             testReadStorage(){
                 window.testvuepage = this;
-                BasicFunction.get_data("/list", function(response){
-                    console.log(response);
-                    if(response.ret !== "10000"){
-                        this.testSuccess();
-                        return;
-                    }else{
-                        // Test fail
-                        this.testFailed();
-                        return;
-                    }
-                })
+                if(localStorage.getItem("xxx") === "333") {
+                    this.testSuccess();
+                }else{
+                    this.testSuccess();
+                }
             },
             testSuccess (){
-                window.testvuepage.$toast("测试成功", 4000);
+                Toast.success("测试成功", 4000);
             },
             testFail (){
-                window.testvuepage.$toast("测试失败", 4000);
+                Toast.fail("测试失败", 4000);
             },
             Toindex(){
                 this.$router.push('index');

+ 0 - 1
sourcecode/h5app/vue/src/views/login.vue

@@ -85,7 +85,6 @@
                     console.log("------ Data Rcvd in Login --------");
                     console.log(response);
                     if(response.ret === "10000"){
-                        // 不需要 设置 SessionID, 已经自动保存在jSessionID中
                         // userId
                         localStorage.setItem("frontend-userid", response.model.userId);
                         window.routerme.push('index');