...
|
...
|
@@ -2,6 +2,12 @@ import 'home/family.page.css'; |
|
|
import $ from 'yoho-jquery';
|
|
|
import Page from 'yoho-page';
|
|
|
import tip from 'plugin/tip';
|
|
|
import yoho from 'yoho-app';
|
|
|
import integral from 'home/integral-paradise.hbs';
|
|
|
|
|
|
const echarts = require('echarts/lib/echarts');
|
|
|
|
|
|
require('echarts/lib/chart/pie');
|
|
|
|
|
|
class FamilyIndex extends Page {
|
|
|
constructor() {
|
...
|
...
|
@@ -12,17 +18,26 @@ class FamilyIndex extends Page { |
|
|
$codeSet: $('.code-set'),
|
|
|
$invition: $('.invition'),
|
|
|
$invitonSet: $('.inviton-set'),
|
|
|
$textarea: $('textarea')
|
|
|
$textarea: $('textarea'),
|
|
|
integralCh: echarts.init(document.getElementById('charts')),
|
|
|
chartWidth: $('.charts').width(),
|
|
|
$integralContent: $('.integral-content')
|
|
|
};
|
|
|
|
|
|
this.view = {
|
|
|
integral
|
|
|
};
|
|
|
|
|
|
this.init();
|
|
|
|
|
|
this.selector.$codeSet.on('click', this.setTrendPop.bind(this));
|
|
|
this.selector.$textarea.on('blur', this.saveTrendWord.bind(this));
|
|
|
this.selector.integralCh.on('click', this.jump.bind(this));
|
|
|
}
|
|
|
|
|
|
init() {
|
|
|
this.headIco();
|
|
|
this.integralCharts();
|
|
|
}
|
|
|
|
|
|
// 头像
|
...
|
...
|
@@ -32,6 +47,41 @@ class FamilyIndex extends Page { |
|
|
}
|
|
|
}
|
|
|
|
|
|
// 积分乐园图表
|
|
|
integralCharts() {
|
|
|
let integralData = {
|
|
|
total: 18922,
|
|
|
totalHref: location.protocol + '//m.yohobuy.com/home/family/coinDetail?openby:yohobuy={"action":"go.h5","params":{"url":"' + location.protocol + '//m.yohobuy.com/home/family/coinDetail"}}', // eslint-disable-line
|
|
|
data: [
|
|
|
{value: 40, name: 'rose2', color: '#000', percent: '20%', plateType: 1},
|
|
|
{value: 35, name: 'rose3', plateType: 2},
|
|
|
{value: 30, name: 'rose4', plateType: 3},
|
|
|
{value: 25, name: 'rose5'},
|
|
|
{value: 20, name: 'rose6'},
|
|
|
{value: 15, name: 'rose7'},
|
|
|
]
|
|
|
};
|
|
|
|
|
|
this.selector.$integralContent.append(this.view.integral(integralData));
|
|
|
|
|
|
this.selector.integralCh.setOption({
|
|
|
calculable: true,
|
|
|
color: ['#C1232B', '#B5C334', '#FCCE10'],
|
|
|
series: [
|
|
|
{
|
|
|
type: 'pie',
|
|
|
radius: [this.selector.chartWidth / 3, this.selector.chartWidth / 2],
|
|
|
roseType: 'radius',
|
|
|
center: ['50%', '50%'],
|
|
|
label: {
|
|
|
normal: false
|
|
|
},
|
|
|
data: integralData.data
|
|
|
}
|
|
|
]
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 设置潮流口令
|
|
|
setTrendPop() {
|
|
|
this.selector.$invition.hide();
|
...
|
...
|
@@ -63,6 +113,15 @@ class FamilyIndex extends Page { |
|
|
tip.show('服务异常,请稍后重试');
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 积分图表点击跳转
|
|
|
jump(params) {
|
|
|
if (yoho && yoho.isApp) {
|
|
|
yoho.goH5(`${location.protocol}//m.yohobuy.com/home/family/coinDetail?plateType=${params.data.plateType}`);
|
|
|
} else {
|
|
|
window.location.href = `${location.protocol}//m.yohobuy.com/home/family/coinDetail?plateType=${params.data.plateType}`; // eslint-disable-line
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$(() => {
|
...
|
...
|
|