Ver código fonte

[Feature]提交代碼

yxb
杨毅 2 anos atrás
pai
commit
c5d5b60f31

+ 0
- 2
after-sale/ETC-log-off/select-car.vue Ver arquivo

@@ -55,8 +55,6 @@
console.log(item)
})
});
const quanCheckActionTrue = () => {
var data = {
opId: getItem(StorageKeys.OpenId),

+ 134
- 267
after-sale/ETC-log-off/upload-card.vue Ver arquivo

@@ -1,79 +1,13 @@
<template>
<view class="upload-box">
<!-- <view class="head-tips">
检测到您的ETC卡中还剩余额<text>100.00</text>元,我们将于<text>14</text>个工作日争议期后退回到您的银行卡中,这里将收集您的收款信,具体金额可能会出现增多或减少得情况,敬请谅解!
</view>
<view class="upload-card" @click="upload()">
<view class="card-left">
<view class="item1"> ETC卡剪段照片 </view>
<view class="item2"> ETC卡剪段并上传照片 </view>
<view class="item3"> 拍摄示例 </view>
</view>
<image :src="`${$imgUrl}ETC1.png`" mode="" v-if="!form.imageUrl"></image>
<image :src="form.imageUrl" mode="" v-else></image>
</view>
-->
<u-form :model="form" ref="myForm" :error-type="errorType">
<view class="from">
<!-- <u-form-item prop="state"> -->
<!-- <view class="from_item">
<text><text style="color: red"></text>是否寄回设备:</text>
<u-radio-group v-model="form.state">
<u-radio :customStyle="{ marginBottom: '8px' }" activeColor="#2CE242"
v-for="(item, index) in radiolist1" :key="index" :label="item.disabled"
:name="item.name" @change="radioChange">
{{ item.name }}
</u-radio>
</u-radio-group>
</view>
</u-form-item>
<u-form-item prop="logisticsname" v-if="form.state=='寄回'">
<view class="from_item">
<text><text style="color: red">*</text>物流公司:</text>
<view style="display: flex" @click="showPicker(1)">
<u-input v-model="form.logisticsname" class="input" disabled placeholder="请选择" />
<u-icon name="arrow-right" style="margin-left: 10px;display: flex;"></u-icon>
</view>
</view>
</u-form-item>
<u-form-item prop="logisticsNum" v-if="form.state=='寄回'">
<view class="from_item">
<text><text style="color: red">*</text>物流单号:</text>
<u-input v-model="form.logisticsNum" class="input" />
</view>
</u-form-item>
<view class="title"> 请输入退费信息 </view>
<u-form-item prop="username">
<view class="from_item">
<text style="color: #777777"><text style="color: red">*</text>联系人姓名:</text>
<u-input v-model="form.username" class="input" />
</view>
</u-form-item>
<u-form-item prop="phone">
<view class="from_item">
<text style="color: #777777"><text style="color: red">*</text>手机号:</text>
<u-input v-model="form.phone" class="input" />
</view>
</u-form-item>
<u-form-item prop="bank">
<view class="from_item">
<text style="color: #777777"><text style="color: red">*</text>开户行:</text>
<u-input v-model="form.bank" class="input" />
</view>
</u-form-item>
<u-form-item prop="bankcardid">
<view class="from_item">
<text style="color: #777777"><text style="color: red">*</text>退费银行卡号:</text>
<u-input v-model="form.bankcardid" class="input" />
</view>
</u-form-item> -->
<view class="title"> 请填写注销原因 </view>
<u-form-item prop="remark">
<view class="from_item">
<text><text style="color: red"></text>注销原因:</text>
<view style="display: flex">
<u-input v-model="form.remark" @click="showPicker(2)" class="input" disabled
<u-input v-model="form.ReasonCancellation" @click="showPicker()" class="input" disabled
placeholder="请选择" />
<u-icon name="arrow-right" style="margin-left: 10px;display: flex;"></u-icon>
</view>
@@ -85,10 +19,8 @@
<button class="submit" @click="toPage()">注销</button>
<!-- 选择弹窗 -->
<view>
<!-- 物流 -->
<u-select v-model="show" mode="single-column" :list="list" @confirm="confirm"></u-select>
<!-- 原因 -->
<u-select v-model="show2" mode="single-column" :list="list2" @confirm="confirm2"></u-select>
<u-select v-model="show" mode="single-column" :list="list" @confirm="confirm"></u-select>
</view>
</view>
</template>
@@ -111,27 +43,23 @@
request
} from "../../utils/network/request.js";
import {
getLogistics,
CardSignCancellation
writeCardBack,
CardSignCancellation,
confirmSignCancellation
} from "../../utils/network/api.js";
import {
stringToJson
} from "../../utils/network/encryption.js";
const bluetoothUtil = require("../../static/etcUtil/index.js");
// 表单数据
const form = reactive({
imageUrl: "",
logisticsname: "",
logisticsNum: "",
state: "",
username: "",
phone: "",
bank: "",
bankcardid: "",
remark: "",
obuId: '',
cardId: '',
orderId: '',
ReasonCancellation: "",
equipmentState: ''
});
const list = reactive([]); //物流数据
const list2 = reactive([{
const list = reactive([{
//原因
value: "原因1",
label: "原因1",
@@ -146,215 +74,154 @@
},
]);
const rules = {
// logisticsname: [{
// required: true,
// message: "请选择",
// trigger: ["change", "blur"],
// }, ],
logisticsNum: [{
required: true,
message: "请输入",
trigger: ["change", "blur"],
}, ],
state: [{
required: true,
message: "请输入",
trigger: ["change", "blur"],
}, ],
username: [{
required: true,
message: "请输入",
trigger: ["change", "blur"],
}, ],
bank: [{
required: true,
message: "请输入",
trigger: ["change", "blur"],
}, ],
bankcardid: [{
required: true,
message: "请输入",
trigger: ["change", "blur"],
}, ],
// remark: [{
// required: true,
// message: "请选择",
// trigger: ["change", "blur"],
// }, ],
phone: [{
required: true,
message: "请输入手机号",
trigger: ["change", "blur"],
},
{
// 自定义验证函数,见上说明
validator: (rule, value, callback) => {
// 上面有说,返回true表示校验通过,返回false表示不通过
console.log(checkStr(value, "mobile"), "0011");
return checkStr(value, "mobile");
},
message: "手机号码不正确",
trigger: ["change", "blur"],
},
],
};
// 验证提示类型(toast要版本为1.3.5才支持)
const errorType = ["border-bottom", "toast"];
// 设置验证规则
const myForm = ref(null);
onReady(() => {
myForm.value.setRules(rules);
});
onLoad(() => {
getexpresslist();
});
const getexpresslist = () => {
//参数说明
let options = {
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
data: {
// opId: getItem("openId"),
// source: "WECHAT",
// tabIndex: "0",
}, //请求参数
method: "POST", //提交方式(默认POST)
showLoading: true, //是否显示加载中(默认显示)
};
//调用方式
request(getLogistics, options)
.then((res) => {
// stringToJson(res.bizContent)
stringToJson(res.bizContent).forEach((item) => {
list.push({
value: item,
label: item,
});
});
})
.catch((err) => {
console.log(err);
});
};
onLoad((option) => {
form.obuId = option.obuId;
form.cardId = option.cardId;
form.orderId = option.orderId
form.equipmentState = option.equipmentState
/*监听蓝牙回调*/
uni.$on('bluetoothLink', function(status) {
queryCardSignCancellation(1, 1, 1).then((item: any) => {
instructAction(item).then(value => {
queryConfirmSignCancellation(0).then((val: any) => {
console.log(val)
navTo("/after-sale/ETC-log-off/log-off-result");
})
})
// 卡签注销
const logoff = (offtype) => {
//参数说明
let options = {
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
data: {
cardId: '', //卡号
obuId: "", //签号
serviceType: "1", //注销类型 1-卡注销,2-签注销,3-卡签注销
operation: offtype, //注销方式 1-有卡注销,2-无卡注销
orderId: '20230225155521777646302', //订单编号
ReasonCancellation: ''
}, //请求参数
method: "POST", //提交方式(默认POST)
showLoading: true, //是否显示加载中(默认显示)
};
//调用方式
request(CardSignCancellation, options)
.then((res) => {
stringToJson(res.bizContent)
if (stringToJson(res.statusCode) == 0) {
navTo("/after-sale/ETC-log-off/log-off-result");
}
})
.catch((err) => {
console.log(err);
});
}
})
});
onUnload(() => {
/*移除监听*/
uni.$off('bluetoothLink')
// 单选数据列表
const radiolist1 = reactive([{
name: "寄回",
disabled: false,
},
{
name: "不寄回",
disabled: false,
},
]);
// 单选
const radioChange = (n) => {
console.log('radioChange', n);
// if (n == '卡退费') {
// flag.value = true
// console.log(flag.value);
// } else {
// flag.value = false
// console.log(flag.value);
// }
}
const upload = () => {
uni.chooseImage({
count: 1, //只能选取一张照片
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
sourceType: ["camera", "album"], //从相册选择
success: function(res) {
console.log(res);
// pathToBase64(res.tempFilePaths[0]).then(path => {
form.imageUrl = res.tempFilePaths[0];
// }).catch(error => {
// })
},
});
};
});
const show = ref(false);
const show2 = ref(false);
const showPicker = function(type) {
console.log('3333333');
if (type == 1) {
show.value = true;
console.log(show.value);
} else {
show2.value = true;
console.log(show2.value);
}
const showPicker = function() {
show.value = true;
};
// 选择物流
const confirm = (e) => {
console.log(e);
form.logisticsname = e[0].value;
};
const confirm2 = (e) => {
console.log(e);
form.remark = e[0].value;
form.ReasonCancellation = e[0].value;
};
const toPage = () => {
myForm.value.validate((valid) => {
console.log(valid);
if (valid) {
console.log("验证通过", form);
wx.showModal({
confirmText: "寄回",
cancelText: "不寄回",
success: function(res) {
if (res.confirm) {
console.log("用户点击确定");
logoff(2)
// navTo("/after-sale/ETC-log-off/log-off-result");
} else if (res.cancel) {
console.log("用户点击取消");
navTo("/after-sale/ETC-log-off/etc-log-off-pay");
}
},
//参数说明
let options = {};
if (form.equipmentState === '1') {
navTo("/pages/bluetooth/bluetooth&&routeType=5");
} else {
queryCardSignCancellation(0, 0, 0).then((item: any) => {
queryConfirmSignCancellation(0).then((val: any) => {
console.log(val)
navTo("/after-sale/ETC-log-off/log-off-result");
})
})
}
};
/*指令返回*/
const instructAction = (data) => {
let cmdArr = data.command.split(",");
console.log(cmdArr);
bluetoothUtil.transCmd(cmdArr, "10", function(res) {
console.log("透传");
console.log(res);
var arraylenth = res.length;
var status = res[arraylenth - 1].substring(
res[arraylenth - 1].length - 4,
res[arraylenth - 1].length
);
console.log("打印指令状态");
console.log(status);
if (status === "9000") {
var form = {
command: data.command,
response: res.toString(),
cosRecordId: data.cosRecordId,
cardId: form.cardId,
cosType: 9 //1- 开卡. 2- 修改卡内信息 4- 卡签绑定 9- 销卡
};
const options = {
type: 2,
data: form,
method: "POST",
showLoading: true,
};
return new Promise(async (resolve, reject) => {
const res = await request(writeCardBack, options);
const data = stringToJson(res.bizContent);
resolve(data);
}).catch((error) => {
reject(error);
});
} else {
console.log("验证未通过");
}
});
};
//注销
const queryCardSignCancellation = (hasCard, hasObu, cosProvider) => {
var options = {
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
data: {
hasCard: hasCard,
hasObu: hasObu,
cosProvider: cosProvider,
cardId: form.cardId, //卡号
obuId: form.obuId, //签号
serviceType: "3", //注销类型 1-卡注销,2-签注销,3-卡签注销
orderId: form.orderId, //订单编号
ReasonCancellation: form.ReasonCancellation
}, //请求参数
method: "POST", //提交方式(默认POST)
showLoading: true, //是否显示加载中(默认显示)
};
return new Promise(async (resolve, reject) => {
const res = await request(confirmSignCancellation, options);
const data = stringToJson(res.bizContent);
resolve(data);
}).catch((error) => {
reject(error);
});
}
//注销确认
const queryConfirmSignCancellation = (hasCard: any) => {
return new Promise(async (resolve, reject) => {
const res = await request(confirmSignCancellation, {
type: 2,
data: {
hasCard: hasCard,
orderId: form.orderId,
cardId: form.cardId
},
method: "POST",
showLoading: true,
});
const data = stringToJson(res.bizContent);
resolve(data);
}).catch((error) => {
reject(error);
});
}
</script>
<style>

+ 3
- 2
after-sale/card-loss-reporting/cardloss.vue Ver arquivo

@@ -131,8 +131,9 @@
margin-top: 50rpx;
padding-bottom: 10rpx;
}
}
.btn {
position: absolute;
right: 45rpx;

+ 3
- 1
after-sale/card-loss-reporting/select-car.vue Ver arquivo

@@ -55,6 +55,7 @@
console.log(item)
})
});

const quanCheckActionTrue = () => {
var data = {
@@ -69,7 +70,8 @@
data: data,
method: "POST",
showLoading: true,
};
};
return new Promise(async (resolve, reject) => {
const res = await request(orderList, options);
const data = stringToJson(res.bizContent);

+ 1
- 1
manifest.json Ver arquivo

@@ -52,7 +52,7 @@
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wx214b4f8de36a0181",
"appid" : "wx008c60533388527a",
"setting" : {
"urlCheck" : false,
"checkSiteMap" : false,

+ 2
- 2
utils/network/request.js Ver arquivo

@@ -35,8 +35,8 @@ export function request(code, options = {}) {
}
//Url 地址
//options.url = envs[process.env.NODE_ENV].baseUrl || '' + options.url
options.url = 'http://192.168.100.63:8087/ifzt/api/interfaceMidGroundIn'
// options.url = 'http://222.85.144.89:19002/ifzt/api/interfaceMidGroundIn'
// options.url = 'http://192.168.100.63:8087/ifzt/api/interfaceMidGroundIn'
options.url = 'http://222.85.144.89:19002/ifzt/api/interfaceMidGroundIn'
//判断baseUri是否为空
if (options.baseUrl) {
options.url = options.baseUrl

+ 4
- 4
utils/util/fileData.js Ver arquivo

@@ -1,7 +1,7 @@
// import {
// TextEncoder,
// TextDecoder
// } from "text-decoding";
import {
TextEncoder,
TextDecoder
} from "text-decoding";


export function IntegerToHexString(num, nLen) {

Carregando…
Cancelar
Salvar