提交 2979bea1 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 a35a72cf
......@@ -25,3 +25,8 @@ export function getShare(data) {
export function getQrcode(data) {
return httpRequest.get('/api/lms/util/pcode', data)
}
// 获取二维码
export function imageTransfer(data) {
return httpRequest.get('/api/usercenter/tool/transfer-image', data)
}
import { getShare, getQrcode } from '../../api/base.js'
import { getShare, getQrcode, imageTransfer } from '../../api/base.js'
import { wxml, style } from './share.js'
const app = getApp()
......@@ -43,7 +43,8 @@ Component({
text: '本质上,我们都生活在我们与内部体验或者外部事件的主观互动中。',
avatar: ''
},
wxUserProfile: {}
wxUserProfile: {},
numLength: 1
},
lifetimes: {
attached() {
......@@ -90,6 +91,8 @@ Component({
data.course_name = data.course_name ? data.course_name.replace(/(\(|()(.+)(\)|))/, '') : ''
data.course_name = `《${data.course_name}》课程`
data.chapter_name = data.chapter_name ? data.chapter_name.replace(/(\(|()(.+)(\)|))/, '') : ''
data.used_day = 123
const numLength = data.used_day.toString().length
// 两门课单独判断
if (data.course_name.includes('整合心理学与批判性思考')) {
......@@ -107,7 +110,7 @@ Component({
this.setData({ textList, 'controls.text': textList[0] })
}
this.setData({ share: Object.assign(data, { lecturer }) })
this.setData({ share: Object.assign(data, { lecturer }), numLength })
return res
})
},
......@@ -126,9 +129,12 @@ Component({
wx.getUserProfile({ desc: '使用头像生成海报' })
.then(res => {
const userInfo = res.userInfo
this.data.avatarList.push(userInfo.avatarUrl)
this.setData({ wxUserProfile: userInfo, avatarList: this.data.avatarList })
wx.setStorageSync('userInfo', JSON.stringify(userInfo))
imageTransfer({ source: userInfo.avatarUrl }).then(res => {
userInfo.avatarUrl = res
this.data.avatarList.push(userInfo.avatarUrl)
this.setData({ wxUserProfile: userInfo, avatarList: this.data.avatarList })
wx.setStorageSync('userInfo', JSON.stringify(userInfo))
})
})
.catch(() => {
wx.showToast({ title: '获取微信头像失败', icon: 'none' })
......
......@@ -25,8 +25,9 @@
<view class="footer">
<view class="footer-left">
<view class="tips">
我已坚持学习<text class="num"> {{ share.used_day }} </text>天</view
>
<text>我已坚持学习</text>
<text class="num" style="width:{{ numLength * 11 }}px;"> {{ share.used_day }} </text><text>天</text>
</view>
<view>我离学位殿堂又近了一步</view>
</view>
<image src="{{ qrcode }}" class="footer-right"></image>
......
......@@ -89,7 +89,7 @@
.text {
margin-top: 56px;
margin-left: 12px;
margin-right: 12px;
width: 200px;
height: 36px;
font-size: 13px;
font-weight: bold;
......@@ -109,16 +109,19 @@
flex: 1;
font-size: 12px;
color: #1a1a1a;
line-height: 18px;
line-height: 1;
}
.footer-left .tips {
display: flex;
align-items: center;
align-items: flex-end;
height: 18px;
margin-bottom: 6px;
}
.num {
font-size: 17px;
color: #d78c4a;
font-weight: bold;
text-align: center;
}
.footer-right {
width: 50px;
......@@ -228,7 +231,7 @@ button::after {
border: 3px solid #ccc;
border-radius: 6px;
overflow: hidden;
padding: 12px;
padding: 10px;
font-size: 13px;
color: #1a1a1a;
line-height: 18px;
......
......@@ -120,31 +120,35 @@ const style = function (data) {
justifyContent: 'center'
},
box: {
marginBottom: 6,
width: 140,
height: 20,
flexDirection: 'row'
flexDirection: 'row',
alignItems: 'flex-end'
},
t1: {
marginiTop: 8,
width: 72,
height: 20,
height: 12,
fontSize: 12,
lineHeight: 20,
lineHeight: 12,
color: '#1A1A1A'
},
t2: {
width: numLength * 12,
height: 20,
width: numLength * 11,
height: 17,
fontSize: 17,
fontWeight: 'bold',
lineHeight: 20,
lineHeight: 17,
color: '#D78C4A',
textAlign: 'center'
},
t3: {
marginiTop: 8,
width: 12,
height: 20,
height: 12,
fontSize: 12,
lineHeight: 20,
lineHeight: 12,
color: '#1A1A1A'
},
tips: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论