Commit 02f4a3d3 authored by 黄奎's avatar 黄奎

页面修改

parent 41873b4b
<template> <template>
<q-page> <q-page>
<div class="account"> <div class="account">
账号信息 帳戶設定 ( 1006186972@qq.com ) 账号信息 帳戶設定 ( {{accountMsg.Account}} )
<table> <table>
<tr> <tr>
<td> <td>
...@@ -10,25 +10,66 @@ ...@@ -10,25 +10,66 @@
</tr> </tr>
<tr> <tr>
<td> <td>
姓氏 姓名
<q-input filled name="name1" v-model="B2BUser.name" class="bg-grey-1" label="姓氏" /> <q-input filled name="Name" v-model="accountMsg.Name" class="bg-grey-1" label="姓名" />
</td> </td>
<td> <td>
名字: 性別:
<q-input filled name="name2" v-model="B2BUser.name" class="bg-grey-1" label="名字" /> <q-input filled name="Sex" v-model="accountMsg.Sex" class="bg-grey-1" label="性別" />
</td>
</tr>
<tr>
<td>
生日:
<q-input filled name="Birthday" v-model="accountMsg.Birthday" class="bg-grey-1" label="生日" />
</td>
<td>
电话:
<q-input filled name="Mobile" v-model="accountMsg.Mobile" class="bg-grey-1" label="电话" />
</td>
</tr>
<tr>
<td>
地址:
<q-input filled name="Address" v-model="accountMsg.Address" class="bg-grey-1" label="地址" />
</td>
</tr>
<tr>
<td>
<q-btn type="a" @click="SaveBasic" label="儲存變更" />
</td>
</tr>
</table>
<table>
<tr>
<td>
密碼變更
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
性別 舊密碼
<q-input filled name="name13" v-model="B2BUser.name" class="bg-grey-1" label="姓氏" /> <q-input filled name="oldPassword" v-model="updateMsg.oldPassword" class="bg-grey-1" label="舊密碼" />
</td> </td>
<td> <td>
名字: 新密碼
<q-input filled name="name23" v-model="B2BUser.name" class="bg-grey-1" label="名字" /> <q-input filled name="Password" v-model="updateMsg.newPassword" class="bg-grey-1" label="新密碼" />
</td>
</tr>
<tr>
<td>
再輸入一次新密碼:
<q-input filled name="SurePassword" v-model="updateMsg.SurePassword" class="bg-grey-1" label="再輸入一次新密碼" />
</td>
</tr>
<tr>
<td>
<q-btn type="a" @click="SavePwd" label="儲存變更" />
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</q-page> </q-page>
</template> </template>
...@@ -37,7 +78,23 @@ ...@@ -37,7 +78,23 @@
props: [], props: [],
data() { data() {
return { return {
B2BUser: {} accountMsg: {
AccountId: 0, //账号编号
Name: "", //姓名
Account: "", //账号
Sex: "1", //性别(1-男,2-女)
Birthday: "", //生日
Password: "", //密码
SurePwd: "", //确认密码
Mobile: "", //联系电话
Address: "", //地址
},
updateMsg: {
AccountId: 0, //账户编号
oldPassword: "", //旧密码
newPassword: "", //新密码
SurePassword: "", //确认密码
}
}; };
}, },
created() { created() {
...@@ -45,13 +102,64 @@ ...@@ -45,13 +102,64 @@
}, },
mounted() { mounted() {
if (localStorage.b2bUser) { if (localStorage.b2bUser) {
this.B2BUser = JSON.parse(window.localStorage.getItem('b2bUser')); var b2bUser = JSON.parse(window.localStorage.getItem('b2bUser'))
if (b2bUser) {
this.accountMsg.AccountId = b2bUser.accountId;
this.updateMsg.AccountId = b2bUser.accountId;
this.getAccountInfo();
}
} }
}, },
methods: { methods: {
getContract() { //获取基础信息
getAccountInfo() {
this.apipost(
"b2b_get_GetCustomerAccountService", {
AccountId: this.accountMsg.AccountId
},
res => {
if (res.data.resultCode == 1) {
var jsonData=res.data.data;
this.accountMsg.Account=jsonData.Account;
this.accountMsg.Address=jsonData.Address;
this.accountMsg.Birthday=jsonData.Birthday;
this.accountMsg.Mobile=jsonData.Mobile;
this.accountMsg.Name=jsonData.Name;
this.accountMsg.Sex=jsonData.Sex;
}
},
err => {}
);
},
//保存基础信息
SaveBasic() {
this.apipost(
"b2b_post_SetCustomerAccountService", this.accountMsg,
res => {
if (res.data.resultCode == 1) {
this.getAccountInfo();
// var jsonData = JSON.stringify(res.data.data);
// window.localStorage.setItem("b2bUser", jsonData);
} }
},
err => {}
);
},
//修改密码
SavePwd() {
this.apipost(
"b2b_post_ModifyAccountPassowrd", this.updateMsg,
res => {
console.log("res", res.data);
if (res.data.resultCode == 1) {
}
},
err => {}
);
},
}, },
}; };
......
...@@ -39,9 +39,9 @@ ...@@ -39,9 +39,9 @@
<tr> <tr>
<td> <td>
*性別 *性別
<q-select filled v-model="registerMsg.Sex" :options="sexArray" option-label="Name" option-value="Id" <!-- <q-select filled v-model="registerMsg.Sex" :options="sexArray" option-label="Name" option-value="Id"
label="性別"> label="性別">
</q-select> </q-select> -->
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -101,7 +101,18 @@ ...@@ -101,7 +101,18 @@
}, },
methods: { methods: {
doRegister() { doRegister() {
this.apipost(
"b2b_post_SetCustomerAccountService", this.registerMsg,
res => {
console.log("res", res.data);
if (res.data.resultCode == 1) {
var jsonData = JSON.stringify(res.data.data);
window.localStorage.setItem("b2bUser", jsonData);
this.CommonJump('/index', {})
}
},
err => {}
);
} }
}, },
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment