/* 整理数据对象返回内容 */ | /* 整理数据对象返回内容 */ | ||||
for (var i = 0; i < props.formData.length; i++) { | for (var i = 0; i < props.formData.length; i++) { | ||||
let data = props.formData[i]; | let data = props.formData[i]; | ||||
console.log("data", data) | |||||
/* 时间另外判断 */ | /* 时间另外判断 */ | ||||
if (data.required && !data.hide) { | if (data.required && !data.hide) { | ||||
//隐藏的不用进行判断 | //隐藏的不用进行判断 |
uni.navigateTo({ | uni.navigateTo({ | ||||
url: "/subpackage/after-sale/deviceInfo/deviceInfo", | 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({ | uni.navigateTo({ | ||||
url: "/subpackage/after-sale/activation-once-again/activation-once-again?state=true&id=" + state.id, | 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") { | } else if (routeType.value == "6") { | ||||
uni.navigateTo({ | uni.navigateTo({ | ||||
url: "/subpackage/after-sale/activation-once-again/activation-once-again?state=true&id=" + state.id | url: "/subpackage/after-sale/activation-once-again/activation-once-again?state=true&id=" + state.id |
</radio-group> | </radio-group> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view> | |||||
<!-- <view> | |||||
<view style="display: flex;align-items: center;"> | <view style="display: flex;align-items: center;"> | ||||
<image class="photo" :src="fileURL + 'image/index/consumptionDetails.png'"></image>消费明细 | <image class="photo" :src="fileURL + 'image/index/consumptionDetails.png'"></image>消费明细 | ||||
</view> | </view> | ||||
<image class="photo1" src="../../static/image/icon-back.png" mode="widthFix"></image> | <image class="photo1" src="../../static/image/icon-back.png" mode="widthFix"></image> | ||||
</view> | |||||
</view> --> | |||||
</view> | </view> | ||||
<view class="tips" v-if="source=='WECHAT'">温馨提示: <text class="red">NFC充值</text>仅支持在<text | <view class="tips" v-if="source=='WECHAT'">温馨提示: <text class="red">NFC充值</text>仅支持在<text | ||||
class="red">安卓手机</text>进行ETC储值卡充值!</view> | class="red">安卓手机</text>进行ETC储值卡充值!</view> |
<view class="title"> 卡信息 </view> | <view class="title"> 卡信息 </view> | ||||
<view class="card"> | <view class="card"> | ||||
<view class="card-left"> | <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"> | ||||
<view class="card-center-head"> {{orderInfos.cardId}} </view> | <view class="card-center-head"> {{orderInfos.cardId}} </view> | ||||
<view class="tips"> | <view class="tips"> | ||||
<view class="title"> OBU设备信息 </view> | <view class="title"> OBU设备信息 </view> | ||||
<view class="card"> | <view class="card"> | ||||
<view class="card-left"> | <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"> | ||||
<view class="card-center-head"> {{orderInfos.obuId}} </view> | <view class="card-center-head"> {{orderInfos.obuId}} </view> | ||||
<view class="tips"> | <view class="tips"> | ||||
<text>OBU</text> | |||||
<!-- <text>储蓄卡</text> --> | |||||
<text class="tips-card">{{getCodeName('OBU_STATE_TYPE',orderInfos.obuStatus)}}</text> | <text class="tips-card">{{getCodeName('OBU_STATE_TYPE',orderInfos.obuStatus)}}</text> | ||||
</view> | </view> | ||||
<!-- <view class="choose-item"> 有效期:xxxx-xx-xx </view> --> | <!-- <view class="choose-item"> 有效期:xxxx-xx-xx </view> --> | ||||
</template> | </template> | ||||
<script lang="ts" setup> | <script lang="ts" setup> | ||||
// #ifdef MP-ALIPAY | |||||
import viewfinder from "@/components/viewfinder.vue" | import viewfinder from "@/components/viewfinder.vue" | ||||
import { | import { | ||||
reactive, | reactive, | ||||
wheelCount: "", | wheelCount: "", | ||||
isJH: "" | isJH: "" | ||||
}); | }); | ||||
let cmdRandNum = ''; | |||||
let ids = ''; | |||||
onLoad((option) => { | onLoad((option) => { | ||||
console.log('======重新激活开始======', option); | console.log('======重新激活开始======', option); | ||||
ids = option.id; | |||||
//请求订单详情 | //请求订单详情 | ||||
queryOrderDetail(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) => { | onShow((option) => { | ||||
uni.$on('bluetoothLink', res => { | |||||
console.log(res); | |||||
if (res.status) { | |||||
// getCardRenewal() | |||||
getObuId() | |||||
} | |||||
//移除监听 | |||||
console.log('======移除监听======', res) | |||||
// uni.$off('bluetoothLink') | |||||
}) | |||||
}) | }) | ||||
activationRecordQuery().then((val) => { | activationRecordQuery().then((val) => { | ||||
console.log("激活次数", val) | console.log("激活次数", val) | ||||
if (val.limit) { | if (val.limit) { | ||||
navTo("/pages/bluetooth/bluetooth?routeType=5&id=" + ids); | |||||
navTo("/pages/bluetooth/bluetooth?routeType=5"); | |||||
} else { | } else { | ||||
msg("一年内到达激活次数上限5次") | msg("一年内到达激活次数上限5次") | ||||
} | } | ||||
msg("请上传正确行驶证") | msg("请上传正确行驶证") | ||||
} | } | ||||
// navTo("/pages/bluetooth/bluetooth?routeType=6&id=" + ids); | |||||
}; | }; | ||||
//获取订单详情 | //获取订单详情 | ||||
activationRecordQuery().then((val) => { | activationRecordQuery().then((val) => { | ||||
console.log("jihuo", val) | console.log("jihuo", val) | ||||
state.activationNum = val.num | state.activationNum = val.num | ||||
// getObuId() | |||||
}); | }); | ||||
}); | }); | ||||
obu.obuId = res[1].substring(20, 36); | obu.obuId = res[1].substring(20, 36); | ||||
obu.vin = res[1].substring(18, 20); | obu.vin = res[1].substring(18, 20); | ||||
obu.version = res[1].substring(18, 19) >= 4 ? "4x" : "2x"; | 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() | getInstallApply() | ||||
// cmdRandNum = res[2].substring(0, res[2].length - 4); | |||||
} | } | ||||
}); | }); | ||||
// getInstallApply() | |||||
}; | }; | ||||
/** | /** | ||||
.then(() => { | .then(() => { | ||||
tools.hideLoadingAlert(); | 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]); | |||||
} | |||||
}) | |||||
}) | }) | ||||
}; | }; | ||||
state.changeColor = true; | state.changeColor = true; | ||||
state.phoneType = 0 | state.phoneType = 0 | ||||
state.isTakePhotoModeShow = false | 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) => { | // uploadFile(val.tempImagePath, state.choiceIndex, ocrAllQuery).then((data) => { | ||||
console.log('输出内容=====================', state.choiceIndex) | console.log('输出内容=====================', state.choiceIndex) | ||||
if (state.choiceIndex == "3") { | |||||
if (state.choiceIndex === "3") { | |||||
if (data.plate_a.length > 8) { | if (data.plate_a.length > 8) { | ||||
state.form.vehicleIdNum = data.plate_a.substring(0, 8); | state.form.vehicleIdNum = data.plate_a.substring(0, 8); | ||||
} else { | } else { | ||||
url: `/subpackage/after-sale/activation-once-again/activation-once-again-record?obuId=${orderInfos.obuId}&&cardId=${orderInfos.cardId}` | url: `/subpackage/after-sale/activation-once-again/activation-once-again-record?obuId=${orderInfos.obuId}&&cardId=${orderInfos.cardId}` | ||||
}) | }) | ||||
} | } | ||||
// #endif | |||||
</script> | </script> | ||||
<style> | <style> | ||||
font-weight: 400; | font-weight: 400; | ||||
color: #999999; | color: #999999; | ||||
margin-bottom: 30rpx; | margin-bottom: 30rpx; | ||||
align-items: center; | |||||
text { | text { | ||||
font-size: 26rpx; | font-size: 26rpx; | ||||
font-family: Noto Sans S Chinese; | font-family: Noto Sans S Chinese; | ||||
font-weight: 400; | font-weight: 400; | ||||
color: #666666; | color: #666666; | ||||
margin-top: 10rpx; | |||||
.tips-card { | .tips-card { | ||||
width: 70rpx; | width: 70rpx; | ||||
font-weight: 400; | font-weight: 400; | ||||
color: #0a8f8a; | color: #0a8f8a; | ||||
padding: 5rpx 10rpx; | padding: 5rpx 10rpx; | ||||
margin-left: 30rpx; | |||||
margin-left: 60rpx; | |||||
} | } | ||||
</style> | </style> |
.add { | .add { | ||||
background: white; | background: white; | ||||
border-radius: 10rpx; | border-radius: 10rpx; | ||||
padding: 4rpx 4rpx; | |||||
padding: 6rpx 14rpx; | |||||
color: #000; | color: #000; | ||||
white-space: nowrap; | |||||
display: inline-block; | |||||
margin-left: 20rpx; | |||||
} | } | ||||
</style> | </style> |
<view v-else> | <view v-else> | ||||
<empty title='暂无找到相关订单信息' /> | <empty title='暂无找到相关订单信息' /> | ||||
</view> | </view> | ||||
<view class="bottom-line" v-if="state.flags">我是有底线的~~~</view> | |||||
</view> | </view> | ||||
</template> | </template> | ||||
navTo | navTo | ||||
} from "@/utils/utils" | } from "@/utils/utils" | ||||
import { | import { | ||||
onLoad, | |||||
onLoad, onReachBottom | |||||
} from "@dcloudio/uni-app"; | } from "@dcloudio/uni-app"; | ||||
import { | import { | ||||
orderList, addEquityListApi | orderList, addEquityListApi | ||||
const state = reactive({ | const state = reactive({ | ||||
list: [],//车辆list, | list: [],//车辆list, | ||||
equtyId: "",//权益id | equtyId: "",//权益id | ||||
pageSize: 10, //每页数据量 | |||||
pageNo: 1, // 当前页 | |||||
flags: false, | |||||
}); | }); | ||||
const flag = ref('0') //默认选择0 | const flag = ref('0') //默认选择0 | ||||
//获取车牌颜色文字 | //获取车牌颜色文字 | ||||
state.equtyId = option.equtyId | state.equtyId = option.equtyId | ||||
quanCheckActionTrue().then((item : any) => { | quanCheckActionTrue().then((item : any) => { | ||||
console.log("1", item.data) | console.log("1", item.data) | ||||
state.list = item.data | |||||
state.list = [...item.data, ...state.list] | |||||
}) | }) | ||||
}); | }); | ||||
"source": source, | "source": source, | ||||
"vehiclePlate": "", | "vehiclePlate": "", | ||||
"tabIndex": "0", | "tabIndex": "0", | ||||
"pageNo": 1, | |||||
"pageSize": 1000, | |||||
"pageNo": state.pageNo, | |||||
"pageSize": state.pageSize, | |||||
"promotionModes": 1, | "promotionModes": 1, | ||||
"isAfter": true, | "isAfter": true, | ||||
"orderStatus": 1 | "orderStatus": 1 | ||||
}, 2000) | }, 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> | </script> | ||||
<style> | <style> | ||||
} | } | ||||
} | } | ||||
} | } | ||||
.bottom-line { | |||||
text-align: center; | |||||
margin: 30rpx 0; | |||||
} | |||||
</style> | </style> |
</view> | </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 class="list-item" v-for="(item,index) in state.listData"> | ||||
<view><text>业务类型:</text><text>{{item.serviceType}}</text></view> | <view><text>业务类型:</text><text>{{item.serviceType}}</text></view> | ||||
<view><text>操作时间:</text><text>{{item.operateTime}}</text></view> | <view><text>操作时间:</text><text>{{item.operateTime}}</text></view> | ||||
<view><text>业务标识:</text><text>{{item.uniqueId}}</text></view> | <view><text>业务标识:</text><text>{{item.uniqueId}}</text></view> | ||||
<view><text>日志记录时间:</text><text>{{item.insertTime}}</text></view> | <view><text>日志记录时间:</text><text>{{item.insertTime}}</text></view> | ||||
</view> | </view> | ||||
<view class="bottom-line" v-if="state.flags">我是有底线的~~~</view> | |||||
</view> | </view> | ||||
<view class="bottom-line" v-if="state.flags">我是有底线的~~~</view> | |||||
<view v-else class="uni-container" style="text-align: center;"> | |||||
暂无数据 | |||||
</view> | |||||
</view> | </view> | ||||
</template> | </template> | ||||
import { | import { | ||||
businessType | businessType | ||||
} from "@/datas/businessType.js" | } from "@/datas/businessType.js" | ||||
import empty from "@/components/empty/empty.vue"; | |||||
import { onLoad, onReachBottom } from "@dcloudio/uni-app"; | import { onLoad, onReachBottom } from "@dcloudio/uni-app"; | ||||
import { businessApi } from "@/utils/network/api.js"; | import { businessApi } from "@/utils/network/api.js"; | ||||
import { stringToJson } from "@/utils/network/encryption"; | import { stringToJson } from "@/utils/network/encryption"; |
position: fixed; | position: fixed; | ||||
left: 50%; | left: 50%; | ||||
transform: translate(-50%); | transform: translate(-50%); | ||||
bottom: 60rpx; | |||||
bottom: 100rpx; | |||||
font-size: 32rpx; | font-size: 32rpx; | ||||
} | } | ||||
</style> | </style> |
<!-- 申请退货 --> | <!-- 申请退货 --> | ||||
<template> | <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> | </template> | ||||
<script setup lang="ts"> | <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> | </script> | ||||
<style> | <style> | ||||
page { | |||||
background-color: #f3f3f3; | |||||
padding-bottom: 30rpx; | |||||
} | |||||
page { | |||||
background-color: #f3f3f3; | |||||
padding-bottom: 30rpx; | |||||
} | |||||
</style> | </style> | ||||
<style lang="scss" scoped> | <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> |