Commit e951dff3 authored by zhengke's avatar zhengke

修改

parent aa6c59ed
<style>
.tw_account {
margin: 40px auto;
padding: 0 20px;
width: 100%;
max-width: 800px;
}
.tw_blocktitle {
font-size: 25px;
margin-bottom: 15px;
color: #666;
font-weight: 400;
}
.member-box {
margin: 0 0 40px;
width: 100%;
padding: 30px 30px 40px;
background-color: #fff;
box-shadow: 0 2px 4px 0 rgba(10, 8, 8, .5);
border-top: 4px solid #00afff;
}
.block-title-light {
font-size: 23px;
margin:10px 0 30px 0;
line-height: 0;
color: #666;
font-weight: bold;
}
.account-group {
position: relative;
margin-bottom: 15px;
}
.account_labelName {
margin-bottom: 10px;
font-size: 15px;
}
.regisStar {
color: red;
}
.tw_account .q-field__control {
height: 46px;
}
.tw_account .q-field__control{
min-height:46px!important;
}
.tw_account .q-field__native{
min-height:46px;
}
.tw_account .q-field__marginal{
height:46px;
}
</style>
<template> <template>
<q-page> <q-page>
<div class="account"> <div class="tw_account">
账号信息 帳戶設定 ( {{accountMsg.Account}} ) <h1 class="tw_blocktitle">帳戶設定({{accountMsg.Account}})</h1>
<table> <div class="member-box">
<tr> <h2 class="block-title-light">個人資訊</h2>
<td> <div class="row q-col-gutter-x-xs q-col-gutter-y-lg">
個人資訊 <div class="account-group col-6">
</td> <div class="account_labelName"><span class="regisStar">*</span>姓名</div>
</tr> <q-input outlined v-model="accountMsg.Name" class="bg-grey-1" />
<tr> </div>
<td> <div class="account-group col-6">
姓名: <div class="account_labelName">性別</div>
<q-input filled name="Name" v-model="accountMsg.Name" class="bg-grey-1" label="姓名" /> <q-select filled v-model="accountMsg.Sex" :options="sexArray" emit-value map-options>
</td> </q-select>
<td> </div>
性別: </div>
<q-input filled name="Sex" v-model="accountMsg.Sex" class="bg-grey-1" label="性別" /> <div class="row q-col-gutter-x-xs q-col-gutter-y-lg">
</td> <div class="account-group col-6">
</tr> <div class="account_labelName"><span class="regisStar">*</span>生日</div>
<tr> <q-input filled v-model="accountMsg.Birthday" mask="date">
<td> <template v-slot:append>
生日: <q-icon name="event" class="cursor-pointer">
<q-input filled name="Birthday" v-model="accountMsg.Birthday" class="bg-grey-1" label="生日" /> <q-popup-proxy ref="qDateProxy" transition-show="scale" transition-hide="scale">
</td> <q-date mask="YYYY-MM-DD" v-model="accountMsg.Birthday" @input="() => $refs.qDateProxy.hide()" />
<td> </q-popup-proxy>
电话: </q-icon>
<q-input filled name="Mobile" v-model="accountMsg.Mobile" class="bg-grey-1" label="电话" /> </template>
</td> </q-input>
</tr> </div>
<tr> <div class="account-group col-6">
<td> <div class="account_labelName">手機</div>
地址: <q-input outlined v-model="accountMsg.Mobile" class="bg-grey-1" />
<q-input filled name="Address" v-model="accountMsg.Address" class="bg-grey-1" label="地址" /> </div>
</td> </div>
<div class="account-group">
</tr> <div class="account_labelName">地址</div>
<tr> <q-input outlined v-model="accountMsg.Address" class="bg-grey-1" />
<td> </div>
<q-btn type="a" @click="SaveBasic" label="儲存變更" /> <div class="account-group">
</td> <q-btn color="primary" style="width:200px;height:50px;margin-top:20px;" @click="SaveBasic" label="儲存變更" />
</tr> </div>
</table> </div>
<table> <div class="member-box">
<tr> <h2 class="block-title-light">密碼變更</h2>
<td> <div class="row q-col-gutter-x-xs q-col-gutter-y-lg">
密碼變更 <div class="account-group col-6">
</td> <div class="account_labelName">舊密碼</div>
</tr> <q-input outlined v-model="updateMsg.oldPassword" type="password" class="bg-grey-1" />
<tr> </div>
<td> <div class="account-group col-6">
舊密碼: <div class="account_labelName">新密碼</div>
<q-input filled name="oldPassword" v-model="updateMsg.oldPassword" class="bg-grey-1" label="舊密碼" /> <q-input outlined v-model="updateMsg.newPassword" type="password" class="bg-grey-1" />
</td> </div>
<td> <div class="account-group col-6">
新密碼 <div class="account_labelName">再輸入一次新密碼</div>
<q-input filled name="Password" v-model="updateMsg.newPassword" class="bg-grey-1" label="新密碼" /> <q-input outlined v-model="updateMsg.SurePassword" type="password" class="bg-grey-1" />
</td> </div>
</tr> </div>
<tr> <div class="account-group">
<td> <q-btn color="primary" style="width:200px;height:50px;margin-top:20px;" @click="SavePwd" label="儲存變更" />
再輸入一次新密碼: </div>
<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>
</tr>
</table>
</div>
</div> </div>
</q-page> </q-page>
</template> </template>
...@@ -82,7 +133,7 @@ ...@@ -82,7 +133,7 @@
AccountId: 0, //账号编号 AccountId: 0, //账号编号
Name: "", //姓名 Name: "", //姓名
Account: "", //账号 Account: "", //账号
Sex: "1", //性别(1-男,2-女) Sex: 1, //性别(1-男,2-女)
Birthday: "", //生日 Birthday: "", //生日
Password: "", //密码 Password: "", //密码
SurePwd: "", //确认密码 SurePwd: "", //确认密码
...@@ -94,7 +145,17 @@ ...@@ -94,7 +145,17 @@
oldPassword: "", //旧密码 oldPassword: "", //旧密码
newPassword: "", //新密码 newPassword: "", //新密码
SurePassword: "", //确认密码 SurePassword: "", //确认密码
} },
sexArray: [{
value: 1,
label: "男"
},
{
value: 2,
label: "女"
},
]
}; };
}, },
created() { created() {
...@@ -119,13 +180,13 @@ ...@@ -119,13 +180,13 @@
}, },
res => { res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
var jsonData=res.data.data; var jsonData = res.data.data;
this.accountMsg.Account=jsonData.Account; this.accountMsg.Account = jsonData.Account;
this.accountMsg.Address=jsonData.Address; this.accountMsg.Address = jsonData.Address;
this.accountMsg.Birthday=jsonData.Birthday; this.accountMsg.Birthday = jsonData.Birthday;
this.accountMsg.Mobile=jsonData.Mobile; this.accountMsg.Mobile = jsonData.Mobile;
this.accountMsg.Name=jsonData.Name; this.accountMsg.Name = jsonData.Name;
this.accountMsg.Sex=jsonData.Sex; this.accountMsg.Sex = jsonData.Sex;
} }
}, },
err => {} err => {}
...@@ -133,12 +194,31 @@ ...@@ -133,12 +194,31 @@
}, },
//保存基础信息 //保存基础信息
SaveBasic() { SaveBasic() {
if(this.accountMsg.Name==''){
this.$q.notify({
type: 'negative',
message:'请輸入姓名',
position:'top',
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
})
return;
}
if(this.accountMsg.Birthday==''){
this.$q.notify({
type: 'negative',
message:'请选择生日',
position:'top',
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
})
return;
}
this.apipost( this.apipost(
"b2b_post_SetCustomerAccountService", this.accountMsg, "b2b_post_SetCustomerAccountService", this.accountMsg,
res => { res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.getAccountInfo(); this.getAccountInfo();
// var jsonData = JSON.stringify(res.data.data); // var jsonData = JSON.stringify(res.data.data);
// window.localStorage.setItem("b2bUser", jsonData); // window.localStorage.setItem("b2bUser", jsonData);
...@@ -149,12 +229,48 @@ ...@@ -149,12 +229,48 @@
}, },
//修改密码 //修改密码
SavePwd() { SavePwd() {
if(this.updateMsg.oldPassword==''){
this.$q.notify({
type: 'negative',
message:'请輸入舊密碼',
position:'top',
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
})
return;
}
if(this.updateMsg.newPassword==''){
this.$q.notify({
type: 'negative',
message:'请輸入新密碼',
position:'top',
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
})
return;
}
if(this.updateMsg.SurePassword==''){
this.$q.notify({
type: 'negative',
message:'再輸入一次新密碼',
position:'top',
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
})
return;
}
if(this.updateMsg.SurePassword!=this.updateMsg.newPassword){
this.$q.notify({
type: 'negative',
message:'两次输入密码不一致',
position:'top',
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
})
return;
}
this.apipost( this.apipost(
"b2b_post_ModifyAccountPassowrd", this.updateMsg, "b2b_post_ModifyAccountPassowrd", this.updateMsg,
res => { res => {
console.log("res", res.data); console.log("res", res.data);
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
} }
}, },
err => {} 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