|
@@ -3,8 +3,8 @@
|
|
|
<view class="info">
|
|
|
<view class="one">
|
|
|
<uni-forms ref="form" :modelValue="form" :rules="rules" label-width="auto">
|
|
|
- <uni-forms-item label="头像" name="logo">
|
|
|
- <upload :list="logo" name="logo" :count="1" @uplSuc="uplSuc" @uplDel="uplDel"></upload>
|
|
|
+ <uni-forms-item label="头像" name="icon">
|
|
|
+ <upload :list="icon" name="icon" :count="1" @uplSuc="uplSuc" @uplDel="uplDel"></upload>
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item label="真实姓名" name="name">
|
|
|
<uni-easyinput type="text" v-model="form.name" placeholder="请输入真实姓名" />
|
|
@@ -21,9 +21,6 @@
|
|
|
<view class="uni-input">{{form.date||'请选择日期'}}</view>
|
|
|
</picker>
|
|
|
</uni-forms-item>
|
|
|
- <uni-forms-item label="QQ号" name="QQ">
|
|
|
- <uni-easyinput type="text" v-model="form.qq" placeholder="请输入QQ号" />
|
|
|
- </uni-forms-item>
|
|
|
<uni-forms-item label="昵称" name="Nname">
|
|
|
<uni-easyinput type="text" v-model="form.Nname" placeholder="请输入昵称" />
|
|
|
</uni-forms-item>
|
|
@@ -77,14 +74,32 @@
|
|
|
value: '2'
|
|
|
},
|
|
|
],
|
|
|
- logo: []
|
|
|
+ icon: []
|
|
|
};
|
|
|
},
|
|
|
onLoad: function(e) {
|
|
|
-
|
|
|
+ const that = this;
|
|
|
+ that.watchLogin();
|
|
|
},
|
|
|
onShow: function() {},
|
|
|
methods: {
|
|
|
+ watchLogin() {
|
|
|
+ const that = this;
|
|
|
+ uni.getStorage({
|
|
|
+ key: 'token',
|
|
|
+ success: (res) => {
|
|
|
+ let user = that.$jwt(res.data);
|
|
|
+ if (user) {
|
|
|
+ console.log(user);
|
|
|
+ // that.$set(that, `form`, {
|
|
|
+ // id: user.id,
|
|
|
+ // phone: user.phone
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (err) => {}
|
|
|
+ })
|
|
|
+ },
|
|
|
toPath(e) {
|
|
|
if (e && e.route) uni.redirectTo({
|
|
|
url: `/${e.route}`
|
|
@@ -93,13 +108,11 @@
|
|
|
// 图片上传
|
|
|
uplSuc(e) {
|
|
|
const that = this;
|
|
|
- console.log(e);
|
|
|
that.$set(that, `${e.name}`, [...that[e.name], e.data]);
|
|
|
},
|
|
|
// 图片删除
|
|
|
uplDel(e) {
|
|
|
const that = this;
|
|
|
- console.log(e);
|
|
|
let data = that[e.name];
|
|
|
let arr = data.filter((i, index) => index != e.data.index);
|
|
|
that.$set(that, `${e.name}`, arr)
|