提交 41520f88 编写于 作者: jieni_cao's avatar jieni_cao

Merge branch 'master' into 'weixin_38603118-master-patch-41488'

# Conflicts:
#   docs/api/media/image.md
......@@ -8,7 +8,7 @@ const { simplifySlugText, tabs } = require('./utils')
const copyOptions = require('./config/copy');
const config = {
theme: 'vuepress-theme-uni-app-test',
theme: 'vuepress-theme-uniapp-official',
title: 'uni-app官网',
description: 'uni-app,uniCloud,serverless',
evergreen: process.env.NODE_ENV === 'development',
......@@ -94,21 +94,6 @@ const config = {
.end()
.plugin('img-add-attrs')
.use(require('./markdown/img-add-attrs'))
.end()
.plugin('attrs')
.use(require('markdown-it-attrs'),[{
leftDelimiter: '#{',
rightDelimiter: '}'
}])
.end()
.plugin('task-lists')
.use(require('markdown-it-task-lists'))
.end()
.plugin('inject-json-to-md')
.use(require('./markdown/inject-json-to-md'))
.end()
.plugin('markdown-it-raw-table')
.use(require('markdown-it-raw-table'))
}
},
chainWebpack (config, isServer) {
......
......@@ -45,7 +45,7 @@ export default {
},
{
subTitle: 'uni-pay',
url: 'https://uniapp.dcloud.net.cn/uniCloud/unipay',
url: 'https://doc.dcloud.net.cn/uniCloud/uni-pay/uni-app.html',
},
{
subTitle: 'uni-push',
......
......@@ -198,6 +198,13 @@ export default {
state: 1,
prefix: '群27',
},
{
number: '166188776',
state: 1,
prefix: '群28',
joinQQGroupHref:
'https://qm.qq.com/cgi-bin/qm/qr?k=jSmA3SLhDdILrUw3EMpN4iWSKgEuSLVW&jump_from=webapi&authKey=iVG0LhlB2TNKwrAf6CChQKeRddFhjjgbXqBgswaLK0UorBqZNKvu4q5XGwXThpsn',
},
{
number: '202965481',
state: 1,
......@@ -232,13 +239,6 @@ export default {
number: '713420817',
state: 1,
prefix: '群35',
},
{
number: '166188776',
state: 0,
prefix: '群28',
joinQQGroupHref:
'https://qm.qq.com/cgi-bin/qm/qr?k=jSmA3SLhDdILrUw3EMpN4iWSKgEuSLVW&jump_from=webapi&authKey=iVG0LhlB2TNKwrAf6CChQKeRddFhjjgbXqBgswaLK0UorBqZNKvu4q5XGwXThpsn',
},
}
],
};
......@@ -40,7 +40,7 @@ function addLoadingAttr(attribs) {
*/
function matchSrc(src) {
return typeof src === 'string'
? src.indexOf('qiniu-web-assets.dcloud.net.cn') > -1
? (src.indexOf('qiniu-web-assets.dcloud.net.cn') > -1 || src.indexOf('web-ext-storage.dcloud.net.cn') > -1)
: false;
}
......@@ -61,6 +61,7 @@ function replaceHTML(token, replace, env) {
const htmlparser = require('htmlparser2');
const serializer = require('dom-serializer');
const dom = new htmlparser.parseDocument(token.content, {
lowerCaseTags: false,
recognizeCDATA: true,
recognizeSelfClosing: true,
});
......
let cssJson = {};
let utsJson = {};
let utsApiJson = {};
let utsComJson = {};
let utsUnicloudApiJson = {};
let customTypeJson = {};
let vueJson = {};
let manifestJson = {};
let pagesJson = {};
let specialStringJson = {};
let pageInstanceJson = {};
try {
cssJson = require('../utils/cssJson.json');
} catch (error) {}
try {
utsJson = require('../utils/utsJson.json');
} catch (error) {}
try {
utsApiJson = require('../utils/utsApiJson.json');
} catch (error) {}
try {
utsComJson = require('../utils/utsComJson.json');
} catch (error) {}
try {
utsUnicloudApiJson = require('../utils/utsUnicloudApiJson.json');
} catch (error) {}
try {
customTypeJson = require('../utils/customTypeJson.json');
} catch (error) {}
try {
vueJson = require('../utils/vueJson.json');
} catch (error) {}
try {
manifestJson = require('../utils/manifestJson.json');
} catch (error) {}
try {
pagesJson = require('../utils/pagesJson.json');
} catch (error) {}
try {
specialStringJson = require('../utils/specialStringJson.json');
} catch (error) {}
try {
pageInstanceJson = require('../utils/pageInstanceJson.json');
} catch (error) {}
function getRegExp(key) {
return new RegExp(`<!--\\s*${key}.([\\w\\W]+[^\\s])\\s*-->`)
}
const getJSON = text => {
let match = text.match(getRegExp('CSSJSON'));
if (match) {
return {
match,
json: cssJson,
};
}
match = text.match(getRegExp('UTSJSON'));
if (match) {
return {
match,
json: utsJson,
};
}
match = text.match(getRegExp('UTSAPIJSON'));
if (match) {
return {
match,
json: utsApiJson,
};
}
match = text.match(getRegExp('UTSCOMJSON'));
if (match) {
return {
match,
json: utsComJson,
};
}
match = text.match(getRegExp('UTSUNICLOUDAPIJSON'));
if (match) {
return {
match,
json: utsUnicloudApiJson,
};
}
match = text.match(getRegExp('CUSTOMTYPEJSON'));
if (match) {
return {
match,
json: customTypeJson,
};
}
match = text.match(getRegExp('VUEJSON'));
if (match) {
return {
match,
json: vueJson,
};
}
match = text.match(getRegExp('MANIFESTJSON'));
if (match) {
return {
match,
json: manifestJson,
};
}
match = text.match(getRegExp('PAGESJSON'));
if (match) {
return {
match,
json: pagesJson,
};
}
match = text.match(getRegExp('SPECIALSTRINGJSON'));
if (match) {
return {
match,
json: specialStringJson,
};
}
match = text.match(getRegExp('PAGEINSTANCE'));
if (match) {
return {
match,
json: pageInstanceJson,
};
}
return {
match: null,
json: {},
};
};
module.exports = function (md, opts) {
if (Object.keys(cssJson) === 0) return false;
md.core.ruler.after('inline', 'merge-css', function (state) {
const ids = []
let idIdx = 1
for (let index = 0; index < state.tokens.length; index++) {
const blockToken = state.tokens[index];
if (blockToken.type === 'html_block') {
const { match, json } = getJSON(blockToken.content);
if (match) {
const jsonPath = match[1];
const path = jsonPath.split('.');
let temp = json;
path.forEach(key => {
if (!temp) return false;
temp = temp[key];
});
if (!temp) continue;
const parseTokens = md.parse(temp);
parseTokens.forEach(token => {
if (token.type === 'heading_open') {
const id = token.attrGet('id')
if(ids.includes(id)) {
token.attrSet('id', `${id}_${idIdx++}`)
} else {
ids.push(id)
}
}
})
state.tokens.splice(index, 1, ...parseTokens);
index = index + parseTokens.length - 1;
// blockToken.content = temp
}
}
}
return false;
});
};
此差异已折叠。
此差异已折叠。
{"manifest":{"table":"| 属性 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| appid | string | - | [DCloud AppID 使用说明](https://ask.dcloud.net.cn/article/35907) |\n| name | string | - | 应用名称 |\n| description | string | - | 应用描述 |\n| versionName | string | - | 应用版本名称 |\n| versionCode | integer | - | 应用版本号,必须是整数,取值范围1~2147483647;升级时必须高于上一次设置的值。 |\n| locale | '' | - | 默认语言 |\n| fallbackLocale | '' | - | 默认回退语言 |\n| uni-app-x | [uni-app-x 配置项列表](#manifest-uni-app-x) | - | 存在uni-app-x节点则表示为uni-app x项目 |\n| app | [app 配置项列表](#manifest-app) | - | App端(原生App)配置 |","description":"[配置指南](http://uniapp.dcloud.io/manifest)"},"manifest_uni-app-x":{"table":"| 属性 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| flex-direction | 'row' \\| 'row-reverse' \\| 'column' \\| 'column-reverse' | column | uvue页面默认flex排列方向 |","description":"存在uni-app-x节点则表示为uni-app x项目"},"manifest_app":{"table":"| 属性 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| distribute | [distribute 配置项列表](#app-distribute) | - | App端发布配置 |","description":"App端(原生App)配置"},"app_distribute":{"table":"| 属性 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| syncDebug | boolean | - | 是否为自定义调试基座 |\n| icons | [icons 配置项列表](#distribute-icons) | - | iOS、Android应用图标配置。云打包后生效,建议在HBuilderX中 manifest.json 的可视化界面操作,不推荐手动在源码视图中修改。 |\n| android | [android 配置项列表](#distribute-android) | - | App-Android端发布配置 |\n| ios | [ios 配置项列表](#distribute-ios) | - | IOS配置 |","description":"App端发布配置"},"distribute_icons":{"table":"| 属性 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| android | [android 配置项列表](#icons-android) | - | Android图标配置 |\n| ios | [ios 配置项列表](#icons-ios) | - | iOS图标配置 |","description":"iOS、Android应用图标配置。云打包后生效,建议在HBuilderX中 manifest.json 的可视化界面操作,不推荐手动在源码视图中修改。"},"icons_android":{"table":"| 属性 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| hdpi | string | - | 高分屏设备程序图标,分辨率要求72x72 |\n| xhdpi | string | - | 720P高分屏设备程序图标,分辨率要求96x96 |\n| xxhdpi | string | - | 1080P高分屏设备程序图标,分辨率要求144x144 |\n| xxxhdpi | string | - | 2K屏设备程序图标,分辨率要求192x192 |"},"icons_ios":{"table":"| 属性 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| appstore | string | - | 提交app store使用的图标 1024x1024 |\n| iphone | [iphone 配置项列表](#ios-iphone) | - | iPhone图标配置 |\n| ipad | [ipad 配置项列表](#ios-ipad) | - | iPad图标配置 |"},"ios_iphone":{"table":"| 属性 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| app@2x | string | - | iOS9.0+ 程序图标(2x) |\n| app@3x | string | - | iOS9.0+ 程序图标(3x) |\n| spotlight@2x | string | - | iOS9.0+ Spotlight图标(2x) |\n| spotlight@3x | string | - | iOS9.0+ Spotlight图标(3x) |\n| settings@2x | string | - | iOS9.0+ Settings设置图标(2x) |\n| settings@3x | string | - | iOS9.0+ Settings设置图标(3x) |\n| notification@2x | string | - | iOS9.0+ 通知栏图标(2x) |\n| notification@3x | string | - | iOS9.0+ 通知栏图标(3x) |"},"ios_ipad":{"table":"| 属性 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| app | string | - | iOS9.0+ 程序图标 |\n| app@2x | string | - | iOS9.0+ 程序图标(2x) |\n| proapp@2x | string | - | iOS9.0+ 程序图标(3x) |\n| spotlight | string | - | iOS9.0+ Spotlight图标 |\n| spotlight@2x | string | - | iOS9.0+ Spotlight图标(2x) |\n| settings | string | - | iOS9.0+ Settings设置图标 |\n| settings@2x | string | - | iOS9.0+ Settings设置图标(2x) |\n| notification | string | - | iOS9.0+ 通知栏图标 |\n| notification@2x | string | - | iOS9.0+ 通知栏图标(2x) |"},"distribute_android":{"table":"| 属性 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| minSdkVersion | integer | 21 | 应用兼容的最低Android版本(API等级);[参考文档](https://uniapp.dcloud.io/tutorial/app-android-minsdkversion) |\n| targetSdkVersion | integer | 30 | 应用适配的目标Android版本(API等级),部分应用市场要求设置较高的targetSdkVersion才能提交审核;[参考文档](https://uniapp.dcloud.io/tutorial/app-android-targetsdkversion) |\n| abiFilters | Array\\<'armeabi-v7a' \\| 'arm64-v8a' \\| 'x86' \\| 'x86_64'> | [\"arm64-v8a\"\\] | [参考文档](https://uniapp.dcloud.io/tutorial/app-android-abifilters) |","description":"App-Android端发布配置"},"distribute_ios":{"table":"| 属性 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| appid | string | - | iOS Bundle ID |"},"tutorial":"## 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=collocation.manifest_json)"}
\ No newline at end of file
{"lifeCycle":{"name":"页面生命周期","compatibility":"| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| onInit | x | x | x | x | x | x |\n| onLoad | 5.0 | √ | √ | 10.0 | √ | x |\n| onShow | 5.0 | √ | √ | 10.0 | √ | x |\n| onReady | 5.0 | √ | √ | 10.0 | √ | x |\n| onHide | 5.0 | √ | √ | 10.0 | √ | x |\n| onUnload | 5.0 | √ | √ | 10.0 | √ | x |\n| onPullDownRefresh | 5.0 | √ | √ | 10.0 | √ | x |\n| onReachBottom | 5.0 | √ | √ | 10.0 | √ | x |\n| onShareAppMessage | x | x | x | x | x | x |\n| onShareTimeline | x | x | x | x | x | x |\n| onAddToFavorites | x | x | x | x | x | x |\n| onPageScroll | 5.0 | √ | √ | 10.0 | √ | x |\n| onResize | 5.0 | √ | √ | 10.0 | √ | x |\n| onTabItemTap | 5.0 | √ | x | 10.0 | √ | x |\n| onNavigationBarButtonTap | 5.0 | √ | x | 10.0 | √ | x |\n| onBackPress | 5.0 | √ | √ | 10.0 | √ | x |\n| onNavigationBarSearchInputChanged | 5.0 | √ | x | 10.0 | √ | x |\n| onNavigationBarSearchInputConfirmed | 5.0 | √ | x | 10.0 | √ | x |\n| onNavigationBarSearchInputClicked | 5.0 | √ | x | 10.0 | √ | x |"}}
\ No newline at end of file
{"pages":{"compatibility":"**pages.json 兼容性** \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| globalStyle | 5.0 | √ | √ | 10.0 | √ | x |\n| pages | 5.0 | √ | √ | 10.0 | √ | x |\n| tabBar | 5.0 | √ | √ | 10.0 | √ | x |\n| condition | 5.0 | √ | √ | 10.0 | √ | x |\n| easycom | 5.0 | 2.5.5+ | √ | 10.0 | 2.5.5+ | x |","table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| globalStyle | [globalStyle 配置项列表](#pages-globalstyle) | - | 否 | - |\n| pages | Array\\<[PagesOptionsPage](#pagesoptionspage)> | - | 是 | 页面路径及窗口表现 |\n| tabBar | [tabBar 配置项列表](#pages-tabbar) | - | 否 | - |\n| condition | [condition 配置项列表](#pages-condition) | - | 否 | - |\n| easycom | [easycom 配置项列表](#pages-easycom) | - | 否 | 组件自动引入规则 |"},"pages_globalStyle":{"compatibility":"**globalStyle 兼容性** \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| navigationBarBackgroundColor | 5.0 | √ | √ | 10.0 | √ | x |\n| navigationBarTextStyle | 5.0 | √ | √ | 10.0 | √ | x |\n| navigationBarTitleText | 5.0 | √ | √ | 10.0 | √ | x |\n| navigationStyle | 5.0 | 2.0.3+ | √ | 10.0 | 2.0.3+ | x |\n| enablePullDownRefresh | 5.0 | √ | √ | 10.0 | √ | x |","table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| navigationBarBackgroundColor | string (string.ColorString) | APP与H5为#F8F8F8,小程序平台请参考相应小程序文档 | 否 | 导航栏背景颜色(同状态栏背景色) |\n| navigationBarTextStyle | 'white' \\| 'black' | black | 否 | 导航栏标题颜色,仅支持 black/white(支付宝小程序不支持,请使用 [my.setNavigationBar](https://opendocs.alipay.com/mini/api/xwq8e6))。 |\n| navigationBarTitleText | string | - | 否 | 导航栏标题文字内容 |\n| navigationStyle | 'default' \\| 'custom' | default | 否 | 导航栏样式,仅支持 default/custom。custom即取消默认的原生导航栏,需看[使用注意](/collocation/pages.md?id=customnav)。 |\n| enablePullDownRefresh | boolean | false | 否 | 是否开启下拉刷新,详见[页面生命周期](/tutorial/page.md?id=lifecycle)。 |"},"PagesOptionsPage":{"compatibility":"**PagesOptionsPage 兼容性** \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| path | 5.0 | √ | √ | 10.0 | √ | x |\n| style | 5.0 | √ | √ | 10.0 | √ | x |","table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string (string.PageURIString) | - | 是 | 配置页面路径 |\n| style | [style 配置项列表](#pagesoptionspage-style) | - | 否 | - |"},"PagesOptionsPage_style":{"compatibility":"**style 兼容性** \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| navigationBarBackgroundColor | 5.0 | √ | √ | 10.0 | √ | x |\n| navigationBarTextStyle | 5.0 | √ | √ | 10.0 | √ | x |\n| navigationBarTitleText | 5.0 | √ | √ | 10.0 | √ | x |\n| navigationStyle | 5.0 | 2.0.3+ | √ | 10.0 | 2.0.3+ | x |\n| enablePullDownRefresh | 5.0 | √ | √ | 10.0 | √ | x |","table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| navigationBarBackgroundColor | string (string.ColorString) | APP与H5为#F8F8F8,小程序平台请参考相应小程序文档 | 否 | 导航栏背景颜色(同状态栏背景色) |\n| navigationBarTextStyle | 'white' \\| 'black' | black | 否 | 导航栏标题颜色,仅支持 black/white |\n| navigationBarTitleText | string | - | 否 | 导航栏标题文字内容 |\n| navigationStyle | 'default' \\| 'custom' | default | 否 | 导航栏样式,仅支持 default/custom。custom即取消默认的原生导航栏,需看[使用注意](/collocation/pages.md?id=customnav)。 |\n| enablePullDownRefresh | boolean | false | 否 | 是否开启下拉刷新,详见[页面生命周期](/tutorial/page.md#lifecycle)。 |\n| h5 | [h5 配置项列表](#style-h5) | - | 否 | - |\n| mp-alipay | [mp-alipay 配置项列表](#style-mp-alipay) | - | 否 | - |"},"style_h5":{"table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| titleNView | [titleNView 配置项列表](#h5-titlenview) | - | 否 | - |\n| pullToRefresh | [pullToRefresh 配置项列表](#h5-pulltorefresh) | - | 否 | - |"},"h5_titleNView":{"table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| backgroundColor | string (string.ColorString) | #f7f7f7 | 否 | 背景颜色,颜色值格式为\"#RRGGBB\"。 |\n| buttons | array | - | 否 | 自定义按钮,参考 [buttons](/collocation/pages.md?id=h5-titlenview-buttons)。 |\n| titleColor | string (string.ColorString) | #000000 | 否 | 标题文字颜色 |\n| titleText | string | - | 否 | 标题文字内容 |\n| titleSize | string | - | 否 | 标题文字字体大小 |\n| type | 'default' \\| 'transparent' | default | 否 | 导航栏样式。\"default\"-默认样式;\"transparent\"-透明渐变。 |\n| searchInput | object | - | 否 | 导航栏上的搜索框样式,详见:[searchInput](/collocation/pages.md?id=h5-searchinput)。 |"},"h5_pullToRefresh":{"table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| support | boolean | - | 否 | 是否开启窗口的下拉刷新功能 |\n| color | string (string.ColorString) | - | 否 | 颜色值格式为\"#RRGGBB\",仅\"circle\"样式下拉刷新支持此属性。 |\n| type | 'default' \\| 'circle' | - | 否 | 下拉刷新控件样式 |\n| height | string | - | 否 | 窗口的下拉刷新控件进入刷新状态的拉拽高度。支持百分比,如\"10%\";像素值,如\"50px\"。 |\n| range | string | - | 否 | 窗口可下拉拖拽的范围。支持百分比,如\"10%\";像素值,如\"50px\"。 |\n| offset | string | - | 否 | 下拉刷新控件的起始位置。仅对\"circle\"样式下拉刷新控件有效,用于定义刷新控件下拉时的起始位置。支持百分比,如\"10%\";像素值,如\"50px\"。 |\n| contentdown | [contentdown 配置项列表](#pulltorefresh-contentdown) | - | 否 | - |\n| contentover | [contentover 配置项列表](#pulltorefresh-contentover) | - | 否 | - |\n| contentrefresh | [contentrefresh 配置项列表](#pulltorefresh-contentrefresh) | - | 否 | - |"},"pullToRefresh_contentdown":{"table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| caption | string | - | 否 | 下拉刷新控件上显示的标题内容 |"},"pullToRefresh_contentover":{"table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| caption | string | - | 否 | 下拉刷新控件上显示的标题内容 |"},"pullToRefresh_contentrefresh":{"table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| caption | string | - | 否 | 下拉刷新控件上显示的标题内容 |"},"style_mp-alipay":{"table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| allowsBounceVertical | 'YES' \\| 'NO' | YES | 否 | 是否允许向下拉拽。支持 YES / NO |\n| transparentTitle | 'always' \\| 'auto' \\| 'none' | none | 否 | 导航栏透明设置。支持 always 一直透明 / auto 滑动自适应 / none 不透明 |\n| titlePenetrate | 'YES' \\| 'NO' | No | 否 | 导航栏点击穿透 |\n| showTitleLoading | 'YES' \\| 'NO' | No | 否 | 是否进入时显示导航栏的 loading。支持 YES / NO |\n| titleImage | string | - | 否 | 导航栏图片地址,替换导航栏标题,必须为https的图片链接地址 |\n| backgroundImageUrl | string (string.ImageURIString) | - | 否 | 下拉露出显示的背景图链接 |\n| backgroundImageColor | string (string.ColorString) | - | 否 | 下拉露出显示的背景图底色 |\n| gestureBack | 'YES' \\| 'NO' | No | 否 | 支付宝小程序 iOS 用,是否支持手势返回。支持 YES / NO |\n| enableScrollBar | 'YES' \\| 'NO' | YES | 否 | 支付宝小程序 Android 用,是否显示 WebView 滚动条。支持 YES / NO。 |"},"pages_tabBar":{"compatibility":"**tabBar 兼容性** \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| color | 5.0 | √ | √ | 10.0 | √ | x |\n| selectedColor | 5.0 | √ | √ | 10.0 | √ | x |\n| backgroundColor | 5.0 | √ | √ | 10.0 | √ | x |\n| list | 5.0 | √ | √ | 10.0 | √ | x |\n| backgroundImage | 5.0 | √ | √ | 10.0 | √ | x |\n| backgroundRepeat | 5.0 | √ | √ | 10.0 | √ | x |\n| redDotColor | 5.0 | √ | √ | 10.0 | √ | x |","table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| color | string (string.ColorString) | - | 是 | tab 上的文字默认颜色 |\n| selectedColor | string (string.ColorString) | - | 是 | tab 上的文字选中时的颜色 |\n| backgroundColor | string (string.ColorString) | - | 是 | tab 的背景色 |\n| list | Array\\<[PagesOptionsTabbarList](#pagesoptionstabbarlist)> | - | 是 | tab 的列表,详见 list 属性说明,最少2个、最多5个 tab |\n| backgroundImage | string | - | 否 | 设置背景图片,优先级高于 backgroundColor |\n| backgroundRepeat | 'repeat' \\| 'repeat-x' \\| 'repeat-y' \\| 'no-repeat' | no-repeat | 否 | 设置标题栏的背景图平铺方式 |\n| redDotColor | string (string.ColorString) | - | 否 | tabbar上红点颜色 |"},"PagesOptionsTabbarList":{"compatibility":"**PagesOptionsTabbarList 兼容性** \n| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| iconfont | 5.0 | 3.4.4+ | √ | 10.0 | 3.4.4+ | x |\n| pagePath | 5.0 | √ | √ | 10.0 | √ | x |\n| text | 5.0 | √ | √ | 10.0 | √ | x |\n| iconPath | 5.0 | √ | √ | 10.0 | √ | x |\n| selectedIconPath | 5.0 | √ | √ | 10.0 | √ | x |\n| visible | 5.0 | 3.2.10+ | √ | 10.0 | 3.2.10+ | x |","table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| iconfont | [iconfont 配置项列表](#pagesoptionstabbarlist-iconfont) | - | 否 | 字体图标,优先级高于 iconPath |\n| pagePath | string (string.PageURIString) | - | 是 | 页面路径,必须在 pages 中先定义 |\n| text | string | - | 是 | tab 上按钮文字,在 App 和 H5 平台为非必填。例如中间可放一个没有文字的+号图标 |\n| iconPath | string (string.ImageURIString) | - | 否 | 图片路径,icon 大小限制为40kb,建议尺寸为 81px * 81px,当 position 为 top 时,此参数无效,不支持网络图片,不支持字体图标 |\n| selectedIconPath | string (string.ImageURIString) | - | 否 | 选中时的图片路径,icon 大小限制为40kb,建议尺寸为 81px * 81px ,当 position 为 top 时,此参数无效 |\n| visible | string | - | 否 | 该项是否显示,默认显示 |"},"PagesOptionsTabbarList_iconfont":{"table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| text | string | - | 否 | 字库 Unicode 码 |\n| selectedText | string | - | 否 | 选中后字库 Unicode 码 |\n| fontSize | string | - | 否 | 字体图标字号(px) |\n| color | string (string.ColorString) | - | 否 | 字体图标颜色 |\n| selectedColor | string (string.ColorString) | - | 否 | 字体图标选中颜色 |","description":"字体图标,优先级高于 iconPath"},"pages_condition":{"table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| current | number | - | 是 | 当前激活的模式,list节点的索引值。 |\n| list | Array\\<[PagesConditionItem](#pagesconditionitem)> | - | 是 | 启动模式列表 |"},"PagesConditionItem":{"table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| name | string | - | 是 | 启动模式名称 |\n| path | string (string.PageURIString) | - | 是 | 启动页面路径 |\n| query | string | - | 否 | 启动参数,可在页面的 onLoad 函数里获得 |"},"pages_easycom":{"table":"| 属性 | 类型 | 默认值 | 必填 | 描述 |\n| :- | :- | :- | :- | :- |\n| autoscan | boolean | true | 否 | 是否开启自动扫描,开启后将会自动扫描符合components/组件名称/组件名称.vue/uvue目录结构的组件 |\n| custom | object | - | 否 | 以正则方式自定义组件匹配规则。如果autoscan不能满足需求,可以使用custom自定义匹配规则 |","description":"组件自动引入规则"},"tutorial":"## 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=collocation.pages_json)"}
\ No newline at end of file
{"specialString":{"name":"### 特殊 String @special-string","table":"| 名称 | 描述 |\n| :- | :- |\n| AttrString | 元素上的属性 |\n| AttrValueString | 元素上某个属性的值 |\n| ClassString | 元素全局属性`class`的值 |\n| IDString | 元素全局属性`id`的值 |\n| HTMLEventString | 元素上的事件 |\n| ColorString | CSS颜色的值 |\n| RequireCommonString | 提示common模块 以及js文件路径 |\n| VueI18NKeyString | 国际化翻译的key值 |\n| VueDataString | vue默认参数data中的属性名称 |\n| VueRefString | vue组件中ref属性的值 |\n| VuexDispatchString | vuex 中 actions 的名称 |\n| VuexCommitString | vuex 中 mutations 的名称 |\n| PageURIString | vue, nvue, uvue页面文件的文件路径(根据项目自动匹配) |\n| NPageURIString | nvue页面文件的文件路径 |\n| UPageURIString | uvue页面文件的文件路径, 仅在uniappx中生效 |\n| VideoIdString | video 组件的 id, 仅在uniappx中生效 |\n| WebviewIdString | web-view 组件的 id, 仅在uniappx中生效 |\n| ParentFieldString | uniCloud db schema中parentKey的值 |\n| SchemaFieldString | uniCloud db schema中required数组的值 |\n| ValidateFunctionString | uniCloud db schema中validateFunction的值 |\n| CloudFunctionString | uniCloud 云函数名 |\n| CloudObjectString | uniCloud 云对象名 |\n| DBCollectionString | uniCloud 数据库集合的名称 |\n| DBFieldString | uniCloud 数据库字段名称 |\n| JQLString | uniCloud 数据库要操作的集合, 要查询的字段 |\n| cssPropertyString | CSS属性的名称 |\n| cssPropertyValueString | CSS某个属性的值 |\n| cssSelectorString | CSS选择器的名称 |\n| URIString | 任意文件的文件路径 |\n| CSSURIString | css文件的文件路径(后缀为`.css`的文件路径) |\n| JSURIString | js文件的文件路径(后缀为`.js`的文件路径) |\n| HTMLURIString | html文件的文件路径(后缀为`.html`的文件路径) |\n| MarkdownURIString | markdown文件的文件路径(后缀为`.md`的文件路径) |\n| ScriptImportURIString | js, ts, uts引用文件或模块的文件路径(支持vue,nvue,uvue中script标签内容), 例: `import xxx from 'xxx'` |\n| CssImportURIString | css文件可以引用的文件的文件路径, 后缀为`[\".css\"\\]`的文件路径 例: `@import url('xxx.css')` |\n| ScssImportURIString | scss文件可以引用的文件的文件路径, 后缀为`[\".scss\", \".css\"\\]`的文件路径, 例: `@import 'xxx.scss'` |\n| LessImportURIString | less文件可以引用的文件的文件路径, 后缀为`[\".less\", \".css\"\\]`的文件路径, 例: `@import 'xxx.less'` |\n| FontURIString | 字体文件的文件路径 |\n| ImageURIString | 图片文件的文件路径 |\n| AudioURIString | 音频文件的文件路径 |\n| VideoURIString | 视频文件的文件路径 |"}}
\ No newline at end of file
此差异已折叠。
因为 它太大了无法显示 source diff 。你可以改为 查看blob
此差异已折叠。
此差异已折叠。
{
"application": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| app.component() | 5.0 | √ | √ | 10.0 | √ | x |\n| app.directive() | 5.0 | √ | x | 10.0 | √ | x |\n| app.use() | 5.0 | √ | 3.99 | 10.0 | √ | x |\n| app.mixin() | 5.0 | √ | 3.99 | 10.0 | √ | x |\n| app.provide() | 5.0 | √ | 3.99 | 10.0 | √ | x |\n| app.config | 5.0 | √ | √ | 10.0 | √ | x |\n| app.config.errorHandler | 5.0 | √ | x | 10.0 | √ | x |\n| app.config.warnHandler | 5.0 | √ | x | 10.0 | √ | x |\n| app.config.performance | 5.0 | √ | x | 10.0 | √ | x |\n| app.config.globalProperties | 5.0 | √ | 3.99 | 10.0 | √ | x |\n| app.config.optionMergeStrategies | 5.0 | √ | x | 10.0 | √ | x |"
},
"general": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| nextTick() | 5.0 | x | √ | 10.0 | x | x |\n| defineComponent() | 5.0 | x | x | 10.0 | x | x |\n| defineAsyncComponent() | 5.0 | x | x | 10.0 | x | x |"
},
"reactivity_core": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| ref() | 5.0 | √ | √ | 10.0 | √ | x |\n| computed() | 5.0 | √ | x | 10.0 | √ | x |\n| reactive() | 5.0 | √ | √ | 10.0 | √ | x |\n| readonly() | 5.0 | √ | x | 10.0 | √ | x |\n| watchEffect() | 5.0 | √ | x | 10.0 | √ | x |\n| watch() | 5.0 | √ | x | 10.0 | √ | x |"
},
"reactivity_utilities": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| isRef() | 5.0 | √ | x | 10.0 | √ | x |\n| unref() | 5.0 | √ | x | 10.0 | √ | x |\n| toRef() | 5.0 | √ | x | 10.0 | √ | x |\n| toRefs() | 5.0 | √ | x | 10.0 | √ | x |\n| isProxy() | 5.0 | √ | x | 10.0 | √ | x |\n| isReactive() | 5.0 | √ | x | 10.0 | √ | x |\n| isReadonly() | 5.0 | √ | x | 10.0 | √ | x |"
},
"reactivity_advanced": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| shallowRef() | 5.0 | √ | x | 10.0 | √ | x |\n| triggerRef() | 5.0 | √ | x | 10.0 | √ | x |\n| customRef() | 5.0 | √ | x | 10.0 | √ | x |\n| shallowReactive() | 5.0 | √ | x | 10.0 | √ | x |\n| shallowReadonly() | 5.0 | √ | x | 10.0 | √ | x |\n| toRaw() | 5.0 | √ | x | 10.0 | √ | x |\n| markRaw() | 5.0 | √ | x | 10.0 | √ | x |"
},
"options_state": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| data | 5.0 | √ | √ | 10.0 | √ | x |\n| props | 5.0 | √ | √ | 10.0 | √ | x |\n| computed | 5.0 | √ | √ | 10.0 | √ | x |\n| methods | 5.0 | √ | √ | 10.0 | √ | x |\n| watch | 5.0 | √ | √ | 10.0 | √ | x |\n| emits | 5.0 | √ | √ | 10.0 | √ | x |"
},
"options_rendering": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| template | 5.0 | x | x | 10.0 | x | x |\n| render | 5.0 | x | 3.99 | 10.0 | x | x |"
},
"options_lifecycle": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| beforeCreate | 5.0 | √ | √ | 10.0 | √ | x |\n| created | 5.0 | √ | √ | 10.0 | √ | x |\n| beforeMount | 5.0 | √ | √ | 10.0 | √ | x |\n| mounted | 5.0 | √ | √ | 10.0 | √ | x |\n| beforeUpdate | 5.0 | √ | √ | 10.0 | √ | x |\n| updated | 5.0 | √ | √ | 10.0 | √ | x |\n| beforeUnmount | 5.0 | √ | √ | 10.0 | √ | x |\n| unmounted | 5.0 | √ | √ | 10.0 | √ | x |\n| errorCaptured | 5.0 | √ | x | 10.0 | √ | x |\n| renderTracked | 5.0 | √ | x | 10.0 | √ | x |\n| renderTriggered | 5.0 | √ | x | 10.0 | √ | x |\n| activated | 5.0 | √ | x | 10.0 | √ | x |\n| deactivated | 5.0 | √ | x | 10.0 | √ | x |"
},
"options_composition": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| provide | 5.0 | √ | 3.99 | 10.0 | √ | x |\n| inject | 5.0 | √ | 3.99 | 10.0 | √ | x |\n| mixins | 5.0 | √ | 3.99 | 10.0 | √ | x |\n| extends | 5.0 | √ | x | 10.0 | √ | x |"
},
"options_misc": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| name | 5.0 | √ | √ | 10.0 | √ | x |\n| inheritAttrs | 5.0 | √ | √ | 10.0 | √ | x |\n| components | 5.0 | √ | √ | 10.0 | √ | x |\n| directives | 5.0 | √ | x | 10.0 | √ | x |"
},
"component_instance": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| $data | 5.0 | √ | √ | 10.0 | √ | x |\n| $props | 5.0 | √ | √ | 10.0 | √ | x |\n| $el | 5.0 | x | √ | 10.0 | x | x |\n| $options | 5.0 | √ | √ | 10.0 | √ | x |\n| $parent | 5.0 | √ | √ | 10.0 | √ | x |\n| $root | 5.0 | √ | √ | 10.0 | √ | x |\n| $slots | 5.0 | x | √ | 10.0 | √ | x |\n| $refs | 5.0 | √ | √ | 10.0 | √ | x |\n| $attrs | 5.0 | √ | √ | 10.0 | √ | x |\n| $watch() | 5.0 | √ | √ | 10.0 | √ | x |\n| $emit | 5.0 | √ | √ | 10.0 | √ | x |\n| $forceUpdate | 5.0 | √ | 3.99 | 10.0 | √ | x |\n| $nextTick | 5.0 | √ | √ | 10.0 | √ | x |\n| $callMethod | 5.0 | x | √ | 10.0 | x | x |"
},
"directives": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| v-text | 5.0 | √ | √ | 10.0 | √ | x |\n| v-html | 5.0 | √ | 3.99 | 10.0 | √ | x |\n| v-show | 5.0 | √ | √ | 10.0 | √ | x |\n| v-if | 5.0 | √ | √ | 10.0 | √ | x |\n| v-else | 5.0 | √ | √ | 10.0 | √ | x |\n| v-else-if | 5.0 | √ | √ | 10.0 | √ | x |\n| v-for | 5.0 | √ | √ | 10.0 | √ | x |\n| v-on | 5.0 | √ | √ | 10.0 | √ | x |\n| v-bind | 5.0 | √ | √ | 10.0 | √ | x |\n| v-model | 5.0 | √ | √ | 10.0 | √ | x |\n| v-slot | 5.0 | √ | √ | 10.0 | √ | x |\n| v-pre | 5.0 | √ | 3.99 | 10.0 | √ | x |\n| v-once | 5.0 | √ | 3.99 | 10.0 | √ | x |\n| v-memo | 5.0 | x | 3.99 | 10.0 | x | x |\n| v-cloak | 5.0 | x | x | 10.0 | x | x |"
},
"components": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| \\<Transition> | 5.0 | x | x | 10.0 | x | x |\n| \\<TransitionGroup> | 5.0 | x | x | 10.0 | x | x |\n| \\<KeepAlive> | 5.0 | x | x | 10.0 | x | x |\n| \\<Teleport> | 5.0 | x | x | 10.0 | x | x |"
},
"special_elements": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| \\<component> | 5.0 | √ | 3.99 | 10.0 | √ | x |\n| \\<slot> | 5.0 | √ | √ | 10.0 | √ | x |\n| \\<template> | 5.0 | √ | √ | 10.0 | √ | x |"
},
"special_attributes": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| key | 5.0 | √ | √ | 10.0 | √ | x |\n| ref | 5.0 | √ | √ | 10.0 | √ | x |\n| is | 5.0 | √ | 3.99 | 10.0 | √ | x |"
},
"render_function": {
"compatibility": "| | 安卓系统版本 | 安卓 uni-app | 安卓 uni-app-x | iOS 系统版本 | iOS uni-app | iOS uni-app-x |\n| :- | :- | :- | :- | :- | :- | :- |\n| h() | 5.0 | x | 3.99 | 10.0 | x | x |\n| resolveComponent() | 5.0 | x | √ | 10.0 | x | x |\n| resolveDirective() | 5.0 | x | x | 10.0 | x | x |\n| withDirectives() | 5.0 | x | √ | 10.0 | x | x |"
}
}
\ No newline at end of file
......@@ -17,9 +17,9 @@ pageClass: custom-page-class
<div class="flex-img-group-view">
<a href="//hellouniappx.dcloud.net.cn/" target="_blank" class="clear-style barcode-view">
<div class="barcode-img-box">
<img src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app-x/hello-uniappx-qrcode.png" width="160" />
<img src="https://web-ext-storage.dcloud.net.cn/uni-app-x/hello-uniappx-qrcode.png" width="160" />
</div>
<b>Android(uni-app x)</b>
<b>Android、iOS(uni-app x)</b>
</a>
<a href="//m3w.cn/uniapp" target="_blank" class="clear-style barcode-view">
<div class="barcode-img-box">
......
......@@ -137,7 +137,9 @@
* [获取服务供应商](plugins/provider.md)
* [登录](plugins/login.md)
* [分享](plugins/share.md)
* [支付](plugins/payment.md)
* 支付```{"collapsable": true}```
* [requestPayment](plugins/payment.md)
* [requestVirtualPayment](plugins/virtualPayment.md)
* [推送](plugins/push.md)
* [语音](plugins/voice.md)
* [实人认证](plugins/facialRecognitionVerify.md)
......
......@@ -19,10 +19,10 @@
|参数名|类型|说明|平台差异说明|
|:-|:-|:-|:-|
|path|String|启动的路径(代码包路径)|其他平台均支持,`抖音小程序(1.12.0+)`|
|scene|Number|启动时的场景值,具体值含义请查看各平台文档说明。App、web端恒为 1001。|其他平台均支持,`抖音小程序(1.12.0+)`|
|query|Object|启动时的 query 参数|其他平台均支持,`抖音小程序(1.12.0+)`|
|referrerInfo|Object|来源信息。如果没有则返回 `{}`|其他平台均支持,`抖音小程序(1.15.0+)`|
|path|String|启动的路径(代码包路径)||
|scene|Number|启动时的场景值,具体值含义请查看各平台文档说明。App、web端恒为 1001。||
|query|Object|启动时的 query 参数||
|referrerInfo|Object|来源信息。如果没有则返回 `{}`||
|channel|String|如果应用没有设置渠道标识,则返回空字符串。取值如下|`仅 App 支持`|
|launcher|String|应用启动来源。取值如下|`仅 App 支持`|
|forwardMaterials|Array\<Object\>|打开的文件信息数组,只有从聊天素材场景打开(scene为1173)才会携带该参数|`微信小程序`|
......@@ -61,4 +61,4 @@
| uniLink | 通过通用链接(universal link)启动应用 |
| miniProgram | 通过微信小程序启动应用 |
| shortcut | 通过快捷方式启动,iOS平台表示通过3D Touch快捷方式,Android平台表示通过桌面快捷方式启动 |
| barcode | 通过二维码扫描启动|
\ No newline at end of file
| barcode | 通过二维码扫描启动|
......@@ -14,10 +14,10 @@ web平台不同Vue版本支持情况有差异:
|参数名|类型|说明|平台差异说明|
|:-|:-|:-|:-|
|path|String|启动的路径(代码包路径,注意:App 端开发过程中热更新会直达当前页面,此时启动路径为当前页面路径)|其他平台均支持,`抖音小程序(1.12.0+)`|
|scene|Number|启动时的场景值,具体值含义请查看各平台文档说明。App、web端恒为 1001。钉钉小程序在 IDE 恒为0000,真机不支持。|其他平台均支持,`抖音小程序(1.12.0+)`|
|query|Object|启动时的 query 参数|其他平台均支持,`抖音小程序(1.12.0+)`|
|referrerInfo|Object|来源信息。如果没有则返回 `{}`|其他平台均支持,`抖音小程序(1.15.0+)``飞书小程序不支持``钉钉小程序不支持`|
|path|String|启动的路径(代码包路径,注意:App 端开发过程中热更新会直达当前页面,此时启动路径为当前页面路径)||
|scene|Number|启动时的场景值,具体值含义请查看各平台文档说明。App、web端恒为 1001。钉钉小程序在 IDE 恒为0000,真机不支持。||
|query|Object|启动时的 query 参数||
|referrerInfo|Object|来源信息。如果没有则返回 `{}`|`飞书``钉钉`小程序不支持|
|channel|String|如果应用没有设置渠道标识,则返回空字符串。取值如下|`仅 App 支持`|
|launcher|String|应用启动来源。取值如下|`仅 App 支持`|
|forwardMaterials|Array\<Object\>|打开的文件信息数组,只有从聊天素材场景打开(scene为1173)才会携带该参数|`微信小程序``QQ小程序`|
......@@ -58,4 +58,4 @@ web平台不同Vue版本支持情况有差异:
| uniLink | 通过通用链接(universal link)启动应用 |
| miniProgram | 通过微信小程序启动应用 |
| shortcut | 通过快捷方式启动,iOS平台表示通过3D Touch快捷方式,Android平台表示通过桌面快捷方式启动 |
| barcode | 通过二维码扫描启动|
\ No newline at end of file
| barcode | 通过二维码扫描启动|
......@@ -296,7 +296,7 @@ uni.chooseImage({
| quality | Number | 80 | 否 | 压缩质量,范围0~100,数值越小,质量越低,压缩率越高(仅对jpg有效) ||
| width | String | auto | 否 | 缩放图片的宽度,支持像素值(如"100px")、百分比(如"50%")、自动计算(如"auto",即根据width与源图宽的缩放比例计算,若未设置width则使用源图宽度)|App 3.0.0+|
| height | String | auto | 否 | 缩放图片的高度,支持像素值(如"100px")、百分比(如"50%")、自动计算(如"auto",即根据height与源图高的缩放比例计算,若未设置height则使用源图高度)|App 3.0.0+|
| compressedWidth | Number | - | 否 | 压缩后图片的宽度,单位为px,若不填写则默认以 compressHeight 为准等比缩放 |微信小程序2.26.0 +|
| compressedWidth | Number | - | 否 | 压缩后图片的宽度,单位为px,若不填写则默认以 compressedHeight 为准等比缩放 |微信小程序2.26.0 +|
| compressedHeight | Number | - | 否 | 压缩后图片的高度,单位为px,若不填写则默认以 compressedWidth 为准等比缩放 |微信小程序2.26.0 +|
| rotate | Number | 0 | 否 | 旋转度数,范围0~360 |App 3.0.0+|
| success | Function | | 否 | 接口调用成功的回调函数 ||
......
......@@ -32,7 +32,7 @@
|onError|callback|录音错误事件, 会回调错误信息|&nbsp;|
|offError|callback|取消监听录音错误事件|仅支付宝小程序支持|
**start(options) 说明**
### start(options)
|属性|类型|必填|说明|平台差异说明|
|:-|:-|:-|:-|:-|
......@@ -61,7 +61,7 @@
|44100|64000 ~ 320000|
|48000|64000 ~ 320000|
**onStop(callback) 回调结果说明**
### onStop(callback)
|属性|类型|说明|
|:-|:-|:-|
......@@ -70,14 +70,14 @@
|fileSize|Number|录音文件大小。单位:Byte。(仅支付宝10.2.90+支持)|
**onFrameRecorded(callback) 回调结果说明**
### onFrameRecorded(callback)
|属性|类型|说明|
|:-|:-|:-|
|frameBuffer|ArrayBuffer|录音分片结果数据|
|isLastFrame|Boolean|当前帧是否正常录音结束前的最后一帧|
**onError(callback) 回调结果说明**
### onError(callback)
|属性|类型|说明|
|:-|:-|:-|
......@@ -87,7 +87,7 @@
- 可以通过用户授权API来判断用户是否给应用授予麦克风的访问权限[https://uniapp.dcloud.io/api/other/authorize](https://uniapp.dcloud.io/api/other/authorize)
**示例**
### 示例
```html
<template>
......
......@@ -48,7 +48,7 @@
**示例**
```html
```
<template>
<view>
<text>hello</text>
......@@ -56,8 +56,6 @@
<video :src="src"></video>
</view>
</template>
```
```javascript
export default {
data() {
return {
......@@ -207,7 +205,7 @@ uni.chooseMedia({
**示例**
```html
```
<template>
<view>
<text>hello</text>
......@@ -215,8 +213,6 @@ uni.chooseMedia({
<video :src="src"></video>
</view>
</template>
```
```javascript
export default {
data() {
return {
......
实人认证提供核验终端操作者的真实身份,包含活体检测和人脸对比等生物识别技术,可快速校验自然人的真实身份。
App平台端详细文档需另见:[业务介绍](https://doc.dcloud.net.cn/uniCloud/frv/intro.html)[开发指南](https://doc.dcloud.net.cn/uniCloud/frv/dev.html)
微信小程序端业务开发流程,请参考[微信人脸核身接口能力](https://developers.weixin.qq.com/community/business/doc/000442d352c1202bd498ecb105c00d)
- App平台端详细文档需另见:[业务介绍](https://doc.dcloud.net.cn/uniCloud/frv/intro.html)[开发指南](https://doc.dcloud.net.cn/uniCloud/frv/dev.html)
- 微信小程序端业务开发流程,请参考[微信人脸核身接口能力](https://developers.weixin.qq.com/community/business/doc/000442d352c1202bd498ecb105c00d)
### uni.getFacialRecognitionMetaInfo()
......
......@@ -59,7 +59,7 @@ Web平台常见的登录包括用户名密码、短信验证码、pc端微信扫
|:-|:-|:-|
|authResult|登录服务商提供的登录信息,服务商不同返回的结果不完全相同|微信登录配置`onlyAuthorize:true`则此项为空,App 3.2.6+ |
|code|用户登录凭证。开发者需要在开发者服务器后台,使用 code 换取 openid 和 session_key 等信息|微信登录配置`onlyAuthorize:true`才会返回,App 3.2.6+、京东小程序 |
|appleInfo|Object|否|`苹果登录`返回的信息|App 3.4.3+|
|appleInfo|`苹果登录`返回的信息|App 3.4.3+|
|errMsg|描述信息||
**示例**
......
......@@ -9,9 +9,9 @@ uni.requestPayment是一个统一各平台的客户端支付API,不管是在
比如微信有App支付、小程序支付、H5支付等不同的申请入口和使用流程,对应到uni-app,在App端要申请微信的App支付,而小程序端则申请微信的小程序支付。
如果服务端使用[uniCloud](https://uniapp.dcloud.io/uniCloud/README),那么官方提供了[uniPay](https://uniapp.dcloud.io/uniCloud/unipay)云端统一支付服务,把App、微信小程序、支付宝小程序里的服务端支付开发进行了统一的封装。
如果服务端使用[uniCloud](https://uniapp.dcloud.io/uniCloud/README),那么官方提供了[uniPay](https://doc.dcloud.net.cn/uniCloud/uni-pay/uni-app.html)云端统一支付服务,把App、微信小程序、支付宝小程序里的服务端支付开发进行了统一的封装。
前端统一的`uni.requestPayment`和云端统一的`uniPay`搭配,可以极大提升支付业务的开发效率,强烈推荐给开发者使用。`uniPay`的文档另见:[https://uniapp.dcloud.io/uniCloud/unipay](https://uniapp.dcloud.io/uniCloud/unipay)
前端统一的`uni.requestPayment`和云端统一的`uniPay`搭配,可以极大提升支付业务的开发效率,强烈推荐给开发者使用。`uniPay`的文档另见:[https://doc.dcloud.net.cn/uniCloud/uni-pay/uni-app.html](https://doc.dcloud.net.cn/uniCloud/uni-pay/uni-app.html)
**平台差异说明**
......@@ -60,14 +60,13 @@ uni.requestPayment是一个统一各平台的客户端支付API,不管是在
6. App端,苹果应用内支付 orderInfo 为Object 类型,{productid: 'productid'}。
## H5 平台@h5-payment
- 普通浏览器平台的支付,仍然是常规web做法。uni-app未封装。
- 普通浏览器平台的支付,仍然是常规web做法。uni-app未封装。但DCloud提供了`uni-pay`插件,已封装了web支付,[详见](https://doc.dcloud.net.cn/uniCloud/uni-pay.html)
- 在普通浏览器里也可以调起微信进行支付,这个在微信叫做H5支付,此功能未开放给普通开发者,需向微信单独申请,[详见](https://pay.weixin.qq.com/wiki/doc/api/H5.php?chapter=15_1)
- 微信内嵌浏览器运行H5版时,可通过js sdk实现微信支付,需要引入一个单独的js,[详见](https://ask.dcloud.net.cn/article/35380)
- 微信内嵌浏览器运行H5版时,可通过js sdk实现微信支付,需要引入一个单独的js,[详见](https://ask.dcloud.net.cn/article/35380),也可以直接使用[uni-pay](https://doc.dcloud.net.cn/uniCloud/uni-pay.html),无需再单独引入其他js
**各平台支持的支付情况说明**
- 微信小程序里只支持微信小程序支付,在 [微信商户平台](https://pay.weixin.qq.com) 申请支付时,选择公众号支付。
- App 里支持微信sdk支付、支付宝sdk支付、苹果iap应用内支付,在各平台申请支付时选择 App 支付。
- 其他支付(如银联)请使用web-view组件以H5方式实现。
- App 里支持微信sdk支付、支付宝sdk支付、苹果iap应用内支付,在各平台申请支付时选择 App 支付。其他支付(如银联)请使用web-view组件以H5方式实现或在插件市场搜索相应插件。
- 支付宝小程序只支持支付宝支付。
- 百度小程序为百度支付,其二次封装了度小满、支付宝、微信支付。
- Hello uniapp 里演示了各种支付。
......@@ -696,8 +695,8 @@ uni.requestPayment({
## 服务器相关
### uniCloud开发
- 前端:使用`unicloud.callfunction`调用指定的云函数
- 服务端:使用[uniPay](https://uniapp.dcloud.io/uniCloud/unipay),该服务对应的演示工程在插件市场:[https://ext.dcloud.net.cn/plugin?id=1835](https://ext.dcloud.net.cn/plugin?id=1835),此示例为完整的前后端支付演示,使用`uniPay`可极快的完成支付业务开发。
- 前端:使用 `uni-pay` 组件发起支付
- 服务端:使用[uniPay](https://doc.dcloud.net.cn/uniCloud/uni-pay/uni-app.html),该服务对应的演示工程在插件市场:[https://ext.dcloud.net.cn/plugin?id=1835](https://ext.dcloud.net.cn/plugin?id=1835),此示例为完整的前后端支付演示,使用`uniPay`可极快的完成支付业务开发。
### php开发
- 前端:使用 ``uni.request`` 请求服务端接口,得到订单数据,使用 ``uni.requestPayment`` 向支付平台发起支付请求,拉起支付平台的客户端进行支付。在hello uni-app里详细代码。
......
......@@ -4,7 +4,7 @@
## 客户端API
### uni.getPushClientId(OBJECT)
### uni.getPushClientId(OBJECT)@getpushclientid
获取客户端唯一的推送标识
注意:这是一个异步的方法,且仅支持uni-push2.0;
......@@ -50,7 +50,7 @@
```
### uni.onPushMessage(callback)@onPushMessage
### uni.onPushMessage(callback)@onpushmessage
启动监听推送消息事件
代码示例:
```js
......@@ -80,7 +80,90 @@ uni.offPushMessage(callback);
- 如果uni.offPushMessage没有传入参数,则移除App级别的所有事件监听器;
- 如果只提供了事件名(callback),则移除该事件名对应的所有监听器;
### uni.createPushMessage(OBJECT)@createPushMessage
### uni.getChannelManager()@getchannelmanager
获取通知渠道管理器,Android 8系统以上才可以设置通知渠道。
**返回值说明**
|类型|
|:-|
|[ChannelManager](#channelmanager)|
#### getChannelManager兼容性
|Android 系统版本 |Android|iOS|其他|
|:-|:-|:-|:-|
|8.0|4.02|x|x|
### ChannelManager
渠道管理器
#### setPushChannel(options)
设置推送渠道
|名称|类型|必填|
|:-|:-|:-|
|options|[SetPushChannelOptions](#setpushchanneloptions)|是|
##### SetPushChannelOptions 的属性值
|名称|类型|必备|默认值|描述|
|:-|:-|:-|:-|:-|
|soundName|string|否|null|声音文件名(不能带文件后缀),需要放置声音文件到Android原生的`/res/raw/`目录下 [原生资源配置](https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-android.html#nativeresources) |
|channelId|string|是|-|通知渠道id|
|channelDesc|string|是|-|通知渠道描述|
|enableLights|boolean|否|false|呼吸灯闪烁|
|enableVibration|boolean|否|false|震动|
|importance|number|否|3|通知的重要性级别,可选范围IMPORTANCE_LOW:2、IMPORTANCE_DEFAULT:3、IMPORTANCE_HIGH:4|
|lockscreenVisibility|number|否|-1000|锁屏可见性,可选范围VISIBILITY_PRIVATE:0、VISIBILITY_PUBLIC:1、VISIBILITY_SECRET:-1、VISIBILITY_NO_OVERRIDE:-1000|
##### 代码示例
```typescript
const manager = uni.getChannelManager()
manager.setPushChannel({
channelId: "xxx",
channelDesc: "通知渠道描述",
soundName: "pushsound" // 已经把声音文件存储到/res/raw/pushsound.mp3
})
```
##### setPushChannel兼容性
|Android 系统版本 |Android|iOS|其他|
|:-|:-|:-|:-|
|8.0|4.02|x|x|
#### getAllChannels()
获取当前应用注册的所有的通知渠道。
##### 返回值
|类型|
|:-|
| Array<string> |
##### getAllChannels兼容性
|Android 系统版本 |Android|iOS|其他|
|:-|:-|:-|:-|
|8.0|4.02|x|x|
### 注意事项
* 通知渠道相关配置为Android端专有配置,只能在Android端进行配置。[通知渠道](https://developer.android.com/develop/ui/views/notifications/channels?hl=zh-cn)
* 离线推送申请自分类权益时,需要客户端创建channel,因此客户端提供了`setPushChannel`来进行channel的创建,通过此Api来创建渠道进行推送。客户端创建渠道成功后,即可通过云函数进行推送,[uni-push2服务端文档](https://doc.dcloud.net.cn/uniCloud/uni-cloud-push/api.html)
* 由于Android通知渠道的机制问题,一旦通知渠道建立,便不能修改此渠道的配置,即使删除渠道后再次创建同channelId名称的渠道,也不会改变原先渠道的配置(除非删除应用),最明显的现象就是铃声动态修改失败,比如调用`setPushChannel`时,第一次的设置参数是`{"channelId":"test","soundName":"pushsound"}` , 这时你想切换铃音,你的channelId就不能再叫test了,而应该为`{"channelId":"test2","soundName":"ring"}` ,此时会新建一个渠道。
### uni.createPushMessage(OBJECT)@createpushmessage
创建本地通知栏消息(HBuilderX 3.5.2起支持)
**平台差异说明**
......@@ -101,6 +184,8 @@ uni.offPushMessage(callback);
|cover |boolean |否 |是否覆盖上一次提示的消息</br>可取值:`true``false`,true为覆盖,false不覆盖,默认为permission中设置的cover值</br>Android - ALL (支持)</br>iOS - 5.0+ (不支持): 不支持覆盖消息,只能创建新的消息。 |
|delay |number |否 |提示消息延迟显示的时间</br>当设备接收到推送消息后,可不立即显示,而是延迟一段时间显示,延迟时间单位为s,默认为0s,立即显示。 |
|when |Date |否 |消息上显示的提示时间</br>默认为当前时间,如果延迟显示则使用延时后显示消息的时间。</br>Android - ALL (支持)</br>iOS - 5.0+ (不支持): 不支持设定消息的显示时间,由系统自动管理消息的创建时间。 |
|channelId |string |否 |渠道id, 支持的版本:HBuilder X 4.02+|
|category |string |否 |通知类别,支持的版本:HBuilder X 4.02+|
|success |Function |否 |接口调用成功的回调函数 |
|fail |Function |否 |接口调用失败的回调函数 |
|complete |Function |否 |接口调用结束的回调函数(调用成功、失败都会执行)
......
# uni.requestVirtualPayment(OBJECT)
**概述**
微信规定上架**短剧**类目的小程序必须使用微信小程序虚拟支付,不可以使用原先的微信支付
**注意**
1. 微信小程序虚拟支付只有短剧类目的小程序才能开通
2. 微信小程序虚拟支付不支持ios系统
3. 微信小程序虚拟支付有较高的手续费(已知目前为10% ~ 20%),由微信官方收取,非uni-app收取(手续费多少跟使用uni-app无关)
**如何开户?**
- [微信虚拟支付官方文档](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html#_1-%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D)
如果服务端使用[uniCloud](https://uniapp.dcloud.io/uniCloud/README),那么官方提供了[uniPay](https://doc.dcloud.net.cn/uniCloud/uni-pay/uni-app.html)云端统一支付服务,把App、微信小程序、支付宝小程序里的服务端支付开发进行了统一的封装。
前端统一的 `uni.requestVirtualPayment` 和云端统一的 `uniPay` 搭配,可以极大提升支付业务的开发效率,强烈推荐给开发者使用。`uniPay` 的文档另见:[https://doc.dcloud.net.cn/uniCloud/uni-pay/uni-app.html](https://doc.dcloud.net.cn/uniCloud/uni-pay/uni-app.html)
**平台差异说明**
|App|H5|微信小程序|支付宝小程序|百度小程序|抖音小程序|飞书小程序|QQ小程序|快手小程序|京东小程序|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|x|x|√|x|x|x|x|x|x|x|
**OBJECT 参数说明**
|参数名|类型|必填|说明|平台差异说明|
|:-|:-|:-|:-|:-|
|signData|Object|是|具体支付参数见signData|微信小程序|
|mode|String|是|支付的类型, 不同的支付类型有各自额外要传的附加参数|微信小程序|
|paySig|String|是|支付签名, 详见[《签名详解》](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html)|微信小程序|
|signature|String|是|用户态签名, 详见[《签名详解》](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html)|微信小程序|
|success|Function|否|接口调用成功的回调||
|fail|Function|否|接口调用失败的回调函数||
|complete|Function|否|接口调用结束的回调函数(调用成功、失败都会执行)||
`signData` 说明
|结构属性|类型|必填|说明|
|:-|:-|:-|:-|
|offerId|String|是|在米大师侧申请的应用 id, mp-支付基础配置中的offerid|
|buyQuantity|Number|是|购买数量|
|currencyType|String|是|币种 固定为 CNY|
|outTradeNo|String|是|业务订单号, 每个订单号只能使用一次, 重复使用会失败(极端情况不保证唯一, 不建议业务强依赖唯一性). 要求8-32个字符内, 只能是数字、大小写字母、符号 _-*@组成, 不能以下划线 _ 开头|
|attach|String|是|透传数据, 发货通知时会透传给开发者|
|productId|String|否|道具ID, **该字段仅mode=short_series_goods时需要必填**|
|goodsPrice|String|否|道具单价(分), **该字段仅mode=short_series_goods时需要必填**, 用来校验价格与后台道具价格是否一致, 避免用户在业务商城页看到的价格与实际价格不一致导致投诉|
|env|Number|否|环境配置, 0 米大师正式环境, 1 米大师沙箱环境, 默认为 0|
`mode` 说明
|合法值 |说明 |
|:-|:-|
|short_series_goods |道具直购 |
|short_series_coin| 代币充值 |
## 代码示例
### 代币充值
```javascript
// 仅作为示例,非真实参数信息。
uni.requestVirtualPayment({
signData: {
offerId: "", // 在米大师侧申请的应用 id, mp-支付基础配置中的offerid
buyQuantity: 1, // 购买数量
env: 0, // 环境配置, 0 米大师正式环境, 1 米大师沙箱环境, 默认为 0
currencyType: "CNY", // 固定CNY
outTradeNo: "test2024030101",
attach: JSON.stringify({
user_id: "001"
})
},
mode: "short_series_coin",
paySig: "支付签名",
signature: '用户态签名',
success: (res) => {
console.log('success:' + JSON.stringify(res));
},
fail: (err) => {
console.log('fail:' + JSON.stringify(err));
},
complete: (res) => {
console.log('complete:' + JSON.stringify(res));
}
});
```
### 道具直购
```javascript
// 仅作为示例,非真实参数信息。
uni.requestVirtualPayment({
signData: {
offerId: "", // 在米大师侧申请的应用 id, mp-支付基础配置中的offerid
buyQuantity: 1, // 购买数量
env: 0, // 环境配置, 0 米大师正式环境, 1 米大师沙箱环境, 默认为 0
currencyType: "CNY", // 固定CNY
outTradeNo: "test2024030101",
attach: JSON.stringify({
user_id: "001"
}),
productId: "", // 道具ID, **该字段仅mode=short_series_goods时需要必填**
goodsPrice: 1, // 道具单价(分), **该字段仅mode=short_series_goods时需要必填**, 用来校验价格与后台道具价格是否一致, 避免用户在业务商城页看到的价格与实际价格不一致导致投诉
},
mode: "short_series_coin",
paySig: "支付签名",
signature: '用户态签名',
success: (res) => {
console.log('success:' + JSON.stringify(res));
},
fail: (err) => {
console.log('fail:' + JSON.stringify(err));
},
complete: (res) => {
console.log('complete:' + JSON.stringify(res));
}
});
```
## 服务器相关
### uniCloud开发
- 前端:使用 `uni-pay` 组件发起支付。
- 服务端:使用[uniPay](https://doc.dcloud.net.cn/uniCloud/uni-pay/uni-app.html),该服务对应的演示工程在插件市场:[https://ext.dcloud.net.cn/plugin?id=1835](https://ext.dcloud.net.cn/plugin?id=1835),此示例为完整的前后端支付演示,使用`uniPay`可极快的完成支付业务开发。
### php、java等后端语言开发
- 前端:使用 `uni.request` 请求服务端接口,得到订单数据,使用 `uni.requestVirtualPayment` 向支付平台发起支付请求,拉起支付平台的客户端进行支付。
- 服务端:[参考文档](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html)
\ No newline at end of file
### voice
voice 包括语言识别和语音朗读两部分。
仅百度小程序平台、App平台支持,各平台开发方式暂未统一,使用时需注意用[条件编译](https://uniapp.dcloud.io/platform)调用不同平台的代码。
百度小程序平台支持语音识别,参考:[规范详情](https://smartprogram.baidu.com/docs/develop/api/ai_voice/)
App 平台实现参考:
- 语音识别:支持科大讯飞语音识别和百度语音识别,云打包的话需要在manifest中勾选模块和App SDK配置,开发规范见:[https://www.html5plus.org/doc/zh_cn/speech.html](https://www.html5plus.org/doc/zh_cn/speech.html),配置文档及讯飞百度的差别见:[https://ask.dcloud.net.cn/article/35059](https://ask.dcloud.net.cn/article/35059)
- 语音朗读:调用科大讯飞进行语音合成、tts朗读,参考[https://ask.dcloud.net.cn/article/1081](https://ask.dcloud.net.cn/article/1081)
### voice
voice 包括语言识别和语音朗读两部分。
仅百度小程序平台、App平台支持,各平台开发方式暂未统一,使用时需注意用[条件编译](https://uniapp.dcloud.io/platform)调用不同平台的代码。
百度小程序平台支持语音识别,参考:[规范详情](https://smartprogram.baidu.com/docs/develop/api/ai_voice/)
App 平台实现参考:
- 语音识别:支持百度语音识别,云打包的话需要在manifest中勾选模块和App SDK配置,开发规范见:[https://www.html5plus.org/doc/zh_cn/speech.html](https://www.html5plus.org/doc/zh_cn/speech.html),配置文档及讯飞百度的差别见:[https://ask.dcloud.net.cn/article/35059](https://ask.dcloud.net.cn/article/35059)
- 语音朗读:调用科大讯飞进行语音合成、tts朗读,参考[https://ask.dcloud.net.cn/article/1081](https://ask.dcloud.net.cn/article/1081)
......@@ -5,8 +5,9 @@
> 在各个小程序平台运行时,网络相关的 API 在使用前需要配置域名白名单。
**推荐开发者上传到uniCloud,uniCloud提供了免费CDN和更好的易用性,包括安全的cdn直传。**
- uniCloud的上传API:[https://uniapp.dcloud.io/uniCloud/storage?id=uploadfile](https://uniapp.dcloud.io/uniCloud/storage?id=uploadfile)
- uniCloud的上传API:[https://doc.dcloud.net.cn/uniCloud/storage/dev.html#uploadfile](https://doc.dcloud.net.cn/uniCloud/storage/dev.html#uploadfile)
- 封装的更完善的[uni-file-picker组件](https://ext.dcloud.net.cn/plugin?id=4079),文件选择、上传到uniCloud,一站式集成。
- 推荐`uni-cdn`,帮你节省至少30%的 CDN 费用![详情](https://doc.dcloud.net.cn/uniCloud/uni-cdn/intro.html)
**OBJECT 参数说明**
......
......@@ -144,7 +144,7 @@ function sendSocketMessage(msg) {
}
```
## 注意事项
**注意事项**
* 出于性能的权衡,在Android端底层实现上发送队列占用的内存不能超过16M,一旦超过将导致连接被关闭。
......
......@@ -101,4 +101,4 @@ HBuilderX (4.0+) android 平台支持
- 如果权限已经申请并且允许之后,`onConfirm`不会触发。
- 如果同时申请多个权限时,`onComplete`可能会触发多次。
- 权限列表参考:[https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-android.html#permissions](https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-android.html#permissions)
- 本API仅提供了权限申请监听,未提供全局弹窗
- 全局监听权限申请可参考插件[uni-registerRequestPermissionTips](https://ext.dcloud.net.cn/plugin?name=uni-registerRequestPermissionTips)
......@@ -569,8 +569,6 @@ uni-app助力数百家单位快速上线**抗疫系统**,开源众多项目。
**云南财政厅阳光云财一网通:** [App](https://android.myapp.com/myapp/detail.htm?apkName=com.zqlian.ynfuchi)
**云南社保局参保缴费申报:** [H5](http://hrss.yn.gov.cn/modules/ginseng/#/)
**内蒙古体育局:** [H5](http://tyj.nmg.gov.cn/h5/#/)
**内蒙古呼和浩特市青城党建e家微应用:** [H5](http://qcdj.hhhtdj.gov.cn:8082/h5/)
......
......@@ -642,7 +642,7 @@ searchInput的点击输入框onNavigationBarSearchInputClicked、文本变化onN
|属性|类型|描述|
|:- |:- |:-|
|id|String| subNVue 原生子窗体的标识 |
|path|String|配置 nvue 文件路径,nvue 文件需放置到使用 subNvue 的页面文件目录下|
|path|String|配置 nvue 文件路径,nvue 文件需放置到使用 subNvue 的页面文件目录下,cli项目需要去掉.nvue后缀,只保留文件名|
|type|String|原生子窗口内置样式,可取值:'popup',弹出层;"navigationBar",导航栏|
|style|Object|subNVue 原生子窗体的样式,配置项参考下方 [subNVuesStyle](/collocation/pages?id=app-subNVuesStyle)|
......
#### animation-view
Lottie动画组件,动画资源参考[Lottie官方链接](https://airbnb.design/lottie/)
> animation-view组件是[uts组件](https://uniapp.dcloud.net.cn/plugin/uts-component.html),需下载插件:[animation-view](https://ext.dcloud.net.cn/plugin?name=uni-animation-view),仅App端nvue页面支持
> animation-view组件是[uts组件](https://uniapp.dcloud.net.cn/plugin/uts-component.html),需下载插件:[animation-view](https://ext.dcloud.net.cn/plugin?name=uni-animation-view),仅app平台 nvue/uvue 页面支持
> [uts组件](https://uniapp.dcloud.net.cn/plugin/uts-component.html)需 HBuilderX 3.7.0+
> App端真机运行需要打[自定义基座](https://uniapp.dcloud.net.cn/tutorial/run/run-app.html#customplayground)
> app平台真机运行需要打[自定义基座](https://uniapp.dcloud.net.cn/tutorial/run/run-app.html#customplayground)
**平台差异说明**
......@@ -15,10 +15,10 @@ Lottie动画组件,动画资源参考[Lottie官方链接](https://airbnb.desig
|√|x|x|x|√|x|x|x|x|x|x|
- animation-view 在App端集成的是lottie官方原生sdk,仅nvue页面支持,vue页面不支持。vue页面可使用webview、或renderjs集成lottie的h5版、或使用下方的微信小程序方案。
- App端实现使用了Lottie官方SDK,开源项目:[Lottie for Android](https://github.com/airbnb/lottie-android)[Lottie for iOS](https://github.com/airbnb/lottie-ios)
* App-Android平台要求Android5(API Leavel 21)及以上系统
* App-iOS平台要求iOS11及以上版本系统
- animation-view 在app平台集成的是lottie官方原生sdk,仅nvue/uvue页面支持,vue页面不支持。vue页面可使用webview、或renderjs集成lottie的h5版、或使用下方的微信小程序方案。
- app平台实现使用了Lottie官方SDK,开源项目:[Lottie for Android](https://github.com/airbnb/lottie-android)[Lottie for iOS](https://github.com/airbnb/lottie-ios)
* app-android平台要求Android5(API Leavel 21)及以上系统
* app-ios平台要求iOS11及以上版本系统
- 微信小程序没有内置该组件,需使用开源项目[https://github.com/wechat-miniprogram/lottie-miniprogram](https://github.com/wechat-miniprogram/lottie-miniprogram)
- 百度小程序已经由百度官方内置了animation-view,底层基于lottie sdk实现。
- 微信、百度之外的其他小程序,可考虑webview加载lottie的h5版,或评估上面的lottie-miniprogram是否兼容。
......
......@@ -49,6 +49,7 @@
- **注1:``button-hover`` 默认为 ``{background-color: rgba(0, 0, 0, 0.1); opacity: 0.7;}``**
- ```open-type="launchApp"```时需要调起的APP接入微信OpenSDK[详见](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/launchApp.html)
- 微信小程序、Web、App平台 button组件的默认边框宽度为0.5px,不会占据实际的渲染宽高;当type属性为plain时,边框宽度是1px,如果未指定元素的宽高,此时边框宽度会占据实际渲染宽高。
## size 有效值
......
......@@ -40,6 +40,7 @@
|enable-zoom|Boolean|true|是否支持缩放|App-nvue 2.1.5+、微信小程序2.3.0|
|enable-scroll|Boolean|true|是否支持拖动|App-nvue 2.1.5+、微信小程序2.3.0|
|enable-rotate|Boolean|false|是否支持旋转|App-nvue 2.1.5+、微信小程序2.3.0|
|rotate|Number|0|旋转角度(范围0-360)地图正北和设备 y 轴角度的夹角|微信小程序2.5.0|
|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|
......
......@@ -21,7 +21,7 @@
>
> - 组件需要依赖 `sass` 插件 ,请自行手动安装
> - 本组件为数据驱动,目的是快速投入使用,只可通过 style 覆盖有限样式,不支持自定义更多样式
> - 如使用过程中有任何问题,或者您对 uni-ui 有一些好的建议,欢迎加入 uni-ui 交流群:871950839
> - 如使用过程中有任何问题,或者您对 uni-ui 有一些好的建议,欢迎加入 [uni-im](https://im.dcloud.net.cn/#/?joinGroup=65aa42e5465fe748c837da2b)
> - 组件支持 nvue ,需要在 `manifest.json > app-plus` 节点下配置 `"nvueStyleCompiler" : "uni-app"`
> - 如组件显示有问题 ,请升级 `HBuilderX` 为 `v3.1.0` 以上
......@@ -88,18 +88,21 @@ export default {
### DataSelect Props
| 属性名 | 类型 | 可选值 | 默认值 | 说明 |
| :-----------: | :-----------: | :----: | :------: | :-----------------------------------------------------------------: |
| value/v-model | String/Number | - | - | 已选择数据的 value 值(当其值为0时不进行初始化赋值) |
| localdata | Array | - | - | 本地渲染数据 |
| clear | Boolean | - | - | 是否可以清空已选项 |
| label | String | | | 左侧标题 |
| placeholder | String | - | 请选择 | 输入框的提示文字 |
| emptyTips | String | - | 暂无数据 | 没有数据时显示的文字 ,本地数据无效 |
| 属性名 | 类型 | 可选值 | 默认值 | 说明 |
| :-----------: | :-----------: | :--------: | :------: | :--------------------------------------------------: |
| value/v-model | String/Number | - | - | 已选择数据的 value 值(当其值为0时不进行初始化赋值) |
| localdata | Array | - | - | 本地渲染数据 |
| clear | Boolean | - | - | 是否可以清空已选项 |
| label | String | | | 左侧标题 |
| placeholder | String | - | 请选择 | 输入框的提示文字 |
| emptyTips | String | - | 暂无数据 | 没有数据时显示的文字 ,本地数据无效 |
| placement | String | bottom,top | bottom | 弹出时位置 |
| page-size | Number | - | 20 | 返回的数据量(云端请求时有效,更多云端属性详见下方) |
#### DataCom Props
更多 DataCom 支持的属性参考[更多](https://uniapp.dcloud.net.cn/component/datacom.html#%E8%AF%AD%E6%B3%95%E6%89%8B%E5%86%8C)
#### 使用云端数据时的属性(DataCom Props)
更多 DataCom 支持的属性参考(包括:设置返回20个的默认大小)[更多](https://uniapp.dcloud.net.cn/component/datacom.html#%E8%AF%AD%E6%B3%95%E6%89%8B%E5%86%8C)
#### Localdata Options
......
......@@ -29,6 +29,7 @@
|max|Number |100|最大值|
|step|Number|1|每次点击改变的间隔大小|
|disabled|Boolean|false |是否为禁用状态|
|width|Number|40 |宽度(单位:px)|
### NumberBox Events
......@@ -51,63 +52,63 @@
::: preview https://hellouniapp.dcloud.net.cn/pages/extUI/number-box/number-box
> Template
``` html
<template>
<view class="page">
<uni-card :is-shadow="false" is-full>
<text class="uni-h6">数字输入框组件多用于购物车加减商品等场景</text>
</uni-card>
<uni-section title="基本用法" type="line" padding>
<uni-number-box @change="changeValue" />
</uni-section>
<uni-section :title="'使用v-model : '+ vModelValue" subTitle="使用 v-model 显示默认值" type="line" padding>
<uni-number-box v-model="vModelValue" @blur="blur" @focus="focus" @change="changeValue" />
</uni-section>
<uni-section title="设置最小值和最大值" subTitle="使用 min \ max 属性设置最大最小值" type="line" padding>
<uni-number-box :min="2" :max="9" :value="555" />
</uni-section>
<uni-section title="设置步长(步长0.1)" subTitle="使用 step 属性设置步长" type="line" padding>
<uni-number-box :value="1.1" :step="0.1" />
</uni-section>
<uni-section title="自定义背景" type="line" subTitle="使用 background 属性设置自定义背景色" padding>
<uni-number-box :value="50" background="#2979FF" color="#fff" />
</uni-section>
<uni-section title="禁用状态" subTitle="使用 disabled 属性设置组件禁用" type="line" padding>
<uni-number-box :disabled="true" />
</uni-section>
<uni-section :title="'获取输入的值 : '+ numberValue" type="line" padding>
<uni-number-box :value="numberValue" @change="change" />
</uni-section>
</view>
<template>
<view class="page">
<uni-card :is-shadow="false" is-full>
<text class="uni-h6">数字输入框组件多用于购物车加减商品等场景</text>
</uni-card>
<uni-section title="基本用法" type="line" padding>
<uni-number-box @change="changeValue" />
</uni-section>
<uni-section :title="'使用v-model : '+ vModelValue" subTitle="使用 v-model 显示默认值" type="line" padding>
<uni-number-box v-model="vModelValue" @blur="blur" @focus="focus" @change="changeValue" />
</uni-section>
<uni-section title="设置最小值和最大值" subTitle="使用 min \ max 属性设置最大最小值" type="line" padding>
<uni-number-box :min="2" :max="9" :value="555" />
</uni-section>
<uni-section title="设置步长(步长0.1)" subTitle="使用 step 属性设置步长" type="line" padding>
<uni-number-box :value="1.1" :step="0.1" />
</uni-section>
<uni-section title="自定义背景" type="line" subTitle="使用 background 属性设置自定义背景色" padding>
<uni-number-box :value="50" background="#2979FF" color="#fff" />
</uni-section>
<uni-section title="禁用状态" subTitle="使用 disabled 属性设置组件禁用" type="line" padding>
<uni-number-box :disabled="true" />
</uni-section>
<uni-section :title="'获取输入的值 : '+ numberValue" type="line" padding>
<uni-number-box :value="numberValue" @change="change" />
</uni-section>
</view>
</template>
```
> Script
``` html
<script>
export default {
components: {},
data() {
return {
numberValue: 0,
vModelValue: 3
}
},
methods: {
change(value) {
this.numberValue = value
},
changeValue(value) {
console.log('返回数值:', value);
},
blur(e) {
console.log('blur:', e);
},
focus(e) {
console.log('focus:', e);
}
}
}
</script>
``` html
<script>
export default {
components: {},
data() {
return {
numberValue: 0,
vModelValue: 3
}
},
methods: {
change(value) {
this.numberValue = value
},
changeValue(value) {
console.log('返回数值:', value);
},
blur(e) {
console.log('blur:', e);
},
focus(e) {
console.log('focus:', e);
}
}
}
</script>
```
:::
......
......@@ -31,7 +31,7 @@
<template>
<view>
<button @click="open">打开弹窗</button>
<uni-popup ref="popup" type="bottom">底部弹出 Popup</uni-popup>
<uni-popup ref="popup" type="bottom" border-radius="10px 10px 0 0">底部弹出 Popup 自定义圆角</uni-popup>
</view>
</template>
<script>
......@@ -113,6 +113,7 @@ export default {
|is-mask-click **[1.7.4新增]**|Boolean|true|蒙版点击是否关闭弹窗|
|mask-background-color **[1.7.4新增]**|rgba|rgba(0,0,0,0.4)|蒙版颜色,建议使用 rgba 颜色值|
|background-color|String|'none'|主窗口背景色|
|borderRadius|String|无| 设置圆角(左上、右上、右下和左下) 示例:"10px 10px 10px 10px"|
|safe-area|Boolean|true|是否适配底部安全区|
#### Type Options
......@@ -239,8 +240,9 @@ export default {
|cancelText **[1.7.4新增]**|String|-|定义取消按钮文本|
|maxlength **[1.8.6新增]**|Number|-|限制输入框字数(当mode="input"时生效)|
|showClose **[1.8.5新增]**|Boolean|-|是否显示取消按钮|
|value| String\Number|-|输入框默认值,input模式下生效|
|value| String\Number|-|输入框值,input模式下生效 注:1.9.0之后为双向绑定,vue2通过value,vue3通过v-model绑定|
|placeholder|String|-|输入框提示文字,input模式下生效|
|borderRadius|String|-|四周圆角值(左上、右上、右下、左下) 示例:"20px 20px 20px 20px"|
|before-close|Boolean|false | 是否拦截按钮事件,如为true,则不会关闭对话框,关闭需要手动执行 uni-popup 的 close 方法|
#### PopupDialog Events
......
::: tip 组件名:uni-segmented-control
> 代码块: `uSegmentedControl`
[点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uni-segmented-control)
:::
用作不同视图的显示
## 介绍
### 基本用法
```html
<template>
<view>
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" activeColor="#4cd964"></uni-segmented-control>
<view class="content">
<view v-show="current === 0">
选项卡1的内容
</view>
<view v-show="current === 1">
选项卡2的内容
</view>
<view v-show="current === 2">
选项卡3的内容
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
...
items: ['选项1', '选项2', '选项3'],
current: 0
};
},
methods: {
...
onClickItem(e) {
if (this.current != e.currentIndex) {
this.current = e.currentIndex;
}
}
}
};
</script>
```
## API
### SegmentedControl Props
|属性名|类型|默认值|说明|
|:-:|:-:|:-:|:-:|
|current|Number|0|当前选中的tab索引值,从0计数|
|styleType|String|button|分段器样式类型,可选值:button(按钮类型),text(文字类型) |
|activeColor|String|#007aff|选中的标签背景色与边框颜色|
|values|Array|-|选项数组|
### SegmentedControl Events
|事件名|说明|返回值|
|:-:|:-:|:-:|
|@clickItem |组件触发点击事件时触发|e={currentIndex} |
## 示例
::: warning 注意
示例依赖了 `uni-card` `uni-section` `uni-scss` 等多个组件,直接拷贝示例代码将无法正常运行 。
请到 [组件下载页面](https://ext.dcloud.net.cn/plugin?name=uni-segmented-control) ,在页面右侧选择 `使用 HBuilderX导入示例项目` ,体验完整组件示例。
:::
::: preview https://hellouniapp.dcloud.net.cn/pages/extUI/segmented-control/segmented-control
> Template
``` html
::: tip 组件名:uni-segmented-control
> 代码块: `uSegmentedControl`
[点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uni-segmented-control)
:::
用作不同视图的显示
## 介绍
### 基本用法
```html
<template>
<view>
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" activeColor="#4cd964"></uni-segmented-control>
<view class="content">
<view v-show="current === 0">
选项卡1的内容
</view>
<view v-show="current === 1">
选项卡2的内容
</view>
<view v-show="current === 2">
选项卡3的内容
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
...
items: ['选项1', '选项2', '选项3'],
current: 0
};
},
methods: {
...
onClickItem(e) {
if (this.current != e.currentIndex) {
this.current = e.currentIndex;
}
}
}
};
</script>
```
## API
### SegmentedControl Props
| 属性名 | 类型 | 默认值 | 说明 |
| :-----------: | :----: | :---------: | :----------------------------------------------------------: |
| current | Number | 0 | 当前选中的tab索引值,从0计数 |
| styleType | String | button | 分段器样式类型,可选值:button(按钮类型),text(文字类型) |
| activeColor | String | #007aff | 选中的标签背景色与边框颜色 |
| inActiveColor | String | transparent | 未激活时的颜色 |
| values | Array | - | 选项数组 |
### SegmentedControl Events
| 事件名 | 说明 | 返回值 |
| :--------: | :--------------------: | :--------------: |
| @clickItem | 组件触发点击事件时触发 | e={currentIndex} |
## 示例
::: warning 注意
示例依赖了 `uni-card` `uni-section` `uni-scss` 等多个组件,直接拷贝示例代码将无法正常运行 。
请到 [组件下载页面](https://ext.dcloud.net.cn/plugin?name=uni-segmented-control) ,在页面右侧选择 `使用 HBuilderX导入示例项目` ,体验完整组件示例。
:::
::: preview https://hellouniapp.dcloud.net.cn/pages/extUI/segmented-control/segmented-control
> Template
``` html
<template>
<view>
<uni-card is-full>
......@@ -127,8 +128,8 @@ export default {
</view>
</view>
</template>
```
> Script
```
> Script
```html
<script>
export default {
......@@ -173,9 +174,9 @@ export default {
}
}
</script>
```
> Style
```
> Style
```html
<style lang="scss">
.example-body {
......@@ -249,8 +250,8 @@ export default {
.uni-list-item__content-title {
font-size: 14px;
}
</style>
```
:::
</style>
```
:::
[完整示例演示](https://hellouniapp.dcloud.net.cn/pages/extUI/segmented-control/segmented-control)
\ No newline at end of file
......@@ -181,6 +181,8 @@ vue页面在App端的渲染引擎默认是系统webview(不是手机自带浏
* 为避免和内置组件冲突,自定义组件请加上前缀(但不能是 u 和 uni)。比如可使用的自定义组件名称:`my-view``m-input``we-icon`,例如不可使用的自定义组件名称:`u-view``uni-input`,如果已有项目使用了可能造成冲突的名称,请修改名称,另外微信小程序下自定义组件名称不能以 wx 开头。
* vue3 开发阶段不会自动处理语法兼容问题,如果在低版本浏览器上运行,需要自行处理,可参考[详情](https://cn.vitejs.dev/config/build-options.html#build-target)
### 小程序开发注意@mp
#### 各家小程序实现机制不同,可能存在的平台兼容问题
......
......@@ -340,6 +340,19 @@ HBuilderX中合并路由界面效果图:
**Tips**
- `uni_modules`插件可以在package.json的`uni_modules->dependencies`节点配置三方依赖(依赖的插件也必须是`uni_modules`插件),如果是依赖了三方的npm插件,可以使用标准的dependencies节点配置。
```json
// 通过 uni_modules->dependencies 配置三方uni_modules插件依赖
{
"id": "uni-badge",
"displayName": "uni-badge 数字角标",
"version": "1.2.2",
"description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。",
"uni_modules": {
"dependencies": ["uni-scss"]
}
}
```
#### 发布到插件市场
当您的插件开发完毕,可以直接发布到[插件市场](https://ext.dcloud.net.cn/)供其他人免费或付费使用,插件市场提供了变现、评价等机制,优秀的插件作者,可以做到月入好几万。
......
......@@ -44,7 +44,7 @@ npm install -g @vue/cli
**注意**
- Vue3/Vite版要求 node 版本`^14.18.0 || >=16.0.0`
- Vue3/Vite版要求 node 版本 18+、20+
- 如果使用 HBuilderX(3.6.7以下版本)运行 Vue3/Vite 创建的最新的 cli 工程,需要在 HBuilderX 运行配置最底部设置 node路径 为自己本机高版本 node 路径(注意需要重启 HBuilderX 才可以生效)
* HBuilderX Mac 版本菜单栏左上角 HBuilderX->偏好设置->运行配置->node路径
* HBuilderX Windows 版本菜单栏 工具->设置->运行配置->node路径
......
此差异已折叠。
此差异已折叠。
......@@ -38,7 +38,8 @@
* [《uniapp 原生插件开发-android》](https://www.bilibili.com/video/BV13V411H7W2?spm_id_from=333.999.0.0&vd_source=b123f8c166833c59567e6923b9aa2013),出品人:朱哲
* [《uniapp 原生插件开发-iOS》](https://www.bilibili.com/video/BV1Db4y1D7Yr?spm_id_from=333.999.0.0),出品人:朱哲
* [《雪狐uni-app+阿里直播实战项目开发第一季》](https://www.studyfox.cn/487.html),出品人:雪狐网
* [《2022新课uniapp零基础入门到项目打包》](https://www.bilibili.com/video/BV1mT411K7nW?p=1),出品人:咸虾米_
* [《2024新课uniapp Vue3 零基础入门到项目打包》](https://www.bilibili.com/video/BV1Yg4y127Fp/?p=1),出品人:咸虾米_
* [《2022新课uniapp Vue2 零基础入门到项目打包》](https://www.bilibili.com/video/BV1mT411K7nW?p=1),出品人:咸虾米_
......
......@@ -105,7 +105,7 @@
* App 本地打包
* [Android本地离线打包](https://nativesupport.dcloud.net.cn/AppDocs/usesdk/android)
* [iOS本地离线打包](https://nativesupport.dcloud.net.cn/AppDocs/usesdk/ios)
* [App 加固加固](app-security.md)
* [App 加固](app-security.md)
* [App 隐私合规检测](app-privacy-detect.md)
* [App 上架注意](store.md)
* [国内应用市场上架](android-store.md)
......@@ -142,7 +142,7 @@
* [app js/nvue文件原生混淆加密](app-sec-confusion.md)
* [Android安全漏洞问题解决方案](app-sec-android.md)
* [App 安全检测API](app-sec-api.md)
* [App 加固加固](app-security.md)
* [App 加固](app-security.md)
* [App 隐私合规检测](app-privacy-detect.md)
* 网络安全
* [云端一体安全网络](https://doc.dcloud.net.cn/uniCloud/secure-network.html)
......
......@@ -128,9 +128,6 @@
DCloud为开发者争取了福利,可优惠获取高德、腾讯的商业授权。如有需求请发邮件到`bd@dcloud.io`(注明你的公司名称、应用名称/介绍、HBuilder账户);你也可以直接通过`企业微信`发起在线咨询,扫描以下二维码获取地图福利。如您需要快速回复,一定注明公司名称、应用名称/介绍、以及HBuilder账户,感谢你的理解与配合。
- 腾讯地图商业授权现优惠政策:买1年送1个月,买2年送1年。如需购买,请速扫以下二维码咨询与购买!
![](https://web-assets.dcloud.net.cn/unidoc/zh/uni-ad/sc-weixin.png)
**注意骗局**
......
>HBuilderX 4.08正式版本2024年4月24日更新云端打包机支持 uni-app 项目配置隐私清单
>HBuilderX 4.13及以上版本开始支持 uni-app x 项目配置隐私清单
## 什么是隐私清单?
在 2023 年 6 月的全球开发者大会(WWDC23)上,Apple 宣布了一系列[关于 App Store 提交隐私更新](https://developer.apple.com/cn/news/?id=3d8a9yyh)的新政策。这些更新旨在增强应用程序在用户数据收集和使用方面的透明度,从而更好地保护用户的隐私权益。
政策主要包含以下关键点:
> * 必要理由的API([use of required reason API](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api)):Apple 引入了一种新的机制,要求开发者在使用某些可能影响用户隐私的 API 时,必须提供使用这些 API 的必要理由。
> * 隐私数据使用描述([data use in privacy manifests](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests)):在你的应用程序或第三方SDK的隐私清单中添加收集关于用户的数据类别,以及收集数据的原因。
> * 第三方 SDK 隐私清单和签名:SDK 提供者需要对清单进行签名,以证明其内容的真实性和准确性。(详情见下文中[xcframework格式的SDK库配置隐私清单](#xcframework))
简单的说隐私清单是一个属性列表,记录您的应用程序或第三方SDK使用的API的原因以及使用/收集的隐私数据类型。
> 从2024年5月1日开始,任何未在隐私清单文件中描述 `必要理由API(use of required reason API)` 使用情况的应用程序,都将无法通过 App Store Connect 的审核,而`隐私数据使用描述(data use in privacy manifests)`目前不会触发审核问题,但建议开发者以及插件作者尽早适配隐私清单,如实填写数据使用描述
## uni-app/uni-app x如何配置隐私清单
通常情况你无需额外配置隐私清单,uni-app/uni-app x 框架中涉及隐私清单的功能模块 DCloud 会根据应用配置自动生成,更新到HBuilderX到最新版本重新提交云端打包即可。
在以下情况可能需要你补充隐私清单:
- 应用代码中包含并非三方SDK提供的收集用户信息相关的功能,比如:获取用户联系方式,信用卡信息,敏感信息、健康信息、浏览历史记录等等
- 使用的`原生语言插件``uts插件`未支持隐私清单,且提交审核时因隐私清单相关问题被拒
这时需要你根据实际情况制作补充隐私清单文件`PrivacyInfo.xcprivacy`,详情可参考[制作隐私清单文件PrivacyInfo.xcprivacy](#privacyInfo)
将制作的隐私清单文件`PrivacyInfo.xcprivacy`保存在项目的 `nativeResources/ios` 目录,详情如下:
![](https://web-ext-storage.dcloud.net.cn/doc/app/ios/app-setup-ios-privacyinfo.jpg)
> 添加或编辑隐私清单文件`PrivacyInfo.xcprivacy`后需提交云端打包后才能生效
## 原生语言插件及UTS插件如何配置隐私清单
> 仅插件作者需关心此章节内容,插件使用者可跳过此章节
`原生语言插件``UTS插件`作者应该根据根据插件的实际情况配置好隐私清单,避免插件使用者手动补充隐私清单,配置后云端打包会自动合并处理隐私清单。
插件依赖的 `xcframework` 格式SDK库涉及的隐私清单可以通过签名内置 `PrivacyInfo.xcprivacy` 文件,而其它格式的SDK库(如.framework、.a等)或插件源码涉及的隐私清单需要在插件包里内置`PrivacyInfo.xcprivacy` 文件
### 原生语言插件及UTS插件配置PrivacyInfo.xcprivacy文件
- 原生语言插件
`ios` 目录下添加 `PrivacyInfo.xcprivacy` 文件,详情如下:
![](https://web-ext-storage.dcloud.net.cn/doc/app/ios/native-plugin-setup-ios-privacyinfo.jpg)
- UTS插件
`utssdk/app-ios` 目录下添加 `PrivacyInfo.xcprivacy` 文件,详情如下:
![](https://web-ext-storage.dcloud.net.cn/doc/app/ios/uts-setup-ios-privacyinfo.jpg)
### xcframework格式的SDK库配置隐私清单@xcframework
xcframework库需在 xcode 环境中进行配置:
- 在SDK原生工程内创建`PrivacyInfo.xcprivacy`文件,创建方法:
在Xcode 15以上版本中,创建新文件 -> Resource -> PrivacyInfo.xcprivacy,并根据[制作隐私清单文件PrivacyInfo.xcprivacy](#privacyInfo)编辑隐私清单
- 通过`xcodebuild`命令将SDK制作成xcframework的形式:
```
xcodebuild -create-xcframework -framework <第一个库的路径> -framework <第二个库的路径> -output <输出路径/库名称.xcframework>
```
- 通过`codesign`命令行给`xcframework`签名:
```
codesign --timestamp -v --sign "证书名称" SDK名称.xcframework
```
## 制作隐私清单文件PrivacyInfo.xcprivacy@privacyInfo
隐私清单文件`PrivacyInfo.xcprivacy`是 PropertyList 格式文件,建议在XCode中创建并编辑,完成后保存使用。
### 隐私清单文件中键值对说明
| Key | 说明 |
|-----|------|
| NSPrivacyTracking | 布尔值,指示您的应用程序或第三方SDK是否使用应用程序跟踪透明度框架下定义的数据进行跟踪 |
| NSPrivacyTrackingDomains | 一组字符串,列出您的应用程序或第三方SDK连接到的参与跟踪的互联网域。如果用户未通过应用程序跟踪透明度框架授予跟踪权限,则对这些域的网络请求将失败,您的应用程序将收到错误. 如果将NSPrivacyTracking设置为true,则需要在NSPrivaceTrackingDomains中至少提供一个internet域 |
| NSPrivacyCollectedDataTypes | 隐私数据使用描述,用于描述应用程序或第三方SDK隐私数据采集的数据类型。有关要在字典中使用的键和值的信息,请参阅[data use in privacy manifests](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests)。 |
| NSPrivacyAccessedAPITypes | 必要理由API,使用了苹果需要说明原因的API时需要填写,具体API的列表和原因请参阅[use of required reason API](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api)。 |
#### NSPrivacyAccessedAPITypes必要理由API的示例
如应用中用到了UserDefaults相关的API则按如下示例填写:
![](https://web-ext-storage.dcloud.net.cn/doc/app/ios/ios-pricacyinfo-requiredapi-sample.jpg)
#### NSPrivacyCollectedDataTypes隐私数据采集的示例
如应用中需要用户输入手机号则按如下示例填写:
![](https://web-ext-storage.dcloud.net.cn/doc/app/ios/ios-pricacyinfo-collecteddata-sample.jpg)
更多制作隐私清单文件参考文档:
* [苹果官方文档:Privacy manifest files](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files)
* [苹果官方文档:use of required reason API](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api)
* [苹果官方文档:data use in privacy manifests](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests)
* [掘金:一文解读苹果隐私新政:提供隐私清单文件](https://juejin.cn/post/7260752483054600252)
* [掘金:iOS 隐私清单和三方SDK签名适配](https://juejin.cn/post/7347165355586109477)
### PrivacyInfo.xcprivacy文件示例
以下是`PrivacyInfo.xcprivacy`文件示例,仅作为参考,实际使用需删除注释内容:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- 描述应用或SDK收集的数据类型 -->
<key>NSPrivacyCollectedDataTypes</key>
<array>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypePhoneNumber</string> <!-- 用于标识应用或SDK收集的数据类型 -->
<key>NSPrivacyCollectedDataTypeLinked</key>
<true/> <!-- 应用程序或SDK是否将此数据类型链接到用户的身份 -->
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/> <!-- 应用程序或SDK是否使用此数据类型进行跟踪 -->
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string> <!-- 收集数据的原因/目的 -->
</array>
</dict>
</array>
<!-- 描述应用或SDK访问的API类型及使用原因 -->
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string> <!-- 使用API的原因代码 -->
</array>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string> <!-- 标记应用程序必要理由的API类型 ->
</dict>
</array>
<!-- 指示应用或SDK是否使用应用跟踪透明度框架下定义的数据进行跟踪 -->
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>
```
## 小程序SDK/离线SDK如何支持隐私清单
`HBuilderX 4.13`版本开始我们在原生示例工程里内置了默认的`PrivacyInfo.xcprivacy` 文件,开发者可根据自身项目情况编辑后重新出包
参考:[uniMPSDK隐私清单](https://nativesupport.dcloud.net.cn/UniMPDocs/UseSdk/ios.html#%25E9%259A%2590%25E7%25A7%2581%25E6%25B8%2585%25E5%258D%2595)[离线SDK隐私清单](https://nativesupport.dcloud.net.cn/AppDocs/usesdk/ios.html#%25E9%259A%2590%25E7%25A7%2581%25E6%25B8%2585%25E5%258D%2595)
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -79,6 +79,7 @@ Uni统一错误信息,用于统一各平台(端)错误信息
对于已经实现的API,继续保留现有errCode规范(保留向下兼容)。\
错误码长度及规范参考微信小程序的[Errno错误码](https://developers.weixin.qq.com/miniprogram/dev/framework/usability/PublicErrno.html#%E9%94%99%E8%AF%AF%E7%A0%81%E5%88%97%E8%A1%A8),使用 7 位数错误码,第 1 - 2 位标识 API 接口的一级类目,第 3 - 4 位标识 API 接口的二级类目,第 5 - 7 位表示具体的错误类型。
其他平台,与微信小程序相同的错误,错误码应尽量保持一致。定义平台专有错误码时,为了避免冲突,错误码的第 5 - 7 位按以下规则:
+ 跨端(App/Web):使用6xx
+ App-Android端:使用7xx
+ App-iOS端:使用8xx
+ Web端:使用9xx
......
此差异已折叠。
此差异已折叠。
......@@ -268,3 +268,6 @@ cli创建的项目使用`npm run dev:h5:ssr`运行即可
- Client ***
- Server ***
```
- 若路由模式配置为history之后,浏览器控制台显示如下报错,则需要根据文档检查有无准备好history相关配置。[配置文档](https://zh.uniapp.dcloud.io/quickstart-hx.html#%E5%8F%91%E5%B8%83%E4%B8%BAweb%E7%BD%91%E7%AB%99)
- `Hydration completed but contains mismatches`
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -4,7 +4,7 @@
> uni-app 内置了 [Pinia](https://pinia.vuejs.org/zh/index.html) 。Vue 2 项目暂不支持
> 使用 `HBuilder X` 不需要手动安装,直接使用即可。使用 `CLI` 需要手动安装,执行 `yarn add pinia@2.0.33` 或 `npm install pinia@2.0.33`。
> 使用 `HBuilder X` 不需要手动安装,直接使用即可。使用 `CLI` 需要手动安装,执行 `yarn add pinia@2.0.36` 或 `npm install pinia@2.0.36`。
### Pinia 是什么?
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -132,4 +132,8 @@ await tag.$('.test')
### 测试示例
GitHub: [https://github.com/dcloudio/hello-uniapp](https://github.com/dcloudio/hello-uniapp)
\ No newline at end of file
GitHub: [https://github.com/dcloudio/hello-uniapp](https://github.com/dcloudio/hello-uniapp)
### 更新记录
- `HBuilderX 4.13` 支持 `page.data` 获取 `defineExpose` 暴露的数据
\ No newline at end of file
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册