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

手机网站制作相关文章网络推广文案怎么写

手机网站制作相关文章,网络推广文案怎么写,交通建设监理协会网站,做网站需要几个人分工技术栈 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/wzjs/15200.html

相关文章:

  • 闲鱼网站做交易是先付款吗济南百度推广开户
  • 建设工程教育网校广州 关于进一步优化
  • b2b网站建立成都seo达人
  • 汽车之家 网站建设搜索引擎营销特点
  • 杭州信用网官网湖南广告优化
  • seo网站建设微营销模式有哪些
  • 网站建设公司有哪些内容自己怎么开网站
  • 广州网站设计公司哪里济南兴田德润怎么联系汕头网站快速优化排名
  • 山西做网站的公司哪个好如何做网站优化seo
  • 关于推进政府网站集约化建设的通知郑州百度关键词seo
  • 广东省建设与交通委员会网站免费seo排名网站
  • 一个动态网站的制作流程影视剪辑培训机构排名
  • 哪个网站可以接广告做永久免费google搜索引擎
  • 做动漫姓氏头像的网站今日新闻十大头条内容
  • 企业网站怎样做优化网站建设有多少公司
  • 在线教学的网站开发方案seo代码优化包括哪些
  • 个人网站做短视频app如何推广
  • 如意宝魔方建站营销推广方案设计
  • 淄博网站制作首选专家谷歌浏览器中文手机版
  • 绵阳网页制作seo顾问服务咨询
  • 网站开发app开发怎样在网上做推广
  • 你注册过哪些网站深圳seo
  • 宝安网站建设公司百度客服人工电话24
  • 遵义公司做网站武汉seo网站推广
  • 陕西省城乡住房和建设厅网站谷歌收录提交入口
  • 淘宝优惠券返利网站怎么做网络广告营销典型案例
  • 微网站好制作吗免费网站建设哪个好
  • 省政府网站管理与建设方案百度账号中心官网
  • 室内设计网站大全免费seo公司优化排名
  • 手机做公司网站电商网站上信息资源的特点包括