|
|
@@ -1,22 +1,23 @@ |
|
|
|
<template> |
|
|
|
<!-- <nav-bar title="申请退款"></nav-bar> --> |
|
|
|
<view class="selectCar-box"> |
|
|
|
<view v-if="state.list&&state.list.length>0" @click="choose(i,item)" class="item" v-for="(item,i) in state.list" :key="i"> |
|
|
|
<view class="iten-left"> |
|
|
|
<!-- <image :src="`${$imgUrl}che.png`" mode=""></image> --> |
|
|
|
<text>订单编号:{{item.orderId}}</text> |
|
|
|
</view> |
|
|
|
<view class="choose-item"> |
|
|
|
<view class="active" v-if="flag==i"> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view v-else> |
|
|
|
<empty title='暂无找到相关储值卡圈存信息' /> |
|
|
|
</view> |
|
|
|
<view class="selectCar-box"> |
|
|
|
<view v-if="state.list&&state.list.length>0" @click="choose(i,item)" class="item" v-for="(item,i) in state.list" |
|
|
|
:key="i"> |
|
|
|
<view class="iten-left"> |
|
|
|
<!-- <image :src="`${$imgUrl}che.png`" mode=""></image> --> |
|
|
|
<text>订单编号:{{item.orderId}}</text> |
|
|
|
</view> |
|
|
|
<view class="choose-item"> |
|
|
|
<view class="active" v-if="flag==i"> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view v-else> |
|
|
|
<empty title='暂无找到相关储值卡圈存信息' /> |
|
|
|
</view> |
|
|
|
<view class="submit" @click="apply()">申请退款</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
@@ -26,13 +27,13 @@ |
|
|
|
ref |
|
|
|
} from "vue" |
|
|
|
import { |
|
|
|
navTo,msg |
|
|
|
navTo, msg |
|
|
|
} from "@/utils/utils" |
|
|
|
import { |
|
|
|
onLoad, |
|
|
|
} from "@dcloudio/uni-app"; |
|
|
|
import { |
|
|
|
refundQuan,queryRefoundResult,queryStoredQuan |
|
|
|
refundQuan, queryRefoundResult, queryStoredQuan |
|
|
|
} from "@/utils/network/api.js"; |
|
|
|
import { |
|
|
|
request |
|
|
@@ -45,84 +46,87 @@ |
|
|
|
stringToJson |
|
|
|
} from "@/utils/network/encryption"; |
|
|
|
const state = reactive({ |
|
|
|
list: [] ,//车辆list |
|
|
|
choiceItem:{}, //选择退款的某一条数据 |
|
|
|
list: [],//车辆list |
|
|
|
choiceItem: {}, //选择退款的某一条数据 |
|
|
|
}); |
|
|
|
const flag = ref('-1') //默认选择0 |
|
|
|
|
|
|
|
onLoad((option:any) => { |
|
|
|
console.log("option",option) |
|
|
|
onLoad((option : any) => { |
|
|
|
console.log("option", option) |
|
|
|
StoredQuan(option.cardId); |
|
|
|
}); |
|
|
|
const StoredQuan=(cardId)=>{ |
|
|
|
const StoredQuan = (cardId) => { |
|
|
|
const options = { |
|
|
|
type: 2, |
|
|
|
data: { |
|
|
|
"status":0, |
|
|
|
"cardId":cardId, |
|
|
|
"status": 0, |
|
|
|
"cardId": cardId, |
|
|
|
}, |
|
|
|
method: 'POST', |
|
|
|
showLoading: true, |
|
|
|
} |
|
|
|
request(queryStoredQuan, options).then((res) => { |
|
|
|
const data=stringToJson(res.bizContent); |
|
|
|
state.list=data.data |
|
|
|
console.log("1111",data) |
|
|
|
const data = stringToJson(res.bizContent); |
|
|
|
state.list = data.data |
|
|
|
console.log("1111", data) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const choose = (i, item) => { |
|
|
|
flag.value = i |
|
|
|
console.log("item",item) |
|
|
|
state.choiceItem=item |
|
|
|
console.log("item", item) |
|
|
|
state.choiceItem = item |
|
|
|
} |
|
|
|
const apply=()=>{ |
|
|
|
if(flag.value=='-1'){ |
|
|
|
const apply = () => { |
|
|
|
if (flag.value == '-1') { |
|
|
|
msg("请选择退款订单") |
|
|
|
return; |
|
|
|
} |
|
|
|
queryRefound(); |
|
|
|
console.log("提交") |
|
|
|
} |
|
|
|
const queryRefound=()=>{ |
|
|
|
const queryRefound = () => { |
|
|
|
const options = { |
|
|
|
type: 2, |
|
|
|
data: { |
|
|
|
"orderId":state.choiceItem.orderId, |
|
|
|
"cardId":state.choiceItem.cardId, |
|
|
|
"orderId": state.choiceItem.orderId, |
|
|
|
"cardId": state.choiceItem.cardId, |
|
|
|
"openId": getItem(StorageKeys.OpenId), |
|
|
|
}, |
|
|
|
method: 'POST', |
|
|
|
showLoading: true, |
|
|
|
} |
|
|
|
console.log("refundQuan", refundQuan, options) |
|
|
|
request(refundQuan, options).then((res) => { |
|
|
|
const data=stringToJson(res.bizContent); |
|
|
|
const data = stringToJson(res.bizContent); |
|
|
|
refoundResult(); |
|
|
|
console.log("222",data) |
|
|
|
console.log("222", data) |
|
|
|
}) |
|
|
|
} |
|
|
|
const refoundResult=()=>{ |
|
|
|
const refoundResult = () => { |
|
|
|
const options = { |
|
|
|
type: 2, |
|
|
|
data: { |
|
|
|
"orderId":state.choiceItem.orderId, |
|
|
|
"cardId":state.choiceItem.cardId, |
|
|
|
"orderId": state.choiceItem.orderId, |
|
|
|
"cardId": state.choiceItem.cardId, |
|
|
|
}, |
|
|
|
method: 'POST', |
|
|
|
showLoading: true, |
|
|
|
} |
|
|
|
console.log("queryRefoundResult", queryRefoundResult, options) |
|
|
|
request(queryRefoundResult, options).then((res) => { |
|
|
|
const data=stringToJson(res.bizContent); |
|
|
|
if(data.refundStatus=="SUCCESS"){ |
|
|
|
const data = stringToJson(res.bizContent); |
|
|
|
console.log("data", data) |
|
|
|
if (data.refundStatus == "SUCCESS") { |
|
|
|
uni.navigateBack({ |
|
|
|
delta:2 |
|
|
|
delta: 2 |
|
|
|
}) |
|
|
|
}else if(data.refundStatus=="CLOSED"){ |
|
|
|
} else if (data.refundStatus == "CLOSED") { |
|
|
|
msg('退款关闭') |
|
|
|
}else if(data.refundStatus=="HANDLING"){ |
|
|
|
} else if (data.refundStatus == "HANDLING") { |
|
|
|
msg('退款处理中') |
|
|
|
}else if(data.refundStatus=="EXCEPTION"){ |
|
|
|
} else if (data.refundStatus == "EXCEPTION") { |
|
|
|
msg('退款异常') |
|
|
|
} |
|
|
|
}) |
|
|
@@ -201,6 +205,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.submit { |
|
|
|
height: 80rpx; |
|
|
|
background: linear-gradient(-90deg, #43A1E0 0%, #13E7C1 100%); |
|
|
@@ -218,4 +223,4 @@ |
|
|
|
transform: translate(-50%); |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |