修复更新bug
This commit is contained in:
@@ -23,9 +23,9 @@
|
||||
</ai-card>
|
||||
<ai-card title="更新记录">
|
||||
<div class="list">
|
||||
<div class="item" v-for="(item, index) in changeLogList" :key="index" @click="info = item, isShow = true">
|
||||
<div class="item" v-for="(item, index) in changeLogList" :key="index" @click="showInfo(item, index)">
|
||||
<div class="left">
|
||||
<el-tag v-if="version !== item.varsion" size="small" effect="dark" type="danger">新版本</el-tag>
|
||||
<el-tag v-if="version !== item.version && index === 0" size="small" effect="dark" type="danger" @click.stop="download(item.downloadUrl)">新版本下载</el-tag>
|
||||
<h2 :title="item.title">{{ item.title }}</h2>
|
||||
</div>
|
||||
<span>{{ item.createTime }}</span>
|
||||
@@ -45,14 +45,15 @@
|
||||
:close-on-click-modal="false"
|
||||
customFooter
|
||||
:show-close="!isImportant"
|
||||
@close="info = {}, isShowDownload = false"
|
||||
width="690">
|
||||
<div class="news">
|
||||
<h2>{{ info.title }}</h2>
|
||||
<p>{{ info.content }}</p>
|
||||
</div>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="read" type="primary" v-if="!info.varsion">{{ isImportant ? '我已阅读' : '关闭' }}{{ info.version }}</el-button>
|
||||
<el-button @click="download" type="primary" style="width: 140px" v-if="info.varsion && info.varsion !== version">下载新版本</el-button>
|
||||
<el-button @click="read" type="primary" style="width: 140px" v-if="!info.version">{{ isImportant ? '我已阅读' : '关闭' }}</el-button>
|
||||
<el-button type="primary" style="width: 140px" v-if="info.version" @click="isShow = false">关闭</el-button>
|
||||
</div>
|
||||
</AiDialog>
|
||||
</div>
|
||||
@@ -70,7 +71,8 @@
|
||||
info: {},
|
||||
changeLogList: [],
|
||||
isImportant: false,
|
||||
version: ''
|
||||
version: '',
|
||||
isShowDownload: false
|
||||
}
|
||||
},
|
||||
|
||||
@@ -93,12 +95,21 @@
|
||||
})
|
||||
},
|
||||
|
||||
download () {
|
||||
showInfo (info, index) {
|
||||
if (index === 0) {
|
||||
this.isShowDownload = true
|
||||
}
|
||||
this.info = info
|
||||
console.log(this.info.version === this.version)
|
||||
this.isShow = true
|
||||
},
|
||||
|
||||
download (url) {
|
||||
const link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
link.href = this.info.downloadUrl
|
||||
link.href = url
|
||||
link.setAttribute('target', '_blank')
|
||||
link.setAttribute('download', `TEMU助手-${this.info.varsion}.zip`)
|
||||
link.setAttribute('download', `TEMU助手-${url}.zip`)
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
|
||||
Reference in New Issue
Block a user