feat: move project
This commit is contained in:
commit
4a940f28ba
97 changed files with 5047 additions and 0 deletions
31
pages/usercenter/info.js
Normal file
31
pages/usercenter/info.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import R from '../../utils/request';
|
||||
|
||||
|
||||
Page({
|
||||
data: {
|
||||
name: '',
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
},
|
||||
|
||||
onShow() {
|
||||
R.get('/index.php/api/v1/my').then(({ model }) => {
|
||||
this.setData({
|
||||
name: model.real_name || model.nick_name || '微信用户',
|
||||
});
|
||||
})
|
||||
},
|
||||
onSubmit(){
|
||||
if(!this.data.name.trim()){
|
||||
wx.showToast({
|
||||
title: '请填写姓名',
|
||||
icon: 'none',
|
||||
});
|
||||
return;
|
||||
}
|
||||
R.post('/index.php/api/v1/set_name',{name:this.data.name.trim()}).then(({ model }) => {
|
||||
wx.navigateBack();
|
||||
})
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue