@@ -0,0 +1,96 @@ | |||
/** | |||
* 订单列表业务逻辑 | |||
*/ | |||
import { onLoad, onShow, onUnload } from "@dcloudio/uni-app"; | |||
import { reactive, ref } from 'vue'; | |||
import { hasLogin, msg } from "@/utils/utils"; | |||
import { orderList } from "@/utils/network/api.js"; | |||
import useOrderSkip from "@/composables/order/useOrderSkip"; | |||
//办理订单按钮跳转业务逻辑 | |||
const { | |||
gotoEditAddress, | |||
gotoCancelOrder, | |||
gotoEditUserOrUnitInfo, | |||
gotoConfirmReceipt, | |||
gotoCheckLogistics, | |||
gotoEvaluateOrder, | |||
gotoEvaluateProduct, | |||
gotoEvaluateSalesman, | |||
gotoActiveOrder, | |||
gotoReturnOrder, | |||
gotoExchangeOrder, | |||
gotoOrderDetailsPay, | |||
gotoOrderDetails, | |||
gotoAgainUseOrder, | |||
gotoOrderSign, | |||
closeOrder | |||
} = useOrderSkip(); | |||
import { | |||
getItem, | |||
setItem, | |||
StorageKeys | |||
} from "@/utils/storage"; | |||
import { | |||
stringToJson | |||
} from "@/utils/network/encryption.js"; | |||
import { | |||
request | |||
} from "@/utils/network/request.js"; | |||
export default function orderJump() { | |||
const data = reactive({ | |||
}) | |||
onLoad((option) => { | |||
}); | |||
onUnload(() => { | |||
}); | |||
onShow(() => { | |||
}) | |||
const getOrderList = (orderId) => { | |||
let newsource = "WECHAT" | |||
// #ifdef MP-ALIPAY | |||
newsource = "ALI" | |||
// #endif | |||
const options = { | |||
type: 2, | |||
data: { | |||
"opId": getItem(StorageKeys.OpenId), | |||
"source": newsource, | |||
"vehiclePlate": "", | |||
"tabIndex": 0, | |||
"pageNo": 1, | |||
"pageSize": 1, | |||
"orderId": orderId | |||
}, | |||
method: 'POST', | |||
showLoading: true | |||
} | |||
request(orderList, options).then((res) => { | |||
uni.hideLoading() | |||
const item = stringToJson(res.bizContent).data[0] | |||
console.log("订单数据", item) | |||
// item.orderStep >=3 不等于4 26 27 会反7041 | |||
// 已支付/待签约 | |||
if (item.orderStep == 3) { | |||
gotoOrderSign(item) | |||
// 去激活 | |||
} else if (item.orderStep == 10) { | |||
gotoActiveOrder(item) | |||
} | |||
// else if (item.orderStep == 2 || item.orderStep == 1 || item.orderStep == 4 || item.orderStep == 27) { | |||
// // 完成个人/单位信息上传 完成填写基本信息 完成车辆信息上传 待支付3 | |||
// gotoEditUserOrUnitInfo(item) | |||
// } | |||
}) | |||
} | |||
return { | |||
getOrderList | |||
} | |||
} |
@@ -5,15 +5,14 @@ import { reactive, ref, watch, nextTick, onMounted } from "vue"; | |||
import { request } from "@/utils/network/request.js"; | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
import { onLoad, onUnload, onReachBottom, onPullDownRefresh } from "@dcloudio/uni-app"; | |||
import { getItem, StorageKeys } from "@/utils/storage"; | |||
import { getItem, StorageKeys, setItem } from "@/utils/storage"; | |||
import { hasLogin, msg, timesDiff } from "@/utils/utils"; | |||
import { orderList } from "@/utils/network/api"; | |||
import { orderList, appPage } from "@/utils/network/api"; | |||
import { PageData } from "@/datas/enum"; | |||
const tools = require("../../static/etcUtil/tools.js"); | |||
export default function useOrderListItem(props) { | |||
//搜索关键字 | |||
const searchKeyWords = ref(''); | |||
//订单列表数据 | |||
const ordersList = ref([]); | |||
@@ -66,6 +65,8 @@ export default function useOrderListItem(props) { | |||
/* 刷新列表 */ | |||
const refreshList = (isLoading) => { | |||
console.log("========", isLoading) | |||
params.pageNum = 1; | |||
params.total = 0; | |||
params.status = 'more'; | |||
@@ -74,6 +75,10 @@ export default function useOrderListItem(props) { | |||
getList(); | |||
} | |||
const changeTab = (tabOption) => { | |||
setItem('tab', tabOption) | |||
refreshList(true) | |||
} | |||
/* 加载更多 */ | |||
const loadMore = () => { | |||
if (params.total > ordersList.value.length) { | |||
@@ -86,7 +91,7 @@ export default function useOrderListItem(props) { | |||
} | |||
/* 获取列表数据 */ | |||
const getList = async (isLoading = true) => { | |||
const getList = async () => { | |||
if (!hasLogin()) { | |||
uni.stopPullDownRefresh(); | |||
uni.$emit('refreshFinish'); | |||
@@ -98,80 +103,154 @@ export default function useOrderListItem(props) { | |||
// #ifdef MP-ALIPAY | |||
newsource = "ALI" | |||
// #endif | |||
let options = {} | |||
if (getItem('tab') == '线下网点') { | |||
options = { | |||
type: 2, | |||
data: { | |||
"opId": getItem(StorageKeys.OpenId), | |||
// "source": newsource, | |||
"vehiclePlate": searchKeyWords.value, | |||
"tabIndex": props.index + '', | |||
"pageNo": params.pageNum, | |||
"pageSize": params.pageSize, | |||
// "promotionModes": 1, | |||
}, | |||
method: 'POST', | |||
showLoading: true | |||
} | |||
console.log("线下网点", ordersList.value) | |||
try { | |||
console.log('输出内容1111111') | |||
request(appPage, options).then((res) => { | |||
uni.hideLoading() | |||
var data = data = stringToJson(res.bizContent); | |||
console.log("ordersList.value", data) | |||
params.total = data.totalCount; | |||
const options = { | |||
type: 2, | |||
data: { | |||
"opId": getItem(StorageKeys.OpenId), | |||
"source": newsource, | |||
"vehiclePlate": searchKeyWords.value, | |||
"tabIndex": props.index + '', | |||
"pageNo": params.pageNum, | |||
"pageSize": params.pageSize, | |||
"promotionModes": 1, | |||
}, | |||
method: 'POST', | |||
// showLoading: isLoading ? (params.pageNum === 1 ? true : false) : false , | |||
} | |||
console.log("订单列表查询", options) | |||
try { | |||
// res = await request(orderList, options); | |||
console.log('输出内容1111111') | |||
request(orderList, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
console.log("ordersList.value", ordersList.value) | |||
params.total = data.totalCount; | |||
if (params.pageNum === 1) { | |||
ordersList.value = []; | |||
} | |||
if (params.total > 0) { | |||
const curList = data.data || []; | |||
ordersList.value = params.reload ? curList : ordersList.value.concat(curList); | |||
params.reload = false; | |||
} | |||
if (params.total === ordersList.value.length) { | |||
params.reload = false; | |||
params.status = 'noMore'; | |||
} | |||
if (params.pageNum === 1) { | |||
uni.stopPullDownRefresh(); | |||
} | |||
// 订单发货后未激活 30天 以后 结束订单功能 insertTime >30 算出来距离今天是负数 updateTime<30(结束订单) | |||
for (var k = 0; k < ordersList.value.length; k++) { | |||
if (ordersList.value[k]['insertTime']) { | |||
if (timesDiff(ordersList.value[k]['insertTime'].replace("T", " ")).days > 30) { | |||
ordersList.value[k]['finishOrder'] = true //可以结束 | |||
} else { | |||
ordersList.value[k]['finishOrder'] = false //不可以结束 | |||
} | |||
if (params.pageNum === 1) { | |||
ordersList.value = []; | |||
} | |||
if (params.total > 0) { | |||
const curList = data.data || []; | |||
ordersList.value = params.reload ? curList : ordersList.value.concat(curList); | |||
params.reload = false; | |||
} | |||
if (params.total === ordersList.value.length) { | |||
params.reload = false; | |||
params.status = 'noMore'; | |||
} | |||
if (ordersList.value[k]['updateTime']) { | |||
if (timesDiff(ordersList.value[k]['updateTime'].replace("T", " ")).days <= 30) { | |||
ordersList.value[k]['isUseAgain'] = true //可以再次使用 | |||
} else { | |||
ordersList.value[k]['isUseAgain'] = false //不可以再次使用 | |||
if (params.pageNum === 1) { | |||
uni.stopPullDownRefresh(); | |||
} | |||
// 订单发货后未激活 30天 以后 结束订单功能 insertTime >30 算出来距离今天是负数 updateTime<30(结束订单) | |||
for (var k = 0; k < ordersList.value.length; k++) { | |||
if (ordersList.value[k]['insertTime']) { | |||
if (timesDiff(ordersList.value[k]['insertTime'].replace("T", " ")).days > 30) { | |||
ordersList.value[k]['finishOrder'] = true //可以结束 | |||
} else { | |||
ordersList.value[k]['finishOrder'] = false //不可以结束 | |||
} | |||
} | |||
if (ordersList.value[k]['updateTime']) { | |||
if (timesDiff(ordersList.value[k]['updateTime'].replace("T", " ")).days <= 30) { | |||
ordersList.value[k]['isUseAgain'] = true //可以再次使用 | |||
} else { | |||
ordersList.value[k]['isUseAgain'] = false //不可以再次使用 | |||
} | |||
} | |||
} | |||
} | |||
console.log('输出内容222222', ordersList) | |||
}) | |||
.catch((err) => { | |||
console.log(err); | |||
}); | |||
uni.$emit("refreshOrder"); | |||
console.log('输出内容111111', ordersList) | |||
}) | |||
.catch((err) => { | |||
console.log(err); | |||
}); | |||
uni.$emit('refreshFinish'); | |||
} catch (e) { | |||
// uni.$emit('refreshFinish'); | |||
} catch (e) { | |||
uni.stopPullDownRefresh(); | |||
uni.$emit('refreshFinish'); | |||
uni.stopPullDownRefresh(); | |||
uni.$emit('refreshFinish'); | |||
} | |||
} else { | |||
options = { | |||
type: 2, | |||
data: { | |||
"opId": getItem(StorageKeys.OpenId), | |||
"source": newsource, | |||
"vehiclePlate": searchKeyWords.value, | |||
"tabIndex": props.index + '', | |||
"pageNo": params.pageNum, | |||
"pageSize": params.pageSize, | |||
"promotionModes": 1, | |||
}, | |||
method: 'POST', | |||
showLoading: true | |||
} | |||
try { | |||
console.log('输出内容1111111') | |||
request(orderList, options).then((res) => { | |||
uni.hideLoading() | |||
var data = data = stringToJson(res.bizContent); | |||
console.log("ordersList.value", data) | |||
params.total = data.totalCount; | |||
if (params.pageNum === 1) { | |||
ordersList.value = []; | |||
} | |||
if (params.total > 0) { | |||
const curList = data.data || []; | |||
ordersList.value = params.reload ? curList : ordersList.value.concat(curList); | |||
params.reload = false; | |||
} | |||
if (params.total === ordersList.value.length) { | |||
params.reload = false; | |||
params.status = 'noMore'; | |||
} | |||
if (params.pageNum === 1) { | |||
uni.stopPullDownRefresh(); | |||
} | |||
// 订单发货后未激活 30天 以后 结束订单功能 insertTime >30 算出来距离今天是负数 updateTime<30(结束订单) | |||
for (var k = 0; k < ordersList.value.length; k++) { | |||
if (ordersList.value[k]['insertTime']) { | |||
if (timesDiff(ordersList.value[k]['insertTime'].replace("T", " ")).days > 30) { | |||
ordersList.value[k]['finishOrder'] = true //可以结束 | |||
} else { | |||
ordersList.value[k]['finishOrder'] = false //不可以结束 | |||
} | |||
} | |||
if (ordersList.value[k]['updateTime']) { | |||
if (timesDiff(ordersList.value[k]['updateTime'].replace("T", " ")).days <= 30) { | |||
ordersList.value[k]['isUseAgain'] = true //可以再次使用 | |||
} else { | |||
ordersList.value[k]['isUseAgain'] = false //不可以再次使用 | |||
} | |||
} | |||
} | |||
console.log('输出内容222222', ordersList) | |||
}) | |||
.catch((err) => { | |||
console.log(err); | |||
}); | |||
uni.$emit('refreshFinish'); | |||
} catch (e) { | |||
uni.stopPullDownRefresh(); | |||
uni.$emit('refreshFinish'); | |||
} | |||
} | |||
console.log("订单列表查询", options) | |||
} | |||
watch(() => props.index, () => { | |||
@@ -201,6 +280,7 @@ export default function useOrderListItem(props) { | |||
ordersList, | |||
doSearch, | |||
onKeyInput, | |||
refreshList | |||
refreshList, | |||
changeTab | |||
}; | |||
} |
@@ -25,7 +25,7 @@ | |||
</view> | |||
<view class="btn"> | |||
<submit-button title="登录" @submit="doLogin" ></submit-button> | |||
<submit-button title="登录" @submit="doLogin"></submit-button> | |||
</view> | |||
<view class="agreement"> | |||
@@ -169,7 +169,6 @@ | |||
subscribeMessages(); | |||
msg("登录成功!"); | |||
uni.$emit("refreshOrder"); | |||
// uni.navigateBack(); | |||
uni.switchTab({ | |||
url: '/pages/index/index' | |||
}) |
@@ -374,9 +374,6 @@ | |||
let options = { | |||
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交) | |||
data: { | |||
// opId: getItem("openId"), | |||
// source: "WECHAT", | |||
// tabIndex: "0", | |||
}, //请求参数 | |||
method: "POST", //提交方式(默认POST) | |||
showLoading: true, //是否显示加载中(默认显示) |
@@ -39,8 +39,8 @@ | |||
v-if="item.amount">{{item.amount / 100}}</text><text class="amount" v-else>0.00</text> | |||
</view> | |||
</view> | |||
<template v-if="item.orderStatus != OrderStatus.已取消"> | |||
<!-- item.orderSource==1 app --> | |||
<view v-if="item.orderStatus != OrderStatus.已取消 && !item.orderSource"> | |||
<!-- 信息填写未完成 --> | |||
<view class="btns" | |||
@@ -138,7 +138,14 @@ | |||
'退款成功' = 16, | |||
'退货成功' = 17, | |||
'换货-设备已回收' = 18, --> | |||
</template> | |||
</view> | |||
<view v-else> | |||
<!-- 待激活 --> | |||
<view class="btns" v-if="item.orderStep == OrderStatus.待激活 "> | |||
<view class="btn btn-primary" @click.stop="gotoActiveOrder(item)">去激活</view> | |||
</view> | |||
</view> | |||
</view> | |||
<!-- 弹窗 --> |
@@ -49,12 +49,13 @@ | |||
/* 改变tab refresh:点击同个tab是否刷新*/ | |||
const changeTab = (index, refresh ?: boolean) => { | |||
console.log("index", index) | |||
if (refresh) { | |||
console.log("index111", index) | |||
uni.$emit("refreshOrder"); | |||
return; | |||
} | |||
if (props.curIndex != index) { | |||
console.log("index222", index) | |||
emit('update:curIndex', index) | |||
} | |||
} |
@@ -30,6 +30,7 @@ | |||
import useOrderList from "@/composables/order/useOrderList"; | |||
import filter from '@/components/filter/filter.vue'; | |||
import { onLoad } from "@dcloudio/uni-app"; | |||
import useOrderListItem from "@/composables/order/useOrderListItem"; | |||
import { | |||
reactive | |||
} from "vue"; | |||
@@ -41,12 +42,27 @@ | |||
tabActive: "小程序", | |||
flowPathTabList: ["小程序", "线下网点"], | |||
}) | |||
const props = defineProps({ | |||
index: { | |||
type: Number, | |||
default() { | |||
return 0 | |||
} | |||
}, | |||
refresh: { //是否刷新列表 | |||
type: Boolean, | |||
default: true | |||
} | |||
}) | |||
const { changeTab } = useOrderListItem(props); | |||
onLoad((option) => { | |||
// console.log("option",option) | |||
// data.tabIndex=option.index | |||
// 一进来就调一遍 | |||
changeTab(state.tabActive) | |||
}) | |||
const flowPathTabHandle = (tab) => { | |||
state.tabActive = tab; | |||
changeTab(state.tabActive) | |||
}; | |||
</script> | |||
@@ -15,14 +15,10 @@ | |||
</view> | |||
<view class="input-box"> | |||
<input v-model="state.money" placeholder="请输入金额" class="input" /> | |||
<input v-model="state.money" placeholder="请输入金额" class="input" type="number" @input="checkNum" /> | |||
<view class="tips">最低充值金额不小于10元</view> | |||
</view> | |||
<view class="tabs"> | |||
<!-- <view class="tab-tit as-gravity-center-start">充值方式 | |||
<u-input @click="state.transWayTypeShow = true" inputAlign="center" v-model="state.transWayName" | |||
type="select" /> | |||
</view> --> | |||
<view class="tab-tit">在线充值</view> | |||
<view class="tab"> | |||
@@ -878,6 +874,27 @@ | |||
url: `/subpackage/personal-center/consumption-record?cardId=${state.cardId}` | |||
}) | |||
} | |||
// 校验金额输入框 | |||
const checkNum = (event) => { | |||
let sNum = event.target.value.toString(); //先转换成字符串类 | |||
if (sNum.indexOf('.') == 0) {//第一位就是 . | |||
console.log('first str is .') | |||
sNum = '0' + sNum | |||
} | |||
sNum = sNum.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符 | |||
sNum = sNum.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的 | |||
sNum = sNum.replace(".", "$#$").replace(/\./g, "").replace("$#$", "."); | |||
sNum = sNum.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');//只能输入两个小数 | |||
//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额 | |||
if (sNum.indexOf(".") < 0 && sNum != "") { | |||
sNum = parseFloat(sNum); | |||
} | |||
console.log('输入的值1', sNum) | |||
setTimeout(() => { | |||
state.money = sNum | |||
}, 20) | |||
} | |||
</script> | |||
<style> |
@@ -1,7 +1,7 @@ | |||
<template> | |||
<view class="oderPage"> | |||
<view class="addr-box"> | |||
<view class="addr-box-left"> | |||
<view class="addr-box-left" v-if="form.consignee"> | |||
<view class="text-image">{{form.consignee.charAt(0)}} </view> | |||
<view class="content"> | |||
<view class=""> | |||
@@ -12,6 +12,7 @@ | |||
<view class=""> {{form.region +form.address}}</view> | |||
</view> | |||
</view> | |||
<view v-else class="editAddress">请先编辑地址</view> | |||
<view class="edit" @click="address.show = true"> | |||
<image :src="`${$imgUrl}applyCard/edit.png`" mode=""></image> | |||
</view> | |||
@@ -53,7 +54,7 @@ | |||
<u-form-item prop="returnNum" v-if="form.sendStatusName == '寄回'"> | |||
<view class="from_item"> | |||
<text><text style="color: red"></text>退货单号:</text> | |||
<u-input v-model="form.courierOrderId" class="input" /> | |||
<u-input v-model="form.courierOrderId" class="input" maxlength="32" type="number" /> | |||
</view> | |||
</u-form-item> | |||
<u-form-item prop="cardState"> | |||
@@ -404,7 +405,7 @@ | |||
}; | |||
const submit = () => { | |||
queryCckChangejzCardInfo().then(val => { | |||
console.log("queryCckChangejzCardInfo",val) | |||
console.log("queryCckChangejzCardInfo", val) | |||
navTo( | |||
`/subpackage/after-sale/replace-equipment/result` | |||
) | |||
@@ -438,7 +439,7 @@ | |||
return new Promise(async (resolve, reject) => { | |||
const res = await request(changeCardInfo, options); | |||
console.log("res",res.errorMsg) | |||
console.log("res", res.errorMsg) | |||
const data = res.errorMsg; | |||
resolve(data); | |||
}).catch((error) => { | |||
@@ -743,4 +744,8 @@ | |||
align-items: center; | |||
margin-top: 60rpx; | |||
} | |||
.editAddress { | |||
font-size: 30rpx; | |||
} | |||
</style> |
@@ -185,8 +185,6 @@ | |||
uni.switchTab({ | |||
url: "/pages/order/order" | |||
}) | |||
// uni.$emit("refreshOrder"); | |||
// uni.navigateBack(); | |||
}, "已完成签约", false); | |||
} else if (data.signStatus === "UNSIGN") { | |||
//已解约 |
@@ -118,11 +118,6 @@ | |||
confirm( | |||
"您已完成签约,等待业务员审核发货", | |||
() => { | |||
// uni.switchTab({ | |||
// url: "/pages/order/order" | |||
// }) | |||
// uni.$emit("refreshOrder"); | |||
// uni.navigateBack(); | |||
const param = `https://qtzl.etcjz.cn/order/#/pages/sigManage/signContract?qdOrderNo=${state.qdOrderNo}&type=3` | |||
const params = encodeURIComponent(JSON.stringify(param)) | |||
console.log('支付结果查询params', params) |
@@ -635,7 +635,7 @@ | |||
} else { | |||
state.form.vehicleIdNum = data.plate_a; | |||
} | |||
state.form.ownerName = data.ownerName; | |||
state.form.ownerName = data.man; | |||
state.form.vehicleType = data.vehicle; | |||
state.form.character = data.character; | |||
state.form.vin = data.vin; |
@@ -48,7 +48,7 @@ | |||
import { onLoad, onUnload, onReachBottom, onPullDownRefresh } from "@dcloudio/uni-app"; | |||
import { getItem, StorageKeys } from "@/utils/storage"; | |||
import { hasLogin, msg, getOrderStatusName, getOrderTypeName } from "@/utils/utils"; | |||
import { orderList } from "@/utils/network/api"; | |||
import { noActivationOrder } from "@/utils/network/api"; | |||
import { PageData } from "@/datas/enum"; | |||
import useOrderSkip from "@/composables/order/useOrderSkip"; | |||
@@ -107,31 +107,32 @@ | |||
} | |||
let source = "" | |||
// #ifdef MP-ALIPAY | |||
source ="ALI" | |||
source = "ALI" | |||
// #endif | |||
// #ifdef MP-WEIXIN | |||
source ="WECHAT" | |||
source = "WECHAT" | |||
// #endif | |||
let res : any = null; | |||
const options = { | |||
type: 2, | |||
data: { | |||
"opId": getItem(StorageKeys.OpenId), | |||
"source": source, | |||
"vehiclePlate": "", | |||
"tabIndex": '0', | |||
"pageNo": params.pageNum, | |||
"pageSize": params.pageSize, | |||
"isValueCard":"", | |||
"title":"0", | |||
"orderStep":"10" | |||
// "source": source, | |||
// "vehiclePlate": "", | |||
// "tabIndex": '0', | |||
// "pageNo": params.pageNum, | |||
// "pageSize": params.pageSize, | |||
// "isValueCard": "", | |||
// "title": "0", | |||
// "orderStep": "10" | |||
}, | |||
method: 'POST', | |||
showLoading: params.pageNum === 1 ? true : false, | |||
} | |||
try { | |||
res = await request(orderList, options); | |||
res = await request(noActivationOrder, options); | |||
console.log("res====", res) | |||
const data = stringToJson(res.bizContent); | |||
params.total = data.totalCount; | |||
@@ -283,4 +283,6 @@ export const queryPhoneApi = "068cf4d1a26f4c2ba37dcf92c7519f88" //对公账户 | |||
export const forgetPassApi = "edaf323b75ba4a2490c242305d692b40" //对公账户忘记密码提交 | |||
export const creactWorkOrder = "c0e9940b350a44c8a60c7d57691658d5" //创建工单 | |||
export const workOrderList = "9cc56a94b9e342228a89e389303f0898" //查询是否有工单 | |||
export const changeWorkOrderStatus = "154c93c9474046dc8c397c35f641e97c" //修改工单 | |||
export const changeWorkOrderStatus = "154c93c9474046dc8c397c35f641e97c" //修改工单 | |||
export const appPage = "608fc3bddd3e4d7b8667b71b743f1b52" //app分页 | |||
export const noActivationOrder = "fa0ef243d4044a96b5fb0186081baf20" //所有待激活订单 |
@@ -116,12 +116,8 @@ export function arrayToJsonString(array) { | |||
*json字符串转换成json对象 | |||
*/ | |||
export function stringToJson(data) { | |||
if (data) { | |||
return JSON.parse(data); | |||
} else { | |||
// 处理换货/换卡签查询接口885,数据问题 | |||
return 0; | |||
} | |||
// console.log("data====", data) | |||
return JSON.parse(data); | |||
} | |||
//array转json对象 |
@@ -22,6 +22,10 @@ import { | |||
import { | |||
updateToken | |||
} from "@/utils/network/api"; | |||
import orderJump from "@/composables/order/orderJump"; | |||
const { | |||
getOrderList | |||
} = orderJump(); | |||
const s4 = new SM4Util() | |||
/* 刷新token */ | |||
@@ -111,12 +115,6 @@ export function request(code, options = {}, start = false) { | |||
if (options.showLoading) { | |||
uni.hideLoading() | |||
} | |||
// if (res.data.statusCode == 704 && res.data.errorMsg.indexOf('相应的申请单')) { | |||
// // let content = s4.decryptData_CBC(res, sm4Key) | |||
// console.log('请求成功返回参数:---------', code, content, res) | |||
// let aa = "data: {bizContent:{'val':null}}" | |||
// resolve(aa) | |||
// } else | |||
if (res.data.statusCode !== 0) { | |||
if (res.data.statusCode == 600) { | |||
resolve(res.data) | |||
@@ -157,6 +155,50 @@ export function request(code, options = {}, start = false) { | |||
} | |||
}); | |||
} | |||
} else if (res.data.statusCode == 7041) { | |||
let orderId = res.data.errorMsg | |||
uni.showModal({ | |||
title: '提示', | |||
content: "继续申请", | |||
// cancelText: '解除车牌', //前往解除车牌占用 | |||
success: function(res) { | |||
if (res.confirm) { | |||
console.log('继续申办2', orderId); | |||
getOrderList(orderId) | |||
} else if (res.cancel) { | |||
} | |||
} | |||
}); | |||
} else if (res.data.statusCode == 7042) { | |||
uni.showModal({ | |||
title: '提示', | |||
content: res.data.errorMsg, | |||
confirmText: "去激活", | |||
success: function(res) { | |||
if (res.confirm) { | |||
uni.redirectTo({ | |||
url: "/subpackage/personal-center/install-activation-order" | |||
}) | |||
} else if (res.cancel) { | |||
} | |||
} | |||
}); | |||
} else if (res.data.statusCode == 7043) { | |||
uni.showModal({ | |||
title: '提示', | |||
content: res.data.errorMsg, | |||
success: function(res) { | |||
if (res.confirm) { | |||
uni.redirectTo({ | |||
url: "/subpackage/after-sale/onlineService" | |||
}) | |||
} else if (res.cancel) { | |||
} | |||
} | |||
}); | |||
} else { | |||
// 当前车辆已存在订单,无法再次创建订单 | |||
if (code == 6 && res.data.statusCode == 704) { |
@@ -409,7 +409,9 @@ function SM4Util() { | |||
// 返回数据是对象情况 | |||
let begin = bizContent.indexOf('{'); | |||
let end = bizContent.lastIndexOf('}'); | |||
cipherText.data.bizContent = bizContent.substring(begin, end + 1) | |||
console.log("返回数据是对象情况,", bizContent.substring(begin, end + 1)) | |||
} | |||
} | |||
return cipherText |