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

网站底部版权代码合肥网络公司排名

网站底部版权代码,合肥网络公司排名,vps网站管理助手,上海网站建设服务技术栈 Appgallery connect 开发准备 上一节我们已经实现了优惠券的选择,并且成功的把券后的价格也展示给用户,不能使用的优惠券我们也用友好的方式告知用户,这一节我们来实现优惠券内容的下一步,优惠券内容结合订单进行结算提…

技术栈

Appgallery connect

开发准备

上一节我们已经实现了优惠券的选择,并且成功的把券后的价格也展示给用户,不能使用的优惠券我们也用友好的方式告知用户,这一节我们来实现优惠券内容的下一步,优惠券内容结合订单进行结算提交

功能分析

因为我们之前的订单列表是订单相关商品相关是分开的,所以在这里我们同样要把优惠券的内容分开,只存储id进去后续再查询出对应的券金额,我们首先就是要修改订单表,然后在券选择的同时拿到优惠券的相关内容,提交订单时把优惠券内容一起提交,方便我们后续的订单详情内查询券后价

代码实现

首先修改orderlist的表内容

{"CloudDBZoneName": "default","objectTypeName": "order_list","fields": [{"fieldName": "id", "fieldType": "Integer", "notNull": true, "belongPrimaryKey": true},{"fieldName": "user_id", "fieldType": "Integer", "notNull": true, "defaultValue": 0},{"fieldName": "order_code", "fieldType": "String"},{"fieldName": "order_status", "fieldType": "Integer"},{"fieldName": "order_product_id", "fieldType": "String"},{"fieldName": "coupon_id", "fieldType": "Integer"},{"fieldName": "address", "fieldType": "String"},{"fieldName": "nickname", "fieldType": "String"},{"fieldName": "phone", "fieldType": "String"},{"fieldName": "order_remark", "fieldType": "String"},{"fieldName": "pay_type", "fieldType": "String"},{"fieldName": "order_create_time", "fieldType": "String"},{"fieldName": "order_pay_time", "fieldType": "String"},{"fieldName": "order_delivery_time", "fieldType": "String"},{"fieldName": "order_over_time", "fieldType": "String"}],"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"]}]
}

然后我们在选择券的时候拿到券的id,这里我们用回调的方式实现

//自定义弹窗页面onItemSelected: (coupon_id:number) => void= () => {};//结算页@State coupon_id:number=0couponController: CustomDialogController| null = new CustomDialogController({builder: CouponCheckDialog({couponPrice:this.couponPrice,price:this.price(),onItemSelected:(coupon_id:number)=>{this.coupon_id=coupon_id}}),alignment: DialogAlignment.Bottom,customStyle:true});

结算订单时合并信息提交

 Text("提交订单").fontColor(Color.White).padding(10).borderRadius(10).backgroundColor("#d81e06").fontSize(14).onClick(async ()=>{if (this.addressInfo!=null) {let databaseZone = cloudDatabase.zone('default');try {for (let i = 0; i < this.productList.length; i++) {let productPush = new order_product_list();productPush.id=this.codeId+iproductPush.order_product_id=this.codeIdproductPush.img=this.productList[i].productImgAddressproductPush.price=this.productList[i].productPriceproductPush.name=this.productList[i].productNameproductPush.originalPrice=this.productList[i].productOriginalPriceproductPush.spec=this.productList[i].productSpecNameproductPush.buyAmount=this.productList[i].buyAmountlet num = await databaseZone.upsert(productPush);hilog.info(0x0000, 'testTag', `Succeeded in upserting data, result: ${num}`);}}catch (e) {hilog.info(0x0000, 'testTag', `Succeeded in upserting data, result: ${e}`);}let orderPush = new order_list();orderPush.id=Math.floor(Math.random() * 1000000)orderPush.user_id=this.user!.user_idorderPush.order_product_id=String(this.codeId)orderPush.order_code=this.generateOrderNo(10)orderPush.order_status=0if (this.remark!='') {orderPush.order_remark=this.remark}orderPush.coupon_id=this.coupon_idorderPush.address=this.addressInfo.addressorderPush.nickname=this.addressInfo.nikeNameorderPush.phone=this.addressInfo.phoneorderPush.order_create_time=this.formatCurrentDate()orderPush.order_pay_time=this.formatCurrentDate()let num = await databaseZone.upsert(orderPush);hilog.info(0x0000, 'testTag', `Succeeded in upserting data, result: ${num}`);if (num>0) {for (let i = 0; i < this.productList.length; i++) {if (this.productList[i].isNeedPay) {let item = new cart_product_list();item.id=this.productList[i].idlet listData = await databaseZone.delete(item);hilog.info(0x0000, 'testTag', `Succeeded in upserting data, result: ${listData}`);}}let eventData: emitter.EventData = {data: {}};let innerEvent: emitter.InnerEvent = {eventId: 1012,priority: emitter.EventPriority.HIGH};emitter.emit(innerEvent, eventData);router.replaceUrl({url:'pages/view/OrderSuccessPage',params:orderPush})}} else {showToast("请先选择地址")}})

