NurseStationApp/pages/Applforrefund/Applforrefund.vue

231 lines
4.8 KiB
Vue
Raw Normal View History

2022-10-28 15:37:07 +08:00
<template>
<view class="app">
<view class="content">
<view class="item">退款类型
2022-11-01 16:26:34 +08:00
<span style='right: 0; color: #000000;'>{{typename}}</span>
2022-10-28 15:37:07 +08:00
</view>
2022-11-01 16:26:34 +08:00
<view class="item" @tap='show=true'>退款原因
<span v-if="dictname==''">请选择</span>
<span v-else style='color: #000000;'>{{dictname}}</span>
2022-10-28 15:37:07 +08:00
<image src="../../static/pic.png" mode=""></image>
</view>
<view class="priceinfo">退款金额
2022-11-01 16:26:34 +08:00
<view class="priceback">{{order.godTotalPrice}}
2022-10-28 15:37:07 +08:00
</view>
2022-11-15 15:36:29 +08:00
<!-- <view class="words">
2022-11-01 16:26:34 +08:00
已修改最多{{order.godTotalPrice}}含发货邮费 0.00
2022-11-15 15:36:29 +08:00
</view> -->
2022-10-28 15:37:07 +08:00
</view>
</view>
<view class="discribe">
<view class="voucher">补充描述和凭证</view>
<view class="supplement">
2022-11-01 16:26:34 +08:00
<u-input v-model="order.refundReasonRemark" type="textarea" height="100" :auto-height="true"
placeholder="补充描述,有助于商家更好的处理售后问题" />
2022-10-28 15:37:07 +08:00
</view>
</view>
2022-11-01 16:26:34 +08:00
<view class="Submit" @tap='refundinfo'>提交</view>
2022-10-28 15:37:07 +08:00
<!-- 弹框 -->
<view class="frame">
2022-11-01 16:26:34 +08:00
<u-popup v-model="show" mode="bottom" length="48%" border-radius="20">
<image class="image" @tap="show = false" src="../../static/gb.png" mode=""></image>
2022-10-28 15:37:07 +08:00
<view class="payment">
2022-11-01 16:26:34 +08:00
请选择退款原因
2022-10-28 15:37:07 +08:00
</view>
2022-11-01 16:26:34 +08:00
<view class="elderly" v-for="(item,index) in reasonlist" :key="index" @tap='tapreason(item)'>
{{item.dictLabel}}
2022-10-28 15:37:07 +08:00
</view>
</u-popup>
</view>
2022-11-01 16:26:34 +08:00
<u-toast ref="uToast" />
2022-10-28 15:37:07 +08:00
</view>
</template>
<script>
2022-11-01 16:26:34 +08:00
import {
refundReason,
refund
} from '@/api/Applforrefund/index.js'
2022-10-28 15:37:07 +08:00
export default {
data() {
return {
2022-11-01 16:26:34 +08:00
show: false, //退款原因开关
typename: '', //退款name
order: {}, //订单
reasonlist: [], //退款原因list
dictname: '', //页面退款原因字段
2022-11-11 17:23:23 +08:00
timer:null,
2022-10-28 15:37:07 +08:00
}
},
methods: {
2022-11-01 16:26:34 +08:00
//退款
refundinfo() {
2022-11-09 16:38:05 +08:00
this.order.updateTime = null
2022-11-01 16:26:34 +08:00
refund(this.order).then(
res => {
console.log(res)
if (res.code == 500) {
this.$refs.uToast.show({
title: res.msg,
type: 'error'
})
} else {
this.$refs.uToast.show({
title: '退款申请提交成功',
type: 'success',
duration: '1500'
})
2022-11-11 17:23:23 +08:00
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(e => {
2022-11-09 16:38:05 +08:00
uni.navigateBack({
delta: 3
});
}, 1500)
2022-11-01 16:26:34 +08:00
}
})
},
//退款原因
refundReasoninfo() {
refundReason().then(res => {
this.reasonlist = res.rows
2022-10-28 15:37:07 +08:00
})
},
2022-11-01 16:26:34 +08:00
//点击退款原因
tapreason(item) {
console.log(item)
this.order.refundReasonDictId = item.dictCode
this.dictname = item.dictLabel
this.show = false;
}
},
//开局获取传值
onLoad(options) {
this.refundReasoninfo();
this.order = JSON.parse(options.order)
this.order.id = this.order.goodsOrderId
this.typename = options.typename
if (this.typename == '我要退款(无需退货)') {
this.order.refundType = "ONLY_REFUND_MONEY"
} else {
this.order.refundType = "REFUND_MONEY_GOODS"
}
2022-10-28 15:37:07 +08:00
}
}
</script>
<style lang="scss">
.app {
padding: 3%;
2022-11-01 16:26:34 +08:00
.frame {
.image {
position: absolute;
right: 30rpx;
top: 40rpx;
width: 31rpx;
height: 31rpx;
2022-10-28 15:37:07 +08:00
}
2022-11-01 16:26:34 +08:00
.payment {
width: 95%;
font-size: 42rpx;
color: #000000;
line-height: 110rpx;
text-align: center;
margin: 0 auto;
}
2022-10-28 15:37:07 +08:00
2022-11-01 16:26:34 +08:00
.elderly {
width: 95%;
margin: 0 auto;
padding: 15rpx 0 15rpx 40rpx;
font-size: 40rpx;
line-height: 68rpx;
border-top: 1rpx solid #D8D4D4;
2022-10-28 15:37:07 +08:00
}
}
.Submit {
width: 217rpx;
height: 68rpx;
background: #4C7BC9;
border-radius: 26rpx;
text-align: center;
line-height: 68rpx;
color: #FFFFFF;
margin-left: 65%;
margin-top: 45%;
}
.discribe {
margin-top: 3%;
width: 99%;
height: 342rpx;
background: #FFFFFF;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 20rpx;
padding: 3%;
.supplement input {
margin-top: 3%;
margin-left: 5%;
font-size: 26rpx;
color: #BAB7B8;
line-height: 67rpx;
}
.voucher {
height: 70rpx;
border-bottom: 1rpx solid #D8D4D4;
}
}
.content {
width: 99%;
height: 342rpx;
background: #FFFFFF;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 20rpx;
margin: 0 auto;
line-height: 60rpx;
padding: 3%;
font-size: 30rpx;
.priceinfo {
.words {
font-size: 26rpx;
color: #BAB7B8;
}
.priceback {
font-size: 38rpx;
color: #D43953;
}
}
.item {
border-bottom: 1rpx solid #D8D4D4;
height: 70rpx;
2022-11-01 16:26:34 +08:00
position: relative;
2022-10-28 15:37:07 +08:00
image {
width: 16rpx;
height: 25rpx;
2022-11-01 16:26:34 +08:00
position: absolute;
right: 0;
top: 50%;
transform: translateY(-60%);
2022-10-28 15:37:07 +08:00
}
span {
2022-11-01 16:26:34 +08:00
position: absolute;
right: 5%;
2022-10-28 15:37:07 +08:00
color: #BAB7B8;
}
}
}
}
</style>