提交 72e0bdb3 authored 作者: lihuihui's avatar lihuihui

Merge branch 'master' into study-kelley

# Conflicts: # learnOnline/utils/util.js
# Windows
[Dd]esktop.ini
Thumbs.db
$RECYCLE.BIN/
# macOS
.DS_Store
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
# Node.js
node_modules/
...@@ -89,6 +89,7 @@ const getCourseDetail = (id, sid, callback) => { ...@@ -89,6 +89,7 @@ const getCourseDetail = (id, sid, callback) => {
/* 课程内容 */ /* 课程内容 */
json.tabs1ChapterList = { json.tabs1ChapterList = {
currentChapterId: cur.latest_play || '', currentChapterId: cur.latest_play || '',
videoType: cur.latest_play_type || '',
course: cur.chapters.map(function (_, i) { course: cur.chapters.map(function (_, i) {
return { return {
title: _.name, title: _.name,
......
...@@ -4,6 +4,7 @@ const app = getApp() ...@@ -4,6 +4,7 @@ const app = getApp()
const util = require('../../utils/util.js') const util = require('../../utils/util.js')
const BindPhone = require('./bindPhone/bindPhone.js') const BindPhone = require('./bindPhone/bindPhone.js')
const BindAccount = require('./bindAccount/bindAccount.js') const BindAccount = require('./bindAccount/bindAccount.js')
const md5 = require('../../utils/md5.js')
Page({ Page({
data: { data: {
...@@ -74,16 +75,70 @@ Page({ ...@@ -74,16 +75,70 @@ Page({
}) })
}, },
guestLogin: function () { guestLogin: function () {
wx.showModal({ this.accountConfirms();
title: '提示', content: '本账户只适用于“体验学习”,正式学习请点击“登录”按钮', // return;
success: (res) => { // wx.showModal({
if (res.confirm) { // title: '提示', content: '本账户只适用于“体验学习”,正式学习请点击“登录”按钮',
wx.setStorageSync('userInfo', { "avatarUrl": "https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJv5HunMDDhpdaTz7aVXniaeOUxyQxwa9clFnJCm7Y8eP8gbUkF7I9NHSXSDJ1KssdYw9vAKb0v8fQ/132", "nickName": "游客账号" }); // success: (res) => {
wx.setStorageSync('userSession', { "sessionKey": "" }); // if (res.confirm) {
this.goOutSite(); // wx.setStorageSync('userInfo', { "avatarUrl": "https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJv5HunMDDhpdaTz7aVXniaeOUxyQxwa9clFnJCm7Y8eP8gbUkF7I9NHSXSDJ1KssdYw9vAKb0v8fQ/132", "nickName": "游客账号" });
// wx.setStorageSync('userSession', { "sessionKey": "" });
// this.goOutSite();
// }
// }
// });
},
//游客登录
accountConfirms: function (e) {
const _that = this;
/* 调用接口 - 使用账号登录 */
wx.request({
url: util.config.URL_PATH2 + '/user_center/login',
data: {
login_name:'18519690645@163.com',
password: md5('uokoaduw' + '123456'.split('').reverse().join('') + 'auhgniq'),
service: 'applet.ezijing.com'
}, method: 'POST', header: {
'tenant': util.config.tenant,
'content-type': 'application/x-www-form-urlencoded',
'version': util.config.version,
'apikey': 'pP5ECUqRDLDzuh4qRuJro0L1LPgjLP0N'
},
success: function (res) {
if (res.statusCode && res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return; }
wx.hideToast();
wx.setStorageSync('userSession', { sessionKey: res.data.ticket });
let _token = wx.getStorageSync('userSession').sessionKey
if (!_token) {
wx.reLaunch({ url: '/pages/index/index' })
return;
} }
} /* 获取用户信息 */
}); wx.request({
url: util.config.URL_PATH1 + '/user/check-access',
data: {}, method: 'GET', header: {
token: _token,
tenant: util.config.tenant,
'apikey': 'pP5ECUqRDLDzuh4qRuJro0L1LPgjLP0N',
'version': util.config.version,
unionid: wx.getStorageSync('union_id')
},
success: res => {
if (res.statusCode != 200 && res.statusCode != 401) { wx.showToast({ title: res.data.message, icon: 'none' }); return; }
let _userInfo = {
avatarUrl: res.data.avatar || '无',
nickName: res.data.nickname || '游客登录'
}
wx.setStorageSync('userInfo', _userInfo);
_that.setData({ userInfo: _userInfo, hasUserInfo: true })
_that.popupClose()
_that.goOutSite()
}
})
},
fail: function (res) { wx.hideToast(); wx.showToast({ title: res, icon: 'none' }); }
})
}, },
/* 手机号绑定 方法 */ /* 手机号绑定 方法 */
accountLogin: BindPhone.BindPhone.accountLogin, accountLogin: BindPhone.BindPhone.accountLogin,
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<image class='logo' src='./icons/hd-logo.png' mode='aspectFit'></image> <image class='logo' src='./icons/hd-logo.png' mode='aspectFit'></image>
<view class='text'>在线学习系统</view> <view class='text'>在线学习系统</view>
<button class='btn' open-type='getUserInfo' bindgetuserinfo='getUserInfo'>登录</button> <button class='btn' open-type='getUserInfo' bindgetuserinfo='getUserInfo'>登录</button>
<!-- <view class='test-id' bindtap='guestLogin'>游客登录</view> --> <view wx-if='{{isUseAccountLogin}}' class='test-id' bindtap='guestLogin'>游客登录</view>
<view class='userinfo'> <view class='userinfo'>
<!-- wx:if='{{!hasUserInfo && canIUse}}' --> <!-- wx:if='{{!hasUserInfo && canIUse}}' -->
<!-- <block wx:else> <!-- <block wx:else>
......
...@@ -212,9 +212,9 @@ Page({ ...@@ -212,9 +212,9 @@ Page({
*/ */
startLearn: function (e) { startLearn: function (e) {
let _data = e.target.dataset let _data = e.target.dataset
let cid = _data.cid, sid = _data.sid, vid = _data.vid let cid = _data.cid, sid = _data.sid, vid = _data.vid,video_type = _data.type;
wx.navigateTo({ wx.navigateTo({
url: '/pages/videoPlayer/show' + '?cid=' + cid + '&sid=' + sid + '&vid=' + vid url: '/pages/videoPlayer/show' + '?cid=' + cid + '&sid=' + sid + '&vid=' + vid + '&type=' + video_type
}) })
}, },
/** /**
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
<view class='tabs-item'>{{item1}}</view> <view class='tabs-item'>{{item1}}</view>
</block> </block>
<block wx:if='{{headerInfo.isStart && tabs[1].chapterList.currentChapterId}}'> <block wx:if='{{headerInfo.isStart && tabs[1].chapterList.currentChapterId}}'>
<view class='btn' bindtap='startLearn' data-cid='{{headerInfo.id}}' data-sid='{{headerInfo.sid}}' data-vid='{{tabs[1].chapterList.currentChapterId}}'>继续学习</view> <view class='btn' bindtap='startLearn' data-cid='{{headerInfo.id}}' data-sid='{{headerInfo.sid}}' data-vid='{{tabs[1].chapterList.currentChapterId}}' data-type='{{tabs[1].chapterList.videoType}}'>继续学习</view>
</block> </block>
<block wx:elif='{{headerInfo.isStart}}'> <block wx:elif='{{headerInfo.isStart}}'>
<view class='btn' bindtap='startLearn' data-cid='{{headerInfo.id}}' data-sid='{{headerInfo.sid}}' data-vid='{{tabs[1].chapterList.course[0].chapters[0].vid}}'>开始学习</view> <view class='btn' bindtap='startLearn' data-cid='{{headerInfo.id}}' data-sid='{{headerInfo.sid}}' data-vid='{{tabs[1].chapterList.course[0].chapters[0].vid}}' data-type='{{tabs[1].chapterList.course[0].chapters[0].videoType}}'>开始学习</view>
</block> </block>
<block wx:else> <block wx:else>
<view class='btn' bindtap='wantThisCourse' data-cid='{{headerInfo.id}}' data-sid='{{headerInfo.sid}}'>选课</view> <view class='btn' bindtap='wantThisCourse' data-cid='{{headerInfo.id}}' data-sid='{{headerInfo.sid}}'>选课</view>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</view> </view>
<view class='main-btns'> <view class='main-btns'>
<view class='btn-back'> <view class='btn-back'>
<image class='img' src='./controlBar/icons/btn-back.png' mode='scaleToFill' data-id='{{chapterList.prevVideo.id}}' data-hasVA='{{chapterList.prevVideo.time}}' data-name='{{chapterList.prevVideo.name}}' bindtap='prevChapter'></image> <image class='img' src='./controlBar/icons/btn-back.png' mode='scaleToFill' data-id='{{chapterList.prevVideo.id}}' data-hasVA='{{chapterList.prevVideo.time}}' data-name='{{chapterList.prevVideo.name}}' bindtap='prevChapter' data-type='{{chapterList.nextVideo.videoType}}' ></image>
</view> </view>
<view class='opt'> <view class='opt'>
<image class='img init-page {{initVAFlag ? "" : "none"}}' src='./controlBar/icons/loading_small.gif' mode='aspectFit'></image> <image class='img init-page {{initVAFlag ? "" : "none"}}' src='./controlBar/icons/loading_small.gif' mode='aspectFit'></image>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<image class='img pause {{initVAFlag ? "none" : ""}} {{!ctrlBar.isPlay ? "none" : ""}}' src='./controlBar/icons/btn-pause.png' mode='scaleToFill' bindtap='pauseVA'></image> <image class='img pause {{initVAFlag ? "none" : ""}} {{!ctrlBar.isPlay ? "none" : ""}}' src='./controlBar/icons/btn-pause.png' mode='scaleToFill' bindtap='pauseVA'></image>
</view> </view>
<view class='btn-front'> <view class='btn-front'>
<image class='img' src='./controlBar/icons/btn-front.png' mode='scaleToFill' data-id='{{chapterList.nextVideo.id}}' data-hasVA='{{chapterList.nextVideo.time}}' data-name='{{chapterList.nextVideo.name}}' bindtap='nextChapter'></image> <image class='img' src='./controlBar/icons/btn-front.png' mode='scaleToFill' data-id='{{chapterList.nextVideo.id}}' data-hasVA='{{chapterList.nextVideo.time}}' data-name='{{chapterList.nextVideo.name}}' data-type='{{chapterList.nextVideo.videoType}}' bindtap='nextChapter'></image>
</view> </view>
</view> </view>
<view class='right-btn' bindtap='openSetContent'> <view class='right-btn' bindtap='openSetContent'>
......
...@@ -12,15 +12,20 @@ const url_test = { ...@@ -12,15 +12,20 @@ const url_test = {
outSiteLink: 'https://e-learning.ezijing.com', // 正式外链 outSiteLink: 'https://e-learning.ezijing.com', // 正式外链
tenant: 'kelley', tenant: 'kelley',
tenant: 'sofia', tenant: 'sofia',
version: '3.1.2' version: '3.1.3'
}; };
const url_online = { const url_online = {
URL_PATH: 'https://api.ezijing.com/tenant', // 正式域名 - 由于项目变动域名 URL_PATH: 'https://api.ezijing.com/tenant', // 正式域名 - 由于项目变动域名
URL_PATH1: 'https://lms-api.ezijing.com', // 正式域名 - 由于项目变动域名 URL_PATH1: 'https://lms-api.ezijing.com', // 正式域名 - 由于项目变动域名
URL_PATH2: 'https://sso.ezijing.com', // 正式域名 - 由于项目变动域名 URL_PATH2: 'https://sso.ezijing.com', // 正式域名 - 由于项目变动域名
outSiteLink: 'https://e-learning.ezijing.com', // 正式外链 outSiteLink: 'https://e-learning.ezijing.com', // 正式外链
<<<<<<< HEAD
tenant: 'kelley', tenant: 'kelley',
version: '3.1.2' version: '3.1.2'
=======
tenant: 'sofia',
version: '3.1.3'
>>>>>>> master
} }
let config = url_online; let config = url_online;
/* 请求接口统一 重定义 */ /* 请求接口统一 重定义 */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论