新增使用协议

This commit is contained in:
lyswhut
2020-04-23 12:12:46 +08:00
parent 9460b12cf9
commit 7bd4002f09
9 changed files with 240 additions and 49 deletions
+24 -15
View File
@@ -6,7 +6,7 @@ transition(enter-active-class="animated fadeIn"
:leave-active-class="outClass")
div(:class="$style.content" v-show="show" @click.stop)
header(:class="$style.header")
button(type="button" @click="close")
button(type="button" @click="close" v-if="closeBtn")
svg(version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' height='100%' viewBox='0 0 212.982 212.982' space='preserve')
use(xlink:href='#icon-delete')
slot
@@ -21,6 +21,10 @@ export default {
type: Boolean,
default: false,
},
closeBtn: {
type: Boolean,
default: true,
},
bgClose: {
type: Boolean,
default: false,
@@ -80,25 +84,28 @@ export default {
...mapGetters(['setting']),
},
watch: {
'setting.randomAnimate': {
handler(n) {
if (n) {
this.unwatchFn = this.$watch('show', function(n) {
if (n) {
this.inClass = 'animated ' + this.animateIn[getRandom(0, this.animateIn.length)]
this.outClass = 'animated ' + this.animateOut[getRandom(0, this.animateOut.length)]
}
})
} else {
this.unwatchFn && this.unwatchFn()
}
},
immediate: true,
'setting.randomAnimate'(n) {
n ? this.createWatch() : this.removeWatch()
},
},
mounted() {
if (this.setting.randomAnimate) this.createWatch()
},
methods: {
createWatch() {
this.removeWatch()
this.unwatchFn = this.$watch('show', function(n) {
this.inClass = 'animated ' + this.animateIn[getRandom(0, this.animateIn.length)]
this.outClass = 'animated ' + this.animateOut[getRandom(0, this.animateOut.length)]
})
this.inClass = 'animated ' + this.animateIn[getRandom(0, this.animateIn.length)]
this.outClass = 'animated ' + this.animateOut[getRandom(0, this.animateOut.length)]
},
removeWatch() {
if (!this.unwatchFn) return
this.unwatchFn()
this.unwatchFn = null
},
close() {
this.$emit('close')
},
@@ -142,7 +149,9 @@ export default {
flex: none;
background-color: @color-theme;
display: flex;
align-items: center;
justify-content: flex-end;
height: 18px;
button {
border: none;
@@ -0,0 +1,176 @@
<template lang="pug">
material-modal(:show="!setting.isAgreePact || globalObj.isShowPact" @close="handleClose(false)" :bgClose="setting.isAgreePact" :close-btn="setting.isAgreePact")
main(:class="$style.main")
h2 许可协议
div.select.scroll(:class="$style.content")
p
| 本项目(软件)基于
strong.hover.underline(@click="openUrl('http://www.apache.org/licenses/LICENSE-2.0')") Apache License 2.0
| &nbsp;许可证发行,在使用本软件前,你(使用者)需签署本协议才可继续使用,以下协议是对于 Apache License 2.0 的补充,如有冲突,以以下协议为准。
br
p 词语约定:本协议中的“本软件”指洛雪音乐桌面版项目;“使用者”指签署本协议的使用者;“官方音乐平台”指对本软件内置的包括酷我、酷狗、咪咕等音乐源的官方平台统称;“版权数据”指包括但不限于图像、音频、名字等在内的他人拥有所属版权的数据。
br
p
strong 1、
| 本软件的数据来源原理是从各官方音乐平台的公开服务器中拉取数据,经过对数据简单地筛选与合并后进行展示,因此本软件不对数据的准确性负责。
p
strong 2、
| 使用本软件的过程中可能会产生版权数据,对于这些版权数据,本软件不拥有它们的所有权,为了避免造成侵权,使用者务必在
strong 24小时内
| 清除使用本软件的过程中所产生的版权数据。
p
strong 3、
| 本软件内的官方音乐平台别名为本软件内对官方音乐平台的一个称呼,不包含恶意,如果官方音乐平台觉得不妥,可联系本软件更改或移除。
p
strong 4、
| 本软件内使用的部分包括但不限于字体、图片等资源来源于互联网,如果出现侵权可联系本软件移除。
p
strong 5、
| 由于使用本软件产生的包括由于本协议或由于使用或无法使用本软件而引起的任何性质的任何直接、间接、特殊、偶然或结果性损害(包括但不限于因商誉损失、停工、计算机故障或故障引起的损害赔偿,或任何及所有其他商业损害或损失)由使用者负责。
p
strong 6、
| 本项目完全免费,且开源发布于&nbsp;
span.hover.underline(@click="openUrl('https://github.com/lyswhut/lx-music-desktop#readme')") GitHub
| &nbsp;面向全世界人用作对技术的学习交流,本软件不对项目内的技术可能存在违反当地法律法规的行为作保证,
strong 禁止在违反当地法律法规的情况下使用本软件
|,对于使用者在明知或不知当地法律法规不允许的情况下使用本软件所造成的任何违法违规行为由使用者承担,本软件不承担由此造成的任何直接、间接、特殊、偶然或结果性责任。
br
p
strong *
| &nbsp;若协议更新,恕不另行通知,可到开源地址查看。
p
strong *
| &nbsp;本软件的初衷是帮助官方音乐平台简化数据后代为展示,帮助使用者根据歌曲名、艺术家等关键字快速地定位所需内容所在的音乐平台。
p
strong *
| &nbsp;音乐平台不易,建议到对应音乐平台支持正版资源。
br
p
strong 若你(使用者)接受以上协议,请点击下面的“接受”按钮签署本协议,若不接受,请点击“不接受”后退出软件并清除本软件的所有数据。
div(:class="$style.btns" v-if="!setting.isAgreePact")
material-btn(:class="$style.btn" @click="handleClose(true)") 不接受
material-btn(:class="$style.btn" :disabled="!btnEnable" @click="handleClick()") 接受 {{timeStr}}
</template>
<script>
import { mapGetters, mapMutations } from 'vuex'
import { rendererSend } from '../../../common/ipc'
import { openUrl } from '../../utils'
export default {
props: {
show: {
type: Boolean,
default: false,
},
},
data() {
return {
time: 20,
globalObj: {
isShowPact: false,
},
}
},
computed: {
...mapGetters(['setting']),
btnEnable() {
return this.time == 0
},
timeStr() {
return this.btnEnable ? '' : `(${this.time})`
},
},
mounted() {
if (!this.setting.isAgreePact) {
this.startTimeout()
}
this.$nextTick(() => {
this.globalObj = window.globalObj
})
},
methods: {
...mapMutations(['setAgreePact']),
handleClick() {
this.setAgreePact()
},
handleClose(isExit) {
if (isExit) return rendererSend('close', true)
this.globalObj.isShowPact = false
},
openUrl(url) {
openUrl(url)
},
startTimeout() {
setTimeout(() => {
if (--this.time > 0) this.startTimeout()
}, 1000)
},
},
}
</script>
<style lang="less" module>
@import '../../assets/styles/layout.less';
.main {
padding: 15px;
max-width: 550px;
min-width: 200px;
min-height: 0;
display: flex;
flex-flow: column nowrap;
justify-content: center;
h2 {
font-size: 16px;
color: @color-theme_2-font;
line-height: 1.3;
text-align: center;
}
}
.content {
flex: auto;
margin: 15px 0;
padding-right: 5px;
h3 {
font-weight: bold;
line-height: 2;
}
p {
line-height: 1.5;
font-size: 14px;
text-align: justify;
}
}
.btns {
display: flex;
align-items: center;
justify-content: space-between;
}
.btn {
display: block;
width: 48%;
&:last-child {
margin-bottom: 0;
}
}
each(@themes, {
:global(#container.@{value}) {
.main {
h2 {
color: ~'@{color-@{value}-theme_2-font}';
}
}
.name {
color: ~'@{color-@{value}-theme}';
}
}
})
</style>