作者 xiaoqiu

优化了综合评述内容,改标题,空无内容不显示

... ... @@ -14,7 +14,7 @@ export default class EntryAbility extends UIAbility {
async onWindowStageCreate(windowStage: window.WindowStage) {
// Main window is created, set main page for this ability
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
await showStartAd(windowStage, this.context)
// await showStartAd(windowStage, this.context)
windowStage.loadContent('pages/Login', (err) => {
if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
... ...
... ... @@ -92,14 +92,30 @@ function extractRichText(str: string | null): comprehensiveType{
} else {
let richText = str.replace(/<.*?>/g, '?')
let arrValue: string[] = richText.split('?').filter(item => item !== '')
let otherArr: string[] = []
if(arrValue.length > 5){
for (let index = 5; index < arrValue.length; index++) {
otherArr.push(arrValue[index])
}
return multiply(arrValue[0], arrValue[1], arrValue[2], arrValue[3], arrValue[4], ...otherArr)
} else if(arrValue.length === 5) {
return multiply(arrValue[0], arrValue[1], arrValue[2], arrValue[3], arrValue[4], '其他:')
let otherValue: string[] = []
let existingProblem: string = ''
let cumulativeIssues: string = ''
let correctedProblems: string = ''
if(arrValue.length >= 2){
for (let index = 2; index < arrValue.length; index++) {
if(arrValue[index].split(':')[0] === '本月发现的问题' || arrValue[index].split(':')[0] === '存在问题' ) {
existingProblem = arrValue[index].split(':')[1]
} else if(arrValue[index].split(':')[0] === '遗留未整改的问题' || arrValue[index].split(':')[0] === '累计问题') {
cumulativeIssues = arrValue[index].split(':')[1]
} else if(arrValue[index].split(':')[0] === '本月已整改的问题' || arrValue[index].split(':')[0] === '已整改问题') {
correctedProblems = arrValue[index].split(':')[1]
} else {
otherValue.push(arrValue[index].slice(3))
}
}
return {
range: arrValue[0].split(':')[1],
facility: arrValue[1].split(':')[1],
existingProblem: existingProblem,
cumulativeIssues: cumulativeIssues,
correctedProblems: correctedProblems,
other: otherValue.join('、')
}
} else {
return {
range: '',
... ... @@ -115,7 +131,16 @@ function extractRichText(str: string | null): comprehensiveType{
// 提交修改时合并富文本内容
function mergeRichText(comprehensive: comprehensiveType): string{
let resStr = `<div>${'本月维保范围:' + comprehensive.range}</div><div style="margin-top: 6px;">${'维保设施包含:' + comprehensive.facility}</div><div style="margin-top: 6px;">${'存在问题:' + comprehensive.existingProblem}</div><div style="margin-top: 6px;">${'累计问题:' + comprehensive.cumulativeIssues}</div><div style="margin-top: 6px;">${'已整改问题:' + comprehensive.correctedProblems}</div>`
let resStr = `<div>${'本月维保范围:' + comprehensive.range}</div><div style="margin-top: 6px;">${'维保设施包含:' + comprehensive.facility}</div>`
if(comprehensive.existingProblem) {
resStr += `<div style="margin-top: 6px;">${'本月发现的问题:' + comprehensive.existingProblem}</div>`
}
if(comprehensive.cumulativeIssues) {
resStr += `<div style="margin-top: 6px;">${'遗留未整改的问题:' + comprehensive.cumulativeIssues}</div>`
}
if(comprehensive.correctedProblems) {
resStr += `<div style="margin-top: 6px;">${'本月已整改的问题:' + comprehensive.correctedProblems}</div>`
}
if (comprehensive.other) {
resStr += `<div style="margin-top: 6px;">${'其他:' + comprehensive.other}</div>`
}
... ... @@ -276,7 +301,7 @@ struct AddRecords {
if(this.addForm.reportName === '' || this.addForm.reportNo === '' || this.addForm.applyCompanyName === '' || this.addForm.maintenanceTime === '请选择起始日期' || this.addForm.maintenanceEndTime === '请选择结束日期' || this.addForm.fireFacilities === '' || this.addForm.maintenancePeople === '') {
return promptAction.showToast({message: '* 号为必填项'})
}
if(this.comprehensiveReview.range === '' || this.comprehensiveReview.existingProblem === '' || this.comprehensiveReview.cumulativeIssues === '' || this.comprehensiveReview.correctedProblems === ''){
if(this.comprehensiveReview.range === ''){
return promptAction.showToast({message: '综合评述带 * 号必填'})
}
if(this.errorMsg !== '') {
... ... @@ -659,22 +684,19 @@ struct AddRecords {
}.width('100%').alignItems(HorizontalAlign.Start)
Column({space: 10}){
Row({space: 5}){
Image($r('app.media.require')).width(20)
Text('存在问题').TitleReview()
Text('本月发现的问题').TitleReview()
}.width('100%')
TextArea({ placeholder: '请输入存在问题', text: $$this.comprehensiveReview.existingProblem }).TextAreaReview()
}.width('100%').alignItems(HorizontalAlign.Start)
Column({space: 10}){
Row({space: 5}){
Image($r('app.media.require')).width(20)
Text('累计问题').TitleReview()
Text('遗留未整改的问题').TitleReview()
}.width('100%')
TextArea({ placeholder: '请输入累计问题', text: $$this.comprehensiveReview.cumulativeIssues }).TextAreaReview()
}.width('100%').alignItems(HorizontalAlign.Start)
Column({space: 10}){
Row({space: 5}){
Image($r('app.media.require')).width(20)
Text('已整改问题').TitleReview()
Text('本月已整改的问题').TitleReview()
}.width('100%')
TextArea({ placeholder: '请输入已整改问题', text: $$this.comprehensiveReview.correctedProblems }).TextAreaReview()
}.width('100%').alignItems(HorizontalAlign.Start)
... ... @@ -690,9 +712,7 @@ struct AddRecords {
Row(){
Text('提交').borderRadius(5).width('100%').height(30).fontColor('#fff')
.backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
.onClick(() => {
this.submitForm()
})
.onClick(() => { this.submitForm() })
}.width('100%').height(40).backgroundColor('#fff').padding({left: 10, right: 10})
}.width('100%').height('100%').backgroundColor('#f2f3f7')
}
... ...
... ... @@ -4,7 +4,6 @@ import preferencesUtils from '../utils/preferences'
import { AxiosResponse } from '@ohos/axios'
import { HmParseHTML } from "@wuyan/html_parse"
import { basePath } from '../utils/baseUrl'
import {getCloudDown, beanType} from '../api/user'
import loadingDialog from '../dialog/LoadingDialog'
import UploadTipDialog from '../dialog/UploadTipDialog'
import { getReportDetail, getMalfunctionList, deleteRecords, successReport, returnSing } from '../api/originalRecords'
... ... @@ -36,7 +35,6 @@ struct DetailRecords {
@State findTime: string = ''
@State applyCompanyComment: string = ''
@State maintenanceComment: string = ''
@State isShowCloudDown: boolean = false
aboutToAppear(): void {
AppStorage.setOrCreate('videoPath', '');
if(!AppStorage.get('isShowTip')) {
... ... @@ -45,9 +43,6 @@ struct DetailRecords {
}
async onPageShow() {
this.loadingController.open()
// 是否可以上传云存储
let cloudDown: AxiosResponse<beanType> = await getCloudDown()
this.isShowCloudDown = cloudDown.data.msg == 'true'
// 获取维保记录详情
const detail: AxiosResponse<reportDetailTest> = await getReportDetail(reportId)
this.reportDetail = detail.data.data
... ... @@ -63,6 +58,7 @@ struct DetailRecords {
}
}
// 加载弹窗
loadingController: CustomDialogController = new CustomDialogController({
builder: loadingDialog(),
customStyle: true,
... ... @@ -71,6 +67,7 @@ struct DetailRecords {
autoCancel: false
})
// 上传下载提示框
uploadController: CustomDialogController = new CustomDialogController({
builder: UploadTipDialog(),
cornerRadius: 10
... ... @@ -94,6 +91,125 @@ struct DetailRecords {
isImgOrVideo = (list: ItemList[]): boolean => {
return list.some(item => item.cosKey !== null)
}
// 分享签名
shareSignature = () => {
AlertDialog.show({
title: '分享签名提示',
message: `出于对多个甲方见证人签名的考虑,在甲方签名完成后,仍是"待甲方签名"的状态,需【维保公司账号】前往【更多操作】-->【完成】`,
alignment: DialogAlignment.Center,
primaryButton: {
value: '取消',
action: () => {
console.info('Callback when the first button is clicked')
}
},
secondaryButton: {
enabled: true,
defaultFocus: true,
style: DialogButtonStyle.HIGHLIGHT,
value: '确认',
action: async () => {
this.copyText(`https://xfappht.crgx.net/report/record?id=${reportId}&token=${preferencesUtils.get('XF_TOKEN', '')}&time=${new Date().getTime()}&type=firstPartySign&username=${preferencesUtils.get('XF_USERNAME', '')}`)
}
}
})
}
// 查看记录
lookReport = () => {
if(personId !== '') {
router.pushUrl({
url: 'pages/LookRecords',
params: {
reportId: this.reportDetail?.reportId,
pid: personId
}
})
} else {
router.pushUrl({
url: 'pages/LookRecordCompany',
params: {
reportId: this.reportDetail?.reportId
}
})
}
}
// 修改记录
updateReport = () => {
AlertDialog.show({
title: '重要提示',
message: `退回编辑会清除所有的维保人员签名和甲方签名,确认退回?`,
alignment: DialogAlignment.Center,
primaryButton: {
value: '取消',
action: () => {
console.info('Callback when the first button is clicked')
}
},
secondaryButton: {
enabled: true,
defaultFocus: true,
style: DialogButtonStyle.HIGHLIGHT,
value: '确认',
action: async () => {
const res: AxiosResponse<configTest> = await returnSing(reportId)
promptAction.showToast({message: res.data.msg})
const detail: AxiosResponse<reportDetailTest> = await getReportDetail(reportId)
this.reportDetail = detail.data.data
}
}
})
}
// 完成签发
IssueCompleted = () => {
AlertDialog.show({
title: '提示',
message: `完成签发后不可退回修改,确认完成吗`,
alignment: DialogAlignment.Center,
primaryButton: {
value: '取消',
action: () => {
console.info('Callback when the first button is clicked')
}
},
secondaryButton: {
enabled: true,
defaultFocus: true,
style: DialogButtonStyle.HIGHLIGHT,
value: '确认',
action: async () => {
await successReport(reportId)
await deleteRecords({reportId, state: '1'})
promptAction.showToast({message: '修改完成'})
}
}
})
}
// 删除记录
deleteReport = () => {
AlertDialog.show({
title: '删除提示',
message: `维保原始记录一经删除,无法找回,确认删除${this.reportDetail?.reportName}(${this.reportDetail?.reportNo})的原始记录吗?`,
alignment: DialogAlignment.Center,
primaryButton: {
value: '取消',
action: () => {
console.info('Callback when the first button is clicked')
}
},
secondaryButton: {
enabled: true,
defaultFocus: true,
style: DialogButtonStyle.HIGHLIGHT,
value: '确认',
action: async () => {
await deleteRecords({reportId, state: '2'})
router.back()
}
}
})
}
build() {
Column(){
NavHeader({title: '维保记录详情'})
... ... @@ -175,29 +291,7 @@ struct DetailRecords {
Row({space: 5}){
Image($r('app.media.share')).width(14)
Text('分享签名').fontSize(12).fontColor('#1890ff')
}.onClick(() => {
AlertDialog.show({
title: '分享签名提示',
message: `出于对多个甲方见证人签名的考虑,在甲方签名完成后,仍是"待甲方签名"的状态,需【维保公司账号】前往【更多操作】-->【完成】`,
alignment: DialogAlignment.Center,
primaryButton: {
value: '取消',
action: () => {
console.info('Callback when the first button is clicked')
}
},
secondaryButton: {
enabled: true,
defaultFocus: true,
style: DialogButtonStyle.HIGHLIGHT,
value: '确认',
action: async () => {
console.log(`https://xfappht.crgx.net/report/record?id=${reportId}&token=${preferencesUtils.get('XF_TOKEN', '')}&time=${new Date().getTime()}&type=firstPartySign&username=${preferencesUtils.get('XF_USERNAME', '')}`)
this.copyText(`https://xfappht.crgx.net/report/record?id=${reportId}&token=${preferencesUtils.get('XF_TOKEN', '')}&time=${new Date().getTime()}&type=firstPartySign&username=${preferencesUtils.get('XF_USERNAME', '')}`)
}
}
})
})
}.onClick(() => { this.shareSignature() })
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
.visibility(this.reportDetail?.state == '1' || this.reportDetail?.state == '5' ? Visibility.Visible : Visibility.None)
Column({space: 5}){
... ... @@ -224,24 +318,7 @@ struct DetailRecords {
Image($r('app.media.edit_1')).width(12)
Text('查看记录').fontColor('#1890ff').fontSize(12).margin({left: 3, right: 3})
Image($r('app.media.right_arrow')).width(12)
}.onClick(() => {
if(personId !== '') {
router.pushUrl({
url: 'pages/LookRecords',
params: {
reportId: this.reportDetail?.reportId,
pid: personId
}
})
} else {
router.pushUrl({
url: 'pages/LookRecordCompany',
params: {
reportId: this.reportDetail?.reportId
}
})
}
})
}.onClick(() => { this.lookReport() })
}.justifyContent(FlexAlign.SpaceBetween).width('100%').margin({bottom: 10})
ForEach(this.projectList, (item: ProjectList, index) => {
Column({space: 5}){
... ... @@ -277,9 +354,7 @@ struct DetailRecords {
})
router.pushUrl({
url: 'pages/VideoDetail',
params: {
cosKeyList: newArr
}
params: { cosKeyList: newArr }
})
})
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
... ... @@ -371,29 +446,7 @@ struct DetailRecords {
Image($r('app.media.right_arrow')).width(16)
}.padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%').border({width: {bottom: 1}, color: '#eee'})
.visibility(this.reportDetail?.state == '1' ? Visibility.None : Visibility.Visible)
.onClick(() => {
AlertDialog.show({
title: '删除提示',
message: `维保原始记录一经删除,无法找回,确认删除${this.reportDetail?.reportName}(${this.reportDetail?.reportNo})的原始记录吗?`,
alignment: DialogAlignment.Center,
primaryButton: {
value: '取消',
action: () => {
console.info('Callback when the first button is clicked')
}
},
secondaryButton: {
enabled: true,
defaultFocus: true,
style: DialogButtonStyle.HIGHLIGHT,
value: '确认',
action: async () => {
await deleteRecords({reportId, state: '2'})
router.back()
}
}
})
})
.onClick(() => { this.deleteReport() })
Row(){
Row(){
Image($r('app.media.finish')).width(16)
... ... @@ -402,30 +455,7 @@ struct DetailRecords {
Image($r('app.media.right_arrow')).width(16)
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
.visibility(this.reportDetail?.state == '5' && roleName == 'company' ? Visibility.Visible : Visibility.None)
.onClick(async () => {
AlertDialog.show({
title: '提示',
message: `完成签发后不可退回修改,确认完成吗`,
alignment: DialogAlignment.Center,
primaryButton: {
value: '取消',
action: () => {
console.info('Callback when the first button is clicked')
}
},
secondaryButton: {
enabled: true,
defaultFocus: true,
style: DialogButtonStyle.HIGHLIGHT,
value: '确认',
action: async () => {
await successReport(reportId)
await deleteRecords({reportId, state: '1'})
promptAction.showToast({message: '修改完成'})
}
}
})
})
.onClick(async () => { this.IssueCompleted() })
Row(){
Row(){
Image($r('app.media.returnUpdate')).width(16)
... ... @@ -434,41 +464,7 @@ struct DetailRecords {
Image($r('app.media.right_arrow')).width(16)
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
.visibility(this.reportDetail?.state == '5' && roleName == 'company' ? Visibility.Visible : Visibility.None)
.onClick(async () => {
AlertDialog.show({
title: '重要提示',
message: `退回编辑会清除所有的维保人员签名和甲方签名,确认退回?`,
alignment: DialogAlignment.Center,
primaryButton: {
value: '取消',
action: () => {
console.info('Callback when the first button is clicked')
}
},
secondaryButton: {
enabled: true,
defaultFocus: true,
style: DialogButtonStyle.HIGHLIGHT,
value: '确认',
action: async () => {
const res: AxiosResponse<configTest> = await returnSing(reportId)
promptAction.showToast({message: res.data.msg})
const detail: AxiosResponse<reportDetailTest> = await getReportDetail(reportId)
this.reportDetail = detail.data.data
}
}
})
})
// Row(){
// Row(){
// Image($r('app.media.lookView')).width(16)
// Text('预览统计').fontColor('#1890ff').fontSize(12).margin({left: 3, right: 3})
// }
// Image($r('app.media.right_arrow')).width(16)
// }.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
// .onClick(() => {
// pushOutsideWeb(`https://xfwbzs.crgx.net/report/preview?id=${reportId}`)
// })
.onClick(async () => { this.updateReport() })
Row(){
Row(){
Image($r('app.media.document')).width(16)
... ... @@ -477,9 +473,7 @@ struct DetailRecords {
Image($r('app.media.right_arrow')).width(16)
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
.visibility(this.reportDetail?.state == '1' ? Visibility.Visible : Visibility.None)
.onClick(() => {
pushOutsideWeb(`${basePath}/report/view?id=${reportId}`)
})
.onClick(() => { pushOutsideWeb(`${basePath}/report/view?id=${reportId}`) })
Row(){
Row(){
Image($r('app.media.setting')).width(16)
... ... @@ -488,9 +482,7 @@ struct DetailRecords {
Image($r('app.media.right_arrow')).width(16)
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
.visibility(this.reportDetail?.state == '1' ? Visibility.Visible : Visibility.None)
.onClick(() => {
pushOutsideWeb(`${basePath}/report/view?id=${reportId}`)
})
.onClick(() => { pushOutsideWeb(`${basePath}/report/view?id=${reportId}`) })
}.backgroundColor('#fff').borderRadius(10).padding(10).width('100%')
}.width('100%')
}.backgroundColor('#f2f3f7').padding(10)
... ...
... ... @@ -36,6 +36,37 @@ struct Login {
alignment: DialogAlignment.Bottom
})
submitLogin = async () => {
if(!this.agreeSelect) return promptAction.showToast({ message: '请勾选同意用户协议与隐私政策' })
if(this.rememberSelect) {
preferencesUtil.set('XF_ACCOUNT', this.loginForm.username) // 存入账号
preferencesUtil.set('XF_PASSWORD', this.loginForm.password) // 存入密码
}
const res: AxiosResponse<loginType> = await login(this.loginForm)
const token = res.data.token
preferencesUtil.set('XF_TOKEN', token) // 存入token
const accountInfo: AxiosResponse<InfoTest> = await getInfo()
let roleName: string = accountInfo.data.roles[0] || ''
preferencesUtil.set('XF_ROLE_NAME', roleName)
// 根据角色存储不同的数据
if(roleName == 'company'){
let companyInfo: AxiosResponse<companyTest> = await getCompanyInfo()
preferencesUtil.set('XF_COMPANY_INFO', JSON.stringify(companyInfo.data.data))
preferencesUtil.set('XF_COMPANY_ID', companyInfo.data.data.companyId)
preferencesUtil.set('XF_USERNAME', companyInfo.data.data.username)
preferencesUtil.set('XF_USER_ID', companyInfo.data.data.userId)
} else {
let personInfo: AxiosResponse<personTest> = await getPersonInfo()
preferencesUtil.set('XF_PERSON_INFO', JSON.stringify(personInfo.data.data))
preferencesUtil.set('XF_COMPANY_ID', personInfo.data.data.companyId || 0)
preferencesUtil.set('XF_PERSON_ID', personInfo.data.data.personId)
preferencesUtil.set('XF_USERNAME', personInfo.data.data.username)
}
router.pushUrl({
url: 'pages/Index'
})
}
build() {
Column(){
Column(){
... ... @@ -65,28 +96,16 @@ struct Login {
.selectedColor('#1890ff')
.shape(CheckBoxShape.CIRCLE)
.width(16).height(16)
.mark({
size: 10,
strokeWidth: 5
})
.onChange((value) => {
this.agreeSelect = value
})
.mark({ size: 10, strokeWidth: 5 })
.onChange((value) => { this.agreeSelect = value })
Row(){
Text('已阅读并同意').fontSize(12).fontColor('#fff')
Text('《用户协议》').fontSize(12).fontColor(Color.Red)
.onClick(() => {
router.pushUrl({
url: 'pages/UserAgreement'
})
})
router.pushUrl({ url: 'pages/UserAgreement' }) })
Text('和').fontSize(12).fontColor('#fff')
Text('《隐私政策》').fontSize(12).fontColor(Color.Red)
.onClick(() => {
router.pushUrl({
url: 'pages/PrivacyPolicy'
})
})
.onClick(() => { router.pushUrl({ url: 'pages/PrivacyPolicy' }) })
}
}.width('100%').justifyContent(FlexAlign.Start)
Row({space: 5}){
... ... @@ -95,10 +114,7 @@ struct Login {
.selectedColor('#1890ff')
.shape(CheckBoxShape.ROUNDED_SQUARE)
.width(16).height(16)
.mark({
size: 10,
strokeWidth: 5
})
.mark({ size: 10, strokeWidth: 5 })
.onChange((value: boolean) => {
this.rememberSelect = value
preferencesUtil.set('XF_REMEMBER', value)
... ... @@ -120,46 +136,7 @@ struct Login {
.fontSize(16).fontColor('#1890ff')
.borderRadius(20).backgroundColor(Color.White)
.margin({top: 20})
.onClick(async () => {
if(!this.agreeSelect) {
return promptAction.showToast({
message: '请勾选同意用户协议与隐私政策'
})
}
if(this.rememberSelect) {
preferencesUtil.set('XF_ACCOUNT', this.loginForm.username)
preferencesUtil.set('XF_PASSWORD', this.loginForm.password)
}
const res: AxiosResponse<loginType> = await login(this.loginForm)
const token = res.data.token
preferencesUtil.set('XF_TOKEN', token)
const accountInfo: AxiosResponse<InfoTest> = await getInfo()
let roleName: string = accountInfo.data.roles[0] || ''
preferencesUtil.set('XF_ROLE_NAME', roleName)
// 根据角色存储不同的数据
if(roleName == 'person'){
let personInfo: AxiosResponse<personTest> = await getPersonInfo()
preferencesUtil.set('XF_PERSON_INFO', JSON.stringify(personInfo.data.data))
preferencesUtil.set('XF_COMPANY_ID', personInfo.data.data.companyId)
preferencesUtil.set('XF_PERSON_ID', personInfo.data.data.personId)
preferencesUtil.set('XF_USERNAME', personInfo.data.data.username)
} else if(roleName == 'company'){
let companyInfo: AxiosResponse<companyTest> = await getCompanyInfo()
preferencesUtil.set('XF_COMPANY_INFO', JSON.stringify(companyInfo.data.data))
preferencesUtil.set('XF_COMPANY_ID', companyInfo.data.data.companyId)
preferencesUtil.set('XF_USERNAME', companyInfo.data.data.username)
preferencesUtil.set('XF_USER_ID', companyInfo.data.data.userId)
} else {
let personInfo: AxiosResponse<personTest> = await getPersonInfo()
preferencesUtil.set('XF_PERSON_INFO', JSON.stringify(personInfo.data.data))
preferencesUtil.set('XF_COMPANY_ID', personInfo.data.data.companyId || 0)
preferencesUtil.set('XF_PERSON_ID', personInfo.data.data.personId)
preferencesUtil.set('XF_USERNAME', personInfo.data.data.username)
}
router.pushUrl({
url: 'pages/Index'
})
})
.onClick(() => { this.submitLogin() })
Row({space: 10}){
Row({ space: 5}){
Text('忘记密码').width(15).fontSize(14).height(60).fontColor('#fff')
... ... @@ -167,11 +144,7 @@ struct Login {
}.width(50).height(100).linearGradient({
angle: GradientDirection.Bottom, colors: [['#72b8d6', 0.0], ['#70a6d8', 0.5]]
}).borderRadius({topRight: 50, bottomRight: 50}).justifyContent(FlexAlign.End).padding(10)
.onClick(() => {
router.pushUrl({
url: 'pages/UpdatePassword'
})
})
.onClick(() => { router.pushUrl({ url: 'pages/UpdatePassword' }) })
Column({space: 10}){
Text('监管工具箱').fontSize(14).fontColor('#fff')
Text('立即使用').height(30).fontSize(14).fontColor('#1890ff').width(120).textAlign(TextAlign.Center)
... ... @@ -179,20 +152,14 @@ struct Login {
}.layoutWeight(1).height(80).linearGradient({
angle: GradientDirection.Bottom, colors: [['#72b8d6', 0.0], ['#70a6d8', 0.5]]
}).borderRadius(40).justifyContent(FlexAlign.Center)
.onClick(() => {
router.pushUrl({
url: 'pages/ToolBox'
})
})
.onClick(() => { router.pushUrl({ url: 'pages/ToolBox' }) })
Row({space: 5}){
Image($r('app.media.left')).width(14)
Text('立即注册').width(15).fontSize(14).height(60).fontColor('#fff')
}.width(50).height(100).linearGradient({
angle: GradientDirection.Bottom, colors: [['#72b8d6', 0.0], ['#70a6d8', 0.5]]
}).borderRadius({topLeft: 50, bottomLeft: 50}).justifyContent(FlexAlign.Start).padding(10)
.onClick(() => {
this.selectRegController.open()
})
.onClick(() => { this.selectRegController.open() })
}.width('100%').height(100).justifyContent(FlexAlign.SpaceBetween)
.position({x: 0, y: '80%'})
Text('Ⓒ 广西世纪创软信息技术有限公司\n' +
... ...
... ... @@ -6,9 +6,6 @@ class preferencesUtils {
const context = getContext(this)
const preferences_obj = preferences.getPreferencesSync(context, {name: 'userData'})
const result = preferences_obj.getSync(key, value)
if(key == 'XF_PERSON_ID') {
console.log(`获取${key}成功`)
}
return result
} catch (e){
return value
... ... @@ -21,9 +18,6 @@ class preferencesUtils {
const preferences_obj = preferences.getPreferencesSync(context, {name: 'userData'})
preferences_obj.putSync(key, value)
preferences_obj.flush().then(() => {
if(key == 'XF_PERSON_ID') {
console.log(`存储${key}成功, 值为${value}`)
}
})
} catch (e){
}
... ... @@ -35,7 +29,6 @@ class preferencesUtils {
const preferences_obj = preferences.getPreferencesSync(context, {name: 'userData'})
preferences_obj.deleteSync(key)
preferences_obj.flush().then(() => {
console.log('删除成功')
})
} catch (e){
console.log('删除失败')
... ...