feat(ywq): 新增授权签名功能
- 添加授权签名相关页面和逻辑 - 新增授权数据模型和接口 - 优化医生选择和授权流程 - 添加授权协议和确认页面
这个提交包含在:
父节点
7e68e4eae4
当前提交
9351da99b1
@ -15,7 +15,8 @@ import { SZYXLocalStorageKeys } from '../utils/SZYXLocalStorageKeys';
|
|||||||
@Component
|
@Component
|
||||||
export struct XWebview {
|
export struct XWebview {
|
||||||
// 手机号
|
// 手机号
|
||||||
@State url: string = (router.getParams() as XWebParams).url
|
@State url?: string = (router.getParams() as XWebParams).url
|
||||||
|
@State content?: string = (router.getParams() as XWebParams).content
|
||||||
@State title?: string = (router.getParams() as XWebParams).title
|
@State title?: string = (router.getParams() as XWebParams).title
|
||||||
@State closeTag?: string = (router.getParams() as XWebParams).closeTag
|
@State closeTag?: string = (router.getParams() as XWebParams).closeTag
|
||||||
@State showMenu: boolean = (router.getParams() as XWebParams).showMenu ?? false
|
@State showMenu: boolean = (router.getParams() as XWebParams).showMenu ?? false
|
||||||
@ -26,6 +27,23 @@ export struct XWebview {
|
|||||||
|
|
||||||
aboutToAppear(): void {
|
aboutToAppear(): void {
|
||||||
SZYXLocalStorageHelper.storage.setOrCreate(SZYXLocalStorageKeys.XWebViewCLose, undefined)
|
SZYXLocalStorageHelper.storage.setOrCreate(SZYXLocalStorageKeys.XWebViewCLose, undefined)
|
||||||
|
if (this.content) {
|
||||||
|
try {
|
||||||
|
this.controller.loadData(this.content,
|
||||||
|
"text/html",
|
||||||
|
"UTF-8")
|
||||||
|
} catch (e) {
|
||||||
|
ToolsHelper.showAlertDialog({
|
||||||
|
title: '警告',
|
||||||
|
msg: e.message ?? '加载内容失败',
|
||||||
|
action: {
|
||||||
|
onClick: () => {
|
||||||
|
router.back()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
aboutToDisappear(): void {
|
aboutToDisappear(): void {
|
||||||
@ -38,7 +56,9 @@ export struct XWebview {
|
|||||||
if (this.controller.accessBackward()) {
|
if (this.controller.accessBackward()) {
|
||||||
this.controller.backward()
|
this.controller.backward()
|
||||||
} else {
|
} else {
|
||||||
ToolsHelper.doubleAndExit()
|
ToolsHelper.doubleAndExit(() => {
|
||||||
|
router.back()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -95,7 +115,7 @@ export struct XWebview {
|
|||||||
.visibility(this.progress > 95 || this.progress == 0 ? Visibility.None : Visibility.Visible)
|
.visibility(this.progress > 95 || this.progress == 0 ? Visibility.None : Visibility.Visible)
|
||||||
.width('100%')
|
.width('100%')
|
||||||
|
|
||||||
Web({ src: this.url, controller: this.controller })
|
Web({ src: this.url ?? 'www.example.com', controller: this.controller })
|
||||||
.width('100%')
|
.width('100%')
|
||||||
.height('100%')
|
.height('100%')
|
||||||
.visibility(this.errorInfo == null ? Visibility.Visible : Visibility.None)
|
.visibility(this.errorInfo == null ? Visibility.Visible : Visibility.None)
|
||||||
|
|||||||
@ -143,6 +143,19 @@ export class WindowHelper {
|
|||||||
WindowHelper._windowClass.setSpecificSystemBarEnabled('navigationIndicator', true);
|
WindowHelper._windowClass.setSpecificSystemBarEnabled('navigationIndicator', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置状态栏内容颜色
|
||||||
|
* #ffffff
|
||||||
|
* 不可以用white这种
|
||||||
|
*/
|
||||||
|
static setStatusBar(color: string) {
|
||||||
|
if (WindowHelper._windowClass) {
|
||||||
|
WindowHelper._windowClass.setWindowSystemBarProperties({
|
||||||
|
statusBarContentColor: color,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -6,7 +6,8 @@ const XWebview = import('../pages/XWebview');
|
|||||||
|
|
||||||
|
|
||||||
export interface XWebParams {
|
export interface XWebParams {
|
||||||
url: string
|
url?: string
|
||||||
|
content?: string
|
||||||
title?: string
|
title?: string
|
||||||
showMenu?: boolean
|
showMenu?: boolean
|
||||||
closeTag?:string
|
closeTag?:string
|
||||||
|
|||||||
@ -17,6 +17,8 @@ export struct SafeView {
|
|||||||
@Prop isImmersive: boolean
|
@Prop isImmersive: boolean
|
||||||
// 设置导航栏标题
|
// 设置导航栏标题
|
||||||
@Prop titleText: ResourceStr
|
@Prop titleText: ResourceStr
|
||||||
|
// 设置导航栏标题颜色
|
||||||
|
@Prop titleColor: ResourceColor
|
||||||
// 设置导航栏背景色
|
// 设置导航栏背景色
|
||||||
@Prop backgroundColorNav: ResourceColor
|
@Prop backgroundColorNav: ResourceColor
|
||||||
// 设置导航栏背景色
|
// 设置导航栏背景色
|
||||||
@ -26,6 +28,8 @@ export struct SafeView {
|
|||||||
@Prop opacitys: number | Resource
|
@Prop opacitys: number | Resource
|
||||||
// 是否显示返回按钮
|
// 是否显示返回按钮
|
||||||
@Prop hideBack: boolean
|
@Prop hideBack: boolean
|
||||||
|
// 是否显示返回按钮
|
||||||
|
@Prop hideNavBar: boolean
|
||||||
/**
|
/**
|
||||||
* 是否显示左侧角标,存在onClickLeft时生效
|
* 是否显示左侧角标,存在onClickLeft时生效
|
||||||
*/
|
*/
|
||||||
@ -59,133 +63,135 @@ export struct SafeView {
|
|||||||
.width('100%')
|
.width('100%')
|
||||||
.height('100%')
|
.height('100%')
|
||||||
|
|
||||||
Row()
|
if (!this.hideNavBar) {
|
||||||
.height(WindowHelper.topRectHeight)
|
Row()
|
||||||
.width('100%')
|
.height(WindowHelper.topRectHeight)
|
||||||
|
.width('100%')
|
||||||
|
.backgroundColor(this.backgroundColorNav ?? '#ffffff')
|
||||||
|
.opacity(undefined === this.opacitys ? 1 : this.opacitys > 1 ? 1 : this.opacitys < 0 ? 0 : this.opacitys)
|
||||||
|
|
||||||
|
Row() {
|
||||||
|
|
||||||
|
Row() {
|
||||||
|
Image($r("app.media.base_back"))
|
||||||
|
.height(15)
|
||||||
|
.objectFit(ImageFit.Contain).visibility(!this.hideBack ? Visibility.Visible : Visibility.None)
|
||||||
|
}.width(110)
|
||||||
|
.onClick(() => {
|
||||||
|
if (this.hideBack) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.onBackEvent && !this.hideBack) {
|
||||||
|
this.onBackEvent()
|
||||||
|
} else if (this.pageInfos) {
|
||||||
|
this.pageInfos.pop()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
Text(this.titleText ?? '')
|
||||||
|
.maxLines(1)
|
||||||
|
.fontColor(this.titleColor ?? '#11102C')
|
||||||
|
.fontSize(16)
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.ellipsisMode(EllipsisMode.CENTER)
|
||||||
|
.textOverflow({
|
||||||
|
overflow: TextOverflow.Ellipsis
|
||||||
|
})
|
||||||
|
.constraintSize({
|
||||||
|
maxWidth: 120
|
||||||
|
})
|
||||||
|
|
||||||
|
Row() {
|
||||||
|
if (!this.onClickLeft?.img && this.onClickLeft) {
|
||||||
|
Badge({
|
||||||
|
count: this.showBadgeLeft ? 1 : 0,
|
||||||
|
style: {
|
||||||
|
badgeSize: 6,
|
||||||
|
badgeColor: Color.Red
|
||||||
|
}
|
||||||
|
}) {
|
||||||
|
Text(`${this.onClickLeft?.text}` ?? '确定')
|
||||||
|
.fontColor(this.onClickLeft?.color ?? '#17171A')
|
||||||
|
.onClick(() => {
|
||||||
|
this.onClickLeft?.onClick && this.onClickLeft?.onClick()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.onClickLeft?.img && this.onClickLeft) {
|
||||||
|
Badge({
|
||||||
|
count: this.showBadgeLeft ? 1 : 0,
|
||||||
|
style: {
|
||||||
|
badgeSize: 6,
|
||||||
|
badgeColor: '#FF6500',
|
||||||
|
color: '#FF6500'
|
||||||
|
}
|
||||||
|
}) {
|
||||||
|
Image(this.onClickLeft.img)
|
||||||
|
.onClick(() => {
|
||||||
|
this.onClickLeft?.onClick && this.onClickLeft?.onClick()
|
||||||
|
})
|
||||||
|
.objectFit(ImageFit.Contain)
|
||||||
|
.width(20)
|
||||||
|
.height(20)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!this.onClickRight?.img && this.onClickRight) {
|
||||||
|
Badge({
|
||||||
|
count: this.showBadgeRight ? 1 : 0,
|
||||||
|
style: {
|
||||||
|
badgeSize: 6,
|
||||||
|
badgeColor: '#FF6500',
|
||||||
|
color: '#FF6500'
|
||||||
|
}
|
||||||
|
}) {
|
||||||
|
Text(this.onClickRight?.text ?? '确定')
|
||||||
|
.fontColor(this.onClickRight?.color ?? '#17171A')
|
||||||
|
.onClick(() => {
|
||||||
|
this.onClickRight?.onClick && this.onClickRight?.onClick()
|
||||||
|
})
|
||||||
|
.margin({
|
||||||
|
left: 10
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.onClickRight?.img && this.onClickRight) {
|
||||||
|
Badge({
|
||||||
|
count: this.showBadgeRight ? 1 : 0,
|
||||||
|
style: {
|
||||||
|
badgeSize: 6,
|
||||||
|
badgeColor: '#FF6500',
|
||||||
|
color: '#FF6500'
|
||||||
|
}
|
||||||
|
}) {
|
||||||
|
Image(this.onClickRight.img)
|
||||||
|
.onClick(() => {
|
||||||
|
this.onClickRight?.onClick && this.onClickRight?.onClick()
|
||||||
|
})
|
||||||
|
.objectFit(ImageFit.Contain)
|
||||||
|
.width(20)
|
||||||
|
.height(20)
|
||||||
|
.margin({
|
||||||
|
left: 10
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}.width(110)
|
||||||
|
.justifyContent(FlexAlign.End)
|
||||||
|
}
|
||||||
.backgroundColor(this.backgroundColorNav ?? '#ffffff')
|
.backgroundColor(this.backgroundColorNav ?? '#ffffff')
|
||||||
.opacity(undefined === this.opacitys ? 1 : this.opacitys > 1 ? 1 : this.opacitys < 0 ? 0 : this.opacitys)
|
.opacity(undefined === this.opacitys ? 1 : this.opacitys > 1 ? 1 : this.opacitys < 0 ? 0 : this.opacitys)
|
||||||
|
.justifyContent(FlexAlign.SpaceBetween)
|
||||||
Row() {
|
.height(44)
|
||||||
|
.padding({
|
||||||
Row() {
|
left: 15,
|
||||||
Image($r("app.media.base_back"))
|
right: 15
|
||||||
.height(15)
|
})
|
||||||
.objectFit(ImageFit.Contain).visibility(!this.hideBack ? Visibility.Visible : Visibility.None)
|
.width('100%')
|
||||||
}.width(110)
|
.margin({
|
||||||
.onClick(() => {
|
top: WindowHelper.topRectHeight
|
||||||
if (this.hideBack) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (this.onBackEvent && !this.hideBack) {
|
|
||||||
this.onBackEvent()
|
|
||||||
} else if (this.pageInfos) {
|
|
||||||
this.pageInfos.pop()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
Text(this.titleText ?? '')
|
|
||||||
.maxLines(1)
|
|
||||||
.fontColor('#11102C')
|
|
||||||
.fontSize(16)
|
|
||||||
.fontWeight(FontWeight.Medium)
|
|
||||||
.ellipsisMode(EllipsisMode.CENTER)
|
|
||||||
.textOverflow({
|
|
||||||
overflow: TextOverflow.Ellipsis
|
|
||||||
})
|
|
||||||
.constraintSize({
|
|
||||||
maxWidth: 120
|
|
||||||
})
|
|
||||||
|
|
||||||
Row() {
|
|
||||||
if (!this.onClickLeft?.img && this.onClickLeft) {
|
|
||||||
Badge({
|
|
||||||
count: this.showBadgeLeft ? 1 : 0,
|
|
||||||
style: {
|
|
||||||
badgeSize: 6,
|
|
||||||
badgeColor: Color.Red
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
Text(`${this.onClickLeft?.text}` ?? '确定')
|
|
||||||
.fontColor(this.onClickLeft?.color ?? '#17171A')
|
|
||||||
.onClick(() => {
|
|
||||||
this.onClickLeft?.onClick && this.onClickLeft?.onClick()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.onClickLeft?.img && this.onClickLeft) {
|
|
||||||
Badge({
|
|
||||||
count: this.showBadgeLeft ? 1 : 0,
|
|
||||||
style: {
|
|
||||||
badgeSize: 6,
|
|
||||||
badgeColor: '#FF6500',
|
|
||||||
color: '#FF6500'
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
Image(this.onClickLeft.img)
|
|
||||||
.onClick(() => {
|
|
||||||
this.onClickLeft?.onClick && this.onClickLeft?.onClick()
|
|
||||||
})
|
|
||||||
.objectFit(ImageFit.Contain)
|
|
||||||
.width(20)
|
|
||||||
.height(20)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!this.onClickRight?.img && this.onClickRight) {
|
|
||||||
Badge({
|
|
||||||
count: this.showBadgeRight ? 1 : 0,
|
|
||||||
style: {
|
|
||||||
badgeSize: 6,
|
|
||||||
badgeColor: '#FF6500',
|
|
||||||
color: '#FF6500'
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
Text(this.onClickRight?.text ?? '确定')
|
|
||||||
.fontColor(this.onClickRight?.color ?? '#17171A')
|
|
||||||
.onClick(() => {
|
|
||||||
this.onClickRight?.onClick && this.onClickRight?.onClick()
|
|
||||||
})
|
|
||||||
.margin({
|
|
||||||
left: 10
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.onClickRight?.img && this.onClickRight) {
|
|
||||||
Badge({
|
|
||||||
count: this.showBadgeRight ? 1 : 0,
|
|
||||||
style: {
|
|
||||||
badgeSize: 6,
|
|
||||||
badgeColor: '#FF6500',
|
|
||||||
color: '#FF6500'
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
Image(this.onClickRight.img)
|
|
||||||
.onClick(() => {
|
|
||||||
this.onClickRight?.onClick && this.onClickRight?.onClick()
|
|
||||||
})
|
|
||||||
.objectFit(ImageFit.Contain)
|
|
||||||
.width(20)
|
|
||||||
.height(20)
|
|
||||||
.margin({
|
|
||||||
left: 10
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}.width(110)
|
|
||||||
.justifyContent(FlexAlign.End)
|
|
||||||
}
|
}
|
||||||
.backgroundColor(this.backgroundColorNav ?? '#ffffff')
|
|
||||||
.opacity(undefined === this.opacitys ? 1 : this.opacitys > 1 ? 1 : this.opacitys < 0 ? 0 : this.opacitys)
|
|
||||||
.justifyContent(FlexAlign.SpaceBetween)
|
|
||||||
.height(44)
|
|
||||||
.padding({
|
|
||||||
left: 15,
|
|
||||||
right: 15
|
|
||||||
})
|
|
||||||
.width('100%')
|
|
||||||
.margin({
|
|
||||||
top: WindowHelper.topRectHeight
|
|
||||||
})
|
|
||||||
|
|
||||||
Column() {
|
Column() {
|
||||||
LoadingProgress()
|
LoadingProgress()
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户