diff --git a/pages/broadcastList/broadcastList.js b/pages/broadcastList/broadcastList.js index b231b92..fad4509 100644 --- a/pages/broadcastList/broadcastList.js +++ b/pages/broadcastList/broadcastList.js @@ -10,6 +10,37 @@ Page({ liveUrl: app.liveUrl, liveRecordUrl: app.liveRecordUrl, livePlanId: null, + page: 1, + rows: 20, + liveRecordList: [], + videoPath: '' + }, + getLivePlanRecordList: function () { + var self = this + app.restAjax.get(app.restAjax.path('{liveUrl}/app/liverecord/listpageliverecordrelease/' + self.data.livePlanId, [app.liveUrl]), { + page: self.data.page, + rows: self.data.rows + }, null, + function (code, data) { + if (data.rows.length > 0) { + self.setData({ + liveRecordList: data.rows + }) + } else { + wx.showToast({ + title: '暂无更多', + icon: "none", + duration: 1500 + }) + } + console.log(self.data.liveRecordList) + } + ) + }, + playVideo: function (e) { + this.setData({ + videoPath: e.currentTarget.dataset.url + }) }, /** * 生命周期函数--监听页面加载 @@ -18,7 +49,7 @@ Page({ this.setData({ livePlanId: options.livePlanId }) - // this.getLivePlanRecordList(1); + this.getLivePlanRecordList(); }, /** * 生命周期函数--监听页面初次渲染完成 @@ -52,14 +83,20 @@ Page({ * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { - this.getLivePlanRecordList(1); + this.setData({ + page: this.data.page + 1 + }) + this.getLivePlanRecordList() }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { - this.getLivePlanRecordList(this.data.currentPage + 1); + this.setData({ + page: this.data.page + 1 + }) + this.getLivePlanRecordList() }, /** diff --git a/pages/broadcastList/broadcastList.wxml b/pages/broadcastList/broadcastList.wxml index e3ed921..4a58288 100644 --- a/pages/broadcastList/broadcastList.wxml +++ b/pages/broadcastList/broadcastList.wxml @@ -1 +1,6 @@ - \ No newline at end of file + + + + + {{index+1}}.{{item.recordFileName}} + diff --git a/pages/broadcastList/broadcastList.wxss b/pages/broadcastList/broadcastList.wxss index faf0eb8..eceebcd 100644 --- a/pages/broadcastList/broadcastList.wxss +++ b/pages/broadcastList/broadcastList.wxss @@ -1,49 +1,25 @@ -.broadcast{ - width: 100%; - height: 400rpx; - background: #000000; +.video{ position: fixed; top: 0; left: 0; right: 0; -} -video{ width: 100%; - height: 400rpx; + height: 475rpx; } -.broadcast-title{ - padding: 30rpx; - font-size: 34rpx; - color: #242424; - border-bottom: 5px solid #FBFBFB; +.video video{ + width: 100%; + height: 100%; } -.broadcast-list{ - margin-top: 400rpx; +.select-list{ + margin-top: 475rpx; + padding: 0 15rpx; } -.play-button-box { - width: 200rpx; - height: 200rpx; - position: fixed; - z-index: 100; - top: 100rpx; - left: 50%; - margin-left: -100rpx; - background-color: rgba(0, 0, 0, 0.5); - border: 1rpx dotted rgba(255, 255, 255, 0.8); - border-radius: 100rpx; +.select-video{ + border-bottom: 1px solid #DEDEDE; + line-height: 80rpx; + font-size: 32rpx; + color: #000; } -.play-button-box .play-button { - border-top-width: 60rpx; - border-bottom-width: 60rpx; - border-left-width: 100rpx; - border-style: solid; - border-top-color: transparent; - border-left-color: red; - border-bottom-color: transparent; - border-right-color: transparent; - width: 0; - height: 0; - position: absolute; - top: 40rpx; - left: 60rpx; +.select-video.active{ + color: #9F1512; } \ No newline at end of file diff --git a/pages/center/center.js b/pages/center/center.js index 7f21892..a9550a2 100644 --- a/pages/center/center.js +++ b/pages/center/center.js @@ -6,18 +6,18 @@ Page({ * 页面的初始数据 */ data: { + randomName: true, + showPhone: true, + gotCode: false, + restTime: 120, + timer: '', userAvatar: '', token: '', userInfo: {}, usercenterUrl: app.usercenterUrl, sourcePath: '/route/file/downloadfile/true/', - randomName: '', - showPhone: true, phone: '', - code: '', - gotCode: false, - restTime: 120, - timer: '' + code: '' }, // 选择头像来源 changeAvatar: function () { @@ -152,10 +152,138 @@ Page({ url: '../order/order', }) }, + // 获取输入的手机号 + phoneNum: function (res) { + this.setData({ + phone: res.detail.value + }) + }, + // 校验手机号 + testPhone: function () { + var self = this + if (self.data.phone) { + if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.data.phone)) { + wx.showToast({ + title: '请输入正确的手机号', + icon: 'none', + duration: 1500 + }) + } else { + self.getCode() + } + } else { + wx.showToast({ + title: '手机号不能为空', + icon: 'none', + duration: 1500 + }) + } + }, + // 获取验证码 + getCode: function () { + var self = this; + self.setData({ + gotCode: true + }) + self.data.timer = setInterval(function () { + var cur = self.data.restTime - 1 + if (cur == 0) { + clearInterval(self.data.timer) + self.setData({ + restTime: 120, + gotCode: false + }) + } else { + self.setData({ + restTime: cur + }) + } + }, 1000) + app.restAjax.get(app.restAjax.path('{usercenterUrl}/api/sms/getverificationcode/' + self.data.phone, [app.usercenterUrl]), {}, null, + function (code, data) {}, + function (code, data) { + wx.showToast({ + title: data.msg, + icon: 'none', + duration: 1500 + }) + }) + }, + // 提交绑定手机 + submitPhone: function () { + var self = this; + self.setData({ + isConfirm: true + }) + app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/user/updateminiappdefaultusername', [app.usercenterUrl]), { + phone: self.data.phone, + verificationCode: self.data.code + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + wx.setStorageSync('token', data.data); + wx.setStorageSync('isRandomUsername', 0) + clearInterval(self.data.timer) + self.setData({ + showPhone: false + }) + wx.showTabBar(); + self.getUserInfo() + }, function (code, data) { + app.dialog.msg(data.msg); + self.setData({ + isConfirm: false + }) + }) + }, + // 验证码 + inputCode: function (e) { + this.setData({ + code: e.detail.value + }) + }, + // 判断用户是否为随机名称 + isRandomName: function () { + var self = this + wx.getStorage({ + key: 'isRandomUsername', + success: function (res) { + if (res.data == 1) { + wx.hideTabBar() + self.setData({ + randomName: true + }) + } else { + wx.hideTabBar() + self.setData({ + randomName: false + }) + } + } + }) + }, + // 获取用户信息 + getUserInfo: function () { + var self = this + app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/user/getappuser', [app.usercenterUrl]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + userInfo: data + }) + }, function (code, data) { + app.dialog.msg(data.msg); + }) + }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { + this.isRandomName(); this.getToken() }, diff --git a/pages/index/index.wxml b/pages/index/index.wxml index f88358a..5dc676c 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -134,7 +134,7 @@ - + \ No newline at end of file