فهرست منبع

双精度问题

Changpeng Duan 5 سال پیش
والد
کامیت
d63cda926f
8فایلهای تغییر یافته به همراه164 افزوده شده و 489 حذف شده
  1. 16 415
      pc/src/views/AcrossVip.vue
  2. 20 12
      pc/src/views/courseEdit.vue
  3. 1 1
      tv/src/main.js
  4. 16 16
      tv/src/views/2pkRank.vue
  5. 27 24
      tv/src/views/3pkRank.vue
  6. 2 1
      tv/src/views/Rank.vue
  7. 36 9
      tv/src/views/pk.vue
  8. 46 11
      tv/src/views/threepk.vue

+ 16 - 415
pc/src/views/AcrossVip.vue

@@ -26,8 +26,8 @@
             </div>
         </div>
         <div class="change">
-            <el-button @click="addMember" v-if="userLevel != 4" type="primary">新增会员</el-button>
-            <el-button @click="delList" v-if="userLevel != 4">删除会员</el-button>
+            <el-button @click="addMember" v-if="userLevel != 4" type="primary">新增跨店会员</el-button>
+            <el-button @click="delList" v-if="userLevel != 4">删除跨店会员</el-button>
         </div>
         <div class="table">
             <el-table
@@ -114,7 +114,7 @@
                 <div>
 
                     <el-form ref="form" :model="form" label-width="80px">
-                        <el-form-item label="会员账号" v-if="form.btnType == 0">
+                        <el-form-item label="会员账号">
                             <el-select v-model="form.userId " filterable placeholder="请选择会员账号">
                                 <el-option
                                         v-for="item in form.vipList"
@@ -124,7 +124,7 @@
                                 ></el-option>
                             </el-select>
                         </el-form-item>
-                        <el-form-item label="商家分组" v-if="form.btnType == 0">
+                        <el-form-item label="商家分组">
                             <el-select v-model="form.groupId " filterable placeholder="请选择商家分组">
                                 <el-option
                                         v-for="item in form.groupList"
@@ -171,12 +171,12 @@
                 qiniuaddr: 'qjzpcd34v.hb-bkt.clouddn.com',
                 dialogVisible: false,//其他dialog
                 TakeVisible: false,//take dialog
-                dialogMemberVisible: false,//新增会员dialog
+                dialogMemberVisible: false,//新增跨店会员dialog
                 dialogLesson: false,//课时调整
                 dialogGift: false,//赠送课时调整
                 dialogExpTime: false,//有效期调整
                 dialogLessonTable: false,//会员课程
-                dialogTitle: '新增会员',
+                dialogTitle: '新增跨店会员',
                 dialogValue: [],
                 Takevalue: 0,
                 Takeoptions: [],
@@ -223,6 +223,7 @@
                     phone: '',
                     name: '',
                     userCode: '',
+                    groupId: '',
                     shopId: '',
                     Id: '',
                     userId: '',
@@ -254,9 +255,6 @@
             }
         },
         mounted() {
-            // 加载课程选项
-            this.getClassVipuserQueryByAdmin();
-            this.getShopGroupQuery();
             // 读取列表
             this.getTableQuery();
         },
@@ -292,201 +290,9 @@
                     }
                 })
             },
