修改bug
This commit is contained in:
parent
a83890881e
commit
195e42f50e
@ -9,21 +9,23 @@ interface DefaultData {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Preview
|
||||||
@CustomDialog
|
@CustomDialog
|
||||||
export struct HeroPopWindow {
|
export struct HeroPopWindow {
|
||||||
@Prop heroId:string = '';
|
@Prop heroId:string = '';
|
||||||
@State detailsData:object = new Object;
|
@State detailsData:object = new Object;
|
||||||
private years: string[] = ['2019年英雄榜','2018年英雄榜','2017年英雄榜','2016年英雄榜','2015年英雄榜'];
|
|
||||||
controller: CustomDialogController;
|
controller: CustomDialogController;
|
||||||
|
|
||||||
heroDetailsRequestUrl:string = BasicConstant.urlExpertAPI+'gethonorDetail'
|
aboutToAppear(): void {
|
||||||
hashMap: HashMap<string, string> = new HashMap();
|
this.updateHeroDetailsAction();
|
||||||
|
}
|
||||||
|
|
||||||
updateHeroDetailsAction(){
|
updateHeroDetailsAction(){
|
||||||
this.hashMap.set('id',this.heroId);
|
const hashMap: HashMap<string, string> = new HashMap();
|
||||||
hdHttp.httpReq<string>(this.heroDetailsRequestUrl,this.hashMap).then(async (res: HdResponse<string>) => {
|
hashMap.set('id',this.heroId);
|
||||||
|
hdHttp.httpReq<string>(BasicConstant.gethonorDetail,hashMap).then(async (res: HdResponse<string>) => {
|
||||||
let json:RequestDefaultModel = JSON.parse(res+'') as RequestDefaultModel;
|
let json:RequestDefaultModel = JSON.parse(res+'') as RequestDefaultModel;
|
||||||
if(json.code=='1') {
|
if(json.code == '1') {
|
||||||
this.detailsData = json.data;
|
this.detailsData = json.data;
|
||||||
} else {
|
} else {
|
||||||
console.error('英雄榜失败:'+json.message)
|
console.error('英雄榜失败:'+json.message)
|
||||||
@ -36,39 +38,37 @@ export struct HeroPopWindow {
|
|||||||
|
|
||||||
build() {
|
build() {
|
||||||
Stack() {
|
Stack() {
|
||||||
//半透明黑色背景
|
|
||||||
Column().width('100%').height('100%').backgroundColor('#50000000')
|
Column().width('100%').height('100%').backgroundColor('#50000000')
|
||||||
|
|
||||||
//弹窗主体
|
|
||||||
Column() {
|
Column() {
|
||||||
//头部图标
|
Image(BasicConstant.urlImage+this.detailsData['img'])
|
||||||
Image($r('app.media.heroPop_headericon'))
|
.alt($r('app.media.heroPop_headericon'))
|
||||||
.width(80)
|
.width(90)
|
||||||
.height(80)
|
.height(90)
|
||||||
.margin({top:-25})
|
.margin({top:-25})
|
||||||
.zIndex(2)
|
.zIndex(2)
|
||||||
//标题和正文范围
|
|
||||||
Column() {
|
Column() {
|
||||||
Text('肝胆英雄榜')
|
Text(this.detailsData['title'])
|
||||||
.fontSize(20)
|
.fontSize(16)
|
||||||
.fontColor('#673986')
|
.fontColor('#DA57E5')
|
||||||
.margin({top:20})
|
.margin({top:20})
|
||||||
Grid() {
|
Grid() {
|
||||||
ForEach(this.years,(item:string)=>{
|
ForEach(this.detailsData['honorlist'],(item:Record<string,string>)=>{
|
||||||
GridItem({style:GridItemStyle.PLAIN}) {
|
GridItem({style:GridItemStyle.PLAIN}) {
|
||||||
Text(item)
|
Text(item.nick_name)
|
||||||
.fontSize(10)
|
.fontSize(12)
|
||||||
.fontColor(Color.Black)
|
.fontColor('#DA57E5')
|
||||||
.backgroundColor(Color.White) // 添加背景色确保可见
|
.backgroundColor(Color.White)
|
||||||
.textAlign(TextAlign.Center)
|
.textAlign(TextAlign.Center)
|
||||||
.width('100%') // 确保文本容器宽度
|
.width('100%').height('100%')
|
||||||
}
|
}
|
||||||
.height(20)
|
.height(20)
|
||||||
.width('48%')
|
.width('48%')
|
||||||
.padding(5)
|
// .padding(5)
|
||||||
.borderRadius(10)
|
.borderRadius(5)
|
||||||
.borderWidth(1)
|
.borderWidth(1)
|
||||||
.borderColor(Color.Red)
|
.borderColor('#DA57E5')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
.columnsGap(10)
|
.columnsGap(10)
|
||||||
@ -76,15 +76,14 @@ export struct HeroPopWindow {
|
|||||||
.padding(10)
|
.padding(10)
|
||||||
.width('100%')
|
.width('100%')
|
||||||
.height('auto')
|
.height('auto')
|
||||||
Text('感谢有您,一路相伴。"肝胆英雄榜"是由国内最具影响力的肝胆病互联网线上服务平台-\n' +
|
|
||||||
'肝胆相照依据肝胆病医生在各自领域年度所做工作,综合评选出来的最认可的"肝胆好医生",授予证书并赠送精美感恩好礼。\n' +
|
Text(this.detailsData['note'])
|
||||||
'目前"肝胆英雄榜"荣誉包括:"护肝大使"护肝新量""公益之星""科普达入"、"视频之星"、"人气科室"及"宣传之星"等。')
|
.fontSize(14)
|
||||||
.fontSize(12)
|
.fontColor('#333333')
|
||||||
.fontColor('#666666')
|
|
||||||
.textAlign(TextAlign.Start)
|
.textAlign(TextAlign.Start)
|
||||||
.lineHeight(20)
|
.lineHeight(20)
|
||||||
.width('90%')
|
.width('90%')
|
||||||
.margin({bottom:10})
|
.margin({top:5,bottom:10})
|
||||||
}
|
}
|
||||||
.zIndex(1)
|
.zIndex(1)
|
||||||
.margin({top:-10,bottom:10})
|
.margin({top:-10,bottom:10})
|
||||||
@ -94,15 +93,12 @@ export struct HeroPopWindow {
|
|||||||
.height('auto')
|
.height('auto')
|
||||||
.width('90%')
|
.width('90%')
|
||||||
|
|
||||||
//删除按钮
|
Image($r('app.media.heropop_delete'))
|
||||||
Button() {
|
.width(30)
|
||||||
Image($r('app.media.heropop_delete'))
|
.height(30)
|
||||||
.width(30)
|
.zIndex(3)
|
||||||
.height(30)
|
.position({ x: '88%', y: 10 })
|
||||||
}
|
.onClick(() => this.controller.close())
|
||||||
.zIndex(3)
|
|
||||||
.position({ x: '88%', y: 10 })
|
|
||||||
.onClick(() => this.controller.close())
|
|
||||||
}
|
}
|
||||||
.width('90%')
|
.width('90%')
|
||||||
.backgroundImage($r('app.media.heroPop_bg'))
|
.backgroundImage($r('app.media.heroPop_bg'))
|
||||||
|
|||||||
@ -38,7 +38,10 @@ export class BasicConstant {
|
|||||||
static readonly videoByKeyWordsNew = BasicConstant.urlExpertApp + "videoByKeyWordsNew";
|
static readonly videoByKeyWordsNew = BasicConstant.urlExpertApp + "videoByKeyWordsNew";
|
||||||
static readonly tagList = BasicConstant.urlExpertApp + "tagList";
|
static readonly tagList = BasicConstant.urlExpertApp + "tagList";
|
||||||
static readonly meetingListBySearch = BasicConstant.urlExpertAPI + "meetingListBySearch";
|
static readonly meetingListBySearch = BasicConstant.urlExpertAPI + "meetingListBySearch";
|
||||||
static readonly videoBySearchNew = BasicConstant.urlExpertApp+'videoBySearchNew'//搜索肝胆视频列表
|
static readonly videoBySearchNew = BasicConstant.urlExpertApp+'videoBySearchNew';//搜索肝胆视频列表
|
||||||
|
static readonly myData = BasicConstant.urlExpertAPI+'my';
|
||||||
|
static readonly gethonorDetail = BasicConstant.urlExpertAPI+'gethonorDetail';
|
||||||
|
static readonly updatePwd = BasicConstant.urlExpertAPI+'updatePwd'
|
||||||
|
|
||||||
static readonly province=['全国','北京市','天津市','河北省','山西省'
|
static readonly province=['全国','北京市','天津市','河北省','山西省'
|
||||||
,'内蒙古自治区','辽宁省','吉林省','黑龙江省','上海市','江苏省','浙江省'
|
,'内蒙古自治区','辽宁省','吉林省','黑龙江省','上海市','江苏省','浙江省'
|
||||||
|
|||||||
@ -58,6 +58,10 @@ export class ChangeUtil {
|
|||||||
return reg2.test(password);
|
return reg2.test(password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static isEmail(email:string): boolean {
|
||||||
|
const reg2: RegExp = new RegExp('^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$')
|
||||||
|
return reg2.test(email);
|
||||||
|
}
|
||||||
|
|
||||||
static async convertUriToBase64(uri: string): Promise<string> {
|
static async convertUriToBase64(uri: string): Promise<string> {
|
||||||
// 打开文件并读取数据
|
// 打开文件并读取数据
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { hdHttp, HdResponse, BasicConstant, ExpertData, authStore } from '@itcast/basic'
|
import { hdHttp, HdResponse, BasicConstant, ExpertData, authStore, ChangeUtil } from '@itcast/basic'
|
||||||
import { BusinessError } from '@kit.BasicServicesKit';
|
import { BusinessError } from '@kit.BasicServicesKit';
|
||||||
import promptAction from '@ohos.promptAction';
|
import promptAction from '@ohos.promptAction';
|
||||||
import HashMap from '@ohos.util.HashMap';
|
import HashMap from '@ohos.util.HashMap';
|
||||||
@ -106,24 +106,23 @@ export struct ChangePasswordComp {
|
|||||||
.borderWidth(1)
|
.borderWidth(1)
|
||||||
.fontColor($r('app.color.main_color'))
|
.fontColor($r('app.color.main_color'))
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
const passwordRegex = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/
|
if (!this.oldPassword) {
|
||||||
if (this.oldPassword.length <= 0 || !this.oldPassword) {
|
|
||||||
promptAction.showToast({message:'请输入原密码'})
|
promptAction.showToast({message:'请输入原密码'})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!passwordRegex.test(this.oldPassword)) {
|
if (!ChangeUtil.isPassword(this.oldPassword)) {
|
||||||
promptAction.showToast({message:'原密码格式错误'})
|
promptAction.showToast({message:'原密码格式错误'})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (this.newPassword.length <= 0 || !this.newPassword) {
|
if (!this.newPassword) {
|
||||||
promptAction.showToast({message:'请输入原密码'})
|
promptAction.showToast({message:'请输入原密码'})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!passwordRegex.test(this.newPassword)) {
|
if (!ChangeUtil.isPassword(this.newPassword)) {
|
||||||
promptAction.showToast({message:'新密码格式错误'})
|
promptAction.showToast({message:'新密码格式错误'})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (this.confirmPassword.length <= 0 || !this.confirmPassword) {
|
if (!this.confirmPassword) {
|
||||||
promptAction.showToast({message:'请确认新密码'})
|
promptAction.showToast({message:'请确认新密码'})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -131,7 +130,7 @@ export struct ChangePasswordComp {
|
|||||||
promptAction.showToast({message:'新密码与确认密码不一致'})
|
promptAction.showToast({message:'新密码与确认密码不一致'})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!passwordRegex.test(this.confirmPassword)) {
|
if (!ChangeUtil.isPassword(this.confirmPassword)) {
|
||||||
promptAction.showToast({message:'密码格式不正确,请重新输入!'})
|
promptAction.showToast({message:'密码格式不正确,请重新输入!'})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { hdHttp, HdResponse, BasicConstant, ExpertData, authStore } from '@itcast/basic'
|
import { hdHttp, HdResponse, BasicConstant, ExpertData, authStore, ChangeUtil } from '@itcast/basic'
|
||||||
import { BusinessError } from '@kit.BasicServicesKit';
|
import { BusinessError } from '@kit.BasicServicesKit';
|
||||||
import promptAction from '@ohos.promptAction';
|
import promptAction from '@ohos.promptAction';
|
||||||
import HashMap from '@ohos.util.HashMap';
|
import HashMap from '@ohos.util.HashMap';
|
||||||
@ -130,7 +130,7 @@ export struct ChangePhoneComp {
|
|||||||
promptAction.showToast({message:'请输入手机号'})
|
promptAction.showToast({message:'请输入手机号'})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!EMAIL_REGEX.test(this.phoneNumber)) {
|
if (!ChangeUtil.isMobileNum(this.phoneNumber)) {
|
||||||
promptAction.showToast({message:'请输入正确的手机号'})
|
promptAction.showToast({message:'请输入正确的手机号'})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -154,12 +154,12 @@ export struct ChangePhoneComp {
|
|||||||
.fontSize(18)
|
.fontSize(18)
|
||||||
.position({x:'5%',y:'80%'})
|
.position({x:'5%',y:'80%'})
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
if (this.phoneNumber.length < 11 || !this.phoneNumber) {
|
if (!this.phoneNumber) {
|
||||||
promptAction.showToast({message:'请输入手机号'})
|
promptAction.showToast({message:'请输入手机号'})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!EMAIL_REGEX.test(this.phoneNumber)) {
|
if (!ChangeUtil.isMobileNum(this.phoneNumber)) {
|
||||||
promptAction.showToast({message:'请输入正确的手机号'})
|
promptAction.showToast({message:'手机号格式错误,请重新输入'})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!this.smsCode) {
|
if (!this.smsCode) {
|
||||||
@ -174,6 +174,3 @@ export struct ChangePhoneComp {
|
|||||||
.backgroundColor('#FFFFFF')
|
.backgroundColor('#FFFFFF')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 手机正则表达式
|
|
||||||
const EMAIL_REGEX = /^1[3-9][0-9]{9}$/
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { hdHttp, HdResponse, BasicConstant, ExpertData, authStore } from '@itcast/basic'
|
import { hdHttp, HdResponse, BasicConstant, ExpertData, authStore, ChangeUtil } from '@itcast/basic'
|
||||||
import { BusinessError } from '@kit.BasicServicesKit';
|
import { BusinessError } from '@kit.BasicServicesKit';
|
||||||
import promptAction from '@ohos.promptAction';
|
import promptAction from '@ohos.promptAction';
|
||||||
import { router } from '@kit.ArkUI';
|
import { router } from '@kit.ArkUI';
|
||||||
@ -66,10 +66,6 @@ export struct ChooseEmailComp {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private validateEmailFormat(email: string): boolean {
|
|
||||||
return EMAIL_REGEX.test(email.trim())
|
|
||||||
}
|
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
Column() {
|
Column() {
|
||||||
// 手机号输入框
|
// 手机号输入框
|
||||||
@ -114,10 +110,10 @@ export struct ChooseEmailComp {
|
|||||||
.fontSize(18)
|
.fontSize(18)
|
||||||
.position({x:'5%',y:'80%'})
|
.position({x:'5%',y:'80%'})
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
// if (this.validateEmailFormat(this.emailString)) {
|
if (!ChangeUtil.isEmail(this.emailString)) {
|
||||||
// promptAction.showToast({message:'请输入正确的邮箱格式'})
|
promptAction.showToast({message:'请输入正确的邮箱格式'})
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
this.commitEmailData(this.emailString);
|
this.commitEmailData(this.emailString);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -126,6 +122,3 @@ export struct ChooseEmailComp {
|
|||||||
.backgroundColor('#FFFFFF')
|
.backgroundColor('#FFFFFF')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 邮箱正则表达式
|
|
||||||
const EMAIL_REGEX = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
||||||
|
|||||||
@ -1,5 +1,21 @@
|
|||||||
import promptAction from '@ohos.promptAction';
|
|
||||||
import { router } from '@kit.ArkUI';
|
import { router } from '@kit.ArkUI';
|
||||||
|
import HashMap from '@ohos.util.HashMap';
|
||||||
|
import { hdHttp, HdResponse, BasicConstant, ChangeUtil, authStore } from '@itcast/basic'
|
||||||
|
import { BusinessError } from '@kit.BasicServicesKit';
|
||||||
|
import promptAction from '@ohos.promptAction';
|
||||||
|
|
||||||
|
interface callBackData {
|
||||||
|
code: number,
|
||||||
|
message:string,
|
||||||
|
msg:string,
|
||||||
|
data: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface updateExtraData {
|
||||||
|
mobile: string,
|
||||||
|
password: string,
|
||||||
|
sms: string
|
||||||
|
}
|
||||||
|
|
||||||
@Preview
|
@Preview
|
||||||
@Component
|
@Component
|
||||||
@ -12,7 +28,44 @@ export struct ForgetPasswordComp {
|
|||||||
@State passWordSrc1: Resource = $r('app.media.icon_forgetpassword_show');
|
@State passWordSrc1: Resource = $r('app.media.icon_forgetpassword_show');
|
||||||
@State passWordSrc2: Resource = $r('app.media.icon_forgetpassword');
|
@State passWordSrc2: Resource = $r('app.media.icon_forgetpassword');
|
||||||
|
|
||||||
// 验证码倒计时
|
submitData() {
|
||||||
|
if (!this.phoneNumber) {
|
||||||
|
promptAction.showToast({message:'请输入手机号'})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!ChangeUtil.isMobileNum(this.phoneNumber)) {
|
||||||
|
promptAction.showToast({message:'手机号格式错误,请重新输入'})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.smsCode) {
|
||||||
|
promptAction.showToast({message:'请输入验证码'})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.password) {
|
||||||
|
promptAction.showToast({message:'请输入密码'})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!ChangeUtil.isPassword(this.password)) {
|
||||||
|
promptAction.showToast({message:'密码格式错误,请重新输入'})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const hashMap: HashMap<string, string> = new HashMap();
|
||||||
|
hashMap.set('mobile',this.phoneNumber)
|
||||||
|
hashMap.set('password',this.password)
|
||||||
|
hashMap.set('sms',this.smsCode)
|
||||||
|
hdHttp.httpReq<string>(BasicConstant.updatePwd, hashMap).then(async (res: HdResponse<string>) => {
|
||||||
|
let json:callBackData = JSON.parse(res+'') as callBackData;
|
||||||
|
console.log('忘记密码 修改数据成功:',json);
|
||||||
|
promptAction.showToast({message:json.message});
|
||||||
|
if (json.code === 200) {
|
||||||
|
router.back();
|
||||||
|
}
|
||||||
|
}).catch((err: BusinessError) => {
|
||||||
|
console.error(`忘记密码 修改数据 fail: ${err}`);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
private startCountdown() {
|
private startCountdown() {
|
||||||
this.countdown = 60
|
this.countdown = 60
|
||||||
const timer = setInterval(() => {
|
const timer = setInterval(() => {
|
||||||
@ -32,7 +85,6 @@ export struct ForgetPasswordComp {
|
|||||||
.height(18)
|
.height(18)
|
||||||
.objectFit(ImageFit.Contain)
|
.objectFit(ImageFit.Contain)
|
||||||
.margin({left:10})
|
.margin({left:10})
|
||||||
// 手机号输入框
|
|
||||||
TextInput({ placeholder: '请输入手机号码' })
|
TextInput({ placeholder: '请输入手机号码' })
|
||||||
.fontSize(16)
|
.fontSize(16)
|
||||||
.backgroundColor(Color.White)
|
.backgroundColor(Color.White)
|
||||||
@ -47,7 +99,6 @@ export struct ForgetPasswordComp {
|
|||||||
.borderWidth(1)
|
.borderWidth(1)
|
||||||
.borderColor('#CCCCCC')
|
.borderColor('#CCCCCC')
|
||||||
|
|
||||||
// 验证码输入区域
|
|
||||||
Row() {
|
Row() {
|
||||||
Row() {
|
Row() {
|
||||||
Image($r('app.media.icon_verification_code'))
|
Image($r('app.media.icon_verification_code'))
|
||||||
@ -58,6 +109,9 @@ export struct ForgetPasswordComp {
|
|||||||
TextInput({ placeholder: '请输入验证码' })
|
TextInput({ placeholder: '请输入验证码' })
|
||||||
.fontSize(16)
|
.fontSize(16)
|
||||||
.backgroundColor(Color.White)
|
.backgroundColor(Color.White)
|
||||||
|
.onChange((value:string)=>{
|
||||||
|
this.smsCode = value;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
.margin({ top: 10 })
|
.margin({ top: 10 })
|
||||||
.width('60%')
|
.width('60%')
|
||||||
@ -80,10 +134,10 @@ export struct ForgetPasswordComp {
|
|||||||
.margin({ top: 10 })
|
.margin({ top: 10 })
|
||||||
.enabled(this.countdown === 0)
|
.enabled(this.countdown === 0)
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
if (this.phoneNumber.length >= 11) {
|
if (ChangeUtil.isMobileNum(this.phoneNumber)) {
|
||||||
this.startCountdown()
|
this.startCountdown()
|
||||||
} else {
|
} else {
|
||||||
promptAction.showToast({message:'请输入手机号'})
|
promptAction.showToast({message:'手机号格式错误,请重新输入'})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -91,18 +145,26 @@ export struct ForgetPasswordComp {
|
|||||||
.justifyContent(FlexAlign.SpaceBetween)
|
.justifyContent(FlexAlign.SpaceBetween)
|
||||||
|
|
||||||
Row() {
|
Row() {
|
||||||
Image($r('app.media.icon_forgetpassword_show'))
|
Image($r('app.media.login_password'))
|
||||||
.width(18)
|
.width(18)
|
||||||
.height(18)
|
.height(18)
|
||||||
.objectFit(ImageFit.Contain)
|
.objectFit(ImageFit.Contain)
|
||||||
.margin({left:10})
|
.margin({left:10})
|
||||||
// 密码输入框
|
|
||||||
TextInput({ placeholder: '6~16位数字字母组合' })
|
TextInput({ placeholder: '6~16位数字字母组合' })
|
||||||
.fontSize(16)
|
.fontSize(16)
|
||||||
.width('95%')
|
.width('83%')
|
||||||
.backgroundColor(Color.White)
|
.backgroundColor(Color.White)
|
||||||
.type(this.showPassword ? InputType.Normal : InputType.Password)
|
.showPasswordIcon(false)
|
||||||
.passwordIcon({ onIconSrc: this.passWordSrc1, offIconSrc: this.passWordSrc2 })
|
.type(this.showPassword?InputType.Normal:InputType.Password)
|
||||||
|
.onChange((value:string)=>{
|
||||||
|
this.password = value;
|
||||||
|
})
|
||||||
|
Image(this.showPassword?this.passWordSrc1:this.passWordSrc2)
|
||||||
|
.width(20)
|
||||||
|
.height(15)
|
||||||
|
.onClick(()=>{
|
||||||
|
this.showPassword = !this.showPassword;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
.margin({ top: 10 })
|
.margin({ top: 10 })
|
||||||
.width('95%')
|
.width('95%')
|
||||||
@ -111,7 +173,6 @@ export struct ForgetPasswordComp {
|
|||||||
.borderWidth(1)
|
.borderWidth(1)
|
||||||
.borderColor('#CCCCCC')
|
.borderColor('#CCCCCC')
|
||||||
|
|
||||||
// 登录按钮
|
|
||||||
Button({type:ButtonType.Normal}){
|
Button({type:ButtonType.Normal}){
|
||||||
Text('登 录')
|
Text('登 录')
|
||||||
}
|
}
|
||||||
@ -123,23 +184,7 @@ export struct ForgetPasswordComp {
|
|||||||
.fontColor('#FFFFFF')
|
.fontColor('#FFFFFF')
|
||||||
.fontSize(18)
|
.fontSize(18)
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
// 处理登录逻辑
|
this.submitData();
|
||||||
if (!/^1[3-9]\d{9}$/.test(this.phoneNumber)) {
|
|
||||||
promptAction.showToast({message:'请输入有效手机号'})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.smsCode) {
|
|
||||||
promptAction.showToast({message:'请输入验证码'})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!/^(?=.*[a-zA-Z])(?=.*\d)[\w]{6,16}$/.test(this.password)) {
|
|
||||||
promptAction.showToast({message:'密码格式不正确'})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 执行登录操作...
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
.width('100%')
|
.width('100%')
|
||||||
|
|||||||
@ -16,10 +16,15 @@ export struct FourSection {
|
|||||||
@State refreshFlag: boolean = false;
|
@State refreshFlag: boolean = false;
|
||||||
|
|
||||||
@State fourSectionList:Array<MyPageSectionClass> = [
|
@State fourSectionList:Array<MyPageSectionClass> = [
|
||||||
new MyPageSectionClass('oneItem',$r('app.media.app_icon'),'微信绑定',''),
|
// new MyPageSectionClass('oneItem',$r('app.media.app_icon'),'微信绑定',''),
|
||||||
new MyPageSectionClass('twoItem',$r('app.media.my_page_choosePhone'),'更换手机号','pages/MinePage/ChangePhonePage'),
|
// new MyPageSectionClass('twoItem',$r('app.media.my_page_choosePhone'),'更换手机号','pages/MinePage/ChangePhonePage'),
|
||||||
new MyPageSectionClass('threeItem',this.pushIconPath,this.pushStatus,''),
|
// new MyPageSectionClass('threeItem',this.pushIconPath,this.pushStatus,''),
|
||||||
new MyPageSectionClass('fourItem',$r('app.media.my_page_version'),'发现新版本','')
|
// new MyPageSectionClass('fourItem',$r('app.media.my_page_version'),'发现新版本','')
|
||||||
|
|
||||||
|
new MyPageSectionClass('oneItem',$r('app.media.my_page_choosePhone'),'更换手机号','pages/MinePage/ChangePhonePage'),
|
||||||
|
new MyPageSectionClass('twoItem',this.pushIconPath,this.pushStatus,''),
|
||||||
|
new MyPageSectionClass('threeItem',$r('app.media.app_icon'),'关于','pages/WebView/WebPage'),
|
||||||
|
new MyPageSectionClass('fourItem',$r('app.media.app_icon'),'直播群','pages/WebView/WebPage')
|
||||||
];
|
];
|
||||||
|
|
||||||
aboutToAppear() {
|
aboutToAppear() {
|
||||||
@ -54,7 +59,7 @@ export struct FourSection {
|
|||||||
this.pushIconPath = this.pushStatus == '通知已开'?$r('app.media.my_page_message_on'):$r('app.media.my_home_push_down');
|
this.pushIconPath = this.pushStatus == '通知已开'?$r('app.media.my_page_message_on'):$r('app.media.my_home_push_down');
|
||||||
// 更新数组中的标题
|
// 更新数组中的标题
|
||||||
this.fourSectionList = this.fourSectionList.map((item, index) => {
|
this.fourSectionList = this.fourSectionList.map((item, index) => {
|
||||||
if (index === 2) {
|
if (index === 1) {
|
||||||
return new MyPageSectionClass(item.id, this.pushIconPath, this.pushStatus, item.path);
|
return new MyPageSectionClass(item.id, this.pushIconPath, this.pushStatus, item.path);
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
@ -102,6 +107,16 @@ export struct FourSection {
|
|||||||
.onClick(()=>{
|
.onClick(()=>{
|
||||||
if (item.title.includes('通知')) {
|
if (item.title.includes('通知')) {
|
||||||
this.handleNotificationClick();
|
this.handleNotificationClick();
|
||||||
|
} else if (item.title.includes('关于')) {
|
||||||
|
router.pushUrl({
|
||||||
|
url:item.path,
|
||||||
|
params: { url: 'http://doc.igandan.com/app/html/about/2017/about2.html' ,title:'关于肝胆相照'}
|
||||||
|
})
|
||||||
|
} else if (item.title.includes('直播群')) {
|
||||||
|
router.pushUrl({
|
||||||
|
url: 'pages/WebView/WebPage',
|
||||||
|
params: { url: 'http://wx.igandan.com/qun/gdxzqun' ,title:'肝胆相照直播群'}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
router.pushUrl({
|
router.pushUrl({
|
||||||
url:item.path
|
url:item.path
|
||||||
|
|||||||
@ -15,6 +15,13 @@ interface callBackData {
|
|||||||
specialy:[]
|
specialy:[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface callMyBackData {
|
||||||
|
expert:ExpertData,
|
||||||
|
code:number,
|
||||||
|
message:string,
|
||||||
|
specialy:[]
|
||||||
|
}
|
||||||
|
|
||||||
interface heroFirst {
|
interface heroFirst {
|
||||||
id: string;
|
id: string;
|
||||||
nick_name: string;
|
nick_name: string;
|
||||||
@ -28,12 +35,12 @@ export struct HeaderView {
|
|||||||
@State name:string = authStore.getUser().realName;
|
@State name:string = authStore.getUser().realName;
|
||||||
@State myPageData:object = new Object;
|
@State myPageData:object = new Object;
|
||||||
@State heroArray:Array<object> = [];
|
@State heroArray:Array<object> = [];
|
||||||
|
@State clickHeroId:string = '';
|
||||||
|
|
||||||
private scrollerForList: Scroller = new Scroller()
|
private scrollerForList: Scroller = new Scroller()
|
||||||
private heroList: string[] = ['2020年英雄榜','2021年英雄榜','2022年英雄榜','2023年英雄榜','2024年英雄榜']
|
|
||||||
|
|
||||||
dialogController: CustomDialogController = new CustomDialogController({
|
dialogController: CustomDialogController = new CustomDialogController({
|
||||||
builder: HeroPopWindow(),
|
builder: HeroPopWindow({heroId:this.clickHeroId}),
|
||||||
alignment: DialogAlignment.Center,
|
alignment: DialogAlignment.Center,
|
||||||
customStyle: true
|
customStyle: true
|
||||||
})
|
})
|
||||||
@ -64,21 +71,21 @@ export struct HeaderView {
|
|||||||
|
|
||||||
uploadBackImgAction() {
|
uploadBackImgAction() {
|
||||||
const hashMap: HashMap<string, string> = new HashMap();
|
const hashMap: HashMap<string, string> = new HashMap();
|
||||||
const userDataUrl:string = BasicConstant.urlExpertAPI+'my';
|
hdHttp.httpReq<string>(BasicConstant.myData,hashMap).then(async (res: HdResponse<string>) => {
|
||||||
hdHttp.httpReq<string>(userDataUrl,hashMap).then(async (res: HdResponse<string>) => {
|
|
||||||
console.info(`我的背景图: ${res}`);
|
console.info(`我的背景图: ${res}`);
|
||||||
let json:RequestDefaultModel = JSON.parse(res+'') as RequestDefaultModel;
|
let json:RequestDefaultModel = JSON.parse(res+'') as RequestDefaultModel;
|
||||||
if(json.code == '200') {
|
if(json.code == '200') {
|
||||||
|
this.heroArray = json.data["honor_list"];
|
||||||
this.myPageData = json.data;
|
this.myPageData = json.data;
|
||||||
// 获取ranking值(带安全类型转换)
|
// 获取ranking值(带安全类型转换)
|
||||||
const ranking: string = this.myPageData["ranking"]?.toString() ?? "";
|
const ranking: string = this.myPageData["ranking"]?.toString() ?? "";
|
||||||
if (Number(ranking) > 0) {
|
if (Number(ranking) > 0) {
|
||||||
// 创建排名对象[4](@ref)
|
// 创建排名对象
|
||||||
const rankDic: heroFirst = {
|
const rankDic: heroFirst = {
|
||||||
"id": "ranking",
|
"id": "ranking",
|
||||||
"nick_name": `随访达人 I 排名${ranking}`
|
"nick_name": `随访达人 I 排名${ranking}`
|
||||||
};
|
};
|
||||||
// 插入数组首位[9](@ref)
|
// 插入数组首位
|
||||||
this.heroArray.unshift(rankDic);
|
this.heroArray.unshift(rankDic);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -103,7 +110,7 @@ export struct HeaderView {
|
|||||||
.width(60)
|
.width(60)
|
||||||
.height(60)
|
.height(60)
|
||||||
.borderRadius(5)
|
.borderRadius(5)
|
||||||
.objectFit(ImageFit.Fill)
|
.objectFit(ImageFit.Cover)
|
||||||
.onClick(()=>this.handleAvatarClick())
|
.onClick(()=>this.handleAvatarClick())
|
||||||
Column({space:5}) {
|
Column({space:5}) {
|
||||||
Text(this.name)
|
Text(this.name)
|
||||||
@ -111,14 +118,14 @@ export struct HeaderView {
|
|||||||
.fontColor('#FFFFFF')
|
.fontColor('#FFFFFF')
|
||||||
.onClick(()=>this.handleAvatarClick())
|
.onClick(()=>this.handleAvatarClick())
|
||||||
List({space:5,initialIndex:this.heroIndex,scroller:this.scrollerForList}) {
|
List({space:5,initialIndex:this.heroIndex,scroller:this.scrollerForList}) {
|
||||||
ForEach(this.heroArray, (item: object,index:number) => {
|
ForEach(this.heroArray, (item: heroFirst) => {
|
||||||
ListItem() {
|
ListItem() {
|
||||||
Row() {
|
Row() {
|
||||||
Image($r('app.media.my_home_hero_ranking'))
|
Image(item.id === 'ranking'?$r('app.media.my_home_hero_ranking'):$r('app.media.my_page_header_hertIcon'))
|
||||||
.width(13)
|
.width(13)
|
||||||
.height(13)
|
.height(13)
|
||||||
.margin({left:7})
|
.margin({left:7})
|
||||||
Text(item["nick_name"])
|
Text(item.nick_name)
|
||||||
.fontColor(Color.White)
|
.fontColor(Color.White)
|
||||||
.fontSize(11)
|
.fontSize(11)
|
||||||
.margin({left:4,right:10})
|
.margin({left:4,right:10})
|
||||||
@ -128,14 +135,11 @@ export struct HeaderView {
|
|||||||
.borderRadius(9)
|
.borderRadius(9)
|
||||||
.borderWidth(1)
|
.borderWidth(1)
|
||||||
.borderColor(Color.White)
|
.borderColor(Color.White)
|
||||||
.onClick(() => {
|
|
||||||
console.log('Show HeroPopWindow');
|
|
||||||
})
|
|
||||||
.onClick(()=>{
|
.onClick(()=>{
|
||||||
this.dialogController.open();
|
if (item.id !== 'ranking') {
|
||||||
// if (!this.heroArray[index] as heroFirst == 'ranking') {
|
this.clickHeroId = item.id;
|
||||||
// this.dialogController.open(heroId:this.heroArray[index]['id'] as string);
|
this.dialogController.open();
|
||||||
// }
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
BIN
features/mypage/src/main/resources/base/media/login_password.png
Normal file
BIN
features/mypage/src/main/resources/base/media/login_password.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Loading…
x
Reference in New Issue
Block a user