diff --git a/.gitignore b/.gitignore index 4960744286567129d55d02f0b9b079be6ab0faf5..82fde9c39adc5db024ca67bfca13c6382e0f3281 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /coverage/ /android/ /mp-weixin/ +/manifest.json diff --git a/pages.json b/pages.json index 7473b51e5f832049ff900a44d3855dc0814b348b..b9ff26dcf2b625e3d30f06c8538394212a368219 100644 --- a/pages.json +++ b/pages.json @@ -182,7 +182,25 @@ "enablePullDownRefresh": false } } - ], + ,{ + "path": "uni_modules/uni-upgrade-center/pages/version/list", + "style": { + "navigationBarTitleText": "版本列表" + } +} +,{ + "path": "uni_modules/uni-upgrade-center/pages/version/add", + "style": { + "navigationBarTitleText": "新版发布" + } +} +,{ + "path": "uni_modules/uni-upgrade-center/pages/version/detail", + "style": { + "navigationBarTitleText": "版本信息查看" + } +} +], "tabBar": { "color": "#7A7E83", "selectedColor": "#1296db", diff --git a/uni_modules/uni-badge/changelog.md b/uni_modules/uni-badge/changelog.md index 544ecc135b69587852ea7708654345908f9f83bc..56581c4eee26d01227b094831bf8c03aaecf5ebc 100644 --- a/uni_modules/uni-badge/changelog.md +++ b/uni_modules/uni-badge/changelog.md @@ -1,3 +1,5 @@ +## 1.2.1(2022-09-05) +- 修复 当 text 超过 max-num 时,badge 的宽度计算是根据 text 的长度计算,更改为 css 计算实际展示宽度,详见:[https://ask.dcloud.net.cn/question/150473](https://ask.dcloud.net.cn/question/150473) ## 1.2.0(2021-11-19) - 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-badge](https://uniapp.dcloud.io/component/uniui/uni-badge) diff --git a/uni_modules/uni-badge/components/uni-badge/uni-badge.vue b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue index 1981b4e7c4c04d0adeaff59b066ce1f1808bd0eb..498bb1c09b0abf8f3e5c1cf0dbc7a6a8973c8492 100644 --- a/uni_modules/uni-badge/components/uni-badge/uni-badge.vue +++ b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue @@ -1,7 +1,7 @@ @@ -130,16 +130,13 @@ const match = whiteList[this.absolute] return match ? match : whiteList['rightTop'] }, - badgeWidth() { - return { - width: `${this.width}px` - } - }, dotStyle() { if (!this.isDot) return {} return { width: '10px', + minWidth: '0', height: '10px', + padding: '0', borderRadius: '10px' } }, @@ -160,7 +157,7 @@ }; - diff --git a/uni_modules/uni-upgrade-center/pages/version/detail.vue b/uni_modules/uni-upgrade-center/pages/version/detail.vue index 7dee38fc81c37e24e96f28a9eabd081b98696343..e3e9f058717621678062d15c47351b44b4e2fda2 100644 --- a/uni_modules/uni-upgrade-center/pages/version/detail.vue +++ b/uni_modules/uni-upgrade-center/pages/version/detail.vue @@ -11,7 +11,7 @@ - + @@ -37,7 +37,7 @@ - + @@ -46,24 +46,28 @@ {{Number(appFileList.size / 1024 / 1024).toFixed(2)}}M - - - + + + + - - - + - - + @@ -92,7 +96,6 @@ validator, enumConverter } from '@/uni_modules/uni-upgrade-center/js_sdk/validator/opendb-app-versions.js'; - import showInfo from '../components/show-info.vue' import addAndDetail, { fields } from '../mixin/version_add_detail_mixin.js' @@ -100,6 +103,7 @@ deepClone, appVersionListDbName } from '../utils.js' + import showInfo from '../components/show-info.vue' const db = uniCloud.database(); const dbCmd = db.command; @@ -127,7 +131,7 @@ return { showStableInfo: false, isStable: true, // 是否是线上发行版 - originalData: [], // 原始数据,用于恢复状态 + originalData: {}, // 原始数据,用于恢复状态 detailsState: true // 查看状态 } }, @@ -152,6 +156,12 @@ mask: true }) this.$refs.form.validate().then((res) => { + res.store_list = this.formData.store_list + if (res.store_list) { + res.store_list.forEach(item => { + item.priority = parseFloat(item.priority) + }) + } this.submitForm(res) }).catch((errors) => { uni.hideLoading() @@ -191,21 +201,24 @@ uni.showLoading({ mask: true }) - return db.collection(dbCollectionName).doc(id).field(fields).get().then(( - res) => { - const data = res.result.data[0] - if (data) { - this.formData = data - this.originalData = deepClone(this.formData) - } - }).catch((err) => { - uni.showModal({ - content: err.message || '请求服务失败', - showCancel: false + return db.collection(dbCollectionName) + .doc(id) + .field(fields) + .get() + .then((res) => { + const data = res.result.data[0] + if (data) { + this.formData = data + this.originalData = deepClone(this.formData) + } + }).catch((err) => { + uni.showModal({ + content: err.message || '请求服务失败', + showCancel: false + }) + }).finally(() => { + uni.hideLoading() }) - }).finally(() => { - uni.hideLoading() - }) }, deletePackage() { uni.showModal({ diff --git a/uni_modules/uni-upgrade-center/pages/version/list.vue b/uni_modules/uni-upgrade-center/pages/version/list.vue index dcfbc10a0a287509eef30b9e93362d90427d3243..2797d590747e28c5995ba8b5b2384406284f9a45 100644 --- a/uni_modules/uni-upgrade-center/pages/version/list.vue +++ b/uni_modules/uni-upgrade-center/pages/version/list.vue @@ -35,6 +35,7 @@ 更新标题 安装包类型 平台 + 版本号 安装包状态 上传时间 @@ -56,6 +57,9 @@ + {{item.version}} {{item.stable_publish == true ? '已上线' : '已下线'}} @@ -93,8 +97,12 @@ appVersionListDbName, defaultDisplayApp } from '../utils.js' + import { + mapState + } from 'vuex' const db = uniCloud.database() + const dbCmd = db.command // 表查询配置 const dbOrderBy = 'stable_publish desc,create_date desc' // 排序字段 const dbSearchFields = ['name', 'title', 'stable_publish', 'type'] // 模糊搜索字段,支持模糊搜索的字段列表 @@ -109,6 +117,13 @@ return document.documentElement ? document.documentElement.clientHeight : window.innerHeight; } + function createListQuery(condition = {}) { + return { + create_env: dbCmd.neq("uni-stat"), + ...condition + } + } + export default { data() { return { @@ -135,19 +150,25 @@ showAppIndex: 0 } }, - async onLoad(options) { + async onLoad({ + appid + }) { await this.getAppList() if (!this.appList.length) return this.loaded = true this.appList.forEach((item, index) => { - if (item.appid === defaultDisplayApp) { + if (item.appid === appid || defaultDisplayApp) { this.showAppIndex = index } }) this.setAppInfo(this.showAppIndex) + this.where = createListQuery({ + appid: this.currentAppid + }) }, computed: { + ...mapState('app', ['appid']), appNameList() { return this.appList.map(item => item.name) } @@ -156,9 +177,9 @@ showAppIndex(val) { this.setAppInfo(val) - this.where = { + this.where = createListQuery({ appid: this.currentAppid - } + }) } }, onReady() { @@ -262,7 +283,7 @@ result } = await db.collection(appListDbName).get() if (result && result.data && result.data.length > 0) { - this.appList = result.data + this.appList = result.data.filter(item => item.appid !== this.appid) } else { this.showModalToAppManager() } @@ -296,6 +317,13 @@ confirmText: '立即跳转', success: (res) => jump() }) + }, + store_list_key(store_list) { + const arr = store_list ? store_list.filter(item => item.enable) : [] + return arr.length ? + arr.sort((a, b) => b.priority - a.priority) + .map(item => item.name).join(',') : + '-' } } } diff --git a/uni_modules/uni-upgrade-center/readme.md b/uni_modules/uni-upgrade-center/readme.md index 2c44ef951f31fe8adb5399e45e132f64b6aa80b4..7d016821f3b2eab19423d31c44d78f5e4be12a88 100644 --- a/uni_modules/uni-upgrade-center/readme.md +++ b/uni_modules/uni-upgrade-center/readme.md @@ -52,25 +52,27 @@ uniCloud 是 DCloud 联合阿里云、腾讯云,为开发者提供的基于 se 7. 在`pages.json`中添加页面路径 ```json //此结构与uniCloud admin中的pages.json结构一致 -"pages": [ - // ……其他页面配置 - { - "path": "uni_modules/uni-upgrade-center/pages/version/list", - "style": { - "navigationBarTitleText": "版本列表" +{ + "pages": [ + // ……其他页面配置 + { + "path": "uni_modules/uni-upgrade-center/pages/version/list", + "style": { + "navigationBarTitleText": "版本列表" + } + }, { + "path": "uni_modules/uni-upgrade-center/pages/version/add", + "style": { + "navigationBarTitleText": "新版发布" + } + }, { + "path": "uni_modules/uni-upgrade-center/pages/version/detail", + "style": { + "navigationBarTitleText": "版本信息查看" + } } - }, { - "path": "uni_modules/uni-upgrade-center/pages/version/add", - "style": { - "navigationBarTitleText": "新版发布" - } - }, { - "path": "uni_modules/uni-upgrade-center/pages/version/detail", - "style": { - "navigationBarTitleText": "版本信息查看" - } - } -] + ] +} ``` 8. 在`manifest.json -> 源码视图`中添加以下配置: @@ -220,4 +222,4 @@ uniCloud 是 DCloud 联合阿里云、腾讯云,为开发者提供的基于 se - 集合[opendb-app-list]对应的schema内存在错误,详细信息:opendb-app-list表对应的schema名称冲突,这是什么意思呢 - 没有/找不到 [opendb-app-list] 集合/表。**解决方案:**升级 admin 至 1.6.0+ 即可 -- 测试时发布了高版本的包,测试完了发布包提示需要大于版本号 (x.x.x)。**解决方案:**直接在控制台修改数据库 +- 测试时发布了高版本的包,测试完了发布包提示需要大于版本号 (x.x.x)。**解决方案:**直接在控制台修改数据库 \ No newline at end of file