<!--
|
* @Author: 小明丶
|
* @Date: 2020-03-19 15:52:24
|
* @LastEditors: 小明丶
|
* @LastEditTime: 2020-08-11 16:22:06
|
* @Description:
|
-->
|
<template>
|
<div class="hb-detail-box h-100-g">
|
<van-nav-bar title="订单详情" fixed @click-left="goBack" v-if="this.$route.query.whereGo==1">
|
<template slot='left'>
|
<i class="iconfont iconzuojiantou" style="font-size:25px;color:#333;vertical-align: middle;"></i>
|
</template>
|
</van-nav-bar>
|
<v-navbar title="订单详情" fixed v-else></v-navbar>
|
<div class="content">
|
<div class="cell-group">
|
<van-cell :value="form.userName" title='用户名称' readonly></van-cell>
|
<van-cell :value="form.mblNo" title='手机号' readonly></van-cell>
|
<van-cell v-if="form.aliAccount" :value="form.aliAccount" title='用户支付宝账号' readonly></van-cell>
|
</div>
|
|
<div class="cell-group">
|
<van-cell :value="form.platRate" title='智享服务费率' readonly></van-cell>
|
<van-cell :value="form.zfbRate" title='花呗分期手续费率' readonly></van-cell>
|
<van-cell :value="form.settAmt" title='结算金额' readonly></van-cell>
|
<van-cell :value="form.insTermStr" title='分期期数' readonly></van-cell>
|
<van-cell :value="form.insAmt" title='还款总额' readonly></van-cell>
|
<van-cell v-if="form.dealTime" :value="form.dealTime | timeformat('yyyy-MM-dd')" title='交易时间' readonly></van-cell>
|
<van-cell v-else title='交易时间' readonly></van-cell>
|
<van-cell :value="form.retFee" title='每月还款' readonly></van-cell>
|
<van-cell :value="form.goodsName" title='商品名称' readonly></van-cell>
|
<van-cell :value="form.statusStr" :value-class="statusColor" title='订单状态' readonly></van-cell>
|
</div>
|
|
<div class="cell-group" >
|
<van-cell :value="form.chanName || '无'" title='办理渠道' readonly></van-cell>
|
<van-cell :value="form.merName || '无'" title='办理商户' readonly></van-cell>
|
<van-cell :value="form.storeName || '无'" title='办理门店' readonly></van-cell>
|
<van-cell :value="form.recordPerson || '无'" title='办单员' readonly></van-cell>
|
</div>
|
</div>
|
<!-- 短信验证码弹窗 -->
|
<van-popup v-model="yzmShow">
|
<div class="yzmbox">
|
<van-icon name="cross" class="yzmbox-close" @click="yzmShow = false" />
|
<p style="font-size:16px;color:#000;">请输入短信验证码</p>
|
<div class="yzmbox-contnet">
|
<div class="yzmbox-contnet-yzm">
|
<span>将发送到手机号:</span>
|
<span>{{userinfo.mblNo.replace(/(\d{3})\d*(\d{4})/, '$1****$2') }}</span>
|
</div>
|
</div>
|
<div class="yzmbox-contnet-get">
|
<input type="text" v-model="yzmVal" placeholder="请输入验证码">
|
<span class="yzmbox-contnet-get-yzm" @click="getYzm">{{ yzmText }}</span>
|
</div>
|
<van-button class="showbtn" round @click="yzmYes">确认</van-button>
|
</div>
|
</van-popup>
|
<!-- 退单成功弹窗 -->
|
<!-- <van-popup v-model="yzmOkShow">
|
<div class="yzmOkbox">
|
<van-icon name="cross" class="yzmbox-close" @click="yzmOkShow = false" />
|
<div class="yzmOkbox-img">
|
<img src="../../assets/img/tkimg.png" alt="">
|
</div>
|
<p>退款成功</p>
|
</div>
|
</van-popup> -->
|
<footer class="footer flex-center-g">
|
<!-- <van-button class="btn" v-if="form.refundStatus==1" @click="refund">退款</van-button> -->
|
<van-button class="btn" v-if="form.status==0" @click="showCode">显示支付二维码</van-button>
|
</footer>
|
|
</div>
|
</template>
|
|
<script>
|
import {
|
mapState
|
} from 'vuex';
|
import Vue from 'vue';
|
import { Notify } from 'vant';
|
import { NavBar } from 'vant';
|
|
Vue.use(NavBar);
|
Vue.use(Notify);
|
export default {
|
data() {
|
return {
|
// typeId: this.$route.query.typeId,
|
Open: true, //倒计时开关
|
yzmText:'获取验证码',
|
yzmVal: '',
|
yzmShow: false, //获取验证码弹窗
|
form: {},
|
statusColor:''
|
}
|
},
|
computed: {
|
id() {
|
return this.$route.query.id
|
},
|
typeId() {
|
return this.$route.query.typeId
|
},
|
...mapState(['userinfo'])
|
},
|
created() {
|
this.init()
|
},
|
methods: {
|
// 返回
|
goBack(){
|
this.$router.push({
|
path:'/main/home',
|
query:{
|
navIndex:6,
|
typeId:200011,
|
prodId:30000012
|
}
|
})
|
},
|
//验证码弹窗确认事件
|
yzmYes() {
|
if(this.yzmVal == '' || this.yzmVal == null){
|
Notify({ type: 'danger', message: '验证码为空!' });
|
} else {
|
this.$api.xygOrderRefundHb({orderId:Number(this.id), verCode:this.yzmVal}).then(() => {
|
this.$notify('退款成功')
|
this.yzmShow = false;
|
this.yzmVal = '',
|
setTimeout(() => {
|
location.reload()
|
}, 700);
|
})
|
|
}
|
},
|
//获取验证码
|
getYzm() {
|
let sendParams = {
|
mblNo: this.userinfo.mblNo,
|
verCodeType: 15,
|
};
|
if(this.Open) {
|
this.$api.userSendMsg(sendParams).then(res => {
|
console.log(res.body)
|
this.Open = false
|
let num = 60;
|
this.yzmText = num + '秒后重发';
|
let _this = this
|
let timer = setInterval(() => {
|
num--;
|
if(num === 0) {
|
clearInterval(timer);
|
_this.Open = true;
|
_this.yzmText = '重新发送';
|
} else {
|
_this.yzmText = num + '秒后重发';
|
}
|
},1000)
|
}).catch(()=>{
|
this.Open = true;
|
})
|
}
|
},
|
init() {
|
this.$api.xygOrderHbOrderDtl({
|
orderId:this.id
|
}).then((res) => {
|
this.form = res.body || {};
|
if(this.form) {
|
if (this.form.status == 1) {
|
this.statusColor = 'status-val-done';
|
} else if (this.form.status == 2) {
|
this.statusColor = 'status-val-error';
|
} else if (this.form.status == 3) {
|
this.statusColor = 'status-val-refund';
|
} else if (this.form.status == 0) {
|
this.statusColor = 'status-val-wait';
|
} else {
|
this.statusColor = 'status-val-done';
|
}
|
}
|
}).catch((err) => {
|
|
});
|
},
|
//退款
|
refund() {
|
this.$dialog.confirm({
|
message: '是否确认退款'
|
}).then(() => {
|
this.yzmShow = true
|
}).catch(() => {
|
|
});
|
},
|
//展示二维码
|
showCode() {
|
if (this.form.payCode) {
|
window.sessionStorage.setItem("xygHbpayQrCodeUrl", this.form.payCode);
|
let queryObj = {
|
payQrCodeUrl:this.form.payCode,
|
orderId: this.form.orderId,
|
totalAmount: this.form.insAmt,
|
term: this.form.insTerm,
|
typeId:this.typeId || ''
|
}
|
this.$router.push({
|
path: "/xyg-getXygHbQRCode",
|
query: queryObj
|
})
|
}
|
}
|
},
|
}
|
</script>
|
<style lang="less" scoped>
|
.showbtn{
|
width: 60%;
|
background: @c-default;
|
color: #fff;
|
position: absolute;
|
bottom: 15px;
|
}
|
.yzmbox{
|
box-sizing: border-box;
|
width: 280px;
|
height: 225px;
|
position: relative;
|
overflow: hidden;
|
// background: #f5f5f5;
|
.flex('', center, center, column);
|
text-align: center;
|
border-radius: 6px;
|
background: #fff;
|
padding-top: 34px;
|
&-close{
|
color: #999;
|
font-size: 16px;
|
position: absolute;
|
right: 8px;
|
top: 8px;
|
}
|
&-contnet{
|
margin-top: 11px;
|
color: #999;
|
font-size: 14px;
|
&-yzm{
|
.flex(center, center);
|
// font-size: 14px;
|
span{
|
font-size: 14px;
|
// color: #999;
|
}
|
|
}
|
&-get{
|
width: 80%;
|
margin: 0 10%;
|
margin-top: 30px;
|
.flex(space-between, center);
|
input{
|
border: none;
|
width: 45%;
|
background: #fff;
|
height: 30px;
|
}
|
&-yzm{
|
color: @c-default;
|
}
|
}
|
}
|
}
|
.yzmOkbox{
|
box-sizing: border-box;
|
width: 280px;
|
height: 225px;
|
position: relative;
|
overflow: hidden;
|
.flex(center, center,'',column);
|
&-img{
|
width: 90px;
|
height: 90px;
|
img{
|
width: 100%;
|
height: 100%;
|
}
|
}
|
p{
|
font-size: 16px;
|
color: #000;
|
margin-top: 16px;
|
}
|
}
|
.status-val-done {
|
color:#19BE6B;
|
}
|
.status-val-refund {
|
color:#FF9900;
|
}
|
.status-val-wait {
|
color:#FF9900;
|
}
|
.status-val-error {
|
color:#ED4014;
|
}
|
.hb-detail-box {
|
padding-top: 44px;
|
background-color: @c-bg-f5;
|
|
.content {
|
padding: 10px 8px;
|
}
|
|
.cell-group {
|
margin-bottom: 10px;
|
}
|
}
|
|
.footer {
|
padding-bottom: 30px;
|
margin: 0 8px;
|
background-color: @c-bg-f5;
|
|
.btn {
|
width: 50%;
|
color: @c-text-fff;
|
background-color: @c-bg-default;
|
}
|
}
|
</style>
|