Initial commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
Page({
|
||||
data: {
|
||||
nameValue: '',
|
||||
},
|
||||
onLoad(options) {
|
||||
const { name } = options;
|
||||
this.setData({
|
||||
nameValue: name,
|
||||
});
|
||||
},
|
||||
onSubmit() {
|
||||
wx.$util.request(wx.$api.SetPersonInfo, { nickname: this.data.nameValue }, 'POST').then((res) => {
|
||||
console.log(res)
|
||||
wx.navigateBack({ delta: 1 });
|
||||
});
|
||||
},
|
||||
clearContent() {
|
||||
this.setData({
|
||||
nameValue: '',
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"navigationBarTitleText": "昵称",
|
||||
"usingComponents": {
|
||||
"t-input": "tdesign-miniprogram/input/input",
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"t-button": "tdesign-miniprogram/button/button"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<view class="name-edit">
|
||||
<t-input borderless model:value="{{nameValue}}" placeholder="请输入文字" label="昵称" type="nickname" clearable bind:clear="clearContent" />
|
||||
<view class="name-edit__input--desc"> 最多可输入15个字 </view>
|
||||
<view class="name-edit__wrapper">
|
||||
<t-button block shape="round" disabled="{{!nameValue}}" bind:tap="onSubmit">保存</t-button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,18 @@
|
||||
page {
|
||||
background-color: var(--bg-grey);
|
||||
}
|
||||
page view {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.name-edit {
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
.name-edit .name-edit__input--desc {
|
||||
font-size: 26rpx;
|
||||
padding: 16rpx 32rpx;
|
||||
color: var(--text-tertiary);
|
||||
margin-bottom: 200rpx;
|
||||
}
|
||||
.name-edit .name-edit__wrapper {
|
||||
margin: 0 32rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user