first commit
This commit is contained in:
@@ -0,0 +1,670 @@
|
||||
<template>
|
||||
<!-- 顶部工具栏 -->
|
||||
<TopBar @click-login="loginVisible = true" />
|
||||
|
||||
<div class="main_boarder">
|
||||
<div class="main_content">
|
||||
<ul class="software_list">
|
||||
<li v-for="software in softwareList" :key="software.softwareId">
|
||||
<!--图标-->
|
||||
<div>
|
||||
<a href="javascript:void(0);" @click="getSoftwareVersion(software.softwareId)">
|
||||
<img class="icon" :src="getSoftwareIcon(software.softwareId)" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!--软件名-->
|
||||
<div class="name">
|
||||
<a href="javascript:void(0);" @click="getSoftwareVersion(software.softwareId)">
|
||||
{{ software.name }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="os_list">
|
||||
<template v-for="(item, bit) in 3" :key="bit">
|
||||
<div class="os_border" v-if="isOsShow(software.os, bit)">
|
||||
<a class="os_img" href="javascript:void(0);" @click="getSoftwareVersion(software.softwareId, bit)">
|
||||
<img :class="`os_icon ${getOsName(bit)}`" :src="getOsIcon(software.softwareId, bit)" />
|
||||
</a>
|
||||
|
||||
<a class="os_txt" :href="`/software?id=${software.softwareId}&os=${bit}`">{{ getOsShowName(bit) }}</a>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!--下载信息-->
|
||||
<div class="download_content">
|
||||
<!--iOS-->
|
||||
<template v-if="swos == 2">
|
||||
<!--前往APP下载-->
|
||||
<a
|
||||
href="https://apps.apple.com/cn/app/%E5%94%B1%E4%BD%9C%E9%AD%94%E6%96%B9/id928747575"
|
||||
target="_blank"
|
||||
class="download_border a_button"
|
||||
>
|
||||
<img class="icon" src="@/assets/images/Software/icon_download.png" />
|
||||
<div class="msg">App Store</div>
|
||||
</a>
|
||||
<!--iOS二维码下载-->
|
||||
<div class="download_code">
|
||||
<img class="code" src="@/assets/images/Software/ios_qr2.png" />
|
||||
<div class="code_msg">扫码下载</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<!--安装包下载-->
|
||||
<a :href="downloadUrl()" class="download_border a_button" @click="handleDownload()">
|
||||
<img class="icon" src="@/assets/images/Software/icon_download.png" />
|
||||
<div class="msg">下载安装包</div>
|
||||
</a>
|
||||
|
||||
<!--Android-->
|
||||
<!--Android二维码下载-->
|
||||
<div v-if="swos == 1" class="download_code">
|
||||
<vue-qrcode
|
||||
:value="`${currentHost}${BASE_SOFTWARE_URL}${currVersion.installPath}`"
|
||||
:width="80"
|
||||
type="image/png"
|
||||
color="#000"
|
||||
:margin="2"
|
||||
/>
|
||||
<div class="code_msg">扫码下载</div>
|
||||
</div>
|
||||
|
||||
<!--PC-->
|
||||
<template v-else>
|
||||
<!--音色库下载-->
|
||||
<a href="javascript:;" class="download_border a_button" @click="showFonts(true)">
|
||||
<img class="icon" src="@/assets/images/Software/icon_download.png" />
|
||||
<div class="msg">下载音色库</div>
|
||||
</a>
|
||||
|
||||
<el-dialog
|
||||
v-model="isFontsVisible"
|
||||
title="音色库下载"
|
||||
width="800"
|
||||
center
|
||||
destroy-on-close
|
||||
:show-close="false"
|
||||
>
|
||||
<div class="fonts_border">
|
||||
<ul class="fonts_list">
|
||||
<li v-for="font in fontList" :key="font.fontsId">
|
||||
<div class="font_left">
|
||||
<!--图标-->
|
||||
<img class="icon" src="@/assets/images/Software/icon_font.png" />
|
||||
<!--信息-->
|
||||
<div class="info">
|
||||
<!--音色库名-->
|
||||
<div class="info_option">
|
||||
<div class="info_title">音色库名</div>
|
||||
<div class="info_val">{{ font.name }}</div>
|
||||
</div>
|
||||
<!--大小-->
|
||||
<div class="info_option">
|
||||
<div class="info_title">大小</div>
|
||||
<div class="info_val">{{ formatFileSize(font.size) }}</div>
|
||||
</div>
|
||||
<!--描述-->
|
||||
<div class="info_option">
|
||||
<div class="info_title">说明</div>
|
||||
<div class="info_val">{{ font.describe }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--下载-->
|
||||
<a :href="`${BASE_FONT_URL}${font.path}`" class="download a_button">
|
||||
<img class="download_icon" src="@/assets/images/Software/icon_download.png" />
|
||||
<div class="download_msg">下载</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="fonts_close" @click="showFonts(false)">关闭</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
<!--分隔线-->
|
||||
<div class="line" style="margin-top: 30px"></div>
|
||||
|
||||
<!--版本信息-->
|
||||
<ul class="versions">
|
||||
<!--版本-->
|
||||
<li>
|
||||
<div class="title">当前版本</div>
|
||||
<div class="val">{{ currVersion.version }}</div>
|
||||
</li>
|
||||
<!--大小-->
|
||||
<li>
|
||||
<div class="title">安装包大小</div>
|
||||
<div class="val">{{ formatFileSize(currVersion.packageSize) }}</div>
|
||||
</li>
|
||||
<!--更新时间-->
|
||||
<li>
|
||||
<div class="title">更新时间</div>
|
||||
<div class="val">{{ formatDate(currVersion.releaseDate) }}</div>
|
||||
</li>
|
||||
<!--适应系统-->
|
||||
<li>
|
||||
<div class="title">适应系统</div>
|
||||
<div class="val">{{ getOsSuit(swos) }}</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!--更新说明-->
|
||||
<div class="update_msg_title">更新内容</div>
|
||||
<div class="update_msg">{{ currVersion.describe }}</div>
|
||||
|
||||
<!--分隔线-->
|
||||
<div class="line"></div>
|
||||
|
||||
<!--宣传图片-->
|
||||
<div class="pic_border">
|
||||
<ul class="pic_list">
|
||||
<li v-for="(pic, index) in currVersion.pictures" :key="index">
|
||||
<img :src="getPicSrc(pic)" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ICP备案 -->
|
||||
<IcpBar v-show="icpVisible" />
|
||||
<LoginDialog v-model:visible="loginVisible" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { isMobile_pc, is_andriod_ios } from "@/utils/device-type";
|
||||
import SoftwareAPI, { SoftwareInfo, VersionInfo, FontInfo } from "@/api/software";
|
||||
import { useRoute } from "vue-router";
|
||||
import { formatDate } from "@/utils/format";
|
||||
import { BASE_SOFTWARE_URL, BASE_FONT_URL } from "@/utils/baseurls";
|
||||
|
||||
// 窗口高度
|
||||
const { height } = useWindowSize();
|
||||
|
||||
// 是否显示 ICP 备案信息
|
||||
const icpVisible = ref(true);
|
||||
const loginVisible = ref(false);
|
||||
const isFontsVisible = ref(false);
|
||||
const swid = ref(2);
|
||||
const swos = ref(0);
|
||||
const currentHost = ref(window.location.protocol + "//" + window.location.host);
|
||||
|
||||
let softwareList = ref([] as SoftwareInfo[]);
|
||||
let fontList = ref([] as FontInfo[]);
|
||||
let currVersion = ref({} as VersionInfo);
|
||||
|
||||
/** 根据屏幕高度切换设备模式 */
|
||||
watchEffect(() => {
|
||||
if (height.value < 600) {
|
||||
icpVisible.value = false;
|
||||
} else {
|
||||
icpVisible.value = true;
|
||||
}
|
||||
});
|
||||
|
||||
function getSoftwareList() {
|
||||
SoftwareAPI.listSoftware().then((data) => {
|
||||
softwareList.value = data;
|
||||
});
|
||||
}
|
||||
|
||||
function getFontList() {
|
||||
SoftwareAPI.listFont().then((data) => {
|
||||
fontList.value = data;
|
||||
});
|
||||
}
|
||||
|
||||
function getSoftwareVersion(id: number, os?: number) {
|
||||
if (os == undefined) {
|
||||
if (id == 3) os = 0;
|
||||
else if (id == 4 && swos.value == 0) os = 1;
|
||||
else os = swos.value;
|
||||
}
|
||||
|
||||
SoftwareAPI.getVersion(id, os).then((data) => {
|
||||
swid.value = data.softwareId;
|
||||
swos.value = data.os;
|
||||
currVersion.value = data;
|
||||
|
||||
// console.log(swid.value, swos.value);
|
||||
});
|
||||
}
|
||||
|
||||
const getSoftwareIcon = computed(() => (id: number) => {
|
||||
return id == swid.value
|
||||
? new URL("@/assets/images/Software/ac_one_focus.png", import.meta.url).href
|
||||
: new URL("@/assets/images/Software/ac_one_blur.png", import.meta.url).href;
|
||||
});
|
||||
|
||||
const getOsIcon = computed(() => (id: number, os: number) => {
|
||||
let src = "icon_";
|
||||
|
||||
if (os == 1) src += "android_";
|
||||
else if (os == 2) src += "ios_";
|
||||
else src += "pc_";
|
||||
|
||||
src += id == swid.value && os == swos.value ? "focus" : "blur";
|
||||
|
||||
return new URL(`../../assets/images/Software/${src}.png`, import.meta.url).href;
|
||||
});
|
||||
|
||||
const getOsName = (bit: number) => {
|
||||
if (bit == 0) return "windows";
|
||||
if (bit == 1) return "android";
|
||||
if (bit == 2) return "ios";
|
||||
};
|
||||
const getOsShowName = (bit: number) => {
|
||||
if (bit == 0) return "Windows";
|
||||
if (bit == 1) return "Android";
|
||||
if (bit == 2) return "iOS";
|
||||
};
|
||||
|
||||
const isOsShow = (os: number, bit: number) => {
|
||||
return os & (1 << bit);
|
||||
};
|
||||
|
||||
const getOsSuit = (os: number) => {
|
||||
if (os == 0) return "winXP以上";
|
||||
if (os == 1) return "android 2.3 以上";
|
||||
if (os == 2) return "iOS 5.1 以上";
|
||||
};
|
||||
|
||||
const formatFileSize = (size: number) => {
|
||||
const sm = (size / 1024 / 1024.0).toFixed(2);
|
||||
|
||||
return `${sm}MB`;
|
||||
};
|
||||
|
||||
const getPicSrc = (pic: string) => {
|
||||
return "/File/Software/Content/" + pic;
|
||||
};
|
||||
|
||||
function downloadUrl() {
|
||||
let prefix = "";
|
||||
if (currVersion.value.softwareId != 3) {
|
||||
prefix = "http://124.220.61.195";
|
||||
}
|
||||
return prefix + BASE_SOFTWARE_URL + currVersion.value.installPath; //`${BASE_SOFTWARE_URL}${currVersion.value.installPath}`;
|
||||
}
|
||||
|
||||
function showFonts(show: boolean) {
|
||||
isFontsVisible.value = show;
|
||||
}
|
||||
|
||||
function handleDownload() {
|
||||
SoftwareAPI.swDownload(currVersion.value.softwareId, currVersion.value.os);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const route = useRoute();
|
||||
if (route.query.os) {
|
||||
if (route.query.os.length == 1) swos.value = parseInt(route.query.os as string);
|
||||
else if (route.query.os == "android") swos.value = 1;
|
||||
else if (route.query.os == "ios") swos.value = 2;
|
||||
} else if (route.params.os) {
|
||||
if (route.params.os.length == 1) swos.value = parseInt(route.params.os as string);
|
||||
else if (route.params.os == "android") swos.value = 1;
|
||||
else if (route.params.os == "ios") swos.value = 2;
|
||||
} else if (isMobile_pc()) {
|
||||
const types = is_andriod_ios();
|
||||
if (is_andriod_ios().iPhone || is_andriod_ios().iPad || is_andriod_ios().ios) swos.value = 2;
|
||||
else if (is_andriod_ios().android) swos.value = 1;
|
||||
} else {
|
||||
swid.value = 3; //PC网页浏览缺省显示Pro
|
||||
}
|
||||
|
||||
if (route.query.fonts) {
|
||||
isFontsVisible.value = route.query.fonts == "1";
|
||||
} else if (route.params.fonts) {
|
||||
isFontsVisible.value = route.params.fonts == "1";
|
||||
}
|
||||
|
||||
if (route.query.id) {
|
||||
swid.value = parseInt(route.query.id as string);
|
||||
window.history.replaceState(history.state, "", route.path);
|
||||
} else if (route.params.id) {
|
||||
swid.value = parseInt(route.params.id as string);
|
||||
window.history.replaceState(history.state, "", "/software");
|
||||
}
|
||||
|
||||
getSoftwareList();
|
||||
getFontList();
|
||||
getSoftwareVersion(swid.value, swos.value);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.main_boarder {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #f4f4f4;
|
||||
padding-top: 90px;
|
||||
overflow: auto;
|
||||
|
||||
div {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.main_content {
|
||||
width: 100%;
|
||||
max-width: 1024px;
|
||||
|
||||
.software_list {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
|
||||
li {
|
||||
width: 220px;
|
||||
height: 220px;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
box-shadow: 0 1px 5px #ccc;
|
||||
background-color: #fff;
|
||||
|
||||
img.icon {
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
&:hover {
|
||||
content: url("@/assets/images/Software/ac_one_focus.png");
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
a {
|
||||
color: #000;
|
||||
|
||||
.on,
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.os_list {
|
||||
display: flex;
|
||||
padding: 0 10px 0 10px;
|
||||
justify-content: space-around;
|
||||
width: 100%;
|
||||
|
||||
.os_border {
|
||||
width: 55px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 10px;
|
||||
|
||||
img.os_icon {
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
img.windows {
|
||||
&:hover {
|
||||
content: url("@/assets/images/Software/icon_pc_focus.png");
|
||||
}
|
||||
}
|
||||
img.android {
|
||||
&:hover {
|
||||
content: url("@/assets/images/Software/icon_android_focus.png");
|
||||
}
|
||||
}
|
||||
img.ios {
|
||||
&:hover {
|
||||
content: url("@/assets/images/Software/icon_ios_focus.png");
|
||||
}
|
||||
}
|
||||
|
||||
a.os_txt {
|
||||
font-size: 12px;
|
||||
height: 25px;
|
||||
color: #000;
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
margin: 20px 0 0 0;
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
/*版本信息*/
|
||||
ul.versions {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 20px 0 0 0;
|
||||
li {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
margin: 0;
|
||||
|
||||
.title {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.val {
|
||||
margin: 0 0 0 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.update_msg_title {
|
||||
margin: 20px 0 0 0;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.update_msg {
|
||||
margin: 5px 0 0 15px;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
/*宣传图片*/
|
||||
.pic_border {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
.pic_list li img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
float: left;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.download_content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
|
||||
.a_button {
|
||||
background-color: #fafafa;
|
||||
height: 20px;
|
||||
float: left;
|
||||
padding: 1px 8px 1px 8px;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
border: 1px solid #555;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0px 1px 3px #999;
|
||||
|
||||
&:hover {
|
||||
background-color: #eae9e9;
|
||||
color: #333;
|
||||
}
|
||||
&:active {
|
||||
background-color: #d7d7d7;
|
||||
}
|
||||
}
|
||||
|
||||
/*下载信息*/
|
||||
a.download_border {
|
||||
width: 140px;
|
||||
height: 40px;
|
||||
padding: 0;
|
||||
margin-top: 30px;
|
||||
color: #000;
|
||||
border: 1px solid #cccccc;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0px 1px 1px #ddd;
|
||||
|
||||
img.icon {
|
||||
height: 21px;
|
||||
float: left;
|
||||
margin: 10px 0 0 15px;
|
||||
}
|
||||
.msg {
|
||||
width: 100px;
|
||||
float: left;
|
||||
margin: 10px 0 0 0;
|
||||
text-align: center;
|
||||
font-weight: 100;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.download_code {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
margin: 30px 0 0 0;
|
||||
border: 1px solid #ccc;
|
||||
box-shadow: 0px 1px 1px #ddd;
|
||||
img.code {
|
||||
width: 80px;
|
||||
float: left;
|
||||
margin: 0;
|
||||
}
|
||||
.code_msg {
|
||||
float: left;
|
||||
font-size: 12px;
|
||||
margin: 2px 0 5px 0;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
/*音色库*/
|
||||
.fonts_border {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
border-top: 1px solid #ccc;
|
||||
|
||||
ul.fonts_list {
|
||||
width: 100%;
|
||||
margin: 0 20px 0 20px;
|
||||
li {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #ccc;
|
||||
&:hover {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
.font_left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 20px 0 20px 10px;
|
||||
|
||||
img.icon {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.info_option {
|
||||
display: flex;
|
||||
margin: 10px 0 10px 20px;
|
||||
|
||||
.info_title {
|
||||
width: 58px;
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
}
|
||||
.info_val {
|
||||
margin-left: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
a.download {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
color: #000;
|
||||
border: 1px solid #cccccc;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0px 1px 1px #ddd;
|
||||
margin-right: 10px;
|
||||
|
||||
.download_icon {
|
||||
height: 21px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.download_msg {
|
||||
margin-right: 10px;
|
||||
text-align: center;
|
||||
font-weight: 100;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fonts_close {
|
||||
margin-top: 10px;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
html.dark {
|
||||
.main_boarder {
|
||||
background-color: #222;
|
||||
|
||||
.fonts_list li:hover {
|
||||
background-color: #333 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user