第4篇scrum冲刺(5.24)

一、站立会议

  1、照片

 

 

  2、工作安排

成员 昨天已完成的工作 今天的工作安排 困难
陈芝敏  完成云开发配置,初始化数据库;  线下模块(还剩下获取词的数据库) 倒计时模块的初加载还是有点慢 
冯晓凤  研究无限模式跟积分模式的逻辑安排。   查资料,学习房间里面的逻辑  还是不懂
江晓琦  邀请好友,转移房主  观看学习了laya教程 上手慢 
高子茵  绘画小程序的头像  研究了别人的小程序头像 没啥灵感,考虑要不要画一只什么小东西 

 

二、燃尽图

 

 

三、签入记录

 

 

四、项目程序

  1.代码

//import GlobalData from 'GlobalData'
// import GlobalweChat from 'GlobalweChat'

window.G = {
    userInfo: null,
};

window.WeChat = {}
WeChat.onRegisterUser = function (_userInfo) {
    wx.cloud.callFunction({
        //云函数的名字
        name: "login",
        //传入的参数
        data: {
            userInfo: _userInfo,
        },
        success(res) {
            console.log("登录成功回调", res);
            //res.result.event.length 长度未知

            wx.cloud.init();
            const db = wx.cloud.database();
            // console.log(db);
            //如果现在的appid跟以存入的appid一样,就不添加
            // db.collection('user_info').get()
            // if(res.userInfo.appId = )

            db.collection('user_info').add({
                data: res.result.event.userInfo,
            }).then(res => {
                console.log(res);
            })

            G.userInfo = res.result.event.userInfo;
            console.log("G.userInfo", G.userInfo);
            //Laya.Scene.open("GameScene");
        },
        fail: console.error()
    });
};


export default class login extends Laya.Scene {
    constructor() {
        super();
    }
    onEnable() {
        this.login();
    };
    login() {
        var wx = Laya.Browser.window.wx;
        wx.getSetting({
            success(res) {
                if (!res.authSetting['scope.userInfo']) {
                    wx.authorize({
                        scope: 'scope.userInfo',
                        success() {
                            //已开启授权
                            // wx.startRecord();
                            WeChat.onRegisterUser(res.userInfo);
                            console.log("已开启授权!");
                        }
                    })
                }
            }
        })
        wx.checkSession({
            success(res) {
                //session_key 未过期,并且在本生命周期一直有效
                WeChat.onRegisterUser(res.userInfo);
                console.log('登录状态还在呢!');
            },
            fail() {
                // session_key 已经失效,需要重新执行登录流程
                wx.login() //重新登录
            }
        })
    }
}
export default class offline extends Laya.Scene {
    constructor() {
        super();
    }
    onEnable() {
        // this.login();
        // this.changeWord();
        this.countdown();
        this.next();
        // this.over();
    }
    //登录
    /*   login() {
         var wx = Laya.Browser.window.wx;
         wx.getSetting({
             success(res) {
                 if (!res.authSetting['scope.userInfo']) {
                     wx.authorize({
                         scope: 'scope.userInfo',
                         success() {
                             //已开启授权
                             // wx.startRecord();
                             console.log("已开启授权!");
                         }
                     })
                 }
             }
         })
         wx.checkSession({
             success() {
                 //session_key 未过期,并且在本生命周期一直有效
                 console.log('登录状态还在呢!');
             },
             fail() {
                 // session_key 已经失效,需要重新执行登录流程
                 wx.login() //重新登录
             }
         })
     }  */

    // 改词
    changeWord(e) {
        this.label_words.text = e;
    }

    // 倒计时
    countdown() {
        /* var second = 2;
        var minute = 00;
        this.label_timeOut.text = second + " : " + minute;
        console.log(this.label_timeOut.text);
        var count = setInterval(()=>{
            minute--;
            this.label_timeOut.text = second + " : " + minute;
        }, 1000); */
        console.log("倒计时开始");
        var count;
        var nowTime;
        var inputTime;
        var times;
        var m;
        var s;
        // var countTime;
        // clearInterval(countTime);
        // clearInterval(count);
        /* countTime = setInterval(() => {
            console.log("下一个循环");

            clearInterval(countTime);
            // clearInterval(count);

            nowTime = +new Date(); // 返回当前时间的总毫秒数
            inputTime = +new Date(nowTime + 120000);
            times = (inputTime - nowTime) / 1000; // 剩余时间的总秒数
            count = setInterval(() => {
                clearInterval(count);
                nowTime = +new Date();
                times = (inputTime - nowTime) / 1000;
                m = parseInt(times / 60 % 60); // 分
                m = m < 10 ? '0' + m : m;
                s = parseInt(times % 60); // 秒
                s = s < 10 ? '0' + s : s;
                console.log(m + " : " + s);
                this.label_timeOut.text = m + " : " + s;
            }, 1000);

            
            // 在这里添加事件
            this.changeWord("abd");
        }, 120000); */
        function getTimeout() {
            console.log("getTimeout函数");

            nowTime = +new Date(); // 返回当前时间的总毫秒数
            inputTime = +new Date(nowTime + 120000);
            times = (inputTime - nowTime) / 1000; // 剩余时间的总秒数
        }

        function timeDown() {
            console.log("timeDown函数");
            nowTime = +new Date(); // 返回当前时间的总毫秒数
            times = (inputTime - nowTime) / 1000; // 剩余时间的总秒数
            m = parseInt(times / 60 % 60); //
            m = m < 10 ? '0' + m : m;
            s = parseInt(times % 60); //
            s = s < 10 ? '0' + s : s;
            console.log(m + " : " + s);
            this.label_timeOut.text = m + " : " + s;
            reTimeout();
        }

        function reTimeout() {
            console.log("reTimeout函数");
            count = setTimeout(() => {
                timeDown();
            }, 1000);
            if (m <= 0 || s <= 0) {
                clearTimeout(count);
                getTimeout();
                timeDown();
            }
        }

        /* t = setTimeout(function () {
            timeDown();
        }, 1000);
        if (num <= 0) {
            clearTimeout(t);
            getTimeout();
        } */
        /* setTimeout(() => {
            console.log("清除interval");
            // clearInterval(countTime);
            // clearInterval(count);
        }, 10000); */
    }

    // 下一个词
    next() {
        this.btn_next.on(Laya.Event.MOUSE_UP, this, () => {
            console.log(this.btn_next);
            this.changeWord("阿迪斯");
            this.countdown();
        });
    }

    /* // 结束游戏
    over() {
        this.btn_over.on(Laya.Event.MOUSE_UP, this, () => {
            console.log("结束游戏!");
            clearTimeout(count);
            Laya.Scene.open("Main.scene");
        })
    } */
}

五、每日总结

成员 每日总结
陈芝敏  明天就来研究云开发到底是怎么搞的
冯晓凤 继续努力
江晓琦  继续加油
高子茵  再多看别人的小程序头像,从模仿获得灵感
posted @ 2020-05-24 21:31  室友天天吃宵夜  阅读(166)  评论(0编辑  收藏  举报