Compare commits

...

3 Commits

Author SHA1 Message Date
Silent YANG 51add00be1 update 2024-04-28 23:35:02 +08:00
Silent YANG 82ee2ad6f6 update 2024-04-28 21:35:44 +08:00
Silent YANG 82d7ef9341 update 2024-04-28 21:23:17 +08:00
12 changed files with 144 additions and 32 deletions

View File

@ -32,7 +32,7 @@
"qrcode": "^1.5.3",
"query-string": "^8.0.3",
"sortablejs": "^1.15.0",
"tdesign-vue-next": "^1.8.1",
"tdesign-vue-next": "^1.9.4",
"uuid": "^9.0.1",
"vue": "^3.2.40",
"vue-echarts": "^6.2.3",
@ -71,7 +71,7 @@
"rollup-plugin-visualizer": "^5.8.2",
"typescript": "^4.8.4",
"unplugin-auto-import": "^0.17.5",
"unplugin-vue-components": "^0.24.1",
"unplugin-vue-components": "^0.26.0",
"vite": "^3.2.5",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-imagemin": "^0.6.1",

BIN
public/1714006925783.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

BIN
public/img1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
public/img2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
public/img3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
public/img4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
public/img5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
public/img6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 KiB

View File

@ -3,10 +3,24 @@
<router-view />
<global-setting />
</a-config-provider>
<t-sticky-tool
:style="{ position: 'absolute', overflow: 'hidden' }"
:offset="[-20, 20]"
@click="handleClick"
@hover="handleHover"
>
<t-sticky-item label="问题反馈" :popup="renderQa" :popup-props="{ overlayInnerStyle: { margin: '10px', height: '450px' } }">
<template #icon><chat-icon /></template>
</t-sticky-item>
<t-sticky-item label="扫码红包" :popup="renderPopup" :popup-props="{ overlayInnerStyle: { margin: '10px', height: '450px' } }">
<template #icon><qrcode-icon /></template>
</t-sticky-item>
</t-sticky-tool>
</template>
<script lang="ts" setup>
import { computed } from 'vue';
import { ChatIcon, QrcodeIcon } from 'tdesign-icons-vue-next';
import { computed, h } from 'vue';
import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn';
import GlobalSetting from '@/components/global-setting/index.vue';
import useLocale from '@/hooks/locale';
@ -33,6 +47,14 @@
document.body.append(shynet);
}
const renderQa = () => {
return h("img", { src: '/qrcode_1714310463601.jpg', height: 440 });
}
const renderPopup = () => {
return h("img", { src: '/1714006925783.jpg', height: 440 });
};
const { currentLocale } = useLocale();
const locale = computed(() => {
switch (currentLocale.value) {

View File

@ -5,6 +5,37 @@
<a-col :span="24">
<a-spin :loading="state.loading" tip="写入中..." style="width: 100%;">
<a-card class="general-card" title="开机图片">
<a-row :gutter="20">
<a-col :span="4" v-for="i in [
{ name: '罗狮虎', url: '/img1.png'},
{ name: '离线小恐龙', url: '/img2.png'},
{ name: '不忘初心牢记使命', url: '/img3.png'},
{ name: '为人民服务', url: '/img4.png'},
{ name: '严禁收听敌台广播', url: '/img5.png'},
{ name: '爱因斯坦', url: '/img6.png'}
]">
<t-card :style="{ width: '100%' }">
<template #cover>
<img :title="i.name" :src="i.url">
</template>
<template #footer>
<t-row :align="'middle'" justify="center" style="gap: 24px">
<t-col flex="auto" style="display: inline-flex; justify-content: center">
<t-button variant="text" shape="square" @click="upImg(i)">
<thumb-up-icon />
</t-button>
</t-col>
<t-col flex="auto" style="display: inline-flex; justify-content: center">
<t-button variant="text" shape="square" @click="useImg(i)">
<check-double-icon />
</t-button>
</t-col>
</t-row>
</template>
</t-card>
</a-col>
</a-row>
<t-pagination style="margin: 10px;" :total="6" showPageNumber :showPageSize="false" />
<a-tabs :active-key="state.activeKey" @change="(e)=>{state.activeKey = e}">
<a-tab-pane :key="1" title="LOSEHU 117"></a-tab-pane>
<a-tab-pane :key="2" title="LOSEHU 118+"></a-tab-pane>
@ -23,6 +54,7 @@
</template>
<script lang="ts" setup>
import { ThumbUpIcon, CheckDoubleIcon } from 'tdesign-icons-vue-next';
import { reactive, nextTick } from 'vue';
import { useAppStore } from '@/store';
import { eeprom_write, eeprom_reboot, eeprom_init } from '@/utils/serial.js';
@ -39,6 +71,64 @@ const state : {
loading: false
})
const upImg = (i:any) => {
alert('图片工坊即将推出');
}
const useImg = (i:any) => {
const canvas = document.createElement("canvas");
canvas.width = 128;
canvas.height = 64;
const canvas2 = canvas.cloneNode();
const canvasDiv = document.getElementById('canvasDiv');
canvasDiv.innerHTML = "";
canvasDiv?.append(canvas, canvas2);
const img = new Image()
img.src = i.url;
img.onload = () => {
const ctx = canvas.getContext('2d');
ctx?.drawImage(img, 0, 0, 128, 64);
const imageData = ctx?.getImageData(0, 0, canvas.width, canvas.height).data;
function getPixel(x: any, y: any) {
const index = y * 128 + x;
const i = index * 4;
return imageData[i] + imageData[i + 1] + imageData[i + 2] > 128 * 3 ? 0 : 1;
}
const ctx2 = canvas2.getContext('2d');
const imageData2 = ctx2.getImageData(0, 0, canvas2.width, canvas2.height);
for (let y = 0; y < 64; y++) {
for (let x = 0; x < 128; x++) {
const index = y * 128 + x;
const i = index * 4;
const pixel = !getPixel(x, y);
imageData2.data[i] = pixel * 255;
imageData2.data[i + 1] = pixel * 255;
imageData2.data[i + 2] = pixel * 255;
imageData2.data[i + 3] = 255;
}
}
ctx2.putImageData(imageData2, 0, 0);
const outputArray = new Uint8Array(1024);
// getPixel(i) outputs the pixel value for any x y coordinate. 0 = black, 1 = white.
// the outputArray is 1024 bytes, where each byte is 8 pixels IN VERTICAL ORDER.
let i = 0;
for (let y = 0; y < 64; y += 8) {
for (let x = 0; x < 128; x++) {
let byte = 0;
for (let i = 0; i < 8; i++) {
byte |= getPixel(x, y + i) << i;
}
outputArray[i++] = byte;
}
}
state.binaryFile = outputArray;
}
}
const selectFile = () => {
const input = document.createElement('input');
input.type = 'file';

View File

@ -15,7 +15,7 @@
"@jridgewell/gen-mapping" "^0.3.5"
"@jridgewell/trace-mapping" "^0.3.24"
"@antfu/utils@^0.7.2", "@antfu/utils@^0.7.7":
"@antfu/utils@^0.7.6", "@antfu/utils@^0.7.7":
version "0.7.7"
resolved "https://registry.yarnpkg.com/@antfu/utils/-/utils-0.7.7.tgz#26ea493a831b4f3a85475e7157be02fb4eab51fb"
integrity sha512-gFPqTG7otEJ8uP6wrhDv6mqwGWYZKNvAcCq6u9hOj0c+IKCEsY4L1oC9trPq2SaWIzAfHvqfBDxF591JkMf+kg==
@ -1022,7 +1022,7 @@
"@electron-forge/maker-base" "^7.1.0"
app-builder-lib "^23.2.0"
"@rollup/pluginutils@^5.0.2", "@rollup/pluginutils@^5.1.0":
"@rollup/pluginutils@^5.0.4", "@rollup/pluginutils@^5.1.0":
version "5.1.0"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.1.0.tgz#7e53eddc8c7f483a4ad0b94afb1f7f5fd3c771e0"
integrity sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==
@ -3599,7 +3599,7 @@ fast-deep-equal@^3.1.1:
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
fast-glob@^3.0.3, fast-glob@^3.2.12, fast-glob@^3.2.7, fast-glob@^3.2.9, fast-glob@^3.3.2:
fast-glob@^3.0.3, fast-glob@^3.2.7, fast-glob@^3.2.9, fast-glob@^3.3.1, fast-glob@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129"
integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==
@ -5132,7 +5132,14 @@ lru-cache@^7.7.1:
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.18.3.tgz#f793896e0fd0e954a59dfdd82f0773808df6aa89"
integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==
magic-string@^0.30.0, magic-string@^0.30.5, magic-string@^0.30.7:
magic-string@^0.30.3:
version "0.30.10"
resolved "https://repo.vicicode.com/repository/npm-proxy/magic-string/-/magic-string-0.30.10.tgz#123d9c41a0cb5640c892b041d4cfb3bd0aa4b39e"
integrity sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==
dependencies:
"@jridgewell/sourcemap-codec" "^1.4.15"
magic-string@^0.30.5, magic-string@^0.30.7:
version "0.30.9"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.9.tgz#8927ae21bfdd856310e07a1bc8dd5e73cb6c251d"
integrity sha512-S1+hd+dIrC8EZqKyT9DstTH/0Z+f76kmmvZnkfQVmOpDEF9iVgdYif3Q/pIWHmCoo59bQVGW0kVL3e2nl+9+Sw==
@ -5340,13 +5347,6 @@ minimatch@^5.0.1:
dependencies:
brace-expansion "^2.0.1"
minimatch@^7.4.2:
version "7.4.6"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.6.tgz#845d6f254d8f4a5e4fd6baf44d5f10c8448365fb"
integrity sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==
dependencies:
brace-expansion "^2.0.1"
minimatch@^9.0.3:
version "9.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.4.tgz#8e49c731d1749cbec05050ee5145147b32496a51"
@ -6421,7 +6421,7 @@ resolve-package@^1.0.1:
dependencies:
get-installed-path "^2.0.3"
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.20.0, resolve@^1.22.1:
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.20.0, resolve@^1.22.1, resolve@^1.22.4:
version "1.22.8"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d"
integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==
@ -7033,10 +7033,10 @@ tdesign-icons-vue-next@^0.2.0:
dependencies:
"@babel/runtime" "^7.16.3"
tdesign-vue-next@^1.8.1:
version "1.9.3"
resolved "https://registry.yarnpkg.com/tdesign-vue-next/-/tdesign-vue-next-1.9.3.tgz#6be46ce998d16acba441f30dfc6667bb2440b6ed"
integrity sha512-mNne2lxoMnOeQbkc3zusvfsC+WZ02Dg5dCKzrVZJPh/RTKHrf+h+qphOduzApjLJ7Nd8hm5wPz3bMPIt5iLarw==
tdesign-vue-next@^1.9.4:
version "1.9.4"
resolved "https://repo.vicicode.com/repository/npm-proxy/tdesign-vue-next/-/tdesign-vue-next-1.9.4.tgz#21a9c117ffec607f1d2f060c5de53e724f4dfdb1"
integrity sha512-mbm2mGzM8WKCkxhFnJa9xyAhaXoP7i/TlJrIFe45BqI8cF3EMHuI6+Bb+8c6V320FSLpmlhChishIC8rGPcWYA==
dependencies:
"@babel/runtime" "^7.22.6"
"@popperjs/core" "^2.11.8"
@ -7322,7 +7322,7 @@ universalify@^2.0.0:
unplugin-auto-import@^0.17.5:
version "0.17.5"
resolved "https://registry.yarnpkg.com/unplugin-auto-import/-/unplugin-auto-import-0.17.5.tgz#5ae7164fddd1560e96bf9be23b2f5ef46c808ca6"
resolved "https://repo.vicicode.com/repository/npm-proxy/unplugin-auto-import/-/unplugin-auto-import-0.17.5.tgz#5ae7164fddd1560e96bf9be23b2f5ef46c808ca6"
integrity sha512-fHNDkDSxv3PGagX1wmKBYBkgaM4AKAgZmdJw/bxjhNljx9KSXSgHpGfX0MwUrq9qw6q1bhHIZVWyOwoY2koo4w==
dependencies:
"@antfu/utils" "^0.7.7"
@ -7334,23 +7334,23 @@ unplugin-auto-import@^0.17.5:
unimport "^3.7.1"
unplugin "^1.6.0"
unplugin-vue-components@^0.24.1:
version "0.24.1"
resolved "https://registry.yarnpkg.com/unplugin-vue-components/-/unplugin-vue-components-0.24.1.tgz#b5c3419c30a603dd795e3a0d63c4c12f4a5d8274"
integrity sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==
unplugin-vue-components@^0.26.0:
version "0.26.0"
resolved "https://repo.vicicode.com/repository/npm-proxy/unplugin-vue-components/-/unplugin-vue-components-0.26.0.tgz#6d79caa770039a1eb3d7c09fdd28778ea20afef3"
integrity sha512-s7IdPDlnOvPamjunVxw8kNgKNK8A5KM1YpK5j/p97jEKTjlPNrA0nZBiSfAKKlK1gWZuyWXlKL5dk3EDw874LQ==
dependencies:
"@antfu/utils" "^0.7.2"
"@rollup/pluginutils" "^5.0.2"
"@antfu/utils" "^0.7.6"
"@rollup/pluginutils" "^5.0.4"
chokidar "^3.5.3"
debug "^4.3.4"
fast-glob "^3.2.12"
fast-glob "^3.3.1"
local-pkg "^0.4.3"
magic-string "^0.30.0"
minimatch "^7.4.2"
resolve "^1.22.1"
unplugin "^1.1.0"
magic-string "^0.30.3"
minimatch "^9.0.3"
resolve "^1.22.4"
unplugin "^1.4.0"
unplugin@^1.1.0, unplugin@^1.5.1, unplugin@^1.6.0:
unplugin@^1.4.0, unplugin@^1.5.1, unplugin@^1.6.0:
version "1.10.1"
resolved "https://registry.yarnpkg.com/unplugin/-/unplugin-1.10.1.tgz#8ceda065dc71bc67d923dea0920f05c67f2cd68c"
integrity sha512-d6Mhq8RJeGA8UfKCu54Um4lFA0eSaRa3XxdAJg8tIdxbu1ubW0hBCZUL7yI2uGyYCRndvbK8FLHzqy2XKfeMsg==