Ver código fonte

重新激活那还原代码

yxb
DESKTOP-2IO5MST\huting 1 ano atrás
pai
commit
d6ec2f0c10

+ 1
- 0
components/form-builder/form-builder.vue Ver arquivo

@@ -584,6 +584,7 @@
/* 整理数据对象返回内容 */
for (var i = 0; i < props.formData.length; i++) {
let data = props.formData[i];
console.log("data", data)
/* 时间另外判断 */
if (data.required && !data.hide) {
//隐藏的不用进行判断

+ 10
- 5
pages/bluetooth/bluetooth.vue Ver arquivo

@@ -546,14 +546,19 @@
uni.navigateTo({
url: "/subpackage/after-sale/deviceInfo/deviceInfo",
});
} else if (routeType.value == "5") {
// uni.$emit('bluetoothLink', { status: true })
// uni.navigateBack({
// delta: 1
// })
} else if (routeType.value == "5") {
// #ifdef MP-ALIPAY
uni.navigateTo({
url: "/subpackage/after-sale/activation-once-again/activation-once-again?state=true&id=" + state.id,
});
// #endif

// #ifdef MP-WEIXIN
uni.$emit('bluetoothLink', { status: true })
uni.navigateBack({
delta: 1
})
// #endif
} else if (routeType.value == "6") {
uni.navigateTo({
url: "/subpackage/after-sale/activation-once-again/activation-once-again?state=true&id=" + state.id

+ 2
- 2
pages/recharge/recharge-pay.vue Ver arquivo

@@ -21,12 +21,12 @@
</radio-group>
</view>
</view>
<view>
<!-- <view>
<view style="display: flex;align-items: center;">
<image class="photo" :src="fileURL + 'image/index/consumptionDetails.png'"></image>消费明细
</view>
<image class="photo1" src="../../static/image/icon-back.png" mode="widthFix"></image>
</view>
</view> -->
</view>
<view class="tips" v-if="source=='WECHAT'">温馨提示: <text class="red">NFC充值</text>仅支持在<text
class="red">安卓手机</text>进行ETC储值卡充值!</view>

+ 466
- 33
subpackage/after-sale/activation-once-again/activation-once-again.vue Ver arquivo

@@ -41,7 +41,7 @@
<view class="title"> 卡信息 </view>
<view class="card">
<view class="card-left">
<image :src="`${$imgUrl}card2.png`" mode="widthFix"></image>
<image :src="`${$imgUrl}card2.png`" mode=""></image>
<view class="card-center">
<view class="card-center-head"> {{orderInfos.cardId}} </view>
<view class="tips">
@@ -56,11 +56,11 @@
<view class="title"> OBU设备信息 </view>
<view class="card">
<view class="card-left">
<image :src="`${$imgUrl}card1.png`" mode="widthFix"></image>
<image :src="`${$imgUrl}card1.png`" mode=""></image>
<view class="card-center">
<view class="card-center-head"> {{orderInfos.obuId}} </view>
<view class="tips">
<text>OBU</text>
<!-- <text>储蓄卡</text> -->
<text class="tips-card">{{getCodeName('OBU_STATE_TYPE',orderInfos.obuStatus)}}</text>
</view>
<!-- <view class="choose-item"> 有效期:xxxx-xx-xx </view> -->
@@ -119,6 +119,7 @@
</template>

<script lang="ts" setup>
// #ifdef MP-ALIPAY
import viewfinder from "@/components/viewfinder.vue"
import {
reactive,
@@ -215,34 +216,462 @@
wheelCount: "",
isJH: ""
});
let cmdRandNum = '';
let ids = '';

onLoad((option) => {
console.log('======重新激活开始======', option);
ids = option.id;
//请求订单详情
queryOrderDetail(option.id);
// uni.$on('bluetoothLink', res => {
// console.log(res,'===========123');
// if (res.status) {
// // getCardRenewal()
// setTimeout(()=>{
// getObuId()
// })
// }
// //移除监听
// console.log('======移除监听======', res)
// // uni.$off('bluetoothLink')
// })

if (option.state) {
getObuId()

});

onShow((option) => {
uni.$on('bluetoothLink', res => {
console.log(res);
if (res.status) {
// getCardRenewal()
getObuId()
}
//移除监听
console.log('======移除监听======', res)

// uni.$off('bluetoothLink')
})

})

const cancel = () => {
state.showPopup = false;
uni.navigateBack({
delta: 2
})
};

const toPage = () => {
if (!state.form.vehPosImgUrl) {
msg("请上传行驶证主页")
return;
}
if (!state.form.vehNegImgUrl) {
msg("请上传行驶证副页")
return;
}
console.log("state.form.vehicleIdNum", state.form.vehicleIdNum, orderInfos.vehiclePlate)
if (state.form.vehicleIdNum == orderInfos.vehiclePlate) {
activationRecordQuery().then((val) => {
console.log("激活次数", val)
if (val.limit) {
navTo("/pages/bluetooth/bluetooth?routeType=5");
} else {
msg("一年内到达激活次数上限5次")
}
});
} else {
msg("请上传正确行驶证")
}

};

//获取订单详情
const queryOrderDetail = (id : string) => {
const options = {
type: 2,
data: {
id: id,
},
method: "POST",
showLoading: true,
};
request(IFCODE.orderDetail, options).then((res) => {
let orderInfo = JSON.parse(res.bizContent);
console.log(orderInfo);
orderInfos.orderId = orderInfo.orderId;
orderInfos.ownerName = orderInfo.ownerName;
orderInfos.ownerIdtype = orderInfo.ownerIdtype;
orderInfos.ownerIdnum = orderInfo.ownerIdnum;
orderInfos.vehiclePlate = orderInfo.vehiclePlate;
orderInfos.vehiclePlateColorStr = orderInfo.vehiclePlateColorStr;
orderInfos.vehiclePlateColor = orderInfo.vehiclePlateColor;
orderInfos.vehicleType = orderInfo.vehicleType;
orderInfos.cardId = orderInfo.cardId;
orderInfos.cardStatus = orderInfo.cardStatus;
orderInfos.obuId = orderInfo.obuId;
orderInfos.obuStatus = orderInfo.obuStatus;
let arr = orderInfo.vehicleDimensions.split("X");
orderInfos.outlineL = parseInt(arr[0]); //外廓 长
orderInfos.outlineW = parseInt(arr[1]); //外廓 宽
orderInfos.outlineH = parseInt(arr[2].substring(0, arr[2].length - 2)); //外廓 高

orderInfos.type = orderInfo.type;
orderInfos.axleCount = orderInfo.vehicleAxleCount;
orderInfos.approvedCount = orderInfo.vehicleApprovedCount;
orderInfos.vehicleVin = orderInfo.vehicleVin;
orderInfos.vehicleEngineNum = orderInfo.vehicleEngineNum;
activationRecordQuery().then((val) => {
console.log("jihuo", val)
state.activationNum = val.num
});

});
};

/**
* 获取OBU号 读OBU
*/
const getObuId = () => {
console.log('======获取OBU号======')
let cmdArray = [cmd.HOME_DIRECTORY, cmd.OBU_SYSTEM_FILE, cmd.RANDOM_NUMBER];
tools.showLoadingAlert("正在执行指令");
bluetoothUtil.transCmd(cmdArray, "20", function (res) {
tools.hideLoadingAlert();
var status = res[1].substring(res[1].length - 4, res[1].length);
console.log('获取OBU号执行结果' + status)
//第一次获取随机数
if (status == "9000") {
obu.obuId = res[1].substring(20, 36);
obu.vin = res[1].substring(18, 20);
obu.version = res[1].substring(18, 19) >= 4 ? "4x" : "2x";
getInstallApply()
// cmdRandNum = res[2].substring(0, res[2].length - 4);
}
});
};

/**
* BDS-安装申请 请求
*/
const getInstallApply = () => {
console.log('======安装申请======')
tools.showLoadingAlert("加载中");
let options = {
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
data: {
obuId: obu.obuId,
vehicleId: orderInfos.vehiclePlate + "_" + orderInfos.vehiclePlateColor,
orderId: orderInfos.orderId,
agentId: agentId,
channelId: channelId,
channelType: "1",
staffId: "opId",
terminalId: "999999999",
}, //请求参数
method: "POST", //提交方式(默认POST)
showLoading: true, //是否显示加载中(默认显示)
};
//调用方式
request(IFCODE.installApply, options)
.then(() => {
tools.hideLoadingAlert();
//再次获取随机数
let cmdArr = [cmd.HOME_DIRECTORY, cmd.RANDOM_NUMBER];
bluetoothUtil.transCmd(cmdArr, '20', function (res) {
var str = res[1].substring(res[1].length - 4, res[1].length);
if (str == "9000") {
let cmdRandNum = res[1].substring(0, res[1].length - 4);
getObuActivation(cmdRandNum);
} else {
tools.alertF("RANDOM_NUMBER指令长度不符" + res[1]);
}
})
})
};

/**
* VFJ-OBU在线激活 请求
*/
const getObuActivation = (cmdRandNum : string) => {
console.log('======VFJ-OBU在线激活======')
tools.showLoadingAlert("加载中");
let options = {
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
data: {
random: cmdRandNum,
obuSerailNo: obu.obuId,
orderId: orderInfos.orderId,
}, //请求参数
method: "POST", //提交方式(默认POST)
showLoading: true, //是否显示加载中(默认显示)
};
//调用方式
request(IFCODE.obuActivation, options)
.then((res) => {
tools.hideLoadingAlert();
console.log("在线激活 请求");
console.log(stringToJson(res.bizContent));
const datas = stringToJson(res.bizContent);
tools.showLoadingAlert("执行指令");
bluetoothUtil.transCmd([datas.data.APDU], "20", function (res) {
tools.hideLoadingAlert();
console.log(res);
if (res[0] == "9000") {
console.log("在线激活执行指令88888 请求", res);
getObuInstall(0, ""); //status 0 - 安装成功 || 1 - 安装失败
}
});
})
.catch((err) => {
console.log(err);
});
};

/**
* BDS-安装确认 请求
*/
const getObuInstall = (status : number, reason : string) => {
console.log('======OBU安装确认======')
tools.showLoadingAlert("加载中");
let options = {
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
data: {
installStatus: status,
failReason: reason,
installType: "1",
installChannelId: channelId,
obuId: obu.obuId,
orderId: orderInfos.orderId
}, //请求参数
method: "POST", //提交方式(默认POST)
showLoading: true, //是否显示加载中(默认显示)
};
//调用方式
request(IFCODE.obuInstall, options)
.then(() => {
tools.hideLoadingAlert();
state.showPopup = true;
submitVehicleQuery()
});

};
const xiangce = (val) => {
console.log("val", val)
if (state.choiceIndex == 3) {
var imageType = 1;
} else {
var imageType = 2;
}
state.changeColor = true;
uni.chooseImage({
count: 1, //只能选取一张照片
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
sourceType: ["album"], //从相册选择
success: function (res) {
console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
if (state.choiceIndex == 3 || state.choiceIndex == 4) {
state.showImg = false
state.images = res.tempFilePaths[0]
state.phoneType = state.choiceIndex
state.isTakePhotoModeShow = false
return
}
},
})
}
const takePhoto = (val) => {
console.log("拍照", val)
state.phoneType = val;
state.showImg = true;
}
const confirmReturn = (val) => {
if (state.choiceIndex == 3) {
var imageType = 1;
} else {
var imageType = 2;
}
state.changeColor = true;
state.phoneType = 0
state.isTakePhotoModeShow = false
uploadFile(val.tempImagePath, imageType, IFCODE.etcCarOcrCard).then((data) => {
// uploadFile(val.tempImagePath, state.choiceIndex, ocrAllQuery).then((data) => {
console.log('输出内容=====================', state.choiceIndex)
if (state.choiceIndex === "3") {
if (data.plate_a.length > 8) {
state.form.vehicleIdNum = data.plate_a.substring(0, 8);
} else {
state.form.vehicleIdNum = data.plate_a;
}
state.form.vehPosImgUrl = data.imageUrl;

} else {
state.form.vehNegImgUrl = data.imageUrl;
console.log('=====================', state.form.vehNegImgUrl, state)
}
state.isTakePhotoModeShow = false
})
console.log("图片地址val", val.tempImagePath)
}
const takePhotoMode = (index) => {
console.log("index", index)
state.isTakePhotoModeShow = true
state.choiceIndex = index
}
const cancle = () => {
state.isTakePhotoModeShow = false
}
const camera = () => {
state.phoneType = 0
}
// 查询重新激活记录
const activationRecordQuery = () => {
const options = {
type: 2,
data: {
cardId: orderInfos.cardId,
obuId: orderInfos.obuId,
},
method: "POST",
showLoading: true,
};

return new Promise(async (resolve, reject) => {
const res = await request(IFCODE.activationRecordApi, options);
const data = stringToJson(res.bizContent);
resolve(data);
}).catch((error) => {
reject(error);
});
}
// 提交车辆信息
const submitVehicleQuery = () => {
const options = {
type: 2,
data: {
cardId: orderInfos.cardId,
obuId: orderInfos.obuId,
vehPosImgUrl: state.form.vehPosImgUrl,
vehNegImgUrl: state.form.vehNegImgUrl,
vehiclePlate: orderInfos.vehiclePlate
},
method: "POST",
};
console.log("提交车辆信息成功", options)
request(IFCODE.submitVehicleApi, options).then(() => {
console.log("提交车辆信息成功")
});
}
const goActivationRecord = () => {
uni.navigateTo({
url: `/subpackage/after-sale/activation-once-again/activation-once-again-record?obuId=${orderInfos.obuId}&&cardId=${orderInfos.cardId}`
})
}

// #endif

// #ifdef MP-WEIXIN
import viewfinder from "@/components/viewfinder.vue"
import {
reactive,
ref
} from "vue";
import {
formatTime,
expireDate,
expireDate2,
getFormatDate,
msg,
navTo,
strReplace,
uploadFile
} from "@/utils/utils";
import {
onLoad, onShow
} from '@dcloudio/uni-app'
import {
request
} from "@/utils/network/request.js";
import {
stringToJson
} from "@/utils/network/encryption.js";
import activeSuccess from "./components/popup-device-active-success";
import * as IFCODE from "@/utils/network/api.js";
import {
channelId
} from "@/utils/network/difference";
const cmd = require("../../../static/etcUtil/cmdConfig.js");
const tools = require("../../../static/etcUtil/tools.js");
const bluetoothUtil = require("../../../static/etcUtil/index.js");
import {
getCodeName
} from "@/datas/queryKey.js";
import { agentId } from "@/utils/network/difference";


const state = reactive({
phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
choiceIndex: 1, // 1 身份证正面 2 身份证反面
isTakePhotoModeShow: false, //选择拍照方式是否出来
changeColor: false,
showImg: true,
images: '',
showPopup: false,
form: {
vehPosImgUrl: "",
vehNegImgUrl: "",
vehicleIdNum: ""
},
activationNum: "",//激活次数
})

//订单
const orderInfos = reactive({
orderId: "",
ownerName: "",
ownerIdtype: "",
ownerIdnum: "",
vehiclePlate: "",
vehiclePlateColorStr: "",
vehiclePlateColor: "",
vehicleType: "",
cardId: "",
cardStatus: "",
obuId: "",
obuStatus: "",
outlineL: 0,
outlineW: 0,
outlineH: 0,
type: 0,
axleCount: 0,
approvedCount: 0,
vehicleVin: "",
vehicleEngineNum: "",
});
//OBU
const obu = reactive({
obuId: "",
startTime: "",
endTime: "",
version: "",
approvedCount: "",
axleCount: "",
axleDistance: "",
engineNum: "",
type: "",
userType: "",
contractNo: "",
vehiclePlate: "",
vehiclePlateColor: "",
vin: "",
wheelCount: "",
isJH: ""
});

onLoad((option) => {
console.log('======重新激活开始======', option);
//请求订单详情
queryOrderDetail(option.id);

});

onShow((option) => {
uni.$on('bluetoothLink', res => {
console.log(res);
if (res.status) {
// getCardRenewal()
getObuId()
}
//移除监听
console.log('======移除监听======', res)

// uni.$off('bluetoothLink')
})

})

@@ -267,7 +696,7 @@
activationRecordQuery().then((val) => {
console.log("激活次数", val)
if (val.limit) {
navTo("/pages/bluetooth/bluetooth?routeType=5&id=" + ids);
navTo("/pages/bluetooth/bluetooth?routeType=5");
} else {
msg("一年内到达激活次数上限5次")
}
@@ -276,7 +705,6 @@
msg("请上传正确行驶证")
}

// navTo("/pages/bluetooth/bluetooth?routeType=6&id=" + ids);
};

//获取订单详情
@@ -317,7 +745,6 @@
activationRecordQuery().then((val) => {
console.log("jihuo", val)
state.activationNum = val.num
// getObuId()
});

});
@@ -339,12 +766,10 @@
obu.obuId = res[1].substring(20, 36);
obu.vin = res[1].substring(18, 20);
obu.version = res[1].substring(18, 19) >= 4 ? "4x" : "2x";
cmdRandNum = res[2].substring(0, res[2].length - 4);
console.log("obu.obuId===========", obu.obuId, res[1].substring(20, 36), cmdRandNum)
getInstallApply()
// cmdRandNum = res[2].substring(0, res[2].length - 4);
}
});
// getInstallApply()
};

