提交 22844191 编写于 作者: F fancy

修改添加placeholder

上级 2d414680
......@@ -9,24 +9,27 @@ Page({
showLogoutDialog: false,
dialogLabel: '',
dialogValue: '',
dialogPlaceholder: '',
dialogParam: '',
avatarUrl: '',
person: {}
},
onLoad: function () {
//获取用户信息
api.me().then(info => {
this.setData({
person: info
});
}).catch(err => {
api.o2Error(err);
})
this.loadPersonInfo();
},
onShow: function() {
this.avatar();
},
loadPersonInfo: function() {
//获取用户信息
api.me().then(info => {
this.setData({
person: info
});
}).catch(err => {
api.o2Error(err);
});
},
//获取头像文件
avatar: function() {
var who = wx.getStorageSync('who');
......@@ -80,24 +83,32 @@ Page({
bindTapLine: function(event) {
console.log(event);
let param = event.currentTarget.dataset.param;
let value = '';
let placeholder = '';
let label = '';
if (!param) {
return;
} else if (param == 'mail') {
var value = this.data.person.mail;
var label = '邮件地址';
value = this.data.person.mail;
label = '邮件地址';
placeholder = '请输入邮件地址';
} else if (param == 'mobile') {
var value = this.data.person.mobile;
var label = '手机号码';
value = this.data.person.mobile;
label = '手机号码';
placeholder = '请输入手机号码';
} else if (param == 'officePhone') {
var value = this.data.person.officePhone;
var label = '办公电话';
value = this.data.person.officePhone;
label = '办公电话';
placeholder = '请输入办公电话';
} else if (param == 'signature') {
var value = this.data.person.signature;
var label = '个人签名';
value = this.data.person.signature;
label = '个人签名';
placeholder = '请输入个人签名';
}
this.setData({
showDialog: true,
dialogLabel: label,
dialogPlaceholder: placeholder,
dialogValue: value,
dialogParam: param
});
......@@ -117,7 +128,7 @@ Page({
dialogParam: ''
});
if (event.detail.index == 1) {
var person = this.data.person;
const person = JSON.parse(JSON.stringify(this.data.person));//Object.clone(this.data.person);
if (!value ) {
var value = ''
}
......@@ -144,6 +155,7 @@ Page({
util.toast('更新成功!');
}).catch(err => {
o2Api.o2Error(err);
//this.loadPersonInfo();
})
},
tapDialogLogoutButton: function(event) {
......
......@@ -71,7 +71,7 @@
<!-- <view class="weui-cells__title">{{dialogLabel}}</view> -->
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell weui-cell_input">
<input class="weui-input" name="dialogInput" auto-focus value="{{dialogValue}}" bindinput="getDialogInputValue" />
<input class="weui-input" name="dialogInput" auto-focus placeholder="{{dialogPlaceholder}}" value="{{dialogValue}}" bindinput="getDialogInputValue" />
</view>
</view>
</view>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册