|
@@ -47,15 +47,49 @@ Page({
|
|
imgUpload: function (e) {
|
|
imgUpload: function (e) {
|
|
const that = this;
|
|
const that = this;
|
|
let data = that.data.fileList;
|
|
let data = that.data.fileList;
|
|
|
|
+ let id = that.data.id;
|
|
data.push(e.detail)
|
|
data.push(e.detail)
|
|
- that.setData({ fileList: data })
|
|
|
|
|
|
+ wx.request({
|
|
|
|
+ url: `${app.globalData.publicUrl}/courtAdmin/api/schedule/${id}`, //接口地址
|
|
|
|
+ method: 'post',
|
|
|
|
+ data: { match_file: data },
|
|
|
|
+ success(res) {
|
|
|
|
+ if (res.data.errcode == 0) {
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: '添加成功',
|
|
|
|
+ duration: 2000,
|
|
|
|
+ icon: 'success',
|
|
|
|
+ })
|
|
|
|
+ that.setData({ fileList: data })
|
|
|
|
+ } else {
|
|
|
|
+ wx.showToast({ title: res.data.errmsg, icon: 'error', duration: 2000 })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
//删除图片
|
|
//删除图片
|
|
imgDel: function (e) {
|
|
imgDel: function (e) {
|
|
const that = this;
|
|
const that = this;
|
|
let data = that.data.fileList;
|
|
let data = that.data.fileList;
|
|
|
|
+ let id = that.data.id;
|
|
let arr = data.filter((i, index) => index != e.detail.index)
|
|
let arr = data.filter((i, index) => index != e.detail.index)
|
|
- that.setData({ fileList: arr })
|
|
|
|
|
|
+ wx.request({
|
|
|
|
+ url: `${app.globalData.publicUrl}/courtAdmin/api/schedule/${id}`, //接口地址
|
|
|
|
+ method: 'post',
|
|
|
|
+ data: { match_file: arr },
|
|
|
|
+ success(res) {
|
|
|
|
+ if (res.data.errcode == 0) {
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: '删除成功',
|
|
|
|
+ duration: 2000,
|
|
|
|
+ icon: 'success',
|
|
|
|
+ })
|
|
|
|
+ that.setData({ fileList: arr })
|
|
|
|
+ } else {
|
|
|
|
+ wx.showToast({ title: res.data.errmsg, icon: 'error', duration: 2000 })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 提交登录
|
|
// 提交登录
|
|
formSubmit: function (e) {
|
|
formSubmit: function (e) {
|
|
@@ -114,6 +148,7 @@ Page({
|
|
data: {},
|
|
data: {},
|
|
success(res) {
|
|
success(res) {
|
|
let fileList = res.data.data.match_file;
|
|
let fileList = res.data.data.match_file;
|
|
|
|
+ console.log(res.data.data);
|
|
that.setData({
|
|
that.setData({
|
|
schedulelist: res.data.data,
|
|
schedulelist: res.data.data,
|
|
fileList: fileList,
|
|
fileList: fileList,
|