/**
@@ -373,7 +798,16 @@
.then(() => {
tools.hideLoadingAlert();
//再次获取随机数
getObuActivation(cmdRandNum);
let cmdArr = [cmd.HOME_DIRECTORY, cmd.RANDOM_NUMBER];
bluetoothUtil.transCmd(cmdArr, '20', function (res) {
var str = res[1].substring(res[1].length - 4, res[1].length);
if (str == "9000") {
let cmdRandNum = res[1].substring(0, res[1].length - 4);
getObuActivation(cmdRandNum);
} else {
tools.alertF("RANDOM_NUMBER指令长度不符" + res[1]);
}
})
})
};

@@ -481,10 +915,10 @@
state.changeColor = true;
state.phoneType = 0
state.isTakePhotoModeShow = false
uploadFile(val.tempImagePath, imageType, IFCODE.etcCarOcrCard).then((data : any) => {
uploadFile(val.tempImagePath, imageType, IFCODE.etcCarOcrCard).then((data) => {
// uploadFile(val.tempImagePath, state.choiceIndex, ocrAllQuery).then((data) => {
console.log('输出内容=====================', state.choiceIndex)
if (state.choiceIndex == "3") {
if (state.choiceIndex === "3") {
if (data.plate_a.length > 8) {
state.form.vehicleIdNum = data.plate_a.substring(0, 8);
} else {
@@ -554,6 +988,7 @@
url: `/subpackage/after-sale/activation-once-again/activation-once-again-record?obuId=${orderInfos.obuId}&&cardId=${orderInfos.cardId}`
})
}
// #endif
</script>

<style>
@@ -637,7 +1072,6 @@
font-weight: 400;
color: #999999;
margin-bottom: 30rpx;
align-items: center;

text {
font-size: 26rpx;
@@ -683,7 +1117,6 @@
font-family: Noto Sans S Chinese;
font-weight: 400;
color: #666666;
margin-top: 10rpx;

.tips-card {
width: 70rpx;
@@ -843,6 +1276,6 @@
font-weight: 400;
color: #0a8f8a;
padding: 5rpx 10rpx;
margin-left: 30rpx;
margin-left: 60rpx;
}
</style>

+ 4
- 1
subpackage/after-sale/add-equity/add-equity.vue Ver arquivo

@@ -87,7 +87,10 @@
.add {
background: white;
border-radius: 10rpx;
padding: 4rpx 4rpx;
padding: 6rpx 14rpx;
color: #000;
white-space: nowrap;
display: inline-block;
margin-left: 20rpx;
}
</style>

+ 23
- 4
subpackage/after-sale/add-equity/choice-order.vue Ver arquivo

@@ -16,6 +16,7 @@
<view v-else>
<empty title='暂无找到相关订单信息' />
</view>
<view class="bottom-line" v-if="state.flags">我是有底线的~~~</view>
</view>
</template>

@@ -30,7 +31,7 @@
navTo
} from "@/utils/utils"
import {
onLoad,
onLoad, onReachBottom
} from "@dcloudio/uni-app";
import {
orderList, addEquityListApi
@@ -52,6 +53,9 @@
const state = reactive({
list: [],//车辆list,
equtyId: "",//权益id
pageSize: 10, //每页数据量
pageNo: 1, // 当前页
flags: false,
});
const flag = ref('0') //默认选择0
//获取车牌颜色文字
@@ -64,7 +68,7 @@
state.equtyId = option.equtyId
quanCheckActionTrue().then((item : any) => {
console.log("1", item.data)
state.list = item.data
state.list = [...item.data, ...state.list]
})
});

@@ -81,8 +85,8 @@
"source": source,
"vehiclePlate": "",
"tabIndex": "0",
"pageNo": 1,
"pageSize": 1000,
"pageNo": state.pageNo,
"pageSize": state.pageSize,
"promotionModes": 1,
"isAfter": true,
"orderStatus": 1
@@ -164,6 +168,16 @@
}, 2000)
})
}
// 触底加载
onReachBottom(() => {
if (state.list.length < state.pageNo * 10) return state.flags = true
console.log("触底了")
state.pageNo++
quanCheckActionTrue().then((item : any) => {
console.log("1", item.data)
state.list = [...item.data, ...state.list]
})
})
</script>

<style>
@@ -229,4 +243,9 @@
}
}
}

.bottom-line {
text-align: center;
margin: 30rpx 0;
}
</style>

+ 7
- 2
subpackage/after-sale/business-processie.vue Ver arquivo

@@ -17,15 +17,19 @@
</view>


<view class="uni-container">
<view class="uni-container" v-if="state.listData.length>0">
<view class="list-item" v-for="(item,index) in state.listData">
<view><text>业务类型:</text><text>{{item.serviceType}}</text></view>
<view><text>操作时间:</text><text>{{item.operateTime}}</text></view>
<view><text>业务标识:</text><text>{{item.uniqueId}}</text></view>
<view><text>日志记录时间:</text><text>{{item.insertTime}}</text></view>
</view>
<view class="bottom-line" v-if="state.flags">我是有底线的~~~</view>
</view>
<view class="bottom-line" v-if="state.flags">我是有底线的~~~</view>
<view v-else class="uni-container" style="text-align: center;">
暂无数据
</view>

</view>

</template>
@@ -35,6 +39,7 @@
import {
businessType
} from "@/datas/businessType.js"
import empty from "@/components/empty/empty.vue";
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
import { businessApi } from "@/utils/network/api.js";
import { stringToJson } from "@/utils/network/encryption";

+ 1
- 1
subpackage/after-sale/card-loss-reporting/cardloss.vue Ver arquivo

@@ -281,7 +281,7 @@
position: fixed;
left: 50%;
transform: translate(-50%);
bottom: 60rpx;
bottom: 100rpx;
font-size: 32rpx;
}
</style>

+ 225
- 229
subpackage/orders/apply-return-goods.vue Ver arquivo

@@ -1,252 +1,248 @@
<!-- 申请退货 -->
<template>
<view class="box">
<form-builder
:config="config"
:formData="state.formData"
@submit="submit"
@radioChange="radioChange"
/>
</view>
<view class="box">
<form-builder :config="config" :formData="state.formData" @submit="submit" @radioChange="radioChange" />
</view>
</template>

<script setup lang="ts">
import { reactive } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { msg, confirm, getOrderStatusName } from "@/utils/utils";
import { request } from "@/utils/network/request";
import { getLogistics, orderReturn, outletList } from "@/utils/network/api";
import { stringToJson } from "@/utils/network/encryption";
import { getItem, StorageKeys } from "@/utils/storage";
import { reactive } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { msg, confirm, getOrderStatusName } from "@/utils/utils";
import { request } from "@/utils/network/request";
import { getLogistics, orderReturn, outletList } from "@/utils/network/api";
import { stringToJson } from "@/utils/network/encryption";
import { getItem, StorageKeys } from "@/utils/storage";

const config = {
submitName: "申请退货",
titleWidth: 160,
divider: true,
};
const config = {
submitName: "申请退货",
titleWidth: 160,
divider: true,
};

const state = reactive({
//订单信息
orderInfo: {} as any,
//退货类型: OFFLINE-线下 ON_LINE-线上
returnMode: "ON_LINE",
//网点列表
outlets: [],
//表单数据
formData: [
{
title: "订单编号:",
inputType: "number",
type: 2,
value: "id",
hint: "订单编号",
disabled: true,
divider: true,
},
{
title: "订单车牌号:",
type: 2,
value: "vehiclePlate",
hint: "订单车牌号",
disabled: true,
divider: true,
},
{
title: "订单状态:",
type: 2,
value: "orderStep",
hint: "订单状态",
disabled: true,
divider: true,
},
{
title: "退货方式:",
type: 7,
value: "returnMode",
star: true,
required: true,
divider: true,
emptyHint: "请选择退货方式",
itemData: [
{
checked: false,
value: "ON_LINE",
name: "线上",
},
{
checked: false,
value: "OFFLINE",
name: "线下",
},
],
},
const state = reactive({
//订单信息
orderInfo: {} as any,
//退货类型: OFFLINE-线下 ON_LINE-线上
returnMode: "ON_LINE",
//网点列表
outlets: [],
//表单数据
formData: [
{
title: "订单编号:",
inputType: "number",
type: 2,
value: "id",
hint: "订单编号",
disabled: true,
divider: true,
},
{
title: "订单车牌号:",
type: 2,
value: "vehiclePlate",
hint: "订单车牌号",
disabled: true,
divider: true,
},
{
title: "订单状态:",
type: 2,
value: "orderStep",
hint: "订单状态",
disabled: true,
divider: true,
},
{
title: "退货方式:",
type: 7,
value: "returnMode",
returnMode: "ON_LINE",
star: true,
required: true,
divider: true,
emptyHint: "请选择退货方式",
itemData: [
{
checked: true,
value: "ON_LINE",
name: "线上",
},
{
checked: false,
value: "OFFLINE",
name: "线下",
},
],
},

{
title: "物流公司:",
type: 4,
value: "returnLogisticsCompany",
required: true,
star: true,
hint: "请输入",
divider: true,
itemData: [],
hide: false,
emptyHint: "请选择物流公司",
mode: "search",
searchPickerVisible: false,
},
{
title: "物流单号:",
type: 2,
value: "returnLogisticsNumber",
required: true,
maxlength: 20,
hint: "请输入",
emptyHint: "请输入物流单号",
star: true,
divider: true,
hide: false,
},
{
title: "退货网点编号:",
type: 4,
value: "returnNetworkName",
required: true,
star: true,
hint: "请输入",
emptyHint: "请选择退货网点",
divider: true,
itemData: [],
hide: true,
mode: "search",
searchPickerVisible: false,
},
{
title: "退货原因:",
required: true,
type: 5,
vertical: 2,
value: "returnReason",
maxlength: 50,
bg: true,
star: true,
hint: "请输入退货原因,限制50字以内",
emptyHint: "请输入退货原因",
},
],
});
{
title: "物流公司:",
type: 4,
value: "returnLogisticsCompany",
required: true,
star: true,
hint: "请输入",
divider: true,
itemData: [],
hide: false,
emptyHint: "请选择物流公司",
mode: "search",
searchPickerVisible: false,
},
{
title: "物流单号:",
type: 2,
value: "returnLogisticsNumber",
required: true,
maxlength: 20,
hint: "请输入",
emptyHint: "请输入物流单号",
star: true,
divider: true,
hide: false,
},
{
title: "退货网点编号:",
type: 4,
value: "returnNetworkName",
required: true,
star: true,
hint: "请输入",
emptyHint: "请选择退货网点",
divider: true,
itemData: [],
hide: true,
mode: "search",
searchPickerVisible: false,
},
{
title: "退货原因:",
required: true,
type: 5,
vertical: 2,
value: "returnReason",
maxlength: 50,
bg: true,
star: true,
hint: "请输入退货原因,限制50字以内",
emptyHint: "请输入退货原因",
},
],
});

/* 获取所有的快递公司 */
const getLogisticsList = () => {
const options = {
type: 2,
data: {},
method: "POST",
showLoading: true,
};
/* 获取所有的快递公司 */
const getLogisticsList = () => {
const options = {
type: 2,
data: {},
method: "POST",
showLoading: true,
};

request(getLogistics, options).then((res) => {
const data = stringToJson(res.bizContent);
state.formData[4].itemData = data;
});
};
request(getLogistics, options).then((res) => {
const data = stringToJson(res.bizContent);
state.formData[4].itemData = data;
});
};

