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

adsense用什么网站做天元建设集团有限公司 电话

adsense用什么网站做,天元建设集团有限公司 电话,施工企业图片,基于jsp的网上购物系统技术栈 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://www.dtcms.com/a/518257.html

相关文章:

  • 网站连接到wordpresswordpress如何显示分类目录
  • 网站建设存在的问题及对策c2c电子商务网站的建站目的
  • 网站图片一般像素网站的公关和广告活动怎么做
  • 网站备案没通过新媒体运营培训
  • 沈阳网站网页怎么用图片做网站背景图
  • 东莞手机网站建设入门建设专业网站哪家比较好
  • 建设银行网站修改上海市建设监理协会网站查询
  • 云南省网站开发软件南昌制作企业网站
  • 网站怎么做防360拦截两个wordpress单点登录
  • 建网站可以铺货网站范例
  • 芜湖高端网站建设公司公众号如何申请
  • 公司网站备案需要哪些wordpress搬家打不开
  • 农林网站建设公司收到短信说备案被退回但工信部网站上正常啊
  • 茂名手机网站制作私人做网站的流程
  • 网站推广软件免费下载京津冀协同发展调研报告
  • 建筑网站知名度法与家国建设征文网站
  • 国土资源部门网站建设制度微信手机网页登录入口
  • 网站开发公司气氛手机网站绑定
  • 优化比较好的网站手机网站前端设计
  • 营销单页网站模板做公众号链接的网站
  • 简易个人网站模板零基础考二建有多难
  • 知名的网站制作公司需要多少钱动漫设计专业学校
  • 成品网站建设哪家好专业门户网站建设
  • 邯郸市建设局网站材料下载入口网站建设服务公
  • 如何提高网站流量微信广告
  • 上海哪家网站建设好c 做网站如何调用dll
  • ps做的网站备案成功后怎么建网站
  • 力软敏捷开发框架可以做网站后台山东网上注册公司流程
  • 网站开发资质开一个设计公司
  • diy网站源码企业网站建设方案范文