<!--
|
* @Author: 小明丶
|
* @Date: 2019-08-19 16:20:48
|
* @LastEditors: 小明丶
|
* @LastEditTime: 2020-12-11 10:54:57
|
* @Description: 商户收款——订单详情
|
-->
|
<template>
|
<div class="hb-detail-box h-100-g">
|
<v-navbar title="订单详情" fixed></v-navbar>
|
|
<div class="status" v-if="isShowStatus">
|
<div v-if="isSuccess">
|
<van-icon name="success" size="45px" color="#19BE6B" />
|
<p class="info">交易成功</p>
|
<h3 class="price">¥{{orderInfo.payAmt}}</h3>
|
</div>
|
<div v-else>
|
<van-icon name="fail" size="45px" color="#FF9900" />
|
<p class="info">订单超时</p>
|
</div>
|
</div>
|
|
<div class="content">
|
<div class="cell-group">
|
<van-cell :value="form.creTime | timeformat('yyyy-MM-dd HH:mm:ss')" title='交易时间' readonly ></van-cell>
|
<van-cell :value="form.orderId" title='订单号' readonly ></van-cell>
|
<van-cell :value="(form.payAmt || '0')+'元'" title='支付金额' readonly ></van-cell>
|
<van-cell :value="form.zfbVersionName || '无'" title="办单通道" readonly></van-cell>
|
<van-cell :value="status" title='订单状态' :value-class="statusColor" readonly ></van-cell>
|
<van-cell v-if="form.aliAccount" :value="form.aliAccount" title='用户支付宝账号' readonly></van-cell>
|
</div>
|
<div class="cell-group">
|
<van-cell v-if="userinfo.orgType < 2" :value="form.chanName || '无'" title='渠道名称' readonly></van-cell>
|
<van-cell v-if="userinfo.orgType < 3" :value="form.merName || '无'" title='商户名称' readonly></van-cell>
|
<van-cell v-if="userinfo.orgType < 4" :value="form.storeName || '无'" title='门店名称' readonly></van-cell>
|
<van-cell v-if="userinfo.orgType < 5" :value="form.mgrName || '无'" title='办单员名称' readonly></van-cell>
|
|
</div>
|
<div class="cell-group">
|
<van-cell :value="form.fee || '无'" title='商户收款费率' readonly></van-cell>
|
</div>
|
<div class="cell-group">
|
<van-cell v-if="userinfo.orgType == 3" :value="form.settStatus || '无'" title='到账状态' readonly></van-cell>
|
</div>
|
<!-- <van-button class="btn" v-if="" @click="yzmShow = true">退单</van-button> -->
|
<van-button class="btn" :color="$store.state.backColor" v-if="form.refundStatus==1&&form.zfbVersion != 5 && $store.state.userinfo.orgType != 1 && $store.state.userinfo.orgType != 2" @click="refund">退款</van-button>
|
<van-button class="btn" :color="$store.state.backColor" v-if="status === '待支付'" @click="$router.replace(`/facepay/code?url=${form.payCode}&id=${form.orderId}`)">展示二维码</van-button>
|
</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>
|
</div>
|
</template>
|
|
<script>
|
import { async } from 'q';
|
import Vue from 'vue';
|
import { Notify } from 'vant';
|
import { mapState } from 'vuex';
|
|
Vue.use(Notify);
|
export default {
|
data() {
|
return {
|
Open: true, //倒计时开关
|
yzmText:'获取验证码',
|
yzmOkShow: false,
|
yzmVal: '',
|
yzmShow: false, //获取验证码弹窗
|
isSuccess: false,
|
isShowStatus: false,
|
isShowListBtn: false,
|
form:{
|
creTime:new Date()
|
},
|
statusColor:''
|
}
|
},
|
computed:{
|
...mapState(['userinfo']),
|
orderId(){
|
return this.$route.query.id
|
},
|
status() {
|
let v = this.form.status;
|
switch (v) {
|
case 0:
|
return '待支付';
|
case 1:
|
return '交易成功';
|
case 2:
|
return '订单超时';
|
case 3:
|
return '退款成功';
|
}
|
}
|
},
|
created(){
|
let query = this.$route.query,
|
orderStatus = query.orderStatus,
|
page = query.page;
|
if (orderStatus == '1') {
|
this.isSuccess = true;
|
}
|
if (page == 'facepay_code') {
|
this.isShowStatus = true;
|
this.isShowListBtn = true;
|
}
|
this.init()
|
},
|
methods: {
|
//验证码弹窗确认事件
|
yzmYes() {
|
console.log(this.orderId)
|
if(this.yzmVal == '' || this.yzmVal == null){
|
Notify({ type: 'danger', message: '验证码为空!' });
|
} else {
|
this.$api.facepay_refund({orderId: Number(this.orderId), 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: 13980353202,
|
verCodeType: 12,
|
};
|
if(this.Open) {
|
this.$api.userSendMsg(sendParams).then(res => {
|
console.log(res.body)
|
this.Open = false
|
let num = 60;
|
this.yzmText = num + 's重发';
|
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 + 's重发';
|
}
|
},1000)
|
}).catch(()=>{
|
this.Open = true;
|
})
|
}
|
},
|
// 退款
|
refund(){
|
this.$dialog.confirm({
|
message: '是否确认退款'
|
}).then(() => {
|
this.yzmShow = true
|
|
}).catch(() => {
|
// on cancel
|
});
|
// this
|
|
},
|
getStatusClass(){
|
let styleClass = ['.status-val-done'];
|
return styleClass;
|
},
|
// 获取详情
|
init(){
|
this.$api.getDmfOrderDetail(this.orderId).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) => {
|
|
});
|
|
}
|
},
|
}
|
</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;
|
}
|
}
|
.status {
|
text-align: center;
|
padding: 15px 0;
|
margin-bottom: 15px;
|
.info {
|
margin-top: 10px;
|
}
|
|
.price {
|
font-size: 26px;
|
color: @c-text-default;
|
}
|
}
|
.btn{
|
width: 320px;
|
background: @c-bg-default;
|
color: @c-text-fff;
|
display: block;
|
margin: 30px auto;
|
}
|
</style>
|