不甘寂寞 2 年前
父节点
当前提交
b79d6656d4

+ 119
- 44
after-sale/refund-order-balance/refund-order-balance.vue 查看文件

<template> <template>
<view class="oderPage"> <view class="oderPage">
<view v-for="(item,index) in state.list" class="details">
<view v-if="state.list&&state.list.length>0" v-for="(item,index) in state.list" class="details">
<view class="header"> <view class="header">
<image :src="`${$imgUrl}order/no1.png`" mode=""></image> <image :src="`${$imgUrl}order/no1.png`" mode=""></image>
<text>{{item.id}}</text>
<text>{{item.orderId}}</text>
</view> </view>
<view class="hr"> <view class="hr">
<view class="line"> <view class="line">
</view> </view>
<button @click="refundTypeAction(item)">余额补领</button>
<button v-if="item.refundType === 'GLYQR'" @click="refundTypeAction(item)"> 补领申请</button>
<button v-if="item.refundType === 'BALSUP'" @click="refundTypeAction(item)"> 圈层</button>
</view>
<view v-else>
<empty title='暂无找到该车牌相关余额补领信息' />
</view> </view>
</view> </view>
</template> </template>
} from "@/utils/utils" } from "@/utils/utils"
import { import {
onLoad, onLoad,
onShow
onShow,
onUnload
} from "@dcloudio/uni-app"; } from "@dcloudio/uni-app";
import { import {
queryRefund, queryRefund,
stringToJson stringToJson
} from "@/utils/network/encryption"; } from "@/utils/network/encryption";
//-----蓝牙模块
const bluetoothUtil = require("../../static/etcUtil/index.js");
const cmd = require("../../static/etcUtil/cmdConfig.js");
const tools = require("../../static/etcUtil/tools.js");
const card = reactive({
/*卡相关信息*/
cardId: "",
netId: "",
cardType: "",
startTime: "",
endTime: "",
userName: "",
idNum: "",
vehiclePlate: "",
vehiclePlateColor: "",
color: "",
version: "",
type: "",
favourable: "",
money: undefined,
v_userType: "",
});
const state = reactive({ const state = reactive({
vehicleId: '', vehicleId: '',
list: []
list: [],
id: ''
}); });
/*视图进入后操作*/ /*视图进入后操作*/
onLoad((option) => { onLoad((option) => {
state.vehicleId = option.vehicleId state.vehicleId = option.vehicleId
//根据车牌查询信息
queryRefundAction().then(val => { queryRefundAction().then(val => {
state.list = val.data state.list = val.data
}) })
/*监听蓝牙回调*/
uni.$on('bluetoothLink', function(status) {
getCardId()
})
}); });
const reason = ref('')
// 单选数据列表
const radiolist1 = reactive([{
name: '退货原因1',
disabled: false
},
{
name: '退货原因2',
disabled: false
},
{
name: '退货原因3',
disabled: false
},
{
name: '退货原因4',
disabled: false
},
{
name: '退货原因5',
disabled: false
},
], )
const refundTypeAction = (val) => {
onUnload(() => {
/*移除监听*/
uni.$off('bluetoothLink')
});
//功能跳转入口
const refundTypeAction = (val: any) => {
if (val.refundType === 'GLYQR') { if (val.refundType === 'GLYQR') {
queryRefundApplyAction(val.id).then(value => {
console.log(value)
/*余额补领申请*/
queryRefundApplyAction(val.id).then((value: any) => {
state.id = value.id
/*查询完刷新状态*/
queryRefundAction().then((result: any) => {
state.list = result.data
})
}) })
} else if (val.refundType === 'BALSUP') {
/*圈层*/
//链接蓝牙
uni.navigateTo({
url: `/pages/bluetooth/bluetooth?routeType=5`,
});
} }
} }
// 单选
const radioChange = (n) => {
console.log('radioChange', n);
}
//储值卡注销退费查询接口
const queryRefundAction = () => { const queryRefundAction = () => {
var data = { var data = {
vehicleId: state.vehicleId vehicleId: state.vehicleId
}; };
reject(error); reject(error);
}); });
} }
//储值卡注销余额补领申请接口
const queryRefundApplyAction = (id) => { const queryRefundApplyAction = (id) => {
var data = { var data = {
id: id id: id
reject(error); reject(error);
}); });
} }
/*读卡*/
const getCardId = () => {
console.log("======获取卡信息======");
let cmdArr = [
cmd.HOME_DIRECTORY,
//选择主目
cmd.APPLICATION_DIRECTORY,
//选择文件1001--DF01联网收费应用目录
cmd.CMD_READBINARY,
//15文件--卡片发行基本数据文件
cmd.CMD_GETBALANCE,
//钱包
];
tools.showLoadingAlert("正在执行指令");
//10:写卡 20:写OBU
bluetoothUtil.transCmd(cmdArr, "10", function(res) {
tools.hideLoadingAlert();
let str = res[2].substring(res[2].length - 4, res[2].length);
let str3 = res[3].substring(res[3].length - 4, res[3].length);
if (str == "9000" || str3 == "9000") {
if (res[2].length > 86 || res[3] >= 12) {
card.cardId = res[2].substring(20, 40); //卡号
card.startTime = res[2].substring(40, 48);
card.endTime = res[2].substring(48, 56);
card.version = res[2].substring(18, 19) >= 4 ? "4x" : "2x";
card.netId = res[2].substring(20, 24);
card.cardType = res[2].substring(28, 29) == 23 ? 1 : 2;
card.vehiclePlateColor = parseInt(res[2].substring(82, 84), 16);
(card.money = parseInt(parseInt(res[3].substring(0, 8), 16), 10)),
console.log("======卡信息======", card);
if (card.cardId !== state.cardId) {
msg("设备卡信息与当前充值卡号不匹配,请核对卡号");
return;
}
quanCheckActionTrue().then((val) => {
checkQuanCengEvent(val);
});
} else {
console.error("CMD_READBINARY指令长度不符" + res[2]);
tools.hideLoadingAlert();
}
}
console.error("CMD_READBINARY指令长度不符" + res[2]);
tools.hideLoadingAlert();
});
};
</script> </script>
<style> <style>
page { page {
/* width: 100%;
height: 100%; */
width: 100%;
height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background-color: #F3F3F3;
background-color: #EEF7F7;
box-sizing: border-box; box-sizing: border-box;
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.oderPage { .oderPage {
background-color: #EEF7F7;
margin: 30rpx;
.details { .details {
margin-top: 30rpx;
margin: 30rpx;
position: relative; position: relative;
background: #fff; background: #fff;
border-radius: 20rpx; border-radius: 20rpx;

+ 13
- 15
after-sale/refund-order-balance/select-car.vue 查看文件

<template> <template>
<view class="selectCar-box"> <view class="selectCar-box">
<view v-if="state.list.length>0" @click="choose(i,item)" class="item" v-for="(item,i) in state.list" :key="i">
<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"> <view class="iten-left">
<image :src="`${$imgUrl}che.png`" mode=""></image> <image :src="`${$imgUrl}che.png`" mode=""></image>
<text>{{item.vehiclePlate}}</text> <text>{{item.vehiclePlate}}</text>
</view> </view>
</view> </view>
</view> </view>
<view v-else class="flex">
暂无车辆订单信息
<view v-else>
<empty title='暂无找到相关车辆信息' />
</view> </view>
</view> </view>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import empty from "@/components/empty/empty.vue";
import { import {
reactive, reactive,
ref ref
} from "@/utils/utils" } from "@/utils/utils"
import { import {
onLoad, onLoad,
onShow
} from "@dcloudio/uni-app"; } from "@dcloudio/uni-app";
import { import {
orderList orderList
import { import {
request request
} from "@/utils/network/request.js"; } from "@/utils/network/request.js";
import {
msg
} from "@/utils/utils";
import { import {
getItem, getItem,
StorageKeys, StorageKeys,
setItem
} from "@/utils/storage"; } from "@/utils/storage";
import { import {
stringToJson stringToJson
} from "@/utils/network/encryption"; } from "@/utils/network/encryption";
const state = reactive({ const state = reactive({
list: []
list: [] //车辆list
}); });
const flag = ref('0') //默认选择0
onLoad(() => { onLoad(() => {
quanCheckActionTrue().then((item: any) => { quanCheckActionTrue().then((item: any) => {
state.list = item.data state.list = item.data
console.log(item)
}) })
}); });
const quanCheckActionTrue = () => { const quanCheckActionTrue = () => {
var data = { var data = {
opId: getItem(StorageKeys.OpenId), opId: getItem(StorageKeys.OpenId),
source: 'WECHAT',
tabIndex: '0',
orderStep: '11',
isValueCard: '2'
source: 'WECHAT', //渠道为小程序
tabIndex: '0', //0全部
orderStep: '11', //11 为已完成”
}; };
const options = { const options = {
type: 2, type: 2,
reject(error); reject(error);
}); });
} }
const flag = ref('0')
const choose = (i, item) => { const choose = (i, item) => {
flag.value = i
navTo(`/after-sale/refund-order-balance/refund-order-balance?vehicleId=${item.vehicleId}`) navTo(`/after-sale/refund-order-balance/refund-order-balance?vehicleId=${item.vehicleId}`)
} }
</script> </script>

+ 53
- 0
components/empty/empty.vue 查看文件

<template>
<view class="content-wrapper">
<view class="picture-wrapper">
<image class="d-img" :src="`${$imgUrl}common/search.png`"></image>
</view>
<view class="title-wrapper">
<view class="title">
{{title}}
</view>
</view>
</view>
</template>
<script setup lang="ts">
defineProps({
//参照https://vkuviewdoc.fsq.pub/components/empty.html说明,也可自定义图片路径
title: {
type: String,
default: '暂未搜索到相关业务信息'
},
})
</script>
<style scoped lang="scss">
.content-wrapper {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: #EEF7F7;
.d-img {
width: 334rpx;
height: 237rpx;
}
.picture-wrapper {
margin-top: 200rpx;
display: flex;
justify-content: center;
}
.title-wrapper {
margin-top: 20rpx;
display: flex;
justify-content: center;
}
}
</style>

+ 0
- 3
pages/bluetooth/bluetooth.vue 查看文件

}); });
} }
else if(routeType.value == "5"){ else if(routeType.value == "5"){
// uni.navigateTo({
// url: "/after-sale/card-Renewal/renewal-confirm",
// });
uni.$emit('bluetoothLink',{status:true}) uni.$emit('bluetoothLink',{status:true})
uni.navigateBack({ uni.navigateBack({
delta:1 delta:1

+ 0
- 2
pages/recharge/recharge.vue 查看文件

getOpenID(); getOpenID();
/*传参*/ /*传参*/
state.cardId = option.cardId; state.cardId = option.cardId;
console.log(state.cardId);
console.log("888888888");
state.connectSuccess = option.connectSuccess; state.connectSuccess = option.connectSuccess;
state.orderNum = getItem("orderNum"); state.orderNum = getItem("orderNum");
if (state.connectSuccess === "1") { if (state.connectSuccess === "1") {

正在加载...
取消
保存