123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- <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="submit" @click="apply()">申请退款</view>
- </view>
- </template>
-
- <script setup lang="ts">
- import empty from "@/components/empty/empty.vue";
- import {
- reactive,
- ref
- } from "vue"
- import {
- navTo, msg
- } from "@/utils/utils"
- import {
- onLoad,
- } from "@dcloudio/uni-app";
- import {
- refundQuan, queryRefoundResult, queryStoredQuan
- } from "@/utils/network/api.js";
- import {
- request
- } from "@/utils/network/request.js";
- import {
- getItem,
- StorageKeys,
- } from "@/utils/storage";
- import {
- stringToJson
- } from "@/utils/network/encryption";
- const state = reactive({
- list: [],//车辆list
- choiceItem: {}, //选择退款的某一条数据
- });
- const flag = ref('-1') //默认选择0
-
- onLoad((option : any) => {
- console.log("option", option)
- StoredQuan(option.cardId);
- });
- const StoredQuan = (cardId) => {
- const options = {
- type: 2,
- data: {
- "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 choose = (i, item) => {
- flag.value = i
- console.log("item", item)
- state.choiceItem = item
- }
- const apply = () => {
- if (flag.value == '-1') {
- msg("请选择退款订单")
- return;
- }
- queryRefound();
- console.log("提交")
- }
- const queryRefound = () => {
- const options = {
- type: 2,
- data: {
- "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);
- refoundResult();
- console.log("222", data)
- })
- }
- const refoundResult = () => {
- const options = {
- type: 2,
- data: {
- "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);
- console.log("data", data)
- if (data.refundStatus == "SUCCESS") {
- uni.navigateBack({
- delta: 2
- })
- } else if (data.refundStatus == "CLOSED") {
- msg('退款关闭')
- } else if (data.refundStatus == "HANDLING") {
- msg('退款处理中')
- } else if (data.refundStatus == "EXCEPTION") {
- msg('退款异常')
- }
- })
- }
- </script>
-
-
- <style>
- page {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- background-color: #F3F3F3;
- }
- </style>
- <style lang="scss" scoped>
- .flex {
- display: flex;
- justify-content: center;
- }
-
- .selectCar-box {
- // width: 100%;
- height: 100%;
- padding: 30rpx;
-
- .item {
- padding: 20rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 130rpx;
- background: #FFFFFF;
- box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
- border-radius: 20rpx;
- margin-bottom: 30rpx;
-
- .iten-left {
- display: flex;
- align-items: center;
-
- image {
- width: 150rpx;
- height: 90rpx;
-
- }
-
- text {
- margin-left: 20rpx;
- font-size: 32rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- color: #333333;
- }
- }
-
- .choose-item {
- width: 44rpx;
- height: 44rpx;
- background: #FFFFFF;
- border: 2rpx solid #00B38B;
- border-radius: 50%;
- margin-right: 20rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- box-sizing: content-box;
- }
-
- .active {
- width: 34rpx;
- height: 34rpx;
- background: #00B38B;
- border-radius: 50%;
- }
- }
- }
-
- .submit {
- height: 80rpx;
- background: linear-gradient(-90deg, #43A1E0 0%, #13E7C1 100%);
- box-shadow: 0rpx 4rpx 11rpx 1rpx rgba(223, 223, 223, 0.5);
- border-radius: 40rpx;
- font-size: 32rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #FFFFFF;
- line-height: 80rpx;
- position: fixed;
- bottom: 70rpx;
- width: 670rpx;
- left: 50%;
- transform: translate(-50%);
- text-align: center;
- }
- </style>
|