页面跳转传参到另一个页面后得刷新页面才出现传递的数据??
发布于 7 年前 作者 dino_xie 3405 次浏览 来自 问答
粉丝福利 : 关注VUE中文社区公众号,回复视频领取粉丝福利

HTML:

订单编号:¥ {{date.orderNum}}

下单时间:¥ {{date.punish}}

付款时间:¥ {{date.total}}

接车时间:{{date.get}}

检车时间:{{date.carInspect}}

完成时间:{{date.finish}}

JS:

data () { return { statusNum: null, payment: false, getCar: false, inspection: false, orderFinish: false, curr: ‘’, punish: [{‘cost’:‘100.00’,‘punish’:‘100.00’,‘total’:‘200.00’}], items: [ {‘carNum’:‘粤AJ1340’,‘txt’:‘驾驶中型以上载客载货汽车、校车、危险物品运输车辆意外的其他机动车行驶超过时速20%以上’,‘place’:‘汕头市龙湖区金砂东路与天山路交接’,‘date’:‘2017-04-05 15:30’,‘deduct’:‘0分’,‘money’:‘200’}, {‘carNum’:‘粤AJ1340’,‘txt’:‘驾驶中型以上载客载货汽车、校车、危险物品运输车辆意外的其他机动车行驶超过时速20%以上’,‘place’:‘汕头市龙湖区金砂东路与天山路交接’,‘date’:‘2017-04-05 15:50’,‘deduct’:‘0分’,‘money’:‘200’}, ], order: [ {‘orderNum’:‘0003165411’,‘orderTime’:‘2017-02-01 10:50’,‘payment’:‘2017-01-14 12:50’,‘transact’:‘2017-05-05 07:50’,‘refund’:‘2015-05-04 10:33’,‘refundSucc’:‘2017-05-05 07:50’,‘finish’:‘2017-08-05 11:12’} ] } }, mounted () { let _this = this this.statusNum = _this.$route.query.status console.log(this.statusNum) // 0–已完成;1–办理中;2–付款成功;3–办理失败,退款中;4–退款成功 switch (this.statusNum) { case ‘0’: this.payment = true; this.getCar = true; this.inspection = true; this.orderFinish = true; this.curr = “已完成” break; case ‘1’: this.payment = false; this.getCar = false; this.inspection = false; this.orderFinish = false; this.curr = “办理中” break; } }

我是通过另外个页面跳转的时候获取“订单状态值”,然后再根据状态值显示相应的页面,但是跳转过来后没得到我想要的页面效果,得刷新那些数据才会出来

回到顶部