//#ifdef MP-WEIXIN | //#ifdef MP-WEIXIN | ||||
uni.chooseAddress({ | uni.chooseAddress({ | ||||
success: (res) => { | success: (res) => { | ||||
console.log("addressInfo", res) | |||||
emit("addressInfo", res); | emit("addressInfo", res); | ||||
}, | }, | ||||
fail: (err) => { | fail: (err) => { | ||||
}, | }, | ||||
}); | }); | ||||
//#endif | //#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") { | } else if (item.btnType === "code") { | ||||
//获取验证码 | //获取验证码 | ||||
showToast("获取验证码"); | showToast("获取验证码"); |
<view class="transparent"> | <view class="transparent"> | ||||
<view class='date-confirm'> | <view class='date-confirm'> | ||||
<view @click="cancelPicker" class="pickerCancel">取消</view> | <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 @click="confirm" class="pickerConfirm">确定</view> | ||||
</view> | </view> | ||||
<picker-view indicator-class="indicator" :value="state.setValue" @change="bindChange" | <picker-view indicator-class="indicator" :value="state.setValue" @change="bindChange" | ||||
indicator-style="height: 100rpx;" mask-style="height:900rpx;" | indicator-style="height: 100rpx;" mask-style="height:900rpx;" | ||||
style="width: 100%; height: 80%;position:absolute;bottom:0rpx;text-align:center;background:white"> | style="width: 100%; height: 80%;position:absolute;bottom:0rpx;text-align:center;background:white"> | ||||
</template> | </template> | ||||
<script lang="ts" setup> | <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({ | const props = defineProps({ | ||||
dataSource: { | dataSource: { | ||||
type: Array, | type: Array, | ||||
default: null | default: null | ||||
}, | |||||
}, | |||||
value: { | value: { | ||||
type: Array, | type: Array, | ||||
default () { | |||||
default() { | |||||
return [0] | return [0] | ||||
} | } | ||||
}, | |||||
visible:{ | |||||
type:Boolean, | |||||
default:false | |||||
}, | |||||
visible: { | |||||
type: Boolean, | |||||
default: false | |||||
} | } | ||||
}) | }) | ||||
onMounted(()=>{ | |||||
onMounted(() => { | |||||
state.flag = props.visible; | state.flag = props.visible; | ||||
state.dataList = props.dataSource; | state.dataList = props.dataSource; | ||||
}) | }) | ||||
flag: false, //是否显示 | flag: false, //是否显示 | ||||
keywords: '', // 搜索值 | keywords: '', // 搜索值 | ||||
setValue: [0], // picker 选择值 | setValue: [0], // picker 选择值 | ||||
dataList:[], | |||||
selectValue:'', //选择的值 | |||||
dataList: [], | |||||
selectValue: '', //选择的值 | |||||
}) | }) | ||||
watch(()=>props.dataSource,(newVal,oldVal)=>{ | |||||
watch(() => props.dataSource, (newVal, oldVal) => { | |||||
state.dataList = newVal; | state.dataList = newVal; | ||||
}); | }); | ||||
watch(()=>props.visible,(newVal,oldVal)=>{ | |||||
watch(() => props.visible, (newVal, oldVal) => { | |||||
state.flag = newVal; | state.flag = newVal; | ||||
}); | }); | ||||
function confirm(e) { | function confirm(e) { | ||||
state.flag = !state.flag; | state.flag = !state.flag; | ||||
if(!state.selectValue){ | |||||
if (!state.selectValue) { | |||||
state.selectValue = state.dataList[0]; | state.selectValue = state.dataList[0]; | ||||
} | } | ||||
emits('update:modelValue', state.selectValue); | emits('update:modelValue', state.selectValue); | ||||
emits('hidePicker',false); | |||||
emits('hidePicker', false); | |||||
} | } | ||||
// 搜索查询 | // 搜索查询 | ||||
function searchChange(val) { | function searchChange(val) { | ||||
state.setValue = [0]; | state.setValue = [0]; | ||||
state.selectValue = ''; | state.selectValue = ''; | ||||
state.dataList = props.dataSource.filter((item) => (item as string).indexOf(val) > -1); | state.dataList = props.dataSource.filter((item) => (item as string).indexOf(val) > -1); | ||||
} | } | ||||
function showDatePicker() { | function showDatePicker() { | ||||
state.flag = !state.flag | state.flag = !state.flag | ||||
} | } | ||||
const cancelPicker = () =>{ | |||||
const cancelPicker = () => { | |||||
state.flag = !state.flag | state.flag = !state.flag | ||||
emits('hidePicker',false); | |||||
emits('hidePicker', false); | |||||
} | } | ||||
defineExpose({ | defineExpose({ | ||||
showDatePicker | |||||
showDatePicker | |||||
}) | }) | ||||
</script> | </script> | ||||
color: #4C83D6; | color: #4C83D6; | ||||
margin-left: 30rpx; | margin-left: 30rpx; | ||||
} | } | ||||
</style> | |||||
</style> |
} | } | ||||
watch(() => props.index, () => { | watch(() => props.index, () => { | ||||
console.log("111") | |||||
refreshList(true); | refreshList(true); | ||||
}); | }); | ||||
watch(() => props.refresh, (nv) => { | watch(() => props.refresh, (nv) => { | ||||
console.log("222") | |||||
if (nv) { | if (nv) { | ||||
refreshList(false); | refreshList(false); | ||||
} | } | ||||
}); | }); | ||||
onMounted(() => { | onMounted(() => { | ||||
console.log("333") | |||||
if (props.refresh) { | if (props.refresh) { | ||||
refreshList(false); | refreshList(false); | ||||
} | } | ||||
}) | }) | ||||
onPullDownRefresh(() => { | onPullDownRefresh(() => { | ||||
console.log("444") | |||||
refreshList(true); | refreshList(true); | ||||
}); | }); | ||||
params, | params, | ||||
ordersList, | ordersList, | ||||
doSearch, | doSearch, | ||||
onKeyInput | |||||
onKeyInput, | |||||
refreshList | |||||
}; | }; | ||||
} | } |
<!-- 订单列表 --> | <!-- 订单列表 --> | ||||
<template> | <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> | ||||
<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' | v-else-if="item.orderType == OrderTypes.同时换卡换签 || item.orderType == 'REPLACEMENT_CARD' | ||||
|| item.orderType == 'REPLACEMENT_SIGNATURE'" /> --> | || 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> | </template> | ||||
<script setup lang="ts"> | <script setup lang="ts"> | ||||
import orderListItemEditCar from "./order-list-item-edit-car.vue"; | import orderListItemEditCar from "./order-list-item-edit-car.vue"; | ||||
import orderListItemCancelNumberplate from './order-list-item-cancel-numberplate.vue'; | import orderListItemCancelNumberplate from './order-list-item-cancel-numberplate.vue'; | ||||
import orderListItemRecharge from "./order-list-item-cancel-recharge.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 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({ | const props = defineProps({ | ||||
index: { | index: { | ||||
type: Number, | type: Number, | ||||
default () { | |||||
default() { | |||||
return 0 | 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> | </script> | ||||
<style lang="scss" scoped> | <style lang="scss" scoped> | ||||
.search-layout{ | |||||
.setHight { | |||||
min-height: calc(100vh - 200rpx); | |||||
} | |||||
.search-layout { | |||||
padding-top: 80rpx; | padding-top: 80rpx; | ||||
.search-box { | .search-box { | ||||
margin: 30rpx 30rpx 0rpx 30rpx; | margin: 30rpx 30rpx 0rpx 30rpx; | ||||
height: 80rpx; | height: 80rpx; | ||||
box-sizing: border-box; | box-sizing: border-box; | ||||
flex: 1; | flex: 1; | ||||
} | } | ||||
.search-box .icon { | .search-box .icon { | ||||
width: 48rpx; | width: 48rpx; | ||||
height: 48rpx; | height: 48rpx; | ||||
margin: 0 20rpx; | margin: 0 20rpx; | ||||
} | } | ||||
.search-box .search { | .search-box .search { | ||||
flex: 1; | flex: 1; | ||||
margin-right: 20rpx; | margin-right: 20rpx; | ||||
font-size: 28rpx; | font-size: 28rpx; | ||||
color: #00b38b; | color: #00b38b; | ||||
} | } | ||||
.search-btn{ | |||||
.search-btn { | |||||
color: white; | color: white; | ||||
background-color: #00B38B; | background-color: #00B38B; | ||||
width: 140rpx; | width: 140rpx; |
//获取fileData | //获取fileData | ||||
const getFileData = () => { | const getFileData = () => { | ||||
console.log("======修改车辆信息0.1======",fileDataStrings); | |||||
console.log("======修改车辆信息0.1======", fileDataStrings); | |||||
//获取fileData 拼接字符串 | //获取fileData 拼接字符串 | ||||
let res1 = AsciToHexString(fileDataStrings.vehiclePlate, 24); //车牌号 | let res1 = AsciToHexString(fileDataStrings.vehiclePlate, 24); //车牌号 | ||||
let res2 = IntegerToHexString(fileDataStrings.vehiclePlateColor, 4); //车牌颜色 | let res2 = IntegerToHexString(fileDataStrings.vehiclePlateColor, 4); //车牌颜色 | ||||
// state.orderId, | // state.orderId, | ||||
// }); | // }); | ||||
bindCardAndObu(); | bindCardAndObu(); | ||||
}); | }); | ||||
}; | }; | ||||
/** | /** | ||||
tools.hideLoadingAlert(); | tools.hideLoadingAlert(); | ||||
let result = JSON.parse(res.bizContent); | let result = JSON.parse(res.bizContent); | ||||
console.log("写卡指令============", result) | 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) => { | .catch((err) => { | ||||
console.log(err); | console.log(err); | ||||
method: "POST", //提交方式(默认POST) | method: "POST", //提交方式(默认POST) | ||||
showLoading: true, //是否显示加载中(默认显示) | showLoading: true, //是否显示加载中(默认显示) | ||||
}; | }; | ||||
//调用方式 | //调用方式 | ||||
request(IFCODE.writeCardBack, options) | request(IFCODE.writeCardBack, options) | ||||
.then((res) => { | .then((res) => { |
state.formData[7].itemData = nameList; | state.formData[7].itemData = nameList; | ||||
state.formData[14].itemData = nameList; | state.formData[14].itemData = nameList; | ||||
}); | }); | ||||
}; | }; | ||||
//radio改变 | //radio改变 | ||||
for (let i = 8; i < 14; i++) { | for (let i = 8; i < 14; i++) { | ||||
state.formData[i].hide = false; | 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") { | } else if (state.exchangeMode === "SELF") { | ||||
//SELF-线上-营业点自提 | //SELF-线上-营业点自提 | ||||
state.formData[7].hide = false; | state.formData[7].hide = false; | ||||
} | } | ||||
//地址改变 | //地址改变 | ||||
const addressInfo = (content : any) => { | 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[9][state.formData[9].value] = content.userName; | ||||
state.formData[10][state.formData[10].value] = content.telNumber; | state.formData[10][state.formData[10].value] = content.telNumber; | ||||
state.formData[11][ | state.formData[11][ | ||||
] = `${content.provinceName}/${content.cityName}/${content.countyName}`; | ] = `${content.provinceName}/${content.cityName}/${content.countyName}`; | ||||
state.formData[12][state.formData[12].value] = content.detailInfo; | state.formData[12][state.formData[12].value] = content.detailInfo; | ||||
state.formData[13][state.formData[13].value] = content.postalCode; | state.formData[13][state.formData[13].value] = content.postalCode; | ||||
// #endif | |||||
}; | }; | ||||
//提交换货申请 | //提交换货申请 |
//客车1 货车2 | //客车1 货车2 | ||||
type: { | type: { | ||||
type: String, | type: String, | ||||
default: '1' | |||||
// default: '1' | |||||
}, | }, | ||||
}) | }) | ||||
} | } | ||||
const getCarColor = () => { | const getCarColor = () => { | ||||
const data = getItem('globalParam') | const data = getItem('globalParam') | ||||
console.log("props.type", props.type, data) | |||||
if (props.type == "1") { | if (props.type == "1") { | ||||
console.log("props.type", props.type, data) | |||||
for (var i = 0; i < data.carPlateColorType.length; i++) { | for (var i = 0; i < data.carPlateColorType.length; i++) { | ||||
for (var j = 0; j < state.allColorList.length; j++) { | for (var j = 0; j < state.allColorList.length; j++) { | ||||
console.log("23", getCodeName('VEHICLE_COLOR_TYPE', data.trucksPlateColorType[i])) | console.log("23", getCodeName('VEHICLE_COLOR_TYPE', data.trucksPlateColorType[i])) | ||||
console.log("state.numberplateColorList", state.numberplateColorList) | console.log("state.numberplateColorList", state.numberplateColorList) | ||||
} | } | ||||
onMounted(() => { | onMounted(() => { | ||||
getCarColor() | |||||
console.log("type", props.type) | |||||
setTimeout(() => { | |||||
getCarColor() | |||||
}) | |||||
}) | }) | ||||
</script> | </script> | ||||
uni.redirectTo({ | uni.redirectTo({ | ||||
url: `/subpackage/orders/choice-product?orderId=${val.orderId}`, | 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) { | } else if (val.orderStep === 4) { | ||||
uni.redirectTo({ | uni.redirectTo({ | ||||
url: `/subpackage/orders/product-detail?orderId=${val.orderId}&&clientFee=${val.product.clientFee}&&id=${val.productId}`, | url: `/subpackage/orders/product-detail?orderId=${val.orderId}&&clientFee=${val.product.clientFee}&&id=${val.productId}`, | ||||
}; | }; | ||||
onLoad((option : any) => { | onLoad((option : any) => { | ||||
globalParam(); | |||||
state.data.type = option.type; //1客车 2货车 | |||||
state.data.opId = getItem(StorageKeys.OpenId); | state.data.opId = getItem(StorageKeys.OpenId); | ||||
state.data.type = option.type; //客车 | |||||
state.data.userType = option.userType; | state.data.userType = option.userType; | ||||
state.data.promoteId = option.promoteId; | state.data.promoteId = option.promoteId; | ||||
state.isValueCard = option.isValueCard | state.isValueCard = option.isValueCard | ||||
state.equityId = option.equityId; | state.equityId = option.equityId; | ||||
console.log("订单选择推广发行产品接口", option) | console.log("订单选择推广发行产品接口", option) | ||||
getInfo(); | getInfo(); | ||||
globalParam(); | |||||
uni.getLocation({ | uni.getLocation({ | ||||
type: 'wgs84', | type: 'wgs84', | ||||
success: function (res) { | success: function (res) { |
// tools.showLoadingAlert("加载中"); | // tools.showLoadingAlert("加载中"); | ||||
uni.downloadFile({ | uni.downloadFile({ | ||||
url: state.agreeURL, | url: state.agreeURL, | ||||
filePath: wx.env.USER_DATA_PATH + '/' + '代扣协议1.docx', | |||||
filePath: uni.env.USER_DATA_PATH + '/' + '代扣协议.docx', | |||||
success(res) { | success(res) { | ||||
const filePath = res.filePath | const filePath = res.filePath | ||||
uni.openDocument({ | uni.openDocument({ |
*json字符串转换成json对象 | *json字符串转换成json对象 | ||||
*/ | */ | ||||
export function stringToJson(data) { | export function stringToJson(data) { | ||||
// let index = data.lastIndexOf("}") | |||||
// let content = data.substring(0, index + 1); | |||||
// console.log("content111111", data) | |||||
return JSON.parse(data); | return JSON.parse(data); | ||||
} | } | ||||
// console.log("没处理之前的数据", bizContent) | // console.log("没处理之前的数据", bizContent) | ||||
if (bizContent.substr(0, 1) == '[') { | 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 { | } else { | ||||
// 返回数据是对象情况 | // 返回数据是对象情况 | ||||
let begin = bizContent.indexOf('{'); | let begin = bizContent.indexOf('{'); | ||||
cipherText.data.bizContent = bizContent.substring(begin, end + 1) | cipherText.data.bizContent = bizContent.substring(begin, end + 1) | ||||
} | } | ||||
} | } | ||||
// cipherText.data.bizContent = bizContent; | |||||
return cipherText | return cipherText | ||||
} catch (e) { | } catch (e) { | ||||
console.error(e) | console.error(e) |