Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
5962ee25
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6048
Star
92
Fork
165
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
5962ee25
编写于
12月 03, 2024
作者:
DCloud_iOS_WZT
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调整一键登录自定义授权页以及隐私协议页面
(cherry picked from commit
9a6056d7
)
上级
8a987c28
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
111 addition
and
77 deletion
+111
-77
pages/API/get-univerify-manager/full-webview-page.uvue
pages/API/get-univerify-manager/full-webview-page.uvue
+100
-67
pages/API/get-univerify-manager/univerify-custom-page.uvue
pages/API/get-univerify-manager/univerify-custom-page.uvue
+11
-10
未找到文件。
pages/API/get-univerify-manager/full-webview-page.uvue
浏览文件 @
5962ee25
<template>
<view class="background">
<view class="container">
<view class="nav">
<text class="left_icon" @click="onBack()">{{backIcon}}</text>
</view>
<web-view class="web_container" :src="url"></web-view>
</view>
</view>
<view class="background">
<view class="container">
<view class="nav">
<view class="left_content">
<text class="left_icon" @click="onBack()">{{backIcon}}</text>
</view>
<view class="title_content">
<text class="title">{{title}}</text>
</view>
</view>
<web-view class="web_container" :src="url"></web-view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
url: '',
backIcon:'\ue601'
}
},
onLoad(options : OnLoadOptions) {
this.url = options["url"] as string;
},
methods: {
onBack(){
console.log('click onback');
uni.closeDialogPage({
dialogPage: this.$page,
animationType:'slide-out-right',
success(res) {
console.log('closeThisDialog success', res)
},
fail(err) {
console.log('closeThisDialog fail', err)
}
})
}
}
}
export default {
data() {
return {
url: '',
title: '',
animationType: 'slide-out-bottom',
backIcon: '\ue601'
}
},
onLoad(options : OnLoadOptions) {
this.url = options["url"] as string;
this.title = options["title"] as string;
this.animationType = options["animationType"] as string;
},
methods: {
onBack() {
uni.closeDialogPage({
dialogPage: this.$page,
animationType: this.animationType,
success(res) {
console.log('closeThisDialog success', res)
},
fail(err) {
console.log('closeThisDialog fail', err)
}
})
}
}
}
</script>
<style>
.background {
.background {
background-color: #007aff;
width: 100%;
height: 100%;
}
.nav{
height: 45px;
width: 100%;
position: relative;
flex-direction: row;
justify-content: space-between;
height: 45px;
}
.left_icon{
width: 100%;
height: 100%;
}
.nav {
height: 45px;
width: 100%;
position: relative;
flex-direction: row;
justify-content: space-between;
height: 45px;
}
.left_content {
justify-content: center;
align-items: center;
width: 40px;
height: 100%;
}
.left_icon {
color: white;
top: 5px;
height: 100%;
font-family: uni-icon;
font-size: 26px;
}
.title_content {
position: absolute;
height: 100%;
top: 0;
bottom: 0;
left: 45px;
right: 45px;
flex-direction: row;
justify-content: center;
align-items: center;
}
.title {
color: white;
top: 5px;
left: 15px;
justify-content: center;
align-items: center;
width: 40px;
height: 100%;
font-family: uni-icon;
font-size: 26px;
font-size: 17px;
}
.container {
padding-top: var(--status-bar-height);
width: 100%;
position: absolute;
height: 100%;
}
.container{
padding-top: var(--status-bar-height);
width: 100%;
position: absolute;
height: 100%;
}
.web_container{
background-color: #f1f1f1;
padding-top: 10px;
flex: 1;
width: 100%;
}
.web_container {
background-color: #f1f1f1;
padding-top: 10px;
flex: 1;
width: 100%;
}
</style>
pages/API/get-univerify-manager/univerify-custom-page.uvue
浏览文件 @
5962ee25
...
...
@@ -9,7 +9,7 @@
</view>
<button id="login-button" class="login-button" @click="loginIn">本机号码一键登录</button>
<view class="privacy">
<checkbox id="privacy-checkbox" class="privacy-checkbox" ref="privacy-checkbox" :checked="
tru
e"></checkbox>
<checkbox id="privacy-checkbox" class="privacy-checkbox" ref="privacy-checkbox" :checked="
fals
e"></checkbox>
<text class="privacy-normal-text">登录即同意</text>
<text id="privacy-text" class="privacy-text" @click="openLink">{{privacyName}}</text>
</view>
...
...
@@ -51,10 +51,10 @@
})
},
openLink() {
let url = '/pages/API/get-univerify-manager/full-webview-page?url=' + this.privacyUrl;
let url = '/pages/API/get-univerify-manager/full-webview-page?url=' + this.privacyUrl
+ '&title=' + this.privacyName + '&animationType=slide-out-bottom'
;
uni.openDialogPage({
url: url,
animationType: 'slide-in-
right
',
animationType: 'slide-in-
bottom
',
success(res) {
console.log("打开隐私协议");
},
...
...
@@ -81,14 +81,19 @@
console.log(res);
this.takePhoneNumber(res.accessToken, res.openId);
},
fail: (error : LoginFail) => {
console.error("login fail => " + error);
fail: (error : LoginFail) => {
if (error.errCode == 40001){
uni.showToast({
title:"请同意服务条款",
icon:'none',
duration:2000
})
}else if(error.errCode == 40002){
uni.showToast({
title:"授权页不符合规范",
icon:'none',
duration:2000
})
}else{
const errorMsg = JSON.parseObject(error.cause?.cause?.message ?? "")?.getString("errorDesc") ?? error.errMsg;
uni.showToast({
...
...
@@ -96,11 +101,7 @@
icon:'none',
duration:2000
})
// uni.showModal({
// title: '登录失败',
// content: errorMsg,
// showCancel: false
// });
}
}
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录