[day24]Vue实作-交易建立页面_完成版

调整

  • 目前虽然可以送交易,但还没有解析回覆的结果,趁连假第一天来处理一下!!
  1. 解析订单送出後回覆之资讯
    昨天写的很急,今天调整了一下内容,并且将API的回应解析也写入了,
    完整的程序码如下
async onSubmit(event) {
    event.preventDefault()
    this.sentform.householder = this.form.name
    this.sentform.Amount = parseInt(this.form.bill)
    this.sentform.OrderNo = this.form.yyyymm
    this.sentform.PayType = this.form.selected
    axios.defaults.headers.common['Access-Control-Allow-Origin'] = '*';
    const response =await axios.post(`${this.sinopac_api}`+"sinopacApi_Order", this.sentform)
    let responseResult=JSON.stringify(response.data["decrypt_dist"])
    let atmParam= JSON.stringify(response.data["decrypt_dist"]["ATMParam"])
    console.log(responseResult)
    console.log(atmParam)
    console.log(JSON.parse(responseResult).OrderNo)
    console.log(JSON.parse(atmParam).AtmPayNo)
      },
  1. 调整弹跳视窗资讯
    调整alert资讯
    alert("银行代码 : 807  汇款帐号 : "+ JSON.parse(atmParam).AtmPayNo+" 汇款金额 : "+ JSON.parse(responseResult).Amount/100)
  1. 新增订单资讯於主页
    很简单的b-card
<b-card class="mt-3" header="订单资讯">
  <span class="order info"> {{orderinfo }}</span> 
</b-card>

script增加资讯

this.orderinfo = "银行代码 : 807  汇款帐号 : "+ JSON.parse(atmParam).AtmPayNo+" 汇款金额 : "+ JSON.parse(responseResult).Amount/100 ;

更新後如下图呈现

  1. 下订单
    https://ithelp.ithome.com.tw/upload/images/20211009/20140924MicsG2zx5T.png
  2. 弹跳视窗
    https://ithelp.ithome.com.tw/upload/images/20211009/201409249ZhYq3iHOn.png
  3. 显示订单资讯於主页下方
    https://ithelp.ithome.com.tw/upload/images/20211009/20140924uMmY2k7nMY.png

<<:  Day24 Modules & Namespaces

>>:  Day23 Plugin 从零开始到上架 - ActivityAware 介绍

Day 07 - Spring Boot 常用依赖

正如Day 04 - Spring Boot 的前世今生所说,Spring Boot 为了简化设定提...

DAY04随机森林演算法(续1)

昨天,我们把基尼系数算完,那今天,我打算建立bagging算法函数: 对於有n个资料的资料集,我们取...

第18天~SharedPreference常被使用於资料储存

SharedPreference常被使用於资料储存,很适合做一些简单的资料存取 先配置按钮-因为是要...

Day 5 Swift语法-基础篇(3/5)-流程控制

今天我们来学习一下流程控制跟一些基本运算子吧~ 布林值:用来表达true或false的资料型态 宣告...

Day 27 - 上传档案 Carrierwave - 多个档案

昨天说的是单一档案上传,如果要多个档案上传的话... 建立新栏位 资料表先新增可以储存一个阵列的栏位...