Commit cacdcfc2 by 李伟康

修改代码

1 parent b02f10be
......@@ -35,7 +35,7 @@
<view class="text text-center" style="{{tabHeight ? 'height: 60rpx;' : ''}}">
{{item}}
</view>
<view class="line" style="lineStyle" style="{{tabHeight ? 'margin-top: 6rpx;' : ''}}" />
<view class="line" style="{{tabHeight ? 'margin-top: 6rpx;' : ''}}" />
<!-- -->
<view wx:if="{{filterUtils.hasRedpoint(unreadClueCount)}}" class="redpoint" />
</view>
......
......@@ -84,7 +84,7 @@ Page({
path = setRouteData(targetPath).url
obj = setRouteData(targetPath).obj
}
wx.$router.redirectTo(path, obj)
wx.$router.reLaunch(path, obj)
} else this.autoLogin(obj)
})
} else this.autoLogin(obj)
......
......@@ -70,23 +70,21 @@ Component({
fontWeight: 500
},
{
x: 12 + drawfun.getTextWidth(n.activityName, 14) + 9,
y: 38,
x: 14 + drawfun.getTextWidth(n.activityName, 14) + 9,
y: 37,
fontSize: 10,
color: '#4466F0',
text: '众筹',
textBaseline: 'top'
textBaseline: 'top',
border: {
width: 1,
color: '#4466F0',
radius: 2,
padding: [2, 5],
opacity: 0.5
}
}
],
lineList: [{
startX: 12 + drawfun.getTextWidth(n.activityName, 14) + 4,
startY: 38,
width: 1,
endX: 12 + drawfun.getTextWidth(n.activityName, 14) + 4,
endY: 54,
color: '#8FA5FF',
opacity: 0.5
}]
})
console.log(res)
wx.hideLoading()
......
......@@ -145,39 +145,13 @@ class Draw {
this[_ctx_].textAlign = textAlign
this[_ctx_].lineWidth = this.toRpx(2)
let text_width = this.getTextWidth(text)
if (textParams.border) {
let boxX = textParams.x - 4.5,
boxY = textParams.y - 0.5,
boxWidth = text_width + 9,
boxHeight = lineHeight + 4
if (boxWidth > width - fontX - this.getTextWidth('…') - fontSize) {
boxWidth = width - boxX + 9
}
this.drawFill({
x: boxX,
y: boxY,
width: boxWidth,
height: boxHeight,
color: textParams.border
})
}
if (textParams.background) {
let boxX = textParams.x - 4,
boxY = textParams.y,
boxWidth = text_width + 8,
boxHeight = lineHeight + 3
if (boxWidth > width - fontX - this.getTextWidth('…') - fontSize) {
boxWidth = width - boxX + 8
}
this.drawFill({
x: boxX,
y: boxY,
width: boxWidth,
height: boxHeight,
color: textParams.background
})
}
if (textParams.border) this.drawBorder({
text,
x: textParams.x,
y: textParams.y,
fontSize: textParams.fontSize || 12,
...textParams.border
})
const drawOneLineText = () => {
let textArr = text.toString().split(''),
newText = '',
......@@ -258,6 +232,26 @@ class Draw {
} else drawOneLineText()
this[_ctx_].stroke()
}
drawBorder(params) {
let {
x,
y,
text,
color,
width,
radius,
opacity,
padding,
fontSize
} = params
console.log(params)
let topX, topY, rightX, rightY, bottomX, bottomY, leftX, leftY, paddingX, paddingY
// if(padding && padding.length>1)
if (radius) {
}
}
drawLine(lineParams, callback) {
this[_ctx_].beginPath()
let {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!