快速办理 | 快速办理 | ||||
</view> | </view> | ||||
<view class="express-lane"> | <view class="express-lane"> | ||||
<view class="item keche"> | |||||
<view class="item keche" @click="showMask(1)"> | |||||
<view class="item-con"> | <view class="item-con"> | ||||
<view class="top-txt"> | <view class="top-txt"> | ||||
客车用户 | 客车用户 | ||||
</view> | </view> | ||||
<view class="btn"> | |||||
<view class="btn" > | |||||
进入 | 进入 | ||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="item huoche"> | |||||
<view class="item huoche" @click="showMask(2)"> | |||||
<view class="item-con"> | <view class="item-con"> | ||||
<view class="top-txt"> | <view class="top-txt"> | ||||
货车用户 | 货车用户 | ||||
</view> | </view> | ||||
<!-- ETC选择弹窗 --> | |||||
<view class="mask" v-if="isShowMask"> | |||||
<view class="mask-content"> | |||||
<filter> | |||||
<view class="mask-close"> | |||||
<image :src="fileURL + 'image/index/icon-close.png'" class="icon-closed" @click="closeMask"></image> | |||||
</view> | |||||
<view class="mask-title" :style="{ '--color': color }">选择ETC用户类型</view> | |||||
<view class="mask-tab"> | |||||
<view class="tab-item active" @click="toCreatOrder('1')"> | |||||
<image :src="fileURL + 'image/index/icon-personal.png'" mode="aspectFill"></image> | |||||
<text class="tab-tit on">个人办理</text> | |||||
</view> | |||||
<view class="tab-item" @click="toCreatOrder('2')"> | |||||
<image :src="fileURL + 'image/index/icon-unit.png'" mode="aspectFill"></image> | |||||
<text class="tab-tit on">单位办理</text> | |||||
</view> | |||||
</view> | |||||
</filter> | |||||
</view> | |||||
</view> | |||||
</template> | </template> | ||||
<script setup lang="ts"> | <script setup lang="ts"> | ||||
import { | import { | ||||
const toCreatOrder = (val : number) => { | const toCreatOrder = (val : number) => { | ||||
console.log(typeof (val)); | console.log(typeof (val)); | ||||
state.userType = val; | state.userType = val; | ||||
navTo(`/subpackage/orders/choice-product?type=${state.type}&&userType=${state.userType}`) | |||||
navTo(`/subpackage/orders/choice-product?vanType=${state.type}&&userType=${state.userType}`) | |||||
closeMask(); | closeMask(); | ||||
}; | }; | ||||
const showMask = (val : any) => { | const showMask = (val : any) => { | ||||
state.type = val; //1 客车 2货车 | state.type = val; //1 客车 2货车 | ||||
isShowMask.value = true; | isShowMask.value = true; | ||||
console.log("showMask",val) | |||||
}; | }; | ||||
const closeMask = () => { | const closeMask = () => { | ||||
} | } | ||||
} | } | ||||
} | } | ||||
.mask { | |||||
background: $uni-bg-color-mask; | |||||
position: fixed; | |||||
left: 0; | |||||
top: 0; | |||||
right: 0; | |||||
bottom: 0; | |||||
} | |||||
.mask-content { | |||||
background: $uni-bg-color; | |||||
width: 570rpx; | |||||
height: 480rpx; | |||||
position: absolute; | |||||
left: 50%; | |||||
top: 50%; | |||||
transform: translate(-50%, -50%); | |||||
display: flex; | |||||
flex-direction: column; | |||||
border-radius: 20rpx; | |||||
} | |||||
.mask-close { | |||||
text-align: right; | |||||
} | |||||
.mask-title { | |||||
text-align: center; | |||||
font-size: 32rpx; | |||||
color: $uni-text-color-black; | |||||
margin-bottom: 50rpx; | |||||
} | |||||
.mask-tab { | |||||
display: flex; | |||||
justify-content: space-evenly; | |||||
} | |||||
.tab-item { | |||||
display: flex; | |||||
flex-direction: column; | |||||
justify-content: center; | |||||
align-items: center; | |||||
} | |||||
.tab-tit { | |||||
font-size: 32rpx; | |||||
margin-top: 20rpx; | |||||
color: #666; | |||||
} | |||||
.tab-item image { | |||||
width: 160rpx; | |||||
height: 160rpx; | |||||
} | |||||
.icon-closed { | |||||
width: 48rpx; | |||||
height: 48rpx; | |||||
margin: 24rpx 24rpx 0 0; | |||||
} | |||||
</style> | </style> |
import empty from "@/components/empty/empty.vue"; | import empty from "@/components/empty/empty.vue"; | ||||
import { onLoad, onReachBottom } from "@dcloudio/uni-app"; | import { onLoad, onReachBottom } from "@dcloudio/uni-app"; | ||||
import { reactive } from "vue"; | import { reactive } from "vue"; | ||||
import { equityProductsApi, addEquityListApi } from "@/utils/network/api.js"; | |||||
import { stringToJson } from "@/utils/network/encryption"; | import { stringToJson } from "@/utils/network/encryption"; | ||||
import { request } from "@/utils/network/request"; | import { request } from "@/utils/network/request"; | ||||
import { msg, navTo } from "@/utils/utils"; | import { msg, navTo } from "@/utils/utils"; | ||||
import { getEquityListApi } from "@/utils/network/api"; | import { getEquityListApi } from "@/utils/network/api"; | ||||
import { | |||||
getItem, | |||||
StorageKeys, | |||||
setItem | |||||
} from "@/utils/storage"; | |||||
const state = reactive({ | const state = reactive({ | ||||
list: [], //权益数据 | list: [], //权益数据 |
<view :style="`background-color:${bgc}`" style="border-radius: 16rpx;padding: 20rpx;margin-top: 20rpx;"> | <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 class="title" style="display: flex;flex-direction: row;justify-content: flex-start;"> | ||||
<view style="font-weight: bold;margin-right: 10rpx;font-size: 18px;"> | <view style="font-weight: bold;margin-right: 10rpx;font-size: 18px;"> | ||||
{{ item.promoteName }} | |||||
{{ item.productName }} | |||||
</view> | </view> | ||||
<view> | <view> | ||||
{{ item['releaseProductStandards']['productStandards']['cardTypeArr'] }} | |||||
{{ item['cardTypeArr'] }} | |||||
</view> | </view> | ||||
</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)"> | style="padding: 0rpx;margin-top: 20rpx;" @click="savaHandle(item,index)"> | ||||
<image style="width: 100%; height: 170rpx; border-radius: 20rpx" | <image style="width: 100%; height: 170rpx; border-radius: 20rpx" | ||||
:src="`${$imgUrl}applyCard/product-bg.png`"></image> | :src="`${$imgUrl}applyCard/product-bg.png`"></image> | ||||
</image> | </image> | ||||
<view class="content"> | <view class="content"> | ||||
<view class="title"> | <view class="title"> | ||||
{{ str.equityName }} | |||||
{{ str.productName }} | |||||
</view> | </view> | ||||
<view style="margin-top: 15rpx" class="tip"> | |||||
<!-- <view style="margin-top: 15rpx" class="tip"> | |||||
{{ str.sellingPoint.substring(0,15) }} | {{ str.sellingPoint.substring(0,15) }} | ||||
</view> | |||||
</view> --> | |||||
</view> | </view> | ||||
<view class="money"> | <view class="money"> | ||||
¥:{{ str.discountPrice * 0.01 }} | |||||
¥:{{ item.fee * 0.01 }} | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<script setup lang="ts"> | <script setup lang="ts"> | ||||
import { onLoad, onPageScroll, onShow } from "@dcloudio/uni-app"; | import { onLoad, onPageScroll, onShow } from "@dcloudio/uni-app"; | ||||
import { reactive, ref } from "vue"; | import { reactive, ref } from "vue"; | ||||
import { etcQueryProduct } from "@/utils/network/api.js"; | |||||
import { request } from "@/utils/network/request.js"; | |||||
import { etcQueryProduct, pageQuery } from "@/utils/network/api.js"; | |||||
import { request,requestNew } from "@/utils/network/request.js"; | |||||
import { stringToJson } from "@/utils/network/encryption"; | import { stringToJson } from "@/utils/network/encryption"; | ||||
import { fileURL } from "@/datas/fileURL.js"; | import { fileURL } from "@/datas/fileURL.js"; | ||||
import navBgCar from "./components/nav-bg-car1"; | import navBgCar from "./components/nav-bg-car1"; | ||||
setItem("promoteId", val.promoteId); | setItem("promoteId", val.promoteId); | ||||
state.isSign = val.isSign; | 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 | state.isValueCard = 2 | ||||
} else if (val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",")[0] == '储值卡') { | |||||
} else if (val['cardTypeArr'].split(",")[0] == '储值卡') { | |||||
state.isValueCard = 1 | state.isValueCard = 1 | ||||
} else { | } else { | ||||
state.isValueCard = 2 | state.isValueCard = 2 | ||||
console.log("state.isValueCard", state.isValueCard) | console.log("state.isValueCard", state.isValueCard) | ||||
setItem("isValueCard", state.isValueCard); | setItem("isValueCard", state.isValueCard); | ||||
uni.navigateTo({ | 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}&promoteId=${val['promoteId']}&userType=${state.userType}&vanType=${state.vanType}&isValueCard=${state.isValueCard}&fee=${state.fee}&signAgencyId=${val['deviceType']}`, | |||||
}); | }); | ||||
} else { | } else { | ||||
state.radiolist1 = []; | 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 = {}; | const obj = {}; | ||||
obj["name"] = val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",")[i]; | |||||
obj["name"] = val['cardTypeArr'].split(",")[i]; | |||||
obj["disabled"] = false; | obj["disabled"] = false; | ||||
state.radiolist1.push(obj) | state.radiolist1.push(obj) | ||||
} | } | ||||
// #ifdef MP-WEIXIN | // #ifdef MP-WEIXIN | ||||
state.sysType = 'WECHAT'; | state.sysType = 'WECHAT'; | ||||
// #endif | // #endif | ||||
state.userType = option.userType; | |||||
state.type = option.type; | |||||
state.userType = Number(option.userType); | |||||
state.vanType = Number(option.vanType); | |||||
productList(); | productList(); | ||||
console.log("option选择产品列表", option) | console.log("option选择产品列表", option) | ||||
}); | }); | ||||
var data = { | var data = { | ||||
userType: state.userType, | userType: state.userType, | ||||
agencyId: agentId, | agencyId: agentId, | ||||
vanType: state.type, | |||||
promotionMode: 1 | |||||
vanType: state.vanType, | |||||
}; | }; | ||||
console.log("data",data) | console.log("data",data) | ||||
const options = { | const options = { | ||||
type: 2, | |||||
data: data, | data: data, | ||||
method: "POST", | method: "POST", | ||||
showLoading: true, | showLoading: true, | ||||
}; | }; | ||||
console.log("输出内容", options); | 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) { | if (data.list && data.list.length > 0) { | ||||
state.dataArray = data.list ? data.list : []; | state.dataArray = data.list ? data.list : []; | ||||
console.log("state.dataArray", state.dataArray); | console.log("state.dataArray", state.dataArray); | ||||
for (var i = 0; i < state.dataArray.length; i++) { | for (var i = 0; i < state.dataArray.length; i++) { | ||||
const cardTypeArr = [] | 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('储值卡') | cardTypeArr.push('储值卡') | ||||
} else if (state.dataArray[i]['releaseProductStandards']['productStandards'].cardType[j] == '1') { | |||||
} else if (state.dataArray[i].cardType[j] == '1') { | |||||
cardTypeArr.push('记账卡') | cardTypeArr.push('记账卡') | ||||
} else if (state.dataArray[i]['releaseProductStandards']['productStandards'].cardType[j] == '3') { | |||||
} else if (state.dataArray[i].cardType[j] == '3') { | |||||
cardTypeArr.push('预存卡') | cardTypeArr.push('预存卡') | ||||
} | } | ||||
} | } | ||||
state.dataArray[i]['releaseProductStandards']['productStandards']['cardTypeArr'] = cardTypeArr.toString() | |||||
state.dataArray[i]['cardTypeArr'] = cardTypeArr.toString() | |||||
} | } | ||||
} else { | } else { | ||||
uni.showModal({ | uni.showModal({ | ||||
success: function (res) { | success: function (res) { | ||||
if (res.confirm) { | if (res.confirm) { | ||||
console.log('用户点击确定'); | console.log('用户点击确定'); | ||||
uni.switchTab({ | |||||
url: '/pages/index/index' | |||||
}) | |||||
} else if (res.cancel) { | } else if (res.cancel) { | ||||
console.log('用户点击取消'); | console.log('用户点击取消'); | ||||
} | } | ||||
sysType: "", | sysType: "", | ||||
orderId: "", | orderId: "", | ||||
userType: 1, //1 个人 2单位 | userType: 1, //1 个人 2单位 | ||||
type: 0, //0 客车 1货车 | |||||
vanType: 0, //0 客车 1货车 | |||||
vehiclePlateColor: "", | vehiclePlateColor: "", | ||||
data: { | data: { | ||||
show: false, | show: false, |
<template> | <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> | <navBgCar></navBgCar> | ||||
<view class="content-wrap"> | <view class="content-wrap"> | ||||
<view> | <view> | ||||
infoQuery, | infoQuery, | ||||
envs, | envs, | ||||
addProduct, | addProduct, | ||||
isSubmitOrderApi | |||||
isSubmitOrderApi, | |||||
orderAdd | |||||
} from "@/utils/network/api.js"; | } 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 { reactive, ref } from "vue"; | ||||
import { msg, noticeUser } from "@/utils/utils"; | import { msg, noticeUser } from "@/utils/utils"; | ||||
const scrollTop = ref(0); | const scrollTop = ref(0); | ||||
vehiclePlate: undefined, //车牌号 | vehiclePlate: undefined, //车牌号 | ||||
vehiclePlateNumber: "", //车牌号 | vehiclePlateNumber: "", //车牌号 | ||||
vehiclePlateColor: 0, //车牌颜色 | vehiclePlateColor: 0, //车牌颜色 | ||||
type: "1", //车牌类型 | |||||
vanType: 1, //客货类型 | |||||
userType: 1, | userType: 1, | ||||
whetherToMail: getItem(StorageKeys.OpenId) ? 0 : "", //是否需要邮寄 小程序默认邮寄 0邮寄||1不邮寄 不登录为1 | |||||
whetherToMail: getItem(StorageKeys.OpenId) ? true : "", //是否需要邮寄 小程序默认邮寄 true邮寄||1不邮寄 不登录为1 | |||||
orderSource: "WECHAT", | orderSource: "WECHAT", | ||||
opId: "", | opId: "", | ||||
consignee: "", //收货人 | consignee: "", //收货人 | ||||
showLoading: true, | showLoading: true, | ||||
}; | }; | ||||
request(etcCreatOrder, options).then((res) => { | |||||
requestNew(orderAdd, options).then((res) => { | |||||
console.log(res); | console.log(res); | ||||
if (res.statusCode === 600) { | if (res.statusCode === 600) { | ||||
orderGoAction(); | orderGoAction(); | ||||
console.log("state.data.vehiclePlate", state.data.vehiclePlate, state.data.vehiclePlateColor, vehicleId) | console.log("state.data.vehiclePlate", state.data.vehiclePlate, state.data.vehiclePlateColor, vehicleId) | ||||
if (state.data.userType == 1) { | if (state.data.userType == 1) { | ||||
uni.navigateTo({ | 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 { | } else { | ||||
uni.navigateTo({ | 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}`, | |||||
}); | }); | ||||
} | } | ||||
}) | }) | ||||
}; | }; | ||||
onLoad((option : any) => { | 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.opId = getItem(StorageKeys.OpenId); | ||||
state.data.userType = option.userType; | |||||
state.data.userType =Number(option.userType); | |||||
state.data.promoteId = option.promoteId; | state.data.promoteId = option.promoteId; | ||||
state.data.vehiclePlate = option.vehiclePlate; | state.data.vehiclePlate = option.vehiclePlate; | ||||
state.data.vehiclePlateColor = option.vehiclePlateColor; | state.data.vehiclePlateColor = option.vehiclePlateColor; |
<template> | <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> | <navBgCar></navBgCar> | ||||
<view class="content-wrap"> | <view class="content-wrap"> | ||||
<!-- 车牌输入 --> | <!-- 车牌输入 --> | ||||
<!-- 车牌颜色 --> | <!-- 车牌颜色 --> | ||||
<view class="chepai-lane"> | <view class="chepai-lane"> | ||||
<view class="title">选择车牌颜色</view> | <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"> | @numberplateResult="checkNumberplateColor"> | ||||
</numberplate-color> | </numberplate-color> | ||||
</view> | </view> | ||||
vehiclePlate: undefined, //车牌号 | vehiclePlate: undefined, //车牌号 | ||||
vehiclePlateNumber: "", //车牌号 | vehiclePlateNumber: "", //车牌号 | ||||
vehiclePlateColor: 0, //车牌颜色 | vehiclePlateColor: 0, //车牌颜色 | ||||
type: "1", //车牌类型 | |||||
vanType: 1, //车牌类型 | |||||
userType: 1, | userType: 1, | ||||
whetherToMail: getItem(StorageKeys.OpenId) ? 0 : "", //是否需要邮寄 小程序默认邮寄 0邮寄||1不邮寄 不登录为1 | whetherToMail: getItem(StorageKeys.OpenId) ? 0 : "", //是否需要邮寄 小程序默认邮寄 0邮寄||1不邮寄 不登录为1 | ||||
orderSource: "WECHAT", | orderSource: "WECHAT", | ||||
console.log("车牌信息", options) | console.log("车牌信息", options) | ||||
request(etcVehiclePlateVer, options).then((res) => { | request(etcVehiclePlateVer, options).then((res) => { | ||||
uni.redirectTo({ | 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?promoteId=${getItem("promoteId")}&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}`, | |||||
}); | }); | ||||
}); | }); | ||||
} else { | } else { | ||||
}; | }; | ||||
onLoad((option : any) => { | 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.opId = getItem(StorageKeys.OpenId); | ||||
state.data.userType = option.userType; | state.data.userType = option.userType; | ||||
state.data.promoteId = option.promoteId; | state.data.promoteId = option.promoteId; |
choiceValue: [], //选择的权益数据的下标 | choiceValue: [], //选择的权益数据的下标 | ||||
choiceValueComplete: [], //选择的权益数据的具体数据 | choiceValueComplete: [], //选择的权益数据的具体数据 | ||||
isValueCard: "", | isValueCard: "", | ||||
type: 0, | |||||
vanType: 0, | |||||
userType: 0, | userType: 0, | ||||
promoteId: "", //产品id | promoteId: "", //产品id | ||||
totalAmount: 0, //产品+权益产品金额 | totalAmount: 0, //产品+权益产品金额 | ||||
state.clientFee = option.clientFee; | state.clientFee = option.clientFee; | ||||
state.equityId = option.equityId; | state.equityId = option.equityId; | ||||
state.userType = option.userType; | state.userType = option.userType; | ||||
state.type = option.type; | |||||
state.vanType = option.vanType; | |||||
state.isValueCard = option.isValueCard; | state.isValueCard = option.isValueCard; | ||||
state.promoteId = option.promoteId; | state.promoteId = option.promoteId; | ||||
state.totalAmount = option.fee; | state.totalAmount = option.fee; | ||||
console.log("state.signAgencyId",state.signAgencyId,deviceType) | console.log("state.signAgencyId",state.signAgencyId,deviceType) | ||||
if(state.signAgencyId==deviceType){ | if(state.signAgencyId==deviceType){ | ||||
let obj={ | let obj={ | ||||
type:state.type, | |||||
type:state.vanType, | |||||
userType:state.userType, | userType:state.userType, | ||||
promoteId:state.promoteId | promoteId:state.promoteId | ||||
} | } | ||||
} else { | } else { | ||||
// 正常流程 | // 正常流程 | ||||
uni.redirectTo({ | 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?promoteId=${getItem("promoteId")}&userType=${state.userType}&vanType=${state.vanType}&isValueCard=${state.isValueCard}&totalAmount=${state.totalAmount}&equityId=${state.equityId}`, | |||||
}); | }); | ||||
} | } | ||||
} | } |
register, | register, | ||||
envs, | envs, | ||||
getUserMsg, | getUserMsg, | ||||
ocrAllQuery | |||||
ocrAllQuery, | |||||
userUpload | |||||
} from "@/utils/network/api.js"; | } from "@/utils/network/api.js"; | ||||
import { | import { | ||||
request | |||||
request, requestNew | |||||
} from "@/utils/network/request.js"; | } from "@/utils/network/request.js"; | ||||
import { | import { | ||||
sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议) | sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议) | ||||
channelId: "", //渠道id | channelId: "", //渠道id | ||||
gender: "", | gender: "", | ||||
customerIdVld: "", | |||||
customerIdVld: "", //用户证件有效期 | |||||
agentName: "", | agentName: "", | ||||
agentGender: "", | agentGender: "", | ||||
agentTel: '', | agentTel: '', | ||||
method: "POST", | method: "POST", | ||||
showLoading: true, | showLoading: true, | ||||
}; | }; | ||||
request(etcUserCardInfoSubmit, options).then((res) => { | |||||
requestNew(userUpload, options).then((res) => { | |||||
console.log(res); | console.log(res); | ||||
uni.redirectTo({ | 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}&type=${state.type}&isSign=${state.isSign}&vehicleId=${state.vehicleId}`, |
export const interceptNDApi = "d8445c8b368d4b57bb6774aa51b91bb0" //拦截诺德 | export const interceptNDApi = "d8445c8b368d4b57bb6774aa51b91bb0" //拦截诺德 | ||||
export const getOnLineUrlApi = "4b173ee5f550478ca22d4681fa9d8b42" //在线客服 | 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 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); | |||||
} | |||||
}); | |||||
}); | |||||
} | } |