feat(h5): calculate integer total from weighted dimensions across reports and admin
This commit is contained in:
+2
-7
@@ -1487,13 +1487,8 @@
|
||||
|
||||
function renderReport(vm, frontPhoto, sidePhoto, payload) {
|
||||
reportOwner = AccountClient.user() && AccountClient.user().id;
|
||||
// 头部:综合评分(vm.total 缺失时回退三维度 S 均分×10)
|
||||
var total = vm.total;
|
||||
if (total == null) {
|
||||
var ds = [vm.dims.firm.S, vm.dims.vita.S, vm.dims.stab.S], sum = 0, n = 0, i;
|
||||
for (i = 0; i < 3; i++) if (typeof ds[i] === 'number') { sum += ds[i]; n++; }
|
||||
if (n) total = Math.round(sum / n * 10);
|
||||
}
|
||||
// Historical snapshots also use their saved dimensions, never the old API total.
|
||||
var total = SkinScore.weightedTotal(vm.dims);
|
||||
// 环形综合评分:满分 100,环长 2πr(r=52)≈326.73
|
||||
$('#stat-score').innerHTML = total != null ? '<b>' + total + '</b><i>分</i>' : '<b>--</b><i>分</i>';
|
||||
var ring = $('#ring-fg');
|
||||
|
||||
Reference in New Issue
Block a user