Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online
Commits
b34a4c8e
提交
b34a4c8e
authored
12月 08, 2021
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
分享海报支持自定义金句,支持颜色选择
上级
d5118510
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
399 行增加
和
111 行删除
+399
-111
README.md
README.md
+31
-11
app.js
learnOnline/app.js
+9
-1
index.js
learnOnline/components/share/index.js
+118
-27
index.json
learnOnline/components/share/index.json
+2
-1
index.wxml
learnOnline/components/share/index.wxml
+66
-23
index.wxss
learnOnline/components/share/index.wxss
+105
-17
share.js
learnOnline/components/share/share.js
+66
-29
project.config.json
learnOnline/project.config.json
+2
-2
没有找到文件。
README.md
浏览文件 @
b34a4c8e
# 小程序 - 开发项目
# 小程序 - 开发项目
## 使用与运行
## 使用与运行
*
打开小程序 “微信开发者工具” 预览、调试、发布、上传都可以。
-
打开小程序 “微信开发者工具” 预览、调试、发布、上传都可以。
-
`微信开发者工具`
:
<a
href=
"https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html"
target=
"_blank"
>
下载地址
</a>
-
`微信开发者工具`
:
<a
href=
"https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html"
target=
"_blank"
>
下载地址
</a>
-
`微信开发者工具`
:
<a
href=
"https://developers.weixin.qq.com/miniprogram/dev/devtools/devtools.html?t=18090718"
target=
"_blank"
>
使用说明地址
</a>
-
`微信开发者工具`
:
<a
href=
"https://developers.weixin.qq.com/miniprogram/dev/devtools/devtools.html?t=18090718"
target=
"_blank"
>
使用说明地址
</a>
## 小程序 - 对应域名添加
## 小程序 - 对应域名添加
*
https://api.ezijing.com
*
https://p.bokecc.com
-
https://api.ezijing.com
*
https://union.bokecc.com
-
https://p.bokecc.com
*
https://cd15-c120-1.play.bokecc.com
-
https://union.bokecc.com
*
https://ca14-cca1-1.play.bokecc.com
-
https://cd15-c120-1.play.bokecc.com
*
https://img1.ezijing.com
-
https://ca14-cca1-1.play.bokecc.com
*
https://zws-imgs-pub.ezijing.com
-
https://img1.ezijing.com
-
https://zws-imgs-pub.ezijing.com
## 小程序审核
## 小程序审核
```
python
```
python
本系统是
内部付费人员使用,需要绑定手机号(你们肯定不愿意提供手机号)。但为了
照顾你们
测试人员,所以在
登录下方已经增加
“游客登录”入口,你测试
为啥不试试就给我拒绝了?
本系统是
内部付费人员使用,需要绑定手机号(你们肯定不愿意提供手机号)。但为了
照顾你们
测试人员,所以在
登录下方已经增加
“游客登录”入口,你测试
为啥不试试就给我拒绝了?
再次重申,我已经增加
“游客登录”入口,就是方便
你们测试人员测试使用。你为啥不用呢?
我已经申请过多次,多次出现这种情况,你们测试人员之间没有沟通吗?
再次重申,我已经增加
“游客登录”入口,就是方便
你们测试人员测试使用。你为啥不用呢?
我已经申请过多次,多次出现这种情况,你们测试人员之间没有沟通吗?
麻烦以后你们测试之间
多沟通一下,不要再让我天天加备注解释,好吗?
麻烦以后你们测试之间
多沟通一下,不要再让我天天加备注解释,好吗?
```
```
\ No newline at end of file
wxml-to-canvas 代码修改
```
let {
color = '#000',
lineHeight = '1.4em',
fontSize = 14,
fontStyle = 'normal',
fontWeight = 'normal',
fontFamily = 'sans-serif',
textAlign = 'left',
verticalAlign = 'top',
backgroundColor = 'transparent'
} = style
ctx.font = `${fontStyle} ${fontWeight} ${fontSize}px ${fontFamily}`
```
learnOnline/app.js
浏览文件 @
b34a4c8e
...
@@ -5,7 +5,15 @@ App({
...
@@ -5,7 +5,15 @@ App({
pageshow
:
false
,
pageshow
:
false
,
user
:
{}
// 用户信息
user
:
{}
// 用户信息
},
},
onLaunch
:
function
()
{},
onLaunch
:
function
()
{
// 加载自定义字体
wx
.
loadFontFace
({
global
:
true
,
family
:
'my'
,
source
:
'https://webapp-pub.ezijing.com/weapp/share/my.ttf'
,
scopes
:
[
'webview'
,
'native'
]
})
},
onPageNotFound
()
{
onPageNotFound
()
{
wx
.
redirectTo
({
url
:
'pages/login/index'
})
wx
.
redirectTo
({
url
:
'pages/login/index'
})
},
},
...
...
learnOnline/components/share/index.js
浏览文件 @
b34a4c8e
...
@@ -3,6 +3,9 @@ import { wxml, style } from './share.js'
...
@@ -3,6 +3,9 @@ import { wxml, style } from './share.js'
const
app
=
getApp
()
const
app
=
getApp
()
Component
({
Component
({
options
:
{
styleIsolation
:
'shared'
},
/**
/**
* 组件的属性列表
* 组件的属性列表
*/
*/
...
@@ -28,33 +31,70 @@ Component({
...
@@ -28,33 +31,70 @@ Component({
'https://webapp-pub.ezijing.com/weapp/share/bg/02.jpg'
,
'https://webapp-pub.ezijing.com/weapp/share/bg/02.jpg'
,
'https://webapp-pub.ezijing.com/weapp/share/bg/03.jpg'
,
'https://webapp-pub.ezijing.com/weapp/share/bg/03.jpg'
,
'https://webapp-pub.ezijing.com/weapp/share/bg/04.jpg'
,
'https://webapp-pub.ezijing.com/weapp/share/bg/04.jpg'
,
'https://webapp-pub.ezijing.com/weapp/share/bg/05.jpg'
'https://webapp-pub.ezijing.com/weapp/share/bg/05.jpg'
,
'https://webapp-pub.ezijing.com/weapp/share/bg/06.jpg'
,
'https://webapp-pub.ezijing.com/weapp/share/bg/07.jpg'
,
'https://webapp-pub.ezijing.com/weapp/share/bg/08.jpg'
,
'https://webapp-pub.ezijing.com/weapp/share/bg/09.jpg'
],
],
textList
:
[
textList
:
[
'本质上,我们都生活在我们与内部体验或者外部事件的主观互动中。'
,
{
text
:
'本质上,我们都生活在我们与内部体验或者外部事件的主观互动中。'
},
'人本主义认为人是多维的,不能只去剖析本能,还要看思想和精神。'
,
{
text
:
'人本主义认为人是多维的,不能只去剖析本能,还要看思想和精神。'
},
'别把身份全建立在与人的关系上,要寻找独立于关系之外的自我意识'
,
{
text
:
'灵性体验发生于与世界的关系中,这种关系是一个有生命的系统。'
},
'反思能力可得知自己的他人的不同,及自己的道德价值观和伦理模式'
{
text
:
'参与式方法认为要尊重文化、科学、宗教的差异,而不是进行统一'
},
{
text
:
'宇宙并非独立于我们而存在于别处,我们就身处宇宙之中——惠勒'
},
{
text
:
'别把身份全建立在与人的关系上,要寻找独立于关系之外的自我意识'
},
{
text
:
'反思能力可得知自己的他人的不同,及自己的道德价值观和伦理模式'
},
{
text
:
'多元交织身份意味着你我之间看着不同,但可建立某种奇特的联盟'
},
{
text
:
'权力和特权是相互关联的,但取决于交互关系和背景'
},
{
text
:
'当触碰到自己的羞愧,可把这些感受当成履行责任的指引'
},
{
text
:
'只有认真观察我们的投射,才能看到自己的阴影中有什么——荣格'
},
{
text
:
'改变自己对他人的看法,这是追求社会公正的一种方法'
}
],
],
avatarList
:
[],
avatarList
:
[],
colorList
:
[
'#d78c4a'
,
'#f44336'
,
'#e91e63'
,
'#673ab7'
,
'#3f51b5'
,
'#2196f3'
,
'#00bcd4'
,
'#009688'
,
'#4caf50'
,
'#8bc34a'
,
'#cddc39'
,
'#ffeb3b'
,
'#ffc107'
,
'#ff9800'
,
'#ff5722'
,
'#795548'
,
'#9e9e9e'
,
'#607d8b'
],
controls
:
{
controls
:
{
active
:
'0'
,
active
:
'0'
,
bg
:
'https://webapp-pub.ezijing.com/weapp/share/bg/01.jpg'
,
bg
:
'https://webapp-pub.ezijing.com/weapp/share/bg/01.jpg'
,
text
:
'本质上,我们都生活在我们与内部体验或者外部事件的主观互动中。'
,
text
:
'本质上,我们都生活在我们与内部体验或者外部事件的主观互动中。'
,
avatar
:
''
avatar
:
''
,
color
:
'#d78c4a'
},
},
controlsTabs
:
[
{
index
:
'0'
,
text
:
'背景'
},
{
index
:
'1'
,
text
:
'金句'
},
{
index
:
'3'
,
text
:
'颜色'
},
{
index
:
'2'
,
text
:
'头像'
}
],
wxUserProfile
:
{},
wxUserProfile
:
{},
numLength
:
1
numLength
:
1
,
customText
:
''
,
customTextVisible
:
false
,
keyboardHeight
:
0
},
},
lifetimes
:
{
lifetimes
:
{
attached
()
{
attached
()
{
// 获取微信头像
// 加载自定义字体
const
localUserInfo
=
wx
.
getStorageSync
(
'userInfo'
)
// wx.loadFontFace({ family: 'my', source: 'https://webapp-pub.ezijing.com/weapp/share/my.ttf' })
let
wxUserProfile
=
localUserInfo
?
JSON
.
parse
(
localUserInfo
)
:
{}
if
(
wxUserProfile
.
avatarUrl
)
{
this
.
data
.
avatarList
.
push
(
wxUserProfile
.
avatarUrl
)
this
.
setData
({
wxUserProfile
,
avatarList
:
this
.
data
.
avatarList
,
'controls.avatar'
:
wxUserProfile
.
avatarUrl
})
}
}
}
},
},
/**
/**
...
@@ -68,11 +108,19 @@ Component({
...
@@ -68,11 +108,19 @@ Component({
}
}
app
.
getUser
().
then
(
res
=>
{
app
.
getUser
().
then
(
res
=>
{
res
.
realname
=
res
.
realname
||
res
.
nickname
res
.
realname
=
res
.
realname
||
res
.
nickname
// 系统头像
const
avatarList
=
[]
if
(
res
.
avatar
)
{
if
(
res
.
avatar
)
{
!
this
.
data
.
avatarList
.
includes
(
res
.
avatar
)
&&
this
.
data
.
avatarList
.
unshift
(
res
.
avatar
)
avatarList
.
push
({
name
:
'系统'
,
url
:
res
.
avatar
})
this
.
setData
({
avatarList
:
this
.
data
.
avatarList
,
'controls.avatar'
:
res
.
avatar
})
}
}
this
.
setData
({
user
:
res
,
show
:
true
})
// 微信头像
const
localUserInfo
=
wx
.
getStorageSync
(
'userInfo'
)
let
wxUserProfile
=
localUserInfo
?
JSON
.
parse
(
localUserInfo
)
:
{}
if
(
wxUserProfile
.
avatarUrl
)
{
avatarList
.
push
({
name
:
'微信'
,
url
:
wxUserProfile
.
avatarUrl
})
}
const
[
firstAvatar
=
{}]
=
avatarList
this
.
setData
({
user
:
res
,
wxUserProfile
,
avatarList
,
show
:
true
,
'controls.avatar'
:
firstAvatar
.
url
})
this
.
getQrcode
()
this
.
getQrcode
()
})
})
})
})
...
@@ -93,24 +141,32 @@ Component({
...
@@ -93,24 +141,32 @@ Component({
data
.
chapter_name
=
data
.
chapter_name
?
data
.
chapter_name
.
replace
(
/
(\(
|(
)(
.+
)(\)
|)
)
/
,
''
)
:
''
data
.
chapter_name
=
data
.
chapter_name
?
data
.
chapter_name
.
replace
(
/
(\(
|(
)(
.+
)(\)
|)
)
/
,
''
)
:
''
data
.
chapter_name
=
data
.
chapter_name
?
data
.
chapter_name
.
split
(
' '
).
pop
()
:
''
data
.
chapter_name
=
data
.
chapter_name
?
data
.
chapter_name
.
split
(
' '
).
pop
()
:
''
data
.
chapter_name
=
data
.
chapter_name
?
`“
${
data
.
chapter_name
}
”专题`
:
''
data
.
chapter_name
=
data
.
chapter_name
?
`“
${
data
.
chapter_name
}
”专题`
:
''
const
numLength
=
data
.
used_day
.
toString
().
length
const
numLength
=
data
.
used_day
.
toString
().
length
// 两门课单独判断
// 两门课单独判断
if
(
data
.
course_name
.
includes
(
'整合心理学与批判性思考'
))
{
if
(
data
.
course_name
.
includes
(
'整合心理学与批判性思考'
))
{
const
textList
=
[
const
textList
=
[
'本质上,我们都生活在我们与内部体验或者外部事件的主观互动中。'
,
{
text
:
'本质上,我们都生活在我们与内部体验或者外部事件的主观互动中。'
},
'人本主义认为人是多维的,不能只去剖析本能,还要看思想和精神。'
{
text
:
'人本主义认为人是多维的,不能只去剖析本能,还要看思想和精神。'
},
{
text
:
'灵性体验发生于与世界的关系中,这种关系是一个有生命的系统。'
},
{
text
:
'参与式方法认为要尊重文化、科学、宗教的差异,而不是进行统一'
},
{
text
:
'宇宙并非独立于我们而存在于别处,我们就身处宇宙之中——惠勒'
}
]
]
this
.
setData
({
textList
,
'controls.text'
:
textList
[
0
]
})
this
.
setData
({
textList
,
'controls.text'
:
textList
[
0
]
.
text
})
}
}
if
(
data
.
course_name
.
includes
(
'自我探究'
))
{
if
(
data
.
course_name
.
includes
(
'自我探究'
))
{
const
textList
=
[
const
textList
=
[
'别把身份全建立在与人的关系上,要寻找独立于关系之外的自我意识'
,
{
text
:
'别把身份全建立在与人的关系上,要寻找独立于关系之外的自我意识'
},
'反思能力可得知自己的他人的不同,及自己的道德价值观和伦理模式'
{
text
:
'反思能力可得知自己的他人的不同,及自己的道德价值观和伦理模式'
},
{
text
:
'多元交织身份意味着你我之间看着不同,但可建立某种奇特的联盟'
},
{
text
:
'权力和特权是相互关联的,但取决于交互关系和背景'
},
{
text
:
'当触碰到自己的羞愧,可把这些感受当成履行责任的指引'
},
{
text
:
'只有认真观察我们的投射,才能看到自己的阴影中有什么——荣格'
},
{
text
:
'改变自己对他人的看法,这是追求社会公正的一种方法'
}
]
]
this
.
setData
({
textList
,
'controls.text'
:
textList
[
0
]
})
this
.
setData
({
textList
,
'controls.text'
:
textList
[
0
]
.
text
})
}
}
this
.
setData
({
share
:
Object
.
assign
(
data
,
{
lecturer
}),
numLength
})
this
.
setData
({
share
:
Object
.
assign
(
data
,
{
lecturer
}),
numLength
})
return
res
return
res
})
})
...
@@ -132,7 +188,7 @@ Component({
...
@@ -132,7 +188,7 @@ Component({
const
userInfo
=
res
.
userInfo
const
userInfo
=
res
.
userInfo
imageTransfer
({
source
:
userInfo
.
avatarUrl
}).
then
(
res
=>
{
imageTransfer
({
source
:
userInfo
.
avatarUrl
}).
then
(
res
=>
{
userInfo
.
avatarUrl
=
res
userInfo
.
avatarUrl
=
res
this
.
data
.
avatarList
.
push
(
userInfo
.
avatarUrl
)
this
.
data
.
avatarList
.
push
(
{
name
:
'微信'
,
url
:
userInfo
.
avatarUrl
}
)
this
.
setData
({
wxUserProfile
:
userInfo
,
avatarList
:
this
.
data
.
avatarList
})
this
.
setData
({
wxUserProfile
:
userInfo
,
avatarList
:
this
.
data
.
avatarList
})
wx
.
setStorageSync
(
'userInfo'
,
JSON
.
stringify
(
userInfo
))
wx
.
setStorageSync
(
'userInfo'
,
JSON
.
stringify
(
userInfo
))
})
})
...
@@ -190,12 +246,17 @@ Component({
...
@@ -190,12 +246,17 @@ Component({
// 选择金句
// 选择金句
onSelectText
(
e
)
{
onSelectText
(
e
)
{
const
{
item
}
=
e
.
currentTarget
.
dataset
const
{
item
}
=
e
.
currentTarget
.
dataset
this
.
setData
({
'controls.text'
:
item
})
this
.
setData
({
'controls.text'
:
item
.
text
})
},
},
// 选择头像
// 选择头像
onSelectAvatar
(
e
)
{
onSelectAvatar
(
e
)
{
const
{
item
}
=
e
.
currentTarget
.
dataset
const
{
item
}
=
e
.
currentTarget
.
dataset
this
.
setData
({
'controls.avatar'
:
item
})
this
.
setData
({
'controls.avatar'
:
item
.
url
})
},
// 选择颜色
onSelectColor
(
e
)
{
const
{
item
}
=
e
.
currentTarget
.
dataset
this
.
setData
({
'controls.color'
:
item
})
},
},
// 控制栏显示隐藏
// 控制栏显示隐藏
toggleControls
()
{
toggleControls
()
{
...
@@ -204,6 +265,36 @@ Component({
...
@@ -204,6 +265,36 @@ Component({
// 关闭预览
// 关闭预览
onClosePreview
()
{
onClosePreview
()
{
this
.
setData
({
isPreivew
:
false
})
this
.
setData
({
isPreivew
:
false
})
},
// 显示自定义金句
showCustomText
()
{
this
.
setData
({
customTextVisible
:
true
})
},
// 使用自定义金句
onCustomTextConfirm
()
{
if
(
this
.
data
.
customText
)
{
this
.
data
.
textList
.
unshift
({
text
:
this
.
data
.
customText
,
isCustom
:
true
})
this
.
setData
({
'controls.text'
:
this
.
data
.
customText
,
textList
:
this
.
data
.
textList
,
customTextVisible
:
false
,
customText
:
''
})
}
},
// 失去焦点
onCustomTextBlur
()
{
this
.
setData
({
customTextVisible
:
false
})
},
// 计算键盘高度
onKeyboardheightchange
(
e
)
{
this
.
setData
({
keyboardHeight
:
e
.
detail
.
height
})
},
// 删除自定义金句
onRemoveCustomText
(
e
)
{
const
{
index
}
=
e
.
currentTarget
.
dataset
this
.
data
.
textList
.
splice
(
index
,
1
)
this
.
setData
({
textList
:
this
.
data
.
textList
})
}
}
}
}
})
})
learnOnline/components/share/index.json
浏览文件 @
b34a4c8e
{
{
"component"
:
true
,
"component"
:
true
,
"usingComponents"
:
{
"usingComponents"
:
{
"wxml-to-canvas"
:
"wxml-to-canvas"
"wxml-to-canvas"
:
"wxml-to-canvas"
,
"van-icon"
:
"@vant/weapp/icon/index"
}
}
}
}
learnOnline/components/share/index.wxml
浏览文件 @
b34a4c8e
...
@@ -9,11 +9,11 @@
...
@@ -9,11 +9,11 @@
class="bg"
class="bg"
></image>
></image>
<image
<image
src="https://webapp-pub.ezijing.com/weapp/share/cover.png?x-oss-process=image/resize,m_fill,h_924,w_534"
src="https://webapp-pub.ezijing.com/weapp/share/
new_
cover.png?x-oss-process=image/resize,m_fill,h_924,w_534"
mode="aspectFill"
mode="aspectFill"
class="cover"
class="cover"
></image>
></image>
<view class="main">
<view class="main"
style="color:{{ controls.color }};"
>
<view class="teacher">{{ share.lecturer.lecturer_name }}</view>
<view class="teacher">{{ share.lecturer.lecturer_name }}</view>
<view class="course">{{ share.course_name }}</view>
<view class="course">{{ share.course_name }}</view>
<view class="user">
<view class="user">
...
@@ -21,20 +21,26 @@
...
@@ -21,20 +21,26 @@
<view class="nickname">{{ share.personal_name }}</view>
<view class="nickname">{{ share.personal_name }}</view>
</view>
</view>
<view class="chapter">{{ share.chapter_name }}</view>
<view class="chapter">{{ share.chapter_name }}</view>
<view class="text">{{ controls.text }}</view>
<view class="title">知识获得者</view>
<view class="text" style="border-color:{{ controls.color }};">{{ controls.text }}</view>
<view class="footer">
<view class="footer">
<view class="footer-left">
<view class="footer-left">
<view class="
tips
">
<view class="
box
">
<text>我已坚持学习</text>
<text>我已坚持学习</text>
<text class="num" style="width:{{ numLength * 11 }}px;"> {{ share.used_day }} </text><text>天</text>
<view class="num" style="color:{{ controls.color }};width:{{ numLength * 11 }}px;">
{{ share.used_day }}
</view>
<text>天</text>
</view>
</view>
<view>我离学位殿堂又近了一步</view>
<view
class="tips"
>我离学位殿堂又近了一步</view>
</view>
</view>
<image src="{{ qrcode }}" class="footer-right"></image>
<image src="{{ qrcode }}" class="footer-right"></image>
</view>
</view>
<view class="qrcode-tips" style="background-color:{{ controls.color }};">扫码和我一起学习吧</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 控制栏 -->
<!-- 控制栏 -->
<view class="controls {{ hasControls ? 'is-show' : '' }}">
<view class="controls {{ hasControls ? 'is-show' : '' }}">
<view class="buttons">
<view class="buttons">
...
@@ -59,15 +65,14 @@
...
@@ -59,15 +65,14 @@
</view>
</view>
<view class="controls-main">
<view class="controls-main">
<view class="controls-tabs">
<view class="controls-tabs">
<view class="controls-tab {{ controls.active === '0' ? 'is-active' : '' }}" data-index="0" bindtap="onTabChange"
<block wx:for="{{ controlsTabs }}" wx:key="index">
>背景</view
<view
>
class="controls-tab {{ controls.active === item.index ? 'is-active' : '' }}"
<view class="controls-tab {{ controls.active === '1' ? 'is-active' : '' }}" data-index="1" bindtap="onTabChange"
data-index="{{ item.index }}"
>金句</view
bindtap="onTabChange"
>
>{{ item.text }}</view
<view class="controls-tab {{ controls.active === '2' ? 'is-active' : '' }}" data-index="2" bindtap="onTabChange"
>
>头像</view
</block>
>
</view>
</view>
<scroll-view class="controls-scroll" scroll-x="{{ true }}">
<scroll-view class="controls-scroll" scroll-x="{{ true }}">
<!-- 背景 -->
<!-- 背景 -->
...
@@ -89,36 +94,75 @@
...
@@ -89,36 +94,75 @@
<!-- 金句 -->
<!-- 金句 -->
<view class="controls-content" hidden="{{ controls.active !== '1' }}">
<view class="controls-content" hidden="{{ controls.active !== '1' }}">
<!-- 自定义金句 -->
<view class="custom-text-button" bindtap="showCustomText">自定义金句</view>
<view
<view
class="controls-text-item {{ controls.text === item ? 'is-active' : '' }}"
class="controls-text-item {{ controls.text === item
.text
? 'is-active' : '' }}"
wx:for="{{ textList }}"
wx:for="{{ textList }}"
wx:key="
*this
"
wx:key="
text
"
data-item="{{ item }}"
data-item="{{ item }}"
bindtap="onSelectText"
bindtap="onSelectText"
>{{ item }}</view
>{{ item.text }}
>
<view class="custom-text-remove" data-index="{{ index }}" bindtap="onRemoveCustomText">
<van-icon name="clear" size="20" color="#d78c4a" wx:if="{{ item.isCustom }}"></van-icon>
</view>
</view>
</view>
</view>
<!-- 头像 -->
<!-- 头像 -->
<view class="controls-content" hidden="{{ controls.active !== '2' }}">
<view class="controls-content" hidden="{{ controls.active !== '2' }}">
<view
<view
class="controls-avatar-item {{ controls.avatar === item ? 'is-active' : '' }}"
class="controls-avatar-item {{ controls.avatar === item
.url
? 'is-active' : '' }}"
wx:for="{{ avatarList }}"
wx:for="{{ avatarList }}"
wx:key="
*this
"
wx:key="
url
"
data-item="{{ item }}"
data-item="{{ item }}"
bindtap="onSelectAvatar"
bindtap="onSelectAvatar"
>
>
<image src="{{ item }}" mode="aspectFill" class="image"></image>
<image src="{{ item.url }}" mode="aspectFill" class="image"></image>
<text>{{ item.name }}</text>
</view>
</view>
<view class="controls-avatar-item" hidden="{{ wxUserProfile.avatarUrl }}">
<view class="controls-avatar-item" hidden="{{ wxUserProfile.avatarUrl }}">
<text>微信</text><text>头像</text>
<text>微信</text><text>头像</text>
<button class="wx-button" open-type="getUserInfo" bindtap="getUserProfile"></button>
<button class="wx-button" open-type="getUserInfo" bindtap="getUserProfile"></button>
</view>
</view>
</view>
</view>
<!-- 颜色 -->
<view class="controls-content" hidden="{{ controls.active !== '3' }}">
<view
class="controls-color-item {{ controls.color === item ? 'is-active' : '' }}"
wx:for="{{ colorList }}"
wx:key="*this"
data-item="{{ item }}"
bindtap="onSelectColor"
style="background-color:{{ item }}"
>{{ item }}</view
>
</view>
</scroll-view>
</scroll-view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 自定义金句 -->
<view class="custom-text" wx:if="{{ customTextVisible }}" style="bottom:{{ keyboardHeight }}px;">
<textarea
class="wx-textarea"
placeholder="输入自定义金句"
model:value="{{ customText }}"
maxlength="30"
cursor-spacing="30"
confirm-type="done"
show-confirm-bar="{{ false }}"
auto-focus="{{ true }}"
fixed="{{ true }}"
adjust-position="{{ false }}"
bindconfirm="onCustomTextConfirm"
bindblur="onCustomTextBlur"
bindkeyboardheightchange="onKeyboardheightchange"
></textarea>
</view>
<!-- 预览页面 -->
<!-- 预览页面 -->
<view class="share-preivew" wx:if="{{ isPreivew }}">
<view class="share-preivew" wx:if="{{ isPreivew }}">
<view class="close" bindtap="onClosePreview"></view>
<view class="close" bindtap="onClosePreview"></view>
...
@@ -129,6 +173,5 @@
...
@@ -129,6 +173,5 @@
<view class="button button-default" bindtap="extraImage">保存图片到相册</view>
<view class="button button-default" bindtap="extraImage">保存图片到相册</view>
<view class="tips">分享图片到朋友圈</view>
<view class="tips">分享图片到朋友圈</view>
<view class="tips">最高可获得5000朵紫荆花</view>
<view class="tips">最高可获得5000朵紫荆花</view>
<!-- <view class="button button-primary"><text></text><text>最高可获得5000朵紫荆花</text></view> -->
</view>
</view>
</view>
</view>
learnOnline/components/share/index.wxss
浏览文件 @
b34a4c8e
...
@@ -40,19 +40,23 @@
...
@@ -40,19 +40,23 @@
top: 120px;
top: 120px;
/* right: 41px; */
/* right: 41px; */
width: 220px;
width: 220px;
color: #d78c4a;
display: flex;
flex-direction: column;
align-items: center;
}
}
.teacher {
.teacher {
width: 220px;
font-size: 13px;
font-size: 13px;
font-weight: bold;
font-weight: bold;
color: #d78c4a;
line-height: 16px;
line-height: 16px;
}
}
.course {
.course {
width: 220px;
font-size: 13px;
font-size: 13px;
font-weight: bold;
font-weight: bold;
color: #d78c4a;
line-height: 16px;
line-height: 16px;
margin-left: -
5
px;
margin-left: -
10
px;
}
}
.user {
.user {
margin-top: 10px;
margin-top: 10px;
...
@@ -71,13 +75,10 @@
...
@@ -71,13 +75,10 @@
margin-top: 2px;
margin-top: 2px;
font-size: 15px;
font-size: 15px;
font-weight: bold;
font-weight: bold;
color: #d78c4a;
line-height: 1;
line-height: 1;
}
}
.chapter {
.chapter {
margin-top: 6px;
margin-top: 6px;
margin-left: 8px;
margin-right: 8px;
height: 32px;
height: 32px;
font-size: 14px;
font-size: 14px;
font-weight: bold;
font-weight: bold;
...
@@ -86,24 +87,36 @@
...
@@ -86,24 +87,36 @@
text-align: center;
text-align: center;
overflow: hidden;
overflow: hidden;
}
}
.title {
font-family: 'my';
margin-top: 9px;
height: 24px;
font-size: 24px;
line-height: 24px;
text-align: center;
}
.text {
.text {
margin-top: 56px;
margin-top: 14px;
margin-left: 12px;
width: 200px;
width: 200px;
height:
36
px;
height:
50
px;
font-size: 13px;
font-size: 13px;
font-weight: bold;
font-weight: bold;
/* font-style: italic; */
/* font-style: italic; */
color: #1a1a1a;
color: #1a1a1a;
line-height: 18px;
line-height: 18px;
word-break: break-word;
overflow: hidden;
overflow: hidden;
border-top: 1px solid #d78c4a;
border-bottom: 1px solid #d78c4a;
display: flex;
align-items: center;
justify-content: center;
}
}
.footer {
.footer {
display: flex;
display: flex;
align-items: center;
align-items: center;
margin-top: 15px;
margin-top: 10px;
margin-left: 15px;
width: 190px;
margin-right: 15px;
}
}
.footer-left {
.footer-left {
flex: 1;
flex: 1;
...
@@ -111,22 +124,39 @@
...
@@ -111,22 +124,39 @@
color: #1a1a1a;
color: #1a1a1a;
line-height: 1;
line-height: 1;
}
}
.footer-left .
tips
{
.footer-left .
box
{
display: flex;
display: flex;
align-items: flex-end;
align-items: flex-end;
height: 18px;
height: 20px;
margin-bottom: 6px;
}
.footer-left .tips {
height: 20px;
line-height: 20px;
}
}
.num {
.num {
font-size: 17px;
font-size: 17px;
color: #d78c4a;
font-weight: bold;
font-weight: bold;
color: #d78c4a;
text-align: center;
text-align: center;
margin-left: 2px;
margin-right: 2px;
}
}
.footer-right {
.footer-right {
width: 50px;
width: 50px;
height: 50px;
height: 50px;
}
}
.qrcode-tips {
width: 130px;
height: 15px;
margin-top: 6px;
background: #d78c4a;
border-radius: 2px;
font-size: 11px;
color: #ffff;
line-height: 15px;
text-align: center;
}
.controls {
.controls {
position: relative;
position: relative;
padding-bottom: env(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
...
@@ -221,6 +251,7 @@ button::after {
...
@@ -221,6 +251,7 @@ button::after {
overflow: hidden;
overflow: hidden;
}
}
.controls-text-item {
.controls-text-item {
position: relative;
margin: 0 15px;
margin: 0 15px;
flex: 0 0 228px;
flex: 0 0 228px;
width: 228px;
width: 228px;
...
@@ -230,12 +261,14 @@ button::after {
...
@@ -230,12 +261,14 @@ button::after {
justify-content: center;
justify-content: center;
border: 3px solid #ccc;
border: 3px solid #ccc;
border-radius: 6px;
border-radius: 6px;
overflow: hidden;
padding: 10px;
padding: 10px;
font-size: 13px;
font-size: 13px;
color: #1a1a1a;
color: #1a1a1a;
line-height: 18px;
line-height: 18px;
box-sizing: border-box;
box-sizing: border-box;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.controls-avatar-item {
.controls-avatar-item {
position: relative;
position: relative;
...
@@ -255,6 +288,23 @@ button::after {
...
@@ -255,6 +288,23 @@ button::after {
line-height: 18px;
line-height: 18px;
box-sizing: border-box;
box-sizing: border-box;
}
}
.controls-color-item {
margin: 0 15px;
flex: 0 0 68px;
width: 68px;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
border: 3px solid #ccc;
border-radius: 6px;
overflow: hidden;
padding: 10px;
font-size: 13px;
color: #fff;
line-height: 18px;
box-sizing: border-box;
}
.image {
.image {
width: 100%;
width: 100%;
height: 100%;
height: 100%;
...
@@ -320,3 +370,41 @@ button::after {
...
@@ -320,3 +370,41 @@ button::after {
line-height: 15px;
line-height: 15px;
text-align: center;
text-align: center;
}
}
.wx-textarea {
padding: 10px;
height: 100%;
}
.custom-text-button {
margin: 0 15px;
flex: 0 0 100px;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
border: 3px solid #ccc;
border-radius: 6px;
overflow: hidden;
padding: 10px;
font-size: 13px;
color: #1a1a1a;
line-height: 18px;
box-sizing: border-box;
}
.custom-text {
position: fixed;
left: 0;
right: 0;
bottom: 0;
height: 60px;
background-color: #fff;
z-index: 100;
}
.custom-text-remove {
position: absolute;
right: -20px;
top: -20px;
padding: 10px;
}
.custom-text-remove .van-icon {
background-color: #fff;
}
learnOnline/components/share/share.js
浏览文件 @
b34a4c8e
...
@@ -2,7 +2,7 @@ const wxml = function (data) {
...
@@ -2,7 +2,7 @@ const wxml = function (data) {
return
`
return
`
<view class="share">
<view class="share">
<image src="
${
data
.
controls
.
bg
}
?x-oss-process=image/resize,m_fill,h_532,w_300" class="bg"></image>
<image src="
${
data
.
controls
.
bg
}
?x-oss-process=image/resize,m_fill,h_532,w_300" class="bg"></image>
<image src="https://webapp-pub.ezijing.com/weapp/share/cover.png" class="cover"></image>
<image src="https://webapp-pub.ezijing.com/weapp/share/
new_
cover.png" class="cover"></image>
<view class="main">
<view class="main">
<text class="teacher">
${
data
.
share
.
lecturer
.
lecturer_name
}
</text>
<text class="teacher">
${
data
.
share
.
lecturer
.
lecturer_name
}
</text>
<text class="course">
${
data
.
share
.
course_name
}
</text>
<text class="course">
${
data
.
share
.
course_name
}
</text>
...
@@ -11,7 +11,14 @@ const wxml = function (data) {
...
@@ -11,7 +11,14 @@ const wxml = function (data) {
<view><text class="nickname">
${
data
.
share
.
personal_name
}
</text></view>
<view><text class="nickname">
${
data
.
share
.
personal_name
}
</text></view>
</view>
</view>
<text class="chapter">
${
data
.
share
.
chapter_name
}
</text>
<text class="chapter">
${
data
.
share
.
chapter_name
}
</text>
<text class="text">
${
data
.
controls
.
text
}
</text>
<text class="title">知识获得者</text>
<view class="text-wrapper">
<view class="text-border"></view>
<view class="text-main">
<text class="text">
${
data
.
controls
.
text
}
</text>
</view>
<view class="text-border"></view>
</view>
<view class="footer">
<view class="footer">
<view class="footer-left">
<view class="footer-left">
<view class="box"><text class="t1">我已坚持学习</text><text class="t2">
${
data
.
share
.
used_day
}
</text><text class="t3">天</text></view>
<view class="box"><text class="t1">我已坚持学习</text><text class="t2">
${
data
.
share
.
used_day
}
</text><text class="t3">天</text></view>
...
@@ -19,6 +26,7 @@ const wxml = function (data) {
...
@@ -19,6 +26,7 @@ const wxml = function (data) {
</view>
</view>
<image src="
${
data
.
qrcode
}
" class="footer-right"></image>
<image src="
${
data
.
qrcode
}
" class="footer-right"></image>
</view>
</view>
<view class="qrcode-tips-wrapper"><text class="qrcode-tips">扫码和我一起学习吧</text></view>
</view>
</view>
</view>`
</view>`
}
}
...
@@ -47,26 +55,28 @@ const style = function (data) {
...
@@ -47,26 +55,28 @@ const style = function (data) {
left
:
40
,
left
:
40
,
top
:
120
,
top
:
120
,
width
:
220
,
width
:
220
,
height
:
300
height
:
300
,
alignItems
:
'center'
},
},
teacher
:
{
teacher
:
{
width
:
220
,
height
:
16
,
height
:
16
,
fontSize
:
13
,
fontSize
:
13
,
fontWeight
:
'bold'
,
fontWeight
:
'bold'
,
lineHeight
:
16
,
lineHeight
:
16
,
color
:
'#D78C4A'
color
:
data
.
controls
.
color
},
},
course
:
{
course
:
{
marginLeft
:
-
5
,
marginLeft
:
-
10
,
width
:
220
,
height
:
16
,
height
:
16
,
fontSize
:
13
,
fontSize
:
13
,
fontWeight
:
'bold'
,
fontWeight
:
'bold'
,
lineHeight
:
16
,
lineHeight
:
16
,
color
:
'#D78C4A'
color
:
data
.
controls
.
color
},
},
user
:
{
user
:
{
marginTop
:
10
,
marginTop
:
10
,
flexDirection
:
'column'
,
alignItems
:
'center'
alignItems
:
'center'
},
},
avatar
:
{
avatar
:
{
...
@@ -81,7 +91,7 @@ const style = function (data) {
...
@@ -81,7 +91,7 @@ const style = function (data) {
fontSize
:
15
,
fontSize
:
15
,
fontWeight
:
'bold'
,
fontWeight
:
'bold'
,
lineHeight
:
16
,
lineHeight
:
16
,
color
:
'#D78C4A'
,
color
:
data
.
controls
.
color
,
textAlign
:
'center'
textAlign
:
'center'
},
},
chapter
:
{
chapter
:
{
...
@@ -92,23 +102,41 @@ const style = function (data) {
...
@@ -92,23 +102,41 @@ const style = function (data) {
fontWeight
:
'bold'
,
fontWeight
:
'bold'
,
color
:
'#1A1A1A'
,
color
:
'#1A1A1A'
,
lineHeight
:
16
,
lineHeight
:
16
,
textAlign
:
'center'
textAlign
:
'center'
,
verticalAlign
:
'middle'
},
},
text
:
{
title
:
{
marginTop
:
56
,
marginTop
:
9
,
marginLeft
:
12
,
width
:
220
,
height
:
24
,
fontSize
:
24
,
fontFamily
:
'my'
,
lineHeight
:
24
,
textAlign
:
'center'
,
color
:
data
.
controls
.
color
},
textWrapper
:
{
marginTop
:
14
,
width
:
200
,
height
:
50
},
textBorder
:
{
width
:
200
,
width
:
200
,
height
:
36
,
height
:
1
,
backgroundColor
:
data
.
controls
.
color
},
text
:
{
height
:
48
,
fontSize
:
13
,
fontSize
:
13
,
fontWeight
:
'bold'
,
fontWeight
:
'bold'
,
fontStyle
:
'italic'
,
fontStyle
:
'italic'
,
color
:
'#1A1A1A'
,
color
:
'#1A1A1A'
,
lineHeight
:
18
lineHeight
:
18
,
verticalAlign
:
'middle'
,
textAlign
:
'center'
},
},
footer
:
{
footer
:
{
marginTop
:
15
,
marginTop
:
10
,
marginLeft
:
15
,
marginRight
:
15
,
width
:
190
,
width
:
190
,
height
:
50
,
height
:
50
,
flexDirection
:
'row'
,
flexDirection
:
'row'
,
...
@@ -116,39 +144,35 @@ const style = function (data) {
...
@@ -116,39 +144,35 @@ const style = function (data) {
},
},
footerLeft
:
{
footerLeft
:
{
width
:
140
,
width
:
140
,
height
:
50
,
height
:
40
justifyContent
:
'center'
},
},
box
:
{
box
:
{
marginBottom
:
6
,
width
:
140
,
width
:
140
,
height
:
20
,
height
:
20
,
lineHeight
:
20
,
flexDirection
:
'row'
,
flexDirection
:
'row'
,
alignItems
:
'flex-end'
alignItems
:
'flex-end'
},
},
t1
:
{
t1
:
{
marginiTop
:
8
,
width
:
72
,
width
:
72
,
height
:
12
,
height
:
20
,
fontSize
:
12
,
fontSize
:
12
,
lineHeight
:
12
,
color
:
'#1A1A1A'
color
:
'#1A1A1A'
},
},
t2
:
{
t2
:
{
marginLeft
:
2
,
marginRight
:
2
,
width
:
numLength
*
11
,
width
:
numLength
*
11
,
height
:
17
,
height
:
20
,
fontSize
:
17
,
fontSize
:
17
,
fontWeight
:
'bold'
,
fontWeight
:
'bold'
,
lineHeight
:
17
,
color
:
data
.
controls
.
color
,
color
:
'#D78C4A'
,
textAlign
:
'center'
textAlign
:
'center'
},
},
t3
:
{
t3
:
{
marginiTop
:
8
,
width
:
12
,
width
:
12
,
height
:
12
,
height
:
20
,
fontSize
:
12
,
fontSize
:
12
,
lineHeight
:
12
,
color
:
'#1A1A1A'
color
:
'#1A1A1A'
},
},
tips
:
{
tips
:
{
...
@@ -161,6 +185,19 @@ const style = function (data) {
...
@@ -161,6 +185,19 @@ const style = function (data) {
footerRight
:
{
footerRight
:
{
width
:
50
,
width
:
50
,
height
:
50
height
:
50
},
qrcodeTipsWrapper
:
{
marginTop
:
6
,
width
:
130
,
borderRadius
:
2
,
backgroundColor
:
data
.
controls
.
color
},
qrcodeTips
:
{
height
:
15
,
fontSize
:
11
,
color
:
'#FFFFFF'
,
lineHeight
:
15
,
textAlign
:
'center'
}
}
}
}
}
}
...
...
learnOnline/project.config.json
浏览文件 @
b34a4c8e
...
@@ -32,9 +32,9 @@
...
@@ -32,9 +32,9 @@
"packNpmRelationList"
:
[],
"packNpmRelationList"
:
[],
"minifyWXSS"
:
true
,
"minifyWXSS"
:
true
,
"disableUseStrict"
:
false
,
"disableUseStrict"
:
false
,
"minifyWXML"
:
true
,
"showES6CompileOption"
:
false
,
"showES6CompileOption"
:
false
,
"useCompilerPlugins"
:
false
,
"useCompilerPlugins"
:
false
"minifyWXML"
:
true
},
},
"compileType"
:
"miniprogram"
,
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.21.0"
,
"libVersion"
:
"2.21.0"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论