ec02_pie_spouseDirection() { const chart = echarts.init($("#ec02_pie_spouseDirection")[0]); this.charts.ec02_pie_spouseDirection = chart; chart.setOption(opt_pie); chart.setOption({ legend: {show: false}, series: [{ data: '子丑寅卯辰巳午未申酉戌亥'.split('').map((item) => { return { name: item, value: 1 } }), startAngle: '105', label: { fontSize: 16 * scale, textShadowColor: '#000', textShadowBlur: .5 * scale, textShadowOffsetX: scale, textShadowOffsetY: scale, } }, { startAngle: '45', data: [ { name: '', value: 30, itemStyle: { color: 'rgba(255,0,0,.33)', borderWidth: 5 * scale, borderColor: 'red', } }, {name: '', value: 150, itemStyle: {color: 'transparent'}}, { name: '', value: 30, itemStyle: { color: 'rgba(255,0,0,.33)', borderWidth: 5 * scale, borderColor: 'red', } }, {name: '', value: 150, itemStyle: {color: 'transparent'}}, ] }].map(item => { return $.extend(true, {}, seri_pie, { silent: true, label: { position: 'inside', verticalAlign: 'top' }, animationEasing: 'exponentialOut', center: ['30%', '55%'], radius: [0, '76%'], }, item) }) }); let opt = chart.getOption(); $('#spouseDirection_submit').click(function () { opt.series[1].startAngle %= 360; opt.series[1].animationDurationUpdate = 0; chart.setOption(opt); let [mon, date] = [$("#spouseDirection_input_m").val(), $("#spouseDirection_input_d").val()]; if (!((mon <= 12 && mon >= 1) && (date <= 30 && date >= 1))) { alert('请输入正确的生日'); return } setTimeout(function () { let num = mon - 0 + (date - 0); opt.series[1].startAngle = -(num - 1) * 30 - 105 - 1800; opt.series[1].animationDurationUpdate = 5000; chart.setOption(opt); }, 0) }) }, c04_bestLocation() { let indexOrder = [5, 9, 6, 7, 2, 8, 3, 4, 1]; let $blocks = $(".blocks"); $("#bestLocation_submit").click(function () { let direct = $('[name=direct]:checked').val(); let season = $('[name=season]:checked').val(); if(!$("#floorNumber").val()){ alert('请输入楼层数!'); return; } if(!direct){ alert('请输入方位!') return; } if(!season){ alert('请输入出生季节!') return; } let breakFlag = false; indexOrder.forEach(function (item, index) { if (!breakFlag) { setTimeout(function () { $blocks.find('#block' + item).addClass('active').siblings().removeClass('active'); }, index * 500); if (((direct - 0 + index) % 9 || 9) === season - 0) { breakFlag = true; } } }) }); $("#floorNumber").change(function () { if ($(this).val() > 5) { $("#direct").text('住宅或单位') } else { $("#direct").text('小区') } }) } }; MapGeo.init();