Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
言程序plus
uni-starter
提交
48ade9e8
U
uni-starter
项目概览
言程序plus
/
uni-starter
与 Fork 源项目一致
Fork自
DCloud / uni-starter
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-starter
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
48ade9e8
编写于
10月 14, 2021
作者:
DCloud_JSON
提交者:
study夏羽
11月 10, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
使用2.0版。当显示分享窗口时,监听返回操作(如:物理返回,全面屏手机侧滑)关闭分享窗口,而不是关闭当前页面。
上级
e2792f07
变更
14
显示空白变更内容
内联
并排
Showing
14 changed file
with
565 addition
and
544 deletion
+565
-544
README.md
README.md
+2
-1
changelog.md
changelog.md
+2
-0
manifest.json
manifest.json
+222
-270
package.json
package.json
+1
-1
pages/list/detail.vue
pages/list/detail.vue
+14
-6
pages/ucenter/about/about.vue
pages/ucenter/about/about.vue
+15
-6
pages/ucenter/ucenter.vue
pages/ucenter/ucenter.vue
+20
-12
uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js
...ules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js
+1
-1
uni_modules/uni-share/changelog.md
uni_modules/uni-share/changelog.md
+2
-0
uni_modules/uni-share/js_sdk/uni-image-menu.js
uni_modules/uni-share/js_sdk/uni-image-menu.js
+202
-168
uni_modules/uni-share/js_sdk/uni-share.js
uni_modules/uni-share/js_sdk/uni-share.js
+79
-77
uni_modules/uni-share/package.json
uni_modules/uni-share/package.json
+1
-1
uni_modules/uni-share/readme.md
uni_modules/uni-share/readme.md
+1
-1
uni_modules_tools/copy/manifest.json
uni_modules_tools/copy/manifest.json
+3
-0
未找到文件。
README.md
浏览文件 @
48ade9e8
...
...
@@ -142,6 +142,7 @@ uni-starter服务端使用[uni-config-center](https://ext.dcloud.net.cn/plugin?i
列举不需要强制登陆即可访问的页面完整路径(支持正则)
#### 配置示例
配置文件:
`项目根目录/uni-starter.config.js`
```
js
"
router
"
:
{
"
needLogin
"
:
[
...
...
@@ -303,7 +304,7 @@ uni-starter集成了这个功能,你只需直接在`项目根目录/uni-starte
-
而路由跳转方法不仅有
`uni.navigateTo`
还有
`uni.redirectTo`
,
`uni.reLaunch`
,
`uni.switchTab`
;
-
另外我们还希望控制直接跳转至哪种登陆类型
所以在uni-starter框架中我们这样定义:
>
uni-starter/common/appInit.js 的第228-280行
uni-starter/common/appInit.js 的第228-280行
```
js
const
{
"
router
"
:
{
needLogin
,
login
}
}
=
uniStarterConfig
//需要登录的页面
let
list
=
[
"
navigateTo
"
,
"
redirectTo
"
,
"
reLaunch
"
,
"
switchTab
"
];
...
...
changelog.md
浏览文件 @
48ade9e8
## 1.1.18(2021-10-14)
使用2.0版
`uni-share`
。当显示分享窗口时,监听返回操作(如:物理返回,全面屏手机侧滑)关闭分享窗口,而不是关闭当前页面。
## 1.1.17(2021-10-12)
-
更新文档
-
修复list页面where条件中缺少&符,导致的错误
...
...
manifest.json
浏览文件 @
48ade9e8
{
"name"
:
"统一应用基本项目"
,
"appid"
:
"__UNI__D53040B
"
,
"appid"
:
"请点击重新获取
"
,
"description"
:
"云端一体应用快速开发模版"
,
"versionName"
:
"1.0.0"
,
"versionCode"
:
"100"
,
...
...
@@ -54,12 +54,18 @@
"delay"
:
0
},
"modules"
:
{
"Fingerprint"
:
{},
"Share"
:
{},
"OAuth"
:
{},
"FaceID"
:
{},
"Geolocation"
:
{},
"Push"
:
{}
"Fingerprint"
:
{
},
"Share"
:
{
},
"OAuth"
:
{
},
"FaceID"
:
{
},
"Geolocation"
:
{
},
"Push"
:
{
}
},
"distribute"
:
{
"android"
:
{
...
...
@@ -98,79 +104,18 @@
},
"sdkConfigs"
:
{
"oauth"
:
{
"apple"
:
{},
"apple"
:
{
},
"weixin"
:
{
"appid"
:
""
,
"appsecret"
:
""
,
"UniversalLinks"
:
""
},
"univerify"
:
{}
},
"privacy"
:
{
"prompt"
:
"template"
,
"template"
:
{
"title"
:
"服务协议和隐私政策"
,
"message"
:
" 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=
\"
https://ask.dcloud.net.cn/protocol.html
\"
>《服务协议》</a>和<a href=
\"
https://ask.dcloud.net.cn/protocol.html
\"
>《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。"
,
"buttonAccept"
:
"同意"
,
"buttonRefuse"
:
"暂不同意"
}
},
"compatible"
:
{
"ignoreVersion"
:
true
},
"usingComponents"
:
true
,
"nvueStyleCompiler"
:
"uni-app"
,
"compilerVersion"
:
3
,
"splashscreen"
:
{
"alwaysShowBeforeRender"
:
false
,
"waiting"
:
true
,
"autoclose"
:
true
,
"delay"
:
0
},
"modules"
:
{
"Fingerprint"
:
{},
"OAuth"
:
{},
"FaceID"
:
{},
"Push"
:
{},
"Geolocation"
:
{}
},
"distribute"
:
{
"android"
:
{
"permissions"
:
[
"<uses-feature android:name=
\"
android.hardware.camera
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera.autofocus
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_WIFI_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CAMERA
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CHANGE_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CHANGE_WIFI_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.FLASHLIGHT
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MODIFY_AUDIO_SETTINGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MOUNT_UNMOUNT_FILESYSTEMS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_LOGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_PHONE_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.USE_FINGERPRINT
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.VIBRATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WAKE_LOCK
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_SETTINGS
\"
/>"
],
"abiFilters"
:
[
"armeabi-v7a"
,
"arm64-v8a"
,
"x86"
]
},
"ios"
:
{
"capabilities"
:
{
"entitlements"
:
{
"com.apple.developer.associated-domains"
:
[
"applinks:static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com"
]
}
"univerify"
:
{
}
},
"sdkConfigs"
:
{
"oauth"
:
{
"apple"
:
{},
"univerify"
:
{}
"ad"
:
{
},
"ad"
:
{},
"share"
:
{
"weixin"
:
{
"appid"
:
""
,
...
...
@@ -179,15 +124,20 @@
},
"geolocation"
:
{
"baidu"
:
{
"__platform__"
:
[
"ios"
,
"android"
],
"__platform__"
:
[
"ios"
,
"android"
],
"appkey_ios"
:
"请填写地图的key"
,
"appkey_android"
:
"请填写地图的key"
}
},
"push"
:
{
"unipush"
:
{}
"unipush"
:
{
}
},
"payment"
:
{}
"payment"
:
{
}
},
"icons"
:
{
"android"
:
{
...
...
@@ -228,7 +178,8 @@
},
"nvueLaunchMode"
:
""
},
"quickapp"
:
{},
"quickapp"
:
{
},
"mp-weixin"
:
{
"appid"
:
""
,
"setting"
:
{
...
...
@@ -263,10 +214,11 @@
"key"
:
""
}
}
},
"router"
:
{
"base"
:
""
}
},
"_spaceID"
:
""
,
"vueVersion"
:
"2"
}
}
}
package.json
浏览文件 @
48ade9e8
{
"id"
:
"uni-starter"
,
"displayName"
:
"uni-starter"
,
"version"
:
"1.1.1
7
"
,
"version"
:
"1.1.1
8
"
,
"description"
:
"云端一体应用快速开发基本项目模版"
,
"keywords"
:
[
"login"
,
...
...
pages/list/detail.vue
浏览文件 @
48ade9e8
...
...
@@ -50,14 +50,22 @@
</template>
<
script
>
import
uniShare
from
'
@/uni_modules/uni-share/js_sdk/uni-share.js
'
;
import
UniShare
from
'
@/uni_modules/uni-share/js_sdk/uni-share.js
'
;
const
uniShare
=
new
UniShare
()
const
db
=
uniCloud
.
database
();
const
readNewsLog
=
db
.
collection
(
'
read-news-log
'
)
import
{
mapGetters
}
from
'
vuex
'
;
export
default
{
onBackPress
({
from
})
{
if
(
from
==
'
backbutton
'
){
this
.
$nextTick
(
function
(){
uniShare
.
hide
()
})
return
uniShare
.
isShow
;
}
},
data
()
{
return
{
// 当前显示 _id
...
...
@@ -197,7 +205,7 @@
excerpt
,
avatar
})
);
uniShare
({
uniShare
.
show
({
content
:
{
//公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
type
:
0
,
href
:
this
.
uniStarterConfig
.
h5
.
url
+
`/#/pages/list/detail?id=
${
_id
}
&title=
${
title
}
`
,
...
...
@@ -264,7 +272,7 @@
],
cancelText
:
this
.
$t
(
'
common
'
).
cancelShare
,
},
e
=>
{
//callback
// console.log(e);
console
.
log
(
e
);
})
},
}
...
...
pages/ucenter/about/about.vue
浏览文件 @
48ade9e8
...
...
@@ -19,8 +19,17 @@
</view>
</
template
>
<
script
>
import
uniShare
from
'
@/uni_modules/uni-share/js_sdk/uni-share.js
'
;
import
UniShare
from
'
@/uni_modules/uni-share/js_sdk/uni-share.js
'
;
const
uniShare
=
new
UniShare
()
export
default
{
onBackPress
({
from
})
{
if
(
from
==
'
backbutton
'
){
this
.
$nextTick
(
function
(){
uniShare
.
hide
()
})
return
uniShare
.
isShow
;
}
},
onLoad
()
{
// #ifdef APP-PLUS
this
.
version
=
plus
.
runtime
.
version
...
...
@@ -53,7 +62,7 @@
slogan
,
logo
}
=
this
.
about
uniShare
({
uniShare
.
show
({
content
:
{
//公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
type
:
0
,
href
:
download
,
...
...
pages/ucenter/ucenter.vue
浏览文件 @
48ade9e8
...
...
@@ -37,10 +37,18 @@
}
from
'
vuex
'
;
import
checkUpdate
from
'
@/uni_modules/uni-upgrade-center-app/utils/check-update
'
;
import
callCheckVersion
from
'
@/uni_modules/uni-upgrade-center-app/utils/call-check-version
'
;
import
u
niShare
from
'
@/uni_modules/uni-share/js_sdk/uni-share.js
'
;
// import pwdLogin from '../../common/toLogin.js';
import
U
niShare
from
'
@/uni_modules/uni-share/js_sdk/uni-share.js
'
;
const
uniShare
=
new
UniShare
()
const
db
=
uniCloud
.
database
();
export
default
{
onBackPress
({
from
})
{
if
(
from
==
'
backbutton
'
){
this
.
$nextTick
(
function
(){
uniShare
.
hide
()
})
return
uniShare
.
isShow
;
}
},
data
()
{
return
{
gridList
:
[{
...
...
@@ -273,7 +281,7 @@
slogan
}
=
this
.
appConfig
.
about
// #ifdef APP-PLUS
uniShare
({
uniShare
.
show
({
content
:
{
//公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
type
:
0
,
href
:
this
.
appConfig
.
h5
.
url
+
...
...
uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js
浏览文件 @
48ade9e8
uni_modules/uni-share/changelog.md
浏览文件 @
48ade9e8
## 2.0.0(2021-10-14)
支持监听返回操作(如:物理返回,全面屏手机侧滑)关闭分享弹窗
## 1.0.6(2021-08-25)
兼容vue3
## 1.0.5(2021-08-05)
...
...
uni_modules/uni-share/js_sdk/uni-image-menu.js
浏览文件 @
48ade9e8
var
nvMask
,
nvImageMenu
;
export
default
{
show
({
list
,
cancelText
},
callback
){
console
.
log
(
789789879
);
if
(
!
list
){
var
nvMask
,
nvImageMenu
;
class
NvImageMenu
{
constructor
(
arg
)
{
this
.
isShow
=
false
}
show
({
list
,
cancelText
},
callback
)
{
if
(
!
list
)
{
list
=
[{
"
img
"
:
"
/static/sharemenu/wechatfriend.png
"
,
"
text
"
:
"
图标文字
"
"
img
"
:
"
/static/sharemenu/wechatfriend.png
"
,
"
text
"
:
"
图标文字
"
}]
}
//以下为计算菜单的nview绘制布局,为固定算法,使用者无关关心
...
...
@@ -32,7 +37,16 @@ export default {
var
top1
=
left1
var
top2
=
top1
+
iconWidth
+
icontextSpace
+
textHeight
+
left1
const
TOP
=
{
top1
,
top2
},
LEFT
=
{
left1
,
left2
,
left3
,
left4
};
const
TOP
=
{
top1
,
top2
},
LEFT
=
{
left1
,
left2
,
left3
,
left4
};
nvMask
=
new
plus
.
nativeObj
.
View
(
"
nvMask
"
,
{
//先创建遮罩层
top
:
'
0px
'
,
...
...
@@ -41,26 +55,29 @@ export default {
width
:
'
100%
'
,
backgroundColor
:
'
rgba(0,0,0,0.2)
'
});
nvMask
.
addEventListener
(
"
click
"
,
function
()
{
//处理遮罩层点击
nvMask
.
hide
();
nvImageMenu
.
hide
();
})
nvImageMenu
=
new
plus
.
nativeObj
.
View
(
"
nvImageMenu
"
,
{
//创建底部图标菜单
bottom
:
'
0px
'
,
left
:
'
0px
'
,
height
:
(
iconWidth
+
textHeight
+
2
*
margin
)
*
Math
.
ceil
(
list
.
length
/
4
)
+
44
+
'
px
'
,
//'264px',
height
:
(
iconWidth
+
textHeight
+
2
*
margin
)
*
Math
.
ceil
(
list
.
length
/
4
)
+
44
+
'
px
'
,
//'264px',
width
:
'
100%
'
,
backgroundColor
:
'
rgb(255,255,255)
'
});
nvMask
.
addEventListener
(
"
click
"
,
()
=>
{
//处理遮罩层点击
// console.log('处理遮罩层点击');
this
.
hide
()
callback
({
event
:
"
clickMask
"
})
})
let
myList
=
[]
list
.
forEach
((
item
,
i
)
=>
{
list
.
forEach
((
item
,
i
)
=>
{
myList
.
push
({
tag
:
'
img
'
,
src
:
item
.
img
,
position
:
{
top
:
TOP
[
'
top
'
+
(
parseInt
(
i
/
4
)
+
1
)],
left
:
LEFT
[
'
left
'
+
(
1
+
i
%
4
)],
top
:
TOP
[
'
top
'
+
(
parseInt
(
i
/
4
)
+
1
)],
left
:
LEFT
[
'
left
'
+
(
1
+
i
%
4
)],
width
:
iconWidth
,
height
:
iconWidth
}
...
...
@@ -72,8 +89,8 @@ export default {
size
:
textHeight
},
position
:
{
top
:
TOP
[
'
top
'
+
(
parseInt
(
i
/
4
)
+
1
)]
+
iconWidth
+
icontextSpace
,
left
:
LEFT
[
'
left
'
+
(
1
+
i
%
4
)],
top
:
TOP
[
'
top
'
+
(
parseInt
(
i
/
4
)
+
1
)]
+
iconWidth
+
icontextSpace
,
left
:
LEFT
[
'
left
'
+
(
1
+
i
%
4
)],
width
:
iconWidth
,
height
:
textHeight
}
...
...
@@ -81,9 +98,8 @@ export default {
})
//绘制底部图标菜单的内容
nvImageMenu
.
draw
([
{
tag
:
'
rect
'
,
//菜单顶部的分割灰线
nvImageMenu
.
draw
([{
tag
:
'
rect
'
,
//菜单顶部的分割灰线
color
:
'
#e7e7e7
'
,
position
:
{
top
:
'
0px
'
,
...
...
@@ -92,7 +108,7 @@ export default {
},
{
tag
:
'
font
'
,
text
:
cancelText
,
//底部取消按钮的文字
text
:
cancelText
,
//底部取消按钮的文字
textStyles
:
{
size
:
'
14px
'
},
...
...
@@ -102,7 +118,7 @@ export default {
}
},
{
tag
:
'
rect
'
,
//底部取消按钮的顶部边线
tag
:
'
rect
'
,
//底部取消按钮的顶部边线
color
:
'
#e7e7e7
'
,
position
:
{
bottom
:
'
45px
'
,
...
...
@@ -112,15 +128,27 @@ export default {
...
myList
])
nvMask
.
show
()
nvImageMenu
.
show
()
//5+应支持从底部向上弹出的动画
nvImageMenu
.
show
()
// 开始动画
/*
plus.nativeObj.View.startAnimation({
type: 'slide-in-bottom',
duration: 300
}, nvImageMenu, {}, function() {
console.log('plus.nativeObj.View.startAnimation动画结束');
// 关闭原生动画
plus.nativeObj.View.clearAnimation();
nvImageMenu.show()
});
*/
nvImageMenu
.
addEventListener
(
"
click
"
,
e
=>
{
//处理底部图标菜单的点击事件,根据点击位置触发不同的逻辑
this
.
isShow
=
true
nvImageMenu
.
addEventListener
(
"
click
"
,
e
=>
{
//处理底部图标菜单的点击事件,根据点击位置触发不同的逻辑
// console.log("click menu"+JSON.stringify(e));
if
(
e
.
screenY
>
plus
.
screen
.
resolutionHeight
-
44
)
{
//点击了底部取消按钮
nvMask
.
hide
();
nvImageMenu
.
hide
();
// callback({event:"clickCancelButton"})
this
.
hide
()
}
else
if
(
e
.
clientX
<
5
||
e
.
clientX
>
screenWidth
-
5
||
e
.
clientY
<
5
)
{
//屏幕左右边缘5像素及菜单顶部5像素不处理点击
}
else
{
//点击了图标按钮
...
...
@@ -144,8 +172,10 @@ export default {
// console.log("点击按钮的序号: " + iClickIndex);
// if (iClickIndex >= 0 && iClickIndex <= 5) { //处理具体的点击逻辑,此处也可以自行定义逻辑。如果增减了按钮,此处也需要跟着修改
// }
callback
(
iClickIndex
)
this
.
hide
()
callback
({
event
:
"
clickMenu
"
,
index
:
iClickIndex
})
}
})
/* nvImageMenu.addEventListener("touchstart", function(e) {
...
...
@@ -161,9 +191,13 @@ export default {
//TODO 这里可以处理释放背景恢复的效果
})
*/
},
hide
(){
}
hide
()
{
nvMask
.
hide
()
nvImageMenu
.
hide
()
this
.
isShow
=
false
}
}
export
default
NvImageMenu
uni_modules/uni-share/js_sdk/uni-share.js
浏览文件 @
48ade9e8
import
uniImageMenu
from
'
./uni-image-menu.js
'
;
export
default
async
(
param
,
callback
)
=>
{
import
UniImageMenu
from
'
./uni-image-menu.js
'
;
class
UniShare
extends
UniImageMenu
{
constructor
(
arg
)
{
super
()
this
.
isShow
=
super
.
isShow
}
async
show
(
param
,
callback
){
var
menus
=
[]
plus
.
share
.
getServices
(
services
=>
{
//只显示有服务的项目
services
=
services
.
filter
(
item
=>
item
.
nativeClient
)
// console.log("servicesList",services);
services
=
services
.
filter
(
item
=>
item
.
nativeClient
)
let
servicesList
=
services
.
map
(
e
=>
e
.
id
)
param
.
menus
.
forEach
(
item
=>
{
if
(
servicesList
.
includes
(
item
.
share
.
provider
)
||
typeof
(
item
.
share
)
==
'
string
'
)
{
menus
.
push
(
item
)
}
})
// console.log(menus);
uniImageMenu
.
show
({
list
:
menus
,
cancelText
:
param
.
cancelText
},
e
=>
{
if
(
typeof
(
menus
[
e
][
'
share
'
])
==
'
string
'
)
{
switch
(
menus
[
e
][
'
share
'
]){
case
"
copyurl
"
:
copyurl
()
break
;
case
"
shareSystem
"
:
shareSystem
()
break
;
default
:
console
.
error
(
'
未知事件名称:
'
+
menus
[
e
][
'
share
'
]);
break
;
}
super
.
show
({
list
:
menus
,
cancelText
:
param
.
cancelText
},
e
=>
{
callback
(
e
)
if
(
e
.
event
==
'
clickMenu
'
){
if
(
typeof
(
menus
[
e
.
index
][
'
share
'
])
==
'
string
'
)
{
this
[
menus
[
e
.
index
][
'
share
'
]](
param
)
}
else
{
console
.
log
(
123456
,{
...
param
.
content
,
...
menus
[
e
].
share
,
});
uni
.
share
({
...
param
.
content
,
...
menus
[
e
].
share
,
success
:
function
(
res
)
{
...
menus
[
e
.
index
].
share
,
success
:
res
=>
{
console
.
log
(
"
success:
"
+
JSON
.
stringify
(
res
));
super
.
hide
()
},
fail
:
function
(
err
)
{
console
.
log
(
"
fail:
"
+
JSON
.
stringify
(
err
));
uni
.
showModal
({
content
:
JSON
.
stringify
(
err
),
showCancel
:
false
,
confirmText
:
"
知道了
"
confirmText
:
"
知道了
"
});
},
complete
(
e
)
{
uniImageMenu
.
hide
()
callback
(
e
)
}
})
}
}
})
},
err
=>
{
uni
.
showModal
({
title
:
'
获取服务供应商失败:
'
+
JSON
.
stringify
(
err
),
...
...
@@ -59,17 +50,22 @@ export default async (param,callback) => {
});
console
.
error
(
'
获取服务供应商失败:
'
+
JSON
.
stringify
(
err
));
})
function
copyurl
()
{
}
hide
(){
super
.
hide
()
}
copyurl
(
param
)
{
console
.
log
(
'
copyurl
'
,
param
);
uni
.
setClipboardData
({
data
:
param
.
content
.
href
,
success
:
function
()
{
success
:
()
=>
{
console
.
log
(
'
success
'
);
uni
.
hideToast
()
//关闭自带的toast
uni
.
hideToast
()
//关闭自带的toast
uni
.
showToast
({
title
:
'
复制成功
'
,
icon
:
'
none
'
});
super
.
hide
();
},
fail
:
(
err
)
=>
{
uni
.
showModal
({
...
...
@@ -80,17 +76,23 @@ export default async (param,callback) => {
});
}
// 使用系统分享发送分享消息
function
shareSystem
()
{
shareSystem
(
param
)
{
console
.
log
(
'
shareSystem
'
,
param
);
plus
.
share
.
sendWithSystem
({
type
:
'
text
'
,
content
:
param
.
content
.
title
+
param
.
content
.
summary
||
''
,
href
:
param
.
content
.
href
,
},
function
(
e
)
{
},
(
e
)
=>
{
console
.
log
(
'
分享成功
'
);
callback
(
e
)
},
function
(
e
)
{
console
.
log
(
'
分享失败:
'
+
JSON
.
stringify
(
e
));
callback
(
e
)
super
.
hide
()
},
(
err
)
=>
{
console
.
log
(
'
分享失败:
'
+
JSON
.
stringify
(
err
));
uni
.
showModal
({
title
:
'
获取服务供应商失败:
'
+
JSON
.
stringify
(
err
),
showCancel
:
false
,
confirmText
:
'
知道了
'
});
});
}
}
export
default
UniShare
\ No newline at end of file
uni_modules/uni-share/package.json
浏览文件 @
48ade9e8
{
"id"
:
"uni-share"
,
"displayName"
:
"uni-share"
,
"version"
:
"
1.0.6
"
,
"version"
:
"
2.0.0
"
,
"description"
:
"底部弹出宫格图标式的分享菜单,可覆盖原生组件。"
,
"keywords"
:
[
"分享菜单"
...
...
uni_modules/uni-share/readme.md
浏览文件 @
48ade9e8
...
...
@@ -9,7 +9,7 @@
export default {
methods: {
uniShare() {
uniShare({
uniShare
.show
({
content: { //公共的分享参数配置 类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
type: 0,
href: 'https://uniapp.dcloud.io/',
...
...
uni_modules_tools/copy/manifest.json
浏览文件 @
48ade9e8
...
...
@@ -193,6 +193,9 @@
"key"
:
""
}
}
},
"router"
:
{
"base"
:
""
}
},
"_spaceID"
:
"76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录