/* 获取退货网点 */
const getOutletList = () => {
const options = {
type: 2,
data: {},
method: "POST",
showLoading: true,
};
/* 获取退货网点 */
const getOutletList = () => {
const options = {
type: 2,
data: {},
method: "POST",
showLoading: true,
};

request(outletList, options).then((res) => {
state.outlets = stringToJson(res.bizContent);
let nameList = [];
state.outlets.map((item) => {
nameList.push(item.name);
});
state.formData[6].itemData = nameList;
});
};
request(outletList, options).then((res) => {
state.outlets = stringToJson(res.bizContent);
let nameList = [];
state.outlets.map((item) => {
nameList.push(item.name);
});
state.formData[6].itemData = nameList;
});
};

//radio改变
const radioChange = (e: any, item: any) => {
if (item.value === "returnMode") {
//退货方式
state.returnMode = item.returnMode;
state.formData[4].hide = state.returnMode === "ON_LINE" ? false : true;
state.formData[5].hide = state.returnMode === "ON_LINE" ? false : true;
state.formData[6].hide = state.returnMode === "ON_LINE" ? true : false;
}
};
//radio改变
const radioChange = (e : any, item : any) => {
if (item.value === "returnMode") {
//退货方式
state.returnMode = item.returnMode;
state.formData[4].hide = state.returnMode === "ON_LINE" ? false : true;
state.formData[5].hide = state.returnMode === "ON_LINE" ? false : true;
state.formData[6].hide = state.returnMode === "ON_LINE" ? true : false;
}
};

