提交 831ada65 authored 作者: 王鹏飞's avatar 王鹏飞

updates

上级 72facb1d
...@@ -7,12 +7,30 @@ App({ ...@@ -7,12 +7,30 @@ App({
}, },
onLaunch: function () { onLaunch: function () {
// 加载自定义字体 // 加载自定义字体
// wx.loadFontFace({ wx.loadFontFace({
// global: true, global: true,
// family: 'my', family: 'HelveticaNeueLTProMd',
// source: 'https://webapp-pub.ezijing.com/weapp/share/my.ttf', source: 'https://webapp-pub.ezijing.com/weapp/share/marywood/HelveticaNeueLTProMd.otf',
// scopes: ['webview', 'native'] scopes: ['webview', 'native']
// }) })
wx.loadFontFace({
global: true,
family: 'HelveticaNeueLTProMdIt',
source: 'https://webapp-pub.ezijing.com/weapp/share/marywood/HelveticaNeueLTProMdIt.otf',
scopes: ['webview', 'native']
})
wx.loadFontFace({
global: true,
family: 'Lato',
source: 'https://webapp-pub.ezijing.com/weapp/share/marywood/Lato-Medium.ttf',
scopes: ['webview', 'native']
})
wx.loadFontFace({
global: true,
family: 'Lato-Light',
source: 'https://webapp-pub.ezijing.com/weapp/share/marywood/Lato-Light.ttf',
scopes: ['webview', 'native']
})
}, },
onPageNotFound() { onPageNotFound() {
wx.redirectTo({ url: 'pages/login/index' }) wx.redirectTo({ url: 'pages/login/index' })
......
...@@ -71,8 +71,8 @@ Component({ ...@@ -71,8 +71,8 @@ Component({
}, },
controlsTabs: [ controlsTabs: [
{ index: '0', text: '背景' }, { index: '0', text: '背景' },
{ index: '1', text: '金句' }, { index: '1', text: '金句' }
{ index: '3', text: '颜色' } // { index: '3', text: '颜色' }
// { index: '2', text: '头像' } // { index: '2', text: '头像' }
], ],
wxUserProfile: {}, wxUserProfile: {},
...@@ -92,8 +92,6 @@ Component({ ...@@ -92,8 +92,6 @@ Component({
semester_id: this.data.semesterId semester_id: this.data.semesterId
} }
}) })
// 加载自定义字体
// wx.loadFontFace({ family: 'my', source: 'https://webapp-pub.ezijing.com/weapp/share/my.ttf' })
} }
}, },
/** /**
...@@ -137,11 +135,14 @@ Component({ ...@@ -137,11 +135,14 @@ Component({
} }
return getShare(params).then(res => { return getShare(params).then(res => {
const data = res.data const data = res.data
// data.sentences = ['If you think education is expensive, try ignorance.'] // data.sentences = [
// 'If you think education is expensive, try ignorance.'
// ]
// data.course_name = '设计思维与管理创新' // data.course_name = '设计思维与管理创新'
// data.english_course_name = 'Organizational Behavior and Leadership' // data.english_course_name = 'Organizational Behavior and Leadership'
// data.current_percent = '90' // data.current_percent = '90%'
// data.all_percent = '25' // data.all_percent = '25%'
// data.used_day = 23
const [lecturer = { lecturer_name: '' }] = data.lecturers const [lecturer = { lecturer_name: '' }] = data.lecturers
lecturer.lecturer_name = lecturer.lecturer_name ? lecturer.lecturer_name.replace(/(\(|()(.+)(\)|))/, '') : '' lecturer.lecturer_name = lecturer.lecturer_name ? lecturer.lecturer_name.replace(/(\(|()(.+)(\)|))/, '') : ''
data.course_name = data.course_name ? data.course_name.replace(/(\(|()(.+)(\)|))/, '') : '' data.course_name = data.course_name ? data.course_name.replace(/(\(|()(.+)(\)|))/, '') : ''
...@@ -149,6 +150,8 @@ Component({ ...@@ -149,6 +150,8 @@ 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.replace(/^.*\s/, '') : '' data.chapter_name = data.chapter_name ? data.chapter_name.replace(/^.*\s/, '') : ''
data.chapter_name = data.chapter_name ? `“${data.chapter_name}”专题` : '' data.chapter_name = data.chapter_name ? `“${data.chapter_name}”专题` : ''
data.current_percent = parseFloat(data.current_percent) || 0
data.all_percent = parseFloat(data.all_percent) || 0
const numLength = data.used_day.toString().length const numLength = data.used_day.toString().length
// 金句设置 // 金句设置
......
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
class="bg" class="bg"
></image> ></image>
<image <image
src="https://webapp-pub.ezijing.com/weapp/share/marywood/cover.png?x-oss-process=image/resize,m_fill,h_898,w_507" src="https://webapp-pub.ezijing.com/weapp/share/marywood/cover2.png?x-oss-process=image/resize,m_fill,h_898,w_507"
mode="aspectFill" mode="aspectFill"
class="cover" class="cover"
></image> ></image>
<view class="main" style="color:{{ controls.color }};"> <view class="main" style="color:{{ controls.color }};">
<view class="title">Zijing-Marywood University</view> <!-- <view class="title">Zijing-Marywood University</view>
<view class="title">Master of Business Administration (MBA)</view> <view class="title">Master of Business Administration (MBA)</view> -->
<view class="day"> <view class="day">
<text class="day-num">{{ share.used_day }}</text> <text class="day-num">{{ share.used_day }}</text>
<text class="day-tips">Learning Days</text> <text class="day-tips">Learning Days</text>
...@@ -106,14 +106,15 @@ ...@@ -106,14 +106,15 @@
<!-- 金句 --> <!-- 金句 -->
<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 class="custom-text-button" bindtap="showCustomText">自定义金句</view> -->
<view <view
class="controls-text-item {{ controls.text === item.text ? 'is-active' : '' }}" class="controls-text-item {{ controls.text === item.text ? 'is-active' : '' }}"
wx:for="{{ textList }}" wx:for="{{ textList }}"
wx:key="text" wx:key="text"
data-item="{{ item }}" data-item="{{ item }}"
bindtap="onSelectText" bindtap="onSelectText"
>{{ item.text }} >
<text class="t">{{ item.text }}</text>
<view class="custom-text-remove" data-index="{{ index }}" catchtap="onRemoveCustomText"> <view class="custom-text-remove" data-index="{{ index }}" catchtap="onRemoveCustomText">
<van-icon name="clear" size="20" color="#d78c4a" wx:if="{{ item.isCustom }}"></van-icon> <van-icon name="clear" size="20" color="#d78c4a" wx:if="{{ item.isCustom }}"></van-icon>
</view> </view>
......
...@@ -37,14 +37,15 @@ ...@@ -37,14 +37,15 @@
.main { .main {
position: absolute; position: absolute;
left: 45px; left: 45px;
top: 95px; top: 142px;
width: 210px; width: 210px;
color: #d78c4a; color: #d78c4a;
} }
.title { .title {
text-align: center; text-align: center;
/* font-family: Lato; */
font-size: 10px; font-size: 10px;
font-weight: bold; font-weight: 700;
line-height: 16px; line-height: 16px;
white-space: nowrap; white-space: nowrap;
} }
...@@ -56,47 +57,66 @@ ...@@ -56,47 +57,66 @@
justify-content: center; justify-content: center;
width: 130px; width: 130px;
height: 130px; height: 130px;
margin: 15px auto 0; margin: 0 auto;
background: url(https://webapp-pub.ezijing.com/weapp/share/marywood/roud_bg.png) no-repeat; background: url(https://webapp-pub.ezijing.com/weapp/share/marywood/roud_bg.png) no-repeat;
background-size: contain; background-size: contain;
} }
.day-num { .day-num {
font-size: 48px; font-size: 48px;
font-family: 'HelveticaNeueLTProMd';
line-height: 48px; line-height: 48px;
color: #f1ae2c; color: #f1ae2c;
} }
.day-tips { .day-tips {
font-size: 14px; font-size: 14px;
font-family: Lato;
color: #fff; color: #fff;
} }
.text { .text {
margin-top: 18px; margin-top: 20px;
margin-bottom: 10px; margin-bottom: 10px;
font-size: 9px; font-size: 9px;
line-height: 14px; font-family: SourceHanSansCN-Regular;
word-break: break-word; line-height: 1;
white-space: nowrap;
text-align: center;
overflow: hidden; overflow: hidden;
border-bottom: 1px solid #f1ae2c; border-bottom: 1rpx solid #f1ae2c;
padding-bottom: 6px; height: 17px;
} }
.box { .box {
display: flex; display: flex;
align-items: center; align-items: center;
margin: 9px 0;
} }
.course { .course {
flex: 1; flex: 1;
margin-right: 6px;
} }
.course-en-name { .course-en-name {
font-family: Lato;
font-size: 12px; font-size: 12px;
line-height: 12px; font-weight: 500;
line-height: 1;
max-height: 24px;
overflow: hidden;
word-wrap: break-word;
word-break: break-all;
} }
.course-name { .course-name {
font-size: 11px; height: 11px;
margin-top: 3px;
margin-left: -6px; margin-left: -6px;
font-size: 11px;
font-weight: 400;
line-height: 1;
overflow: hidden;
} }
.course-mba { .course-mba {
flex: 1; flex: 1;
font-size: 12px; font-size: 12px;
font-family: Lato;
font-weight: 500;
text-align: right; text-align: right;
} }
.progress { .progress {
...@@ -106,21 +126,29 @@ ...@@ -106,21 +126,29 @@
justify-content: center; justify-content: center;
} }
.progress-box { .progress-box {
display: flex;
align-items: flex-end;
text-align: center; text-align: center;
height: 30px; height: 30px;
overflow: hidden; overflow: hidden;
} }
.progress-num { .progress-num {
font-style: italic; height: 30px;
font-size: 30px; font-size: 30px;
font-family: 'HelveticaNeueLTProMdIt';
line-height: 1; line-height: 1;
margin-bottom: -5px;
} }
.progress-unit { .progress-unit {
font-size: 16px; font-size: 16px;
font-family: 'HelveticaNeueLTProMdIt';
line-height: 1; line-height: 1;
} }
.progress-completed { .progress-completed {
margin-top: -4px;
font-size: 11px; font-size: 11px;
font-family: 'Lato-Light';
font-weight: normal;
line-height: 1; line-height: 1;
} }
...@@ -130,7 +158,7 @@ ...@@ -130,7 +158,7 @@
align-items: center; align-items: center;
margin-top: 10px; margin-top: 10px;
padding-top: 9px; padding-top: 9px;
border-top: 1px solid #f1ae2c; border-top: 1rpx solid #f1ae2c;
} }
.qrcode { .qrcode {
width: 37px; width: 37px;
...@@ -250,13 +278,18 @@ button::after { ...@@ -250,13 +278,18 @@ button::after {
border: 3px solid #ccc; border: 3px solid #ccc;
border-radius: 6px; border-radius: 6px;
padding: 10px; padding: 10px;
box-sizing: border-box;
}
.controls-text-item .t {
font-size: 13px; font-size: 13px;
color: #1a1a1a; color: #1a1a1a;
line-height: 18px; line-height: 18px;
box-sizing: border-box; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
word-wrap: break-word;
} }
.controls-avatar-item { .controls-avatar-item {
position: relative; position: relative;
......
...@@ -2,10 +2,8 @@ const wxml = function (data) { ...@@ -2,10 +2,8 @@ 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_530,w_300" class="bg"></image> <image src="${data.controls.bg}?x-oss-process=image/resize,m_fill,h_530,w_300" class="bg"></image>
<image src="https://webapp-pub.ezijing.com/weapp/share/marywood/cover.png" class="cover"></image> <image src="https://webapp-pub.ezijing.com/weapp/share/marywood/cover2.png" class="cover"></image>
<view class="main"> <view class="main">
<text class="title">Zijing-Marywood University</text>
<text class="title">Master of Business Administration (MBA)</text>
<view class="day"> <view class="day">
<image src="https://webapp-pub.ezijing.com/weapp/share/marywood/roud_bg.png?x-oss-process=image/resize,m_fill,h_130,w_130" class="day-bg"></image> <image src="https://webapp-pub.ezijing.com/weapp/share/marywood/roud_bg.png?x-oss-process=image/resize,m_fill,h_130,w_130" class="day-bg"></image>
<view class="day-inner"> <view class="day-inner">
...@@ -38,15 +36,17 @@ const wxml = function (data) { ...@@ -38,15 +36,17 @@ const wxml = function (data) {
</view> </view>
<text class="course-mba">MBA Learning Achievement</text> <text class="course-mba">MBA Learning Achievement</text>
</view> </view>
<view class="line"></view> <view class="line mt10"></view>
<image src="${data.qrcode}" class="qrcode"></image> <view class="qrcode-box">
<image src="${data.qrcode}" class="qrcode"></image>
</view>
<text class="qrcode-tips">Scan to learn with me</text> <text class="qrcode-tips">Scan to learn with me</text>
</view> </view>
</view>` </view>`
} }
const style = function (data) { const style = function (data) {
const numLength = data.share.used_day.toString().length const enCourseNameLength = data.share.english_course_name.length
return { return {
share: { share: {
position: 'relative', position: 'relative',
...@@ -67,7 +67,7 @@ const style = function (data) { ...@@ -67,7 +67,7 @@ const style = function (data) {
main: { main: {
position: 'absolute', position: 'absolute',
left: 45, left: 45,
top: 95, top: 142,
width: 210, width: 210,
height: 300, height: 300,
alignItems: 'center', alignItems: 'center',
...@@ -77,15 +77,15 @@ const style = function (data) { ...@@ -77,15 +77,15 @@ const style = function (data) {
width: 210, width: 210,
textAlign: 'center', textAlign: 'center',
fontSize: 10, fontSize: 10,
// fontFamily: 'Lato',
fontWeight: 700,
lineHeight: 16, lineHeight: 16,
fontWeight: 'bold',
height: 16 height: 16
}, },
day: { day: {
position: 'relative', position: 'relative',
width: 130, width: 130,
height: 130, height: 130
marginTop: 15
}, },
dayBg: { dayBg: {
position: 'absolute', position: 'absolute',
...@@ -107,56 +107,62 @@ const style = function (data) { ...@@ -107,56 +107,62 @@ const style = function (data) {
dayNum: { dayNum: {
height: 48, height: 48,
fontSize: 48, fontSize: 48,
fontFamily: 'HelveticaNeueLTProMd',
lineHeight: 48, lineHeight: 48,
color: '#f1ae2c' color: '#f1ae2c'
}, },
dayTips: { dayTips: {
height: 20, height: 20,
fontSize: 14, fontSize: 14,
fontFamily: 'Lato',
color: '#fff' color: '#fff'
}, },
line: { line: {
marginTop: 8,
width: 210, width: 210,
height: 1, height: 0.5,
backgroundColor: '#F1AE2C' backgroundColor: '#F1AE2C'
}, },
text: { text: {
marginTop: 18, marginTop: 20,
width: 210, width: 210,
height: 14, height: 17,
fontSize: 9, fontSize: 9,
lineHeight: 14, lineHeight: 9,
textAlign: 'center' textAlign: 'center'
}, },
box: { box: {
marginTop: 8, marginTop: 9,
width: 210, width: 210,
color: data.controls.color, color: data.controls.color,
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center' alignItems: 'center'
}, },
mt10: {
marginTop: 9
},
course: { course: {
width: 160, width: 156
height: 40 // height: 40
}, },
courseEnName: { courseEnName: {
height: 24, height: enCourseNameLength > 26 ? 24 : 12,
fontFamily: 'Lato',
fontSize: 12, fontSize: 12,
fontWeight: 500, fontWeight: 500,
lineHeight: 12 lineHeight: 12
}, },
courseName: { courseName: {
marginLeft: -5, marginLeft: -5,
marginTop: 5, marginTop: 3,
height: 11, height: 11,
fontSize: 11, fontSize: 11,
fontWeight: 400, fontWeight: 400,
lineHeight: 11 lineHeight: 11
}, },
courseMba: { courseMba: {
width: 160, width: 156,
height: 12, height: 12,
fontFamily: 'Lato',
fontSize: 12, fontSize: 12,
fontWeight: 500, fontWeight: 500,
lineHeight: 12, lineHeight: 12,
...@@ -166,44 +172,53 @@ const style = function (data) { ...@@ -166,44 +172,53 @@ const style = function (data) {
flexDirection: 'column', flexDirection: 'column',
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
width: 50, width: 54,
height: 38 height: 38
}, },
progressBox: { progressBox: {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'flex-end', alignItems: 'flex-end',
width: 50, justifyContent: 'center',
width: 54,
height: 28 height: 28
}, },
progressNum: { progressNum: {
width: 36, width: 36,
height: 28, height: 30,
fontSize: 28, marginBottom: -5,
fontStyle: 'italic', fontFamily: 'HelveticaNeueLTProMdIt',
lineHeight: 28, fontSize: 30,
lineHeight: 30,
textAlign: 'right' textAlign: 'right'
}, },
progressUnit: { progressUnit: {
width: 14, width: 16,
height: 14, height: 16,
fontSize: 14, fontFamily: 'HelveticaNeueLTProMdIt',
lineHeight: 14 fontSize: 16,
lineHeight: 16
}, },
progressCompleted: { progressCompleted: {
marginTop: -2, marginTop: -2,
width: 50, width: 54,
height: 11, height: 11,
fontSize: 10, fontFamily: 'Lato-Light',
fontSize: 11,
fontWeight: 300, fontWeight: 300,
lineHeight: 10, lineHeight: 11,
textAlign: 'right' textAlign: 'center'
}, },
qrcode: { qrcodeBox: {
marginTop: 8, marginTop: 8,
width: 37, width: 39,
height: 37, height: 39,
borderRadius: 2, borderRadius: 2,
backgroundColor: data.controls.color backgroundColor: '#1d5434'
},
qrcode: {
margin: 1,
width: 37,
height: 37
}, },
qrcodeTips: { qrcodeTips: {
width: 210, width: 210,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论