MCPcopy Create free account
hub / github.com/Xu22Web/tech-study-js / ScoreItem

Function ScoreItem

tech-study.js:4979–5054  ·  view source on GitHub ↗

* @description 分数详情

()

Source from the content-addressed store, hash-verified

4977 * @description 分数详情
4978 */
4979function ScoreItem() {
4980 return watchEffectRef(() => {
4981 if (login.value) {
4982 // 分数显示
4983 const scoreShow = ref(false);
4984 // 分数信息
4985 return createElementNode('div', undefined, {
4986 class: 'egg_score_item',
4987 }, createElementNode('div', undefined, { class: 'egg_scoreinfo' }, [
4988 createElementNode('div', undefined, {
4989 class: 'egg_totalscore',
4990 }, [
4991 createTextNode('总积分'),
4992 createElementNode('span', undefined, undefined, createTextNode(totalScore)),
4993 ]),
4994 createElementNode('div', undefined, {
4995 class: 'egg_todayscore',
4996 }, [
4997 createElementNode('button', undefined, {
4998 type: 'button',
4999 class: 'egg_todayscore_btn',
5000 title: '查看分数详情',
5001 onclick: debounce(() => {
5002 scoreShow.value = !scoreShow.value;
5003 }, 300),
5004 onblur: () => {
5005 scoreShow.value = false;
5006 },
5007 }, [
5008 createTextNode('当天分数'),
5009 // 当天分数
5010 createElementNode('span', undefined, undefined, createTextNode(todayScore)),
5011 // icon
5012 createNSElementNode('svg', undefined, {
5013 viewBox: '0 0 1024 1024',
5014 class: 'egg_icon',
5015 }, createNSElementNode('path', undefined, {
5016 d: 'M332.16 883.84a40.96 40.96 0 0 0 58.24 0l338.56-343.04a40.96 40.96 0 0 0 0-58.24L390.4 140.16a40.96 40.96 0 0 0-58.24 58.24L640 512l-307.84 314.24a40.96 40.96 0 0 0 0 57.6z',
5017 })),
5018 createElementNode('div', undefined, {
5019 class: watchEffectRef(() => `egg_score_details${scoreShow.value ? '' : ' hide'}`),
5020 }, [
5021 createElementNode('div', undefined, { class: 'egg_score_title' }, [
5022 createNSElementNode('svg', undefined, {
5023 viewBox: '0 0 1024 1024',
5024 class: 'egg_icon',
5025 }, [
5026 createNSElementNode('path', undefined, {
5027 d: 'M314.81 304.01h415.86v58.91H314.81zM314.81 440.24h415.86v58.91H314.81z',
5028 }),
5029 createNSElementNode('path', undefined, {
5030 d: 'M814.8 892.74h-8.64l-283.51-182-283.51 182h-8.64A69.85 69.85 0 0 1 160.72 823V188.22a69.85 69.85 0 0 1 69.77-69.77H814.8a69.85 69.85 0 0 1 69.77 69.77V823a69.85 69.85 0 0 1-69.77 69.74zM230.5 177.35a10.87 10.87 0 0 0-10.86 10.86V823a10.86 10.86 0 0 0 5 9.11l298.01-191.42 298.06 191.38a10.86 10.86 0 0 0 5-9.11V188.22a10.87 10.87 0 0 0-10.86-10.86z',
5031 }),
5032 ]),
5033 createElementNode('div', undefined, {
5034 class: 'egg_score_title_text',
5035 }, createTextNode('积分详情')),
5036 ]),

Callers 1

PanelFunction · 0.70

Calls 6

watchEffectRefFunction · 0.70
refFunction · 0.70
createElementNodeFunction · 0.70
createTextNodeFunction · 0.70
debounceFunction · 0.70
createNSElementNodeFunction · 0.70

Tested by

no test coverage detected