@@ -323,6 +323,7 @@ | |||
//#ifdef MP-WEIXIN | |||
uni.chooseAddress({ | |||
success: (res) => { | |||
console.log("addressInfo", res) | |||
emit("addressInfo", res); | |||
}, | |||
fail: (err) => { | |||
@@ -330,6 +331,17 @@ | |||
}, | |||
}); | |||
//#endif | |||
//#ifdef MP-ALIPAY | |||
my.getAddress({ | |||
success: (res) => { | |||
console.log("addressInfo", res.result) | |||
emit("addressInfo", res.result); | |||
}, | |||
fail: (err) => { | |||
showToast("获取失败!"); | |||
}, | |||
}); | |||
//#endif | |||
} else if (item.btnType === "code") { | |||
//获取验证码 | |||
showToast("获取验证码"); |
@@ -7,11 +7,11 @@ | |||
<view class="transparent"> | |||
<view class='date-confirm'> | |||
<view @click="cancelPicker" class="pickerCancel">取消</view> | |||
<u-input v-model="state.keywords" placeholder="请输入搜索关键词" :border="true" | |||
:auto-height="false" :adjust-position="false" style="flex:1;" @input='searchChange' height="65"></u-input> | |||
<u-input v-model="state.keywords" placeholder="请输入搜索关键词" :border="true" :auto-height="false" | |||
:adjust-position="false" style="flex:1;" @input='searchChange' height="65"></u-input> | |||
<view @click="confirm" class="pickerConfirm">确定</view> | |||
</view> | |||
<picker-view indicator-class="indicator" :value="state.setValue" @change="bindChange" | |||
indicator-style="height: 100rpx;" mask-style="height:900rpx;" | |||
style="width: 100%; height: 80%;position:absolute;bottom:0rpx;text-align:center;background:white"> | |||
@@ -26,27 +26,27 @@ | |||
</template> | |||
<script lang="ts" setup> | |||
import {onMounted, reactive, watch} from "vue"; | |||
const emits = defineEmits(['update:modelValue','hidePicker']) | |||
import { onMounted, reactive, watch } from "vue"; | |||
const emits = defineEmits(['update:modelValue', 'hidePicker']) | |||
const props = defineProps({ | |||
dataSource: { | |||
type: Array, | |||
default: null | |||
}, | |||
}, | |||
value: { | |||
type: Array, | |||
default () { | |||
default() { | |||
return [0] | |||
} | |||
}, | |||
visible:{ | |||
type:Boolean, | |||
default:false | |||
}, | |||
visible: { | |||
type: Boolean, | |||
default: false | |||
} | |||
}) | |||
onMounted(()=>{ | |||
onMounted(() => { | |||
state.flag = props.visible; | |||
state.dataList = props.dataSource; | |||
}) | |||
@@ -54,14 +54,14 @@ | |||
flag: false, //是否显示 | |||
keywords: '', // 搜索值 | |||
setValue: [0], // picker 选择值 | |||
dataList:[], | |||
selectValue:'', //选择的值 | |||
dataList: [], | |||
selectValue: '', //选择的值 | |||
}) | |||
watch(()=>props.dataSource,(newVal,oldVal)=>{ | |||
watch(() => props.dataSource, (newVal, oldVal) => { | |||
state.dataList = newVal; | |||
}); | |||
watch(()=>props.visible,(newVal,oldVal)=>{ | |||
watch(() => props.visible, (newVal, oldVal) => { | |||
state.flag = newVal; | |||
}); | |||
@@ -76,31 +76,31 @@ | |||
function confirm(e) { | |||
state.flag = !state.flag; | |||
if(!state.selectValue){ | |||
if (!state.selectValue) { | |||
state.selectValue = state.dataList[0]; | |||
} | |||
emits('update:modelValue', state.selectValue); | |||
emits('hidePicker',false); | |||
emits('hidePicker', false); | |||
} | |||
// 搜索查询 | |||
function searchChange(val) { | |||
state.setValue = [0]; | |||
state.selectValue = ''; | |||
state.dataList = props.dataSource.filter((item) => (item as string).indexOf(val) > -1); | |||
} | |||
function showDatePicker() { | |||
state.flag = !state.flag | |||
} | |||
const cancelPicker = () =>{ | |||
const cancelPicker = () => { | |||
state.flag = !state.flag | |||
emits('hidePicker',false); | |||
emits('hidePicker', false); | |||
} | |||
defineExpose({ | |||
showDatePicker | |||
showDatePicker | |||
}) | |||
</script> | |||
@@ -177,4 +177,4 @@ | |||
color: #4C83D6; | |||
margin-left: 30rpx; | |||
} | |||
</style> | |||
</style> |
@@ -168,23 +168,19 @@ export default function useOrderListItem(props) { | |||
} | |||
watch(() => props.index, () => { | |||
console.log("111") | |||
refreshList(true); | |||
}); | |||
watch(() => props.refresh, (nv) => { | |||
console.log("222") | |||
if (nv) { | |||
refreshList(false); | |||
} | |||
}); | |||
onMounted(() => { | |||
console.log("333") | |||
if (props.refresh) { | |||
refreshList(false); | |||
} | |||
}) | |||
onPullDownRefresh(() => { | |||
console.log("444") | |||
refreshList(true); | |||
}); | |||
@@ -197,6 +193,7 @@ export default function useOrderListItem(props) { | |||
params, | |||
ordersList, | |||
doSearch, | |||
onKeyInput | |||
onKeyInput, | |||
refreshList | |||
}; | |||
} |
@@ -1,43 +1,47 @@ | |||
<!-- 订单列表 --> | |||
<template> | |||
<!-- 搜索框 --> | |||
<view class="as-layout-horizontal as-gravity-center-start search-layout"> | |||
<view class="search-box"> | |||
<image :src="`${$imgUrl}service/icon-search.png`" class="icon" mode="aspectFill"></image> | |||
<input class="search" placeholder="请输入车牌号" @input="onKeyInput" /> | |||
<scroll-view class="setHight" scroll-y="true" refresher-enabled="true" :refresher-enabled='state.freshing' | |||
:refresher-triggered='state.triggered' @refresherrefresh="onRefresh" @refresherpulling="onPulling" | |||
refresher-default-style="black"> | |||
<!-- 搜索框 --> | |||
<view class="as-layout-horizontal as-gravity-center-start search-layout"> | |||
<view class="search-box"> | |||
<image :src="`${$imgUrl}service/icon-search.png`" class="icon" mode="aspectFill"></image> | |||
<input class="search" placeholder="请输入车牌号" @input="onKeyInput" /> | |||
</view> | |||
<view class="search-btn" @click="doSearch">搜索</view> | |||
</view> | |||
<view class="search-btn" @click="doSearch">搜索</view> | |||
</view> | |||
<!-- 数据为空 --> | |||
<empty-view :mode="config.emptyHint.mode" :content="config.emptyHint.hint" v-if="ordersList.length === 0" /> | |||
<template v-else> | |||
<!-- 列表 --> | |||
<block v-for="(item,index) in ordersList" :key="index"> | |||
<!-- 新办订单 --> | |||
<!-- v-if="item.orderType == 'ISSUE'" --> | |||
<order-list-item-new :item="item" /> | |||
<!-- 卡签同时更换/更换卡/更换签订单 --> | |||
<!-- <order-list-item-card-sign :item="item" | |||
<!-- 数据为空 --> | |||
<empty-view :mode="config.emptyHint.mode" :content="config.emptyHint.hint" v-if="ordersList.length === 0" /> | |||
<template v-else> | |||
<!-- 列表 --> | |||
<block v-for="(item,index) in ordersList" :key="index"> | |||
<!-- 新办订单 --> | |||
<!-- v-if="item.orderType == 'ISSUE'" --> | |||
<order-list-item-new :item="item" /> | |||
<!-- 卡签同时更换/更换卡/更换签订单 --> | |||
<!-- <order-list-item-card-sign :item="item" | |||
v-else-if="item.orderType == OrderTypes.同时换卡换签 || item.orderType == 'REPLACEMENT_CARD' | |||
|| item.orderType == 'REPLACEMENT_SIGNATURE'" /> --> | |||
<!-- 增补OBU订单 --> | |||
<!-- <order-list-item-obu :item="item" v-else-if="item.orderType == 'SUPPLEMENT_OBU'" /> --> | |||
<!-- 公务车增补OBU订单 --> | |||
<!-- <order-list-item-obu :item="item" v-else-if="item.orderType == 'OFFICAL_SUPPLEMENT_OBU'" /> --> | |||
<!-- ETC注销业务类型订单 --> | |||
<!-- <order-list-item-logoff-etc :item="item" v-else-if="item.orderType == OrderTypes.ETC注销" /> --> | |||
<!-- 车辆信息变更 --> | |||
<!-- <order-list-item-edit-car :item="item" v-else-if="item.orderType == OrderTypes.车辆信息变更" /> --> | |||
<!-- 解除车牌占用 --> | |||
<!-- <order-list-item-cancel-numberplate :item="item" v-else-if="item.orderType == OrderTypes.解除车牌占用" /> --> | |||
<!-- 单位账户充值开户订单 --> | |||
<!-- <order-list-item-recharge :item="item" v-else-if="item.orderType == 'EXCHANGE_CARD_TYPE'" /> --> | |||
</block> | |||
<uni-load-more :status="params.status" iconType="snow" :icon-size="16" :content-text="config.contentTxt" | |||
v-if="ordersList.length > 0"/> | |||
</template> | |||
<!-- 增补OBU订单 --> | |||
<!-- <order-list-item-obu :item="item" v-else-if="item.orderType == 'SUPPLEMENT_OBU'" /> --> | |||
<!-- 公务车增补OBU订单 --> | |||
<!-- <order-list-item-obu :item="item" v-else-if="item.orderType == 'OFFICAL_SUPPLEMENT_OBU'" /> --> | |||
<!-- ETC注销业务类型订单 --> | |||
<!-- <order-list-item-logoff-etc :item="item" v-else-if="item.orderType == OrderTypes.ETC注销" /> --> | |||
<!-- 车辆信息变更 --> | |||
<!-- <order-list-item-edit-car :item="item" v-else-if="item.orderType == OrderTypes.车辆信息变更" /> --> | |||
<!-- 解除车牌占用 --> | |||
<!-- <order-list-item-cancel-numberplate :item="item" v-else-if="item.orderType == OrderTypes.解除车牌占用" /> --> | |||
<!-- 单位账户充值开户订单 --> | |||
<!-- <order-list-item-recharge :item="item" v-else-if="item.orderType == 'EXCHANGE_CARD_TYPE'" /> --> | |||
</block> | |||
<uni-load-more :status="params.status" iconType="snow" :icon-size="16" :content-text="config.contentTxt" | |||
v-if="ordersList.length > 0" /> | |||
</template> | |||
</scroll-view> | |||
</template> | |||
<script setup lang="ts"> | |||
@@ -48,28 +52,55 @@ | |||
import orderListItemEditCar from "./order-list-item-edit-car.vue"; | |||
import orderListItemCancelNumberplate from './order-list-item-cancel-numberplate.vue'; | |||
import orderListItemRecharge from "./order-list-item-cancel-recharge.vue"; | |||
import {OrderTypes} from "@/datas/enum"; | |||
import { OrderTypes } from "@/datas/enum"; | |||
import useOrderListItem from "@/composables/order/useOrderListItem"; | |||
import { reactive } from "vue"; | |||
import { onLoad } from "@dcloudio/uni-app"; | |||
const state = reactive({ | |||
triggered: false, //设置当前下拉刷新的状态 | |||
freshing: true, | |||
_freshing: false | |||
}) | |||
const props = defineProps({ | |||
index: { | |||
type: Number, | |||
default () { | |||
default() { | |||
return 0 | |||
} | |||
}, | |||
refresh:{ //是否刷新列表 | |||
type:Boolean, | |||
default:true | |||
refresh: { //是否刷新列表 | |||
type: Boolean, | |||
default: true | |||
} | |||
}) | |||
const {config,params,ordersList,doSearch,onKeyInput} = useOrderListItem(props); | |||
const { config, params, ordersList, doSearch, onKeyInput, refreshList } = useOrderListItem(props); | |||
//自定义下拉刷新被触发 | |||
const onRefresh = () => { | |||
refreshList(true) | |||
if (state._freshing) return; | |||
state._freshing = true; | |||
setTimeout(() => { | |||
state.triggered = false; | |||
state._freshing = false; | |||
}, 2000) | |||
} | |||
const onPulling = (e) => { | |||
if (e.detail.deltaY < 0) { | |||
return | |||
} | |||
state.triggered = true | |||
} | |||
</script> | |||
<style lang="scss" scoped> | |||
.search-layout{ | |||
.setHight { | |||
min-height: calc(100vh - 200rpx); | |||
} | |||
.search-layout { | |||
padding-top: 80rpx; | |||
.search-box { | |||
margin: 30rpx 30rpx 0rpx 30rpx; | |||
height: 80rpx; | |||
@@ -82,13 +113,13 @@ | |||
box-sizing: border-box; | |||
flex: 1; | |||
} | |||
.search-box .icon { | |||
width: 48rpx; | |||
height: 48rpx; | |||
margin: 0 20rpx; | |||
} | |||
.search-box .search { | |||
flex: 1; | |||
margin-right: 20rpx; | |||
@@ -97,7 +128,8 @@ | |||
font-size: 28rpx; | |||
color: #00b38b; | |||
} | |||
.search-btn{ | |||
.search-btn { | |||
color: white; | |||
background-color: #00B38B; | |||
width: 140rpx; |
@@ -252,9 +252,9 @@ | |||
//获取fileData | |||
const getFileData = () => { | |||
console.log("======修改车辆信息0.1======",fileDataStrings); | |||
console.log("======修改车辆信息0.1======", fileDataStrings); | |||
//获取fileData 拼接字符串 | |||
let res1 = AsciToHexString(fileDataStrings.vehiclePlate, 24); //车牌号 | |||
let res2 = IntegerToHexString(fileDataStrings.vehiclePlateColor, 4); //车牌颜色 | |||
@@ -720,7 +720,7 @@ | |||
// state.orderId, | |||
// }); | |||
bindCardAndObu(); | |||
}); | |||
}; | |||
/** | |||
@@ -744,15 +744,15 @@ | |||
tools.hideLoadingAlert(); | |||
let result = JSON.parse(res.bizContent); | |||
console.log("写卡指令============", result) | |||
tools.showLoadingAlert("执行指令中"); | |||
bluetoothUtil.transCmd(result.command.split(","), "10", function(res) { | |||
tools.hideLoadingAlert(); | |||
let response = res.toString(); | |||
getCommandBackEnd(result.command, result.cosRecordId, response); | |||
// uni.navigateTo({ | |||
// url: "/subpackage/after-sale/deviceInfo/deviceInfo", | |||
// }); | |||
}); | |||
tools.showLoadingAlert("执行指令中"); | |||
bluetoothUtil.transCmd(result.command.split(","), "10", function(res) { | |||
tools.hideLoadingAlert(); | |||
let response = res.toString(); | |||
getCommandBackEnd(result.command, result.cosRecordId, response); | |||
// uni.navigateTo({ | |||
// url: "/subpackage/after-sale/deviceInfo/deviceInfo", | |||
// }); | |||
}); | |||
}) | |||
.catch((err) => { | |||
console.log(err); | |||
@@ -777,7 +777,7 @@ | |||
method: "POST", //提交方式(默认POST) | |||
showLoading: true, //是否显示加载中(默认显示) | |||
}; | |||
//调用方式 | |||
request(IFCODE.writeCardBack, options) | |||
.then((res) => { |
@@ -313,6 +313,7 @@ | |||
state.formData[7].itemData = nameList; | |||
state.formData[14].itemData = nameList; | |||
}); | |||
}; | |||
//radio改变 | |||
@@ -339,6 +340,12 @@ | |||
for (let i = 8; i < 14; i++) { | |||
state.formData[i].hide = false; | |||
} | |||
// #ifdef MP-ALIPAY | |||
state.formData[8].btnTitle = "获取支付宝地址" | |||
// #endif | |||
// #ifdef MP-WEIXIN | |||
state.formData[8].btnTitle = "获取微信地址" | |||
// #endif | |||
} else if (state.exchangeMode === "SELF") { | |||
//SELF-线上-营业点自提 | |||
state.formData[7].hide = false; | |||
@@ -353,6 +360,15 @@ | |||
} | |||
//地址改变 | |||
const addressInfo = (content : any) => { | |||
// #ifdef MP-ALIPAY | |||
state.formData[9][state.formData[9].value] = content.fullname; | |||
state.formData[10][state.formData[10].value] = content.mobilePhone; | |||
state.formData[11][state.formData[11].value] = `${content.prov}/${content.city}/${content.area}`; | |||
const addressArr = content.address.split("-") | |||
state.formData[12][state.formData[12].value] = addressArr[3]; | |||
// state.formData[13][state.formData[13].value] = ""; | |||
// #endif | |||
// #ifdef MP-WEIXIN | |||
state.formData[9][state.formData[9].value] = content.userName; | |||
state.formData[10][state.formData[10].value] = content.telNumber; | |||
state.formData[11][ | |||
@@ -360,6 +376,7 @@ | |||
] = `${content.provinceName}/${content.cityName}/${content.countyName}`; | |||
state.formData[12][state.formData[12].value] = content.detailInfo; | |||
state.formData[13][state.formData[13].value] = content.postalCode; | |||
// #endif | |||
}; | |||
//提交换货申请 |
@@ -36,7 +36,7 @@ | |||
//客车1 货车2 | |||
type: { | |||
type: String, | |||
default: '1' | |||
// default: '1' | |||
}, | |||
}) | |||
@@ -64,8 +64,8 @@ | |||
} | |||
const getCarColor = () => { | |||
const data = getItem('globalParam') | |||
console.log("props.type", props.type, data) | |||
if (props.type == "1") { | |||
console.log("props.type", props.type, data) | |||
for (var i = 0; i < data.carPlateColorType.length; i++) { | |||
for (var j = 0; j < state.allColorList.length; j++) { | |||
console.log("23", getCodeName('VEHICLE_COLOR_TYPE', data.trucksPlateColorType[i])) | |||
@@ -89,9 +89,9 @@ | |||
console.log("state.numberplateColorList", state.numberplateColorList) | |||
} | |||
onMounted(() => { | |||
getCarColor() | |||
console.log("type", props.type) | |||
setTimeout(() => { | |||
getCarColor() | |||
}) | |||
}) | |||
</script> | |||
@@ -371,15 +371,6 @@ | |||
uni.redirectTo({ | |||
url: `/subpackage/orders/choice-product?orderId=${val.orderId}`, | |||
}); | |||
// if(val.isValueCard==2){ | |||
// uni.redirectTo({ | |||
// url:`/subpackage/orders/interestsList?orderId=${val.orderId}&&clientFee=${val.product.clientFee}&&id=${val.productId}` | |||
// }); | |||
// }else{ | |||
// uni.redirectTo({ | |||
// url: `/subpackage/orders/choice-product?orderId=${val.orderId}`, | |||
// }); | |||
// } | |||
} else if (val.orderStep === 4) { | |||
uni.redirectTo({ | |||
url: `/subpackage/orders/product-detail?orderId=${val.orderId}&&clientFee=${val.product.clientFee}&&id=${val.productId}`, | |||
@@ -392,9 +383,8 @@ | |||
}; | |||
onLoad((option : any) => { | |||
globalParam(); | |||
state.data.type = option.type; //1客车 2货车 | |||
state.data.opId = getItem(StorageKeys.OpenId); | |||
state.data.type = option.type; //客车 | |||
state.data.userType = option.userType; | |||
state.data.promoteId = option.promoteId; | |||
state.isValueCard = option.isValueCard | |||
@@ -403,6 +393,7 @@ | |||
state.equityId = option.equityId; | |||
console.log("订单选择推广发行产品接口", option) | |||
getInfo(); | |||
globalParam(); | |||
uni.getLocation({ | |||
type: 'wgs84', | |||
success: function (res) { |
@@ -78,7 +78,7 @@ | |||
// tools.showLoadingAlert("加载中"); | |||
uni.downloadFile({ | |||
url: state.agreeURL, | |||
filePath: wx.env.USER_DATA_PATH + '/' + '代扣协议1.docx', | |||
filePath: uni.env.USER_DATA_PATH + '/' + '代扣协议.docx', | |||
success(res) { | |||
const filePath = res.filePath | |||
uni.openDocument({ |
@@ -116,9 +116,6 @@ export function arrayToJsonString(array) { | |||
*json字符串转换成json对象 | |||
*/ | |||
export function stringToJson(data) { | |||
// let index = data.lastIndexOf("}") | |||
// let content = data.substring(0, index + 1); | |||
// console.log("content111111", data) | |||
return JSON.parse(data); | |||
} | |||
@@ -402,7 +402,9 @@ function SM4Util() { | |||
// console.log("没处理之前的数据", bizContent) | |||
if (bizContent.substr(0, 1) == '[') { | |||
// 返回数据是数组情况 | |||
cipherText.data.bizContent = bizContent; | |||
let begin = bizContent.indexOf('['); | |||
let end = bizContent.lastIndexOf(']'); | |||
cipherText.data.bizContent = bizContent.substring(begin, end + 1) | |||
} else { | |||
// 返回数据是对象情况 | |||
let begin = bizContent.indexOf('{'); | |||
@@ -410,7 +412,6 @@ function SM4Util() { | |||
cipherText.data.bizContent = bizContent.substring(begin, end + 1) | |||
} | |||
} | |||
// cipherText.data.bizContent = bizContent; | |||
return cipherText | |||
} catch (e) { | |||
console.error(e) |