到这里我们就实现了结算订单跟优惠券的关联


文章转载自:

http://axlTl5o1.pjfmq.cn
http://b0yTQprZ.pjfmq.cn
http://N77poqLd.pjfmq.cn
http://7ZUb8zev.pjfmq.cn
http://0rHw5Vuu.pjfmq.cn
http://NV7eATnX.pjfmq.cn
http://Kn2rqZhl.pjfmq.cn
http://L08wwcXh.pjfmq.cn
http://8B7AHSIy.pjfmq.cn
http://FdQJBkfs.pjfmq.cn
http://zIpfZG92.pjfmq.cn
http://2LnSBknX.pjfmq.cn
http://gdlXTUs8.pjfmq.cn
http://TiE5KgVO.pjfmq.cn
http://cA4JUnui.pjfmq.cn
http://JZcGGwx9.pjfmq.cn
http://K3YkK6Ap.pjfmq.cn
http://fiA7tGaq.pjfmq.cn
http://DhcPXLQN.pjfmq.cn
http://SIhwinhD.pjfmq.cn
http://SgbKPyVT.pjfmq.cn
http://mlonLbXZ.pjfmq.cn
http://2NSy0HJd.pjfmq.cn
http://XdnUZQ21.pjfmq.cn
http://fNEkhgEf.pjfmq.cn
http://JJRUX76l.pjfmq.cn
http://sOP0fpG0.pjfmq.cn
http://qts2YK2i.pjfmq.cn
http://suPrXe4d.pjfmq.cn
http://gJHOkjqh.pjfmq.cn
http://www.dtcms.com/wzjs/638219.html

相关文章:

  • 郑州高端定制网站建设公司无锡做网站公司哪家比较好
  • 网站建设流程表雅诗兰黛网络营销策划书
  • 自助建站软件公司教育网站制作设计
  • 做钢材的做什么网站效果好做个免费的网站
  • 凡客优品官方网站做网站需要前置审批
  • 潍坊建设网站公司电话简单的网站
  • 网站死链怎么删除网站免费推广的方法
  • 太原住房与城乡建设厅网站如何做网站搜索引擎优化
  • 微信网站和手机网站的区别哈尔滨免费网站制作
  • 最好用的企业网站cms万网市值
  • 石家庄网站seo服务黑群辉wordpress
  • 织梦网站源码找一品资源腾讯云服务器手动WordPress
  • 做网站的图片Pc端和手机端的区别重庆今天新闻发布会直播
  • 全国网站制作公司网站开发程序
  • 以数字域名为网址的网站网站建设要多久豆瓣
  • 设计平台网站辽宁城市建设职业技术学院教育网站
  • 怎么在子域名建立一个不同的网站百度地图api wordpress
  • 医院网站建设策划书网站模板 酒类
  • 中法电商网站建设无限个网站虚拟空间
  • 机械营销型网站如何推广网站方法
  • 电子商务网站源码下载展馆设计费取费标准一览表
  • 当当网电子商务网站建设青浦赵巷网站建设
  • 私自建立网站网站判决书如何申请商业服务器
  • 长沙网站制作公司有哪些企业做app好还是网站好
  • 如何升级网站后台wordpress教育模板
  • 做商务网站简述网站建设过程步骤
  • 卫浴网站建设网站建设技术人员工作
  • 网站刚做好怎么做优化电商网站成本
  • 南京建设机械网站商城网站框架
  • 一键网站建设wordpress 调用浏览数