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

bootstrap响应式网站2021全国大学生营销大赛

bootstrap响应式网站,2021全国大学生营销大赛,做动态网站的软件有哪些,保定靠谱的网络公司开发准备 上一节我们实现了回收金提现的功能,并且成功展示了当前账户的支出列表,但是我们的提现相关的记录并没有很好的给用户做出展示,用户只知道当前账户提现扣款,并不知道回收金的去向,这一节我们就要实现回收金记…

开发准备

上一节我们实现了回收金提现的功能,并且成功展示了当前账户的支出列表,但是我们的提现相关的记录并没有很好的给用户做出展示,用户只知道当前账户提现扣款,并不知道回收金的去向,这一节我们就要实现回收金记录的查询添加、查询、展示

功能分析

要实现这些功能我们需要新建一张表,根据当前用户绑定的信息去填充对应的信息,把提现的银行卡,提现状态,提现时间,提现金额都先添加到表里,在用户进入提现记录页面之后,通过userid去查询当前用户的记录然后在列表里进行展示

代码实现

首先我们创建对应的提现记录表

{"objectTypeName": "withdrawal_record","fields": [{"fieldName": "id", "fieldType": "Integer", "notNull": true, "belongPrimaryKey": true},{"fieldName": "user_id", "fieldType": "Integer", "notNull": true, "defaultValue": 0},{"fieldName": "bank_name", "fieldType": "String"},{"fieldName": "bank_num", "fieldType": "String"},{"fieldName": "creat_time", "fieldType": "String"},{"fieldName": "type_str", "fieldType": "String"},{"fieldName": "money", "fieldType": "Double"}],"indexes": [{"indexName": "field1Index", "indexList": [{"fieldName":"id","sortType":"ASC"}]}],"permissions": [{"role": "World", "rights": ["Read", "Upsert", "Delete"]},{"role": "Authenticated", "rights": ["Read", "Upsert", "Delete"]},{"role": "Creator", "rights": ["Read", "Upsert", "Delete"]},{"role": "Administrator", "rights": ["Read", "Upsert", "Delete"]}]
}

我们生成对应的实体和db类之后,在提现成功的提交记录里,把我们表需要的信息添加进去

 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);

添加完成之后我们新建一个提现记录展示页面

@Entry
@Component
struct WithdrawalRecordPage {@State user: User|null=nullbuild() {Column() {CommonTopBar({ title: "提现记录", alpha: 0, titleAlignment: TextAlign.Center ,backButton:true})}.backgroundColor("#F1F3F5").height('100%').width('100%')}
}

首先进行数据的查询

 @State user: User|null=null@State withdrawalRecordList:WithdrawalRecord[]=[]async aboutToAppear(): Promise<void> {const value = await StorageUtils.getAll('user');if (value != "") {this.user = JSON.parse(value)}let databaseZone = cloudDatabase.zone('default');let condition = new cloudDatabase.DatabaseQuery(withdrawal_record);condition.equalTo("user_id", this.user?.user_id)let listData = await databaseZone.query(condition);let json = JSON.stringify(listData)let data: WithdrawalRecord[] = JSON.parse(json)if (data.length>0) {this.withdrawalRecordList=data}}

然后把我们查询到的数据展示到列表组件中

 List({space:10}){ForEach(this.withdrawalRecordList,(item:WithdrawalRecord,index:number)=>{ListItem(){Column({space:10}){Row(){Text(item.type_str=='0'?"提现成功":"提现中").fontColor(item.type_str=='0'?Color.Green:Color.Black).fontSize(16).fontWeight(FontWeight.Bold)Text("¥"+item.money+"").fontSize(16).fontWeight(FontWeight.Bold).fontColor(Color.Black)}.width('100%').justifyContent(FlexAlign.SpaceBetween)Row(){Text(item.bank_name+" ("+item.bank_num+")").fontColor(Color.Black).fontSize(14).fontWeight(FontWeight.Bold)Text(item.creat_time+"").fontSize(14).fontWeight(FontWeight.Bold).fontColor(Color.Grey)}.width('100%').justifyContent(FlexAlign.SpaceBetween)}.padding(10).width('100%').borderRadius(10).backgroundColor(Color.White)}})}.padding(10)

现在让我们运行代码查看效果
在这里插入图片描述

http://www.dtcms.com/wzjs/481804.html

相关文章:

  • 如何提升网站的权重个人如何做网络推广
  • 关于建设工程招标的网站流量平台有哪些
  • 代理分佣后台网站开发微信推广
  • 大家都在哪些网站做宣传站长之家权重
  • 一个网站如何产生流量网站优化网络推广seo
  • 工商网站官网查询网站建设技术托管
  • 广东网站设计工具站长工具是干嘛的
  • 怎么做百度联盟网站一键关键词优化
  • 河北提供网站制作公司哪家专业广告联盟推广
  • 个人做众筹网站合法吗网络营销比较好的企业
  • 公司网站后如何更新市场调研报告ppt模板
  • 沈阳网站建设报价抖音seo排名软件哪个好
  • 网站刷链接怎么做seo关键词首页排名代发
  • wordpress输出tags保定seo推广外包
  • 网站建设预付流程seo从0到1怎么做
  • 合肥设计网站济南网站推广
  • 广州b2b网站建设网络推广公司有哪些
  • 百度为何不收录你的网站产品页网站做优化
  • 北京市建筑工程装饰集团有限公司深圳网站seo地址
  • 门店到什么地步可以做网站班级优化大师免费下载学生版
  • 网站上传大文件百度关键词刷搜索量
  • 深达网站制作深圳公司最新网域查询入口
  • 青岛做网站公司排名广告营销推广方案
  • 沈阳微网站制作seo关键词有哪些类型
  • 网站建设吸引人的话语徐州seo代理计费
  • 河南汝州文明建设门户网站百度账号登录入口
  • 装饰行业做网站朋友圈广告
  • 做50个网站怎么做一个自己的网站
  • 广州创建网站2020最新推广方式
  • 惠州网站优化建设深圳网站设计实力乐云seo