提交 0f09d4fb 编写于 作者: study夏羽's avatar study夏羽

更新依赖插件

上级 a89a5585
......@@ -5,3 +5,4 @@
/coverage/
/android/
/mp-weixin/
/manifest.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",
......
## 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)
......
<template>
<view class="uni-badge--x">
<slot />
<text v-if="text" :class="classNames" :style="[badgeWidth, positionStyle, customStyle, dotStyle]"
<text v-if="text" :class="classNames" :style="[positionStyle, customStyle, dotStyle]"
class="uni-badge" @click="onClick()">{{displayValue}}</text>
</view>
</template>
......@@ -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 @@
};
</script>
<style lang="scss" scoped>
<style lang="scss" >
$uni-primary: #2979ff !default;
$uni-success: #4cd964 !default;
$uni-warning: #f0ad4e !default;
......@@ -199,6 +196,8 @@
justify-content: center;
flex-direction: row;
height: 20px;
min-width: 20px;
padding: 0 4px;
line-height: 18px;
color: #fff;
border-radius: 100px;
......@@ -207,6 +206,7 @@
border: 1px solid #fff;
text-align: center;
font-family: 'Helvetica Neue', Helvetica, sans-serif;
font-feature-settings: "tnum";
font-size: $bage-size;
/* #ifdef H5 */
z-index: 999;
......
{
"id": "uni-badge",
"displayName": "uni-badge 数字角标",
"version": "1.2.0",
"version": "1.2.1",
"description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。",
"keywords": [
"",
......@@ -18,11 +18,7 @@
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
......@@ -39,10 +35,11 @@
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": [],
"dependencies": ["uni-scss"],
"encrypt": [],
"platforms": {
"cloud": {
......
## 1.0.7(2022-07-06)
- 优化 pc端图标位置不正确的问题
## 1.0.6(2022-07-05)
- 优化 显示样式
## 1.0.5(2022-07-04)
- 修复 uni-data-picker 在 uni-forms-item 中宽度不正确的bug
## 1.0.4(2022-04-19)
......
......@@ -10,7 +10,7 @@
<scroll-view v-else-if="inputSelected.length" class="selected-area" scroll-x="true">
<view class="selected-list">
<view class="selected-item" v-for="(item,index) in inputSelected" :key="index">
<text>{{item.text}}</text><text v-if="index<inputSelected.length-1"
<text class="text-color">{{item.text}}</text><text v-if="index<inputSelected.length-1"
class="input-split-line">{{split}}</text>
</view>
</view>
......@@ -18,7 +18,7 @@
<text v-else class="selected-area placeholder">{{placeholder}}</text>
<view v-if="clearIcon && !readonly && inputSelected.length" class="icon-clear"
@click.stop="clear">
<uni-icons type="clear" color="#e1e1e1" size="14"></uni-icons>
<uni-icons type="clear" color="#c0c4cc" size="24"></uni-icons>
</view>
<view class="arrow-area" v-if="(!clearIcon || !inputSelected.length) && !readonly ">
<view class="input-arrow"></view>
......@@ -313,12 +313,14 @@
align-items: center;
flex-wrap: nowrap;
font-size: 14px;
line-height: 38px;
padding: 0 5px;
/* line-height: 35px; */
padding: 0 10px;
padding-right: 5px;
overflow: hidden;
height: 35px;
/* #ifdef APP-NVUE */
height: 40px;
/* #endif */
box-sizing: border-box;
}
.input-value-border {
......@@ -350,19 +352,24 @@
/* #endif */
flex-direction: row;
flex-wrap: nowrap;
padding: 0 5px;
/* padding: 0 5px; */
}
.selected-item {
flex-direction: row;
padding: 0 1px;
/* padding: 0 1px; */
/* #ifndef APP-NVUE */
white-space: nowrap;
/* #endif */
}
.text-color {
color: #333;
}
.placeholder {
color: grey;
font-size: 12px;
}
.input-split-line {
......@@ -478,6 +485,11 @@
flex: 1;
overflow: hidden;
}
.icon-clear {
display: flex;
align-items: center;
}
/* #ifdef H5 */
@media all and (min-width: 768px) {
......@@ -503,7 +515,7 @@
}
.icon-clear {
margin-right: 5px;
/* margin-right: 5px; */
}
}
......
{
"id": "uni-data-picker",
"displayName": "uni-data-picker 数据驱动的picker选择器",
"version": "1.0.5",
"version": "1.0.7",
"description": "单列、多列级联选择器,常用于省市区城市选择、公司部门选择、多级分类等场景",
"keywords": [
"uni-ui",
......@@ -76,7 +76,8 @@
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
"QQ": "y",
"京东": "u"
},
"快应用": {
"华为": "u",
......
## 2.2.8(2022-09-08)
- 修复 close事件无效的 bug
## 2.2.7(2022-09-05)
- 修复 移动端 maskClick 无效的 bug,详见:[https://ask.dcloud.net.cn/question/140824?item_id=209458&rf=false](https://ask.dcloud.net.cn/question/140824?item_id=209458&rf=false)
## 2.2.6(2022-06-30)
- 优化 组件样式,调整了组件图标大小、高度、颜色等,与uni-ui风格保持一致
## 2.2.5(2022-06-24)
......
<template>
<view class="uni-calendar" @mouseleave="leaveCale">
<view v-if="!insert&&show" class="uni-calendar__mask" :class="{'uni-calendar--mask-show':aniMaskShow}"
@click="clean"></view>
@click="clean();maskClick()"></view>
<view v-if="insert || show" class="uni-calendar__content"
:class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow, 'uni-calendar__content-mobile': aniMaskShow}">
<view class="uni-calendar__header" :class="{'uni-calendar__header-mobile' :!insert}">
......@@ -411,6 +411,11 @@
this.close()
},
// 蒙版点击事件
maskClick() {
this.$emit('maskClose')
},
clearCalender() {
if (this.range) {
this.timeRange.startTime = ''
......
......@@ -91,7 +91,7 @@
<calendar v-show="isPhone" ref="mobile" :clearDate="false" :date="defSingleDate" :defTime="reactMobDefTime"
:start-date="caleRange.startDate" :end-date="caleRange.endDate" :selectableTimes="mobSelectableTime"
:pleStatus="endMultipleStatus" :showMonth="false" :range="isRange" :typeHasTime="hasTime" :insert="false"
:hideSecond="hideSecond" @confirm="mobileChange" />
:hideSecond="hideSecond" @confirm="mobileChange" @maskClose="close" />
</view>
</template>
<script>
......@@ -516,6 +516,7 @@
setTimeout(() => {
this.popup = false
this.$emit('maskClick', this.value)
this.$refs.mobile.close()
}, 20)
},
setEmit(value) {
......
{
"id": "uni-datetime-picker",
"displayName": "uni-datetime-picker 日期选择器",
"version": "2.2.6",
"version": "2.2.8",
"description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择",
"keywords": [
"uni-datetime-picker",
......@@ -17,11 +17,7 @@
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
......@@ -38,7 +34,8 @@
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": [
......
## 1.2.4(2022-09-07)
小程序端由于 style 使用了对象导致报错,[详情](https://ask.dcloud.net.cn/question/152790?item_id=211778&rf=false)
## 1.2.3(2022-09-05)
- 修复 nvue 环境下,具有 tabBar 时,fab 组件下部位置无法正常获取 --window-bottom 的bug,详见:[https://ask.dcloud.net.cn/question/110638?notification_id=826310](https://ask.dcloud.net.cn/question/110638?notification_id=826310)
## 1.2.2(2021-12-29)
- 更新 组件依赖
## 1.2.1(2021-11-19)
......
......@@ -5,7 +5,9 @@
'uni-fab--rightBottom': rightBottom,
'uni-fab--leftTop': leftTop,
'uni-fab--rightTop': rightTop
}" class="uni-fab">
}" class="uni-fab"
:style="nvueBottom"
>
<view :class="{
'uni-fab__content--left': horizontal === 'left',
'uni-fab__content--right': horizontal === 'right',
......@@ -32,7 +34,7 @@
'uni-fab__circle--leftTop': leftTop,
'uni-fab__circle--rightTop': rightTop,
'uni-fab__content--other-platform': !isAndroidNvue
}" class="uni-fab__circle uni-fab__plus" :style="{ 'background-color': styles.buttonColor }" @click="_onClick">
}" class="uni-fab__circle uni-fab__plus" :style="{ 'background-color': styles.buttonColor, 'bottom': nvueBottom }" @click="_onClick">
<uni-icons class="fab-circle-icon" type="plusempty" :color="styles.iconColor" size="32"
:class="{'uni-fab__plus--active': isShow && content.length > 0}"></uni-icons>
<!-- <view class="fab-circle-v" :class="{'uni-fab__plus--active': isShow && content.length > 0}"></view>
......@@ -158,6 +160,16 @@
},
horizontalRight() {
return this.getPosition(2, 'horizontal', 'right')
},
// 计算 nvue bottom
nvueBottom() {
const safeBottom = uni.getSystemInfoSync().windowBottom;
// #ifdef APP-NVUE
return 30 + safeBottom
// #endif
// #ifndef APP-NVUE
return 30
// #endif
}
},
watch: {
......
{
"id": "uni-fab",
"displayName": "uni-fab 悬浮按钮",
"version": "1.2.2",
"version": "1.2.4",
"description": "悬浮按钮 fab button ,点击可展开一个图标按钮菜单。",
"keywords": [
"uni-ui",
......@@ -17,11 +17,7 @@
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
......@@ -38,7 +34,8 @@
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": ["uni-scss","uni-icons"],
......
## 1.4.8(2022-08-23)
- 优化 根据 rules 自动添加 required 的问题
## 1.4.7(2022-08-22)
- 修复 item 未设置 require 属性,rules 设置 require 后,星号也显示的 bug,详见:[https://ask.dcloud.net.cn/question/151540](https://ask.dcloud.net.cn/question/151540)
## 1.4.6(2022-07-13)
- 修复 model 需要校验的值没有声明对应字段时,导致第一次不触发校验的bug
## 1.4.5(2022-07-05)
- 新增 更多表单示例
- 优化 子表单组件过期提示的问题
- 优化 子表单组件uni-datetime-picker、uni-data-select、uni-data-picker的显示样式
## 1.4.4(2022-07-04)
- 更新 删除组件日志
## 1.4.3(2022-07-04)
......
......@@ -181,8 +181,9 @@
(value, oldVal) => {
const isEqual = this.form._isEqual(value, oldVal)
// 简单判断前后值的变化,只有发生变化才会发生校验
// TODO 如果 oldVal = undefined ,那么大概率是源数据里没有值导致 ,这个情况不哦校验 ,可能不严谨 ,需要在做观察
if (!isEqual && oldVal !== undefined) {
// TODO 如果 oldVal = undefined ,那么大概率是源数据里没有值导致 ,这个情况不哦校验 ,可能不严谨 ,需要在做观察
// fix by mehaotian 暂时取消 && oldVal !== undefined ,如果formData 中不存在,可能会不校验
if (!isEqual) {
const val = this.itemSetValue(value)
this.onFieldChange(val, false)
}
......@@ -217,7 +218,7 @@
},
// 兼容老版本表单组件
setValue() {
console.log('setValue 方法已经弃用,请使用最新版本的 uni-forms 表单组件以及其他关联组件。');
// console.log('setValue 方法已经弃用,请使用最新版本的 uni-forms 表单组件以及其他关联组件。');
},
/**
* 外部调用方法
......@@ -386,9 +387,13 @@
// 是否显示星号
_isRequired() {
if (this.form) {
return this.required || this.form._isRequiredField(this.itemRules.rules || [])
}
// TODO 不根据规则显示 星号,考虑后续兼容
// if (this.form) {
// if (this.form._isRequiredField(this.itemRules.rules || []) && this.required) {
// return true
// }
// return false
// }
return this.required
},
......@@ -479,6 +484,7 @@
padding: 0 12px 0 0;
/* #ifndef APP-NVUE */
vertical-align: middle;
flex-shrink: 0;
/* #endif */
/* #ifndef APP-NVUE */
......@@ -492,8 +498,8 @@
&__content {
/* #ifndef MP-TOUTIAO */
display: flex;
align-items: center;
// display: flex;
// align-items: center;
/* #endif */
position: relative;
font-size: 14px;
......
{
"id": "uni-forms",
"displayName": "uni-forms 表单",
"version": "1.4.4",
"version": "1.4.8",
"description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据",
"keywords": [
"uni-ui",
......@@ -17,11 +17,7 @@
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
......@@ -38,7 +34,8 @@
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": [
......@@ -74,7 +71,8 @@
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
"QQ": "y",
"京东": "u"
},
"快应用": {
"华为": "u",
......
## 3.3.28(2022-07-27)
- 修复 app端微信登录返回的accessToken过期时间(expired)不正确的Bug
## 3.3.27(2022-07-27)
- 短信发送失败、微信登录失败等场景下输出原始错误方便排查错误
## 3.3.26(2022-07-08)
- 兼容配置放在uni-id下的逻辑,但是仍推荐使用uni-config-center
## 3.3.25(2022-06-30)
- 修复config文件不合法时未抛出具体错误的Bug
## 3.3.24(2022-06-28)
......
{
"id": "uni-id",
"displayName": "uni-id",
"version": "3.3.25",
"version": "3.3.28",
"description": "简单、统一、可扩展的用户中心",
"keywords": [
"uniid",
......@@ -14,11 +14,7 @@
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"uniCloud",
"云函数模板"
],
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
......@@ -35,7 +31,8 @@
"data": "无",
"permissions": "无"
},
"npmurl": ""
"npmurl": "",
"type": "unicloud-template-function"
},
"uni_modules": {
"dependencies": ["uni-config-center"],
......
{
"name": "uni-id",
"version": "3.3.25",
"version": "3.3.28",
"description": "uni-id for uniCloud",
"main": "index.js",
"homepage": "https://uniapp.dcloud.io/uniCloud/uni-id",
......
## 1.2.1(2022-09-05)
- 新增 属性 fontSize,可修改文字大小。
## 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-notice-bar](https://uniapp.dcloud.io/component/uniui/uni-notice-bar)
......
<template>
<view v-if="show" class="uni-noticebar" :style="{ backgroundColor: backgroundColor }" @click="onClick">
<view v-if="show" class="uni-noticebar" :style="{ backgroundColor }" @click="onClick">
<uni-icons v-if="showIcon === true || showIcon === 'true'" class="uni-noticebar-icon" type="sound"
:color="color" size="22" />
:color="color" :size="fontSize * 1.5" />
<view ref="textBox" class="uni-noticebar__content-wrapper"
:class="{'uni-noticebar__content-wrapper--scrollable':scrollable, 'uni-noticebar__content-wrapper--single':!scrollable && (single || moreText)}">
:class="{
'uni-noticebar__content-wrapper--scrollable': scrollable,
'uni-noticebar__content-wrapper--single': !scrollable && (single || moreText)
}"
:style="{ height: scrollable ? fontSize * 1.5 + 'px' : 'auto' }"
>
<view :id="elIdBox" class="uni-noticebar__content"
:class="{'uni-noticebar__content--scrollable':scrollable, 'uni-noticebar__content--single':!scrollable && (single || moreText)}">
<text :id="elId" ref="animationEle" class="uni-noticebar__content-text"
:class="{'uni-noticebar__content-text--scrollable':scrollable,'uni-noticebar__content-text--single':!scrollable && (single || showGetMore)}"
:style="{color:color, width:wrapWidth+'px', 'animationDuration': animationDuration, '-webkit-animationDuration': animationDuration ,animationPlayState: webviewHide?'paused':animationPlayState,'-webkit-animationPlayState':webviewHide?'paused':animationPlayState, animationDelay: animationDelay, '-webkit-animationDelay':animationDelay}">{{text}}</text>
:class="{
'uni-noticebar__content--scrollable': scrollable,
'uni-noticebar__content--single': !scrollable && (single || moreText)
}"
>
<text :id="elId" ref="animationEle" class="uni-noticebar__content-text"
:class="{
'uni-noticebar__content-text--scrollable': scrollable,
'uni-noticebar__content-text--single': !scrollable && (single || showGetMore)
}"
:style="{
color: color,
fontSize: fontSize + 'px',
lineHeight: fontSize * 1.5 + 'px',
width: wrapWidth + 'px',
'animationDuration': animationDuration,
'-webkit-animationDuration': animationDuration,
animationPlayState: webviewHide ? 'paused' : animationPlayState,
'-webkit-animationPlayState': webviewHide ? 'paused' : animationPlayState,
animationDelay: animationDelay,
'-webkit-animationDelay': animationDelay
}"
>{{text}}</text>
</view>
</view>
<view v-if="showGetMore === true || showGetMore === 'true'" class="uni-noticebar__more uni-cursor-point"
<view v-if="isShowGetMore" class="uni-noticebar__more uni-cursor-point"
@click="clickMore">
<text v-if="moreText.length > 0" :style="{ color: moreColor }" class="uni-noticebar__more-text">{{ moreText }}</text>
<uni-icons v-else type="right" :color="moreColor" size="16" />
<text v-if="moreText.length > 0" :style="{ color: moreColor, fontSize: fontSize + 'px' }">{{ moreText }}</text>
<uni-icons v-else type="right" :color="moreColor" :size="fontSize * 1.1" />
</view>
<view class="uni-noticebar-close uni-cursor-point" v-if="(showClose === true || showClose === 'true') && (showGetMore === false || showGetMore === 'false')">
<uni-icons
type="closeempty" :color="color" size="16" @click="close" />
<view class="uni-noticebar-close uni-cursor-point" v-if="isShowClose">
<uni-icons type="closeempty" :color="color" :size="fontSize * 1.1" @click="close" />
</view>
</view>
</template>
......@@ -74,6 +97,10 @@
type: String,
default: '#FF9A43'
},
fontSize: {
type: Number,
default: 14
},
moreColor: {
type: String,
default: '#FF9A43'
......@@ -123,6 +150,15 @@
animationDelay: '0s'
}
},
computed: {
isShowGetMore() {
return this.showGetMore === true || this.showGetMore === 'true'
},
isShowClose() {
return (this.showClose === true || this.showClose === 'true')
&& (this.showGetMore === false || this.showGetMore === 'false')
}
},
mounted() {
// #ifdef APP-PLUS
var pages = getCurrentPages();
......@@ -310,7 +346,6 @@
/* #ifndef APP-NVUE */
.uni-noticebar__content-wrapper--scrollable {
position: relative;
height: 18px;
}
/* #endif */
......@@ -383,10 +418,6 @@
padding-left: 5px;
}
.uni-noticebar__more-text {
font-size: 14px;
}
@keyframes notice {
100% {
transform: translate3d(-100%, 0, 0);
......
{
"id": "uni-notice-bar",
"displayName": "uni-notice-bar 通告栏",
"version": "1.2.0",
"version": "1.2.1",
"description": "NoticeBar 通告栏组件,常用于展示公告信息,可设为滚动公告",
"keywords": [
"uni-ui",
......@@ -17,11 +17,7 @@
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
......@@ -38,7 +34,8 @@
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": [
......
## 1.2.2(2022-07-06)
- 修复 es 语言 i18n 错误
## 1.2.1(2021-11-22)
- 修复 vue3中某些scss变量无法找到的问题
## 1.2.0(2021-11-19)
......
{
"uni-pagination.prevText": "prev",
"uni-pagination.nextText": "next"
"uni-pagination.nextText": "next",
"uni-pagination.piecePerPage": "piece/page"
}
{
"uni-pagination.prevText": "anterior",
"uni-pagination.nextText": "próxima"
"uni-pagination.nextText": "prxima",
"uni-pagination.piecePerPage": "Art¨ªculo/P¨¢gina"
}
{
"uni-pagination.prevText": "précédente",
"uni-pagination.nextText": "suivante"
"uni-pagination.nextText": "suivante",
"uni-pagination.piecePerPage": "Articles/Pages"
}
{
"uni-pagination.prevText": "上一页",
"uni-pagination.nextText": "下一页"
"uni-pagination.nextText": "下一页",
"uni-pagination.piecePerPage": "条/页"
}
{
"uni-pagination.prevText": "上一頁",
"uni-pagination.nextText": "下一頁"
"uni-pagination.nextText": "下一頁",
"uni-pagination.piecePerPage": "條/頁"
}
<template>
<view class="uni-pagination">
<!-- #ifndef MP -->
<picker v-if="showPageSize === true || showPageSize === 'true'" class="select-picker" mode="selector"
:value="pageSizeIndex" :range="pageSizeRange" @change="pickerChange" @cancel="pickerClick"
@click.native="pickerClick">
<button type="default" size="mini" :plain="true">
<text>{{pageSizeRange[pageSizeIndex]}} {{piecePerPage}}</text>
<uni-icons class="select-picker-icon" type="arrowdown" size="12" color="#999"></uni-icons>
</button>
</picker>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<view class="uni-pagination__total is-phone-hide">{{ total }}</view>
<!-- #endif -->
......@@ -49,11 +59,15 @@
* @tutorial https://ext.dcloud.net.cn/plugin?id=32
* @property {String} prevText 左侧按钮文字
* @property {String} nextText 右侧按钮文字
* @property {String} piecePerPageText 条/页文字
* @property {Number} current 当前页
* @property {Number} total 数据总量
* @property {Number} pageSize 每页数据量
* @property {Number} showIcon = [true|false] 是否以 icon 形式展示按钮
* @property {Boolean} showIcon = [true|false] 是否以 icon 形式展示按钮
* @property {Boolean} showPageSize = [true|false] 是否展示每页条数
* @property {Array} pageSizeRange = [20, 50, 100, 500] 每页条数选框
* @event {Function} change 点击页码按钮时触发 ,e={type,current} current为当前页,type值为:next/prev,表示点击的是上一页还是下一个
* * @event {Function} pageSizeChange 当前每页条数改变时触发 ,e={pageSize} pageSize 为当前所选的每页条数
*/
import {
......@@ -65,7 +79,7 @@
} = initVueI18n(messages)
export default {
name: 'UniPagination',
emits: ['update:modelValue', 'input', 'change'],
emits: ['update:modelValue', 'input', 'change', 'pageSizeChange'],
props: {
value: {
type: [Number, String],
......@@ -81,6 +95,9 @@
nextText: {
type: String,
},
piecePerPageText: {
type: String
},
current: {
type: [Number, String],
default: 1
......@@ -100,18 +117,32 @@
type: [Boolean, String],
default: false
},
showPageSize: {
// 是否以 icon 形式展示按钮
type: [Boolean, String],
default: false
},
pagerCount: {
type: Number,
default: 7
},
pageSizeRange: {
type: Array,
default: () => [20, 50, 100, 500]
}
},
data() {
return {
pageSizeIndex: 0,
currentIndex: 1,
paperData: []
paperData: [],
pickerShow: false
}
},
computed: {
piecePerPage() {
return this.piecePerPageText || t('uni-pagination.piecePerPage')
},
prevPageText() {
return this.prevText || t('uni-pagination.prevText')
},
......@@ -199,9 +230,31 @@
this.currentIndex = val
}
}
},
pageSizeIndex(val) {
this.$emit('pageSizeChange', this.pageSizeRange[val])
}
},
methods: {
pickerChange(e) {
this.pageSizeIndex = e.detail.value
this.pickerClick()
},
pickerClick() {
// #ifdef H5
const body = document.querySelector('body')
if (!body) return
const className = 'uni-pagination-picker-show'
this.pickerShow = !this.pickerShow
if (this.pickerShow) {
body.classList.add(className)
} else {
setTimeout(() => body.classList.remove(className), 300)
}
// #endif
},
// 选择标签
selectPage(e, index) {
if (parseInt(e)) {
......@@ -258,6 +311,7 @@
<style lang="scss" scoped>
$uni-primary: #2979ff;
.uni-pagination {
/* #ifndef APP-NVUE */
display: flex;
......
{
"id": "uni-pagination",
"displayName": "uni-pagination 分页器",
"version": "1.2.1",
"version": "1.2.2",
"description": "Pagination 分页器组件,用于展示页码、请求数据等。",
"keywords": [
"uni-ui",
......
......@@ -9,5 +9,3 @@
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-pagination)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
## 0.4.2(2022-06-02)
- 修复 wgt 包更新时错误处理的 bug
## 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)
- 修复 上版引出的报错问题
## 0.4.0(2022-05-27)
......
{
"id": "uni-upgrade-center-app",
"displayName": "升级中心 uni-upgrade-center - App",
"version": "0.4.2",
"version": "0.6.1",
"description": "uni升级中心 - 客户端检查更新",
"keywords": [
"uniCloud",
......@@ -13,11 +13,7 @@
"engines": {
"HBuilderX": "^3.1.0"
},
"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",
......
......@@ -37,7 +37,7 @@
</view>
<button v-else class="content-button" style="border: none;color: #fff;" plain
@click="downloadPackage">
@click="updateApp">
{{downLoadBtnText}}
</button>
</template>
......@@ -62,9 +62,10 @@
</template>
<script>
const localFilePathKey = '__localFilePath__'
const localFilePathKey = 'UNI_ADMIN_UPGRADE_CENTER_LOCAL_FILE_PATH'
const platform_iOS = 'iOS';
let downloadTask = null;
let openSchemePromise
/**
* 对比版本号,如需要,请自行修改判断规则
......@@ -177,6 +178,9 @@
downloadTask && downloadTask.abort()
},
onHide() {
openSchemePromise = null
},
computed: {
isWGT() {
return this.type === 'wgt'
......@@ -242,6 +246,33 @@
uni.navigateBack()
},
updateApp() {
this.checkStoreScheme().catch(() => {
this.downloadPackage()
})
},
// 跳转应用商店
checkStoreScheme() {
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) => {
openSchemePromise = (promise || (promise = Promise.reject())).catch(() => {
return new Promise((resolve, reject) => {
plus.runtime.openURL(cur, (err) => {
reject(err)
})
})
})
return openSchemePromise
}, openSchemePromise)
return openSchemePromise
}
return Promise.reject()
},
downloadPackage() {
this.downloading = true;
......@@ -282,7 +313,6 @@
if (this.isWGT) {
this.installing = true;
}
plus.runtime.install(this.tempFilePath, {
force: false
}, async res => {
......@@ -322,14 +352,14 @@
this.installed = false;
uni.showModal({
title: `更新失败${this.isWGT ? '' : ',APK文件不存在'},请重新下载`,
title: '更新失败,请重新下载',
content: err.message,
showCancel: false
});
});
// 非wgt包,安装跳出覆盖安装,此处直接返回上一页
if (!this.isWGT) {
if (!this.isWGT && !this.is_mandatory) {
uni.navigateBack()
}
// #endif
......@@ -341,16 +371,22 @@
plus.runtime.restart();
// #endif
},
async saveFile(tempFilePath, version) {
const [err, res] = await uni.saveFile({
tempFilePath
})
if (err) {
return;
}
uni.setStorageSync(localFilePathKey, {
version,
savedFilePath: res.savedFilePath
saveFile(tempFilePath, version) {
return new Promise((resolve, reject) => {
uni.saveFile({
tempFilePath,
success({
savedFilePath
}) {
uni.setStorageSync(localFilePathKey, {
version,
savedFilePath
})
},
complete() {
resolve()
}
})
})
},
deleteSavedFile(filePath) {
......
## 升级中心 - app插件与 `uni-admin` 版本关系
### `uni-admin >= 1.9.3`:云函数 `checkVersion` 废弃,使用 uni-admin 自带的 `uni-upgrade-center` 云函数。
# uni-upgrade-center - App
### 概述
......@@ -18,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
......@@ -119,4 +123,4 @@
|101|wgt更新|
|102|整包更新|
|-101|暂无更新或检查appid是否填写正确|
|-102|请检查传参是否填写正确|
|-102|请检查传参是否填写正确|
\ No newline at end of file
const {
checkVersion
} = uniCloud.importObject('checkVersion')
export default function() {
// #ifdef APP-PLUS
return new Promise((resolve, reject) => {
plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
checkVersion({
const data = {
action: 'checkVersion',
appid: plus.runtime.appid,
appVersion: plus.runtime.version,
wgtVersion: widgetInfo.version
}).then(result => {
resolve({
result
})
}).catch(err => {
reject(err)
}
console.log("data: ",data);
uniCloud.callFunction({
name: 'uni-upgrade-center',
data,
success: (e) => {
console.log("e: ", e);
resolve(e)
},
fail: (error) => {
reject(error)
}
})
})
})
......
## 0.5.1(2022-07-06)
- 修复 上版带出云函数不存在的Bug
- 升级 uni-admin 大于等于 1.9.0 务必更新至此版本。uni-admin 版本小于 1.9.0 请不要更新,历史版本在 Gitee 有发行版。后续 uni-admin 会集成升级中心
## 0.5.0(2022-07-05)
- 修复 版本列表默认显示全部版本的Bug
- 升级 uni-admin 1.9.0 务必更新至此版本。uni-admin 版本小于 1.9.0 请不要更新,后续 uni-admin 会集成升级中心
## 0.4.2(2021-12-07)
- 更新 优化 list 页面显示,修复 list 页面报错
## 0.4.1(2021-12-01)
......
{
"id": "uni-upgrade-center",
"displayName": "升级中心 uni-upgrade-center - Admin",
"version": "0.4.2",
"version": "0.5.1",
"description": "uni升级中心 - 后台管理系统",
"keywords": [
"uniCloud",
......@@ -21,10 +21,10 @@
],
"sale": {
"regular": {
"price": 0
"price": "0.00"
},
"sourcecode": {
"price": 0
"price": "0.00"
}
},
"contact": {
......
......@@ -2,7 +2,7 @@
<view style="position: relative;">
<uni-icons @mouseenter.native="mouseenter" @mouseleave.native="showStableInfo = false"
style="padding:0 10px;color: #a8a8a8;cursor: pointer;" type="info" />
<view v-if="showStableInfo" class="show-stable" :style="{top:`${top}px`,left:`${left}px`}">
<view v-if="showStableInfo" class="show-stable" :style="{top:`${top}px`,left:`${left}px`,width:`${width}px`}">
<text>{{content}}</text>
</view>
</view>
......@@ -19,6 +19,10 @@
left: {
type: [Number, String],
default: -100
},
width: {
type: [Number, String],
default: 200
}
},
data() {
......
......@@ -22,13 +22,15 @@ export const fields =
export default {
data() {
return {
enableiOSWgt: true, // 是否开启iOS的wgt更新
labelWidth: '80px',
enableiOSWgt: true, // 是否开启iOS的wgt更新
silentlyContent: '静默更新:App升级时会在后台下载wgt包并自行安装。新功能在下次启动App时生效',
mandatoryContent: '强制更新:App升级弹出框不可取消',
stablePublishContent: '同时只可有一个线上发行版,线上发行不可更设为下线。\n未上线可以设为上线发行并自动替换当前线上发行版',
stablePublishContent2: '使用本包替换当前线上发行版',
uploadFileContent: '可下载安装包地址。上传文件到云存储自动填写,也可以手动填写',
minUniVersionContent: '上次使用新Api或打包新模块的App版本',
priorityContent: '检查更新时,按照优先级从大到小依次尝试跳转商店。如果都跳转失败,则会打开浏览器使用下载链接下载apk安装包',
latestStableData: [], // 库中最新已上线版
appFileList: null, // 上传包
type_valuetotext: enumConverter.type_valuetotext,
......@@ -91,7 +93,11 @@ export default {
return this.isWGT ? ['wgt'] : ['apk']
},
platformLocaldata() {
return !this.isWGT ? this.formOptions.platform_localdata : this.enableiOSWgt ? this.formOptions.platform_localdata : [this.formOptions.platform_localdata[0]]
return !this.isWGT ? this.formOptions.platform_localdata : this.enableiOSWgt ? this.formOptions
.platform_localdata : [this.formOptions.platform_localdata[0]]
},
uni_platform() {
return (this.isiOS ? platform_iOS : platform_Android).toLocaleLowerCase()
}
},
methods: {
......@@ -129,6 +135,36 @@ export default {
duration: 1000
});
}
},
createCenterRecord(value) {
return {
...value,
uni_platform: this.uni_platform,
create_env: 'upgrade-center'
}
},
createCenterQuery({
appid
}) {
return {
appid,
create_env: 'upgrade-center'
}
},
createStatQuery({
appid,
type,
version,
uni_platform
}) {
return {
appid,
type,
version,
uni_platform: uni_platform ? uni_platform : this.uni_platform,
create_env: 'uni-stat',
stable_publish: false
}
}
}
}
......@@ -6,7 +6,7 @@
<view class="uni-sub-title">{{type_valuetotext[formData.type]}}</view>
</view>
</view>
<uni-forms ref="form" :value="formData" validateTrigger="bind">
<uni-forms ref="form" :value="formData" validateTrigger="bind" :labelWidth="labelWidth">
<uni-forms-item name="appid" label="AppID" required>
<uni-easyinput :disabled="true" v-model="formData.appid" trim="both" />
</uni-forms-item>
......@@ -31,11 +31,15 @@
<uni-easyinput placeholder="原生App最低版本" v-model="formData.min_uni_version" />
<show-info :content="minUniVersionContent"></show-info>
</uni-forms-item>
<uni-forms-item v-if="!isiOS" label="上传包">
<uni-forms-item v-if="!isiOS" label="上传apk包">
<uni-file-picker v-model="appFileList" :file-extname="fileExtname" :disabled="hasPackage"
returnType="object" file-mediatype="all" limit="1" @success="packageUploadSuccess"
@delete="packageDelete">
<button type="primary" size="mini" @click="selectFile">选择文件</button>
<view class="flex">
<button type="primary" size="mini" @click="selectFile" style="margin: 0;">选择文件</button>
<text
style="padding: 10px;font-size: 12px;color: #666;">上传apk到当前服务空间的云存储中,上传成功后,会自动使用云存储地址填充下载链接</text>
</view>
</uni-file-picker>
<text v-if="hasPackage"
style="padding-left: 20px;color: #a8a8a8;">{{Number(appFileList.size / 1024 / 1024).toFixed(2)}}M</text>
......@@ -44,6 +48,9 @@
<uni-easyinput placeholder="可下载安装包地址" v-model="formData.url" :maxlength="-1" />
<show-info :top="-80" :content="uploadFileContent"></show-info>
</uni-forms-item>
<!-- <uni-forms-item v-if="formData.store_list" name="store_list" style="height: 0px;"></uni-forms-item> -->
<uni-forms-item v-if="isWGT" name="is_silently" label="静默更新">
<switch @change="binddata('is_silently', $event.detail.value)" :checked="formData.is_silently" />
<show-info :top="-80" :content="silentlyContent"></show-info>
......@@ -72,13 +79,13 @@
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';
import {
appVersionListDbName
} from '../utils.js';
import showInfo from '../components/show-info.vue'
const db = uniCloud.database();
const dbCmd = db.command;
......@@ -147,12 +154,14 @@
type
}) {
if (appid && type && name) {
// const store_list = await this.getStoreList(appid)
this.formData = {
...this.formData,
...{
appid,
name,
type
type,
// store_list
}
}
......@@ -235,10 +244,19 @@
* 触发表单提交
*/
submit() {
if (!this.formData.url && this.isiOS) {
uni.showToast({
icon: 'error',
title: 'AppStore 链接必填'
})
return
}
uni.showLoading({
mask: true
})
this.$refs.form.validate().then((res) => {
// TODO 兼容 uni-forms 的bug
res.url = this.formData.url
if (compare(this.latestVersion, res.version) >= 0) {
uni.showModal({
content: `版本号必须大于当前已上线版本(${this.latestVersion})`,
......@@ -251,15 +269,36 @@
if (!this.isWGT) {
res.platform = [res.platform]
}
if (this.isiOS || this.isWGT) delete res.store_list;
if (res.store_list) {
res.store_list.forEach(item => {
item.priority = parseFloat(item.priority)
})
}
this.submitForm(res)
}).catch((errors) => {
uni.hideLoading()
})
},
async submitForm(value) {
value = this.createCenterRecord(value)
const collectionDB = db.collection(dbCollectionName)
// uni-stat 会创建这些字段 appid
let recordCreateByUniStat = []
if (!this.isWGT) {
recordCreateByUniStat = await this.getDetail(value.appid, value.type, this.createStatQuery(value))
}
let dbOperate
if (!recordCreateByUniStat.length) {
dbOperate = collectionDB.add(value)
} else {
value.create_date = Date.now()
dbOperate = collectionDB.doc(recordCreateByUniStat[0]._id).update(value)
}
// 使用 clientDB 提交数据
collectionDB.add(value).then(async (res) => {
dbOperate.then(async (res) => {
// 如果新增版本为上线发行,且之前有该平台的上线发行,则自动将上一版设为下线
if (value.stable_publish && this.lastVersionId) {
await collectionDB.doc(this.lastVersionId).update({
......@@ -284,16 +323,21 @@
* 获取表单数据
* @param {Object} id
*/
getDetail(appid, type) {
getDetail(appid, type, args = {}) {
uni.showLoading({
mask: true
})
return db.collection(dbCollectionName).where({
appid,
type,
stable_publish: true
}).field(fields)
.get().then((res) => res.result.data)
return db.collection(dbCollectionName)
.where(
Object.assign({
appid,
type,
stable_publish: true
}, args)
)
.field(fields)
.get()
.then((res) => res.result.data)
.catch((err) => {
uni.showModal({
content: err.message || '请求服务失败',
......@@ -303,6 +347,17 @@
uni.hideLoading()
})
},
getStoreList(appid) {
return db.collection('opendb-app-list')
.where({
appid
})
.get()
.then(res => {
const data = res.result.data[0]
return data.store_list || []
})
},
getData(data = [], platform) {
if (typeof platform === 'string') {
return data.filter(item => item.platform.includes(platform))
......@@ -313,7 +368,7 @@
back() {
uni.showModal({
title: '取消发布',
content: this.hasPackage ? '将会删除已上传的包' : '',
content: this.hasPackage ? '将会删除已上传的包' : undefined,
success: res => {
if (res.confirm) {
// 若已上传包但取消发布,则自动将包删除
......@@ -351,4 +406,13 @@
margin-left: 0px;
}
}
.title_padding {
padding-bottom: 15px;
display: block;
}
::v-deep .uni-file-picker__files {
max-width: 100%;
}
</style>
......@@ -11,7 +11,7 @@
<button class="uni-button" type="warn" size="mini" @click="deletePackage">删除</button>
</view>
</view>
<uni-forms ref="form" :value="formData" validateTrigger="bind">
<uni-forms ref="form" :value="formData" validateTrigger="bind" :labelWidth="labelWidth">
<uni-forms-item name="appid" label="AppID" required>
<uni-easyinput :disabled="true" v-model="formData.appid" trim="both" />
</uni-forms-item>
......@@ -37,7 +37,7 @@
<uni-easyinput :disabled="detailsState" placeholder="原生App最低版本" v-model="formData.min_uni_version" />
<show-info :content="minUniVersionContent"></show-info>
</uni-forms-item>
<uni-forms-item v-if="!isiOS && !detailsState" label="上传包">
<uni-forms-item v-if="!isiOS && !detailsState" label="上传apk包">
<uni-file-picker v-model="appFileList" :file-extname="fileExtname" :disabled="hasPackage"
returnType="object" file-mediatype="all" limit="1" @success="packageUploadSuccess"
@delete="packageDelete">
......@@ -46,24 +46,28 @@
<text v-if="hasPackage"
style="padding-left: 20px;color: #a8a8a8;">{{Number(appFileList.size / 1024 / 1024).toFixed(2)}}M</text>
</uni-forms-item>
<uni-forms-item name="url" :label="isiOS ? 'AppStore' : '包地址'" required>
<uni-easyinput :disabled="detailsState" placeholder="可下载安装包地址" v-model="formData.url" :maxlength="-1" />
<show-info :top="-80" :content="uploadFileContent"></show-info>
<uni-forms-item name="url" :label="isiOS ? 'AppStore' : '下载链接'" required>
<uni-easyinput :disabled="detailsState" placeholder="下载链接" v-model="formData.url" :maxlength="-1" />
<!-- <show-info :top="-80" :content="uploadFileContent"></show-info> -->
</uni-forms-item>
<uni-forms-item v-if="isWGT" name="is_silently" label="静默更新">
<switch :disabled="detailsState" @change="binddata('is_silently', $event.detail.value)"
<switch :disabled="detailsState"
@change="binddata('is_silently', $event.detail.value),formData.is_silently=$event.detail.value"
:checked="formData.is_silently" />
<show-info :top="-80" :content="silentlyContent"></show-info>
</uni-forms-item>
<uni-forms-item v-if="!isiOS" name="is_mandatory" label="强制更新">
<switch :disabled="detailsState" @change="binddata('is_mandatory', $event.detail.value)"
<switch :disabled="detailsState"
@change="binddata('is_mandatory', $event.detail.value),formData.is_mandatory=$event.detail.value"
:checked="formData.is_mandatory" />
<show-info :content="mandatoryContent"></show-info>
<show-info width="230" :top="-30" :content="mandatoryContent"></show-info>
</uni-forms-item>
<uni-forms-item name="stable_publish" label="上线发行">
<switch :disabled="detailsState || isStable" @change="binddata('stable_publish', $event.detail.value)"
<switch :disabled="detailsState || isStable"
@change="binddata('stable_publish', $event.detail.value),formData.stable_publish=$event.detail.value"
:checked="formData.stable_publish" />
<show-info v-if="isStable" :top="-100" :content="stablePublishContent"></show-info>
<show-info v-if="isStable" :top="-50" width="350" :content="stablePublishContent"></show-info>
<show-info v-else :top="-40" :content="stablePublishContent2"></show-info>
</uni-forms-item>
<uni-forms-item name="create_date" label="上传时间">
......@@ -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({
......
......@@ -35,6 +35,7 @@
<uni-th align="center">更新标题</uni-th>
<uni-th align="center">安装包类型</uni-th>
<uni-th align="center">平台</uni-th>
<!-- <uni-th align="center">已上架应用市场</uni-th> -->
<uni-th align="center">版本号</uni-th>
<uni-th align="center">安装包状态</uni-th>
<uni-th align="center">上传时间</uni-th>
......@@ -56,6 +57,9 @@
<uni-data-picker :localdata="options.platform_valuetotext" :value="item.platform"
:border="false" :readonly="true" split="," />
</uni-td>
<!-- <uni-td align="center">
<text>{{store_list_key(item.store_list)}}</text>
</uni-td> -->
<uni-td align="center"> {{item.version}} </uni-td>
<uni-td align="center"> {{item.stable_publish == true ? '已上线' : '已下线'}} </uni-td>
<uni-td align="center">
......@@ -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(',') :
'-'
}
}
}
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册