Showing
8 changed files
with
26 additions
and
43 deletions
src/assets/images/index/01.1713103305.png
0 → 100644
81.5 KB
src/assets/images/index/02.1713103305.png
0 → 100644
138 KB
src/assets/images/index/03.1713103305.png
0 → 100644
186 KB
src/assets/images/index/04.1713103305.png
0 → 100644
43.1 KB
src/assets/images/index/05.1713103305.png
0 → 100644
9.69 KB
src/assets/images/index/06.1713103305.png
0 → 100644
19.4 KB
src/assets/images/index/bg.1713103305.jpg
0 → 100644
169 KB
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-04-07 10:15:55 | 2 | * @Date: 2024-04-07 10:15:55 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-04-14 10:05:55 | 4 | + * @LastEditTime: 2024-04-14 22:39:32 |
| 5 | * @FilePath: /fxPark/src/views/fxPark/index.vue | 5 | * @FilePath: /fxPark/src/views/fxPark/index.vue |
| 6 | * @Description: 首页 | 6 | * @Description: 首页 |
| 7 | --> | 7 | --> |
| ... | @@ -22,10 +22,15 @@ | ... | @@ -22,10 +22,15 @@ |
| 22 | <van-icon name="chat-o" /> <span>校园报名</span> | 22 | <van-icon name="chat-o" /> <span>校园报名</span> |
| 23 | </div> | 23 | </div> |
| 24 | </div> | 24 | </div> |
| 25 | - <div class="container" v-for="(item, index) in data_list" :key="index" @click="onChipClick()"> | 25 | + <div class="container" @click="onChipClick()"> |
| 26 | - <img :src="item.chip_src" class="img" :style="{ zIndex: index }"> | 26 | + <img |
| 27 | - <!-- 示例范围标记 --> | 27 | + v-for="(item, index) in data_list" |
| 28 | - <!-- <div class="range"></div> --> | 28 | + :key="index" |
| 29 | + :src="item.chip_src" | ||
| 30 | + class="img" | ||
| 31 | + :style="{ zIndex: index + 2 }" | ||
| 32 | + > | ||
| 33 | + <img src="https://cdn.ipadbiz.cn/xfPark/index/bg.1713103305.jpg" class="img" style="z-index: 1;"> | ||
| 29 | </div> | 34 | </div> |
| 30 | 35 | ||
| 31 | <van-action-sheet v-model:show="show_danmu_message" title="留言" :round="false" :close-on-click-overlay="false" :closeable="false"> | 36 | <van-action-sheet v-model:show="show_danmu_message" title="留言" :round="false" :close-on-click-overlay="false" :closeable="false"> |
| ... | @@ -79,28 +84,25 @@ useTitle($route.meta.title); | ... | @@ -79,28 +84,25 @@ useTitle($route.meta.title); |
| 79 | 84 | ||
| 80 | const TREE_CHIP = { // 碎片图结构 | 85 | const TREE_CHIP = { // 碎片图结构 |
| 81 | 1: { | 86 | 1: { |
| 82 | - invalid: 'https://cdn.ipadbiz.cn/tmp/fx_park/s1.png', | 87 | + active: 'https://cdn.ipadbiz.cn/xfPark/index/01.1713103305.png' |
| 83 | - active: 'https://cdn.ipadbiz.cn/tmp/fx_park/s1.png' | ||
| 84 | }, | 88 | }, |
| 85 | 2: { | 89 | 2: { |
| 86 | - invalid: 'https://cdn.ipadbiz.cn/tmp/fx_park/s2.png', | 90 | + active: 'https://cdn.ipadbiz.cn/xfPark/index/02.1713103305.png' |
| 87 | - active: 'https://cdn.ipadbiz.cn/tmp/fx_park/s2.png' | ||
| 88 | }, | 91 | }, |
| 89 | 3: { | 92 | 3: { |
| 90 | - invalid: 'https://cdn.ipadbiz.cn/tmp/fx_park/s3.png', | 93 | + active: 'https://cdn.ipadbiz.cn/xfPark/index/03.1713103305.png' |
| 91 | - active: 'https://cdn.ipadbiz.cn/tmp/fx_park/s3.png' | ||
| 92 | }, | 94 | }, |
| 93 | 4: { | 95 | 4: { |
| 94 | - invalid: 'https://cdn.ipadbiz.cn/tmp/fx_park/s4.png', | 96 | + active: 'https://cdn.ipadbiz.cn/xfPark/index/04.1713103305.png' |
| 95 | - active: 'https://cdn.ipadbiz.cn/tmp/fx_park/s4.png' | ||
| 96 | }, | 97 | }, |
| 97 | 5: { | 98 | 5: { |
| 98 | - invalid: 'https://cdn.ipadbiz.cn/tmp/fx_park/s5.png', | 99 | + active: 'https://cdn.ipadbiz.cn/xfPark/index/05.1713103305.png' |
| 99 | - active: 'https://cdn.ipadbiz.cn/tmp/fx_park/s5.png' | ||
| 100 | }, | 100 | }, |
| 101 | 6: { | 101 | 6: { |
| 102 | - invalid: 'https://cdn.ipadbiz.cn/tmp/fx_park/s6.png', | 102 | + active: 'https://cdn.ipadbiz.cn/xfPark/index/06.1713103305.png' |
| 103 | - active: 'https://cdn.ipadbiz.cn/tmp/fx_park/s6.png' | 103 | + }, |
| 104 | + 7: { | ||
| 105 | + active: '' | ||
| 104 | }, | 106 | }, |
| 105 | }; | 107 | }; |
| 106 | 108 | ||
| ... | @@ -120,36 +122,17 @@ onMounted(async () => { | ... | @@ -120,36 +122,17 @@ onMounted(async () => { |
| 120 | const { code, data } = await getTreeAPI(); | 122 | const { code, data } = await getTreeAPI(); |
| 121 | if (code) { | 123 | if (code) { |
| 122 | let index = data.findIndex(item => item.is_tree === 0); // 全点亮标识 | 124 | let index = data.findIndex(item => item.is_tree === 0); // 全点亮标识 |
| 123 | - if (index === -1) { // 未全点亮 | 125 | + |
| 124 | - data.forEach(item => { | 126 | + data_list.value = data.filter(item => item.is_tree === 1); // 获取植物信息,提出最后一个非植物。 |
| 125 | - item.chip_src = item.is_light === '0' ? TREE_CHIP[item.revision]['invalid'] : TREE_CHIP[item.revision]['active']; // 根据点亮状态,显示碎片地址 | 127 | + data_list.value.forEach(item => { |
| 128 | + item.chip_src = item.is_light === '0' ? '' : TREE_CHIP[item.revision]['active']; // 根据点亮状态,显示碎片地址 | ||
| 126 | }); | 129 | }); |
| 127 | - } else { // 全点亮 | 130 | + |
| 131 | + console.log("🚀 ~ file: index.vue:137 ~ onMounted ~ data_list.value:", data_list.value); | ||
| 132 | + if (index !== -1) { // 全点亮 | ||
| 128 | all_actived.value = true; | 133 | all_actived.value = true; |
| 129 | - // 过滤树类型碎片 | ||
| 130 | - data | ||
| 131 | - .filter(item => item.is_tree === 1) | ||
| 132 | - .forEach(item => { | ||
| 133 | - item.chip_src = TREE_CHIP[item.revision]['active']; | ||
| 134 | - }); | ||
| 135 | } | 134 | } |
| 136 | - // | ||
| 137 | - data_list.value = data; | ||
| 138 | } | 135 | } |
| 139 | - // | ||
| 140 | - // nextTick(() => { | ||
| 141 | - // $('.container').on('click', function(event) { | ||
| 142 | - // const rect = event.target.getBoundingClientRect(); // 获取图片位置信息 | ||
| 143 | - // const x = event.clientX - rect.left; // 鼠标点击位置相对于图片左边的距离 | ||
| 144 | - // const y = event.clientY - rect.top; // 鼠标点击位置相对于图片顶部的距离 | ||
| 145 | - // // 示例范围标记位置 | ||
| 146 | - // $('.range').css({ left: x + 'px', top: y + 'px' }).show(); // 更新范围标记位置并显示 | ||
| 147 | - // // 判断点击范围是否在图片的矩形内 | ||
| 148 | - // if (x >= 0 && x <= 50 && y >= 0 && y <= 50) { | ||
| 149 | - // alert('点击了图片的矩形范围内'); | ||
| 150 | - // } | ||
| 151 | - // }); | ||
| 152 | - // }); | ||
| 153 | }); | 136 | }); |
| 154 | 137 | ||
| 155 | const RefDanmu = ref(null); | 138 | const RefDanmu = ref(null); | ... | ... |
-
Please register or login to post a comment