Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online
Commits
77d360d4
提交
77d360d4
authored
8月 20, 2019
作者:
hexi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加数据埋点
上级
5bfac678
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
41 行增加
和
5 行删除
+41
-5
courseContent.js
learnOnline/pages/learnSystem/courseContent/courseContent.js
+8
-0
courseList.wxml
...ages/learnSystem/courseContent/courseList/courseList.wxml
+6
-4
courseList.wxss
...ages/learnSystem/courseContent/courseList/courseList.wxss
+1
-1
util.js
learnOnline/utils/util.js
+26
-0
没有找到文件。
learnOnline/pages/learnSystem/courseContent/courseContent.js
浏览文件 @
77d360d4
// pages/learnSystem/courseContent/courseContent.js
const
CourseApi
=
require
(
'../../../apiService/CourseApi.js'
)
const
util
=
require
(
'../../../utils/util.js'
)
Page
({
/**
...
...
@@ -277,5 +278,11 @@ Page({
/* 跳转 */
wx
.
showToast
({
title
:
'请上PC使用该功能'
,
icon
:
'none'
})
}
},
// 发送formid
formSubmit
:
function
(
e
)
{
util
.
sendformid
(
e
.
detail
.
formId
);
console
.
log
(
'form发生了submit事件,携带数据为:'
,
e
.
detail
.
formId
)
}
})
\ No newline at end of file
learnOnline/pages/learnSystem/courseContent/courseList/courseList.wxml
浏览文件 @
77d360d4
...
...
@@ -2,10 +2,12 @@
<view class='course-list'>
<block wx:for='{{item.chapterList.course}}' wx:key='{{index}}' wx:for-item='_item'>
<view class='content-group {{!_item.chapters.length ? "no-child" : ""}} {{_item.isUp ? "up" : ""}}'>
<view class='title' bindtap='clickJumpOrStatus' data-index='{{index}}' data-status='{{!!_item.chapters.length}}'>{{_item.title}}
<image class='side' style='{{!_item.chapters.length ? "display: none;" : ""}} {{_item.isUp ? "display: none;" : ""}}' mode='aspectFill' src='../icons/courseContent/up.png'></image>
<image class='side' style='{{!_item.chapters.length ? "display: none;" : ""}} {{_item.isUp ? "" : "display: none;"}}' mode='aspectFill' src='../icons/courseContent/down.png'></image>
</view>
<form report-submit='true' bindsubmit="formSubmit" >
<button form-type="submit" class='title' bindtap='clickJumpOrStatus' data-index='{{index}}' data-status='{{!!_item.chapters.length}}'>{{_item.title}}
<image class='side' style='{{!_item.chapters.length ? "display: none;" : ""}} {{_item.isUp ? "display: none;" : ""}}' mode='aspectFill' src='../icons/courseContent/up.png'></image>
<image class='side' style='{{!_item.chapters.length ? "display: none;" : ""}} {{_item.isUp ? "" : "display: none;"}}' mode='aspectFill' src='../icons/courseContent/down.png'></image>
</button>
</form>
<block wx:for='{{_item.chapters}}' wx:key='{{index1}}' wx:for-item='item1' wx:for-index='index1'>
<view class='body {{item1.id === item.chapterList.currentChapterId && "on"}}'>
<view class='name' data-vid='{{item1.vid}}' data-cid='{{item1.cid}}' data-sid='{{item1.sid}}' data-hasVA='{{item1.time}}' data-name='{{item1.name}}' bindtap='jumpToOtherVA' data-index='{{index}}' data-index1='{{index1}}' data-type='{{item1.videoType}}'>
...
...
learnOnline/pages/learnSystem/courseContent/courseList/courseList.wxss
浏览文件 @
77d360d4
...
...
@@ -3,7 +3,7 @@
.course-list .content-group.no-child { margin-bottom: 20rpx; }
.course-list .content-group.up { margin-bottom: 20rpx; }
.course-list .content-group.up .body { display: none; }
.course-list .content-group .title { position: relative; padding: 20rpx 54rpx 20rpx 24rpx; color: #313131; font-size: 30rpx; line-height: 40rpx; background: #e5e5e5; }
.course-list .content-group .title { position: relative; padding: 20rpx 54rpx 20rpx 24rpx; color: #313131; font-size: 30rpx; line-height: 40rpx; background: #e5e5e5;
text-align: left;
}
.course-list .content-group .title .side { position: absolute; top: 32rpx; right: 24rpx; width: 30rpx; height: 17rpx; }
.course-list .content-group .body { position: relative; padding: 0 24rpx; font-size: 30rpx; line-height: 42rpx; color: #505050; }
.course-list .content-group .body.on .name { color: #b2183e; }
...
...
learnOnline/utils/util.js
浏览文件 @
77d360d4
...
...
@@ -133,6 +133,7 @@ const loginApi = (obj, callback) => {
success
:
res
=>
{
if
(
res
.
statusCode
==
200
)
{
wx
.
setStorageSync
(
'union_id'
,
res
.
data
.
union_id
);
wx
.
setStorageSync
(
'openId'
,
res
.
data
.
open_id
);
wx
.
request
({
url
:
config
.
URL_PATH2
+
'/user_center/wechat_login'
,
data
:
{
wechat_unionid
:
res
.
data
.
union_id
,
service
:
'applet.ezijing.com'
},
method
:
'POST'
,
header
:
{
...
...
@@ -205,6 +206,30 @@ const LoginAgainAndJumpPage = (callback) => {
miniGetInfo
((
res
,
obj
)
=>
{
callback
(
res
,
obj
);
})
};
// 上报formid
const
sendformid
=
(
formId
)
=>
{
let
_token
=
wx
.
getStorageSync
(
'userSession'
).
sessionKey
;
if
(
!
_token
)
{
wx
.
reLaunch
({
url
:
'/pages/index/index'
})
return
;
}
wx
.
request
({
url
:
config
.
URL_PATH1
+
'/v2/education/formid'
,
data
:{
openid
:
wx
.
getStorageSync
(
'openId'
),
formid
:
formId
},
header
:{
'token'
:
_token
,
'tenant'
:
config
.
tenant
,
'content-type'
:
'application/x-www-form-urlencoded'
,
'apikey'
:
'pP5ECUqRDLDzuh4qRuJro0L1LPgjLP0N'
,
'version'
:
config
.
version
},
method
:
'POST'
})
}
/**
* localStorage 中存放的 各种值
* userSession - 调用 login 获取对应的 sessionKey openId等值
...
...
@@ -218,5 +243,6 @@ module.exports = {
'config'
:
config
,
requestApi
:
requestApi
,
durationToTimeString
:
durationToTimeString
,
sendformid
:
sendformid
,
LoginAgainAndJumpPage
:
LoginAgainAndJumpPage
};
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论