价格显示问题
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
## 0.6.4(2023-09-01)
|
||||
chore: 优化代码结构
|
||||
## 0.6.3(2023-08-30)
|
||||
- 修复 下载 wgt 时如果后缀名不正确,重命名后安装
|
||||
## 0.6.2(2022-11-21)
|
||||
- 处理 cloudfunctions 目录
|
||||
## 0.6.1(2022-08-17)
|
||||
- 修复 后台添加应用市场,但都没有启用的情况下报错的Bug (需要 uni-admin 1.9.3+)
|
||||
## 0.6.0(2022-07-19)
|
||||
- 新增 支持多应用商店配置(需要 uni-admin 1.9.3+)
|
||||
## 0.4.1(2022-05-27)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "uni-upgrade-center-app",
|
||||
"displayName": "升级中心 uni-upgrade-center - App",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.4",
|
||||
"description": "uni升级中心 - 客户端检查更新",
|
||||
"keywords": [
|
||||
"uniCloud",
|
||||
@@ -11,13 +11,9 @@
|
||||
],
|
||||
"repository": "https://gitee.com/dcloud/uni-upgrade-center/tree/master/uni_modules/uni-upgrade-center-app",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.1.0"
|
||||
"HBuilderX": "^3.2.14"
|
||||
},
|
||||
"dcloudext": {
|
||||
"category": [
|
||||
"uniCloud",
|
||||
"云端一体页面模板"
|
||||
],
|
||||
"dcloudext": {
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
@@ -34,7 +30,8 @@
|
||||
"data": "插件不采集任何数据",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": ""
|
||||
"npmurl": "",
|
||||
"type": "unicloud-template-page"
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": [],
|
||||
@@ -67,7 +64,8 @@
|
||||
"阿里": "u",
|
||||
"百度": "u",
|
||||
"字节跳动": "u",
|
||||
"QQ": "u"
|
||||
"QQ": "u",
|
||||
"京东": "u"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "u",
|
||||
|
||||
@@ -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>
|
||||
@@ -22,9 +22,9 @@
|
||||
|
||||
3. 在插件市场打开本插件页面,在右侧点击`使用 HBuilderX 导入插件`,选择要导入的项目点击确定
|
||||
|
||||
4. 绑定一个服务空间
|
||||
4. 绑定一个服务空间。自 `0.6.0` 起,依赖 `uni-admin 1.9.3+` 的 `uni-upgrade-center 云函数`,请和 uni-admin 项目关联同一个服务空间
|
||||
|
||||
5. 找到`/uni_modules/uni-upgrade-center-app/uniCloud/cloudfunctions/check-version`,右键上传部署
|
||||
5. 找到`/uni_modules/uni-upgrade-center-app/uniCloud/cloudfunctions/check-version`,右键上传部署。自 `0.6.0` 起,依赖 `uni-admin 1.9.3+` 的 `uni-upgrade-center 云函数`,插件不再单独提供云函数,这样可以省下一个云函数名额。
|
||||
|
||||
6. 在`pages.json`中添加页面路径。**注:请不要设置为pages.json中第一项**
|
||||
```json
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -2,13 +2,13 @@ export default function() {
|
||||
// #ifdef APP-PLUS
|
||||
return new Promise((resolve, reject) => {
|
||||
plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
|
||||
const data = {
|
||||
console.log('哈哈哈哈', widgetInfo)
|
||||
let data = {
|
||||
action: 'checkVersion',
|
||||
appid: plus.runtime.appid,
|
||||
appVersion: plus.runtime.version,
|
||||
wgtVersion: widgetInfo.version
|
||||
}
|
||||
console.log("获取当前版本信息data: ",data);
|
||||
uniCloud.callFunction({
|
||||
name: 'uni-upgrade-center',
|
||||
data,
|
||||
@@ -30,4 +30,4 @@ export default function() {
|
||||
})
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ export default function() {
|
||||
// #ifdef APP-PLUS
|
||||
return new Promise((resolve, reject) => {
|
||||
callCheckVersion().then(async (e) => {
|
||||
console.log('hhhhhhhhhhhh', e)
|
||||
if (!e.result) return;
|
||||
const {
|
||||
code,
|
||||
@@ -64,7 +65,7 @@ export default function() {
|
||||
uni.removeStorageSync(PACKAGE_INFO_KEY)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
return
|
||||
} else if (code < 0) {
|
||||
// TODO 云函数报错处理
|
||||
@@ -155,4 +156,4 @@ function updateUseModal(packageInfo) {
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user