|
@@ -8,19 +8,53 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
+ showModal: false,
|
|
|
|
|
|
infoHeight: '',
|
|
|
frameStyle: { useTop: true, name: '创建团队', leftArrow: true, useBar: false },
|
|
|
form: {
|
|
|
type: ['乒乓球', '足球', '篮球'],
|
|
|
objectType: [{ id: 0, name: '乒乓球' }, { id: 1, name: '足球' }, { id: 2, name: '篮球' },],
|
|
|
+ create_time: '2016-09-01',
|
|
|
},
|
|
|
- lists: [{ id: '1', menbers: '' }],
|
|
|
- menbers:[],
|
|
|
+ lists: [],
|
|
|
index: 0,
|
|
|
+ item: [],
|
|
|
+ check: [],
|
|
|
|
|
|
fileList: [],
|
|
|
},
|
|
|
+ apply: function (e) {
|
|
|
+
|
|
|
+ console.log(this.data.check);
|
|
|
+ },
|
|
|
+
|
|
|
+ checkboxChange: function (e) {
|
|
|
+ const that = this;
|
|
|
+ let data = e.detail.value;
|
|
|
+ let _id = [];
|
|
|
+ let item = that.data.item;
|
|
|
+ let check = [];
|
|
|
+ for (const val of _id) {
|
|
|
+ let arr = item.find((i) => i._id == val);
|
|
|
+ if (arr) check.push({ id: arr._id, nickname: arr.nickname, icon: arr.icon })
|
|
|
+ }
|
|
|
+ that.setData({ check: check })
|
|
|
+ },
|
|
|
+
|
|
|
+ clickme: function () {
|
|
|
+ this.setData({
|
|
|
+ showModal: true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ preventTouchMove: function () {
|
|
|
+ },
|
|
|
+
|
|
|
+ go: function () {
|
|
|
+ this.setData({
|
|
|
+ showModal: false
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
bindPickerChange: function (e) {
|
|
|
console.log('picker发送选择改变,携带值为', e.detail.value)
|
|
@@ -28,18 +62,16 @@ Page({
|
|
|
index: e.detail.value
|
|
|
})
|
|
|
},
|
|
|
- back: function () {
|
|
|
- wx.navigateBack({ url: '/pages/me/index' })
|
|
|
- },
|
|
|
-
|
|
|
- addList: function () {
|
|
|
- var lists = this.data.lists;
|
|
|
- var newData = [];
|
|
|
- lists.push(newData);
|
|
|
+ bindDateChange: function (e) {
|
|
|
+ console.log('picker发送选择改变,携带值为', e.detail.value)
|
|
|
this.setData({
|
|
|
- lists: lists,
|
|
|
+ create_time: e.detail.value
|
|
|
})
|
|
|
},
|
|
|
+ back: function () {
|
|
|
+ wx.navigateBack({ url: '/pages/me/index' })
|
|
|
+ },
|
|
|
+
|
|
|
|
|
|
delList: function () {
|
|
|
var lists = this.data.lists;
|
|
@@ -48,51 +80,54 @@ Page({
|
|
|
lists: lists,
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
- formSubmit: function (e) {
|
|
|
- const value = e.detail.value;
|
|
|
- const that = this;
|
|
|
- if (!this.WxValidate.checkForm(value)) {
|
|
|
- const error = this.WxValidate.errorList[0];
|
|
|
- wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
|
|
|
- return false
|
|
|
- } else {
|
|
|
- value.icon = this.data.fileList;
|
|
|
- wx.getStorage({
|
|
|
- key: 'token',
|
|
|
- success: function (res) {
|
|
|
- wx.request({
|
|
|
- url: `${app.globalData.publicUrl}/courtAdmin/api/team`,
|
|
|
- method: "post",
|
|
|
- data: value,
|
|
|
- header: {},
|
|
|
- success: res => {
|
|
|
-
|
|
|
- console.log(res);
|
|
|
- if (res.data.errcode == 0) {
|
|
|
- wx.showToast({
|
|
|
- title: '创建团队成功',
|
|
|
- icon: 'success',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- } else {
|
|
|
- wx.showToast({
|
|
|
- title: '创建团队失败',
|
|
|
- icon: 'error',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- error: err => {
|
|
|
- console.log(err);
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
+ formSubmit(e) {
|
|
|
+ console.log('form发生了submit事件,携带数据为:', e.detail.value)
|
|
|
+ },
|
|
|
afterRead: function (event) {
|
|
|
+ const that = this;
|
|
|
const { file } = event.detail;
|
|
|
|
|
|
console.log(file);
|
|
@@ -132,7 +167,6 @@ Page({
|
|
|
this.watchLogin();
|
|
|
|
|
|
this.initValidate()
|
|
|
-
|
|
|
},
|
|
|
|
|
|
watchLogin: function () {
|
|
@@ -141,6 +175,19 @@ Page({
|
|
|
key: 'token',
|
|
|
success: res => {
|
|
|
|
|
|
+ wx.request({
|
|
|
+ url: `${app.globalData.publicUrl}/courtAdmin/api/user`,
|
|
|
+ method: "get",
|
|
|
+ data: {},
|
|
|
+ header: {},
|
|
|
+ success: res => {
|
|
|
+ console.log(res);
|
|
|
+ that.setData({ item: res.data.data })
|
|
|
+ },
|
|
|
+ error: err => {
|
|
|
+ console.log(err);
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
fail: res => {
|
|
|
wx.redirectTo({ url: '/pages/login/index', })
|
|
@@ -157,7 +204,6 @@ Page({
|
|
|
if (frameStyle.useBar) infoHeight = infoHeight - 50;
|
|
|
if (infoHeight) this.setData({ infoHeight: infoHeight })
|
|
|
},
|
|
|
-
|
|
|
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|