-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{$t('settings.logOut')}}
- {{$t('settings.login')}}
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/ucenter/userinfo/bind-mobile/bind-mobile.vue b/pages/ucenter/userinfo/bind-mobile/bind-mobile.vue
index 29cb05d85f094acd893fe7e7ede6875ecdf7e8dd..fc255197e4e10458b95aec5db53141d8802236e8 100644
--- a/pages/ucenter/userinfo/bind-mobile/bind-mobile.vue
+++ b/pages/ucenter/userinfo/bind-mobile/bind-mobile.vue
@@ -1,77 +1,77 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ }
+ }
+ }
+
+
+
diff --git a/pages/ucenter/userinfo/limeClipper/utils.js b/pages/ucenter/userinfo/limeClipper/utils.js
index 980c43915efa8b5664ca42e439e1e0ef2b28cb4b..c807d8cbbf3948081e07f5ec4fbb9c703af0f3f5 100644
--- a/pages/ucenter/userinfo/limeClipper/utils.js
+++ b/pages/ucenter/userinfo/limeClipper/utils.js
@@ -1,244 +1,244 @@
-/**
- * 判断手指触摸位置
- */
-export function determineDirection(clipX, clipY, clipWidth, clipHeight, currentX, currentY) {
- /*
- * (右下>>1 右上>>2 左上>>3 左下>>4)
- */
- let corner;
- /**
- * 思路:(利用直角坐标系)
- * 1.找出裁剪框中心点
- * 2.如点击坐标在上方点与左方点区域内,则点击为左上角
- * 3.如点击坐标在下方点与右方点区域内,则点击为右下角
- * 4.其他角同理
- */
- const mainPoint = [clipX + clipWidth / 2, clipY + clipHeight / 2]; // 中心点
- const currentPoint = [currentX, currentY]; // 触摸点
-
- if (currentPoint[0] <= mainPoint[0] && currentPoint[1] <= mainPoint[1]) {
- corner = 3; // 左上
- } else if (currentPoint[0] >= mainPoint[0] && currentPoint[1] <= mainPoint[1]) {
- corner = 2; // 右上
- } else if (currentPoint[0] <= mainPoint[0] && currentPoint[1] >= mainPoint[1]) {
- corner = 4; // 左下
- } else if (currentPoint[0] >= mainPoint[0] && currentPoint[1] >= mainPoint[1]) {
- corner = 1; // 右下
- }
-
- return corner;
-}
-
-/**
- * 图片边缘检测检测时,计算图片偏移量
- */
-export function calcImageOffset(data, scale) {
- let left = data.imageLeft;
- let top = data.imageTop;
- scale = scale || data.scale;
-
- let imageWidth = data.imageWidth;
- let imageHeight = data.imageHeight;
- if ((data.angle / 90) % 2) {
- imageWidth = data.imageHeight;
- imageHeight = data.imageWidth;
- }
- const {
- clipX,
- clipWidth,
- clipY,
- clipHeight
- } = data;
-
- // 当前图片宽度/高度
- const currentImageSize = (size) => (size * scale) / 2;
- const currentImageWidth = currentImageSize(imageWidth);
- const currentImageHeight = currentImageSize(imageHeight);
-
- left = clipX + currentImageWidth >= left ? left : clipX + currentImageWidth;
- left = clipX + clipWidth - currentImageWidth <= left ? left : clipX + clipWidth - currentImageWidth;
- top = clipY + currentImageHeight >= top ? top : clipY + currentImageHeight;
- top = clipY + clipHeight - currentImageHeight <= top ? top : clipY + clipHeight - currentImageHeight;
- return {
- left,
- top,
- scale
- };
-}
-
-/**
- * 图片边缘检测时,计算图片缩放比例
- */
-export function calcImageScale(data, scale) {
- scale = scale || data.scale;
- let {
- imageWidth,
- imageHeight,
- clipWidth,
- clipHeight,
- angle
- } = data
- if ((angle / 90) % 2) {
- imageWidth = imageHeight;
- imageHeight = imageWidth;
- }
- if (imageWidth * scale < clipWidth) {
- scale = clipWidth / imageWidth;
- }
- if (imageHeight * scale < clipHeight) {
- scale = Math.max(scale, clipHeight / imageHeight);
- }
- return scale;
-}
-
-/**
- * 计算图片尺寸
- */
-export function calcImageSize(width, height, data) {
- let imageWidth = width,
- imageHeight = height;
- let {
- clipWidth,
- clipHeight,
- sysinfo,
- width: originWidth,
- height: originHeight
- } = data
- if (imageWidth && imageHeight) {
- if (imageWidth / imageHeight > (clipWidth || originWidth) / (clipWidth || originHeight)) {
- imageHeight = clipHeight || originHeight;
- imageWidth = (width / height) * imageHeight;
- } else {
- imageWidth = clipWidth || originWidth;
- imageHeight = (height / width) * imageWidth;
- }
- } else {
- let sys = sysinfo || uni.getSystemInfoSync();
- imageWidth = sys.windowWidth;
- imageHeight = 0;
- }
- return {
- imageWidth,
- imageHeight
- };
-}
-
-/**
- * 勾股定理求斜边
- */
-export function calcPythagoreanTheorem(width, height) {
- return Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));
-}
-
-/**
- * 拖动裁剪框时计算
- */
-export function clipTouchMoveOfCalculate(data, event) {
- const clientX = event.touches[0].clientX;
- const clientY = event.touches[0].clientY;
-
- let {
- clipWidth,
- clipHeight,
- clipY: oldClipY,
- clipX: oldClipX,
- clipStart,
- isLockRatio,
- maxWidth,
- minWidth,
- maxHeight,
- minHeight
- } = data;
- maxWidth = maxWidth / 2;
- minWidth = minWidth / 2;
- minHeight = minHeight / 2;
- maxHeight = maxHeight / 2;
-
- let width = clipWidth,
- height = clipHeight,
- clipY = oldClipY,
- clipX = oldClipX,
- // 获取裁剪框实际宽度/高度
- // 如果大于最大值则使用最大值
- // 如果小于最小值则使用最小值
- sizecorrect = () => {
- width = width <= maxWidth ? (width >= minWidth ? width : minWidth) : maxWidth;
- height = height <= maxHeight ? (height >= minHeight ? height : minHeight) : maxHeight;
- },
- sizeinspect = () => {
- sizecorrect();
- if ((width > maxWidth || width < minWidth || height > maxHeight || height < minHeight) && isLockRatio) {
- return false;
- } else {
- return true;
- }
- };
- //if (clipStart.corner) {
- height = clipStart.height + (clipStart.corner > 1 && clipStart.corner < 4 ? 1 : -1) * (clipStart.y - clientY);
- //}
- switch (clipStart.corner) {
- case 1:
- width = clipStart.width - clipStart.x + clientX;
- if (isLockRatio) {
- height = width / (clipWidth / clipHeight);
- }
- if (!sizeinspect()) return;
- break;
- case 2:
- width = clipStart.width - clipStart.x + clientX;
- if (isLockRatio) {
- height = width / (clipWidth / clipHeight);
- }
- if (!sizeinspect()) {
- return;
- } else {
- clipY = clipStart.clipY - (height - clipStart.height);
- }
-
- break;
- case 3:
- width = clipStart.width + clipStart.x - clientX;
- if (isLockRatio) {
- height = width / (clipWidth / clipHeight);
- }
- if (!sizeinspect()) {
- return;
- } else {
- clipY = clipStart.clipY - (height - clipStart.height);
- clipX = clipStart.clipX - (width - clipStart.width);
- }
-
- break;
- case 4:
- width = clipStart.width + clipStart.x - clientX;
- if (isLockRatio) {
- height = width / (clipWidth / clipHeight);
- }
- if (!sizeinspect()) {
- return;
- } else {
- clipX = clipStart.clipX - (width - clipStart.width);
- }
- break;
- default:
- break;
- }
- return {
- width,
- height,
- clipX,
- clipY
- };
-}
-
-/**
- * 单指拖动图片计算偏移
- */
-export function imageTouchMoveOfCalcOffset(data, clientXForLeft, clientYForLeft) {
- let left = clientXForLeft - data.touchRelative[0].x,
- top = clientYForLeft - data.touchRelative[0].y;
- return {
- left,
- top
- };
-}
+/**
+ * 判断手指触摸位置
+ */
+export function determineDirection(clipX, clipY, clipWidth, clipHeight, currentX, currentY) {
+ /*
+ * (右下>>1 右上>>2 左上>>3 左下>>4)
+ */
+ let corner;
+ /**
+ * 思路:(利用直角坐标系)
+ * 1.找出裁剪框中心点
+ * 2.如点击坐标在上方点与左方点区域内,则点击为左上角
+ * 3.如点击坐标在下方点与右方点区域内,则点击为右下角
+ * 4.其他角同理
+ */
+ const mainPoint = [clipX + clipWidth / 2, clipY + clipHeight / 2]; // 中心点
+ const currentPoint = [currentX, currentY]; // 触摸点
+
+ if (currentPoint[0] <= mainPoint[0] && currentPoint[1] <= mainPoint[1]) {
+ corner = 3; // 左上
+ } else if (currentPoint[0] >= mainPoint[0] && currentPoint[1] <= mainPoint[1]) {
+ corner = 2; // 右上
+ } else if (currentPoint[0] <= mainPoint[0] && currentPoint[1] >= mainPoint[1]) {
+ corner = 4; // 左下
+ } else if (currentPoint[0] >= mainPoint[0] && currentPoint[1] >= mainPoint[1]) {
+ corner = 1; // 右下
+ }
+
+ return corner;
+}
+
+/**
+ * 图片边缘检测检测时,计算图片偏移量
+ */
+export function calcImageOffset(data, scale) {
+ let left = data.imageLeft;
+ let top = data.imageTop;
+ scale = scale || data.scale;
+
+ let imageWidth = data.imageWidth;
+ let imageHeight = data.imageHeight;
+ if ((data.angle / 90) % 2) {
+ imageWidth = data.imageHeight;
+ imageHeight = data.imageWidth;
+ }
+ const {
+ clipX,
+ clipWidth,
+ clipY,
+ clipHeight
+ } = data;
+
+ // 当前图片宽度/高度
+ const currentImageSize = (size) => (size * scale) / 2;
+ const currentImageWidth = currentImageSize(imageWidth);
+ const currentImageHeight = currentImageSize(imageHeight);
+
+ left = clipX + currentImageWidth >= left ? left : clipX + currentImageWidth;
+ left = clipX + clipWidth - currentImageWidth <= left ? left : clipX + clipWidth - currentImageWidth;
+ top = clipY + currentImageHeight >= top ? top : clipY + currentImageHeight;
+ top = clipY + clipHeight - currentImageHeight <= top ? top : clipY + clipHeight - currentImageHeight;
+ return {
+ left,
+ top,
+ scale
+ };
+}
+
+/**
+ * 图片边缘检测时,计算图片缩放比例
+ */
+export function calcImageScale(data, scale) {
+ scale = scale || data.scale;
+ let {
+ imageWidth,
+ imageHeight,
+ clipWidth,
+ clipHeight,
+ angle
+ } = data
+ if ((angle / 90) % 2) {
+ imageWidth = imageHeight;
+ imageHeight = imageWidth;
+ }
+ if (imageWidth * scale < clipWidth) {
+ scale = clipWidth / imageWidth;
+ }
+ if (imageHeight * scale < clipHeight) {
+ scale = Math.max(scale, clipHeight / imageHeight);
+ }
+ return scale;
+}
+
+/**
+ * 计算图片尺寸
+ */
+export function calcImageSize(width, height, data) {
+ let imageWidth = width,
+ imageHeight = height;
+ let {
+ clipWidth,
+ clipHeight,
+ sysinfo,
+ width: originWidth,
+ height: originHeight
+ } = data
+ if (imageWidth && imageHeight) {
+ if (imageWidth / imageHeight > (clipWidth || originWidth) / (clipWidth || originHeight)) {
+ imageHeight = clipHeight || originHeight;
+ imageWidth = (width / height) * imageHeight;
+ } else {
+ imageWidth = clipWidth || originWidth;
+ imageHeight = (height / width) * imageWidth;
+ }
+ } else {
+ let sys = sysinfo || uni.getSystemInfoSync();
+ imageWidth = sys.windowWidth;
+ imageHeight = 0;
+ }
+ return {
+ imageWidth,
+ imageHeight
+ };
+}
+
+/**
+ * 勾股定理求斜边
+ */
+export function calcPythagoreanTheorem(width, height) {
+ return Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));
+}
+
+/**
+ * 拖动裁剪框时计算
+ */
+export function clipTouchMoveOfCalculate(data, event) {
+ const clientX = event.touches[0].clientX;
+ const clientY = event.touches[0].clientY;
+
+ let {
+ clipWidth,
+ clipHeight,
+ clipY: oldClipY,
+ clipX: oldClipX,
+ clipStart,
+ isLockRatio,
+ maxWidth,
+ minWidth,
+ maxHeight,
+ minHeight
+ } = data;
+ maxWidth = maxWidth / 2;
+ minWidth = minWidth / 2;
+ minHeight = minHeight / 2;
+ maxHeight = maxHeight / 2;
+
+ let width = clipWidth,
+ height = clipHeight,
+ clipY = oldClipY,
+ clipX = oldClipX,
+ // 获取裁剪框实际宽度/高度
+ // 如果大于最大值则使用最大值
+ // 如果小于最小值则使用最小值
+ sizecorrect = () => {
+ width = width <= maxWidth ? (width >= minWidth ? width : minWidth) : maxWidth;
+ height = height <= maxHeight ? (height >= minHeight ? height : minHeight) : maxHeight;
+ },
+ sizeinspect = () => {
+ sizecorrect();
+ if ((width > maxWidth || width < minWidth || height > maxHeight || height < minHeight) && isLockRatio) {
+ return false;
+ } else {
+ return true;
+ }
+ };
+ //if (clipStart.corner) {
+ height = clipStart.height + (clipStart.corner > 1 && clipStart.corner < 4 ? 1 : -1) * (clipStart.y - clientY);
+ //}
+ switch (clipStart.corner) {
+ case 1:
+ width = clipStart.width - clipStart.x + clientX;
+ if (isLockRatio) {
+ height = width / (clipWidth / clipHeight);
+ }
+ if (!sizeinspect()) return;
+ break;
+ case 2:
+ width = clipStart.width - clipStart.x + clientX;
+ if (isLockRatio) {
+ height = width / (clipWidth / clipHeight);
+ }
+ if (!sizeinspect()) {
+ return;
+ } else {
+ clipY = clipStart.clipY - (height - clipStart.height);
+ }
+
+ break;
+ case 3:
+ width = clipStart.width + clipStart.x - clientX;
+ if (isLockRatio) {
+ height = width / (clipWidth / clipHeight);
+ }
+ if (!sizeinspect()) {
+ return;
+ } else {
+ clipY = clipStart.clipY - (height - clipStart.height);
+ clipX = clipStart.clipX - (width - clipStart.width);
+ }
+
+ break;
+ case 4:
+ width = clipStart.width + clipStart.x - clientX;
+ if (isLockRatio) {
+ height = width / (clipWidth / clipHeight);
+ }
+ if (!sizeinspect()) {
+ return;
+ } else {
+ clipX = clipStart.clipX - (width - clipStart.width);
+ }
+ break;
+ default:
+ break;
+ }
+ return {
+ width,
+ height,
+ clipX,
+ clipY
+ };
+}
+
+/**
+ * 单指拖动图片计算偏移
+ */
+export function imageTouchMoveOfCalcOffset(data, clientXForLeft, clientYForLeft) {
+ let left = clientXForLeft - data.touchRelative[0].x,
+ top = clientYForLeft - data.touchRelative[0].y;
+ return {
+ left,
+ top
+ };
+}
diff --git a/pages/ucenter/userinfo/userinfo.vue b/pages/ucenter/userinfo/userinfo.vue
index 7e3f42307fde886b001e9b9847ed198c5cf5eded..7c38f725b3a4182d120bfae25383900e1634ec2b 100644
--- a/pages/ucenter/userinfo/userinfo.vue
+++ b/pages/ucenter/userinfo/userinfo.vue
@@ -1,284 +1,284 @@
-
-
-
-
-
-
- {{$t('userinfo.ProfilePhoto')}}
-
+
+
+
+
+
+
+ {{$t('userinfo.ProfilePhoto')}}
+
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
-
-
-
-
diff --git a/pages/uni-agree/uni-agree.nvue b/pages/uni-agree/uni-agree.nvue
index 5befcea554d0b103656b23cf176e3cc895153aa4..4ac97e652235d36294c6c7af43f0993c37fe7f1d 100644
--- a/pages/uni-agree/uni-agree.nvue
+++ b/pages/uni-agree/uni-agree.nvue
@@ -1,73 +1,73 @@
-
-
-
- 个人信息保护指引
-
-
- 1.在浏览使用时,我们会收集、使用设备标识信息用于推荐。
-
-
- 2.我们可能会申请位置权限,用于演示 uni-app 的地图、定位能力。
-
-
- 3.你可以查看完整版
-
-
- 《用户协议》
- 和
- 《隐私政策》
-
-
- 以便了解我们收集、使用、共享、存储信息的情况,以及对信息的保护措施。
-
-
- 如果你同意请点击下面的按钮以接受我们的服务
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/store/index.js b/store/index.js
index 0282d1430997be1e01927f85255f098ee0349608..efbd986d90fd99dc02b3bf10d6e539a20bfda5aa 100644
--- a/store/index.js
+++ b/store/index.js
@@ -1,24 +1,24 @@
-import user from '@/store/modules/user.js'
-
-// #ifndef VUE3
-import Vue from 'vue'
-import Vuex from 'vuex'
-Vue.use(Vuex)
-const store = new Vuex.Store({
- modules: {
- user
- },
- strict: true
-})
-// #endif
-
-// #ifdef VUE3
-import {createStore} from 'vuex'
+import user from '@/store/modules/user.js'
+
+// #ifndef VUE3
+import Vue from 'vue'
+import Vuex from 'vuex'
+Vue.use(Vuex)
+const store = new Vuex.Store({
+ modules: {
+ user
+ },
+ strict: true
+})
+// #endif
+
+// #ifdef VUE3
+import {createStore} from 'vuex'
const store = createStore({
modules: {
user
}
-})
-// #endif
-
+})
+// #endif
+
export default store
\ No newline at end of file
diff --git a/uniCloud-aliyun/cloudfunctions/uni-analyse-searchhot/index.js b/uniCloud-aliyun/cloudfunctions/uni-analyse-searchhot/index.js
index 1f16dc2fe70cfe7a79f8ce4dece68d49ccf51947..b87d021729c7ed16b73fe600fff151bdec22f092 100644
--- a/uniCloud-aliyun/cloudfunctions/uni-analyse-searchhot/index.js
+++ b/uniCloud-aliyun/cloudfunctions/uni-analyse-searchhot/index.js
@@ -1,49 +1,49 @@
-'use strict';
-exports.main = async (event, context) => {
- /**
- * 根据搜索记录,设定时间间隔来归纳出热搜数据并存储在热搜表中
- */
- const SEARCHHOT = 'opendb-search-hot'; // 热搜数据库名称
- const SEARCHLOG = 'opendb-search-log'; // 搜索记录数据库名称
- const SEARCHLOG_timeZone = 604800000; // 归纳搜索记录时间间隔,毫秒数,默认为最近7天
- const SEARCHHOT_size = 10; // 热搜条数
-
- const DB = uniCloud.database();
- const DBCmd = DB.command;
- const $ = DB.command.aggregate;
- const SEARCHHOT_db = DB.collection(SEARCHHOT);
- const SEARCHLOG_db = DB.collection(SEARCHLOG);
- const timeEnd = Date.now() - SEARCHLOG_timeZone;
-
- let {
- data: searchHotData
- } = await SEARCHLOG_db
- .aggregate()
- .match({
- create_date: DBCmd.gt(timeEnd)
- })
- .group({
- _id: {
- 'content': '$content',
- },
- count: $.sum(1)
- })
- .replaceRoot({
- newRoot: $.mergeObjects(['$_id', '$$ROOT'])
- })
- .project({
- _id: false
- })
- .sort({
- count: -1
- })
- .end();
-
- let now = Date.now();
- searchHotData.map(item => {
- item.create_date = now;
- return item;
- }).slice(0, SEARCHHOT_size);
- // searchHotData = searchHotData.sort((a, b) => b.count - a.count).slice(0, SEARCHHOT_size);
- return searchHotData.length ? await SEARCHHOT_db.add(searchHotData) : ''
-};
+'use strict';
+exports.main = async (event, context) => {
+ /**
+ * 根据搜索记录,设定时间间隔来归纳出热搜数据并存储在热搜表中
+ */
+ const SEARCHHOT = 'opendb-search-hot'; // 热搜数据库名称
+ const SEARCHLOG = 'opendb-search-log'; // 搜索记录数据库名称
+ const SEARCHLOG_timeZone = 604800000; // 归纳搜索记录时间间隔,毫秒数,默认为最近7天
+ const SEARCHHOT_size = 10; // 热搜条数
+
+ const DB = uniCloud.database();
+ const DBCmd = DB.command;
+ const $ = DB.command.aggregate;
+ const SEARCHHOT_db = DB.collection(SEARCHHOT);
+ const SEARCHLOG_db = DB.collection(SEARCHLOG);
+ const timeEnd = Date.now() - SEARCHLOG_timeZone;
+
+ let {
+ data: searchHotData
+ } = await SEARCHLOG_db
+ .aggregate()
+ .match({
+ create_date: DBCmd.gt(timeEnd)
+ })
+ .group({
+ _id: {
+ 'content': '$content',
+ },
+ count: $.sum(1)
+ })
+ .replaceRoot({
+ newRoot: $.mergeObjects(['$_id', '$$ROOT'])
+ })
+ .project({
+ _id: false
+ })
+ .sort({
+ count: -1
+ })
+ .end();
+
+ let now = Date.now();
+ searchHotData.map(item => {
+ item.create_date = now;
+ return item;
+ }).slice(0, SEARCHHOT_size);
+ // searchHotData = searchHotData.sort((a, b) => b.count - a.count).slice(0, SEARCHHOT_size);
+ return searchHotData.length ? await SEARCHHOT_db.add(searchHotData) : ''
+};
diff --git a/uniCloud-aliyun/cloudfunctions/uni-analyse-searchhot/package.json b/uniCloud-aliyun/cloudfunctions/uni-analyse-searchhot/package.json
index 6005add8563ac879001ba7f5fdeb304768ed8486..2102599074a290040974ef3519f5707f00db66d6 100644
--- a/uniCloud-aliyun/cloudfunctions/uni-analyse-searchhot/package.json
+++ b/uniCloud-aliyun/cloudfunctions/uni-analyse-searchhot/package.json
@@ -1,14 +1,14 @@
-{
- "name": "uni-analyse-searchhot",
- "version": "1.0.0",
- "description": "定时归纳热搜",
- "main": "index.js",
- "dependencies": {},
- "cloudfunction-config": {
- "triggers": [{
- "name": "analyse-searchHot",
- "type": "timer",
- "config": "0 0 */2 * * * *"
- }]
- }
-}
+{
+ "name": "uni-analyse-searchhot",
+ "version": "1.0.0",
+ "description": "定时归纳热搜",
+ "main": "index.js",
+ "dependencies": {},
+ "cloudfunction-config": {
+ "triggers": [{
+ "name": "analyse-searchHot",
+ "type": "timer",
+ "config": "0 0 */2 * * * *"
+ }]
+ }
+}
diff --git a/uniCloud-aliyun/database/db_init.json b/uniCloud-aliyun/database/db_init.json
index 6c7d6891cea81a29360b087bf2f4029127174a31..20f4b1f4bd95d20ea2c4187ef839e9b37d658840 100644
--- a/uniCloud-aliyun/database/db_init.json
+++ b/uniCloud-aliyun/database/db_init.json
@@ -1,157 +1,157 @@
// 在本文件中可配置云数据库初始化,数据格式见:https://uniapp.dcloud.io/uniCloud/cf-database?id=db_init
-// 编写完毕后对本文件点右键,可按配置规则创建表和添加数据
-{
- "opendb-verify-codes": {
- "data": []
- },
- "uni-id-roles": {
- "data": []
- },
- "uni-id-permissions": {
- "data": []
+// 编写完毕后对本文件点右键,可按配置规则创建表和添加数据
+{
+ "opendb-verify-codes": {
+ "data": []
+ },
+ "uni-id-roles": {
+ "data": []
+ },
+ "uni-id-permissions": {
+ "data": []
},
"uni-id-log": {
"data": []
- },
- "opendb-admin-menus": {
- "data": [{
- "menu_id": "system_management",
- "name": "系统管理",
- "icon": "uni-icons-gear",
- "url": "",
- "sort": 1000,
- "parent_id": "",
- "permission": [],
- "enable": true,
- "create_date": 1602662469396
- }, {
- "menu_id": "system_user",
- "name": "用户管理",
- "icon": "uni-icons-person",
- "url": "/pages/system/user/list",
- "sort": 1010,
- "parent_id": "system_management",
- "permission": [],
- "enable": true,
- "create_date": 1602662469398
- }, {
- "menu_id": "system_role",
- "name": "角色管理",
- "icon": "uni-icons-personadd",
- "url": "/pages/system/role/list",
- "sort": 1020,
- "parent_id": "system_management",
- "permission": [],
- "enable": true,
- "create_date": 1602662469397
- }, {
- "menu_id": "system_permission",
- "name": "权限管理",
- "icon": "uni-icons-locked",
- "url": "/pages/system/permission/list",
- "sort": 1030,
- "parent_id": "system_management",
- "permission": [],
- "enable": true,
- "create_date": 1602662469396
- }, {
- "menu_id": "system_menu",
- "name": "菜单管理",
- "icon": "uni-icons-settings",
- "url": "/pages/system/menu/list",
- "sort": 1040,
- "parent_id": "system_management",
- "permission": [],
- "enable": true,
- "create_date": 1602662469396
- }]
- },
- "opendb-news-articles": {
- "data": [{
- "title": "阿里小程序IDE官方内嵌uni-app,为开发者提供多端开发服务",
- "excerpt": "阿里小程序IDE官方内嵌uni-app,为开发者提供多端开发服务",
- "content": "随着微信、阿里、百度、头条、QQ纷纷推出小程序,开发者的开发维护成本持续上升,负担过重。这点已经成为共识,现在连小程序平台厂商也充分意识到了。
\n阿里小程序团队,为了减轻开发者的负担,在官方的小程序开发者工具中整合了多端框架。
\n经过阿里团队仔细评估,uni-app 在产品完成度、跨平台支持度、开发者社区、可持续发展等多方面优势明显,最终选定 uni-app内置于阿里小程序开发工具中,为开发者提供多端开发解决方案。
\n经过之前1个月的公测,10月10日,阿里小程序正式发布0.70版开发者工具,通过 uni-app 实现多端开发,成为本次版本更新的亮点功能!
\n如下图,在阿里小程序工具左侧主导航选择 uni-app,创建项目,即可开发。
\n\n
阿里小程序开发工具更新说明详见:https://docs.alipay.com/mini/ide/0.70-stable
\n
\n集成uni-app,这对于阿里团队而言,并不是一个容易做出的决定。毕竟 uni-app 是一个三方产品,要经过复杂的评审流程。
\n这一方面突显出阿里团队以开发者需求为本的优秀价值观,另一方面也证明 uni-app的产品确实过硬。
\n很多开发者都有多端需求,但又没有足够精力去了解、评估 uni-app,而处于观望态度。现在大家可以更放心的使用 uni-app 了,它没有让阿里失望,也不会让你失望。
\n自从uni-app推出以来,DCloud也取得了高速的发展,目前拥有370万开发者,框架运行在4.6亿手机用户设备上,月活达到1.35亿(仅包括部分接入DCloud统计平台的数据)。并且数据仍在高速增长中,在市场占有率上处于遥遥领先的位置。
\n本次阿里小程序工具集成 uni-app,会让 uni-app 继续快速爆发,取得更大的成功。
\n后续DCloud还将深化与阿里的合作,在serverless等领域给开发者提供更多优质服务。
\n使用多端框架开发各端应用,是多赢的模式。开发者减轻了负担,获得了更多新流量。而小程序平台厂商,也能保证自己平台上的各种应用可以被及时的更新。
\nDCloud欢迎更多小程序平台厂商,与我们一起合作,为开发者、平台、用户的多赢而努力。
\n进一步了解uni-app,详见:https://uniapp.dcloud.io
\n欢迎扫码关注DCloud公众号,转发消息到朋友圈。
",
- "avatar": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-aliyun-gacrhzeynhss7c6d04/249516a0-3941-11eb-899d-733ae62bed2f.jpg",
- "type": 0,
- "user_id": "123",
- "comment_count": 0,
- "like_count": 0,
- "comment_status": 0,
- "article_status": 1,
- "publish_date": 1616092287006,
- "last_modify_date": 1616092303031,
- "create_time": "2021-03-19T08:25:06.109Z"
- }]
- },
- "opendb-app-versions": {
- "data": [{
- "is_silently": false,
- "is_mandatory": false,
- "appid": "__UNI__03B096E",
- "name": "uni-starter",
- "title": "新增升级中心",
- "contents": "新增升级中心",
- "platform": [
- "Android"
- ],
- "version": "1.0.1",
- "url": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-3469aac7-a663-4c5d-8ee8-94275f8c09ab/3128d010-01c5-4121-a1d6-f3f919944a23.apk",
- "stable_publish": false,
- "type": "native_app",
- "create_date": 1616771628150
- }]
- },
- "uni-id-users": {
- "data": [{
- "_id": "123",
- "username": "预置用户",
- "nickname": "测试",
- "avatar": "https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-dc-site/d84c6de0-6080-11eb-bdc1-8bd33eb6adaa.png",
- "mobile": "18888888888",
- "mobile_confirmed": 1
- }]
- },
- "opendb-banner": {
- "data": [{
- "status": true,
- "bannerfile": {
- "name": "094a9dc0-50c0-11eb-b680-7980c8a877b8.jpg",
- "extname": "jpg",
- "fileType": "image",
- "url": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e/b88a7e17-35f0-4d0d-bc32-93f8909baf03.jpg",
- "size": 70880,
- "image": {
- "width": 500,
- "height": 333,
- "location": "blob:http://localhost:8081/a3bfaab4-7ee6-44d5-a171-dc8225d83598"
- },
- "path": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e/b88a7e17-35f0-4d0d-bc32-93f8909baf03.jpg"
- },
- "open_url": "https://www.dcloud.io/",
- "title": "测试",
- "sort": 1,
- "category_id": "",
- "description": ""
- },
- {
- "status": true,
- "bannerfile": {
- "name": "094a9dc0-50c0-11eb-b680-7980c8a877b8.jpg",
- "extname": "jpg",
- "fileType": "image",
- "url": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e/9db94cb4-a5e0-4ed9-b356-b42a392b3112.jpg",
- "size": 70880,
- "image": {
- "width": 500,
- "height": 333,
- "location": "blob:http://localhost:8081/1a6f718a-4012-476a-9172-590fef2cc518"
- },
- "path": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e/9db94cb4-a5e0-4ed9-b356-b42a392b3112.jpg"
- },
- "open_url": "https://www.dcloud.io/",
- "title": "",
- "category_id": "",
- "description": ""
+ },
+ "opendb-admin-menus": {
+ "data": [{
+ "menu_id": "system_management",
+ "name": "系统管理",
+ "icon": "uni-icons-gear",
+ "url": "",
+ "sort": 1000,
+ "parent_id": "",
+ "permission": [],
+ "enable": true,
+ "create_date": 1602662469396
+ }, {
+ "menu_id": "system_user",
+ "name": "用户管理",
+ "icon": "uni-icons-person",
+ "url": "/pages/system/user/list",
+ "sort": 1010,
+ "parent_id": "system_management",
+ "permission": [],
+ "enable": true,
+ "create_date": 1602662469398
+ }, {
+ "menu_id": "system_role",
+ "name": "角色管理",
+ "icon": "uni-icons-personadd",
+ "url": "/pages/system/role/list",
+ "sort": 1020,
+ "parent_id": "system_management",
+ "permission": [],
+ "enable": true,
+ "create_date": 1602662469397
+ }, {
+ "menu_id": "system_permission",
+ "name": "权限管理",
+ "icon": "uni-icons-locked",
+ "url": "/pages/system/permission/list",
+ "sort": 1030,
+ "parent_id": "system_management",
+ "permission": [],
+ "enable": true,
+ "create_date": 1602662469396
+ }, {
+ "menu_id": "system_menu",
+ "name": "菜单管理",
+ "icon": "uni-icons-settings",
+ "url": "/pages/system/menu/list",
+ "sort": 1040,
+ "parent_id": "system_management",
+ "permission": [],
+ "enable": true,
+ "create_date": 1602662469396
}]
- }
+ },
+ "opendb-news-articles": {
+ "data": [{
+ "title": "阿里小程序IDE官方内嵌uni-app,为开发者提供多端开发服务",
+ "excerpt": "阿里小程序IDE官方内嵌uni-app,为开发者提供多端开发服务",
+ "content": "随着微信、阿里、百度、头条、QQ纷纷推出小程序,开发者的开发维护成本持续上升,负担过重。这点已经成为共识,现在连小程序平台厂商也充分意识到了。
\n阿里小程序团队,为了减轻开发者的负担,在官方的小程序开发者工具中整合了多端框架。
\n经过阿里团队仔细评估,uni-app 在产品完成度、跨平台支持度、开发者社区、可持续发展等多方面优势明显,最终选定 uni-app内置于阿里小程序开发工具中,为开发者提供多端开发解决方案。
\n经过之前1个月的公测,10月10日,阿里小程序正式发布0.70版开发者工具,通过 uni-app 实现多端开发,成为本次版本更新的亮点功能!
\n如下图,在阿里小程序工具左侧主导航选择 uni-app,创建项目,即可开发。
\n\n
阿里小程序开发工具更新说明详见:https://docs.alipay.com/mini/ide/0.70-stable
\n
\n集成uni-app,这对于阿里团队而言,并不是一个容易做出的决定。毕竟 uni-app 是一个三方产品,要经过复杂的评审流程。
\n这一方面突显出阿里团队以开发者需求为本的优秀价值观,另一方面也证明 uni-app的产品确实过硬。
\n很多开发者都有多端需求,但又没有足够精力去了解、评估 uni-app,而处于观望态度。现在大家可以更放心的使用 uni-app 了,它没有让阿里失望,也不会让你失望。
\n自从uni-app推出以来,DCloud也取得了高速的发展,目前拥有370万开发者,框架运行在4.6亿手机用户设备上,月活达到1.35亿(仅包括部分接入DCloud统计平台的数据)。并且数据仍在高速增长中,在市场占有率上处于遥遥领先的位置。
\n本次阿里小程序工具集成 uni-app,会让 uni-app 继续快速爆发,取得更大的成功。
\n后续DCloud还将深化与阿里的合作,在serverless等领域给开发者提供更多优质服务。
\n使用多端框架开发各端应用,是多赢的模式。开发者减轻了负担,获得了更多新流量。而小程序平台厂商,也能保证自己平台上的各种应用可以被及时的更新。
\nDCloud欢迎更多小程序平台厂商,与我们一起合作,为开发者、平台、用户的多赢而努力。
\n进一步了解uni-app,详见:https://uniapp.dcloud.io
\n欢迎扫码关注DCloud公众号,转发消息到朋友圈。
",
+ "avatar": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-aliyun-gacrhzeynhss7c6d04/249516a0-3941-11eb-899d-733ae62bed2f.jpg",
+ "type": 0,
+ "user_id": "123",
+ "comment_count": 0,
+ "like_count": 0,
+ "comment_status": 0,
+ "article_status": 1,
+ "publish_date": 1616092287006,
+ "last_modify_date": 1616092303031,
+ "create_time": "2021-03-19T08:25:06.109Z"
+ }]
+ },
+ "opendb-app-versions": {
+ "data": [{
+ "is_silently": false,
+ "is_mandatory": false,
+ "appid": "__UNI__03B096E",
+ "name": "uni-starter",
+ "title": "新增升级中心",
+ "contents": "新增升级中心",
+ "platform": [
+ "Android"
+ ],
+ "version": "1.0.1",
+ "url": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-3469aac7-a663-4c5d-8ee8-94275f8c09ab/3128d010-01c5-4121-a1d6-f3f919944a23.apk",
+ "stable_publish": false,
+ "type": "native_app",
+ "create_date": 1616771628150
+ }]
+ },
+ "uni-id-users": {
+ "data": [{
+ "_id": "123",
+ "username": "预置用户",
+ "nickname": "测试",
+ "avatar": "https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-dc-site/d84c6de0-6080-11eb-bdc1-8bd33eb6adaa.png",
+ "mobile": "18888888888",
+ "mobile_confirmed": 1
+ }]
+ },
+ "opendb-banner": {
+ "data": [{
+ "status": true,
+ "bannerfile": {
+ "name": "094a9dc0-50c0-11eb-b680-7980c8a877b8.jpg",
+ "extname": "jpg",
+ "fileType": "image",
+ "url": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e/b88a7e17-35f0-4d0d-bc32-93f8909baf03.jpg",
+ "size": 70880,
+ "image": {
+ "width": 500,
+ "height": 333,
+ "location": "blob:http://localhost:8081/a3bfaab4-7ee6-44d5-a171-dc8225d83598"
+ },
+ "path": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e/b88a7e17-35f0-4d0d-bc32-93f8909baf03.jpg"
+ },
+ "open_url": "https://www.dcloud.io/",
+ "title": "测试",
+ "sort": 1,
+ "category_id": "",
+ "description": ""
+ },
+ {
+ "status": true,
+ "bannerfile": {
+ "name": "094a9dc0-50c0-11eb-b680-7980c8a877b8.jpg",
+ "extname": "jpg",
+ "fileType": "image",
+ "url": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e/9db94cb4-a5e0-4ed9-b356-b42a392b3112.jpg",
+ "size": 70880,
+ "image": {
+ "width": 500,
+ "height": 333,
+ "location": "blob:http://localhost:8081/1a6f718a-4012-476a-9172-590fef2cc518"
+ },
+ "path": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e/9db94cb4-a5e0-4ed9-b356-b42a392b3112.jpg"
+ },
+ "open_url": "https://www.dcloud.io/",
+ "title": "",
+ "category_id": "",
+ "description": ""
+ }]
+ }
}
\ No newline at end of file
diff --git a/uniCloud-aliyun/database/guestbook.schema.json b/uniCloud-aliyun/database/guestbook.schema.json
index b4e9bb93d59668768053172b7b1537ed61bdb33b..8f8cbec3e1e67d382c6d2a7f417432d126743c5c 100644
--- a/uniCloud-aliyun/database/guestbook.schema.json
+++ b/uniCloud-aliyun/database/guestbook.schema.json
@@ -1,57 +1,57 @@
-// 文档教程: https://uniapp.dcloud.net.cn/uniCloud/schema
-{
- "bsonType": "object",
- "required": [],
- "permission": {
- "read": "doc.state || auth.uid == doc.user_id || 'AUDITOR' in auth.role",
- "create": "auth.uid != null",
- "update": "'AUDITOR' in auth.role",
- "delete": "auth.uid == doc.user_id"
- },
- "properties": {
- "_id": {
+// 文档教程: https://uniapp.dcloud.net.cn/uniCloud/schema
+{
+ "bsonType": "object",
+ "required": [],
+ "permission": {
+ "read": "doc.state || auth.uid == doc.user_id || 'AUDITOR' in auth.role",
+ "create": "auth.uid != null",
+ "update": "'AUDITOR' in auth.role",
+ "delete": "auth.uid == doc.user_id"
+ },
+ "properties": {
+ "_id": {
"description": "ID,系统自动生成",
"permission":{
"write":false
- }
- },
- "text": {
+ }
+ },
+ "text": {
"bsonType": "string",
"permission":{
"write":false
- }
- },
- "user_id": {
- "forceDefaultValue": {
- "$env": "uid"
- },
+ }
+ },
+ "user_id": {
+ "forceDefaultValue": {
+ "$env": "uid"
+ },
"foreignKey": "uni-id-users._id",
"permission":{
"write":false
- }
- },
- "ip": {
- "forceDefaultValue": {
- "$env": "clientIP"
+ }
+ },
+ "ip": {
+ "forceDefaultValue": {
+ "$env": "clientIP"
},
"permission":{
"write":false
- }
- },
- "create_time": {
- "forceDefaultValue": {
- "$env": "now"
+ }
+ },
+ "create_time": {
+ "forceDefaultValue": {
+ "$env": "now"
},
"permission":{
"write":false
- }
- },
- "state": {
- "bsonType": "bool",
- "forceDefaultValue":false,
- "permission":{
- "write":true
- }
- }
- }
+ }
+ },
+ "state": {
+ "bsonType": "bool",
+ "forceDefaultValue":false,
+ "permission":{
+ "write":true
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uniCloud-aliyun/database/opendb-admin-menus.schema.json b/uniCloud-aliyun/database/opendb-admin-menus.schema.json
index c6b9de5383e1ee6488f07604e8a34898b546de67..cfeef1b4562a4a372fd850fcf86226c26fb58bc0 100644
--- a/uniCloud-aliyun/database/opendb-admin-menus.schema.json
+++ b/uniCloud-aliyun/database/opendb-admin-menus.schema.json
@@ -1,56 +1,56 @@
-{
- "bsonType": "object",
- "required": ["name", "menu_id"],
- "permission": {
- "read": true
- },
- "properties": {
- "_id": {
- "description": "存储文档 ID,系统自动生成"
- },
- "menu_id": {
- "bsonType": "string",
- "description": "菜单项的ID,不可重复",
- "trim": "both"
- },
- "name": {
- "bsonType": "string",
- "description": "菜单名称",
- "trim": "both"
- },
- "icon": {
- "bsonType": "string",
- "description": "菜单图标",
- "trim": "both"
- },
- "url": {
- "bsonType": "string",
- "description": "菜单url",
- "trim": "both"
- },
- "sort": {
- "bsonType": "int",
- "description": "菜单序号(越大越靠后)"
- },
- "parent_id": {
- "bsonType": "string",
- "description": "父级菜单Id",
- "parentKey": "menu_id"
- },
- "permission": {
- "bsonType": "array",
- "description": "菜单权限列表"
- },
- "enable": {
- "bsonType": "bool",
- "description": "是否启用菜单,true启用、false禁用"
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "菜单创建时间",
- "forceDefaultValue": {
- "$env": "now"
- }
- }
- }
+{
+ "bsonType": "object",
+ "required": ["name", "menu_id"],
+ "permission": {
+ "read": true
+ },
+ "properties": {
+ "_id": {
+ "description": "存储文档 ID,系统自动生成"
+ },
+ "menu_id": {
+ "bsonType": "string",
+ "description": "菜单项的ID,不可重复",
+ "trim": "both"
+ },
+ "name": {
+ "bsonType": "string",
+ "description": "菜单名称",
+ "trim": "both"
+ },
+ "icon": {
+ "bsonType": "string",
+ "description": "菜单图标",
+ "trim": "both"
+ },
+ "url": {
+ "bsonType": "string",
+ "description": "菜单url",
+ "trim": "both"
+ },
+ "sort": {
+ "bsonType": "int",
+ "description": "菜单序号(越大越靠后)"
+ },
+ "parent_id": {
+ "bsonType": "string",
+ "description": "父级菜单Id",
+ "parentKey": "menu_id"
+ },
+ "permission": {
+ "bsonType": "array",
+ "description": "菜单权限列表"
+ },
+ "enable": {
+ "bsonType": "bool",
+ "description": "是否启用菜单,true启用、false禁用"
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "description": "菜单创建时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ }
+ }
+ }
}
diff --git a/uniCloud-aliyun/database/opendb-app-versions.schema.json b/uniCloud-aliyun/database/opendb-app-versions.schema.json
index a24c2d34d647ce7d19d173c316c152c004764cd1..6d1fa8b7959983af7649c1d55548c2672cc410bc 100644
--- a/uniCloud-aliyun/database/opendb-app-versions.schema.json
+++ b/uniCloud-aliyun/database/opendb-app-versions.schema.json
@@ -1,124 +1,124 @@
-{
- "bsonType": "object",
- "required": ["appid", "platform", "version", "url", "contents", "type"],
- "permission": {
- "read": false,
- "create": false,
- "update": false,
- "delete": false
- },
- "properties": {
- "_id": {
- "description": "记录id,自动生成"
- },
- "appid": {
- "bsonType": "string",
- "trim": "both",
- "description": "应用的AppID",
- "label": "AppID",
- "componentForEdit": {
- "name": "uni-easyinput",
- "props": {
- "disabled": true
- }
- }
- },
- "name": {
- "bsonType": "string",
- "trim": "both",
- "description": "应用名称",
- "label": "应用名称",
- "componentForEdit": {
- "name": "uni-easyinput",
- "props": {
- "disabled": true
- }
- }
- },
- "title": {
- "bsonType": "string",
- "description": "更新标题",
- "label": "更新标题"
- },
- "contents": {
- "bsonType": "string",
- "description": "更新内容",
- "label": "更新内容",
- "componentForEdit": {
- "name": "textarea"
- },
- "componentForShow": {
- "name": "textarea",
- "props": {
- "disabled": true
- }
- }
- },
- "platform": {
- "bsonType": "array",
- "enum": [{
- "value": "Android",
- "text": "安卓"
- }, {
- "value": "iOS",
- "text": "苹果"
- }],
- "description": "更新平台,Android || iOS || [Android, iOS]",
- "label": "平台"
- },
- "type": {
- "bsonType": "string",
- "enum": [{
- "value": "native_app",
- "text": "原生App安装包"
- }, {
- "value": "wgt",
- "text": "Wgt资源包"
- }],
- "description": "安装包类型,native_app || wgt",
- "label": "安装包类型"
- },
- "version": {
- "bsonType": "string",
- "description": "当前包版本号,必须大于当前线上发行版本号",
- "label": "版本号"
- },
- "min_uni_version": {
- "bsonType": "string",
- "description": "原生App最低版本",
- "label": "原生App最低版本"
- },
- "url": {
- "bsonType": "string",
- "description": "可下载安装包地址",
- "label": "包地址"
- },
- "stable_publish": {
- "bsonType": "bool",
- "description": "是否上线发行",
- "label": "上线发行"
- },
- "is_silently": {
- "bsonType": "bool",
- "description": "是否静默更新",
- "label": "静默更新",
- "defaultValue": false
- },
- "is_mandatory": {
- "bsonType": "bool",
- "description": "是否强制更新",
- "label": "强制更新",
- "defaultValue": false
- },
- "create_date": {
- "bsonType": "timestamp",
- "label": "上传时间",
- "forceDefaultValue": {
- "$env": "now"
- },
- "componentForEdit": {
- "name": "uni-dateformat"
- }
- }
- }
+{
+ "bsonType": "object",
+ "required": ["appid", "platform", "version", "url", "contents", "type"],
+ "permission": {
+ "read": false,
+ "create": false,
+ "update": false,
+ "delete": false
+ },
+ "properties": {
+ "_id": {
+ "description": "记录id,自动生成"
+ },
+ "appid": {
+ "bsonType": "string",
+ "trim": "both",
+ "description": "应用的AppID",
+ "label": "AppID",
+ "componentForEdit": {
+ "name": "uni-easyinput",
+ "props": {
+ "disabled": true
+ }
+ }
+ },
+ "name": {
+ "bsonType": "string",
+ "trim": "both",
+ "description": "应用名称",
+ "label": "应用名称",
+ "componentForEdit": {
+ "name": "uni-easyinput",
+ "props": {
+ "disabled": true
+ }
+ }
+ },
+ "title": {
+ "bsonType": "string",
+ "description": "更新标题",
+ "label": "更新标题"
+ },
+ "contents": {
+ "bsonType": "string",
+ "description": "更新内容",
+ "label": "更新内容",
+ "componentForEdit": {
+ "name": "textarea"
+ },
+ "componentForShow": {
+ "name": "textarea",
+ "props": {
+ "disabled": true
+ }
+ }
+ },
+ "platform": {
+ "bsonType": "array",
+ "enum": [{
+ "value": "Android",
+ "text": "安卓"
+ }, {
+ "value": "iOS",
+ "text": "苹果"
+ }],
+ "description": "更新平台,Android || iOS || [Android, iOS]",
+ "label": "平台"
+ },
+ "type": {
+ "bsonType": "string",
+ "enum": [{
+ "value": "native_app",
+ "text": "原生App安装包"
+ }, {
+ "value": "wgt",
+ "text": "Wgt资源包"
+ }],
+ "description": "安装包类型,native_app || wgt",
+ "label": "安装包类型"
+ },
+ "version": {
+ "bsonType": "string",
+ "description": "当前包版本号,必须大于当前线上发行版本号",
+ "label": "版本号"
+ },
+ "min_uni_version": {
+ "bsonType": "string",
+ "description": "原生App最低版本",
+ "label": "原生App最低版本"
+ },
+ "url": {
+ "bsonType": "string",
+ "description": "可下载安装包地址",
+ "label": "包地址"
+ },
+ "stable_publish": {
+ "bsonType": "bool",
+ "description": "是否上线发行",
+ "label": "上线发行"
+ },
+ "is_silently": {
+ "bsonType": "bool",
+ "description": "是否静默更新",
+ "label": "静默更新",
+ "defaultValue": false
+ },
+ "is_mandatory": {
+ "bsonType": "bool",
+ "description": "是否强制更新",
+ "label": "强制更新",
+ "defaultValue": false
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "label": "上传时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ },
+ "componentForEdit": {
+ "name": "uni-dateformat"
+ }
+ }
+ }
}
diff --git a/uniCloud-aliyun/database/opendb-banner.schema.json b/uniCloud-aliyun/database/opendb-banner.schema.json
index a027517e79b756cdb0af19666759f54845e1377b..d67031583a06653a27932a264a44ceaeb61ea017 100644
--- a/uniCloud-aliyun/database/opendb-banner.schema.json
+++ b/uniCloud-aliyun/database/opendb-banner.schema.json
@@ -1,54 +1,54 @@
-{
- "bsonType": "object",
- "required": ["bannerfile"],
- "permission": {
- "read": true
- },
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
- },
- "bannerfile": {
- "bsonType": "file",
- "fileMediaType": "image",
- "title": "图片文件",
- "description": "图片文件信息,包括文件名、url等"
- },
- "open_url": {
- "bsonType": "string",
- "description": "点击跳转目标地址。如果是web地址则使用内置web-view打开;如果是本地页面则跳转本地页面;如果是schema地址则打开本地的app",
- "title": "点击目标地址",
- "format": "url",
- "pattern": "^(http:\/\/|https:\/\/|\/|.\/|@\/)\\S",
- "trim": "both"
- },
- "title": {
- "bsonType": "string",
- "description": "注意标题文字颜色和背景图靠色导致看不清的问题",
- "maxLength": 20,
- "title": "标题",
- "trim": "both"
- },
- "sort": {
- "bsonType": "int",
- "description": "数字越小,排序越前",
- "title": "排序"
- },
- "category_id": {
- "bsonType": "string",
- "description": "多个栏目的banner都存在一个表里时可用这个字段区分",
- "title": "分类id"
- },
- "status": {
- "bsonType": "bool",
- "defaultValue": true,
- "title": "生效状态"
- },
- "description": {
- "bsonType": "string",
- "description": "维护者自用描述",
- "title": "备注",
- "trim": "both"
- }
- }
+{
+ "bsonType": "object",
+ "required": ["bannerfile"],
+ "permission": {
+ "read": true
+ },
+ "properties": {
+ "_id": {
+ "description": "ID,系统自动生成"
+ },
+ "bannerfile": {
+ "bsonType": "file",
+ "fileMediaType": "image",
+ "title": "图片文件",
+ "description": "图片文件信息,包括文件名、url等"
+ },
+ "open_url": {
+ "bsonType": "string",
+ "description": "点击跳转目标地址。如果是web地址则使用内置web-view打开;如果是本地页面则跳转本地页面;如果是schema地址则打开本地的app",
+ "title": "点击目标地址",
+ "format": "url",
+ "pattern": "^(http:\/\/|https:\/\/|\/|.\/|@\/)\\S",
+ "trim": "both"
+ },
+ "title": {
+ "bsonType": "string",
+ "description": "注意标题文字颜色和背景图靠色导致看不清的问题",
+ "maxLength": 20,
+ "title": "标题",
+ "trim": "both"
+ },
+ "sort": {
+ "bsonType": "int",
+ "description": "数字越小,排序越前",
+ "title": "排序"
+ },
+ "category_id": {
+ "bsonType": "string",
+ "description": "多个栏目的banner都存在一个表里时可用这个字段区分",
+ "title": "分类id"
+ },
+ "status": {
+ "bsonType": "bool",
+ "defaultValue": true,
+ "title": "生效状态"
+ },
+ "description": {
+ "bsonType": "string",
+ "description": "维护者自用描述",
+ "title": "备注",
+ "trim": "both"
+ }
+ }
}
diff --git a/uniCloud-aliyun/database/opendb-department.schema.json b/uniCloud-aliyun/database/opendb-department.schema.json
index 698239b363e88fa4ed2eaa8b199ec1a5edaf7648..3996e9abd0ef8d866d2aac743f5ce0e30f9df1a3 100644
--- a/uniCloud-aliyun/database/opendb-department.schema.json
+++ b/uniCloud-aliyun/database/opendb-department.schema.json
@@ -1,47 +1,47 @@
-{
- "bsonType": "object",
- "required": ["name"],
- "permission": {
- "read": true,
- "create": false,
- "update": false,
- "delete": false
- },
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
- },
- "parent_id": {
- "bsonType": "string",
- "description": "父级部门ID",
- "parentKey": "_id"
- },
- "name": {
- "bsonType": "string",
- "description": "部门名称",
- "title": "部门名称",
- "trim": "both"
- },
- "level": {
- "bsonType": "int",
- "description": "部门层级,为提升检索效率而作的冗余设计"
- },
- "sort": {
- "bsonType": "int",
- "description": "部门在当前层级下的顺序,由小到大",
- "title": "显示顺序"
- },
- "manager_uid": {
- "bsonType": "string",
- "description": "部门主管的userid, 参考`uni-id-users` 表",
- "foreignKey": "uni-id-users._id"
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "部门创建时间",
- "forceDefaultValue": {
- "$env": "now"
- }
- }
- }
+{
+ "bsonType": "object",
+ "required": ["name"],
+ "permission": {
+ "read": true,
+ "create": false,
+ "update": false,
+ "delete": false
+ },
+ "properties": {
+ "_id": {
+ "description": "ID,系统自动生成"
+ },
+ "parent_id": {
+ "bsonType": "string",
+ "description": "父级部门ID",
+ "parentKey": "_id"
+ },
+ "name": {
+ "bsonType": "string",
+ "description": "部门名称",
+ "title": "部门名称",
+ "trim": "both"
+ },
+ "level": {
+ "bsonType": "int",
+ "description": "部门层级,为提升检索效率而作的冗余设计"
+ },
+ "sort": {
+ "bsonType": "int",
+ "description": "部门在当前层级下的顺序,由小到大",
+ "title": "显示顺序"
+ },
+ "manager_uid": {
+ "bsonType": "string",
+ "description": "部门主管的userid, 参考`uni-id-users` 表",
+ "foreignKey": "uni-id-users._id"
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "description": "部门创建时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ }
+ }
+ }
}
diff --git a/uniCloud-aliyun/database/opendb-mall-goods.schema.json b/uniCloud-aliyun/database/opendb-mall-goods.schema.json
index b3c24cc6506c60543bd011741f599fcfbbd62c50..3b6e3092d7884cb38355523d89f79926380327b9 100644
--- a/uniCloud-aliyun/database/opendb-mall-goods.schema.json
+++ b/uniCloud-aliyun/database/opendb-mall-goods.schema.json
@@ -1,123 +1,123 @@
-{
- "bsonType": "object",
- "permission": {
- "create": false,
- "delete": false,
- "read": "doc.is_on_sale == true",
- "update": false
- },
- "properties": {
- "_id": {
- "description": "存储文档 ID(商品 ID),系统自动生成"
- },
- "add_date": {
- "bsonType": "timestamp",
- "defaultValue": {
- "$env": "now"
- },
- "description": "上架时间"
- },
- "category_id": {
- "bsonType": "string",
- "description": "分类 id,参考`opendb-mall-categories`表",
- "foreignKey": "opendb-mall-categories._id"
- },
- "comment_count": {
- "bsonType": "int",
- "description": "累计评论数"
- },
- "goods_banner_imgs": {
- "bsonType": "array",
- "description": "商品详情页的banner图地址"
- },
- "goods_desc": {
- "bsonType": "string",
- "description": "商品详细描述",
- "title": "详细描述",
- "trim": "both"
- },
- "goods_sn": {
- "bsonType": "string",
- "description": "商品的唯一货号",
- "title": "货号",
- "trim": "both"
- },
- "goods_thumb": {
- "bsonType": "string",
- "description": "商品缩略图,用于在列表或搜索结果中预览显示",
- "pattern": "^(http:\/\/|https:\/\/|\/|.\/|@\/)\\S",
- "title": "缩略图地址",
- "trim": "both"
- },
- "is_alone_sale": {
- "bsonType": "bool",
- "description": "是否能单独销售;如果不能单独销售,则只能作为某商品的配件或者赠品销售"
- },
- "is_best": {
- "bsonType": "bool",
- "description": "是否精品"
- },
- "is_hot": {
- "bsonType": "bool",
- "description": "是否热销"
- },
- "is_new": {
- "bsonType": "bool",
- "description": "是否新品",
- "title": "是否新品"
- },
- "is_on_sale": {
- "bsonType": "bool",
- "description": "是否上架销售",
- "title": "是否上架"
- },
- "is_real": {
- "bsonType": "bool",
- "description": "是否实物",
- "title": "是否为实物"
- },
- "keywords": {
- "bsonType": "string",
- "description": "商品关键字,为搜索引擎收录使用",
- "title": "关键字",
- "trim": "both"
- },
- "last_modify_date": {
- "bsonType": "timestamp",
- "defaultValue": {
- "$env": "now"
- },
- "description": "最后修改时间"
- },
- "month_sell_count": {
- "bsonType": "int",
- "description": "月销量"
- },
- "name": {
- "bsonType": "string",
- "description": "商品名称",
- "title": "名称",
- "trim": "both"
- },
- "remain_count": {
- "bsonType": "int",
- "description": "库存数量",
- "title": "库存数量"
- },
- "seller_note": {
- "bsonType": "string",
- "description": "商家备注,仅商家可见",
- "permission": {
- "read": false
- },
- "trim": "both"
- },
- "total_sell_count": {
- "bsonType": "int",
- "description": "总销量"
- }
- },
- "required": ["goods_sn", "name", "remain_count", "month_sell_count", "total_sell_count", "comment_count", "is_real",
- "is_on_sale", "is_alone_sale", "is_best", "is_new", "is_hot"
- ]
+{
+ "bsonType": "object",
+ "permission": {
+ "create": false,
+ "delete": false,
+ "read": "doc.is_on_sale == true",
+ "update": false
+ },
+ "properties": {
+ "_id": {
+ "description": "存储文档 ID(商品 ID),系统自动生成"
+ },
+ "add_date": {
+ "bsonType": "timestamp",
+ "defaultValue": {
+ "$env": "now"
+ },
+ "description": "上架时间"
+ },
+ "category_id": {
+ "bsonType": "string",
+ "description": "分类 id,参考`opendb-mall-categories`表",
+ "foreignKey": "opendb-mall-categories._id"
+ },
+ "comment_count": {
+ "bsonType": "int",
+ "description": "累计评论数"
+ },
+ "goods_banner_imgs": {
+ "bsonType": "array",
+ "description": "商品详情页的banner图地址"
+ },
+ "goods_desc": {
+ "bsonType": "string",
+ "description": "商品详细描述",
+ "title": "详细描述",
+ "trim": "both"
+ },
+ "goods_sn": {
+ "bsonType": "string",
+ "description": "商品的唯一货号",
+ "title": "货号",
+ "trim": "both"
+ },
+ "goods_thumb": {
+ "bsonType": "string",
+ "description": "商品缩略图,用于在列表或搜索结果中预览显示",
+ "pattern": "^(http:\/\/|https:\/\/|\/|.\/|@\/)\\S",
+ "title": "缩略图地址",
+ "trim": "both"
+ },
+ "is_alone_sale": {
+ "bsonType": "bool",
+ "description": "是否能单独销售;如果不能单独销售,则只能作为某商品的配件或者赠品销售"
+ },
+ "is_best": {
+ "bsonType": "bool",
+ "description": "是否精品"
+ },
+ "is_hot": {
+ "bsonType": "bool",
+ "description": "是否热销"
+ },
+ "is_new": {
+ "bsonType": "bool",
+ "description": "是否新品",
+ "title": "是否新品"
+ },
+ "is_on_sale": {
+ "bsonType": "bool",
+ "description": "是否上架销售",
+ "title": "是否上架"
+ },
+ "is_real": {
+ "bsonType": "bool",
+ "description": "是否实物",
+ "title": "是否为实物"
+ },
+ "keywords": {
+ "bsonType": "string",
+ "description": "商品关键字,为搜索引擎收录使用",
+ "title": "关键字",
+ "trim": "both"
+ },
+ "last_modify_date": {
+ "bsonType": "timestamp",
+ "defaultValue": {
+ "$env": "now"
+ },
+ "description": "最后修改时间"
+ },
+ "month_sell_count": {
+ "bsonType": "int",
+ "description": "月销量"
+ },
+ "name": {
+ "bsonType": "string",
+ "description": "商品名称",
+ "title": "名称",
+ "trim": "both"
+ },
+ "remain_count": {
+ "bsonType": "int",
+ "description": "库存数量",
+ "title": "库存数量"
+ },
+ "seller_note": {
+ "bsonType": "string",
+ "description": "商家备注,仅商家可见",
+ "permission": {
+ "read": false
+ },
+ "trim": "both"
+ },
+ "total_sell_count": {
+ "bsonType": "int",
+ "description": "总销量"
+ }
+ },
+ "required": ["goods_sn", "name", "remain_count", "month_sell_count", "total_sell_count", "comment_count", "is_real",
+ "is_on_sale", "is_alone_sale", "is_best", "is_new", "is_hot"
+ ]
}
diff --git a/uniCloud-aliyun/database/opendb-news-articles-detail.schema.json b/uniCloud-aliyun/database/opendb-news-articles-detail.schema.json
index 325fc9aadd7babd0b8ff08ccbacf848ba633e962..92071076b6c990f1a9822c4691277db84a029c86 100644
--- a/uniCloud-aliyun/database/opendb-news-articles-detail.schema.json
+++ b/uniCloud-aliyun/database/opendb-news-articles-detail.schema.json
@@ -1,122 +1,122 @@
-{
- "bsonType": "object",
- "permission": {
- "create": "auth.uid != null",
- "delete": "doc.user_id == auth.uid",
- "read": true,
- "update": "doc.user_id == auth.uid"
- },
- "properties": {
- "_id": {
- "description": "存储文档 ID(用户 ID),系统自动生成"
- },
- "article_status": {
- "bsonType": "int",
- "description": "文章状态:0 草稿箱 1 已发布",
- "maximum": 1,
- "minimum": 0
- },
- "avatar": {
- "bsonType": "string",
- "description": "缩略图地址",
- "label": "封面大图"
- },
- "category_id": {
- "bsonType": "string",
- "description": "分类 id,参考`uni-news-categories`表"
- },
- "comment_count": {
- "bsonType": "int",
- "description": "评论数量",
- "permission": {
- "write": false
- }
- },
- "comment_status": {
- "bsonType": "int",
- "description": "评论状态:0 关闭 1 开放",
- "maximum": 1,
- "minimum": 0
- },
- "content": {
- "bsonType": "string",
- "description": "文章内容",
- "label": "文章内容"
- },
- "excerpt": {
- "bsonType": "string",
- "description": "文章摘录",
- "label": "摘要"
- },
- "is_essence": {
- "bsonType": "bool",
- "description": "阅读加精",
- "permission": {
- "write": false
- }
- },
- "is_sticky": {
- "bsonType": "bool",
- "description": "是否置顶",
- "permission": {
- "write": false
- }
- },
- "last_comment_user_id": {
- "bsonType": "string",
- "description": "最后回复用户 id,参考`uni-id-users` 表"
- },
- "last_modify_date": {
- "bsonType": "timestamp",
- "description": "最后修改时间"
- },
- "last_modify_ip": {
- "bsonType": "string",
- "description": "最后修改时 IP 地址"
- },
- "like_count": {
- "bsonType": "int",
- "description": "喜欢数、点赞数",
- "permission": {
- "write": false
- }
- },
- "mode": {
- "bsonType": "number",
- "description": "排版显示模式"
- },
- "publish_date": {
- "bsonType": "timestamp",
- "defaultValue": {
- "$env": "now"
- },
- "description": "发表时间"
- },
- "publish_ip": {
- "bsonType": "string",
- "description": "发表时 IP 地址",
- "forceDefaultValue": {
- "$env": "clientIP"
- }
- },
- "title": {
- "bsonType": "string",
- "description": "标题",
- "label": "标题"
- },
- "user_id": {
- "bsonType": "string",
- "description": "文章作者ID, 参考`uni-id-users` 表"
- },
- "view_count": {
- "bsonType": "int",
- "description": "阅读数量",
- "permission": {
- "write": false
- }
- }
- },
- "required": ["user_id", "title", "content", "article_status", "view_count", "like_count", "is_sticky", "is_essence",
- "comment_status", "comment_count", "mode"
- ]
+{
+ "bsonType": "object",
+ "permission": {
+ "create": "auth.uid != null",
+ "delete": "doc.user_id == auth.uid",
+ "read": true,
+ "update": "doc.user_id == auth.uid"
+ },
+ "properties": {
+ "_id": {
+ "description": "存储文档 ID(用户 ID),系统自动生成"
+ },
+ "article_status": {
+ "bsonType": "int",
+ "description": "文章状态:0 草稿箱 1 已发布",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "avatar": {
+ "bsonType": "string",
+ "description": "缩略图地址",
+ "label": "封面大图"
+ },
+ "category_id": {
+ "bsonType": "string",
+ "description": "分类 id,参考`uni-news-categories`表"
+ },
+ "comment_count": {
+ "bsonType": "int",
+ "description": "评论数量",
+ "permission": {
+ "write": false
+ }
+ },
+ "comment_status": {
+ "bsonType": "int",
+ "description": "评论状态:0 关闭 1 开放",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "content": {
+ "bsonType": "string",
+ "description": "文章内容",
+ "label": "文章内容"
+ },
+ "excerpt": {
+ "bsonType": "string",
+ "description": "文章摘录",
+ "label": "摘要"
+ },
+ "is_essence": {
+ "bsonType": "bool",
+ "description": "阅读加精",
+ "permission": {
+ "write": false
+ }
+ },
+ "is_sticky": {
+ "bsonType": "bool",
+ "description": "是否置顶",
+ "permission": {
+ "write": false
+ }
+ },
+ "last_comment_user_id": {
+ "bsonType": "string",
+ "description": "最后回复用户 id,参考`uni-id-users` 表"
+ },
+ "last_modify_date": {
+ "bsonType": "timestamp",
+ "description": "最后修改时间"
+ },
+ "last_modify_ip": {
+ "bsonType": "string",
+ "description": "最后修改时 IP 地址"
+ },
+ "like_count": {
+ "bsonType": "int",
+ "description": "喜欢数、点赞数",
+ "permission": {
+ "write": false
+ }
+ },
+ "mode": {
+ "bsonType": "number",
+ "description": "排版显示模式"
+ },
+ "publish_date": {
+ "bsonType": "timestamp",
+ "defaultValue": {
+ "$env": "now"
+ },
+ "description": "发表时间"
+ },
+ "publish_ip": {
+ "bsonType": "string",
+ "description": "发表时 IP 地址",
+ "forceDefaultValue": {
+ "$env": "clientIP"
+ }
+ },
+ "title": {
+ "bsonType": "string",
+ "description": "标题",
+ "label": "标题"
+ },
+ "user_id": {
+ "bsonType": "string",
+ "description": "文章作者ID, 参考`uni-id-users` 表"
+ },
+ "view_count": {
+ "bsonType": "int",
+ "description": "阅读数量",
+ "permission": {
+ "write": false
+ }
+ }
+ },
+ "required": ["user_id", "title", "content", "article_status", "view_count", "like_count", "is_sticky", "is_essence",
+ "comment_status", "comment_count", "mode"
+ ]
}
diff --git a/uniCloud-aliyun/database/opendb-news-articles.schema.json b/uniCloud-aliyun/database/opendb-news-articles.schema.json
index ee4f8cce2c03225b63c9ecd41dfc1b526b7c98ec..3dd9f01986112bc95844e086214dad724d562ec4 100644
--- a/uniCloud-aliyun/database/opendb-news-articles.schema.json
+++ b/uniCloud-aliyun/database/opendb-news-articles.schema.json
@@ -1,165 +1,165 @@
-{
- "bsonType": "object",
- "required": ["user_id", "title", "content"],
- "permission": {
- "read": "doc.uid == auth.uid && doc.article_status == 0 || doc.article_status == 1",
- "create": "auth.uid != null",
- "update": "doc.user_id == auth.uid",
- "delete": "doc.user_id == auth.uid"
- },
- "properties": {
- "_id": {
- "description": "存储文档 ID(用户 ID),系统自动生成"
- },
- "user_id": {
- "bsonType": "string",
- "description": "文章作者ID, 参考`uni-id-users` 表",
- "foreignKey": "uni-id-users._id",
- "defaultValue": {
- "$env": "uid"
- }
- },
- "category_id": {
- "bsonType": "string",
- "title": "分类",
- "description": "分类 id,参考`uni-news-categories`表",
- "foreignKey": "opendb-news-categories._id",
- "enum": {
- "collection": "opendb-news-categories",
- "field": "name as text, _id as value"
- }
- },
- "title": {
- "bsonType": "string",
- "title": "标题",
- "description": "标题",
- "label": "标题",
- "trim": "both"
- },
- "content": {
- "bsonType": "string",
- "title": "文章内容",
- "description": "文章内容",
- "label": "文章内容",
- "trim": "right"
- },
- "excerpt": {
- "bsonType": "string",
- "title": "文章摘录",
- "description": "文章摘录",
- "label": "摘要",
- "trim": "both"
- },
- "article_status": {
- "bsonType": "int",
- "title": "文章状态",
- "description": "文章状态:0 草稿箱 1 已发布",
- "defaultValue": 0,
- "enum": [{
- "value": 0,
- "text": "草稿箱"
- }, {
- "value": 1,
- "text": "已发布"
- }]
- },
- "view_count": {
- "bsonType": "int",
- "title": "阅读数量",
- "description": "阅读数量",
- "permission": {
- "write": false
- }
- },
- "like_count": {
- "bsonType": "int",
- "description": "喜欢数、点赞数",
- "permission": {
- "write": false
- }
- },
- "is_sticky": {
- "bsonType": "bool",
- "title": "是否置顶",
- "description": "是否置顶",
- "permission": {
- "write": false
- }
- },
- "is_essence": {
- "bsonType": "bool",
- "title": "阅读加精",
- "description": "阅读加精",
- "permission": {
- "write": false
- }
- },
- "comment_status": {
- "bsonType": "int",
- "title": "开放评论",
- "description": "评论状态:0 关闭 1 开放",
- "enum": [{
- "value": 0,
- "text": "关闭"
- }, {
- "value": 1,
- "text": "开放"
- }]
- },
- "comment_count": {
- "bsonType": "int",
- "description": "评论数量",
- "permission": {
- "write": false
- }
- },
- "last_comment_user_id": {
- "bsonType": "string",
- "description": "最后回复用户 id,参考`uni-id-users` 表",
- "foreignKey": "uni-id-users._id"
- },
- "avatar": {
- "bsonType": "string",
- "title": "封面大图",
- "description": "缩略图地址",
- "label": "封面大图",
- "trim": "both"
- },
- "publish_date": {
- "bsonType": "timestamp",
- "title": "发表时间",
- "description": "发表时间",
- "defaultValue": {
- "$env": "now"
- }
- },
- "publish_ip": {
- "bsonType": "string",
- "title": "发布文章时IP地址",
- "description": "发表时 IP 地址",
- "forceDefaultValue": {
- "$env": "clientIP"
- }
- },
- "last_modify_date": {
- "bsonType": "timestamp",
- "title": "最后修改时间",
- "description": "最后修改时间",
- "defaultValue": {
- "$env": "now"
- }
- },
- "last_modify_ip": {
- "bsonType": "string",
- "description": "最后修改时 IP 地址",
- "forceDefaultValue": {
- "$env": "clientIP"
- }
- },
- "mode": {
- "bsonType": "number",
- "title": "排版显示模式",
- "description": "排版显示模式,如左图右文、上图下文等"
- }
- }
+{
+ "bsonType": "object",
+ "required": ["user_id", "title", "content"],
+ "permission": {
+ "read": "doc.uid == auth.uid && doc.article_status == 0 || doc.article_status == 1",
+ "create": "auth.uid != null",
+ "update": "doc.user_id == auth.uid",
+ "delete": "doc.user_id == auth.uid"
+ },
+ "properties": {
+ "_id": {
+ "description": "存储文档 ID(用户 ID),系统自动生成"
+ },
+ "user_id": {
+ "bsonType": "string",
+ "description": "文章作者ID, 参考`uni-id-users` 表",
+ "foreignKey": "uni-id-users._id",
+ "defaultValue": {
+ "$env": "uid"
+ }
+ },
+ "category_id": {
+ "bsonType": "string",
+ "title": "分类",
+ "description": "分类 id,参考`uni-news-categories`表",
+ "foreignKey": "opendb-news-categories._id",
+ "enum": {
+ "collection": "opendb-news-categories",
+ "field": "name as text, _id as value"
+ }
+ },
+ "title": {
+ "bsonType": "string",
+ "title": "标题",
+ "description": "标题",
+ "label": "标题",
+ "trim": "both"
+ },
+ "content": {
+ "bsonType": "string",
+ "title": "文章内容",
+ "description": "文章内容",
+ "label": "文章内容",
+ "trim": "right"
+ },
+ "excerpt": {
+ "bsonType": "string",
+ "title": "文章摘录",
+ "description": "文章摘录",
+ "label": "摘要",
+ "trim": "both"
+ },
+ "article_status": {
+ "bsonType": "int",
+ "title": "文章状态",
+ "description": "文章状态:0 草稿箱 1 已发布",
+ "defaultValue": 0,
+ "enum": [{
+ "value": 0,
+ "text": "草稿箱"
+ }, {
+ "value": 1,
+ "text": "已发布"
+ }]
+ },
+ "view_count": {
+ "bsonType": "int",
+ "title": "阅读数量",
+ "description": "阅读数量",
+ "permission": {
+ "write": false
+ }
+ },
+ "like_count": {
+ "bsonType": "int",
+ "description": "喜欢数、点赞数",
+ "permission": {
+ "write": false
+ }
+ },
+ "is_sticky": {
+ "bsonType": "bool",
+ "title": "是否置顶",
+ "description": "是否置顶",
+ "permission": {
+ "write": false
+ }
+ },
+ "is_essence": {
+ "bsonType": "bool",
+ "title": "阅读加精",
+ "description": "阅读加精",
+ "permission": {
+ "write": false
+ }
+ },
+ "comment_status": {
+ "bsonType": "int",
+ "title": "开放评论",
+ "description": "评论状态:0 关闭 1 开放",
+ "enum": [{
+ "value": 0,
+ "text": "关闭"
+ }, {
+ "value": 1,
+ "text": "开放"
+ }]
+ },
+ "comment_count": {
+ "bsonType": "int",
+ "description": "评论数量",
+ "permission": {
+ "write": false
+ }
+ },
+ "last_comment_user_id": {
+ "bsonType": "string",
+ "description": "最后回复用户 id,参考`uni-id-users` 表",
+ "foreignKey": "uni-id-users._id"
+ },
+ "avatar": {
+ "bsonType": "string",
+ "title": "封面大图",
+ "description": "缩略图地址",
+ "label": "封面大图",
+ "trim": "both"
+ },
+ "publish_date": {
+ "bsonType": "timestamp",
+ "title": "发表时间",
+ "description": "发表时间",
+ "defaultValue": {
+ "$env": "now"
+ }
+ },
+ "publish_ip": {
+ "bsonType": "string",
+ "title": "发布文章时IP地址",
+ "description": "发表时 IP 地址",
+ "forceDefaultValue": {
+ "$env": "clientIP"
+ }
+ },
+ "last_modify_date": {
+ "bsonType": "timestamp",
+ "title": "最后修改时间",
+ "description": "最后修改时间",
+ "defaultValue": {
+ "$env": "now"
+ }
+ },
+ "last_modify_ip": {
+ "bsonType": "string",
+ "description": "最后修改时 IP 地址",
+ "forceDefaultValue": {
+ "$env": "clientIP"
+ }
+ },
+ "mode": {
+ "bsonType": "number",
+ "title": "排版显示模式",
+ "description": "排版显示模式,如左图右文、上图下文等"
+ }
+ }
}
diff --git a/uniCloud-aliyun/database/opendb-news-categories.schema.json b/uniCloud-aliyun/database/opendb-news-categories.schema.json
index 976c8a8f4fd0d89c87a28365b8cacafb641b1a95..5f00709a6524f642f08e6def7e3482d02f272fea 100644
--- a/uniCloud-aliyun/database/opendb-news-categories.schema.json
+++ b/uniCloud-aliyun/database/opendb-news-categories.schema.json
@@ -1,50 +1,50 @@
-{
- "bsonType": "object",
- "required": ["name"],
- "permission": {
- "read": true,
- "create": false,
- "update": false,
- "delete": false
- },
- "properties": {
- "_id": {
- "description": "存储文档 ID(文章 ID),系统自动生成"
- },
- "name": {
- "bsonType": "string",
- "description": "类别名称",
- "label": "名称",
- "trim": "both"
- },
- "description": {
- "bsonType": "string",
- "description": "类别描述",
- "label": "描述",
- "trim": "both"
- },
- "icon": {
- "bsonType": "string",
- "description": "类别图标地址",
- "label": "图标地址",
- "pattern": "^(http:\/\/|https:\/\/|\/|.\/|@\/)\\S",
- "trim": "both"
- },
- "sort": {
- "bsonType": "int",
- "description": "类别显示顺序",
- "label": "排序"
- },
- "article_count": {
- "bsonType": "int",
- "description": "该类别下文章数量"
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "创建时间",
- "forceDefaultValue": {
- "$env": "now"
- }
- }
- }
+{
+ "bsonType": "object",
+ "required": ["name"],
+ "permission": {
+ "read": true,
+ "create": false,
+ "update": false,
+ "delete": false
+ },
+ "properties": {
+ "_id": {
+ "description": "存储文档 ID(文章 ID),系统自动生成"
+ },
+ "name": {
+ "bsonType": "string",
+ "description": "类别名称",
+ "label": "名称",
+ "trim": "both"
+ },
+ "description": {
+ "bsonType": "string",
+ "description": "类别描述",
+ "label": "描述",
+ "trim": "both"
+ },
+ "icon": {
+ "bsonType": "string",
+ "description": "类别图标地址",
+ "label": "图标地址",
+ "pattern": "^(http:\/\/|https:\/\/|\/|.\/|@\/)\\S",
+ "trim": "both"
+ },
+ "sort": {
+ "bsonType": "int",
+ "description": "类别显示顺序",
+ "label": "排序"
+ },
+ "article_count": {
+ "bsonType": "int",
+ "description": "该类别下文章数量"
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "description": "创建时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ }
+ }
+ }
}
diff --git a/uniCloud-aliyun/database/opendb-news-comments.schema.json b/uniCloud-aliyun/database/opendb-news-comments.schema.json
index 1c0b197f6ba56b59970e3cd4da0baa9a7a73c76a..c4aa84ebd255ca1c6da48dd7bbfbfdb6d17d5730 100644
--- a/uniCloud-aliyun/database/opendb-news-comments.schema.json
+++ b/uniCloud-aliyun/database/opendb-news-comments.schema.json
@@ -1,68 +1,68 @@
-{
- "bsonType": "object",
- "required": ["article_id", "user_id", "comment_content", "like_count", "comment_type", "reply_user_id",
- "reply_comment_id"
- ],
- "permission": {
- "read": true,
- "create": "auth.uid != null && get(`database.opendb-news-article.${doc.article_id}`).comment_status == 1",
- "update": "doc.user_id == auth.uid",
- "delete": "doc.user_id == auth.uid"
- },
- "properties": {
- "_id": {
- "description": "存储文档 ID(文章 ID),系统自动生成"
- },
- "article_id": {
- "bsonType": "string",
- "description": "文章ID,opendb-news-posts 表中的`_id`字段",
- "foreignKey": "opendb-news-articles._id"
- },
- "user_id": {
- "bsonType": "string",
- "description": "评论者ID,参考`uni-id-users` 表",
- "forceDefaultValue": {
- "$env": "uid"
- },
- "foreignKey": "uni-id-users._id"
- },
- "comment_content": {
- "bsonType": "string",
- "description": "评论内容",
- "title": "评论内容",
- "trim": "right"
- },
- "like_count": {
- "bsonType": "int",
- "description": "评论喜欢数、点赞数"
- },
- "comment_type": {
- "bsonType": "int",
- "description": "回复类型: 0 针对文章的回复 1 针对评论的回复"
- },
- "reply_user_id": {
- "bsonType": "string",
- "description": "被回复的评论用户ID,comment_type为1时有效",
- "foreignKey": "uni-id-users._id"
- },
- "reply_comment_id": {
- "bsonType": "string",
- "description": "被回复的评论ID,comment_type为1时有效",
- "foreignKey": "opendb-news-comments._id"
- },
- "comment_date": {
- "bsonType": "timestamp",
- "description": "评论发表时间",
- "forceDefaultValue": {
- "$env": "now"
- }
- },
- "comment_ip": {
- "bsonType": "string",
- "description": "评论发表时 IP 地址",
- "forceDefaultValue": {
- "$env": "clientIP"
- }
- }
- }
-}
+{
+ "bsonType": "object",
+ "required": ["article_id", "user_id", "comment_content", "like_count", "comment_type", "reply_user_id",
+ "reply_comment_id"
+ ],
+ "permission": {
+ "read": true,
+ "create": "auth.uid != null && get(`database.opendb-news-article.${doc.article_id}`).comment_status == 1",
+ "update": "doc.user_id == auth.uid",
+ "delete": "doc.user_id == auth.uid"
+ },
+ "properties": {
+ "_id": {
+ "description": "存储文档 ID(文章 ID),系统自动生成"
+ },
+ "article_id": {
+ "bsonType": "string",
+ "description": "文章ID,opendb-news-posts 表中的`_id`字段",
+ "foreignKey": "opendb-news-articles._id"
+ },
+ "user_id": {
+ "bsonType": "string",
+ "description": "评论者ID,参考`uni-id-users` 表",
+ "forceDefaultValue": {
+ "$env": "uid"
+ },
+ "foreignKey": "uni-id-users._id"
+ },
+ "comment_content": {
+ "bsonType": "string",
+ "description": "评论内容",
+ "title": "评论内容",
+ "trim": "right"
+ },
+ "like_count": {
+ "bsonType": "int",
+ "description": "评论喜欢数、点赞数"
+ },
+ "comment_type": {
+ "bsonType": "int",
+ "description": "回复类型: 0 针对文章的回复 1 针对评论的回复"
+ },
+ "reply_user_id": {
+ "bsonType": "string",
+ "description": "被回复的评论用户ID,comment_type为1时有效",
+ "foreignKey": "uni-id-users._id"
+ },
+ "reply_comment_id": {
+ "bsonType": "string",
+ "description": "被回复的评论ID,comment_type为1时有效",
+ "foreignKey": "opendb-news-comments._id"
+ },
+ "comment_date": {
+ "bsonType": "timestamp",
+ "description": "评论发表时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ }
+ },
+ "comment_ip": {
+ "bsonType": "string",
+ "description": "评论发表时 IP 地址",
+ "forceDefaultValue": {
+ "$env": "clientIP"
+ }
+ }
+ }
+}
diff --git a/uniCloud-aliyun/database/opendb-news-favorite.schema.json b/uniCloud-aliyun/database/opendb-news-favorite.schema.json
index a4034f17042a1d855c256dab5761e4b34f59f007..88b285a6b27dc1a6edbc4942f148a4f33d0ec456 100644
--- a/uniCloud-aliyun/database/opendb-news-favorite.schema.json
+++ b/uniCloud-aliyun/database/opendb-news-favorite.schema.json
@@ -1,46 +1,46 @@
-{
- "bsonType": "object",
- "required": ["user_id", "article_id"],
- "permission": {
- "read": "doc.user_id == auth.uid",
- "create": "auth.uid != null",
- "update": "doc.user_id == auth.uid",
- "delete": "doc.user_id == auth.uid"
- },
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
- },
- "article_id": {
- "bsonType": "string",
- "description": "文章id,参考opendb-news-articles表",
- "foreignKey": "opendb-news-articles._id"
- },
- "article_title": {
- "bsonType": "string",
- "description": "文章标题"
- },
- "user_id": {
- "bsonType": "string",
- "description": "收藏者id,参考uni-id-users表",
- "forceDefaultValue": {
- "$env": "uid"
- },
- "foreignKey": "uni-id-users._id"
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "收藏时间",
- "forceDefaultValue": {
- "$env": "now"
- }
- },
- "update_date": {
- "bsonType": "timestamp",
- "description": "更新\/修改时间",
- "forceDefaultValue": {
- "$env": "now"
- }
- }
- }
-}
+{
+ "bsonType": "object",
+ "required": ["user_id", "article_id"],
+ "permission": {
+ "read": "doc.user_id == auth.uid",
+ "create": "auth.uid != null",
+ "update": "doc.user_id == auth.uid",
+ "delete": "doc.user_id == auth.uid"
+ },
+ "properties": {
+ "_id": {
+ "description": "ID,系统自动生成"
+ },
+ "article_id": {
+ "bsonType": "string",
+ "description": "文章id,参考opendb-news-articles表",
+ "foreignKey": "opendb-news-articles._id"
+ },
+ "article_title": {
+ "bsonType": "string",
+ "description": "文章标题"
+ },
+ "user_id": {
+ "bsonType": "string",
+ "description": "收藏者id,参考uni-id-users表",
+ "forceDefaultValue": {
+ "$env": "uid"
+ },
+ "foreignKey": "uni-id-users._id"
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "description": "收藏时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ }
+ },
+ "update_date": {
+ "bsonType": "timestamp",
+ "description": "更新\/修改时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ }
+ }
+ }
+}
diff --git a/uniCloud-aliyun/database/opendb-search-hot.schema.json b/uniCloud-aliyun/database/opendb-search-hot.schema.json
index 1230be4c8bd443f26ab8136c69854dfe47d27e03..8c067fa150b710efb54815da2a68473583b1453d 100644
--- a/uniCloud-aliyun/database/opendb-search-hot.schema.json
+++ b/uniCloud-aliyun/database/opendb-search-hot.schema.json
@@ -1,27 +1,27 @@
-{
- "bsonType": "object",
- "permission": {
- "create": false,
- "delete": false,
- "read": true,
- "update": false
- },
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
- },
- "content": {
- "bsonType": "string",
- "description": "搜索内容"
- },
- "count": {
- "bsonType": "long",
- "description": "搜索次数"
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "统计时间"
- }
- },
- "required": ["content", "count"]
+{
+ "bsonType": "object",
+ "permission": {
+ "create": false,
+ "delete": false,
+ "read": true,
+ "update": false
+ },
+ "properties": {
+ "_id": {
+ "description": "ID,系统自动生成"
+ },
+ "content": {
+ "bsonType": "string",
+ "description": "搜索内容"
+ },
+ "count": {
+ "bsonType": "long",
+ "description": "搜索次数"
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "description": "统计时间"
+ }
+ },
+ "required": ["content", "count"]
}
diff --git a/uniCloud-aliyun/database/opendb-search-log.schema.json b/uniCloud-aliyun/database/opendb-search-log.schema.json
index 421ee8c0aa01062fcd3cc86ccffe00bbb2b32cab..6c9676a47bd1c2b463b5cec9d37deba00710b12b 100644
--- a/uniCloud-aliyun/database/opendb-search-log.schema.json
+++ b/uniCloud-aliyun/database/opendb-search-log.schema.json
@@ -1,31 +1,31 @@
-{
- "bsonType": "object",
- "permission": {
- "create": true,
- "delete": false,
- "read": false,
- "update": false
- },
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
- },
- "content": {
- "bsonType": "string",
- "description": "搜索内容"
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "统计时间"
- },
- "device_id": {
- "bsonType": "string",
- "description": "设备id"
- },
- "user_id": {
- "bsonType": "string",
- "description": "收藏者id,参考uni-id-users表"
- }
- },
- "required": ["content"]
+{
+ "bsonType": "object",
+ "permission": {
+ "create": true,
+ "delete": false,
+ "read": false,
+ "update": false
+ },
+ "properties": {
+ "_id": {
+ "description": "ID,系统自动生成"
+ },
+ "content": {
+ "bsonType": "string",
+ "description": "搜索内容"
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "description": "统计时间"
+ },
+ "device_id": {
+ "bsonType": "string",
+ "description": "设备id"
+ },
+ "user_id": {
+ "bsonType": "string",
+ "description": "收藏者id,参考uni-id-users表"
+ }
+ },
+ "required": ["content"]
}
diff --git a/uniCloud-aliyun/database/read-news-log.schema.json b/uniCloud-aliyun/database/read-news-log.schema.json
index 1cbd342af01ef11e4c2a4fec86e8da5e7e2385c6..17efd4b4f8ccad6c626989361df6bdf1c0a9b023 100644
--- a/uniCloud-aliyun/database/read-news-log.schema.json
+++ b/uniCloud-aliyun/database/read-news-log.schema.json
@@ -1,35 +1,35 @@
-{
- "bsonType": "object",
- "required": ["user_id", "article_id"],
- "permission": {
- "read": "doc.user_id == auth.uid",
- "create": "auth.uid != null",
- "update": "doc.user_id == auth.uid"
- //"delete": "doc.user_id == auth.uid"
- },
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
- },
- "article_id": {
- "bsonType": "string",
- "description": "文章id,参考opendb-news-articles表",
- "foreignKey": "opendb-news-articles._id"
- },
- "user_id": {
- "bsonType": "string",
- "description": "收藏者id,参考uni-id-users表",
- "forceDefaultValue": {
- "$env": "uid"
- },
- "foreignKey": "uni-id-users._id"
- },
- "last_time": { //设计策略是多次看同一个文章只做一次记录,重复看的文章时间更新为当前时间
- "bsonType": "timestamp",
- "description": "最后一次看的时间",
- "defaultValue": {
- "$env": "now"
- }
- }
- }
-}
+{
+ "bsonType": "object",
+ "required": ["user_id", "article_id"],
+ "permission": {
+ "read": "doc.user_id == auth.uid",
+ "create": "auth.uid != null",
+ "update": "doc.user_id == auth.uid"
+ //"delete": "doc.user_id == auth.uid"
+ },
+ "properties": {
+ "_id": {
+ "description": "ID,系统自动生成"
+ },
+ "article_id": {
+ "bsonType": "string",
+ "description": "文章id,参考opendb-news-articles表",
+ "foreignKey": "opendb-news-articles._id"
+ },
+ "user_id": {
+ "bsonType": "string",
+ "description": "收藏者id,参考uni-id-users表",
+ "forceDefaultValue": {
+ "$env": "uid"
+ },
+ "foreignKey": "uni-id-users._id"
+ },
+ "last_time": { //设计策略是多次看同一个文章只做一次记录,重复看的文章时间更新为当前时间
+ "bsonType": "timestamp",
+ "description": "最后一次看的时间",
+ "defaultValue": {
+ "$env": "now"
+ }
+ }
+ }
+}
diff --git a/uniCloud-aliyun/database/uni-id-device.schema.json b/uniCloud-aliyun/database/uni-id-device.schema.json
index 483a7852ddd886366a2640e18e778044b677158b..da0244fcc66600083a763f9bc02aa857c629e5de 100644
--- a/uniCloud-aliyun/database/uni-id-device.schema.json
+++ b/uniCloud-aliyun/database/uni-id-device.schema.json
@@ -1,64 +1,64 @@
-{
- "bsonType": "object",
- "required": ["user_id"],
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
+{
+ "bsonType": "object",
+ "required": ["user_id"],
+ "properties": {
+ "_id": {
+ "description": "ID,系统自动生成"
},
- "user_id": {
- "bsonType": "string",
- "description": "用户id,参考uni-id-users表"
- },
- "ua": {
- "bsonType": "string",
- "description": "userAgent"
- },
- "uuid": {
- "bsonType": "string",
- "description": "设备唯一标识(需要加密存储)"
- },
- "vendor": {
- "bsonType": "string",
- "description": "设备厂商"
- },
- "push_clientid": {
- "bsonType": "string",
- "description": "推送设备客户端标识"
- },
- "imei": {
- "bsonType": "string",
- "description": "国际移动设备识别码IMEI(International Mobile Equipment Identity)"
- },
- "oaid": {
- "bsonType": "string",
- "description": "移动智能设备标识公共服务平台提供的匿名设备标识符(OAID)"
- },
- "idfa": {
- "bsonType": "string",
- "description": "iOS平台配置应用使用广告标识(IDFA)"
- },
- "model": {
- "bsonType": "string",
- "description": "设备型号"
- },
- "platform": {
- "bsonType": "string",
- "description": "平台类型"
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "创建时间",
- "forceDefaultValue": {
- "$env": "now"
- }
- },
- "last_active_date": {
- "bsonType": "timestamp",
- "description": "最后登录时间"
- },
- "last_active_ip": {
- "bsonType": "string",
- "description": "最后登录IP"
- }
- }
+ "user_id": {
+ "bsonType": "string",
+ "description": "用户id,参考uni-id-users表"
+ },
+ "ua": {
+ "bsonType": "string",
+ "description": "userAgent"
+ },
+ "uuid": {
+ "bsonType": "string",
+ "description": "设备唯一标识(需要加密存储)"
+ },
+ "vendor": {
+ "bsonType": "string",
+ "description": "设备厂商"
+ },
+ "push_clientid": {
+ "bsonType": "string",
+ "description": "推送设备客户端标识"
+ },
+ "imei": {
+ "bsonType": "string",
+ "description": "国际移动设备识别码IMEI(International Mobile Equipment Identity)"
+ },
+ "oaid": {
+ "bsonType": "string",
+ "description": "移动智能设备标识公共服务平台提供的匿名设备标识符(OAID)"
+ },
+ "idfa": {
+ "bsonType": "string",
+ "description": "iOS平台配置应用使用广告标识(IDFA)"
+ },
+ "model": {
+ "bsonType": "string",
+ "description": "设备型号"
+ },
+ "platform": {
+ "bsonType": "string",
+ "description": "平台类型"
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "description": "创建时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ }
+ },
+ "last_active_date": {
+ "bsonType": "timestamp",
+ "description": "最后登录时间"
+ },
+ "last_active_ip": {
+ "bsonType": "string",
+ "description": "最后登录IP"
+ }
+ }
}
diff --git a/uniCloud-aliyun/database/uni-id-log.schema.json b/uniCloud-aliyun/database/uni-id-log.schema.json
index 086432acee206583e54003c22eef62d377a510c5..cb1d86b2b96395dd3a2abd8286b713b00e680556 100644
--- a/uniCloud-aliyun/database/uni-id-log.schema.json
+++ b/uniCloud-aliyun/database/uni-id-log.schema.json
@@ -1,41 +1,41 @@
-{
- "bsonType": "object",
- "required": ["user_id"],
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
- },
- "user_id": {
- "bsonType": "string",
- "description": "用户id,参考uni-id-users表"
- },
- "ua": {
- "bsonType": "string",
- "description": "userAgent"
- },
- "device_uuid": {
- "bsonType": "string",
- "description": "设备唯一标识(需要加密存储)"
- },
- "type": {
- "bsonType": "string",
- "enum": ["login", "logout"],
- "description": "登录类型"
- },
- "state": {
- "bsonType": "int",
- "description": "结果:0 失败、1 成功"
- },
- "ip": {
- "bsonType": "string",
- "description": "ip地址"
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "创建时间",
- "forceDefaultValue": {
- "$env": "now"
- }
- }
- }
+{
+ "bsonType": "object",
+ "required": ["user_id"],
+ "properties": {
+ "_id": {
+ "description": "ID,系统自动生成"
+ },
+ "user_id": {
+ "bsonType": "string",
+ "description": "用户id,参考uni-id-users表"
+ },
+ "ua": {
+ "bsonType": "string",
+ "description": "userAgent"
+ },
+ "device_uuid": {
+ "bsonType": "string",
+ "description": "设备唯一标识(需要加密存储)"
+ },
+ "type": {
+ "bsonType": "string",
+ "enum": ["login", "logout"],
+ "description": "登录类型"
+ },
+ "state": {
+ "bsonType": "int",
+ "description": "结果:0 失败、1 成功"
+ },
+ "ip": {
+ "bsonType": "string",
+ "description": "ip地址"
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "description": "创建时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ }
+ }
+ }
}
diff --git a/uniCloud-aliyun/database/uni-id-permissions.schema.json b/uniCloud-aliyun/database/uni-id-permissions.schema.json
index f0ddc99de8928df2446b125155406c4f86f043f1..c5dba1e2a399544c680ff799b41cf0254e333363 100644
--- a/uniCloud-aliyun/database/uni-id-permissions.schema.json
+++ b/uniCloud-aliyun/database/uni-id-permissions.schema.json
@@ -1,46 +1,46 @@
-{
- "bsonType": "object",
- "required": ["permission_id", "permission_name"],
- "properties": {
- "_id": {
- "description": "存储文档 ID,系统自动生成"
- },
- "permission_id": {
- "bsonType": "string",
- "description": "权限唯一标识,不可修改,不允许重复",
- "label": "权限标识",
- "trim": "both",
- "title": "权限ID",
- "component": {
- "name": "input"
- }
- },
- "permission_name": {
- "bsonType": "string",
- "description": "权限名称",
- "label": "权限名称",
- "title": "权限名称",
- "trim": "both",
- "component": {
- "name": "input"
- }
- },
- "comment": {
- "bsonType": "string",
- "description": "备注",
- "label": "备注",
- "title": "备注",
- "trim": "both",
- "component": {
- "name": "textarea"
- }
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "创建时间",
- "forceDefaultValue": {
- "$env": "now"
- }
- }
- }
+{
+ "bsonType": "object",
+ "required": ["permission_id", "permission_name"],
+ "properties": {
+ "_id": {
+ "description": "存储文档 ID,系统自动生成"
+ },
+ "permission_id": {
+ "bsonType": "string",
+ "description": "权限唯一标识,不可修改,不允许重复",
+ "label": "权限标识",
+ "trim": "both",
+ "title": "权限ID",
+ "component": {
+ "name": "input"
+ }
+ },
+ "permission_name": {
+ "bsonType": "string",
+ "description": "权限名称",
+ "label": "权限名称",
+ "title": "权限名称",
+ "trim": "both",
+ "component": {
+ "name": "input"
+ }
+ },
+ "comment": {
+ "bsonType": "string",
+ "description": "备注",
+ "label": "备注",
+ "title": "备注",
+ "trim": "both",
+ "component": {
+ "name": "textarea"
+ }
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "description": "创建时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ }
+ }
+ }
}
diff --git a/uniCloud-aliyun/database/uni-id-roles.schema.json b/uniCloud-aliyun/database/uni-id-roles.schema.json
index 9802441517783dbd906fafa8e01c3c5a607184c5..c07ebf76671009b3489c51e2e2d92f044a2bba4b 100644
--- a/uniCloud-aliyun/database/uni-id-roles.schema.json
+++ b/uniCloud-aliyun/database/uni-id-roles.schema.json
@@ -1,46 +1,46 @@
-{
- "bsonType": "object",
- "required": ["role_id"],
- "permission": {
- "read": false,
- "create": false,
- "update": false,
- "delete": false
- },
- "properties": {
- "_id": {
- "description": "存储文档 ID,系统自动生成"
- },
- "role_id": {
- "title": "唯一ID",
- "bsonType": "string",
- "description": "角色唯一标识,不可修改,不允许重复",
- "trim": "both"
- },
- "role_name": {
- "title": "名称",
- "bsonType": "string",
- "description": "角色名称",
- "trim": "both"
- },
- "permission": {
- "title": "权限",
- "bsonType": "array",
- "foreignKey": "uni-id-permissions.permission_id",
- "description": "角色拥有的权限列表"
- },
- "comment": {
- "title": "备注",
- "bsonType": "string",
- "description": "备注",
- "trim": "both"
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "创建时间",
- "forceDefaultValue": {
- "$env": "now"
- }
- }
- }
+{
+ "bsonType": "object",
+ "required": ["role_id"],
+ "permission": {
+ "read": false,
+ "create": false,
+ "update": false,
+ "delete": false
+ },
+ "properties": {
+ "_id": {
+ "description": "存储文档 ID,系统自动生成"
+ },
+ "role_id": {
+ "title": "唯一ID",
+ "bsonType": "string",
+ "description": "角色唯一标识,不可修改,不允许重复",
+ "trim": "both"
+ },
+ "role_name": {
+ "title": "名称",
+ "bsonType": "string",
+ "description": "角色名称",
+ "trim": "both"
+ },
+ "permission": {
+ "title": "权限",
+ "bsonType": "array",
+ "foreignKey": "uni-id-permissions.permission_id",
+ "description": "角色拥有的权限列表"
+ },
+ "comment": {
+ "title": "备注",
+ "bsonType": "string",
+ "description": "备注",
+ "trim": "both"
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "description": "创建时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ }
+ }
+ }
}
diff --git a/uniCloud-aliyun/database/uni-id-scores.schema.json b/uniCloud-aliyun/database/uni-id-scores.schema.json
index 0e2a7f6587fe90bde952a7dc5565593d96661689..1c4d4d4cd626402db55e51de20ed5dd9ea7619c0 100644
--- a/uniCloud-aliyun/database/uni-id-scores.schema.json
+++ b/uniCloud-aliyun/database/uni-id-scores.schema.json
@@ -1,44 +1,44 @@
-{
- "bsonType": "object",
- "required": ["user_id", "score", "balance"],
- "permission": {
- "read": "doc.user_id == auth.uid",
- "create": false,
- "update": false,
- "delete": false
- },
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
- },
- "user_id": {
- "bsonType": "string",
- "description": "用户id,参考uni-id-users表"
- },
- "score": {
- "bsonType": "int",
- "description": "本次变化的积分"
- },
- "type": {
- "bsonType": "int",
- "enum": [1, 2],
- "description": "积分类型 1:收入 2:支出"
- },
- "balance": {
- "bsonType": "int",
- "description": "变化后的积分余额"
- },
- "comment": {
- "bsonType": "string",
- "description": "备注,说明积分新增、消费的缘由",
- "trim": "both"
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "创建时间",
- "forceDefaultValue": {
- "$env": "now"
- }
- }
- }
+{
+ "bsonType": "object",
+ "required": ["user_id", "score", "balance"],
+ "permission": {
+ "read": "doc.user_id == auth.uid",
+ "create": false,
+ "update": false,
+ "delete": false
+ },
+ "properties": {
+ "_id": {
+ "description": "ID,系统自动生成"
+ },
+ "user_id": {
+ "bsonType": "string",
+ "description": "用户id,参考uni-id-users表"
+ },
+ "score": {
+ "bsonType": "int",
+ "description": "本次变化的积分"
+ },
+ "type": {
+ "bsonType": "int",
+ "enum": [1, 2],
+ "description": "积分类型 1:收入 2:支出"
+ },
+ "balance": {
+ "bsonType": "int",
+ "description": "变化后的积分余额"
+ },
+ "comment": {
+ "bsonType": "string",
+ "description": "备注,说明积分新增、消费的缘由",
+ "trim": "both"
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "description": "创建时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ }
+ }
+ }
}
diff --git a/uniCloud-aliyun/database/uni-id-users.schema.json b/uniCloud-aliyun/database/uni-id-users.schema.json
index a75e9cb9eaf852d4bd5974a2566e0195216028ea..c32b8289341d58992a35c1c6cd96175bd8e491f4 100644
--- a/uniCloud-aliyun/database/uni-id-users.schema.json
+++ b/uniCloud-aliyun/database/uni-id-users.schema.json
@@ -1,366 +1,366 @@
-{
+{
"bsonType": "object",
"permission":{
"read":true,
"update":"doc._id == auth.uid"
- },
- "required": [],
- "properties": {
- "_id": {
- "description": "存储文档 ID(用户 ID),系统自动生成"
- },
- "username": {
- "bsonType": "string",
- "title": "用户名",
- "description": "用户名,不允许重复",
+ },
+ "required": [],
+ "properties": {
+ "_id": {
+ "description": "存储文档 ID(用户 ID),系统自动生成"
+ },
+ "username": {
+ "bsonType": "string",
+ "title": "用户名",
+ "description": "用户名,不允许重复",
"trim": "both",
"permission":{
"write":false
- }
- },
- "password": {
- "bsonType": "password",
- "title": "密码",
- "description": "密码,加密存储",
+ }
+ },
+ "password": {
+ "bsonType": "password",
+ "title": "密码",
+ "description": "密码,加密存储",
"trim": "both",
"permission":{
"write":false
}
- },
- "password_secret_version": {
- "bsonType": "int",
- "title": "passwordSecret",
+ },
+ "password_secret_version": {
+ "bsonType": "int",
+ "title": "passwordSecret",
"description": "密码使用的passwordSecret版本",
"permission":{
"write":false
- }
- },
- "nickname": {
- "bsonType": "string",
- "title": "昵称",
- "description": "用户昵称",
- "trim": "both"
- },
- "gender": {
- "bsonType": "int",
- "title": "性别",
- "description": "用户性别:0 未知 1 男性 2 女性",
- "defaultValue": 0,
- "enum": [{
- "text": "未知",
- "value": 0
- },
- {
- "text": "男",
- "value": 1
- },
- {
- "text": "女",
- "value": 2
- }
- ]
- },
- "status": {
- "bsonType": "int",
- "description": "用户状态:0 正常 1 禁用 2 审核中 3 审核拒绝",
- "title": "用户状态",
+ }
+ },
+ "nickname": {
+ "bsonType": "string",
+ "title": "昵称",
+ "description": "用户昵称",
+ "trim": "both"
+ },
+ "gender": {
+ "bsonType": "int",
+ "title": "性别",
+ "description": "用户性别:0 未知 1 男性 2 女性",
+ "defaultValue": 0,
+ "enum": [{
+ "text": "未知",
+ "value": 0
+ },
+ {
+ "text": "男",
+ "value": 1
+ },
+ {
+ "text": "女",
+ "value": 2
+ }
+ ]
+ },
+ "status": {
+ "bsonType": "int",
+ "description": "用户状态:0 正常 1 禁用 2 审核中 3 审核拒绝",
+ "title": "用户状态",
"defaultValue": 0,
"permission":{
"write":false
- },
- "enum": [{
- "text": "正常",
- "value": 0
- },
- {
- "text": "禁用",
- "value": 1
- },
- {
- "text": "审核中",
- "value": 2
- },
- {
- "text": "审核拒绝",
- "value": 3
- }
- ]
- },
- "mobile": {
- "bsonType": "string",
- "title": "手机号码",
- "description": "手机号码",
- "pattern": "^\\+?[0-9-]{3,20}$",
+ },
+ "enum": [{
+ "text": "正常",
+ "value": 0
+ },
+ {
+ "text": "禁用",
+ "value": 1
+ },
+ {
+ "text": "审核中",
+ "value": 2
+ },
+ {
+ "text": "审核拒绝",
+ "value": 3
+ }
+ ]
+ },
+ "mobile": {
+ "bsonType": "string",
+ "title": "手机号码",
+ "description": "手机号码",
+ "pattern": "^\\+?[0-9-]{3,20}$",
"trim": "both",
"permission":{
"write":false
- }
- },
- "mobile_confirmed": {
- "bsonType": "int",
- "description": "手机号验证状态:0 未验证 1 已验证",
- "title": "手机号验证状态",
- "defaultValue": 0,
- "enum": [{
- "text": "未验证",
- "value": 0
- },
- {
- "text": "已验证",
- "value": 1
- }
+ }
+ },
+ "mobile_confirmed": {
+ "bsonType": "int",
+ "description": "手机号验证状态:0 未验证 1 已验证",
+ "title": "手机号验证状态",
+ "defaultValue": 0,
+ "enum": [{
+ "text": "未验证",
+ "value": 0
+ },
+ {
+ "text": "已验证",
+ "value": 1
+ }
],
"permission":{
"write":false
- }
- },
- "email": {
- "bsonType": "string",
- "format": "email",
- "title": "邮箱",
- "description": "邮箱地址",
+ }
+ },
+ "email": {
+ "bsonType": "string",
+ "format": "email",
+ "title": "邮箱",
+ "description": "邮箱地址",
"trim": "both",
"permission":{
"write":false
- }
- },
- "email_confirmed": {
- "bsonType": "int",
- "description": "邮箱验证状态:0 未验证 1 已验证",
- "title": "邮箱验证状态",
- "defaultValue": 0,
- "enum": [{
- "text": "未验证",
- "value": 0
- },
- {
- "text": "已验证",
- "value": 1
- }
+ }
+ },
+ "email_confirmed": {
+ "bsonType": "int",
+ "description": "邮箱验证状态:0 未验证 1 已验证",
+ "title": "邮箱验证状态",
+ "defaultValue": 0,
+ "enum": [{
+ "text": "未验证",
+ "value": 0
+ },
+ {
+ "text": "已验证",
+ "value": 1
+ }
],
"permission":{
"write":false
- }
- },
- "avatar": {
- "bsonType": "string",
- "title": "头像地址",
- "description": "头像地址",
- "trim": "both"
- },
- "avatar_file": {
- "bsonType": "file",
- "title": "头像文件",
- "description": "用file类型方便使用uni-file-picker组件"
- },
- "department_id": {
- "bsonType": "array",
+ }
+ },
+ "avatar": {
+ "bsonType": "string",
+ "title": "头像地址",
+ "description": "头像地址",
+ "trim": "both"
+ },
+ "avatar_file": {
+ "bsonType": "file",
+ "title": "头像文件",
+ "description": "用file类型方便使用uni-file-picker组件"
+ },
+ "department_id": {
+ "bsonType": "array",
"description": "部门ID",
"permission":{
"write":false
- },
- "title": "部门",
- "enumType": "tree",
- "enum": {
- "collection": "opendb-department",
- "orderby": "name asc",
- "field": "_id as value, name as text"
- }
- },
- "role": {
- "bsonType": "array",
- "title": "角色",
- "description": "用户角色",
- "enum": {
- "collection": "uni-id-roles",
- "field": "role_id as value, role_name as text"
- },
- "foreignKey": "uni-id-roles.role_id",
- "permission": {
- "write": false
- }
- },
- "wx_unionid": {
- "bsonType": "string",
+ },
+ "title": "部门",
+ "enumType": "tree",
+ "enum": {
+ "collection": "opendb-department",
+ "orderby": "name asc",
+ "field": "_id as value, name as text"
+ }
+ },
+ "role": {
+ "bsonType": "array",
+ "title": "角色",
+ "description": "用户角色",
+ "enum": {
+ "collection": "uni-id-roles",
+ "field": "role_id as value, role_name as text"
+ },
+ "foreignKey": "uni-id-roles.role_id",
+ "permission": {
+ "write": false
+ }
+ },
+ "wx_unionid": {
+ "bsonType": "string",
"description": "微信unionid",
"permission":{
"write":false
- }
- },
- "wx_openid": {
- "bsonType": "object",
- "description": "微信各个平台openid",
- "properties": {
- "app-plus": {
- "bsonType": "string",
- "description": "app平台微信openid"
- },
- "mp-weixin": {
- "bsonType": "string",
- "description": "微信小程序平台openid"
- }
+ }
+ },
+ "wx_openid": {
+ "bsonType": "object",
+ "description": "微信各个平台openid",
+ "properties": {
+ "app-plus": {
+ "bsonType": "string",
+ "description": "app平台微信openid"
+ },
+ "mp-weixin": {
+ "bsonType": "string",
+ "description": "微信小程序平台openid"
+ }
},
"permission":{
"write":false
- }
- },
- "ali_openid": {
- "bsonType": "string",
+ }
+ },
+ "ali_openid": {
+ "bsonType": "string",
"description": "支付宝平台openid",
"permission":{
"write":false
- }
- },
- "apple_openid": {
- "bsonType": "string",
+ }
+ },
+ "apple_openid": {
+ "bsonType": "string",
"description": "苹果登录openid",
"permission":{
"write":false
- }
- },
- "comment": {
- "bsonType": "string",
- "title": "备注",
- "description": "备注",
+ }
+ },
+ "comment": {
+ "bsonType": "string",
+ "title": "备注",
+ "description": "备注",
"trim": "both",
"permission":{
"write":false
- }
- },
- "realname_auth": {
- "bsonType": "object",
- "description": "实名认证信息",
- "required": [
- "type",
- "auth_status"
+ }
+ },
+ "realname_auth": {
+ "bsonType": "object",
+ "description": "实名认证信息",
+ "required": [
+ "type",
+ "auth_status"
],
"permission":{
"write":false
- },
- "properties": {
- "type": {
- "bsonType": "int",
- "minimum": 0,
- "maximum": 1,
- "description": "用户类型:0 个人用户 1 企业用户"
- },
- "auth_status": {
- "bsonType": "int",
- "minimum": 0,
- "maximum": 3,
- "description": "认证状态:0 未认证 1 等待认证 2 认证通过 3 认证失败"
- },
- "auth_date": {
- "bsonType": "timestamp",
- "description": "认证通过时间"
- },
- "real_name": {
- "bsonType": "string",
- "description": "真实姓名/企业名称"
- },
- "identity": {
- "bsonType": "string",
- "description": "身份证号码/营业执照号码"
- },
- "id_card_front": {
- "bsonType": "string",
- "description": "身份证正面照 URL"
- },
- "id_card_back": {
- "bsonType": "string",
- "description": "身份证反面照 URL"
- },
- "in_hand": {
- "bsonType": "string",
- "description": "手持身份证照片 URL"
- },
- "license": {
- "bsonType": "string",
- "description": "营业执照 URL"
- },
- "contact_person": {
- "bsonType": "string",
- "description": "联系人姓名"
- },
- "contact_mobile": {
- "bsonType": "string",
- "description": "联系人手机号码"
- },
- "contact_email": {
- "bsonType": "string",
- "description": "联系人邮箱"
- }
- }
- },
- "score": {
- "bsonType": "int",
+ },
+ "properties": {
+ "type": {
+ "bsonType": "int",
+ "minimum": 0,
+ "maximum": 1,
+ "description": "用户类型:0 个人用户 1 企业用户"
+ },
+ "auth_status": {
+ "bsonType": "int",
+ "minimum": 0,
+ "maximum": 3,
+ "description": "认证状态:0 未认证 1 等待认证 2 认证通过 3 认证失败"
+ },
+ "auth_date": {
+ "bsonType": "timestamp",
+ "description": "认证通过时间"
+ },
+ "real_name": {
+ "bsonType": "string",
+ "description": "真实姓名/企业名称"
+ },
+ "identity": {
+ "bsonType": "string",
+ "description": "身份证号码/营业执照号码"
+ },
+ "id_card_front": {
+ "bsonType": "string",
+ "description": "身份证正面照 URL"
+ },
+ "id_card_back": {
+ "bsonType": "string",
+ "description": "身份证反面照 URL"
+ },
+ "in_hand": {
+ "bsonType": "string",
+ "description": "手持身份证照片 URL"
+ },
+ "license": {
+ "bsonType": "string",
+ "description": "营业执照 URL"
+ },
+ "contact_person": {
+ "bsonType": "string",
+ "description": "联系人姓名"
+ },
+ "contact_mobile": {
+ "bsonType": "string",
+ "description": "联系人手机号码"
+ },
+ "contact_email": {
+ "bsonType": "string",
+ "description": "联系人邮箱"
+ }
+ }
+ },
+ "score": {
+ "bsonType": "int",
"description": "用户积分,积分变更记录可参考:uni-id-scores表定义",
"permission":{
"write":false
- }
- },
- "register_date": {
- "bsonType": "timestamp",
- "description": "注册时间",
- "forceDefaultValue": {
- "$env": "now"
+ }
+ },
+ "register_date": {
+ "bsonType": "timestamp",
+ "description": "注册时间",
+ "forceDefaultValue": {
+ "$env": "now"
},
"permission":{
"write":false
- }
- },
- "register_ip": {
- "bsonType": "string",
- "description": "注册时 IP 地址",
- "forceDefaultValue": {
- "$env": "clientIP"
+ }
+ },
+ "register_ip": {
+ "bsonType": "string",
+ "description": "注册时 IP 地址",
+ "forceDefaultValue": {
+ "$env": "clientIP"
},
"permission":{
"write":false
- }
- },
- "last_login_date": {
- "bsonType": "timestamp",
+ }
+ },
+ "last_login_date": {
+ "bsonType": "timestamp",
"description": "最后登录时间",
"permission":{
"write":false
- }
- },
- "last_login_ip": {
- "bsonType": "string",
+ }
+ },
+ "last_login_ip": {
+ "bsonType": "string",
"description": "最后登录时 IP 地址",
"permission":{
"write":false
- }
- },
- "token": {
- "bsonType": "array",
+ }
+ },
+ "token": {
+ "bsonType": "array",
"description": "用户token",
"permission":{
"write":false
- }
- },
- "inviter_uid": {
- "bsonType": "array",
- "description": "用户全部上级邀请者",
+ }
+ },
+ "inviter_uid": {
+ "bsonType": "array",
+ "description": "用户全部上级邀请者",
"trim": "both",
"permission":{
"write":false
- }
- },
- "invite_time": {
- "bsonType": "timestamp",
+ }
+ },
+ "invite_time": {
+ "bsonType": "timestamp",
"description": "受邀时间",
"permission":{
"write":false
- }
- },
- "my_invite_code": {
- "bsonType": "string",
+ }
+ },
+ "my_invite_code": {
+ "bsonType": "string",
"description": "用户自身邀请码",
"permission":{
"write":false
- }
- }
- }
+ }
+ }
+ }
}
diff --git a/uni_modules/json-gps/js_sdk/gps.js b/uni_modules/json-gps/js_sdk/gps.js
index 34bd0e819f86465066099a7f1688fbc4ff0394d9..2b99ead5a9aed1d5acdd5b76d62f5b88aaa3951a 100644
--- a/uni_modules/json-gps/js_sdk/gps.js
+++ b/uni_modules/json-gps/js_sdk/gps.js
@@ -1,56 +1,56 @@
-// #ifdef APP-PLUS
-import permision from "./wa-permission/permission.js"
-// #endif
-class Gps {
- constructor(arg) {
- this.lock = false //锁防止重复请求
- }
- async getLocation(param = {
- type: 'wgs84'
- }) {
- return new Promise(async (callback) => {
- if (this.lock) {
- // console.log('已锁,已有另一个请求正在执行。无需重复请求');
- callback(false);
- return false
- }
- this.lock = true //加锁防止重复的请求
- uni.getLocation({
- ...param,
- success: res => {
- this.lock = false //成功后解锁
- //console.log(res);
- callback(res)
- },
- fail: async (err) => {
- uni.showToast({
- title: '定位获取失败',
- icon: 'none'
- });
+// #ifdef APP-PLUS
+import permision from "./wa-permission/permission.js"
+// #endif
+class Gps {
+ constructor(arg) {
+ this.lock = false //锁防止重复请求
+ }
+ async getLocation(param = {
+ type: 'wgs84'
+ }) {
+ return new Promise(async (callback) => {
+ if (this.lock) {
+ // console.log('已锁,已有另一个请求正在执行。无需重复请求');
+ callback(false);
+ return false
+ }
+ this.lock = true //加锁防止重复的请求
+ uni.getLocation({
+ ...param,
+ success: res => {
+ this.lock = false //成功后解锁
+ //console.log(res);
+ callback(res)
+ },
+ fail: async (err) => {
+ uni.showToast({
+ title: '定位获取失败',
+ icon: 'none'
+ });
console.error(err)
callback(false)
-
- // #ifdef APP-PLUS
- await this.checkGpsIsOpen()
+
+ // #ifdef APP-PLUS
+ await this.checkGpsIsOpen()
// #endif
-
- // #ifdef MP-WEIXIN
- if (err.errMsg == 'getLocation:fail auth deny') {
- uni.showModal({
- content: '应用无定位权限',
- confirmText: '前往设置',
- complete: (e) => {
- if (e.confirm) {
- uni.openSetting({
- success(res) {
- console.log(res.authSetting)
- }
- });
+
+ // #ifdef MP-WEIXIN
+ if (err.errMsg == 'getLocation:fail auth deny') {
+ uni.showModal({
+ content: '应用无定位权限',
+ confirmText: '前往设置',
+ complete: (e) => {
+ if (e.confirm) {
+ uni.openSetting({
+ success(res) {
+ console.log(res.authSetting)
+ }
+ });
}
- this.lock = false //解锁让回到界面重新获取
- }
- });
+ this.lock = false //解锁让回到界面重新获取
+ }
+ });
}
if (err.errMsg == 'getLocation:fail:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF') {
uni.showModal({
@@ -59,10 +59,10 @@ class Gps {
confirmText:"知道了"
});
}
- // #endif
- }
- });
- })
+ // #endif
+ }
+ });
+ })
}
// #ifdef APP-PLUS
async checkGpsIsOpen() {
@@ -128,6 +128,6 @@ class Gps {
}
return true
}
- // #endif
-}
+ // #endif
+}
export default Gps
diff --git a/uni_modules/json-gps/js_sdk/wa-permission/permission.js b/uni_modules/json-gps/js_sdk/wa-permission/permission.js
index 501cab45618434cca3c4597682bc9c404d8e18bc..185dfae680144379771cbd964b063361d44a5512 100644
--- a/uni_modules/json-gps/js_sdk/wa-permission/permission.js
+++ b/uni_modules/json-gps/js_sdk/wa-permission/permission.js
@@ -1,272 +1,272 @@
-/**
- * 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
- */
-
-var isIos
-// #ifdef APP-PLUS
-isIos = (plus.os.name == "iOS")
-// #endif
-
-// 判断推送权限是否开启
-function judgeIosPermissionPush() {
- var result = false;
- var UIApplication = plus.ios.import("UIApplication");
- var app = UIApplication.sharedApplication();
- var enabledTypes = 0;
- if (app.currentUserNotificationSettings) {
- var settings = app.currentUserNotificationSettings();
- enabledTypes = settings.plusGetAttribute("types");
- console.log("enabledTypes1:" + enabledTypes);
- if (enabledTypes == 0) {
- console.log("推送权限没有开启");
- } else {
- result = true;
- console.log("已经开启推送功能!")
- }
- plus.ios.deleteObject(settings);
- } else {
- enabledTypes = app.enabledRemoteNotificationTypes();
- if (enabledTypes == 0) {
- console.log("推送权限没有开启!");
- } else {
- result = true;
- console.log("已经开启推送功能!")
- }
- console.log("enabledTypes2:" + enabledTypes);
- }
- plus.ios.deleteObject(app);
- plus.ios.deleteObject(UIApplication);
- return result;
-}
-
-// 判断定位权限是否开启
-function judgeIosPermissionLocation() {
- var result = false;
- var cllocationManger = plus.ios.import("CLLocationManager");
- var status = cllocationManger.authorizationStatus();
- result = (status != 2)
- console.log("定位权限开启:" + result);
- // 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
- /* var enable = cllocationManger.locationServicesEnabled();
- var status = cllocationManger.authorizationStatus();
- console.log("enable:" + enable);
- console.log("status:" + status);
- if (enable && status != 2) {
- result = true;
- console.log("手机定位服务已开启且已授予定位权限");
- } else {
- console.log("手机系统的定位没有打开或未给予定位权限");
- } */
- plus.ios.deleteObject(cllocationManger);
- return result;
-}
-
-// 判断麦克风权限是否开启
-function judgeIosPermissionRecord() {
- var result = false;
- var avaudiosession = plus.ios.import("AVAudioSession");
- var avaudio = avaudiosession.sharedInstance();
- var permissionStatus = avaudio.recordPermission();
- console.log("permissionStatus:" + permissionStatus);
- if (permissionStatus == 1684369017 || permissionStatus == 1970168948) {
- console.log("麦克风权限没有开启");
- } else {
- result = true;
- console.log("麦克风权限已经开启");
- }
- plus.ios.deleteObject(avaudiosession);
- return result;
-}
-
-// 判断相机权限是否开启
-function judgeIosPermissionCamera() {
- var result = false;
- var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
- var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
- console.log("authStatus:" + authStatus);
- if (authStatus == 3) {
- result = true;
- console.log("相机权限已经开启");
- } else {
- console.log("相机权限没有开启");
- }
- plus.ios.deleteObject(AVCaptureDevice);
- return result;
-}
-
-// 判断相册权限是否开启
-function judgeIosPermissionPhotoLibrary() {
- var result = false;
- var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
- var authStatus = PHPhotoLibrary.authorizationStatus();
- console.log("authStatus:" + authStatus);
- if (authStatus == 3) {
- result = true;
- console.log("相册权限已经开启");
- } else {
- console.log("相册权限没有开启");
- }
- plus.ios.deleteObject(PHPhotoLibrary);
- return result;
-}
-
-// 判断通讯录权限是否开启
-function judgeIosPermissionContact() {
- var result = false;
- var CNContactStore = plus.ios.import("CNContactStore");
- var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
- if (cnAuthStatus == 3) {
- result = true;
- console.log("通讯录权限已经开启");
- } else {
- console.log("通讯录权限没有开启");
- }
- plus.ios.deleteObject(CNContactStore);
- return result;
-}
-
-// 判断日历权限是否开启
-function judgeIosPermissionCalendar() {
- var result = false;
- var EKEventStore = plus.ios.import("EKEventStore");
- var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
- if (ekAuthStatus == 3) {
- result = true;
- console.log("日历权限已经开启");
- } else {
- console.log("日历权限没有开启");
- }
- plus.ios.deleteObject(EKEventStore);
- return result;
-}
-
-// 判断备忘录权限是否开启
-function judgeIosPermissionMemo() {
- var result = false;
- var EKEventStore = plus.ios.import("EKEventStore");
- var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
- if (ekAuthStatus == 3) {
- result = true;
- console.log("备忘录权限已经开启");
- } else {
- console.log("备忘录权限没有开启");
- }
- plus.ios.deleteObject(EKEventStore);
- return result;
-}
-
-// Android权限查询
-function requestAndroidPermission(permissionID) {
- return new Promise((resolve, reject) => {
- plus.android.requestPermissions(
- [permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
- function(resultObj) {
- var result = 0;
- for (var i = 0; i < resultObj.granted.length; i++) {
- var grantedPermission = resultObj.granted[i];
- console.log('已获取的权限:' + grantedPermission);
- result = 1
- }
- for (var i = 0; i < resultObj.deniedPresent.length; i++) {
- var deniedPresentPermission = resultObj.deniedPresent[i];
- console.log('拒绝本次申请的权限:' + deniedPresentPermission);
- result = 0
- }
- for (var i = 0; i < resultObj.deniedAlways.length; i++) {
- var deniedAlwaysPermission = resultObj.deniedAlways[i];
- console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
- result = -1
- }
- resolve(result);
- // 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
- // if (result != 1) {
- // gotoAppPermissionSetting()
- // }
- },
- function(error) {
- console.log('申请权限错误:' + error.code + " = " + error.message);
- resolve({
- code: error.code,
- message: error.message
- });
- }
- );
- });
-}
-
-// 使用一个方法,根据参数判断权限
-function judgeIosPermission(permissionID) {
- if (permissionID == "location") {
- return judgeIosPermissionLocation()
- } else if (permissionID == "camera") {
- return judgeIosPermissionCamera()
- } else if (permissionID == "photoLibrary") {
- return judgeIosPermissionPhotoLibrary()
- } else if (permissionID == "record") {
- return judgeIosPermissionRecord()
- } else if (permissionID == "push") {
- return judgeIosPermissionPush()
- } else if (permissionID == "contact") {
- return judgeIosPermissionContact()
- } else if (permissionID == "calendar") {
- return judgeIosPermissionCalendar()
- } else if (permissionID == "memo") {
- return judgeIosPermissionMemo()
- }
- return false;
-}
-
-// 跳转到**应用**的权限页面
-function gotoAppPermissionSetting() {
- if (isIos) {
- var UIApplication = plus.ios.import("UIApplication");
- var application2 = UIApplication.sharedApplication();
- var NSURL2 = plus.ios.import("NSURL");
- // var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
- var setting2 = NSURL2.URLWithString("app-settings:");
- application2.openURL(setting2);
-
- plus.ios.deleteObject(setting2);
- plus.ios.deleteObject(NSURL2);
- plus.ios.deleteObject(application2);
- } else {
- // console.log(plus.device.vendor);
- var Intent = plus.android.importClass("android.content.Intent");
- var Settings = plus.android.importClass("android.provider.Settings");
- var Uri = plus.android.importClass("android.net.Uri");
- var mainActivity = plus.android.runtimeMainActivity();
- var intent = new Intent();
- intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
- var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
- intent.setData(uri);
- mainActivity.startActivity(intent);
- }
-}
-
-// 检查系统的设备服务是否开启
-// var checkSystemEnableLocation = async function () {
-function checkSystemEnableLocation() {
- if (isIos) {
- var result = false;
- var cllocationManger = plus.ios.import("CLLocationManager");
- var result = cllocationManger.locationServicesEnabled();
- console.log("系统定位开启:" + result);
- plus.ios.deleteObject(cllocationManger);
- return result;
- } else {
- var context = plus.android.importClass("android.content.Context");
- var locationManager = plus.android.importClass("android.location.LocationManager");
- var main = plus.android.runtimeMainActivity();
- var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
- var result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
- console.log("系统定位开启:" + result);
- return result
- }
-}
-
-export default {
- judgeIosPermission: judgeIosPermission,
- requestAndroidPermission: requestAndroidPermission,
- checkSystemEnableLocation: checkSystemEnableLocation,
- gotoAppPermissionSetting: gotoAppPermissionSetting
+/**
+ * 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
+ */
+
+var isIos
+// #ifdef APP-PLUS
+isIos = (plus.os.name == "iOS")
+// #endif
+
+// 判断推送权限是否开启
+function judgeIosPermissionPush() {
+ var result = false;
+ var UIApplication = plus.ios.import("UIApplication");
+ var app = UIApplication.sharedApplication();
+ var enabledTypes = 0;
+ if (app.currentUserNotificationSettings) {
+ var settings = app.currentUserNotificationSettings();
+ enabledTypes = settings.plusGetAttribute("types");
+ console.log("enabledTypes1:" + enabledTypes);
+ if (enabledTypes == 0) {
+ console.log("推送权限没有开启");
+ } else {
+ result = true;
+ console.log("已经开启推送功能!")
+ }
+ plus.ios.deleteObject(settings);
+ } else {
+ enabledTypes = app.enabledRemoteNotificationTypes();
+ if (enabledTypes == 0) {
+ console.log("推送权限没有开启!");
+ } else {
+ result = true;
+ console.log("已经开启推送功能!")
+ }
+ console.log("enabledTypes2:" + enabledTypes);
+ }
+ plus.ios.deleteObject(app);
+ plus.ios.deleteObject(UIApplication);
+ return result;
+}
+
+// 判断定位权限是否开启
+function judgeIosPermissionLocation() {
+ var result = false;
+ var cllocationManger = plus.ios.import("CLLocationManager");
+ var status = cllocationManger.authorizationStatus();
+ result = (status != 2)
+ console.log("定位权限开启:" + result);
+ // 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
+ /* var enable = cllocationManger.locationServicesEnabled();
+ var status = cllocationManger.authorizationStatus();
+ console.log("enable:" + enable);
+ console.log("status:" + status);
+ if (enable && status != 2) {
+ result = true;
+ console.log("手机定位服务已开启且已授予定位权限");
+ } else {
+ console.log("手机系统的定位没有打开或未给予定位权限");
+ } */
+ plus.ios.deleteObject(cllocationManger);
+ return result;
+}
+
+// 判断麦克风权限是否开启
+function judgeIosPermissionRecord() {
+ var result = false;
+ var avaudiosession = plus.ios.import("AVAudioSession");
+ var avaudio = avaudiosession.sharedInstance();
+ var permissionStatus = avaudio.recordPermission();
+ console.log("permissionStatus:" + permissionStatus);
+ if (permissionStatus == 1684369017 || permissionStatus == 1970168948) {
+ console.log("麦克风权限没有开启");
+ } else {
+ result = true;
+ console.log("麦克风权限已经开启");
+ }
+ plus.ios.deleteObject(avaudiosession);
+ return result;
+}
+
+// 判断相机权限是否开启
+function judgeIosPermissionCamera() {
+ var result = false;
+ var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
+ var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
+ console.log("authStatus:" + authStatus);
+ if (authStatus == 3) {
+ result = true;
+ console.log("相机权限已经开启");
+ } else {
+ console.log("相机权限没有开启");
+ }
+ plus.ios.deleteObject(AVCaptureDevice);
+ return result;
+}
+
+// 判断相册权限是否开启
+function judgeIosPermissionPhotoLibrary() {
+ var result = false;
+ var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
+ var authStatus = PHPhotoLibrary.authorizationStatus();
+ console.log("authStatus:" + authStatus);
+ if (authStatus == 3) {
+ result = true;
+ console.log("相册权限已经开启");
+ } else {
+ console.log("相册权限没有开启");
+ }
+ plus.ios.deleteObject(PHPhotoLibrary);
+ return result;
+}
+
+// 判断通讯录权限是否开启
+function judgeIosPermissionContact() {
+ var result = false;
+ var CNContactStore = plus.ios.import("CNContactStore");
+ var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
+ if (cnAuthStatus == 3) {
+ result = true;
+ console.log("通讯录权限已经开启");
+ } else {
+ console.log("通讯录权限没有开启");
+ }
+ plus.ios.deleteObject(CNContactStore);
+ return result;
+}
+
+// 判断日历权限是否开启
+function judgeIosPermissionCalendar() {
+ var result = false;
+ var EKEventStore = plus.ios.import("EKEventStore");
+ var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
+ if (ekAuthStatus == 3) {
+ result = true;
+ console.log("日历权限已经开启");
+ } else {
+ console.log("日历权限没有开启");
+ }
+ plus.ios.deleteObject(EKEventStore);
+ return result;
+}
+
+// 判断备忘录权限是否开启
+function judgeIosPermissionMemo() {
+ var result = false;
+ var EKEventStore = plus.ios.import("EKEventStore");
+ var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
+ if (ekAuthStatus == 3) {
+ result = true;
+ console.log("备忘录权限已经开启");
+ } else {
+ console.log("备忘录权限没有开启");
+ }
+ plus.ios.deleteObject(EKEventStore);
+ return result;
+}
+
+// Android权限查询
+function requestAndroidPermission(permissionID) {
+ return new Promise((resolve, reject) => {
+ plus.android.requestPermissions(
+ [permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
+ function(resultObj) {
+ var result = 0;
+ for (var i = 0; i < resultObj.granted.length; i++) {
+ var grantedPermission = resultObj.granted[i];
+ console.log('已获取的权限:' + grantedPermission);
+ result = 1
+ }
+ for (var i = 0; i < resultObj.deniedPresent.length; i++) {
+ var deniedPresentPermission = resultObj.deniedPresent[i];
+ console.log('拒绝本次申请的权限:' + deniedPresentPermission);
+ result = 0
+ }
+ for (var i = 0; i < resultObj.deniedAlways.length; i++) {
+ var deniedAlwaysPermission = resultObj.deniedAlways[i];
+ console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
+ result = -1
+ }
+ resolve(result);
+ // 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
+ // if (result != 1) {
+ // gotoAppPermissionSetting()
+ // }
+ },
+ function(error) {
+ console.log('申请权限错误:' + error.code + " = " + error.message);
+ resolve({
+ code: error.code,
+ message: error.message
+ });
+ }
+ );
+ });
+}
+
+// 使用一个方法,根据参数判断权限
+function judgeIosPermission(permissionID) {
+ if (permissionID == "location") {
+ return judgeIosPermissionLocation()
+ } else if (permissionID == "camera") {
+ return judgeIosPermissionCamera()
+ } else if (permissionID == "photoLibrary") {
+ return judgeIosPermissionPhotoLibrary()
+ } else if (permissionID == "record") {
+ return judgeIosPermissionRecord()
+ } else if (permissionID == "push") {
+ return judgeIosPermissionPush()
+ } else if (permissionID == "contact") {
+ return judgeIosPermissionContact()
+ } else if (permissionID == "calendar") {
+ return judgeIosPermissionCalendar()
+ } else if (permissionID == "memo") {
+ return judgeIosPermissionMemo()
+ }
+ return false;
+}
+
+// 跳转到**应用**的权限页面
+function gotoAppPermissionSetting() {
+ if (isIos) {
+ var UIApplication = plus.ios.import("UIApplication");
+ var application2 = UIApplication.sharedApplication();
+ var NSURL2 = plus.ios.import("NSURL");
+ // var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
+ var setting2 = NSURL2.URLWithString("app-settings:");
+ application2.openURL(setting2);
+
+ plus.ios.deleteObject(setting2);
+ plus.ios.deleteObject(NSURL2);
+ plus.ios.deleteObject(application2);
+ } else {
+ // console.log(plus.device.vendor);
+ var Intent = plus.android.importClass("android.content.Intent");
+ var Settings = plus.android.importClass("android.provider.Settings");
+ var Uri = plus.android.importClass("android.net.Uri");
+ var mainActivity = plus.android.runtimeMainActivity();
+ var intent = new Intent();
+ intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
+ var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
+ intent.setData(uri);
+ mainActivity.startActivity(intent);
+ }
+}
+
+// 检查系统的设备服务是否开启
+// var checkSystemEnableLocation = async function () {
+function checkSystemEnableLocation() {
+ if (isIos) {
+ var result = false;
+ var cllocationManger = plus.ios.import("CLLocationManager");
+ var result = cllocationManger.locationServicesEnabled();
+ console.log("系统定位开启:" + result);
+ plus.ios.deleteObject(cllocationManger);
+ return result;
+ } else {
+ var context = plus.android.importClass("android.content.Context");
+ var locationManager = plus.android.importClass("android.location.LocationManager");
+ var main = plus.android.runtimeMainActivity();
+ var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
+ var result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
+ console.log("系统定位开启:" + result);
+ return result
+ }
+}
+
+export default {
+ judgeIosPermission: judgeIosPermission,
+ requestAndroidPermission: requestAndroidPermission,
+ checkSystemEnableLocation: checkSystemEnableLocation,
+ gotoAppPermissionSetting: gotoAppPermissionSetting
}
diff --git a/uni_modules/json-gps/readme.md b/uni_modules/json-gps/readme.md
index 739335fc233a750753ffc013ab9a96688de68c42..f62b67468d9333ad00acdc075a8dd544d902e9b9 100644
--- a/uni_modules/json-gps/readme.md
+++ b/uni_modules/json-gps/readme.md
@@ -9,11 +9,11 @@
```js
import Gps from '@/uni_modules/json-gps/js_sdk/gps.js';
const gps = new Gps()
-export default {
+export default {
async onShow() {
uni.showLoading({
title:"获取定位中"
- });
+ });
let location = await gps.getLocation()
console.log(location);
if(location){
@@ -22,8 +22,8 @@ export default {
icon: 'none'
});
}
- uni.hideLoading()
- }
+ uni.hideLoading()
+ }
}
```
diff --git a/uni_modules/json-interceptor-chooseImage/readme.md b/uni_modules/json-interceptor-chooseImage/readme.md
index e9d98fb956397d004d17975bd05fd64d00624f85..dc74da4fe00b9815a6059b70eb65ba1f7b45e7c4 100644
--- a/uni_modules/json-interceptor-chooseImage/readme.md
+++ b/uni_modules/json-interceptor-chooseImage/readme.md
@@ -9,21 +9,21 @@
```
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 f3869c481ec5f1547e41d3cf3d2dc1c9ce5b0f22..cbd8548cb7c1180702e32855e6a9e7fbf9ec150c 100644
--- a/uni_modules/uni-badge/components/uni-badge/uni-badge.vue
+++ b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue
@@ -1,253 +1,253 @@
-
-
-
- {{displayValue}}
-
-
-
-
-
-
diff --git a/uni_modules/uni-calendar/components/uni-calendar/i18n/en.json b/uni_modules/uni-calendar/components/uni-calendar/i18n/en.json
index fcbd13cfc08064e801531332625f0fdacbb7c509..526a4f39caeea9f36583c01c685b4ed2e502ad94 100644
--- a/uni_modules/uni-calendar/components/uni-calendar/i18n/en.json
+++ b/uni_modules/uni-calendar/components/uni-calendar/i18n/en.json
@@ -1,12 +1,12 @@
-{
- "uni-calender.ok": "ok",
- "uni-calender.cancel": "cancel",
- "uni-calender.today": "today",
- "uni-calender.MON": "MON",
- "uni-calender.TUE": "TUE",
- "uni-calender.WED": "WED",
- "uni-calender.THU": "THU",
- "uni-calender.FRI": "FRI",
- "uni-calender.SAT": "SAT",
- "uni-calender.SUN": "SUN"
+{
+ "uni-calender.ok": "ok",
+ "uni-calender.cancel": "cancel",
+ "uni-calender.today": "today",
+ "uni-calender.MON": "MON",
+ "uni-calender.TUE": "TUE",
+ "uni-calender.WED": "WED",
+ "uni-calender.THU": "THU",
+ "uni-calender.FRI": "FRI",
+ "uni-calender.SAT": "SAT",
+ "uni-calender.SUN": "SUN"
}
diff --git a/uni_modules/uni-calendar/components/uni-calendar/i18n/index.js b/uni_modules/uni-calendar/components/uni-calendar/i18n/index.js
index de7509c87ba5197b9f5d20ca94a0558c7a8e08a9..fa8f0f3734de6effb137592fce6c0f722c048432 100644
--- a/uni_modules/uni-calendar/components/uni-calendar/i18n/index.js
+++ b/uni_modules/uni-calendar/components/uni-calendar/i18n/index.js
@@ -1,8 +1,8 @@
-import en from './en.json'
-import zhHans from './zh-Hans.json'
-import zhHant from './zh-Hant.json'
-export default {
- en,
- 'zh-Hans': zhHans,
- 'zh-Hant': zhHant
+import en from './en.json'
+import zhHans from './zh-Hans.json'
+import zhHant from './zh-Hant.json'
+export default {
+ en,
+ 'zh-Hans': zhHans,
+ 'zh-Hant': zhHant
}
diff --git a/uni_modules/uni-calendar/components/uni-calendar/i18n/zh-Hans.json b/uni_modules/uni-calendar/components/uni-calendar/i18n/zh-Hans.json
index 1ca43de010911bfec3405d84de46530f6de1a03e..4d959a4dd0392f9e6836b8b264ed05dd09db4d22 100644
--- a/uni_modules/uni-calendar/components/uni-calendar/i18n/zh-Hans.json
+++ b/uni_modules/uni-calendar/components/uni-calendar/i18n/zh-Hans.json
@@ -1,12 +1,12 @@
-{
- "uni-calender.ok": "确定",
- "uni-calender.cancel": "取消",
- "uni-calender.today": "今日",
- "uni-calender.SUN": "日",
- "uni-calender.MON": "一",
- "uni-calender.TUE": "二",
- "uni-calender.WED": "三",
- "uni-calender.THU": "四",
- "uni-calender.FRI": "五",
- "uni-calender.SAT": "六"
+{
+ "uni-calender.ok": "确定",
+ "uni-calender.cancel": "取消",
+ "uni-calender.today": "今日",
+ "uni-calender.SUN": "日",
+ "uni-calender.MON": "一",
+ "uni-calender.TUE": "二",
+ "uni-calender.WED": "三",
+ "uni-calender.THU": "四",
+ "uni-calender.FRI": "五",
+ "uni-calender.SAT": "六"
}
diff --git a/uni_modules/uni-calendar/components/uni-calendar/i18n/zh-Hant.json b/uni_modules/uni-calendar/components/uni-calendar/i18n/zh-Hant.json
index e0fe33b958f8ee991a4de2d1b370c8ca81e0dbb9..8dabf817267905077e0b2759c213132b33bdca41 100644
--- a/uni_modules/uni-calendar/components/uni-calendar/i18n/zh-Hant.json
+++ b/uni_modules/uni-calendar/components/uni-calendar/i18n/zh-Hant.json
@@ -1,12 +1,12 @@
-{
- "uni-calender.ok": "確定",
- "uni-calender.cancel": "取消",
- "uni-calender.today": "今日",
+{
+ "uni-calender.ok": "確定",
+ "uni-calender.cancel": "取消",
+ "uni-calender.today": "今日",
"uni-calender.SUN": "日",
"uni-calender.MON": "一",
"uni-calender.TUE": "二",
"uni-calender.WED": "三",
"uni-calender.THU": "四",
"uni-calender.FRI": "五",
- "uni-calender.SAT": "六"
+ "uni-calender.SAT": "六"
}
diff --git a/uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.vue b/uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.vue
index 0353011e99ec6f362fba732ce5ca62c490288f23..cd5863d5c92f5b447ed38e1abbbf983d711bb39f 100644
--- a/uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.vue
+++ b/uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.vue
@@ -1,181 +1,181 @@
-
-
-
-
- {{weeks.date}}
- {{todayText}}
- {{weeks.isDay ? todayText : (weeks.lunar.IDayCn === '初一'?weeks.lunar.IMonthCn:weeks.lunar.IDayCn)}}
- {{weeks.extraInfo.info}}
-
-
-
-
-
-
-
+
+
+
+
+ {{weeks.date}}
+ {{todayText}}
+ {{weeks.isDay ? todayText : (weeks.lunar.IDayCn === '初一'?weeks.lunar.IMonthCn:weeks.lunar.IDayCn)}}
+ {{weeks.extraInfo.info}}
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue b/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue
index 401a2de6d5d5d1ea583d562dd67d0711e94f2ce3..0b9ecde3bc6b3ab41c5de180039d94c3aa5b7c3e 100644
--- a/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue
+++ b/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue
@@ -1,547 +1,547 @@
-
-
-
-
-
-
-
-
- {{nowDate.month}}
-
-
-
- {{SUNText}}
-
-
- {{monText}}
-
-
- {{TUEText}}
-
-
- {{WEDText}}
-
-
- {{THUText}}
-
-
- {{FRIText}}
-
-
- {{SATText}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ {{nowDate.month}}
+
+
+
+ {{SUNText}}
+
+
+ {{monText}}
+
+
+ {{TUEText}}
+
+
+ {{WEDText}}
+
+
+ {{THUText}}
+
+
+ {{FRIText}}
+
+
+ {{SATText}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-calendar/components/uni-calendar/util.js b/uni_modules/uni-calendar/components/uni-calendar/util.js
index 37f44321ebc299212eea8646c9e7e63e9b2ed6f8..70680255988abc0507295bacc396393d997459be 100644
--- a/uni_modules/uni-calendar/components/uni-calendar/util.js
+++ b/uni_modules/uni-calendar/components/uni-calendar/util.js
@@ -1,352 +1,352 @@
-import CALENDAR from './calendar.js'
-
-class Calendar {
- constructor({
- date,
- selected,
- startDate,
- endDate,
- range
- } = {}) {
- // 当前日期
- this.date = this.getDate(new Date()) // 当前初入日期
- // 打点信息
- this.selected = selected || [];
- // 范围开始
- this.startDate = startDate
- // 范围结束
- this.endDate = endDate
- this.range = range
- // 多选状态
- this.cleanMultipleStatus()
- // 每周日期
- this.weeks = {}
- // this._getWeek(this.date.fullDate)
- }
- /**
- * 设置日期
- * @param {Object} date
- */
- setDate(date) {
- this.selectDate = this.getDate(date)
- this._getWeek(this.selectDate.fullDate)
- }
-
- /**
- * 清理多选状态
- */
- cleanMultipleStatus() {
- this.multipleStatus = {
- before: '',
- after: '',
- data: []
- }
- }
-
- /**
- * 重置开始日期
- */
- resetSatrtDate(startDate) {
- // 范围开始
- this.startDate = startDate
-
- }
-
- /**
- * 重置结束日期
- */
- resetEndDate(endDate) {
- // 范围结束
- this.endDate = endDate
- }
-
- /**
- * 获取任意时间
- */
- getDate(date, AddDayCount = 0, str = 'day') {
- if (!date) {
- date = new Date()
- }
- if (typeof date !== 'object') {
- date = date.replace(/-/g, '/')
- }
- const dd = new Date(date)
- switch (str) {
- case 'day':
- dd.setDate(dd.getDate() + AddDayCount) // 获取AddDayCount天后的日期
- break
- case 'month':
- if (dd.getDate() === 31) {
- dd.setDate(dd.getDate() + AddDayCount)
- } else {
- dd.setMonth(dd.getMonth() + AddDayCount) // 获取AddDayCount天后的日期
- }
- break
- case 'year':
- dd.setFullYear(dd.getFullYear() + AddDayCount) // 获取AddDayCount天后的日期
- break
- }
- const y = dd.getFullYear()
- const m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1 // 获取当前月份的日期,不足10补0
- const d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 获取当前几号,不足10补0
- return {
- fullDate: y + '-' + m + '-' + d,
- year: y,
- month: m,
- date: d,
- day: dd.getDay()
- }
- }
-
-
- /**
- * 获取上月剩余天数
- */
- _getLastMonthDays(firstDay, full) {
- let dateArr = []
- for (let i = firstDay; i > 0; i--) {
- const beforeDate = new Date(full.year, full.month - 1, -i + 1).getDate()
- dateArr.push({
- date: beforeDate,
- month: full.month - 1,
- lunar: this.getlunar(full.year, full.month - 1, beforeDate),
- disable: true
- })
- }
- return dateArr
- }
- /**
- * 获取本月天数
- */
- _currentMonthDys(dateData, full) {
- let dateArr = []
- let fullDate = this.date.fullDate
- for (let i = 1; i <= dateData; i++) {
- let isinfo = false
- let nowDate = full.year + '-' + (full.month < 10 ?
- full.month : full.month) + '-' + (i < 10 ?
- '0' + i : i)
- // 是否今天
- let isDay = fullDate === nowDate
- // 获取打点信息
- let info = this.selected && this.selected.find((item) => {
- if (this.dateEqual(nowDate, item.date)) {
- return item
- }
- })
-
- // 日期禁用
- let disableBefore = true
- let disableAfter = true
- if (this.startDate) {
- let dateCompBefore = this.dateCompare(this.startDate, fullDate)
- disableBefore = this.dateCompare(dateCompBefore ? this.startDate : fullDate, nowDate)
+import CALENDAR from './calendar.js'
+
+class Calendar {
+ constructor({
+ date,
+ selected,
+ startDate,
+ endDate,
+ range
+ } = {}) {
+ // 当前日期
+ this.date = this.getDate(new Date()) // 当前初入日期
+ // 打点信息
+ this.selected = selected || [];
+ // 范围开始
+ this.startDate = startDate
+ // 范围结束
+ this.endDate = endDate
+ this.range = range
+ // 多选状态
+ this.cleanMultipleStatus()
+ // 每周日期
+ this.weeks = {}
+ // this._getWeek(this.date.fullDate)
+ }
+ /**
+ * 设置日期
+ * @param {Object} date
+ */
+ setDate(date) {
+ this.selectDate = this.getDate(date)
+ this._getWeek(this.selectDate.fullDate)
+ }
+
+ /**
+ * 清理多选状态
+ */
+ cleanMultipleStatus() {
+ this.multipleStatus = {
+ before: '',
+ after: '',
+ data: []
+ }
+ }
+
+ /**
+ * 重置开始日期
+ */
+ resetSatrtDate(startDate) {
+ // 范围开始
+ this.startDate = startDate
+
+ }
+
+ /**
+ * 重置结束日期
+ */
+ resetEndDate(endDate) {
+ // 范围结束
+ this.endDate = endDate
+ }
+
+ /**
+ * 获取任意时间
+ */
+ getDate(date, AddDayCount = 0, str = 'day') {
+ if (!date) {
+ date = new Date()
+ }
+ if (typeof date !== 'object') {
+ date = date.replace(/-/g, '/')
+ }
+ const dd = new Date(date)
+ switch (str) {
+ case 'day':
+ dd.setDate(dd.getDate() + AddDayCount) // 获取AddDayCount天后的日期
+ break
+ case 'month':
+ if (dd.getDate() === 31) {
+ dd.setDate(dd.getDate() + AddDayCount)
+ } else {
+ dd.setMonth(dd.getMonth() + AddDayCount) // 获取AddDayCount天后的日期
+ }
+ break
+ case 'year':
+ dd.setFullYear(dd.getFullYear() + AddDayCount) // 获取AddDayCount天后的日期
+ break
+ }
+ const y = dd.getFullYear()
+ const m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1 // 获取当前月份的日期,不足10补0
+ const d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 获取当前几号,不足10补0
+ return {
+ fullDate: y + '-' + m + '-' + d,
+ year: y,
+ month: m,
+ date: d,
+ day: dd.getDay()
+ }
+ }
+
+
+ /**
+ * 获取上月剩余天数
+ */
+ _getLastMonthDays(firstDay, full) {
+ let dateArr = []
+ for (let i = firstDay; i > 0; i--) {
+ const beforeDate = new Date(full.year, full.month - 1, -i + 1).getDate()
+ dateArr.push({
+ date: beforeDate,
+ month: full.month - 1,
+ lunar: this.getlunar(full.year, full.month - 1, beforeDate),
+ disable: true
+ })
+ }
+ return dateArr
+ }
+ /**
+ * 获取本月天数
+ */
+ _currentMonthDys(dateData, full) {
+ let dateArr = []
+ let fullDate = this.date.fullDate
+ for (let i = 1; i <= dateData; i++) {
+ let isinfo = false
+ let nowDate = full.year + '-' + (full.month < 10 ?
+ full.month : full.month) + '-' + (i < 10 ?
+ '0' + i : i)
+ // 是否今天
+ let isDay = fullDate === nowDate
+ // 获取打点信息
+ let info = this.selected && this.selected.find((item) => {
+ if (this.dateEqual(nowDate, item.date)) {
+ return item
+ }
+ })
+
+ // 日期禁用
+ let disableBefore = true
+ let disableAfter = true
+ if (this.startDate) {
+ let dateCompBefore = this.dateCompare(this.startDate, fullDate)
+ disableBefore = this.dateCompare(dateCompBefore ? this.startDate : fullDate, nowDate)
+ }
+
+ if (this.endDate) {
+ let dateCompAfter = this.dateCompare(fullDate, this.endDate)
+ disableAfter = this.dateCompare(nowDate, dateCompAfter ? this.endDate : fullDate)
}
-
- if (this.endDate) {
- let dateCompAfter = this.dateCompare(fullDate, this.endDate)
- disableAfter = this.dateCompare(nowDate, dateCompAfter ? this.endDate : fullDate)
+ let multiples = this.multipleStatus.data
+ let checked = false
+ let multiplesStatus = -1
+ if (this.range) {
+ if (multiples) {
+ multiplesStatus = multiples.findIndex((item) => {
+ return this.dateEqual(item, nowDate)
+ })
+ }
+ if (multiplesStatus !== -1) {
+ checked = true
+ }
+ }
+ let data = {
+ fullDate: nowDate,
+ year: full.year,
+ date: i,
+ multiple: this.range ? checked : false,
+ beforeMultiple: this.dateEqual(this.multipleStatus.before, nowDate),
+ afterMultiple: this.dateEqual(this.multipleStatus.after, nowDate),
+ month: full.month,
+ lunar: this.getlunar(full.year, full.month, i),
+ disable: !disableBefore || !disableAfter,
+ isDay
}
- let multiples = this.multipleStatus.data
- let checked = false
- let multiplesStatus = -1
- if (this.range) {
- if (multiples) {
- multiplesStatus = multiples.findIndex((item) => {
- return this.dateEqual(item, nowDate)
- })
- }
- if (multiplesStatus !== -1) {
- checked = true
- }
- }
- let data = {
- fullDate: nowDate,
- year: full.year,
- date: i,
- multiple: this.range ? checked : false,
- beforeMultiple: this.dateEqual(this.multipleStatus.before, nowDate),
- afterMultiple: this.dateEqual(this.multipleStatus.after, nowDate),
- month: full.month,
- lunar: this.getlunar(full.year, full.month, i),
- disable: !disableBefore || !disableAfter,
- isDay
- }
- if (info) {
- data.extraInfo = info
- }
-
- dateArr.push(data)
- }
- return dateArr
- }
- /**
- * 获取下月天数
- */
- _getNextMonthDays(surplus, full) {
- let dateArr = []
- for (let i = 1; i < surplus + 1; i++) {
- dateArr.push({
- date: i,
- month: Number(full.month) + 1,
- lunar: this.getlunar(full.year, Number(full.month) + 1, i),
- disable: true
- })
- }
- return dateArr
- }
-
- /**
- * 获取当前日期详情
- * @param {Object} date
- */
- getInfo(date) {
- if (!date) {
- date = new Date()
- }
- const dateInfo = this.canlender.find(item => item.fullDate === this.getDate(date).fullDate)
- return dateInfo
- }
-
- /**
- * 比较时间大小
- */
- dateCompare(startDate, endDate) {
- // 计算截止时间
- startDate = new Date(startDate.replace('-', '/').replace('-', '/'))
- // 计算详细项的截止时间
- endDate = new Date(endDate.replace('-', '/').replace('-', '/'))
- if (startDate <= endDate) {
- return true
- } else {
- return false
- }
- }
-
- /**
- * 比较时间是否相等
- */
- dateEqual(before, after) {
- // 计算截止时间
- before = new Date(before.replace('-', '/').replace('-', '/'))
- // 计算详细项的截止时间
- after = new Date(after.replace('-', '/').replace('-', '/'))
- if (before.getTime() - after.getTime() === 0) {
- return true
- } else {
- return false
- }
- }
-
-
- /**
- * 获取日期范围内所有日期
- * @param {Object} begin
- * @param {Object} end
- */
- geDateAll(begin, end) {
- var arr = []
- var ab = begin.split('-')
- var ae = end.split('-')
- var db = new Date()
- db.setFullYear(ab[0], ab[1] - 1, ab[2])
- var de = new Date()
- de.setFullYear(ae[0], ae[1] - 1, ae[2])
- var unixDb = db.getTime() - 24 * 60 * 60 * 1000
- var unixDe = de.getTime() - 24 * 60 * 60 * 1000
- for (var k = unixDb; k <= unixDe;) {
- k = k + 24 * 60 * 60 * 1000
- arr.push(this.getDate(new Date(parseInt(k))).fullDate)
- }
- return arr
- }
- /**
- * 计算阴历日期显示
- */
- getlunar(year, month, date) {
- return CALENDAR.solar2lunar(year, month, date)
- }
- /**
- * 设置打点
- */
- setSelectInfo(data, value) {
- this.selected = value
- this._getWeek(data)
- }
-
- /**
- * 获取多选状态
- */
- setMultiple(fullDate) {
- let {
- before,
- after
+ if (info) {
+ data.extraInfo = info
+ }
+
+ dateArr.push(data)
+ }
+ return dateArr
+ }
+ /**
+ * 获取下月天数
+ */
+ _getNextMonthDays(surplus, full) {
+ let dateArr = []
+ for (let i = 1; i < surplus + 1; i++) {
+ dateArr.push({
+ date: i,
+ month: Number(full.month) + 1,
+ lunar: this.getlunar(full.year, Number(full.month) + 1, i),
+ disable: true
+ })
+ }
+ return dateArr
+ }
+
+ /**
+ * 获取当前日期详情
+ * @param {Object} date
+ */
+ getInfo(date) {
+ if (!date) {
+ date = new Date()
+ }
+ const dateInfo = this.canlender.find(item => item.fullDate === this.getDate(date).fullDate)
+ return dateInfo
+ }
+
+ /**
+ * 比较时间大小
+ */
+ dateCompare(startDate, endDate) {
+ // 计算截止时间
+ startDate = new Date(startDate.replace('-', '/').replace('-', '/'))
+ // 计算详细项的截止时间
+ endDate = new Date(endDate.replace('-', '/').replace('-', '/'))
+ if (startDate <= endDate) {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ /**
+ * 比较时间是否相等
+ */
+ dateEqual(before, after) {
+ // 计算截止时间
+ before = new Date(before.replace('-', '/').replace('-', '/'))
+ // 计算详细项的截止时间
+ after = new Date(after.replace('-', '/').replace('-', '/'))
+ if (before.getTime() - after.getTime() === 0) {
+ return true
+ } else {
+ return false
+ }
+ }
+
+
+ /**
+ * 获取日期范围内所有日期
+ * @param {Object} begin
+ * @param {Object} end
+ */
+ geDateAll(begin, end) {
+ var arr = []
+ var ab = begin.split('-')
+ var ae = end.split('-')
+ var db = new Date()
+ db.setFullYear(ab[0], ab[1] - 1, ab[2])
+ var de = new Date()
+ de.setFullYear(ae[0], ae[1] - 1, ae[2])
+ var unixDb = db.getTime() - 24 * 60 * 60 * 1000
+ var unixDe = de.getTime() - 24 * 60 * 60 * 1000
+ for (var k = unixDb; k <= unixDe;) {
+ k = k + 24 * 60 * 60 * 1000
+ arr.push(this.getDate(new Date(parseInt(k))).fullDate)
+ }
+ return arr
+ }
+ /**
+ * 计算阴历日期显示
+ */
+ getlunar(year, month, date) {
+ return CALENDAR.solar2lunar(year, month, date)
+ }
+ /**
+ * 设置打点
+ */
+ setSelectInfo(data, value) {
+ this.selected = value
+ this._getWeek(data)
+ }
+
+ /**
+ * 获取多选状态
+ */
+ setMultiple(fullDate) {
+ let {
+ before,
+ after
} = this.multipleStatus
-
- if (!this.range) return
- if (before && after) {
- this.multipleStatus.before = ''
- this.multipleStatus.after = ''
- this.multipleStatus.data = []
+
+ if (!this.range) return
+ if (before && after) {
+ this.multipleStatus.before = ''
+ this.multipleStatus.after = ''
+ this.multipleStatus.data = []
} else {
if (!before) {
this.multipleStatus.before = fullDate
} else {
- this.multipleStatus.after = fullDate
- if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
- this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
- } else {
- this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
- }
- }
- }
- this._getWeek(fullDate)
- }
-
- /**
- * 获取每周数据
- * @param {Object} dateData
- */
- _getWeek(dateData) {
- const {
- fullDate,
- year,
- month,
- date,
- day
- } = this.getDate(dateData)
- let firstDay = new Date(year, month - 1, 1).getDay()
- let currentDay = new Date(year, month, 0).getDate()
- let dates = {
- lastMonthDays: this._getLastMonthDays(firstDay, this.getDate(dateData)), // 上个月末尾几天
- currentMonthDys: this._currentMonthDys(currentDay, this.getDate(dateData)), // 本月天数
- nextMonthDays: [], // 下个月开始几天
- weeks: []
- }
- let canlender = []
- const surplus = 42 - (dates.lastMonthDays.length + dates.currentMonthDys.length)
- dates.nextMonthDays = this._getNextMonthDays(surplus, this.getDate(dateData))
- canlender = canlender.concat(dates.lastMonthDays, dates.currentMonthDys, dates.nextMonthDays)
- let weeks = {}
- // 拼接数组 上个月开始几天 + 本月天数+ 下个月开始几天
- for (let i = 0; i < canlender.length; i++) {
- if (i % 7 === 0) {
- weeks[parseInt(i / 7)] = new Array(7)
- }
- weeks[parseInt(i / 7)][i % 7] = canlender[i]
+ this.multipleStatus.after = fullDate
+ if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
+ this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
+ } else {
+ this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
+ }
+ }
}
- this.canlender = canlender
- this.weeks = weeks
- }
-
- //静态方法
- // static init(date) {
- // if (!this.instance) {
- // this.instance = new Calendar(date);
- // }
- // return this.instance;
- // }
-}
-
-
+ this._getWeek(fullDate)
+ }
+
+ /**
+ * 获取每周数据
+ * @param {Object} dateData
+ */
+ _getWeek(dateData) {
+ const {
+ fullDate,
+ year,
+ month,
+ date,
+ day
+ } = this.getDate(dateData)
+ let firstDay = new Date(year, month - 1, 1).getDay()
+ let currentDay = new Date(year, month, 0).getDate()
+ let dates = {
+ lastMonthDays: this._getLastMonthDays(firstDay, this.getDate(dateData)), // 上个月末尾几天
+ currentMonthDys: this._currentMonthDys(currentDay, this.getDate(dateData)), // 本月天数
+ nextMonthDays: [], // 下个月开始几天
+ weeks: []
+ }
+ let canlender = []
+ const surplus = 42 - (dates.lastMonthDays.length + dates.currentMonthDys.length)
+ dates.nextMonthDays = this._getNextMonthDays(surplus, this.getDate(dateData))
+ canlender = canlender.concat(dates.lastMonthDays, dates.currentMonthDys, dates.nextMonthDays)
+ let weeks = {}
+ // 拼接数组 上个月开始几天 + 本月天数+ 下个月开始几天
+ for (let i = 0; i < canlender.length; i++) {
+ if (i % 7 === 0) {
+ weeks[parseInt(i / 7)] = new Array(7)
+ }
+ weeks[parseInt(i / 7)][i % 7] = canlender[i]
+ }
+ this.canlender = canlender
+ this.weeks = weeks
+ }
+
+ //静态方法
+ // static init(date) {
+ // if (!this.instance) {
+ // this.instance = new Calendar(date);
+ // }
+ // return this.instance;
+ // }
+}
+
+
export default Calendar
diff --git a/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/LICENSE.md b/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/LICENSE.md
index 261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64..29f81d812f3e768fa89638d1f72920dbfd1413a8 100644
--- a/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/LICENSE.md
+++ b/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/LICENSE.md
@@ -1,201 +1,201 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/uni_modules/uni-card/changelog.md b/uni_modules/uni-card/changelog.md
index 59c4be98156b3e42de635ec14ab1a1e34e6a9bc2..c84f1ace5d86ce7b0105d5ff6228c52d2423ee25 100644
--- a/uni_modules/uni-card/changelog.md
+++ b/uni_modules/uni-card/changelog.md
@@ -1,12 +1,12 @@
## 1.2.1(2021-07-30)
- 优化 vue3下事件警告的问题
-## 1.2.0(2021-07-13)
-- 组件兼容 vue3,如何创建vue3项目详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.1.8(2021-07-01)
-- 优化 图文卡片无图片加载时,提供占位图标
-- 新增 header 插槽,自定义卡片头部( 图文卡片 mode="style" 时,不支持)
-- 修复 thumbnail 不存在仍然占位的 bug
-## 1.1.7(2021-05-12)
-- 新增 组件示例地址
-## 1.1.6(2021-02-04)
-- 调整为uni_modules目录规范
+## 1.2.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.1.8(2021-07-01)
+- 优化 图文卡片无图片加载时,提供占位图标
+- 新增 header 插槽,自定义卡片头部( 图文卡片 mode="style" 时,不支持)
+- 修复 thumbnail 不存在仍然占位的 bug
+## 1.1.7(2021-05-12)
+- 新增 组件示例地址
+## 1.1.6(2021-02-04)
+- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-card/components/uni-card/uni-card.vue b/uni_modules/uni-card/components/uni-card/uni-card.vue
index d80cdf17f428c46848dd13dfb27755b02bb04909..7458b777f1368d1802b2b3d77103e5a742149639 100644
--- a/uni_modules/uni-card/components/uni-card/uni-card.vue
+++ b/uni_modules/uni-card/components/uni-card/uni-card.vue
@@ -1,431 +1,431 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ title }}
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ title }}
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
- {{ title }}
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-card/package.json b/uni_modules/uni-card/package.json
index 507273c1f11d146f34c4bf180ffa21d30a535b6c..79533648372c7bd339e04d86911da660ce844ea0 100644
--- a/uni_modules/uni-card/package.json
+++ b/uni_modules/uni-card/package.json
@@ -1,85 +1,85 @@
-{
- "id": "uni-card",
- "displayName": "uni-card 卡片",
- "version": "1.2.1",
- "description": "Card 组件,提供常见的卡片样式。",
- "keywords": [
- "uni-ui",
- "uniui",
- "card",
- "",
- "卡片"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [
- "uni-icons"
- ],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
-}
+{
+ "id": "uni-card",
+ "displayName": "uni-card 卡片",
+ "version": "1.2.1",
+ "description": "Card 组件,提供常见的卡片样式。",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "card",
+ "",
+ "卡片"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-icons"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
+}
diff --git a/uni_modules/uni-collapse/changelog.md b/uni_modules/uni-collapse/changelog.md
index 9fb4b5c1b1cc1c89ff1be7a1456f0121e3736fbd..c0dba72e0ede34c4b8922c78684c63281578b02a 100644
--- a/uni_modules/uni-collapse/changelog.md
+++ b/uni_modules/uni-collapse/changelog.md
@@ -1,27 +1,27 @@
## 1.3.3(2021-08-17)
- 优化 show-arrow 属性默认为true
-## 1.3.2(2021-08-17)
-- 新增 show-arrow 属性,控制是否显示右侧箭头
-## 1.3.1(2021-07-30)
-- 优化 vue3下小程序事件警告的问题
-## 1.3.0(2021-07-30)
-- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.2.2(2021-07-21)
-- 修复 由1.2.0版本引起的 change 事件返回 undefined 的Bug
-## 1.2.1(2021-07-21)
-- 优化 组件示例
-## 1.2.0(2021-07-21)
-- 新增 组件折叠动画
-- 新增 value\v-model 属性 ,动态修改面板折叠状态
-- 新增 title 插槽 ,可定义面板标题
-- 新增 border 属性 ,显示隐藏面板内容分隔线
-- 新增 title-border 属性 ,显示隐藏面板标题分隔线
-- 修复 resize 方法失效的Bug
-- 修复 change 事件返回参数不正确的Bug
-- 优化 H5、App 平台自动更具内容更新高度,无需调用 reszie() 方法
-## 1.1.7(2021-05-12)
-- 新增 组件示例地址
-## 1.1.6(2021-02-05)
-- 优化 组件引用关系,通过uni_modules引用组件
-## 1.1.5(2021-02-05)
+## 1.3.2(2021-08-17)
+- 新增 show-arrow 属性,控制是否显示右侧箭头
+## 1.3.1(2021-07-30)
+- 优化 vue3下小程序事件警告的问题
+## 1.3.0(2021-07-30)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.2.2(2021-07-21)
+- 修复 由1.2.0版本引起的 change 事件返回 undefined 的Bug
+## 1.2.1(2021-07-21)
+- 优化 组件示例
+## 1.2.0(2021-07-21)
+- 新增 组件折叠动画
+- 新增 value\v-model 属性 ,动态修改面板折叠状态
+- 新增 title 插槽 ,可定义面板标题
+- 新增 border 属性 ,显示隐藏面板内容分隔线
+- 新增 title-border 属性 ,显示隐藏面板标题分隔线
+- 修复 resize 方法失效的Bug
+- 修复 change 事件返回参数不正确的Bug
+- 优化 H5、App 平台自动更具内容更新高度,无需调用 reszie() 方法
+## 1.1.7(2021-05-12)
+- 新增 组件示例地址
+## 1.1.6(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+## 1.1.5(2021-02-05)
- 调整为uni_modules目录规范
\ No newline at end of file
diff --git a/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue b/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue
index e962a9f1a30f0c052c826c01128758c3195e67a5..32d63739cc75aaad1d35b30c869434441e7e5049 100644
--- a/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue
+++ b/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue
@@ -1,131 +1,131 @@
-
-
-
-
-
-
-
-
- {{ title }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue b/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue
index b7360d47f03d31f38d931c43620b060bd7b5846d..f16d8fa7dab0711b095853fdd59f2f344588169d 100644
--- a/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue
+++ b/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue
@@ -1,146 +1,146 @@
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-collapse/package.json b/uni_modules/uni-collapse/package.json
index 965814fb4c8447cdcbdd8223ca4403303bc84cdb..59731d5b9abd39d5058be5eb78ad0562b8a7a7fb 100644
--- a/uni_modules/uni-collapse/package.json
+++ b/uni_modules/uni-collapse/package.json
@@ -1,88 +1,88 @@
-{
- "id": "uni-collapse",
- "displayName": "uni-collapse 折叠面板",
- "version": "1.3.3",
- "description": "Collapse 组件,可以折叠 / 展开的内容区域。",
- "keywords": [
- "uni-ui",
- "折叠",
- "折叠面板",
- "手风琴"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [
- "uni-icons"
- ],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- },
- "Vue": {
- "vue2": "y",
- "vue3": "u"
- }
- }
- }
- }
+{
+ "id": "uni-collapse",
+ "displayName": "uni-collapse 折叠面板",
+ "version": "1.3.3",
+ "description": "Collapse 组件,可以折叠 / 展开的内容区域。",
+ "keywords": [
+ "uni-ui",
+ "折叠",
+ "折叠面板",
+ "手风琴"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-icons"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-combox/changelog.md b/uni_modules/uni-combox/changelog.md
index 39e8a055d5e6d6bb1e7beffa6db32196b224a230..77cedbd7cc4b66c4dcb920ca4026f69ca4cc363c 100644
--- a/uni_modules/uni-combox/changelog.md
+++ b/uni_modules/uni-combox/changelog.md
@@ -1,10 +1,10 @@
## 0.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 0.0.6(2021-05-12)
-- 新增 组件示例地址
-## 0.0.5(2021-04-21)
-- 优化 添加依赖 uni-icons, 导入后自动下载依赖
-## 0.0.4(2021-02-05)
-- 优化 组件引用关系,通过uni_modules引用组件
-## 0.0.3(2021-02-04)
-- 调整为uni_modules目录规范
+## 0.0.6(2021-05-12)
+- 新增 组件示例地址
+## 0.0.5(2021-04-21)
+- 优化 添加依赖 uni-icons, 导入后自动下载依赖
+## 0.0.4(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+## 0.0.3(2021-02-04)
+- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-combox/components/uni-combox/uni-combox.vue b/uni_modules/uni-combox/components/uni-combox/uni-combox.vue
index fef61111447a01d928d623d144e6c2700873eb5e..3c201d3a2a178309089ddd3d9530dc6af9b06c02 100644
--- a/uni_modules/uni-combox/components/uni-combox/uni-combox.vue
+++ b/uni_modules/uni-combox/components/uni-combox/uni-combox.vue
@@ -1,239 +1,239 @@
-
-
-
- {{label}}
-
-
-
-
-
-
-
- {{emptyTips}}
-
-
- {{item}}
-
-
-
-
-
-
-
-
-
-
+
+
+
+ {{label}}
+
+
+
+
+
+
+
+ {{emptyTips}}
+
+
+ {{item}}
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-combox/package.json b/uni_modules/uni-combox/package.json
index 1254459e9936ca6a53fa08206b75f6e12e945708..951a901598afdd9aac83954b290f6aca402fcbec 100644
--- a/uni_modules/uni-combox/package.json
+++ b/uni_modules/uni-combox/package.json
@@ -1,85 +1,85 @@
-{
- "id": "uni-combox",
- "displayName": "uni-combox 组合框",
- "version": "0.1.0",
- "description": "可以选择也可以输入的表单项 ",
- "keywords": [
- "uni-ui",
- "uniui",
- "combox",
- "组合框",
- "select"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [
- "uni-icons"
- ],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "n"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-combox",
+ "displayName": "uni-combox 组合框",
+ "version": "0.1.0",
+ "description": "可以选择也可以输入的表单项 ",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "combox",
+ "组合框",
+ "select"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-icons"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "n"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-config-center/package.json b/uni_modules/uni-config-center/package.json
index c5dec93b1299d7881b5f80f95960b8024f41772b..d97bd27a6329c76d1cafe7e15b7afaf2a25f9343 100644
--- a/uni_modules/uni-config-center/package.json
+++ b/uni_modules/uni-config-center/package.json
@@ -1,80 +1,80 @@
-{
- "id": "uni-config-center",
- "displayName": "uni-config-center",
- "version": "0.0.2",
- "description": "uniCloud 配置中心",
- "keywords": [
- "配置",
- "配置中心"
-],
- "repository": "",
- "engines": {
- "HBuilderX": "^3.1.0"
- },
- "dcloudext": {
- "category": [
- "uniCloud",
- "云函数模板"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": ""
- },
- "directories": {
- "example": "../../../scripts/dist"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "u",
- "app-nvue": "u"
- },
- "H5-mobile": {
- "Safari": "u",
- "Android Browser": "u",
- "微信浏览器(Android)": "u",
- "QQ浏览器(Android)": "u"
- },
- "H5-pc": {
- "Chrome": "u",
- "IE": "u",
- "Edge": "u",
- "Firefox": "u",
- "Safari": "u"
- },
- "小程序": {
- "微信": "u",
- "阿里": "u",
- "百度": "u",
- "字节跳动": "u",
- "QQ": "u"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-config-center",
+ "displayName": "uni-config-center",
+ "version": "0.0.2",
+ "description": "uniCloud 配置中心",
+ "keywords": [
+ "配置",
+ "配置中心"
+],
+ "repository": "",
+ "engines": {
+ "HBuilderX": "^3.1.0"
+ },
+ "dcloudext": {
+ "category": [
+ "uniCloud",
+ "云函数模板"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": ""
+ },
+ "directories": {
+ "example": "../../../scripts/dist"
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "u",
+ "app-nvue": "u"
+ },
+ "H5-mobile": {
+ "Safari": "u",
+ "Android Browser": "u",
+ "微信浏览器(Android)": "u",
+ "QQ浏览器(Android)": "u"
+ },
+ "H5-pc": {
+ "Chrome": "u",
+ "IE": "u",
+ "Edge": "u",
+ "Firefox": "u",
+ "Safari": "u"
+ },
+ "小程序": {
+ "微信": "u",
+ "阿里": "u",
+ "百度": "u",
+ "字节跳动": "u",
+ "QQ": "u"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
diff --git a/uni_modules/uni-config-center/readme.md b/uni_modules/uni-config-center/readme.md
index 03f7fc27964d93a6c16cc2671d777faa52e079a4..0bd8ac438e0ecc0dc518cf4de8c3d9ede2df3690 100644
--- a/uni_modules/uni-config-center/readme.md
+++ b/uni_modules/uni-config-center/readme.md
@@ -1,93 +1,93 @@
-# 为什么使用uni-config-center
-
-实际开发中很多插件需要配置文件才可以正常运行,如果每个插件都单独进行配置的话就会产生下面这样的目录结构
-
-```bash
-cloudfunctions
-└─────common 公共模块
- ├─plugin-a // 插件A对应的目录
- │ ├─index.js
- │ ├─config.json // plugin-a对应的配置文件
- │ └─other-file.cert // plugin-a依赖的其他文件
- └─plugin-b // plugin-b对应的目录
- ├─index.js
- └─config.json // plugin-b对应的配置文件
-```
-
-假设插件作者要发布一个项目模板,里面使用了很多需要配置的插件,无论是作者发布还是用户使用都是一个大麻烦。
-
-uni-config-center就是用了统一管理这些配置文件的,使用uni-config-center后的目录结构如下
-
-```bash
-cloudfunctions
-└─────common 公共模块
- ├─plugin-a // 插件A对应的目录
- │ └─index.js
- ├─plugin-b // plugin-b对应的目录
- │ └─index.js
- └─uni-config-center
- ├─index.js // config-center入口文件
- ├─plugin-a
- │ ├─config.json // plugin-a对应的配置文件
- │ └─other-file.cert // plugin-a依赖的其他文件
- └─plugin-b
- └─config.json // plugin-b对应的配置文件
-```
-
-使用uni-config-center后的优势
-
-- 配置文件统一管理,分离插件主体和配置信息,更新插件更方便
-- 支持对config.json设置schema,插件使用者在HBuilderX内编写config.json文件时会有更好的提示(后续HBuilderX会提供支持)
-
-# 用法
-
-在要使用uni-config-center的公共模块或云函数内引入uni-config-center依赖,请参考:[使用公共模块](https://uniapp.dcloud.net.cn/uniCloud/cf-common)
-
-```js
-const createConfig = require('uni-config-center')
-
-const uniIdConfig = createConfig({
- pluginId: 'uni-id', // 插件id
- defaultConfig: { // 默认配置
- tokenExpiresIn: 7200,
- tokenExpiresThreshold: 600,
- },
- customMerge: function(defaultConfig, userConfig) { // 自定义默认配置和用户配置的合并规则,不设置的情况侠会对默认配置和用户配置进行深度合并
- // defaudltConfig 默认配置
- // userConfig 用户配置
- return Object.assign(defaultConfig, userConfig)
- }
-})
-
-
-// 以如下配置为例
-// {
-// "tokenExpiresIn": 7200,
-// "passwordErrorLimit": 6,
-// "bindTokenToDevice": false,
-// "passwordErrorRetryTime": 3600,
-// "app-plus": {
-// "tokenExpiresIn": 2592000
-// },
-// "service": {
-// "sms": {
-// "codeExpiresIn": 300
-// }
-// }
-// }
-
-// 获取配置
-uniIdConfig.config() // 获取全部配置,注意:uni-config-center内不存在对应插件目录时会返回空对象
-uniIdConfig.config('tokenExpiresIn') // 指定键值获取配置,返回:7200
-uniIdConfig.config('service.sms.codeExpiresIn') // 指定键值获取配置,返回:300
-uniIdConfig.config('tokenExpiresThreshold', 600) // 指定键值获取配置,如果不存在则取传入的默认值,返回:600
-
-// 获取文件绝对路径
-uniIdConfig.resolve('custom-token.js') // 获取uni-config-center/uni-id/custom-token.js文件的路径
-
-// 引用文件(require)
-uniIDConfig.requireFile('custom-token.js') // 使用require方式引用uni-config-center/uni-id/custom-token.js文件。文件不存在时返回undefined,文件内有其他错误导致require失败时会抛出错误。
-
-// 判断是否包含某文件
-uniIDConfig.hasFile('custom-token.js') // 配置目录是否包含某文件,true: 文件存在,false: 文件不存在
+# 为什么使用uni-config-center
+
+实际开发中很多插件需要配置文件才可以正常运行,如果每个插件都单独进行配置的话就会产生下面这样的目录结构
+
+```bash
+cloudfunctions
+└─────common 公共模块
+ ├─plugin-a // 插件A对应的目录
+ │ ├─index.js
+ │ ├─config.json // plugin-a对应的配置文件
+ │ └─other-file.cert // plugin-a依赖的其他文件
+ └─plugin-b // plugin-b对应的目录
+ ├─index.js
+ └─config.json // plugin-b对应的配置文件
+```
+
+假设插件作者要发布一个项目模板,里面使用了很多需要配置的插件,无论是作者发布还是用户使用都是一个大麻烦。
+
+uni-config-center就是用了统一管理这些配置文件的,使用uni-config-center后的目录结构如下
+
+```bash
+cloudfunctions
+└─────common 公共模块
+ ├─plugin-a // 插件A对应的目录
+ │ └─index.js
+ ├─plugin-b // plugin-b对应的目录
+ │ └─index.js
+ └─uni-config-center
+ ├─index.js // config-center入口文件
+ ├─plugin-a
+ │ ├─config.json // plugin-a对应的配置文件
+ │ └─other-file.cert // plugin-a依赖的其他文件
+ └─plugin-b
+ └─config.json // plugin-b对应的配置文件
+```
+
+使用uni-config-center后的优势
+
+- 配置文件统一管理,分离插件主体和配置信息,更新插件更方便
+- 支持对config.json设置schema,插件使用者在HBuilderX内编写config.json文件时会有更好的提示(后续HBuilderX会提供支持)
+
+# 用法
+
+在要使用uni-config-center的公共模块或云函数内引入uni-config-center依赖,请参考:[使用公共模块](https://uniapp.dcloud.net.cn/uniCloud/cf-common)
+
+```js
+const createConfig = require('uni-config-center')
+
+const uniIdConfig = createConfig({
+ pluginId: 'uni-id', // 插件id
+ defaultConfig: { // 默认配置
+ tokenExpiresIn: 7200,
+ tokenExpiresThreshold: 600,
+ },
+ customMerge: function(defaultConfig, userConfig) { // 自定义默认配置和用户配置的合并规则,不设置的情况侠会对默认配置和用户配置进行深度合并
+ // defaudltConfig 默认配置
+ // userConfig 用户配置
+ return Object.assign(defaultConfig, userConfig)
+ }
+})
+
+
+// 以如下配置为例
+// {
+// "tokenExpiresIn": 7200,
+// "passwordErrorLimit": 6,
+// "bindTokenToDevice": false,
+// "passwordErrorRetryTime": 3600,
+// "app-plus": {
+// "tokenExpiresIn": 2592000
+// },
+// "service": {
+// "sms": {
+// "codeExpiresIn": 300
+// }
+// }
+// }
+
+// 获取配置
+uniIdConfig.config() // 获取全部配置,注意:uni-config-center内不存在对应插件目录时会返回空对象
+uniIdConfig.config('tokenExpiresIn') // 指定键值获取配置,返回:7200
+uniIdConfig.config('service.sms.codeExpiresIn') // 指定键值获取配置,返回:300
+uniIdConfig.config('tokenExpiresThreshold', 600) // 指定键值获取配置,如果不存在则取传入的默认值,返回:600
+
+// 获取文件绝对路径
+uniIdConfig.resolve('custom-token.js') // 获取uni-config-center/uni-id/custom-token.js文件的路径
+
+// 引用文件(require)
+uniIDConfig.requireFile('custom-token.js') // 使用require方式引用uni-config-center/uni-id/custom-token.js文件。文件不存在时返回undefined,文件内有其他错误导致require失败时会抛出错误。
+
+// 判断是否包含某文件
+uniIDConfig.hasFile('custom-token.js') // 配置目录是否包含某文件,true: 文件存在,false: 文件不存在
```
\ No newline at end of file
diff --git a/uni_modules/uni-countdown/components/uni-countdown/i18n/en.json b/uni_modules/uni-countdown/components/uni-countdown/i18n/en.json
index 06309cb0ffe8f4fb60088b19176407b80e5174dc..c18587cf05f4b77e3fc77294904c7481f2f2c174 100644
--- a/uni_modules/uni-countdown/components/uni-countdown/i18n/en.json
+++ b/uni_modules/uni-countdown/components/uni-countdown/i18n/en.json
@@ -1,6 +1,6 @@
-{
- "uni-countdown.day": "day",
- "uni-countdown.h": "h",
- "uni-countdown.m": "m",
- "uni-countdown.s": "s"
+{
+ "uni-countdown.day": "day",
+ "uni-countdown.h": "h",
+ "uni-countdown.m": "m",
+ "uni-countdown.s": "s"
}
diff --git a/uni_modules/uni-countdown/components/uni-countdown/i18n/index.js b/uni_modules/uni-countdown/components/uni-countdown/i18n/index.js
index de7509c87ba5197b9f5d20ca94a0558c7a8e08a9..fa8f0f3734de6effb137592fce6c0f722c048432 100644
--- a/uni_modules/uni-countdown/components/uni-countdown/i18n/index.js
+++ b/uni_modules/uni-countdown/components/uni-countdown/i18n/index.js
@@ -1,8 +1,8 @@
-import en from './en.json'
-import zhHans from './zh-Hans.json'
-import zhHant from './zh-Hant.json'
-export default {
- en,
- 'zh-Hans': zhHans,
- 'zh-Hant': zhHant
+import en from './en.json'
+import zhHans from './zh-Hans.json'
+import zhHant from './zh-Hant.json'
+export default {
+ en,
+ 'zh-Hans': zhHans,
+ 'zh-Hant': zhHant
}
diff --git a/uni_modules/uni-countdown/components/uni-countdown/i18n/zh-Hans.json b/uni_modules/uni-countdown/components/uni-countdown/i18n/zh-Hans.json
index 358cdd1663579dbd94007945518d5be867c19de6..c0216003fc48115f42a40cf35d09a902406b611e 100644
--- a/uni_modules/uni-countdown/components/uni-countdown/i18n/zh-Hans.json
+++ b/uni_modules/uni-countdown/components/uni-countdown/i18n/zh-Hans.json
@@ -1,6 +1,6 @@
-{
- "uni-countdown.day": "天",
- "uni-countdown.h": "时",
- "uni-countdown.m": "分",
- "uni-countdown.s": "秒"
+{
+ "uni-countdown.day": "天",
+ "uni-countdown.h": "时",
+ "uni-countdown.m": "分",
+ "uni-countdown.s": "秒"
}
diff --git a/uni_modules/uni-countdown/components/uni-countdown/i18n/zh-Hant.json b/uni_modules/uni-countdown/components/uni-countdown/i18n/zh-Hant.json
index e5a63deabaad8ea6933a66b8ffd320b1520b2e29..3f153c7716a8ecc12ab35dc0fa6df26ce9a49e8f 100644
--- a/uni_modules/uni-countdown/components/uni-countdown/i18n/zh-Hant.json
+++ b/uni_modules/uni-countdown/components/uni-countdown/i18n/zh-Hant.json
@@ -1,6 +1,6 @@
-{
- "uni-countdown.day": "天",
- "uni-countdown.h": "時",
- "uni-countdown.m": "分",
- "uni-countdown.s": "秒"
+{
+ "uni-countdown.day": "天",
+ "uni-countdown.h": "時",
+ "uni-countdown.m": "分",
+ "uni-countdown.s": "秒"
}
diff --git a/uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue b/uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue
index 3597e5c9ee6aeaacb63194917e3e5fe8ac3f5da3..1f916bd5e8ac788c749b0f8882bd69fc7e31dd86 100644
--- a/uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue
+++ b/uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue
@@ -1,260 +1,260 @@
-
-
- {{ d }}
- {{dayText}}
- {{ h }}
- {{ showColon ? ':' : hourText }}
- {{ i }}
- {{ showColon ? ':' : minuteText }}
- {{ s }}
- {{secondText}}
-
-
-
-
+
+
+ {{ d }}
+ {{dayText}}
+ {{ h }}
+ {{ showColon ? ':' : hourText }}
+ {{ i }}
+ {{ showColon ? ':' : minuteText }}
+ {{ s }}
+ {{secondText}}
+
+
+
+
diff --git a/uni_modules/uni-data-checkbox/changelog.md b/uni_modules/uni-data-checkbox/changelog.md
index cda4c3bb86d5c1c6d9fcbef053aba73d1710c369..47e9f4c23dc963643fed6b72abda998b61656360 100644
--- a/uni_modules/uni-data-checkbox/changelog.md
+++ b/uni_modules/uni-data-checkbox/changelog.md
@@ -2,35 +2,35 @@
- 修复 在uni-forms中 modelValue 中不存在当前字段,当前字段必填写也不参与校验的问题
## 0.2.4(2021-08-17)
- 修复 单选 list 模式下 ,icon 为 left 时,选中图标不显示的问题
-## 0.2.3(2021-08-11)
-- 修复 在 uni-forms 中重置表单,错误信息无法清除的问题
-## 0.2.2(2021-07-30)
-- 优化 在uni-forms组件,与label不对齐的问题
-## 0.2.1(2021-07-27)
-- 修复 单选默认值为0不能选中的Bug
-## 0.2.0(2021-07-13)
-- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 0.1.11(2021-07-06)
-- 优化 删除无用日志
-## 0.1.10(2021-07-05)
-- 修复 由 0.1.9 引起的非 nvue 端图标不显示的问题
-## 0.1.9(2021-07-05)
-- 修复 nvue 黑框样式问题
-## 0.1.8(2021-06-28)
-- 修复 selectedTextColor 属性不生效的Bug
-## 0.1.7(2021-06-02)
-- 新增 map 属性,可以方便映射text/value属性
-## 0.1.6(2021-05-26)
-- 修复 不关联服务空间的情况下组件报错的Bug
-## 0.1.5(2021-05-12)
-- 新增 组件示例地址
-## 0.1.4(2021-04-09)
-- 修复 nvue 下无法选中的问题
-## 0.1.3(2021-03-22)
-- 新增 disabled属性
-## 0.1.2(2021-02-24)
-- 优化 默认颜色显示
-## 0.1.1(2021-02-24)
-- 新增 支持nvue
-## 0.1.0(2021-02-18)
-- “暂无数据”显示居中
+## 0.2.3(2021-08-11)
+- 修复 在 uni-forms 中重置表单,错误信息无法清除的问题
+## 0.2.2(2021-07-30)
+- 优化 在uni-forms组件,与label不对齐的问题
+## 0.2.1(2021-07-27)
+- 修复 单选默认值为0不能选中的Bug
+## 0.2.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 0.1.11(2021-07-06)
+- 优化 删除无用日志
+## 0.1.10(2021-07-05)
+- 修复 由 0.1.9 引起的非 nvue 端图标不显示的问题
+## 0.1.9(2021-07-05)
+- 修复 nvue 黑框样式问题
+## 0.1.8(2021-06-28)
+- 修复 selectedTextColor 属性不生效的Bug
+## 0.1.7(2021-06-02)
+- 新增 map 属性,可以方便映射text/value属性
+## 0.1.6(2021-05-26)
+- 修复 不关联服务空间的情况下组件报错的Bug
+## 0.1.5(2021-05-12)
+- 新增 组件示例地址
+## 0.1.4(2021-04-09)
+- 修复 nvue 下无法选中的问题
+## 0.1.3(2021-03-22)
+- 新增 disabled属性
+## 0.1.2(2021-02-24)
+- 优化 默认颜色显示
+## 0.1.1(2021-02-24)
+- 新增 支持nvue
+## 0.1.0(2021-02-18)
+- “暂无数据”显示居中
diff --git a/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue b/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue
index 71dd59b1565ef1af6f3e7f471b29d2a9b7a5e1b7..7d3d52ece4b778e5521347aeaa737bb16aef5d90 100644
--- a/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue
+++ b/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue
@@ -1,823 +1,823 @@
-
-
-
-
-
- {{mixinDatacomErrorMessage}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ }
+ this.rename = this.formItem.name
+ this.form.inputChildrens.push(this)
+ }
+ }
+
+ if (this.localdata && this.localdata.length !== 0) {
+ this.isLocal = true
+ this.range = this.localdata
+ this.dataList = this.getDataList(this.getSelectedValue(this.range))
+ } else {
+ if (this.collection) {
+ this.isLocal = false
+ this.loadData()
+ }
+ }
+ },
+ methods: {
+ loadData() {
+ this.mixinDatacomGet().then(res=>{
+ this.mixinDatacomResData = res.result.data
+ if(this.mixinDatacomResData.length === 0){
+ this.isLocal = false
+ this.mixinDatacomErrorMessage = this.emptyText
+ }else{
+ this.isLocal = true
+ }
+ }).catch(err=>{
+ this.mixinDatacomErrorMessage = err.message
+ })
+ },
+ /**
+ * 获取父元素实例
+ */
+ getForm(name = 'uniForms') {
+ let parent = this.$parent;
+ let parentName = parent.$options.name;
+ while (parentName !== name) {
+ parent = parent.$parent;
+ if (!parent) return false
+ parentName = parent.$options.name;
+ }
+ return parent;
+ },
+ chagne(e) {
+ const values = e.detail.value
+
+ let detail = {
+ value: [],
+ data: []
+ }
+
+ if (this.multiple) {
+ this.range.forEach(item => {
+
+ if (values.includes(item[this.map.value] + '')) {
+ detail.value.push(item[this.map.value])
+ detail.data.push(item)
+ }
+ })
+ } else {
+ const range = this.range.find(item => (item[this.map.value] + '') === values)
+ if (range) {
+ detail = {
+ value: range[this.map.value],
+ data: range
+ }
+ }
+ }
+ this.formItem && this.formItem.setValue(detail.value)
+ // TODO 兼容 vue2
+ this.$emit('input', detail.value);
+ // // TOTO 兼容 vue3
+ this.$emit('update:modelValue', detail.value);
+ this.$emit('change', {
+ detail
+ })
+ if (this.multiple) {
+ // 如果 v-model 没有绑定 ,则走内部逻辑
+ // if (this.value.length === 0) {
+ this.dataList = this.getDataList(detail.value, true)
+ // }
+ } else {
+ this.dataList = this.getDataList(detail.value)
+ }
+ },
+
+ /**
+ * 获取渲染的新数组
+ * @param {Object} value 选中内容
+ */
+ getDataList(value) {
+ // 解除引用关系,破坏原引用关系,避免污染源数据
+ let dataList = JSON.parse(JSON.stringify(this.range))
+ let list = []
+ if (this.multiple) {
+ if (!Array.isArray(value)) {
+ value = []
+ }
+ }
+ dataList.forEach((item, index) => {
+ item.disabled = item.disable || item.disabled || false
+ if (this.multiple) {
+ if (value.length > 0) {
+ let have = value.find(val => val === item[this.map.value])
+ item.selected = have !== undefined
+ } else {
+ item.selected = false
+ }
+ } else {
+ item.selected = value === item[this.map.value]
+ }
+
+ list.push(item)
+ })
+ return this.setRange(list)
+ },
+ /**
+ * 处理最大最小值
+ * @param {Object} list
+ */
+ setRange(list) {
+ let selectList = list.filter(item => item.selected)
+ let min = Number(this.min) || 0
+ let max = Number(this.max) || ''
+ list.forEach((item, index) => {
+ if (this.multiple) {
+ if (selectList.length <= min) {
+ let have = selectList.find(val => val[this.map.value] === item[this.map.value])
+ if (have !== undefined) {
+ item.disabled = true
+ }
+ }
+
+ if (selectList.length >= max && max !== '') {
+ let have = selectList.find(val => val[this.map.value] === item[this.map.value])
+ if (have === undefined) {
+ item.disabled = true
+ }
+ }
+ }
+ this.setStyles(item, index)
+ list[index] = item
+ })
+ return list
+ },
+ /**
+ * 设置 class
+ * @param {Object} item
+ * @param {Object} index
+ */
+ setStyles(item, index) {
+ // 设置自定义样式
+ item.styleBackgroud = this.setStyleBackgroud(item)
+ item.styleIcon = this.setStyleIcon(item)
+ item.styleIconText = this.setStyleIconText(item)
+ item.styleRightIcon = this.setStyleRightIcon(item)
+ },
+
+ /**
+ * 获取选中值
+ * @param {Object} range
+ */
+ getSelectedValue(range) {
+ if (!this.multiple) return this.dataValue
+ let selectedArr = []
+ range.forEach((item) => {
+ if (item.selected) {
+ selectedArr.push(item[this.map.value])
+ }
+ })
+ return this.dataValue.length > 0 ? this.dataValue : selectedArr
+ },
+
+ /**
+ * 设置背景样式
+ */
+ setStyleBackgroud(item) {
+ let styles = {}
+ let selectedColor = this.selectedColor?this.selectedColor:'#007aff'
+ if (this.mode !== 'list') {
+ styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
+ }
+ if (this.mode === 'tag') {
+ styles['background-color'] = item.selected? selectedColor:'#f5f5f5'
+ }
+ let classles = ''
+ for (let i in styles) {
+ classles += `${i}:${styles[i]};`
+ }
+ return classles
+ },
+ setStyleIcon(item) {
+ let styles = {}
+ let classles = ''
+ let selectedColor = this.selectedColor?this.selectedColor:'#007aff'
+ styles['background-color'] = item.selected?selectedColor:'#fff'
+ styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
+
+ if(!item.selected && item.disabled){
+ styles['background-color'] = '#F2F6FC'
+ styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
+ }
+
+ for (let i in styles) {
+ classles += `${i}:${styles[i]};`
+ }
+ return classles
+ },
+ setStyleIconText(item) {
+ let styles = {}
+ let classles = ''
+ let selectedColor = this.selectedColor?this.selectedColor:'#007aff'
+ if (this.mode === 'tag') {
+ styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:'#fff'):'#333'
+ } else {
+ styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:selectedColor):'#333'
+ }
+ if(!item.selected && item.disabled){
+ styles.color = '#999'
+ }
+
+ for (let i in styles) {
+ classles += `${i}:${styles[i]};`
+ }
+ return classles
+ },
+ setStyleRightIcon(item) {
+ let styles = {}
+ let classles = ''
+ if (this.mode === 'list') {
+ styles['border-color'] = item.selected?this.styles.selectedColor:'#DCDFE6'
+ }
+ for (let i in styles) {
+ classles += `${i}:${styles[i]};`
+ }
+
+ return classles
+ }
+ }
+ }
+
+
+
diff --git a/uni_modules/uni-data-checkbox/package.json b/uni_modules/uni-data-checkbox/package.json
index e978c4ef01fb640948e16c975851c3ba92aa8ff2..245595e5030652110030c8c71e91583e385ddf71 100644
--- a/uni_modules/uni-data-checkbox/package.json
+++ b/uni_modules/uni-data-checkbox/package.json
@@ -1,87 +1,87 @@
-{
- "id": "uni-data-checkbox",
- "displayName": "uni-data-checkbox 数据选择器",
- "version": "0.2.5",
- "description": "通过数据驱动的单选框和复选框",
- "keywords": [
- "uni-ui",
- "checkbox",
- "单选",
- "多选",
- "单选多选"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": "^3.1.1"
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": ["uni-load-more"],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- },
- "Vue": {
- "vue2": "y",
- "vue3": "u"
- }
- }
- }
- }
-}
+{
+ "id": "uni-data-checkbox",
+ "displayName": "uni-data-checkbox 数据选择器",
+ "version": "0.2.5",
+ "description": "通过数据驱动的单选框和复选框",
+ "keywords": [
+ "uni-ui",
+ "checkbox",
+ "单选",
+ "多选",
+ "单选多选"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": "^3.1.1"
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": ["uni-load-more"],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "u"
+ }
+ }
+ }
+ }
+}
diff --git a/uni_modules/uni-data-picker/changelog.md b/uni_modules/uni-data-picker/changelog.md
index 269cedcf404c41523691bb7cfeaba22730bcc736..a7489f55d0581cedfaa27e224f65cb2e5eb2f321 100644
--- a/uni_modules/uni-data-picker/changelog.md
+++ b/uni_modules/uni-data-picker/changelog.md
@@ -1,25 +1,25 @@
## 0.4.0(2021-07-13)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 0.3.5(2021-06-04)
-- 修复 无法加载云端数据的问题
-## 0.3.4(2021-05-28)
-- 修复 v-model无效问题
-- 修复 loaddata 为空数据组时加载时间过长问题
-- 修复 上个版本引出的本地数据无法选择带有children的2级节点
-## 0.3.3(2021-05-12)
-- 新增 组件示例地址
-## 0.3.2(2021-04-22)
-- 修复 非树形数据有 where 属性查询报错的问题
-## 0.3.1(2021-04-15)
-- 修复 本地数据概率无法回显时问题
-## 0.3.0(2021-04-07)
-- 新增 支持云端非树形表结构数据
-- 修复 根节点 parent_field 字段等于null时选择界面错乱问题
-## 0.2.0(2021-03-15)
-- 修复 nodeclick、popupopened、popupclosed事件无法触发的问题
-## 0.1.9(2021-03-09)
-- 修复 微信小程序某些情况下无法选择的问题
-## 0.1.8(2021-02-05)
-- 优化 部分样式在nvue上的兼容表现
-## 0.1.7(2021-02-05)
-- 调整为uni_modules目录规范
+## 0.3.5(2021-06-04)
+- 修复 无法加载云端数据的问题
+## 0.3.4(2021-05-28)
+- 修复 v-model无效问题
+- 修复 loaddata 为空数据组时加载时间过长问题
+- 修复 上个版本引出的本地数据无法选择带有children的2级节点
+## 0.3.3(2021-05-12)
+- 新增 组件示例地址
+## 0.3.2(2021-04-22)
+- 修复 非树形数据有 where 属性查询报错的问题
+## 0.3.1(2021-04-15)
+- 修复 本地数据概率无法回显时问题
+## 0.3.0(2021-04-07)
+- 新增 支持云端非树形表结构数据
+- 修复 根节点 parent_field 字段等于null时选择界面错乱问题
+## 0.2.0(2021-03-15)
+- 修复 nodeclick、popupopened、popupclosed事件无法触发的问题
+## 0.1.9(2021-03-09)
+- 修复 微信小程序某些情况下无法选择的问题
+## 0.1.8(2021-02-05)
+- 优化 部分样式在nvue上的兼容表现
+## 0.1.7(2021-02-05)
+- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-data-picker/components/uni-data-picker/keypress.js b/uni_modules/uni-data-picker/components/uni-data-picker/keypress.js
index 6ef26a26211ff28976e6fc835fbef5d2ea5b5b1e..a747b9fc8c0d3df87adc4e7ffa380beef7f42cbe 100644
--- a/uni_modules/uni-data-picker/components/uni-data-picker/keypress.js
+++ b/uni_modules/uni-data-picker/components/uni-data-picker/keypress.js
@@ -1,45 +1,45 @@
-// #ifdef H5
-export default {
- name: 'Keypress',
- props: {
- disable: {
- type: Boolean,
- default: false
- }
- },
- mounted () {
- const keyNames = {
- esc: ['Esc', 'Escape'],
- tab: 'Tab',
- enter: 'Enter',
- space: [' ', 'Spacebar'],
- up: ['Up', 'ArrowUp'],
- left: ['Left', 'ArrowLeft'],
- right: ['Right', 'ArrowRight'],
- down: ['Down', 'ArrowDown'],
- delete: ['Backspace', 'Delete', 'Del']
- }
- const listener = ($event) => {
- if (this.disable) {
- return
- }
- const keyName = Object.keys(keyNames).find(key => {
- const keyName = $event.key
- const value = keyNames[key]
- return value === keyName || (Array.isArray(value) && value.includes(keyName))
- })
- if (keyName) {
- // 避免和其他按键事件冲突
- setTimeout(() => {
- this.$emit(keyName, {})
- }, 0)
- }
- }
- document.addEventListener('keyup', listener)
- this.$once('hook:beforeDestroy', () => {
- document.removeEventListener('keyup', listener)
- })
- },
- render: () => {}
-}
-// #endif
+// #ifdef H5
+export default {
+ name: 'Keypress',
+ props: {
+ disable: {
+ type: Boolean,
+ default: false
+ }
+ },
+ mounted () {
+ const keyNames = {
+ esc: ['Esc', 'Escape'],
+ tab: 'Tab',
+ enter: 'Enter',
+ space: [' ', 'Spacebar'],
+ up: ['Up', 'ArrowUp'],
+ left: ['Left', 'ArrowLeft'],
+ right: ['Right', 'ArrowRight'],
+ down: ['Down', 'ArrowDown'],
+ delete: ['Backspace', 'Delete', 'Del']
+ }
+ const listener = ($event) => {
+ if (this.disable) {
+ return
+ }
+ const keyName = Object.keys(keyNames).find(key => {
+ const keyName = $event.key
+ const value = keyNames[key]
+ return value === keyName || (Array.isArray(value) && value.includes(keyName))
+ })
+ if (keyName) {
+ // 避免和其他按键事件冲突
+ setTimeout(() => {
+ this.$emit(keyName, {})
+ }, 0)
+ }
+ }
+ document.addEventListener('keyup', listener)
+ this.$once('hook:beforeDestroy', () => {
+ document.removeEventListener('keyup', listener)
+ })
+ },
+ render: () => {}
+}
+// #endif
diff --git a/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue b/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue
index fced5ecd14dd65cb4797444d337056f93514b60a..897143afc82162826dc21bc280764780cbde69d2 100644
--- a/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue
+++ b/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue
@@ -1,472 +1,472 @@
-
-
-
-
-
- {{errorMessage}}
-
-
-
-
-
-
- {{item.text}}{{split}}
-
-
-
- {{placeholder}}
-
-
-
-
-
-
-
-
-
-
- {{popupTitle}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js b/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js
index bb285009fc728adbb77ee0efb4f8fe65cf0a50a4..51bbc5863bf3579c072bf11799f09957e7d0d0c5 100644
--- a/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js
+++ b/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js
@@ -1,545 +1,545 @@
-export default {
- props: {
- localdata: {
- type: [Array, Object],
- default () {
- return []
- }
- },
- collection: {
- type: String,
- default: ''
- },
- action: {
- type: String,
- default: ''
- },
- field: {
- type: String,
- default: ''
- },
- orderby: {
- type: String,
- default: ''
- },
- where: {
- type: [String, Object],
- default: ''
- },
- pageData: {
- type: String,
- default: 'add'
- },
- pageCurrent: {
- type: Number,
- default: 1
- },
- pageSize: {
- type: Number,
- default: 20
- },
- getcount: {
- type: [Boolean, String],
- default: false
- },
- getone: {
- type: [Boolean, String],
- default: false
- },
- gettree: {
- type: [Boolean, String],
- default: false
- },
- manual: {
- type: Boolean,
- default: false
- },
- value: {
- type: [Array, String, Number],
- default () {
- return []
- }
- },
- modelValue: {
- type: [Array, String, Number],
- default () {
- return []
- }
- },
- preload: {
- type: Boolean,
- default: false
- },
- stepSearh: {
- type: Boolean,
- default: true
- },
- selfField: {
- type: String,
- default: ''
- },
- parentField: {
- type: String,
- default: ''
- },
- multiple: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {
- loading: false,
- errorMessage: '',
- loadMore: {
- contentdown: '',
- contentrefresh: '',
- contentnomore: ''
- },
- dataList: [],
- selected: [],
- selectedIndex: 0,
- page: {
- current: this.pageCurrent,
- size: this.pageSize,
- count: 0
- }
- }
- },
- computed: {
- isLocaldata() {
- return !this.collection.length
- },
- postField() {
- let fields = [this.field];
- if (this.parentField) {
- fields.push(`${this.parentField} as parent_value`);
- }
- return fields.join(',');
- },
- dataValue(){
- let isarr = Array.isArray(this.value) && this.value.length === 0
- let isstr = typeof this.value === 'string' && !this.value
- let isnum = typeof this.value === 'number' && !this.value
-
- if(isarr || isstr || isnum){
- return this.modelValue
- }
-
- return this.value
- }
- },
- created() {
- this.$watch(() => {
- var al = [];
- ['pageCurrent',
- 'pageSize',
- 'value',
- 'modelValue',
- 'localdata',
- 'collection',
- 'action',
- 'field',
- 'orderby',
- 'where',
- 'getont',
- 'getcount',
- 'gettree'
- ].forEach(key => {
- al.push(this[key])
- });
- return al
- }, (newValue, oldValue) => {
- let needReset = false
- for (let i = 2; i < newValue.length; i++) {
- if (newValue[i] != oldValue[i]) {
- needReset = true
- break
- }
- }
- if (newValue[0] != oldValue[0]) {
- this.page.current = this.pageCurrent
- }
- this.page.size = this.pageSize
-
- this.onPropsChange()
- })
- this._treeData = []
- },
- methods: {
- onPropsChange() {
- this._treeData = []
- },
- getCommand(options = {}) {
- /* eslint-disable no-undef */
- let db = uniCloud.database()
-
- const action = options.action || this.action
- if (action) {
- db = db.action(action)
- }
-
- const collection = options.collection || this.collection
- db = db.collection(collection)
-
- const where = options.where || this.where
- if (!(!where || !Object.keys(where).length)) {
- db = db.where(where)
- }
-
- const field = options.field || this.field
- if (field) {
- db = db.field(field)
- }
-
- const orderby = options.orderby || this.orderby
- if (orderby) {
- db = db.orderBy(orderby)
- }
-
- const current = options.pageCurrent !== undefined ? options.pageCurrent : this.page.current
- const size = options.pageSize !== undefined ? options.pageSize : this.page.size
- const getCount = options.getcount !== undefined ? options.getcount : this.getcount
- const getTree = options.gettree !== undefined ? options.gettree : this.gettree
-
- const getOptions = {
- getCount,
- getTree
- }
- if (options.getTreePath) {
- getOptions.getTreePath = options.getTreePath
- }
-
- db = db.skip(size * (current - 1)).limit(size).get(getOptions)
-
- return db
- },
- getNodeData(callback) {
- if (this.loading) {
- return
- }
- this.loading = true
- this.getCommand({
- field: this.postField,
- where: this._pathWhere()
- }).then((res) => {
- this.loading = false
- this.selected = res.result.data
- callback && callback()
- }).catch((err) => {
- this.loading = false
- this.errorMessage = err
- })
- },
- getTreePath(callback) {
- if (this.loading) {
- return
- }
- this.loading = true
-
- this.getCommand({
- field: this.postField,
- getTreePath: {
- startWith: `${this.selfField}=='${this.dataValue}'`
- }
- }).then((res) => {
- this.loading = false
- let treePath = []
- this._extractTreePath(res.result.data, treePath)
- this.selected = treePath
- callback && callback()
- }).catch((err) => {
- this.loading = false
- this.errorMessage = err
- })
- },
- loadData() {
- if (this.isLocaldata) {
- this._processLocalData()
- return
- }
-
- if (this.dataValue.length) {
- this._loadNodeData((data) => {
- this._treeData = data
- this._updateBindData()
- this._updateSelected()
- })
- return
- }
-
- if (this.stepSearh) {
- this._loadNodeData((data) => {
- this._treeData = data
- this._updateBindData()
- })
- } else {
- this._loadAllData((data) => {
- this._treeData = []
- this._extractTree(data, this._treeData, null)
- this._updateBindData()
- })
- }
- },
- _loadAllData(callback) {
- if (this.loading) {
- return
- }
- this.loading = true
-
- this.getCommand({
- field: this.postField,
- gettree: true,
- startwith: `${this.selfField}=='${this.dataValue}'`
- }).then((res) => {
- this.loading = false
- callback(res.result.data)
- this.onDataChange()
- }).catch((err) => {
- this.loading = false
- this.errorMessage = err
- })
- },
- _loadNodeData(callback, pw) {
- if (this.loading) {
- return
- }
- this.loading = true
-
- this.getCommand({
- field: this.postField,
- where: pw || this._postWhere(),
- pageSize: 500
- }).then((res) => {
- this.loading = false
- callback(res.result.data)
- this.onDataChange()
- }).catch((err) => {
- this.loading = false
- this.errorMessage = err
- })
- },
- _pathWhere() {
- let result = []
- let where_field = this._getParentNameByField();
- if (where_field) {
- result.push(`${where_field} == '${this.dataValue}'`)
- }
-
- if (this.where) {
- return `(${this.where}) && (${result.join(' || ')})`
- }
-
- return result.join(' || ')
- },
- _postWhere() {
- let result = []
- let selected = this.selected
- let parentField = this.parentField
- if (parentField) {
- result.push(`${parentField} == null || ${parentField} == ""`)
- }
- if (selected.length) {
- for (var i = 0; i < selected.length - 1; i++) {
- result.push(`${parentField} == '${selected[i].value}'`)
- }
- }
-
- let where = []
- if (this.where) {
- where.push(`(${this.where})`)
- }
- if (result.length) {
- where.push(`(${result.join(' || ')})`)
- }
-
- return where.join(' && ')
- },
- _nodeWhere() {
- let result = []
- let selected = this.selected
- if (selected.length) {
- result.push(`${this.parentField} == '${selected[selected.length - 1].value}'`)
- }
-
- if (this.where) {
- return `(${this.where}) && (${result.join(' || ')})`
- }
-
- return result.join(' || ')
- },
- _getParentNameByField() {
- const fields = this.field.split(',');
- let where_field = null;
- for (let i = 0; i < fields.length; i++) {
- const items = fields[i].split('as');
- if (items.length < 2) {
- continue;
- }
- if (items[1].trim() === 'value') {
- where_field = items[0].trim();
- break;
- }
- }
- return where_field
- },
- _isTreeView() {
- return (this.parentField && this.selfField)
- },
- _updateSelected() {
- var dl = this.dataList
- var sl = this.selected
- for (var i = 0; i < sl.length; i++) {
- var value = sl[i].value
- var dl2 = dl[i]
- for (var j = 0; j < dl2.length; j++) {
- var item2 = dl2[j]
- if (item2.value === value) {
- sl[i].text = item2.text
- break
- }
- }
- }
- },
- _updateBindData(node) {
- const {
- dataList,
- hasNodes
- } = this._filterData(this._treeData, this.selected)
-
- let isleaf = this._stepSearh === false && !hasNodes
-
- if (node) {
- node.isleaf = isleaf
- }
-
- this.dataList = dataList
- this.selectedIndex = dataList.length - 1
-
- if (!isleaf && this.selected.length < dataList.length) {
- this.selected.push({
- value: null,
- text: "请选择"
- })
- }
-
- return {
- isleaf,
- hasNodes
- }
- },
- _filterData(data, paths) {
- let dataList = []
-
- let hasNodes = true
-
- dataList.push(data.filter((item) => {
- return item.parent_value === undefined
- }))
- for (let i = 0; i < paths.length; i++) {
- var value = paths[i].value
- var nodes = data.filter((item) => {
- return item.parent_value === value
- })
-
- if (nodes.length) {
- dataList.push(nodes)
- } else {
- hasNodes = false
- }
- }
-
- return {
- dataList,
- hasNodes
- }
- },
- _extractTree(nodes, result, parent_value) {
- let list = result || []
- for (let i = 0; i < nodes.length; i++) {
- let node = nodes[i]
-
- let child = {}
- for (let key in node) {
- if (key !== 'children') {
- child[key] = node[key]
- }
- }
- if (parent_value !== undefined) {
- child.parent_value = parent_value
- }
- result.push(child)
-
- let children = node.children
- if (children) {
- this._extractTree(children, result, node.value)
- }
- }
- },
- _extractTreePath(nodes, result) {
- let list = result || []
- for (let i = 0; i < nodes.length; i++) {
- let node = nodes[i]
-
- let child = {}
- for (let key in node) {
- if (key !== 'children') {
- child[key] = node[key]
- }
- }
- result.push(child)
-
- let children = node.children
- if (children) {
- this._extractTreePath(children, result)
- }
- }
- },
- _findNodePath(key, nodes, path = []) {
- for (let i = 0; i < nodes.length; i++) {
- let {
- value,
- text,
- children
- } = nodes[i]
-
- path.push({
- value,
- text
- })
-
- if (value === key) {
- return path
- }
-
- if (children) {
- const p = this._findNodePath(key, children, path)
- if (p.length) {
- return p
- }
- }
-
- path.pop()
- }
- return []
- },
- _processLocalData() {
- this._treeData = []
- this._extractTree(this.localdata, this._treeData)
-
- var inputValue = this.dataValue
- if (inputValue === undefined) {
- return
- }
-
- if (Array.isArray(inputValue)) {
- inputValue = inputValue[inputValue.length - 1]
- if (typeof inputValue === 'object' && inputValue.value) {
- inputValue = inputValue.value
- }
- }
-
- this.selected = this._findNodePath(inputValue, this.localdata)
- }
- }
-}
+export default {
+ props: {
+ localdata: {
+ type: [Array, Object],
+ default () {
+ return []
+ }
+ },
+ collection: {
+ type: String,
+ default: ''
+ },
+ action: {
+ type: String,
+ default: ''
+ },
+ field: {
+ type: String,
+ default: ''
+ },
+ orderby: {
+ type: String,
+ default: ''
+ },
+ where: {
+ type: [String, Object],
+ default: ''
+ },
+ pageData: {
+ type: String,
+ default: 'add'
+ },
+ pageCurrent: {
+ type: Number,
+ default: 1
+ },
+ pageSize: {
+ type: Number,
+ default: 20
+ },
+ getcount: {
+ type: [Boolean, String],
+ default: false
+ },
+ getone: {
+ type: [Boolean, String],
+ default: false
+ },
+ gettree: {
+ type: [Boolean, String],
+ default: false
+ },
+ manual: {
+ type: Boolean,
+ default: false
+ },
+ value: {
+ type: [Array, String, Number],
+ default () {
+ return []
+ }
+ },
+ modelValue: {
+ type: [Array, String, Number],
+ default () {
+ return []
+ }
+ },
+ preload: {
+ type: Boolean,
+ default: false
+ },
+ stepSearh: {
+ type: Boolean,
+ default: true
+ },
+ selfField: {
+ type: String,
+ default: ''
+ },
+ parentField: {
+ type: String,
+ default: ''
+ },
+ multiple: {
+ type: Boolean,
+ default: false
+ }
+ },
+ data() {
+ return {
+ loading: false,
+ errorMessage: '',
+ loadMore: {
+ contentdown: '',
+ contentrefresh: '',
+ contentnomore: ''
+ },
+ dataList: [],
+ selected: [],
+ selectedIndex: 0,
+ page: {
+ current: this.pageCurrent,
+ size: this.pageSize,
+ count: 0
+ }
+ }
+ },
+ computed: {
+ isLocaldata() {
+ return !this.collection.length
+ },
+ postField() {
+ let fields = [this.field];
+ if (this.parentField) {
+ fields.push(`${this.parentField} as parent_value`);
+ }
+ return fields.join(',');
+ },
+ dataValue(){
+ let isarr = Array.isArray(this.value) && this.value.length === 0
+ let isstr = typeof this.value === 'string' && !this.value
+ let isnum = typeof this.value === 'number' && !this.value
+
+ if(isarr || isstr || isnum){
+ return this.modelValue
+ }
+
+ return this.value
+ }
+ },
+ created() {
+ this.$watch(() => {
+ var al = [];
+ ['pageCurrent',
+ 'pageSize',
+ 'value',
+ 'modelValue',
+ 'localdata',
+ 'collection',
+ 'action',
+ 'field',
+ 'orderby',
+ 'where',
+ 'getont',
+ 'getcount',
+ 'gettree'
+ ].forEach(key => {
+ al.push(this[key])
+ });
+ return al
+ }, (newValue, oldValue) => {
+ let needReset = false
+ for (let i = 2; i < newValue.length; i++) {
+ if (newValue[i] != oldValue[i]) {
+ needReset = true
+ break
+ }
+ }
+ if (newValue[0] != oldValue[0]) {
+ this.page.current = this.pageCurrent
+ }
+ this.page.size = this.pageSize
+
+ this.onPropsChange()
+ })
+ this._treeData = []
+ },
+ methods: {
+ onPropsChange() {
+ this._treeData = []
+ },
+ getCommand(options = {}) {
+ /* eslint-disable no-undef */
+ let db = uniCloud.database()
+
+ const action = options.action || this.action
+ if (action) {
+ db = db.action(action)
+ }
+
+ const collection = options.collection || this.collection
+ db = db.collection(collection)
+
+ const where = options.where || this.where
+ if (!(!where || !Object.keys(where).length)) {
+ db = db.where(where)
+ }
+
+ const field = options.field || this.field
+ if (field) {
+ db = db.field(field)
+ }
+
+ const orderby = options.orderby || this.orderby
+ if (orderby) {
+ db = db.orderBy(orderby)
+ }
+
+ const current = options.pageCurrent !== undefined ? options.pageCurrent : this.page.current
+ const size = options.pageSize !== undefined ? options.pageSize : this.page.size
+ const getCount = options.getcount !== undefined ? options.getcount : this.getcount
+ const getTree = options.gettree !== undefined ? options.gettree : this.gettree
+
+ const getOptions = {
+ getCount,
+ getTree
+ }
+ if (options.getTreePath) {
+ getOptions.getTreePath = options.getTreePath
+ }
+
+ db = db.skip(size * (current - 1)).limit(size).get(getOptions)
+
+ return db
+ },
+ getNodeData(callback) {
+ if (this.loading) {
+ return
+ }
+ this.loading = true
+ this.getCommand({
+ field: this.postField,
+ where: this._pathWhere()
+ }).then((res) => {
+ this.loading = false
+ this.selected = res.result.data
+ callback && callback()
+ }).catch((err) => {
+ this.loading = false
+ this.errorMessage = err
+ })
+ },
+ getTreePath(callback) {
+ if (this.loading) {
+ return
+ }
+ this.loading = true
+
+ this.getCommand({
+ field: this.postField,
+ getTreePath: {
+ startWith: `${this.selfField}=='${this.dataValue}'`
+ }
+ }).then((res) => {
+ this.loading = false
+ let treePath = []
+ this._extractTreePath(res.result.data, treePath)
+ this.selected = treePath
+ callback && callback()
+ }).catch((err) => {
+ this.loading = false
+ this.errorMessage = err
+ })
+ },
+ loadData() {
+ if (this.isLocaldata) {
+ this._processLocalData()
+ return
+ }
+
+ if (this.dataValue.length) {
+ this._loadNodeData((data) => {
+ this._treeData = data
+ this._updateBindData()
+ this._updateSelected()
+ })
+ return
+ }
+
+ if (this.stepSearh) {
+ this._loadNodeData((data) => {
+ this._treeData = data
+ this._updateBindData()
+ })
+ } else {
+ this._loadAllData((data) => {
+ this._treeData = []
+ this._extractTree(data, this._treeData, null)
+ this._updateBindData()
+ })
+ }
+ },
+ _loadAllData(callback) {
+ if (this.loading) {
+ return
+ }
+ this.loading = true
+
+ this.getCommand({
+ field: this.postField,
+ gettree: true,
+ startwith: `${this.selfField}=='${this.dataValue}'`
+ }).then((res) => {
+ this.loading = false
+ callback(res.result.data)
+ this.onDataChange()
+ }).catch((err) => {
+ this.loading = false
+ this.errorMessage = err
+ })
+ },
+ _loadNodeData(callback, pw) {
+ if (this.loading) {
+ return
+ }
+ this.loading = true
+
+ this.getCommand({
+ field: this.postField,
+ where: pw || this._postWhere(),
+ pageSize: 500
+ }).then((res) => {
+ this.loading = false
+ callback(res.result.data)
+ this.onDataChange()
+ }).catch((err) => {
+ this.loading = false
+ this.errorMessage = err
+ })
+ },
+ _pathWhere() {
+ let result = []
+ let where_field = this._getParentNameByField();
+ if (where_field) {
+ result.push(`${where_field} == '${this.dataValue}'`)
+ }
+
+ if (this.where) {
+ return `(${this.where}) && (${result.join(' || ')})`
+ }
+
+ return result.join(' || ')
+ },
+ _postWhere() {
+ let result = []
+ let selected = this.selected
+ let parentField = this.parentField
+ if (parentField) {
+ result.push(`${parentField} == null || ${parentField} == ""`)
+ }
+ if (selected.length) {
+ for (var i = 0; i < selected.length - 1; i++) {
+ result.push(`${parentField} == '${selected[i].value}'`)
+ }
+ }
+
+ let where = []
+ if (this.where) {
+ where.push(`(${this.where})`)
+ }
+ if (result.length) {
+ where.push(`(${result.join(' || ')})`)
+ }
+
+ return where.join(' && ')
+ },
+ _nodeWhere() {
+ let result = []
+ let selected = this.selected
+ if (selected.length) {
+ result.push(`${this.parentField} == '${selected[selected.length - 1].value}'`)
+ }
+
+ if (this.where) {
+ return `(${this.where}) && (${result.join(' || ')})`
+ }
+
+ return result.join(' || ')
+ },
+ _getParentNameByField() {
+ const fields = this.field.split(',');
+ let where_field = null;
+ for (let i = 0; i < fields.length; i++) {
+ const items = fields[i].split('as');
+ if (items.length < 2) {
+ continue;
+ }
+ if (items[1].trim() === 'value') {
+ where_field = items[0].trim();
+ break;
+ }
+ }
+ return where_field
+ },
+ _isTreeView() {
+ return (this.parentField && this.selfField)
+ },
+ _updateSelected() {
+ var dl = this.dataList
+ var sl = this.selected
+ for (var i = 0; i < sl.length; i++) {
+ var value = sl[i].value
+ var dl2 = dl[i]
+ for (var j = 0; j < dl2.length; j++) {
+ var item2 = dl2[j]
+ if (item2.value === value) {
+ sl[i].text = item2.text
+ break
+ }
+ }
+ }
+ },
+ _updateBindData(node) {
+ const {
+ dataList,
+ hasNodes
+ } = this._filterData(this._treeData, this.selected)
+
+ let isleaf = this._stepSearh === false && !hasNodes
+
+ if (node) {
+ node.isleaf = isleaf
+ }
+
+ this.dataList = dataList
+ this.selectedIndex = dataList.length - 1
+
+ if (!isleaf && this.selected.length < dataList.length) {
+ this.selected.push({
+ value: null,
+ text: "请选择"
+ })
+ }
+
+ return {
+ isleaf,
+ hasNodes
+ }
+ },
+ _filterData(data, paths) {
+ let dataList = []
+
+ let hasNodes = true
+
+ dataList.push(data.filter((item) => {
+ return item.parent_value === undefined
+ }))
+ for (let i = 0; i < paths.length; i++) {
+ var value = paths[i].value
+ var nodes = data.filter((item) => {
+ return item.parent_value === value
+ })
+
+ if (nodes.length) {
+ dataList.push(nodes)
+ } else {
+ hasNodes = false
+ }
+ }
+
+ return {
+ dataList,
+ hasNodes
+ }
+ },
+ _extractTree(nodes, result, parent_value) {
+ let list = result || []
+ for (let i = 0; i < nodes.length; i++) {
+ let node = nodes[i]
+
+ let child = {}
+ for (let key in node) {
+ if (key !== 'children') {
+ child[key] = node[key]
+ }
+ }
+ if (parent_value !== undefined) {
+ child.parent_value = parent_value
+ }
+ result.push(child)
+
+ let children = node.children
+ if (children) {
+ this._extractTree(children, result, node.value)
+ }
+ }
+ },
+ _extractTreePath(nodes, result) {
+ let list = result || []
+ for (let i = 0; i < nodes.length; i++) {
+ let node = nodes[i]
+
+ let child = {}
+ for (let key in node) {
+ if (key !== 'children') {
+ child[key] = node[key]
+ }
+ }
+ result.push(child)
+
+ let children = node.children
+ if (children) {
+ this._extractTreePath(children, result)
+ }
+ }
+ },
+ _findNodePath(key, nodes, path = []) {
+ for (let i = 0; i < nodes.length; i++) {
+ let {
+ value,
+ text,
+ children
+ } = nodes[i]
+
+ path.push({
+ value,
+ text
+ })
+
+ if (value === key) {
+ return path
+ }
+
+ if (children) {
+ const p = this._findNodePath(key, children, path)
+ if (p.length) {
+ return p
+ }
+ }
+
+ path.pop()
+ }
+ return []
+ },
+ _processLocalData() {
+ this._treeData = []
+ this._extractTree(this.localdata, this._treeData)
+
+ var inputValue = this.dataValue
+ if (inputValue === undefined) {
+ return
+ }
+
+ if (Array.isArray(inputValue)) {
+ inputValue = inputValue[inputValue.length - 1]
+ if (typeof inputValue === 'object' && inputValue.value) {
+ inputValue = inputValue.value
+ }
+ }
+
+ this.selected = this._findNodePath(inputValue, this.localdata)
+ }
+ }
+}
diff --git a/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue b/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue
index 7b5952965b31469d9c1f6b23166491d5135fa0ad..7f4e99994de7ea9bbcc9695735dc42f6831554a2 100644
--- a/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue
+++ b/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue
@@ -1,300 +1,300 @@
-
-
-
-
-
-
- {{item.text}}
-
-
-
-
-
-
-
-
- {{item.text}}
-
-
-
-
-
-
-
-
-
- {{errorMessage}}
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ {{item.text}}
+
+
+
+
+
+
+
+
+ {{item.text}}
+
+
+
+
+
+
+
+
+
+ {{errorMessage}}
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-data-picker/package.json b/uni_modules/uni-data-picker/package.json
index 469b06583e3c2f0e31c35689cd899f3b5b3e3eeb..676f68baf92bc3dd61e77c9e4bd1cc674b9cf06f 100644
--- a/uni_modules/uni-data-picker/package.json
+++ b/uni_modules/uni-data-picker/package.json
@@ -1,86 +1,86 @@
-{
- "id": "uni-data-picker",
- "displayName": "uni-data-picker 数据驱动的picker选择器",
- "version": "0.4.0",
- "description": "Picker选择器",
- "keywords": [
- "uni-ui",
- "uniui",
- "picker",
- "级联",
- "省市区",
- ""
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [
- "uni-load-more"
- ],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-data-picker",
+ "displayName": "uni-data-picker 数据驱动的picker选择器",
+ "version": "0.4.0",
+ "description": "Picker选择器",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "picker",
+ "级联",
+ "省市区",
+ ""
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-load-more"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js b/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js
index e00d5597e7a0b8dcdea64ef0c1c3f4d69e9522f8..6821b7ede79d669f8b08a7146d13e3a7027616a6 100644
--- a/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js
+++ b/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js
@@ -1,200 +1,200 @@
-// yyyy-MM-dd hh:mm:ss.SSS 所有支持的类型
-function pad(str, length = 2) {
- str += ''
- while (str.length < length) {
- str = '0' + str
- }
- return str.slice(-length)
-}
-
-const parser = {
- yyyy: (dateObj) => {
- return pad(dateObj.year, 4)
- },
- yy: (dateObj) => {
- return pad(dateObj.year)
- },
- MM: (dateObj) => {
- return pad(dateObj.month)
- },
- M: (dateObj) => {
- return dateObj.month
- },
- dd: (dateObj) => {
- return pad(dateObj.day)
- },
- d: (dateObj) => {
- return dateObj.day
- },
- hh: (dateObj) => {
- return pad(dateObj.hour)
- },
- h: (dateObj) => {
- return dateObj.hour
- },
- mm: (dateObj) => {
- return pad(dateObj.minute)
- },
- m: (dateObj) => {
- return dateObj.minute
- },
- ss: (dateObj) => {
- return pad(dateObj.second)
- },
- s: (dateObj) => {
- return dateObj.second
- },
- SSS: (dateObj) => {
- return pad(dateObj.millisecond, 3)
- },
- S: (dateObj) => {
- return dateObj.millisecond
- },
-}
-
-// 这都n年了iOS依然不认识2020-12-12,需要转换为2020/12/12
-function getDate(time) {
- if (time instanceof Date) {
- return time
- }
- switch (typeof time) {
- case 'string':
- {
- // 2020-12-12T12:12:12.000Z、2020-12-12T12:12:12.000
- if (time.indexOf('T') > -1) {
- return new Date(time)
- }
- return new Date(time.replace(/-/g, '/'))
- }
- default:
- return new Date(time)
- }
-}
-
-export function formatDate(date, format = 'yyyy/MM/dd hh:mm:ss') {
- if (!date && date !== 0) {
- return ''
- }
- date = getDate(date)
- const dateObj = {
- year: date.getFullYear(),
- month: date.getMonth() + 1,
- day: date.getDate(),
- hour: date.getHours(),
- minute: date.getMinutes(),
- second: date.getSeconds(),
- millisecond: date.getMilliseconds()
- }
- const tokenRegExp = /yyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S/
- let flag = true
- let result = format
- while (flag) {
- flag = false
- result = result.replace(tokenRegExp, function(matched) {
- flag = true
- return parser[matched](dateObj)
- })
- }
- return result
-}
-
-export function friendlyDate(time, {
- locale = 'zh',
- threshold = [60000, 3600000],
- format = 'yyyy/MM/dd hh:mm:ss'
-}) {
- if (time === '-') {
- return time
- }
- if (!time && time !== 0) {
- return ''
- }
- const localeText = {
- zh: {
- year: '年',
- month: '月',
- day: '天',
- hour: '小时',
- minute: '分钟',
- second: '秒',
- ago: '前',
- later: '后',
- justNow: '刚刚',
- soon: '马上',
- template: '{num}{unit}{suffix}'
- },
- en: {
- year: 'year',
- month: 'month',
- day: 'day',
- hour: 'hour',
- minute: 'minute',
- second: 'second',
- ago: 'ago',
- later: 'later',
- justNow: 'just now',
- soon: 'soon',
- template: '{num} {unit} {suffix}'
- }
- }
- const text = localeText[locale] || localeText.zh
- let date = getDate(time)
- let ms = date.getTime() - Date.now()
- let absMs = Math.abs(ms)
- if (absMs < threshold[0]) {
- return ms < 0 ? text.justNow : text.soon
- }
- if (absMs >= threshold[1]) {
- return formatDate(date, format)
- }
- let num
- let unit
- let suffix = text.later
- if (ms < 0) {
- suffix = text.ago
- ms = -ms
- }
- const seconds = Math.floor((ms) / 1000)
- const minutes = Math.floor(seconds / 60)
- const hours = Math.floor(minutes / 60)
- const days = Math.floor(hours / 24)
- const months = Math.floor(days / 30)
- const years = Math.floor(months / 12)
- switch (true) {
- case years > 0:
- num = years
- unit = text.year
- break
- case months > 0:
- num = months
- unit = text.month
- break
- case days > 0:
- num = days
- unit = text.day
- break
- case hours > 0:
- num = hours
- unit = text.hour
- break
- case minutes > 0:
- num = minutes
- unit = text.minute
- break
- default:
- num = seconds
- unit = text.second
- break
- }
-
- if (locale === 'en') {
- if (num === 1) {
- num = 'a'
- } else {
- unit += 's'
- }
- }
-
- return text.template.replace(/{\s*num\s*}/g, num + '').replace(/{\s*unit\s*}/g, unit).replace(/{\s*suffix\s*}/g,
- suffix)
-}
+// yyyy-MM-dd hh:mm:ss.SSS 所有支持的类型
+function pad(str, length = 2) {
+ str += ''
+ while (str.length < length) {
+ str = '0' + str
+ }
+ return str.slice(-length)
+}
+
+const parser = {
+ yyyy: (dateObj) => {
+ return pad(dateObj.year, 4)
+ },
+ yy: (dateObj) => {
+ return pad(dateObj.year)
+ },
+ MM: (dateObj) => {
+ return pad(dateObj.month)
+ },
+ M: (dateObj) => {
+ return dateObj.month
+ },
+ dd: (dateObj) => {
+ return pad(dateObj.day)
+ },
+ d: (dateObj) => {
+ return dateObj.day
+ },
+ hh: (dateObj) => {
+ return pad(dateObj.hour)
+ },
+ h: (dateObj) => {
+ return dateObj.hour
+ },
+ mm: (dateObj) => {
+ return pad(dateObj.minute)
+ },
+ m: (dateObj) => {
+ return dateObj.minute
+ },
+ ss: (dateObj) => {
+ return pad(dateObj.second)
+ },
+ s: (dateObj) => {
+ return dateObj.second
+ },
+ SSS: (dateObj) => {
+ return pad(dateObj.millisecond, 3)
+ },
+ S: (dateObj) => {
+ return dateObj.millisecond
+ },
+}
+
+// 这都n年了iOS依然不认识2020-12-12,需要转换为2020/12/12
+function getDate(time) {
+ if (time instanceof Date) {
+ return time
+ }
+ switch (typeof time) {
+ case 'string':
+ {
+ // 2020-12-12T12:12:12.000Z、2020-12-12T12:12:12.000
+ if (time.indexOf('T') > -1) {
+ return new Date(time)
+ }
+ return new Date(time.replace(/-/g, '/'))
+ }
+ default:
+ return new Date(time)
+ }
+}
+
+export function formatDate(date, format = 'yyyy/MM/dd hh:mm:ss') {
+ if (!date && date !== 0) {
+ return ''
+ }
+ date = getDate(date)
+ const dateObj = {
+ year: date.getFullYear(),
+ month: date.getMonth() + 1,
+ day: date.getDate(),
+ hour: date.getHours(),
+ minute: date.getMinutes(),
+ second: date.getSeconds(),
+ millisecond: date.getMilliseconds()
+ }
+ const tokenRegExp = /yyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S/
+ let flag = true
+ let result = format
+ while (flag) {
+ flag = false
+ result = result.replace(tokenRegExp, function(matched) {
+ flag = true
+ return parser[matched](dateObj)
+ })
+ }
+ return result
+}
+
+export function friendlyDate(time, {
+ locale = 'zh',
+ threshold = [60000, 3600000],
+ format = 'yyyy/MM/dd hh:mm:ss'
+}) {
+ if (time === '-') {
+ return time
+ }
+ if (!time && time !== 0) {
+ return ''
+ }
+ const localeText = {
+ zh: {
+ year: '年',
+ month: '月',
+ day: '天',
+ hour: '小时',
+ minute: '分钟',
+ second: '秒',
+ ago: '前',
+ later: '后',
+ justNow: '刚刚',
+ soon: '马上',
+ template: '{num}{unit}{suffix}'
+ },
+ en: {
+ year: 'year',
+ month: 'month',
+ day: 'day',
+ hour: 'hour',
+ minute: 'minute',
+ second: 'second',
+ ago: 'ago',
+ later: 'later',
+ justNow: 'just now',
+ soon: 'soon',
+ template: '{num} {unit} {suffix}'
+ }
+ }
+ const text = localeText[locale] || localeText.zh
+ let date = getDate(time)
+ let ms = date.getTime() - Date.now()
+ let absMs = Math.abs(ms)
+ if (absMs < threshold[0]) {
+ return ms < 0 ? text.justNow : text.soon
+ }
+ if (absMs >= threshold[1]) {
+ return formatDate(date, format)
+ }
+ let num
+ let unit
+ let suffix = text.later
+ if (ms < 0) {
+ suffix = text.ago
+ ms = -ms
+ }
+ const seconds = Math.floor((ms) / 1000)
+ const minutes = Math.floor(seconds / 60)
+ const hours = Math.floor(minutes / 60)
+ const days = Math.floor(hours / 24)
+ const months = Math.floor(days / 30)
+ const years = Math.floor(months / 12)
+ switch (true) {
+ case years > 0:
+ num = years
+ unit = text.year
+ break
+ case months > 0:
+ num = months
+ unit = text.month
+ break
+ case days > 0:
+ num = days
+ unit = text.day
+ break
+ case hours > 0:
+ num = hours
+ unit = text.hour
+ break
+ case minutes > 0:
+ num = minutes
+ unit = text.minute
+ break
+ default:
+ num = seconds
+ unit = text.second
+ break
+ }
+
+ if (locale === 'en') {
+ if (num === 1) {
+ num = 'a'
+ } else {
+ unit += 's'
+ }
+ }
+
+ return text.template.replace(/{\s*num\s*}/g, num + '').replace(/{\s*unit\s*}/g, unit).replace(/{\s*suffix\s*}/g,
+ suffix)
+}
diff --git a/uni_modules/uni-dateformat/package.json b/uni_modules/uni-dateformat/package.json
index 64ec8cf13521394f42e6d954957c2b19dfc6ad1a..93023ad9aa63054e368339ae0407d1f97abf584d 100644
--- a/uni_modules/uni-dateformat/package.json
+++ b/uni_modules/uni-dateformat/package.json
@@ -1,84 +1,84 @@
-{
- "id": "uni-dateformat",
- "displayName": "uni-dateformat 日期格式化",
- "version": "0.0.5",
- "description": "日期格式化组件,可以将日期格式化为1分钟前、刚刚等形式",
- "keywords": [
- "uni-ui",
- "uniui",
- "日期格式化",
- "时间格式化",
- "格式化时间",
- ""
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "y",
- "联盟": "y"
- }
- }
- }
- }
+{
+ "id": "uni-dateformat",
+ "displayName": "uni-dateformat 日期格式化",
+ "version": "0.0.5",
+ "description": "日期格式化组件,可以将日期格式化为1分钟前、刚刚等形式",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "日期格式化",
+ "时间格式化",
+ "格式化时间",
+ ""
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "y",
+ "联盟": "y"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue
index 608dd7853dc016d241b0890cb6f19ee923ee9031..e3bf17d827ed194847a7e01a28596cf1030f0988 100644
--- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue
+++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue
@@ -1,172 +1,172 @@
-
-
-
-
- {{weeks.date}}
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue
index 73e949336b1b87beff08e43e119c45e14ca88442..6b7a20b42488bcce25d5d6db6815cba5abd94453 100644
--- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue
+++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue
@@ -1,801 +1,801 @@
-
-
-
-
-
-
-
-
- {{nowDate.month}}
-
-
-
- {{SUNText}}
-
-
- {{monText}}
-
-
- {{TUEText}}
-
-
- {{WEDText}}
-
-
- {{THUText}}
-
-
- {{FRIText}}
-
-
- {{SATText}}
-
-
-
-
-
-
-
-
-
-
- {{tempSingleDate ? tempSingleDate : selectDateText}}
-
-
-
-
-
-
- {{tempRange.before ? tempRange.before : startDateText}}
-
-
-
-
-
- {{tempRange.after ? tempRange.after : endDateText}}
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ {{nowDate.month}}
+
+
+
+ {{SUNText}}
+
+
+ {{monText}}
+
+
+ {{TUEText}}
+
+
+ {{WEDText}}
+
+
+ {{THUText}}
+
+
+ {{FRIText}}
+
+
+ {{SATText}}
+
+
+
+
+
+
+
+
+
+
+ {{tempSingleDate ? tempSingleDate : selectDateText}}
+
+
+
+
+
+
+ {{tempRange.before ? tempRange.before : startDateText}}
+
+
+
+
+
+ {{tempRange.after ? tempRange.after : endDateText}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json
index cc76311be5be4de856623efaa10e42e7f7fa0b8d..75b3754659e76dcd68801802c44a7bd617d4338d 100644
--- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json
+++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json
@@ -1,19 +1,19 @@
-{
- "uni-datetime-picker.selectDate": "select date",
- "uni-datetime-picker.selectTime": "select time",
- "uni-datetime-picker.selectDateTime": "select datetime",
- "uni-datetime-picker.startDate": "start date",
+{
+ "uni-datetime-picker.selectDate": "select date",
+ "uni-datetime-picker.selectTime": "select time",
+ "uni-datetime-picker.selectDateTime": "select datetime",
+ "uni-datetime-picker.startDate": "start date",
"uni-datetime-picker.endDate": "end date",
"uni-datetime-picker.startTime": "start time",
- "uni-datetime-picker.endTime": "end time",
- "uni-datetime-picker.ok": "ok",
+ "uni-datetime-picker.endTime": "end time",
+ "uni-datetime-picker.ok": "ok",
"uni-datetime-picker.clear": "clear",
- "uni-datetime-picker.cancel": "cancel",
- "uni-calender.MON": "MON",
- "uni-calender.TUE": "TUE",
- "uni-calender.WED": "WED",
- "uni-calender.THU": "THU",
- "uni-calender.FRI": "FRI",
- "uni-calender.SAT": "SAT",
- "uni-calender.SUN": "SUN"
+ "uni-datetime-picker.cancel": "cancel",
+ "uni-calender.MON": "MON",
+ "uni-calender.TUE": "TUE",
+ "uni-calender.WED": "WED",
+ "uni-calender.THU": "THU",
+ "uni-calender.FRI": "FRI",
+ "uni-calender.SAT": "SAT",
+ "uni-calender.SUN": "SUN"
}
diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js
index de7509c87ba5197b9f5d20ca94a0558c7a8e08a9..fa8f0f3734de6effb137592fce6c0f722c048432 100644
--- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js
+++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js
@@ -1,8 +1,8 @@
-import en from './en.json'
-import zhHans from './zh-Hans.json'
-import zhHant from './zh-Hant.json'
-export default {
- en,
- 'zh-Hans': zhHans,
- 'zh-Hant': zhHant
+import en from './en.json'
+import zhHans from './zh-Hans.json'
+import zhHant from './zh-Hant.json'
+export default {
+ en,
+ 'zh-Hans': zhHans,
+ 'zh-Hant': zhHant
}
diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json
index 7bc7405f553cff1a0a7f1ec4855747e2011b331c..1a885e4178f113a45cf9ab3b55080fd1f5f4a03f 100644
--- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json
+++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json
@@ -1,12 +1,12 @@
-{
- "uni-datetime-picker.selectDate": "选择日期",
- "uni-datetime-picker.selectTime": "选择时间",
- "uni-datetime-picker.selectDateTime": "选择日期时间",
- "uni-datetime-picker.startDate": "开始日期",
+{
+ "uni-datetime-picker.selectDate": "选择日期",
+ "uni-datetime-picker.selectTime": "选择时间",
+ "uni-datetime-picker.selectDateTime": "选择日期时间",
+ "uni-datetime-picker.startDate": "开始日期",
"uni-datetime-picker.endDate": "结束日期",
"uni-datetime-picker.startTime": "开始时间",
- "uni-datetime-picker.endTime": "结束时间",
- "uni-datetime-picker.ok": "确定",
+ "uni-datetime-picker.endTime": "结束时间",
+ "uni-datetime-picker.ok": "确定",
"uni-datetime-picker.clear": "清除",
"uni-datetime-picker.cancel": "取消",
"uni-calender.SUN": "日",
diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json
index 7d370432ebf316bdd7bd1442fbefcf94169e6d09..de50ff02d93c7bcaed3af6d88c86cd56bd2fca19 100644
--- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json
+++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json
@@ -1,12 +1,12 @@
-{
- "uni-datetime-picker.selectDate": "選擇日期",
- "uni-datetime-picker.selectTime": "選擇時間",
- "uni-datetime-picker.selectDateTime": "選擇日期時間",
- "uni-datetime-picker.startDate": "開始日期",
+{
+ "uni-datetime-picker.selectDate": "選擇日期",
+ "uni-datetime-picker.selectTime": "選擇時間",
+ "uni-datetime-picker.selectDateTime": "選擇日期時間",
+ "uni-datetime-picker.startDate": "開始日期",
"uni-datetime-picker.endDate": "結束日期",
"uni-datetime-picker.startTime": "開始时间",
- "uni-datetime-picker.endTime": "結束时间",
- "uni-datetime-picker.ok": "確定",
+ "uni-datetime-picker.endTime": "結束时间",
+ "uni-datetime-picker.ok": "確定",
"uni-datetime-picker.clear": "清除",
"uni-datetime-picker.cancel": "取消",
"uni-calender.SUN": "日",
@@ -15,5 +15,5 @@
"uni-calender.WED": "三",
"uni-calender.THU": "四",
"uni-calender.FRI": "五",
- "uni-calender.SAT": "六"
+ "uni-calender.SAT": "六"
}
diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue
index 1748de582172d5c1af138e8b16304e6056ddece5..147513a13451617489253737e3d810e45a8617d1 100644
--- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue
+++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue
@@ -1,924 +1,924 @@
-
-
-
-
-
- {{time}}
-
- {{selectTimeText}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ {{time}}
+
+ {{selectTimeText}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue
index 7d75ebf4160c40dfc0a3b6ea6d167a6e733e7b47..c967cd0ed3edaaf06c2e487e093f8555549a49d0 100644
--- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue
+++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue
@@ -1,951 +1,951 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{rangeSeparator}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ max-width: 152px;
+ }
+
+ .uni-date-picker__container {
+ position: relative;
+ /* position: fixed;
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ box-sizing: border-box;
+ z-index: 996;
+ font-size: 14px; */
+ }
+
+ .uni-date-mask {
+ position: fixed;
+ bottom: 0px;
+ top: 0px;
+ left: 0px;
+ right: 0px;
+ background-color: rgba(0, 0, 0, 0);
+ transition-duration: 0.3s;
+ z-index: 996;
+ }
+
+ .uni-date-single--x {
+ /* padding: 0 8px; */
+ background-color: #fff;
+ position: absolute;
+ top: 0;
+ z-index: 999;
+ border: 1px solid #e4e7ed;
+ box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
+ border-radius: 4px;
+ }
+
+ .uni-date-range--x {
+ /* padding: 0 8px; */
+ background-color: #fff;
+ position: absolute;
+ top: 0;
+ z-index: 999;
+ border: 1px solid #e4e7ed;
+ box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
+ border-radius: 4px;
+ }
+
+ .uni-date-editor--x__disabled {
+ opacity: 0.4;
+ cursor: default;
+ }
+
+ .uni-date-editor--logo {
+ width: 16px;
+ height: 16px;
+ vertical-align: middle;
+ }
+
+ /* 添加时间 */
+ .popup-x-header {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: row;
+ /* justify-content: space-between; */
+ }
+
+ .popup-x-header--datetime {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: row;
+ flex: 1;
+ }
+
+ .popup-x-body {
+ display: flex;
+ }
+
+ .popup-x-footer {
+ padding: 0 15px;
+ border-top-color: #F1F1F1;
+ border-top-style: solid;
+ border-top-width: 1px;
+ background-color: #fff;
+ line-height: 40px;
+ text-align: right;
+ color: #666;
+ }
+
+ .popup-x-footer text:hover {
+ color: #007aff;
+ cursor: pointer;
+ opacity: 0.8;
+ }
+
+ .popup-x-footer .confirm {
+ margin-left: 20px;
+ color: #007aff;
+ }
+
+ .uni-date-changed {
+ background-color: #fff;
+ text-align: center;
+ color: #333;
+ border-bottom-color: #F1F1F1;
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+ /* padding: 0 50px; */
+ }
+
+ .uni-date-changed--time text {
+ /* padding: 0 20px; */
+ height: 50px;
+ line-height: 50px;
+ }
+
+ .uni-date-changed .uni-date-changed--time {
+ /* display: flex; */
+ flex: 1;
+ }
+
+ .uni-date-changed--time-date {
+ color: #333;
+ opacity: 0.6;
+ }
+
+ .mr-50 {
+ margin-right: 50px;
+ }
+ .uni-date_calendar-pc {
+ padding: 0 6px;
+ }
+
diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js
index 1f9f97793282d8e534352bb4a36047bd02caad00..6b95347aa3a3d872ad0702de94e28c5e5ef56836 100644
--- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js
+++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js
@@ -1,352 +1,352 @@
-import CALENDAR from './calendar.js'
-
-class Calendar {
- constructor({
- date,
- selected,
- startDate,
- endDate,
- range,
- // multipleStatus
- } = {}) {
- // 当前日期
- this.date = this.getDate(new Date()) // 当前初入日期
- // 打点信息
- this.selected = selected || [];
- // 范围开始
- this.startDate = startDate
- // 范围结束
- this.endDate = endDate
- this.range = range
- // 多选状态
- this.cleanMultipleStatus()
- // 每周日期
- this.weeks = {}
- // this._getWeek(this.date.fullDate)
- // this.multipleStatus = multipleStatus
- this.lastHover = false
- }
- /**
- * 设置日期
- * @param {Object} date
- */
- setDate(date) {
- this.selectDate = this.getDate(date)
- this._getWeek(this.selectDate.fullDate)
- }
-
- /**
- * 清理多选状态
- */
- cleanMultipleStatus() {
- this.multipleStatus = {
- before: '',
- after: '',
- data: []
- }
- }
-
- /**
- * 重置开始日期
- */
- resetSatrtDate(startDate) {
- // 范围开始
- this.startDate = startDate
-
- }
-
- /**
- * 重置结束日期
- */
- resetEndDate(endDate) {
- // 范围结束
- this.endDate = endDate
- }
-
- /**
- * 获取任意时间
- */
- getDate(date, AddDayCount = 0, str = 'day') {
- if (!date) {
- date = new Date()
- }
- if (typeof date !== 'object') {
- date = date.replace(/-/g, '/')
- }
- const dd = new Date(date)
- switch (str) {
- case 'day':
- dd.setDate(dd.getDate() + AddDayCount) // 获取AddDayCount天后的日期
- break
- case 'month':
- if (dd.getDate() === 31) {
- dd.setDate(dd.getDate() + AddDayCount)
- } else {
- dd.setMonth(dd.getMonth() + AddDayCount) // 获取AddDayCount天后的日期
- }
- break
- case 'year':
- dd.setFullYear(dd.getFullYear() + AddDayCount) // 获取AddDayCount天后的日期
- break
- }
- const y = dd.getFullYear()
- const m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1 // 获取当前月份的日期,不足10补0
- const d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 获取当前几号,不足10补0
- return {
- fullDate: y + '-' + m + '-' + d,
- year: y,
- month: m,
- date: d,
- day: dd.getDay()
- }
- }
-
-
- /**
- * 获取上月剩余天数
- */
- _getLastMonthDays(firstDay, full) {
- let dateArr = []
- for (let i = firstDay; i > 0; i--) {
- const beforeDate = new Date(full.year, full.month - 1, -i + 1).getDate()
- dateArr.push({
- date: beforeDate,
- month: full.month - 1,
- lunar: this.getlunar(full.year, full.month - 1, beforeDate),
- disable: true
- })
- }
- return dateArr
- }
- /**
- * 获取本月天数
- */
- _currentMonthDys(dateData, full) {
- let dateArr = []
- let fullDate = this.date.fullDate
- for (let i = 1; i <= dateData; i++) {
- let isinfo = false
- let nowDate = full.year + '-' + (full.month < 10 ?
- full.month : full.month) + '-' + (i < 10 ?
- '0' + i : i)
- // 是否今天
- let isDay = fullDate === nowDate
- // 获取打点信息
- let info = this.selected && this.selected.find((item) => {
- if (this.dateEqual(nowDate, item.date)) {
- return item
- }
- })
-
- // 日期禁用
- let disableBefore = true
- let disableAfter = true
- if (this.startDate) {
- // let dateCompBefore = this.dateCompare(this.startDate, fullDate)
+import CALENDAR from './calendar.js'
+
+class Calendar {
+ constructor({
+ date,
+ selected,
+ startDate,
+ endDate,
+ range,
+ // multipleStatus
+ } = {}) {
+ // 当前日期
+ this.date = this.getDate(new Date()) // 当前初入日期
+ // 打点信息
+ this.selected = selected || [];
+ // 范围开始
+ this.startDate = startDate
+ // 范围结束
+ this.endDate = endDate
+ this.range = range
+ // 多选状态
+ this.cleanMultipleStatus()
+ // 每周日期
+ this.weeks = {}
+ // this._getWeek(this.date.fullDate)
+ // this.multipleStatus = multipleStatus
+ this.lastHover = false
+ }
+ /**
+ * 设置日期
+ * @param {Object} date
+ */
+ setDate(date) {
+ this.selectDate = this.getDate(date)
+ this._getWeek(this.selectDate.fullDate)
+ }
+
+ /**
+ * 清理多选状态
+ */
+ cleanMultipleStatus() {
+ this.multipleStatus = {
+ before: '',
+ after: '',
+ data: []
+ }
+ }
+
+ /**
+ * 重置开始日期
+ */
+ resetSatrtDate(startDate) {
+ // 范围开始
+ this.startDate = startDate
+
+ }
+
+ /**
+ * 重置结束日期
+ */
+ resetEndDate(endDate) {
+ // 范围结束
+ this.endDate = endDate
+ }
+
+ /**
+ * 获取任意时间
+ */
+ getDate(date, AddDayCount = 0, str = 'day') {
+ if (!date) {
+ date = new Date()
+ }
+ if (typeof date !== 'object') {
+ date = date.replace(/-/g, '/')
+ }
+ const dd = new Date(date)
+ switch (str) {
+ case 'day':
+ dd.setDate(dd.getDate() + AddDayCount) // 获取AddDayCount天后的日期
+ break
+ case 'month':
+ if (dd.getDate() === 31) {
+ dd.setDate(dd.getDate() + AddDayCount)
+ } else {
+ dd.setMonth(dd.getMonth() + AddDayCount) // 获取AddDayCount天后的日期
+ }
+ break
+ case 'year':
+ dd.setFullYear(dd.getFullYear() + AddDayCount) // 获取AddDayCount天后的日期
+ break
+ }
+ const y = dd.getFullYear()
+ const m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1 // 获取当前月份的日期,不足10补0
+ const d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 获取当前几号,不足10补0
+ return {
+ fullDate: y + '-' + m + '-' + d,
+ year: y,
+ month: m,
+ date: d,
+ day: dd.getDay()
+ }
+ }
+
+
+ /**
+ * 获取上月剩余天数
+ */
+ _getLastMonthDays(firstDay, full) {
+ let dateArr = []
+ for (let i = firstDay; i > 0; i--) {
+ const beforeDate = new Date(full.year, full.month - 1, -i + 1).getDate()
+ dateArr.push({
+ date: beforeDate,
+ month: full.month - 1,
+ lunar: this.getlunar(full.year, full.month - 1, beforeDate),
+ disable: true
+ })
+ }
+ return dateArr
+ }
+ /**
+ * 获取本月天数
+ */
+ _currentMonthDys(dateData, full) {
+ let dateArr = []
+ let fullDate = this.date.fullDate
+ for (let i = 1; i <= dateData; i++) {
+ let isinfo = false
+ let nowDate = full.year + '-' + (full.month < 10 ?
+ full.month : full.month) + '-' + (i < 10 ?
+ '0' + i : i)
+ // 是否今天
+ let isDay = fullDate === nowDate
+ // 获取打点信息
+ let info = this.selected && this.selected.find((item) => {
+ if (this.dateEqual(nowDate, item.date)) {
+ return item
+ }
+ })
+
+ // 日期禁用
+ let disableBefore = true
+ let disableAfter = true
+ if (this.startDate) {
+ // let dateCompBefore = this.dateCompare(this.startDate, fullDate)
// disableBefore = this.dateCompare(dateCompBefore ? this.startDate : fullDate, nowDate)
disableBefore = this.dateCompare(this.startDate, nowDate)
- }
-
- if (this.endDate) {
- // let dateCompAfter = this.dateCompare(fullDate, this.endDate)
+ }
+
+ if (this.endDate) {
+ // let dateCompAfter = this.dateCompare(fullDate, this.endDate)
// disableAfter = this.dateCompare(nowDate, dateCompAfter ? this.endDate : fullDate)
disableAfter = this.dateCompare(nowDate, this.endDate)
- }
- let multiples = this.multipleStatus.data
- let checked = false
- let multiplesStatus = -1
- if (this.range) {
- if (multiples) {
- multiplesStatus = multiples.findIndex((item) => {
- return this.dateEqual(item, nowDate)
- })
- }
- if (multiplesStatus !== -1) {
- checked = true
- }
- }
- let data = {
- fullDate: nowDate,
- year: full.year,
- date: i,
- multiple: this.range ? checked : false,
- beforeMultiple: this.dateEqual(this.multipleStatus.before, nowDate),
- afterMultiple: this.dateEqual(this.multipleStatus.after, nowDate),
- month: full.month,
- lunar: this.getlunar(full.year, full.month, i),
- disable: !(disableBefore && disableAfter),
- isDay
- }
- if (info) {
- data.extraInfo = info
- }
-
- dateArr.push(data)
- }
- return dateArr
- }
- /**
- * 获取下月天数
- */
- _getNextMonthDays(surplus, full) {
- let dateArr = []
- for (let i = 1; i < surplus + 1; i++) {
- dateArr.push({
- date: i,
- month: Number(full.month) + 1,
- lunar: this.getlunar(full.year, Number(full.month) + 1, i),
- disable: true
- })
- }
- return dateArr
- }
-
- /**
- * 获取当前日期详情
- * @param {Object} date
- */
- getInfo(date) {
- if (!date) {
- date = new Date()
- }
- const dateInfo = this.canlender.find(item => item.fullDate === this.getDate(date).fullDate)
- return dateInfo
- }
-
- /**
- * 比较时间大小
- */
- dateCompare(startDate, endDate) {
- // 计算截止时间
- startDate = new Date(startDate.replace('-', '/').replace('-', '/'))
- // 计算详细项的截止时间
- endDate = new Date(endDate.replace('-', '/').replace('-', '/'))
- if (startDate <= endDate) {
- return true
- } else {
- return false
- }
- }
-
- /**
- * 比较时间是否相等
- */
- dateEqual(before, after) {
- // 计算截止时间
- before = new Date(before.replace('-', '/').replace('-', '/'))
- // 计算详细项的截止时间
- after = new Date(after.replace('-', '/').replace('-', '/'))
- if (before.getTime() - after.getTime() === 0) {
- return true
- } else {
- return false
- }
- }
-
-
- /**
- * 获取日期范围内所有日期
- * @param {Object} begin
- * @param {Object} end
- */
- geDateAll(begin, end) {
- var arr = []
- var ab = begin.split('-')
- var ae = end.split('-')
- var db = new Date()
- db.setFullYear(ab[0], ab[1] - 1, ab[2])
- var de = new Date()
- de.setFullYear(ae[0], ae[1] - 1, ae[2])
- var unixDb = db.getTime() - 24 * 60 * 60 * 1000
- var unixDe = de.getTime() - 24 * 60 * 60 * 1000
- for (var k = unixDb; k <= unixDe;) {
- k = k + 24 * 60 * 60 * 1000
- arr.push(this.getDate(new Date(parseInt(k))).fullDate)
- }
- return arr
- }
- /**
- * 计算阴历日期显示
- */
- getlunar(year, month, date) {
- return CALENDAR.solar2lunar(year, month, date)
- }
- /**
- * 设置打点
- */
- setSelectInfo(data, value) {
- this.selected = value
- this._getWeek(data)
- }
-
- /**
- * 获取多选状态
- */
- setMultiple(fullDate) {
- let {
- before,
- after
- } = this.multipleStatus
-
- if (!this.range) return
- if (before && after) {
- if (!this.lastHover) {
- this.lastHover = true
- return
- }
- this.multipleStatus.before = ''
- this.multipleStatus.after = ''
- this.multipleStatus.data = []
- this.multipleStatus.fulldate = ''
- this.lastHover = false
- } else {
- this.lastHover = false
- if (!before) {
- this.multipleStatus.before = fullDate
- } else {
- this.multipleStatus.after = fullDate
- if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
- this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus
- .after);
- } else {
- this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus
- .before);
- }
- }
- }
- this._getWeek(fullDate)
- }
-
- /**
- * 鼠标 hover 更新多选状态
- */
- setHoverMultiple(fullDate) {
- let {
- before,
- after
- } = this.multipleStatus
-
- if (!this.range) return
- if (this.lastHover) return
-
- if (!before) {
- this.multipleStatus.before = fullDate
- } else {
- this.multipleStatus.after = fullDate
- if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
- this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
- } else {
- this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
- }
- }
- this._getWeek(fullDate)
- }
-
- /**
- * 更新默认值多选状态
- */
- setDefaultMultiple(before, after) {
- this.multipleStatus.before = before
+ }
+ let multiples = this.multipleStatus.data
+ let checked = false
+ let multiplesStatus = -1
+ if (this.range) {
+ if (multiples) {
+ multiplesStatus = multiples.findIndex((item) => {
+ return this.dateEqual(item, nowDate)
+ })
+ }
+ if (multiplesStatus !== -1) {
+ checked = true
+ }
+ }
+ let data = {
+ fullDate: nowDate,
+ year: full.year,
+ date: i,
+ multiple: this.range ? checked : false,
+ beforeMultiple: this.dateEqual(this.multipleStatus.before, nowDate),
+ afterMultiple: this.dateEqual(this.multipleStatus.after, nowDate),
+ month: full.month,
+ lunar: this.getlunar(full.year, full.month, i),
+ disable: !(disableBefore && disableAfter),
+ isDay
+ }
+ if (info) {
+ data.extraInfo = info
+ }
+
+ dateArr.push(data)
+ }
+ return dateArr
+ }
+ /**
+ * 获取下月天数
+ */
+ _getNextMonthDays(surplus, full) {
+ let dateArr = []
+ for (let i = 1; i < surplus + 1; i++) {
+ dateArr.push({
+ date: i,
+ month: Number(full.month) + 1,
+ lunar: this.getlunar(full.year, Number(full.month) + 1, i),
+ disable: true
+ })
+ }
+ return dateArr
+ }
+
+ /**
+ * 获取当前日期详情
+ * @param {Object} date
+ */
+ getInfo(date) {
+ if (!date) {
+ date = new Date()
+ }
+ const dateInfo = this.canlender.find(item => item.fullDate === this.getDate(date).fullDate)
+ return dateInfo
+ }
+
+ /**
+ * 比较时间大小
+ */
+ dateCompare(startDate, endDate) {
+ // 计算截止时间
+ startDate = new Date(startDate.replace('-', '/').replace('-', '/'))
+ // 计算详细项的截止时间
+ endDate = new Date(endDate.replace('-', '/').replace('-', '/'))
+ if (startDate <= endDate) {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ /**
+ * 比较时间是否相等
+ */
+ dateEqual(before, after) {
+ // 计算截止时间
+ before = new Date(before.replace('-', '/').replace('-', '/'))
+ // 计算详细项的截止时间
+ after = new Date(after.replace('-', '/').replace('-', '/'))
+ if (before.getTime() - after.getTime() === 0) {
+ return true
+ } else {
+ return false
+ }
+ }
+
+
+ /**
+ * 获取日期范围内所有日期
+ * @param {Object} begin
+ * @param {Object} end
+ */
+ geDateAll(begin, end) {
+ var arr = []
+ var ab = begin.split('-')
+ var ae = end.split('-')
+ var db = new Date()
+ db.setFullYear(ab[0], ab[1] - 1, ab[2])
+ var de = new Date()
+ de.setFullYear(ae[0], ae[1] - 1, ae[2])
+ var unixDb = db.getTime() - 24 * 60 * 60 * 1000
+ var unixDe = de.getTime() - 24 * 60 * 60 * 1000
+ for (var k = unixDb; k <= unixDe;) {
+ k = k + 24 * 60 * 60 * 1000
+ arr.push(this.getDate(new Date(parseInt(k))).fullDate)
+ }
+ return arr
+ }
+ /**
+ * 计算阴历日期显示
+ */
+ getlunar(year, month, date) {
+ return CALENDAR.solar2lunar(year, month, date)
+ }
+ /**
+ * 设置打点
+ */
+ setSelectInfo(data, value) {
+ this.selected = value
+ this._getWeek(data)
+ }
+
+ /**
+ * 获取多选状态
+ */
+ setMultiple(fullDate) {
+ let {
+ before,
+ after
+ } = this.multipleStatus
+
+ if (!this.range) return
+ if (before && after) {
+ if (!this.lastHover) {
+ this.lastHover = true
+ return
+ }
+ this.multipleStatus.before = ''
+ this.multipleStatus.after = ''
+ this.multipleStatus.data = []
+ this.multipleStatus.fulldate = ''
+ this.lastHover = false
+ } else {
+ this.lastHover = false
+ if (!before) {
+ this.multipleStatus.before = fullDate
+ } else {
+ this.multipleStatus.after = fullDate
+ if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
+ this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus
+ .after);
+ } else {
+ this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus
+ .before);
+ }
+ }
+ }
+ this._getWeek(fullDate)
+ }
+
+ /**
+ * 鼠标 hover 更新多选状态
+ */
+ setHoverMultiple(fullDate) {
+ let {
+ before,
+ after
+ } = this.multipleStatus
+
+ if (!this.range) return
+ if (this.lastHover) return
+
+ if (!before) {
+ this.multipleStatus.before = fullDate
+ } else {
+ this.multipleStatus.after = fullDate
+ if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
+ this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
+ } else {
+ this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
+ }
+ }
+ this._getWeek(fullDate)
+ }
+
+ /**
+ * 更新默认值多选状态
+ */
+ setDefaultMultiple(before, after) {
+ this.multipleStatus.before = before
this.multipleStatus.after = after
if (before && after) {
if (this.dateCompare(before, after)) {
@@ -357,52 +357,52 @@ class Calendar {
this._getWeek(before)
}
}
- }
-
- /**
- * 获取每周数据
- * @param {Object} dateData
- */
- _getWeek(dateData) {
- const {
- fullDate,
- year,
- month,
- date,
- day
- } = this.getDate(dateData)
- let firstDay = new Date(year, month - 1, 1).getDay()
- let currentDay = new Date(year, month, 0).getDate()
- let dates = {
- lastMonthDays: this._getLastMonthDays(firstDay, this.getDate(dateData)), // 上个月末尾几天
- currentMonthDys: this._currentMonthDys(currentDay, this.getDate(dateData)), // 本月天数
- nextMonthDays: [], // 下个月开始几天
- weeks: []
- }
- let canlender = []
- const surplus = 42 - (dates.lastMonthDays.length + dates.currentMonthDys.length)
- dates.nextMonthDays = this._getNextMonthDays(surplus, this.getDate(dateData))
- canlender = canlender.concat(dates.lastMonthDays, dates.currentMonthDys, dates.nextMonthDays)
- let weeks = {}
- // 拼接数组 上个月开始几天 + 本月天数+ 下个月开始几天
- for (let i = 0; i < canlender.length; i++) {
- if (i % 7 === 0) {
- weeks[parseInt(i / 7)] = new Array(7)
- }
- weeks[parseInt(i / 7)][i % 7] = canlender[i]
- }
- this.canlender = canlender
- this.weeks = weeks
- }
-
- //静态方法
- // static init(date) {
- // if (!this.instance) {
- // this.instance = new Calendar(date);
- // }
- // return this.instance;
- // }
-}
-
-
+ }
+
+ /**
+ * 获取每周数据
+ * @param {Object} dateData
+ */
+ _getWeek(dateData) {
+ const {
+ fullDate,
+ year,
+ month,
+ date,
+ day
+ } = this.getDate(dateData)
+ let firstDay = new Date(year, month - 1, 1).getDay()
+ let currentDay = new Date(year, month, 0).getDate()
+ let dates = {
+ lastMonthDays: this._getLastMonthDays(firstDay, this.getDate(dateData)), // 上个月末尾几天
+ currentMonthDys: this._currentMonthDys(currentDay, this.getDate(dateData)), // 本月天数
+ nextMonthDays: [], // 下个月开始几天
+ weeks: []
+ }
+ let canlender = []
+ const surplus = 42 - (dates.lastMonthDays.length + dates.currentMonthDys.length)
+ dates.nextMonthDays = this._getNextMonthDays(surplus, this.getDate(dateData))
+ canlender = canlender.concat(dates.lastMonthDays, dates.currentMonthDys, dates.nextMonthDays)
+ let weeks = {}
+ // 拼接数组 上个月开始几天 + 本月天数+ 下个月开始几天
+ for (let i = 0; i < canlender.length; i++) {
+ if (i % 7 === 0) {
+ weeks[parseInt(i / 7)] = new Array(7)
+ }
+ weeks[parseInt(i / 7)][i % 7] = canlender[i]
+ }
+ this.canlender = canlender
+ this.weeks = weeks
+ }
+
+ //静态方法
+ // static init(date) {
+ // if (!this.instance) {
+ // this.instance = new Calendar(date);
+ // }
+ // return this.instance;
+ // }
+}
+
+
export default Calendar
diff --git a/uni_modules/uni-drawer/changelog.md b/uni_modules/uni-drawer/changelog.md
index c8eed01969f6b14644b452e0c3b28f7ad2ecd3ff..4077ce1c7bc2395b11e54e36fe987409da90d421 100644
--- a/uni_modules/uni-drawer/changelog.md
+++ b/uni_modules/uni-drawer/changelog.md
@@ -1,8 +1,8 @@
## 1.1.1(2021-07-30)
- 优化 vue3下事件警告的问题
-## 1.1.0(2021-07-13)
-- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.0.7(2021-05-12)
-- 新增 组件示例地址
-## 1.0.6(2021-02-04)
-- 调整为uni_modules目录规范
+## 1.1.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.0.7(2021-05-12)
+- 新增 组件示例地址
+## 1.0.6(2021-02-04)
+- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-drawer/components/uni-drawer/keypress.js b/uni_modules/uni-drawer/components/uni-drawer/keypress.js
index 62dda461bd5d5923a173e541f2cf049d816d612b..16a5818818d5f6f9a6c90b7ae4e9a6f1386f8524 100644
--- a/uni_modules/uni-drawer/components/uni-drawer/keypress.js
+++ b/uni_modules/uni-drawer/components/uni-drawer/keypress.js
@@ -1,45 +1,45 @@
-// #ifdef H5
-export default {
- name: 'Keypress',
- props: {
- disable: {
- type: Boolean,
- default: false
- }
- },
- mounted () {
- const keyNames = {
- esc: ['Esc', 'Escape'],
- tab: 'Tab',
- enter: 'Enter',
- space: [' ', 'Spacebar'],
- up: ['Up', 'ArrowUp'],
- left: ['Left', 'ArrowLeft'],
- right: ['Right', 'ArrowRight'],
- down: ['Down', 'ArrowDown'],
- delete: ['Backspace', 'Delete', 'Del']
- }
- const listener = ($event) => {
- if (this.disable) {
- return
- }
- const keyName = Object.keys(keyNames).find(key => {
- const keyName = $event.key
- const value = keyNames[key]
- return value === keyName || (Array.isArray(value) && value.includes(keyName))
- })
- if (keyName) {
- // 避免和其他按键事件冲突
- setTimeout(() => {
- this.$emit(keyName, {})
- }, 0)
- }
- }
- document.addEventListener('keyup', listener)
- // this.$once('hook:beforeDestroy', () => {
- // document.removeEventListener('keyup', listener)
- // })
- },
- render: () => {}
-}
-// #endif
+// #ifdef H5
+export default {
+ name: 'Keypress',
+ props: {
+ disable: {
+ type: Boolean,
+ default: false
+ }
+ },
+ mounted () {
+ const keyNames = {
+ esc: ['Esc', 'Escape'],
+ tab: 'Tab',
+ enter: 'Enter',
+ space: [' ', 'Spacebar'],
+ up: ['Up', 'ArrowUp'],
+ left: ['Left', 'ArrowLeft'],
+ right: ['Right', 'ArrowRight'],
+ down: ['Down', 'ArrowDown'],
+ delete: ['Backspace', 'Delete', 'Del']
+ }
+ const listener = ($event) => {
+ if (this.disable) {
+ return
+ }
+ const keyName = Object.keys(keyNames).find(key => {
+ const keyName = $event.key
+ const value = keyNames[key]
+ return value === keyName || (Array.isArray(value) && value.includes(keyName))
+ })
+ if (keyName) {
+ // 避免和其他按键事件冲突
+ setTimeout(() => {
+ this.$emit(keyName, {})
+ }, 0)
+ }
+ }
+ document.addEventListener('keyup', listener)
+ // this.$once('hook:beforeDestroy', () => {
+ // document.removeEventListener('keyup', listener)
+ // })
+ },
+ render: () => {}
+}
+// #endif
diff --git a/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue b/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue
index c3cb00bb43e7a7025526b825bb3794b874a44653..253d7f502cf32ba8cc27b95d46f98ae5c76514b7 100644
--- a/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue
+++ b/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue
@@ -1,53 +1,53 @@
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
diff --git a/uni_modules/uni-drawer/package.json b/uni_modules/uni-drawer/package.json
index 0fad43f6303f91845bcbad3d97e72c9018c1c79d..446171bc382728ee1ce8d4448fc81747bcc6596b 100644
--- a/uni_modules/uni-drawer/package.json
+++ b/uni_modules/uni-drawer/package.json
@@ -1,83 +1,83 @@
-{
- "id": "uni-drawer",
- "displayName": "uni-drawer 抽屉",
- "version": "1.1.1",
- "description": "抽屉式导航,用于展示侧滑菜单,侧滑导航。",
- "keywords": [
- "uni-ui",
- "uniui",
- "drawer",
- "抽屉",
- "侧滑导航"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-drawer",
+ "displayName": "uni-drawer 抽屉",
+ "version": "1.1.1",
+ "description": "抽屉式导航,用于展示侧滑菜单,侧滑导航。",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "drawer",
+ "抽屉",
+ "侧滑导航"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-easyinput/changelog.md b/uni_modules/uni-easyinput/changelog.md
index 80dc9fbaebe1c4f004ea2f1972f8eb9611939b16..b9c0029b5d1c0725e7c79df5433866e776f4306b 100644
--- a/uni_modules/uni-easyinput/changelog.md
+++ b/uni_modules/uni-easyinput/changelog.md
@@ -1,28 +1,28 @@
## 0.1.4(2021-08-20)
- 修复 在 uni-forms 的动态表单中默认值校验不通过的 bug
-## 0.1.3(2021-08-11)
-- 修复 在 uni-forms 中重置表单,错误信息无法清除的问题
-## 0.1.2(2021-07-30)
-- 优化 vue3下事件警告的问题
-## 0.1.1
-- 优化 errorMessage 属性支持 Boolean 类型
-## 0.1.0(2021-07-13)
-- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 0.0.16(2021-06-29)
-- 修复 confirmType 属性(仅 type="text" 生效)导致多行文本框无法换行的 bug
-## 0.0.15(2021-06-21)
-- 修复 passwordIcon 属性拼写错误的 bug
-## 0.0.14(2021-06-18)
-- 新增 passwordIcon 属性,当type=password时是否显示小眼睛图标
-- 修复 confirmType 属性不生效的问题
-## 0.0.13(2021-06-04)
-- 修复 disabled 状态可清出内容的 bug
-## 0.0.12(2021-05-12)
-- 新增 组件示例地址
-## 0.0.11(2021-05-07)
-- 修复 input-border 属性不生效的问题
-## 0.0.10(2021-04-30)
-- 修复 ios 遮挡文字、显示一半的问题
-## 0.0.9(2021-02-05)
-- 调整为uni_modules目录规范
-- 优化 兼容 nvue 页面
+## 0.1.3(2021-08-11)
+- 修复 在 uni-forms 中重置表单,错误信息无法清除的问题
+## 0.1.2(2021-07-30)
+- 优化 vue3下事件警告的问题
+## 0.1.1
+- 优化 errorMessage 属性支持 Boolean 类型
+## 0.1.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 0.0.16(2021-06-29)
+- 修复 confirmType 属性(仅 type="text" 生效)导致多行文本框无法换行的 bug
+## 0.0.15(2021-06-21)
+- 修复 passwordIcon 属性拼写错误的 bug
+## 0.0.14(2021-06-18)
+- 新增 passwordIcon 属性,当type=password时是否显示小眼睛图标
+- 修复 confirmType 属性不生效的问题
+## 0.0.13(2021-06-04)
+- 修复 disabled 状态可清出内容的 bug
+## 0.0.12(2021-05-12)
+- 新增 组件示例地址
+## 0.0.11(2021-05-07)
+- 修复 input-border 属性不生效的问题
+## 0.0.10(2021-04-30)
+- 修复 ios 遮挡文字、显示一半的问题
+## 0.0.9(2021-02-05)
+- 调整为uni_modules目录规范
+- 优化 兼容 nvue 页面
diff --git a/uni_modules/uni-easyinput/components/uni-easyinput/common.js b/uni_modules/uni-easyinput/components/uni-easyinput/common.js
index df9abe1da71fd2245aba33c6d31dadd62e39c47c..5549cc993e5af6a6b50b3fc2bcd2543c2472b547 100644
--- a/uni_modules/uni-easyinput/components/uni-easyinput/common.js
+++ b/uni_modules/uni-easyinput/components/uni-easyinput/common.js
@@ -1,56 +1,56 @@
-/**
- * @desc 函数防抖
- * @param func 目标函数
- * @param wait 延迟执行毫秒数
- * @param immediate true - 立即执行, false - 延迟执行
- */
-export const debounce = function(func, wait = 1000, immediate = true) {
- let timer;
- console.log(1);
- return function() {
- console.log(123);
- let context = this,
- args = arguments;
- if (timer) clearTimeout(timer);
- if (immediate) {
- let callNow = !timer;
- timer = setTimeout(() => {
- timer = null;
- }, wait);
- if (callNow) func.apply(context, args);
- } else {
- timer = setTimeout(() => {
- func.apply(context, args);
- }, wait)
- }
- }
-}
-/**
- * @desc 函数节流
- * @param func 函数
- * @param wait 延迟执行毫秒数
- * @param type 1 使用表时间戳,在时间段开始的时候触发 2 使用表定时器,在时间段结束的时候触发
- */
-export const throttle = (func, wait = 1000, type = 1) => {
- let previous = 0;
- let timeout;
- return function() {
- let context = this;
- let args = arguments;
- if (type === 1) {
- let now = Date.now();
-
- if (now - previous > wait) {
- func.apply(context, args);
- previous = now;
- }
- } else if (type === 2) {
- if (!timeout) {
- timeout = setTimeout(() => {
- timeout = null;
- func.apply(context, args)
- }, wait)
- }
- }
- }
+/**
+ * @desc 函数防抖
+ * @param func 目标函数
+ * @param wait 延迟执行毫秒数
+ * @param immediate true - 立即执行, false - 延迟执行
+ */
+export const debounce = function(func, wait = 1000, immediate = true) {
+ let timer;
+ console.log(1);
+ return function() {
+ console.log(123);
+ let context = this,
+ args = arguments;
+ if (timer) clearTimeout(timer);
+ if (immediate) {
+ let callNow = !timer;
+ timer = setTimeout(() => {
+ timer = null;
+ }, wait);
+ if (callNow) func.apply(context, args);
+ } else {
+ timer = setTimeout(() => {
+ func.apply(context, args);
+ }, wait)
+ }
+ }
+}
+/**
+ * @desc 函数节流
+ * @param func 函数
+ * @param wait 延迟执行毫秒数
+ * @param type 1 使用表时间戳,在时间段开始的时候触发 2 使用表定时器,在时间段结束的时候触发
+ */
+export const throttle = (func, wait = 1000, type = 1) => {
+ let previous = 0;
+ let timeout;
+ return function() {
+ let context = this;
+ let args = arguments;
+ if (type === 1) {
+ let now = Date.now();
+
+ if (now - previous > wait) {
+ func.apply(context, args);
+ previous = now;
+ }
+ } else if (type === 2) {
+ if (!timeout) {
+ timeout = setTimeout(() => {
+ timeout = null;
+ func.apply(context, args)
+ }, wait)
+ }
+ }
+ }
}
diff --git a/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue b/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue
index 16911f247bbe9c1437682587ffba6006ebe20653..c0a242f52b01ddd26a1c38e41f3bb46c4bddc138 100644
--- a/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue
+++ b/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue
@@ -1,461 +1,461 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
diff --git a/uni_modules/uni-easyinput/package.json b/uni_modules/uni-easyinput/package.json
index cb436acb9391929557096a95741ecfba9f3d1956..408a182e8574e75949901b52ff531ceb5fc3e506 100644
--- a/uni_modules/uni-easyinput/package.json
+++ b/uni_modules/uni-easyinput/package.json
@@ -1,89 +1,89 @@
-{
- "id": "uni-easyinput",
- "displayName": "uni-easyinput 增强输入框",
- "version": "0.1.4",
- "description": "Easyinput 组件是对原生input组件的增强",
- "keywords": [
- "uni-ui",
- "uniui",
- "input",
- "uni-easyinput",
- "输入框"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [
- "uni-icons"
- ],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- },
- "Vue": {
- "vue2": "y",
- "vue3": "u"
- }
- }
- }
- }
+{
+ "id": "uni-easyinput",
+ "displayName": "uni-easyinput 增强输入框",
+ "version": "0.1.4",
+ "description": "Easyinput 组件是对原生input组件的增强",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "input",
+ "uni-easyinput",
+ "输入框"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-icons"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-fab/changelog.md b/uni_modules/uni-fab/changelog.md
index cbf69d6a572103f2046e3c25adabe0b353b74fd0..1895c7d7acf1dad0da2edebf9dd4e41b8ce51f9e 100644
--- a/uni_modules/uni-fab/changelog.md
+++ b/uni_modules/uni-fab/changelog.md
@@ -1,8 +1,8 @@
## 1.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.0.7(2021-05-12)
-- 新增 组件示例地址
-## 1.0.6(2021-02-05)
-- 调整为uni_modules目录规范
-- 优化 按钮背景色调整
-- 优化 兼容pc端
+## 1.0.7(2021-05-12)
+- 新增 组件示例地址
+## 1.0.6(2021-02-05)
+- 调整为uni_modules目录规范
+- 优化 按钮背景色调整
+- 优化 兼容pc端
diff --git a/uni_modules/uni-fab/components/uni-fab/uni-fab.vue b/uni_modules/uni-fab/components/uni-fab/uni-fab.vue
index 0afab66ee8185475dc2618e8db85175b5a3a856c..599a2d4996d50263e5514f02d38aac6879b758a1 100644
--- a/uni_modules/uni-fab/components/uni-fab/uni-fab.vue
+++ b/uni_modules/uni-fab/components/uni-fab/uni-fab.vue
@@ -1,448 +1,448 @@
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-fab/components/uni-fab/uni-fab.vue.bak b/uni_modules/uni-fab/components/uni-fab/uni-fab.vue.bak
index 9df4dcd7f5958b17b962e9d37c52c298d549ad00..10afebdb4324388ef046692aa8ee50ab022cb442 100644
--- a/uni_modules/uni-fab/components/uni-fab/uni-fab.vue.bak
+++ b/uni_modules/uni-fab/components/uni-fab/uni-fab.vue.bak
@@ -1,383 +1,383 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-fab/package.json b/uni_modules/uni-fab/package.json
index 84cb81408a8e9439ae57447dad27aa6bab8e4ad6..9e71b42a16e7a81e74174a06029f29182e971299 100644
--- a/uni_modules/uni-fab/package.json
+++ b/uni_modules/uni-fab/package.json
@@ -1,83 +1,83 @@
-{
- "id": "uni-fab",
- "displayName": "uni-fab 悬浮按钮",
- "version": "1.1.0",
- "description": "悬浮按钮 fab button ,点击可展开一个图标按钮菜单。",
- "keywords": [
- "uni-ui",
- "uniui",
- "按钮",
- "悬浮按钮",
- "fab"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
-}
+{
+ "id": "uni-fab",
+ "displayName": "uni-fab 悬浮按钮",
+ "version": "1.1.0",
+ "description": "悬浮按钮 fab button ,点击可展开一个图标按钮菜单。",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "按钮",
+ "悬浮按钮",
+ "fab"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
+}
diff --git a/uni_modules/uni-fav/components/uni-fav/i18n/en.json b/uni_modules/uni-fav/components/uni-fav/i18n/en.json
index 9a0759e0214562df0a0e69aca7760e288b68366b..b288cb0334ef3024ecb0606f889bdd854221cd3e 100644
--- a/uni_modules/uni-fav/components/uni-fav/i18n/en.json
+++ b/uni_modules/uni-fav/components/uni-fav/i18n/en.json
@@ -1,4 +1,4 @@
-{
- "uni-fav.collect": "collect",
- "uni-fav.collected": "collected"
+{
+ "uni-fav.collect": "collect",
+ "uni-fav.collected": "collected"
}
diff --git a/uni_modules/uni-fav/components/uni-fav/i18n/index.js b/uni_modules/uni-fav/components/uni-fav/i18n/index.js
index de7509c87ba5197b9f5d20ca94a0558c7a8e08a9..fa8f0f3734de6effb137592fce6c0f722c048432 100644
--- a/uni_modules/uni-fav/components/uni-fav/i18n/index.js
+++ b/uni_modules/uni-fav/components/uni-fav/i18n/index.js
@@ -1,8 +1,8 @@
-import en from './en.json'
-import zhHans from './zh-Hans.json'
-import zhHant from './zh-Hant.json'
-export default {
- en,
- 'zh-Hans': zhHans,
- 'zh-Hant': zhHant
+import en from './en.json'
+import zhHans from './zh-Hans.json'
+import zhHant from './zh-Hant.json'
+export default {
+ en,
+ 'zh-Hans': zhHans,
+ 'zh-Hant': zhHant
}
diff --git a/uni_modules/uni-fav/components/uni-fav/i18n/zh-Hans.json b/uni_modules/uni-fav/components/uni-fav/i18n/zh-Hans.json
index 67c89bfc7e5b57a51a04aa655d39c895325e8308..41ccefbb01b7c9530fe4c7c27a9b576e4f69c3fc 100644
--- a/uni_modules/uni-fav/components/uni-fav/i18n/zh-Hans.json
+++ b/uni_modules/uni-fav/components/uni-fav/i18n/zh-Hans.json
@@ -1,4 +1,4 @@
-{
- "uni-fav.collect": "收藏",
- "uni-fav.collected": "已收藏"
+{
+ "uni-fav.collect": "收藏",
+ "uni-fav.collected": "已收藏"
}
diff --git a/uni_modules/uni-fav/components/uni-fav/i18n/zh-Hant.json b/uni_modules/uni-fav/components/uni-fav/i18n/zh-Hant.json
index 67c89bfc7e5b57a51a04aa655d39c895325e8308..41ccefbb01b7c9530fe4c7c27a9b576e4f69c3fc 100644
--- a/uni_modules/uni-fav/components/uni-fav/i18n/zh-Hant.json
+++ b/uni_modules/uni-fav/components/uni-fav/i18n/zh-Hant.json
@@ -1,4 +1,4 @@
-{
- "uni-fav.collect": "收藏",
- "uni-fav.collected": "已收藏"
+{
+ "uni-fav.collect": "收藏",
+ "uni-fav.collected": "已收藏"
}
diff --git a/uni_modules/uni-fav/components/uni-fav/uni-fav.vue b/uni_modules/uni-fav/components/uni-fav/uni-fav.vue
index d82864bb9249847d6fe68600dd5d96fb1512cc5a..b86424586d3596d8c7a11ec35285d402783b6924 100644
--- a/uni_modules/uni-fav/components/uni-fav/uni-fav.vue
+++ b/uni_modules/uni-fav/components/uni-fav/uni-fav.vue
@@ -1,20 +1,20 @@
-
-
-
-
-
-
-
-
-
-
- {{ checked ? contentFav : contentDefault }}
-
-
-
-
-
-
+ /* #endif */
+ }
+
+ .uni-fav--circle {
+ border-radius: 30px;
+ }
+
+ .uni-fav-star {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ height: $fav-height;
+ line-height: 24px;
+ margin-right: 3px;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .uni-fav-text {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ height: $fav-height;
+ line-height: $fav-height;
+ align-items: center;
+ justify-content: center;
+ font-size: $uni-font-size-base;
+ }
+
diff --git a/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback.vue b/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback.vue
index 1978c7214009b4b7a6077e78134452ed279d8c14..9c30b673f484ec0f120b7efabfd67178b0746358 100644
--- a/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback.vue
+++ b/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback.vue
@@ -1,140 +1,140 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-feedback/uniCloud/database/opendb-feedback.schema.json b/uni_modules/uni-feedback/uniCloud/database/opendb-feedback.schema.json
index e13d8742204b53ad3632925152228e28de4354e6..45ed18948717441838296916a6954e7158194645 100644
--- a/uni_modules/uni-feedback/uniCloud/database/opendb-feedback.schema.json
+++ b/uni_modules/uni-feedback/uniCloud/database/opendb-feedback.schema.json
@@ -1,72 +1,72 @@
-{
- "bsonType": "object",
- "required": ["content"],
- "permission": {
- "create": "auth.uid != null",
- "read": true,
- "delete": false,
- "update": false
- },
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
- },
- "user_id": {
- "bsonType": "string",
- "description": "留言反馈用户ID\/回复留言用户ID,参考uni-id-users表",
- "foreignKey": "uni-id-users._id",
- "forceDefaultValue": {
- "$env": "uid"
- }
- },
- "create_date": {
- "bsonType": "timestamp",
- "title": "留言时间\/回复留言时间",
- "forceDefaultValue": {
- "$env": "now"
- }
- },
- "content": {
- "bsonType": "string",
- "title": "留言内容\/回复内容",
- "componentForEdit": {
- "name": "textarea"
- },
- "trim": "right"
- },
- "imgs": {
- "bsonType": "array",
- "arrayType": "file",
- "maxLength": 6,
- "fileMediaType": "image",
- "title": "图片列表"
- },
- "is_reply": {
- "bsonType": "bool",
- "title": "是否是回复类型"
- },
- "feedback_id": {
- "bsonType": "string",
- "title": "被回复留言ID"
- },
- "contact": {
- "bsonType": "string",
- "title": "联系人",
- "trim": "both"
- },
- "mobile": {
- "bsonType": "string",
- "title": "联系电话",
- "pattern": "^\\+?[0-9-]{3,20}$",
- "trim": "both"
- },
- "reply_count": {
- "permission": {
- "write": false
- },
- "bsonType": "int",
- "title": "被回复条数",
- "defaultValue": 0
- }
- }
+{
+ "bsonType": "object",
+ "required": ["content"],
+ "permission": {
+ "create": "auth.uid != null",
+ "read": true,
+ "delete": false,
+ "update": false
+ },
+ "properties": {
+ "_id": {
+ "description": "ID,系统自动生成"
+ },
+ "user_id": {
+ "bsonType": "string",
+ "description": "留言反馈用户ID\/回复留言用户ID,参考uni-id-users表",
+ "foreignKey": "uni-id-users._id",
+ "forceDefaultValue": {
+ "$env": "uid"
+ }
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "title": "留言时间\/回复留言时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ }
+ },
+ "content": {
+ "bsonType": "string",
+ "title": "留言内容\/回复内容",
+ "componentForEdit": {
+ "name": "textarea"
+ },
+ "trim": "right"
+ },
+ "imgs": {
+ "bsonType": "array",
+ "arrayType": "file",
+ "maxLength": 6,
+ "fileMediaType": "image",
+ "title": "图片列表"
+ },
+ "is_reply": {
+ "bsonType": "bool",
+ "title": "是否是回复类型"
+ },
+ "feedback_id": {
+ "bsonType": "string",
+ "title": "被回复留言ID"
+ },
+ "contact": {
+ "bsonType": "string",
+ "title": "联系人",
+ "trim": "both"
+ },
+ "mobile": {
+ "bsonType": "string",
+ "title": "联系电话",
+ "pattern": "^\\+?[0-9-]{3,20}$",
+ "trim": "both"
+ },
+ "reply_count": {
+ "permission": {
+ "write": false
+ },
+ "bsonType": "int",
+ "title": "被回复条数",
+ "defaultValue": 0
+ }
+ }
}
diff --git a/uni_modules/uni-file-picker/changelog.md b/uni_modules/uni-file-picker/changelog.md
index df26c52345e85eea3500e547715ac26b25ed9fc9..82bc093d931e4ed56b37b79ab9a90f8b7a1443f9 100644
--- a/uni_modules/uni-file-picker/changelog.md
+++ b/uni_modules/uni-file-picker/changelog.md
@@ -1,52 +1,52 @@
## 0.2.14(2021-08-23)
- 新增 参数中返回 fileID 字段
-## 0.2.13(2021-08-23)
-- 修复 腾讯云传入fileID 不能回显的bug
-- 修复 选择图片后,不能放大的问题
-## 0.2.12(2021-08-17)
-- 修复 由于 0.2.11 版本引起的不能回显图片的Bug
-## 0.2.11(2021-08-16)
-- 新增 clearFiles(index) 方法,可以手动删除指定文件
-- 修复 v-model 值设为 null 报错的Bug
-## 0.2.10(2021-08-13)
-- 修复 return-type="object" 时,无法删除文件的Bug
-## 0.2.9(2021-08-03)
-- 修复 auto-upload 属性失效的Bug
-## 0.2.8(2021-07-31)
-- 修复 fileExtname属性不指定值报错的Bug
-## 0.2.7(2021-07-31)
-- 修复 在某种场景下图片不回显的Bug
-## 0.2.6(2021-07-30)
-- 修复 return-type为object下,返回值不正确的Bug
-## 0.2.5(2021-07-30)
-- 修复(重要) H5 平台下如果和uni-forms组件一同使用导致页面卡死的问题
-## 0.2.3(2021-07-28)
-- 优化 调整示例代码
-## 0.2.2(2021-07-27)
-- 修复 vue3 下赋值错误的Bug
-- 优化 h5平台下上传文件导致页面卡死的问题
-## 0.2.0(2021-07-13)
-- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 0.1.1(2021-07-02)
-- 修复 sourceType 缺少默认值导致 ios 无法选择文件
-## 0.1.0(2021-06-30)
-- 优化 解耦与uniCloud的强绑定关系 ,如不绑定服务空间,默认autoUpload为false且不可更改
-## 0.0.11(2021-06-30)
-- 修复 由 0.0.10 版本引发的 returnType 属性失效的问题
-## 0.0.10(2021-06-29)
-- 优化 文件上传后进度条消失时机
-## 0.0.9(2021-06-29)
-- 修复 在uni-forms 中,删除文件 ,获取的值不对的Bug
-## 0.0.8(2021-06-15)
-- 修复 删除文件时无法触发 v-model 的Bug
-## 0.0.7(2021-05-12)
-- 新增 组件示例地址
-## 0.0.6(2021-04-09)
-- 修复 选择的文件非 file-extname 字段指定的扩展名报错的Bug
-## 0.0.5(2021-04-09)
-- 优化 更新组件示例
-## 0.0.4(2021-04-09)
-- 优化 file-extname 字段支持字符串写法,多个扩展名需要用逗号分隔
-## 0.0.3(2021-02-05)
-- 调整为uni_modules目录规范
-- 修复 微信小程序不指定 fileExtname 属性选择失败的Bug
+## 0.2.13(2021-08-23)
+- 修复 腾讯云传入fileID 不能回显的bug
+- 修复 选择图片后,不能放大的问题
+## 0.2.12(2021-08-17)
+- 修复 由于 0.2.11 版本引起的不能回显图片的Bug
+## 0.2.11(2021-08-16)
+- 新增 clearFiles(index) 方法,可以手动删除指定文件
+- 修复 v-model 值设为 null 报错的Bug
+## 0.2.10(2021-08-13)
+- 修复 return-type="object" 时,无法删除文件的Bug
+## 0.2.9(2021-08-03)
+- 修复 auto-upload 属性失效的Bug
+## 0.2.8(2021-07-31)
+- 修复 fileExtname属性不指定值报错的Bug
+## 0.2.7(2021-07-31)
+- 修复 在某种场景下图片不回显的Bug
+## 0.2.6(2021-07-30)
+- 修复 return-type为object下,返回值不正确的Bug
+## 0.2.5(2021-07-30)
+- 修复(重要) H5 平台下如果和uni-forms组件一同使用导致页面卡死的问题
+## 0.2.3(2021-07-28)
+- 优化 调整示例代码
+## 0.2.2(2021-07-27)
+- 修复 vue3 下赋值错误的Bug
+- 优化 h5平台下上传文件导致页面卡死的问题
+## 0.2.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 0.1.1(2021-07-02)
+- 修复 sourceType 缺少默认值导致 ios 无法选择文件
+## 0.1.0(2021-06-30)
+- 优化 解耦与uniCloud的强绑定关系 ,如不绑定服务空间,默认autoUpload为false且不可更改
+## 0.0.11(2021-06-30)
+- 修复 由 0.0.10 版本引发的 returnType 属性失效的问题
+## 0.0.10(2021-06-29)
+- 优化 文件上传后进度条消失时机
+## 0.0.9(2021-06-29)
+- 修复 在uni-forms 中,删除文件 ,获取的值不对的Bug
+## 0.0.8(2021-06-15)
+- 修复 删除文件时无法触发 v-model 的Bug
+## 0.0.7(2021-05-12)
+- 新增 组件示例地址
+## 0.0.6(2021-04-09)
+- 修复 选择的文件非 file-extname 字段指定的扩展名报错的Bug
+## 0.0.5(2021-04-09)
+- 优化 更新组件示例
+## 0.0.4(2021-04-09)
+- 优化 file-extname 字段支持字符串写法,多个扩展名需要用逗号分隔
+## 0.0.3(2021-02-05)
+- 调整为uni_modules目录规范
+- 修复 微信小程序不指定 fileExtname 属性选择失败的Bug
diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js b/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js
index 24a07f5787f23688cb233546644c28ee0ca7ee29..9c4af20f150f3330a06b74a92e757da4063795ef 100644
--- a/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js
+++ b/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js
@@ -1,224 +1,224 @@
-'use strict';
-
-const ERR_MSG_OK = 'chooseAndUploadFile:ok';
-const ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
-
-function chooseImage(opts) {
- const {
- count,
- sizeType = ['original', 'compressed'],
- sourceType = ['album', 'camera'],
- extension
- } = opts
- return new Promise((resolve, reject) => {
- uni.chooseImage({
- count,
- sizeType,
- sourceType,
- extension,
- success(res) {
- resolve(normalizeChooseAndUploadFileRes(res, 'image'));
- },
- fail(res) {
- reject({
- errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL),
- });
- },
- });
- });
-}
-
-function chooseVideo(opts) {
- const {
- camera,
- compressed,
- maxDuration,
- sourceType = ['album', 'camera'],
- extension
- } = opts;
- return new Promise((resolve, reject) => {
- uni.chooseVideo({
- camera,
- compressed,
- maxDuration,
- sourceType,
- extension,
- success(res) {
- const {
- tempFilePath,
- duration,
- size,
- height,
- width
- } = res;
- resolve(normalizeChooseAndUploadFileRes({
- errMsg: 'chooseVideo:ok',
- tempFilePaths: [tempFilePath],
- tempFiles: [
- {
- name: (res.tempFile && res.tempFile.name) || '',
- path: tempFilePath,
- size,
- type: (res.tempFile && res.tempFile.type) || '',
- width,
- height,
- duration,
- fileType: 'video',
- cloudPath: '',
- }, ],
- }, 'video'));
- },
- fail(res) {
- reject({
- errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL),
- });
- },
- });
- });
-}
-
-function chooseAll(opts) {
- const {
- count,
- extension
- } = opts;
- return new Promise((resolve, reject) => {
- let chooseFile = uni.chooseFile;
- if (typeof wx !== 'undefined' &&
- typeof wx.chooseMessageFile === 'function') {
- chooseFile = wx.chooseMessageFile;
- }
- if (typeof chooseFile !== 'function') {
- return reject({
- errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。',
- });
- }
- chooseFile({
- type: 'all',
- count,
- extension,
- success(res) {
- resolve(normalizeChooseAndUploadFileRes(res));
- },
- fail(res) {
- reject({
- errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL),
- });
- },
- });
- });
-}
-
-function normalizeChooseAndUploadFileRes(res, fileType) {
- res.tempFiles.forEach((item, index) => {
- if (!item.name) {
- item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
- }
- if (fileType) {
- item.fileType = fileType;
- }
- item.cloudPath =
- Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
- });
- if (!res.tempFilePaths) {
- res.tempFilePaths = res.tempFiles.map((file) => file.path);
- }
- return res;
-}
-
-function uploadCloudFiles(files, max = 5, onUploadProgress) {
- files = JSON.parse(JSON.stringify(files))
- const len = files.length
- let count = 0
- let self = this
- return new Promise(resolve => {
- while (count < max) {
- next()
- }
-
- function next() {
- let cur = count++
- if (cur >= len) {
- !files.find(item => !item.url && !item.errMsg) && resolve(files)
- return
- }
- const fileItem = files[cur]
- const index = self.files.findIndex(v => v.uuid === fileItem.uuid)
- fileItem.url = ''
- delete fileItem.errMsg
-
- uniCloud
- .uploadFile({
- filePath: fileItem.path,
- cloudPath: fileItem.cloudPath,
- fileType: fileItem.fileType,
- onUploadProgress: res => {
- res.index = index
- onUploadProgress && onUploadProgress(res)
- }
- })
- .then(res => {
- fileItem.url = res.fileID
- fileItem.index = index
- if (cur < len) {
- next()
- }
- })
- .catch(res => {
- fileItem.errMsg = res.errMsg || res.message
- fileItem.index = index
- if (cur < len) {
- next()
- }
- })
- }
- })
-}
-
-
-
-
-
-function uploadFiles(choosePromise, {
- onChooseFile,
- onUploadProgress
-}) {
- return choosePromise
- .then((res) => {
- if (onChooseFile) {
- const customChooseRes = onChooseFile(res);
- if (typeof customChooseRes !== 'undefined') {
- return Promise.resolve(customChooseRes).then((chooseRes) => typeof chooseRes === 'undefined' ?
- res : chooseRes);
- }
- }
- return res;
- })
- .then((res) => {
- if (res === false) {
- return {
- errMsg: ERR_MSG_OK,
- tempFilePaths: [],
- tempFiles: [],
- };
- }
- return res
- })
-}
-
-function chooseAndUploadFile(opts = {
- type: 'all'
-}) {
- if (opts.type === 'image') {
- return uploadFiles(chooseImage(opts), opts);
- }
- else if (opts.type === 'video') {
- return uploadFiles(chooseVideo(opts), opts);
- }
- return uploadFiles(chooseAll(opts), opts);
-}
-
-export {
- chooseAndUploadFile,
- uploadCloudFiles
+'use strict';
+
+const ERR_MSG_OK = 'chooseAndUploadFile:ok';
+const ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
+
+function chooseImage(opts) {
+ const {
+ count,
+ sizeType = ['original', 'compressed'],
+ sourceType = ['album', 'camera'],
+ extension
+ } = opts
+ return new Promise((resolve, reject) => {
+ uni.chooseImage({
+ count,
+ sizeType,
+ sourceType,
+ extension,
+ success(res) {
+ resolve(normalizeChooseAndUploadFileRes(res, 'image'));
+ },
+ fail(res) {
+ reject({
+ errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL),
+ });
+ },
+ });
+ });
+}
+
+function chooseVideo(opts) {
+ const {
+ camera,
+ compressed,
+ maxDuration,
+ sourceType = ['album', 'camera'],
+ extension
+ } = opts;
+ return new Promise((resolve, reject) => {
+ uni.chooseVideo({
+ camera,
+ compressed,
+ maxDuration,
+ sourceType,
+ extension,
+ success(res) {
+ const {
+ tempFilePath,
+ duration,
+ size,
+ height,
+ width
+ } = res;
+ resolve(normalizeChooseAndUploadFileRes({
+ errMsg: 'chooseVideo:ok',
+ tempFilePaths: [tempFilePath],
+ tempFiles: [
+ {
+ name: (res.tempFile && res.tempFile.name) || '',
+ path: tempFilePath,
+ size,
+ type: (res.tempFile && res.tempFile.type) || '',
+ width,
+ height,
+ duration,
+ fileType: 'video',
+ cloudPath: '',
+ }, ],
+ }, 'video'));
+ },
+ fail(res) {
+ reject({
+ errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL),
+ });
+ },
+ });
+ });
+}
+
+function chooseAll(opts) {
+ const {
+ count,
+ extension
+ } = opts;
+ return new Promise((resolve, reject) => {
+ let chooseFile = uni.chooseFile;
+ if (typeof wx !== 'undefined' &&
+ typeof wx.chooseMessageFile === 'function') {
+ chooseFile = wx.chooseMessageFile;
+ }
+ if (typeof chooseFile !== 'function') {
+ return reject({
+ errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。',
+ });
+ }
+ chooseFile({
+ type: 'all',
+ count,
+ extension,
+ success(res) {
+ resolve(normalizeChooseAndUploadFileRes(res));
+ },
+ fail(res) {
+ reject({
+ errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL),
+ });
+ },
+ });
+ });
+}
+
+function normalizeChooseAndUploadFileRes(res, fileType) {
+ res.tempFiles.forEach((item, index) => {
+ if (!item.name) {
+ item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
+ }
+ if (fileType) {
+ item.fileType = fileType;
+ }
+ item.cloudPath =
+ Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
+ });
+ if (!res.tempFilePaths) {
+ res.tempFilePaths = res.tempFiles.map((file) => file.path);
+ }
+ return res;
+}
+
+function uploadCloudFiles(files, max = 5, onUploadProgress) {
+ files = JSON.parse(JSON.stringify(files))
+ const len = files.length
+ let count = 0
+ let self = this
+ return new Promise(resolve => {
+ while (count < max) {
+ next()
+ }
+
+ function next() {
+ let cur = count++
+ if (cur >= len) {
+ !files.find(item => !item.url && !item.errMsg) && resolve(files)
+ return
+ }
+ const fileItem = files[cur]
+ const index = self.files.findIndex(v => v.uuid === fileItem.uuid)
+ fileItem.url = ''
+ delete fileItem.errMsg
+
+ uniCloud
+ .uploadFile({
+ filePath: fileItem.path,
+ cloudPath: fileItem.cloudPath,
+ fileType: fileItem.fileType,
+ onUploadProgress: res => {
+ res.index = index
+ onUploadProgress && onUploadProgress(res)
+ }
+ })
+ .then(res => {
+ fileItem.url = res.fileID
+ fileItem.index = index
+ if (cur < len) {
+ next()
+ }
+ })
+ .catch(res => {
+ fileItem.errMsg = res.errMsg || res.message
+ fileItem.index = index
+ if (cur < len) {
+ next()
+ }
+ })
+ }
+ })
+}
+
+
+
+
+
+function uploadFiles(choosePromise, {
+ onChooseFile,
+ onUploadProgress
+}) {
+ return choosePromise
+ .then((res) => {
+ if (onChooseFile) {
+ const customChooseRes = onChooseFile(res);
+ if (typeof customChooseRes !== 'undefined') {
+ return Promise.resolve(customChooseRes).then((chooseRes) => typeof chooseRes === 'undefined' ?
+ res : chooseRes);
+ }
+ }
+ return res;
+ })
+ .then((res) => {
+ if (res === false) {
+ return {
+ errMsg: ERR_MSG_OK,
+ tempFilePaths: [],
+ tempFiles: [],
+ };
+ }
+ return res
+ })
+}
+
+function chooseAndUploadFile(opts = {
+ type: 'all'
+}) {
+ if (opts.type === 'image') {
+ return uploadFiles(chooseImage(opts), opts);
+ }
+ else if (opts.type === 'video') {
+ return uploadFiles(chooseVideo(opts), opts);
+ }
+ return uploadFiles(chooseAll(opts), opts);
+}
+
+export {
+ chooseAndUploadFile,
+ uploadCloudFiles
};
diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue b/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue
index ddf1c93b5fb43c1ab38cc8b5412ef5e73de09a34..ba4d742e367ba4e38e705d2371d1b9f15d6606e9 100644
--- a/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue
+++ b/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue
@@ -1,652 +1,652 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue b/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue
index 625d92ec72822c33e50deb5cda45304ff76a59fb..eb1840b75b51fcacc1cd09e8d187cc46770107b7 100644
--- a/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue
+++ b/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue
@@ -1,325 +1,325 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.name}}
-
-
-
-
-
-
-
-
-
- 点击重试
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue b/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue
index 6d6cdc0785164e0d9043280df5fdda6e163d4fa8..6b1741d9a1acae86e978225a414380b3ddd4ca93 100644
--- a/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue
+++ b/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue
@@ -1,290 +1,290 @@
-
+
-
-
-
-
-
-
-
-
-
- 点击重试
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/utils.js b/uni_modules/uni-file-picker/components/uni-file-picker/utils.js
index 60aaa3e4ebccc9cf9f456feb3cd6fa5a87a1f5ca..6d94b1a7ae219e4d5c1d39395a597039b0deadb3 100644
--- a/uni_modules/uni-file-picker/components/uni-file-picker/utils.js
+++ b/uni_modules/uni-file-picker/components/uni-file-picker/utils.js
@@ -1,109 +1,109 @@
-/**
- * 获取文件名和后缀
- * @param {String} name
- */
-export const get_file_ext = (name) => {
- const last_len = name.lastIndexOf('.')
- const len = name.length
- return {
- name: name.substring(0, last_len),
- ext: name.substring(last_len + 1, len)
- }
-}
-
-/**
- * 获取扩展名
- * @param {Array} fileExtname
- */
-export const get_extname = (fileExtname) => {
- if (!Array.isArray(fileExtname)) {
- let extname = fileExtname.replace(/(\[|\])/g, '')
- return extname.split(',')
- } else {
- return fileExtname
- }
- return []
-}
-
-/**
- * 获取文件和检测是否可选
- */
-export const get_files_and_is_max = (res, _extname) => {
- let filePaths = []
- let files = []
- if(!_extname || _extname.length === 0){
- return {
- filePaths,
- files
- }
- }
- res.tempFiles.forEach(v => {
- let fileFullName = get_file_ext(v.name)
- const extname = fileFullName.ext.toLowerCase()
- if (_extname.indexOf(extname) !== -1) {
- files.push(v)
- filePaths.push(v.path)
- }
- })
- if (files.length !== res.tempFiles.length) {
- uni.showToast({
- title: `当前选择了${res.tempFiles.length}个文件 ,${res.tempFiles.length - files.length} 个文件格式不正确`,
- icon: 'none',
- duration: 5000
- })
- }
-
- return {
- filePaths,
- files
- }
-}
-
-
-/**
- * 获取图片信息
- * @param {Object} filepath
- */
-export const get_file_info = (filepath) => {
- return new Promise((resolve, reject) => {
- uni.getImageInfo({
- src: filepath,
- success(res) {
- resolve(res)
- },
- fail(err) {
- reject(err)
- }
- })
- })
-}
-/**
- * 获取封装数据
- */
-export const get_file_data = async (files, type = 'image') => {
- // 最终需要上传数据库的数据
- let fileFullName = get_file_ext(files.name)
- const extname = fileFullName.ext.toLowerCase()
- let filedata = {
- name: files.name,
- uuid: files.uuid,
- extname: extname || '',
- cloudPath: files.cloudPath,
- fileType: files.fileType,
- url: files.path || files.path,
- size: files.size, //单位是字节
- image: {},
- path: files.path,
- video: {}
- }
- if (type === 'image') {
- const imageinfo = await get_file_info(files.path)
- delete filedata.video
- filedata.image.width = imageinfo.width
- filedata.image.height = imageinfo.height
- filedata.image.location = imageinfo.path
- } else {
- delete filedata.image
- }
- return filedata
-}
+/**
+ * 获取文件名和后缀
+ * @param {String} name
+ */
+export const get_file_ext = (name) => {
+ const last_len = name.lastIndexOf('.')
+ const len = name.length
+ return {
+ name: name.substring(0, last_len),
+ ext: name.substring(last_len + 1, len)
+ }
+}
+
+/**
+ * 获取扩展名
+ * @param {Array} fileExtname
+ */
+export const get_extname = (fileExtname) => {
+ if (!Array.isArray(fileExtname)) {
+ let extname = fileExtname.replace(/(\[|\])/g, '')
+ return extname.split(',')
+ } else {
+ return fileExtname
+ }
+ return []
+}
+
+/**
+ * 获取文件和检测是否可选
+ */
+export const get_files_and_is_max = (res, _extname) => {
+ let filePaths = []
+ let files = []
+ if(!_extname || _extname.length === 0){
+ return {
+ filePaths,
+ files
+ }
+ }
+ res.tempFiles.forEach(v => {
+ let fileFullName = get_file_ext(v.name)
+ const extname = fileFullName.ext.toLowerCase()
+ if (_extname.indexOf(extname) !== -1) {
+ files.push(v)
+ filePaths.push(v.path)
+ }
+ })
+ if (files.length !== res.tempFiles.length) {
+ uni.showToast({
+ title: `当前选择了${res.tempFiles.length}个文件 ,${res.tempFiles.length - files.length} 个文件格式不正确`,
+ icon: 'none',
+ duration: 5000
+ })
+ }
+
+ return {
+ filePaths,
+ files
+ }
+}
+
+
+/**
+ * 获取图片信息
+ * @param {Object} filepath
+ */
+export const get_file_info = (filepath) => {
+ return new Promise((resolve, reject) => {
+ uni.getImageInfo({
+ src: filepath,
+ success(res) {
+ resolve(res)
+ },
+ fail(err) {
+ reject(err)
+ }
+ })
+ })
+}
+/**
+ * 获取封装数据
+ */
+export const get_file_data = async (files, type = 'image') => {
+ // 最终需要上传数据库的数据
+ let fileFullName = get_file_ext(files.name)
+ const extname = fileFullName.ext.toLowerCase()
+ let filedata = {
+ name: files.name,
+ uuid: files.uuid,
+ extname: extname || '',
+ cloudPath: files.cloudPath,
+ fileType: files.fileType,
+ url: files.path || files.path,
+ size: files.size, //单位是字节
+ image: {},
+ path: files.path,
+ video: {}
+ }
+ if (type === 'image') {
+ const imageinfo = await get_file_info(files.path)
+ delete filedata.video
+ filedata.image.width = imageinfo.width
+ filedata.image.height = imageinfo.height
+ filedata.image.location = imageinfo.path
+ } else {
+ delete filedata.image
+ }
+ return filedata
+}
diff --git a/uni_modules/uni-file-picker/package.json b/uni_modules/uni-file-picker/package.json
index 0a02dda64ff59b26b0a1eb51a31ebeeed9802fa3..1379d29b9814e1858e6eddc4a055f92db3c64e31 100644
--- a/uni_modules/uni-file-picker/package.json
+++ b/uni_modules/uni-file-picker/package.json
@@ -1,86 +1,86 @@
-{
- "id": "uni-file-picker",
- "displayName": "uni-file-picker 文件选择上传",
- "version": "0.2.14",
- "description": "文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间",
- "keywords": [
- "uni-ui",
- "uniui",
- "图片上传",
- "文件上传"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "n"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- },
- "Vue": {
- "vue2": "y",
- "vue3": "u"
- }
- }
- }
- }
-}
+{
+ "id": "uni-file-picker",
+ "displayName": "uni-file-picker 文件选择上传",
+ "version": "0.2.14",
+ "description": "文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "图片上传",
+ "文件上传"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "n"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "u"
+ }
+ }
+ }
+ }
+}
diff --git a/uni_modules/uni-forms/changelog.md b/uni_modules/uni-forms/changelog.md
index b5b12f0b47b16bb62aab302b6812283f3536e757..1d19e70603b92d713220f7e9bf422343a9348863 100644
--- a/uni_modules/uni-forms/changelog.md
+++ b/uni_modules/uni-forms/changelog.md
@@ -1,53 +1,53 @@
## 1.2.7(2021-08-13)
- 修复 没有添加校验规则的字段依然报错的Bug
-## 1.2.6(2021-08-11)
-- 修复 重置表单错误信息无法清除的问题
-## 1.2.5(2021-08-11)
-- 优化 组件文档
-## 1.2.4(2021-08-11)
-- 修复 表单验证只生效一次的问题
-## 1.2.3(2021-07-30)
-- 优化 vue3下事件警告的问题
-## 1.2.2(2021-07-26)
-- 修复 vue2 下条件编译导致destroyed生命周期失效的Bug
-- 修复 1.2.1 引起的示例在小程序平台报错的Bug
-## 1.2.1(2021-07-22)
-- 修复 动态校验表单,默认值为空的情况下校验失效的Bug
-- 修复 不指定name属性时,运行报错的Bug
-- 优化 label默认宽度从65调整至70,使required为true且四字时不换行
-- 优化 组件示例,新增动态校验示例代码
-- 优化 组件文档,使用方式更清晰
-## 1.2.0(2021-07-13)
-- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.1.2(2021-06-25)
-- 修复 pattern 属性在微信小程序平台无效的问题
-## 1.1.1(2021-06-22)
-- 修复 validate-trigger属性为submit且err-show-type属性为toast时不能弹出的Bug
-## 1.1.0(2021-06-22)
-- 修复 只写setRules方法而导致校验不生效的Bug
-- 修复 由上个办法引发的错误提示文字错位的Bug
-## 1.0.48(2021-06-21)
-- 修复 不设置 label 属性 ,无法设置label插槽的问题
-## 1.0.47(2021-06-21)
-- 修复 不设置label属性,label-width属性不生效的bug
-- 修复 setRules 方法与rules属性冲突的问题
-## 1.0.46(2021-06-04)
-- 修复 动态删减数据导致报错的问题
-## 1.0.45(2021-06-04)
-- 新增 modelValue 属性 ,value 即将废弃
-## 1.0.44(2021-06-02)
-- 新增 uni-forms-item 可以设置单独的 rules
-- 新增 validate 事件增加 keepitem 参数,可以选择那些字段不过滤
-- 优化 submit 事件重命名为 validate
-## 1.0.43(2021-05-12)
-- 新增 组件示例地址
-## 1.0.42(2021-04-30)
-- 修复 自定义检验器失效的问题
-## 1.0.41(2021-03-05)
-- 更新 校验器
-- 修复 表单规则设置类型为 number 的情况下,值为0校验失败的Bug
-## 1.0.40(2021-03-04)
-- 修复 动态显示uni-forms-item的情况下,submit 方法获取值错误的Bug
-## 1.0.39(2021-02-05)
-- 调整为uni_modules目录规范
-- 修复 校验器传入 int 等类型 ,返回String类型的Bug
+## 1.2.6(2021-08-11)
+- 修复 重置表单错误信息无法清除的问题
+## 1.2.5(2021-08-11)
+- 优化 组件文档
+## 1.2.4(2021-08-11)
+- 修复 表单验证只生效一次的问题
+## 1.2.3(2021-07-30)
+- 优化 vue3下事件警告的问题
+## 1.2.2(2021-07-26)
+- 修复 vue2 下条件编译导致destroyed生命周期失效的Bug
+- 修复 1.2.1 引起的示例在小程序平台报错的Bug
+## 1.2.1(2021-07-22)
+- 修复 动态校验表单,默认值为空的情况下校验失效的Bug
+- 修复 不指定name属性时,运行报错的Bug
+- 优化 label默认宽度从65调整至70,使required为true且四字时不换行
+- 优化 组件示例,新增动态校验示例代码
+- 优化 组件文档,使用方式更清晰
+## 1.2.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.1.2(2021-06-25)
+- 修复 pattern 属性在微信小程序平台无效的问题
+## 1.1.1(2021-06-22)
+- 修复 validate-trigger属性为submit且err-show-type属性为toast时不能弹出的Bug
+## 1.1.0(2021-06-22)
+- 修复 只写setRules方法而导致校验不生效的Bug
+- 修复 由上个办法引发的错误提示文字错位的Bug
+## 1.0.48(2021-06-21)
+- 修复 不设置 label 属性 ,无法设置label插槽的问题
+## 1.0.47(2021-06-21)
+- 修复 不设置label属性,label-width属性不生效的bug
+- 修复 setRules 方法与rules属性冲突的问题
+## 1.0.46(2021-06-04)
+- 修复 动态删减数据导致报错的问题
+## 1.0.45(2021-06-04)
+- 新增 modelValue 属性 ,value 即将废弃
+## 1.0.44(2021-06-02)
+- 新增 uni-forms-item 可以设置单独的 rules
+- 新增 validate 事件增加 keepitem 参数,可以选择那些字段不过滤
+- 优化 submit 事件重命名为 validate
+## 1.0.43(2021-05-12)
+- 新增 组件示例地址
+## 1.0.42(2021-04-30)
+- 修复 自定义检验器失效的问题
+## 1.0.41(2021-03-05)
+- 更新 校验器
+- 修复 表单规则设置类型为 number 的情况下,值为0校验失败的Bug
+## 1.0.40(2021-03-04)
+- 修复 动态显示uni-forms-item的情况下,submit 方法获取值错误的Bug
+## 1.0.39(2021-02-05)
+- 调整为uni_modules目录规范
+- 修复 校验器传入 int 等类型 ,返回String类型的Bug
diff --git a/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue b/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue
index 5837320edd038d76ee904f3f12314e974656cf06..b75459b3e6d72b180de8f644444e72f8672bfd73 100644
--- a/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue
+++ b/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue
@@ -1,185 +1,185 @@
-
-
-
-
+
+
+
+
-
- *
-
- {{ label }}
-
-
-
-
-
-
-
- {{ showMsg === 'undertext' ? msg : '' }}
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-forms/components/uni-forms/uni-forms.vue b/uni_modules/uni-forms/components/uni-forms/uni-forms.vue
index 057afc8fedaf34f397fb4afdf1afff6d8955b430..d15b505b0f4dee7f43fa128e462edc44e8e290cf 100644
--- a/uni_modules/uni-forms/components/uni-forms/uni-forms.vue
+++ b/uni_modules/uni-forms/components/uni-forms/uni-forms.vue
@@ -1,472 +1,472 @@
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-forms/components/uni-forms/validate.js b/uni_modules/uni-forms/components/uni-forms/validate.js
index 1834c6cf61559bd1a9b8f2a984ef9b8e13350e98..c29ef7fa2db0193f572a7b2d546ed08c5c056046 100644
--- a/uni_modules/uni-forms/components/uni-forms/validate.js
+++ b/uni_modules/uni-forms/components/uni-forms/validate.js
@@ -1,486 +1,486 @@
-var pattern = {
- email: /^\S+?@\S+?\.\S+?$/,
- idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
- url: new RegExp(
- "^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
- 'i')
-};
-
-const FORMAT_MAPPING = {
- "int": 'integer',
- "bool": 'boolean',
- "double": 'number',
- "long": 'number',
- "password": 'string'
- // "fileurls": 'array'
-}
-
-function formatMessage(args, resources = '') {
- var defaultMessage = ['label']
- defaultMessage.forEach((item) => {
- if (args[item] === undefined) {
- args[item] = ''
- }
- })
-
- let str = resources
- for (let key in args) {
- let reg = new RegExp('{' + key + '}')
- str = str.replace(reg, args[key])
- }
- return str
-}
-
-function isEmptyValue(value, type) {
- if (value === undefined || value === null) {
- return true;
- }
-
- if (typeof value === 'string' && !value) {
- return true;
- }
-
- if (Array.isArray(value) && !value.length) {
- return true;
- }
-
- if (type === 'object' && !Object.keys(value).length) {
- return true;
- }
-
- return false;
-}
-
-const types = {
- integer(value) {
- return types.number(value) && parseInt(value, 10) === value;
- },
- string(value) {
- return typeof value === 'string';
- },
- number(value) {
- if (isNaN(value)) {
- return false;
- }
- return typeof value === 'number';
- },
- "boolean": function(value) {
- return typeof value === 'boolean';
- },
- "float": function(value) {
- return types.number(value) && !types.integer(value);
- },
- array(value) {
- return Array.isArray(value);
- },
- object(value) {
- return typeof value === 'object' && !types.array(value);
- },
- date(value) {
- return value instanceof Date;
- },
- timestamp(value) {
- if (!this.integer(value) || Math.abs(value).toString().length > 16) {
- return false
- }
- return true;
- },
- file(value) {
- return typeof value.url === 'string';
- },
- email(value) {
- return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
- },
- url(value) {
- return typeof value === 'string' && !!value.match(pattern.url);
- },
- pattern(reg, value) {
- try {
- return new RegExp(reg).test(value);
- } catch (e) {
- return false;
- }
- },
- method(value) {
- return typeof value === 'function';
- },
- idcard(value) {
- return typeof value === 'string' && !!value.match(pattern.idcard);
- },
- 'url-https'(value) {
- return this.url(value) && value.startsWith('https://');
- },
- 'url-scheme'(value) {
- return value.startsWith('://');
- },
- 'url-web'(value) {
- return false;
- }
-}
-
-class RuleValidator {
-
- constructor(message) {
- this._message = message
- }
-
- async validateRule(fieldKey, fieldValue, value, data, allData) {
- var result = null
-
- let rules = fieldValue.rules
-
- let hasRequired = rules.findIndex((item) => {
- return item.required
- })
- if (hasRequired < 0) {
- if (value === null || value === undefined) {
- return result
- }
- if (typeof value === 'string' && !value.length) {
- return result
- }
- }
-
- var message = this._message
-
- if (rules === undefined) {
- return message['default']
- }
-
- for (var i = 0; i < rules.length; i++) {
- let rule = rules[i]
- let vt = this._getValidateType(rule)
-
- Object.assign(rule, {
- label: fieldValue.label || `["${fieldKey}"]`
- })
-
- if (RuleValidatorHelper[vt]) {
- result = RuleValidatorHelper[vt](rule, value, message)
- if (result != null) {
- break
- }
- }
-
- if (rule.validateExpr) {
- let now = Date.now()
- let resultExpr = rule.validateExpr(value, allData, now)
- if (resultExpr === false) {
- result = this._getMessage(rule, rule.errorMessage || this._message['default'])
- break
- }
- }
-
- if (rule.validateFunction) {
- result = await this.validateFunction(rule, value, data, allData, vt)
- if (result !== null) {
- break
- }
- }
- }
-
- if (result !== null) {
- result = message.TAG + result
- }
-
- return result
- }
-
- async validateFunction(rule, value, data, allData, vt) {
- let result = null
- try {
- let callbackMessage = null
- const res = await rule.validateFunction(rule, value, allData || data, (message) => {
- callbackMessage = message
- })
- if (callbackMessage || (typeof res === 'string' && res) || res === false) {
- result = this._getMessage(rule, callbackMessage || res, vt)
- }
- } catch (e) {
- result = this._getMessage(rule, e.message, vt)
- }
- return result
- }
-
- _getMessage(rule, message, vt) {
- return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default'])
- }
-
- _getValidateType(rule) {
- var result = ''
- if (rule.required) {
- result = 'required'
- } else if (rule.format) {
- result = 'format'
- } else if (rule.arrayType) {
- result = 'arrayTypeFormat'
- } else if (rule.range) {
- result = 'range'
- } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
- result = 'rangeNumber'
- } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
- result = 'rangeLength'
- } else if (rule.pattern) {
- result = 'pattern'
- } else if (rule.validateFunction) {
- result = 'validateFunction'
- }
- return result
- }
-}
-
-const RuleValidatorHelper = {
- required(rule, value, message) {
- if (rule.required && isEmptyValue(value, rule.format || typeof value)) {
- return formatMessage(rule, rule.errorMessage || message.required);
- }
-
- return null
- },
-
- range(rule, value, message) {
- const {
- range,
- errorMessage
- } = rule;
-
- let list = new Array(range.length);
- for (let i = 0; i < range.length; i++) {
- const item = range[i];
- if (types.object(item) && item.value !== undefined) {
- list[i] = item.value;
- } else {
- list[i] = item;
- }
- }
-
- let result = false
- if (Array.isArray(value)) {
- result = (new Set(value.concat(list)).size === list.length);
- } else {
- if (list.indexOf(value) > -1) {
- result = true;
- }
- }
-
- if (!result) {
- return formatMessage(rule, errorMessage || message['enum']);
- }
-
- return null
- },
-
- rangeNumber(rule, value, message) {
- if (!types.number(value)) {
- return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
- }
-
- let {
- minimum,
- maximum,
- exclusiveMinimum,
- exclusiveMaximum
- } = rule;
- let min = exclusiveMinimum ? value <= minimum : value < minimum;
- let max = exclusiveMaximum ? value >= maximum : value > maximum;
-
- if (minimum !== undefined && min) {
- return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ?
- 'exclusiveMinimum' : 'minimum'
- ])
- } else if (maximum !== undefined && max) {
- return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ?
- 'exclusiveMaximum' : 'maximum'
- ])
- } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
- return formatMessage(rule, rule.errorMessage || message['number'].range)
- }
-
- return null
- },
-
- rangeLength(rule, value, message) {
- if (!types.string(value) && !types.array(value)) {
- return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
- }
-
- let min = rule.minLength;
- let max = rule.maxLength;
- let val = value.length;
-
- if (min !== undefined && val < min) {
- return formatMessage(rule, rule.errorMessage || message['length'].minLength)
- } else if (max !== undefined && val > max) {
- return formatMessage(rule, rule.errorMessage || message['length'].maxLength)
- } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
- return formatMessage(rule, rule.errorMessage || message['length'].range)
- }
-
- return null
- },
-
- pattern(rule, value, message) {
- if (!types['pattern'](rule.pattern, value)) {
- return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
- }
-
- return null
- },
-
- format(rule, value, message) {
- var customTypes = Object.keys(types);
- var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : (rule.format || rule.arrayType);
-
- if (customTypes.indexOf(format) > -1) {
- if (!types[format](value)) {
- return formatMessage(rule, rule.errorMessage || message.typeError);
- }
- }
-
- return null
- },
-
- arrayTypeFormat(rule, value, message) {
- if (!Array.isArray(value)) {
- return formatMessage(rule, rule.errorMessage || message.typeError);
- }
-
- for (let i = 0; i < value.length; i++) {
- const element = value[i];
- let formatResult = this.format(rule, element, message)
- if (formatResult !== null) {
- return formatResult
- }
- }
-
- return null
- }
-}
-
-class SchemaValidator extends RuleValidator {
-
- constructor(schema, options) {
- super(SchemaValidator.message);
-
- this._schema = schema
- this._options = options || null
- }
-
- updateSchema(schema) {
- this._schema = schema
- }
-
- async validate(data, allData) {
- let result = this._checkFieldInSchema(data)
- if (!result) {
- result = await this.invokeValidate(data, false, allData)
- }
- return result.length ? result[0] : null
- }
-
- async validateAll(data, allData) {
- let result = this._checkFieldInSchema(data)
- if (!result) {
- result = await this.invokeValidate(data, true, allData)
- }
- return result
- }
-
- async validateUpdate(data, allData) {
- let result = this._checkFieldInSchema(data)
- if (!result) {
- result = await this.invokeValidateUpdate(data, false, allData)
- }
- return result.length ? result[0] : null
- }
-
- async invokeValidate(data, all, allData) {
- let result = []
- let schema = this._schema
- for (let key in schema) {
- let value = schema[key]
- let errorMessage = await this.validateRule(key, value, data[key], data, allData)
- if (errorMessage != null) {
- result.push({
- key,
- errorMessage
- })
- if (!all) break
- }
- }
- return result
- }
-
- async invokeValidateUpdate(data, all, allData) {
- let result = []
- for (let key in data) {
- let errorMessage = await this.validateRule(key, this._schema[key], data[key], data, allData)
- if (errorMessage != null) {
- result.push({
- key,
- errorMessage
- })
- if (!all) break
- }
- }
- return result
- }
-
- _checkFieldInSchema(data) {
- var keys = Object.keys(data)
- var keys2 = Object.keys(this._schema)
- if (new Set(keys.concat(keys2)).size === keys2.length) {
- return ''
- }
-
- var noExistFields = keys.filter((key) => {
- return keys2.indexOf(key) < 0;
- })
- var errorMessage = formatMessage({
- field: JSON.stringify(noExistFields)
- }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid'])
- return [{
- key: 'invalid',
- errorMessage
- }]
- }
-}
-
-function Message() {
- return {
- TAG: "",
- default: '验证错误',
- defaultInvalid: '提交的字段{field}在数据库中并不存在',
- validateFunction: '验证无效',
- required: '{label}必填',
- 'enum': '{label}超出范围',
- timestamp: '{label}格式无效',
- whitespace: '{label}不能为空',
- typeError: '{label}类型无效',
- date: {
- format: '{label}日期{value}格式无效',
- parse: '{label}日期无法解析,{value}无效',
- invalid: '{label}日期{value}无效'
- },
- length: {
- minLength: '{label}长度不能少于{minLength}',
- maxLength: '{label}长度不能超过{maxLength}',
- range: '{label}必须介于{minLength}和{maxLength}之间'
- },
- number: {
- minimum: '{label}不能小于{minimum}',
- maximum: '{label}不能大于{maximum}',
- exclusiveMinimum: '{label}不能小于等于{minimum}',
- exclusiveMaximum: '{label}不能大于等于{maximum}',
- range: '{label}必须介于{minimum}and{maximum}之间'
- },
- pattern: {
- mismatch: '{label}格式不匹配'
- }
- };
-}
-
-
-SchemaValidator.message = new Message();
-
+var pattern = {
+ email: /^\S+?@\S+?\.\S+?$/,
+ idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
+ url: new RegExp(
+ "^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
+ 'i')
+};
+
+const FORMAT_MAPPING = {
+ "int": 'integer',
+ "bool": 'boolean',
+ "double": 'number',
+ "long": 'number',
+ "password": 'string'
+ // "fileurls": 'array'
+}
+
+function formatMessage(args, resources = '') {
+ var defaultMessage = ['label']
+ defaultMessage.forEach((item) => {
+ if (args[item] === undefined) {
+ args[item] = ''
+ }
+ })
+
+ let str = resources
+ for (let key in args) {
+ let reg = new RegExp('{' + key + '}')
+ str = str.replace(reg, args[key])
+ }
+ return str
+}
+
+function isEmptyValue(value, type) {
+ if (value === undefined || value === null) {
+ return true;
+ }
+
+ if (typeof value === 'string' && !value) {
+ return true;
+ }
+
+ if (Array.isArray(value) && !value.length) {
+ return true;
+ }
+
+ if (type === 'object' && !Object.keys(value).length) {
+ return true;
+ }
+
+ return false;
+}
+
+const types = {
+ integer(value) {
+ return types.number(value) && parseInt(value, 10) === value;
+ },
+ string(value) {
+ return typeof value === 'string';
+ },
+ number(value) {
+ if (isNaN(value)) {
+ return false;
+ }
+ return typeof value === 'number';
+ },
+ "boolean": function(value) {
+ return typeof value === 'boolean';
+ },
+ "float": function(value) {
+ return types.number(value) && !types.integer(value);
+ },
+ array(value) {
+ return Array.isArray(value);
+ },
+ object(value) {
+ return typeof value === 'object' && !types.array(value);
+ },
+ date(value) {
+ return value instanceof Date;
+ },
+ timestamp(value) {
+ if (!this.integer(value) || Math.abs(value).toString().length > 16) {
+ return false
+ }
+ return true;
+ },
+ file(value) {
+ return typeof value.url === 'string';
+ },
+ email(value) {
+ return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
+ },
+ url(value) {
+ return typeof value === 'string' && !!value.match(pattern.url);
+ },
+ pattern(reg, value) {
+ try {
+ return new RegExp(reg).test(value);
+ } catch (e) {
+ return false;
+ }
+ },
+ method(value) {
+ return typeof value === 'function';
+ },
+ idcard(value) {
+ return typeof value === 'string' && !!value.match(pattern.idcard);
+ },
+ 'url-https'(value) {
+ return this.url(value) && value.startsWith('https://');
+ },
+ 'url-scheme'(value) {
+ return value.startsWith('://');
+ },
+ 'url-web'(value) {
+ return false;
+ }
+}
+
+class RuleValidator {
+
+ constructor(message) {
+ this._message = message
+ }
+
+ async validateRule(fieldKey, fieldValue, value, data, allData) {
+ var result = null
+
+ let rules = fieldValue.rules
+
+ let hasRequired = rules.findIndex((item) => {
+ return item.required
+ })
+ if (hasRequired < 0) {
+ if (value === null || value === undefined) {
+ return result
+ }
+ if (typeof value === 'string' && !value.length) {
+ return result
+ }
+ }
+
+ var message = this._message
+
+ if (rules === undefined) {
+ return message['default']
+ }
+
+ for (var i = 0; i < rules.length; i++) {
+ let rule = rules[i]
+ let vt = this._getValidateType(rule)
+
+ Object.assign(rule, {
+ label: fieldValue.label || `["${fieldKey}"]`
+ })
+
+ if (RuleValidatorHelper[vt]) {
+ result = RuleValidatorHelper[vt](rule, value, message)
+ if (result != null) {
+ break
+ }
+ }
+
+ if (rule.validateExpr) {
+ let now = Date.now()
+ let resultExpr = rule.validateExpr(value, allData, now)
+ if (resultExpr === false) {
+ result = this._getMessage(rule, rule.errorMessage || this._message['default'])
+ break
+ }
+ }
+
+ if (rule.validateFunction) {
+ result = await this.validateFunction(rule, value, data, allData, vt)
+ if (result !== null) {
+ break
+ }
+ }
+ }
+
+ if (result !== null) {
+ result = message.TAG + result
+ }
+
+ return result
+ }
+
+ async validateFunction(rule, value, data, allData, vt) {
+ let result = null
+ try {
+ let callbackMessage = null
+ const res = await rule.validateFunction(rule, value, allData || data, (message) => {
+ callbackMessage = message
+ })
+ if (callbackMessage || (typeof res === 'string' && res) || res === false) {
+ result = this._getMessage(rule, callbackMessage || res, vt)
+ }
+ } catch (e) {
+ result = this._getMessage(rule, e.message, vt)
+ }
+ return result
+ }
+
+ _getMessage(rule, message, vt) {
+ return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default'])
+ }
+
+ _getValidateType(rule) {
+ var result = ''
+ if (rule.required) {
+ result = 'required'
+ } else if (rule.format) {
+ result = 'format'
+ } else if (rule.arrayType) {
+ result = 'arrayTypeFormat'
+ } else if (rule.range) {
+ result = 'range'
+ } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
+ result = 'rangeNumber'
+ } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
+ result = 'rangeLength'
+ } else if (rule.pattern) {
+ result = 'pattern'
+ } else if (rule.validateFunction) {
+ result = 'validateFunction'
+ }
+ return result
+ }
+}
+
+const RuleValidatorHelper = {
+ required(rule, value, message) {
+ if (rule.required && isEmptyValue(value, rule.format || typeof value)) {
+ return formatMessage(rule, rule.errorMessage || message.required);
+ }
+
+ return null
+ },
+
+ range(rule, value, message) {
+ const {
+ range,
+ errorMessage
+ } = rule;
+
+ let list = new Array(range.length);
+ for (let i = 0; i < range.length; i++) {
+ const item = range[i];
+ if (types.object(item) && item.value !== undefined) {
+ list[i] = item.value;
+ } else {
+ list[i] = item;
+ }
+ }
+
+ let result = false
+ if (Array.isArray(value)) {
+ result = (new Set(value.concat(list)).size === list.length);
+ } else {
+ if (list.indexOf(value) > -1) {
+ result = true;
+ }
+ }
+
+ if (!result) {
+ return formatMessage(rule, errorMessage || message['enum']);
+ }
+
+ return null
+ },
+
+ rangeNumber(rule, value, message) {
+ if (!types.number(value)) {
+ return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
+ }
+
+ let {
+ minimum,
+ maximum,
+ exclusiveMinimum,
+ exclusiveMaximum
+ } = rule;
+ let min = exclusiveMinimum ? value <= minimum : value < minimum;
+ let max = exclusiveMaximum ? value >= maximum : value > maximum;
+
+ if (minimum !== undefined && min) {
+ return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ?
+ 'exclusiveMinimum' : 'minimum'
+ ])
+ } else if (maximum !== undefined && max) {
+ return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ?
+ 'exclusiveMaximum' : 'maximum'
+ ])
+ } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
+ return formatMessage(rule, rule.errorMessage || message['number'].range)
+ }
+
+ return null
+ },
+
+ rangeLength(rule, value, message) {
+ if (!types.string(value) && !types.array(value)) {
+ return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
+ }
+
+ let min = rule.minLength;
+ let max = rule.maxLength;
+ let val = value.length;
+
+ if (min !== undefined && val < min) {
+ return formatMessage(rule, rule.errorMessage || message['length'].minLength)
+ } else if (max !== undefined && val > max) {
+ return formatMessage(rule, rule.errorMessage || message['length'].maxLength)
+ } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
+ return formatMessage(rule, rule.errorMessage || message['length'].range)
+ }
+
+ return null
+ },
+
+ pattern(rule, value, message) {
+ if (!types['pattern'](rule.pattern, value)) {
+ return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
+ }
+
+ return null
+ },
+
+ format(rule, value, message) {
+ var customTypes = Object.keys(types);
+ var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : (rule.format || rule.arrayType);
+
+ if (customTypes.indexOf(format) > -1) {
+ if (!types[format](value)) {
+ return formatMessage(rule, rule.errorMessage || message.typeError);
+ }
+ }
+
+ return null
+ },
+
+ arrayTypeFormat(rule, value, message) {
+ if (!Array.isArray(value)) {
+ return formatMessage(rule, rule.errorMessage || message.typeError);
+ }
+
+ for (let i = 0; i < value.length; i++) {
+ const element = value[i];
+ let formatResult = this.format(rule, element, message)
+ if (formatResult !== null) {
+ return formatResult
+ }
+ }
+
+ return null
+ }
+}
+
+class SchemaValidator extends RuleValidator {
+
+ constructor(schema, options) {
+ super(SchemaValidator.message);
+
+ this._schema = schema
+ this._options = options || null
+ }
+
+ updateSchema(schema) {
+ this._schema = schema
+ }
+
+ async validate(data, allData) {
+ let result = this._checkFieldInSchema(data)
+ if (!result) {
+ result = await this.invokeValidate(data, false, allData)
+ }
+ return result.length ? result[0] : null
+ }
+
+ async validateAll(data, allData) {
+ let result = this._checkFieldInSchema(data)
+ if (!result) {
+ result = await this.invokeValidate(data, true, allData)
+ }
+ return result
+ }
+
+ async validateUpdate(data, allData) {
+ let result = this._checkFieldInSchema(data)
+ if (!result) {
+ result = await this.invokeValidateUpdate(data, false, allData)
+ }
+ return result.length ? result[0] : null
+ }
+
+ async invokeValidate(data, all, allData) {
+ let result = []
+ let schema = this._schema
+ for (let key in schema) {
+ let value = schema[key]
+ let errorMessage = await this.validateRule(key, value, data[key], data, allData)
+ if (errorMessage != null) {
+ result.push({
+ key,
+ errorMessage
+ })
+ if (!all) break
+ }
+ }
+ return result
+ }
+
+ async invokeValidateUpdate(data, all, allData) {
+ let result = []
+ for (let key in data) {
+ let errorMessage = await this.validateRule(key, this._schema[key], data[key], data, allData)
+ if (errorMessage != null) {
+ result.push({
+ key,
+ errorMessage
+ })
+ if (!all) break
+ }
+ }
+ return result
+ }
+
+ _checkFieldInSchema(data) {
+ var keys = Object.keys(data)
+ var keys2 = Object.keys(this._schema)
+ if (new Set(keys.concat(keys2)).size === keys2.length) {
+ return ''
+ }
+
+ var noExistFields = keys.filter((key) => {
+ return keys2.indexOf(key) < 0;
+ })
+ var errorMessage = formatMessage({
+ field: JSON.stringify(noExistFields)
+ }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid'])
+ return [{
+ key: 'invalid',
+ errorMessage
+ }]
+ }
+}
+
+function Message() {
+ return {
+ TAG: "",
+ default: '验证错误',
+ defaultInvalid: '提交的字段{field}在数据库中并不存在',
+ validateFunction: '验证无效',
+ required: '{label}必填',
+ 'enum': '{label}超出范围',
+ timestamp: '{label}格式无效',
+ whitespace: '{label}不能为空',
+ typeError: '{label}类型无效',
+ date: {
+ format: '{label}日期{value}格式无效',
+ parse: '{label}日期无法解析,{value}无效',
+ invalid: '{label}日期{value}无效'
+ },
+ length: {
+ minLength: '{label}长度不能少于{minLength}',
+ maxLength: '{label}长度不能超过{maxLength}',
+ range: '{label}必须介于{minLength}和{maxLength}之间'
+ },
+ number: {
+ minimum: '{label}不能小于{minimum}',
+ maximum: '{label}不能大于{maximum}',
+ exclusiveMinimum: '{label}不能小于等于{minimum}',
+ exclusiveMaximum: '{label}不能大于等于{maximum}',
+ range: '{label}必须介于{minimum}and{maximum}之间'
+ },
+ pattern: {
+ mismatch: '{label}格式不匹配'
+ }
+ };
+}
+
+
+SchemaValidator.message = new Message();
+
export default SchemaValidator
diff --git a/uni_modules/uni-forms/package.json b/uni_modules/uni-forms/package.json
index 9d949b2be4a7f85c9cbba6fc3ecab4cb25f86382..d791aeb99add3868ac16de57752944b5b5e42fa8 100644
--- a/uni_modules/uni-forms/package.json
+++ b/uni_modules/uni-forms/package.json
@@ -1,89 +1,89 @@
-{
- "id": "uni-forms",
- "displayName": "uni-forms 表单",
- "version": "1.2.7",
- "description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据",
- "keywords": [
- "uni-ui",
- "表单",
- "校验",
- "表单校验",
- "表单验证"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [
- "uni-icons"
- ],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- },
- "Vue": {
- "vue2": "y",
- "vue3": "u"
- }
- }
- }
- }
-}
+{
+ "id": "uni-forms",
+ "displayName": "uni-forms 表单",
+ "version": "1.2.7",
+ "description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据",
+ "keywords": [
+ "uni-ui",
+ "表单",
+ "校验",
+ "表单校验",
+ "表单验证"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-icons"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "u"
+ }
+ }
+ }
+ }
+}
diff --git a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/en.json b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/en.json
index dcdba41cee4c2e0b6f4b5bc7d2bdc2df56982f15..4494f2a5c21ee4bb41f977eb9720302346e20168 100644
--- a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/en.json
+++ b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/en.json
@@ -1,6 +1,6 @@
-{
- "uni-goods-nav.options.shop": "shop",
- "uni-goods-nav.options.cart": "cart",
- "uni-goods-nav.buttonGroup.addToCart": "add to cart",
- "uni-goods-nav.buttonGroup.buyNow": "buy now"
+{
+ "uni-goods-nav.options.shop": "shop",
+ "uni-goods-nav.options.cart": "cart",
+ "uni-goods-nav.buttonGroup.addToCart": "add to cart",
+ "uni-goods-nav.buttonGroup.buyNow": "buy now"
}
diff --git a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/index.js b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/index.js
index de7509c87ba5197b9f5d20ca94a0558c7a8e08a9..fa8f0f3734de6effb137592fce6c0f722c048432 100644
--- a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/index.js
+++ b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/index.js
@@ -1,8 +1,8 @@
-import en from './en.json'
-import zhHans from './zh-Hans.json'
-import zhHant from './zh-Hant.json'
-export default {
- en,
- 'zh-Hans': zhHans,
- 'zh-Hant': zhHant
+import en from './en.json'
+import zhHans from './zh-Hans.json'
+import zhHant from './zh-Hant.json'
+export default {
+ en,
+ 'zh-Hans': zhHans,
+ 'zh-Hant': zhHant
}
diff --git a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hans.json b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hans.json
index 48ee344c39f8f2903b09ca02822e4f56305d3ca4..806913a70603b8171525cec67677454ba756e893 100644
--- a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hans.json
+++ b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hans.json
@@ -1,6 +1,6 @@
-{
- "uni-goods-nav.options.shop": "店铺",
- "uni-goods-nav.options.cart": "购物车",
- "uni-goods-nav.buttonGroup.addToCart": "加入购物车",
- "uni-goods-nav.buttonGroup.buyNow": "立即购买"
+{
+ "uni-goods-nav.options.shop": "店铺",
+ "uni-goods-nav.options.cart": "购物车",
+ "uni-goods-nav.buttonGroup.addToCart": "加入购物车",
+ "uni-goods-nav.buttonGroup.buyNow": "立即购买"
}
diff --git a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hant.json b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hant.json
index d0a0255c77edd18216bb6a37bb8d45f9c25bc41d..e862171d0a0889a7e35409b44567befd3fb45f3b 100644
--- a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hant.json
+++ b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hant.json
@@ -1,6 +1,6 @@
-{
- "uni-goods-nav.options.shop": "店鋪",
- "uni-goods-nav.options.cart": "購物車",
- "uni-goods-nav.buttonGroup.addToCart": "加入購物車",
- "uni-goods-nav.buttonGroup.buyNow": "立即購買"
+{
+ "uni-goods-nav.options.shop": "店鋪",
+ "uni-goods-nav.options.cart": "購物車",
+ "uni-goods-nav.buttonGroup.addToCart": "加入購物車",
+ "uni-goods-nav.buttonGroup.buyNow": "立即購買"
}
diff --git a/uni_modules/uni-goods-nav/components/uni-goods-nav/uni-goods-nav.vue b/uni_modules/uni-goods-nav/components/uni-goods-nav/uni-goods-nav.vue
index 32ab1b94052fb45ef55844db31c6b03bc930055f..e2a6baf233db64f27af688ac355eb00b1c2846f6 100644
--- a/uni_modules/uni-goods-nav/components/uni-goods-nav/uni-goods-nav.vue
+++ b/uni_modules/uni-goods-nav/components/uni-goods-nav/uni-goods-nav.vue
@@ -1,232 +1,232 @@
-
-
-
-
-
-
-
-
-
-
-
- {{ item.text }}
-
- {{ item.info }}
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.text }}
+
+ {{ item.info }}
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-grid/changelog.md b/uni_modules/uni-grid/changelog.md
index 49fe00850647eef74413854e47cf1cda6566cb57..8fc506d7f63d4483173d7dba2444e84a5cac3132 100644
--- a/uni_modules/uni-grid/changelog.md
+++ b/uni_modules/uni-grid/changelog.md
@@ -1,8 +1,8 @@
## 1.3.1(2021-07-30)
- 优化 vue3下事件警告的问题
-## 1.3.0(2021-07-13)
-- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.2.4(2021-05-12)
-- 新增 组件示例地址
-## 1.2.3(2021-02-05)
-- 调整为uni_modules目录规范
+## 1.3.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.2.4(2021-05-12)
+- 新增 组件示例地址
+## 1.2.3(2021-02-05)
+- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue b/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue
index 1f2d79abaacb990ad870b4e7fa400a708de2874c..c63bbc2ba9e9f1fa5e6cd7921f9e75f265ce752a 100644
--- a/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue
+++ b/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue
@@ -1,127 +1,127 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-grid/components/uni-grid/uni-grid.vue b/uni_modules/uni-grid/components/uni-grid/uni-grid.vue
index 62bbc32eb1177ecea1610926e592570eefa79b33..b7cc9a4973f06babfa051cb85e9b4de444036605 100644
--- a/uni_modules/uni-grid/components/uni-grid/uni-grid.vue
+++ b/uni_modules/uni-grid/components/uni-grid/uni-grid.vue
@@ -1,142 +1,142 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-grid/package.json b/uni_modules/uni-grid/package.json
index 8b6da6a18069957243edfd8aaf83c3f15219722c..90306f59842ac39934bc6e17d973ca290490257b 100644
--- a/uni_modules/uni-grid/package.json
+++ b/uni_modules/uni-grid/package.json
@@ -1,82 +1,82 @@
-{
- "id": "uni-grid",
- "displayName": "uni-grid 宫格",
- "version": "1.3.1",
- "description": "Grid 宫格组件,提供移动端常见的宫格布局,如九宫格。",
- "keywords": [
- "uni-ui",
- "uniui",
- "九宫格",
- "表格"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-grid",
+ "displayName": "uni-grid 宫格",
+ "version": "1.3.1",
+ "description": "Grid 宫格组件,提供移动端常见的宫格布局,如九宫格。",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "九宫格",
+ "表格"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-group/changelog.md b/uni_modules/uni-group/changelog.md
index 7348312006aecf7ca08d8eb60d978559da434cfc..6a36f7dfd096b34e82946b9eb8ae1574b04918b1 100644
--- a/uni_modules/uni-group/changelog.md
+++ b/uni_modules/uni-group/changelog.md
@@ -1,8 +1,8 @@
## 1.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
- 优化 组件文档
-## 1.0.3(2021-05-12)
-- 新增 组件示例地址
-## 1.0.2(2021-02-05)
-- 调整为uni_modules目录规范
-- 优化 兼容 nvue 页面
+## 1.0.3(2021-05-12)
+- 新增 组件示例地址
+## 1.0.2(2021-02-05)
+- 调整为uni_modules目录规范
+- 优化 兼容 nvue 页面
diff --git a/uni_modules/uni-group/components/uni-group/uni-group.vue b/uni_modules/uni-group/components/uni-group/uni-group.vue
index 25ddb294a4b9e5bd921457d32ac4334f2f94e2f1..eaae7f0c0615f9e98bca1f34bc6fb9a8281b8761 100644
--- a/uni_modules/uni-group/components/uni-group/uni-group.vue
+++ b/uni_modules/uni-group/components/uni-group/uni-group.vue
@@ -1,130 +1,130 @@
-
-
-
-
- {{ title }}
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-group/package.json b/uni_modules/uni-group/package.json
index bdbaf95368b0511f89c1facf5195486814adfc66..ec178634a892db382e2c5d80e290dffce916cdfd 100644
--- a/uni_modules/uni-group/package.json
+++ b/uni_modules/uni-group/package.json
@@ -1,83 +1,83 @@
-{
- "id": "uni-group",
- "displayName": "uni-group 分组",
- "version": "1.1.0",
- "description": "分组组件可用于将组件用于分组,添加间隔,以产生明显的区块",
- "keywords": [
- "uni-ui",
- "uniui",
- "group",
- "分组",
- ""
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-group",
+ "displayName": "uni-group 分组",
+ "version": "1.1.0",
+ "description": "分组组件可用于将组件用于分组,添加间隔,以产生明显的区块",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "group",
+ "分组",
+ ""
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-icons/components/uni-icons/icons.js b/uni_modules/uni-icons/components/uni-icons/icons.js
index 60b733214dc67b78c1523ae31f878d937e5a830b..5242f2277365e36b41fc3203f831f9a9075fb184 100644
--- a/uni_modules/uni-icons/components/uni-icons/icons.js
+++ b/uni_modules/uni-icons/components/uni-icons/icons.js
@@ -1,132 +1,132 @@
-export default {
- "pulldown": "\ue588",
- "refreshempty": "\ue461",
- "back": "\ue471",
- "forward": "\ue470",
- "more": "\ue507",
- "more-filled": "\ue537",
- "scan": "\ue612",
- "qq": "\ue264",
- "weibo": "\ue260",
- "weixin": "\ue261",
- "pengyouquan": "\ue262",
- "loop": "\ue565",
- "refresh": "\ue407",
- "refresh-filled": "\ue437",
- "arrowthindown": "\ue585",
- "arrowthinleft": "\ue586",
- "arrowthinright": "\ue587",
- "arrowthinup": "\ue584",
- "undo-filled": "\ue7d6",
- "undo": "\ue406",
- "redo": "\ue405",
- "redo-filled": "\ue7d9",
- "bars": "\ue563",
- "chatboxes": "\ue203",
- "camera": "\ue301",
- "chatboxes-filled": "\ue233",
- "camera-filled": "\ue7ef",
- "cart-filled": "\ue7f4",
- "cart": "\ue7f5",
- "checkbox-filled": "\ue442",
- "checkbox": "\ue7fa",
- "arrowleft": "\ue582",
- "arrowdown": "\ue581",
- "arrowright": "\ue583",
- "smallcircle-filled": "\ue801",
- "arrowup": "\ue580",
- "circle": "\ue411",
- "eye-filled": "\ue568",
- "eye-slash-filled": "\ue822",
- "eye-slash": "\ue823",
- "eye": "\ue824",
- "flag-filled": "\ue825",
- "flag": "\ue508",
- "gear-filled": "\ue532",
- "reload": "\ue462",
- "gear": "\ue502",
- "hand-thumbsdown-filled": "\ue83b",
- "hand-thumbsdown": "\ue83c",
- "hand-thumbsup-filled": "\ue83d",
- "heart-filled": "\ue83e",
- "hand-thumbsup": "\ue83f",
- "heart": "\ue840",
- "home": "\ue500",
- "info": "\ue504",
- "home-filled": "\ue530",
- "info-filled": "\ue534",
- "circle-filled": "\ue441",
- "chat-filled": "\ue847",
- "chat": "\ue263",
- "mail-open-filled": "\ue84d",
- "email-filled": "\ue231",
- "mail-open": "\ue84e",
- "email": "\ue201",
- "checkmarkempty": "\ue472",
- "list": "\ue562",
- "locked-filled": "\ue856",
- "locked": "\ue506",
- "map-filled": "\ue85c",
- "map-pin": "\ue85e",
- "map-pin-ellipse": "\ue864",
- "map": "\ue364",
- "minus-filled": "\ue440",
- "mic-filled": "\ue332",
- "minus": "\ue410",
- "micoff": "\ue360",
- "mic": "\ue302",
- "clear": "\ue434",
- "smallcircle": "\ue868",
- "close": "\ue404",
- "closeempty": "\ue460",
- "paperclip": "\ue567",
- "paperplane": "\ue503",
- "paperplane-filled": "\ue86e",
- "person-filled": "\ue131",
- "contact-filled": "\ue130",
- "person": "\ue101",
- "contact": "\ue100",
- "images-filled": "\ue87a",
- "phone": "\ue200",
- "images": "\ue87b",
- "image": "\ue363",
- "image-filled": "\ue877",
- "location-filled": "\ue333",
- "location": "\ue303",
- "plus-filled": "\ue439",
- "plus": "\ue409",
- "plusempty": "\ue468",
- "help-filled": "\ue535",
- "help": "\ue505",
- "navigate-filled": "\ue884",
- "navigate": "\ue501",
- "mic-slash-filled": "\ue892",
- "search": "\ue466",
- "settings": "\ue560",
- "sound": "\ue590",
- "sound-filled": "\ue8a1",
- "spinner-cycle": "\ue465",
- "download-filled": "\ue8a4",
- "personadd-filled": "\ue132",
- "videocam-filled": "\ue8af",
- "personadd": "\ue102",
- "upload": "\ue402",
- "upload-filled": "\ue8b1",
- "starhalf": "\ue463",
- "star-filled": "\ue438",
- "star": "\ue408",
- "trash": "\ue401",
- "phone-filled": "\ue230",
- "compose": "\ue400",
- "videocam": "\ue300",
- "trash-filled": "\ue8dc",
- "download": "\ue403",
- "chatbubble-filled": "\ue232",
- "chatbubble": "\ue202",
- "cloud-download": "\ue8e4",
- "cloud-upload-filled": "\ue8e5",
- "cloud-upload": "\ue8e6",
+export default {
+ "pulldown": "\ue588",
+ "refreshempty": "\ue461",
+ "back": "\ue471",
+ "forward": "\ue470",
+ "more": "\ue507",
+ "more-filled": "\ue537",
+ "scan": "\ue612",
+ "qq": "\ue264",
+ "weibo": "\ue260",
+ "weixin": "\ue261",
+ "pengyouquan": "\ue262",
+ "loop": "\ue565",
+ "refresh": "\ue407",
+ "refresh-filled": "\ue437",
+ "arrowthindown": "\ue585",
+ "arrowthinleft": "\ue586",
+ "arrowthinright": "\ue587",
+ "arrowthinup": "\ue584",
+ "undo-filled": "\ue7d6",
+ "undo": "\ue406",
+ "redo": "\ue405",
+ "redo-filled": "\ue7d9",
+ "bars": "\ue563",
+ "chatboxes": "\ue203",
+ "camera": "\ue301",
+ "chatboxes-filled": "\ue233",
+ "camera-filled": "\ue7ef",
+ "cart-filled": "\ue7f4",
+ "cart": "\ue7f5",
+ "checkbox-filled": "\ue442",
+ "checkbox": "\ue7fa",
+ "arrowleft": "\ue582",
+ "arrowdown": "\ue581",
+ "arrowright": "\ue583",
+ "smallcircle-filled": "\ue801",
+ "arrowup": "\ue580",
+ "circle": "\ue411",
+ "eye-filled": "\ue568",
+ "eye-slash-filled": "\ue822",
+ "eye-slash": "\ue823",
+ "eye": "\ue824",
+ "flag-filled": "\ue825",
+ "flag": "\ue508",
+ "gear-filled": "\ue532",
+ "reload": "\ue462",
+ "gear": "\ue502",
+ "hand-thumbsdown-filled": "\ue83b",
+ "hand-thumbsdown": "\ue83c",
+ "hand-thumbsup-filled": "\ue83d",
+ "heart-filled": "\ue83e",
+ "hand-thumbsup": "\ue83f",
+ "heart": "\ue840",
+ "home": "\ue500",
+ "info": "\ue504",
+ "home-filled": "\ue530",
+ "info-filled": "\ue534",
+ "circle-filled": "\ue441",
+ "chat-filled": "\ue847",
+ "chat": "\ue263",
+ "mail-open-filled": "\ue84d",
+ "email-filled": "\ue231",
+ "mail-open": "\ue84e",
+ "email": "\ue201",
+ "checkmarkempty": "\ue472",
+ "list": "\ue562",
+ "locked-filled": "\ue856",
+ "locked": "\ue506",
+ "map-filled": "\ue85c",
+ "map-pin": "\ue85e",
+ "map-pin-ellipse": "\ue864",
+ "map": "\ue364",
+ "minus-filled": "\ue440",
+ "mic-filled": "\ue332",
+ "minus": "\ue410",
+ "micoff": "\ue360",
+ "mic": "\ue302",
+ "clear": "\ue434",
+ "smallcircle": "\ue868",
+ "close": "\ue404",
+ "closeempty": "\ue460",
+ "paperclip": "\ue567",
+ "paperplane": "\ue503",
+ "paperplane-filled": "\ue86e",
+ "person-filled": "\ue131",
+ "contact-filled": "\ue130",
+ "person": "\ue101",
+ "contact": "\ue100",
+ "images-filled": "\ue87a",
+ "phone": "\ue200",
+ "images": "\ue87b",
+ "image": "\ue363",
+ "image-filled": "\ue877",
+ "location-filled": "\ue333",
+ "location": "\ue303",
+ "plus-filled": "\ue439",
+ "plus": "\ue409",
+ "plusempty": "\ue468",
+ "help-filled": "\ue535",
+ "help": "\ue505",
+ "navigate-filled": "\ue884",
+ "navigate": "\ue501",
+ "mic-slash-filled": "\ue892",
+ "search": "\ue466",
+ "settings": "\ue560",
+ "sound": "\ue590",
+ "sound-filled": "\ue8a1",
+ "spinner-cycle": "\ue465",
+ "download-filled": "\ue8a4",
+ "personadd-filled": "\ue132",
+ "videocam-filled": "\ue8af",
+ "personadd": "\ue102",
+ "upload": "\ue402",
+ "upload-filled": "\ue8b1",
+ "starhalf": "\ue463",
+ "star-filled": "\ue438",
+ "star": "\ue408",
+ "trash": "\ue401",
+ "phone-filled": "\ue230",
+ "compose": "\ue400",
+ "videocam": "\ue300",
+ "trash-filled": "\ue8dc",
+ "download": "\ue403",
+ "chatbubble-filled": "\ue232",
+ "chatbubble": "\ue202",
+ "cloud-download": "\ue8e4",
+ "cloud-upload-filled": "\ue8e5",
+ "cloud-upload": "\ue8e6",
"cloud-download-filled": "\ue8e9",
"headphones":"\ue8bf",
- "shop":"\ue609"
+ "shop":"\ue609"
}
diff --git a/uni_modules/uni-icons/components/uni-icons/uni-icons.vue b/uni_modules/uni-icons/components/uni-icons/uni-icons.vue
index 6bcc0a2fa186f5350b6d2a747c69f14f0c2df74f..edd5f087ba5ed43d2f0668a142276d2ecd9575d8 100644
--- a/uni_modules/uni-icons/components/uni-icons/uni-icons.vue
+++ b/uni_modules/uni-icons/components/uni-icons/uni-icons.vue
@@ -1,72 +1,72 @@
-
- {{fontFamily ? '' : icons[type]}}
-
-
-
-
-
diff --git a/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js b/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js
index be4876186b99029282bc9196932c042672b0fa5e..8c118468481d55195069d7d0695d222f9414f97d 100644
--- a/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js
+++ b/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js
@@ -1,580 +1,580 @@
-'use strict';
-let uniID = require('uni-id')
-const uniCaptcha = require('uni-captcha')
-const createConfig = require('uni-config-center')
-const uniIdConfig = createConfig({
- pluginId: 'uni-id'
-}).config()
-const db = uniCloud.database()
-const dbCmd = db.command
-const usersDB = db.collection('uni-id-users')
-exports.main = async (event, context) => {
- //UNI_WYQ:这里的uniID换成新的,保证多人访问不会冲突
- uniID = uniID.createInstance({
- context
- })
- console.log('event : ' + JSON.stringify(event))
- /*
- 1.event为客户端 uniCloud.callFunction填写的data的值,这里介绍一下其中的属性
- action:表示要执行的任务名称、比如:登录login、退出登录 logout等
- params:业务数据内容
- uniIdToken:系统自动传递的token,数据来源客户端的 uni.getStorageSync('uni_id_token')
- */
- const {
- action,
- uniIdToken,
- inviteCode
- } = event;
- const deviceInfo = event.deviceInfo || {};
- let params = event.params || {};
- /*
- 2.在某些操作之前我们要对用户对身份进行校验(也就是要检查用户的token)再将得到的uid写入params.uid
- 校验用到的方法是uniID.checkToken 详情:https://uniapp.dcloud.io/uniCloud/uni-id?id=checktoken
-
- 讨论,我们假设一个这样的场景,代码如下。
- 如:
- uniCloud.callFunction({
- name:"xxx",
- data:{
- "params":{
- uid:"通过某种方式获取来的别人的uid"
- }
- }
- })
- 用户就这样轻易地伪造了他人的uid传递给服务端,有一句话叫:前端传来的数据都是不可信任的
- 所以这里我们需要将uniID.checkToken返回的uid写入到params.uid
- */
- let noCheckAction = ['register', 'checkToken', 'login', 'logout', 'sendSmsCode', 'createCaptcha',
- 'verifyCaptcha', 'refreshCaptcha', 'inviteLogin', 'loginByWeixin', 'loginByUniverify',
- 'loginByApple', 'loginBySms', 'resetPwdBySmsCode', 'registerAdmin'
- ]
- if (!noCheckAction.includes(action)) {
- if (!uniIdToken) {
- return {
- code: 403,
- msg: '缺少token'
- }
- }
- let payload = await uniID.checkToken(uniIdToken)
- if (payload.code && payload.code > 0) {
- return payload
- }
- params.uid = payload.uid
- }
-
- //禁止前台用户传递角色
- if (action.slice(0, 7) == "loginBy") {
- if (params.role) {
- return {
- code: 403,
- msg: '禁止前台用户传递角色'
- }
- }
- }
-
- // 3.注册成功后触发。
- async function registerSuccess(uid) {
- //用户接受邀请
- if (inviteCode) {
- await uniID.acceptInvite({
- inviteCode,
- uid
- });
- }
- //添加当前用户设备信息
- await db.collection('uni-id-device').add({
- ...deviceInfo,
- user_id: uid
- })
- }
- //4.记录成功登录的日志方法
- const loginLog = async (res = {}) => {
- const now = Date.now()
- const uniIdLogCollection = db.collection('uni-id-log')
- let logData = {
- deviceId: params.deviceId || context.DEVICEID,
- ip: params.ip || context.CLIENTIP,
- type: res.type,
- ua: context.CLIENTUA,
- create_date: now
- };
-
- if(res.code === 0){
- logData.user_id = res.uid
- logData.state = 1
- if(res.userInfo&&res.userInfo.password){
- delete res.userInfo.password
- }
- if (res.type == 'register') {
- await registerSuccess(res.uid)
- } else {
- if (Object.keys(deviceInfo).length) {
- // console.log(979797, {
- // deviceInfo,
- // user_id: res
- // });
- //更新当前用户设备信息
- await db.collection('uni-id-device').where({
- user_id: res.uid
- }).update(deviceInfo)
- }
- }
- }else{
- logData.state = 0
- }
- return await uniIdLogCollection.add(logData)
- }
-
- let res = {}
- switch (action) { //根据action的值执行对应的操作
- case 'refreshSessionKey':
- let getSessionKey = await uniID.code2SessionWeixin({code:params.code});
- if(getSessionKey.code){
- return getSessionKey
- }
- res = await uniID.updateUser({
- uid: params.uid,
- sessionKey:getSessionKey.sessionKey
- })
- console.log(res);
- break;
- case 'bindMobileByMpWeixin':
- console.log(params);
- let getSessionKeyRes = await uniID.getUserInfo({
- uid: params.uid,
- field: ['sessionKey']
- })
- if(getSessionKeyRes.code){
- return getSessionKeyRes
- }
- let sessionKey = getSessionKeyRes.userInfo.sessionKey
- console.log(getSessionKeyRes);
- res = await uniID.wxBizDataCrypt({
- ...params,
- sessionKey
- })
- console.log(res);
- if(res.code){
- return res
- }
- res = await uniID.bindMobile({
- uid: params.uid,
- mobile: res.purePhoneNumber
- })
- console.log(res);
- break;
- case 'bindMobileByUniverify':
- let {
- appid, apiKey, apiSecret
- } = uniIdConfig.service.univerify
- let univerifyRes = await uniCloud.getPhoneNumber({
- provider: 'univerify',
- appid,
- apiKey,
- apiSecret,
- access_token: params.access_token,
- openid: params.openid
- })
- if (univerifyRes.code === 0) {
- res = await uniID.bindMobile({
- uid: params.uid,
- mobile: univerifyRes.phoneNumber
- })
- res.mobile = univerifyRes.phoneNumber
- }
- break;
- case 'bindMobileBySms':
- // console.log({
- // uid: params.uid,
- // mobile: params.mobile,
- // code: params.code
- // });
- res = await uniID.bindMobile({
- uid: params.uid,
- mobile: params.mobile,
- code: params.code
- })
- // console.log(res);
- break;
- case 'register':
- var {
- username, password, nickname
- } = params
- if (/^1\d{10}$/.test(username)) {
- return {
- code: 401,
- msg: '用户名不能是手机号'
- }
- };
- if (/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/.test(username)) {
- return {
- code: 401,
- msg: '用户名不能是邮箱'
- }
- }
- res = await uniID.register({
- username,
- password,
- nickname,
- inviteCode
- });
- if (res.code === 0) {
- await registerSuccess(res.uid)
- }
- break;
- case 'login':
- //防止黑客恶意破解登录,连续登录失败一定次数后,需要用户提供验证码
- const getNeedCaptcha = async () => {
- //当用户最近“2小时内(recordDate)”登录失败达到2次(recordSize)时。要求用户提交验证码
- const now = Date.now(),
- recordDate = 120 * 60 * 1000,
- recordSize = 2;
- const uniIdLogCollection = db.collection('uni-id-log')
- let recentRecord = await uniIdLogCollection.where({
- deviceId: params.deviceId || context.DEVICEID,
- create_date: dbCmd.gt(now - recordDate),
- type: 'login'
- })
- .orderBy('create_date', 'desc')
- .limit(recordSize)
- .get();
- return recentRecord.data.filter(item => item.state === 0).length === recordSize;
- }
-
- let passed = false;
- let needCaptcha = await getNeedCaptcha();
- console.log('needCaptcha', needCaptcha);
- if (needCaptcha) {
- res = await uniCaptcha.verify({
- ...params,
- scene: 'login'
- })
- if (res.code === 0) passed = true;
- }
-
- if (!needCaptcha || passed) {
- res = await uniID.login({
- ...params,
- queryField: ['username', 'email', 'mobile']
- });
- res.type = 'login'
- await loginLog(res);
- needCaptcha = await getNeedCaptcha();
- }
-
- res.needCaptcha = needCaptcha;
- break;
- case 'loginByWeixin':
- let loginRes = await uniID.loginByWeixin(params);
- if(loginRes.code===0){
- //用户完善资料(昵称、头像)
- if(context.PLATFORM == "app-plus" && !loginRes.userInfo.nickname){
- let {accessToken:access_token,openid} = loginRes,
- {appid,appsecret:secret} = uniIdConfig['app-plus'].oauth.weixin;
- let wxRes = await uniCloud.httpclient.request(
- `https://api.weixin.qq.com/sns/userinfo?access_token=${access_token}&openid=${openid}&scope=snsapi_userinfo&appid=${appid}&secret=${secret}`, {
- method: 'POST',
- contentType: 'json', // 指定以application/json发送data内的数据
- dataType: 'json' // 指定返回值为json格式,自动进行parse
- })
- if(wxRes.status == 200){
- let {nickname,headimgurl} = wxRes.data;
- let headimgurlFile = {},cloudPath = loginRes.uid+'/'+Date.now()+"headimgurl.jpg";
- let getImgBuffer = await uniCloud.httpclient.request(headimgurl)
- if(getImgBuffer.status == 200){
- let {fileID} = await uniCloud.uploadFile({
- cloudPath,
- fileContent: getImgBuffer.data
- });
- headimgurlFile = {
- name:cloudPath,
- extname:"jpg",
- url:fileID
- }
- }else{
- return getImgBuffer
- }
- await uniID.updateUser({
- uid: loginRes.uid,
- nickname,
- avatar_file:headimgurlFile
- })
- loginRes.userInfo.nickname = nickname;
- loginRes.userInfo.avatar_file = headimgurlFile;
- }else{
- return wxRes
- }
- }
- if(context.PLATFORM == "mp-weixin"){
- let resUpdateUser = await uniID.updateUser({
- uid: loginRes.uid,
- sessionKey:loginRes.sessionKey
- })
- console.log(resUpdateUser);
- }
- delete loginRes.openid
- delete loginRes.sessionKey
- delete loginRes.accessToken
- delete loginRes.refreshToken
- }
- await loginLog(loginRes)
- return loginRes
- break;
- case 'loginByUniverify':
- res = await uniID.loginByUniverify(params)
- await loginLog(res)
- break;
- case 'loginByApple':
- res = await uniID.loginByApple(params)
- await loginLog(res)
- break;
- case 'checkToken':
- res = await uniID.checkToken(uniIdToken);
- break;
- case 'logout':
- res = await uniID.logout(uniIdToken)
- break;
- case 'sendSmsCode':
- /* -开始- 测试期间,为节约资源。统一虚拟短信验证码为: 123456;开启以下代码块即可 */
- return uniID.setVerifyCode({
- mobile: params.mobile,
- code: '123456',
- type: params.type
- })
- /* -结束- */
-
- // 简单限制一下客户端调用频率
- const ipLimit = await db.collection('opendb-verify-codes').where({
- ip: context.CLIENTIP,
- created_at: dbCmd.gt(Date.now() - 60000)
- }).get()
- if (ipLimit.data.length > 0) {
- return {
- code: 429,
- msg: '请求过于频繁'
- }
- }
- const templateId = '11753' // 替换为自己申请的模板id
- if (!templateId) {
- return {
- code: 500,
- msg: 'sendSmsCode需要传入自己的templateId,参考https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=sendsmscode'
- }
- }
- const randomStr = '00000' + Math.floor(Math.random() * 1000000)
- const code = randomStr.substring(randomStr.length - 6)
- res = await uniID.sendSmsCode({
- mobile: params.mobile,
- code,
- type: params.type,
- templateId
- })
- break;
- case 'loginBySms':
- if (!params.code) {
- return {
- code: 500,
- msg: '请填写验证码'
- }
- }
- if (!/^1\d{10}$/.test(params.mobile)) {
- return {
- code: 500,
- msg: '手机号码填写错误'
- }
- }
- res = await uniID.loginBySms(params)
- await loginLog(res)
- break;
- case 'resetPwdBySmsCode':
- if (!params.code) {
- return {
- code: 500,
- msg: '请填写验证码'
- }
- }
- if (!/^1\d{10}$/.test(params.mobile)) {
- return {
- code: 500,
- msg: '手机号码填写错误'
- }
- }
- params.type = 'login'
- let loginBySmsRes = await uniID.loginBySms(params)
- // console.log(loginBySmsRes);
- if (loginBySmsRes.code === 0) {
- res = await uniID.resetPwd({
- password: params.password,
- "uid": loginBySmsRes.uid
- })
- } else {
- return loginBySmsRes
- }
- break;
- case 'getInviteCode':
- res = await uniID.getUserInfo({
- uid: params.uid,
- field: ['my_invite_code']
- })
- if (res.code === 0) {
- res.myInviteCode = res.userInfo.my_invite_code
- delete res.userInfo
- }
- break;
- case 'getInvitedUser':
- res = await uniID.getInvitedUser(params)
- break;
- case 'updatePwd':
- res = await uniID.updatePwd(params)
- break;
- case 'createCaptcha':
- res = await uniCaptcha.create(params)
- break;
- case 'refreshCaptcha':
- res = await uniCaptcha.refresh(params)
- break;
- case 'getUserInviteCode':
- res = await uniID.getUserInfo({
- uid: params.uid,
- field: ['my_invite_code']
- })
- if (!res.userInfo.my_invite_code) {
- res = await uniID.setUserInviteCode({
- uid: params.uid
- })
- }
- break;
-
- // =========================== admin api start =========================
- case 'registerAdmin': {
- var {
- username,
- password
- } = params
- let {
- total
- } = await db.collection('uni-id-users').where({
- role: 'admin'
- }).count()
- if (total) {
- return {
- code: 10001,
- message: '超级管理员已存在,请登录...'
- }
- }
- const appid = params.appid
- const appName = params.appName
- delete params.appid
- delete params.appName
- res = await uniID.register({
- username,
- password,
- role: ["admin"]
- })
- if (res.code === 0) {
- const app = await db.collection('opendb-app-list').where({
- appid
- }).count()
- if (!app.total) {
- await db.collection('opendb-app-list').add({
- appid,
- name: appName,
- description: "admin 管理后台",
- create_date: Date.now()
- })
- }
-
- }
- }
- break;
- case 'registerUser':
- const {
- userInfo
- } = await uniID.getUserInfo({
- uid: params.uid
- })
- if (userInfo.role.indexOf('admin') === -1) {
- res = {
- code: 403,
- message: '非法访问, 无权限注册超级管理员',
- }
- } else {
- // 过滤 dcloud_appid,注册用户成功后再提交
- const dcloudAppidList = params.dcloud_appid
- delete params.dcloud_appid
- res = await uniID.register({
- autoSetDcloudAppid: false,
- ...params
- })
- if (res.code === 0) {
- delete res.token
- delete res.tokenExpired
- await uniID.setAuthorizedAppLogin({
- uid: res.uid,
- dcloudAppidList
- })
- }
- }
- break;
- case 'updateUser': {
- const {
- userInfo
- } = await uniID.getUserInfo({
- uid: params.uid
- })
- if (userInfo.role.indexOf('admin') === -1) {
- res = {
- code: 403,
- message: '非法访问, 无权限注册超级管理员',
- }
- } else {
- // 过滤 dcloud_appid,注册用户成功后再提交
- const dcloudAppidList = params.dcloud_appid
- delete params.dcloud_appid
-
- // 过滤 password,注册用户成功后再提交
- const password = params.password
- delete params.password
-
- // 过滤 uid、id
- const id = params.id
- delete params.id
- delete params.uid
-
-
- res = await uniID.updateUser({
- uid: id,
- ...params
- })
- if (res.code === 0) {
- if (password) {
- await uniID.resetPwd({
- uid: id,
- password
- })
- }
- await uniID.setAuthorizedAppLogin({
- uid: id,
- dcloudAppidList
- })
- }
- }
- break;
- }
- case 'getCurrentUserInfo':
- res = await uniID.getUserInfo({
- uid: params.uid,
- ...params
- })
- break;
- // =========================== admin api end =========================
- default:
- res = {
- code: 403,
- msg: '非法访问'
- }
- break;
- }
- //返回数据给客户端
- return res
-}
+'use strict';
+let uniID = require('uni-id')
+const uniCaptcha = require('uni-captcha')
+const createConfig = require('uni-config-center')
+const uniIdConfig = createConfig({
+ pluginId: 'uni-id'
+}).config()
+const db = uniCloud.database()
+const dbCmd = db.command
+const usersDB = db.collection('uni-id-users')
+exports.main = async (event, context) => {
+ //UNI_WYQ:这里的uniID换成新的,保证多人访问不会冲突
+ uniID = uniID.createInstance({
+ context
+ })
+ console.log('event : ' + JSON.stringify(event))
+ /*
+ 1.event为客户端 uniCloud.callFunction填写的data的值,这里介绍一下其中的属性
+ action:表示要执行的任务名称、比如:登录login、退出登录 logout等
+ params:业务数据内容
+ uniIdToken:系统自动传递的token,数据来源客户端的 uni.getStorageSync('uni_id_token')
+ */
+ const {
+ action,
+ uniIdToken,
+ inviteCode
+ } = event;
+ const deviceInfo = event.deviceInfo || {};
+ let params = event.params || {};
+ /*
+ 2.在某些操作之前我们要对用户对身份进行校验(也就是要检查用户的token)再将得到的uid写入params.uid
+ 校验用到的方法是uniID.checkToken 详情:https://uniapp.dcloud.io/uniCloud/uni-id?id=checktoken
+
+ 讨论,我们假设一个这样的场景,代码如下。
+ 如:
+ uniCloud.callFunction({
+ name:"xxx",
+ data:{
+ "params":{
+ uid:"通过某种方式获取来的别人的uid"
+ }
+ }
+ })
+ 用户就这样轻易地伪造了他人的uid传递给服务端,有一句话叫:前端传来的数据都是不可信任的
+ 所以这里我们需要将uniID.checkToken返回的uid写入到params.uid
+ */
+ let noCheckAction = ['register', 'checkToken', 'login', 'logout', 'sendSmsCode', 'createCaptcha',
+ 'verifyCaptcha', 'refreshCaptcha', 'inviteLogin', 'loginByWeixin', 'loginByUniverify',
+ 'loginByApple', 'loginBySms', 'resetPwdBySmsCode', 'registerAdmin'
+ ]
+ if (!noCheckAction.includes(action)) {
+ if (!uniIdToken) {
+ return {
+ code: 403,
+ msg: '缺少token'
+ }
+ }
+ let payload = await uniID.checkToken(uniIdToken)
+ if (payload.code && payload.code > 0) {
+ return payload
+ }
+ params.uid = payload.uid
+ }
+
+ //禁止前台用户传递角色
+ if (action.slice(0, 7) == "loginBy") {
+ if (params.role) {
+ return {
+ code: 403,
+ msg: '禁止前台用户传递角色'
+ }
+ }
+ }
+
+ // 3.注册成功后触发。
+ async function registerSuccess(uid) {
+ //用户接受邀请
+ if (inviteCode) {
+ await uniID.acceptInvite({
+ inviteCode,
+ uid
+ });
+ }
+ //添加当前用户设备信息
+ await db.collection('uni-id-device').add({
+ ...deviceInfo,
+ user_id: uid
+ })
+ }
+ //4.记录成功登录的日志方法
+ const loginLog = async (res = {}) => {
+ const now = Date.now()
+ const uniIdLogCollection = db.collection('uni-id-log')
+ let logData = {
+ deviceId: params.deviceId || context.DEVICEID,
+ ip: params.ip || context.CLIENTIP,
+ type: res.type,
+ ua: context.CLIENTUA,
+ create_date: now
+ };
+
+ if(res.code === 0){
+ logData.user_id = res.uid
+ logData.state = 1
+ if(res.userInfo&&res.userInfo.password){
+ delete res.userInfo.password
+ }
+ if (res.type == 'register') {
+ await registerSuccess(res.uid)
+ } else {
+ if (Object.keys(deviceInfo).length) {
+ // console.log(979797, {
+ // deviceInfo,
+ // user_id: res
+ // });
+ //更新当前用户设备信息
+ await db.collection('uni-id-device').where({
+ user_id: res.uid
+ }).update(deviceInfo)
+ }
+ }
+ }else{
+ logData.state = 0
+ }
+ return await uniIdLogCollection.add(logData)
+ }
+
+ let res = {}
+ switch (action) { //根据action的值执行对应的操作
+ case 'refreshSessionKey':
+ let getSessionKey = await uniID.code2SessionWeixin({code:params.code});
+ if(getSessionKey.code){
+ return getSessionKey
+ }
+ res = await uniID.updateUser({
+ uid: params.uid,
+ sessionKey:getSessionKey.sessionKey
+ })
+ console.log(res);
+ break;
+ case 'bindMobileByMpWeixin':
+ console.log(params);
+ let getSessionKeyRes = await uniID.getUserInfo({
+ uid: params.uid,
+ field: ['sessionKey']
+ })
+ if(getSessionKeyRes.code){
+ return getSessionKeyRes
+ }
+ let sessionKey = getSessionKeyRes.userInfo.sessionKey
+ console.log(getSessionKeyRes);
+ res = await uniID.wxBizDataCrypt({
+ ...params,
+ sessionKey
+ })
+ console.log(res);
+ if(res.code){
+ return res
+ }
+ res = await uniID.bindMobile({
+ uid: params.uid,
+ mobile: res.purePhoneNumber
+ })
+ console.log(res);
+ break;
+ case 'bindMobileByUniverify':
+ let {
+ appid, apiKey, apiSecret
+ } = uniIdConfig.service.univerify
+ let univerifyRes = await uniCloud.getPhoneNumber({
+ provider: 'univerify',
+ appid,
+ apiKey,
+ apiSecret,
+ access_token: params.access_token,
+ openid: params.openid
+ })
+ if (univerifyRes.code === 0) {
+ res = await uniID.bindMobile({
+ uid: params.uid,
+ mobile: univerifyRes.phoneNumber
+ })
+ res.mobile = univerifyRes.phoneNumber
+ }
+ break;
+ case 'bindMobileBySms':
+ // console.log({
+ // uid: params.uid,
+ // mobile: params.mobile,
+ // code: params.code
+ // });
+ res = await uniID.bindMobile({
+ uid: params.uid,
+ mobile: params.mobile,
+ code: params.code
+ })
+ // console.log(res);
+ break;
+ case 'register':
+ var {
+ username, password, nickname
+ } = params
+ if (/^1\d{10}$/.test(username)) {
+ return {
+ code: 401,
+ msg: '用户名不能是手机号'
+ }
+ };
+ if (/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/.test(username)) {
+ return {
+ code: 401,
+ msg: '用户名不能是邮箱'
+ }
+ }
+ res = await uniID.register({
+ username,
+ password,
+ nickname,
+ inviteCode
+ });
+ if (res.code === 0) {
+ await registerSuccess(res.uid)
+ }
+ break;
+ case 'login':
+ //防止黑客恶意破解登录,连续登录失败一定次数后,需要用户提供验证码
+ const getNeedCaptcha = async () => {
+ //当用户最近“2小时内(recordDate)”登录失败达到2次(recordSize)时。要求用户提交验证码
+ const now = Date.now(),
+ recordDate = 120 * 60 * 1000,
+ recordSize = 2;
+ const uniIdLogCollection = db.collection('uni-id-log')
+ let recentRecord = await uniIdLogCollection.where({
+ deviceId: params.deviceId || context.DEVICEID,
+ create_date: dbCmd.gt(now - recordDate),
+ type: 'login'
+ })
+ .orderBy('create_date', 'desc')
+ .limit(recordSize)
+ .get();
+ return recentRecord.data.filter(item => item.state === 0).length === recordSize;
+ }
+
+ let passed = false;
+ let needCaptcha = await getNeedCaptcha();
+ console.log('needCaptcha', needCaptcha);
+ if (needCaptcha) {
+ res = await uniCaptcha.verify({
+ ...params,
+ scene: 'login'
+ })
+ if (res.code === 0) passed = true;
+ }
+
+ if (!needCaptcha || passed) {
+ res = await uniID.login({
+ ...params,
+ queryField: ['username', 'email', 'mobile']
+ });
+ res.type = 'login'
+ await loginLog(res);
+ needCaptcha = await getNeedCaptcha();
+ }
+
+ res.needCaptcha = needCaptcha;
+ break;
+ case 'loginByWeixin':
+ let loginRes = await uniID.loginByWeixin(params);
+ if(loginRes.code===0){
+ //用户完善资料(昵称、头像)
+ if(context.PLATFORM == "app-plus" && !loginRes.userInfo.nickname){
+ let {accessToken:access_token,openid} = loginRes,
+ {appid,appsecret:secret} = uniIdConfig['app-plus'].oauth.weixin;
+ let wxRes = await uniCloud.httpclient.request(
+ `https://api.weixin.qq.com/sns/userinfo?access_token=${access_token}&openid=${openid}&scope=snsapi_userinfo&appid=${appid}&secret=${secret}`, {
+ method: 'POST',
+ contentType: 'json', // 指定以application/json发送data内的数据
+ dataType: 'json' // 指定返回值为json格式,自动进行parse
+ })
+ if(wxRes.status == 200){
+ let {nickname,headimgurl} = wxRes.data;
+ let headimgurlFile = {},cloudPath = loginRes.uid+'/'+Date.now()+"headimgurl.jpg";
+ let getImgBuffer = await uniCloud.httpclient.request(headimgurl)
+ if(getImgBuffer.status == 200){
+ let {fileID} = await uniCloud.uploadFile({
+ cloudPath,
+ fileContent: getImgBuffer.data
+ });
+ headimgurlFile = {
+ name:cloudPath,
+ extname:"jpg",
+ url:fileID
+ }
+ }else{
+ return getImgBuffer
+ }
+ await uniID.updateUser({
+ uid: loginRes.uid,
+ nickname,
+ avatar_file:headimgurlFile
+ })
+ loginRes.userInfo.nickname = nickname;
+ loginRes.userInfo.avatar_file = headimgurlFile;
+ }else{
+ return wxRes
+ }
+ }
+ if(context.PLATFORM == "mp-weixin"){
+ let resUpdateUser = await uniID.updateUser({
+ uid: loginRes.uid,
+ sessionKey:loginRes.sessionKey
+ })
+ console.log(resUpdateUser);
+ }
+ delete loginRes.openid
+ delete loginRes.sessionKey
+ delete loginRes.accessToken
+ delete loginRes.refreshToken
+ }
+ await loginLog(loginRes)
+ return loginRes
+ break;
+ case 'loginByUniverify':
+ res = await uniID.loginByUniverify(params)
+ await loginLog(res)
+ break;
+ case 'loginByApple':
+ res = await uniID.loginByApple(params)
+ await loginLog(res)
+ break;
+ case 'checkToken':
+ res = await uniID.checkToken(uniIdToken);
+ break;
+ case 'logout':
+ res = await uniID.logout(uniIdToken)
+ break;
+ case 'sendSmsCode':
+ /* -开始- 测试期间,为节约资源。统一虚拟短信验证码为: 123456;开启以下代码块即可 */
+ return uniID.setVerifyCode({
+ mobile: params.mobile,
+ code: '123456',
+ type: params.type
+ })
+ /* -结束- */
+
+ // 简单限制一下客户端调用频率
+ const ipLimit = await db.collection('opendb-verify-codes').where({
+ ip: context.CLIENTIP,
+ created_at: dbCmd.gt(Date.now() - 60000)
+ }).get()
+ if (ipLimit.data.length > 0) {
+ return {
+ code: 429,
+ msg: '请求过于频繁'
+ }
+ }
+ const templateId = '11753' // 替换为自己申请的模板id
+ if (!templateId) {
+ return {
+ code: 500,
+ msg: 'sendSmsCode需要传入自己的templateId,参考https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=sendsmscode'
+ }
+ }
+ const randomStr = '00000' + Math.floor(Math.random() * 1000000)
+ const code = randomStr.substring(randomStr.length - 6)
+ res = await uniID.sendSmsCode({
+ mobile: params.mobile,
+ code,
+ type: params.type,
+ templateId
+ })
+ break;
+ case 'loginBySms':
+ if (!params.code) {
+ return {
+ code: 500,
+ msg: '请填写验证码'
+ }
+ }
+ if (!/^1\d{10}$/.test(params.mobile)) {
+ return {
+ code: 500,
+ msg: '手机号码填写错误'
+ }
+ }
+ res = await uniID.loginBySms(params)
+ await loginLog(res)
+ break;
+ case 'resetPwdBySmsCode':
+ if (!params.code) {
+ return {
+ code: 500,
+ msg: '请填写验证码'
+ }
+ }
+ if (!/^1\d{10}$/.test(params.mobile)) {
+ return {
+ code: 500,
+ msg: '手机号码填写错误'
+ }
+ }
+ params.type = 'login'
+ let loginBySmsRes = await uniID.loginBySms(params)
+ // console.log(loginBySmsRes);
+ if (loginBySmsRes.code === 0) {
+ res = await uniID.resetPwd({
+ password: params.password,
+ "uid": loginBySmsRes.uid
+ })
+ } else {
+ return loginBySmsRes
+ }
+ break;
+ case 'getInviteCode':
+ res = await uniID.getUserInfo({
+ uid: params.uid,
+ field: ['my_invite_code']
+ })
+ if (res.code === 0) {
+ res.myInviteCode = res.userInfo.my_invite_code
+ delete res.userInfo
+ }
+ break;
+ case 'getInvitedUser':
+ res = await uniID.getInvitedUser(params)
+ break;
+ case 'updatePwd':
+ res = await uniID.updatePwd(params)
+ break;
+ case 'createCaptcha':
+ res = await uniCaptcha.create(params)
+ break;
+ case 'refreshCaptcha':
+ res = await uniCaptcha.refresh(params)
+ break;
+ case 'getUserInviteCode':
+ res = await uniID.getUserInfo({
+ uid: params.uid,
+ field: ['my_invite_code']
+ })
+ if (!res.userInfo.my_invite_code) {
+ res = await uniID.setUserInviteCode({
+ uid: params.uid
+ })
+ }
+ break;
+
+ // =========================== admin api start =========================
+ case 'registerAdmin': {
+ var {
+ username,
+ password
+ } = params
+ let {
+ total
+ } = await db.collection('uni-id-users').where({
+ role: 'admin'
+ }).count()
+ if (total) {
+ return {
+ code: 10001,
+ message: '超级管理员已存在,请登录...'
+ }
+ }
+ const appid = params.appid
+ const appName = params.appName
+ delete params.appid
+ delete params.appName
+ res = await uniID.register({
+ username,
+ password,
+ role: ["admin"]
+ })
+ if (res.code === 0) {
+ const app = await db.collection('opendb-app-list').where({
+ appid
+ }).count()
+ if (!app.total) {
+ await db.collection('opendb-app-list').add({
+ appid,
+ name: appName,
+ description: "admin 管理后台",
+ create_date: Date.now()
+ })
+ }
+
+ }
+ }
+ break;
+ case 'registerUser':
+ const {
+ userInfo
+ } = await uniID.getUserInfo({
+ uid: params.uid
+ })
+ if (userInfo.role.indexOf('admin') === -1) {
+ res = {
+ code: 403,
+ message: '非法访问, 无权限注册超级管理员',
+ }
+ } else {
+ // 过滤 dcloud_appid,注册用户成功后再提交
+ const dcloudAppidList = params.dcloud_appid
+ delete params.dcloud_appid
+ res = await uniID.register({
+ autoSetDcloudAppid: false,
+ ...params
+ })
+ if (res.code === 0) {
+ delete res.token
+ delete res.tokenExpired
+ await uniID.setAuthorizedAppLogin({
+ uid: res.uid,
+ dcloudAppidList
+ })
+ }
+ }
+ break;
+ case 'updateUser': {
+ const {
+ userInfo
+ } = await uniID.getUserInfo({
+ uid: params.uid
+ })
+ if (userInfo.role.indexOf('admin') === -1) {
+ res = {
+ code: 403,
+ message: '非法访问, 无权限注册超级管理员',
+ }
+ } else {
+ // 过滤 dcloud_appid,注册用户成功后再提交
+ const dcloudAppidList = params.dcloud_appid
+ delete params.dcloud_appid
+
+ // 过滤 password,注册用户成功后再提交
+ const password = params.password
+ delete params.password
+
+ // 过滤 uid、id
+ const id = params.id
+ delete params.id
+ delete params.uid
+
+
+ res = await uniID.updateUser({
+ uid: id,
+ ...params
+ })
+ if (res.code === 0) {
+ if (password) {
+ await uniID.resetPwd({
+ uid: id,
+ password
+ })
+ }
+ await uniID.setAuthorizedAppLogin({
+ uid: id,
+ dcloudAppidList
+ })
+ }
+ }
+ break;
+ }
+ case 'getCurrentUserInfo':
+ res = await uniID.getUserInfo({
+ uid: params.uid,
+ ...params
+ })
+ break;
+ // =========================== admin api end =========================
+ default:
+ res = {
+ code: 403,
+ msg: '非法访问'
+ }
+ break;
+ }
+ //返回数据给客户端
+ return res
+}
diff --git a/uni_modules/uni-id/changelog.md b/uni_modules/uni-id/changelog.md
index 9615838f736e2d792350121eb9e3fb26d08b9034..406a73f4046f7770080beec4a98fd2a25ca8e9be 100644
--- a/uni_modules/uni-id/changelog.md
+++ b/uni_modules/uni-id/changelog.md
@@ -1,54 +1,54 @@
## 3.3.6(2021-09-08)
- 修复 邀请码可能重复的Bug
-## 3.3.5(2021-08-10)
-- 修复版本号错误
-## 3.3.4(2021-08-10)
-- 微信、QQ、支付宝登录新增type参数用于指定当前是登录还是注册
-## 3.3.3(2021-08-04)
-- 修复使用数组形式的配置文件报错的Bug
-## 3.3.2(2021-08-03)
-- 修复上3.3.0版本引出的createInstance接口传入配置不生效的Bug 感谢[hmh](https://gitee.com/hmh)
-## 3.3.1(2021-07-30)
-- 修复 将设置用户允许登录的应用列表时传入空数组报错的Bug
-## 3.3.0(2021-07-30)
-- 新增 不同端应用配置隔离 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-config)
-- 新增 不同端用户隔离 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-user)
- + 此版本升级需要开发者处理一下用户数据,请参考 [补齐用户dcloud_appid字段](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=makeup-dcloud-appid)
-- 新增 QQ登录、注册相关功能 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=qq)
-- 调整 不再支持绑定手机、邮箱时不填验证码直接绑定
-## 3.2.1(2021-07-09)
-- 撤销3.2.0版本所做的调整
-## 3.2.0(2021-07-09)
-- 【重要】支持不同端(管理端、用户端等)用户隔离 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-user)
-- 支持不同端(管理端、用户端等)配置文件隔离 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-config)
-## 3.1.3(2021-07-08)
-- 移除插件内误传的node_modules
-## 3.1.2(2021-07-08)
-- 修复 微信小程序绑定微信账号时报错的Bug
-## 3.1.1(2021-07-01)
-- 使用新的错误码规范,兼容旧版 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=errcode)
-- 修复微信登录、绑定时未返回用户accessToken的Bug
-## 3.1.0(2021-04-19)
-- 增加对用户名、邮箱、密码字段的两端去空格
-- 默认忽略用户名、邮箱的大小写 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=case-sensitive)
-- 修复 customToken导出async方法报错的Bug
-## 3.0.12(2021-04-13)
-- 调整bindTokenToDevice默认值为false
-## 3.0.11(2021-04-12)
-- 修复3.0.7版本引出的多个用户访问时可能出现30201报错的Bug
-## 3.0.10(2021-04-08)
-- 优化错误提示
-## 3.0.9(2021-04-08)
-- bindMobile接口支持通过一键登录的方式绑定
-- 优化错误提示
-## 3.0.8(2021-03-19)
-- 修复 3.0.7版本某些情况下生成token报错的Bug
-## 3.0.7(2021-03-19)
-- 新增 支持uni-config-center,更新uni-id无须再担心配置被覆盖 [详情](https://uniapp.dcloud.io/uniCloud/uni-id?id=uni-config-center)
-- 新增 自定义token内容,可以缓存角色权限之外的更多信息到客户端 [详情](https://uniapp.dcloud.io/uniCloud/uni-id?id=custom-token)
-- 新增 支持传入context获取uni-id实例,防止单实例多并发时全局context混乱 [详情](https://uniapp.dcloud.io/uniCloud/uni-id?id=create-instance)
-## 3.0.6(2021-03-05)
-- 新增[uniID.wxBizDataCrypt](https://uniapp.dcloud.io/uniCloud/uni-id?id=%e5%be%ae%e4%bf%a1%e6%95%b0%e6%8d%ae%e8%a7%a3%e5%af%86)方法
-- 优化loginByApple方法,提高接口响应速度
-## 3.0.5(2021-02-03)
-- 调整为uni_modules目录规范
+## 3.3.5(2021-08-10)
+- 修复版本号错误
+## 3.3.4(2021-08-10)
+- 微信、QQ、支付宝登录新增type参数用于指定当前是登录还是注册
+## 3.3.3(2021-08-04)
+- 修复使用数组形式的配置文件报错的Bug
+## 3.3.2(2021-08-03)
+- 修复上3.3.0版本引出的createInstance接口传入配置不生效的Bug 感谢[hmh](https://gitee.com/hmh)
+## 3.3.1(2021-07-30)
+- 修复 将设置用户允许登录的应用列表时传入空数组报错的Bug
+## 3.3.0(2021-07-30)
+- 新增 不同端应用配置隔离 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-config)
+- 新增 不同端用户隔离 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-user)
+ + 此版本升级需要开发者处理一下用户数据,请参考 [补齐用户dcloud_appid字段](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=makeup-dcloud-appid)
+- 新增 QQ登录、注册相关功能 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=qq)
+- 调整 不再支持绑定手机、邮箱时不填验证码直接绑定
+## 3.2.1(2021-07-09)
+- 撤销3.2.0版本所做的调整
+## 3.2.0(2021-07-09)
+- 【重要】支持不同端(管理端、用户端等)用户隔离 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-user)
+- 支持不同端(管理端、用户端等)配置文件隔离 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-config)
+## 3.1.3(2021-07-08)
+- 移除插件内误传的node_modules
+## 3.1.2(2021-07-08)
+- 修复 微信小程序绑定微信账号时报错的Bug
+## 3.1.1(2021-07-01)
+- 使用新的错误码规范,兼容旧版 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=errcode)
+- 修复微信登录、绑定时未返回用户accessToken的Bug
+## 3.1.0(2021-04-19)
+- 增加对用户名、邮箱、密码字段的两端去空格
+- 默认忽略用户名、邮箱的大小写 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=case-sensitive)
+- 修复 customToken导出async方法报错的Bug
+## 3.0.12(2021-04-13)
+- 调整bindTokenToDevice默认值为false
+## 3.0.11(2021-04-12)
+- 修复3.0.7版本引出的多个用户访问时可能出现30201报错的Bug
+## 3.0.10(2021-04-08)
+- 优化错误提示
+## 3.0.9(2021-04-08)
+- bindMobile接口支持通过一键登录的方式绑定
+- 优化错误提示
+## 3.0.8(2021-03-19)
+- 修复 3.0.7版本某些情况下生成token报错的Bug
+## 3.0.7(2021-03-19)
+- 新增 支持uni-config-center,更新uni-id无须再担心配置被覆盖 [详情](https://uniapp.dcloud.io/uniCloud/uni-id?id=uni-config-center)
+- 新增 自定义token内容,可以缓存角色权限之外的更多信息到客户端 [详情](https://uniapp.dcloud.io/uniCloud/uni-id?id=custom-token)
+- 新增 支持传入context获取uni-id实例,防止单实例多并发时全局context混乱 [详情](https://uniapp.dcloud.io/uniCloud/uni-id?id=create-instance)
+## 3.0.6(2021-03-05)
+- 新增[uniID.wxBizDataCrypt](https://uniapp.dcloud.io/uniCloud/uni-id?id=%e5%be%ae%e4%bf%a1%e6%95%b0%e6%8d%ae%e8%a7%a3%e5%af%86)方法
+- 优化loginByApple方法,提高接口响应速度
+## 3.0.5(2021-02-03)
+- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-id/package.json b/uni_modules/uni-id/package.json
index f94bee59b94056085e9fa323d28c426a43e44bca..b78d0c41ef6ad54b622d5dd2d69364bb9ec9034b 100644
--- a/uni_modules/uni-id/package.json
+++ b/uni_modules/uni-id/package.json
@@ -1,84 +1,84 @@
-{
- "id": "uni-id",
- "displayName": "uni-id",
- "version": "3.3.6",
- "description": "简单、统一、可扩展的用户中心",
- "keywords": [
- "uniid",
- "uni-id",
- "用户管理",
- "用户中心",
- "短信验证码"
-],
- "repository": "https://gitee.com/dcloud/uni-id.git",
- "engines": {
- "HBuilderX": "^3.1.0"
- },
- "dcloudext": {
- "category": [
- "uniCloud",
- "云函数模板"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": ""
- },
- "uni_modules": {
- "dependencies": ["uni-config-center"],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "u",
- "app-nvue": "u"
- },
- "H5-mobile": {
- "Safari": "u",
- "Android Browser": "u",
- "微信浏览器(Android)": "u",
- "QQ浏览器(Android)": "u"
- },
- "H5-pc": {
- "Chrome": "u",
- "IE": "u",
- "Edge": "u",
- "Firefox": "u",
- "Safari": "u"
- },
- "小程序": {
- "微信": "u",
- "阿里": "u",
- "百度": "u",
- "字节跳动": "u",
- "QQ": "u"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- },
- "Vue": {
- "vue2": "y",
- "vue3": "u"
- }
- }
- }
- }
+{
+ "id": "uni-id",
+ "displayName": "uni-id",
+ "version": "3.3.6",
+ "description": "简单、统一、可扩展的用户中心",
+ "keywords": [
+ "uniid",
+ "uni-id",
+ "用户管理",
+ "用户中心",
+ "短信验证码"
+],
+ "repository": "https://gitee.com/dcloud/uni-id.git",
+ "engines": {
+ "HBuilderX": "^3.1.0"
+ },
+ "dcloudext": {
+ "category": [
+ "uniCloud",
+ "云函数模板"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": ""
+ },
+ "uni_modules": {
+ "dependencies": ["uni-config-center"],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "u",
+ "app-nvue": "u"
+ },
+ "H5-mobile": {
+ "Safari": "u",
+ "Android Browser": "u",
+ "微信浏览器(Android)": "u",
+ "QQ浏览器(Android)": "u"
+ },
+ "H5-pc": {
+ "Chrome": "u",
+ "IE": "u",
+ "Edge": "u",
+ "Firefox": "u",
+ "Safari": "u"
+ },
+ "小程序": {
+ "微信": "u",
+ "阿里": "u",
+ "百度": "u",
+ "字节跳动": "u",
+ "QQ": "u"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-id/readme.md b/uni_modules/uni-id/readme.md
index ea7751ccf07d57da8ea31887d3ca0562d20efba6..6890121312059daf2c483575567c3569cd3af93a 100644
--- a/uni_modules/uni-id/readme.md
+++ b/uni_modules/uni-id/readme.md
@@ -1,33 +1,33 @@
-**文档已移至[uni-id文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id)**
-
-> 一般uni-id升级大版本时为不兼容更新,从低版本迁移到高版本请参考:[uni-id迁移指南](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=migration)
-
-## 重要升级说明
-
-**uni-id 3.x版本,搭配的uniCloud admin版本需大于1.2.10。**
-
-### 缓存角色权限
-
-自`uni-id 3.0.0`起,支持在token内缓存用户的角色权限,默认开启此功能,各登录接口的needPermission参数不再生效。如需关闭请在config内配置`"removePermissionAndRoleFromToken": true`。
-
-为什么要缓存角色权限?要知道云数据库是按照读写次数来收取费用的,并且读写数据库会拖慢接口响应速度。未配置`"removePermissionAndRoleFromToken": true`的情况下,可以在调用checkToken接口时不查询数据库获取用户角色权限。
-
-详细checkToken流程如下:
-
-![](https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/ed45d350-5a4d-11eb-b997-9918a5dda011.jpg)
-
-可以看出,旧版token(removePermissionAndRoleFromToken为true时生成的)在checkToken时如需返回权限需要进行两次数据库查询。新版token不需要查库即可返回权限信息。
-
-**注意**
-
-- 由于角色权限缓存在token内,可能会存在权限已经更新但是用户token未过期之前依然是旧版角色权限的情况。可以调短一些token过期时间来减少这种情况的影响。
-- admin角色token内不包含permission,如需自行判断用户是否有某个权限,要注意admin角色需要额外判断一下,写法如下
- ```js
- const {
- role,
- permission
- } = await uniID.checkToken(event.uniIdToken)
- if(role.includes('admin') || permission.includes('your permission id')) {
- // 当前角色拥有'your permission id'对应的权限
- }
+**文档已移至[uni-id文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id)**
+
+> 一般uni-id升级大版本时为不兼容更新,从低版本迁移到高版本请参考:[uni-id迁移指南](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=migration)
+
+## 重要升级说明
+
+**uni-id 3.x版本,搭配的uniCloud admin版本需大于1.2.10。**
+
+### 缓存角色权限
+
+自`uni-id 3.0.0`起,支持在token内缓存用户的角色权限,默认开启此功能,各登录接口的needPermission参数不再生效。如需关闭请在config内配置`"removePermissionAndRoleFromToken": true`。
+
+为什么要缓存角色权限?要知道云数据库是按照读写次数来收取费用的,并且读写数据库会拖慢接口响应速度。未配置`"removePermissionAndRoleFromToken": true`的情况下,可以在调用checkToken接口时不查询数据库获取用户角色权限。
+
+详细checkToken流程如下:
+
+![](https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/ed45d350-5a4d-11eb-b997-9918a5dda011.jpg)
+
+可以看出,旧版token(removePermissionAndRoleFromToken为true时生成的)在checkToken时如需返回权限需要进行两次数据库查询。新版token不需要查库即可返回权限信息。
+
+**注意**
+
+- 由于角色权限缓存在token内,可能会存在权限已经更新但是用户token未过期之前依然是旧版角色权限的情况。可以调短一些token过期时间来减少这种情况的影响。
+- admin角色token内不包含permission,如需自行判断用户是否有某个权限,要注意admin角色需要额外判断一下,写法如下
+ ```js
+ const {
+ role,
+ permission
+ } = await uniID.checkToken(event.uniIdToken)
+ if(role.includes('admin') || permission.includes('your permission id')) {
+ // 当前角色拥有'your permission id'对应的权限
+ }
```
\ No newline at end of file
diff --git a/uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/LICENSE.md b/uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/LICENSE.md
index 261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64..29f81d812f3e768fa89638d1f72920dbfd1413a8 100644
--- a/uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/LICENSE.md
+++ b/uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/LICENSE.md
@@ -1,201 +1,201 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/uni_modules/uni-indexed-list/changelog.md b/uni_modules/uni-indexed-list/changelog.md
index 7af85e4ce3501afd8417cfadb0dfd90a411b9535..66b20d790199502337f84a09025c6df0279b836a 100644
--- a/uni_modules/uni-indexed-list/changelog.md
+++ b/uni_modules/uni-indexed-list/changelog.md
@@ -1,12 +1,12 @@
## 1.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.0.11(2021-05-12)
-- 新增 组件示例地址
-## 1.0.10(2021-04-21)
-- 优化 添加依赖 uni-icons, 导入后自动下载依赖
-## 1.0.9(2021-02-05)
-- 优化 组件引用关系,通过uni_modules引用组件
-
-## 1.0.8(2021-02-05)
-- 调整为uni_modules目录规范
-- 新增 支持 PC 端
+## 1.0.11(2021-05-12)
+- 新增 组件示例地址
+## 1.0.10(2021-04-21)
+- 优化 添加依赖 uni-icons, 导入后自动下载依赖
+## 1.0.9(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+
+## 1.0.8(2021-02-05)
+- 调整为uni_modules目录规范
+- 新增 支持 PC 端
diff --git a/uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list-item.vue b/uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list-item.vue
index 7976f6844df5479ded3fa935f10abe7f380be962..afa50412ccdd9553aa7e9cfbba8476c4c0cf001c 100644
--- a/uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list-item.vue
+++ b/uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list-item.vue
@@ -1,142 +1,142 @@
-
-
-
- {{ list.key }}
-
-
-
-
-
-
-
-
- {{ item.name }}
-
-
-
-
-
-
-
-
-
-
+ /* #endif */
+ }
+
+ .uni-indexed-list__item-border {
+ flex: 1;
+ position: relative;
+ /* #ifndef APP-NVUE */
+ display: flex;
+ box-sizing: border-box;
+ /* #endif */
+ flex-direction: row;
+ justify-content: space-between;
+ align-items: center;
+ height: 50px;
+ padding: $uni-spacing-row-lg;
+ padding-left: 0;
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+ border-bottom-color: $uni-border-color;
+ }
+
+ .uni-indexed-list__item-border--last {
+ border-bottom-width: 0px;
+ }
+
+ .uni-indexed-list__item-content {
+ flex: 1;
+ font-size: 14px;
+ }
+
+ .uni-indexed-list {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: row;
+ }
+
+ .uni-indexed-list__title-wrapper {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ width: 100%;
+ /* #endif */
+ background-color: #f7f7f7;
+ }
+
+ .uni-indexed-list__title {
+ padding: 6px 12px;
+ line-height: 24px;
+ font-size: $uni-font-size-sm;
+ }
+
diff --git a/uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list.vue b/uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list.vue
index 665379ccb2d87394c9a32d93610ad274b671b156..e507051b4c60330f754c99bc961b60c093b7e210 100644
--- a/uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list.vue
+++ b/uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list.vue
@@ -1,359 +1,359 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
-
-
- {{ lists[touchmoveIndex].key }}
-
-
-
-
-
diff --git a/uni_modules/uni-indexed-list/package.json b/uni_modules/uni-indexed-list/package.json
index 5e1cddc999e39890ecaf6a94e3c838694c9bcd75..3f2c0cc6a15878aacda42502eb1c1e173b8381f9 100644
--- a/uni_modules/uni-indexed-list/package.json
+++ b/uni_modules/uni-indexed-list/package.json
@@ -1,84 +1,84 @@
-{
- "id": "uni-indexed-list",
- "displayName": "uni-indexed-list 索引列表",
- "version": "1.1.0",
- "description": "索引列表组件,右侧带索引的列表,方便快速定位到具体内容,通常用于城市/机场选择等场景",
- "keywords": [
- "uni-ui",
- "索引列表",
- "索引",
- "列表"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [
- "uni-icons"
- ],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
-}
+{
+ "id": "uni-indexed-list",
+ "displayName": "uni-indexed-list 索引列表",
+ "version": "1.1.0",
+ "description": "索引列表组件,右侧带索引的列表,方便快速定位到具体内容,通常用于城市/机场选择等场景",
+ "keywords": [
+ "uni-ui",
+ "索引列表",
+ "索引",
+ "列表"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-icons"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
+}
diff --git a/uni_modules/uni-list/changelog.md b/uni_modules/uni-list/changelog.md
index dd6f01d7855d0b0684fa5c2256cf3ed4e88a5b01..713e2698890b9d0778b54f57d59a68bb7bc9c31a 100644
--- a/uni_modules/uni-list/changelog.md
+++ b/uni_modules/uni-list/changelog.md
@@ -1,15 +1,15 @@
## 1.1.3(2021-08-30)
- 修复 在vue3中to属性在发行应用的时候报错的bug
-## 1.1.2(2021-07-30)
-- 优化 vue3下事件警告的问题
-## 1.1.1(2021-07-21)
-- 修复 与其他组件嵌套使用时,点击失效的Bug
-## 1.1.0(2021-07-13)
-- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.0.17(2021-05-12)
-- 新增 组件示例地址
-## 1.0.16(2021-02-05)
-- 优化 组件引用关系,通过uni_modules引用组件
-## 1.0.15(2021-02-05)
-- 调整为uni_modules目录规范
-- 修复 uni-list-chat 角标显示不正常的问题
+## 1.1.2(2021-07-30)
+- 优化 vue3下事件警告的问题
+## 1.1.1(2021-07-21)
+- 修复 与其他组件嵌套使用时,点击失效的Bug
+## 1.1.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.0.17(2021-05-12)
+- 新增 组件示例地址
+## 1.0.16(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+## 1.0.15(2021-02-05)
+- 调整为uni_modules目录规范
+- 修复 uni-list-chat 角标显示不正常的问题
diff --git a/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue b/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue
index e256e4c5c8e45ca094c0002c19a4928aa9fbcb32..553dea2cc0a33e3ec09823b6e2a64a21b615ebea 100644
--- a/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue
+++ b/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue
@@ -1,107 +1,107 @@
-
-
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss
index 311f8d9faf070f43c719519076af6a8b29424383..7e2708f74c2643208872ef6fa4d2c1f014328639 100644
--- a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss
+++ b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss
@@ -14,8 +14,8 @@ $divide-line-color : #e5e5e5;
$avatar-width : 45px ;
// 头像边框
-$avatar-border-radius: 5px;
-$avatar-border-color: #eee;
+$avatar-border-radius: 5px;
+$avatar-border-color: #eee;
$avatar-border-width: 1px;
// 标题文字样式
@@ -36,11 +36,11 @@ $right-text-weight : normal;
// 角标样式
// nvue 页面不支持修改圆点位置以及大小
// 角标在左侧时,角标的位置,默认为 0 ,负数左/下移动,正数右/上移动
-$badge-left: 0px;
+$badge-left: 0px;
$badge-top: 0px;
// 显示圆点时,圆点大小
-$dot-width: 10px;
+$dot-width: 10px;
$dot-height: 10px;
// 显示角标时,角标大小和字体大小
diff --git a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue
index 70345afc264d6f052b5e618c6b84a84be7c25777..9f8796f821dd17457e567ee2164f67b0bf46c4c6 100644
--- a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue
+++ b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue
@@ -1,534 +1,534 @@
-
-
-
-
-
-
-
-
-
- {{ badgeText === 'dot' ? '' : badgeText }}
-
-
-
- {{ title }}
- {{ note }}
-
-
-
-
-
-
- |
-
-
-
-
-
-
diff --git a/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue b/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue
index 167222bcbf685b5cd048f75f418f3ddb30d38e2b..71f16a4d77a5b5f0d2b8fa1521803f7b10d42acc 100644
--- a/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue
+++ b/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue
@@ -1,461 +1,461 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ title }}
- {{ note }}
-
-
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
diff --git a/uni_modules/uni-list/components/uni-list/uni-list.vue b/uni_modules/uni-list/components/uni-list/uni-list.vue
index 1c85003e5547d3d2b16115037b76d51ae2a1d970..389178b2b09e45e936e20b7f3aea68b35f6ca5f9 100644
--- a/uni_modules/uni-list/components/uni-list/uni-list.vue
+++ b/uni_modules/uni-list/components/uni-list/uni-list.vue
@@ -1,106 +1,106 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-list/components/uni-list/uni-refresh.vue b/uni_modules/uni-list/components/uni-list/uni-refresh.vue
index 3b4c5a230061935d31d8332663b8a511b5143759..2c64158a6293c4c9d67c8e551d8365a90fcfcd80 100644
--- a/uni_modules/uni-list/components/uni-list/uni-refresh.vue
+++ b/uni_modules/uni-list/components/uni-list/uni-refresh.vue
@@ -1,65 +1,65 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-list/components/uni-list/uni-refresh.wxs b/uni_modules/uni-list/components/uni-list/uni-refresh.wxs
index 818a6b721b1172073d91c1f6a456d2b54d772f77..9ef364e092dbae2ec45dcd6a279a27263c890103 100644
--- a/uni_modules/uni-list/components/uni-list/uni-refresh.wxs
+++ b/uni_modules/uni-list/components/uni-list/uni-refresh.wxs
@@ -1,87 +1,87 @@
-var pullDown = {
- threshold: 95,
- maxHeight: 200,
- callRefresh: 'onrefresh',
- callPullingDown: 'onpullingdown',
- refreshSelector: '.uni-refresh'
-};
-
-function ready(newValue, oldValue, ownerInstance, instance) {
- var state = instance.getState()
- state.canPullDown = newValue;
- // console.log(newValue);
-}
-
-function touchStart(e, instance) {
- var state = instance.getState();
- state.refreshInstance = instance.selectComponent(pullDown.refreshSelector);
- state.canPullDown = (state.refreshInstance != null && state.refreshInstance != undefined);
- if (!state.canPullDown) {
- return
- }
-
- // console.log("touchStart");
-
- state.height = 0;
- state.touchStartY = e.touches[0].pageY || e.changedTouches[0].pageY;
- state.refreshInstance.setStyle({
- 'height': 0
- });
- state.refreshInstance.callMethod("onchange", true);
-}
-
-function touchMove(e, ownerInstance) {
- var instance = e.instance;
- var state = instance.getState();
- if (!state.canPullDown) {
- return
- }
-
- var oldHeight = state.height;
- var endY = e.touches[0].pageY || e.changedTouches[0].pageY;
- var height = endY - state.touchStartY;
- if (height > pullDown.maxHeight) {
- return;
- }
-
- var refreshInstance = state.refreshInstance;
- refreshInstance.setStyle({
- 'height': height + 'px'
- });
-
- height = height < pullDown.maxHeight ? height : pullDown.maxHeight;
- state.height = height;
- refreshInstance.callMethod(pullDown.callPullingDown, {
- height: height
- });
-}
-
-function touchEnd(e, ownerInstance) {
- var state = e.instance.getState();
- if (!state.canPullDown) {
- return
- }
-
- state.refreshInstance.callMethod("onchange", false);
-
- var refreshInstance = state.refreshInstance;
- if (state.height > pullDown.threshold) {
- refreshInstance.callMethod(pullDown.callRefresh);
- return;
- }
-
- refreshInstance.setStyle({
- 'height': 0
- });
-}
-
-function propObserver(newValue, oldValue, instance) {
- pullDown = newValue;
-}
-
-module.exports = {
- touchmove: touchMove,
- touchstart: touchStart,
- touchend: touchEnd,
- propObserver: propObserver
-}
+var pullDown = {
+ threshold: 95,
+ maxHeight: 200,
+ callRefresh: 'onrefresh',
+ callPullingDown: 'onpullingdown',
+ refreshSelector: '.uni-refresh'
+};
+
+function ready(newValue, oldValue, ownerInstance, instance) {
+ var state = instance.getState()
+ state.canPullDown = newValue;
+ // console.log(newValue);
+}
+
+function touchStart(e, instance) {
+ var state = instance.getState();
+ state.refreshInstance = instance.selectComponent(pullDown.refreshSelector);
+ state.canPullDown = (state.refreshInstance != null && state.refreshInstance != undefined);
+ if (!state.canPullDown) {
+ return
+ }
+
+ // console.log("touchStart");
+
+ state.height = 0;
+ state.touchStartY = e.touches[0].pageY || e.changedTouches[0].pageY;
+ state.refreshInstance.setStyle({
+ 'height': 0
+ });
+ state.refreshInstance.callMethod("onchange", true);
+}
+
+function touchMove(e, ownerInstance) {
+ var instance = e.instance;
+ var state = instance.getState();
+ if (!state.canPullDown) {
+ return
+ }
+
+ var oldHeight = state.height;
+ var endY = e.touches[0].pageY || e.changedTouches[0].pageY;
+ var height = endY - state.touchStartY;
+ if (height > pullDown.maxHeight) {
+ return;
+ }
+
+ var refreshInstance = state.refreshInstance;
+ refreshInstance.setStyle({
+ 'height': height + 'px'
+ });
+
+ height = height < pullDown.maxHeight ? height : pullDown.maxHeight;
+ state.height = height;
+ refreshInstance.callMethod(pullDown.callPullingDown, {
+ height: height
+ });
+}
+
+function touchEnd(e, ownerInstance) {
+ var state = e.instance.getState();
+ if (!state.canPullDown) {
+ return
+ }
+
+ state.refreshInstance.callMethod("onchange", false);
+
+ var refreshInstance = state.refreshInstance;
+ if (state.height > pullDown.threshold) {
+ refreshInstance.callMethod(pullDown.callRefresh);
+ return;
+ }
+
+ refreshInstance.setStyle({
+ 'height': 0
+ });
+}
+
+function propObserver(newValue, oldValue, instance) {
+ pullDown = newValue;
+}
+
+module.exports = {
+ touchmove: touchMove,
+ touchstart: touchStart,
+ touchend: touchEnd,
+ propObserver: propObserver
+}
diff --git a/uni_modules/uni-list/package.json b/uni_modules/uni-list/package.json
index f7f7ef948f2d7ed1eea95d70a846ca9d92b97604..d9453a92d0c22bf345aaa95cab7fe404f5d2da0d 100644
--- a/uni_modules/uni-list/package.json
+++ b/uni_modules/uni-list/package.json
@@ -1,91 +1,91 @@
-{
- "id": "uni-list",
- "displayName": "uni-list 列表",
- "version": "1.1.3",
- "description": "List 组件 ,帮助使用者快速构建列表。",
- "keywords": [
- "",
- "uni-ui",
- "uniui",
- "列表",
- "",
- "list"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [
- "uni-badge",
- "uni-icons"
- ],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- },
- "Vue": {
- "vue2": "y",
- "vue3": "u"
- }
- }
- }
- }
+{
+ "id": "uni-list",
+ "displayName": "uni-list 列表",
+ "version": "1.1.3",
+ "description": "List 组件 ,帮助使用者快速构建列表。",
+ "keywords": [
+ "",
+ "uni-ui",
+ "uniui",
+ "列表",
+ "",
+ "list"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-badge",
+ "uni-icons"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json b/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json
index a4f14a5454b19c2e6245be1cfdcf6b2f48ac0a34..6f45b0ec86cebdb367de41b7cb9c6ababcf6ed8f 100644
--- a/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json
+++ b/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json
@@ -1,4 +1,4 @@
-{
+{
"uni-load-more.contentdown": "Pull up to show more",
"uni-load-more.contentrefresh": "loading...",
"uni-load-more.contentnomore": "No more data"
diff --git a/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js b/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js
index de7509c87ba5197b9f5d20ca94a0558c7a8e08a9..fa8f0f3734de6effb137592fce6c0f722c048432 100644
--- a/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js
+++ b/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js
@@ -1,8 +1,8 @@
-import en from './en.json'
-import zhHans from './zh-Hans.json'
-import zhHant from './zh-Hant.json'
-export default {
- en,
- 'zh-Hans': zhHans,
- 'zh-Hant': zhHant
+import en from './en.json'
+import zhHans from './zh-Hans.json'
+import zhHant from './zh-Hant.json'
+export default {
+ en,
+ 'zh-Hans': zhHans,
+ 'zh-Hant': zhHant
}
diff --git a/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json b/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json
index f15d5105033ed020b5286f3c6219bf9102134c72..3a14ca07bdc3208a3376f0a2fab28dd44d81e1fb 100644
--- a/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json
+++ b/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json
@@ -1,4 +1,4 @@
-{
+{
"uni-load-more.contentdown": "上拉显示更多",
"uni-load-more.contentrefresh": "正在加载...",
"uni-load-more.contentnomore": "没有更多数据了"
diff --git a/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json b/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json
index a255c6ded74a6a2422caab02e46a0b41d4a86353..ee99b0678292e75f9eedb3e4c476424a42288e64 100644
--- a/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json
+++ b/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json
@@ -1,4 +1,4 @@
-{
+{
"uni-load-more.contentdown": "上拉顯示更多",
"uni-load-more.contentrefresh": "正在加載...",
"uni-load-more.contentnomore": "沒有更多數據了"
diff --git a/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue b/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue
index 19fbc95f20da09b4b0aa8d51bcef0aebf7dd99f2..b20dea5e026bbd68c465d42e053ba367b09747cf 100644
--- a/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue
+++ b/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue
@@ -1,378 +1,378 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ status === 'more' ? contentdownText : status === 'loading' ? contentrefreshText : contentnomoreText }}
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ status === 'more' ? contentdownText : status === 'loading' ? contentrefreshText : contentnomoreText }}
+
+
+
+
+
+
diff --git a/uni_modules/uni-nav-bar/changelog.md b/uni_modules/uni-nav-bar/changelog.md
index 9aaae1fc692dc13c10b0f50a6ed8358e2c91ec49..70b3c488026ca64c47a6d00000fa3d0d82fdcdee 100644
--- a/uni_modules/uni-nav-bar/changelog.md
+++ b/uni_modules/uni-nav-bar/changelog.md
@@ -1,19 +1,19 @@
## 1.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.0.11(2021-05-12)
-- 新增 组件示例地址
-## 1.0.10(2021-04-30)
-- 修复 在nvue下fixed为true,宽度不能撑满的Bug
-## 1.0.9(2021-04-21)
-- 优化 添加依赖 uni-icons, 导入后自动下载依赖
-## 1.0.8(2021-04-14)
-- uni-ui 修复 uni-nav-bar 当 fixed 属性为 true 时铺不满屏幕的 bug
-
-## 1.0.7(2021-02-25)
-- 修复 easycom 下,找不到 uni-status-bar 的bug
-
-## 1.0.6(2021-02-05)
-- 优化 组件引用关系,通过uni_modules引用组件
-
-## 1.0.5(2021-02-05)
-- 调整为uni_modules目录规范
+## 1.0.11(2021-05-12)
+- 新增 组件示例地址
+## 1.0.10(2021-04-30)
+- 修复 在nvue下fixed为true,宽度不能撑满的Bug
+## 1.0.9(2021-04-21)
+- 优化 添加依赖 uni-icons, 导入后自动下载依赖
+## 1.0.8(2021-04-14)
+- uni-ui 修复 uni-nav-bar 当 fixed 属性为 true 时铺不满屏幕的 bug
+
+## 1.0.7(2021-02-25)
+- 修复 easycom 下,找不到 uni-status-bar 的bug
+
+## 1.0.6(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+
+## 1.0.5(2021-02-05)
+- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue b/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue
index 33b843092eb025328a85cc0c6a138bc57cd8fc90..0df773fecb496747b7996d60362f98405fa8194a 100644
--- a/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue
+++ b/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue
@@ -1,231 +1,231 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ }
+
+ .uni-navbar--shadow {
+ /* #ifndef APP-NVUE */
+ box-shadow: 0 1px 6px #ccc;
+ /* #endif */
+ }
+
+ .uni-navbar--border {
+ border-bottom-width: 1rpx;
+ border-bottom-style: solid;
+ border-bottom-color: $uni-border-color;
+ }
+
diff --git a/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar.vue b/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar.vue
index 976af6c49e3aa4eb30635f38f923e9722aad43b0..c91e67752e7ec40a2b6f7f3f79bdf75793a69cb9 100644
--- a/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar.vue
+++ b/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar.vue
@@ -1,27 +1,27 @@
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-nav-bar/package.json b/uni_modules/uni-nav-bar/package.json
index 3b0f20e78c98660fb4d3d461d1d786d31e631742..caf0ed4b12e8d0a9b3ecd984f347d9a05a40700a 100644
--- a/uni_modules/uni-nav-bar/package.json
+++ b/uni_modules/uni-nav-bar/package.json
@@ -1,84 +1,84 @@
-{
- "id": "uni-nav-bar",
- "displayName": "uni-nav-bar 自定义导航栏",
- "version": "1.1.0",
- "description": "自定义导航栏组件,主要用于头部导航。",
- "keywords": [
- "uni-ui",
- "导航",
- "导航栏",
- "自定义导航栏"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [
- "uni-icons"
- ],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-nav-bar",
+ "displayName": "uni-nav-bar 自定义导航栏",
+ "version": "1.1.0",
+ "description": "自定义导航栏组件,主要用于头部导航。",
+ "keywords": [
+ "uni-ui",
+ "导航",
+ "导航栏",
+ "自定义导航栏"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-icons"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-notice-bar/changelog.md b/uni_modules/uni-notice-bar/changelog.md
index 348245e02e004071dd75e427c7b460b0f13af592..37d7319e1f7a1392f2b1fdbdabede28e3dca51b4 100644
--- a/uni_modules/uni-notice-bar/changelog.md
+++ b/uni_modules/uni-notice-bar/changelog.md
@@ -1,11 +1,11 @@
## 1.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.0.9(2021-05-12)
-- 新增 组件示例地址
-## 1.0.8(2021-04-21)
-- 优化 添加依赖 uni-icons, 导入后自动下载依赖
-## 1.0.7(2021-02-05)
-- 优化 组件引用关系,通过uni_modules引用组件
-
-## 1.0.6(2021-02-05)
-- 调整为uni_modules目录规范
+## 1.0.9(2021-05-12)
+- 新增 组件示例地址
+## 1.0.8(2021-04-21)
+- 优化 添加依赖 uni-icons, 导入后自动下载依赖
+## 1.0.7(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+
+## 1.0.6(2021-02-05)
+- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue b/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue
index 878ba7e3806ddef1ad9673690b7fb30f432666ef..914ebe2c6d0d6fe02cd121938badb3c842cc195e 100644
--- a/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue
+++ b/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue
@@ -1,36 +1,36 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{text}}
-
-
-
- {{ moreText }}
-
-
-
-
-
-
-
-
+ }
+
+ .uni-noticebar-close {
+ margin-right: 5px;
+ }
+
+ .uni-noticebar-icon {
+ margin-right: 5px;
+ }
+
+ .uni-noticebar__content-wrapper {
+ flex: 1;
+ flex-direction: column;
+ overflow: hidden;
+ }
+
+ .uni-noticebar__content-wrapper--single {
+ /* #ifndef APP-NVUE */
+ line-height: 18px;
+ /* #endif */
+ }
+
+ .uni-noticebar__content-wrapper--single,
+ .uni-noticebar__content-wrapper--scrollable {
+ flex-direction: row;
+ }
+
+ /* #ifndef APP-NVUE */
+ .uni-noticebar__content-wrapper--scrollable {
+ position: relative;
+ height: 18px;
+ }
+ /* #endif */
+
+ .uni-noticebar__content--scrollable {
+ /* #ifdef APP-NVUE */
+ flex: 0;
+ /* #endif */
+ /* #ifndef APP-NVUE */
+ flex: 1;
+ display: block;
+ overflow: hidden;
+ /* #endif */
+ }
+
+ .uni-noticebar__content--single {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ flex: none;
+ width: 100%;
+ justify-content: center;
+ /* #endif */
+ }
+
+ .uni-noticebar__content-text {
+ font-size: 14px;
+ line-height: 18px;
+ /* #ifndef APP-NVUE */
+ word-break: break-all;
+ /* #endif */
+ }
+
+ .uni-noticebar__content-text--single {
+ /* #ifdef APP-NVUE */
+ lines: 1;
+ /* #endif */
+ /* #ifndef APP-NVUE */
+ display: block;
+ width: 100%;
+ white-space: nowrap;
+ /* #endif */
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ .uni-noticebar__content-text--scrollable {
+ /* #ifdef APP-NVUE */
+ lines: 1;
+ padding-left: 750rpx;
+ /* #endif */
+ /* #ifndef APP-NVUE */
+ position: absolute;
+ display: block;
+ height: 18px;
+ line-height: 18px;
+ white-space: nowrap;
+ padding-left: 100%;
+ animation: notice 10s 0s linear infinite both;
+ animation-play-state: paused;
+ /* #endif */
+ }
+
+ .uni-noticebar__more {
+ /* #ifndef APP-NVUE */
+ display: inline-flex;
+ /* #endif */
+ flex-direction: row;
+ flex-wrap: nowrap;
+ align-items: center;
+ padding-left: 5px;
+ }
+
+ .uni-noticebar__more-text {
+ font-size: 14px;
+ }
+
+ @keyframes notice {
+ 100% {
+ transform: translate3d(-100%, 0, 0);
+ }
+ }
+
diff --git a/uni_modules/uni-notice-bar/package.json b/uni_modules/uni-notice-bar/package.json
index 6b2e26e734c3da27eb7126b1f892d1cbb7f605f3..e11a41793fd9944fc36873d338dfafc9c352ed3f 100644
--- a/uni_modules/uni-notice-bar/package.json
+++ b/uni_modules/uni-notice-bar/package.json
@@ -1,85 +1,85 @@
-{
- "id": "uni-notice-bar",
- "displayName": "uni-notice-bar 通告栏",
- "version": "1.1.0",
- "description": "NoticeBar 通告栏组件,常用于展示公告信息,可设为滚动公告",
- "keywords": [
- "uni-ui",
- "uniui",
- "通告栏",
- "公告",
- "跑马灯"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [
- "uni-icons"
- ],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
-}
+{
+ "id": "uni-notice-bar",
+ "displayName": "uni-notice-bar 通告栏",
+ "version": "1.1.0",
+ "description": "NoticeBar 通告栏组件,常用于展示公告信息,可设为滚动公告",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "通告栏",
+ "公告",
+ "跑马灯"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-icons"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
+}
diff --git a/uni_modules/uni-number-box/changelog.md b/uni_modules/uni-number-box/changelog.md
index ed3890d1e62dab2c5a37f2631730c10a1d532047..1b73c791692966abf8bba034bb7b6b7cdc93e633 100644
--- a/uni_modules/uni-number-box/changelog.md
+++ b/uni_modules/uni-number-box/changelog.md
@@ -1,18 +1,18 @@
## 1.1.1(2021-07-30)
- 优化 vue3下事件警告的问题
-## 1.1.0(2021-07-13)
-- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.0.7(2021-05-12)
-- 新增 组件示例地址
-## 1.0.6(2021-04-20)
-- 修复 uni-number-box 浮点数运算不精确的 bug
-- 修复 uni-number-box change 事件触发不正确的 bug
-- 新增 uni-number-box v-model 双向绑定
-## 1.0.5(2021-02-05)
-- 调整为uni_modules目录规范
-
-## 1.0.7(2021-02-05)
-- 调整为uni_modules目录规范
-- 新增 支持 v-model
-- 新增 支持 focus、blur 事件
-- 新增 支持 PC 端
+## 1.1.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.0.7(2021-05-12)
+- 新增 组件示例地址
+## 1.0.6(2021-04-20)
+- 修复 uni-number-box 浮点数运算不精确的 bug
+- 修复 uni-number-box change 事件触发不正确的 bug
+- 新增 uni-number-box v-model 双向绑定
+## 1.0.5(2021-02-05)
+- 调整为uni_modules目录规范
+
+## 1.0.7(2021-02-05)
+- 调整为uni_modules目录规范
+- 新增 支持 v-model
+- 新增 支持 focus、blur 事件
+- 新增 支持 PC 端
diff --git a/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue b/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue
index e59fa40cda02966a4caecacb8c4b4f0a7a18680a..aee1742d8b532d6f5242deeb3a99b551113761b6 100644
--- a/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue
+++ b/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue
@@ -1,231 +1,231 @@
-
-
-
- -
-
-
-
- +
-
-
-
-
-
+
+
+
+ -
+
+
+
+ +
+
+
+
+
+
diff --git a/uni_modules/uni-number-box/package.json b/uni_modules/uni-number-box/package.json
index 1a0a8599074d464787509a31b17dd58a121f0574..940a29574b7a0dbe195036d64bb950e9c97f0360 100644
--- a/uni_modules/uni-number-box/package.json
+++ b/uni_modules/uni-number-box/package.json
@@ -1,81 +1,81 @@
-{
- "id": "uni-number-box",
- "displayName": "uni-number-box 数字输入框",
- "version": "1.1.1",
- "description": "NumberBox 带加减按钮的数字输入框组件,用户可以控制每次点击增加的数值,支持小数。",
- "keywords": [
- "uni-ui",
- "uniui",
- "数字输入框"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-number-box",
+ "displayName": "uni-number-box 数字输入框",
+ "version": "1.1.1",
+ "description": "NumberBox 带加减按钮的数字输入框组件,用户可以控制每次点击增加的数值,支持小数。",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "数字输入框"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-pagination/changelog.md b/uni_modules/uni-pagination/changelog.md
index 05387e0f4fea3bd6ae1b4ab19c0e024a170935f4..9c4fde2f2bef380063ee30ede424af8e34317175 100644
--- a/uni_modules/uni-pagination/changelog.md
+++ b/uni_modules/uni-pagination/changelog.md
@@ -1,11 +1,11 @@
## 1.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.0.7(2021-05-12)
-- 新增 组件示例地址
-## 1.0.6(2021-04-12)
-- 新增 PC 和 移动端适配不同的 ui
-## 1.0.5(2021-02-05)
-- 优化 组件引用关系,通过uni_modules引用组件
-
-## 1.0.4(2021-02-05)
-- 调整为uni_modules目录规范
+## 1.0.7(2021-05-12)
+- 新增 组件示例地址
+## 1.0.6(2021-04-12)
+- 新增 PC 和 移动端适配不同的 ui
+## 1.0.5(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+
+## 1.0.4(2021-02-05)
+- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue b/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue
index a883602f20c57d3c83fc782c61cf44891c93be11..4f07c0eb359076805620022a05061c7452ee19a9 100644
--- a/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue
+++ b/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue
@@ -1,27 +1,27 @@
-
+
-
-
-
-
diff --git a/uni_modules/uni-pagination/package.json b/uni_modules/uni-pagination/package.json
index 1b066ce06900afca2e65b0805caa5b45556140aa..b0e9501aa473e26a51e3e9c50d9f271338da5a2e 100644
--- a/uni_modules/uni-pagination/package.json
+++ b/uni_modules/uni-pagination/package.json
@@ -1,82 +1,82 @@
-{
- "id": "uni-pagination",
- "displayName": "uni-pagination 分页器",
- "version": "1.1.0",
- "description": "Pagination 分页器组件,用于展示页码、请求数据等。",
- "keywords": [
- "uni-ui",
- "uniui",
- "分页器",
- "页码"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": ["uni-icons"],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-pagination",
+ "displayName": "uni-pagination 分页器",
+ "version": "1.1.0",
+ "description": "Pagination 分页器组件,用于展示页码、请求数据等。",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "分页器",
+ "页码"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": ["uni-icons"],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js b/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js
index 6ef26a26211ff28976e6fc835fbef5d2ea5b5b1e..a747b9fc8c0d3df87adc4e7ffa380beef7f42cbe 100644
--- a/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js
+++ b/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js
@@ -1,45 +1,45 @@
-// #ifdef H5
-export default {
- name: 'Keypress',
- props: {
- disable: {
- type: Boolean,
- default: false
- }
- },
- mounted () {
- const keyNames = {
- esc: ['Esc', 'Escape'],
- tab: 'Tab',
- enter: 'Enter',
- space: [' ', 'Spacebar'],
- up: ['Up', 'ArrowUp'],
- left: ['Left', 'ArrowLeft'],
- right: ['Right', 'ArrowRight'],
- down: ['Down', 'ArrowDown'],
- delete: ['Backspace', 'Delete', 'Del']
- }
- const listener = ($event) => {
- if (this.disable) {
- return
- }
- const keyName = Object.keys(keyNames).find(key => {
- const keyName = $event.key
- const value = keyNames[key]
- return value === keyName || (Array.isArray(value) && value.includes(keyName))
- })
- if (keyName) {
- // 避免和其他按键事件冲突
- setTimeout(() => {
- this.$emit(keyName, {})
- }, 0)
- }
- }
- document.addEventListener('keyup', listener)
- this.$once('hook:beforeDestroy', () => {
- document.removeEventListener('keyup', listener)
- })
- },
- render: () => {}
-}
-// #endif
+// #ifdef H5
+export default {
+ name: 'Keypress',
+ props: {
+ disable: {
+ type: Boolean,
+ default: false
+ }
+ },
+ mounted () {
+ const keyNames = {
+ esc: ['Esc', 'Escape'],
+ tab: 'Tab',
+ enter: 'Enter',
+ space: [' ', 'Spacebar'],
+ up: ['Up', 'ArrowUp'],
+ left: ['Left', 'ArrowLeft'],
+ right: ['Right', 'ArrowRight'],
+ down: ['Down', 'ArrowDown'],
+ delete: ['Backspace', 'Delete', 'Del']
+ }
+ const listener = ($event) => {
+ if (this.disable) {
+ return
+ }
+ const keyName = Object.keys(keyNames).find(key => {
+ const keyName = $event.key
+ const value = keyNames[key]
+ return value === keyName || (Array.isArray(value) && value.includes(keyName))
+ })
+ if (keyName) {
+ // 避免和其他按键事件冲突
+ setTimeout(() => {
+ this.$emit(keyName, {})
+ }, 0)
+ }
+ }
+ document.addEventListener('keyup', listener)
+ this.$once('hook:beforeDestroy', () => {
+ document.removeEventListener('keyup', listener)
+ })
+ },
+ render: () => {}
+}
+// #endif
diff --git a/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue b/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue
index 291634c6ac62c0ea8b1d47c8d690d8f74448505c..7c8a0d3122c21aa3a5c02b7c09f3325fb06654d8 100644
--- a/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue
+++ b/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue
@@ -1,263 +1,263 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue b/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue
index f4c85e259e5310a01a1b4f6566aacc19b14270b9..f6bbccd75584262dcac9bf7b8f4a09a8d01e17cd 100644
--- a/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue
+++ b/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue
@@ -1,143 +1,143 @@
-
-
+
+
+
-
+ }
+ }
+ }
+
+
diff --git a/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue b/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue
index 705902db12585539592262c45239c1b524bc9ac2..3d9365ac30af0cb30b83b714ba25638ba4161902 100644
--- a/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue
+++ b/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue
@@ -1,185 +1,185 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/uni_modules/uni-popup/components/uni-popup/i18n/en.json b/uni_modules/uni-popup/components/uni-popup/i18n/en.json
index 7f1bd06a0380527163901fc369ed810b8e25fc46..8c0f5f38e3c7655ff05dbdc4a21cea2ba5d1038c 100644
--- a/uni_modules/uni-popup/components/uni-popup/i18n/en.json
+++ b/uni_modules/uni-popup/components/uni-popup/i18n/en.json
@@ -1,6 +1,6 @@
-{
- "uni-popup.cancel": "cancel",
- "uni-popup.ok": "ok",
+{
+ "uni-popup.cancel": "cancel",
+ "uni-popup.ok": "ok",
"uni-popup.placeholder": "pleace enter",
"uni-popup.title": "Hint",
"uni-popup.shareTitle": "Share to"
diff --git a/uni_modules/uni-popup/components/uni-popup/i18n/index.js b/uni_modules/uni-popup/components/uni-popup/i18n/index.js
index de7509c87ba5197b9f5d20ca94a0558c7a8e08a9..fa8f0f3734de6effb137592fce6c0f722c048432 100644
--- a/uni_modules/uni-popup/components/uni-popup/i18n/index.js
+++ b/uni_modules/uni-popup/components/uni-popup/i18n/index.js
@@ -1,8 +1,8 @@
-import en from './en.json'
-import zhHans from './zh-Hans.json'
-import zhHant from './zh-Hant.json'
-export default {
- en,
- 'zh-Hans': zhHans,
- 'zh-Hant': zhHant
+import en from './en.json'
+import zhHans from './zh-Hans.json'
+import zhHant from './zh-Hant.json'
+export default {
+ en,
+ 'zh-Hans': zhHans,
+ 'zh-Hant': zhHant
}
diff --git a/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json b/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json
index 5e3003cabc8f40b133736719aaaf8b3f1a226fb1..8e5b99f0822dc9c6781f5838a0c6b42c1ca85392 100644
--- a/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json
+++ b/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json
@@ -1,7 +1,7 @@
-{
- "uni-popup.cancel": "取消",
+{
+ "uni-popup.cancel": "取消",
"uni-popup.ok": "确定",
"uni-popup.placeholder": "请输入",
"uni-popup.title": "提示",
- "uni-popup.shareTitle": "分享到"
+ "uni-popup.shareTitle": "分享到"
}
diff --git a/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json b/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json
index 13e39eba1045a5cb942bbe1e27ed4162848ecf4f..06ce1629ba3bf090d84720a85e9bdbc9096ba69a 100644
--- a/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json
+++ b/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json
@@ -1,7 +1,7 @@
-{
- "uni-popup.cancel": "取消",
+{
+ "uni-popup.cancel": "取消",
"uni-popup.ok": "確定",
"uni-popup.placeholder": "請輸入",
"uni-popup.title": "提示",
- "uni-popup.shareTitle": "分享到"
+ "uni-popup.shareTitle": "分享到"
}
diff --git a/uni_modules/uni-popup/components/uni-popup/keypress.js b/uni_modules/uni-popup/components/uni-popup/keypress.js
index 62dda461bd5d5923a173e541f2cf049d816d612b..16a5818818d5f6f9a6c90b7ae4e9a6f1386f8524 100644
--- a/uni_modules/uni-popup/components/uni-popup/keypress.js
+++ b/uni_modules/uni-popup/components/uni-popup/keypress.js
@@ -1,45 +1,45 @@
-// #ifdef H5
-export default {
- name: 'Keypress',
- props: {
- disable: {
- type: Boolean,
- default: false
- }
- },
- mounted () {
- const keyNames = {
- esc: ['Esc', 'Escape'],
- tab: 'Tab',
- enter: 'Enter',
- space: [' ', 'Spacebar'],
- up: ['Up', 'ArrowUp'],
- left: ['Left', 'ArrowLeft'],
- right: ['Right', 'ArrowRight'],
- down: ['Down', 'ArrowDown'],
- delete: ['Backspace', 'Delete', 'Del']
- }
- const listener = ($event) => {
- if (this.disable) {
- return
- }
- const keyName = Object.keys(keyNames).find(key => {
- const keyName = $event.key
- const value = keyNames[key]
- return value === keyName || (Array.isArray(value) && value.includes(keyName))
- })
- if (keyName) {
- // 避免和其他按键事件冲突
- setTimeout(() => {
- this.$emit(keyName, {})
- }, 0)
- }
- }
- document.addEventListener('keyup', listener)
- // this.$once('hook:beforeDestroy', () => {
- // document.removeEventListener('keyup', listener)
- // })
- },
- render: () => {}
-}
-// #endif
+// #ifdef H5
+export default {
+ name: 'Keypress',
+ props: {
+ disable: {
+ type: Boolean,
+ default: false
+ }
+ },
+ mounted () {
+ const keyNames = {
+ esc: ['Esc', 'Escape'],
+ tab: 'Tab',
+ enter: 'Enter',
+ space: [' ', 'Spacebar'],
+ up: ['Up', 'ArrowUp'],
+ left: ['Left', 'ArrowLeft'],
+ right: ['Right', 'ArrowRight'],
+ down: ['Down', 'ArrowDown'],
+ delete: ['Backspace', 'Delete', 'Del']
+ }
+ const listener = ($event) => {
+ if (this.disable) {
+ return
+ }
+ const keyName = Object.keys(keyNames).find(key => {
+ const keyName = $event.key
+ const value = keyNames[key]
+ return value === keyName || (Array.isArray(value) && value.includes(keyName))
+ })
+ if (keyName) {
+ // 避免和其他按键事件冲突
+ setTimeout(() => {
+ this.$emit(keyName, {})
+ }, 0)
+ }
+ }
+ document.addEventListener('keyup', listener)
+ // this.$once('hook:beforeDestroy', () => {
+ // document.removeEventListener('keyup', listener)
+ // })
+ },
+ render: () => {}
+}
+// #endif
diff --git a/uni_modules/uni-popup/components/uni-popup/message.js b/uni_modules/uni-popup/components/uni-popup/message.js
index 0ff9a0242c1a2ed1899a36629cf6067f13ed29df..0c0c88d0bdfb102dbe9301c5e2f1b12ce41ff2e6 100644
--- a/uni_modules/uni-popup/components/uni-popup/message.js
+++ b/uni_modules/uni-popup/components/uni-popup/message.js
@@ -1,22 +1,22 @@
-export default {
- created() {
- if (this.type === 'message') {
- // 不显示遮罩
- this.maskShow = false
- // 获取子组件对象
- this.childrenMsg = null
- }
- },
- methods: {
- customOpen() {
- if (this.childrenMsg) {
- this.childrenMsg.open()
- }
- },
- customClose() {
- if (this.childrenMsg) {
- this.childrenMsg.close()
- }
- }
- }
-}
+export default {
+ created() {
+ if (this.type === 'message') {
+ // 不显示遮罩
+ this.maskShow = false
+ // 获取子组件对象
+ this.childrenMsg = null
+ }
+ },
+ methods: {
+ customOpen() {
+ if (this.childrenMsg) {
+ this.childrenMsg.open()
+ }
+ },
+ customClose() {
+ if (this.childrenMsg) {
+ this.childrenMsg.close()
+ }
+ }
+ }
+}
diff --git a/uni_modules/uni-popup/components/uni-popup/popup.js b/uni_modules/uni-popup/components/uni-popup/popup.js
index c4e5781dd6834247c297788d5bc4ef1339584143..a37fb9fc19bc1241ccd35d3f8bbae8b01cf7e398 100644
--- a/uni_modules/uni-popup/components/uni-popup/popup.js
+++ b/uni_modules/uni-popup/components/uni-popup/popup.js
@@ -1,9 +1,9 @@
-export default {
- data() {
- return {
-
- }
+export default {
+ data() {
+ return {
+
+ }
},
created(){
this.popup = this.getParent()
@@ -22,5 +22,5 @@ export default {
}
return parent;
},
- }
-}
+ }
+}
diff --git a/uni_modules/uni-popup/components/uni-popup/share.js b/uni_modules/uni-popup/components/uni-popup/share.js
index 462bb83ab3cbf468e41f4faa3463e1a68d3d6941..930a6cfb51ff212cca314e5e08277f099714f5ac 100644
--- a/uni_modules/uni-popup/components/uni-popup/share.js
+++ b/uni_modules/uni-popup/components/uni-popup/share.js
@@ -1,16 +1,16 @@
-export default {
- created() {
- if (this.type === 'share') {
- // 关闭点击
- this.mkclick = false
- }
- },
- methods: {
- customOpen() {
- console.log('share 打开了');
- },
- customClose() {
- console.log('share 关闭了');
- }
- }
-}
+export default {
+ created() {
+ if (this.type === 'share') {
+ // 关闭点击
+ this.mkclick = false
+ }
+ },
+ methods: {
+ customOpen() {
+ console.log('share 打开了');
+ },
+ customClose() {
+ console.log('share 关闭了');
+ }
+ }
+}
diff --git a/uni_modules/uni-popup/components/uni-popup/uni-popup.vue b/uni_modules/uni-popup/components/uni-popup/uni-popup.vue
index 59698b726046f5146a032af1ff95de6a91c19d0e..32419d86b825a990c88995b71854358d6ae59521 100644
--- a/uni_modules/uni-popup/components/uni-popup/uni-popup.vue
+++ b/uni_modules/uni-popup/components/uni-popup/uni-popup.vue
@@ -1,240 +1,240 @@
-
+
-
-
-
-
diff --git a/uni_modules/uni-rate/changelog.md b/uni_modules/uni-rate/changelog.md
index efb03b7968d1b3786068534c849f285a74e51728..9fe0e841fb2ccf3533a5621bb5f54144ee3ad96c 100644
--- a/uni_modules/uni-rate/changelog.md
+++ b/uni_modules/uni-rate/changelog.md
@@ -1,18 +1,18 @@
## 1.2.1(2021-07-30)
- 优化 vue3下事件警告的问题
-## 1.2.0(2021-07-13)
-- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.1.2(2021-05-12)
-- 新增 组件示例地址
-## 1.1.1(2021-04-21)
-- 修复 布局变化后 uni-rate 星星计算不准确的 bug
-- 优化 添加依赖 uni-icons, 导入 uni-rate 自动下载依赖
-## 1.1.0(2021-04-16)
-- 修复 uni-rate 属性 margin 值为 string 组件失效的 bug
-
-## 1.0.9(2021-02-05)
-- 优化 组件引用关系,通过uni_modules引用组件
-
-## 1.0.8(2021-02-05)
-- 调整为uni_modules目录规范
-- 支持 pc 端
+## 1.2.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.1.2(2021-05-12)
+- 新增 组件示例地址
+## 1.1.1(2021-04-21)
+- 修复 布局变化后 uni-rate 星星计算不准确的 bug
+- 优化 添加依赖 uni-icons, 导入 uni-rate 自动下载依赖
+## 1.1.0(2021-04-16)
+- 修复 uni-rate 属性 margin 值为 string 组件失效的 bug
+
+## 1.0.9(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+
+## 1.0.8(2021-02-05)
+- 调整为uni_modules目录规范
+- 支持 pc 端
diff --git a/uni_modules/uni-rate/components/uni-rate/uni-rate.vue b/uni_modules/uni-rate/components/uni-rate/uni-rate.vue
index 58b513233f5b1f731177ac33aa3336b852e97d68..082f6767c793e141754f4b7a2876322a3392bb21 100644
--- a/uni_modules/uni-rate/components/uni-rate/uni-rate.vue
+++ b/uni_modules/uni-rate/components/uni-rate/uni-rate.vue
@@ -1,228 +1,228 @@
-
-
-
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-rate/package.json b/uni_modules/uni-rate/package.json
index c98df3dfc77771aa4f744c3f0de791a4e017ecf8..1cb4669a93548e7bccbe99845b457703ba27c8fb 100644
--- a/uni_modules/uni-rate/package.json
+++ b/uni_modules/uni-rate/package.json
@@ -1,83 +1,83 @@
-{
- "id": "uni-rate",
- "displayName": "uni-rate 评分",
- "version": "1.2.1",
- "description": "Rate 评分组件,可自定义评分星星图标的大小、间隔、评分数。",
- "keywords": [
- "uni-ui",
- "uniui",
- "评分"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [
- "uni-icons"
- ],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
-}
+{
+ "id": "uni-rate",
+ "displayName": "uni-rate 评分",
+ "version": "1.2.1",
+ "description": "Rate 评分组件,可自定义评分星星图标的大小、间隔、评分数。",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "评分"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-icons"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
+}
diff --git a/uni_modules/uni-row/changelog.md b/uni_modules/uni-row/changelog.md
index 8a269ffb01d44512d9ff25fd2b3c3a07e1efe89d..2327912317fc340c8440647f4c9e03995c8023ec 100644
--- a/uni_modules/uni-row/changelog.md
+++ b/uni_modules/uni-row/changelog.md
@@ -1,7 +1,7 @@
## 0.1.0(2021-07-13)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 0.0.4(2021-05-12)
-- 新增 组件示例地址
-## 0.0.3(2021-02-05)
-- 调整为uni_modules目录规范
-- 新增uni-row组件
+## 0.0.4(2021-05-12)
+- 新增 组件示例地址
+## 0.0.3(2021-02-05)
+- 调整为uni_modules目录规范
+- 新增uni-row组件
diff --git a/uni_modules/uni-row/components/uni-col/uni-col.vue b/uni_modules/uni-row/components/uni-col/uni-col.vue
index 84e2deb4cff6badb4221eaadf23d482aca47ea8d..5b2ecd821b09de94d78eba4553c0690cffd6d6a2 100644
--- a/uni_modules/uni-row/components/uni-col/uni-col.vue
+++ b/uni_modules/uni-row/components/uni-col/uni-col.vue
@@ -1,317 +1,317 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-row/components/uni-row/uni-row.vue b/uni_modules/uni-row/components/uni-row/uni-row.vue
index f8e854239a53bc1bd917cde58aa6954a5908a686..3451cc905a7f28212af5551494f9165c0118c25b 100644
--- a/uni_modules/uni-row/components/uni-row/uni-row.vue
+++ b/uni_modules/uni-row/components/uni-row/uni-row.vue
@@ -1,190 +1,190 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-row/package.json b/uni_modules/uni-row/package.json
index 0251ea7491e54b61880c03a6c706a2c62754baf0..0f93391e962457b04006c0fa10051a9571f2135a 100644
--- a/uni_modules/uni-row/package.json
+++ b/uni_modules/uni-row/package.json
@@ -1,83 +1,83 @@
-{
- "id": "uni-row",
- "displayName": "uni-row 布局-行",
- "version": "0.1.0",
- "description": "流式栅格系统,随着屏幕或视口分为 24 份,可以迅速简便地创建布局。",
- "keywords": [
- "uni-ui",
- "uniui",
- "栅格",
- "布局",
- "layout"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-row",
+ "displayName": "uni-row 布局-行",
+ "version": "0.1.0",
+ "description": "流式栅格系统,随着屏幕或视口分为 24 份,可以迅速简便地创建布局。",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "栅格",
+ "布局",
+ "layout"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-search-bar/components/uni-search-bar/i18n/en.json b/uni_modules/uni-search-bar/components/uni-search-bar/i18n/en.json
index dd083a5357aa7576eedcf55fe1b6d0caedace0cd..0c72ffb3e02159893395c18151964a9b42b0706e 100644
--- a/uni_modules/uni-search-bar/components/uni-search-bar/i18n/en.json
+++ b/uni_modules/uni-search-bar/components/uni-search-bar/i18n/en.json
@@ -1,4 +1,4 @@
-{
- "uni-search-bar.cancel": "cancel",
+{
+ "uni-search-bar.cancel": "cancel",
"uni-search-bar.placeholder": "Search enter content"
}
\ No newline at end of file
diff --git a/uni_modules/uni-search-bar/components/uni-search-bar/i18n/index.js b/uni_modules/uni-search-bar/components/uni-search-bar/i18n/index.js
index de7509c87ba5197b9f5d20ca94a0558c7a8e08a9..fa8f0f3734de6effb137592fce6c0f722c048432 100644
--- a/uni_modules/uni-search-bar/components/uni-search-bar/i18n/index.js
+++ b/uni_modules/uni-search-bar/components/uni-search-bar/i18n/index.js
@@ -1,8 +1,8 @@
-import en from './en.json'
-import zhHans from './zh-Hans.json'
-import zhHant from './zh-Hant.json'
-export default {
- en,
- 'zh-Hans': zhHans,
- 'zh-Hant': zhHant
+import en from './en.json'
+import zhHans from './zh-Hans.json'
+import zhHant from './zh-Hant.json'
+export default {
+ en,
+ 'zh-Hans': zhHans,
+ 'zh-Hant': zhHant
}
diff --git a/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hans.json b/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hans.json
index d4e5c120cd8fd530407da308754b20285f95bef9..37f5d31fded79efa491fb860174c7bf21e3bc2ff 100644
--- a/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hans.json
+++ b/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hans.json
@@ -1,4 +1,4 @@
-{
- "uni-search-bar.cancel": "cancel",
+{
+ "uni-search-bar.cancel": "cancel",
"uni-search-bar.placeholder": "请输入搜索内容"
}
diff --git a/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hant.json b/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hant.json
index 318b6ef1b7ec16cb05d7609d093b65be2943ccec..0cfebf205bfb749ccc46a91caa27c195e56f04fe 100644
--- a/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hant.json
+++ b/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hant.json
@@ -1,4 +1,4 @@
-{
- "uni-search-bar.cancel": "cancel",
+{
+ "uni-search-bar.cancel": "cancel",
"uni-search-bar.placeholder": "請輸入搜索內容"
}
diff --git a/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.vue b/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.vue
index 3c67344f055c5b44748d568c79f8545de74dea42..f26be5075ea0698963f9b7d94209181ff5732764 100644
--- a/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.vue
+++ b/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.vue
@@ -1,282 +1,282 @@
-
-
-
-
-
-
-
-
-
- {{ placeholder }}
-
-
-
-
-
-
- {{cancelTextI18n}}
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ {{ placeholder }}
+
+
+
+
+
+
+ {{cancelTextI18n}}
+
+
+
+
+
+
diff --git a/uni_modules/uni-segmented-control/changelog.md b/uni_modules/uni-segmented-control/changelog.md
index e5093b3c3e82ce03e2580689791bbccf2912f1d9..b3eacdcac1b446e4b432e8ff04561433b7f96e1a 100644
--- a/uni_modules/uni-segmented-control/changelog.md
+++ b/uni_modules/uni-segmented-control/changelog.md
@@ -1,6 +1,6 @@
## 1.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.0.5(2021-05-12)
-- 新增 项目示例地址
-## 1.0.4(2021-02-05)
-- 调整为uni_modules目录规范
+## 1.0.5(2021-05-12)
+- 新增 项目示例地址
+## 1.0.4(2021-02-05)
+- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue b/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue
index b753366eb173e8b41351a9de2c34e04c1da10b10..e3f6e5ecc917e0de387ac95018fb74f52cdc5bd3 100644
--- a/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue
+++ b/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue
@@ -1,142 +1,142 @@
-
-
-
- {{ item }}
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-segmented-control/package.json b/uni_modules/uni-segmented-control/package.json
index b3ccdd2a61dea97cd449ee50266c83804ec33118..5680713184d68c4ae221984ec82e5037f0c651b7 100644
--- a/uni_modules/uni-segmented-control/package.json
+++ b/uni_modules/uni-segmented-control/package.json
@@ -1,83 +1,83 @@
-{
- "id": "uni-segmented-control",
- "displayName": "uni-segmented-control 分段器",
- "version": "1.1.0",
- "description": "分段器由至少 2 个分段控件组成,用作不同视图的显示",
- "keywords": [
- "uni-ui",
- "uniui",
- "分段器",
- "segement",
- "顶部选择"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-segmented-control",
+ "displayName": "uni-segmented-control 分段器",
+ "version": "1.1.0",
+ "description": "分段器由至少 2 个分段控件组成,用作不同视图的显示",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "分段器",
+ "segement",
+ "顶部选择"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-share/js_sdk/uni-image-menu.js b/uni_modules/uni-share/js_sdk/uni-image-menu.js
index a15a846ef986c4588a3ee1c8a9c9b544d33fefb2..9b4e07dc2f346de5e9714e2dcebfdbca112404e5 100644
--- a/uni_modules/uni-share/js_sdk/uni-image-menu.js
+++ b/uni_modules/uni-share/js_sdk/uni-image-menu.js
@@ -1,203 +1,203 @@
-var nvMask, nvImageMenu;
-class NvImageMenu {
- constructor(arg) {
- this.isShow = false
- }
- show({
- list,
- cancelText
- }, callback) {
- if (!list) {
- list = [{
- "img": "/static/sharemenu/wechatfriend.png",
- "text": "图标文字"
- }]
- }
- //以下为计算菜单的nview绘制布局,为固定算法,使用者无关关心
- var screenWidth = plus.screen.resolutionWidth
- //以360px宽度屏幕为例,上下左右边距及2排按钮边距留25像素,图标宽度55像素,同行图标间的间距在360宽的屏幕是30px,但需要动态计算,以此原则计算4列图标分别的left位置
- //图标下的按钮文字距离图标5像素,文字大小12像素
- //底部取消按钮高度固定为44px
- //TODO 未处理横屏和pad,这些情况6个图标应该一排即可
- var margin = 20,
- iconWidth = 60,
- icontextSpace = 5,
- textHeight = 12
- var left1 = margin / 360 * screenWidth
- var iconSpace = (screenWidth - (left1 * 2) - (iconWidth * 4)) / 3 //屏幕宽度减去左右留白间距,再减去4个图标的宽度,就是3个同行图标的间距
- if (iconSpace <= 5) { //屏幕过窄时,缩小边距和图标大小,再算一次
- margin = 15
- iconWidth = 40
- left1 = margin / 360 * screenWidth
- iconSpace = (screenWidth - (left1 * 2) - (iconWidth * 4)) / 3 //屏幕宽度减去左右留白间距,再减去4个图标的宽度,就是3个同行图标的间距
- }
- var left2 = left1 + iconWidth + iconSpace
- var left3 = left1 + (iconWidth + iconSpace) * 2
- var left4 = left1 + (iconWidth + iconSpace) * 3
- var top1 = left1
- var top2 = top1 + iconWidth + icontextSpace + textHeight + left1
-
- const TOP = {
- top1,
- top2
- },
- LEFT = {
- left1,
- left2,
- left3,
- left4
- };
-
- nvMask = new plus.nativeObj.View("nvMask", { //先创建遮罩层
- top: '0px',
- left: '0px',
- height: '100%',
- width: '100%',
- backgroundColor: 'rgba(0,0,0,0.2)'
- });
- nvImageMenu = new plus.nativeObj.View("nvImageMenu", { //创建底部图标菜单
- bottom: '0px',
- left: '0px',
- height: (iconWidth + textHeight + 2 * margin) * Math.ceil(list.length / 4) + 44 +
- 'px', //'264px',
- width: '100%',
- backgroundColor: 'rgb(255,255,255)'
- });
- nvMask.addEventListener("click", () => { //处理遮罩层点击
- // console.log('处理遮罩层点击');
- this.hide()
- callback({
- event: "clickMask"
- })
- })
- let myList = []
- list.forEach((item, i) => {
- myList.push({
- tag: 'img',
- src: item.img,
- position: {
- top: TOP['top' + (parseInt(i / 4) + 1)],
- left: LEFT['left' + (1 + i % 4)],
- width: iconWidth,
- height: iconWidth
- }
- })
- myList.push({
- tag: 'font',
- text: item.text,
- textStyles: {
- size: textHeight
- },
- position: {
- top: TOP['top' + (parseInt(i / 4) + 1)] + iconWidth + icontextSpace,
- left: LEFT['left' + (1 + i % 4)],
- width: iconWidth,
- height: textHeight
- }
- })
- })
-
- //绘制底部图标菜单的内容
- nvImageMenu.draw([{
- tag: 'rect', //菜单顶部的分割灰线
- color: '#e7e7e7',
- position: {
- top: '0px',
- height: '1px'
- }
- },
- {
- tag: 'font',
- text: cancelText, //底部取消按钮的文字
- textStyles: {
- size: '14px'
- },
- position: {
- bottom: '0px',
- height: '44px'
- }
- },
- {
- tag: 'rect', //底部取消按钮的顶部边线
- color: '#e7e7e7',
- position: {
- bottom: '45px',
- height: '1px'
- }
- },
- ...myList
- ])
+var nvMask, nvImageMenu;
+class NvImageMenu {
+ constructor(arg) {
+ this.isShow = false
+ }
+ show({
+ list,
+ cancelText
+ }, callback) {
+ if (!list) {
+ list = [{
+ "img": "/static/sharemenu/wechatfriend.png",
+ "text": "图标文字"
+ }]
+ }
+ //以下为计算菜单的nview绘制布局,为固定算法,使用者无关关心
+ var screenWidth = plus.screen.resolutionWidth
+ //以360px宽度屏幕为例,上下左右边距及2排按钮边距留25像素,图标宽度55像素,同行图标间的间距在360宽的屏幕是30px,但需要动态计算,以此原则计算4列图标分别的left位置
+ //图标下的按钮文字距离图标5像素,文字大小12像素
+ //底部取消按钮高度固定为44px
+ //TODO 未处理横屏和pad,这些情况6个图标应该一排即可
+ var margin = 20,
+ iconWidth = 60,
+ icontextSpace = 5,
+ textHeight = 12
+ var left1 = margin / 360 * screenWidth
+ var iconSpace = (screenWidth - (left1 * 2) - (iconWidth * 4)) / 3 //屏幕宽度减去左右留白间距,再减去4个图标的宽度,就是3个同行图标的间距
+ if (iconSpace <= 5) { //屏幕过窄时,缩小边距和图标大小,再算一次
+ margin = 15
+ iconWidth = 40
+ left1 = margin / 360 * screenWidth
+ iconSpace = (screenWidth - (left1 * 2) - (iconWidth * 4)) / 3 //屏幕宽度减去左右留白间距,再减去4个图标的宽度,就是3个同行图标的间距
+ }
+ var left2 = left1 + iconWidth + iconSpace
+ var left3 = left1 + (iconWidth + iconSpace) * 2
+ var left4 = left1 + (iconWidth + iconSpace) * 3
+ var top1 = left1
+ var top2 = top1 + iconWidth + icontextSpace + textHeight + left1
+
+ const TOP = {
+ top1,
+ top2
+ },
+ LEFT = {
+ left1,
+ left2,
+ left3,
+ left4
+ };
+
+ nvMask = new plus.nativeObj.View("nvMask", { //先创建遮罩层
+ top: '0px',
+ left: '0px',
+ height: '100%',
+ width: '100%',
+ backgroundColor: 'rgba(0,0,0,0.2)'
+ });
+ nvImageMenu = new plus.nativeObj.View("nvImageMenu", { //创建底部图标菜单
+ bottom: '0px',
+ left: '0px',
+ height: (iconWidth + textHeight + 2 * margin) * Math.ceil(list.length / 4) + 44 +
+ 'px', //'264px',
+ width: '100%',
+ backgroundColor: 'rgb(255,255,255)'
+ });
+ nvMask.addEventListener("click", () => { //处理遮罩层点击
+ // console.log('处理遮罩层点击');
+ this.hide()
+ callback({
+ event: "clickMask"
+ })
+ })
+ let myList = []
+ list.forEach((item, i) => {
+ myList.push({
+ tag: 'img',
+ src: item.img,
+ position: {
+ top: TOP['top' + (parseInt(i / 4) + 1)],
+ left: LEFT['left' + (1 + i % 4)],
+ width: iconWidth,
+ height: iconWidth
+ }
+ })
+ myList.push({
+ tag: 'font',
+ text: item.text,
+ textStyles: {
+ size: textHeight
+ },
+ position: {
+ top: TOP['top' + (parseInt(i / 4) + 1)] + iconWidth + icontextSpace,
+ left: LEFT['left' + (1 + i % 4)],
+ width: iconWidth,
+ height: textHeight
+ }
+ })
+ })
+
+ //绘制底部图标菜单的内容
+ nvImageMenu.draw([{
+ tag: 'rect', //菜单顶部的分割灰线
+ color: '#e7e7e7',
+ position: {
+ top: '0px',
+ height: '1px'
+ }
+ },
+ {
+ tag: 'font',
+ text: cancelText, //底部取消按钮的文字
+ textStyles: {
+ size: '14px'
+ },
+ position: {
+ bottom: '0px',
+ height: '44px'
+ }
+ },
+ {
+ tag: 'rect', //底部取消按钮的顶部边线
+ color: '#e7e7e7',
+ position: {
+ bottom: '45px',
+ height: '1px'
+ }
+ },
+ ...myList
+ ])
nvMask.show()
- nvImageMenu.show()
- // 开始动画
+ nvImageMenu.show()
+ // 开始动画
/*
- plus.nativeObj.View.startAnimation({
- type: 'slide-in-bottom',
- duration: 300
- }, nvImageMenu, {}, function() {
- console.log('plus.nativeObj.View.startAnimation动画结束');
- // 关闭原生动画
- plus.nativeObj.View.clearAnimation();
- nvImageMenu.show()
+ plus.nativeObj.View.startAnimation({
+ type: 'slide-in-bottom',
+ duration: 300
+ }, nvImageMenu, {}, function() {
+ console.log('plus.nativeObj.View.startAnimation动画结束');
+ // 关闭原生动画
+ plus.nativeObj.View.clearAnimation();
+ nvImageMenu.show()
});
- */
-
-
- this.isShow = true
- nvImageMenu.addEventListener("click", e => { //处理底部图标菜单的点击事件,根据点击位置触发不同的逻辑
- // console.log("click menu"+JSON.stringify(e));
- if (e.screenY > plus.screen.resolutionHeight - 44) { //点击了底部取消按钮
- // callback({event:"clickCancelButton"})
- this.hide()
- } else if (e.clientX < 5 || e.clientX > screenWidth - 5 || e.clientY < 5) {
- //屏幕左右边缘5像素及菜单顶部5像素不处理点击
- } else { //点击了图标按钮
- var iClickIndex = -1 //点击的图标按钮序号,第一个图标按钮的index为0
- var iRow = e.clientY < (top2 - (left1 / 2)) ? 0 : 1
- var iCol = -1
- if (e.clientX < (left2 - (iconSpace / 2))) {
- iCol = 0
- } else if (e.clientX < (left3 - (iconSpace / 2))) {
- iCol = 1
- } else if (e.clientX < (left4 - (iconSpace / 2))) {
- iCol = 2
- } else {
- iCol = 3
- }
- if (iRow == 0) {
- iClickIndex = iCol
- } else {
- iClickIndex = iCol + 4
- }
- // console.log("点击按钮的序号: " + iClickIndex);
- // if (iClickIndex >= 0 && iClickIndex <= 5) { //处理具体的点击逻辑,此处也可以自行定义逻辑。如果增减了按钮,此处也需要跟着修改
- // }
- callback({
- event: "clickMenu",
- index: iClickIndex
- })
- }
- })
- /* nvImageMenu.addEventListener("touchstart", function(e) {
- if (e.screenY > (plus.screen.resolutionHeight - 44)) {
- //TODO 这里可以处理按下背景变灰的效果
- }
- })
- nvImageMenu.addEventListener("touchmove", function(e) {
- //TODO 这里可以处理按下背景变灰的效果
- if (e.screenY > plus.screen.resolutionHeight - 44) {}
- })
- nvImageMenu.addEventListener("touchend", function(e) {
- //TODO 这里可以处理释放背景恢复的效果
- })
- */
- }
-
- hide() {
- nvMask.hide()
- nvImageMenu.hide()
- this.isShow = false
- }
-}
-
+ */
+
+
+ this.isShow = true
+ nvImageMenu.addEventListener("click", e => { //处理底部图标菜单的点击事件,根据点击位置触发不同的逻辑
+ // console.log("click menu"+JSON.stringify(e));
+ if (e.screenY > plus.screen.resolutionHeight - 44) { //点击了底部取消按钮
+ // callback({event:"clickCancelButton"})
+ this.hide()
+ } else if (e.clientX < 5 || e.clientX > screenWidth - 5 || e.clientY < 5) {
+ //屏幕左右边缘5像素及菜单顶部5像素不处理点击
+ } else { //点击了图标按钮
+ var iClickIndex = -1 //点击的图标按钮序号,第一个图标按钮的index为0
+ var iRow = e.clientY < (top2 - (left1 / 2)) ? 0 : 1
+ var iCol = -1
+ if (e.clientX < (left2 - (iconSpace / 2))) {
+ iCol = 0
+ } else if (e.clientX < (left3 - (iconSpace / 2))) {
+ iCol = 1
+ } else if (e.clientX < (left4 - (iconSpace / 2))) {
+ iCol = 2
+ } else {
+ iCol = 3
+ }
+ if (iRow == 0) {
+ iClickIndex = iCol
+ } else {
+ iClickIndex = iCol + 4
+ }
+ // console.log("点击按钮的序号: " + iClickIndex);
+ // if (iClickIndex >= 0 && iClickIndex <= 5) { //处理具体的点击逻辑,此处也可以自行定义逻辑。如果增减了按钮,此处也需要跟着修改
+ // }
+ callback({
+ event: "clickMenu",
+ index: iClickIndex
+ })
+ }
+ })
+ /* nvImageMenu.addEventListener("touchstart", function(e) {
+ if (e.screenY > (plus.screen.resolutionHeight - 44)) {
+ //TODO 这里可以处理按下背景变灰的效果
+ }
+ })
+ nvImageMenu.addEventListener("touchmove", function(e) {
+ //TODO 这里可以处理按下背景变灰的效果
+ if (e.screenY > plus.screen.resolutionHeight - 44) {}
+ })
+ nvImageMenu.addEventListener("touchend", function(e) {
+ //TODO 这里可以处理释放背景恢复的效果
+ })
+ */
+ }
+
+ hide() {
+ nvMask.hide()
+ nvImageMenu.hide()
+ this.isShow = false
+ }
+}
+
export default NvImageMenu
diff --git a/uni_modules/uni-sign-in/components/uni-sign-in/uni-sign-in.vue b/uni_modules/uni-sign-in/components/uni-sign-in/uni-sign-in.vue
index 99d55917276ed122224efef5fca125d8051a543b..0ff8dd1a81cb60502aceb8202695c69d81d3f439 100644
--- a/uni_modules/uni-sign-in/components/uni-sign-in/uni-sign-in.vue
+++ b/uni_modules/uni-sign-in/components/uni-sign-in/uni-sign-in.vue
@@ -1,70 +1,70 @@
-
-
-
-
-
-
-
- 今日签到成功
- 本轮已签到{{signInRes.days.length}}天
- 当前积分:{{signInRes.score}}
-
-
-
-
-
-
-
-
-
-
- 第{{item}}天
-
-
- 缺卡
-
-
-
- 签到一次得10积分
-
- 连续签到7天可多得
- 50
- 积分
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-sign-in/pages/demo/demo.vue b/uni_modules/uni-sign-in/pages/demo/demo.vue
index 4efee8ae08fefca35e071e8eb1eb09693359f3e3..a7536cd85738cdd5308db3a54ef1b496157952c1 100644
--- a/uni_modules/uni-sign-in/pages/demo/demo.vue
+++ b/uni_modules/uni-sign-in/pages/demo/demo.vue
@@ -4,8 +4,8 @@
-
-
+ margin-bottom: 8px;
+ }
+
+ .uni-steps__column-text-container {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: column;
+ flex: 1;
+ }
+
+ .uni-steps__row-text {
+ /* #ifndef APP-NVUE */
+ display: inline-flex;
+ /* #endif */
+ flex: 1;
+ flex-direction: column;
+ }
+
+ .uni-steps__column-text {
+ padding: 6px 0px;
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+ border-bottom-color: $uni-border-color;
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: column;
+ }
+
+ .uni-steps__row-title {
+ font-size: $uni-font-size-base;
+ line-height: 16px;
+ text-align: center;
+ }
+
+ .uni-steps__column-title {
+ font-size: $uni-font-size-base;
+ text-align: left;
+ line-height: 18px;
+ }
+
+ .uni-steps__row-desc {
+ font-size: 12px;
+ line-height: 14px;
+ text-align: center;
+ }
+
+ .uni-steps__column-desc {
+ font-size: $uni-font-size-sm;
+ text-align: left;
+ line-height: 18px;
+ }
+
+ .uni-steps__row-container {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: row;
+ }
+
+ .uni-steps__column-container {
+ /* #ifndef APP-NVUE */
+ display: inline-flex;
+ /* #endif */
+ width: 30px;
+ flex-direction: column;
+ }
+
+ .uni-steps__row-line-item {
+ /* #ifndef APP-NVUE */
+ display: inline-flex;
+ /* #endif */
+ flex-direction: row;
+ flex: 1;
+ height: 14px;
+ line-height: 14px;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .uni-steps__column-line-item {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: column;
+ flex: 1;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .uni-steps__row-line {
+ flex: 1;
+ height: 1px;
+ background-color: $uni-text-color-grey;
+ }
+
+ .uni-steps__column-line {
+ width: 1px;
+ background-color: $uni-text-color-grey;
+ }
+
+ .uni-steps__row-line--after {
+ transform: translateX(1px);
+ }
+
+ .uni-steps__column-line--after {
+ flex: 1;
+ transform: translate(0px, 1px);
+ }
+
+ .uni-steps__row-line--before {
+ transform: translateX(-1px);
+ }
+
+ .uni-steps__column-line--before {
+ height: 6px;
+ transform: translate(0px, -1px);
+ }
+
+ .uni-steps__row-circle {
+ width: 5px;
+ height: 5px;
+ border-radius: 100px;
+ background-color: $uni-text-color-grey;
+ margin: 0px 3px;
+ }
+
+ .uni-steps__column-circle {
+ width: 5px;
+ height: 5px;
+ border-radius: 100px;
+ background-color: $uni-text-color-grey;
+ margin: 4px 0px 5px 0px;
+ }
+
+ .uni-steps__row-check {
+ margin: 0px 6px;
+ }
+
+ .uni-steps__column-check {
+ height: 14px;
+ line-height: 14px;
+ margin: 2px 0px;
+ }
+
diff --git a/uni_modules/uni-steps/package.json b/uni_modules/uni-steps/package.json
index 70108b5d8e629df8d4c076296997cbf7e9a9b8ad..a9714fec20ae7a050f9cabeb2f685b9ff1772b31 100644
--- a/uni_modules/uni-steps/package.json
+++ b/uni_modules/uni-steps/package.json
@@ -1,84 +1,84 @@
-{
- "id": "uni-steps",
- "displayName": "uni-steps 步骤条",
- "version": "1.0.8",
- "description": "步骤条组件,提供横向和纵向两种布局格式。",
- "keywords": [
- "uni-ui",
- "uniui",
- "步骤条",
- "时间轴"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [
- "uni-icons"
- ],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-steps",
+ "displayName": "uni-steps 步骤条",
+ "version": "1.0.8",
+ "description": "步骤条组件,提供横向和纵向两种布局格式。",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "步骤条",
+ "时间轴"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-icons"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-swipe-action/changelog.md b/uni_modules/uni-swipe-action/changelog.md
index e61f047735faf16c9bfc95e439a55704aa0e842d..b3bc0bec6a91f37c96980d044b73ff2f4f9771b3 100644
--- a/uni_modules/uni-swipe-action/changelog.md
+++ b/uni_modules/uni-swipe-action/changelog.md
@@ -2,23 +2,23 @@
- 优化 close-all 方法
## 1.2.3(2021-08-20)
- 新增 close-all 方法,关闭所有已打开的组件
-## 1.2.2(2021-08-17)
-- 新增 resize() 方法,在非微信小程序、h5、app-vue端出现不能滑动的问题的时候,重置组件
-- 修复 app 端偶尔出现类似 Page[x][-x,xx;-x,xx,x,x-x] 的问题
-- 优化 微信小程序、h5、app-vue 滑动逻辑,避免出现动态新增组件后不能滑动的问题
-## 1.2.1(2021-07-30)
-- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-- 修复 跨页面修改组件数据 ,导致不能滑动的问题
-## 1.1.10(2021-06-17)
-- 修复 按钮点击执行两次的bug
-## 1.1.9(2021-05-12)
-- 新增 项目示例地址
-## 1.1.8(2021-03-26)
-- 修复 微信小程序 nv_navigator is not defined 报错的bug
-## 1.1.7(2021-02-05)
-- 调整为uni_modules目录规范
-- 新增 左侧滑动
-- 新增 插槽使用方式
-- 新增 threshold 属性,可以控制滑动缺省值
-- 优化 长列表滚动性能
-- 修复 滚动页面时触发组件滑动的Bug
+## 1.2.2(2021-08-17)
+- 新增 resize() 方法,在非微信小程序、h5、app-vue端出现不能滑动的问题的时候,重置组件
+- 修复 app 端偶尔出现类似 Page[x][-x,xx;-x,xx,x,x-x] 的问题
+- 优化 微信小程序、h5、app-vue 滑动逻辑,避免出现动态新增组件后不能滑动的问题
+## 1.2.1(2021-07-30)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+- 修复 跨页面修改组件数据 ,导致不能滑动的问题
+## 1.1.10(2021-06-17)
+- 修复 按钮点击执行两次的bug
+## 1.1.9(2021-05-12)
+- 新增 项目示例地址
+## 1.1.8(2021-03-26)
+- 修复 微信小程序 nv_navigator is not defined 报错的bug
+## 1.1.7(2021-02-05)
+- 调整为uni_modules目录规范
+- 新增 左侧滑动
+- 新增 插槽使用方式
+- 新增 threshold 属性,可以控制滑动缺省值
+- 优化 长列表滚动性能
+- 修复 滚动页面时触发组件滑动的Bug
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/bindingx.js b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/bindingx.js
index 7e328500a0bfa574cabadf0254e906d452a83d63..7fcf9ea3891558a893c951d08f69efcd93a02344 100644
--- a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/bindingx.js
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/bindingx.js
@@ -1,300 +1,300 @@
-// #ifdef APP-NVUE
-const BindingX = uni.requireNativePlugin('bindingx');
-const dom = uni.requireNativePlugin('dom');
-const animation = uni.requireNativePlugin('animation');
-
-export default {
- data() {
- return {}
- },
-
- watch: {
- show(newVal) {
- if (this.autoClose) return
+// #ifdef APP-NVUE
+const BindingX = uni.requireNativePlugin('bindingx');
+const dom = uni.requireNativePlugin('dom');
+const animation = uni.requireNativePlugin('animation');
+
+export default {
+ data() {
+ return {}
+ },
+
+ watch: {
+ show(newVal) {
+ if (this.autoClose) return
if (this.stop) return
- this.stop = true
- if (newVal) {
- this.open(newVal)
- } else {
- this.close()
- }
- },
- leftOptions() {
- this.getSelectorQuery()
- this.init()
- },
- rightOptions(newVal) {
- this.init()
- }
- },
- created() {
- this.swipeaction = this.getSwipeAction()
- if (this.swipeaction.children !== undefined) {
- this.swipeaction.children.push(this)
- }
- },
- mounted() {
- this.box = this.getEl(this.$refs['selector-box--hock'])
- this.selector = this.getEl(this.$refs['selector-content--hock']);
- this.leftButton = this.getEl(this.$refs['selector-left-button--hock']);
- this.rightButton = this.getEl(this.$refs['selector-right-button--hock']);
- this.init()
- },
- // beforeDestroy() {
- // this.swipeaction.children.forEach((item, index) => {
- // if (item === this) {
- // this.swipeaction.children.splice(index, 1)
- // }
- // })
- // },
- methods: {
- init() {
- this.$nextTick(() => {
- this.x = 0
- this.button = {
- show: false
- }
- setTimeout(() => {
- this.getSelectorQuery()
- }, 200)
- })
- },
- onClick(index, item, position) {
- this.$emit('click', {
- content: item,
- index,
- position
- })
- },
- touchstart(e) {
- // 每次只触发一次,避免多次监听造成闪烁
- if (this.stop) return
- this.stop = true
+ this.stop = true
+ if (newVal) {
+ this.open(newVal)
+ } else {
+ this.close()
+ }
+ },
+ leftOptions() {
+ this.getSelectorQuery()
+ this.init()
+ },
+ rightOptions(newVal) {
+ this.init()
+ }
+ },
+ created() {
+ this.swipeaction = this.getSwipeAction()
+ if (this.swipeaction.children !== undefined) {
+ this.swipeaction.children.push(this)
+ }
+ },
+ mounted() {
+ this.box = this.getEl(this.$refs['selector-box--hock'])
+ this.selector = this.getEl(this.$refs['selector-content--hock']);
+ this.leftButton = this.getEl(this.$refs['selector-left-button--hock']);
+ this.rightButton = this.getEl(this.$refs['selector-right-button--hock']);
+ this.init()
+ },
+ // beforeDestroy() {
+ // this.swipeaction.children.forEach((item, index) => {
+ // if (item === this) {
+ // this.swipeaction.children.splice(index, 1)
+ // }
+ // })
+ // },
+ methods: {
+ init() {
+ this.$nextTick(() => {
+ this.x = 0
+ this.button = {
+ show: false
+ }
+ setTimeout(() => {
+ this.getSelectorQuery()
+ }, 200)
+ })
+ },
+ onClick(index, item, position) {
+ this.$emit('click', {
+ content: item,
+ index,
+ position
+ })
+ },
+ touchstart(e) {
+ // 每次只触发一次,避免多次监听造成闪烁
+ if (this.stop) return
+ this.stop = true
if (this.autoClose) {
this.swipeaction.closeOther(this)
}
-
- const leftWidth = this.button.left.width
- const rightWidth = this.button.right.width
- let expression = this.range(this.x, -rightWidth, leftWidth)
- let leftExpression = this.range(this.x - leftWidth, -leftWidth, 0)
- let rightExpression = this.range(this.x + rightWidth, 0, rightWidth)
-
- this.eventpan = BindingX.bind({
- anchor: this.box,
- eventType: 'pan',
- props: [{
- element: this.selector,
- property: 'transform.translateX',
- expression
- }, {
- element: this.leftButton,
- property: 'transform.translateX',
- expression: leftExpression
- }, {
- element: this.rightButton,
- property: 'transform.translateX',
- expression: rightExpression
- }, ]
- }, (e) => {
- // nope
- if (e.state === 'end') {
- this.x = e.deltaX + this.x;
- this.isclick = true
- this.bindTiming(e.deltaX)
- }
- });
- },
- touchend(e) {
- if (this.isopen !== 'none' && !this.isclick) {
- this.open('none')
- }
- },
- bindTiming(x) {
- const left = this.x
- const leftWidth = this.button.left.width
- const rightWidth = this.button.right.width
- const threshold = this.threshold
- if (!this.isopen || this.isopen === 'none') {
- if (left > threshold) {
- this.open('left')
- } else if (left < -threshold) {
- this.open('right')
- } else {
- this.open('none')
- }
- } else {
- if ((x > -leftWidth && x < 0) || x > rightWidth) {
- if ((x > -threshold && x < 0) || (x - rightWidth > threshold)) {
- this.open('left')
- } else {
- this.open('none')
- }
- } else {
- if ((x < threshold && x > 0) || (x + leftWidth < -threshold)) {
- this.open('right')
- } else {
- this.open('none')
- }
- }
- }
- },
-
- /**
- * 移动范围
- * @param {Object} num
- * @param {Object} mix
- * @param {Object} max
- */
- range(num, mix, max) {
- return `min(max(x+${num}, ${mix}), ${max})`
- },
-
- /**
- * 开启swipe
- */
- open(type) {
- this.animation(type)
- },
-
- /**
- * 关闭swipe
- */
- close() {
- this.animation('none')
- },
-
- /**
- * 开启关闭动画
- * @param {Object} type
- */
- animation(type) {
- const time = 300
- const leftWidth = this.button.left.width
- const rightWidth = this.button.right.width
- if (this.eventpan && this.eventpan.token) {
- BindingX.unbind({
- token: this.eventpan.token,
- eventType: 'pan'
- })
- }
-
- switch (type) {
- case 'left':
- Promise.all([
- this.move(this.selector, leftWidth),
- this.move(this.leftButton, 0),
- this.move(this.rightButton, rightWidth * 2)
- ]).then(() => {
- this.setEmit(leftWidth, type)
- })
- break
- case 'right':
- Promise.all([
- this.move(this.selector, -rightWidth),
- this.move(this.leftButton, -leftWidth * 2),
- this.move(this.rightButton, 0)
- ]).then(() => {
- this.setEmit(-rightWidth, type)
- })
- break
- default:
- Promise.all([
- this.move(this.selector, 0),
- this.move(this.leftButton, -leftWidth),
- this.move(this.rightButton, rightWidth)
- ]).then(() => {
- this.setEmit(0, type)
- })
-
- }
- },
- setEmit(x, type) {
- const leftWidth = this.button.left.width
- const rightWidth = this.button.right.width
- this.isopen = this.isopen || 'none'
- this.stop = false
- this.isclick = false
- // 只有状态不一致才会返回结果
- if (this.isopen !== type && this.x !== x) {
- if (type === 'left' && leftWidth > 0) {
- this.$emit('change', 'left')
- }
- if (type === 'right' && rightWidth > 0) {
- this.$emit('change', 'right')
- }
- if (type === 'none') {
- this.$emit('change', 'none')
- }
- }
- this.x = x
- this.isopen = type
- },
- move(ref, value) {
- return new Promise((resolve, reject) => {
- animation.transition(ref, {
- styles: {
- transform: `translateX(${value})`,
- },
- duration: 150, //ms
- timingFunction: 'linear',
- needLayout: false,
- delay: 0 //ms
- }, function(res) {
- resolve(res)
- })
- })
-
- },
-
- /**
- * 获取ref
- * @param {Object} el
- */
- getEl(el) {
- return el.ref
- },
- /**
- * 获取节点信息
- */
- getSelectorQuery() {
- Promise.all([
- this.getDom('left'),
- this.getDom('right'),
- ]).then((data) => {
- let show = 'none'
- if (this.autoClose) {
- show = 'none'
- } else {
- show = this.show
- }
-
- if (show === 'none') {
- // this.close()
- } else {
- this.open(show)
- }
-
- })
-
- },
- getDom(str) {
- return new Promise((resolve, reject) => {
- dom.getComponentRect(this.$refs[`selector-${str}-button--hock`], (data) => {
- if (data) {
- this.button[str] = data.size
- resolve(data)
- } else {
- reject()
- }
- })
- })
- }
- }
+
+ const leftWidth = this.button.left.width
+ const rightWidth = this.button.right.width
+ let expression = this.range(this.x, -rightWidth, leftWidth)
+ let leftExpression = this.range(this.x - leftWidth, -leftWidth, 0)
+ let rightExpression = this.range(this.x + rightWidth, 0, rightWidth)
+
+ this.eventpan = BindingX.bind({
+ anchor: this.box,
+ eventType: 'pan',
+ props: [{
+ element: this.selector,
+ property: 'transform.translateX',
+ expression
+ }, {
+ element: this.leftButton,
+ property: 'transform.translateX',
+ expression: leftExpression
+ }, {
+ element: this.rightButton,
+ property: 'transform.translateX',
+ expression: rightExpression
+ }, ]
+ }, (e) => {
+ // nope
+ if (e.state === 'end') {
+ this.x = e.deltaX + this.x;
+ this.isclick = true
+ this.bindTiming(e.deltaX)
+ }
+ });
+ },
+ touchend(e) {
+ if (this.isopen !== 'none' && !this.isclick) {
+ this.open('none')
+ }
+ },
+ bindTiming(x) {
+ const left = this.x
+ const leftWidth = this.button.left.width
+ const rightWidth = this.button.right.width
+ const threshold = this.threshold
+ if (!this.isopen || this.isopen === 'none') {
+ if (left > threshold) {
+ this.open('left')
+ } else if (left < -threshold) {
+ this.open('right')
+ } else {
+ this.open('none')
+ }
+ } else {
+ if ((x > -leftWidth && x < 0) || x > rightWidth) {
+ if ((x > -threshold && x < 0) || (x - rightWidth > threshold)) {
+ this.open('left')
+ } else {
+ this.open('none')
+ }
+ } else {
+ if ((x < threshold && x > 0) || (x + leftWidth < -threshold)) {
+ this.open('right')
+ } else {
+ this.open('none')
+ }
+ }
+ }
+ },
+
+ /**
+ * 移动范围
+ * @param {Object} num
+ * @param {Object} mix
+ * @param {Object} max
+ */
+ range(num, mix, max) {
+ return `min(max(x+${num}, ${mix}), ${max})`
+ },
+
+ /**
+ * 开启swipe
+ */
+ open(type) {
+ this.animation(type)
+ },
+
+ /**
+ * 关闭swipe
+ */
+ close() {
+ this.animation('none')
+ },
+
+ /**
+ * 开启关闭动画
+ * @param {Object} type
+ */
+ animation(type) {
+ const time = 300
+ const leftWidth = this.button.left.width
+ const rightWidth = this.button.right.width
+ if (this.eventpan && this.eventpan.token) {
+ BindingX.unbind({
+ token: this.eventpan.token,
+ eventType: 'pan'
+ })
+ }
+
+ switch (type) {
+ case 'left':
+ Promise.all([
+ this.move(this.selector, leftWidth),
+ this.move(this.leftButton, 0),
+ this.move(this.rightButton, rightWidth * 2)
+ ]).then(() => {
+ this.setEmit(leftWidth, type)
+ })
+ break
+ case 'right':
+ Promise.all([
+ this.move(this.selector, -rightWidth),
+ this.move(this.leftButton, -leftWidth * 2),
+ this.move(this.rightButton, 0)
+ ]).then(() => {
+ this.setEmit(-rightWidth, type)
+ })
+ break
+ default:
+ Promise.all([
+ this.move(this.selector, 0),
+ this.move(this.leftButton, -leftWidth),
+ this.move(this.rightButton, rightWidth)
+ ]).then(() => {
+ this.setEmit(0, type)
+ })
+
+ }
+ },
+ setEmit(x, type) {
+ const leftWidth = this.button.left.width
+ const rightWidth = this.button.right.width
+ this.isopen = this.isopen || 'none'
+ this.stop = false
+ this.isclick = false
+ // 只有状态不一致才会返回结果
+ if (this.isopen !== type && this.x !== x) {
+ if (type === 'left' && leftWidth > 0) {
+ this.$emit('change', 'left')
+ }
+ if (type === 'right' && rightWidth > 0) {
+ this.$emit('change', 'right')
+ }
+ if (type === 'none') {
+ this.$emit('change', 'none')
+ }
+ }
+ this.x = x
+ this.isopen = type
+ },
+ move(ref, value) {
+ return new Promise((resolve, reject) => {
+ animation.transition(ref, {
+ styles: {
+ transform: `translateX(${value})`,
+ },
+ duration: 150, //ms
+ timingFunction: 'linear',
+ needLayout: false,
+ delay: 0 //ms
+ }, function(res) {
+ resolve(res)
+ })
+ })
+
+ },
+
+ /**
+ * 获取ref
+ * @param {Object} el
+ */
+ getEl(el) {
+ return el.ref
+ },
+ /**
+ * 获取节点信息
+ */
+ getSelectorQuery() {
+ Promise.all([
+ this.getDom('left'),
+ this.getDom('right'),
+ ]).then((data) => {
+ let show = 'none'
+ if (this.autoClose) {
+ show = 'none'
+ } else {
+ show = this.show
+ }
+
+ if (show === 'none') {
+ // this.close()
+ } else {
+ this.open(show)
+ }
+
+ })
+
+ },
+ getDom(str) {
+ return new Promise((resolve, reject) => {
+ dom.getComponentRect(this.$refs[`selector-${str}-button--hock`], (data) => {
+ if (data) {
+ this.button[str] = data.size
+ resolve(data)
+ } else {
+ reject()
+ }
+ })
+ })
+ }
+ }
}
-
-// #endif
-
-// #ifndef APP-NVUE
-export default {}
+
+// #endif
+
+// #ifndef APP-NVUE
+export default {}
// #endif
\ No newline at end of file
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/index.wxs b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/index.wxs
index 10ddb568ff1d268f0bb81731651545c0c4b1d1ad..886bc75241ccf3184845f8f06a113176176ab0a5 100644
--- a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/index.wxs
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/index.wxs
@@ -1,323 +1,323 @@
-var MIN_DISTANCE = 10;
-
-/**
- * 判断当前是否为H5、app-vue
- */
-var IS_HTML5 = false
-if (typeof window === 'object') IS_HTML5 = true
-
-/**
- * 监听页面内值的变化,主要用于动态开关swipe-action
- * @param {Object} newValue
- * @param {Object} oldValue
- * @param {Object} ownerInstance
- * @param {Object} instance
- */
-function sizeReady(newValue, oldValue, ownerInstance, instance) {
- var state = instance.getState()
- var buttonPositions = JSON.parse(newValue)
- if (!buttonPositions || !buttonPositions.data || buttonPositions.data.length === 0) return
- state.leftWidth = buttonPositions.data[0].width
- state.rightWidth = buttonPositions.data[1].width
- state.threshold = instance.getDataset().threshold
-
- if (buttonPositions.show && buttonPositions.show !== 'none') {
- openState(buttonPositions.show, instance, ownerInstance)
- return
- }
-
- if (state.left) {
- openState('none', instance, ownerInstance)
- }
- resetTouchStatus(instance)
-}
-
-/**
- * 开始触摸操作
- * @param {Object} e
- * @param {Object} ins
- */
-function touchstart(e, ins) {
- var instance = e.instance;
- var disabled = instance.getDataset().disabled
- var state = instance.getState();
- // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
- disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
- if (disabled) return
- // 开始触摸时移除动画类
- instance.requestAnimationFrame(function() {
- instance.removeClass('ani');
- ins.callMethod('closeSwipe');
- })
-
- // 记录上次的位置
- state.x = state.left || 0
- // 计算滑动开始位置
- stopTouchStart(e, ins)
-}
-
-/**
- * 开始滑动操作
- * @param {Object} e
- * @param {Object} ownerInstance
- */
-function touchmove(e, ownerInstance) {
- var instance = e.instance;
- var disabled = instance.getDataset().disabled
- var state = instance.getState()
- // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
- disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
- if (disabled) return
- // 是否可以滑动页面
- stopTouchMove(e);
- if (state.direction !== 'horizontal') {
- return;
- }
-
- if (e.preventDefault) {
- // 阻止页面滚动
- e.preventDefault()
- }
-
- move(state.x + state.deltaX, instance, ownerInstance)
-}
-
-/**
- * 结束触摸操作
- * @param {Object} e
- * @param {Object} ownerInstance
- */
-function touchend(e, ownerInstance) {
- var instance = e.instance;
- var disabled = instance.getDataset().disabled
- var state = instance.getState()
- // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
- disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
-
- if (disabled) return
- // 滑动过程中触摸结束,通过阙值判断是开启还是关闭
- // fixed by mehaotian 定时器解决点击按钮,touchend 触发比 click 事件时机早的问题 ,主要是 ios13
- moveDirection(state.left, instance, ownerInstance)
-
-}
-
-/**
- * 设置移动距离
- * @param {Object} value
- * @param {Object} instance
- * @param {Object} ownerInstance
- */
-function move(value, instance, ownerInstance) {
- value = value || 0
- var state = instance.getState()
- var leftWidth = state.leftWidth
- var rightWidth = state.rightWidth
- // 获取可滑动范围
- state.left = range(value, -rightWidth, leftWidth);
- instance.requestAnimationFrame(function() {
- instance.setStyle({
- transform: 'translateX(' + state.left + 'px)',
- '-webkit-transform': 'translateX(' + state.left + 'px)'
- })
- })
-
-}
-
-/**
- * 获取范围
- * @param {Object} num
- * @param {Object} min
- * @param {Object} max
- */
-function range(num, min, max) {
- return Math.min(Math.max(num, min), max);
-}
-
-
-/**
- * 移动方向判断
- * @param {Object} left
- * @param {Object} value
- * @param {Object} ownerInstance
- * @param {Object} ins
- */
-function moveDirection(left, ins, ownerInstance) {
- var state = ins.getState()
- var threshold = state.threshold
- var position = state.position
- var isopen = state.isopen || 'none'
- var leftWidth = state.leftWidth
- var rightWidth = state.rightWidth
- if (state.deltaX === 0) {
- openState('none', ins, ownerInstance)
- return
- }
- if ((isopen === 'none' && rightWidth > 0 && -left > threshold) || (isopen !== 'none' && rightWidth > 0 &&
- rightWidth +
- left < threshold)) {
- // right
- openState('right', ins, ownerInstance)
- } else if ((isopen === 'none' && leftWidth > 0 && left > threshold) || (isopen !== 'none' && leftWidth > 0 &&
- leftWidth - left < threshold)) {
- // left
- openState('left', ins, ownerInstance)
- } else {
- // default
- openState('none', ins, ownerInstance)
- }
-}
-
-
-/**
- * 开启状态
- * @param {Boolean} type
- * @param {Object} ins
- * @param {Object} ownerInstance
- */
-function openState(type, ins, ownerInstance) {
- var state = ins.getState()
- var position = state.position
- var leftWidth = state.leftWidth
- var rightWidth = state.rightWidth
- var left = ''
- state.isopen = state.isopen ? state.isopen : 'none'
- switch (type) {
- case "left":
- left = leftWidth
- break
- case "right":
- left = -rightWidth
- break
- default:
- left = 0
- }
-
- // && !state.throttle
-
- if (state.isopen !== type) {
- state.throttle = true
- ownerInstance.callMethod('change', {
- open: type
- })
-
- }
-
- state.isopen = type
- // 添加动画类
- ins.requestAnimationFrame(function() {
- ins.addClass('ani');
- move(left, ins, ownerInstance)
- })
- // 设置最终移动位置,理论上只要进入到这个函数,肯定是要打开的
-}
-
-
-function getDirection(x, y) {
- if (x > y && x > MIN_DISTANCE) {
- return 'horizontal';
- }
- if (y > x && y > MIN_DISTANCE) {
- return 'vertical';
- }
- return '';
-}
-
-/**
- * 重置滑动状态
- * @param {Object} event
- */
-function resetTouchStatus(instance) {
- var state = instance.getState();
- state.direction = '';
- state.deltaX = 0;
- state.deltaY = 0;
- state.offsetX = 0;
- state.offsetY = 0;
-}
-
-/**
- * 设置滑动开始位置
- * @param {Object} event
- */
-function stopTouchStart(event) {
- var instance = event.instance;
- var state = instance.getState();
- resetTouchStatus(instance);
- var touch = event.touches[0];
- if (IS_HTML5 && isPC()) {
- touch = event;
- }
- state.startX = touch.clientX;
- state.startY = touch.clientY;
-}
-
-/**
- * 滑动中,是否禁止打开
- * @param {Object} event
- */
-function stopTouchMove(event) {
- var instance = event.instance;
- var state = instance.getState();
- var touch = event.touches[0];
- if (IS_HTML5 && isPC()) {
- touch = event;
- }
- state.deltaX = touch.clientX - state.startX;
- state.deltaY = touch.clientY - state.startY;
- state.offsetY = Math.abs(state.deltaY);
- state.offsetX = Math.abs(state.deltaX);
- state.direction = state.direction || getDirection(state.offsetX, state.offsetY);
-}
-
-function isPC() {
- var userAgentInfo = navigator.userAgent;
- var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
- var flag = true;
- for (var v = 0; v < Agents.length - 1; v++) {
- if (userAgentInfo.indexOf(Agents[v]) > 0) {
- flag = false;
- break;
- }
- }
- return flag;
-}
-
-var movable = false
-
+var MIN_DISTANCE = 10;
+
+/**
+ * 判断当前是否为H5、app-vue
+ */
+var IS_HTML5 = false
+if (typeof window === 'object') IS_HTML5 = true
+
+/**
+ * 监听页面内值的变化,主要用于动态开关swipe-action
+ * @param {Object} newValue
+ * @param {Object} oldValue
+ * @param {Object} ownerInstance
+ * @param {Object} instance
+ */
+function sizeReady(newValue, oldValue, ownerInstance, instance) {
+ var state = instance.getState()
+ var buttonPositions = JSON.parse(newValue)
+ if (!buttonPositions || !buttonPositions.data || buttonPositions.data.length === 0) return
+ state.leftWidth = buttonPositions.data[0].width
+ state.rightWidth = buttonPositions.data[1].width
+ state.threshold = instance.getDataset().threshold
+
+ if (buttonPositions.show && buttonPositions.show !== 'none') {
+ openState(buttonPositions.show, instance, ownerInstance)
+ return
+ }
+
+ if (state.left) {
+ openState('none', instance, ownerInstance)
+ }
+ resetTouchStatus(instance)
+}
+
+/**
+ * 开始触摸操作
+ * @param {Object} e
+ * @param {Object} ins
+ */
+function touchstart(e, ins) {
+ var instance = e.instance;
+ var disabled = instance.getDataset().disabled
+ var state = instance.getState();
+ // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
+ disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
+ if (disabled) return
+ // 开始触摸时移除动画类
+ instance.requestAnimationFrame(function() {
+ instance.removeClass('ani');
+ ins.callMethod('closeSwipe');
+ })
+
+ // 记录上次的位置
+ state.x = state.left || 0
+ // 计算滑动开始位置
+ stopTouchStart(e, ins)
+}
+
+/**
+ * 开始滑动操作
+ * @param {Object} e
+ * @param {Object} ownerInstance
+ */
+function touchmove(e, ownerInstance) {
+ var instance = e.instance;
+ var disabled = instance.getDataset().disabled
+ var state = instance.getState()
+ // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
+ disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
+ if (disabled) return
+ // 是否可以滑动页面
+ stopTouchMove(e);
+ if (state.direction !== 'horizontal') {
+ return;
+ }
+
+ if (e.preventDefault) {
+ // 阻止页面滚动
+ e.preventDefault()
+ }
+
+ move(state.x + state.deltaX, instance, ownerInstance)
+}
+
+/**
+ * 结束触摸操作
+ * @param {Object} e
+ * @param {Object} ownerInstance
+ */
+function touchend(e, ownerInstance) {
+ var instance = e.instance;
+ var disabled = instance.getDataset().disabled
+ var state = instance.getState()
+ // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
+ disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
+
+ if (disabled) return
+ // 滑动过程中触摸结束,通过阙值判断是开启还是关闭
+ // fixed by mehaotian 定时器解决点击按钮,touchend 触发比 click 事件时机早的问题 ,主要是 ios13
+ moveDirection(state.left, instance, ownerInstance)
+
+}
+
+/**
+ * 设置移动距离
+ * @param {Object} value
+ * @param {Object} instance
+ * @param {Object} ownerInstance
+ */
+function move(value, instance, ownerInstance) {
+ value = value || 0
+ var state = instance.getState()
+ var leftWidth = state.leftWidth
+ var rightWidth = state.rightWidth
+ // 获取可滑动范围
+ state.left = range(value, -rightWidth, leftWidth);
+ instance.requestAnimationFrame(function() {
+ instance.setStyle({
+ transform: 'translateX(' + state.left + 'px)',
+ '-webkit-transform': 'translateX(' + state.left + 'px)'
+ })
+ })
+
+}
+
+/**
+ * 获取范围
+ * @param {Object} num
+ * @param {Object} min
+ * @param {Object} max
+ */
+function range(num, min, max) {
+ return Math.min(Math.max(num, min), max);
+}
+
+
+/**
+ * 移动方向判断
+ * @param {Object} left
+ * @param {Object} value
+ * @param {Object} ownerInstance
+ * @param {Object} ins
+ */
+function moveDirection(left, ins, ownerInstance) {
+ var state = ins.getState()
+ var threshold = state.threshold
+ var position = state.position
+ var isopen = state.isopen || 'none'
+ var leftWidth = state.leftWidth
+ var rightWidth = state.rightWidth
+ if (state.deltaX === 0) {
+ openState('none', ins, ownerInstance)
+ return
+ }
+ if ((isopen === 'none' && rightWidth > 0 && -left > threshold) || (isopen !== 'none' && rightWidth > 0 &&
+ rightWidth +
+ left < threshold)) {
+ // right
+ openState('right', ins, ownerInstance)
+ } else if ((isopen === 'none' && leftWidth > 0 && left > threshold) || (isopen !== 'none' && leftWidth > 0 &&
+ leftWidth - left < threshold)) {
+ // left
+ openState('left', ins, ownerInstance)
+ } else {
+ // default
+ openState('none', ins, ownerInstance)
+ }
+}
+
+
+/**
+ * 开启状态
+ * @param {Boolean} type
+ * @param {Object} ins
+ * @param {Object} ownerInstance
+ */
+function openState(type, ins, ownerInstance) {
+ var state = ins.getState()
+ var position = state.position
+ var leftWidth = state.leftWidth
+ var rightWidth = state.rightWidth
+ var left = ''
+ state.isopen = state.isopen ? state.isopen : 'none'
+ switch (type) {
+ case "left":
+ left = leftWidth
+ break
+ case "right":
+ left = -rightWidth
+ break
+ default:
+ left = 0
+ }
+
+ // && !state.throttle
+
+ if (state.isopen !== type) {
+ state.throttle = true
+ ownerInstance.callMethod('change', {
+ open: type
+ })
+
+ }
+
+ state.isopen = type
+ // 添加动画类
+ ins.requestAnimationFrame(function() {
+ ins.addClass('ani');
+ move(left, ins, ownerInstance)
+ })
+ // 设置最终移动位置,理论上只要进入到这个函数,肯定是要打开的
+}
+
+
+function getDirection(x, y) {
+ if (x > y && x > MIN_DISTANCE) {
+ return 'horizontal';
+ }
+ if (y > x && y > MIN_DISTANCE) {
+ return 'vertical';
+ }
+ return '';
+}
+
+/**
+ * 重置滑动状态
+ * @param {Object} event
+ */
+function resetTouchStatus(instance) {
+ var state = instance.getState();
+ state.direction = '';
+ state.deltaX = 0;
+ state.deltaY = 0;
+ state.offsetX = 0;
+ state.offsetY = 0;
+}
+
+/**
+ * 设置滑动开始位置
+ * @param {Object} event
+ */
+function stopTouchStart(event) {
+ var instance = event.instance;
+ var state = instance.getState();
+ resetTouchStatus(instance);
+ var touch = event.touches[0];
+ if (IS_HTML5 && isPC()) {
+ touch = event;
+ }
+ state.startX = touch.clientX;
+ state.startY = touch.clientY;
+}
+
+/**
+ * 滑动中,是否禁止打开
+ * @param {Object} event
+ */
+function stopTouchMove(event) {
+ var instance = event.instance;
+ var state = instance.getState();
+ var touch = event.touches[0];
+ if (IS_HTML5 && isPC()) {
+ touch = event;
+ }
+ state.deltaX = touch.clientX - state.startX;
+ state.deltaY = touch.clientY - state.startY;
+ state.offsetY = Math.abs(state.deltaY);
+ state.offsetX = Math.abs(state.deltaX);
+ state.direction = state.direction || getDirection(state.offsetX, state.offsetY);
+}
+
+function isPC() {
+ var userAgentInfo = navigator.userAgent;
+ var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
+ var flag = true;
+ for (var v = 0; v < Agents.length - 1; v++) {
+ if (userAgentInfo.indexOf(Agents[v]) > 0) {
+ flag = false;
+ break;
+ }
+ }
+ return flag;
+}
+
+var movable = false
+
function mousedown(e, ins) {
- if (!IS_HTML5) return
- if (!isPC()) return
- touchstart(e, ins)
- movable = true
-}
-
+ if (!IS_HTML5) return
+ if (!isPC()) return
+ touchstart(e, ins)
+ movable = true
+}
+
function mousemove(e, ins) {
- if (!IS_HTML5) return
- if (!isPC()) return
- if (!movable) return
- touchmove(e, ins)
-}
-
+ if (!IS_HTML5) return
+ if (!isPC()) return
+ if (!movable) return
+ touchmove(e, ins)
+}
+
function mouseup(e, ins) {
- if (!IS_HTML5) return
- if (!isPC()) return
- touchend(e, ins)
- movable = false
-}
-
+ if (!IS_HTML5) return
+ if (!isPC()) return
+ touchend(e, ins)
+ movable = false
+}
+
function mouseleave(e, ins) {
- if (!IS_HTML5) return
- if (!isPC()) return
- movable = false
-}
-
-module.exports = {
- sizeReady: sizeReady,
- touchstart: touchstart,
- touchmove: touchmove,
- touchend: touchend,
- mousedown: mousedown,
- mousemove: mousemove,
- mouseup: mouseup,
- mouseleave: mouseleave
+ if (!IS_HTML5) return
+ if (!isPC()) return
+ movable = false
+}
+
+module.exports = {
+ sizeReady: sizeReady,
+ touchstart: touchstart,
+ touchmove: touchmove,
+ touchend: touchend,
+ mousedown: mousedown,
+ mousemove: mousemove,
+ mouseup: mouseup,
+ mouseleave: mouseleave
}
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/isPC.js b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/isPC.js
index 9a10ece956bd1e1085515f0120875983cba396d2..7f549f65c1746f75b4037844c44411dfd280e1f5 100644
--- a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/isPC.js
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/isPC.js
@@ -1,12 +1,12 @@
-export function isPC() {
- var userAgentInfo = navigator.userAgent;
- var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
- var flag = true;
- for (let v = 0; v < Agents.length - 1; v++) {
- if (userAgentInfo.indexOf(Agents[v]) > 0) {
- flag = false;
- break;
- }
- }
- return flag;
+export function isPC() {
+ var userAgentInfo = navigator.userAgent;
+ var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
+ var flag = true;
+ for (let v = 0; v < Agents.length - 1; v++) {
+ if (userAgentInfo.indexOf(Agents[v]) > 0) {
+ flag = false;
+ break;
+ }
+ }
+ return flag;
}
\ No newline at end of file
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpalipay.js b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpalipay.js
index 1a68ef81b4a287e6dda1b799e7b8c3691b2ea61c..ad737ce508dd163c37baeae9a5d16c3d5c54bedc 100644
--- a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpalipay.js
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpalipay.js
@@ -1,36 +1,36 @@
-export default {
- data() {
- return {
- x: 0,
- transition: false,
- width: 0,
- viewWidth: 0,
+export default {
+ data() {
+ return {
+ x: 0,
+ transition: false,
+ width: 0,
+ viewWidth: 0,
swipeShow: 0
- }
- },
- watch: {
- show(newVal) {
+ }
+ },
+ watch: {
+ show(newVal) {
if (this.autoClose) return
if (newVal && newVal !== 'none' ) {
- this.transition = true
- this.open(newVal)
- } else {
- this.close()
- }
- }
- },
- created() {
- this.swipeaction = this.getSwipeAction()
- if (this.swipeaction.children !== undefined) {
- this.swipeaction.children.push(this)
+ this.transition = true
+ this.open(newVal)
+ } else {
+ this.close()
+ }
+ }
+ },
+ created() {
+ this.swipeaction = this.getSwipeAction()
+ if (this.swipeaction.children !== undefined) {
+ this.swipeaction.children.push(this)
}
- },
- mounted() {
- this.isopen = false
- setTimeout(() => {
- this.getQuerySelect()
- }, 50)
- },
+ },
+ mounted() {
+ this.isopen = false
+ setTimeout(() => {
+ this.getQuerySelect()
+ }, 50)
+ },
methods: {
appTouchStart(e) {
const {
@@ -54,140 +54,140 @@ export default {
})
}
},
- /**
- * 移动触发
- * @param {Object} e
- */
- onChange(e) {
- this.moveX = e.detail.x
- this.isclose = false
- },
- touchstart(e) {
- this.transition = false
- this.isclose = true
- this.autoClose && this.swipeaction.closeOther(this)
- },
- touchmove(e) {},
+ /**
+ * 移动触发
+ * @param {Object} e
+ */
+ onChange(e) {
+ this.moveX = e.detail.x
+ this.isclose = false
+ },
+ touchstart(e) {
+ this.transition = false
+ this.isclose = true
+ this.autoClose && this.swipeaction.closeOther(this)
+ },
+ touchmove(e) {},
touchend(e) {
- // 0的位置什么都不执行
- if (this.isclose && this.isopen === 'none') return
- if (this.isclose && this.isopen !== 'none') {
- this.transition = true
- this.close()
- } else {
- this.move(this.moveX + this.leftWidth)
- }
- },
-
- /**
- * 移动
- * @param {Object} moveX
- */
- move(moveX) {
- // 打开关闭的处理逻辑不太一样
- this.transition = true
- // 未打开状态
- if (!this.isopen || this.isopen === 'none') {
- if (moveX > this.threshold) {
- this.open('left')
- } else if (moveX < -this.threshold) {
- this.open('right')
- } else {
- this.close()
- }
- } else {
- if (moveX < 0 && moveX < this.rightWidth) {
- const rightX = this.rightWidth + moveX
- if (rightX < this.threshold) {
- this.open('right')
- } else {
- this.close()
- }
- } else if (moveX > 0 && moveX < this.leftWidth) {
- const leftX = this.leftWidth - moveX
- if (leftX < this.threshold) {
- this.open('left')
- } else {
- this.close()
- }
- }
-
- }
-
- },
-
- /**
- * 打开
- */
- open(type) {
- this.x = this.moveX
- this.animation(type)
- },
-
- /**
- * 关闭
- */
+ // 0的位置什么都不执行
+ if (this.isclose && this.isopen === 'none') return
+ if (this.isclose && this.isopen !== 'none') {
+ this.transition = true
+ this.close()
+ } else {
+ this.move(this.moveX + this.leftWidth)
+ }
+ },
+
+ /**
+ * 移动
+ * @param {Object} moveX
+ */
+ move(moveX) {
+ // 打开关闭的处理逻辑不太一样
+ this.transition = true
+ // 未打开状态
+ if (!this.isopen || this.isopen === 'none') {
+ if (moveX > this.threshold) {
+ this.open('left')
+ } else if (moveX < -this.threshold) {
+ this.open('right')
+ } else {
+ this.close()
+ }
+ } else {
+ if (moveX < 0 && moveX < this.rightWidth) {
+ const rightX = this.rightWidth + moveX
+ if (rightX < this.threshold) {
+ this.open('right')
+ } else {
+ this.close()
+ }
+ } else if (moveX > 0 && moveX < this.leftWidth) {
+ const leftX = this.leftWidth - moveX
+ if (leftX < this.threshold) {
+ this.open('left')
+ } else {
+ this.close()
+ }
+ }
+
+ }
+
+ },
+
+ /**
+ * 打开
+ */
+ open(type) {
+ this.x = this.moveX
+ this.animation(type)
+ },
+
+ /**
+ * 关闭
+ */
close() {
this.x = this.moveX
- // TODO 解决 x 值不更新的问题,所以会多触发一次 nextTick ,待优化
- this.$nextTick(() => {
+ // TODO 解决 x 值不更新的问题,所以会多触发一次 nextTick ,待优化
+ this.$nextTick(() => {
this.x = -this.leftWidth
if(this.isopen!=='none'){
this.$emit('change', 'none')
- }
- this.isopen = 'none'
- })
- },
-
- /**
- * 执行结束动画
- * @param {Object} type
- */
- animation(type) {
- this.$nextTick(() => {
- if (type === 'left') {
- this.x = 0
- } else {
- this.x = -this.rightWidth - this.leftWidth
+ }
+ this.isopen = 'none'
+ })
+ },
+
+ /**
+ * 执行结束动画
+ * @param {Object} type
+ */
+ animation(type) {
+ this.$nextTick(() => {
+ if (type === 'left') {
+ this.x = 0
+ } else {
+ this.x = -this.rightWidth - this.leftWidth
}
if(this.isopen!==type){
this.$emit('change', type)
}
- this.isopen = type
- })
-
- },
- getSlide(x) {},
- getQuerySelect() {
- const query = uni.createSelectorQuery().in(this);
- query.selectAll('.movable-view--hock').boundingClientRect(data => {
- this.leftWidth = data[1].width
+ this.isopen = type
+ })
+
+ },
+ getSlide(x) {},
+ getQuerySelect() {
+ const query = uni.createSelectorQuery().in(this);
+ query.selectAll('.movable-view--hock').boundingClientRect(data => {
+ this.leftWidth = data[1].width
this.rightWidth = data[2].width
- this.width = data[0].width
- this.viewWidth = this.width + this.rightWidth + this.leftWidth
- if (this.leftWidth === 0) {
- // TODO 疑似bug ,初始化的时候如果x 是0,会导致移动位置错误,所以让元素超出一点
- this.x = -0.1
- } else {
- this.x = -this.leftWidth
- }
- this.moveX = this.x
- this.$nextTick(() => {
- this.swipeShow = 1
- })
-
- if (!this.buttonWidth) {
- this.disabledView = true
+ this.width = data[0].width
+ this.viewWidth = this.width + this.rightWidth + this.leftWidth
+ if (this.leftWidth === 0) {
+ // TODO 疑似bug ,初始化的时候如果x 是0,会导致移动位置错误,所以让元素超出一点
+ this.x = -0.1
+ } else {
+ this.x = -this.leftWidth
}
-
- if (this.autoClose) return
+ this.moveX = this.x
+ this.$nextTick(() => {
+ this.swipeShow = 1
+ })
+
+ if (!this.buttonWidth) {
+ this.disabledView = true
+ }
+
+ if (this.autoClose) return
if (this.show !== 'none') {
- this.transition = true
- this.open(this.shows)
- }
- }).exec();
-
- }
- }
+ this.transition = true
+ this.open(this.shows)
+ }
+ }).exec();
+
+ }
+ }
}
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpother.js b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpother.js
index b9e0aafd44cfdf0978e2d47db78ae534134f1b59..eef22330dcf80d199e3c854f77aad38b9cf76aff 100644
--- a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpother.js
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpother.js
@@ -1,24 +1,24 @@
-// #ifndef APP-PLUS|| MP-WEIXIN || H5
-
-const MIN_DISTANCE = 10;
-export default {
- data() {
- // TODO 随机生生元素ID,解决百度小程序获取同一个元素位置信息的bug
- const elClass = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
- return {
- uniShow: false,
- left: 0,
- buttonShow: 'none',
+// #ifndef APP-PLUS|| MP-WEIXIN || H5
+
+const MIN_DISTANCE = 10;
+export default {
+ data() {
+ // TODO 随机生生元素ID,解决百度小程序获取同一个元素位置信息的bug
+ const elClass = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
+ return {
+ uniShow: false,
+ left: 0,
+ buttonShow: 'none',
ani: false,
- moveLeft:'',
- elClass
- }
- },
- watch: {
- show(newVal) {
- if (this.autoClose) return
- this.openState(newVal)
- },
+ moveLeft:'',
+ elClass
+ }
+ },
+ watch: {
+ show(newVal) {
+ if (this.autoClose) return
+ this.openState(newVal)
+ },
left(){
this.moveLeft = `translateX(${this.left}px)`
},
@@ -31,15 +31,15 @@ export default {
},
rightOptions() {
this.init()
- }
- },
- mounted() {
- this.swipeaction = this.getSwipeAction()
- if (this.swipeaction.children !== undefined) {
- this.swipeaction.children.push(this)
- }
- this.init()
- },
+ }
+ },
+ mounted() {
+ this.swipeaction = this.getSwipeAction()
+ if (this.swipeaction.children !== undefined) {
+ this.swipeaction.children.push(this)
+ }
+ this.init()
+ },
methods: {
init(){
clearTimeout(this.timer)
@@ -49,210 +49,210 @@ export default {
// 移动距离
this.left = 0
this.x = 0
+ },
+
+ closeSwipe(e) {
+ if (!this.autoClose) return
+ this.swipeaction.closeOther(this)
+ },
+ appTouchStart(e) {
+ const {
+ clientX
+ } = e.changedTouches[0]
+ this.clientX = clientX
+ this.timestamp = new Date().getTime()
+ },
+ appTouchEnd(e, index, item, position) {
+ const {
+ clientX
+ } = e.changedTouches[0]
+ // fixed by xxxx 模拟点击事件,解决 ios 13 点击区域错位的问题
+ let diff = Math.abs(this.clientX - clientX)
+ let time = (new Date().getTime()) - this.timestamp
+ if (diff < 40 && time < 300) {
+ this.$emit('click', {
+ content: item,
+ index,
+ position
+ })
+ }
},
-
- closeSwipe(e) {
- if (!this.autoClose) return
- this.swipeaction.closeOther(this)
- },
- appTouchStart(e) {
- const {
- clientX
- } = e.changedTouches[0]
- this.clientX = clientX
- this.timestamp = new Date().getTime()
- },
- appTouchEnd(e, index, item, position) {
- const {
- clientX
- } = e.changedTouches[0]
- // fixed by xxxx 模拟点击事件,解决 ios 13 点击区域错位的问题
- let diff = Math.abs(this.clientX - clientX)
- let time = (new Date().getTime()) - this.timestamp
- if (diff < 40 && time < 300) {
- this.$emit('click', {
- content: item,
- index,
- position
- })
- }
- },
- touchstart(e) {
- if (this.disabled) return
- this.ani = false
- this.x = this.left || 0
+ touchstart(e) {
+ if (this.disabled) return
+ this.ani = false
+ this.x = this.left || 0
this.stopTouchStart(e)
- this.autoClose && this.closeSwipe()
- },
- touchmove(e) {
- if (this.disabled) return
- // 是否可以滑动页面
- this.stopTouchMove(e);
- if (this.direction !== 'horizontal') {
- return;
- }
- this.move(this.x + this.deltaX)
- return false
- },
- touchend() {
- if (this.disabled) return
- this.moveDirection(this.left)
- },
- /**
- * 设置移动距离
- * @param {Object} value
- */
+ this.autoClose && this.closeSwipe()
+ },
+ touchmove(e) {
+ if (this.disabled) return
+ // 是否可以滑动页面
+ this.stopTouchMove(e);
+ if (this.direction !== 'horizontal') {
+ return;
+ }
+ this.move(this.x + this.deltaX)
+ return false
+ },
+ touchend() {
+ if (this.disabled) return
+ this.moveDirection(this.left)
+ },
+ /**
+ * 设置移动距离
+ * @param {Object} value
+ */
move(value) {
- value = value || 0
- const leftWidth = this.leftWidth
+ value = value || 0
+ const leftWidth = this.leftWidth
const rightWidth = this.rightWidth
- // 获取可滑动范围
+ // 获取可滑动范围
this.left = this.range(value, -rightWidth, leftWidth);
- },
-
- /**
- * 获取范围
- * @param {Object} num
- * @param {Object} min
- * @param {Object} max
- */
- range(num, min, max) {
- return Math.min(Math.max(num, min), max);
- },
- /**
- * 移动方向判断
- * @param {Object} left
- * @param {Object} value
- */
- moveDirection(left) {
- const threshold = this.threshold
- const isopen = this.isopen || 'none'
- const leftWidth = this.leftWidth
- const rightWidth = this.rightWidth
- if (this.deltaX === 0) {
- this.openState('none')
- return
- }
- if ((isopen === 'none' && rightWidth > 0 && -left > threshold) || (isopen !== 'none' && rightWidth > 0 && rightWidth +
- left < threshold)) {
- // right
- this.openState('right')
- } else if ((isopen === 'none' && leftWidth > 0 && left > threshold) || (isopen !== 'none' && leftWidth > 0 &&
- leftWidth - left < threshold)) {
- // left
- this.openState('left')
- } else {
- // default
- this.openState('none')
- }
- },
-
- /**
- * 开启状态
- * @param {Boolean} type
- */
- openState(type) {
- const leftWidth = this.leftWidth
+ },
+
+ /**
+ * 获取范围
+ * @param {Object} num
+ * @param {Object} min
+ * @param {Object} max
+ */
+ range(num, min, max) {
+ return Math.min(Math.max(num, min), max);
+ },
+ /**
+ * 移动方向判断
+ * @param {Object} left
+ * @param {Object} value
+ */
+ moveDirection(left) {
+ const threshold = this.threshold
+ const isopen = this.isopen || 'none'
+ const leftWidth = this.leftWidth
const rightWidth = this.rightWidth
- let left = ''
- this.isopen = this.isopen ? this.isopen : 'none'
- switch (type) {
- case "left":
- left = leftWidth
- break
- case "right":
- left = -rightWidth
- break
- default:
- left = 0
- }
-
-
- if (this.isopen !== type) {
- this.throttle = true
- this.$emit('change', type)
- }
-
- this.isopen = type
- // 添加动画类
- this.ani = true
- this.$nextTick(() => {
- this.move(left)
- })
- // 设置最终移动位置,理论上只要进入到这个函数,肯定是要打开的
- },
- close() {
- this.openState('none')
- },
- getDirection(x, y) {
- if (x > y && x > MIN_DISTANCE) {
- return 'horizontal';
- }
- if (y > x && y > MIN_DISTANCE) {
- return 'vertical';
- }
- return '';
- },
-
- /**
- * 重置滑动状态
- * @param {Object} event
- */
- resetTouchStatus() {
- this.direction = '';
- this.deltaX = 0;
- this.deltaY = 0;
- this.offsetX = 0;
- this.offsetY = 0;
- },
-
- /**
- * 设置滑动开始位置
- * @param {Object} event
- */
- stopTouchStart(event) {
- this.resetTouchStatus();
- const touch = event.touches[0];
- this.startX = touch.clientX;
- this.startY = touch.clientY;
- },
-
- /**
- * 滑动中,是否禁止打开
- * @param {Object} event
- */
- stopTouchMove(event) {
- const touch = event.touches[0];
- this.deltaX = touch.clientX - this.startX;
- this.deltaY = touch.clientY - this.startY;
- this.offsetX = Math.abs(this.deltaX);
- this.offsetY = Math.abs(this.deltaY);
- this.direction = this.direction || this.getDirection(this.offsetX, this.offsetY);
- },
-
- getSelectorQuery() {
- const views = uni.createSelectorQuery().in(this)
- views
- .selectAll('.'+this.elClass)
- .boundingClientRect(data => {
- if(data.length === 0) return
- let show = 'none'
- if (this.autoClose) {
- show = 'none'
- } else {
- show = this.show
+ if (this.deltaX === 0) {
+ this.openState('none')
+ return
+ }
+ if ((isopen === 'none' && rightWidth > 0 && -left > threshold) || (isopen !== 'none' && rightWidth > 0 && rightWidth +
+ left < threshold)) {
+ // right
+ this.openState('right')
+ } else if ((isopen === 'none' && leftWidth > 0 && left > threshold) || (isopen !== 'none' && leftWidth > 0 &&
+ leftWidth - left < threshold)) {
+ // left
+ this.openState('left')
+ } else {
+ // default
+ this.openState('none')
+ }
+ },
+
+ /**
+ * 开启状态
+ * @param {Boolean} type
+ */
+ openState(type) {
+ const leftWidth = this.leftWidth
+ const rightWidth = this.rightWidth
+ let left = ''
+ this.isopen = this.isopen ? this.isopen : 'none'
+ switch (type) {
+ case "left":
+ left = leftWidth
+ break
+ case "right":
+ left = -rightWidth
+ break
+ default:
+ left = 0
+ }
+
+
+ if (this.isopen !== type) {
+ this.throttle = true
+ this.$emit('change', type)
+ }
+
+ this.isopen = type
+ // 添加动画类
+ this.ani = true
+ this.$nextTick(() => {
+ this.move(left)
+ })
+ // 设置最终移动位置,理论上只要进入到这个函数,肯定是要打开的
+ },
+ close() {
+ this.openState('none')
+ },
+ getDirection(x, y) {
+ if (x > y && x > MIN_DISTANCE) {
+ return 'horizontal';
+ }
+ if (y > x && y > MIN_DISTANCE) {
+ return 'vertical';
+ }
+ return '';
+ },
+
+ /**
+ * 重置滑动状态
+ * @param {Object} event
+ */
+ resetTouchStatus() {
+ this.direction = '';
+ this.deltaX = 0;
+ this.deltaY = 0;
+ this.offsetX = 0;
+ this.offsetY = 0;
+ },
+
+ /**
+ * 设置滑动开始位置
+ * @param {Object} event
+ */
+ stopTouchStart(event) {
+ this.resetTouchStatus();
+ const touch = event.touches[0];
+ this.startX = touch.clientX;
+ this.startY = touch.clientY;
+ },
+
+ /**
+ * 滑动中,是否禁止打开
+ * @param {Object} event
+ */
+ stopTouchMove(event) {
+ const touch = event.touches[0];
+ this.deltaX = touch.clientX - this.startX;
+ this.deltaY = touch.clientY - this.startY;
+ this.offsetX = Math.abs(this.deltaX);
+ this.offsetY = Math.abs(this.deltaY);
+ this.direction = this.direction || this.getDirection(this.offsetX, this.offsetY);
+ },
+
+ getSelectorQuery() {
+ const views = uni.createSelectorQuery().in(this)
+ views
+ .selectAll('.'+this.elClass)
+ .boundingClientRect(data => {
+ if(data.length === 0) return
+ let show = 'none'
+ if (this.autoClose) {
+ show = 'none'
+ } else {
+ show = this.show
}
- this.leftWidth = data[0].width || 0
- this.rightWidth = data[1].width || 0
- this.buttonShow = show
- })
- .exec()
- }
- }
+ this.leftWidth = data[0].width || 0
+ this.rightWidth = data[1].width || 0
+ this.buttonShow = show
+ })
+ .exec()
+ }
+ }
}
-
-// #endif
-
-// #ifdef APP-PLUS|| MP-WEIXIN || H5
-export default { }
+
+// #endif
+
+// #ifdef APP-PLUS|| MP-WEIXIN || H5
+export default { }
// #endif
\ No newline at end of file
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpwxs.js b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpwxs.js
index 900b78d4211e1820e45fba7a3d1447a76f3ce0a2..1e36fd546026a4aa3a46eb17ae1859ea8a59f5d2 100644
--- a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpwxs.js
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpwxs.js
@@ -1,81 +1,81 @@
-// #ifdef APP-VUE|| MP-WEIXIN || H5
+// #ifdef APP-VUE|| MP-WEIXIN || H5
import { isPC } from "./isPC"
-export default {
- data() {
- return {
- is_show:'none'
- }
- },
- watch: {
- show(newVal){
- this.is_show = this.show
- }
- },
- created() {
- this.swipeaction = this.getSwipeAction()
- if (this.swipeaction.children !== undefined) {
- this.swipeaction.children.push(this)
- }
- },
- mounted(){
- this.is_show = this.show
- },
- methods: {
- // wxs 中调用
- closeSwipe(e) {
- if (!this.autoClose) return
- this.swipeaction.closeOther(this)
- },
-
- change(e) {
- this.$emit('change', e.open)
- if (this.is_show !== e.open) {
- this.is_show = e.open
- }
- },
-
+export default {
+ data() {
+ return {
+ is_show:'none'
+ }
+ },
+ watch: {
+ show(newVal){
+ this.is_show = this.show
+ }
+ },
+ created() {
+ this.swipeaction = this.getSwipeAction()
+ if (this.swipeaction.children !== undefined) {
+ this.swipeaction.children.push(this)
+ }
+ },
+ mounted(){
+ this.is_show = this.show
+ },
+ methods: {
+ // wxs 中调用
+ closeSwipe(e) {
+ if (!this.autoClose) return
+ this.swipeaction.closeOther(this)
+ },
+
+ change(e) {
+ this.$emit('change', e.open)
+ if (this.is_show !== e.open) {
+ this.is_show = e.open
+ }
+ },
+
appTouchStart(e) {
// #ifdef H5
if(isPC()) return
- // #endif
- const {
- clientX
- } = e.changedTouches[0]
- this.clientX = clientX
- this.timestamp = new Date().getTime()
- },
+ // #endif
+ const {
+ clientX
+ } = e.changedTouches[0]
+ this.clientX = clientX
+ this.timestamp = new Date().getTime()
+ },
appTouchEnd(e, index, item, position) {
// #ifdef H5
if(isPC()) return
- // #endif
- const {
- clientX
- } = e.changedTouches[0]
- // fixed by xxxx 模拟点击事件,解决 ios 13 点击区域错位的问题
- let diff = Math.abs(this.clientX - clientX)
- let time = (new Date().getTime()) - this.timestamp
- if (diff < 40 && time < 300) {
- this.$emit('click', {
- content: item,
- index,
- position
- })
+ // #endif
+ const {
+ clientX
+ } = e.changedTouches[0]
+ // fixed by xxxx 模拟点击事件,解决 ios 13 点击区域错位的问题
+ let diff = Math.abs(this.clientX - clientX)
+ let time = (new Date().getTime()) - this.timestamp
+ if (diff < 40 && time < 300) {
+ this.$emit('click', {
+ content: item,
+ index,
+ position
+ })
}
},
onClickForPC(index, item, position) {
// #ifdef H5
- if(!isPC()) return
- this.$emit('click', {
- content: item,
- index,
- position
- })
- // #endif
+ if(!isPC()) return
+ this.$emit('click', {
+ content: item,
+ index,
+ position
+ })
+ // #endif
}
- }
-}
-
+ }
+}
+
// #endif
-// #ifndef APP-VUE|| MP-WEIXIN || H5
-export default {}
+// #ifndef APP-VUE|| MP-WEIXIN || H5
+export default {}
// #endif
\ No newline at end of file
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/render.js b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/render.js
index abaa54d30c231155ee3253857f4b7c6e86a4a7b2..ac50d759cdea36b2f15ebb2e4263458a6bc2ef1b 100644
--- a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/render.js
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/render.js
@@ -1,265 +1,265 @@
-const MIN_DISTANCE = 10;
-export default {
- showWatch(newVal, oldVal, ownerInstance, instance,self) {
- let state = self.state
- this.getDom(instance, ownerInstance,self)
- if (newVal && newVal !== 'none') {
- this.openState(newVal, instance, ownerInstance,self)
- return
- }
-
- if (state.left) {
- this.openState('none', instance, ownerInstance,self)
- }
- this.resetTouchStatus(instance,self)
- },
-
- /**
- * 开始触摸操作
- * @param {Object} e
- * @param {Object} ins
- */
- touchstart(e, ownerInstance, self) {
- let instance = e.instance;
- let disabled = instance.getDataset().disabled
- let state = self.state;
- this.getDom(instance, ownerInstance, self)
- // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
- disabled = this.getDisabledType(disabled)
- if (disabled) return
- // 开始触摸时移除动画类
- instance.requestAnimationFrame(function() {
- instance.removeClass('ani');
- ownerInstance.callMethod('closeSwipe');
- })
-
- // 记录上次的位置
- state.x = state.left || 0
- // 计算滑动开始位置
- this.stopTouchStart(e, ownerInstance, self)
- },
-
- /**
- * 开始滑动操作
- * @param {Object} e
- * @param {Object} ownerInstance
- */
- touchmove(e, ownerInstance, self) {
- let instance = e.instance;
- let disabled = instance.getDataset().disabled
- let state = self.state
- // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
- disabled = this.getDisabledType(disabled)
- if (disabled) return
- // 是否可以滑动页面
- this.stopTouchMove(e, self);
- if (state.direction !== 'horizontal') {
- return;
- }
- if (e.preventDefault) {
- // 阻止页面滚动
- e.preventDefault()
- }
- let x = state.x + state.deltaX
- this.move(x, instance, ownerInstance, self)
- },
-
- /**
- * 结束触摸操作
- * @param {Object} e
- * @param {Object} ownerInstance
- */
- touchend(e, ownerInstance, self) {
- let instance = e.instance;
- let disabled = instance.getDataset().disabled
- let state = self.state
- // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
- disabled = this.getDisabledType(disabled)
-
- if (disabled) return
- // 滑动过程中触摸结束,通过阙值判断是开启还是关闭
- // fixed by mehaotian 定时器解决点击按钮,touchend 触发比 click 事件时机早的问题 ,主要是 ios13
- this.moveDirection(state.left, instance, ownerInstance, self)
-
- },
-
- /**
- * 设置移动距离
- * @param {Object} value
- * @param {Object} instance
- * @param {Object} ownerInstance
- */
- move(value, instance, ownerInstance, self) {
- value = value || 0
- let state = self.state
- let leftWidth = state.leftWidth
- let rightWidth = state.rightWidth
- // 获取可滑动范围
- state.left = this.range(value, -rightWidth, leftWidth);
- instance.requestAnimationFrame(function() {
- instance.setStyle({
- transform: 'translateX(' + state.left + 'px)',
- '-webkit-transform': 'translateX(' + state.left + 'px)'
- })
- })
-
- },
-
- /**
- * 获取元素信息
- * @param {Object} instance
- * @param {Object} ownerInstance
- */
- getDom(instance, ownerInstance, self) {
- let state = self.state
- var leftDom = ownerInstance.$el.querySelector('.button-group--left')
- var rightDom = ownerInstance.$el.querySelector('.button-group--right')
-
- state.leftWidth = leftDom.offsetWidth || 0
- state.rightWidth = rightDom.offsetWidth || 0
- state.threshold = instance.getDataset().threshold
- },
-
- getDisabledType(value) {
- return (typeof(value) === 'string' ? JSON.parse(value) : value) || false;
- },
-
- /**
- * 获取范围
- * @param {Object} num
- * @param {Object} min
- * @param {Object} max
- */
- range(num, min, max) {
- return Math.min(Math.max(num, min), max);
- },
-
-
- /**
- * 移动方向判断
- * @param {Object} left
- * @param {Object} value
- * @param {Object} ownerInstance
- * @param {Object} ins
- */
- moveDirection(left, ins, ownerInstance, self) {
- var state = self.state
- var threshold = state.threshold
- var position = state.position
- var isopen = state.isopen || 'none'
- var leftWidth = state.leftWidth
- var rightWidth = state.rightWidth
- if (state.deltaX === 0) {
- this.openState('none', ins, ownerInstance, self)
- return
- }
- if ((isopen === 'none' && rightWidth > 0 && -left > threshold) || (isopen !== 'none' && rightWidth > 0 &&
- rightWidth +
- left < threshold)) {
- // right
- this.openState('right', ins, ownerInstance, self)
- } else if ((isopen === 'none' && leftWidth > 0 && left > threshold) || (isopen !== 'none' && leftWidth > 0 &&
- leftWidth - left < threshold)) {
- // left
- this.openState('left', ins, ownerInstance, self)
- } else {
- // default
- this.openState('none', ins, ownerInstance, self)
- }
- },
-
-
- /**
- * 开启状态
- * @param {Boolean} type
- * @param {Object} ins
- * @param {Object} ownerInstance
- */
- openState(type, ins, ownerInstance, self) {
- let state = self.state
- let leftWidth = state.leftWidth
- let rightWidth = state.rightWidth
- let left = ''
- state.isopen = state.isopen ? state.isopen : 'none'
- switch (type) {
- case "left":
- left = leftWidth
- break
- case "right":
- left = -rightWidth
- break
- default:
- left = 0
- }
-
- // && !state.throttle
-
- if (state.isopen !== type) {
- state.throttle = true
- ownerInstance.callMethod('change', {
- open: type
- })
-
- }
-
- state.isopen = type
- // 添加动画类
- ins.requestAnimationFrame(()=> {
- ins.addClass('ani');
- this.move(left, ins, ownerInstance, self)
- })
- },
-
-
- getDirection(x, y) {
- if (x > y && x > MIN_DISTANCE) {
- return 'horizontal';
- }
- if (y > x && y > MIN_DISTANCE) {
- return 'vertical';
- }
- return '';
- },
-
- /**
- * 重置滑动状态
- * @param {Object} event
- */
- resetTouchStatus(instance, self) {
- let state = self.state;
- state.direction = '';
- state.deltaX = 0;
- state.deltaY = 0;
- state.offsetX = 0;
- state.offsetY = 0;
- },
-
- /**
- * 设置滑动开始位置
- * @param {Object} event
- */
- stopTouchStart(event, ownerInstance, self) {
- let instance = event.instance;
- let state = self.state
- this.resetTouchStatus(instance, self);
- var touch = event.touches[0];
- state.startX = touch.clientX;
- state.startY = touch.clientY;
- },
-
- /**
- * 滑动中,是否禁止打开
- * @param {Object} event
- */
- stopTouchMove(event, self) {
- let instance = event.instance;
- let state = self.state;
- let touch = event.touches[0];
-
- state.deltaX = touch.clientX - state.startX;
- state.deltaY = touch.clientY - state.startY;
- state.offsetY = Math.abs(state.deltaY);
- state.offsetX = Math.abs(state.deltaX);
- state.direction = state.direction || this.getDirection(state.offsetX, state.offsetY);
- }
-}
+const MIN_DISTANCE = 10;
+export default {
+ showWatch(newVal, oldVal, ownerInstance, instance,self) {
+ let state = self.state
+ this.getDom(instance, ownerInstance,self)
+ if (newVal && newVal !== 'none') {
+ this.openState(newVal, instance, ownerInstance,self)
+ return
+ }
+
+ if (state.left) {
+ this.openState('none', instance, ownerInstance,self)
+ }
+ this.resetTouchStatus(instance,self)
+ },
+
+ /**
+ * 开始触摸操作
+ * @param {Object} e
+ * @param {Object} ins
+ */
+ touchstart(e, ownerInstance, self) {
+ let instance = e.instance;
+ let disabled = instance.getDataset().disabled
+ let state = self.state;
+ this.getDom(instance, ownerInstance, self)
+ // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
+ disabled = this.getDisabledType(disabled)
+ if (disabled) return
+ // 开始触摸时移除动画类
+ instance.requestAnimationFrame(function() {
+ instance.removeClass('ani');
+ ownerInstance.callMethod('closeSwipe');
+ })
+
+ // 记录上次的位置
+ state.x = state.left || 0
+ // 计算滑动开始位置
+ this.stopTouchStart(e, ownerInstance, self)
+ },
+
+ /**
+ * 开始滑动操作
+ * @param {Object} e
+ * @param {Object} ownerInstance
+ */
+ touchmove(e, ownerInstance, self) {
+ let instance = e.instance;
+ let disabled = instance.getDataset().disabled
+ let state = self.state
+ // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
+ disabled = this.getDisabledType(disabled)
+ if (disabled) return
+ // 是否可以滑动页面
+ this.stopTouchMove(e, self);
+ if (state.direction !== 'horizontal') {
+ return;
+ }
+ if (e.preventDefault) {
+ // 阻止页面滚动
+ e.preventDefault()
+ }
+ let x = state.x + state.deltaX
+ this.move(x, instance, ownerInstance, self)
+ },
+
+ /**
+ * 结束触摸操作
+ * @param {Object} e
+ * @param {Object} ownerInstance
+ */
+ touchend(e, ownerInstance, self) {
+ let instance = e.instance;
+ let disabled = instance.getDataset().disabled
+ let state = self.state
+ // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
+ disabled = this.getDisabledType(disabled)
+
+ if (disabled) return
+ // 滑动过程中触摸结束,通过阙值判断是开启还是关闭
+ // fixed by mehaotian 定时器解决点击按钮,touchend 触发比 click 事件时机早的问题 ,主要是 ios13
+ this.moveDirection(state.left, instance, ownerInstance, self)
+
+ },
+
+ /**
+ * 设置移动距离
+ * @param {Object} value
+ * @param {Object} instance
+ * @param {Object} ownerInstance
+ */
+ move(value, instance, ownerInstance, self) {
+ value = value || 0
+ let state = self.state
+ let leftWidth = state.leftWidth
+ let rightWidth = state.rightWidth
+ // 获取可滑动范围
+ state.left = this.range(value, -rightWidth, leftWidth);
+ instance.requestAnimationFrame(function() {
+ instance.setStyle({
+ transform: 'translateX(' + state.left + 'px)',
+ '-webkit-transform': 'translateX(' + state.left + 'px)'
+ })
+ })
+
+ },
+
+ /**
+ * 获取元素信息
+ * @param {Object} instance
+ * @param {Object} ownerInstance
+ */
+ getDom(instance, ownerInstance, self) {
+ let state = self.state
+ var leftDom = ownerInstance.$el.querySelector('.button-group--left')
+ var rightDom = ownerInstance.$el.querySelector('.button-group--right')
+
+ state.leftWidth = leftDom.offsetWidth || 0
+ state.rightWidth = rightDom.offsetWidth || 0
+ state.threshold = instance.getDataset().threshold
+ },
+
+ getDisabledType(value) {
+ return (typeof(value) === 'string' ? JSON.parse(value) : value) || false;
+ },
+
+ /**
+ * 获取范围
+ * @param {Object} num
+ * @param {Object} min
+ * @param {Object} max
+ */
+ range(num, min, max) {
+ return Math.min(Math.max(num, min), max);
+ },
+
+
+ /**
+ * 移动方向判断
+ * @param {Object} left
+ * @param {Object} value
+ * @param {Object} ownerInstance
+ * @param {Object} ins
+ */
+ moveDirection(left, ins, ownerInstance, self) {
+ var state = self.state
+ var threshold = state.threshold
+ var position = state.position
+ var isopen = state.isopen || 'none'
+ var leftWidth = state.leftWidth
+ var rightWidth = state.rightWidth
+ if (state.deltaX === 0) {
+ this.openState('none', ins, ownerInstance, self)
+ return
+ }
+ if ((isopen === 'none' && rightWidth > 0 && -left > threshold) || (isopen !== 'none' && rightWidth > 0 &&
+ rightWidth +
+ left < threshold)) {
+ // right
+ this.openState('right', ins, ownerInstance, self)
+ } else if ((isopen === 'none' && leftWidth > 0 && left > threshold) || (isopen !== 'none' && leftWidth > 0 &&
+ leftWidth - left < threshold)) {
+ // left
+ this.openState('left', ins, ownerInstance, self)
+ } else {
+ // default
+ this.openState('none', ins, ownerInstance, self)
+ }
+ },
+
+
+ /**
+ * 开启状态
+ * @param {Boolean} type
+ * @param {Object} ins
+ * @param {Object} ownerInstance
+ */
+ openState(type, ins, ownerInstance, self) {
+ let state = self.state
+ let leftWidth = state.leftWidth
+ let rightWidth = state.rightWidth
+ let left = ''
+ state.isopen = state.isopen ? state.isopen : 'none'
+ switch (type) {
+ case "left":
+ left = leftWidth
+ break
+ case "right":
+ left = -rightWidth
+ break
+ default:
+ left = 0
+ }
+
+ // && !state.throttle
+
+ if (state.isopen !== type) {
+ state.throttle = true
+ ownerInstance.callMethod('change', {
+ open: type
+ })
+
+ }
+
+ state.isopen = type
+ // 添加动画类
+ ins.requestAnimationFrame(()=> {
+ ins.addClass('ani');
+ this.move(left, ins, ownerInstance, self)
+ })
+ },
+
+
+ getDirection(x, y) {
+ if (x > y && x > MIN_DISTANCE) {
+ return 'horizontal';
+ }
+ if (y > x && y > MIN_DISTANCE) {
+ return 'vertical';
+ }
+ return '';
+ },
+
+ /**
+ * 重置滑动状态
+ * @param {Object} event
+ */
+ resetTouchStatus(instance, self) {
+ let state = self.state;
+ state.direction = '';
+ state.deltaX = 0;
+ state.deltaY = 0;
+ state.offsetX = 0;
+ state.offsetY = 0;
+ },
+
+ /**
+ * 设置滑动开始位置
+ * @param {Object} event
+ */
+ stopTouchStart(event, ownerInstance, self) {
+ let instance = event.instance;
+ let state = self.state
+ this.resetTouchStatus(instance, self);
+ var touch = event.touches[0];
+ state.startX = touch.clientX;
+ state.startY = touch.clientY;
+ },
+
+ /**
+ * 滑动中,是否禁止打开
+ * @param {Object} event
+ */
+ stopTouchMove(event, self) {
+ let instance = event.instance;
+ let state = self.state;
+ let touch = event.touches[0];
+
+ state.deltaX = touch.clientX - state.startX;
+ state.deltaY = touch.clientY - state.startY;
+ state.offsetY = Math.abs(state.deltaY);
+ state.offsetX = Math.abs(state.deltaX);
+ state.direction = state.direction || this.getDirection(state.offsetX, state.offsetY);
+ }
+}
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue
index 0452d3e6aff0b45d3019dba923017913b5432e84..310c5e7626b4fd6cb353ec398f4ec57bb90dc337 100644
--- a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue
@@ -1,348 +1,348 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/wx.wxs b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/wx.wxs
index b394244f2b8e8e88adec35a26e6615977c635f7c..68060321c4a8d6d77837fe2247db3c8fbe94ec24 100644
--- a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/wx.wxs
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/wx.wxs
@@ -1,341 +1,341 @@
-var MIN_DISTANCE = 10;
-
-/**
- * 判断当前是否为H5、app-vue
- */
-var IS_HTML5 = false
-if (typeof window === 'object') IS_HTML5 = true
-
-/**
- * 监听页面内值的变化,主要用于动态开关swipe-action
- * @param {Object} newValue
- * @param {Object} oldValue
- * @param {Object} ownerInstance
- * @param {Object} instance
- */
-function showWatch(newVal, oldVal, ownerInstance, instance) {
- var state = instance.getState()
- getDom(instance, ownerInstance)
- if (newVal && newVal !== 'none') {
- openState(newVal, instance, ownerInstance)
- return
- }
-
- if (state.left) {
- openState('none', instance, ownerInstance)
- }
- resetTouchStatus(instance)
-}
-
-/**
- * 开始触摸操作
- * @param {Object} e
- * @param {Object} ins
- */
-function touchstart(e, ownerInstance) {
- var instance = e.instance;
- var disabled = instance.getDataset().disabled
- var state = instance.getState();
- getDom(instance, ownerInstance)
- // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
- disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
- if (disabled) return
- // 开始触摸时移除动画类
- instance.requestAnimationFrame(function() {
- instance.removeClass('ani');
- ownerInstance.callMethod('closeSwipe');
- })
-
- // 记录上次的位置
- state.x = state.left || 0
- // 计算滑动开始位置
- stopTouchStart(e, ownerInstance)
-}
-
-/**
- * 开始滑动操作
- * @param {Object} e
- * @param {Object} ownerInstance
- */
-function touchmove(e, ownerInstance) {
- var instance = e.instance;
- var disabled = instance.getDataset().disabled
- var state = instance.getState()
- // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
- disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
- if (disabled) return
- // 是否可以滑动页面
- stopTouchMove(e);
- if (state.direction !== 'horizontal') {
- return;
- }
-
- if (e.preventDefault) {
- // 阻止页面滚动
- e.preventDefault()
- }
-
- move(state.x + state.deltaX, instance, ownerInstance)
-}
-
-/**
- * 结束触摸操作
- * @param {Object} e
- * @param {Object} ownerInstance
- */
-function touchend(e, ownerInstance) {
- var instance = e.instance;
- var disabled = instance.getDataset().disabled
- var state = instance.getState()
- // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
- disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
-
- if (disabled) return
- // 滑动过程中触摸结束,通过阙值判断是开启还是关闭
- // fixed by mehaotian 定时器解决点击按钮,touchend 触发比 click 事件时机早的问题 ,主要是 ios13
- moveDirection(state.left, instance, ownerInstance)
-
-}
-
-/**
- * 设置移动距离
- * @param {Object} value
- * @param {Object} instance
- * @param {Object} ownerInstance
- */
-function move(value, instance, ownerInstance) {
- value = value || 0
- var state = instance.getState()
- var leftWidth = state.leftWidth
- var rightWidth = state.rightWidth
- // 获取可滑动范围
- state.left = range(value, -rightWidth, leftWidth);
- instance.requestAnimationFrame(function() {
- instance.setStyle({
- transform: 'translateX(' + state.left + 'px)',
- '-webkit-transform': 'translateX(' + state.left + 'px)'
- })
- })
-
-}
-
-/**
- * 获取元素信息
- * @param {Object} instance
- * @param {Object} ownerInstance
- */
-function getDom(instance, ownerInstance) {
- var state = instance.getState()
- var leftDom = ownerInstance.selectComponent('.button-group--left')
- var rightDom = ownerInstance.selectComponent('.button-group--right')
- var leftStyles = {
- width: 0
- }
- var rightStyles = {
- width: 0
- }
- leftStyles = leftDom.getBoundingClientRect()
- rightStyles = rightDom.getBoundingClientRect()
-
- state.leftWidth = leftStyles.width || 0
- state.rightWidth = rightStyles.width || 0
- state.threshold = instance.getDataset().threshold
-}
-
-/**
- * 获取范围
- * @param {Object} num
- * @param {Object} min
- * @param {Object} max
- */
-function range(num, min, max) {
- return Math.min(Math.max(num, min), max);
-}
-
-
-/**
- * 移动方向判断
- * @param {Object} left
- * @param {Object} value
- * @param {Object} ownerInstance
- * @param {Object} ins
- */
-function moveDirection(left, ins, ownerInstance) {
- var state = ins.getState()
- var threshold = state.threshold
- var position = state.position
- var isopen = state.isopen || 'none'
- var leftWidth = state.leftWidth
- var rightWidth = state.rightWidth
- if (state.deltaX === 0) {
- openState('none', ins, ownerInstance)
- return
- }
- if ((isopen === 'none' && rightWidth > 0 && -left > threshold) || (isopen !== 'none' && rightWidth > 0 &&
- rightWidth +
- left < threshold)) {
- // right
- openState('right', ins, ownerInstance)
- } else if ((isopen === 'none' && leftWidth > 0 && left > threshold) || (isopen !== 'none' && leftWidth > 0 &&
- leftWidth - left < threshold)) {
- // left
- openState('left', ins, ownerInstance)
- } else {
- // default
- openState('none', ins, ownerInstance)
- }
-}
-
-
-/**
- * 开启状态
- * @param {Boolean} type
- * @param {Object} ins
- * @param {Object} ownerInstance
- */
-function openState(type, ins, ownerInstance) {
- var state = ins.getState()
- var leftWidth = state.leftWidth
- var rightWidth = state.rightWidth
- var left = ''
- state.isopen = state.isopen ? state.isopen : 'none'
- switch (type) {
- case "left":
- left = leftWidth
- break
- case "right":
- left = -rightWidth
- break
- default:
- left = 0
- }
-
- // && !state.throttle
-
- if (state.isopen !== type) {
- state.throttle = true
- ownerInstance.callMethod('change', {
- open: type
- })
-
- }
-
- state.isopen = type
- // 添加动画类
- ins.requestAnimationFrame(function() {
- ins.addClass('ani');
- move(left, ins, ownerInstance)
- })
- // 设置最终移动位置,理论上只要进入到这个函数,肯定是要打开的
-}
-
-
-function getDirection(x, y) {
- if (x > y && x > MIN_DISTANCE) {
- return 'horizontal';
- }
- if (y > x && y > MIN_DISTANCE) {
- return 'vertical';
- }
- return '';
-}
-
-/**
- * 重置滑动状态
- * @param {Object} event
- */
-function resetTouchStatus(instance) {
- var state = instance.getState();
- state.direction = '';
- state.deltaX = 0;
- state.deltaY = 0;
- state.offsetX = 0;
- state.offsetY = 0;
-}
-
-/**
- * 设置滑动开始位置
- * @param {Object} event
- */
-function stopTouchStart(event) {
- var instance = event.instance;
- var state = instance.getState();
- resetTouchStatus(instance);
- var touch = event.touches[0];
- if (IS_HTML5 && isPC()) {
- touch = event;
- }
- state.startX = touch.clientX;
- state.startY = touch.clientY;
-}
-
-/**
- * 滑动中,是否禁止打开
- * @param {Object} event
- */
-function stopTouchMove(event) {
- var instance = event.instance;
- var state = instance.getState();
- var touch = event.touches[0];
- if (IS_HTML5 && isPC()) {
- touch = event;
- }
- state.deltaX = touch.clientX - state.startX;
- state.deltaY = touch.clientY - state.startY;
- state.offsetY = Math.abs(state.deltaY);
- state.offsetX = Math.abs(state.deltaX);
- state.direction = state.direction || getDirection(state.offsetX, state.offsetY);
-}
-
-function isPC() {
- var userAgentInfo = navigator.userAgent;
- var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
- var flag = true;
- for (var v = 0; v < Agents.length - 1; v++) {
- if (userAgentInfo.indexOf(Agents[v]) > 0) {
- flag = false;
- break;
- }
- }
- return flag;
-}
-
-var movable = false
-
-function mousedown(e, ins) {
- if (!IS_HTML5) return
- if (!isPC()) return
- touchstart(e, ins)
- movable = true
-}
-
-function mousemove(e, ins) {
- if (!IS_HTML5) return
- if (!isPC()) return
- if (!movable) return
- touchmove(e, ins)
-}
-
-function mouseup(e, ins) {
- if (!IS_HTML5) return
- if (!isPC()) return
- touchend(e, ins)
- movable = false
-}
-
-function mouseleave(e, ins) {
- if (!IS_HTML5) return
- if (!isPC()) return
- movable = false
-}
-
-module.exports = {
- showWatch: showWatch,
- touchstart: touchstart,
- touchmove: touchmove,
- touchend: touchend,
- mousedown: mousedown,
- mousemove: mousemove,
- mouseup: mouseup,
- mouseleave: mouseleave
-}
+var MIN_DISTANCE = 10;
+
+/**
+ * 判断当前是否为H5、app-vue
+ */
+var IS_HTML5 = false
+if (typeof window === 'object') IS_HTML5 = true
+
+/**
+ * 监听页面内值的变化,主要用于动态开关swipe-action
+ * @param {Object} newValue
+ * @param {Object} oldValue
+ * @param {Object} ownerInstance
+ * @param {Object} instance
+ */
+function showWatch(newVal, oldVal, ownerInstance, instance) {
+ var state = instance.getState()
+ getDom(instance, ownerInstance)
+ if (newVal && newVal !== 'none') {
+ openState(newVal, instance, ownerInstance)
+ return
+ }
+
+ if (state.left) {
+ openState('none', instance, ownerInstance)
+ }
+ resetTouchStatus(instance)
+}
+
+/**
+ * 开始触摸操作
+ * @param {Object} e
+ * @param {Object} ins
+ */
+function touchstart(e, ownerInstance) {
+ var instance = e.instance;
+ var disabled = instance.getDataset().disabled
+ var state = instance.getState();
+ getDom(instance, ownerInstance)
+ // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
+ disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
+ if (disabled) return
+ // 开始触摸时移除动画类
+ instance.requestAnimationFrame(function() {
+ instance.removeClass('ani');
+ ownerInstance.callMethod('closeSwipe');
+ })
+
+ // 记录上次的位置
+ state.x = state.left || 0
+ // 计算滑动开始位置
+ stopTouchStart(e, ownerInstance)
+}
+
+/**
+ * 开始滑动操作
+ * @param {Object} e
+ * @param {Object} ownerInstance
+ */
+function touchmove(e, ownerInstance) {
+ var instance = e.instance;
+ var disabled = instance.getDataset().disabled
+ var state = instance.getState()
+ // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
+ disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
+ if (disabled) return
+ // 是否可以滑动页面
+ stopTouchMove(e);
+ if (state.direction !== 'horizontal') {
+ return;
+ }
+
+ if (e.preventDefault) {
+ // 阻止页面滚动
+ e.preventDefault()
+ }
+
+ move(state.x + state.deltaX, instance, ownerInstance)
+}
+
+/**
+ * 结束触摸操作
+ * @param {Object} e
+ * @param {Object} ownerInstance
+ */
+function touchend(e, ownerInstance) {
+ var instance = e.instance;
+ var disabled = instance.getDataset().disabled
+ var state = instance.getState()
+ // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
+ disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
+
+ if (disabled) return
+ // 滑动过程中触摸结束,通过阙值判断是开启还是关闭
+ // fixed by mehaotian 定时器解决点击按钮,touchend 触发比 click 事件时机早的问题 ,主要是 ios13
+ moveDirection(state.left, instance, ownerInstance)
+
+}
+
+/**
+ * 设置移动距离
+ * @param {Object} value
+ * @param {Object} instance
+ * @param {Object} ownerInstance
+ */
+function move(value, instance, ownerInstance) {
+ value = value || 0
+ var state = instance.getState()
+ var leftWidth = state.leftWidth
+ var rightWidth = state.rightWidth
+ // 获取可滑动范围
+ state.left = range(value, -rightWidth, leftWidth);
+ instance.requestAnimationFrame(function() {
+ instance.setStyle({
+ transform: 'translateX(' + state.left + 'px)',
+ '-webkit-transform': 'translateX(' + state.left + 'px)'
+ })
+ })
+
+}
+
+/**
+ * 获取元素信息
+ * @param {Object} instance
+ * @param {Object} ownerInstance
+ */
+function getDom(instance, ownerInstance) {
+ var state = instance.getState()
+ var leftDom = ownerInstance.selectComponent('.button-group--left')
+ var rightDom = ownerInstance.selectComponent('.button-group--right')
+ var leftStyles = {
+ width: 0
+ }
+ var rightStyles = {
+ width: 0
+ }
+ leftStyles = leftDom.getBoundingClientRect()
+ rightStyles = rightDom.getBoundingClientRect()
+
+ state.leftWidth = leftStyles.width || 0
+ state.rightWidth = rightStyles.width || 0
+ state.threshold = instance.getDataset().threshold
+}
+
+/**
+ * 获取范围
+ * @param {Object} num
+ * @param {Object} min
+ * @param {Object} max
+ */
+function range(num, min, max) {
+ return Math.min(Math.max(num, min), max);
+}
+
+
+/**
+ * 移动方向判断
+ * @param {Object} left
+ * @param {Object} value
+ * @param {Object} ownerInstance
+ * @param {Object} ins
+ */
+function moveDirection(left, ins, ownerInstance) {
+ var state = ins.getState()
+ var threshold = state.threshold
+ var position = state.position
+ var isopen = state.isopen || 'none'
+ var leftWidth = state.leftWidth
+ var rightWidth = state.rightWidth
+ if (state.deltaX === 0) {
+ openState('none', ins, ownerInstance)
+ return
+ }
+ if ((isopen === 'none' && rightWidth > 0 && -left > threshold) || (isopen !== 'none' && rightWidth > 0 &&
+ rightWidth +
+ left < threshold)) {
+ // right
+ openState('right', ins, ownerInstance)
+ } else if ((isopen === 'none' && leftWidth > 0 && left > threshold) || (isopen !== 'none' && leftWidth > 0 &&
+ leftWidth - left < threshold)) {
+ // left
+ openState('left', ins, ownerInstance)
+ } else {
+ // default
+ openState('none', ins, ownerInstance)
+ }
+}
+
+
+/**
+ * 开启状态
+ * @param {Boolean} type
+ * @param {Object} ins
+ * @param {Object} ownerInstance
+ */
+function openState(type, ins, ownerInstance) {
+ var state = ins.getState()
+ var leftWidth = state.leftWidth
+ var rightWidth = state.rightWidth
+ var left = ''
+ state.isopen = state.isopen ? state.isopen : 'none'
+ switch (type) {
+ case "left":
+ left = leftWidth
+ break
+ case "right":
+ left = -rightWidth
+ break
+ default:
+ left = 0
+ }
+
+ // && !state.throttle
+
+ if (state.isopen !== type) {
+ state.throttle = true
+ ownerInstance.callMethod('change', {
+ open: type
+ })
+
+ }
+
+ state.isopen = type
+ // 添加动画类
+ ins.requestAnimationFrame(function() {
+ ins.addClass('ani');
+ move(left, ins, ownerInstance)
+ })
+ // 设置最终移动位置,理论上只要进入到这个函数,肯定是要打开的
+}
+
+
+function getDirection(x, y) {
+ if (x > y && x > MIN_DISTANCE) {
+ return 'horizontal';
+ }
+ if (y > x && y > MIN_DISTANCE) {
+ return 'vertical';
+ }
+ return '';
+}
+
+/**
+ * 重置滑动状态
+ * @param {Object} event
+ */
+function resetTouchStatus(instance) {
+ var state = instance.getState();
+ state.direction = '';
+ state.deltaX = 0;
+ state.deltaY = 0;
+ state.offsetX = 0;
+ state.offsetY = 0;
+}
+
+/**
+ * 设置滑动开始位置
+ * @param {Object} event
+ */
+function stopTouchStart(event) {
+ var instance = event.instance;
+ var state = instance.getState();
+ resetTouchStatus(instance);
+ var touch = event.touches[0];
+ if (IS_HTML5 && isPC()) {
+ touch = event;
+ }
+ state.startX = touch.clientX;
+ state.startY = touch.clientY;
+}
+
+/**
+ * 滑动中,是否禁止打开
+ * @param {Object} event
+ */
+function stopTouchMove(event) {
+ var instance = event.instance;
+ var state = instance.getState();
+ var touch = event.touches[0];
+ if (IS_HTML5 && isPC()) {
+ touch = event;
+ }
+ state.deltaX = touch.clientX - state.startX;
+ state.deltaY = touch.clientY - state.startY;
+ state.offsetY = Math.abs(state.deltaY);
+ state.offsetX = Math.abs(state.deltaX);
+ state.direction = state.direction || getDirection(state.offsetX, state.offsetY);
+}
+
+function isPC() {
+ var userAgentInfo = navigator.userAgent;
+ var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
+ var flag = true;
+ for (var v = 0; v < Agents.length - 1; v++) {
+ if (userAgentInfo.indexOf(Agents[v]) > 0) {
+ flag = false;
+ break;
+ }
+ }
+ return flag;
+}
+
+var movable = false
+
+function mousedown(e, ins) {
+ if (!IS_HTML5) return
+ if (!isPC()) return
+ touchstart(e, ins)
+ movable = true
+}
+
+function mousemove(e, ins) {
+ if (!IS_HTML5) return
+ if (!isPC()) return
+ if (!movable) return
+ touchmove(e, ins)
+}
+
+function mouseup(e, ins) {
+ if (!IS_HTML5) return
+ if (!isPC()) return
+ touchend(e, ins)
+ movable = false
+}
+
+function mouseleave(e, ins) {
+ if (!IS_HTML5) return
+ if (!isPC()) return
+ movable = false
+}
+
+module.exports = {
+ showWatch: showWatch,
+ touchstart: touchstart,
+ touchmove: touchmove,
+ touchend: touchend,
+ mousedown: mousedown,
+ mousemove: mousemove,
+ mouseup: mouseup,
+ mouseleave: mouseleave
+}
diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue b/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue
index 49717824c22092e91c576f953e5f1b5e1e3ab391..87e5572038e6cf8871d6286a3dad143a82c24add 100644
--- a/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue
+++ b/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue
@@ -1,32 +1,32 @@
-
-
-
-
-
-
-
-
+ },
+ closeOther(vm) {
+ if (this.openItem && this.openItem !== vm) {
+ // #ifdef APP-VUE || H5 || MP-WEIXIN
+ this.openItem.is_show = 'none'
+ // #endif
+
+ // #ifndef APP-VUE || H5 || MP-WEIXIN
+ this.openItem.close()
+ // #endif
+ }
+ // 记录上一个打开的 swipe-action-item ,用于 auto-close
+ this.openItem = vm
+ }
+ }
+ };
+
+
diff --git a/uni_modules/uni-swipe-action/package.json b/uni_modules/uni-swipe-action/package.json
index 88fa537a3b1843a89fef70e06962560fd76811f2..a69be520599bf9abbf7c9ee132aee92776ca64ce 100644
--- a/uni_modules/uni-swipe-action/package.json
+++ b/uni_modules/uni-swipe-action/package.json
@@ -1,87 +1,87 @@
-{
- "id": "uni-swipe-action",
- "displayName": "uni-swipe-action 滑动操作",
- "version": "1.2.4",
- "description": "SwipeAction 滑动操作操作组件",
- "keywords": [
- "",
- "uni-ui",
- "uniui",
- "滑动删除",
- "侧滑删除"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "y",
- "联盟": "u"
- },
- "Vue": {
- "vue2": "y",
- "vue3": "u"
- }
- }
- }
- }
+{
+ "id": "uni-swipe-action",
+ "displayName": "uni-swipe-action 滑动操作",
+ "version": "1.2.4",
+ "description": "SwipeAction 滑动操作操作组件",
+ "keywords": [
+ "",
+ "uni-ui",
+ "uniui",
+ "滑动删除",
+ "侧滑删除"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "y",
+ "联盟": "u"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-swiper-dot/changelog.md b/uni_modules/uni-swiper-dot/changelog.md
index f1356a9ddd9378f099c343b8c4a45bfbeb10df06..dd6e4449a616ba85f3606991e1fcc47dd9a4aac6 100644
--- a/uni_modules/uni-swiper-dot/changelog.md
+++ b/uni_modules/uni-swiper-dot/changelog.md
@@ -1,9 +1,9 @@
## 1.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.0.6(2021-05-12)
-- 新增 示例地址
-- 修复 示例项目缺少组件的Bug
-## 1.0.5(2021-02-05)
-- 调整为uni_modules目录规范
-- 新增 clickItem 事件,支持指示点控制轮播
-- 新增 支持 pc 可用
+## 1.0.6(2021-05-12)
+- 新增 示例地址
+- 修复 示例项目缺少组件的Bug
+## 1.0.5(2021-02-05)
+- 调整为uni_modules目录规范
+- 新增 clickItem 事件,支持指示点控制轮播
+- 新增 支持 pc 可用
diff --git a/uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.vue b/uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.vue
index dd247d3e9457232e36e87943c2bc111360ce834d..79c0816fc46db201e8253016db77a25f25ba04d3 100644
--- a/uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.vue
+++ b/uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.vue
@@ -1,32 +1,32 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ (current+1)+"/"+info.length +' ' +info[current][field] }}
-
-
- {{ index+1 }}
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (current+1)+"/"+info.length +' ' +info[current][field] }}
+
+
+ {{ index+1 }}
+
+
+
+
-
-
diff --git a/uni_modules/uni-swiper-dot/package.json b/uni_modules/uni-swiper-dot/package.json
index 7562ce5d14195d6f83a1cdb40eccd8a426e2db13..31393d778ce2e3ca2c4db5f4d08f257964d07dc4 100644
--- a/uni_modules/uni-swiper-dot/package.json
+++ b/uni_modules/uni-swiper-dot/package.json
@@ -1,83 +1,83 @@
-{
- "id": "uni-swiper-dot",
- "displayName": "uni-swiper-dot 轮播图指示点",
- "version": "1.1.0",
- "description": "自定义轮播图指示点组件",
- "keywords": [
- "uni-ui",
- "uniui",
- "轮播图指示点",
- "dot",
- "swiper"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-swiper-dot",
+ "displayName": "uni-swiper-dot 轮播图指示点",
+ "version": "1.1.0",
+ "description": "自定义轮播图指示点组件",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "轮播图指示点",
+ "dot",
+ "swiper"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-table/changelog.md b/uni_modules/uni-table/changelog.md
index 4ade98fda971128cef27adc263a6d2c325563a56..d8743f25565da79362ba0fc9342c80e176f760f6 100644
--- a/uni_modules/uni-table/changelog.md
+++ b/uni_modules/uni-table/changelog.md
@@ -1,18 +1,18 @@
## 1.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.0.7(2021-07-08)
-- 新增 uni-th 支持 date 日期筛选范围
-## 1.0.6(2021-07-05)
-- 新增 uni-th 支持 range 筛选范围
-## 1.0.5(2021-06-28)
-- 新增 uni-th 筛选功能
-## 1.0.4(2021-05-12)
-- 新增 示例地址
-- 修复 示例项目缺少组件的Bug
-## 1.0.3(2021-04-16)
-- 新增 sortable 属性,是否开启单列排序
-- 优化 表格多选逻辑
-## 1.0.2(2021-03-22)
-- uni-tr 添加 disabled 属性,用于 type=selection 时,设置某行是否可由全选按钮控制
-## 1.0.1(2021-02-05)
-- 调整为uni_modules目录规范
+## 1.0.7(2021-07-08)
+- 新增 uni-th 支持 date 日期筛选范围
+## 1.0.6(2021-07-05)
+- 新增 uni-th 支持 range 筛选范围
+## 1.0.5(2021-06-28)
+- 新增 uni-th 筛选功能
+## 1.0.4(2021-05-12)
+- 新增 示例地址
+- 修复 示例项目缺少组件的Bug
+## 1.0.3(2021-04-16)
+- 新增 sortable 属性,是否开启单列排序
+- 优化 表格多选逻辑
+## 1.0.2(2021-03-22)
+- uni-tr 添加 disabled 属性,用于 type=selection 时,设置某行是否可由全选按钮控制
+## 1.0.1(2021-02-05)
+- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-table/components/uni-table/uni-table.vue b/uni_modules/uni-table/components/uni-table/uni-table.vue
index 91b74fa7870a069e1692451996aa1a7e9196f65c..d8d49db1fdb950ce54debe17ff7af4e15283ce60 100644
--- a/uni_modules/uni-table/components/uni-table/uni-table.vue
+++ b/uni_modules/uni-table/components/uni-table/uni-table.vue
@@ -1,89 +1,89 @@
-
-
-
-
-
-
- {{ emptyText }}
-
-
-
-
-
-
-
-
- {{ emptyText }}
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-table/components/uni-tbody/uni-tbody.vue b/uni_modules/uni-table/components/uni-tbody/uni-tbody.vue
index fbe1bdcb1e53aeaee5f2303362e26fe742232132..1d808b3bd53541f205f9df6da60b3d9fb0d0c8a4 100644
--- a/uni_modules/uni-table/components/uni-tbody/uni-tbody.vue
+++ b/uni_modules/uni-table/components/uni-tbody/uni-tbody.vue
@@ -1,29 +1,29 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-table/components/uni-td/uni-td.vue b/uni_modules/uni-table/components/uni-td/uni-td.vue
index 9ce93e9363b7fa69a6b22d81a34de92ceb7d462f..e0d743be7fccf28b187f6d98777c7b8ca76a0819 100644
--- a/uni_modules/uni-table/components/uni-td/uni-td.vue
+++ b/uni_modules/uni-table/components/uni-td/uni-td.vue
@@ -9,30 +9,30 @@
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-table/components/uni-th/filter-dropdown.vue b/uni_modules/uni-table/components/uni-th/filter-dropdown.vue
index fe8cd96cb440524f866be6347f3540b0125aa3ad..0045f965e444412dc7b80809efa332c05da6b157 100644
--- a/uni_modules/uni-table/components/uni-th/filter-dropdown.vue
+++ b/uni_modules/uni-table/components/uni-th/filter-dropdown.vue
@@ -1,503 +1,503 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-table/components/uni-th/uni-th.vue b/uni_modules/uni-table/components/uni-th/uni-th.vue
index 9430fba9afb31f33caf6060823273cb139e83ed4..d87f1e821ae34e945ec7e2064959cfae3f60613a 100644
--- a/uni_modules/uni-table/components/uni-th/uni-th.vue
+++ b/uni_modules/uni-table/components/uni-th/uni-th.vue
@@ -1,189 +1,189 @@
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
- |
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
diff --git a/uni_modules/uni-table/components/uni-thead/uni-thead.vue b/uni_modules/uni-table/components/uni-thead/uni-thead.vue
index 0dd18cd8ce68d943ca84c65025cb25cad5a787dd..a12078aa3d0b666805ca837de82a4bb0b530d216 100644
--- a/uni_modules/uni-table/components/uni-thead/uni-thead.vue
+++ b/uni_modules/uni-table/components/uni-thead/uni-thead.vue
@@ -1,129 +1,129 @@
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-table/components/uni-tr/table-checkbox.vue b/uni_modules/uni-table/components/uni-tr/table-checkbox.vue
index 158f3ffd04e426934eb22ad567f8de995bb0ea1a..7c315603f8c5d267fe4eda4cfcda5494bb0828a4 100644
--- a/uni_modules/uni-table/components/uni-tr/table-checkbox.vue
+++ b/uni_modules/uni-table/components/uni-tr/table-checkbox.vue
@@ -1,41 +1,41 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-table/components/uni-tr/uni-tr.vue b/uni_modules/uni-table/components/uni-tr/uni-tr.vue
index 54b67762a16605a03185222e43e9c5042ff85db6..3eb62e110f1431c2aa1cfdf8c3ffb1710781f578 100644
--- a/uni_modules/uni-table/components/uni-tr/uni-tr.vue
+++ b/uni_modules/uni-table/components/uni-tr/uni-tr.vue
@@ -1,162 +1,162 @@
-
-
-
-
-
- |
+
+
+
+
+
+ |
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-table/package.json b/uni_modules/uni-table/package.json
index 7dd56daf621c225dd561ca1bec0d61c941dd820d..ad55cc3c9dd742af16c10b1edb234fb3780f6d48 100644
--- a/uni_modules/uni-table/package.json
+++ b/uni_modules/uni-table/package.json
@@ -1,82 +1,82 @@
-{
- "id": "uni-table",
- "displayName": "uni-table 表格",
- "version": "1.1.0",
- "description": "表格组件,多用于展示多条结构类似的数据,如",
- "keywords": [
- "uni-ui",
- "uniui",
- "table",
- "表格"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": ["uni-datetime-picker"],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "n"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "n",
- "QQ": "y"
- },
- "快应用": {
- "华为": "n",
- "联盟": "n"
- }
- }
- }
- }
+{
+ "id": "uni-table",
+ "displayName": "uni-table 表格",
+ "version": "1.1.0",
+ "description": "表格组件,多用于展示多条结构类似的数据,如",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "table",
+ "表格"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": ["uni-datetime-picker"],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "n"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "n",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "n",
+ "联盟": "n"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-tag/components/uni-tag/uni-tag.vue b/uni_modules/uni-tag/components/uni-tag/uni-tag.vue
index de1d1a7195287c7ba4fd74bcba1b452b8753d742..917492417183f5d353e870a33cbb3ac45c82d6f4 100644
--- a/uni_modules/uni-tag/components/uni-tag/uni-tag.vue
+++ b/uni_modules/uni-tag/components/uni-tag/uni-tag.vue
@@ -1,279 +1,279 @@
-
- {{text}}
-
-
-
-
-
diff --git a/uni_modules/uni-title/changelog.md b/uni_modules/uni-title/changelog.md
index beb70bb0d04a1caa066611d3be123ddd5de98357..588ea1a74dec884d1dd6a000ba5038ab5292d80b 100644
--- a/uni_modules/uni-title/changelog.md
+++ b/uni_modules/uni-title/changelog.md
@@ -1,5 +1,5 @@
## 1.0.2(2021-05-12)
- 新增 示例地址
- 修复 示例项目缺少组件的Bug
-## 1.0.1(2021-02-05)
-- 调整为uni_modules目录规范
+## 1.0.1(2021-02-05)
+- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-title/components/uni-title/uni-title.vue b/uni_modules/uni-title/components/uni-title/uni-title.vue
index 64d9c83b31753e4ad87cf2e037ad52f26c63a769..f428f037b05e72fe8eb7cabbefdc418126431653 100644
--- a/uni_modules/uni-title/components/uni-title/uni-title.vue
+++ b/uni_modules/uni-title/components/uni-title/uni-title.vue
@@ -1,9 +1,9 @@
-
-
- {{title}}
-
-
-
+
+
+ {{title}}
+
+
+
-
-
diff --git a/uni_modules/uni-title/package.json b/uni_modules/uni-title/package.json
index 3391b6845a4b7062cda470f22269f64bcf51e7ec..fa2ddd432680f36ad9f434154cbb4056212255aa 100644
--- a/uni_modules/uni-title/package.json
+++ b/uni_modules/uni-title/package.json
@@ -1,84 +1,84 @@
-{
- "id": "uni-title",
- "displayName": "uni-title 章节标题",
- "version": "1.0.2",
- "description": "章节标题,通常用于记录页面标题,使用当前组件,uni-app 如果开启统计,将会自动统计页面标题",
- "keywords": [
- "uni-ui",
- "uniui",
- "标题",
- "章节",
- "章节标题",
- ""
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-title",
+ "displayName": "uni-title 章节标题",
+ "version": "1.0.2",
+ "description": "章节标题,通常用于记录页面标题,使用当前组件,uni-app 如果开启统计,将会自动统计页面标题",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "标题",
+ "章节",
+ "章节标题",
+ ""
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-transition/changelog.md b/uni_modules/uni-transition/changelog.md
index dca8178cdc476f8d38c9a7df8d10c3a060c36fd4..2c33b5e22ab0e7c8a737b9147825102d49bf8195 100644
--- a/uni_modules/uni-transition/changelog.md
+++ b/uni_modules/uni-transition/changelog.md
@@ -1,13 +1,13 @@
## 1.2.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.1.1(2021-05-12)
-- 新增 示例地址
-- 修复 示例项目缺少组件的Bug
-## 1.1.0(2021-04-22)
-- 新增 通过方法自定义动画
-- 新增 custom-class 非 NVUE 平台支持自定义 class 定制样式
-- 优化 动画触发逻辑,使动画更流畅
-- 优化 支持单独的动画类型
-- 优化 文档示例
-## 1.0.2(2021-02-05)
-- 调整为uni_modules目录规范
+## 1.1.1(2021-05-12)
+- 新增 示例地址
+- 修复 示例项目缺少组件的Bug
+## 1.1.0(2021-04-22)
+- 新增 通过方法自定义动画
+- 新增 custom-class 非 NVUE 平台支持自定义 class 定制样式
+- 优化 动画触发逻辑,使动画更流畅
+- 优化 支持单独的动画类型
+- 优化 文档示例
+## 1.0.2(2021-02-05)
+- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-transition/components/uni-transition/createAnimation.js b/uni_modules/uni-transition/components/uni-transition/createAnimation.js
index 5f54365e6e2c3de0df680ea7ca0c4453ccbaee40..af47dbca2bc690876e054fd2cbc3c888f810706e 100644
--- a/uni_modules/uni-transition/components/uni-transition/createAnimation.js
+++ b/uni_modules/uni-transition/components/uni-transition/createAnimation.js
@@ -1,128 +1,128 @@
-// const defaultOption = {
-// duration: 300,
-// timingFunction: 'linear',
-// delay: 0,
-// transformOrigin: '50% 50% 0'
-// }
-// #ifdef APP-NVUE
-const nvueAnimation = uni.requireNativePlugin('animation')
-// #endif
-class MPAnimation {
- constructor(options, _this) {
- this.options = options
- this.animation = uni.createAnimation(options)
- this.currentStepAnimates = {}
- this.next = 0
- this.$ = _this
-
- }
-
- _nvuePushAnimates(type, args) {
- let aniObj = this.currentStepAnimates[this.next]
- let styles = {}
- if (!aniObj) {
- styles = {
- styles: {},
- config: {}
- }
- } else {
- styles = aniObj
- }
- if (animateTypes1.includes(type)) {
- if (!styles.styles.transform) {
- styles.styles.transform = ''
+// const defaultOption = {
+// duration: 300,
+// timingFunction: 'linear',
+// delay: 0,
+// transformOrigin: '50% 50% 0'
+// }
+// #ifdef APP-NVUE
+const nvueAnimation = uni.requireNativePlugin('animation')
+// #endif
+class MPAnimation {
+ constructor(options, _this) {
+ this.options = options
+ this.animation = uni.createAnimation(options)
+ this.currentStepAnimates = {}
+ this.next = 0
+ this.$ = _this
+
+ }
+
+ _nvuePushAnimates(type, args) {
+ let aniObj = this.currentStepAnimates[this.next]
+ let styles = {}
+ if (!aniObj) {
+ styles = {
+ styles: {},
+ config: {}
+ }
+ } else {
+ styles = aniObj
+ }
+ if (animateTypes1.includes(type)) {
+ if (!styles.styles.transform) {
+ styles.styles.transform = ''
}
let unit = ''
if(type === 'rotate'){
unit = 'deg'
- }
- styles.styles.transform += `${type}(${args+unit}) `
- } else {
- styles.styles[type] = `${args}`
- }
- this.currentStepAnimates[this.next] = styles
- }
- _animateRun(styles = {}, config = {}) {
- let ref = this.$.$refs['ani'].ref
- if (!ref) return
+ }
+ styles.styles.transform += `${type}(${args+unit}) `
+ } else {
+ styles.styles[type] = `${args}`
+ }
+ this.currentStepAnimates[this.next] = styles
+ }
+ _animateRun(styles = {}, config = {}) {
+ let ref = this.$.$refs['ani'].ref
+ if (!ref) return
return new Promise((resolve, reject) => {
- nvueAnimation.transition(ref, {
- styles,
- ...config
- }, res => {
- resolve()
- })
- })
- }
-
- _nvueNextAnimate(animates, step = 0, fn) {
- let obj = animates[step]
- if (obj) {
- let {
- styles,
- config
- } = obj
- this._animateRun(styles, config).then(() => {
- step += 1
- this._nvueNextAnimate(animates, step, fn)
- })
- } else {
- this.currentStepAnimates = {}
- typeof fn === 'function' && fn()
- this.isEnd = true
- }
- }
-
+ nvueAnimation.transition(ref, {
+ styles,
+ ...config
+ }, res => {
+ resolve()
+ })
+ })
+ }
+
+ _nvueNextAnimate(animates, step = 0, fn) {
+ let obj = animates[step]
+ if (obj) {
+ let {
+ styles,
+ config
+ } = obj
+ this._animateRun(styles, config).then(() => {
+ step += 1
+ this._nvueNextAnimate(animates, step, fn)
+ })
+ } else {
+ this.currentStepAnimates = {}
+ typeof fn === 'function' && fn()
+ this.isEnd = true
+ }
+ }
+
step(config = {}) {
// #ifndef APP-NVUE
- this.animation.step(config)
- // #endif
- // #ifdef APP-NVUE
+ this.animation.step(config)
+ // #endif
+ // #ifdef APP-NVUE
this.currentStepAnimates[this.next].config = Object.assign({}, this.options, config)
this.currentStepAnimates[this.next].styles.transformOrigin = this.currentStepAnimates[this.next].config.transformOrigin
- this.next++
- // #endif
- return this
- }
-
- run(fn) {
+ this.next++
+ // #endif
+ return this
+ }
+
+ run(fn) {
// #ifndef APP-NVUE
- this.$.animationData = this.animation.export()
+ this.$.animationData = this.animation.export()
this.$.timer = setTimeout(() => {
- typeof fn === 'function' && fn()
- }, this.$.durationTime)
- // #endif
- // #ifdef APP-NVUE
+ typeof fn === 'function' && fn()
+ }, this.$.durationTime)
+ // #endif
+ // #ifdef APP-NVUE
this.isEnd = false
let ref = this.$.$refs['ani'] && this.$.$refs['ani'].ref
- if(!ref) return
- this._nvueNextAnimate(this.currentStepAnimates, 0, fn)
- this.next = 0
- // #endif
- }
-}
-
-
-const animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d',
- 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY',
- 'translateZ'
-]
-const animateTypes2 = ['opacity', 'backgroundColor']
-const animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom']
-animateTypes1.concat(animateTypes2, animateTypes3).forEach(type => {
- MPAnimation.prototype[type] = function(...args) {
+ if(!ref) return
+ this._nvueNextAnimate(this.currentStepAnimates, 0, fn)
+ this.next = 0
+ // #endif
+ }
+}
+
+
+const animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d',
+ 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY',
+ 'translateZ'
+]
+const animateTypes2 = ['opacity', 'backgroundColor']
+const animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom']
+animateTypes1.concat(animateTypes2, animateTypes3).forEach(type => {
+ MPAnimation.prototype[type] = function(...args) {
// #ifndef APP-NVUE
this.animation[type](...args)
- // #endif
- // #ifdef APP-NVUE
- this._nvuePushAnimates(type, args)
- // #endif
- return this
- }
-})
-
+ // #endif
+ // #ifdef APP-NVUE
+ this._nvuePushAnimates(type, args)
+ // #endif
+ return this
+ }
+})
+
export function createAnimation(option, _this) {
- if(!_this) return
- clearTimeout(_this.timer)
- return new MPAnimation(option, _this)
+ if(!_this) return
+ clearTimeout(_this.timer)
+ return new MPAnimation(option, _this)
}
diff --git a/uni_modules/uni-transition/components/uni-transition/uni-transition.vue b/uni_modules/uni-transition/components/uni-transition/uni-transition.vue
index 69ff9d98ef2a1595c008a276b6ad6a7d1ff2efd9..5a16f89a68dd48f9be8c06534b35a0b4970c2c26 100644
--- a/uni_modules/uni-transition/components/uni-transition/uni-transition.vue
+++ b/uni_modules/uni-transition/components/uni-transition/uni-transition.vue
@@ -1,277 +1,277 @@
-
-
-
-
-
-
+ return this
+ },
+ /**
+ * ref 触发 执行动画
+ */
+ run(fn) {
+ if (!this.animation) return
+ this.animation.run(fn)
+ },
+ // 开始过度动画
+ open() {
+ clearTimeout(this.timer)
+ this.transform = ''
+ this.isShow = true
+ let { opacity, transform } = this.styleInit(false)
+ if (typeof opacity !== 'undefined') {
+ this.opacity = opacity
+ }
+ this.transform = transform
+ // 确保动态样式已经生效后,执行动画,如果不加 nextTick ,会导致 wx 动画执行异常
+ this.$nextTick(() => {
+ // TODO 定时器保证动画完全执行,目前有些问题,后面会取消定时器
+ this.timer = setTimeout(() => {
+ this.animation = createAnimation(this.config, this)
+ this.tranfromInit(false).step()
+ this.animation.run()
+ this.$emit('change', {
+ detail: this.isShow
+ })
+ }, 20)
+ })
+ },
+ // 关闭过度动画
+ close(type) {
+ if (!this.animation) return
+ this.tranfromInit(true)
+ .step()
+ .run(() => {
+ this.isShow = false
+ this.animationData = null
+ this.animation = null
+ let { opacity, transform } = this.styleInit(false)
+ this.opacity = opacity || 1
+ this.transform = transform
+ this.$emit('change', {
+ detail: this.isShow
+ })
+ })
+ },
+ // 处理动画开始前的默认样式
+ styleInit(type) {
+ let styles = {
+ transform: ''
+ }
+ let buildStyle = (type, mode) => {
+ if (mode === 'fade') {
+ styles.opacity = this.animationType(type)[mode]
+ } else {
+ styles.transform += this.animationType(type)[mode] + ' '
+ }
+ }
+ if (typeof this.modeClass === 'string') {
+ buildStyle(type, this.modeClass)
+ } else {
+ this.modeClass.forEach(mode => {
+ buildStyle(type, mode)
+ })
+ }
+ return styles
+ },
+ // 处理内置组合动画
+ tranfromInit(type) {
+ let buildTranfrom = (type, mode) => {
+ let aniNum = null
+ if (mode === 'fade') {
+ aniNum = type ? 0 : 1
+ } else {
+ aniNum = type ? '-100%' : '0'
+ if (mode === 'zoom-in') {
+ aniNum = type ? 0.8 : 1
+ }
+ if (mode === 'zoom-out') {
+ aniNum = type ? 1.2 : 1
+ }
+ if (mode === 'slide-right') {
+ aniNum = type ? '100%' : '0'
+ }
+ if (mode === 'slide-bottom') {
+ aniNum = type ? '100%' : '0'
+ }
+ }
+ this.animation[this.animationMode()[mode]](aniNum)
+ }
+ if (typeof this.modeClass === 'string') {
+ buildTranfrom(type, this.modeClass)
+ } else {
+ this.modeClass.forEach(mode => {
+ buildTranfrom(type, mode)
+ })
+ }
+
+ return this.animation
+ },
+ animationType(type) {
+ return {
+ fade: type ? 1 : 0,
+ 'slide-top': `translateY(${type ? '0' : '-100%'})`,
+ 'slide-right': `translateX(${type ? '0' : '100%'})`,
+ 'slide-bottom': `translateY(${type ? '0' : '100%'})`,
+ 'slide-left': `translateX(${type ? '0' : '-100%'})`,
+ 'zoom-in': `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`,
+ 'zoom-out': `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})`
+ }
+ },
+ // 内置动画类型与实际动画对应字典
+ animationMode() {
+ return {
+ fade: 'opacity',
+ 'slide-top': 'translateY',
+ 'slide-right': 'translateX',
+ 'slide-bottom': 'translateY',
+ 'slide-left': 'translateX',
+ 'zoom-in': 'scale',
+ 'zoom-out': 'scale'
+ }
+ },
+ // 驼峰转中横线
+ toLine(name) {
+ return name.replace(/([A-Z])/g, '-$1').toLowerCase()
+ }
+ }
+}
+
+
diff --git a/uni_modules/uni-transition/package.json b/uni_modules/uni-transition/package.json
index 0a709c9a44538356a436885f772bfc5671863196..481270d9065c0304851b9861f3e46fc8d522b1b7 100644
--- a/uni_modules/uni-transition/package.json
+++ b/uni_modules/uni-transition/package.json
@@ -1,83 +1,83 @@
-{
- "id": "uni-transition",
- "displayName": "uni-transition 过渡动画",
- "version": "1.2.0",
- "description": "元素的简单过渡动画",
- "keywords": [
- "uni-ui",
- "uniui",
- "动画",
- "过渡",
- "过渡动画"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-transition",
+ "displayName": "uni-transition 过渡动画",
+ "version": "1.2.0",
+ "description": "元素的简单过渡动画",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "动画",
+ "过渡",
+ "过渡动画"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-ui/changelog.md b/uni_modules/uni-ui/changelog.md
index 48342259c4b14c994d47a237adf56c9a22d9d327..4e47272267a95e4a4b60aa67b6eceae839665c2c 100644
--- a/uni_modules/uni-ui/changelog.md
+++ b/uni_modules/uni-ui/changelog.md
@@ -209,21 +209,21 @@
- uni-data-picker 修复 本地数据概率无法回显时问题
- uni-table 新增 sortable 属性,是否开启单列排序
- uni-table 优化 表格多选逻辑
-## 1.2.12(2021-03-23)
-- uni-ui 新增 uni-datetime-picker 的 hide-second 属性、border 属性;
-- uni-ui 修复 uni-datetime-picker 选择跟显示的日期不一样的 bug,
-- uni-ui 修复 uni-datetime-picker change事件触发2次的 bug
-- uni-ui 修复 uni-datetime-picker 分、秒 end 范围错误的 bug
-- uni-ui 新增 uni-tr selectable 属性,用于 type=selection 时,设置某行是否可由全选按钮控制
-- uni-ui 新增 uni-data-checkbox 新增 disabled属性,支持nvue
-- uni-ui 优化 uni-data-checkbox 无选项时提示“暂无数据”
-- uni-ui 优化 uni-data-checkbox 默认颜色显示
-- uni-ui 新增 uni-link href 属性支持 tel:|mailto:
-- uni-ui 新增 uni-table 示例demo
-- uni-ui 修复 uni-data-picker 微信小程序某些情况下无法选择的问题,事件无法触发的问题
-- uni-ui 修复 uni-nav-bar easycom 下,找不到 uni-status-bar 的bug
-- uni-ui 修复 uni-easyinput 示例在 qq 小程序上的bug
-- uni-ui 修复 uni-forms 动态显示uni-forms-item的情况下,submit 方法获取值错误的Bug
+## 1.2.12(2021-03-23)
+- uni-ui 新增 uni-datetime-picker 的 hide-second 属性、border 属性;
+- uni-ui 修复 uni-datetime-picker 选择跟显示的日期不一样的 bug,
+- uni-ui 修复 uni-datetime-picker change事件触发2次的 bug
+- uni-ui 修复 uni-datetime-picker 分、秒 end 范围错误的 bug
+- uni-ui 新增 uni-tr selectable 属性,用于 type=selection 时,设置某行是否可由全选按钮控制
+- uni-ui 新增 uni-data-checkbox 新增 disabled属性,支持nvue
+- uni-ui 优化 uni-data-checkbox 无选项时提示“暂无数据”
+- uni-ui 优化 uni-data-checkbox 默认颜色显示
+- uni-ui 新增 uni-link href 属性支持 tel:|mailto:
+- uni-ui 新增 uni-table 示例demo
+- uni-ui 修复 uni-data-picker 微信小程序某些情况下无法选择的问题,事件无法触发的问题
+- uni-ui 修复 uni-nav-bar easycom 下,找不到 uni-status-bar 的bug
+- uni-ui 修复 uni-easyinput 示例在 qq 小程序上的bug
+- uni-ui 修复 uni-forms 动态显示uni-forms-item的情况下,submit 方法获取值错误的Bug
- uni-ui 调整 cli 项目 建议使用 easycom 方式引用组件,如使用按需引用,需手动维护组件内部引用
## 1.2.11(2021-02-24)
diff --git a/uni_modules/uni-upgrade-center-app/changelog.md b/uni_modules/uni-upgrade-center-app/changelog.md
index 7d0251cdce072b0392cf6307c2500bc7462b3c45..fff3c115c159dd941f9a58044ce8e130f5c44afc 100644
--- a/uni_modules/uni-upgrade-center-app/changelog.md
+++ b/uni_modules/uni-upgrade-center-app/changelog.md
@@ -11,35 +11,35 @@
- 修改 移除static中的图片
## 0.1.6(2021-06-03)
- 修改 下载更新按钮使用CSS渐变色
-## 0.1.5(2021-04-22)
-- 更新check-update函数。现在返回一个Promise,有更新时成功回调,其他情况错误回调
-## 0.1.4(2021-04-13)
-- 更新文档。明确云函数调用结果
-## 0.1.3(2021-04-13)
-- 解耦云函数与弹框处理。utils中新增 call-check-version.js,可用于单独检测是否有更新
-## 0.1.2(2021-04-07)
-- 更新版本对比函数 compare
-## 0.1.1(2021-04-07)
-- 修复 腾讯云空间下载链接不能下载问题
-## 0.1.0(2021-04-07)
-- 新增使用uni.showModal提示升级示例
-- 修改iOS升级提示方式
-## 0.0.7(2021-04-02)
-- 修复在iOS上打开弹框报错
-## 0.0.6(2021-04-01)
-- 兼容旧版本安卓
-## 0.0.5(2021-04-01)
-- 修复低版本安卓上进度条错位
-## 0.0.4(2021-04-01)
-- 更新readme
-- 修复check-update语法错误
-## 0.0.3(2021-04-01)
-- 新增前台更新弹框,详见readme
-- 更新前台检查更新方法
-
-## 0.0.2(2021-03-29)
-- 更新文档
-- 移除 dependencies
-
-## 0.0.1(2021-03-25)
-- 升级中心前台检查更新
+## 0.1.5(2021-04-22)
+- 更新check-update函数。现在返回一个Promise,有更新时成功回调,其他情况错误回调
+## 0.1.4(2021-04-13)
+- 更新文档。明确云函数调用结果
+## 0.1.3(2021-04-13)
+- 解耦云函数与弹框处理。utils中新增 call-check-version.js,可用于单独检测是否有更新
+## 0.1.2(2021-04-07)
+- 更新版本对比函数 compare
+## 0.1.1(2021-04-07)
+- 修复 腾讯云空间下载链接不能下载问题
+## 0.1.0(2021-04-07)
+- 新增使用uni.showModal提示升级示例
+- 修改iOS升级提示方式
+## 0.0.7(2021-04-02)
+- 修复在iOS上打开弹框报错
+## 0.0.6(2021-04-01)
+- 兼容旧版本安卓
+## 0.0.5(2021-04-01)
+- 修复低版本安卓上进度条错位
+## 0.0.4(2021-04-01)
+- 更新readme
+- 修复check-update语法错误
+## 0.0.3(2021-04-01)
+- 新增前台更新弹框,详见readme
+- 更新前台检查更新方法
+
+## 0.0.2(2021-03-29)
+- 更新文档
+- 移除 dependencies
+
+## 0.0.1(2021-03-25)
+- 升级中心前台检查更新
diff --git a/uni_modules/uni-upgrade-center-app/package.json b/uni_modules/uni-upgrade-center-app/package.json
index 5b18234b0485a2ce115035c56d835627c875553d..e6b8bff8064290dfbd5df9c7da61fb40694767e1 100644
--- a/uni_modules/uni-upgrade-center-app/package.json
+++ b/uni_modules/uni-upgrade-center-app/package.json
@@ -1,80 +1,80 @@
-{
- "id": "uni-upgrade-center-app",
- "displayName": "升级中心 uni-upgrade-center - App",
- "version": "0.2.1",
- "description": "升级中心前台检查更新",
- "keywords": [
- "uniCloud",
- "admin",
- "update",
- "升级",
- "wgt"
-],
- "repository": "https://gitee.com/dcloud/uni-upgrade-center/tree/master/uni_modules/uni-upgrade-center-app",
- "engines": {
- "HBuilderX": "^3.1.0"
- },
- "dcloudext": {
- "category": [
- "uniCloud",
- "云端一体页面模板"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "插件不采集任何数据",
- "permissions": "无"
- },
- "npmurl": ""
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "u",
- "app-nvue": "u"
- },
- "H5-mobile": {
- "Safari": "u",
- "Android Browser": "u",
- "微信浏览器(Android)": "u",
- "QQ浏览器(Android)": "u"
- },
- "H5-pc": {
- "Chrome": "u",
- "IE": "u",
- "Edge": "u",
- "Firefox": "u",
- "Safari": "u"
- },
- "小程序": {
- "微信": "u",
- "阿里": "u",
- "百度": "u",
- "字节跳动": "u",
- "QQ": "u"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
-}
+{
+ "id": "uni-upgrade-center-app",
+ "displayName": "升级中心 uni-upgrade-center - App",
+ "version": "0.2.1",
+ "description": "升级中心前台检查更新",
+ "keywords": [
+ "uniCloud",
+ "admin",
+ "update",
+ "升级",
+ "wgt"
+],
+ "repository": "https://gitee.com/dcloud/uni-upgrade-center/tree/master/uni_modules/uni-upgrade-center-app",
+ "engines": {
+ "HBuilderX": "^3.1.0"
+ },
+ "dcloudext": {
+ "category": [
+ "uniCloud",
+ "云端一体页面模板"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "插件不采集任何数据",
+ "permissions": "无"
+ },
+ "npmurl": ""
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "u",
+ "app-nvue": "u"
+ },
+ "H5-mobile": {
+ "Safari": "u",
+ "Android Browser": "u",
+ "微信浏览器(Android)": "u",
+ "QQ浏览器(Android)": "u"
+ },
+ "H5-pc": {
+ "Chrome": "u",
+ "IE": "u",
+ "Edge": "u",
+ "Firefox": "u",
+ "Safari": "u"
+ },
+ "小程序": {
+ "微信": "u",
+ "阿里": "u",
+ "百度": "u",
+ "字节跳动": "u",
+ "QQ": "u"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
+}
diff --git a/uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue b/uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue
index fce803f4fb6be2e00a187bd3f1b89cb69d658b11..21ab39086821e72c9d0f099122131d84029cf215 100644
--- a/uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue
+++ b/uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue
@@ -1,506 +1,506 @@
-
-
-
-
- {{title}}
-
-
-
-
-
-
- {{subTitle}}
-
-
-
-
-
- {{contents}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ }
+ }, async err => {
+ // 如果是安装之前的包,安装失败后删除之前的包
+ if (this.installForBeforeFilePath) {
+ await this.deleteSavedFile(this.installForBeforeFilePath)
+ this.installForBeforeFilePath = '';
+ }
+
+ // 安装失败需要重新下载安装包
+ this.installing = false;
+ this.installed = false;
+
+ uni.showModal({
+ title: `更新失败${this.isWGT ? '' : ',APK文件不存在'},请重新下载`,
+ content: err.message,
+ showCancel: false
+ });
+ });
+
+ // 非wgt包,安装跳出覆盖安装,此处直接返回上一页
+ if (!this.isWGT) {
+ uni.navigateBack()
+ }
+ // #endif
+ },
+ restart() {
+ this.installed = false;
+ // #ifdef APP-PLUS
+ //更新完重启app
+ 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
+ })
+ },
+ deleteSavedFile(filePath) {
+ uni.removeStorageSync(localFilePathKey)
+ return uni.removeSavedFile({
+ filePath
+ })
+ },
+ jumpToAppStore() {
+ plus.runtime.openURL(this.url);
+ }
+ }
+ }
+
+
+
diff --git a/uni_modules/uni-upgrade-center-app/pages_init.json b/uni_modules/uni-upgrade-center-app/pages_init.json
index c12164dc43e5266b15fc52e68b29443786f371d0..7021d998761abeac0f0c115701d7104cd195968f 100644
--- a/uni_modules/uni-upgrade-center-app/pages_init.json
+++ b/uni_modules/uni-upgrade-center-app/pages_init.json
@@ -1,18 +1,18 @@
-{
- "pages": [{
- "path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup",
- "style": {
- "disableScroll": true,
- "app-plus": {
- "backgroundColorTop": "transparent",
- "background": "transparent",
- "titleNView": false,
- "scrollIndicator": false,
- "popGesture": "none",
- "animationType": "fade-in",
- "animationDuration": 200
-
- }
- }
- }]
+{
+ "pages": [{
+ "path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup",
+ "style": {
+ "disableScroll": true,
+ "app-plus": {
+ "backgroundColorTop": "transparent",
+ "background": "transparent",
+ "titleNView": false,
+ "scrollIndicator": false,
+ "popGesture": "none",
+ "animationType": "fade-in",
+ "animationDuration": 200
+
+ }
+ }
+ }]
}
diff --git a/uni_modules/uni-upgrade-center-app/readme.md b/uni_modules/uni-upgrade-center-app/readme.md
index 049083b3b78a5e5b137f4f5b9ba37a5300230593..c39a57301f3b476edd9b8850f837abde034d0037 100644
--- a/uni_modules/uni-upgrade-center-app/readme.md
+++ b/uni_modules/uni-upgrade-center-app/readme.md
@@ -1,119 +1,119 @@
-# uni-upgrade-center - App
-
-### 概述
-
-> 统一管理App及App在`Android`、`iOS`平台上`App安装包`和`wgt资源包`的发布升级
-
-> 本插件为升级中心前台检查更新,后台Admin管理系统请点击查看 [uni-upgrade-center](https://ext.dcloud.net.cn/plugin?id=4470)
-
-### 基于uni-upgrade-center的App前台检查升级插件
- - 一键式检查更新,统一整包与wgt资源包更新
- - 好看、实用、可自定义、可拓展的前台更新弹框
-
-## 安装指引
-
-0. 依赖数据库`opendb-app-versions`,如果没有此库,请在云服务空间中创建。
-
-1. 使用`HBuilderX 3.1.0+`,因为要使用到`uni_modules`
-
-3. 在插件市场打开本插件页面,在右侧点击`使用 HBuilderX 导入插件`,选择要导入的项目点击确定
-
-5. 找到`/uni_modules/uni-upgrade-center-app/uniCloud/cloudfunctions/check-version`,右键上传部署
-
-6. 在`pages.json`中添加页面路径。**注:请不要设置为pages.json中第一项**
-```json
-"pages": [
- // ……其他页面配置
- {
- "path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup",
- "style": {
- "disableScroll": true,
- "app-plus": {
- "backgroundColorTop": "transparent",
- "background": "transparent",
- "titleNView": false,
- "scrollIndicator": false,
- "popGesture": "none",
- "animationType": "fade-in",
- "animationDuration": 200
-
- }
- }
- }
-]
-```
-
-7. 将`@/uni_modules/uni-upgrade-center-app/utils/check-update`import到需要用到的地方,调用一下即可
-
+# uni-upgrade-center - App
+
+### 概述
+
+> 统一管理App及App在`Android`、`iOS`平台上`App安装包`和`wgt资源包`的发布升级
+
+> 本插件为升级中心前台检查更新,后台Admin管理系统请点击查看 [uni-upgrade-center](https://ext.dcloud.net.cn/plugin?id=4470)
+
+### 基于uni-upgrade-center的App前台检查升级插件
+ - 一键式检查更新,统一整包与wgt资源包更新
+ - 好看、实用、可自定义、可拓展的前台更新弹框
+
+## 安装指引
+
+0. 依赖数据库`opendb-app-versions`,如果没有此库,请在云服务空间中创建。
+
+1. 使用`HBuilderX 3.1.0+`,因为要使用到`uni_modules`
+
+3. 在插件市场打开本插件页面,在右侧点击`使用 HBuilderX 导入插件`,选择要导入的项目点击确定
+
+5. 找到`/uni_modules/uni-upgrade-center-app/uniCloud/cloudfunctions/check-version`,右键上传部署
+
+6. 在`pages.json`中添加页面路径。**注:请不要设置为pages.json中第一项**
+```json
+"pages": [
+ // ……其他页面配置
+ {
+ "path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup",
+ "style": {
+ "disableScroll": true,
+ "app-plus": {
+ "backgroundColorTop": "transparent",
+ "background": "transparent",
+ "titleNView": false,
+ "scrollIndicator": false,
+ "popGesture": "none",
+ "animationType": "fade-in",
+ "animationDuration": 200
+
+ }
+ }
+ }
+]
+```
+
+7. 将`@/uni_modules/uni-upgrade-center-app/utils/check-update`import到需要用到的地方,调用一下即可
+
8. 升级弹框可自行编写,也可以使用`uni.showModal`,或使用现有的升级弹框样式,如果不满足UI需求请自行替换资源文件。在`utils/check-update.js`中都有实例。
-9. wgt更新时,打包前请务必将manifest.json中的版本修改为更高版本。
-
-### 更新下载安装`check-update.js`
-
-*该函数在utils目录下*
-
-1. 如果是静默更新,则不会打开更新弹框,会在后台下载后安装,下次启动应用生效
-
-2. 如果是 iOS,则会直接打开AppStore的链接
-
-3. 其他情况,会将`check-version`返回的结果保存在localStorage中,并跳转进入`upgrade-popup.vue`打开更新弹框
-
-### 检查更新函数`check-version`
-
-*该函数在uniCloud/cloudfunctions目录下*
-
-1. 使用检查更新需要传递三个参数 `appid`、`appVersion`、`wgtVersion`
-
-2. `appid` 使用 plus.runtime.appid 获取,*注:真机运行时为固定值HBuilder,在调试的时候请使用本地调试云函数*
-
-3. `appVersion` 使用 plus.runtime.version 获取
-
-4. `wgtVersion` 使用 plus.runtime.getProperty(plus.runtime.appid,(wgtInfo) => { wgtInfo.version }) 获取
-
-5. `check-version`云函数内部会自动获取 App 平台
-
-
-**Tips**
-
-1. `check-version`云函数内部有版本对比函数(compare)。
- - 使用多段式版本格式(如:"3.0.0.0.0.1.0.1", "3.0.0.0.0.1")。如果不满足对比规则,请自行修改。
- - 如果修改,请将*pages/upgrade-popup.vue*中*compare*函数一并修改
-
-## 项目代码说明
-
-### 更新弹框
-- `upgrade-popup.vue` - 更新应用:
- - 如果云函数`check-version`返回的参数表明需要更新,则将参数保存在localStorage中,带着键值跳转该页面
- - 进入时会先从localStorage中尝试取出之前存的安装包路径(此包不会是强制安装类型的包)
- - 如果有已经保存的包,则和传进来的 `version` 进行比较,如果相等则安装。大于和小于都不进行安装,因为admin端可能会调整包的版本。不符合更新会将此包删除
- - 如果本地没有包或者包不符合安装条件,则进行下载安装包
- - 点击下载会有进度条、已下载大小和下载包的大小
- - 下载完成会提示安装:
- - 如果是 wgt 包,安装时则会提示 正在安装…… 和 安装完成。安装完成会提示是否重启
- - 如果是 原生安装包,则直接跳出去覆盖安装
- - 下载过程中,如果退出会提示是否取消下载。如果是强制更新,则只会提示正在下载请稍后,此时不可退出
- - 如果是下载完成了没有安装就退出,则会将下载完成的包保存在本地。将包的本地路径和包version保存在localStorage中
-
-### 工具类 utils
-- `call-check-version`
- - 请求云函数`check-version`拿取版本检测结果
-- `check-update`
- - 调用`call-check-version`并根据结果判断是否显示更新弹框
-
-### 云函数
-- `check-version` - 检查应用更新:
- - 根据传参,先检测传参是否完整,appid appVersion wgtVersion 必传
- - 先从数据库取出所有该平台(会从上下文读取平台信息)的所有线上发行更新
- - 再从所有线上发行更新中取出版本最大的一版。如果可以,尽量先检测wgt的线上发行版更新
- - 使用上一步取出的版本包的版本号 和传参 appVersion、wgtVersion 来检测是否有更新。必须同时大于这两项,因为上一次可能是wgt热更新,否则返回暂无更新
- - 如果库中 wgt包 版本大于传参 appVersion,但是不满足 min_uni_version < appVersion,则不会使用wgt更新,会接着判断库中 app包version 是否大于 appVersion
- - 返回结果:
-
- |code|message|
- |:-:|:-:|
- |0|当前版本已经是最新的,不需要更新|
- |101|wgt更新|
- |102|整包更新|
- |-101|暂无更新或检查appid是否填写正确|
+9. wgt更新时,打包前请务必将manifest.json中的版本修改为更高版本。
+
+### 更新下载安装`check-update.js`
+
+*该函数在utils目录下*
+
+1. 如果是静默更新,则不会打开更新弹框,会在后台下载后安装,下次启动应用生效
+
+2. 如果是 iOS,则会直接打开AppStore的链接
+
+3. 其他情况,会将`check-version`返回的结果保存在localStorage中,并跳转进入`upgrade-popup.vue`打开更新弹框
+
+### 检查更新函数`check-version`
+
+*该函数在uniCloud/cloudfunctions目录下*
+
+1. 使用检查更新需要传递三个参数 `appid`、`appVersion`、`wgtVersion`
+
+2. `appid` 使用 plus.runtime.appid 获取,*注:真机运行时为固定值HBuilder,在调试的时候请使用本地调试云函数*
+
+3. `appVersion` 使用 plus.runtime.version 获取
+
+4. `wgtVersion` 使用 plus.runtime.getProperty(plus.runtime.appid,(wgtInfo) => { wgtInfo.version }) 获取
+
+5. `check-version`云函数内部会自动获取 App 平台
+
+
+**Tips**
+
+1. `check-version`云函数内部有版本对比函数(compare)。
+ - 使用多段式版本格式(如:"3.0.0.0.0.1.0.1", "3.0.0.0.0.1")。如果不满足对比规则,请自行修改。
+ - 如果修改,请将*pages/upgrade-popup.vue*中*compare*函数一并修改
+
+## 项目代码说明
+
+### 更新弹框
+- `upgrade-popup.vue` - 更新应用:
+ - 如果云函数`check-version`返回的参数表明需要更新,则将参数保存在localStorage中,带着键值跳转该页面
+ - 进入时会先从localStorage中尝试取出之前存的安装包路径(此包不会是强制安装类型的包)
+ - 如果有已经保存的包,则和传进来的 `version` 进行比较,如果相等则安装。大于和小于都不进行安装,因为admin端可能会调整包的版本。不符合更新会将此包删除
+ - 如果本地没有包或者包不符合安装条件,则进行下载安装包
+ - 点击下载会有进度条、已下载大小和下载包的大小
+ - 下载完成会提示安装:
+ - 如果是 wgt 包,安装时则会提示 正在安装…… 和 安装完成。安装完成会提示是否重启
+ - 如果是 原生安装包,则直接跳出去覆盖安装
+ - 下载过程中,如果退出会提示是否取消下载。如果是强制更新,则只会提示正在下载请稍后,此时不可退出
+ - 如果是下载完成了没有安装就退出,则会将下载完成的包保存在本地。将包的本地路径和包version保存在localStorage中
+
+### 工具类 utils
+- `call-check-version`
+ - 请求云函数`check-version`拿取版本检测结果
+- `check-update`
+ - 调用`call-check-version`并根据结果判断是否显示更新弹框
+
+### 云函数
+- `check-version` - 检查应用更新:
+ - 根据传参,先检测传参是否完整,appid appVersion wgtVersion 必传
+ - 先从数据库取出所有该平台(会从上下文读取平台信息)的所有线上发行更新
+ - 再从所有线上发行更新中取出版本最大的一版。如果可以,尽量先检测wgt的线上发行版更新
+ - 使用上一步取出的版本包的版本号 和传参 appVersion、wgtVersion 来检测是否有更新。必须同时大于这两项,因为上一次可能是wgt热更新,否则返回暂无更新
+ - 如果库中 wgt包 版本大于传参 appVersion,但是不满足 min_uni_version < appVersion,则不会使用wgt更新,会接着判断库中 app包version 是否大于 appVersion
+ - 返回结果:
+
+ |code|message|
+ |:-:|:-:|
+ |0|当前版本已经是最新的,不需要更新|
+ |101|wgt更新|
+ |102|整包更新|
+ |-101|暂无更新或检查appid是否填写正确|
|-102|请检查传参是否填写正确|
\ No newline at end of file
diff --git a/uni_modules/uni-upgrade-center-app/uniCloud/cloudfunctions/check-version/check-version.param.json b/uni_modules/uni-upgrade-center-app/uniCloud/cloudfunctions/check-version/check-version.param.json
index 78ff505f4cd874db1cbc419a0a8605238817b31d..b45ad7c3981fceb7e94f25371272f4e6bb9bf783 100644
--- a/uni_modules/uni-upgrade-center-app/uniCloud/cloudfunctions/check-version/check-version.param.json
+++ b/uni_modules/uni-upgrade-center-app/uniCloud/cloudfunctions/check-version/check-version.param.json
@@ -1,9 +1,9 @@
-// 本文件中的json内容将在云函数【运行】时作为参数传给云函数。
-
-// 配置教程参考:https://uniapp.dcloud.net.cn/uniCloud/quickstart?id=runparam
-
-{
- "appid": "__YOUR_APPID__",
- "appVersion": "2.2.0",
- "wgtVersion": "2.2.2"
-}
+// 本文件中的json内容将在云函数【运行】时作为参数传给云函数。
+
+// 配置教程参考:https://uniapp.dcloud.net.cn/uniCloud/quickstart?id=runparam
+
+{
+ "appid": "__YOUR_APPID__",
+ "appVersion": "2.2.0",
+ "wgtVersion": "2.2.2"
+}
diff --git a/uni_modules/uni-upgrade-center-app/uniCloud/cloudfunctions/check-version/index.js b/uni_modules/uni-upgrade-center-app/uniCloud/cloudfunctions/check-version/index.js
index b46f10b2b016be8c0003de27d63a75241114109b..76f4247416d6781322b027b8bc28d6102846bee3 100644
--- a/uni_modules/uni-upgrade-center-app/uniCloud/cloudfunctions/check-version/index.js
+++ b/uni_modules/uni-upgrade-center-app/uniCloud/cloudfunctions/check-version/index.js
@@ -1,167 +1,167 @@
-'use strict';
-exports.main = async (event, context) => {
- /**
- * 检测升级 使用说明
- * 上传包:
- * 1. 根据传参,先检测传参是否完整,appid appVersion wgtVersion 必传
- * 2. 先从数据库取出所有该平台(从上下文读取平台信息,默认 Andriod)的所有线上发行更新
- * 3. 再从所有线上发行更新中取出版本最大的一版。如果可以,尽量先检测wgt的线上发行版更新
- * 4. 使用上步取出的版本包的版本号 和传参 appVersion、wgtVersion 来检测是否有更新,必须同时大于这两项,否则返回暂无更新
- * 5. 如果库中 wgt包 版本大于传参 appVersion,但是不满足 min_uni_version < appVersion,则不会使用wgt更新,会接着判断库中 app包version 是否大于 appVersion
- */
-
- let {
- appid,
- appVersion,
- wgtVersion,
- } = event;
-
- const platform_Android = 'Android';
- const platform_iOS = 'iOS';
- const package_app = 'native_app';
- const package_wgt = 'wgt';
- const app_version_db_name = 'opendb-app-versions'
-
- let platform = platform_Android;
-
- // 云函数URL化请求
- if (event.headers) {
- let body;
- try {
- if (event.httpMethod.toLocaleLowerCase() === 'get') {
- body = event.queryStringParameters;
- } else {
- body = JSON.parse(event.body);
- }
- } catch (e) {
- return {
- code: 500,
- msg: '请求错误'
- };
- }
-
- appid = body.appid;
- appVersion = body.appVersion;
- wgtVersion = body.wgtVersion;
-
- platform = /iPhone|iPad/.test(event.headers) ? platform_iOS : platform_Android;
- } else if (context.OS) {
- platform = context.OS === 'android'
- ? platform_Android
- : context.OS === 'ios'
- ? platform_iOS
- : platform_Android;
- }
-
- if (appid && appVersion && wgtVersion && platform) {
- const collection = uniCloud.database().collection(app_version_db_name);
-
- const record = await collection.where({
- appid,
- platform,
- stable_publish: true
- })
- .orderBy('create_date', 'desc')
- .get();
-
- if (record && record.data && record.data.length > 0) {
- const appVersionInDb = record.data.find(item => item.type === package_app) || {};
- const wgtVersionInDb = record.data.find(item => item.type === package_wgt) || {};
- const hasAppPackage = !!Object.keys(appVersionInDb).length;
- const hasWgtPackage = !!Object.keys(wgtVersionInDb).length;
-
- // 取两个版本中版本号最大的包,版本一样,使用wgt包
- let stablePublishDb = hasAppPackage
- ? hasWgtPackage
- ? compare(wgtVersionInDb.version, appVersionInDb.version) >= 0
- ? wgtVersionInDb
- : appVersionInDb
- : appVersionInDb
- : wgtVersionInDb;
-
- const {
- version,
- min_uni_version
- } = stablePublishDb;
-
- // 库中的version必须满足同时大于appVersion和wgtVersion才行,因为上次更新可能是wgt更新
- const appUpdate = compare(version, appVersion) === 1; // app包可用更新
- const wgtUpdate = compare(version, wgtVersion) === 1; // wgt包可用更新
-
- if (Object.keys(stablePublishDb).length && appUpdate && wgtUpdate) {
- // 判断是否可用wgt更新
- if (min_uni_version && compare(min_uni_version, appVersion) < 1) {
- return {
- code: 101,
- message: 'wgt更新',
- ...stablePublishDb
- };
- } else if (hasAppPackage && compare(appVersionInDb.version, appVersion) === 1) {
- return {
- code: 102,
- message: '整包更新',
- ...appVersionInDb
- };
- }
- }
-
- return {
- code: 0,
- message: '当前版本已经是最新的,不需要更新'
- };
- }
-
- return {
- code: -101,
- message: '暂无更新或检查appid是否填写正确'
- };
- }
-
- return {
- code: -102,
- message: '请检查传参是否填写正确'
- };
-};
-
-/**
- * 对比版本号,如需要,请自行修改判断规则
- * 支持比对 ("3.0.0.0.0.1.0.1", "3.0.0.0.0.1") ("3.0.0.1", "3.0") ("3.1.1", "3.1.1.1") 之类的
- * @param {Object} v1
- * @param {Object} v2
- * v1 > v2 return 1
- * v1 < v2 return -1
- * v1 == v2 return 0
- */
-function compare(v1 = '0', v2 = '0') {
- v1 = String(v1).split('.')
- v2 = String(v2).split('.')
- const minVersionLens = Math.min(v1.length, v2.length);
-
- let result = 0;
- for (let i = 0; i < minVersionLens; i++) {
- const curV1 = Number(v1[i])
- const curV2 = Number(v2[i])
-
- if (curV1 > curV2) {
- result = 1
- break;
- } else if(curV1 < curV2) {
- result = -1
- break;
- }
- }
-
- if (result === 0 && (v1.length !== v2.length)) {
- const v1BiggerThenv2 = v1.length > v2.length;
- const maxLensVersion = v1BiggerThenv2 ? v1 : v2;
- for (let i = minVersionLens; i < maxLensVersion.length; i++) {
- const curVersion = Number(maxLensVersion[i])
- if (curVersion > 0) {
- v1BiggerThenv2 ? result = 1 : result = -1
- break;
- }
- }
- }
-
- return result;
-}
+'use strict';
+exports.main = async (event, context) => {
+ /**
+ * 检测升级 使用说明
+ * 上传包:
+ * 1. 根据传参,先检测传参是否完整,appid appVersion wgtVersion 必传
+ * 2. 先从数据库取出所有该平台(从上下文读取平台信息,默认 Andriod)的所有线上发行更新
+ * 3. 再从所有线上发行更新中取出版本最大的一版。如果可以,尽量先检测wgt的线上发行版更新
+ * 4. 使用上步取出的版本包的版本号 和传参 appVersion、wgtVersion 来检测是否有更新,必须同时大于这两项,否则返回暂无更新
+ * 5. 如果库中 wgt包 版本大于传参 appVersion,但是不满足 min_uni_version < appVersion,则不会使用wgt更新,会接着判断库中 app包version 是否大于 appVersion
+ */
+
+ let {
+ appid,
+ appVersion,
+ wgtVersion,
+ } = event;
+
+ const platform_Android = 'Android';
+ const platform_iOS = 'iOS';
+ const package_app = 'native_app';
+ const package_wgt = 'wgt';
+ const app_version_db_name = 'opendb-app-versions'
+
+ let platform = platform_Android;
+
+ // 云函数URL化请求
+ if (event.headers) {
+ let body;
+ try {
+ if (event.httpMethod.toLocaleLowerCase() === 'get') {
+ body = event.queryStringParameters;
+ } else {
+ body = JSON.parse(event.body);
+ }
+ } catch (e) {
+ return {
+ code: 500,
+ msg: '请求错误'
+ };
+ }
+
+ appid = body.appid;
+ appVersion = body.appVersion;
+ wgtVersion = body.wgtVersion;
+
+ platform = /iPhone|iPad/.test(event.headers) ? platform_iOS : platform_Android;
+ } else if (context.OS) {
+ platform = context.OS === 'android'
+ ? platform_Android
+ : context.OS === 'ios'
+ ? platform_iOS
+ : platform_Android;
+ }
+
+ if (appid && appVersion && wgtVersion && platform) {
+ const collection = uniCloud.database().collection(app_version_db_name);
+
+ const record = await collection.where({
+ appid,
+ platform,
+ stable_publish: true
+ })
+ .orderBy('create_date', 'desc')
+ .get();
+
+ if (record && record.data && record.data.length > 0) {
+ const appVersionInDb = record.data.find(item => item.type === package_app) || {};
+ const wgtVersionInDb = record.data.find(item => item.type === package_wgt) || {};
+ const hasAppPackage = !!Object.keys(appVersionInDb).length;
+ const hasWgtPackage = !!Object.keys(wgtVersionInDb).length;
+
+ // 取两个版本中版本号最大的包,版本一样,使用wgt包
+ let stablePublishDb = hasAppPackage
+ ? hasWgtPackage
+ ? compare(wgtVersionInDb.version, appVersionInDb.version) >= 0
+ ? wgtVersionInDb
+ : appVersionInDb
+ : appVersionInDb
+ : wgtVersionInDb;
+
+ const {
+ version,
+ min_uni_version
+ } = stablePublishDb;
+
+ // 库中的version必须满足同时大于appVersion和wgtVersion才行,因为上次更新可能是wgt更新
+ const appUpdate = compare(version, appVersion) === 1; // app包可用更新
+ const wgtUpdate = compare(version, wgtVersion) === 1; // wgt包可用更新
+
+ if (Object.keys(stablePublishDb).length && appUpdate && wgtUpdate) {
+ // 判断是否可用wgt更新
+ if (min_uni_version && compare(min_uni_version, appVersion) < 1) {
+ return {
+ code: 101,
+ message: 'wgt更新',
+ ...stablePublishDb
+ };
+ } else if (hasAppPackage && compare(appVersionInDb.version, appVersion) === 1) {
+ return {
+ code: 102,
+ message: '整包更新',
+ ...appVersionInDb
+ };
+ }
+ }
+
+ return {
+ code: 0,
+ message: '当前版本已经是最新的,不需要更新'
+ };
+ }
+
+ return {
+ code: -101,
+ message: '暂无更新或检查appid是否填写正确'
+ };
+ }
+
+ return {
+ code: -102,
+ message: '请检查传参是否填写正确'
+ };
+};
+
+/**
+ * 对比版本号,如需要,请自行修改判断规则
+ * 支持比对 ("3.0.0.0.0.1.0.1", "3.0.0.0.0.1") ("3.0.0.1", "3.0") ("3.1.1", "3.1.1.1") 之类的
+ * @param {Object} v1
+ * @param {Object} v2
+ * v1 > v2 return 1
+ * v1 < v2 return -1
+ * v1 == v2 return 0
+ */
+function compare(v1 = '0', v2 = '0') {
+ v1 = String(v1).split('.')
+ v2 = String(v2).split('.')
+ const minVersionLens = Math.min(v1.length, v2.length);
+
+ let result = 0;
+ for (let i = 0; i < minVersionLens; i++) {
+ const curV1 = Number(v1[i])
+ const curV2 = Number(v2[i])
+
+ if (curV1 > curV2) {
+ result = 1
+ break;
+ } else if(curV1 < curV2) {
+ result = -1
+ break;
+ }
+ }
+
+ if (result === 0 && (v1.length !== v2.length)) {
+ const v1BiggerThenv2 = v1.length > v2.length;
+ const maxLensVersion = v1BiggerThenv2 ? v1 : v2;
+ for (let i = minVersionLens; i < maxLensVersion.length; i++) {
+ const curVersion = Number(maxLensVersion[i])
+ if (curVersion > 0) {
+ v1BiggerThenv2 ? result = 1 : result = -1
+ break;
+ }
+ }
+ }
+
+ return result;
+}
diff --git a/uni_modules/uni-upgrade-center-app/utils/call-check-version.js b/uni_modules/uni-upgrade-center-app/utils/call-check-version.js
index 31f80e7ca66bedc8c597b084d0df0d2cea9a8800..a2ed34ce8bb685794cdb39d98e1780a345edb5ab 100644
--- a/uni_modules/uni-upgrade-center-app/utils/call-check-version.js
+++ b/uni_modules/uni-upgrade-center-app/utils/call-check-version.js
@@ -1,29 +1,29 @@
-export default function() {
- // #ifdef APP-PLUS
- return new Promise((resolve, reject) => {
- plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
- uniCloud.callFunction({
- name: 'check-version',
- data: {
- appid: plus.runtime.appid,
- appVersion: plus.runtime.version,
- wgtVersion: widgetInfo.version
- },
- success: (e) => {
- resolve(e)
- },
- fail: (error) => {
- reject(error)
- }
- })
- })
- })
- // #endif
- // #ifndef APP-PLUS
- return new Promise((resolve, reject) => {
- reject({
- message: '请在App中使用'
- })
- })
- // #endif
-}
+export default function() {
+ // #ifdef APP-PLUS
+ return new Promise((resolve, reject) => {
+ plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
+ uniCloud.callFunction({
+ name: 'check-version',
+ data: {
+ appid: plus.runtime.appid,
+ appVersion: plus.runtime.version,
+ wgtVersion: widgetInfo.version
+ },
+ success: (e) => {
+ resolve(e)
+ },
+ fail: (error) => {
+ reject(error)
+ }
+ })
+ })
+ })
+ // #endif
+ // #ifndef APP-PLUS
+ return new Promise((resolve, reject) => {
+ reject({
+ message: '请在App中使用'
+ })
+ })
+ // #endif
+}
diff --git a/uni_modules/uni-upgrade-center-app/utils/check-update.js b/uni_modules/uni-upgrade-center-app/utils/check-update.js
index 3899a18dce16e50a5b44a42e24d210dd0eac77a3..cd5bcb6d607af9aba40a94e6656c52b5fa238210 100644
--- a/uni_modules/uni-upgrade-center-app/utils/check-update.js
+++ b/uni_modules/uni-upgrade-center-app/utils/check-update.js
@@ -1,155 +1,155 @@
-import callCheckVersion from './call-check-version'
-
-// 推荐再App.vue中使用
-const PACKAGE_INFO_KEY = '__package_info__'
-
-export default function() {
- // #ifdef APP-PLUS
- return new Promise((resolve, reject) => {
- callCheckVersion().then(async (e) => {
- if (!e.result) return;
- const {
- code,
- message,
- is_silently, // 是否静默更新
- url, // 安装包下载地址
- platform, // 安装包平台
- type // 安装包类型
- } = e.result;
-
- // 此处逻辑仅为实例,可自行编写
- if (code > 0) {
- // 腾讯云和阿里云下载链接不同,需要处理一下,阿里云会原样返回
- const {
- fileList
- } = await uniCloud.getTempFileURL({
- fileList: [url]
- });
- if (fileList[0].tempFileURL)
- e.result.url = fileList[0].tempFileURL;
-
- resolve(e)
-
- // 静默更新,只有wgt有
- if (is_silently) {
- uni.downloadFile({
- url: e.result.url,
- success: res => {
- if (res.statusCode == 200) {
- // 下载好直接安装,下次启动生效
- plus.runtime.install(res.tempFilePath, {
- force: false
- });
- }
- }
- });
- return;
- }
-
- /**
- * 提示升级一
- * 使用 uni.showModal
- */
- // return updateUseModal(e.result)
-
- /**
- * 提示升级二
- * 官方适配的升级弹窗,可自行替换资源适配UI风格
- */
- uni.setStorageSync(PACKAGE_INFO_KEY, e.result)
- uni.navigateTo({
- url: `/uni_modules/uni-upgrade-center-app/pages/upgrade-popup?local_storage_key=${PACKAGE_INFO_KEY}`,
- fail: (err) => {
- console.error('更新弹框跳转失败', err)
- uni.removeStorageSync(PACKAGE_INFO_KEY)
- }
- })
- } else if (code < 0) {
- // TODO 云函数报错处理
- console.error(message)
- reject(e)
- }
- }).catch(err => {
- // TODO 云函数报错处理
- console.error(err.message)
- reject(err)
- })
- });
- // #endif
-}
-
-/**
- * 使用 uni.showModal 升级
- */
-function updateUseModal(packageInfo) {
- const {
- title, // 标题
- contents, // 升级内容
- is_mandatory, // 是否强制更新
- url, // 安装包下载地址
- platform, // 安装包平台
- type // 安装包类型
- } = packageInfo;
-
- let isWGT = type === 'wgt'
- let isiOS = !isWGT ? platform.includes('iOS') : false;
- let confirmText = isiOS ? '立即跳转更新' : '立即下载更新'
-
- return uni.showModal({
- title,
- content: contents,
- showCancel: !is_mandatory,
- confirmText,
- success: res => {
- if (res.cancel) return;
-
- // 安装包下载
- if (isiOS) {
- plus.runtime.openURL(url);
- return;
- }
-
- uni.showToast({
- title: '后台下载中……',
- duration: 1000
- });
-
- // wgt 和 安卓下载更新
- downloadTask = uni.downloadFile({
- url,
- success: res => {
- if (res.statusCode !== 200) {
- console.error('下载安装包失败', err);
- return;
- }
- // 下载好直接安装,下次启动生效
- plus.runtime.install(res.tempFilePath, {
- force: false
- }, () => {
- if (is_mandatory) {
- //更新完重启app
- plus.runtime.restart();
- return;
- }
- uni.showModal({
- title: '安装成功是否重启?',
- success: res => {
- if (res.confirm) {
- //更新完重启app
- plus.runtime.restart();
- }
- }
- });
- }, err => {
- uni.showModal({
- title: '更新失败',
- content: err
- .message,
- showCancel: false
- });
- });
- }
- });
- }
- });
+import callCheckVersion from './call-check-version'
+
+// 推荐再App.vue中使用
+const PACKAGE_INFO_KEY = '__package_info__'
+
+export default function() {
+ // #ifdef APP-PLUS
+ return new Promise((resolve, reject) => {
+ callCheckVersion().then(async (e) => {
+ if (!e.result) return;
+ const {
+ code,
+ message,
+ is_silently, // 是否静默更新
+ url, // 安装包下载地址
+ platform, // 安装包平台
+ type // 安装包类型
+ } = e.result;
+
+ // 此处逻辑仅为实例,可自行编写
+ if (code > 0) {
+ // 腾讯云和阿里云下载链接不同,需要处理一下,阿里云会原样返回
+ const {
+ fileList
+ } = await uniCloud.getTempFileURL({
+ fileList: [url]
+ });
+ if (fileList[0].tempFileURL)
+ e.result.url = fileList[0].tempFileURL;
+
+ resolve(e)
+
+ // 静默更新,只有wgt有
+ if (is_silently) {
+ uni.downloadFile({
+ url: e.result.url,
+ success: res => {
+ if (res.statusCode == 200) {
+ // 下载好直接安装,下次启动生效
+ plus.runtime.install(res.tempFilePath, {
+ force: false
+ });
+ }
+ }
+ });
+ return;
+ }
+
+ /**
+ * 提示升级一
+ * 使用 uni.showModal
+ */
+ // return updateUseModal(e.result)
+
+ /**
+ * 提示升级二
+ * 官方适配的升级弹窗,可自行替换资源适配UI风格
+ */
+ uni.setStorageSync(PACKAGE_INFO_KEY, e.result)
+ uni.navigateTo({
+ url: `/uni_modules/uni-upgrade-center-app/pages/upgrade-popup?local_storage_key=${PACKAGE_INFO_KEY}`,
+ fail: (err) => {
+ console.error('更新弹框跳转失败', err)
+ uni.removeStorageSync(PACKAGE_INFO_KEY)
+ }
+ })
+ } else if (code < 0) {
+ // TODO 云函数报错处理
+ console.error(message)
+ reject(e)
+ }
+ }).catch(err => {
+ // TODO 云函数报错处理
+ console.error(err.message)
+ reject(err)
+ })
+ });
+ // #endif
+}
+
+/**
+ * 使用 uni.showModal 升级
+ */
+function updateUseModal(packageInfo) {
+ const {
+ title, // 标题
+ contents, // 升级内容
+ is_mandatory, // 是否强制更新
+ url, // 安装包下载地址
+ platform, // 安装包平台
+ type // 安装包类型
+ } = packageInfo;
+
+ let isWGT = type === 'wgt'
+ let isiOS = !isWGT ? platform.includes('iOS') : false;
+ let confirmText = isiOS ? '立即跳转更新' : '立即下载更新'
+
+ return uni.showModal({
+ title,
+ content: contents,
+ showCancel: !is_mandatory,
+ confirmText,
+ success: res => {
+ if (res.cancel) return;
+
+ // 安装包下载
+ if (isiOS) {
+ plus.runtime.openURL(url);
+ return;
+ }
+
+ uni.showToast({
+ title: '后台下载中……',
+ duration: 1000
+ });
+
+ // wgt 和 安卓下载更新
+ downloadTask = uni.downloadFile({
+ url,
+ success: res => {
+ if (res.statusCode !== 200) {
+ console.error('下载安装包失败', err);
+ return;
+ }
+ // 下载好直接安装,下次启动生效
+ plus.runtime.install(res.tempFilePath, {
+ force: false
+ }, () => {
+ if (is_mandatory) {
+ //更新完重启app
+ plus.runtime.restart();
+ return;
+ }
+ uni.showModal({
+ title: '安装成功是否重启?',
+ success: res => {
+ if (res.confirm) {
+ //更新完重启app
+ plus.runtime.restart();
+ }
+ }
+ });
+ }, err => {
+ uni.showModal({
+ title: '更新失败',
+ content: err
+ .message,
+ showCancel: false
+ });
+ });
+ }
+ });
+ }
+ });
}
diff --git a/uni_modules/uni-upgrade-center/uniCloud/database/opendb-app-list.schema.json b/uni_modules/uni-upgrade-center/uniCloud/database/opendb-app-list.schema.json
index 4a690e42f4f26f5b344231fb85525d17a1d0c464..31db799677c1148c9b1272656fd140d0b2f530e3 100644
--- a/uni_modules/uni-upgrade-center/uniCloud/database/opendb-app-list.schema.json
+++ b/uni_modules/uni-upgrade-center/uniCloud/database/opendb-app-list.schema.json
@@ -1,62 +1,62 @@
-// 文档教程: https://uniapp.dcloud.net.cn/uniCloud/schema
-{
- "bsonType": "object",
- "required": ["appid", "name", "description"],
- "permission": {
- "read": false,
- "create": false,
- "update": false,
- "delete": false
- },
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
- },
- "appid": {
- "bsonType": "string",
- "description": "应用的AppID",
- "label": "AppID",
- "componentForEdit": {
- "name": "uni-easyinput",
- "props": {
- "disabled": true
- }
- }
- },
- "name": {
- "bsonType": "string",
- "description": "应用名称",
- "label": "应用名称",
- "componentForEdit": {
- "name": "uni-easyinput",
- "props": {
- "disabled": true
- }
- }
- },
- "description": {
- "bsonType": "string",
- "description": "应用描述",
- "label": "应用描述",
- "componentForEdit": {
- "name": "textarea"
- },
- "componentForShow": {
- "name": "textarea",
- "props": {
- "disabled": true
- }
- }
- },
- "create_date": {
- "bsonType": "timestamp",
- "label": "创建时间",
- "forceDefaultValue": {
- "$env": "now"
- },
- "componentForEdit": {
- "name": "uni-dateformat"
- }
- }
- }
+// 文档教程: https://uniapp.dcloud.net.cn/uniCloud/schema
+{
+ "bsonType": "object",
+ "required": ["appid", "name", "description"],
+ "permission": {
+ "read": false,
+ "create": false,
+ "update": false,
+ "delete": false
+ },
+ "properties": {
+ "_id": {
+ "description": "ID,系统自动生成"
+ },
+ "appid": {
+ "bsonType": "string",
+ "description": "应用的AppID",
+ "label": "AppID",
+ "componentForEdit": {
+ "name": "uni-easyinput",
+ "props": {
+ "disabled": true
+ }
+ }
+ },
+ "name": {
+ "bsonType": "string",
+ "description": "应用名称",
+ "label": "应用名称",
+ "componentForEdit": {
+ "name": "uni-easyinput",
+ "props": {
+ "disabled": true
+ }
+ }
+ },
+ "description": {
+ "bsonType": "string",
+ "description": "应用描述",
+ "label": "应用描述",
+ "componentForEdit": {
+ "name": "textarea"
+ },
+ "componentForShow": {
+ "name": "textarea",
+ "props": {
+ "disabled": true
+ }
+ }
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "label": "创建时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ },
+ "componentForEdit": {
+ "name": "uni-dateformat"
+ }
+ }
+ }
}
diff --git a/uni_modules_tools/change_after.js b/uni_modules_tools/change_after.js
new file mode 100644
index 0000000000000000000000000000000000000000..f174a41e462ca60d04f4bbbc8b8bebe1f99695a3
--- /dev/null
+++ b/uni_modules_tools/change_after.js
@@ -0,0 +1,24 @@
+const fs = require('fs');
+module.exports = function(){
+ console.log('开始执行脚本change_after');
+ let changelog = fs.readFileSync(process.cwd() + '/changelog.md', 'utf-8').split("##")[1].split("\n").slice(1).join(' ');
+ console.log(changelog);
+ // 这里是修改完相关敏感配置后执行的脚本,你可以在这里自定义逻辑,
+ // 比如执行git提交命令
+ var shell = require("shelljs");
+ var exec = shell.exec;
+
+ if (exec('git add .').code !== 0) {
+ shell.echo('Error: Git add failed');
+ shell.exit(1);
+ }
+ if (exec(`git commit -a -m "${changelog}"`).code !== 0) {
+ shell.echo('Error: Git commit failed');
+ shell.exit(1);
+ }
+ if (exec('git push').code !== 0) {
+ shell.echo('Error: Git commit failed');
+ shell.exit(1);
+ }
+ shell.exec(`echo git success ${changelog}`);
+}
\ No newline at end of file
diff --git a/uni_modules_tools/config.js b/uni_modules_tools/config.js
new file mode 100644
index 0000000000000000000000000000000000000000..fe134d41324b1368b57fa884a010a4a7f941c418
--- /dev/null
+++ b/uni_modules_tools/config.js
@@ -0,0 +1,80 @@
+// "文件路径" : {"键名":"改成什么"}
+{
+ "/manifest.json": {
+ "appid": "请点击重新获取" ,//清空appid
+ "mp-weixin" : {
+ "appid" : ""
+ },
+ "app-plus" : {
+ "distribute" :{
+ "sdkConfigs" : {
+ "oauth" : {
+ "weixin" : {
+ "appid" : "",
+ "appsecret" : "",
+ "UniversalLinks" : ""
+ },
+ "univerify" : {}
+ },
+ "share" : {
+ "weixin" : {
+ "appid" : "",
+ "UniversalLinks" : ""
+ }
+ },
+ "geolocation" : {
+ "baidu" : {
+ "__platform__" : [ "ios", "android" ],
+ "appkey_ios" : "请填写地图的key",
+ "appkey_android" : "请填写地图的key"
+ }
+ }
+ }
+ }
+ },
+ "_spaceID" : "",
+ "vueVersion" : "2"
+ },
+ "/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json": {
+ "tokenExpiresIn": 7200,
+ "app-plus": {
+ "oauth": {
+ "weixin": {
+ "appid": "填写来源微信开放平台https://open.weixin.qq.com/创建的应用的appid",
+ "appsecret": "填写来源微信开放平台https://open.weixin.qq.com/创建的应用的appsecret"
+ },
+ "apple": {
+ "bundleId": "苹果开发者后台获取的bundleId"
+ }
+ }
+ },
+ "mp-weixin": {
+ "oauth": {
+ "weixin": {
+ "appid": "微信小程序登录所用的appid、appsecret需要在对应的小程序管理控制台获取",
+ "appsecret": "微信小程序后台获取的appsecret"
+ }
+ }
+ },
+ "mp-alipay": {
+ "oauth": {
+ "alipay": {
+ "appid": "支付宝小程序登录用到的appid、privateKey请参考支付宝小程序的文档进行设置或者获取,https://opendocs.alipay.com/open/291/105971#LDsXr",
+ "privateKey": "支付宝小程序登录用到的appid、privateKey请参考支付宝小程序的文档进行设置或者获取,https://opendocs.alipay.com/open/291/105971#LDsXr"
+ }
+ }
+ },
+ "service": {
+ "sms": {
+ "name": "应用名称,对应短信模版的name",
+ "smsKey": "短信密钥key,开通短信服务处可以看到",
+ "smsSecret": "短信密钥secret,开通短信服务处可以看到"
+ },
+ "univerify": {
+ "appid": "当前应用的appid,使用云函数URL化,此项必须配置",
+ "apiKey": "apiKey 和 apiSecret 在开发者中心获取,开发者中心:https://dev.dcloud.net.cn/uniLogin/index?type=0,文档:https://ask.dcloud.net.cn/article/37965",
+ "apiSecret": ""
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/uni_modules_tools/main.js b/uni_modules_tools/main.js
new file mode 100644
index 0000000000000000000000000000000000000000..9b0c5936e681e65b31a40b9bc3a3e3b92f5b03ca
--- /dev/null
+++ b/uni_modules_tools/main.js
@@ -0,0 +1,102 @@
+//脚本文件目录 __dirname
+//运行脚本的目录,即:项目的目录 process.cwd()
+
+//配置文件
+const fs = require('fs'),
+ Hjson = require('hjson'),
+ config = Hjson.rt.parse(fs.readFileSync(__dirname+'/config.js', 'utf-8'))
+const change_after = require('./change_after')
+
+if(process.argv[2] == 'change'){
+ change(config,()=>{
+ console.log('脚本change已经执行成功');
+ change_after()
+ })
+}else{
+ recovery(config)
+}
+
+function change(config,callback){
+ const total = Object.keys(config).length
+ let index = 0;
+ for (let fileName in config) {
+ let path = process.cwd() + fileName
+ let copyPath = __dirname + '/copy' + fileName
+ let fileText = fs.readFileSync(path, 'utf-8')
+ //保持原文件名先备份一份到/uni_modules_tools/copy目录下,然后再覆盖
+ writeFileRecursive(copyPath, fileText, function(err) { //创建目录并写入文件
+ if (err) {
+ return console.log(err);
+ }
+ //改写
+ let HfileObj = Hjson.rt.parse(fileText)
+ //递归合并,为了保留注释内容
+ mergeJSON(HfileObj,config[fileName])
+
+ fs.writeFile(path, Hjson.rt.stringify(HfileObj, {
+ quotes: 'all',
+ separator: true,
+ multiline: "off",
+ bracesSameLine: true
+ }), function(err) {
+ if (err) {
+ return console.log(err);
+ }
+ index++
+ if(index == total){
+ callback()
+ }
+ })
+ })
+ }
+}
+
+
+
+
+function recovery(){
+ let paths = Object.keys(config)
+ console.log(paths);
+ paths.forEach(path=>{
+ console.log(__dirname + '/copy' + path);
+ let oldFile = fs.readFileSync(__dirname + '/copy' + path)
+ console.log(process.cwd() + path);
+ fs.writeFile(process.cwd() + path, oldFile, function(err) {
+ if (err) {
+ console.log(err);
+ return
+ }
+ // fs.unlinkSync(__dirname + path+'.lock')
+ })
+ })
+}
+
+
+
+
+
+
+//创建目录并写入文件
+function writeFileRecursive(path, buffer, callback) {
+ let lastPath = path.substring(0, path.lastIndexOf("/"));
+ fs.mkdir(lastPath, {
+ recursive: true
+ }, (err) => {
+ if (err) return callback(err);
+ fs.writeFile(path, buffer, function(err) {
+ if (err) return callback(err);
+ return callback(null);
+ });
+ });
+}
+
+//递归合并,为了保留注释内容
+function mergeJSON(minor, main) {
+ for (var key in main) {
+ if (typeof(main[key]) != 'object' ) {
+ minor[key] = main[key];
+ }else{
+ mergeJSON(minor[key], main[key]);
+ }
+ }
+}
\ No newline at end of file
diff --git a/uni_modules_tools/package.json b/uni_modules_tools/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..5fdc53706ecffa46d9d9ae7c3988cb3a578c7fa1
--- /dev/null
+++ b/uni_modules_tools/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "uni_modules_tools",
+ "version": "1.0.0",
+ "description": "本插件是一个[uni_modules钩子脚本](https://uniapp.dcloud.io/uni_modules?id=uni_modulesconfigjson),仅限uni_modules插件使用 #### 为什么使用 uni_modules_tools 在实际开发中很多插件需要配置文件才可以正常运行,比如uni-id、uni-pay等; 有些配置内容属于密钥,在发表到插件市场的时候我们通常不希望这些配置被暴露。 传统的方式你需要手动备份密钥内容,上传结束后再将配置填回。这样插件作者发表插件会比较不便。",
+ "main": "main.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "hjson": "^3.2.2"
+ }
+}
diff --git a/uni_modules_tools/readme.md b/uni_modules_tools/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..dc309e5a6df36c0bc81b04000281ea47ffdce03f
--- /dev/null
+++ b/uni_modules_tools/readme.md
@@ -0,0 +1,84 @@
+本插件是一个[uni_modules钩子脚本](https://uniapp.dcloud.io/uni_modules?id=uni_modulesconfigjson),仅限uni_modules插件使用
+#### 为什么使用 uni_modules_tools
+在实际开发中很多插件需要配置文件才可以正常运行,比如uni-id、uni-pay等;
+有些配置内容属于密钥,在发表到插件市场的时候我们通常不希望这些配置被暴露。
+传统的方式你需要手动备份密钥内容,上传结束后再将配置填回。这样插件作者发表插件会比较不便。
+
+而现在有了 `uni_modules_tools` 只需配置`/uni_modules_tools/config.js`即实现
+- 在插件上传之前,自动根据配置改写项目中对应配置。
+- 上传结束(成功和失败都触发)后自动恢复项目中的配置。
+
+#### 示例目录结构
+
+├─ uni_modules // 存放uni_module规范的插件。
+│ └─uni-config-center
+│ └─uniCloud
+│ └─cloudfunctions
+│ └─common
+│ └─uni-config-center
+│ └─uni-id
+│ └─config.json
+├─ manifest.json
+├─ uni_modules.config.json //uni_modules的配置文件
+└─ uni_modules_tools
+ ├─ copy //用于自动修改配置文件时的,临时备份目录
+ ├─ config.js //插件配置文件,下面会有示例说明
+ ├─ main.js //插件核心代码,入口文件;你无需修改此文件中的代码,除非你了解内部逻辑
+ └─ readme.md //插件文档
+
+
+
+#### 使用方式
+`/uni_modules_tools/config.js`的格式为:
+```
+{
+ "文件路径" : {"键名":"改后的内容"}
+}
+```
+
+- 文件仅支持json格式,如:`manifest.json`、`uni-config-center`下的`config.json`等
+
+使用示例,比如你需要:
+- 修改manifest.json文件的appid内容改为:请重新获取appid
+- 修改uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json 文件的内容app-plus -> oauth -> weixin 和 apple 下的 `appid` `appsecret` `apple`值为:`请填写你的自己的appid` `请填写你的自己的appsecret` `请填写你的自己的bundleId`
+
+1. 配置,根目录下的`/uni_modules_tools/config.js`文件,如下:
+
+```
+{
+ "/manifest.json": {
+ "appid": "请重新获取appid"
+ },
+ "/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json": {
+ "app-plus": {
+ "oauth": {
+ "weixin": {
+ "appid": "请填写你的自己的appid",
+ "appsecret": "请填写你的自己的appsecret"
+ },
+ "apple": {
+ "bundleId": "请填写你的自己的bundleId"
+ }
+ }
+ }
+ }
+}
+```
+
+2. 根目录下的`/uni_modules.config.json`配置如下:
+```
+{
+ "scripts":{
+ "preupload": "node uni_modules_tools/main.js change",
+ "postupload": "node uni_modules_tools/main.js recovery"
+ }
+}
+```
+
+3. 项目依赖hjson-js需要在uni_modules_tools目录,执行npm install完成依赖的安装
+
+#### 测试方式
+- 在项目根目录直接执行 `node uni_modules_tools/main.js change` 即可测试修改相关配置的效果
+- 在项目根目录直接执行 `node uni_modules_tools/main.js recovery` 即可测试恢复相关配置的效果
+
+> 本插件中使用了[hjson-js](https://www.npmjs.com/package/hjson) 感谢@hjson-js的作者
\ No newline at end of file