优化更新按钮文案

This commit is contained in:
lyswhut 2021-05-17 17:31:59 +08:00
parent 0106feab16
commit b59a137fef
4 changed files with 16 additions and 5 deletions

View File

@ -104,8 +104,9 @@
"version_label_history": "History version:", "version_label_history": "History version:",
"version_tip_checking": "Checking for updates...⏳", "version_tip_checking": "Checking for updates...⏳",
"version_tip_downloaded": "The installation package has been downloaded.", "version_tip_downloaded": "The installation package has been downloaded.",
"version_tip_failed": "The installation package download failed. You can try again or go to the project address to manually download the new version update.", "version_tip_failed": "The download of the installation package failed. You can try again or go to the project address to manually download the new version update.",
"version_tip_unknown": "Failed to obtain the latest version information, it is recommended to manually go to the project address to check if there is a new version", "version_tip_unknown": "Failed to obtain the latest version information, it is recommended to manually go to the project address to check if there is a new version",
"version_tip_min": "It has been switched to background download, you can go to Settings-Software Update and reopen this pop-up window",
"version_tip_latest": "The software is up to date, please enjoy it~🥂", "version_tip_latest": "The software is up to date, please enjoy it~🥂",
"version_btn_new": "Update", "version_btn_new": "Update",
"version_btn_downloading": "I am trying to download...{{total}}/{{current}} ({{progress}}%)", "version_btn_downloading": "I am trying to download...{{total}}/{{current}} ({{progress}}%)",
@ -114,6 +115,7 @@
"version_btn_unknown": "Project Homepage", "version_btn_unknown": "Project Homepage",
"version_btn_ignore": "Ignore", "version_btn_ignore": "Ignore",
"version_btn_close": "Close", "version_btn_close": "Close",
"version_btn_min": "Background download",
"version_title_latest": "🎉 The current version is already the latest 🎊", "version_title_latest": "🎉 The current version is already the latest 🎊",
"version_title_checking": "⏳ Checking for updates ⏳", "version_title_checking": "⏳ Checking for updates ⏳",
"version_title_new": "🌟 New version found 🌟", "version_title_new": "🌟 New version found 🌟",

View File

@ -106,6 +106,7 @@
"version_tip_downloaded": "安装包已经下载完毕。", "version_tip_downloaded": "安装包已经下载完毕。",
"version_tip_failed": "安装包下载失败,你可以重试或者去项目地址手动下载新版更新。", "version_tip_failed": "安装包下载失败,你可以重试或者去项目地址手动下载新版更新。",
"version_tip_unknown": "获取最新版本信息失败,建议手动去项目地址检查是否有新版本", "version_tip_unknown": "获取最新版本信息失败,建议手动去项目地址检查是否有新版本",
"version_tip_min": "已切换到后台下载,你可以去 设置-软件更新 重新打开本弹窗哦",
"version_tip_latest": "软件已是最新,尽情地体验吧~🥂", "version_tip_latest": "软件已是最新,尽情地体验吧~🥂",
"version_btn_new": "更新", "version_btn_new": "更新",
"version_btn_downloading": "正在努力下载中...{{total}}/{{current}} ({{progress}}%)", "version_btn_downloading": "正在努力下载中...{{total}}/{{current}} ({{progress}}%)",
@ -114,6 +115,7 @@
"version_btn_unknown": "项目首页", "version_btn_unknown": "项目首页",
"version_btn_ignore": "忽略", "version_btn_ignore": "忽略",
"version_btn_close": "关闭", "version_btn_close": "关闭",
"version_btn_min": "后台下载",
"version_title_latest": "🎉 当前版本已是最新 🎊", "version_title_latest": "🎉 当前版本已是最新 🎊",
"version_title_checking": "⏳ 检查更新中 ⏳", "version_title_checking": "⏳ 检查更新中 ⏳",
"version_title_new": "🌟 发现新版本 🌟", "version_title_new": "🌟 发现新版本 🌟",

View File

