@@ -4,7 +4,7 @@ | |||
:style="{paddingTop:searchMarginTop+'px',height:searchHeight+'px',lineHeight:searchHeight+'px'}"> | |||
<block v-if="isBack && !isAlipay"> | |||
<image :src="`/static/image/icon-back.png`" :style="{height:searchHeight+'px',width:searchHeight+'px'}" | |||
class="back" @click="back(title,type,userType)"></image> | |||
class="back" @click="back(title,type,userType,orderId)"></image> | |||
</block> | |||
<text>{{title}}</text> | |||
</view> | |||
@@ -53,6 +53,10 @@ | |||
type: String, | |||
default: '' | |||
}, | |||
orderId: { | |||
type: String, | |||
default: '' | |||
}, | |||
type: { | |||
type: String, | |||
default: '' | |||
@@ -70,8 +74,8 @@ | |||
default: 0 | |||
} | |||
}) | |||
const back = (title, type, userType) => { | |||
console.log("555555555", title, type, userType) | |||
const back = (title, type, userType, orderId) => { | |||
console.log("555555555", title, type, userType, orderId) | |||
if (title == "九州ETC" && type) { | |||
uni.redirectTo({ | |||
url: `/subpackage/orders/choice-product?type=${type}&&userType=${userType}` | |||
@@ -94,6 +98,11 @@ | |||
delta: 1 | |||
}) | |||
} | |||
// else if (title == "订单支付") { | |||
// uni.navigateTo({ | |||
// url: `/subpackage/orders/product-detail?orderId=orderId` | |||
// }) | |||
// } | |||
} | |||
</script> | |||
@@ -3,7 +3,9 @@ import { msg, navTo } from "@/utils/utils"; | |||
import { OrderStatus } from "@/datas/enum"; | |||
import { OrderTypes } from "@/datas/enum"; | |||
import { getItem, setItem } from "@/utils/storage"; | |||
import { request } from "@/utils/network/request.js"; | |||
import { gotoAgainUseOrderApi } from "@/utils/network/api.js"; | |||
import { stringToJson } from "@/utils/network/encryption.js"; | |||
export default function useOrderSkip() { | |||
//根据订单类型 跳转到不同的订单详情页面 | |||
@@ -183,12 +185,30 @@ export default function useOrderSkip() { | |||
//跳转到车辆信息变更界面 | |||
navTo(`/subpackage/personal-center/setting/car-information/car-change`); | |||
} | |||
//再次使用订单 | |||
const gotoAgainUseOrder = (orderInfo : any) => { | |||
const options = { | |||
type: 2, | |||
data: { | |||
orderId: orderInfo.orderId, | |||
orderSource: "WECHAT", | |||
openId: getItem('openId'), | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(gotoAgainUseOrderApi, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
// 刷新本页面 | |||
console.log("再次使用订单", data) | |||
}); | |||
} | |||
return { | |||
gotoEditAddress, gotoCancelOrder, gotoEditUserOrUnitInfo, | |||
gotoConfirmReceipt, gotoCheckLogistics, gotoEvaluateOrder, gotoEvaluateProduct, gotoEvaluateSalesman, | |||
gotoActiveOrder, gotoReturnOrder, gotoExchangeOrder, gotoPay, | |||
gotoOrderDetails, gotoLogoffETC, gotoEditCarWriteInfo, | |||
gotoEditCarApplyAgain, gotoCardSignPay | |||
gotoEditCarApplyAgain, gotoCardSignPay, gotoAgainUseOrder | |||
} | |||
} |
@@ -118,7 +118,8 @@ | |||
<!-- 已结束 --> | |||
<view class="btns" v-else-if="item.orderStep == OrderStatus.已结束"> | |||
<view class="btn btn-primary" @click.stop="showActiveOrder = true">重新激活订单</view> | |||
<!-- <view class="btn btn-primary" @click.stop="showActiveOrder = true">重新激活订单</view> --> <!-- 以前的 --> | |||
<view class="btn btn-primary" @click.stop="gotoAgainUseOrder(item)">再次使用订单</view> | |||
</view> | |||
<!-- 换货中 --> | |||
@@ -185,7 +186,8 @@ | |||
gotoReturnOrder, | |||
gotoExchangeOrder, | |||
gotoPay, | |||
gotoOrderDetails | |||
gotoOrderDetails, | |||
gotoAgainUseOrder | |||
} = useOrderSkip(); | |||
//激活订单 |
@@ -9,7 +9,7 @@ | |||
<view class="head" :style="{ marinTop: margin + 'px' }"> | |||
<view class="avatar"> | |||
<image :src="`${$imgUrl}user/icon-avatar.png`" :class="!state.data.opId ? 'unlogin' : ''" | |||
@click="$util.navTo('/login/login')"> | |||
@click="goLogin"> | |||
</image> | |||
<view v-if="!state.data.opId" class="name" @click="$util.navTo('/login/login')"> | |||
@@ -383,6 +383,13 @@ | |||
url: `../order/order?index=${index}` | |||
}) | |||
} | |||
const goLogin = () => { | |||
if (!getItem('openId')) { | |||
uni.navigateTo({ | |||
url: "/login/login" | |||
}) | |||
} | |||
} | |||
</script> | |||
<style> | |||
page { |
@@ -98,8 +98,11 @@ | |||
<u-select v-model="showApplyRes" mode="single-column" :list="applyResList" @confirm="applyResConfirm"> | |||
</u-select> | |||
</view> | |||
<view class="buttonWrap"> | |||
<button class="default button" @click="changeCardQueryCancleAction()" type="default">撤回申请</button> | |||
<button class="submit" @click="submit">下一步</button> | |||
</view> | |||
<button class="submit" @click="submit">下一步</button> | |||
</view> | |||
<!-- 地址弹窗 --> | |||
<u-popup mode="bottom" v-model="address.show"> | |||
@@ -159,7 +162,8 @@ | |||
import { | |||
getLogistics, | |||
addressQuery, | |||
changeCardInfo | |||
changeCardInfo, | |||
changeCardQueryCancle | |||
} from "@/utils/network/api.js"; | |||
import { | |||
stringToJson | |||
@@ -176,7 +180,13 @@ | |||
msg | |||
} from "@/utils/utils"; | |||
const list = reactive([]); //物流数据 | |||
const apply = reactive({ | |||
data: { | |||
status: undefined, | |||
id: '' | |||
} | |||
}); | |||
const address = reactive({ | |||
@@ -218,7 +228,7 @@ | |||
value: "其它", | |||
label: "其它", | |||
}, | |||
]); | |||
// 单选数据列表 | |||
const radiolist1 = reactive([{ | |||
@@ -278,7 +288,32 @@ | |||
console.log(e); | |||
form.receiveMethod = e.detail.value | |||
}; | |||
//撤销订单 | |||
const changeCardQueryCancleAction = () => { | |||
var data = { | |||
id: params.id, | |||
cancelRes: '取消申请单' | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
return new Promise(async (resolve, reject) => { | |||
const res = await request(changeCardQueryCancle, options); | |||
// const data = stringToJson(res.bizContent); | |||
console.log("取消申请成功", data) | |||
msg('取消申请成功'); | |||
setTimeout(() => { | |||
uni.navigateBack({ | |||
delta: 2 | |||
}) | |||
}, 1000) | |||
}).catch((error) => { | |||
reject(error); | |||
}); | |||
} | |||
let showApplyRes = ref(false); | |||
// 打开物流先择器 | |||
@@ -330,6 +365,7 @@ | |||
request(getLogistics, options) | |||
.then((res) => { | |||
// stringToJson(res.bizContent) | |||
console.log("物流", res) | |||
stringToJson(res.bizContent).forEach((item) => { | |||
list.push({ | |||
value: item, | |||
@@ -681,7 +717,7 @@ | |||
} | |||
.submit { | |||
width: 670rpx; | |||
width: 45%; | |||
height: 80rpx; | |||
background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%); | |||
box-shadow: 0rpx 4rpx 11rpx 1rpx rgba(223, 223, 223, 0.5); | |||
@@ -691,6 +727,29 @@ | |||
font-weight: 400; | |||
color: #ffffff; | |||
line-height: 80rpx; | |||
// margin-top: 60rpx; | |||
} | |||
.default { | |||
height: 80rpx; | |||
background: rgba(0, 179, 139, .1); | |||
border-radius: 40rpx; | |||
font-size: 32rpx; | |||
font-weight: 400; | |||
color: #00B38B; | |||
line-height: 80rpx; | |||
width: 45%; | |||
border: 1px solid #00B38B; | |||
} | |||
.button::after { | |||
border: none; | |||
} | |||
.buttonWrap { | |||
display: flex; | |||
justify-content: space-evenly; | |||
align-items: center; | |||
margin-top: 60rpx; | |||
} | |||
</style> |
@@ -100,7 +100,8 @@ | |||
} from "@/utils/network/request.js"; | |||
import { | |||
orderDetail, | |||
CardlossStatus | |||
CardlossStatus, | |||
changeCardQuery | |||
} from "@/utils/network/api.js"; | |||
import { | |||
@@ -128,12 +129,18 @@ | |||
}, | |||
type: undefined | |||
}); | |||
const apply = reactive({ | |||
data: { | |||
status: undefined, | |||
id: '' | |||
} | |||
}); | |||
/*视图进入后操作*/ | |||
onLoad((option) => { | |||
console.log("id",option) | |||
queryOrderDetail(option.id).then((val: any) => { | |||
console.log("val",val) | |||
console.log("id", option) | |||
queryOrderDetail(option.id).then((val : any) => { | |||
console.log("val", val) | |||
state.data = val | |||
}) | |||
@@ -143,12 +150,50 @@ | |||
}); | |||
/*下一步*/ | |||
const nextACtion = () => { | |||
changeCardQueryAction().then(val => { | |||
console.log("val.status", val); | |||
if (!val) { | |||
navTo( | |||
`/subpackage/after-sale/replace-equipment/verification?orderId=${state.data.orderId}&&cardId=${state.data.cardId}&&mobile=${state.data.customerTel}` | |||
) | |||
} else { | |||
apply.data = val; | |||
apply.data.status = val.status; | |||
// 申请中APPLY 审核中AUDIT | |||
if (val.status == "APPLY" || val.status == "AUDIT") { | |||
navTo( | |||
`/subpackage/after-sale/replace-equipment/form?orderId=${state.data.orderId}&&id=${apply.data.id}` | |||
) | |||
} else { | |||
navTo( | |||
`/subpackage/after-sale/replace-equipment/verification?orderId=${state.data.orderId}&&cardId=${state.data.cardId}&&mobile=${state.data.customerTel}` | |||
) | |||
} | |||
} | |||
navTo( | |||
`/subpackage/after-sale/replace-equipment/verification?orderId=${state.data.orderId}&&cardId=${state.data.cardId}&&mobile=${state.data.customerTel}` | |||
) | |||
}) | |||
} | |||
//查询申请单 | |||
const changeCardQueryAction = () => { | |||
var data = { | |||
orderId: state.data.orderId | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
return new Promise(async (resolve, reject) => { | |||
const res = await request(changeCardQuery, options); | |||
const data = stringToJson(res.bizContent); | |||
resolve(data); | |||
}).catch((error) => { | |||
reject(error); | |||
}); | |||
} | |||
const queryOrderDetail = (id) => { | |||
return new Promise(async (resolve, reject) => { | |||
const res = await request(orderDetail, { | |||
@@ -308,4 +353,4 @@ | |||
line-height: 80rpx; | |||
} | |||
} | |||
</style> | |||
</style> |
@@ -58,8 +58,10 @@ | |||
</view> | |||
<view class="btn-wrapper"> | |||
<button class="default button" v-if="apply.data.status" @click="changeCardQueryCancleAction()" | |||
type="default">撤回申请</button> | |||
<!-- <button class="default button" v-if="apply.data.status" @click="changeCardQueryCancleAction()" | |||
type="default">撤回申请</button> --> | |||
<!-- <button class="submit button" v-if="apply.data.status === 'APPLY'||!apply.data.status" @click="toPage()" | |||
type="default">下一步填写资料</button> --> | |||
<button class="submit button" v-if="apply.data.status === 'APPLY'||!apply.data.status" @click="toPage()" | |||
type="default">下一步填写资料</button> | |||
</view> |
@@ -514,8 +514,7 @@ | |||
state.form.issueDate = data.issue; | |||
state.form.vehPosImgUrl = data.imageUrl; | |||
state.form.vehicleModel = data.model; | |||
state.form.permittedWeight = data.alc ? data.alc : 0; | |||
state.form.permittedTowWeight = data.towing ? data.towing : 0; | |||
} else { | |||
state.form.approvedCount = data.apc; | |||
state.form.approvedCountShow = data.apc; | |||
@@ -529,6 +528,8 @@ | |||
state.form.totalMass = data.gross; | |||
state.form.totalMassShow = data.gross; | |||
state.form.vehNegImgUrl = data.imageUrl; | |||
state.form.permittedWeight = data.alc ? data.alc : 0; | |||
state.form.permittedTowWeight = data.towing ? data.towing : 0; | |||
} | |||
}); | |||
}) |
@@ -87,6 +87,7 @@ | |||
//选择图片 | |||
const backImg = (e : any) => { | |||
console.log("e", e) | |||
state.product.imageList = e; | |||
} | |||
@@ -1,5 +1,5 @@ | |||
<template> | |||
<navBar title="订单支付" :scrollTop="scrollTop"></navBar> | |||
<navBar title="订单支付" :scrollTop="scrollTop" :orderId="state.orderId"></navBar> | |||
<navBgCar></navBgCar> | |||
<view class="content-value"> | |||
<view @click="savaHandle(item)" class="ul-item" v-for="(item, index) in state.dataArray" :key="index"> |
@@ -21,8 +21,8 @@ export const envs = { | |||
// baseUrl: "http://192.168.124.6:8087", | |||
// baseUrl: "http://222.85.144.89:19002", | |||
// baseUrl: "https://qtzl.etcjz.cn", | |||
// baseUrl: "https://qtzl.etcjz.cn/test", | |||
baseUrl: "https://trial.etcjz.cn", | |||
// baseUrl: "https://qtzl.etcjz.cn/test", | |||
// baseUrl: "http://192.168.100.158:8085", | |||
// baseUrl: "http://192.168.100.63:50001", | |||
}, | |||
@@ -258,4 +258,5 @@ export const getAgreementApi = "32a9d99a781a4bf2af29a46d903702bd" //根据订单 | |||
export const mobileIsRepeatApi = "19d58812148d41bbb7d435ab93928787" //个人账号重复注册校验 | |||
export const transferRecordApi = "323bc6e1f3304c83921155fc220e9e37" //过户记录查询 | |||
export const agreementConfirmApi = "96fa039a85f54655af06d980c8ddc057" //协议确认接口 | |||
export const equityProductsApi = "56db1aa8b9854f2f8c2428f3393e5045" //查询加购权益产品 | |||
export const equityProductsApi = "56db1aa8b9854f2f8c2428f3393e5045" //查询加购权益产品 | |||
export const gotoAgainUseOrderApi = "f92bfe60dbdf492eb37e2aad96ae1fd2" //再次使用订单接口 |
@@ -193,6 +193,35 @@ function textToBase64(text, key, iv) { | |||
// let endData = arrayToJson(requestData); | |||
// return endData; | |||
// } | |||
// 不加密 | |||
// export function encryption(ifCode, subdata, type) { | |||
// var requestData = new Array(); | |||
// const key = 'WVdSdGFXNHdNREZmTWpBeU16QTRNRE09' | |||
// // const key = 'TlRJd016QXhNekZmTWpBeU16QTRNekU9' | |||
// requestData["ifCode"] = ifCode; | |||
// // requestData["appId"] = "52030131"; // || "admin001" | |||
// requestData["appId"] = "admin001"; // || "admin001" | |||
// requestData["signType"] = "SM3"; // || "NONE" | |||
// // requestData["encryptType"] = "SM4"; | |||
// requestData["encryptType"] = "NONE"; | |||
// requestData["reqId"] = requestData["appId"] + "_" + getDate() + "_" + generateMixed(5); | |||
// requestData["timestamp"] = formatTime(new Date()); | |||
// requestData["bizContent"] = JSON.stringify(subdata) | |||
// // requestData["bizContent"] = s4.encryptData_CBC(subdata, sm4Key) | |||
// requestData["accessToken"] = getItem(StorageKeys.Token) | |||
// requestData["sign"] = sm3( | |||
// "appId=" + requestData["appId"] + | |||
// "&bizContent=" + requestData["bizContent"] + | |||
// "&signType=" + requestData["signType"] + | |||
// "&encryptType=" + requestData["encryptType"] + | |||
// "×tamp=" + requestData["timestamp"] + | |||
// "&ifCode=" + requestData["ifCode"] + | |||
// "&reqId=" + requestData["reqId"] + | |||
// "&accessToken=" + requestData["accessToken"], key | |||
// ); | |||
// let endData = arrayToJson(requestData); | |||
// return endData; | |||
// } | |||
//调用中台参数 | |||
export function encryption(ifCode, subdata, type) { | |||
var requestData = new Array(); | |||
@@ -206,9 +235,7 @@ export function encryption(ifCode, subdata, type) { | |||
// requestData["encryptType"] = "NONE"; | |||
requestData["reqId"] = requestData["appId"] + "_" + getDate() + "_" + generateMixed(5); | |||
requestData["timestamp"] = formatTime(new Date()); | |||
console.log("subdata加密之前", subdata) | |||
requestData["bizContent"] = s4.encryptData_CBC(subdata, sm4Key) | |||
// requestData["bizContent"] = JSON.stringify(subdata) | |||
requestData["accessToken"] = getItem(StorageKeys.Token) | |||
requestData["sign"] = sm3( | |||
"appId=" + requestData["appId"] + |
@@ -100,7 +100,7 @@ export function request(code, options = {}, start = false) { | |||
//参数返回 | |||
return new Promise((resolve, reject) => { | |||
options.success = (res) => { | |||
console.log('请求成功返回参数:', res) | |||
console.log('请求成功返回参数:', code, res) | |||
// 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading) | |||
uni.hideLoading() | |||
if (res.data.statusCode !== 0) { | |||
@@ -158,10 +158,12 @@ export function request(code, options = {}, start = false) { | |||
reject(res.data.errorMsg) | |||
return | |||
} else { | |||
let content = s4.decryptData_CBC(res, sm4Key) | |||
// let content = res | |||
// console.log(content); | |||
// content.data.bizContent = JSON.stringify(content.data.bizContent) | |||
console.log('请求成功返回参数:', content) | |||
resolve(content.data) | |||
} | |||
} |
@@ -393,11 +393,22 @@ function SM4Util() { | |||
let keyBytes = this.stringToByte(secretKey.substring(0, 16)) | |||
let ivBytes = this.stringToByte(this.iv) | |||
sm4.sm4_setkey_dec(ctx, keyBytes) | |||
let decrypted = sm4.sm4_crypt_cbc(ctx, ivBytes, base64js.toByteArray(cipherText.data.bizContent)) | |||
let bizContent = utf8ByteToUnicodeStr(decrypted) | |||
let begin = bizContent.indexOf('{'); | |||
let end = bizContent.lastIndexOf('}'); | |||
cipherText.data.bizContent = bizContent.substring(begin, end + 1) | |||
if (cipherText.data.errorMsg == "成功" && !cipherText.data.bizContent) { | |||
cipherText.data.bizContent = 1 //884换货/换卡签取消查询接口 | |||
} else { | |||
let decrypted = sm4.sm4_crypt_cbc(ctx, ivBytes, base64js.toByteArray(cipherText.data.bizContent)) | |||
let bizContent = utf8ByteToUnicodeStr(decrypted) | |||
if (bizContent.indexOf('{') == "-1" || bizContent.indexOf('{') == -1) { | |||
// 返回数据是数组情况 | |||
cipherText.data.bizContent = bizContent; | |||
} else { | |||
// 返回数据是对象情况 | |||
let begin = bizContent.indexOf('{'); | |||
let end = bizContent.lastIndexOf('}'); | |||
cipherText.data.bizContent = bizContent.substring(begin, end + 1) | |||
} | |||
} | |||
// console.log("没处理之前的数据", cipherText.data.bizContent, cipherText.data.errorMsg) | |||
// cipherText.data.bizContent = bizContent; | |||
return cipherText | |||
} catch (e) { |
@@ -138,7 +138,6 @@ export function isBlank(val) { | |||
//根据订单状态获取订单状态文字 | |||
export const getOrderStatusName = (status) => { | |||
console.log(Number(OrderStatus["完成车辆信息上传/待支付"]), status) | |||
switch (Number(status)) { | |||
case Number(OrderStatus.完成填写基本信息): | |||
return '申请中'; |