<!--
|
* @Author: 小明丶
|
* @Date: 2019-08-19 16:20:48
|
* @LastEditors: 小明丶
|
* @LastEditTime: 2020-12-09 20:32:32
|
* @Description: 花呗分期——订单详情
|
-->
|
<template>
|
<div class="hb-detail-box h-100-g">
|
<v-navbar title="订单详情" fixed></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 :value="form.aliAccount.replace(/(\d{3})\d*(\d{2})/,'$1xxxxxx$2')" 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.insTerm" 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.goodsBrand" 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>
|
<van-cell :value="form.zfbVersionName" title='办单通道' readonly></van-cell>
|
<van-cell :value="form.payTypeName" 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 class="cell-group">
|
<van-cell :value="form.rate + '%'" 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" :color="$store.state.backColor" 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" :color="$store.state.backColor" v-if="hasHjBackUrl" @click="goHj">返回红茄</van-button>
|
<van-button class="btn" :color="$store.state.backColor" v-if="form.refundStatus==1&&hasHjTokenGetRefBtn" @click="refund">退款</van-button>
|
<van-button class="btn" :color="$store.state.backColor" v-if="form.status==0&&form.payTypeName!='反扫'" @click="showCode">显示支付二维码</van-button>
|
</footer>
|
|
</div>
|
</template>
|
|
<script>
|
import {
|
mapState
|
} from 'vuex';
|
import Vue from 'vue';
|
import { Notify } from 'vant';
|
|
Vue.use(Notify);
|
export default {
|
data() {
|
return {
|
// typeId: this.$route.query.typeId,
|
Open: true, //倒计时开关
|
yzmText:'获取验证码',
|
yzmOkShow: false,
|
yzmVal: '',
|
yzmShow: false, //获取验证码弹窗
|
form: {},
|
statusColor:'',
|
hasHjBackUrl:false,
|
backUrl:''
|
}
|
},
|
computed: {
|
payTypeStr(){
|
if(this.form.payType == 1){
|
return '正选'
|
}
|
if(this.form.payType == 2){
|
return '反选'
|
}
|
},
|
id() {
|
return this.$route.query.id
|
},
|
typeId() {
|
return this.$route.query.typeId
|
},
|
// hasHjBackUrl(){
|
// if(sessionStorage.hjBackUrl!='null' && sessionStorage.hjBackUrl){
|
// return true
|
// }else{
|
// return false
|
// }
|
// },
|
hasHjTokenGetRefBtn(){
|
if(typeof localStorage.hjToken !='undefined' && localStorage.hjToken){
|
return false
|
}else{
|
return true
|
}
|
},
|
...mapState(['userinfo'])
|
},
|
created() {
|
this.init()
|
console.log(this.typeId)
|
},
|
methods: {
|
goHj(){
|
//console.log(this.$route.query.backUrl.split('https'))
|
location.href=sessionStorage.hjBackUrl
|
},
|
//验证码弹窗确认事件
|
yzmYes() {
|
// console.log(this.yzmVal)
|
if(this.yzmVal == '' || this.yzmVal == null){
|
Notify({ type: 'danger', message: '验证码为空!' });
|
} else {
|
this.$api.hbOrderRefund({orderId:Number(this.id), verCode:this.yzmVal}).then(() => {
|
// this.$router.replace(`/product/dmf-detail?id=${this.orderId}`)
|
this.$notify('退款成功')
|
this.yzmShow = false;
|
this.yzmVal = '',
|
this.yzmOkShow = true;
|
setTimeout(() => {
|
location.reload()
|
}, 700);
|
})
|
|
}
|
},
|
//获取验证码
|
getYzm() {
|
let sendParams = {
|
// mblNo: this.userinfo.mblNo,
|
mblNo: this.userinfo.mblNo,
|
verCodeType: 11,
|
};
|
if(this.typeId != 200002) {
|
sendParams.verCodeType =11;
|
}
|
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--;
|
// _this.$set(_this.yzmText = num + 's重发')
|
if(num === 0) {
|
clearInterval(timer);
|
_this.Open = true;
|
_this.yzmText = '重新发送';
|
} else {
|
_this.yzmText = num + '秒后重发';
|
}
|
},1000)
|
}).catch(()=>{
|
this.Open = true;
|
})
|
}
|
},
|
init() {
|
this.$api.getHBDetail(this.id).then((res) => {
|
this.form = res.body || {};
|
|
if(res.body.backUrl !='null' && res.body.backUrl){
|
this.hasHjBackUrl = true
|
this.backUrl = res.body.backUrl
|
}else{
|
this.hasHjBackUrl = false
|
}
|
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
|
// this.$api.hbOrderRefund(this.id).then((res) => {
|
// if (res.errorCode == 0) {
|
// this.$notify('退款成功');
|
// this.$router.back();
|
// }
|
// }).catch((err) => {
|
|
// });
|
}).catch(() => {
|
// on cancel
|
});
|
// this
|
|
},
|
//展示二维码
|
showCode() {
|
if (this.form.payCode) {
|
window.sessionStorage.setItem("hbpayQrCodeUrl", this.form.payCode);
|
let queryObj = {
|
payQrCodeUrl:this.form.payCode,
|
orderId: this.form.orderId,
|
totalAmount: this.form.insAmt,
|
term: this.form.insTerm,
|
typeId:this.typeId || '',
|
platRate:this.form.platRate,
|
zfbRate:this.form.zfbRate,
|
backUrl:this.backUrl,
|
capitalAmt:this.form.settAmt
|
}
|
this.$router.push({
|
path: "/hb-getHBQRCode",
|
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>
|