@@ -2,12 +2,12 @@ | |||
* 订单列表业务逻辑 | |||
*/ | |||
import { reactive, ref, watch, nextTick, onMounted } from "vue"; | |||
import { request } from "@/utils/network/request.js"; | |||
import { request, requestNew } from "@/utils/network/request.js"; | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
import { onLoad, onUnload, onReachBottom, onPullDownRefresh, onShow } from "@dcloudio/uni-app"; | |||
import {onReachBottom, onPullDownRefresh, onShow } from "@dcloudio/uni-app"; | |||
import { getItem, StorageKeys, setItem } from "@/utils/storage"; | |||
import { hasLogin, msg, timesDiff } from "@/utils/utils"; | |||
import { orderList} from "@/utils/network/api"; | |||
import { orderList,queryPage} from "@/utils/network/api"; | |||
import { PageData } from "@/datas/enum"; | |||
const tools = require("../../static/etcUtil/tools.js"); | |||
const searchKeyWords = ref(''); | |||
@@ -124,9 +124,10 @@ export default function useOrderListItem(props) { | |||
} | |||
try { | |||
request(orderList, options).then((res) => { | |||
requestNew(queryPage, options).then((res) => { | |||
uni.hideLoading() | |||
var data = stringToJson(res.bizContent); | |||
console.log("订单",res) | |||
var data = res; | |||
console.log("ordersList.value", data) | |||
params.total = data.totalCount; |
@@ -350,7 +350,7 @@ | |||
// #endif | |||
} | |||
const state = reactive({ | |||
type: 0, //1客车 2货车 | |||
vanType: 0, //1客车 2货车 | |||
userType: 1, //1个人 2单位 | |||
notice: "", | |||
swiperList: [], | |||
@@ -434,7 +434,7 @@ | |||
}; | |||
const showMask = (val : any) => { | |||
state.type = val; //1 客车 2货车 | |||
state.vanType = val; //1 客车 2货车 | |||
isShowMask.value = true; | |||
}; | |||
@@ -550,7 +550,7 @@ | |||
const toCreatOrder = (val : number) => { | |||
console.log(typeof (val)); | |||
state.userType = val; | |||
navTo(`/subpackage/orders/choice-product?type=${state.type}&&userType=${state.userType}`) | |||
navTo(`/subpackage/orders/choice-product?vanType=${state.vanType}&&userType=${state.userType}`) | |||
closeMask(); | |||
}; | |||
@@ -219,7 +219,7 @@ | |||
} | |||
//获取车牌颜色文字 | |||
const getVehiclePlateColor = (id : number) => { | |||
console.log("id",id) | |||
const colors = vehiclePlateColor.filter(item => item.id == id); | |||
return colors[0].color | |||
} |
@@ -26,16 +26,10 @@ | |||
import empty from "@/components/empty/empty.vue"; | |||
import { onLoad, onReachBottom } from "@dcloudio/uni-app"; | |||
import { reactive } from "vue"; | |||
import { equityProductsApi, addEquityListApi } from "@/utils/network/api.js"; | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
import { request } from "@/utils/network/request"; | |||
import { msg, navTo } from "@/utils/utils"; | |||
import { getEquityListApi } from "@/utils/network/api"; | |||
import { | |||
getItem, | |||
StorageKeys, | |||
setItem | |||
} from "@/utils/storage"; | |||
const state = reactive({ | |||
list: [], //权益数据 |
@@ -8,9 +8,9 @@ | |||
<script setup lang="ts"> | |||
import { reactive } from "vue"; | |||
import { onLoad } from "@dcloudio/uni-app"; | |||
import { request } from "@/utils/network/request.js"; | |||
import { request,requestNew } from "@/utils/network/request.js"; | |||
import { msg, confirm, getOrderStatusName } from "@/utils/utils"; | |||
import { cancelOrder, cancelOrderNew } from "@/utils/network/api"; | |||
import { cancelOrder, cancelOrderNew,orderCancel } from "@/utils/network/api"; | |||
import { getItem, StorageKeys } from "@/utils/storage"; | |||
import { deviceType } from "@/utils/network/difference"; | |||
const config = { | |||
@@ -71,7 +71,8 @@ import { deviceType } from "@/utils/network/difference"; | |||
data: { | |||
id: state.orderInfo.id, | |||
reason: e.orderReason, | |||
openId: getItem(StorageKeys.OpenId) | |||
orderId:state.orderInfo.orderId | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
@@ -86,7 +87,7 @@ import { deviceType } from "@/utils/network/difference"; | |||
options.data['source'] = 'ALI' | |||
// #endif | |||
console.log("options", options) | |||
request(cancelOrder, options).then((res) => { | |||
requestNew(orderCancel, options).then((res) => { | |||
cancelOrderSuccess(); | |||
}); | |||
}, |
@@ -50,7 +50,7 @@ | |||
</view> | |||
</view> | |||
<view class="uni-list tractor"> | |||
<radio-group @change="radioChange" v-if="state.form.type=='2'"> | |||
<radio-group @change="radioChange" v-if="state.form.vanType=='2'"> | |||
<text class="title">是否是牵引车</text> | |||
<label style="margin-right: 60rpx;" class="uni-list-cell uni-list-cell-pd " | |||
v-for="(item, index) in state.items" :key="item.value"> | |||
@@ -59,7 +59,7 @@ | |||
</radio-group> | |||
</view> | |||
<!-- 货车 牵引车 需要传道路运输许可证--> | |||
<view class="picture-wrapper" v-if="state.form.type=='2' && state.form.tractorSign==1" | |||
<view class="picture-wrapper" v-if="state.form.vanType=='2' && state.form.tractorSign==1" | |||
@click="cardFileImageUpdate(2)"> | |||
<view class="bg"> | |||
<view class=""> | |||
@@ -81,7 +81,7 @@ | |||
<u-form label-width="200" :model="state.form" ref="uForm"> | |||
<u-form-item label="车牌号"> | |||
<car-number-input @numberInputResult="carNumber" | |||
:defaultStr="state.form.vehicleIdNum"></car-number-input> | |||
:defaultStr="state.form.vehiclePlate"></car-number-input> | |||
</u-form-item> | |||
<u-form-item label="所有人"> | |||
@@ -110,10 +110,10 @@ | |||
</u-form-item> | |||
<u-form-item label="注册日期"> | |||
<picker mode="date" :value="state.form.register" @change="bindDateChange1" | |||
<picker mode="date" :value="state.form.registerDate" @change="bindDateChange1" | |||
:disabled="state.isEnableChangeOCRCarInfo"> | |||
<view class="uni-input" style="text-align: right;" :class="state.changeColor?'hei':'hui'"> | |||
{{state.form.register}} | |||
{{state.form.registerDate}} | |||
</view> | |||
</picker> | |||
</u-form-item> | |||
@@ -241,9 +241,10 @@ | |||
queryGuoHuJianCe, | |||
queryGuoHuCaoZuo, | |||
ocrAllQuery, | |||
carMessageApi | |||
carMessageApi, | |||
vehicleUpload | |||
} from "@/utils/network/api.js"; | |||
import { request } from "@/utils/network/request.js"; | |||
import { request, requestNew } from "@/utils/network/request.js"; | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
import { onLoad, onPageScroll } from "@dcloudio/uni-app"; | |||
@@ -261,7 +262,7 @@ | |||
//车牌号输入 | |||
const carNumber = (val : any) => { | |||
state.form.vehicleIdNum = val.trim(); | |||
state.form.vehiclePlate = val.trim(); | |||
}; | |||
const camera = () => { | |||
@@ -322,7 +323,7 @@ | |||
msg("请上传道路运输许可证"); | |||
return; | |||
} | |||
if (state.form.type == 1) { | |||
if (state.form.vanType == 1) { | |||
state.form.axleCount = 2; | |||
} else { | |||
if (!state.form.axleCount) { | |||
@@ -331,7 +332,7 @@ | |||
} | |||
} | |||
state.form.vehicleId = | |||
state.form.vehicleIdNum + "_" + state.vehiclePlateColor; | |||
state.form.vehiclePlate + "_" + state.vehiclePlateColor; | |||
state.form.opId = getItem(StorageKeys.OpenId); | |||
state.form.approvedCount = parseFloat(state.form.approvedCount); | |||
state.form.maintenaceMass = parseFloat(state.form.maintenaceMass); | |||
@@ -362,7 +363,7 @@ | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(etcCarCardInfoSubmit, options) | |||
requestNew(vehicleUpload, options) | |||
.then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
queryGuoHuJianCeAction().then((value) => { | |||
@@ -408,7 +409,7 @@ | |||
const pass = () => { | |||
state.show = false | |||
state.form.vehicleId = | |||
state.form.vehicleIdNum + "_" + state.vehiclePlateColor; | |||
state.form.vehiclePlate + "_" + state.vehiclePlateColor; | |||
state.form.opId = getItem(StorageKeys.OpenId); | |||
state.form.approvedCount = parseFloat(state.form.approvedCount); | |||
state.form.maintenaceMass = parseFloat(state.form.maintenaceMass); | |||
@@ -474,15 +475,15 @@ | |||
form: { | |||
orderId: "", //订单ID | |||
character: "", //使用性质 | |||
register: "请输入注册日期", //注册日期 | |||
registerDate: "请输入注册日期", //注册日期 | |||
customerId: "", //用户编号 | |||
vehicleId: "", | |||
vehicleIdNum: "", //车牌编号 | |||
vehiclePlate: "", //车牌编号 | |||
issueDate: "请输入发证日期", //发证日期 | |||
vehPosImgUrl: "", //行驶证正面 | |||
vehNegImgUrl: "", //行驶证证反面 | |||
type: "0", //1,客车 2.货车 | |||
vanType: "0", //1,客车 2.货车 | |||
useUserType: 0, //车辆用户类型 | |||
useUserTypeName: "普通车", | |||
vehicleSign: 2, //前/后装标识 | |||
@@ -538,7 +539,7 @@ | |||
}); | |||
onLoad((option : any) => { | |||
state.form.orderId = option.orderId; | |||
state.form.type = option.type; | |||
state.form.vanType = option.vanType; | |||
state.vehiclePlateColor = option.vehiclePlateColor; | |||
if (option.vehicleId) { | |||
state.form.vehicleId = option.vehicleId; | |||
@@ -673,7 +674,7 @@ | |||
state.form.vehPosImgUrl = allData['vehPosImgUrl'] | |||
state.form.vehNegImgUrl = allData['vehNegImgUrl'] | |||
state.form.vehBodyUrl = allData['vehBodyUrl'] | |||
state.form.vehicleIdNum = allData['vehiclePlate'] | |||
state.form.vehiclePlate = allData['vehiclePlate'] | |||
state.form.ownerName = allData['ownerName'] | |||
state.form.vehicleType = allData['vehicleType'] | |||
if (allData['useCharacter'] == 1) { | |||
@@ -685,7 +686,7 @@ | |||
} | |||
state.form.vin = allData['vin'] | |||
state.form.engineNum = allData['engineNum'] | |||
state.form.register = allData['registerDate'] | |||
state.form.registerDate = allData['registerDate'] | |||
state.form.issueDate = allData['issueDate'] | |||
state.form.approvedCountShow = allData['approvedCount'] | |||
state.form.maintenaceMassShow = allData['maintenaceMass'] | |||
@@ -725,7 +726,7 @@ | |||
} | |||
const bindDateChange1 = (e) => { | |||
state.form.register = e.detail.value | |||
state.form.registerDate = e.detail.value | |||
state.changeColor = true; | |||
} | |||
const bindDateChange2 = (e) => { | |||
@@ -766,16 +767,17 @@ | |||
console.log('输出内容=====================', state.choiceIndex) | |||
if (state.choiceIndex === "3") { | |||
if (data.plate_a.length > 8) { | |||
state.form.vehicleIdNum = data.plate_a.substring(0, 8); | |||
state.form.vehiclePlate = data.plate_a.substring(0, 8); | |||
} else { | |||
state.form.vehicleIdNum = data.plate_a; | |||
state.form.vehiclePlate = data.plate_a; | |||
} | |||
state.form.ownerName = data.man; | |||
state.form.vehicleType = data.vehicle; | |||
state.form.character = data.character; | |||
// state.form.character = data.character; | |||
state.form.character = 2; | |||
state.form.vin = data.vin; | |||
state.form.engineNum = data.engine; | |||
state.form.register = data.register; | |||
state.form.registerDate = data.register; | |||
state.form.issueDate = data.issue; | |||
state.form.vehPosImgUrl = data.imageUrl; | |||
state.form.vehicleModel = data.model; |
@@ -6,13 +6,13 @@ | |||
<view :style="`background-color:${bgc}`" style="border-radius: 16rpx;padding: 20rpx;margin-top: 20rpx;"> | |||
<view class="title" style="display: flex;flex-direction: row;justify-content: flex-start;"> | |||
<view style="font-weight: bold;margin-right: 10rpx;font-size: 18px;"> | |||
{{ item.promoteName }} | |||
{{ item.productName }} | |||
</view> | |||
<view> | |||
{{ item['releaseProductStandards']['productStandards']['cardTypeArr'] }} | |||
{{ item['cardTypeArr'] }} | |||
</view> | |||
</view> | |||
<view v-for="(str, index) in item.releaseProductStandards.equityList" :key="index" class="ul-item" | |||
<view v-for="(str, index) in item.equityList" :key="index" class="ul-item" | |||
style="padding: 0rpx;margin-top: 20rpx;" @click="savaHandle(item,index)"> | |||
<image style="width: 100%; height: 170rpx; border-radius: 20rpx" | |||
:src="`${$imgUrl}applyCard/product-bg.png`"></image> | |||
@@ -22,14 +22,14 @@ | |||
</image> | |||
<view class="content"> | |||
<view class="title"> | |||
{{ str.equityName }} | |||
{{ str.productName }} | |||
</view> | |||
<view style="margin-top: 15rpx" class="tip"> | |||
<!-- <view style="margin-top: 15rpx" class="tip"> | |||
{{ str.sellingPoint.substring(0,15) }} | |||
</view> | |||
</view> --> | |||
</view> | |||
<view class="money"> | |||
¥:{{ str.discountPrice * 0.01 }} | |||
¥:{{ item.fee * 0.01 }} | |||
</view> | |||
</view> | |||
</view> | |||
@@ -66,14 +66,12 @@ | |||
<script setup lang="ts"> | |||
import { onLoad, onPageScroll, onShow } from "@dcloudio/uni-app"; | |||
import { reactive, ref } from "vue"; | |||
import { etcQueryProduct } from "@/utils/network/api.js"; | |||
import { request } from "@/utils/network/request.js"; | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
import { pageQuery } from "@/utils/network/api.js"; | |||
import { requestNew } from "@/utils/network/request.js"; | |||
import { fileURL } from "@/datas/fileURL.js"; | |||
import navBgCar from "./components/nav-bg-car1"; | |||
import navBar from "@/components/nav-bar/nav-bar2.vue"; | |||
import { getItem, StorageKeys, setItem } from "@/utils/storage.ts"; | |||
import { msg } from "@/utils/utils"; | |||
import { getItem, setItem } from "@/utils/storage.ts"; | |||
import { agentId } from "@/utils/network/difference"; | |||
const imgURL = `${fileURL}image/`; | |||
@@ -99,26 +97,25 @@ | |||
} | |||
setItem("isValueCard", state.isValueCard); | |||
uni.navigateTo({ | |||
url: `/subpackage/orders/interestsList?promoteId=${getItem("promoteId")}&userType=${state.userType}&type=${state.type}&isValueCard=${state.isValueCard}&fee=${Number(state.fee)}&equityId=${state.equityId}&fee=${state.fee}&signAgencyId=${state.signAgencyId}`, | |||
url: `/subpackage/orders/interestsList?userType=${state.userType}&type=${state.type}&isValueCard=${state.isValueCard}&fee=${Number(state.fee)}&equityId=${state.equityId}&fee=${state.fee}&signAgencyId=${state.signAgencyId}`, | |||
}); | |||
} | |||
const savaHandle = (val, idx) => { | |||
console.log("vAL", val) | |||
setItem("clientFee", val.clientFee); | |||
setItem("promoteId", val.promoteId); | |||
// setItem("promoteId", val.promoteId); | |||
state.isSign = val.isSign; | |||
state.signAgencyId = val['releaseProductStandards']['deviceType']; | |||
state.equityId = val.releaseProductStandards.equityList[idx].equityId; | |||
state.signAgencyId = val['deviceType']; | |||
state.equityId = val.equityList[idx].equityId; | |||
// 产品金额+权益金额 | |||
state.fee = Number(val.fee) + Number(val.releaseProductStandards.equityList[idx].discountPrice); | |||
state.fee = Number(val.fee) + Number(val.equityList[idx].discountPrice); | |||
// 判断是几张卡 | |||
console.log("state.dataArray[i]['releaseProductStandards']['productStandards']", val['releaseProductStandards']['productStandards']) | |||
if (val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",").length == 1) { | |||
if (val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",")[0] == "记账卡") { | |||
if (val['cardTypeArr'].split(",").length == 1) { | |||
if (val['cardTypeArr'].split(",")[0] == "记账卡") { | |||
state.isValueCard = 2 | |||
} else if (val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",")[0] == '储值卡') { | |||
} else if (val['cardTypeArr'].split(",")[0] == '储值卡') { | |||
state.isValueCard = 1 | |||
} else { | |||
state.isValueCard = 2 | |||
@@ -126,14 +123,14 @@ | |||
console.log("state.isValueCard", state.isValueCard) | |||
setItem("isValueCard", state.isValueCard); | |||
uni.navigateTo({ | |||
url: `/subpackage/orders/interestsList?equityId=${val.releaseProductStandards.equityList[idx].equityId}&promoteId=${val['promoteId']}&userType=${state.userType}&type=${state.type}&isValueCard=${state.isValueCard}&fee=${state.fee}&signAgencyId=${val['releaseProductStandards']['deviceType']}`, | |||
url: `/subpackage/orders/interestsList?equityId=${val.equityList[idx].equityId}&userType=${state.userType}&vanType=${state.vanType}&isValueCard=${state.isValueCard}&fee=${state.fee}&signAgencyId=${val['deviceType']}&productId=${val['productId']}`, | |||
}); | |||
} else { | |||
state.radiolist1 = []; | |||
// 处理卡的数据 | |||
for (var i = 0; i < val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",").length; i++) { | |||
for (var i = 0; i < val['cardTypeArr'].split(",").length; i++) { | |||
const obj = {}; | |||
obj["name"] = val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",")[i]; | |||
obj["name"] = val['cardTypeArr'].split(",")[i]; | |||
obj["disabled"] = false; | |||
state.radiolist1.push(obj) | |||
} | |||
@@ -149,8 +146,8 @@ | |||
// #ifdef MP-WEIXIN | |||
state.sysType = 'WECHAT'; | |||
// #endif | |||
state.userType = option.userType; | |||
state.type = option.type; | |||
state.userType = Number(option.userType); | |||
state.vanType = Number(option.vanType); | |||
productList(); | |||
console.log("option选择产品列表", option) | |||
}); | |||
@@ -161,35 +158,33 @@ | |||
var data = { | |||
userType: state.userType, | |||
agencyId: agentId, | |||
vanType: state.type, | |||
promotionMode: 1 | |||
vanType: state.vanType, | |||
}; | |||
console.log("data",data) | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
console.log("输出内容", options); | |||
request(etcQueryProduct, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
console.log("产品列表", data.list); | |||
requestNew(pageQuery, options).then((res) => { | |||
console.log("产品列表", res); | |||
const data = res; | |||
if (data.list && data.list.length > 0) { | |||
state.dataArray = data.list ? data.list : []; | |||
console.log("state.dataArray", state.dataArray); | |||
for (var i = 0; i < state.dataArray.length; i++) { | |||
const cardTypeArr = [] | |||
for (var j = 0; j < state.dataArray[i]['releaseProductStandards']['productStandards'].cardType.length; j++) { | |||
if (state.dataArray[i]['releaseProductStandards']['productStandards'].cardType[j] == '2') { | |||
for (var j = 0; j < state.dataArray[i].cardType.length; j++) { | |||
if (state.dataArray[i].cardType[j] == '2') { | |||
cardTypeArr.push('储值卡') | |||
} else if (state.dataArray[i]['releaseProductStandards']['productStandards'].cardType[j] == '1') { | |||
} else if (state.dataArray[i].cardType[j] == '1') { | |||
cardTypeArr.push('记账卡') | |||
} else if (state.dataArray[i]['releaseProductStandards']['productStandards'].cardType[j] == '3') { | |||
} else if (state.dataArray[i].cardType[j] == '3') { | |||
cardTypeArr.push('预存卡') | |||
} | |||
} | |||
state.dataArray[i]['releaseProductStandards']['productStandards']['cardTypeArr'] = cardTypeArr.toString() | |||
state.dataArray[i]['cardTypeArr'] = cardTypeArr.toString() | |||
} | |||
} else { | |||
uni.showModal({ | |||
@@ -198,10 +193,10 @@ | |||
showCancel: false, | |||
success: function (res) { | |||
if (res.confirm) { | |||
console.log('用户点击确定'); | |||
uni.switchTab({ | |||
url: '/pages/index/index' | |||
}) | |||
console.log('用户点击确定'); | |||
} else if (res.cancel) { | |||
console.log('用户点击取消'); | |||
} | |||
@@ -225,7 +220,7 @@ | |||
sysType: "", | |||
orderId: "", | |||
userType: 1, //1 个人 2单位 | |||
type: 0, //0 客车 1货车 | |||
vanType: 0, //0 客车 1货车 | |||
vehiclePlateColor: "", | |||
data: { | |||
show: false, |
@@ -1,5 +1,5 @@ | |||
<template> | |||
<navBar title="九州ETC" :scrollTop="scrollTop" :type="state.data.type" :userType="state.data.userType"></navBar> | |||
<navBar title="九州ETC" :scrollTop="scrollTop" :type="state.data.vanType" :userType="state.data.userType"></navBar> | |||
<navBgCar></navBgCar> | |||
<view class="content-wrap"> | |||
<view> | |||
@@ -95,15 +95,12 @@ | |||
import { onLoad, onShow, onPageScroll, onUnload } from "@dcloudio/uni-app"; | |||
import { | |||
addressQuery, | |||
etcCreatOrder, | |||
searchOrder, | |||
productReCode, | |||
infoQuery, | |||
envs, | |||
addProduct, | |||
isSubmitOrderApi | |||
orderAdd | |||
} from "@/utils/network/api.js"; | |||
import { request } from "@/utils/network/request.js"; | |||
import { request,requestNew } from "@/utils/network/request.js"; | |||
import { reactive, ref } from "vue"; | |||
import { msg, noticeUser } from "@/utils/utils"; | |||
const scrollTop = ref(0); | |||
@@ -112,9 +109,9 @@ | |||
vehiclePlate: undefined, //车牌号 | |||
vehiclePlateNumber: "", //车牌号 | |||
vehiclePlateColor: 0, //车牌颜色 | |||
type: "1", //车牌类型 | |||
vanType: 1, //客货类型 | |||
userType: 1, | |||
whetherToMail: getItem(StorageKeys.OpenId) ? 0 : "", //是否需要邮寄 小程序默认邮寄 0邮寄||1不邮寄 不登录为1 | |||
whetherToMail: getItem(StorageKeys.OpenId) ? true : "", //是否需要邮寄 小程序默认邮寄 true邮寄||1不邮寄 不登录为1 | |||
orderSource: "WECHAT", | |||
opId: "", | |||
consignee: "", //收货人 | |||
@@ -122,11 +119,11 @@ | |||
region: "", | |||
address: "", | |||
postalCode: "", | |||
promoteId: "", | |||
longitude: "", | |||
latitude: "", | |||
detailedAddress: '', //通过经纬度转的地址 | |||
cardType: '' //卡类型 | |||
cardType: '', //卡类型 | |||
productId:"",//产品编号 | |||
}, | |||
show: false, | |||
addressArray: [], | |||
@@ -173,32 +170,31 @@ | |||
showLoading: true, | |||
}; | |||
request(etcCreatOrder, options).then((res) => { | |||
console.log(res); | |||
requestNew(orderAdd, options).then((res) => { | |||
console.log("res===",res); | |||
if (res.statusCode === 600) { | |||
orderGoAction(); | |||
} else { | |||
const data = stringToJson(res.bizContent); | |||
const data = res; | |||
state.orderId = data.orderId | |||
console.log(data); | |||
//提交产品信息 | |||
productReCodeAction(data.orderId).then((result) => { | |||
console.log("产品信息", result); | |||
//提交产品信息 接口直接不要了 | |||
// productReCodeAction(data.orderId).then((result) => { | |||
// 加购权益产品 | |||
addProductRequest().then((res) => { | |||
// addProductRequest().then((res) => { //接口直接不要了 | |||
var vehicleId = state.data.vehiclePlate + "_" + state.data.vehiclePlateColor | |||
console.log("state.data.vehiclePlate", state.data.vehiclePlate, state.data.vehiclePlateColor, vehicleId) | |||
if (state.data.userType == 1) { | |||
uni.navigateTo({ | |||
url: `/subpackage/orders/opening-account-people?orderId=${data.orderId}&&vehiclePlateColor=${state.data.vehiclePlateColor}&isSign=${state.isValueCard}&type=${state.data.type}&vehicleId=${vehicleId}`, | |||
url: `/subpackage/orders/opening-account-people?orderId=${data.orderId}&&vehiclePlateColor=${state.data.vehiclePlateColor}&isSign=${state.isValueCard}&vanType=${state.data.vanType}&vehicleId=${vehicleId}`, | |||
}); | |||
} else { | |||
uni.navigateTo({ | |||
url: `/subpackage/orders/opening-account-unit?orderId=${data.orderId}&&vehiclePlateColor=${state.data.vehiclePlateColor}&isSign=${state.isValueCard}&type=${state.data.type}&vehicleId=${vehicleId}`, | |||
url: `/subpackage/orders/opening-account-unit?orderId=${data.orderId}&&vehiclePlateColor=${state.data.vehiclePlateColor}&isSign=${state.isValueCard}&vanType=${state.data.vanType}&vehicleId=${vehicleId}`, | |||
}); | |||
} | |||
}) | |||
}) | |||
// }) | |||
// }) | |||
} | |||
}); | |||
} | |||
@@ -255,10 +251,10 @@ | |||
}; | |||
onLoad((option : any) => { | |||
state.data.type = option.type; //1客车 2货车 | |||
state.data.vanType = Number(option.vanType); //1客车 2货车 | |||
state.data.opId = getItem(StorageKeys.OpenId); | |||
state.data.userType = option.userType; | |||
state.data.promoteId = option.promoteId; | |||
state.data.userType =Number(option.userType); | |||
state.data.productId = option.productId; | |||
state.data.vehiclePlate = option.vehiclePlate; | |||
state.data.vehiclePlateColor = option.vehiclePlateColor; | |||
state.isValueCard = option.isValueCard | |||
@@ -341,7 +337,7 @@ | |||
const productReCodeAction = (orderId) => { | |||
var data = { | |||
promoteId: state.data.promoteId, | |||
promoteId: state.data.productId, | |||
orderId: orderId, | |||
isValueCard: state.isValueCard, | |||
loginSource: getItem("loginSource") | |||
@@ -363,50 +359,30 @@ | |||
reject(error); | |||
}); | |||
}; | |||
const addProductRequest = () => { | |||
const options = { | |||
type: 2, | |||
data: { | |||
orderId: state.orderId, //订单编号 | |||
openId: getItem(StorageKeys.OpenId), //操作人 id | |||
equityId: state.equityId, //权益Id | |||
totalAmount: state.totalAmount, //总金额 | |||
isRepeatPurchase: 0 | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
console.log("optionss", options); | |||
return new Promise(async (resolve, reject) => { | |||
const res = await request(addProduct, options); | |||
const data = stringToJson(res.bizContent); | |||
console.log("111") | |||
resolve(data); | |||
}).catch((error) => { | |||
console.log("222") | |||
reject(error); | |||
}); | |||
} | |||
// 老中台-检测能否提交订单 | |||
const isSubmitOrderRequest = (vehiclePlate, vehiclePlateColor) => { | |||
const options = { | |||
type: 2, | |||
data: { | |||
vehicleId: vehiclePlate + "_" + vehiclePlateColor | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
return new Promise(async (resolve, reject) => { | |||
const res = await request(isSubmitOrderApi, options); | |||
const data = stringToJson(res.bizContent); | |||
console.log("111") | |||
resolve(data); | |||
}).catch((error) => { | |||
console.log("222") | |||
reject(error); | |||
}); | |||
} | |||
// const addProductRequest = () => { | |||
// const options = { | |||
// type: 2, | |||
// data: { | |||
// orderId: state.orderId, //订单编号 | |||
// openId: getItem(StorageKeys.OpenId), //操作人 id | |||
// equityId: state.equityId, //权益Id | |||
// totalAmount: state.totalAmount, //总金额 | |||
// isRepeatPurchase: 0 | |||
// }, | |||
// method: "POST", | |||
// showLoading: true, | |||
// }; | |||
// console.log("optionss", options); | |||
// return new Promise(async (resolve, reject) => { | |||
// const res = await request(addProduct, options); | |||
// const data = stringToJson(res.bizContent); | |||
// console.log("111") | |||
// resolve(data); | |||
// }).catch((error) => { | |||
// console.log("222") | |||
// reject(error); | |||
// }); | |||
// } | |||
</script> | |||
<style lang="scss" scoped> |
@@ -1,5 +1,5 @@ | |||
<template> | |||
<navBar title="九州ETC" :scrollTop="scrollTop" :type="state.data.type" :userType="state.data.userType"></navBar> | |||
<navBar title="九州ETC" :scrollTop="scrollTop" :type="state.data.vanType" :userType="state.data.userType"></navBar> | |||
<navBgCar></navBgCar> | |||
<view class="content-wrap"> | |||
<!-- 车牌输入 --> | |||
@@ -10,7 +10,7 @@ | |||
<!-- 车牌颜色 --> | |||
<view class="chepai-lane"> | |||
<view class="title">选择车牌颜色</view> | |||
<numberplate-color :numberplate="state.data.vehiclePlateNumber" :type="state.data.type" | |||
<numberplate-color :numberplate="state.data.vehiclePlateNumber" :type="state.data.vanType" | |||
@numberplateResult="checkNumberplateColor"> | |||
</numberplate-color> | |||
</view> | |||
@@ -74,25 +74,21 @@ | |||
import { onLoad, onShow, onPageScroll, onUnload } from "@dcloudio/uni-app"; | |||
import { | |||
addressQuery, | |||
etcCreatOrder, | |||
etcVehiclePlateVer, | |||
searchOrder, | |||
productReCode, | |||
envs, | |||
addProduct, | |||
isSubmitOrderApi | |||
isSubmitOrderApi, | |||
plateCheck, | |||
etcVehiclePlateVer | |||
} from "@/utils/network/api.js"; | |||
import { request } from "@/utils/network/request.js"; | |||
import { request, requestNew } from "@/utils/network/request.js"; | |||
import { reactive, ref } from "vue"; | |||
import { msg, noticeUser } from "@/utils/utils"; | |||
// import amap from "../../lib/amap-uni.130.js";//引入高德地图小程序插件 | |||
const scrollTop = ref(0); | |||
const state = reactive({ | |||
data: { | |||
vehiclePlate: undefined, //车牌号 | |||
vehiclePlateNumber: "", //车牌号 | |||
vehiclePlateColor: 0, //车牌颜色 | |||
type: "1", //车牌类型 | |||
vanType: 1, //车牌类型 | |||
userType: 1, | |||
whetherToMail: getItem(StorageKeys.OpenId) ? 0 : "", //是否需要邮寄 小程序默认邮寄 0邮寄||1不邮寄 不登录为1 | |||
orderSource: "WECHAT", | |||
@@ -102,11 +98,11 @@ | |||
region: "", | |||
address: "", | |||
postalCode: "", | |||
promoteId: "", | |||
longitude: "", | |||
latitude: "", | |||
detailedAddress: '', //通过经纬度转的地址 | |||
cardType: '' //卡类型 | |||
cardType: '' ,//卡类型 | |||
productId:"" | |||
}, | |||
show: false, | |||
addressArray: [], | |||
@@ -186,11 +182,18 @@ | |||
showLoading: true, | |||
}; | |||
console.log("车牌信息", options) | |||
// 车牌校验有问题 还没改好 | |||
// requestNew(plateCheck, options).then((res) => { | |||
// uni.redirectTo({ | |||
// url: `/subpackage/orders/essential-information-two?userType=${state.data.userType}&vanType=${state.data.vanType}&isValueCard=${state.isValueCard}&totalAmount=${state.totalAmount}&equityId=${state.equityId}&vehiclePlate=${state.data.vehiclePlate}&vehiclePlateColor=${state.data.vehiclePlateColor}&productId=${state.data.productId}`, | |||
// }); | |||
// }); | |||
request(etcVehiclePlateVer, options).then((res) => { | |||
uni.redirectTo({ | |||
url: `/subpackage/orders/essential-information-two?promoteId=${getItem("promoteId")}&userType=${state.data.userType}&type=${state.data.type}&isValueCard=${state.isValueCard}&totalAmount=${state.totalAmount}&equityId=${state.equityId}&vehiclePlate=${state.data.vehiclePlate}&vehiclePlateColor=${state.data.vehiclePlateColor}`, | |||
url: `/subpackage/orders/essential-information-two?userType=${state.data.userType}&vanType=${state.data.vanType}&isValueCard=${state.isValueCard}&totalAmount=${state.totalAmount}&equityId=${state.equityId}&vehiclePlate=${state.data.vehiclePlate}&vehiclePlateColor=${state.data.vehiclePlateColor}&productId=${state.data.productId}`, | |||
}); | |||
}); | |||
} else { | |||
msg(item.data.data.canSubmitMsg); | |||
} | |||
@@ -249,10 +252,10 @@ | |||
}; | |||
onLoad((option : any) => { | |||
state.data.type = option.type; //1客车 2货车 | |||
state.data.vanType = option.vanType; //1客车 2货车 | |||
state.data.opId = getItem(StorageKeys.OpenId); | |||
state.data.userType = option.userType; | |||
state.data.promoteId = option.promoteId; | |||
state.data.productId = option.productId; | |||
state.isValueCard = option.isValueCard | |||
state.data.cardType = option.isValueCard | |||
state.totalAmount = option.totalAmount; | |||
@@ -307,55 +310,7 @@ | |||
onUnload(() => { | |||
uni.$off('updateData'); | |||
}) | |||
const productReCodeAction = (orderId) => { | |||
var data = { | |||
promoteId: state.data.promoteId, | |||
orderId: orderId, | |||
isValueCard: state.isValueCard, | |||
loginSource: getItem("loginSource") | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
return new Promise(async (resolve, reject) => { | |||
const res = await request(productReCode, options); | |||
const data = stringToJson(res.bizContent); | |||
console.log("111") | |||
resolve(data); | |||
}).catch((error) => { | |||
console.log("222") | |||
reject(error); | |||
}); | |||
}; | |||
const addProductRequest = () => { | |||
const options = { | |||
type: 2, | |||
data: { | |||
orderId: state.orderId, //订单编号 | |||
openId: getItem(StorageKeys.OpenId), //操作人 id | |||
equityId: state.equityId, //权益Id | |||
totalAmount: state.totalAmount, //总金额 | |||
isRepeatPurchase: 0 | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
console.log("optionss", options); | |||
return new Promise(async (resolve, reject) => { | |||
const res = await request(addProduct, options); | |||
const data = stringToJson(res.bizContent); | |||
console.log("111") | |||
resolve(data); | |||
}).catch((error) => { | |||
console.log("222") | |||
reject(error); | |||
}); | |||
} | |||
// 老中台-检测能否提交订单 | |||
const isSubmitOrderRequest = (vehiclePlate, vehiclePlateColor) => { | |||
const options = { |
@@ -15,7 +15,7 @@ | |||
import { equityProductsInfo } from "@/utils/network/api.js"; | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
import { request } from "@/utils/network/request"; | |||
import { msg, navTo } from "@/utils/utils"; | |||
import { navTo } from "@/utils/utils"; | |||
import { jump } from "@/datas/9901Jump.js"; | |||
import { | |||
getOpenidApi | |||
@@ -34,15 +34,15 @@ import { deviceType } from "@/utils/network/difference"; | |||
choiceValue: [], //选择的权益数据的下标 | |||
choiceValueComplete: [], //选择的权益数据的具体数据 | |||
isValueCard: "", | |||
type: 0, | |||
vanType: 0, | |||
userType: 0, | |||
promoteId: "", //产品id | |||
totalAmount: 0, //产品+权益产品金额 | |||
changeCardType: "",//储值卡转记账卡选权益产品 | |||
applyId: "", | |||
orderId: "", | |||
sysType: "", | |||
signAgencyId:"", | |||
productId:"",//产品编号 | |||
}) | |||
let richText = ref('') | |||
@@ -58,9 +58,9 @@ import { deviceType } from "@/utils/network/difference"; | |||
state.clientFee = option.clientFee; | |||
state.equityId = option.equityId; | |||
state.userType = option.userType; | |||
state.type = option.type; | |||
state.vanType = option.vanType; | |||
state.isValueCard = option.isValueCard; | |||
state.promoteId = option.promoteId; | |||
state.productId = option.productId; | |||
state.totalAmount = option.fee; | |||
// 储值卡转记账卡传过来的参数 | |||
state.changeCardType = option.changeCardType; | |||
@@ -74,21 +74,21 @@ import { deviceType } from "@/utils/network/difference"; | |||
console.log("state.signAgencyId",state.signAgencyId,deviceType) | |||
if(state.signAgencyId==deviceType){ | |||
let obj={ | |||
type:state.type, | |||
type:state.vanType, | |||
userType:state.userType, | |||
promoteId:state.promoteId | |||
promoteId:state.productId | |||
} | |||
const params = encodeURIComponent(JSON.stringify(obj)) | |||
jump("15",params) | |||
}else{ | |||
if (state.changeCardType == "1") { | |||
navTo( | |||
`/subpackage/after-sale/to-bookkeeping-card/mailing_information?orderId=${state.orderId}&&applyId=${state.applyId}&&productId=${state.promoteId}&&totalAmount=${state.totalAmount}&&equityId=${state.equityId}` | |||
`/subpackage/after-sale/to-bookkeeping-card/mailing_information?orderId=${state.orderId}&&applyId=${state.applyId}&&productId=${state.productId}&&totalAmount=${state.totalAmount}&&equityId=${state.equityId}` | |||
) | |||
} else { | |||
// 正常流程 | |||
uni.redirectTo({ | |||
url: `/subpackage/orders/essential-information?promoteId=${getItem("promoteId")}&userType=${state.userType}&type=${state.type}&isValueCard=${state.isValueCard}&totalAmount=${state.totalAmount}&equityId=${state.equityId}`, | |||
url: `/subpackage/orders/essential-information?userType=${state.userType}&vanType=${state.vanType}&isValueCard=${state.isValueCard}&totalAmount=${state.totalAmount}&equityId=${state.equityId}&productId=${state.productId}`, | |||
}); | |||
} | |||
} |
@@ -56,7 +56,7 @@ | |||
:disabled="state.isEnableOCRData" maxlength="18" /> | |||
</u-form-item> | |||
<u-form-item label="地址"> | |||
<u-input placeholder='请输入地址' :autoHeight='true' v-model="state.form.address" | |||
<u-input placeholder='请输入地址' :autoHeight='true' v-model="state.form.userAddress" | |||
:disabled="state.isEnableOCRData" maxlength="50" /> | |||
</u-form-item> | |||
<u-form-item label="联系方式"> | |||
@@ -127,7 +127,7 @@ | |||
type="number" /> | |||
</u-form-item> | |||
<u-form-item label="地址"> | |||
<u-input placeholder='请输入地址' inputAlign="right" :autoHeight='true' v-model="state.form.address" | |||
<u-input placeholder='请输入地址' inputAlign="right" :autoHeight='true' v-model="state.form.userAddress" | |||
:disabled="state.isEnableOCRData" maxlength="50" /> | |||
</u-form-item> | |||
</u-form> | |||
@@ -244,16 +244,14 @@ | |||
} from "@dcloudio/uni-app"; | |||
import { | |||
etcOcrCard, | |||
etcUserCardInfoSubmit, | |||
fileUpload, | |||
register, | |||
envs, | |||
getUserMsg, | |||
ocrAllQuery | |||
ocrAllQuery, | |||
userUpload | |||
} from "@/utils/network/api.js"; | |||
import { | |||
request | |||
request, requestNew | |||
} from "@/utils/network/request.js"; | |||
import { | |||
@@ -292,11 +290,11 @@ | |||
userPosImgUrl: "", //身份证正面 | |||
userNegImgUrl: "", //身份证反面 | |||
tel: "", //开户人手机号 | |||
address: "", //开户人地址 | |||
userAddress: "", //开户人地址 | |||
sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议) | |||
channelId: "", //渠道id | |||
gender: "", | |||
customerIdVld: "", | |||
customerIdVld: "", //用户证件有效期 | |||
agentName: "", | |||
agentGender: "", | |||
agentTel: '', | |||
@@ -310,6 +308,7 @@ | |||
agentIdVld: '', | |||
opId: '', | |||
orderSource: 'WECHAT', | |||
isAgent:false | |||
}, | |||
genderShow: false, | |||
@@ -317,7 +316,7 @@ | |||
vehiclePlateColor: undefined, | |||
isMyPeopple: true, | |||
isSign: '', | |||
type: 1, | |||
vanType: 1, | |||
isEnableOther: true, //小程序是否支持他人办理 | |||
isEnableBook: true, //他人办理时是否上传委托书 | |||
isEnableInfo: true, //小程序信息带出 | |||
@@ -381,10 +380,10 @@ | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(etcUserCardInfoSubmit, options).then((res) => { | |||
requestNew(userUpload, options).then((res) => { | |||
console.log(res); | |||
uni.redirectTo({ | |||
url: `/subpackage/orders/car-release?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}&type=${state.type}&isSign=${state.isSign}&vehicleId=${state.vehicleId}`, | |||
url: `/subpackage/orders/car-release?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}&vanType=${state.vanType}&isSign=${state.isSign}&vehicleId=${state.vehicleId}`, | |||
}); | |||
}); | |||
}) | |||
@@ -408,8 +407,10 @@ | |||
state.isTakePhotoModeShow = false | |||
if (val) { | |||
state.isMyPeopple = true; | |||
state.form.isAgent=false | |||
} else { | |||
state.isMyPeopple = false; | |||
state.form.isAgent=true | |||
} | |||
state.form = { | |||
orderId: state.orderId, //订单ID | |||
@@ -419,7 +420,7 @@ | |||
userPosImgUrl: "", //身份证正面 | |||
userNegImgUrl: "", //身份证反面 | |||
tel: "", //开户人手机号 | |||
address: "", //开户人地址 | |||
userAddress: "", //开户人地址 | |||
sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议) | |||
channelId: "", //渠道id | |||
gender: "", | |||
@@ -436,6 +437,7 @@ | |||
agentAddress: "", | |||
agentIdVld: '', | |||
orderSource: 'WECHAT', | |||
isAgent:false | |||
}; | |||
}; | |||
onLoad((option : any) => { | |||
@@ -444,7 +446,7 @@ | |||
state.vehiclePlateColor = option.vehiclePlateColor; | |||
state.form.opId = getItem('openId') ? getItem('openId') : ''; | |||
state.isSign = option.isSign; | |||
state.type = option.type; | |||
state.vanType = option.vanType; | |||
state.vehicleId = option.vehicleId; | |||
getGlobalParam(); //全局配置数据 | |||
console.log("option", option) | |||
@@ -530,7 +532,7 @@ | |||
state.form.userNegImgUrl = data.customerNegImgUrl; | |||
state.form.userName = data.customerName; | |||
state.form.userIdNum = data.customerIdNum; | |||
state.form.address = data.customerAddress; | |||
state.form.userAddress = data.customerAddress; | |||
state.form.tel = data.customerTel; | |||
}) | |||
} | |||
@@ -569,7 +571,7 @@ | |||
state.form.gender = data.gender; | |||
state.form.userIdNum = data.idno; | |||
state.form.userPosImgUrl = data.imageUrl; | |||
state.form.address = data.address; | |||
state.form.userAddress = data.address; | |||
} else { | |||
state.form.customerIdVld = data.enddate; | |||
state.form.userNegImgUrl = data.imageUrl; | |||
@@ -631,7 +633,7 @@ | |||
userName: state.form.userName, | |||
gender: state.form.gender == '男' ? 'MALE' : 'FEMALE', | |||
certifyChannel: "BAIDUOCR", | |||
address: state.form.address, | |||
address: state.form.userAddress, | |||
agentIdNum: state.form.agentIdNum, | |||
agentIdType: state.form.agentIdType, | |||
agentName: state.form.agentName, |
@@ -25,9 +25,9 @@ | |||
import orderInfoItem from "./components/order-info-item"; | |||
import { reactive } from "vue"; | |||
import { onLoad } from "@dcloudio/uni-app"; | |||
import { request } from "@/utils/network/request.js"; | |||
import { request, requestNew } from "@/utils/network/request.js"; | |||
import { msg, confirm, getOrderStatusName } from "@/utils/utils"; | |||
import { orderDetail, receiveOrder } from "@/utils/network/api"; | |||
import { orderDetail, receiveOrder,orderReceiveGoods } from "@/utils/network/api"; | |||
import { getItem, StorageKeys } from "@/utils/storage"; | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
@@ -64,14 +64,13 @@ | |||
const options = { | |||
type: 2, | |||
data: { | |||
id: state.orderInfo.id, | |||
source: "WECHAT", | |||
opId: getItem(StorageKeys.OpenId) | |||
opId: getItem(StorageKeys.OpenId), | |||
orderId:state.orderInfo.orderId | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(receiveOrder, options).then((res) => { | |||
requestNew(orderReceiveGoods, options).then((res) => { | |||
confirm( | |||
"您已完成订单收货", | |||
() => { |
@@ -27,20 +27,18 @@ | |||
import { onLoad, onPageScroll } from "@dcloudio/uni-app"; | |||
import { reactive, ref } from "vue"; | |||
import { | |||
PAYDETECTION, | |||
// PAYDETECTION, | |||
PAYMENTORDERAPPLY, | |||
aliPayConfigIdTwo, | |||
obtainUserId, | |||
getOpenidApi, | |||
etcVehiclePlateVer | |||
etcVehiclePlateVer,payApply,payQuery | |||
} from "@/utils/network/api.js"; | |||
import { request } from "@/utils/network/request.js"; | |||
import { request,requestNew } from "@/utils/network/request.js"; | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
import { fileURL } from "@/datas/fileURL.js"; | |||
import navBgCar from "./components/nav-bg-car5"; | |||
import navBar from "@/components/nav-bar/nav-bar2.vue"; | |||
import { getItem, StorageKeys, setItem } from "@/utils/storage.ts"; | |||
import { msg } from "@/utils/utils"; | |||
const imgURL = `${fileURL}image/`; | |||
import { confirm } from "@/utils/utils"; | |||
let imageUrl = "" | |||
@@ -150,7 +148,7 @@ | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(PAYMENTORDERAPPLY, options).then((res) => { | |||
requestNew(payApply, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
console.log("data======111", data) | |||
if (data) { | |||
@@ -235,7 +233,7 @@ | |||
showLoading: true, | |||
}; | |||
console.log("输出内容", options); | |||
request(PAYDETECTION, options).then((res) => { | |||
requestNew(payQuery, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
console.log(data); | |||
if (data.paymentStatus == 'ALLSUCCESS') { | |||
@@ -311,7 +309,7 @@ | |||
showLoading: true, | |||
}; | |||
console.log("输出内容", options); | |||
request(PAYDETECTION, options).then((res) => { | |||
requestNew(payQuery, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
console.log(data); | |||
if (data.paymentStatus == 'ALLSUCCESS') { |
@@ -50,10 +50,10 @@ | |||
getAgreementApi, | |||
PAYDETECTION, | |||
envs, | |||
agreementConfirmApi | |||
agreementConfirmApi,payQuery | |||
} from "@/utils/network/api.js"; | |||
import { | |||
request | |||
request,requestNew | |||
} from "@/utils/network/request.js"; | |||
import { | |||
@@ -276,7 +276,7 @@ console.log("fileType",fileType) | |||
showLoading: true, | |||
}; | |||
console.log("输出内容", options); | |||
request(PAYDETECTION, options).then((res) => { | |||
requestNew(payQuery, options).then((res) => { | |||
// console.log(res.bizContent); | |||
const data = stringToJson(res.bizContent); | |||
console.log(data); |
@@ -34,7 +34,7 @@ | |||
<script setup lang="ts"> | |||
import { onLoad, onShow } from "@dcloudio/uni-app"; | |||
import { reactive } from "vue"; | |||
import { request } from "@/utils/network/request.js"; | |||
import { request,requestNew } from "@/utils/network/request.js"; | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
import { fileURL } from "@/datas/fileURL.js"; | |||
@@ -43,7 +43,7 @@ | |||
import { | |||
getOpenidApi, | |||
infoQuery, | |||
envs, etcQYAction, channelSingQueryApi | |||
envs, etcQYAction, channelSingQueryApi,userSign | |||
} from "@/utils/network/api"; | |||
const imgURL = `${fileURL}image/`; | |||
@@ -172,7 +172,7 @@ | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(etcQYAction, options).then((res) => { | |||
requestNew(userSign, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
console.log("data", data) | |||
if (data.userState === "UNAUTHORIZED") { |
@@ -310,4 +310,17 @@ export const versionVerificationApi = "d4f9dd3758ca41a1baa4f191df728f8b" //卡 | |||
export const interceptNDApi = "d8445c8b368d4b57bb6774aa51b91bb0" //拦截诺德 | |||
export const getOnLineUrlApi = "4b173ee5f550478ca22d4681fa9d8b42" //在线客服 | |||
export const signTest = "880ae48d40704572bac521b2fa11e93e" //异地支付宝签约检测 | |||
export const signTest = "880ae48d40704572bac521b2fa11e93e" //异地支付宝签约检测 | |||
// 新接口 | |||
export const pageQuery = "/iaw/issue/product/pageQuery" //产品分页查询 | |||
export const orderAdd = "/iaw/issue/order/add" //创建订单 | |||
export const userUpload = "/iaw/issue/user/userUpload" //用户信息上传 | |||
export const vehicleUpload= "/iaw/issue/vehicle/vehicleUpload" //车辆信息上传 | |||
export const plateCheck= "/iaw/app/issue/plateCheck/check" //车牌校验 | |||
export const payApply= "/iaw/issue/order/payApply" //支付申请 | |||
export const payQuery= "/iaw/issue/order/payQuery" //支付查询 | |||
export const userSign= "/iaw/app/issue/userSign/query" //签约检测 | |||
export const orderCancel= "/iaw/issue/order/orderCancel" //订单取消 | |||
export const queryPage= "/iaw/issue/order/queryPage" //订单分页查询 | |||
export const orderReceiveGoods= "/iaw/issue/order/orderReceiveGoods" //订单收货 |
@@ -298,4 +298,110 @@ export function request(code, options = {}, start = false) { | |||
} | |||
}); | |||
}); | |||
} | |||
//请求 | |||
export function requestNew(code, options = {}, start = false) { | |||
//公参 | |||
const Common = { | |||
// agentId: agentId, | |||
// channelId: channelId, | |||
// channelType: "1", | |||
// staffId: "54623263cb4d4a289dccbc983b22a4af", | |||
// terminalId: "999999999999", | |||
// loginSource: getItem("loginSource"), | |||
// rbacSource: 'MINI_PROGRAM', | |||
// accessToken: getItem(StorageKeys.Token), | |||
// openId: getItem(StorageKeys.OpenId), | |||
opId: getItem(StorageKeys.OpenId), | |||
orderSource:'WECHAT' | |||
} | |||
options.url = envs[process.env.NODE_ENV].baseUrl+'/ndev' + code | |||
//默认json数据格式提交` | |||
let contentType = 'application/json' | |||
//判断baseUri是否为空 | |||
if (options.baseUrlNew) { | |||
options.url = options.baseUrlNew | |||
} | |||
//根据type判断数据传输格式 | |||
if (options.type && options.type === 2) { | |||
contentType = 'application/json;charset=UTF-8' | |||
} | |||
//默认POST提交 | |||
options.method = options.method ? options.method : 'POST' | |||
//设置请求超时时间 | |||
options.timeout = 60000 | |||
options.header = { | |||
'content-type': contentType, | |||
'Access-Token': getItem(StorageKeys.Token) | |||
} | |||
if (!start) { | |||
//判断code不为空 | |||
if (code) { | |||
options.data =Object.assign(Common,{...options.data}); | |||
} | |||
} | |||
console.log('code', code, options.data) | |||
//是否显示加载中 | |||
if (options.showLoading) { | |||
uni.showLoading({ | |||
title: '请稍后', | |||
mask: true | |||
}); | |||
} | |||
//参数返回 | |||
return new Promise((resolve, reject) => { | |||
options.success = (res) => { | |||
// 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading) | |||
if (options.showLoading) { | |||
uni.hideLoading() | |||
} | |||
console.log("返回结果"+code,res) | |||
if (res.statusCode == 200 && res.data.code == 0) { | |||
resolve(res.data.data) | |||
} else { | |||
uni.showModal({ | |||
title: '提示', | |||
content: res.data.message, | |||
success: function(res) { | |||
if (res.confirm) { | |||
console.log('用户点击确定2'); | |||
} else if (res.cancel) { | |||
console.log('用户点击取消2'); | |||
} | |||
} | |||
}); | |||
reject(res.data.message) | |||
return | |||
} | |||
} | |||
options.fail = (err) => { | |||
uni.hideLoading() | |||
console.log('请求错误', err) | |||
//处理请求错误 | |||
reject(err) | |||
} | |||
uni.getNetworkType({ | |||
success: function(res) { | |||
if (res.networkType == 'none') { | |||
uni.showModal({ | |||
title: '提示', | |||
content: "网络异常", | |||
success: function(res) { | |||
if (res.confirm) { | |||
console.log('用户点击确定'); | |||
} else if (res.cancel) { | |||
console.log('用户点击取消'); | |||
} | |||
} | |||
}); | |||
} else { | |||
uni.request(options) | |||
} | |||
console.log("res.networkType", res.networkType); | |||
} | |||
}); | |||
}); | |||
} |