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

网站建设设计制作培训百度营销登录平台

网站建设设计制作培训,百度营销登录平台,wordpress 上传视频,做网站推广业务怎么样开发准备 上一节我们实现了回收金提现的功能,并且成功展示了当前账户的支出列表,但是我们的提现相关的记录并没有很好的给用户做出展示,用户只知道当前账户提现扣款,并不知道回收金的去向,这一节我们就要实现回收金记…

开发准备

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

功能分析

要实现这些功能我们需要新建一张表,根据当前用户绑定的信息去填充对应的信息,把提现的银行卡,提现状态,提现时间,提现金额都先添加到表里,在用户进入提现记录页面之后,通过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.khdw.cn/news/17618.html

相关文章:

  • 2345浏览器免费版seo搜索排名
  • 网络营销分析论文福州seo博客
  • 营销推广方案怎么写临沧seo
  • 传奇私服网站做ssl春哥seo博客
  • 企业网站做多大尺寸seo内部优化包括哪些内容
  • php做的购物网站系统下载百度获客平台怎么收费的
  • 做网站的内容资源seo策略什么意思
  • 灯塔网站制作公司百度推广登录首页
  • 企业文化墙设计网站推荐自动优化app
  • 我们做网站 老公弟弟也跟着做天津网站优化公司
  • 网站建设便宜b站推广网站2024
  • 英文网站设计多少钱搜多多搜索引擎入口
  • 网站建设 营销营销型企业网站建设的内容
  • 学校网站建设用哪个系统百度关键词优化方法
  • 手表网站建设策划腾讯朋友圈广告怎么投放
  • 网站视频解析临沂网站seo
  • 武汉网站建设公司有哪些bt磁力王
  • 做视频网站虚拟主机怎么选灰色产业推广引流渠道
  • wix怎么做网站交换链接网站
  • mac wordpress本地安装插件网站建设优化的技巧
  • 国外的网站用不用备案网络营销怎么推广
  • 阿里云服务器可以做多少个网站网络推广优化方案
  • da面板做两个网站建一个外贸独立站大约多少钱
  • 高品质的佛山网站建设电商怎么做如何从零开始
  • 网站模版上传空间后怎么做如何自己制作网页
  • 嘉兴企业网站设计哪家好互联网广告公司排名前十
  • 网站开发公司报价单模板营销推广的公司
  • 网络营销方案定义思路广州做seo整站优化公司
  • 东莞市手机网站建设品牌济南网站推广优化
  • 用备案的网站做违法网站惠州短视频seo