-            // 关联手机号跳转
-            goRelevance(row) {
-                this.$router.push({path: '/relevancePhone', query: {userId: row.UserInfo.Id}});
-            },
-            // 上传文件到七牛云
-            upqiniu(req) {
-                let that = this;
-                const config = {
-                    headers: {'Content-Type': 'multipart/form-data'}
-                };
-                let filetype = '';
-                if (req.file.type === 'image/png') {
-                    filetype = 'png'
-                } else {
-                    filetype = 'jpg'
-                }
-                // 重命名要上传的文件
-                const keyname = 'GoAllOut' + new Date().valueOf() + Math.floor(Math.random() * 100) + '.' + filetype;
-                // 从后端获取上传凭证token
-                let param = {
-                    token: localStorage.token,
-                };
-                let postdata = qs.stringify(param);
-                this.axios.post(headapi + 'v1/QiNiu/GetSimpleQiNiuToken', postdata).then(res => {
-                    const formdata = new FormData();
-                    formdata.append('file', req.file);
-                    formdata.append('token', res.data.QiNinToken);
-                    formdata.append('key', keyname);
-                    // 获取到凭证之后再将文件上传到七牛云空间
-                    this.axios.post(this.domain, formdata, config).then(res => {
-                        this.imageUrl = 'http://' + this.qiniuaddr + '/' + res.data.key;
-                        this.form.head = 'http://' + this.qiniuaddr + '/' + keyname;
-                    })
-                })
-            },
-            // 验证文件合法性
-            beforeUpload(file) {
-                const isJPG = file.type === 'image/jpeg' || file.type === 'image/png';
-                const isLt2M = file.size / 1024 / 1024 < 2;
-                if (!isJPG) {
-                    this.$message.error('上传头像图片只能是 JPG 格式!')
-                }
-                if (!isLt2M) {
-                    this.$message.error('上传头像图片大小不能超过 2MB!')
-                }
-                return isJPG && isLt2M
-            },
-            // 打开take绑定和拉取take数据
-            addTake(row) {
-                let that = this;
-                let param = {
-                    token: localStorage.token,
-                    userId: row.UserInfo.Id,
-                };
-                this.TakeHid = row.UserInfo.HId;
-                let postdata = qs.stringify(param);
-                QueryTakeCustomerByName(postdata).then(res => {
-                    let json = res;
-                    if (json.Code == 0) {
-                        if (json.Rs != '') {
-                            that.Takeoptions = json.Rs;
-                            that.Takevalue = json.Rs[0].Id;
-                            // 有值才能打开
-                            this.TakeVisible = true;
-                        } else {
-                            that.$message.error('当前用户没有可用的Take账号');
-                            this.TakeVisible = false;
-                            console.log('null');
-                        }
-                    } else {
-                        that.$message.error(json.Memo);
-                    }
-                })
-            },
-            // 绑定take
-            confirmTake() {
-                let that = this;
-                let param = {
-                    token: localStorage.token,
-                    hId: this.TakeHid,
-                    customerId: this.Takevalue,
-                    memo: '后台管理手动绑定',
-                };
-                let postdata = qs.stringify(param);
-                BindTakeCustomer(postdata).then(res => {
-                    let json = res;
-                    if (json.Code == 0) {
-                        that.$message({
-                            showClose: true,
-                            message: 'Take绑定成功!',
-                            type: 'success'
-                        });
-                        this.TakeVisible = false;
-                        // 读取列表
-                        this.getTableQuery();
-                    } else {
-                        that.$message.error(json.Memo);
-                    }
-                })
-            },
-
             clickChange(item) {
                 this.tableRadio = item
             },
-            // 编辑
-            editMember(row) {
-                let that = this;
-                this.clearForm();
-                this.form.phone = row.UserInfo.Phone;
-                this.form.name = row.UserInfo.Name;
-                this.form.memo = row.UserInfo.Memo;
-                this.imageUrl = row.UserInfo.Head;
-                this.form.height = row.UserInfo.Height;
-                this.form.weight = parseInt(row.UserInfo.Weight) / 10;
-                // this.form.staticHr = row.UserInfo.StaticHr;
-                this.form.sex = row.UserInfo.Sex;
-                this.form.birthday = row.UserInfo.Birthday;
-                this.form.ubId = row.UserInfo.UbId;
-                this.form.btnType = 1;
-                this.form.shopId = row.UserInfo.ShopId;
-                this.form.Id = row.UserInfo.Id;
-                this.dialogMemberVisible = true;
-                this.dialogTitle = '编辑会员'
-
-            },
-            // 禁用
-            pauseRow(row) {
-                let that = this;
-                this.$confirm('是否禁用用户' + row.UserInfo.Name + '?', '禁用操作', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    let param = {
-                        token: localStorage.token,
-                        userId: row.UserInfo.Id,
-                        status: 8,//状态 8:禁用 1:启用 9:删除
-                    };
-                    let postdata = qs.stringify(param);
-                    VipUserStatusEdit(postdata).then(res => {
-                        let json = res;
-                        if (json.Code == 0) {
-                            that.$message({
-                                showClose: true,
-                                message: row.UserInfo.Name + '禁用成功!',
-                                type: 'success'
-                            });
-                            // table 重载
-                            that.getTableQuery();
-                        } else {
-                            that.$message.error(json.Memo);
-                        }
-                    })
-                }).catch(() => {
-                    this.$message({
-                        type: 'info',
-                        message: '已取消禁用'
-                    });
-                });
-            },
-            // 启用
-            runRow(row) {
-                let that = this;
-                this.$confirm('是否启用用户' + row.UserInfo.Name + '?', '启用操作', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    let param = {
-                        token: localStorage.token,
-                        userId: row.UserInfo.Id,
-                        status: 1,//状态 8:禁用 1:启用 9:删除
-                    };
-                    let postdata = qs.stringify(param);
-                    VipUserStatusEdit(postdata).then(res => {
-                        let json = res;
-                        if (json.Code == 0) {
-                            that.$message({
-                                showClose: true,
-                                message: row.UserInfo.Name + '启用成功!',
-                                type: 'success'
-                            });
-                            // table 重载
-                            that.getTableQuery();
-                        } else {
-                            that.$message.error(json.Memo);
-                        }
-                    })
-                }).catch(() => {
-                    this.$message({
-                        type: 'info',
-                        message: '已取消启用'
-                    });
-                });
-            },
             // 关闭所有
             allDialogClose() {
                 this.dialogVisible = false;
@@ -495,82 +301,7 @@
                 this.dialogExpTime = false;
                 this.dialogLessonTable = false;
             },
