提交 32fd2525 authored 作者: hexi's avatar hexi

修复安卓数据上报

...@@ -3,3 +3,4 @@ ...@@ -3,3 +3,4 @@
config.js config.js
node_modules node_modules
npm-debug.log npm-debug.log
.idea/
#### 3.0.8.2019.07.22
1、修复安卓手机数据上报问题
#### 3.0.7.2019.07.17
1、用户手机号没有绑定微信,后端返回401,弹出提示框
#### 3.0.6.2019.07.16 #### 3.0.6.2019.07.16
1、upload-video 接口在 data 中增加vid传递 1、upload-video 接口在 data 中增加vid传递
#### 3.0.6.2019.07.15 #### 3.0.6.2019.07.15
......
...@@ -13,8 +13,7 @@ const BindAccount = { ...@@ -13,8 +13,7 @@ const BindAccount = {
/* 点击确定 */ /* 点击确定 */
accountConfirm: function (e) { accountConfirm: function (e) {
const _that = this, _bind = _that.data.bindaccount const _that = this, _bind = _that.data.bindaccount;
/* 调用接口 - 使用账号登录 */ /* 调用接口 - 使用账号登录 */
wx.request({ wx.request({
url: util.config.URL_PATH2 + '/user_center/login', url: util.config.URL_PATH2 + '/user_center/login',
...@@ -24,11 +23,12 @@ const BindAccount = { ...@@ -24,11 +23,12 @@ const BindAccount = {
service: 'applet.ezijing.com' }, method: 'POST', header: { service: 'applet.ezijing.com' }, method: 'POST', header: {
'tenant': util.config.tenant, 'tenant': util.config.tenant,
'content-type': 'application/x-www-form-urlencoded', 'content-type': 'application/x-www-form-urlencoded',
'version':util.config.version,
'apikey': 'kZjHzONjsfkJZPvHwVHMTXvmjZ9D30pS' 'apikey': 'kZjHzONjsfkJZPvHwVHMTXvmjZ9D30pS'
}, },
success: function (res) { success: function (res) {
if (res.statusCode && res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return; } if (res.statusCode && res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return; }
wx.hideToast() wx.hideToast();
wx.setStorageSync('userSession', { sessionKey: res.data.ticket }); wx.setStorageSync('userSession', { sessionKey: res.data.ticket });
let _token = wx.getStorageSync('userSession').sessionKey let _token = wx.getStorageSync('userSession').sessionKey
...@@ -43,10 +43,26 @@ const BindAccount = { ...@@ -43,10 +43,26 @@ const BindAccount = {
token: _token, token: _token,
tenant: util.config.tenant, tenant: util.config.tenant,
'apikey': 'kZjHzONjsfkJZPvHwVHMTXvmjZ9D30pS', 'apikey': 'kZjHzONjsfkJZPvHwVHMTXvmjZ9D30pS',
'version':util.config.version,
unionid: wx.getStorageSync('union_id') unionid: wx.getStorageSync('union_id')
}, },
success: res => { success: res => {
if (res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return; } if (res.statusCode != 200 && res.statusCode != 401) { wx.showToast({ title: res.data.message, icon: 'none' }); return; }
if (res.statusCode && res.statusCode == 401) {
// 401特殊处理,这种情况,理解为手机号绑定错误
wx.hideToast();
wx.showModal({
title: '提示',
content: res.data.message,
showCancel:false,
complete (res) {
_that.setData({
'bindaccount.pwd': '',
});
}
})
return ;
}
let _userInfo = { let _userInfo = {
avatarUrl: res.data.avatar || _that.tempUserInfo.avatarUrl || '无', avatarUrl: res.data.avatar || _that.tempUserInfo.avatarUrl || '无',
nickName: res.data.nickname || _that.tempUserInfo.nickName || '无' nickName: res.data.nickname || _that.tempUserInfo.nickName || '无'
......
...@@ -46,7 +46,7 @@ const BindPhone = { ...@@ -46,7 +46,7 @@ const BindPhone = {
}, },
/* 点击确定 */ /* 点击确定 */
codeConfirm: function (e) { codeConfirm: function (e) {
const _that = this, _bind = _that.data.bindphone const _that = this, _bind = _that.data.bindphone;
if (!_bind.phone || !/^1[3-9][0-9]{9}$/.test(_bind.phone)) { wx.showToast({ title: '请填入正确手机号', icon: 'none' }); return ; } if (!_bind.phone || !/^1[3-9][0-9]{9}$/.test(_bind.phone)) { wx.showToast({ title: '请填入正确手机号', icon: 'none' }); return ; }
if (!_bind.code || !/^\d{4}$/.test(_bind.code)) { wx.showToast({ title: '请填入正确验证码', icon: 'none' }); return ; } if (!_bind.code || !/^\d{4}$/.test(_bind.code)) { wx.showToast({ title: '请填入正确验证码', icon: 'none' }); return ; }
wx.showToast({ title: '验证中', icon: 'none' }) wx.showToast({ title: '验证中', icon: 'none' })
...@@ -56,11 +56,12 @@ const BindPhone = { ...@@ -56,11 +56,12 @@ const BindPhone = {
data: { mobile: _bind.phone, code: _bind.code, service: 'applet.ezijing.com' }, method: 'POST', header: { data: { mobile: _bind.phone, code: _bind.code, service: 'applet.ezijing.com' }, method: 'POST', header: {
'tenant': util.config.tenant, 'tenant': util.config.tenant,
'content-type': 'application/x-www-form-urlencoded', 'content-type': 'application/x-www-form-urlencoded',
'version':util.config.version,
'apikey': 'kZjHzONjsfkJZPvHwVHMTXvmjZ9D30pS' 'apikey': 'kZjHzONjsfkJZPvHwVHMTXvmjZ9D30pS'
}, },
success: function (res) { success: function (res) {
if (res.statusCode && res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return ; } if (res.statusCode && res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return ; }
wx.hideToast() wx.hideToast();
clearInterval(_that.timer); clearInterval(_that.timer);
wx.setStorageSync('userSession', { sessionKey: res.data.ticket }); wx.setStorageSync('userSession', { sessionKey: res.data.ticket });
...@@ -76,10 +77,26 @@ const BindPhone = { ...@@ -76,10 +77,26 @@ const BindPhone = {
token: _token, token: _token,
'tenant': util.config.tenant, 'tenant': util.config.tenant,
'apikey': 'kZjHzONjsfkJZPvHwVHMTXvmjZ9D30pS', 'apikey': 'kZjHzONjsfkJZPvHwVHMTXvmjZ9D30pS',
'version': util.config.version,
unionid: wx.getStorageSync('union_id') unionid: wx.getStorageSync('union_id')
}, },
success: res => { success: res => {
if (res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return; } if (res.statusCode != 200 && res.statusCode != 401) { wx.showToast({ title: res.data.message, icon: 'none' }); return; }
if (res.statusCode && res.statusCode == 401) {
// 401特殊处理,这种情况,理解为手机号绑定错误
wx.hideToast();
wx.showModal({
title: '提示',
content: res.data.message,
showCancel:false,
complete (res) {
_that.setData({
'bindphone.code': '',
});
}
})
return ;
}
let _userInfo = { let _userInfo = {
avatarUrl: res.data.avatar || _that.tempUserInfo.avatarUrl || '无', avatarUrl: res.data.avatar || _that.tempUserInfo.avatarUrl || '无',
nickName: res.data.nickname || _that.tempUserInfo.nickName || '无' nickName: res.data.nickname || _that.tempUserInfo.nickName || '无'
......
...@@ -301,8 +301,8 @@ Page({ ...@@ -301,8 +301,8 @@ Page({
playVA: function () { playVA: function () {
let _data = this.data, _status = _data.status let _data = this.data, _status = _data.status
this.setData({ 'ctrlBar.isPlay': true }) this.setData({ 'ctrlBar.isPlay': true })
_status.isVideo && this._video.play() _status.isVideo && this._video.play();
_status.isAudio && this._audio.play() _status.isAudio && this._audio.play();
this.setHeartbeat() this.setHeartbeat()
}, },
/* controlBar页面 - 暂停音视频 - bindTap事件和内部调用 */ /* controlBar页面 - 暂停音视频 - bindTap事件和内部调用 */
...@@ -335,7 +335,10 @@ Page({ ...@@ -335,7 +335,10 @@ Page({
beginAndOutFullScreen: function (e) {}, beginAndOutFullScreen: function (e) {},
/* VideoOrAudio标签 - 开始/继续播放时触发play事件时,触发 - bindplay事件 */ /* VideoOrAudio标签 - 开始/继续播放时触发play事件时,触发 - bindplay事件 */
beginPlayVA: function () { beginPlayVA: function () {
if(this.data.initVAFlag){
this.setData({ 'initVAFlag': false }) this.setData({ 'initVAFlag': false })
this.setHeartbeat() //安卓手机播放之后才会上送进度
}
/* iphone6 8.4.1 首次初始化时,不能直接 设置进度并播放 */ /* iphone6 8.4.1 首次初始化时,不能直接 设置进度并播放 */
if (this.isFirstInitAndSwitchVideo) { if (this.isFirstInitAndSwitchVideo) {
if (!this._cache) this._cache = wx.getStorageSync('videoCacheCtrlBar') || {} if (!this._cache) this._cache = wx.getStorageSync('videoCacheCtrlBar') || {}
...@@ -381,8 +384,14 @@ Page({ ...@@ -381,8 +384,14 @@ Page({
let arr = _data.ctrlBar.currentTime.split(':'), tempTime = parseInt(arr[0] * 60) + parseInt(arr[1]); let arr = _data.ctrlBar.currentTime.split(':'), tempTime = parseInt(arr[0] * 60) + parseInt(arr[1]);
this.setData({ 'ctrlBar.initial_time': tempTime }) this.setData({ 'ctrlBar.initial_time': tempTime })
/* 这里改成异步的,试一下 */ /* 这里改成异步的,试一下 */
wx.setStorage('videoCacheCtrlBar', _data.ctrlBar) wx.setStorage({
wx.setStorage('audioCacheCtrlBar', _data.ctrlBar) 'key': 'videoCacheCtrlBar',
'data': _data.ctrlBar
})
wx.setStorage({
'key': 'audioCacheCtrlBar',
'data': _data.ctrlBar
})
/* 由于 音视频相同,所以 设置方式设置成一致就可以了 */ /* 由于 音视频相同,所以 设置方式设置成一致就可以了 */
/* 提交进度请求, 进度进行中,才计算上进度时间 */ /* 提交进度请求, 进度进行中,才计算上进度时间 */
if (this.realTimeProgress && tempTime != this.realTimeProgress.cpt) { if (this.realTimeProgress && tempTime != this.realTimeProgress.cpt) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论