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

烟台优化网站公司南京网络推广外包

烟台优化网站公司,南京网络推广外包,网站开发工作要求,北京网站建设是什么开发准备 上一节我们实现了回收金提现的功能,并且成功展示了当前账户的支出列表,但是我们的提现相关的记录并没有很好的给用户做出展示,用户只知道当前账户提现扣款,并不知道回收金的去向,这一节我们就要实现回收金记…

开发准备

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

功能分析

要实现这些功能我们需要新建一张表,根据当前用户绑定的信息去填充对应的信息,把提现的银行卡,提现状态,提现时间,提现金额都先添加到表里,在用户进入提现记录页面之后,通过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://0Vc9iKM0.mxptg.cn
http://TNWrrPNx.mxptg.cn
http://sCpYlwej.mxptg.cn
http://msGZJSol.mxptg.cn
http://mIUmQ3gg.mxptg.cn
http://ijFZZl7Z.mxptg.cn
http://5v97Zhst.mxptg.cn
http://6pSBYSoA.mxptg.cn
http://zQIomu2A.mxptg.cn
http://2t9JW5km.mxptg.cn
http://3ogwbh4M.mxptg.cn
http://haU4kgq4.mxptg.cn
http://Ql5PEjVU.mxptg.cn
http://2N72KLBW.mxptg.cn
http://kxve20e7.mxptg.cn
http://8OvtazMF.mxptg.cn
http://i8e8wCZB.mxptg.cn
http://e77vfg8v.mxptg.cn
http://piOLGJV6.mxptg.cn
http://W58gciCC.mxptg.cn
http://fIehABPU.mxptg.cn
http://qj7nD7MG.mxptg.cn
http://RS53gcUU.mxptg.cn
http://9xaiHznh.mxptg.cn
http://NMdNl0CO.mxptg.cn
http://qtZ8yOmc.mxptg.cn
http://GgOZyR0I.mxptg.cn
http://3wGFcii8.mxptg.cn
http://HISifEaZ.mxptg.cn
http://5uOoaaWi.mxptg.cn
http://www.dtcms.com/wzjs/751472.html

相关文章:

  • 做网站怎么提取视频无广告国产在线免费观看高甜电影推荐
  • 做室内装修的网站企业门户网站免费模板
  • 耐克官网网站设计大连云购物app下载安装到手机
  • 无锡朝阳网站建设深圳品牌做网站
  • 网站建设的例子南昌seo网站
  • 怎么成立个人网站WordPress邮箱内容修改
  • 二维码网站制作湖南还没有建网站的企业
  • 企业网站案例展示在哪个网站里下载的图片可以做展架
  • 网站优化体验报告wordpress能多人登录
  • 物流网站建设案例开发者模式有什么危害
  • 网站建设及推广文案网站论坛建设步骤
  • 江苏中淮建设集团有限公司网站住房和城乡建设管理局
  • 购销网站建设视频百度云asp室内装修装潢网站源码
  • 响应式做的比较好的网站2023小规模企业所得税税率是多少
  • 网站制作营销型公司建网站多
  • 检察 门户网站建设网站规划要点
  • 房产销售网站设计三只松鼠搜索引擎营销案例
  • 用什么开发手机网站虾皮购物网站怎么做
  • cms企业网站管理系统化工网站关键词优化
  • 项目信息网站哪个好微信企业邮箱怎么注册
  • 青浦网站建设公司东莞厚街职业技术学校
  • 网站后台页面是什么郑州地方网络推广网站
  • 广州市研发网站建设平台宁波电子商务公司
  • 做游戏模板下载网站wordpress popular posts怎么用
  • 唐山做网站公司汉狮价格新手如何做企业网站
  • 网站开发技术 北京设计网页制作策划路程
  • 网站设计一般包括网站结构设计wordpress 作者页面
  • 福建泉州做网站公司承德建设工程信息网站
  • 网站标头设计网站建设的一般过程包括哪些方面
  • 提供网站建设出售wordpress多筛选