-            // 有效期调整
-            ExpTimeChange() {
-                // 仅针对年费用户,使用日期格式
-                this.allDialogClose();
-                if (this.tableRadio.length == 0) {
-                    this.$message.error("请先选中一条记录");
-                    return false
-                }
-                let row = this.tableRadio;
-                if (parseInt(row.UserInfo.VipType) == 2) {
-                    this.$message({
-                        showClose: true,
-                        message: '错了哦,充值会员不能调整有效期',
-                        type: 'error'
-                    });
-                    return false
-                }
-                this.form.rowName = row.UserInfo.Name;
-                this.form.userId = row.UserInfo.Id;
-                this.form.expTime = row.UserInfo.ExpTime
-                this.dialogVisible = true;
-                this.dialogExpTime = true;
-            },
-            // 课时调整
-            lessonChange() {
-                this.allDialogClose();
-                if (this.tableRadio.length == 0) {
-                    this.$message.error("请先选中一条记录");
-                    return false
-                }
-                let row = this.tableRadio;
-                this.form.normalhour = row.UserInfo.RemainNormalhour;
-                this.form.newnormalhour = 0;
-                this.form.rowName = row.UserInfo.Name;
-                this.form.userId = row.UserInfo.Id;
-                this.dialogVisible = true;
-                this.dialogLesson = true;
-
-            },
-            // 赠送调整
-            giftChange() {
-                this.allDialogClose();
-                if (this.tableRadio.length == 0) {
-                    this.$message.error("请先选中一条记录");
-                    return false
-                }
-                let row = this.tableRadio;
-                this.form.gifthour = row.UserInfo.RemainGifthour;
-                this.form.newgifthour = 0;
-                this.form.rowName = row.UserInfo.Name;
-                this.form.userId = row.UserInfo.Id;
-                this.dialogVisible = true;
-                this.dialogGift = true;
-
-            },
-            // 增删会员课程
-            lessonStudenChange() {
-                let that = this;
-                this.allDialogClose();
-                // 重载课程列表选项
-                if (this.tableRadio.length == 0) {
-                    that.$message.error("请先选中一条记录");
-                    return false
-                }
-                let row = this.tableRadio;
-                this.form.rowName = row.UserInfo.Name;
-                this.form.userId = row.UserInfo.Id;
-                if (row.ClassInfo) {
-                    row.ClassInfo.map(function (item) {
-                        that.form.dialogValue.push(item.ClassId)
-                    })
-                }
-                this.dialogVisible = true;
-                this.dialogLessonTable = true;
-            },
-            // 确认提交新增会员
+            // 确认提交新增跨店会员
             confirmMember() {
                 let that = this;
                 // checkNum
@@ -608,125 +339,16 @@
                     }
                 })
             },