//提交退货申请
const submit = (e: any) => {
confirm(
"是否确认退货?",
() => {
const curOutlet = state.outlets.find(
(out) => out.name === e.returnNetworkName
);
const options = {
type: 2,
data: {
id: state.orderInfo.id,
returnMode: e.returnMode,
// returnNetworkId: curOutlet == null ? "" : curOutlet.servicehallId,
returnNetworkId: e.returnNetworkName,
returnNetworkName: e.returnNetworkName,
returnLogisticsCompany: e.returnLogisticsCompany,
returnLogisticsNumber: e.returnLogisticsNumber,
returnReason: e.returnReason,
opId: getItem(StorageKeys.OpenId),
},
method: "POST",
showLoading: true,
};
//提交退货申请
const submit = (e : any) => {
confirm(
"是否确认退货?",
() => {
const curOutlet = state.outlets.find(
(out) => out.name === e.returnNetworkName
);
const options = {
type: 2,
data: {
id: state.orderInfo.id,
returnMode: e.returnMode,
// returnNetworkId: curOutlet == null ? "" : curOutlet.servicehallId,
returnNetworkId: e.returnNetworkName,
returnNetworkName: e.returnNetworkName,
returnLogisticsCompany: e.returnLogisticsCompany,
returnLogisticsNumber: e.returnLogisticsNumber,
returnReason: e.returnReason,
opId: getItem(StorageKeys.OpenId),
},
method: "POST",
showLoading: true,
};

request(orderReturn, options).then((res) => {
confirm(
"您申办的ETC订单已申请退货",
() => {
uni.$emit("refreshOrder");
uni.navigateBack();
},
"申请成功",
false
);
});
},
"退货确认",
true
);
};
request(orderReturn, options).then((res) => {
confirm(
"您申办的ETC订单已申请退货",
() => {
uni.$emit("refreshOrder");
uni.navigateBack();
},
"申请成功",
false
);
});
},
"退货确认",
true
);
};

onLoad((option) => {
state.orderInfo = JSON.parse(option.data);
state.formData[0].hint = state.orderInfo.orderId;
state.formData[1].hint = state.orderInfo.vehiclePlate;
state.formData[2].hint = getOrderStatusName(state.orderInfo.orderStep);
onLoad((option) => {
state.orderInfo = JSON.parse(option.data);
state.formData[0].hint = state.orderInfo.orderId;
state.formData[1].hint = state.orderInfo.vehiclePlate;
state.formData[2].hint = getOrderStatusName(state.orderInfo.orderStep);

//获取物流公司
getLogisticsList();
//获取物流公司
getLogisticsList();

//获取退货网点
getOutletList();
});
//获取退货网点
getOutletList();
});
</script>

<style>
page {
background-color: #f3f3f3;
padding-bottom: 30rpx;
}
page {
background-color: #f3f3f3;
padding-bottom: 30rpx;
}
</style>
<style lang="scss" scoped>
.box {
margin: 20rpx 0rpx;
background-color: white;
padding: 0 20rpx 20rpx;
}
</style>
.box {
margin: 20rpx 0rpx;
background-color: white;
padding: 0 20rpx 20rpx;
}
</style>

Carregando…
Cancelar
Salvar