|
@@ -11,17 +11,86 @@ Page({
|
|
|
infoHeight: '',
|
|
|
frameStyle: { useTop: true, name: '个人信息', leftArrow: true, useBar: false },
|
|
|
form: {
|
|
|
- src: '/image/tou.png',
|
|
|
ranks: '比赛第一名队',
|
|
|
mechanism: '吉佳通达',
|
|
|
sex: ['男', '女'],
|
|
|
objectSex: [{ id: 0, name: '男' }, { id: 1, name: '女' },],
|
|
|
-
|
|
|
post: '后勤部长',
|
|
|
phone: '12311111111',
|
|
|
email: '123@qq.com',
|
|
|
},
|
|
|
index: 0,
|
|
|
+ // 上传图片
|
|
|
+ fileList: [],
|
|
|
+ },
|
|
|
+ //上传头像,更改头像
|
|
|
+ // changeSrc: function (event) {
|
|
|
+ // var that = this;
|
|
|
+ // wx.chooseImage({
|
|
|
+ // count: 1,//最多可以选择的图片数量,默认9
|
|
|
+ // sizeType: ['compressed', 'original'],
|
|
|
+ // sourceType: ['album', 'camera'],
|
|
|
+ // success: function (res) {
|
|
|
+ // console.log(res.tempFilePaths + "修改页面")
|
|
|
+ // var src = res.tempFilePaths;
|
|
|
+ // that.setData({
|
|
|
+ // src: src,
|
|
|
+ // upSrc: true,
|
|
|
+
|
|
|
+ // })
|
|
|
+ // const { file } = event.detail;
|
|
|
+ // console.log(file);
|
|
|
+ // wx.uploadFile({
|
|
|
+ // url: `${app.globalData.imageUrl}/files/court/elimg/upload`,
|
|
|
+ // filePath: file.url,
|
|
|
+ // name: 'file',
|
|
|
+ // formData: {},
|
|
|
+ // success: (res) => {
|
|
|
+ // console.log(res);
|
|
|
+ // if (res.statusCode == '200') {
|
|
|
+ // let data = [{ name: JSON.parse(res.data).name, url: `${app.globalData.imageUrl}` + JSON.parse(res.data).uri }]
|
|
|
+ // const { fileList = [] } = that.data;
|
|
|
+ // fileList.push({ ...file, url: res.data });
|
|
|
+ // that.setData({ fileList });
|
|
|
+ // } else {
|
|
|
+ // wx.showToast({ title: `${res.data.errmsg}`, icon: 'fail', duration: 2000 })
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+
|
|
|
+
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+
|
|
|
+ // },
|
|
|
+ // 上传图片
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //上传图片
|
|
|
+
|
|
|
+
|
|
|
+ afterRead: function (event) {
|
|
|
+ const { file } = event.detail;
|
|
|
+ // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式app.globalData.fileUrl:
|
|
|
+ console.log(file);
|
|
|
+ wx.uploadFile({
|
|
|
+ url: `${app.globalData.imageUrl}/files/court/elimg/upload`,
|
|
|
+ filePath: file.url,
|
|
|
+ name: 'file',
|
|
|
+ formData: {},
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res);
|
|
|
+ if (res.statusCode == '200') {
|
|
|
+ let data = [{ name: JSON.parse(res.data).name, url: `${app.globalData.imageUrl}` + JSON.parse(res.data).uri }]
|
|
|
+ const { fileList = [] } = this.data;
|
|
|
+ fileList.push({ ...file, url: res.data });
|
|
|
+ this.setData({ fileList });
|
|
|
+ } else {
|
|
|
+ wx.showToast({ title: `${res.data.errmsg}`, icon: 'fail', duration: 2000 })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
//选择
|
|
|
bindPickerChange: function (e) {
|