YY 2 anos atrás
pai
commit
b6425d3f7e

+ 1 - 1
pages/sonecoach/list.js

@@ -62,7 +62,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(`/coach/${item.coach_id}`);
         if (arr.errcode == '0') {
             that.setData({ form: arr.data })
             // 生成二维码

+ 3 - 2
pages/sonecoach/list.json

@@ -1,6 +1,7 @@
 {
     "component": true,
     "usingComponents": {
-      "mobile-main": "/commpents/mobile-frame/index"
+        "mobile-main": "/commpents/mobile-frame/index",
+        "dialog": "/commpents/dialog/index"
     }
-  }
+}

+ 1 - 1
pages/sonecoach/list.wxml

@@ -14,7 +14,7 @@
                     <view class="list {{item.coach_id_level=='0'?'level_0':item.coach_id_level=='1'?'level_1':item.coach_id_level=='2'?'level_2':'level_3'}}" wx:for="{{list}}" wx:key="item">
                         <view class="list_1">
                             <view class="icon">
-                                <image src="{{item.icon&&item.icon.length>0?item.icon[0].url:''}}">
+                                <image src="{{item.coach_id_icon&&item.coach_id_icon.length>0?item.coach_id_icon[0].url:''}}">
                                 </image>
                             </view>
                             <view class="content">

+ 19 - 0
pages/sonefee/list.js

@@ -3,11 +3,30 @@ Page({
     data: {
         frameStyle: { useTop: true, name: '审批教练费', leftArrow: true, useBar: false },
         list: [{}, {}],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
     },
     // 返回
     back(e) {
         wx.navigateBack({ delta: 1 })
     },
+    // 分页
+    toPage: function () {
+        const that = this;
+        let list = that.data.list;
+        let limit = that.data.limit;
+        if (that.data.total > list.length) {
+            wx.showLoading({ title: '加载中', mask: true })
+            let page = that.data.page + 1;
+            that.setData({ page: page })
+            let skip = page * limit;
+            that.setData({ skip: skip })
+            that.watchLogin();
+            wx.hideLoading()
+        } else { wx.showToast({ title: '没有更多数据了', icon: 'none', duration: 2000 }) }
+    },
     /**
      * 生命周期函数--监听页面加载
      */

+ 1 - 0
pages/sonefee/list.less

@@ -39,6 +39,7 @@
             padding: 2vw;
             margin: 2vw 2vw 0;
             border-radius: 10px;
+            border: 1px dashed var(--blackColor);
 
             .list_1 {
                 display: flex;

+ 1 - 0
pages/sonefee/list.wxss

@@ -34,6 +34,7 @@
   padding: 2vw;
   margin: 2vw 2vw 0;
   border-radius: 10px;
+  border: 1px dashed var(--blackColor);
 }
 .main .two .list .list_1 {
   display: flex;

+ 8 - 7
pages/sonestudent/list.js

@@ -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 }) }
             },

+ 2 - 1
pages/sonestudent/list.json

@@ -1,6 +1,7 @@
 {
     "component": true,
     "usingComponents": {
-      "mobile-main": "/commpents/mobile-frame/index"
+      "mobile-main": "/commpents/mobile-frame/index",
+      "dialog": "/commpents/dialog/index"
     }
   }

+ 31 - 0
pages/sonestudent/list.less

@@ -39,6 +39,8 @@
             padding: 2vw;
             margin: 2vw 2vw 0;
             border-radius: 10px;
+            border: 1px dashed var(--blackColor);
+
 
             .list_1 {
                 display: flex;
@@ -124,4 +126,33 @@
         display: flex;
         flex-direction: column;
     }
+}
+
+.dialog {
+    .dialog_1 {
+        .name {
+            text-align: center;
+            font-size: var(--font18Szie);
+            font-weight: bold;
+            margin: 3vw 0;
+        }
+
+        .image {
+            text-align: center;
+            height: 18vh;
+            overflow: hidden;
+
+            .qrcode {
+                height: 22vh;
+                position: absolute;
+                left: 32vw;
+            }
+        }
+
+        .remark {
+            text-align: center;
+            font-size: 15px;
+            margin: 0 0 4vw 0;
+        }
+    }
 }

+ 15 - 4
pages/sonestudent/list.wxml

@@ -14,14 +14,14 @@
                     <view class="list" wx:for="{{list}}" wx:key="item">
                         <view class="list_1">
                             <view class="icon">
-                                <image src="{{item.icon&&item.icon.length>0?item.icon[0].url:''}}">
+                                <image src="{{item.student_id_icon&&item.student_id_icon.length>0?item.student_id_icon[0].url:''}}">
                                 </image>
                             </view>
                             <view class="content">
-                                <view class="name textOver">{{item.name||'学员姓名'}}</view>
+                                <view class="name textOver">{{item.student_id_name||'学员姓名'}}</view>
                                 <view class="other">学员等级:<text>{{item.zhLevel||'一级'}}</text>
                                 </view>
-                                <view class="other">联系电话:{{item.phone||'暂无'}}
+                                <view class="other">联系电话:{{item.student_id_phone||'暂无'}}
                                 </view>
                             </view>
                         </view>
@@ -35,4 +35,15 @@
             </scroll-view>
         </view>
     </view>
-</mobile-main>
+</mobile-main>
+<dialog dialog="{{dialog}}" bind:toClose="toClose">
+    <view slot="info" class="dialog">
+        <view class="dialog_1" wx:if="{{dialog.type=='1'}}">
+            <view class="name">{{form.name}}</view>
+            <view class="image">
+                <canvas class="qrcode" canvas-id="myQrcode"></canvas>
+            </view>
+            <view class="remark">用户可扫描二维码进行账号绑定</view>
+        </view>
+    </view>
+</dialog>

+ 22 - 0
pages/sonestudent/list.wxss

@@ -34,6 +34,7 @@
   padding: 2vw;
   margin: 2vw 2vw 0;
   border-radius: 10px;
+  border: 1px dashed var(--blackColor);
 }
 .main .two .list .list_1 {
   display: flex;
@@ -105,3 +106,24 @@
   display: flex;
   flex-direction: column;
 }
+.dialog .dialog_1 .name {
+  text-align: center;
+  font-size: var(--font18Szie);
+  font-weight: bold;
+  margin: 3vw 0;
+}
+.dialog .dialog_1 .image {
+  text-align: center;
+  height: 18vh;
+  overflow: hidden;
+}
+.dialog .dialog_1 .image .qrcode {
+  height: 22vh;
+  position: absolute;
+  left: 32vw;
+}
+.dialog .dialog_1 .remark {
+  text-align: center;
+  font-size: 15px;
+  margin: 0 0 4vw 0;
+}