价格显示问题

This commit is contained in:
liuyuan
2025-04-18 17:56:33 +08:00
parent 648a993d14
commit 380ed58d17
179 changed files with 17322 additions and 2750 deletions

View File

@@ -28,22 +28,20 @@
<template v-else>
<template v-if="!downloadSuccess">
<view class="progress-box flex-column" v-if="downloading">
<progress class="progress" border-radius="35" :percent="downLoadPercent"
activeColor="#3DA7FF" show-info stroke-width="10" />
<progress class="progress" border-radius="35" :percent="downLoadPercent" activeColor="#3DA7FF" show-info
stroke-width="10" />
<view style="width:100%;font-size: 28rpx;display: flex;justify-content: space-around;">
<text>{{downLoadingText}}</text>
<text>({{downloadedSize}}/{{packageFileSize}}M)</text>
</view>
</view>
<button v-else class="content-button" style="border: none;color: #fff;" plain
@click="updateApp">
<button v-else class="content-button" style="border: none;color: #fff;" plain @click="updateApp">
{{downLoadBtnText}}
</button>
</template>
<button v-else-if="downloadSuccess && !installed" class="content-button"
style="border: none;color: #fff;" plain :loading="installing" :disabled="installing"
@click="installPackage">
<button v-else-if="downloadSuccess && !installed" class="content-button" style="border: none;color: #fff;"
plain :loading="installing" :disabled="installing" @click="installPackage">
{{installing ? '正在安装' : '下载完成立即安装'}}
</button>
@@ -55,8 +53,8 @@
</view>
</view>
<image v-if="!is_mandatory" class="close-img" src="../images/app_update_close.png"
@click.stop="closeUpdate"></image>
<image v-if="!is_mandatory" class="close-img" src="../images/app_update_close.png" @click.stop="closeUpdate">
</image>
</view>
</view>
</template>
@@ -253,9 +251,9 @@
},
// 跳转应用商店
checkStoreScheme() {
if (this.store_list && this.store_list.length) {
this.store_list
.filter(item => item.enable)
const storeList = (this.store_list || []).filter(item => item.enable)
if (storeList && storeList.length) {
storeList
.sort((cur, next) => next.priority - cur.priority)
.map(item => item.scheme)
.reduce((promise, cur, curIndex) => {
@@ -270,7 +268,7 @@
}, openSchemePromise)
return openSchemePromise
}
return Promise.reject()
},
downloadPackage() {
@@ -282,22 +280,26 @@
success: res => {
if (res.statusCode == 200) {
this.downloadSuccess = true;
this.tempFilePath = res.tempFilePath
// 强制更新,直接安装
if (this.is_mandatory) {
this.installPackage();
// fix: wgt 文件下载完成后后缀不是 wgt
// if (this.isWGT && res.tempFilePath.split('.').slice(-1) !== 'wgt') {
if (this.isWGT && res.tempFilePath.split('.').slice(-1)[0] !== 'wgt'){
const failCallback = (e) => {
console.log('[FILE RENAME FAIL]', JSON.stringify(e));
}
plus.io.resolveLocalFileSystemURL(res.tempFilePath, function(entry) {
entry.getParent((parent) => {
const newName = `new_wgt_${Date.now()}.wgt`
entry.copyTo(parent, newName, (res) => {
this.tempFilePath = res.fullPath
this.downLoadComplete()
}, failCallback)
}, failCallback)
}, failCallback);
} else {
this.tempFilePath = res.tempFilePath
this.downLoadComplete()
}
}
},
complete: () => {
this.downloading = false;
this.downLoadPercent = 0
this.downloadedSize = 0
this.packageFileSize = 0
downloadTask = null;
}
});
@@ -307,6 +309,20 @@
this.packageFileSize = (res.totalBytesExpectedToWrite / Math.pow(1024, 2)).toFixed(2);
});
},
downLoadComplete() {
this.downloading = false;
this.downLoadPercent = 0
this.downloadedSize = 0
this.packageFileSize = 0
downloadTask = null;
// 强制更新,直接安装
if (this.is_mandatory) {
this.installPackage();
}
},
installPackage() {
// #ifdef APP-PLUS
// wgt资源包安装
@@ -520,7 +536,7 @@
text-align: center;
flex: 1;
font-size: 30rpx;
font-weight: 600;
font-weight: 400;
color: #FFFFFF;
border-radius: 40rpx;
margin: 0 18rpx;
@@ -536,4 +552,4 @@
flex-direction: column;
align-items: center;
}
</style>
</style>