当前位置: 首页 > news >正文

网站免费高清素材软件小游戏公司网站怎么优化

网站免费高清素材软件小游戏,公司网站怎么优化,企业网站建设研究目的意义,衣服网站建设方案开发准备 上一节我们实现了回收金提现记录的展示功能,我们回收金相关的内容更加的丰富了,在之前的业务逻辑中我们添加了一个设置安全锁的功能,虽然我们成功设置了安全锁,也把对应的表信息提交到云端,但是我们并没有在…

开发准备

上一节我们实现了回收金提现记录的展示功能,我们回收金相关的内容更加的丰富了,在之前的业务逻辑中我们添加了一个设置安全锁的功能,虽然我们成功设置了安全锁,也把对应的表信息提交到云端,但是我们并没有在提现的流程中去使用安全锁相关的内容,这一节我们就把安全锁相关的内容跟提现流程关联起来,让我们的功能安全性更高

功能分析

首先我们在进入提现页面的时候要先查询当前userid下的安全锁表有没有数据,有数据我们就拿当前安全锁开启的状态,如果是开启的,那我们就在用户点击提现按钮的时候进行一个弹窗校验,根据用户在弹窗里绘制的值跟我们设置的安全锁的值进行匹配,如果匹配成功,就执行内容的添加操作,如果不成功,提醒用户,安全锁验证失败

代码实现

首先我们在提现页面先查询对应的表内容

let databaseZone = cloudDatabase.zone('default');
let condition3 = new cloudDatabase.DatabaseQuery(verify_info);condition.equalTo("user_id", this.user?.user_id)let listData3 = await databaseZone.query(condition3);let json3 = JSON.stringify(listData3)let data3: VerifyInfo[] = JSON.parse(json3)this.verifyInfo=data3

然后我们进行数据源的非空判断,安全锁开关判断

 if (this.verifyInfo.length>0) {if (this.verifyInfo[0].open_lock) {}}

都没问题之后我们需要有一个校验的弹窗

import showToast from '../utils/ToastUtils';@Preview
@CustomDialog
export struct WithdrawalLockDialog {@State passwords: Number[]=[];public callback:(passwords:string)=>void=():void=>{}private patternLockController: PatternLockController = new PatternLockController();controller: CustomDialogController;build() {Column({space:10}) {Text("请验证您的安全密码!").fontColor(Color.White).fontWeight(FontWeight.Bold).fontSize(16).width('100%').textAlign(TextAlign.Center).padding(10)PatternLock(this.patternLockController).sideLength(300).circleRadius(9).pathStrokeWidth(5).borderRadius(10).activeColor('#707070').selectedColor('#707070').pathColor('#707070').backgroundColor('#F5F5F5').autoReset(true).onDotConnect((index: number) => {console.log("onDotConnect index: " + index);}).onPatternComplete((input: Array<number>) => {if (input.length < 5) {showToast("图案连接数不能小于5")return;}const str: string = JSON.stringify(input);this.callback(str)this.controller.close()})}.width('100%').height(400)}
}

这里我们把弹窗中输入的值通过回调传递出去,在提现页面引用弹窗

private dialogController: CustomDialogController = new CustomDialogController({builder: WithdrawalLockDialog({callback: async (str:string)=>{}}),alignment: DialogAlignment.Bottom,customStyle:false});

然后我们把输入的值跟表中存储的值进行校验,验证成功后提交对应的记录

 if (str==this.verifyInfo[0].lock_str) {showToast("校验成功")let record=new withdrawal_record()record.id=Math.floor(Math.random() * 1000000)record.user_id=this.user!.user_idrecord.bank_name=this.bankList[0].bank_namerecord.bank_num=this.bankList[0].bank_cardrecord.creat_time=this.year+"-"+this.month+"-"+this.day+" "+this.timerecord.type_str='0'record.money=this.moneyNumlet status =  await databaseZone.upsert(record);let money=new money_info()money.id=Math.floor(Math.random() * 1000000)money.user_id=this.user!.user_idmoney.money=String(this.moneyNum)money.all_money=''money.money_type='1'money.address='银行卡提现'money.year=this.yearmoney.month=this.monthmoney.day=this.daymoney.time=this.timemoney.create_time=this.year+"-"+this.month+"-"+this.day+" "+this.timelet nums =  await databaseZone.upsert(money);let userData=new user_info()userData.id=this.userInfo!.iduserData.user_id=this.userInfo!.user_iduserData.sex=this.userInfo!.sexuserData.bind_phone=this.userInfo!.bind_phoneuserData.create_time=this.userInfo!.create_timeuserData.nickname=this.userInfo!.nicknameuserData.head_img=this.userInfo!.head_imgif (this.userInfo?.money!=null) {userData.money=this.userInfo!.money-this.moneyNum}else {userData.money=0}if (this.userInfo?.points!=null) {userData.points=this.userInfo!.points}else {userData.points=0}let s= await databaseZone.upsert(userData);if (s>0) {router.pushUrl({url:'pages/recycle/money/SuccessPage'})}this.dialogController.close()}else {showToast("安全锁验证失败!")}

我们执行代码查看一下开启安全锁后提现的效果
在这里插入图片描述

http://www.yayakq.cn/news/576727/

相关文章:

  • 国家城乡住房建设厅网站网站右侧广告
  • 辽宁沈阳网站建设自己做的网站上出现乱码怎么修改
  • php网站开发案例教程现在不流行做网站了么
  • 国内购物网站哪个最好网站优化月总结
  • 南昌网络营销网站网站建设帖子
  • 环保类网站模板免费下载WordPress博客页显示
  • 对网站设计的建议简单网站建设课程
  • wordpress建企业网站教程html表格编辑器
  • 淘客app网站是怎么做的文创产品设计方案范本
  • 价格对比网站开发做淘宝客网站能赚到钱吗
  • 电子商务网站的建设流程是怎样的深圳网站seo哪家快
  • 成都装修建材网站建设西安企业网站建设哪家好
  • 哪个网站做h5比较好sae wordpress 4.3
  • 住房和城乡建设部科技网站提供南昌网站建设公司
  • 做ppt好的网站有哪些内容永久免费进销存软件app
  • 高性能网站建设进阶...在线网页游戏传奇
  • 推广活动策划方案范文中山短视频seo教程
  • 成都网站建设推来客熊掌号网站小图标怎么制作
  • 滇中引水建设管理局网站自己做的网站可以开直播
  • 上海自助建站官网小说主题 wordpress
  • 北京网站设计定制开发建设公司网站设计时应考虑哪些因素
  • 建设网站时 首先要解决两个问题 一是什么企业建站程序哪个好
  • wordpress不能评论网站抓取优化
  • discuz 科技网站模板做网站公司会场主持台词
  • 公司网站不续费建设网站哪家公司好
  • 网站防御怎么做网站为契机建设校园数字化
  • 潍坊建设网站的公司电话网站功能项目报价
  • 帮别人做数学题赚钱的网站网页制作程序代码
  • 增城网站建设推广大型综合门户网站营销模式
  • ASP网站开发教程实验总结科技部政服务服平台