diff --git a/src/uni_modules/uview-plus/components/up-button/button.uts b/src/uni_modules/uview-plus/components/up-button/button.uts new file mode 100644 index 000000000..a3fea3952 --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-button/button.uts @@ -0,0 +1,42 @@ +/* + * @Author : LQ + * @Description : + * @version : 1.0 + * @Date : 2021-08-20 16:44:21 + * @LastAuthor : LQ + * @lastTime : 2021-08-20 16:51:27 + * @FilePath : /u-view2.0/uview-ui/libs/config/props/button.js + */ +export default { + // button组件 + button: { + hairline: false, + type: 'info', + size: 'normal', + shape: 'square', + plain: false, + disabled: false, + loading: false, + loadingText: '', + loadingMode: 'spinner', + loadingSize: 15, + openType: '', + formType: '', + appParameter: '', + hoverStopPropagation: true, + lang: 'en', + sessionFrom: '', + sendMessageTitle: '', + sendMessagePath: '', + sendMessageImg: '', + showMessageCard: false, + dataName: '', + throttleTime: 0, + hoverStartTime: 0, + hoverStayTime: 200, + text: '', + icon: '', + iconColor: '', + color: '' + } +} as UTSJSONObject diff --git a/src/uni_modules/uview-plus/components/up-button/props.js b/src/uni_modules/uview-plus/components/up-button/props.js index d01f0ab2a..5ce97066e 100644 --- a/src/uni_modules/uview-plus/components/up-button/props.js +++ b/src/uni_modules/uview-plus/components/up-button/props.js @@ -1,6 +1,7 @@ import { defineMixin } from '../../libs/vue' -import defProps from '../../libs/config/props.js' -export const props = defineMixin({ +import defProps from '../../libs/config/props' + +export const propsButton = defineMixin({ props: { // 是否细边框 hairline: { diff --git a/src/uni_modules/uview-plus/components/up-button/props.uts b/src/uni_modules/uview-plus/components/up-button/props.uts new file mode 100644 index 000000000..95c63797b --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-button/props.uts @@ -0,0 +1,156 @@ +import { defineMixin } from '../../libs/vue.uts' +import defProps from './button.uts' +let btnProp = defProps['button'] as UTSJSONObject + +export const propsButton = defineMixin({ + props: { + // 是否细边框 + hairline: { + type: Boolean, + default: btnProp['hairline'] + }, + // 按钮的预置样式,info,primary,error,warning,success + type: { + type: String, + default: btnProp['type'] + }, + // 按钮尺寸,large,normal,small,mini + size: { + type: String, + default: btnProp['size'] + }, + // 按钮形状,circle(两边为半圆),square(带圆角) + shape: { + type: String, + default: btnProp['shape'] + }, + // 按钮是否镂空 + plain: { + type: Boolean, + default: btnProp['plain'] + }, + // 是否禁止状态 + disabled: { + type: Boolean, + default: btnProp['disabled'] + }, + // 是否加载中 + loading: { + type: Boolean, + default: btnProp['loading'] + }, + // 加载中提示文字 + loadingText: { + type: [String], + default: btnProp['loadingText'] + }, + // 加载状态图标类型 + loadingMode: { + type: String, + default: btnProp['loadingMode'] + }, + // 加载图标大小 + loadingSize: { + type: Number, + default: btnProp['loadingSize'] + }, + // 开放能力,具体请看uniapp稳定关于button组件部分说明 + // https://uniapp.dcloud.io/component/button + openType: { + type: String, + default: btnProp['openType'] + }, + // 用于
组件,点击分别会触发 组件的 submit/reset 事件 + // 取值为submit(提交表单),reset(重置表单) + formType: { + type: String, + default: btnProp['formType'] + }, + // 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 + // 只微信小程序、QQ小程序有效 + appParameter: { + type: String, + default: btnProp['appParameter'] + }, + // 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效 + hoverStopPropagation: { + type: Boolean, + default: btnProp['hoverStopPropagation'] + }, + // 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。只微信小程序有效 + lang: { + type: String, + default: btnProp['lang'] + }, + // 会话来源,open-type="contact"时有效。只微信小程序有效 + sessionFrom: { + type: String, + default: btnProp['sessionFrom'] + }, + // 会话内消息卡片标题,open-type="contact"时有效 + // 默认当前标题,只微信小程序有效 + sendMessageTitle: { + type: String, + default: btnProp['sendMessageTitle'] + }, + // 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效 + // 默认当前分享路径,只微信小程序有效 + sendMessagePath: { + type: String, + default: btnProp['sendMessagePath'] + }, + // 会话内消息卡片图片,open-type="contact"时有效 + // 默认当前页面截图,只微信小程序有效 + sendMessageImg: { + type: String, + default: btnProp['sendMessageImg'] + }, + // 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示, + // 用户点击后可以快速发送小程序消息,open-type="contact"时有效 + showMessageCard: { + type: Boolean, + default: btnProp['showMessageCard'] + }, + // 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取 + dataName: { + type: String, + default: btnProp['dataName'] + }, + // 节流,一定时间内只能触发一次 + throttleTime: { + type: Number, + default: btnProp['throttleTime'] + }, + // 按住后多久出现点击态,单位毫秒 + hoverStartTime: { + type: Number, + default: btnProp['hoverStartTime'] + }, + // 手指松开后点击态保留时间,单位毫秒 + hoverStayTime: { + type: Number, + default: btnProp['hoverStayTime'] + }, + // 按钮文字,之所以通过props传入,是因为slot传入的话 + // nvue中无法控制文字的样式 + text: { + type: [String], + default: btnProp['text'] + }, + // 按钮图标 + icon: { + type: String, + default: btnProp['icon'] + }, + // 按钮图标 + iconColor: { + type: String, + default: btnProp['iconColor'] + }, + // 按钮颜色,支持传入linear-gradient渐变色 + color: { + type: String, + default: btnProp['color'] + } + } +}); diff --git a/src/uni_modules/uview-plus/components/up-button/up-button.nvue b/src/uni_modules/uview-plus/components/up-button/up-button.nvue new file mode 100644 index 000000000..0eeb81f42 --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-button/up-button.nvue @@ -0,0 +1,447 @@ + + + + + diff --git a/src/uni_modules/uview-plus/components/up-button/up-button.vue b/src/uni_modules/uview-plus/components/up-button/up-button.vue index 5609a3f57..a0d6fc73e 100644 --- a/src/uni_modules/uview-plus/components/up-button/up-button.vue +++ b/src/uni_modules/uview-plus/components/up-button/up-button.vue @@ -114,7 +114,7 @@ import { buttonMixin } from "../../libs/mixin/button"; import { openType } from "../../libs/mixin/openType"; import { mpMixin } from '../../libs/mixin/mpMixin'; import { mixin } from '../../libs/mixin/mixin'; -import { props } from "./props"; +import { propsButton } from "./props"; import { addStyle } from '../../libs/function/index'; import { throttle } from '../../libs/function/throttle'; import color from '../../libs/config/color'; @@ -165,10 +165,10 @@ import color from '../../libs/config/color'; export default { name: "up-button", // #ifdef MP - mixins: [mpMixin, mixin, buttonMixin, openType, props], + mixins: [mpMixin, mixin, buttonMixin, openType, propsButton], // #endif // #ifndef MP - mixins: [mpMixin, mixin, props], + mixins: [mpMixin, mixin, propsButton], // #endif data() { return {}; diff --git a/src/uni_modules/uview-plus/components/up-cell-group/cellGroup.uts b/src/uni_modules/uview-plus/components/up-cell-group/cellGroup.uts new file mode 100644 index 000000000..1fc7e4fee --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-cell-group/cellGroup.uts @@ -0,0 +1,17 @@ +/* + * @Author : LQ + * @Description : + * @version : 1.0 + * @Date : 2021-08-20 16:44:21 + * @LastAuthor : LQ + * @lastTime : 2021-08-20 16:54:16 + * @FilePath : /u-view2.0/uview-ui/libs/config/props/cellGroup.js + */ +export default { + // cell-group组件的props + cellGroup: { + title: '', + border: true, + customStyle: {} + } +} as UTSJSONObject diff --git a/src/uni_modules/uview-plus/components/up-cell-group/props.uts b/src/uni_modules/uview-plus/components/up-cell-group/props.uts new file mode 100644 index 000000000..56dbb9c89 --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-cell-group/props.uts @@ -0,0 +1,18 @@ +import { defineMixin } from '../../libs/vue.uts' +import defProps from '../../libs/config/props.uts' +let cellGroup = defProps['cellGroup'] as UTSJSONObject + +export const props = defineMixin({ + props: { + // 分组标题 + title: { + type: String, + default: cellGroup['title'] + }, + // 是否显示外边框 + border: { + type: Boolean, + default: cellGroup['border'] + } + } +}) diff --git a/src/uni_modules/uview-plus/components/up-cell-group/up-cell-group.uvue b/src/uni_modules/uview-plus/components/up-cell-group/up-cell-group.uvue new file mode 100644 index 000000000..a2db6f190 --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-cell-group/up-cell-group.uvue @@ -0,0 +1,69 @@ + + + + + + diff --git a/src/uni_modules/uview-plus/components/up-cell/cell.uts b/src/uni_modules/uview-plus/components/up-cell/cell.uts new file mode 100644 index 000000000..6783f17b2 --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-cell/cell.uts @@ -0,0 +1,35 @@ +/* + * @Author : LQ + * @Description : + * @version : 1.0 + * @Date : 2021-08-20 16:44:21 + * @LastAuthor : LQ + * @lastTime : 2021-08-23 20:53:09 + * @FilePath : /u-view2.0/uview-ui/libs/config/props/cell.js + */ +export default { + // cell组件的props + cell: { + customClass: '', + title: '', + label: '', + value: '', + icon: '', + disabled: false, + border: true, + center: false, + url: '', + linkType: 'navigateTo', + clickable: false, + isLink: false, + required: false, + arrowDirection: '', + iconStyle: {}, + rightIconStyle: {}, + rightIcon: 'arrow-right', + titleStyle: {}, + size: '', + stop: true, + name: '' + } +} as UTSJSONObject diff --git a/src/uni_modules/uview-plus/components/up-cell/props.js b/src/uni_modules/uview-plus/components/up-cell/props.js index 73f52106d..a508602fb 100644 --- a/src/uni_modules/uview-plus/components/up-cell/props.js +++ b/src/uni_modules/uview-plus/components/up-cell/props.js @@ -1,6 +1,7 @@ import { defineMixin } from '../../libs/vue' -import defProps from '../../libs/config/props.js' -export const props = defineMixin({ +import defProps from '../../libs/config/props' + +export const propsCell = defineMixin({ props: { // 标题 title: { diff --git a/src/uni_modules/uview-plus/components/up-cell/props.uts b/src/uni_modules/uview-plus/components/up-cell/props.uts new file mode 100644 index 000000000..fe55256aa --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-cell/props.uts @@ -0,0 +1,107 @@ +import { defineMixin } from '../../libs/vue.uts' +import defProps from '../../libs/config/props.uts' + +export const propsCell = defineMixin({ + props: { + // 标题 + title: { + type: String, + default: defProps.getString('cell.title') + }, + // 标题下方的描述信息 + label: { + type: String, + default: defProps.getString('cell.label') + }, + // 右侧的内容 + value: { + type: String, + default: defProps.getString('cell.value') + }, + // 左侧图标名称,或者图片链接(本地文件建议使用绝对地址) + icon: { + type: String, + default: defProps.getString('cell.icon') + }, + // 是否禁用cell + disabled: { + type: Boolean, + default: defProps.getBoolean('cell.disabled') + }, + // 是否显示下边框 + border: { + type: Boolean, + default: defProps.getBoolean('cell.border') + }, + // 内容是否垂直居中(主要是针对右侧的value部分) + center: { + type: Boolean, + default: defProps.getBoolean('cell.center') + }, + // 点击后跳转的URL地址 + url: { + type: String, + default: defProps.getString('cell.url') + }, + // 链接跳转的方式,内部使用的是uView封装的route方法,可能会进行拦截操作 + linkType: { + type: String, + default: defProps.getString('cell.linkType') + }, + // 是否开启点击反馈(表现为点击时加上灰色背景) + clickable: { + type: Boolean, + default: defProps.getBoolean('cell.clickable') + }, + // 是否展示右侧箭头并开启点击反馈 + isLink: { + type: Boolean, + default: defProps.getBoolean('cell.isLink') + }, + // 是否显示表单状态下的必填星号(此组件可能会内嵌入input组件) + required: { + type: Boolean, + default: defProps.getBoolean('cell.required') + }, + // 右侧的图标箭头 + rightIcon: { + type: String, + default: defProps.getString('cell.rightIcon') + }, + // 右侧箭头的方向,可选值为:left,up,down + arrowDirection: { + type: String, + default: defProps.getString('cell.arrowDirection') + }, + // 左侧图标样式 + iconStyle: { + type: Object, + default: defProps.getAny('cell.iconStyle') + }, + // 右侧箭头图标的样式 + rightIconStyle: { + type: Object, + default: defProps.getAny('cell.rightIconStyle') + }, + // 标题的样式 + titleStyle: { + type: Object, + default: defProps.getAny('cell.titleStyle') + }, + // 单位元的大小,可选值为large + size: { + type: String, + default: defProps.getString('cell.size') + }, + // 点击cell是否阻止事件传播 + stop: { + type: Boolean, + default: defProps.getBoolean('cell.stop') + }, + // 标识符,cell被点击时返回 + name: { + type: String, + default: defProps.getString('cell.name') + } + } +}) diff --git a/src/uni_modules/uview-plus/components/up-cell/up-cell.uvue b/src/uni_modules/uview-plus/components/up-cell/up-cell.uvue new file mode 100644 index 000000000..9a75c4595 --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-cell/up-cell.uvue @@ -0,0 +1,259 @@ + + + + + diff --git a/src/uni_modules/uview-plus/components/up-cell/up-cell.vue b/src/uni_modules/uview-plus/components/up-cell/up-cell.vue index 7549ba667..c53ffc80b 100644 --- a/src/uni_modules/uview-plus/components/up-cell/up-cell.vue +++ b/src/uni_modules/uview-plus/components/up-cell/up-cell.vue @@ -47,7 +47,7 @@ + + diff --git a/src/uni_modules/uview-plus/components/up-gap/up-gap.vue b/src/uni_modules/uview-plus/components/up-gap/up-gap.vue index 252c00ba5..b32b5a61c 100644 --- a/src/uni_modules/uview-plus/components/up-gap/up-gap.vue +++ b/src/uni_modules/uview-plus/components/up-gap/up-gap.vue @@ -3,7 +3,7 @@ + + diff --git a/src/uni_modules/uview-plus/components/up-icon/up-icon.vue b/src/uni_modules/uview-plus/components/up-icon/up-icon.vue index 4043fd9e7..115e70de7 100644 --- a/src/uni_modules/uview-plus/components/up-icon/up-icon.vue +++ b/src/uni_modules/uview-plus/components/up-icon/up-icon.vue @@ -48,7 +48,7 @@ // 引入图标名称,已经对应的unicode import icons from './icons' - import { props } from './props'; + import { propsIcon } from './props'; import { mpMixin } from '../../libs/mixin/mpMixin'; import { mixin } from '../../libs/mixin/mixin'; import { addUnit, addStyle } from '../../libs/function/index'; @@ -87,7 +87,7 @@ } }, emits: ['click'], - mixins: [mpMixin, mixin, props], + mixins: [mpMixin, mixin, propsIcon], computed: { uClasses() { let classes = [] diff --git a/src/uni_modules/uview-plus/components/up-image/image.uts b/src/uni_modules/uview-plus/components/up-image/image.uts new file mode 100644 index 000000000..478fd8edb --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-image/image.uts @@ -0,0 +1,30 @@ +/* + * @Author : LQ + * @Description : + * @version : 1.0 + * @Date : 2021-08-20 16:44:21 + * @LastAuthor : LQ + * @lastTime : 2021-08-20 17:01:51 + * @FilePath : /u-view2.0/uview-ui/libs/config/props/image.js + */ +export default { + // image组件 + image: { + src: '', + mode: 'aspectFill', + width: '300', + height: '225', + shape: 'square', + radius: '0', + lazyLoad: false, + showMenuByLongpress: true, + loadingIcon: 'photo', + errorIcon: 'error-circle', + showLoading: true, + showError: true, + fade: true, + webp: false, + duration: 500, + bgColor: '#f3f4f6' + } +} as UTSJSONObject diff --git a/src/uni_modules/uview-plus/components/up-image/props.js b/src/uni_modules/uview-plus/components/up-image/props.js index 9f02d6e7d..f8feb0386 100644 --- a/src/uni_modules/uview-plus/components/up-image/props.js +++ b/src/uni_modules/uview-plus/components/up-image/props.js @@ -1,6 +1,7 @@ import { defineMixin } from '../../libs/vue' -import defProps from '../../libs/config/props.js' -export const props = defineMixin({ +import defProps from '../../libs/config/props' + +export const propsImage = defineMixin({ props: { // 图片地址 src: { diff --git a/src/uni_modules/uview-plus/components/up-image/props.uts b/src/uni_modules/uview-plus/components/up-image/props.uts new file mode 100644 index 000000000..458f8856f --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-image/props.uts @@ -0,0 +1,87 @@ +import { defineMixin } from '../../libs/vue' +import defProps from '../../libs/config/props' + +export const propsImage = defineMixin({ + props: { + // 图片地址 + src: { + type: String, + default: defProps.getString('image.src') + }, + // 裁剪模式 + mode: { + type: String, + default: defProps.getString('image.mode') + }, + // 宽度,单位任意 + width: { + type: [String], + default: defProps.getString('image.width') + }, + // 高度,单位任意 + height: { + type: [String], + default: defProps.getString('image.height') + }, + // 图片形状,circle-圆形,square-方形 + shape: { + type: String, + default: defProps.getString('image.shape') + }, + // 圆角,单位任意 + radius: { + type: [String], + default: defProps.getString('image.radius') + }, + // 是否懒加载,微信小程序、App、百度小程序、字节跳动小程序 + lazyLoad: { + type: Boolean, + default: defProps.getBoolean('image.lazyLoad') + }, + // 开启长按图片显示识别微信小程序码菜单 + showMenuByLongpress: { + type: Boolean, + default: defProps.getBoolean('image.showMenuByLongpress') + }, + // 加载中的图标,或者小图片 + loadingIcon: { + type: String, + default: defProps.getString('image.loadingIcon') + }, + // 加载失败的图标,或者小图片 + errorIcon: { + type: String, + default: defProps.getString('image.errorIcon') + }, + // 是否显示加载中的图标或者自定义的slot + showLoading: { + type: Boolean, + default: defProps.getBoolean('image.showLoading') + }, + // 是否显示加载错误的图标或者自定义的slot + showError: { + type: Boolean, + default: defProps.getBoolean('image.showError') + }, + // 是否需要淡入效果 + fade: { + type: Boolean, + default: defProps.getBoolean('image.fade') + }, + // 只支持网络资源,只对微信小程序有效 + webp: { + type: Boolean, + default: defProps.getBoolean('image.webp') + }, + // 过渡时间,单位ms + duration: { + type: [Number], + default: defProps.getNumber('image.duration') + }, + // 背景颜色,用于深色页面加载图片时,为了和背景色融合 + bgColor: { + type: String, + default: defProps.getString('image.bgColor') + } + } +}) diff --git a/src/uni_modules/uview-plus/components/up-image/up-image.uvue b/src/uni_modules/uview-plus/components/up-image/up-image.uvue new file mode 100644 index 000000000..6fe88d563 --- /dev/null +++ b/src/uni_modules/uview-plus/components/up-image/up-image.uvue @@ -0,0 +1,238 @@ + + + + + diff --git a/src/uni_modules/uview-plus/components/up-image/up-image.vue b/src/uni_modules/uview-plus/components/up-image/up-image.vue index 823d1fa32..56680dd54 100644 --- a/src/uni_modules/uview-plus/components/up-image/up-image.vue +++ b/src/uni_modules/uview-plus/components/up-image/up-image.vue @@ -64,7 +64,7 @@ + + diff --git a/src/uni_modules/uview-plus/components/up-line/up-line.vue b/src/uni_modules/uview-plus/components/up-line/up-line.vue index d6d34768e..aa7a30a61 100644 --- a/src/uni_modules/uview-plus/components/up-line/up-line.vue +++ b/src/uni_modules/uview-plus/components/up-line/up-line.vue @@ -8,7 +8,7 @@ + + diff --git a/src/uni_modules/uview-plus/components/up-loading-icon/up-loading-icon.vue b/src/uni_modules/uview-plus/components/up-loading-icon/up-loading-icon.vue index 429d8f237..e793cd5c3 100644 --- a/src/uni_modules/uview-plus/components/up-loading-icon/up-loading-icon.vue +++ b/src/uni_modules/uview-plus/components/up-loading-icon/up-loading-icon.vue @@ -58,7 +58,7 @@ + + diff --git a/src/uni_modules/uview-plus/components/up-transition/up-transition.vue b/src/uni_modules/uview-plus/components/up-transition/up-transition.vue index cbd2ccee0..69d1f5f13 100644 --- a/src/uni_modules/uview-plus/components/up-transition/up-transition.vue +++ b/src/uni_modules/uview-plus/components/up-transition/up-transition.vue @@ -13,7 +13,7 @@ + +``` \ No newline at end of file diff --git a/src/uni_modules/wa-clipboard/utssdk/app-android/index.uts b/src/uni_modules/wa-clipboard/utssdk/app-android/index.uts new file mode 100644 index 000000000..7206ff65f --- /dev/null +++ b/src/uni_modules/wa-clipboard/utssdk/app-android/index.uts @@ -0,0 +1,33 @@ +import ClipData from "android.content.ClipData"; +// import ClipDescription from "android.content.ClipDescription"; +import ClipboardManager from "android.content.ClipboardManager"; +import Context from "android.content.Context"; +import { UTSAndroid } from "io.dcloud.uts"; + +// export const setClipboardData : void = function () { +// export function setClipboardData() : void { +export function setClipboardData(data:string) : void { + const context = UTSAndroid.getAppContext(); + if (context != null) { + const cm = context.getSystemService( + Context.CLIPBOARD_SERVICE + ) as ClipboardManager; + cm.setText(data); + // return + // let cd = ClipData.newPlainText("label") as ClipData + // cm.setPrimaryClip(cd); + } +} + +export function getClipboardData() : string { + const context = UTSAndroid.getAppContext(); + if (context != null) { + const cm = context.getSystemService( + Context.CLIPBOARD_SERVICE + ) as ClipboardManager; + return cm.getText().toString() + } + else{ + return "" + } +} diff --git a/src/uni_modules/wa-clipboard/utssdk/app-ios/index.uts b/src/uni_modules/wa-clipboard/utssdk/app-ios/index.uts new file mode 100644 index 000000000..9162ed6f8 --- /dev/null +++ b/src/uni_modules/wa-clipboard/utssdk/app-ios/index.uts @@ -0,0 +1,10 @@ +import { UIPasteboard } from "UIKit" +export function getClipboardData() : string { + let pasteboard = UIPasteboard.general + return (pasteboard.string == null) ? "" : pasteboard.string! +} + +export function setClipboardData(data:string) : void { + let pasteboard = UIPasteboard.general + pasteboard.string = data +} \ No newline at end of file