-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from lndj/feature_setting
Feature setting
- Loading branch information
Showing
12 changed files
with
297 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<template> | ||
<div class="container"> | ||
<van-nav-bar title="小特社区" :fixed="true" left-arrow @click-left="onClickLeft" /> | ||
<div style="height:46px;"></div> | ||
|
||
<div class="about-icon"> | ||
<van-image | ||
round | ||
width="8rem" | ||
height="8rem" | ||
:src="AvatarImage" | ||
/> | ||
</div> | ||
|
||
<div class="about-block"> | ||
|
||
<span>本插件进攻学习交流,请勿用于其他用途。</span> | ||
<span>代码:<a href="https://github.com/lndj/chrome-xiaote" target="_blank">https://github.com/lndj/chrome-xiaote</a></span> | ||
|
||
<span style="font-size: 16px;">使用我的 Tesla 推荐码购车,你我均可获得 1500KM 的免费超充额度,邀请链接:<br /><br /> <a href="https://ts.la/lnanddj59482" target="_blank">点我去购买(lnanddj59482)</a></span> | ||
</div> | ||
|
||
<!-- <div style="height:46px;"></div> --> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { mapGetters } from 'vuex'; | ||
import AvatarImage from '@/assets/images/avatar.jpeg'; | ||
export default { | ||
name: 'About', | ||
data() { | ||
return { | ||
AvatarImage: AvatarImage, | ||
}; | ||
}, | ||
created() { | ||
document.body.scrollTop = document.documentElement.scrollTop = 0; | ||
}, | ||
computed: { | ||
...mapGetters(['currentPost']), | ||
}, | ||
filters: { | ||
}, | ||
methods: { | ||
onClickLeft() { | ||
this.$router.go(-1); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.about-block { | ||
margin-top: 40px; | ||
} | ||
span { | ||
font-size: 14px; | ||
text-align: center; | ||
display: block; | ||
margin: 20px 20px 0 20px; | ||
color: rgba(69, 90, 100, 0.6); | ||
} | ||
.about-icon { | ||
text-align: center; | ||
margin-top: 20px; | ||
} | ||
a { | ||
color: rgba(10, 90, 200, 0.6); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<template> | ||
<div class="container"> | ||
<van-nav-bar title="小特社区" :fixed="true" left-arrow @click-left="onClickLeft" /> | ||
<div style="height:46px;"></div> | ||
|
||
<div class="setting-block"> | ||
<div class="setting-block-title"> | ||
<p>新帖子通知</p> | ||
</div> | ||
<van-cell title="开启新帖子通知"> | ||
<van-switch v-model="openNewPostNitice" slot="right-icon" size="24" /> | ||
</van-cell> | ||
<van-field | ||
v-model="newPostNiticeDeltaMinute" | ||
center | ||
type="number" | ||
:disabled="!openNewPostNitice" | ||
clearable | ||
label="间隔分钟" | ||
placeholder="请输入分钟" | ||
> | ||
<van-button slot="button" size="small" type="primary" @click="saveNoticeConfig">保存</van-button> | ||
</van-field> | ||
</div> | ||
|
||
<!-- <div style="height:46px;"></div> --> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { mapGetters } from 'vuex'; | ||
import { Toast } from 'vant'; | ||
import AvatarImage from '@/assets/images/avatar.jpeg'; | ||
export default { | ||
name: 'Settings', | ||
data() { | ||
return { | ||
openNewPostNitice: null, | ||
newPostNiticeDeltaMinute: 5, | ||
}; | ||
}, | ||
created() { | ||
this.getNoticeConfig(); | ||
document.body.scrollTop = document.documentElement.scrollTop = 0; | ||
}, | ||
computed: { | ||
...mapGetters(['currentPost']), | ||
}, | ||
filters: { | ||
}, | ||
methods: { | ||
saveNoticeConfig() { | ||
const config = { | ||
openNewPostNitice: this.openNewPostNitice, | ||
newPostNiticeDeltaMinute: parseFloat(this.newPostNiticeDeltaMinute), | ||
}; | ||
chrome.storage.sync.set({'newPostNotice': config}, function() { | ||
Toast.success('配置保存成功'); | ||
}); | ||
}, | ||
getNoticeConfig() { | ||
chrome.storage.sync.get('newPostNotice', config => { | ||
if (config.newPostNotice) { | ||
this.openNewPostNitice = config.newPostNotice.openNewPostNitice; | ||
this.newPostNiticeDeltaMinute = config.newPostNotice.newPostNiticeDeltaMinute; | ||
} | ||
}); | ||
}, | ||
formatter(value) { | ||
return value + ' 分钟'; | ||
}, | ||
onClickLeft() { | ||
this.$router.go(-1); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.setting-block-title { | ||
margin: 0; | ||
padding: 32px 12px 16px; | ||
color: rgba(69, 90, 100, 0.6); | ||
font-weight: normal; | ||
font-size: 14px; | ||
line-height: 8px; | ||
} | ||
.statistics-name { | ||
display: block; | ||
text-align: center; | ||
font-size: 14px; | ||
font-weight: 100; | ||
color: gray; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.