|
@@ -11,129 +11,127 @@ Page({
|
|
frameStyle: { useTop: true, name: '审核队员', leftArrow: true, useBar: false },
|
|
frameStyle: { useTop: true, name: '审核队员', leftArrow: true, useBar: false },
|
|
//加入团队列表
|
|
//加入团队列表
|
|
list: [],
|
|
list: [],
|
|
- menbers: [],
|
|
|
|
|
|
+ // 团队id
|
|
id: '',
|
|
id: '',
|
|
show: false,
|
|
show: false,
|
|
- show1: false
|
|
|
|
},
|
|
},
|
|
-
|
|
|
|
back: function () {
|
|
back: function () {
|
|
wx.navigateBack({ url: '/pages/me/index' })
|
|
wx.navigateBack({ url: '/pages/me/index' })
|
|
},
|
|
},
|
|
- chickme: function (e) {
|
|
|
|
- this.setData({
|
|
|
|
- show: true ,
|
|
|
|
- id1:e.currentTarget.dataset.id1
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- chickme1: function (e) {
|
|
|
|
- this.setData({
|
|
|
|
- show1: true,
|
|
|
|
- id1:e.currentTarget.dataset.id1
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- onClose() {
|
|
|
|
- this.setData({ show: false })
|
|
|
|
- },
|
|
|
|
- //通过
|
|
|
|
- adopt: function (e) {
|
|
|
|
|
|
+ // 详细信息
|
|
|
|
+ toView: function (e) {
|
|
const that = this;
|
|
const that = this;
|
|
- let id = e.currentTarget.dataset.id;
|
|
|
|
- //修改状态-加入团队修改
|
|
|
|
- wx.request({
|
|
|
|
- url: `${app.globalData.publicUrl}/courtAdmin/api/joinapply/${id}`,
|
|
|
|
- method: "post",
|
|
|
|
- data: { status: '1' },
|
|
|
|
- header: {},
|
|
|
|
- success: res => {
|
|
|
|
- if (res.data.errcode == 0) {
|
|
|
|
- wx.showToast({
|
|
|
|
- title: '已通过',
|
|
|
|
- icon: 'success',
|
|
|
|
- duration: 2000
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- error: err => {
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ let { userid } = e.currentTarget.dataset;
|
|
|
|
+ that.setData({ show: true })
|
|
//用户详情
|
|
//用户详情
|
|
- let id1 = e.currentTarget.dataset.id1;
|
|
|
|
wx.request({
|
|
wx.request({
|
|
- url: `${app.globalData.publicUrl}/courtAdmin/api/user/${id1}`, //接口地址
|
|
|
|
|
|
+ url: `${app.globalData.publicUrl}/courtAdmin/api/user/${userid}`, //接口地址
|
|
method: "get",
|
|
method: "get",
|
|
data: {},
|
|
data: {},
|
|
header: {},
|
|
header: {},
|
|
success: res => {
|
|
success: res => {
|
|
- let id_1 = that.data.id
|
|
|
|
- let members = [];
|
|
|
|
- members.push({ id: res.data.data.id, nickname: res.data.data.nickname, icon: res.data.data.icon })
|
|
|
|
- that.setData({ members: members })
|
|
|
|
- wx.request({
|
|
|
|
- url: `${app.globalData.publicUrl}/courtAdmin/api/team/${id_1}`,
|
|
|
|
- method: "post",
|
|
|
|
- data: { members: members },
|
|
|
|
- header: {},
|
|
|
|
- success: res => {
|
|
|
|
- if (res.data.errcode == 0) {
|
|
|
|
- wx.showToast({
|
|
|
|
- title: '已通过',
|
|
|
|
- icon: 'success',
|
|
|
|
- duration: 2000
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- error: err => {
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ that.setData({ details: res.data.data })
|
|
},
|
|
},
|
|
error: err => {
|
|
error: err => {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- //驳回
|
|
|
|
- reject: function (e) {
|
|
|
|
- let { id } = e.currentTarget.dataset;
|
|
|
|
- wx.request({
|
|
|
|
- url: `${app.globalData.publicUrl}/courtAdmin/api/joinapply/${id}`,
|
|
|
|
- method: "post",
|
|
|
|
- data: { status: '-1' },
|
|
|
|
- header: {},
|
|
|
|
- success: res => {
|
|
|
|
- if (res.data.errcode == 0) {
|
|
|
|
- wx.showToast({
|
|
|
|
- title: '已驳回',
|
|
|
|
- icon: 'success',
|
|
|
|
- duration: 2000
|
|
|
|
|
|
+ // 审核
|
|
|
|
+ toCheck: function (e) {
|
|
|
|
+ const that = this;
|
|
|
|
+ let { id, userid, status } = e.currentTarget.dataset;
|
|
|
|
+ let id_1 = that.data.id
|
|
|
|
+ wx.showModal({
|
|
|
|
+ content: `您确定提交${status == '1' ? '通过' : '驳回'}操作吗?`,
|
|
|
|
+ title: '提示',
|
|
|
|
+ success: (result) => {
|
|
|
|
+ if (status == '1') {
|
|
|
|
+ //修改状态-加入团队修改
|
|
|
|
+ wx.request({
|
|
|
|
+ url: `${app.globalData.publicUrl}/courtAdmin/api/joinapply/${id}`,
|
|
|
|
+ method: "post",
|
|
|
|
+ data: { status: status },
|
|
|
|
+ header: {},
|
|
|
|
+ success: res => {
|
|
|
|
+ if (res.data.errcode === 0) {
|
|
|
|
+ wx.showToast({ title: '审核成功', icon: 'success', duration: 2000 });
|
|
|
|
+ that.watchLogin();
|
|
|
|
+ } else {
|
|
|
|
+ wx.showToast({ title: res.data.errmsg, icon: 'error', duration: 2000 })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error: err => {
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ //用户详情
|
|
|
|
+ wx.request({
|
|
|
|
+ url: `${app.globalData.publicUrl}/courtAdmin/api/user/${userid}`, //接口地址
|
|
|
|
+ method: "get",
|
|
|
|
+ data: {},
|
|
|
|
+ header: {},
|
|
|
|
+ success: res => {
|
|
|
|
+ let member = [];
|
|
|
|
+ member.push({ id: res.data.data.id, nickname: res.data.data.nickname, icon: res.data.data.icon })
|
|
|
|
+ that.setData({ member: member })
|
|
|
|
+ let members = that.data.members;
|
|
|
|
+ members = [...members, ...member];
|
|
|
|
+ wx.request({
|
|
|
|
+ url: `${app.globalData.publicUrl}/courtAdmin/api/team/${id_1}`,
|
|
|
|
+ method: "post",
|
|
|
|
+ data: { members: members },
|
|
|
|
+ header: {},
|
|
|
|
+ success: res => {
|
|
|
|
+ },
|
|
|
|
+ error: err => {
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ error: err => {
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ wx.request({
|
|
|
|
+ url: `${app.globalData.publicUrl}/courtAdmin/api/joinapply/${id}`,
|
|
|
|
+ method: "post",
|
|
|
|
+ data: { status: status },
|
|
|
|
+ header: {},
|
|
|
|
+ success: res => {
|
|
|
|
+ if (res.data.errcode === 0) {
|
|
|
|
+ wx.showToast({ title: '审核成功', icon: 'success', duration: 2000 });
|
|
|
|
+ that.watchLogin();
|
|
|
|
+ } else {
|
|
|
|
+ wx.showToast({ title: res.data.errmsg, icon: 'error', duration: 2000 })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error: err => {
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- error: err => {
|
|
|
|
- }
|
|
|
|
})
|
|
})
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
*/
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
- this.setData({ id: options.id })
|
|
|
|
|
|
+ let id = options.id;
|
|
|
|
+ this.setData({ id: id })
|
|
// 计算高度
|
|
// 计算高度
|
|
this.searchHeight();
|
|
this.searchHeight();
|
|
// 监听用户是否登录
|
|
// 监听用户是否登录
|
|
- this.watchLogin();
|
|
|
|
|
|
+ this.watchLogin(id);
|
|
},
|
|
},
|
|
// 监听用户是否登录
|
|
// 监听用户是否登录
|
|
watchLogin: function () {
|
|
watchLogin: function () {
|
|
const that = this;
|
|
const that = this;
|
|
- var id = that.data.id;
|
|
|
|
wx.getStorage({
|
|
wx.getStorage({
|
|
key: 'token',
|
|
key: 'token',
|
|
success: res => {
|
|
success: res => {
|
|
wx.request({
|
|
wx.request({
|
|
url: `${app.globalData.publicUrl}/courtAdmin/api/joinapply`,
|
|
url: `${app.globalData.publicUrl}/courtAdmin/api/joinapply`,
|
|
method: "get",
|
|
method: "get",
|
|
- data: { team_id: id },
|
|
|
|
|
|
+ data: { team_id: that.data.id },
|
|
header: {},
|
|
header: {},
|
|
success: res => {
|
|
success: res => {
|
|
that.setData({ list: res.data.data })
|
|
that.setData({ list: res.data.data })
|
|
@@ -141,6 +139,17 @@ Page({
|
|
error: err => {
|
|
error: err => {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ wx.request({
|
|
|
|
+ url: `${app.globalData.publicUrl}/courtAdmin/api/team/${that.data.id}`,
|
|
|
|
+ method: "get",
|
|
|
|
+ data: {},
|
|
|
|
+ header: {},
|
|
|
|
+ success: res => {
|
|
|
|
+ that.setData({ members: res.data.data.members })
|
|
|
|
+ },
|
|
|
|
+ error: err => {
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
|
|
},
|
|
},
|
|
fail: res => {
|
|
fail: res => {
|