Commit b4133d59 by 李伟康

commit 分数为0时也显示

1 parent 4511624d
...@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd' ...@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd'
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 1 let index = 2
const accountInfo = wx.getAccountInfoSync() const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync() const systemInfo = wx.getSystemInfoSync()
......
...@@ -62,7 +62,7 @@ Page({ ...@@ -62,7 +62,7 @@ Page({
}) })
const arcComponent = this.selectComponent('#arc') const arcComponent = this.selectComponent('#arc')
arcComponent.init() arcComponent.init()
if (inspectionInfo.score) arcComponent.drawData() if (inspectionInfo.score != null) arcComponent.drawData()
} else throw message } else throw message
} catch (error) { } catch (error) {
wx.hideLoading() wx.hideLoading()
......
...@@ -96,7 +96,7 @@ Component({ ...@@ -96,7 +96,7 @@ Component({
num num
} = this.data } = this.data
this.part = Math.ceil(num / 20) this.part = Math.ceil(num / 20)
if (num) this.fillArc(Start_Angle, 0, Start_Angle + Angle) if (num != null) this.fillArc(Start_Angle, 0, num == 0 ? Start_Angle : Start_Angle + Angle)
}, },
drawTips(data) { drawTips(data) {
let { let {
...@@ -107,7 +107,7 @@ Component({ ...@@ -107,7 +107,7 @@ Component({
this.ctx.clearRect(x + 10, y / 2 + 20, this.toRpx(52), this.toRpx(30)) this.ctx.clearRect(x + 10, y / 2 + 20, this.toRpx(52), this.toRpx(30))
this.ctx.clearRect(x + 10, y / 2 + 60, this.toRpx(50), this.toRpx(30)) this.ctx.clearRect(x + 10, y / 2 + 60, this.toRpx(50), this.toRpx(30))
this.drawText({ this.drawText({
text: data || '···', text: data != null ? data : '···',
x, x,
y: y / 2, y: y / 2,
fontSize: 30, fontSize: 30,
...@@ -117,7 +117,7 @@ Component({ ...@@ -117,7 +117,7 @@ Component({
textBaseline: 'middle' textBaseline: 'middle'
}) })
this.drawText({ this.drawText({
text: data ? '分数' : '计算中…', text: data != null ? '分数' : '计算中…',
x, x,
y: (y + 44) / 2, y: (y + 44) / 2,
fontSize: 10, fontSize: 10,
...@@ -143,6 +143,7 @@ Component({ ...@@ -143,6 +143,7 @@ Component({
} }
} = this, } = this,
a = startAngle a = startAngle
if(num == 0) return this.drawTips(num)
let b = startAngle + Math.PI / 70 let b = startAngle + Math.PI / 70
ctx.beginPath() ctx.beginPath()
ctx.strokeStyle = Arc_Data_Background[index] ctx.strokeStyle = Arc_Data_Background[index]
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
{ {
"name": "质检", "name": "质检",
"pathName": "packageEquity/pages/aiInspection/aiInspection", "pathName": "packageEquity/pages/aiInspection/aiInspection",
"query": "badgeId=3030F935D78C", "query": "badgeId=4827E2F0CD24",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!