Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
良好的行为成为习惯
uni-app
提交
6696b612
U
uni-app
项目概览
良好的行为成为习惯
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6696b612
编写于
12月 07, 2018
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update mp-runtime
上级
4415a3d8
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
327 addition
and
6 deletion
+327
-6
build/rollup.config.js
build/rollup.config.js
+1
-1
packages/uni-mp-alipay/dist/index.js
packages/uni-mp-alipay/dist/index.js
+75
-0
packages/uni-mp-alipay/package.json
packages/uni-mp-alipay/package.json
+1
-1
packages/uni-mp-baidu/dist/index.js
packages/uni-mp-baidu/dist/index.js
+75
-0
packages/uni-mp-baidu/package.json
packages/uni-mp-baidu/package.json
+1
-1
packages/uni-mp-weixin/dist/index.js
packages/uni-mp-weixin/dist/index.js
+75
-0
packages/uni-mp-weixin/package.json
packages/uni-mp-weixin/package.json
+1
-1
src/core/runtime/base.js
src/core/runtime/base.js
+28
-0
src/core/runtime/index.js
src/core/runtime/index.js
+20
-2
src/core/runtime/todo.js
src/core/runtime/todo.js
+32
-0
src/platforms/mp-alipay/service/api/providers.js
src/platforms/mp-alipay/service/api/providers.js
+6
-0
src/platforms/mp-baidu/service/api/providers.js
src/platforms/mp-baidu/service/api/providers.js
+6
-0
src/platforms/mp-weixin/service/api/providers.js
src/platforms/mp-weixin/service/api/providers.js
+6
-0
未找到文件。
build/rollup.config.js
浏览文件 @
6696b612
...
@@ -8,7 +8,7 @@ const GLOBAL = {
...
@@ -8,7 +8,7 @@ const GLOBAL = {
'
mp-baidu
'
:
'
swan
'
'
mp-baidu
'
:
'
swan
'
}
}
module
.
exports
=
{
module
.
exports
=
{
input
:
'
src/core/
uni
.js
'
,
input
:
'
src/core/
runtime/index
.js
'
,
output
:
{
output
:
{
file
:
`packages/uni-
${
process
.
env
.
UNI_PLATFORM
}
/dist/index.js`
,
file
:
`packages/uni-
${
process
.
env
.
UNI_PLATFORM
}
/dist/index.js`
,
format
:
'
es
'
format
:
'
es
'
...
...
packages/uni-mp-alipay/dist/index.js
浏览文件 @
6696b612
...
@@ -97,6 +97,67 @@ function upx2px (number, newDeviceWidth) {
...
@@ -97,6 +97,67 @@ function upx2px (number, newDeviceWidth) {
return
number
return
number
}
}
const
todoApis
=
Object
.
create
(
null
);
const
TODOS
=
[
'
subscribePush
'
,
'
unsubscribePush
'
,
'
onPush
'
,
'
offPush
'
,
'
share
'
];
function
createTodoApi
(
name
)
{
return
function
todoApi
({
fail
,
complete
})
{
const
res
=
{
errMsg
:
`
${
name
}
:fail:暂不支持
${
name
}
方法`
};
isFn
(
fail
)
&&
fail
(
res
);
isFn
(
complete
)
&&
complete
(
res
);
}
}
TODOS
.
forEach
(
function
(
name
)
{
todoApis
[
name
]
=
createTodoApi
(
name
);
});
var
providers
=
{
oauth
:
[
'
alipay
'
],
share
:
[
'
alipay
'
],
payment
:
[
'
alipay
'
],
push
:
[
'
alipay
'
]
};
function
getProvider
({
service
,
success
,
fail
,
complete
})
{
let
res
=
false
;
if
(
providers
[
service
])
{
res
=
{
errMsg
:
'
getProvider:ok
'
,
service
,
provider
:
providers
[
service
]
};
isFn
(
success
)
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getProvider:fail:服务[
'
+
service
+
'
]不存在
'
};
isFn
(
fail
)
&&
fail
(
res
);
}
isFn
(
complete
)
&&
complete
(
res
);
}
var
baseApi
=
/*#__PURE__*/
Object
.
freeze
({
getProvider
:
getProvider
});
var
api
=
/*#__PURE__*/
Object
.
freeze
({
var
api
=
/*#__PURE__*/
Object
.
freeze
({
...
@@ -114,6 +175,12 @@ if (typeof Proxy !== 'undefined') {
...
@@ -114,6 +175,12 @@ if (typeof Proxy !== 'undefined') {
if
(
api
[
name
])
{
if
(
api
[
name
])
{
return
promisify
(
name
,
api
[
name
])
return
promisify
(
name
,
api
[
name
])
}
}
if
(
baseApi
[
name
])
{
return
promisify
(
name
,
baseApi
[
name
])
}
if
(
todoApis
[
name
])
{
return
promisify
(
name
,
todoApis
[
name
])
}
if
(
!
my
.
hasOwnProperty
(
name
))
{
if
(
!
my
.
hasOwnProperty
(
name
))
{
return
return
}
}
...
@@ -123,6 +190,14 @@ if (typeof Proxy !== 'undefined') {
...
@@ -123,6 +190,14 @@ if (typeof Proxy !== 'undefined') {
}
else
{
}
else
{
uni$1
.
upx2px
=
upx2px
;
uni$1
.
upx2px
=
upx2px
;
Object
.
keys
(
todoApis
).
forEach
(
name
=>
{
uni$1
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
baseApi
).
forEach
(
name
=>
{
uni$1
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
api
).
forEach
(
name
=>
{
Object
.
keys
(
api
).
forEach
(
name
=>
{
uni$1
[
name
]
=
promisify
(
name
,
api
[
name
]);
uni$1
[
name
]
=
promisify
(
name
,
api
[
name
]);
});
});
...
...
packages/uni-mp-alipay/package.json
浏览文件 @
6696b612
{
{
"name"
:
"@dcloudio/uni-mp-alipay"
,
"name"
:
"@dcloudio/uni-mp-alipay"
,
"version"
:
"0.0.
1
"
,
"version"
:
"0.0.
2
"
,
"description"
:
"uni-app mp-alipay"
,
"description"
:
"uni-app mp-alipay"
,
"main"
:
"dist/index.js"
,
"main"
:
"dist/index.js"
,
"scripts"
:
{
"scripts"
:
{
...
...
packages/uni-mp-baidu/dist/index.js
浏览文件 @
6696b612
...
@@ -97,6 +97,67 @@ function upx2px (number, newDeviceWidth) {
...
@@ -97,6 +97,67 @@ function upx2px (number, newDeviceWidth) {
return
number
return
number
}
}
const
todoApis
=
Object
.
create
(
null
);
const
TODOS
=
[
'
subscribePush
'
,
'
unsubscribePush
'
,
'
onPush
'
,
'
offPush
'
,
'
share
'
];
function
createTodoApi
(
name
)
{
return
function
todoApi
({
fail
,
complete
})
{
const
res
=
{
errMsg
:
`
${
name
}
:fail:暂不支持
${
name
}
方法`
};
isFn
(
fail
)
&&
fail
(
res
);
isFn
(
complete
)
&&
complete
(
res
);
}
}
TODOS
.
forEach
(
function
(
name
)
{
todoApis
[
name
]
=
createTodoApi
(
name
);
});
var
providers
=
{
oauth
:
[
'
baidu
'
],
share
:
[
'
baidu
'
],
payment
:
[
'
baidu
'
],
push
:
[
'
baidu
'
]
};
function
getProvider
({
service
,
success
,
fail
,
complete
})
{
let
res
=
false
;
if
(
providers
[
service
])
{
res
=
{
errMsg
:
'
getProvider:ok
'
,
service
,
provider
:
providers
[
service
]
};
isFn
(
success
)
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getProvider:fail:服务[
'
+
service
+
'
]不存在
'
};
isFn
(
fail
)
&&
fail
(
res
);
}
isFn
(
complete
)
&&
complete
(
res
);
}
var
baseApi
=
/*#__PURE__*/
Object
.
freeze
({
getProvider
:
getProvider
});
var
api
=
/*#__PURE__*/
Object
.
freeze
({
var
api
=
/*#__PURE__*/
Object
.
freeze
({
...
@@ -114,6 +175,12 @@ if (typeof Proxy !== 'undefined') {
...
@@ -114,6 +175,12 @@ if (typeof Proxy !== 'undefined') {
if
(
api
[
name
])
{
if
(
api
[
name
])
{
return
promisify
(
name
,
api
[
name
])
return
promisify
(
name
,
api
[
name
])
}
}
if
(
baseApi
[
name
])
{
return
promisify
(
name
,
baseApi
[
name
])
}
if
(
todoApis
[
name
])
{
return
promisify
(
name
,
todoApis
[
name
])
}
if
(
!
swan
.
hasOwnProperty
(
name
))
{
if
(
!
swan
.
hasOwnProperty
(
name
))
{
return
return
}
}
...
@@ -123,6 +190,14 @@ if (typeof Proxy !== 'undefined') {
...
@@ -123,6 +190,14 @@ if (typeof Proxy !== 'undefined') {
}
else
{
}
else
{
uni$1
.
upx2px
=
upx2px
;
uni$1
.
upx2px
=
upx2px
;
Object
.
keys
(
todoApis
).
forEach
(
name
=>
{
uni$1
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
baseApi
).
forEach
(
name
=>
{
uni$1
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
api
).
forEach
(
name
=>
{
Object
.
keys
(
api
).
forEach
(
name
=>
{
uni$1
[
name
]
=
promisify
(
name
,
api
[
name
]);
uni$1
[
name
]
=
promisify
(
name
,
api
[
name
]);
});
});
...
...
packages/uni-mp-baidu/package.json
浏览文件 @
6696b612
{
{
"name"
:
"@dcloudio/uni-mp-baidu"
,
"name"
:
"@dcloudio/uni-mp-baidu"
,
"version"
:
"0.0.
1
"
,
"version"
:
"0.0.
2
"
,
"description"
:
"uni-app mp-baidu"
,
"description"
:
"uni-app mp-baidu"
,
"main"
:
"dist/index.js"
,
"main"
:
"dist/index.js"
,
"scripts"
:
{
"scripts"
:
{
...
...
packages/uni-mp-weixin/dist/index.js
浏览文件 @
6696b612
...
@@ -97,6 +97,67 @@ function upx2px (number, newDeviceWidth) {
...
@@ -97,6 +97,67 @@ function upx2px (number, newDeviceWidth) {
return
number
return
number
}
}
const
todoApis
=
Object
.
create
(
null
);
const
TODOS
=
[
'
subscribePush
'
,
'
unsubscribePush
'
,
'
onPush
'
,
'
offPush
'
,
'
share
'
];
function
createTodoApi
(
name
)
{
return
function
todoApi
({
fail
,
complete
})
{
const
res
=
{
errMsg
:
`
${
name
}
:fail:暂不支持
${
name
}
方法`
};
isFn
(
fail
)
&&
fail
(
res
);
isFn
(
complete
)
&&
complete
(
res
);
}
}
TODOS
.
forEach
(
function
(
name
)
{
todoApis
[
name
]
=
createTodoApi
(
name
);
});
var
providers
=
{
oauth
:
[
'
weixin
'
],
share
:
[
'
weixin
'
],
payment
:
[
'
wxpay
'
],
push
:
[
'
weixin
'
]
};
function
getProvider
({
service
,
success
,
fail
,
complete
})
{
let
res
=
false
;
if
(
providers
[
service
])
{
res
=
{
errMsg
:
'
getProvider:ok
'
,
service
,
provider
:
providers
[
service
]
};
isFn
(
success
)
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getProvider:fail:服务[
'
+
service
+
'
]不存在
'
};
isFn
(
fail
)
&&
fail
(
res
);
}
isFn
(
complete
)
&&
complete
(
res
);
}
var
baseApi
=
/*#__PURE__*/
Object
.
freeze
({
getProvider
:
getProvider
});
var
api
=
/*#__PURE__*/
Object
.
freeze
({
var
api
=
/*#__PURE__*/
Object
.
freeze
({
...
@@ -114,6 +175,12 @@ if (typeof Proxy !== 'undefined') {
...
@@ -114,6 +175,12 @@ if (typeof Proxy !== 'undefined') {
if
(
api
[
name
])
{
if
(
api
[
name
])
{
return
promisify
(
name
,
api
[
name
])
return
promisify
(
name
,
api
[
name
])
}
}
if
(
baseApi
[
name
])
{
return
promisify
(
name
,
baseApi
[
name
])
}
if
(
todoApis
[
name
])
{
return
promisify
(
name
,
todoApis
[
name
])
}
if
(
!
wx
.
hasOwnProperty
(
name
))
{
if
(
!
wx
.
hasOwnProperty
(
name
))
{
return
return
}
}
...
@@ -123,6 +190,14 @@ if (typeof Proxy !== 'undefined') {
...
@@ -123,6 +190,14 @@ if (typeof Proxy !== 'undefined') {
}
else
{
}
else
{
uni$1
.
upx2px
=
upx2px
;
uni$1
.
upx2px
=
upx2px
;
Object
.
keys
(
todoApis
).
forEach
(
name
=>
{
uni$1
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
baseApi
).
forEach
(
name
=>
{
uni$1
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
api
).
forEach
(
name
=>
{
Object
.
keys
(
api
).
forEach
(
name
=>
{
uni$1
[
name
]
=
promisify
(
name
,
api
[
name
]);
uni$1
[
name
]
=
promisify
(
name
,
api
[
name
]);
});
});
...
...
packages/uni-mp-weixin/package.json
浏览文件 @
6696b612
{
{
"name"
:
"@dcloudio/uni-mp-weixin"
,
"name"
:
"@dcloudio/uni-mp-weixin"
,
"version"
:
"0.0.
1
"
,
"version"
:
"0.0.
2
"
,
"description"
:
"uni-app mp-weixin"
,
"description"
:
"uni-app mp-weixin"
,
"main"
:
"dist/index.js"
,
"main"
:
"dist/index.js"
,
"scripts"
:
{
"scripts"
:
{
...
...
src/core/runtime/base.js
0 → 100644
浏览文件 @
6696b612
import
{
isFn
}
from
'
uni-shared
'
import
providers
from
'
uni-platform/service/api/providers
'
export
function
getProvider
({
service
,
success
,
fail
,
complete
})
{
let
res
=
false
if
(
providers
[
service
])
{
res
=
{
errMsg
:
'
getProvider:ok
'
,
service
,
provider
:
providers
[
service
]
}
isFn
(
success
)
&&
success
(
res
)
}
else
{
res
=
{
errMsg
:
'
getProvider:fail:服务[
'
+
service
+
'
]不存在
'
}
isFn
(
fail
)
&&
fail
(
res
)
}
isFn
(
complete
)
&&
complete
(
res
)
}
src/core/
uni
.js
→
src/core/
runtime/index
.js
浏览文件 @
6696b612
import
{
import
{
promisify
promisify
}
from
'
./helpers/promise
'
}
from
'
.
.
/helpers/promise
'
import
{
import
{
upx2px
upx2px
}
from
'
./service/api/upx2px
'
}
from
'
../service/api/upx2px
'
import
todoApi
from
'
./todo
'
import
*
as
baseApi
from
'
./base
'
import
*
as
api
from
'
uni-platform/service/api/index.js
'
import
*
as
api
from
'
uni-platform/service/api/index.js
'
...
@@ -19,6 +23,12 @@ if (typeof Proxy !== 'undefined') {
...
@@ -19,6 +23,12 @@ if (typeof Proxy !== 'undefined') {
if
(
api
[
name
])
{
if
(
api
[
name
])
{
return
promisify
(
name
,
api
[
name
])
return
promisify
(
name
,
api
[
name
])
}
}
if
(
baseApi
[
name
])
{
return
promisify
(
name
,
baseApi
[
name
])
}
if
(
todoApi
[
name
])
{
return
promisify
(
name
,
todoApi
[
name
])
}
if
(
!
__GLOBAL__
.
hasOwnProperty
(
name
))
{
if
(
!
__GLOBAL__
.
hasOwnProperty
(
name
))
{
return
return
}
}
...
@@ -28,6 +38,14 @@ if (typeof Proxy !== 'undefined') {
...
@@ -28,6 +38,14 @@ if (typeof Proxy !== 'undefined') {
}
else
{
}
else
{
uni
.
upx2px
=
upx2px
uni
.
upx2px
=
upx2px
Object
.
keys
(
todoApi
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApi
[
name
])
})
Object
.
keys
(
baseApi
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApi
[
name
])
})
Object
.
keys
(
api
).
forEach
(
name
=>
{
Object
.
keys
(
api
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
api
[
name
])
uni
[
name
]
=
promisify
(
name
,
api
[
name
])
})
})
...
...
src/core/runtime/todo.js
0 → 100644
浏览文件 @
6696b612
import
{
isFn
}
from
'
uni-shared
'
const
todoApis
=
Object
.
create
(
null
)
const
TODOS
=
[
'
subscribePush
'
,
'
unsubscribePush
'
,
'
onPush
'
,
'
offPush
'
,
'
share
'
]
function
createTodoApi
(
name
)
{
return
function
todoApi
({
fail
,
complete
})
{
const
res
=
{
errMsg
:
`
${
name
}
:fail:暂不支持
${
name
}
方法`
}
isFn
(
fail
)
&&
fail
(
res
)
isFn
(
complete
)
&&
complete
(
res
)
}
}
TODOS
.
forEach
(
function
(
name
)
{
todoApis
[
name
]
=
createTodoApi
(
name
)
})
export
default
todoApis
src/platforms/mp-alipay/service/api/providers.js
0 → 100644
浏览文件 @
6696b612
export
default
{
oauth
:
[
'
alipay
'
],
share
:
[
'
alipay
'
],
payment
:
[
'
alipay
'
],
push
:
[
'
alipay
'
]
}
src/platforms/mp-baidu/service/api/providers.js
0 → 100644
浏览文件 @
6696b612
export
default
{
oauth
:
[
'
baidu
'
],
share
:
[
'
baidu
'
],
payment
:
[
'
baidu
'
],
push
:
[
'
baidu
'
]
}
src/platforms/mp-weixin/service/api/providers.js
0 → 100644
浏览文件 @
6696b612
export
default
{
oauth
:
[
'
weixin
'
],
share
:
[
'
weixin
'
],
payment
:
[
'
wxpay
'
],
push
:
[
'
weixin
'
]
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录