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

网站免备案空间免费优化网站排名

网站免备案空间,免费优化网站排名,上传自己做的网站吗,2345网址导航智能主版开发准备 上一节我们实现了回收金提现记录的展示功能,我们回收金相关的内容更加的丰富了,在之前的业务逻辑中我们添加了一个设置安全锁的功能,虽然我们成功设置了安全锁,也把对应的表信息提交到云端,但是我们并没有在…

开发准备

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

功能分析

首先我们在进入提现页面的时候要先查询当前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.khdw.cn/news/2254.html

相关文章:

  • 一个专门做预告片的网站百度推广业务员
  • 网络课程网站模板梅花seo 快速排名软件
  • 购彩网站建设做小程序公司哪家好
  • 自助网站建设工具收录好的网站
  • 网站开发公司架构如何给网站做推广
  • 外国炫酷网站网址自媒体平台注册
  • vue做网站前台南昌seo排名外包
  • 做海报素材的网站嘉兴seo外包公司费用
  • 如何做网站相册北京seo排名技术
  • wordperss网站做负载均衡无代码系统搭建平台
  • 长沙手机app网站开发百度关键词指数
  • 微信官网网站模板seo优化论坛
  • 寮步网站建设公司最新域名查询ip
  • idc空间商网站源码产品推广ppt范例
  • 定制网站开发平台网站推广线上推广
  • 软件网站关键词优化南宁最新消息今天
  • 郑州seo网站有优化宁波seo怎么推广
  • wordpress情侣模板下载sem对seo的影响有哪些
  • 网站建设委托建设合同百度搜索指数在线查询
  • 自助小站小红书推广方式
  • 餐饮企业网站建设方案书关键词优化公司靠谱推荐
  • 本溪建网站北京百度seo排名
  • 郑州网站推广营销品牌网站建设解决方案
  • 怎么做公司宣传网站上海百度公司总部
  • 合肥比较好的网站建设公司百度热门
  • 泰安钢管网站建设关键词推广技巧
  • 减压轻松网站开发广州头条新闻最新
  • 网站支付页面设计seo优化技术排名
  • 做网站放广告实时热搜
  • 营销型网站头部布局的元素自己怎么免费做网站网页