官方QQ交流群
-
+
群35:713420817(2000人已满)
群34:530305531(2000人已满)
群33:498071674(2000人已满)
@@ -146,7 +146,7 @@
群24:672494800(2000人已满)
群23:599958679(2000人已满)
群22:687186952(2000人已满)
-
+
群21:717019120(2000人已满)
群20:165796402(2000人已满)
群19:165657124(2000人已满)
群18:698592271(2000人已满)
@@ -156,7 +156,7 @@
群14:465953250(2000人已满)
群13:699478442(2000人已满)
群12:884860657(2000人已满)
-
群11:296811328(2000人已满)
+
群10:959059626(2000人已满)
群9:775128777(2000人已满)
群8:695442854(2000人已满)
diff --git a/docs/component/ad-draw.md b/docs/component/ad-draw.md
index 0967002b52630afeea647dd6330136c654fbf64f..10aee25d81e97e52bba51b8d0eac55608b46d7ad 100644
--- a/docs/component/ad-draw.md
+++ b/docs/component/ad-draw.md
@@ -101,7 +101,7 @@
-
+
@@ -115,6 +115,7 @@
}
},
onReady: function (e) {
+ this.getAdData()
},
methods: {
getAdData: function (e) {
diff --git a/docs/component/ad-rewarded-video.md b/docs/component/ad-rewarded-video.md
index e39daf2b5f92b318f6e5ae3891bf445471f17708..0c487b805f5a3b3ecc2985c4eddc1ddf46cf1510 100644
--- a/docs/component/ad-rewarded-video.md
+++ b/docs/component/ad-rewarded-video.md
@@ -1,3 +1,3 @@
### 激励视频广告
-文档地址已迁移至:[https://uniapp.dcloud.io/api/ad/rewarded-video-ad/](https://uniapp.dcloud.io/api/ad/rewarded-video-ad)
\ No newline at end of file
+文档地址已迁移至:[https://uniapp.dcloud.io/api/ad/rewarded-video](https://uniapp.dcloud.io/api/ad/rewarded-video)
\ No newline at end of file
diff --git a/docs/component/ad.md b/docs/component/ad.md
index f7d74f50f6e00b3498d6c3fe1e92bb352c0954fa..da055316553cae8e3f369cdfb3b9d0960f124ee7 100644
--- a/docs/component/ad.md
+++ b/docs/component/ad.md
@@ -192,6 +192,7 @@ export default {
width: 300 // 根据宽度获取合适的广告(单位px)
},
(res) => {
+ // 注意: 广告数据只能使用一次
this.adData = res.ads[0];
console.log(this.adData);
},
diff --git a/docs/component/datacom.md b/docs/component/datacom.md
index 0b8d44d2d514f23f17cf9b6276d3c5c986b601dc..296bc52b678b3e4735405e8b271c8d2865d24084 100644
--- a/docs/component/datacom.md
+++ b/docs/component/datacom.md
@@ -350,3 +350,469 @@ datacom组件规范还要求支持绑定 value,且支持双向绑定,即:
|tree(树状控件) |单选、多选 |树 |平铺 |展示 | |
欢迎开发者们开发这些`datacom组件`,后续插件市场将单列出datacom组件,给予更高的显示权重。
+
+
+### 使用mixinDatacom快速开发datacom@mixindatacom
+
+> 版本要求:HBuilderX 3.1.0+
+
+开发一个支持localdata的datacom组件相对容易,但要开发支持云端数据的datacom组件,实现对collection、field、where等属性的解析,工作量还是不小的。
+
+为此官方提供了一个mixin混入库,开发者在自己的datacom组件中混入`uniCloud.mixinDatacom`,即可方便的让自己的组件支持本地和云端的数据绑定,快速完成datacom组件。
+
+mixin是vue的技术,不熟悉的可以点此了解[vue官网的mixin文档](https://cn.vuejs.org/v2/api/#Vue-mixin)
+
+#### 语法手册
+
+`uniCloud.mixinDatacom` 的props
+
+与标准的datacom组件相同,除了localdata外,其他都是`uniCloud-db组件`的标准属性。
+
+|属性名 | 类型 | 默认值 | 说明|
+|:-: | :-: | :-: | :-: |
+|localdata |Array | |本地数据,[详情](https://uniapp.dcloud.net.cn/component/datacom)|
+|collection |String | |表名。支持输入多个表名,用 `,` 分割|
+|field |String | |查询字段,多个字段用 `,` 分割|
+|where |String | |查询条件,内容较多,另见jql文档:[详情](https://uniapp.dcloud.net.cn/uniCloud/uni-clientDB?id=jsquery)|
+|orderby |String | |排序字段及正序倒叙设置|
+|groupby |String | |对数据进行分组|
+|group-field |String | |对数据进行分组统计|
+|distinct |Boolean | false |是否对数据查询结果中重复的记录进行去重|
+|action |string | |云端执行数据库查询的前或后,触发某个action函数操作,进行预处理或后处理,[详情](https://uniapp.dcloud.net.cn/uniCloud/uni-clientDB?id=%e4%ba%91%e7%ab%af%e9%83%a8%e5%88%86)。场景:前端无权操作的数据,比如阅读数+1|
+|page-data |String | add |分页策略选择。值为 `add` 代表下一页的数据追加到之前的数据中,常用于滚动到底加载下一页;值为 `replace` 时则替换当前data数据,常用于PC式交互,列表底部有页码分页按钮|
+|page-current |Number | 0 |当前页|
+|page-size |Number | 10 |每页数据数量|
+|getcount |Boolean | false |是否查询总数据条数,默认 `false`,需要分页模式时指定为 `true`|
+|getone |Boolean | false |指定查询结果是否仅返回数组第一条数据,默认 false。在false情况下返回的是数组,即便只有一条结果,也需要[0]的方式获取。在值为 true 时,直接返回结果数据,少一层数组。一般用于非列表页,比如详情页|
+|gettree |Boolean | false |是否查询树状数据,默认 `false`|
+|startwith |String | '' |`gettree`的第一层级条件,此初始条件可以省略,不传startWith时默认从最顶级开始查询|
+|limitlevel |Number | 10 |`gettree`查询返回的树的最大层级。超过设定层级的节点不会返回。默认10级,最大15,最小1|
+
+
+`uniCloud.mixinDatacom` 的data
+
+|属性名 | 类型 | 默认值 | 说明|
+|:-: | :-: | :-: | :-: |
+|mixinDatacomLoading |Boolean | false |加载数据状态|
+|mixinDatacomHasMore |Boolean | false |是否有更多数据|
+|mixinDatacomResData |Array | [] |查询返回的数据|
+|mixinDatacomErrorMessage |String | |错误消息|
+|mixinDatacomPage |OBject | |分页信息|
+
+
+`uniCloud.mixinDatacom` methods
+
+|方法名 | 说明|
+|:-: | :-: |
+|mixinDatacomGet |加载数据|
+|mixinDatacomEasyGet |加载数据,包含 `mixinDatacomLoading` 、`mixinDatacomHasMore`、`mixinDatacomErrorMessage` 逻辑 |
+|onMixinDatacomPropsChange |属性发生变化时触发|
+
+#### 使用方法
+
+使用 `uniCloud.mixinDatacom` 开发 `datacom` 组件需要以下步骤
+
+1. 在export default下声明`mixin: [uniCloud.mixinDatacom]`
+2. 在template中定义三个标签,绑定 `uniCloud.mixinDatacom` 的 `data` 状态,加载中`mixinDatacomLoading` 、加载出错提示 `mixinDatacomErrorMessage`、处理数据及相关UI展现 `mixinDatacomResData`
+3. 组件的created声明周期中调用 `uniCloud.mixinDatacom` 中的 `mixinDatacomGet()` 或 `mixinDatacomEasyGet()` 方法请求云端数据库。这两种方法的区别如下:
+ - `mixinDatacomGet()` 仅请求数据,自行处理各种状态和异常。
+ - `mixinDatacomEasyGet()` 在 `mixinDatacomGet()` 的基础之上封装了加载状态、分页及错误消息,可通过模板绑定。用起来更简单
+
+
+使用 `uniCloud.mixinDatacom` 开发 `datacom` 组件的优势
+
+- 不需要定义 `datacom` 组件的属性
+- 不需要关心 `uniClinetDB` API
+- 不需要判断哪些属性变化时需要重置已加载数据, 仅判断 `onMixinDatacomPropsChange(needReset, changed) {}` 参数 `needReset` 是否为 `true` 即可
+- 当 `uniClinetDB` 有新增属性时,组件代码也不需要跟随更新
+
+
+例如要开发一个datacom组件,名为uni-data-jql:
+
+- 方法1,使用 `mixinDatacomEasyGet()`
+
+```html
+
+
+
+ Loading...
+
+ 请求错误:{{mixinDatacomErrorMessage}}
+
+
+
+ {{mixinDatacomResData}}
+
+
+
+
+
+```
+
+
+- 方法2,使用 `mixinDatacomGet()`
+
+需要多写些代码处理各种状态。如果`mixinDatacomEasyGet`的封装无法灵活满足你的需求,可以使用这种方式。
+
+```html
+
+
+
+ Loading...
+
+ 请求错误:{{mixinDatacomErrorMessage}}
+
+
+
+ {{mixinDatacomResData}}
+
+
+
+
+
+```
+
+
+做好这个uni-data-jql组件后,就可以在页面中使用了:
+
+```html
+
+
+
+
+
+
+
+```
+
+
+#### `uniCloud.mixinDatacom` 源码 @mixinDatacomsource
+为方便开发者理解mixinDatacom的工作原理,这里贴出mixinDatacom的源码:
+
+```js
+export default {
+ props: {
+ localdata: {
+ type: Array,
+ default () {
+ return []
+ }
+ },
+ options: {
+ type: [Object, Array],
+ 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
+ },
+ gettree: {
+ type: [Boolean, String],
+ default: false
+ },
+ gettreepath: {
+ type: [Boolean, String],
+ default: false
+ },
+ startwith: {
+ type: String,
+ default: ''
+ },
+ limitlevel: {
+ type: Number,
+ default: 10
+ },
+ groupby: {
+ type: String,
+ default: ''
+ },
+ groupField: {
+ type: String,
+ default: ''
+ },
+ distinct: {
+ type: [Boolean, String],
+ default: false
+ },
+ manual: {
+ type: Boolean,
+ default: false
+ }
+ },
+ data() {
+ return {
+ mixinDatacomLoading: false, // 网络请求状态
+ mixinDatacomHasMore: false, // 是否有更多数据
+ mixinDatacomResData: [], // 请求返回的数据,调用 loadData 后会更新
+ mixinDatacomErrorMessage: '', // 请求出错时的错误消息
+ mixinDatacomPage: {} // 分页信息,详情见 created 生命周期
+ }
+ },
+ created() {
+ this.mixinDatacomPage = {
+ current: this.pageCurrent, // 当前页面,初始化设置 props中的 pageCurrent
+ size: this.pageSize, // 页面大小,初始化设置 props中的 pageSize
+ count: 0, // 数据总数,getcount=true时有效
+ }
+ this.$watch(() => {
+ var al = [];
+ ['pageCurrent',
+ 'pageSize',
+ 'localdata',
+ 'collection',
+ 'action',
+ 'field',
+ 'orderby',
+ 'where',
+ 'getont',
+ 'getcount',
+ 'gettree'
+ ].forEach(key => {
+ al.push(this[key])
+ })
+ return al
+ }, (newValue, oldValue) => {
+ let needReset = false
+ let changed = []
+ for (let i = 2; i < newValue.length; i++) {
+ if (newValue[i] !== oldValue[i]) {
+ needReset = true
+ changed.push(newValue[i])
+ }
+ }
+ if (newValue[0] !== oldValue[0]) {
+ this.mixinDatacomPage.current = this.pageCurrent
+ }
+ this.mixinDatacomPage.size = this.pageSize
+
+ this.onMixinDatacomPropsChange(needReset, changed)
+ })
+ },
+ methods: {
+ // props发生变化时被调用,在组件中覆盖此方法
+ // 非 pageCurrent,pageSize 改变时 needReset=true,需要重置数据
+ // changed,发生变化的属性名,类型为Array,例如 ['collection', 'action']
+ onMixinDatacomPropsChange(needReset, changed) {},
+ // 加载数据
+ mixinDatacomEasyGet({
+ getone = false,
+ success,
+ fail
+ } = {}) {
+ if (this.mixinDatacomLoading) {
+ return
+ }
+ this.mixinDatacomLoading = true
+
+ this.mixinDatacomErrorMessage = ''
+
+ this.mixinDatacomGet().then((res) => {
+ this.mixinDatacomLoading = false
+ const {
+ data,
+ count
+ } = res.result
+ if (this.getcount) {
+ this.mixinDatacomPage.count = count
+ }
+ this.mixinDatacomHasMore = data.length < this.pageSize
+ const responseData = getone ? (data.length ? data[0] : undefined) : data
+ this.mixinDatacomResData = responseData
+
+ if (success) {
+ success(responseData)
+ }
+ }).catch((err) => {
+ this.mixinDatacomLoading = false
+ this.mixinDatacomErrorMessage = err
+ fail && fail(err)
+ })
+ },
+ // 调用 uniClientDB 查询数据
+ mixinDatacomGet(options = {}) {
+ 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 groupby = options.groupby || this.groupby
+ if (groupby) {
+ db = db.groupBy(groupby)
+ }
+
+ const groupField = options.groupField || this.groupField
+ if (groupField) {
+ db = db.groupField(groupField)
+ }
+
+ const distinct = options.distinct !== undefined ? options.distinct : this.distinct
+ if (distinct === true) {
+ db = db.distinct()
+ }
+
+ const orderby = options.orderby || this.orderby
+ if (orderby) {
+ db = db.orderBy(orderby)
+ }
+
+ const current = options.pageCurrent !== undefined ? options.pageCurrent : this.mixinDatacomPage.current
+ const size = options.pageSize !== undefined ? options.pageSize : this.mixinDatacomPage.size
+ const getCount = options.getcount !== undefined ? options.getcount : this.getcount
+ const gettree = options.gettree !== undefined ? options.gettree : this.gettree
+ const gettreepath = options.gettreepath !== undefined ? options.gettreepath : this.gettreepath
+ const limitLevel = options.limitlevel !== undefined ? options.limitlevel : this.limitlevel
+ const startWith = options.startwith !== undefined ? options.startwith : this.startwith
+
+ const getOptions = {
+ getCount
+ }
+ const treeOptions = {
+ limitLevel,
+ startWith
+ }
+ if (gettree) {
+ getOptions.getTree = treeOptions
+ }
+ if (gettreepath) {
+ getOptions.getTreePath = treeOptions
+ }
+
+ db = db.skip(size * (current - 1)).limit(size).get(getOptions)
+
+ return db
+ }
+ }
+}
+```
diff --git a/docs/component/input.md b/docs/component/input.md
index be077ef4fbcdde97ccf54e852316e641ac81e881..cac6e49b17bff203f948f92128cd8ad2b40cd056 100644
--- a/docs/component/input.md
+++ b/docs/component/input.md
@@ -15,7 +15,7 @@
|disabled|Boolean|false|是否禁用||
|maxlength|Number|140|最大输入长度,设置为 -1 的时候不限制最大长度||
|cursor-spacing|Number|0|指定光标与键盘的距离,单位 px 。取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离|App、微信小程序、百度小程序、QQ小程序|
-|focus|Boolean|false|获取焦点。|在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。|
+|focus|Boolean|false|获取焦点。|在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点|
|confirm-type|String|done|设置键盘右下角按钮的文字,仅在 type="text" 时生效。|微信小程序、App、H5|
|confirm-hold|Boolean|false|点击键盘右下角按钮时是否保持键盘不收起|App、微信小程序、支付宝小程序、百度小程序、QQ小程序|
|cursor|Number||指定focus时的光标位置||
diff --git a/docs/component/list.md b/docs/component/list.md
index f4c827494b1b721ea16335634bf8f972022493c9..8d873247ab7cc98c8fcb167323ecb19132a6d8cb 100644
--- a/docs/component/list.md
+++ b/docs/component/list.md
@@ -76,7 +76,8 @@ headerHeight|吸顶距离|Number|是|子list吸顶距离最外层滚动容器顶
如果列表滚动到底部将会立即触发这个事件,你可以在这个事件的处理函数中加载下一页的列表项。 如果未触发,请检查是否设置了loadmoreoffset的值,建议此值设置大于0
- 如何重置 loadmore
-```
+
+```html
@@ -133,13 +134,32 @@ headerHeight|float|0|是|要吸顶的header顶部距离scroller顶部的距离
#### 示例:
+```html
+
+
+
+
+
+
+
+
+
```
-
- // ios 需要配置 fixFreezing="true"
-
- //设置
- const list = this.$refs["list0"];
- list.setSpecialEffects({id:"scroller", headerHeight:150});
- //清除
- list.setSpecialEffects({});
-```
+
+`setSpecialEffects` 完整代码: [https://github.com/dcloudio/hello-uniapp/tree/master/pages/template/swiper-list-nvue](https://github.com/dcloudio/hello-uniapp/tree/master/pages/template/swiper-list-nvue)
diff --git a/docs/component/map.md b/docs/component/map.md
index 82dd58cd762f5735b8f8072464fcaa7d458b65c9..936c4092a033a6c9a87cac3161fc3c323295ee04 100644
--- a/docs/component/map.md
+++ b/docs/component/map.md
@@ -16,7 +16,10 @@
|:-|:-|:-|:-|:-|
|longitude|Number||中心经度||
|latitude|Number||中心纬度||
-|scale|Number|16|缩放级别,取值范围为5-18||
+|scale|Number|16|缩放级别,取值范围为3-20|高德地图缩放比例与微信小程序不同|
+|min-scale|Number|3|最小缩放级别|App-nvue 3.1.0+、微信小程序2.13+|
+|max-scale|Number|20|最大缩放级别|App-nvue 3.1.0+、微信小程序2.13+|
+|layer-style|Number|1|个性化地图|App-nvue 3.1.0+、微信小程序2.13+|
|markers|Array||标记点||
|polyline|Array||路线||
|circles|Array||圆||
@@ -30,8 +33,11 @@
|enable-overlooking|Boolean|false|是否开启俯视|App-nvue 2.1.5+、微信小程序2.3.0|
|enable-satellite|Boolean|false|是否开启卫星图|App-nvue 2.1.5+、微信小程序2.7.0|
|enable-traffic|Boolean|false|是否开启实时路况|App-nvue 2.1.5+、微信小程序2.7.0|
+|enable-poi|Boolean|false|是否展示 POI 点|App-nvue 3.1.0+|
+|enable-building|Boolean|false|是否展示建筑物|App-nvue 3.1.0+ 支持 (**废除原enable-3D属性 高德地图默认开启建筑物就是3D无法设置**)|
|show-location|Boolean||显示带有方向的当前定位点|微信小程序、H5、百度小程序、支付宝小程序|
|polygons|Array.``||多边形|App-nvue 2.1.5+、微信小程序、百度小程序、支付宝小程序|
+|enable-indoorMap|Boolean|false|是否展示室内地图|App-nvue 3.1.0+|
|@markertap|EventHandle||点击标记点时触发,e.detail = {markerId}|App-nvue 2.3.3+, App平台需要指定 marker 对象属性 id|
|@labeltap|EventHandle||点击label时触发,e.detail = {markerId} |微信小程序2.9.0|
|@callouttap|EventHandle||点击标记点对应的气泡时触发,e.detail = {markerId}||
@@ -39,11 +45,13 @@
|@regionchange|EventHandle||视野发生变化时触发|微信小程序、H5、百度小程序、支付宝小程序|
|@tap|EventHandle||点击地图时触发; App-nuve、微信小程序2.9支持返回经纬度||
|@updated|EventHandle||在地图渲染更新完成时触发|微信小程序、H5、百度小程序|
+|@anchorpointtap|EventHandle||点击定位标时触发,e.detail = {longitude, latitude}|App-nvue 3.1.0+、微信小程序2.13+|
**注意**
- ` |