Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
这我不会
uni-starter
提交
48ade9e8
U
uni-starter
项目概览
这我不会
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
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
...
@@ -142,6 +142,7 @@ uni-starter服务端使用[uni-config-center](https://ext.dcloud.net.cn/plugin?i
列举不需要强制登陆即可访问的页面完整路径(支持正则)
列举不需要强制登陆即可访问的页面完整路径(支持正则)
#### 配置示例
#### 配置示例
配置文件:
`项目根目录/uni-starter.config.js`
配置文件:
`项目根目录/uni-starter.config.js`
```
js
```
js
"
router
"
:
{
"
router
"
:
{
"
needLogin
"
:
[
"
needLogin
"
:
[
...
@@ -303,7 +304,7 @@ uni-starter集成了这个功能,你只需直接在`项目根目录/uni-starte
...
@@ -303,7 +304,7 @@ uni-starter集成了这个功能,你只需直接在`项目根目录/uni-starte
-
而路由跳转方法不仅有
`uni.navigateTo`
还有
`uni.redirectTo`
,
`uni.reLaunch`
,
`uni.switchTab`
;
-
而路由跳转方法不仅有
`uni.navigateTo`
还有
`uni.redirectTo`
,
`uni.reLaunch`
,
`uni.switchTab`
;
-
另外我们还希望控制直接跳转至哪种登陆类型
-
另外我们还希望控制直接跳转至哪种登陆类型
所以在uni-starter框架中我们这样定义:
所以在uni-starter框架中我们这样定义:
>
uni-starter/common/appInit.js 的第228-280行
uni-starter/common/appInit.js 的第228-280行
```
js
```
js
const
{
"
router
"
:
{
needLogin
,
login
}
}
=
uniStarterConfig
//需要登录的页面
const
{
"
router
"
:
{
needLogin
,
login
}
}
=
uniStarterConfig
//需要登录的页面
let
list
=
[
"
navigateTo
"
,
"
redirectTo
"
,
"
reLaunch
"
,
"
switchTab
"
];
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)
## 1.1.17(2021-10-12)
-
更新文档
-
更新文档
-
修复list页面where条件中缺少&符,导致的错误
-
修复list页面where条件中缺少&符,导致的错误
...
...
manifest.json
浏览文件 @
48ade9e8
{
{
"name"
:
"统一应用基本项目"
,
"name"
:
"统一应用基本项目"
,
"appid"
:
"__UNI__D53040B
"
,
"appid"
:
"请点击重新获取
"
,
"description"
:
"云端一体应用快速开发模版"
,
"description"
:
"云端一体应用快速开发模版"
,
"versionName"
:
"1.0.0"
,
"versionName"
:
"1.0.0"
,
"versionCode"
:
"100"
,
"versionCode"
:
"100"
,
...
@@ -54,12 +54,18 @@
...
@@ -54,12 +54,18 @@
"delay"
:
0
"delay"
:
0
},
},
"modules"
:
{
"modules"
:
{
"Fingerprint"
:
{},
"Fingerprint"
:
{
"Share"
:
{},
},
"OAuth"
:
{},
"Share"
:
{
"FaceID"
:
{},
},
"Geolocation"
:
{},
"OAuth"
:
{
"Push"
:
{}
},
"FaceID"
:
{
},
"Geolocation"
:
{
},
"Push"
:
{
}
},
},
"distribute"
:
{
"distribute"
:
{
"android"
:
{
"android"
:
{
...
@@ -98,79 +104,18 @@
...
@@ -98,79 +104,18 @@
},
},
"sdkConfigs"
:
{
"sdkConfigs"
:
{
"oauth"
:
{
"oauth"
:
{
"apple"
:
{},
"apple"
:
{
},
"weixin"
:
{
"weixin"
:
{
"appid"
:
""
,
"appid"
:
""
,
"appsecret"
:
""
,
"appsecret"
:
""
,
"UniversalLinks"
:
""
"UniversalLinks"
:
""
},
},
"univerify"
:
{}
"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"
]
}
}
}
},
},
"sdkConfigs"
:
{
"ad"
:
{
"oauth"
:
{
"apple"
:
{},
"univerify"
:
{}
},
},
"ad"
:
{},
"share"
:
{
"share"
:
{
"weixin"
:
{
"weixin"
:
{
"appid"
:
""
,
"appid"
:
""
,
...
@@ -179,15 +124,20 @@
...
@@ -179,15 +124,20 @@
},
},
"geolocation"
:
{
"geolocation"
:
{
"baidu"
:
{
"baidu"
:
{
"__platform__"
:
[
"ios"
,
"android"
],
"__platform__"
:
[
"ios"
,
"android"
],
"appkey_ios"
:
"请填写地图的key"
,
"appkey_ios"
:
"请填写地图的key"
,
"appkey_android"
:
"请填写地图的key"
"appkey_android"
:
"请填写地图的key"
}
}
},
},
"push"
:
{
"push"
:
{
"unipush"
:
{}
"unipush"
:
{
}
},
},
"payment"
:
{}
"payment"
:
{
}
},
},
"icons"
:
{
"icons"
:
{
"android"
:
{
"android"
:
{
...
@@ -228,7 +178,8 @@
...
@@ -228,7 +178,8 @@
},
},
"nvueLaunchMode"
:
""
"nvueLaunchMode"
:
""
},
},
"quickapp"
:
{},
"quickapp"
:
{
},
"mp-weixin"
:
{
"mp-weixin"
:
{
"appid"
:
""
,
"appid"
:
""
,
"setting"
:
{
"setting"
:
{
...
@@ -263,10 +214,11 @@
...
@@ -263,10 +214,11 @@
"key"
:
""
"key"
:
""
}
}
}
}
},
"router"
:
{
"base"
:
""
}
}
},
},
"_spaceID"
:
""
,
"_spaceID"
:
""
,
"vueVersion"
:
"2"
"vueVersion"
:
"2"
}
}
}
}
package.json
浏览文件 @
48ade9e8
{
{
"id"
:
"uni-starter"
,
"id"
:
"uni-starter"
,
"displayName"
:
"uni-starter"
,
"displayName"
:
"uni-starter"
,
"version"
:
"1.1.1
7
"
,
"version"
:
"1.1.1
8
"
,
"description"
:
"云端一体应用快速开发基本项目模版"
,
"description"
:
"云端一体应用快速开发基本项目模版"
,
"keywords"
:
[
"keywords"
:
[
"login"
,
"login"
,
...
...
pages/list/detail.vue
浏览文件 @
48ade9e8
...
@@ -50,14 +50,22 @@
...
@@ -50,14 +50,22 @@
</template>
</template>
<
script
>
<
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
db
=
uniCloud
.
database
();
const
readNewsLog
=
db
.
collection
(
'
read-news-log
'
)
const
readNewsLog
=
db
.
collection
(
'
read-news-log
'
)
import
{
import
{
mapGetters
mapGetters
}
from
'
vuex
'
;
}
from
'
vuex
'
;
export
default
{
export
default
{
onBackPress
({
from
})
{
if
(
from
==
'
backbutton
'
){
this
.
$nextTick
(
function
(){
uniShare
.
hide
()
})
return
uniShare
.
isShow
;
}
},
data
()
{
data
()
{
return
{
return
{
// 当前显示 _id
// 当前显示 _id
...
@@ -197,7 +205,7 @@
...
@@ -197,7 +205,7 @@
excerpt
,
excerpt
,
avatar
avatar
})
);
})
);
uniShare
({
uniShare
.
show
({
content
:
{
//公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
content
:
{
//公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
type
:
0
,
type
:
0
,
href
:
this
.
uniStarterConfig
.
h5
.
url
+
`/#/pages/list/detail?id=
${
_id
}
&title=
${
title
}
`
,
href
:
this
.
uniStarterConfig
.
h5
.
url
+
`/#/pages/list/detail?id=
${
_id
}
&title=
${
title
}
`
,
...
@@ -264,7 +272,7 @@
...
@@ -264,7 +272,7 @@
],
],
cancelText
:
this
.
$t
(
'
common
'
).
cancelShare
,
cancelText
:
this
.
$t
(
'
common
'
).
cancelShare
,
},
e
=>
{
//callback
},
e
=>
{
//callback
// console.log(e);
console
.
log
(
e
);
})
})
},
},
}
}
...
...
pages/ucenter/about/about.vue
浏览文件 @
48ade9e8
...
@@ -19,8 +19,17 @@
...
@@ -19,8 +19,17 @@
</view>
</view>
</
template
>
</
template
>
<
script
>
<
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
{
export
default
{
onBackPress
({
from
})
{
if
(
from
==
'
backbutton
'
){
this
.
$nextTick
(
function
(){
uniShare
.
hide
()
})
return
uniShare
.
isShow
;
}
},
onLoad
()
{
onLoad
()
{
// #ifdef APP-PLUS
// #ifdef APP-PLUS
this
.
version
=
plus
.
runtime
.
version
this
.
version
=
plus
.
runtime
.
version
...
@@ -53,7 +62,7 @@
...
@@ -53,7 +62,7 @@
slogan
,
slogan
,
logo
logo
}
=
this
.
about
}
=
this
.
about
uniShare
({
uniShare
.
show
({
content
:
{
//公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
content
:
{
//公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
type
:
0
,
type
:
0
,
href
:
download
,
href
:
download
,
...
...
pages/ucenter/ucenter.vue
浏览文件 @
48ade9e8
...
@@ -37,10 +37,18 @@
...
@@ -37,10 +37,18 @@
}
from
'
vuex
'
;
}
from
'
vuex
'
;
import
checkUpdate
from
'
@/uni_modules/uni-upgrade-center-app/utils/check-update
'
;
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
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
U
niShare
from
'
@/uni_modules/uni-share/js_sdk/uni-share.js
'
;
// import pwdLogin from '../../common/toLogin.js';
const
uniShare
=
new
UniShare
()
const
db
=
uniCloud
.
database
();
const
db
=
uniCloud
.
database
();
export
default
{
export
default
{
onBackPress
({
from
})
{
if
(
from
==
'
backbutton
'
){
this
.
$nextTick
(
function
(){
uniShare
.
hide
()
})
return
uniShare
.
isShow
;
}
},
data
()
{
data
()
{
return
{
return
{
gridList
:
[{
gridList
:
[{
...
@@ -273,7 +281,7 @@
...
@@ -273,7 +281,7 @@
slogan
slogan
}
=
this
.
appConfig
.
about
}
=
this
.
appConfig
.
about
// #ifdef APP-PLUS
// #ifdef APP-PLUS
uniShare
({
uniShare
.
show
({
content
:
{
//公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
content
:
{
//公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
type
:
0
,
type
:
0
,
href
:
this
.
appConfig
.
h5
.
url
+
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)
## 1.0.6(2021-08-25)
兼容vue3
兼容vue3
## 1.0.5(2021-08-05)
## 1.0.5(2021-08-05)
...
...
uni_modules/uni-share/js_sdk/uni-image-menu.js
浏览文件 @
48ade9e8
var
nvMask
,
nvImageMenu
;
var
nvMask
,
nvImageMenu
;
export
default
{
class
NvImageMenu
{
show
({
list
,
cancelText
},
callback
){
constructor
(
arg
)
{
console
.
log
(
789789879
);
this
.
isShow
=
false
if
(
!
list
){
}
show
({
list
,
cancelText
},
callback
)
{
if
(
!
list
)
{
list
=
[{
list
=
[{
"
img
"
:
"
/static/sharemenu/wechatfriend.png
"
,
"
img
"
:
"
/static/sharemenu/wechatfriend.png
"
,
"
text
"
:
"
图标文字
"
"
text
"
:
"
图标文字
"
}]
}]
}
}
//以下为计算菜单的nview绘制布局,为固定算法,使用者无关关心
//以下为计算菜单的nview绘制布局,为固定算法,使用者无关关心
...
@@ -32,7 +37,16 @@ export default {
...
@@ -32,7 +37,16 @@ export default {
var
top1
=
left1
var
top1
=
left1
var
top2
=
top1
+
iconWidth
+
icontextSpace
+
textHeight
+
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
"
,
{
//先创建遮罩层
nvMask
=
new
plus
.
nativeObj
.
View
(
"
nvMask
"
,
{
//先创建遮罩层
top
:
'
0px
'
,
top
:
'
0px
'
,
...
@@ -41,26 +55,29 @@ export default {
...
@@ -41,26 +55,29 @@ export default {
width
:
'
100%
'
,
width
:
'
100%
'
,
backgroundColor
:
'
rgba(0,0,0,0.2)
'
backgroundColor
:
'
rgba(0,0,0,0.2)
'
});
});
nvMask
.
addEventListener
(
"
click
"
,
function
()
{
//处理遮罩层点击
nvMask
.
hide
();
nvImageMenu
.
hide
();
})
nvImageMenu
=
new
plus
.
nativeObj
.
View
(
"
nvImageMenu
"
,
{
//创建底部图标菜单
nvImageMenu
=
new
plus
.
nativeObj
.
View
(
"
nvImageMenu
"
,
{
//创建底部图标菜单
bottom
:
'
0px
'
,
bottom
:
'
0px
'
,
left
:
'
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%
'
,
width
:
'
100%
'
,
backgroundColor
:
'
rgb(255,255,255)
'
backgroundColor
:
'
rgb(255,255,255)
'
});
});
nvMask
.
addEventListener
(
"
click
"
,
()
=>
{
//处理遮罩层点击
// console.log('处理遮罩层点击');
this
.
hide
()
callback
({
event
:
"
clickMask
"
})
})
let
myList
=
[]
let
myList
=
[]
list
.
forEach
((
item
,
i
)
=>
{
list
.
forEach
((
item
,
i
)
=>
{
myList
.
push
({
myList
.
push
({
tag
:
'
img
'
,
tag
:
'
img
'
,
src
:
item
.
img
,
src
:
item
.
img
,
position
:
{
position
:
{
top
:
TOP
[
'
top
'
+
(
parseInt
(
i
/
4
)
+
1
)],
top
:
TOP
[
'
top
'
+
(
parseInt
(
i
/
4
)
+
1
)],
left
:
LEFT
[
'
left
'
+
(
1
+
i
%
4
)],
left
:
LEFT
[
'
left
'
+
(
1
+
i
%
4
)],
width
:
iconWidth
,
width
:
iconWidth
,
height
:
iconWidth
height
:
iconWidth
}
}
...
@@ -72,8 +89,8 @@ export default {
...
@@ -72,8 +89,8 @@ export default {
size
:
textHeight
size
:
textHeight
},
},
position
:
{
position
:
{
top
:
TOP
[
'
top
'
+
(
parseInt
(
i
/
4
)
+
1
)]
+
iconWidth
+
icontextSpace
,
top
:
TOP
[
'
top
'
+
(
parseInt
(
i
/
4
)
+
1
)]
+
iconWidth
+
icontextSpace
,
left
:
LEFT
[
'
left
'
+
(
1
+
i
%
4
)],
left
:
LEFT
[
'
left
'
+
(
1
+
i
%
4
)],
width
:
iconWidth
,
width
:
iconWidth
,
height
:
textHeight
height
:
textHeight
}
}
...
@@ -81,9 +98,8 @@ export default {
...
@@ -81,9 +98,8 @@ export default {
})
})
//绘制底部图标菜单的内容
//绘制底部图标菜单的内容
nvImageMenu
.
draw
([
nvImageMenu
.
draw
([{
{
tag
:
'
rect
'
,
//菜单顶部的分割灰线
tag
:
'
rect
'
,
//菜单顶部的分割灰线
color
:
'
#e7e7e7
'
,
color
:
'
#e7e7e7
'
,
position
:
{
position
:
{
top
:
'
0px
'
,
top
:
'
0px
'
,
...
@@ -92,7 +108,7 @@ export default {
...
@@ -92,7 +108,7 @@ export default {
},
},
{
{
tag
:
'
font
'
,
tag
:
'
font
'
,
text
:
cancelText
,
//底部取消按钮的文字
text
:
cancelText
,
//底部取消按钮的文字
textStyles
:
{
textStyles
:
{
size
:
'
14px
'
size
:
'
14px
'
},
},
...
@@ -102,7 +118,7 @@ export default {
...
@@ -102,7 +118,7 @@ export default {
}
}
},
},
{
{
tag
:
'
rect
'
,
//底部取消按钮的顶部边线
tag
:
'
rect
'
,
//底部取消按钮的顶部边线
color
:
'
#e7e7e7
'
,
color
:
'
#e7e7e7
'
,
position
:
{
position
:
{
bottom
:
'
45px
'
,
bottom
:
'
45px
'
,
...
@@ -112,15 +128,27 @@ export default {
...
@@ -112,15 +128,27 @@ export default {
...
myList
...
myList
])
])
nvMask
.
show
()
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));
// console.log("click menu"+JSON.stringify(e));
if
(
e
.
screenY
>
plus
.
screen
.
resolutionHeight
-
44
)
{
//点击了底部取消按钮
if
(
e
.
screenY
>
plus
.
screen
.
resolutionHeight
-
44
)
{
//点击了底部取消按钮
nvMask
.
hide
();
// callback({event:"clickCancelButton"})
nvImageMenu
.
hide
();
this
.
hide
()
}
else
if
(
e
.
clientX
<
5
||
e
.
clientX
>
screenWidth
-
5
||
e
.
clientY
<
5
)
{
}
else
if
(
e
.
clientX
<
5
||
e
.
clientX
>
screenWidth
-
5
||
e
.
clientY
<
5
)
{
//屏幕左右边缘5像素及菜单顶部5像素不处理点击
//屏幕左右边缘5像素及菜单顶部5像素不处理点击
}
else
{
//点击了图标按钮
}
else
{
//点击了图标按钮
...
@@ -144,8 +172,10 @@ export default {
...
@@ -144,8 +172,10 @@ export default {
// console.log("点击按钮的序号: " + iClickIndex);
// console.log("点击按钮的序号: " + iClickIndex);
// if (iClickIndex >= 0 && iClickIndex <= 5) { //处理具体的点击逻辑,此处也可以自行定义逻辑。如果增减了按钮,此处也需要跟着修改
// if (iClickIndex >= 0 && iClickIndex <= 5) { //处理具体的点击逻辑,此处也可以自行定义逻辑。如果增减了按钮,此处也需要跟着修改
// }
// }
callback
(
iClickIndex
)
callback
({
this
.
hide
()
event
:
"
clickMenu
"
,
index
:
iClickIndex
})
}
}
})
})
/* nvImageMenu.addEventListener("touchstart", function(e) {
/* nvImageMenu.addEventListener("touchstart", function(e) {
...
@@ -161,9 +191,13 @@ export default {
...
@@ -161,9 +191,13 @@ export default {
//TODO 这里可以处理释放背景恢复的效果
//TODO 这里可以处理释放背景恢复的效果
})
})
*/
*/
},
}
hide
(){
hide
()
{
nvMask
.
hide
()
nvMask
.
hide
()
nvImageMenu
.
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
'
;
import
UniImageMenu
from
'
./uni-image-menu.js
'
;
export
default
async
(
param
,
callback
)
=>
{
class
UniShare
extends
UniImageMenu
{
constructor
(
arg
)
{
super
()
this
.
isShow
=
super
.
isShow
}
async
show
(
param
,
callback
){
var
menus
=
[]
var
menus
=
[]
plus
.
share
.
getServices
(
services
=>
{
//只显示有服务的项目
plus
.
share
.
getServices
(
services
=>
{
//只显示有服务的项目
services
=
services
.
filter
(
item
=>
item
.
nativeClient
)
services
=
services
.
filter
(
item
=>
item
.
nativeClient
)
// console.log("servicesList",services);
let
servicesList
=
services
.
map
(
e
=>
e
.
id
)
let
servicesList
=
services
.
map
(
e
=>
e
.
id
)
param
.
menus
.
forEach
(
item
=>
{
param
.
menus
.
forEach
(
item
=>
{
if
(
servicesList
.
includes
(
item
.
share
.
provider
)
||
typeof
(
item
.
share
)
==
'
string
'
)
{
if
(
servicesList
.
includes
(
item
.
share
.
provider
)
||
typeof
(
item
.
share
)
==
'
string
'
)
{
menus
.
push
(
item
)
menus
.
push
(
item
)
}
}
})
})
// console.log(menus);
super
.
show
({
uniImageMenu
.
show
({
list
:
menus
,
cancelText
:
param
.
cancelText
},
e
=>
{
list
:
menus
,
if
(
typeof
(
menus
[
e
][
'
share
'
])
==
'
string
'
)
{
cancelText
:
param
.
cancelText
switch
(
menus
[
e
][
'
share
'
]){
},
e
=>
{
case
"
copyurl
"
:
callback
(
e
)
copyurl
()
if
(
e
.
event
==
'
clickMenu
'
){
break
;
if
(
typeof
(
menus
[
e
.
index
][
'
share
'
])
==
'
string
'
)
{
case
"
shareSystem
"
:
this
[
menus
[
e
.
index
][
'
share
'
]](
param
)
shareSystem
()
break
;
default
:
console
.
error
(
'
未知事件名称:
'
+
menus
[
e
][
'
share
'
]);
break
;
}
}
else
{
}
else
{
console
.
log
(
123456
,{
...
param
.
content
,
...
menus
[
e
].
share
,
});
uni
.
share
({
uni
.
share
({
...
param
.
content
,
...
param
.
content
,
...
menus
[
e
].
share
,
...
menus
[
e
.
index
].
share
,
success
:
function
(
res
)
{
success
:
res
=>
{
console
.
log
(
"
success:
"
+
JSON
.
stringify
(
res
));
console
.
log
(
"
success:
"
+
JSON
.
stringify
(
res
));
super
.
hide
()
},
},
fail
:
function
(
err
)
{
fail
:
function
(
err
)
{
console
.
log
(
"
fail:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
fail:
"
+
JSON
.
stringify
(
err
));
uni
.
showModal
({
uni
.
showModal
({
content
:
JSON
.
stringify
(
err
),
content
:
JSON
.
stringify
(
err
),
showCancel
:
false
,
showCancel
:
false
,
confirmText
:
"
知道了
"
confirmText
:
"
知道了
"
});
});
},
complete
(
e
)
{
uniImageMenu
.
hide
()
callback
(
e
)
}
}
})
})
}
}
}
})
})
},
err
=>
{
},
err
=>
{
uni
.
showModal
({
uni
.
showModal
({
title
:
'
获取服务供应商失败:
'
+
JSON
.
stringify
(
err
),
title
:
'
获取服务供应商失败:
'
+
JSON
.
stringify
(
err
),
...
@@ -59,17 +50,22 @@ export default async (param,callback) => {
...
@@ -59,17 +50,22 @@ export default async (param,callback) => {
});
});
console
.
error
(
'
获取服务供应商失败:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
获取服务供应商失败:
'
+
JSON
.
stringify
(
err
));
})
})
}
function
copyurl
()
{
hide
(){
super
.
hide
()
}
copyurl
(
param
)
{
console
.
log
(
'
copyurl
'
,
param
);
uni
.
setClipboardData
({
uni
.
setClipboardData
({
data
:
param
.
content
.
href
,
data
:
param
.
content
.
href
,
success
:
function
()
{
success
:
()
=>
{
console
.
log
(
'
success
'
);
console
.
log
(
'
success
'
);
uni
.
hideToast
()
//关闭自带的toast
uni
.
hideToast
()
//关闭自带的toast
uni
.
showToast
({
uni
.
showToast
({
title
:
'
复制成功
'
,
title
:
'
复制成功
'
,
icon
:
'
none
'
icon
:
'
none
'
});
});
super
.
hide
();
},
},
fail
:
(
err
)
=>
{
fail
:
(
err
)
=>
{
uni
.
showModal
({
uni
.
showModal
({
...
@@ -80,17 +76,23 @@ export default async (param,callback) => {
...
@@ -80,17 +76,23 @@ export default async (param,callback) => {
});
});
}
}
// 使用系统分享发送分享消息
// 使用系统分享发送分享消息
function
shareSystem
()
{
shareSystem
(
param
)
{
console
.
log
(
'
shareSystem
'
,
param
);
plus
.
share
.
sendWithSystem
({
plus
.
share
.
sendWithSystem
({
type
:
'
text
'
,
type
:
'
text
'
,
content
:
param
.
content
.
title
+
param
.
content
.
summary
||
''
,
content
:
param
.
content
.
title
+
param
.
content
.
summary
||
''
,
href
:
param
.
content
.
href
,
href
:
param
.
content
.
href
,
},
function
(
e
)
{
},
(
e
)
=>
{
console
.
log
(
'
分享成功
'
);
console
.
log
(
'
分享成功
'
);
callback
(
e
)
super
.
hide
()
},
function
(
e
)
{
},
(
err
)
=>
{
console
.
log
(
'
分享失败:
'
+
JSON
.
stringify
(
e
));
console
.
log
(
'
分享失败:
'
+
JSON
.
stringify
(
err
));
callback
(
e
)
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"
,
"id"
:
"uni-share"
,
"displayName"
:
"uni-share"
,
"displayName"
:
"uni-share"
,
"version"
:
"
1.0.6
"
,
"version"
:
"
2.0.0
"
,
"description"
:
"底部弹出宫格图标式的分享菜单,可覆盖原生组件。"
,
"description"
:
"底部弹出宫格图标式的分享菜单,可覆盖原生组件。"
,
"keywords"
:
[
"keywords"
:
[
"分享菜单"
"分享菜单"
...
...
uni_modules/uni-share/readme.md
浏览文件 @
48ade9e8
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
export default {
export default {
methods: {
methods: {
uniShare() {
uniShare() {
uniShare({
uniShare
.show
({
content: { //公共的分享参数配置 类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
content: { //公共的分享参数配置 类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
type: 0,
type: 0,
href: 'https://uniapp.dcloud.io/',
href: 'https://uniapp.dcloud.io/',
...
...
uni_modules_tools/copy/manifest.json
浏览文件 @
48ade9e8
...
@@ -193,6 +193,9 @@
...
@@ -193,6 +193,9 @@
"key"
:
""
"key"
:
""
}
}
}
}
},
"router"
:
{
"base"
:
""
}
}
},
},
"_spaceID"
:
"76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e"
,
"_spaceID"
:
"76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录