|
@@ -1,8 +1,10 @@
|
|
|
const app = getApp()
|
|
|
+import QRCode from '../../utils/weapp-qrcode.js';
|
|
|
+
|
|
|
Page({
|
|
|
data: {
|
|
|
frameStyle: { useTop: true, name: '学员信息', leftArrow: true, useBar: false },
|
|
|
- list: [{}, {}, {}],
|
|
|
+ list: [],
|
|
|
total: 0,
|
|
|
page: 0,
|
|
|
skip: 0,
|
|
@@ -28,7 +30,7 @@ Page({
|
|
|
const that = this;
|
|
|
let { item } = e.currentTarget.dataset;
|
|
|
that.setData({ skip: 0, page: 0, list: [] })
|
|
|
- // wx.navigateTo({ url: `/pages/sonecoach/add?id=${item.coach_id}` })
|
|
|
+ wx.navigateTo({ url: `/pages/sonestudent/add?id=${item.student_id}` })
|
|
|
},
|
|
|
// 删除
|
|
|
toDel: async function (e) {
|
|
@@ -55,7 +57,7 @@ Page({
|
|
|
toBind: async function (e) {
|
|
|
const that = this;
|
|
|
let { item } = e.currentTarget.dataset;
|
|
|
- const arr = await app.$get(`/coach/${item.id}`);
|
|
|
+ const arr = await app.$get(`/student/${item.student_id}`);
|
|
|
if (arr.errcode == '0') {
|
|
|
that.setData({ form: arr.data })
|
|
|
// 生成二维码
|
|
@@ -119,12 +121,11 @@ Page({
|
|
|
const arr = await app.$get(`/rss`, { ...info });
|
|
|
if (arr.errcode == '0') {
|
|
|
for (const val of arr.data) {
|
|
|
- let level = that.data.levelList.find(i => i.value == val.coach_id_level)
|
|
|
+ let level = that.data.levelList.find(i => i.value == val.student_id_level)
|
|
|
if (level) val.zhLevel = level.label;
|
|
|
}
|
|
|
- // that.setData({ list: [...that.data.list, ...arr.data] });
|
|
|
- // that.setData({ total: arr.total });
|
|
|
- // console.log(arr.data);
|
|
|
+ that.setData({ list: [...that.data.list, ...arr.data] });
|
|
|
+ that.setData({ total: arr.total });
|
|
|
}
|
|
|
else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
|
|
|
},
|