-            // 确认提交课时
-            confirmLesson() {
-                let that = this;
-                // checkNum
-                let param = {
-                    token: localStorage.token,
-                    userId: that.form.userId,
-                    chgHour: that.form.newnormalhour,
-                    chgType: 1,//课时类型 1:普通课时 2:赠送课时
-                };
-                let postdata = qs.stringify(param);
-                VipUserHourEdit(postdata).then(res => {
-                    let json = res;
-                    if (json.Code == 0) {
-                        // 关闭弹窗
-                        that.dialogVisible = false;
-                        // 重载列表
-                        that.getTableQuery();
-                        that.$message({
-                            showClose: true,
-                            message: '课时调整成功!',
-                            type: 'success'
-                        });
-                    } else {
-                        that.$message.error(json.Memo);
-                    }
-                })
-            },
-            // 确认提交赠送
-            confirmGift() {
-                let that = this;
-                let param = {
-                    token: localStorage.token,
-                    userId: that.form.userId,
-                    chgHour: that.form.newgifthour,
-                    chgType: 2,//课时类型 1:普通课时 2:赠送课时
-                };
-                let postdata = qs.stringify(param);
-                VipUserHourEdit(postdata).then(res => {
-                    let json = res;
-                    if (json.Code == 0) {
-                        // 关闭弹窗
-                        that.dialogVisible = false;
-                        // 重载列表
-                        that.getTableQuery();
-                        that.$message({
-                            showClose: true,
-                            message: '赠送课时调整成功!',
-                            type: 'success'
-                        });
-                    } else {
-                        that.$message.error(json.Memo);
-                    }
-                })
-            },
-            // 确认提交有效期
-            confirmExpTime() {
-                let that = this;
-                // checkNum
-
-                let param = {
-                    token: localStorage.token,
-                    userId: that.form.userId,
-                    expTime: nonTfmtDate(that.form.expTime, 16),
-                };
-                let postdata = qs.stringify(param);
-                VipUserExpEdit(postdata).then(res => {
-                    let json = res;
-                    if (json.Code == 0) {
-                        // 关闭弹窗
-                        that.dialogVisible = false;
-                        // 重载列表
-                        that.getTableQuery();
-                        that.$message({
-                            showClose: true,
-                            message: '赠送课时调整成功!',
-                            type: 'success'
-                        });
-                    } else {
-                        that.$message.error(json.Memo);
-                    }
-                })
-            },
-            // 确认提交会员课程
-            confirmLessonTable() {
-                let that = this;
-                // checkNum
-                let classList = that.form.dialogValue ? that.form.dialogValue.toString() : '';
-
-                let param = {
-                    token: localStorage.token,
-                    userId: that.form.userId,
-                    classList: classList,
-                };
-                let postdata = qs.stringify(param);
-                VipUserClassEdit(postdata).then(res => {
-                    let json = res;
-                    if (json.Code == 0) {
-                        // 关闭弹窗
-                        that.dialogVisible = false;
-                        // 重载列表
-                        that.getTableQuery();
-                        that.$message({
-                            showClose: true,
-                            message: '会员课程调整成功!',
-                            type: 'success'
-                        });
-                    } else {
-                        that.$message.error(json.Memo);
-                    }
-                })
-            },
-            // 新增会员
+            // 新增跨店会员
             addMember() {
-                this.clearForm();
+                this.getClassVipuserQueryByAdmin();
+                this.getShopGroupQuery();
                 this.dialogMemberVisible = true;
                 this.btnType = 0;
                 this.form.btnType = 0;
-                this.dialogTitle = '新增会员'
+                this.form.userId = '';
+                this.form.groupId = '';
+                this.dialogTitle = '新增跨店会员'
             },
             // 删除
             delList() {
@@ -779,33 +401,15 @@
                 that.serachBtnStatus = true;
                 that.getTableQuery();
                 that.$message.success('查询完毕');
-                let totalTime = 2
+                let totalTime = 2;
                 let clock = window.setInterval(() => {
-                    totalTime--
+                    totalTime--;
                     if (totalTime < 0) {
                         totalTime = 2;
                         that.serachBtnStatus = false;
                     }
                 }, 1000)
             },
