modifyInfo.vue 4.4 KB
<!--
 * @Author: jiangzaicheng jiangzaicheng_jzc@163.com
 * @Date: 2022-07-07 16:13:13
 * @LastEditors: jiangzaicheng jiangzaicheng_jzc@163.com
 * @LastEditTime: 2022-07-22 16:58:52
 * @FilePath: \mcep-h5\src\components\common\Bottom.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->

<template>
  <div>

    <div class="rarle">
       <!-- <tatle-bar :tatle="tatleName"  style="background: #0B54E0" @="onClickReturn"></tatle-bar> -->
      <tatle-bar :tatle="tatleName"  style="background: #0B54E0" ></tatle-bar>
    </div>
    <van-row type="flex" class="iconImg">
      <van-col span="24">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-touxiang"></use>
        </svg>
      </van-col>
    </van-row>
    <van-row type="flex">
      <van-col span="24">
        <van-field v-model="name" label="姓名" :border="true" placeholder="请输入姓名" disabled/>
      </van-col>
    </van-row>
    <van-row type="flex">
      <van-col span="24">
        <van-field v-model="IdCard" label="身份证号" :border="true" placeholder="请输入身份证号"  disabled/>
      </van-col>
    </van-row>
    <van-row type="flex">
      <van-col span="24">
        <van-field v-model="phone" label="电话" :border="true" placeholder="请输入电话" />
      </van-col>
    </van-row>
    <van-row type="flex">
      <van-col span="24">
        <van-field v-model="liveAdress" label="居住地址" :border="true" placeholder="请输入居住地址" />
      </van-col>
    </van-row>

    <!-- <van-row type="flex">
      <van-col span="24">
        <van-field v-model="password" label="原密码" :border="true" placeholder="请输入原密码" />
      </van-col>
    </van-row>
    <van-row type="flex">
      <van-col span="24">
        <van-field v-model="newPassword" label="新密码" :border="true" placeholder="请输入新密码" />
      </van-col>
    </van-row> -->
    <!-- <div style="margin: 16px;">
      <van-button @click="modifyInfo" round  block type="info" native-type="button">保存</van-button>


    </div> -->

        <van-row type="flex">
      <van-col span="24">
        <van-button  native-type="button"
      style="width: 92%; margin:10px 4%; background-color: #3672F1;border-radius: 5px; border-color: #3672F1"
       type="primary" block @click="modifyInfo">保存</van-button>
      </van-col>
    </van-row>

  </div>
</template>

<script lang="ts">
import commonApi from "@/constants/api/login/common.api";
import systemApi from "@/constants/api/ms-system/system.api";
import { Code } from "@/constants/enum/general/code.enum";
import { RestfulResponse } from "@/model/domain/RestfulResponse";
import apiService from "@/services/api.service";
import { Toast } from "vant";
import { Component, Vue, Prop, Watch, Emit } from "vue-property-decorator";


/*
* title
*/
@Component({
  name: "modifyInfo"
})
export default class modifyInfo extends Vue {
  tatleName="修改信息"//个人信息
  name: string = ""//姓名
  IdCard: string = ""//身份证号
  phone: string = ""//手机号
  liveAdress: string = ""//居住地址
  password : String =""//原始密码
  newPassword : String =""//原始密码

  mounted() {
    this.name = this.$route.params.name;
    this.IdCard = this.$route.params.IdCard;
    this.phone = this.$route.params.phone;
    this.liveAdress = this.$route.params.liveAdress;
  }

  

  async modifyInfo(){
     let custInfo: any = sessionStorage.getItem("sysCustInfo");
    custInfo = JSON.parse(custInfo);
    let id = custInfo.id;
    
    let query = {
     
    };
    let param = {
       id: custInfo.id,
       phone: this.phone,
       address: this.liveAdress,
    };
    console.log(param);
    // console.log(typeof param);
    // console.log(commonApi.getPicCode.url);
    // console.log(systemApi.updateSysCustInfoById.url);
    apiService.general(systemApi.updateSysCustInfoById, undefined, param, undefined).then((response: RestfulResponse) => {
      console.log(response);
      if (response.code == Code.SUCCESS.code) {
        console.log(55);
         Toast(response.msg +"");
         this.$router.back();
        
      }else{
        Toast(response.msg +"");  
      }
      
    });


  
      // this.$router.back();
  }
}
</script>
<style scoped lang="scss">
.iconImg{
  text-align: center;
  margin-top: 2%;
  margin-bottom: 2%;
}
.icon {
  width: 80px;
  height: 80px;
}
</style>