guhongwei пре 2 година
родитељ
комит
41f85e808e
2 измењених фајлова са 17 додато и 13 уклоњено
  1. 5 4
      pages/setting/basic.js
  2. 12 9
      pagesMatch/matchAdmin/referee/list.js

+ 5 - 4
pages/setting/basic.js

@@ -144,10 +144,11 @@ Page({
         wx.scanCode({
             async success(res) {
                 let arr = res.result.split('&&');
-                let user_id = arr[0];
-                let school_id = arr[1];
-                const aee = await app.$post(`/utbj`, { user_id: user_id, school_id: school_id }, 'race')
-                console.log(aee);
+                let parent_id = arr[0];
+                let type = arr[1];
+                console.log(user);
+                // const aee = await app.$post(`/utbj`, { user_id: user_id, parent_id: parent_id }, 'race')
+                // console.log(aee);
             }
         })
     },

+ 12 - 9
pagesMatch/matchAdmin/referee/list.js

@@ -5,6 +5,8 @@ import QRCode from '../../../utils/weapp-qrcode.js';
 Page({
     data: {
         frameStyle: { useTop: true, name: '裁判信息', leftArrow: true, useBar: false },
+        // 比赛系统用户
+        raceuser: {},
         list: [],
         total: 0,
         page: 0,
@@ -39,14 +41,14 @@ Page({
             content: '是否确认删除该条数据?',
             async success(res) {
                 if (res.confirm) {
-                    // const arr = await app.$delete(`/user/${item._id}`);
-                    // if (arr.errcode == '0') {
-                    //     wx.showToast({ title: `删除信息成功`, icon: 'success', duration: 2000 })
-                    //     that.setData({ skip: 0, page: 0, list: [] })
-                    //     that.watchLogin()
-                    // } else {
-                    //     wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
-                    // }
+                    const arr = await app.$delete(`/user/${item._id}`, {}, 'race');
+                    if (arr.errcode == '0') {
+                        wx.showToast({ title: `删除信息成功`, icon: 'success', duration: 2000 })
+                        that.setData({ skip: 0, page: 0, list: [] })
+                        that.watchLogin()
+                    } else {
+                        wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                    }
                 }
             }
         })
@@ -85,7 +87,7 @@ Page({
     },
     makeQRCode(template = 0) {
         const that = this;
-        const url = `${that.data.form.id}&&2`;
+        const url = `${that.data.raceuser._id}&&2`;
         var qrcode = new QRCode(`myQrcode`, {
             text: url,
             width: 110,
@@ -153,6 +155,7 @@ Page({
         wx.getStorage({
             key: 'raceuser',
             success: async res => {
+                that.setData({ raceuser: res.data })
                 let arr;
                 // 查询当前用户学校,学校id存比赛系统user中的_id,查询当前用户学校与教练的关系表
                 arr = await app.$get(`/school`, { user_id: res.data.user_id._id })