-            clearForm() {
-                // clear
-                this.form.name = '';
-                this.form.head = '';
-                this.imageUrl = '';
-                this.form.phone = '';
-                this.form.memo = '';
-                this.form.normalhour = 0;
-                this.form.gifthour = 0;
-                this.form.height = '';
-                this.form.weight = '';
-                this.form.staticHr = 0;
-                this.form.sex = 1;
-                this.form.birthday = '';
-                this.form.userCode = '';
-                this.form.shopId = '';
-                this.form.classlist = [];
-            },
             // 页面数据查询
             getTableQuery() {
                 let that = this;
@@ -891,9 +495,6 @@
         watch: {
             $route(to) {
                 if (to.name == 'AcrossVip') {
-                    // 加载课程选项
-                    this.getClassVipuserQueryByAdmin();
-                    this.getShopGroupQuery();
                     // 读取列表
                     this.getTableQuery();
                 }

+ 20 - 12
pc/src/views/courseEdit.vue

@@ -665,7 +665,7 @@
                         that.getTableQuery();
                         that.$message({
                             showClose: true,
-                            message: '下课会员修改成功!',
+                            message: '会员添加成功!',
                             type: 'success'
                         });
                     } else {
@@ -768,19 +768,27 @@
                         that.loading = false;
                         if (json.Rs) {
                             // 分队处理
-                            // 未上课的分,已上课的不处理
-                            if(that.FinishClass == 3){
+                            // 未上课的分,已上课的旧的不处理,新人需要处理
+                            if (that.FinishClass == 3) {
                                 if (that.ClassType == 2) {
                                     that.TurnUnit(json.Rs);
                                 } else {
                                     json.Rs.map(function (item) {
-                                        item.group_no = 0;
+                                        item.group_no = item.GroupNo;
                                     })
                                 }
-                            }else{
-                                json.Rs.map(function (item) {
-                                    item.group_no = item.GroupNo;
-                                })
+                            } else {
+                                // 已上课的状态
+                                json.Rs.map(function (item, i) {
+                                    if (that.ClassType == 2) {
+                                        if (item.group_no == 0) {
+                                            item.group_no = i % that.PkNum;
+                                            console.log(i % that.PkNum);
+                                        }
+                                    } else {
+                                        item.group_no = item.GroupNo;
+                                    }
+                                });
                             }
                             that.allTableData = json.Rs;
                             that.recordsTotal = json.Rs.length;
@@ -965,14 +973,14 @@
                         break;
                 }
             },
-            PkNum(to){
-                 let that = this;
-                if(to == 2){
+            PkNum(to) {
+                let that = this;
+                if (to == 2) {
                     that.groupList = [
                         {label: '红队', value: 1},
                         {label: '蓝队', value: 2},
                     ]
-                }else{
+                } else {
                     that.groupList = [
                         {label: '红队', value: 1},
                         {label: '蓝队', value: 2},

+ 1 - 1
tv/src/main.js

@@ -10,7 +10,7 @@ import axios from 'axios'
 import VConsole from 'vconsole/dist/vconsole.min.js' //import vconsole
 
 if(process.env.NODE_ENV === 'development'){
-    // let vConsole = new VConsole() // 初始化
+    let vConsole = new VConsole() // 初始化
 }else{
 
 }

+ 16 - 16
tv/src/views/2pkRank.vue

@@ -40,7 +40,7 @@
                                 {{s.Name}}
                             </div>
                             <div class="CLEscore">
-                                <em>CLE</em>
+                                <em>cal</em>
                                 {{s.Cle|fmtInt}}
                             </div>
                             <div class="CKscore">
@@ -68,7 +68,7 @@
                                 {{s.Name}}
                             </div>
                             <div class="CLEscore">
-                                <em>CLE</em>
+                                <em>cal</em>
                                 {{s.Cle|fmtInt}}
                             </div>
                             <div class="CKscore">
@@ -108,6 +108,7 @@
                 rankTimer: null,
                 redSum: 0,
                 blueSum: 0,
+                totalTime:60
             }
         },
         mounted() {
@@ -128,6 +129,7 @@
                 this.totalTime = 60;
                 let clock = window.setInterval(() => {
                     this.totalTime--;
+                    console.log(this.totalTime);
                     if (parseInt(this.totalTime) < 0) {
                         // 前往等待页面
                         that.$router.push({path: '/wait'});
@@ -172,20 +174,16 @@
                 let that = this;
                 that.students.redUnite = [];
                 that.students.blueUnite = [];
-                if (!Rs) {
-                    that.students.redUnite = [];
-                    that.students.blueUnite = [];
-                } else {
-                    Rs.map(function (item, t) {
-                        if (item.GroupNo == 1) {
-                            that.students.redUnite.push(item);
-                        }
-                        if (item.GroupNo == 2) {
-                            that.students.blueUnite.push(item);
-                        }
-                    })
+                console.log(!Rs);
 
-                }
+                Rs.map(function (item, t) {
+                    if (item.GroupNo == 1) {
+                        that.students.redUnite.push(item);
+                    }
+                    if (item.GroupNo == 2) {
+                        that.students.blueUnite.push(item);
+                    }
+                });
                 // 排序
                 that.students.redUnite = that.students.redUnite.sort(function (a, b) {
                     return b.Cle - a.Cle;
@@ -219,6 +217,8 @@
                 let postdata = qs.stringify(param);
                 ClassUserRank(postdata).then(res => {
                     let json = res;
+                    that.students.redUnite = [];
+                    that.students.blueUnite = [];
                     if (json.Code == 0) {
                         that.UniteBreak(json.Rs);
                         // this.students.CkSort = json.Rs.CkSort;
@@ -263,7 +263,7 @@
         },
         watch: {
             '$route': function (val) {
-                if (val.path == '/rank') {
+                if (val.path == '/2pkRank') {
                     if (this.trueDate) {
                         this.getClassUserRank();
                         this.rankTimer = setInterval(() => {

+ 27 - 24
tv/src/views/3pkRank.vue

@@ -65,11 +65,11 @@
                                 {{s.Name}}
                             </div>
                             <div class="CLEscore">
-                                <em>CLE</em>
+                                <em>CAL</em>
                                 {{s.Cle|fmtInt}}
                             </div>
                             <div class="CKscore">
-                                <em>ck</em>
+                                <em>cal</em>
                                 {{s.Ck|fmtFloat}}
                             </div>
                             <div class="record">
@@ -91,7 +91,7 @@
                                 {{s.Name}}
                             </div>
                             <div class="CLEscore">
-                                <em>CLE</em>
+                                <em>cal</em>
                                 {{s.Cle|fmtInt}}
                             </div>
                             <div class="CKscore">
@@ -117,7 +117,7 @@
                                 {{s.Name}}
                             </div>
                             <div class="CLEscore">
-                                <em>CLE</em>
+                                <em>cal</em>
                                 {{s.Cle|fmtInt}}
                             </div>
                             <div class="CKscore">
@@ -156,6 +156,7 @@
                 students: {
                     redUnite: [],
                     blueUnite: [],
+                    yellowUnite: [],
                 },
                 red: {
                     rank: 0,
@@ -170,6 +171,7 @@
                 redSum: 0,
                 blueSum: 0,
                 yellowSum: 0,
+                totalTime:60
             }
         },
         mounted() {
@@ -190,6 +192,7 @@
                 this.totalTime = 60;
                 let clock = window.setInterval(() => {
                     this.totalTime--;
+                    console.log(this.totalTime);
                     if (parseInt(this.totalTime) < 0) {
                         // 前往等待页面
                         that.$router.push({path: '/wait'});
@@ -235,24 +238,21 @@
                 that.students.redUnite = [];
                 that.students.blueUnite = [];
                 that.students.yellowUnite = [];
-                if (!Rs) {
-                    that.students.redUnite = [];
-                    that.students.blueUnite = [];
-                    that.students.yellowUnite = [];
-                } else {
-                    Rs.map(function (item, t) {
-                        if (item.GroupNo == 1) {
-                            that.students.redUnite.push(item);
-                        }
-                        if (item.GroupNo == 2) {
-                            that.students.blueUnite.push(item);
-                        }
-                        if (item.GroupNo == 3) {
-                            that.students.yellowUnite.push(item);
-                        }
-                    })
+                console.log(!Rs);
+
+                Rs.map(function (item, t) {
+                    if (item.GroupNo == 1) {
+                        that.students.redUnite.push(item);
+                    }
+                    if (item.GroupNo == 2) {
+                        that.students.blueUnite.push(item);
+                    }
+                    if (item.GroupNo == 3) {
+                        that.students.yellowUnite.push(item);
+                    }
+                });
+
 
-                }
                 // 排序
                 that.students.redUnite = that.students.redUnite.sort(function (a, b) {
                     return b.Cle - a.Cle;
@@ -311,6 +311,10 @@
                 let postdata = qs.stringify(param);
                 ClassUserRank(postdata).then(res => {
                     let json = res;
+                    that.students.redUnite = [];
+                    that.students.blueUnite = [];
+                    that.students.yellowUnite = [];
+                    console.log(json.Rs);
                     if (json.Code == 0) {
                         that.UniteBreak(json.Rs);
                         // this.students.CkSort = json.Rs.CkSort;
@@ -353,7 +357,7 @@
         },
         watch: {
             '$route': function (val) {
-                if (val.path == '/rank') {
+                if (val.path == '/3pkRank') {
                     if (this.trueDate) {
                         this.getClassUserRank();
                         this.rankTimer = setInterval(() => {
@@ -372,6 +376,7 @@
                         this.totalTime = 60;
                         let clock = window.setInterval(() => {
                             this.totalTime--;
+                            console.log(this.totalTime);
                             if (parseInt(this.totalTime) < 0) {
                                 // 前往等待页面
                                 that.$router.push({path: '/wait'});
@@ -403,8 +408,6 @@
     * {
         font-family: vista;
     }
-
-
     .pages {
         position: absolute;
         top: 0;

+ 2 - 1
tv/src/views/Rank.vue

@@ -74,7 +74,8 @@
                     CkSort: [],
                     CalSort: [],
                 },
-                rankTimer:null
+                rankTimer:null,
+                totalTime:60
             }
         },
         mounted() {

+ 36 - 9
tv/src/views/pk.vue

@@ -48,11 +48,11 @@
                             <div class="bottomLi">
                                 <div class="btcla">
                                     <img src="../static/img/s1.svg"/>
-                                    <span>{{ s.Cle |fmtFloat }}</span>
+                                    <span>{{ s.Cle |fmtInt }}</span>
                                 </div>
                                 <div class="btck">
                                     <img src="../static/img/s2.svg"/>
-                                    <span>{{ s.PureCalorieNoVo2  |fmtFloat }}</span>
+                                    <span>{{ s.PureCalorieNoVo2  |fmtInt }}</span>
                                 </div>
                                 <div class="step">
                                     <img src="../static/img/ck.svg"/>
@@ -137,11 +137,11 @@
                             <div class="bottomLi">
                                 <div class="btcla">
                                     <img src="../static/img/s1.svg"/>
-                                    <span>{{ s.Cle |fmtFloat }}</span>
+                                    <span>{{ s.Cle |fmtInt }}</span>
                                 </div>
                                 <div class="btck">
                                     <img src="../static/img/s2.svg"/>
-                                    <span>{{ s.PureCalorieNoVo2  |fmtFloat}}</span>
+                                    <span>{{ s.PureCalorieNoVo2  |fmtInt}}</span>
                                 </div>
                                 <div class="step">
                                     <img src="../static/img/ck.svg"/>
@@ -303,17 +303,37 @@
                 let blueSum = 0;
                 // that.redSum
                 Rs.redUnite.map(function (item, t) {
-                    redSum += parseFloat(item.Ck)
+                    redSum += parseFloat(item.Ck);
                 });
                 Rs.blueUnite.map(function (item, t) {
-                    blueSum += parseFloat(item.Ck)
+                    blueSum += parseFloat(item.Ck);
                 });
                 that.redSum = redSum.toFixed(1);
                 that.blueSum = blueSum.toFixed(1);
 
+                // 进度条 formatCk
+                let redFmtSum = 0;
+                let blueFmtSum = 0;
+                Rs.redUnite.map(function (item, t) {
+                    redFmtSum += item.formatCk
+                });
+                Rs.blueUnite.map(function (item, t) {
+                    blueFmtSum += item.formatCk
+                });
+
+
                 // pkVal
-                let sumMax = (parseFloat(redSum) + parseFloat(blueSum)).toFixed(2);
-                that.pkVal = parseFloat((redSum / sumMax) * 100).toFixed(2) + '%';
+                let sumMax = redFmtSum + blueFmtSum;
+
+                // 当为0时均分
+                if (sumMax == 0) {
+                    that.pkVal = '50%';
+                } else {
+                    // 限制最大
+                    let pkval = parseInt((redFmtSum / sumMax) * 100) > 100 ? 100 : parseInt((redFmtSum / sumMax) * 100);
+                    that.pkVal = pkval + '%';
+                    console.log(pkval);
+                }
             },
             // 获取上课学生信息
             GetgetUserList() {
@@ -377,7 +397,7 @@
             ClacClassTime() {
                 let BeginTime = new Date(globalcurrent() + ' ' + this.BeginTime);//结束时间
                 let nowDate = new Date();
-                let date = new Date(nowDate - BeginTime - 8*60*60*1000);//减掉东八区时区问题
+                let date = new Date(nowDate - BeginTime - 8 * 60 * 60 * 1000);//减掉东八区时区问题
 
                 let h = date.getHours() < 10 ? '0' + date.getHours() + ':' : date.getHours() + ':';
                 let m = date.getMinutes() < 10 ? '0' + date.getMinutes() + ':' : date.getMinutes() + ':';
@@ -451,6 +471,13 @@
                 } else {
                     return parseFloat(val).toFixed(1);
                 }
+            },
+            fmtInt(val) {
+                if (val == 0) {
+                    return '0'
+                } else {
+                    return parseInt(val);
+                }
             }
         },
         watch: {

+ 46 - 11
tv/src/views/threepk.vue

@@ -85,11 +85,11 @@
                             <div class="bottomLi">
                                 <div class="btcla">
                                     <img src="../static/img/s1.svg"/>
-                                    <span>{{ s.Cle |fmtFloat }}</span>
+                                    <span>{{ s.Cle |fmtInt }}</span>
                                 </div>
                                 <div class="btck">
                                     <img src="../static/img/s2.svg"/>
-                                    <span>{{ s.PureCalorieNoVo2  |fmtFloat}}</span>
+                                    <span>{{ s.PureCalorieNoVo2  |fmtInt}}</span>
                                 </div>
                                 <div class="step">
                                     <img src="../static/img/ck.svg"/>
@@ -135,11 +135,11 @@
                             <div class="bottomLi">
                                 <div class="btcla">
                                     <img src="../static/img/s1.svg"/>
-                                    <span>{{ s.Cle |fmtFloat }}</span>
+                                    <span>{{ s.Cle |fmtInt }}</span>
                                 </div>
                                 <div class="btck">
                                     <img src="../static/img/s2.svg"/>
-                                    <span>{{ s.PureCalorieNoVo2  |fmtFloat}}</span>
+                                    <span>{{ s.PureCalorieNoVo2  |fmtInt}}</span>
                                 </div>
                                 <div class="step">
                                     <img src="../static/img/ck.svg"/>
@@ -185,11 +185,11 @@
                             <div class="bottomLi">
                                 <div class="btcla">
                                     <img src="../static/img/s1.svg"/>
-                                    <span>{{ s.Cle |fmtFloat }}</span>
+                                    <span>{{ s.Cle |fmtInt }}</span>
                                 </div>
                                 <div class="btck">
                                     <img src="../static/img/s2.svg"/>
-                                    <span>{{ s.PureCalorieNoVo2  |fmtFloat}}</span>
+                                    <span>{{ s.PureCalorieNoVo2  |fmtInt}}</span>
                                 </div>
                                 <div class="step">
                                     <img src="../static/img/ck.svg"/>
@@ -226,8 +226,8 @@
                 redSum: 0,
                 blueSum: 0,
                 yellowSum: 0,
-                pkVal: '50%',
-                yellowVal: '50%',
+                pkVal: '33.33%',
+                yellowVal: '33.33%',
                 students: {
                     redUnite: [],
                     blueUnite: [],
@@ -374,10 +374,37 @@
                 that.blueSum = blueSum.toFixed(1);
                 that.yellowSum = yellowSum.toFixed(1);
 
+
+
+                // 进度条 formatCk
+                let redFmtSum = 0;
+                let blueFmtSum = 0;
+                let yellowFmtSum = 0;
+                Rs.redUnite.map(function (item, t) {
+                    redFmtSum += item.formatCk
+                });
+                Rs.blueUnite.map(function (item, t) {
+                    blueFmtSum += item.formatCk
+                });
+                Rs.yellowUnite.map(function (item, t) {
+                    yellowFmtSum += item.formatCk
+                });
+
                 // pkVal
-                let sumMax = (parseFloat(redSum) + parseFloat(blueSum) + parseFloat(yellowSum)).toFixed(2);
-                that.pkVal = parseFloat((redSum / sumMax) * 100).toFixed(2) + '%';
-                that.yellowVal = parseFloat((yellowSum / sumMax) * 100).toFixed(2) + '%';
+                let sumMax =redFmtSum+ blueFmtSum + yellowFmtSum;
+
+                // 当为0时均分
+                if (sumMax == 0) {
+                    that.pkVal = '33.33%';
+                    that.yellowVal = '33.33%';
+                } else {
+                    // 限制最大
+                    let pkval = parseInt((redFmtSum / sumMax) * 100) > 100 ? 100 : parseInt((redFmtSum / sumMax) * 100);
+                    let yellowVal = parseInt((yellowFmtSum / sumMax) * 100) > 100 ? 100 : parseInt((yellowFmtSum / sumMax) * 100);
+                    console.log('that.pkVal:'+that.pkVal);
+                    that.pkVal = pkval.toFixed(1) + '%';
+                    that.yellowVal = yellowVal.toFixed(1) + '%';
+                }
             },
             // 获取上课学生信息
             GetgetUserList() {
@@ -489,6 +516,7 @@
                             // 1:团课/私教 todo
                             // 2:竞技课2PK
                             // 3:竞技课3PK
+                            console.log('json.dp' + json.dp);
                             switch (parseInt(json.dp)) {
                                 case 2:
                                     that.$router.push({path: '/3pkRank'});
@@ -519,6 +547,13 @@
                 } else {
                     return parseFloat(val).toFixed(1);
                 }
+            },
+            fmtInt(val) {
+                if (val == 0) {
+                    return '0'
+                } else {
+                    return parseInt(val);
+                }
             }
         },
         watch: {