@ -29,7 +29,7 @@ const VersionModal = ({ componentId }) => {
const setVersionInfo = useDispatch('common', 'setVersionInfo') const setVersionInfo = useDispatch('common', 'setVersionInfo')
const setIgnoreVersion = useDispatch('common', 'setIgnoreVersion') const setIgnoreVersion = useDispatch('common', 'setIgnoreVersion')
const [ignoreBtn, setIgnoreBtn] = useState({ text: t('version_btn_ignore'), show: true, disabled: false }) const [ignoreBtn, setIgnoreBtn] = useState({ text: t('version_btn_ignore'), show: true, disabled: false })
// const [closeBtn, setCloseBtn] = useState({ text: t('version_btn_close'), show: true, disabled: false }) const [closeBtnText, setCloseBtnText] = useState(t('version_btn_close'))
const [confirmBtn, setConfirmBtn] = useState({ text: t('version_btn_confirm'), show: true, disabled: false }) const [confirmBtn, setConfirmBtn] = useState({ text: t('version_btn_confirm'), show: true, disabled: false })
const [title, setTitle] = useState('') const [title, setTitle] = useState('')
const [tip, setTip] = useState('') const [tip, setTip] = useState('')
@ -114,6 +114,7 @@ const VersionModal = ({ componentId }) => {
setIgnoreBtn({ text: t('version_btn_ignore'), show: true, disabled: false }) setIgnoreBtn({ text: t('version_btn_ignore'), show: true, disabled: false })
setConfirmBtn({ text: t('version_btn_new'), show: true, disabled: false }) setConfirmBtn({ text: t('version_btn_new'), show: true, disabled: false })
// setTip(t('version_btn_new')) // setTip(t('version_btn_new'))
setCloseBtnText({ text: t('version_btn_close') })
break break
case VERSION_STATUS.downloading: case VERSION_STATUS.downloading:
setTitle(t('version_title_new')) setTitle(t('version_title_new'))
@ -124,30 +125,35 @@ const VersionModal = ({ componentId }) => {
})) }))
if (ignoreBtn.show) setIgnoreBtn({ text: t('version_btn_ignore'), show: false, disabled: true }) if (ignoreBtn.show) setIgnoreBtn({ text: t('version_btn_ignore'), show: false, disabled: true })
if (!confirmBtn.disabled) setConfirmBtn({ text: t('version_btn_update'), show: true, disabled: true }) if (!confirmBtn.disabled) setConfirmBtn({ text: t('version_btn_update'), show: true, disabled: true })
setCloseBtnText({ text: t('version_btn_min') })
break break
case VERSION_STATUS.downloaded: case VERSION_STATUS.downloaded:
setTitle(t('version_title_update')) setTitle(t('version_title_update'))
setTip('') setTip('')
if (ignoreBtn.show) setIgnoreBtn({ text: t('version_btn_ignore'), show: false, disabled: true }) if (ignoreBtn.show) setIgnoreBtn({ text: t('version_btn_ignore'), show: false, disabled: true })
setConfirmBtn({ text: t('version_btn_update'), show: true, disabled: false }) setConfirmBtn({ text: t('version_btn_update'), show: true, disabled: false })
setCloseBtnText({ text: t('version_btn_close') })
break break
case VERSION_STATUS.checking: case VERSION_STATUS.checking:
setTitle(t('version_title_checking')) setTitle(t('version_title_checking'))
setTip(t('')) setTip(t(''))
setIgnoreBtn({ text: t('version_btn_ignore'), show: false, disabled: true }) setIgnoreBtn({ text: t('version_btn_ignore'), show: false, disabled: true })
setConfirmBtn({ text: t('version_btn_new'), show: false, disabled: true }) setConfirmBtn({ text: t('version_btn_new'), show: false, disabled: true })
setCloseBtnText({ text: t('version_btn_close') })
break break
case VERSION_STATUS.failed: case VERSION_STATUS.failed:
setTitle(t('version_title_failed')) setTitle(t('version_title_failed'))
setTip(t('version_tip_failed')) setTip(t('version_tip_failed'))
setIgnoreBtn({ text: t('version_btn_ignore'), show: true, disabled: false }) setIgnoreBtn({ text: t('version_btn_ignore'), show: true, disabled: false })
setConfirmBtn({ text: t('version_btn_failed'), show: true, disabled: false }) setConfirmBtn({ text: t('version_btn_failed'), show: true, disabled: false })
setCloseBtnText({ text: t('version_btn_close') })
break break
case VERSION_STATUS.unknown: case VERSION_STATUS.unknown:
setTitle(t('version_title_unknown')) setTitle(t('version_title_unknown'))
setTip(t('version_tip_unknown')) setTip(t('version_tip_unknown'))
setIgnoreBtn({ text: t('version_btn_ignore'), show: false, disabled: true }) setIgnoreBtn({ text: t('version_btn_ignore'), show: false, disabled: true })
setConfirmBtn({ text: t('version_btn_unknown'), show: true, disabled: false }) setConfirmBtn({ text: t('version_btn_unknown'), show: true, disabled: false })
setCloseBtnText({ text: t('version_btn_close') })
break break
case VERSION_STATUS.latest: case VERSION_STATUS.latest:
default: default:
@ -155,6 +161,7 @@ const VersionModal = ({ componentId }) => {
setTip('') setTip('')
setIgnoreBtn({ text: t('version_btn_ignore'), show: false, disabled: true }) setIgnoreBtn({ text: t('version_btn_ignore'), show: false, disabled: true })
setConfirmBtn({ text: t('version_btn_new'), show: false, disabled: true }) setConfirmBtn({ text: t('version_btn_new'), show: false, disabled: true })
setCloseBtnText({ text: t('version_btn_close') })
break break
} }
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
@ -207,7 +214,7 @@ const VersionModal = ({ componentId }) => {
: null : null
} }
<Button style={{ ...styles.btn, backgroundColor: theme.secondary45 }} onPress={handleCancel}> <Button style={{ ...styles.btn, backgroundColor: theme.secondary45 }} onPress={handleCancel}>
<Text style={{ fontSize: 14, color: theme.secondary_5 }}>{t('version_btn_close')}</Text> <Text style={{ fontSize: 14, color: theme.secondary_5 }}>{closeBtnText}</Text>
</Button> </Button>
{ {
confirmBtn.show confirmBtn.show

View File

@ -165,7 +165,7 @@ const handlePlayMusic = async({ getState, dispatch, playMusicInfo, musicInfo, is
// console.log(AppState.currentState) // console.log(AppState.currentState)
if (!isRefresh && state.common.setting.player.togglePlayMethod == 'random') dispatch({ type: TYPES.addMusicToPlayedList, payload: playMusicInfo }) if (!isRefresh && state.common.setting.player.togglePlayMethod == 'random') dispatch({ type: TYPES.addMusicToPlayedList, payload: playMusicInfo })
console.log(musicInfo.img) // console.log(musicInfo.img)
if (!musicInfo.img) { if (!musicInfo.img) {
dispatch(getPic(musicInfo)).then(async() => { dispatch(getPic(musicInfo)).then(async() => {
if (playMusicId != id) return if (playMusicId != id) return
@ -378,7 +378,7 @@ export const getUrl = ({ musicInfo, type, isRefresh }) => async(dispatch, getSta
return handleGetUrl(dispatch, getState().player.listInfo.id, musicInfo, type).then(result => { return handleGetUrl(dispatch, getState().player.listInfo.id, musicInfo, type).then(result => {
saveMusicUrl(musicInfo, type, result.url) saveMusicUrl(musicInfo, type, result.url)
console.log('get' + musicInfo.name + ' url success: ' + result.url) // console.log('get' + musicInfo.name + ' url success: ' + result.url)
return result.url return result.url
}).catch(err => { }).catch(err => {
console.log('get' + musicInfo.name + ' url fail: ' + err.message) console.log('get' + musicInfo.name + ' url fail: ' + err.message)