Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
言程序plus
uni-starter
提交
b5a47407
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看板
提交
b5a47407
编写于
6月 18, 2021
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.H5端新增,强制要求用户同意隐私协议 2.兼容ios端自动设置打开下载页用户的剪切板为邀请者的inviteCode 3.成功注册用户,且请求体含邀请码inviteCode自动关联裂变关系
上级
d74e48f9
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
206 addition
and
121 deletion
+206
-121
App.vue
App.vue
+5
-1
changelog.md
changelog.md
+2
-0
package.json
package.json
+1
-1
pages/ucenter/invite/invite.vue
pages/ucenter/invite/invite.vue
+164
-91
static/h5/download-app/android.png
static/h5/download-app/android.png
+0
-0
static/h5/download-app/back.png
static/h5/download-app/back.png
+0
-0
static/h5/download-app/ios.png
static/h5/download-app/ios.png
+0
-0
uni-starter.config.js
uni-starter.config.js
+7
-1
uniCloud-aliyun/cloudfunctions/uni-id-cf/index.js
uniCloud-aliyun/cloudfunctions/uni-id-cf/index.js
+11
-26
uni_modules/uni-agree/pages/uni-agree/uni-agree.nvue
uni_modules/uni-agree/pages/uni-agree/uni-agree.nvue
+16
-1
未找到文件。
App.vue
浏览文件 @
b5a47407
...
...
@@ -11,7 +11,11 @@
console
.
log
(
'
App Launch
'
)
initApp
();
// #ifdef APP-PLUS
//checkIsAgree(); 暂时先用默认生成的,自定义的等待原生支持后实现。因为启动vue界面时已经,请求了部分权限这并不符合国家的法规
//checkIsAgree(); APP端暂时先用原生默认生成的。目前,自定义方式启动vue界面时,原生层已经请求了部分权限这并不符合国家的法规
// #endif
// #ifdef H5
checkIsAgree
();
// #endif
// #ifdef APP-PLUS
...
...
changelog.md
浏览文件 @
b5a47407
## 1.0.20(2021-06-18)
1.
H5端新增,强制要求用户同意隐私协议 2.兼容ios端自动设置打开下载页用户的剪切板为邀请者的inviteCode 3.成功注册用户,且请求体含邀请码inviteCode自动关联裂变关系
## 1.0.19(2021-06-17)
1.
新增获取邀请码接口getUserInviteCode 2.在邀请用户下载应用页面,自动设置被邀请用户的剪切板为邀请者的code(仅支持安卓端) 3.在注册或登陆并注册请求时自动添加剪切板中的请求参数 4.统一接口名称为驼峰法
## 1.0.18(2021-06-15)
...
...
package.json
浏览文件 @
b5a47407
{
"id"
:
"uni-starter"
,
"displayName"
:
"uni-starter"
,
"version"
:
"1.0.
19
"
,
"version"
:
"1.0.
20
"
,
"description"
:
"云端一体应用快速开发基本项目模版"
,
"keywords"
:
[
"uni-starter"
,
...
...
pages/ucenter/invite/invite.vue
浏览文件 @
b5a47407
<
template
>
<view>
<web-view
:src=
"url"
></web-view>
</view>
</
template
>
<
script
>
export
default
{
created
()
{
<
template
>
<view
class=
"about"
>
<view
class=
"box"
>
<image
class=
"logoImg"
:src=
"about.logo"
></image>
<text
class=
"tip appName"
>
{{
about
.
appName
}}
</text>
<text
class=
"tip"
>
{{
about
.
slogan
}}
</text>
<view
@
click=
"download"
type=
"default"
id=
"download"
>
<image
v-if=
"isIos"
class=
"icon"
src=
"@/static/h5/download-app/ios.png"
mode=
"widthFix"
></image>
<image
v-else
class=
"icon"
src=
"@/static/h5/download-app/android.png"
mode=
"widthFix"
></image>
<text
class=
"download-text"
>
下载
</text>
</view>
<text
class=
"tip"
>
version
{{
about
.
version
}}
</text>
</view>
<view
class=
"copyright"
>
<text
class=
"hint"
>
{{
about
.
company
}}
</text>
</view>
<view
class=
"mask"
v-if=
"showMask"
>
<image
src=
"../../../static/h5/download-app/openImg.png"
mode=
"widthFix"
></image>
</view>
</view>
</
template
>
<
script
>
export
default
{
computed
:{
uniStarterConfig
(){
return
getApp
().
globalData
.
config
}
},
data
()
{
return
{
about
:{},
code
:
""
,
isIos
:
""
,
showMask
:
false
,
downloadUrl
:{
"
ios
"
:
""
,
"
android
"
:
""
}
};
},
created
()
{
this
.
about
=
this
.
uniStarterConfig
.
about
this
.
downloadUrl
=
this
.
uniStarterConfig
.
download
this
.
year
=
(
new
Date
).
getFullYear
()
//判断是否在微信中打开
var
userAgent
=
navigator
.
userAgent
;
var
ua
=
userAgent
.
toLowerCase
();
this
.
isWeixin
=
ua
.
indexOf
(
'
micromessenger
'
)
!=
-
1
;
if
(
this
.
isWeixin
){
//执行逻辑
}
else
{
//执行逻辑
}
//判断是否在ios或者安卓打开
this
.
isIos
=
!!
userAgent
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
);
},
onLoad
({
code
})
{
this
.
code
=
code
||
'
123456
'
document
.
getElementById
(
"
openApp
"
).
style
.
display
=
'
none
'
document
.
getElementsByTagName
(
"
body
"
)[
0
].
style
=
""
},
onLoad
({
code
})
{
this
.
code
=
code
},
onReady
()
{
var
IframeOnClick
=
{
resolution
:
200
,
iframes
:
[],
interval
:
null
,
Iframe
:
function
()
{
this
.
element
=
arguments
[
0
];
this
.
cb
=
arguments
[
1
];
this
.
hasTracked
=
false
;
},
track
:
function
(
element
,
cb
)
{
this
.
iframes
.
push
(
new
this
.
Iframe
(
element
,
cb
));
if
(
!
this
.
interval
)
{
var
_this
=
this
;
this
.
interval
=
setInterval
(
function
()
{
_this
.
checkClick
();
},
this
.
resolution
);
}
},
checkClick
:
function
()
{
if
(
document
.
activeElement
)
{
var
activeElement
=
document
.
activeElement
;
for
(
var
i
in
this
.
iframes
)
{
if
(
activeElement
===
this
.
iframes
[
i
].
element
)
{
// user is in this Iframe
if
(
this
.
iframes
[
i
].
hasTracked
==
false
)
{
this
.
iframes
[
i
].
cb
.
apply
(
window
,
[]);
this
.
iframes
[
i
].
hasTracked
=
true
;
}
}
else
{
this
.
iframes
[
i
].
hasTracked
=
false
;
}
}
}
}
};
IframeOnClick
.
track
(
document
.
getElementsByTagName
(
"
iframe
"
)[
0
],
()
=>
{
this
.
copy
()
});
},
computed
:
{
url
()
{
return
getApp
().
globalData
.
config
.
about
.
download
}
},
data
()
{
return
{
code
:
""
}
},
methods
:
{
copy
()
{
console
.
log
(
'
copy
'
);
if
(
!
this
.
code
){
return
false
}
uni
.
setClipboardData
({
data
:
'
uniInvitationCode:
'
+
this
.
code
,
success
:
()
=>
{
uni
.
showModal
({
content
:
'
成功在用户剪切板中存储,邀请人code:
'
+
this
.
code
,
showCancel
:
false
});
},
fail
:
()
=>
{
uni
.
showModal
({
content
:
'
失败,未能。在用户剪切板中存储,邀请人code
'
,
showCancel
:
false
});
}
})
uni
.
hideToast
()
methods
:{
download
(){
if
(
this
.
code
){
uni
.
setClipboardData
({
data
:
this
.
code
,
complete
:
(
e
)
=>
{
console
.
log
(
e
);
// uni.showToast({
// title: JSON.stringify(e),
// icon: 'none'
// });
/* 以下临时解决setClipboardData h5端样式和键盘弹出端错误解决方案,后续会直接内置*/
document
.
getElementById
(
"
#clipboard
"
).
style
.
top
=
'
-999px
'
;
uni
.
hideKeyboard
()
}
})
}
/* 以下临时解决h5端样式和键盘弹出端错误解决方案,后续会直接内置*/
document
.
getElementById
(
"
#clipboard
"
).
style
.
top
=
'
-999px
'
;
uni
.
hideKeyboard
()
}
}
}
</
script
>
<
style
>
</
style
>
if
(
this
.
isIos
){
window
.
location
.
href
=
this
.
downloadUrl
.
ios
}
else
{
if
(
this
.
isWeixin
){
//显示浮层
this
.
showMask
=
true
}
else
{
window
.
location
.
href
=
this
.
downloadUrl
.
android
}
}
}
}
}
</
script
>
<
style
lang=
"scss"
>
.about
{
width
:
750rpx
;
flex-direction
:
column
;
}
.box
{
margin-top
:
100px
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.logoImg
{
margin-bottom
:
10upx
;
width
:
160upx
;
height
:
160upx
;
border-radius
:
15px
;
}
.tip
{
font-size
:
24rpx
;
margin-top
:
10px
;
}
.appName
{
margin-top
:
20px
;
font-size
:
42rpx
;
font-weight
:
500
;
}
.copyright
{
width
:
750upx
;
font-size
:
32rpx
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
bottom
:
20px
;
left
:
0
;
position
:
fixed
;
}
.hint
{
color
:
#999999
;
font-size
:
26rpx
;
}
.icon
{
width
:
34rpx
;
}
#download
{
background-color
:
#2A9839
;
color
:
#FFFFFF
;
margin
:
55rpx
;
padding
:
5px
;
width
:
200rpx
;
border-radius
:
100px
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
center
;
}
.download-text
{
font-size
:
32rpx
;
}
.mask
{
position
:
fixed
;
top
:
0
;
left
:
0
;
width
:
750rpx
;
height
:
100vh
;
flex-direction
:
row
;
justify-content
:
flex-end
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.6
);
}
.mask
image
{
width
:
600rpx
;
}
</
style
>
\ No newline at end of file
static/h5/download-app/a
drio
d.png
→
static/h5/download-app/a
ndroi
d.png
浏览文件 @
b5a47407
文件已移动
static/h5/download-app/back.png
已删除
100755 → 0
浏览文件 @
d74e48f9
200.8 KB
static/h5/download-app/
apple
.png
→
static/h5/download-app/
ios
.png
浏览文件 @
b5a47407
文件已移动
uni-starter.config.js
浏览文件 @
b5a47407
...
...
@@ -54,7 +54,13 @@ module.exports = {
}
],
//应用的链接,用于分享到第三方平台和生成关于我们页的二维码
"
download
"
:
"
https://m3w.cn/uniapp
"
"
download
"
:
"
https://m3w.cn/uniapp
"
,
//version
"
version
"
:
"
1.0.0
"
//用于非app端显示,app端自动获取
},
"
download
"
:{
//用于生成二合一下载页面
"
ios
"
:
"
https://itunes.apple.com/cn/app/hello-uni-app/id1417078253?mt=8
"
,
"
android
"
:
"
https://vkceyugu.cdn.bspapp.com/VKCEYUGU-97fca9f2-41f6-449f-a35e-3f135d4c3875/6d754387-a6c3-48ed-8ad2-e8f39b40fc01.apk
"
},
//用于打开应用市场评分界面
"
marketId
"
:{
...
...
uniCloud-aliyun/cloudfunctions/uni-id-cf/index.js
浏览文件 @
b5a47407
...
...
@@ -21,7 +21,8 @@ exports.main = async (event, context) => {
*/
const
{
action
,
uniIdToken
uniIdToken
,
inviteCode
}
=
event
;
const
deviceInfo
=
event
.
deviceInfo
||
{};
let
params
=
event
.
params
||
{};
...
...
@@ -71,7 +72,11 @@ exports.main = async (event, context) => {
}
//3.注册成功后创建新用户的积分表方法
async
function
registerSuccess
(
uid
)
{
async
function
registerSuccess
(
uid
)
{
//用户接受邀请
if
(
inviteCode
){
await
uniID
.
acceptInvite
({
inviteCode
,
uid
});
}
//添加当前用户设备信息
await
db
.
collection
(
'
uni-id-device
'
).
add
({
...
deviceInfo
,
...
...
@@ -154,7 +159,7 @@ exports.main = async (event, context) => {
// console.log(res);
break
;
case
'
register
'
:
var
{
username
,
password
,
nickname
,
inviteCode
}
=
params
var
{
username
,
password
,
nickname
}
=
params
if
(
/^1
\d{10}
$/
.
test
(
username
))
{
return
{
code
:
401
,
...
...
@@ -216,12 +221,7 @@ exports.main = async (event, context) => {
res
.
needCaptcha
=
needCaptcha
;
break
;
case
'
loginByWeixin
'
:
var
{
username
,
password
,
nickname
}
=
params
res
=
await
uniID
.
loginByWeixin
({
...
params
});
res
=
await
uniID
.
loginByWeixin
(
params
);
await
uniID
.
updateUser
({
uid
:
res
.
uid
,
username
:
"
微信用户
"
...
...
@@ -293,18 +293,6 @@ exports.main = async (event, context) => {
res
=
await
uniID
.
loginBySms
(
params
)
await
loginLog
(
res
)
break
;
case
'
inviteLogin
'
:
if
(
!
params
.
code
)
{
return
{
code
:
500
,
msg
:
'
请填写验证码
'
}
}
res
=
await
uniID
.
loginBySms
({
...
params
,
type
:
'
register
'
})
break
;
case
'
resetPwdBySmsCode
'
:
if
(
!
params
.
code
)
{
return
{
...
...
@@ -343,10 +331,7 @@ exports.main = async (event, context) => {
res
=
await
uniID
.
getInvitedUser
(
params
)
break
;
case
'
updatePwd
'
:
res
=
await
uniID
.
updatePwd
({
uid
:
params
.
uid
,
...
params
})
res
=
await
uniID
.
updatePwd
(
params
)
break
;
case
'
createCaptcha
'
:
res
=
await
uniCaptcha
.
create
(
params
)
...
...
@@ -392,7 +377,7 @@ exports.main = async (event, context) => {
const
{
userInfo
}
=
await
uniID
.
getUserInfo
({
uid
:
params
.
uid
,
uid
:
params
.
uid
})
if
(
userInfo
.
role
.
indexOf
(
'
admin
'
)
===
-
1
&&
params
.
role
.
indexOf
(
'
admin
'
)
>
-
1
)
{
res
=
{
...
...
uni_modules/uni-agree/pages/uni-agree/uni-agree.nvue
浏览文件 @
b5a47407
...
...
@@ -69,7 +69,22 @@ import {about} from '@/uni-starter.config.js';
}, 100)
},
disagree() {
plus.runtime.quit();
// #ifdef APP-PLUS
plus.runtime.quit();
// #endif
// #ifdef H5
uni.showModal({
content: '确定退出本应用?',
cancelText:"退出",
confirmText:"取消",
success: (e) => {
if(!e.confirm){
window.location.href="about:blank";
window.close();
}
}
});
// #endif
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录