console.log("******************", orderInfo.orderStep); | console.log("******************", orderInfo.orderStep); | ||||
console.log("********555555555555**********", orderInfo); | console.log("********555555555555**********", orderInfo); | ||||
let url = ''; | let url = ''; | ||||
if (orderInfo.orderStep == OrderStatus.完成填写基本信息) { | |||||
if (orderInfo.orderStep == OrderStatus.完成填写基本信息 || orderInfo.orderStep == OrderStatus.待支付3) { | |||||
url = orderInfo.userType === 'PERSONAL_USER' ? '/subpackage/orders/opening-account-people' : '/subpackage/orders/opening-account-unit'; | url = orderInfo.userType === 'PERSONAL_USER' ? '/subpackage/orders/opening-account-people' : '/subpackage/orders/opening-account-unit'; | ||||
} else if (orderInfo.orderStep === OrderStatus["完成个人/单位信息上传"]) { | } else if (orderInfo.orderStep === OrderStatus["完成个人/单位信息上传"]) { | ||||
url = '/subpackage/orders/car-release'; | url = '/subpackage/orders/car-release'; | ||||
// uni.redirectTo({ | // uni.redirectTo({ | ||||
// url: `/subpackage/orders/choice-product?orderId=${val.orderId}`, | // url: `/subpackage/orders/choice-product?orderId=${val.orderId}`, | ||||
// }); | // }); | ||||
} else { | |||||
} else if (orderInfo.orderStep === OrderStatus["完成车辆信息上传/待支付"]) { | |||||
url = '/subpackage/orders/order-payment'; | |||||
} | } | ||||
console.log("url", url) | console.log("url", url) | ||||
navTo(`${url}?orderId=${orderInfo.orderId}&clientFee=${orderInfo.amount}&id=${orderInfo.productId}&vehiclePlateColor=${orderInfo.vehiclePlateColor}&fromOrder=true&type=${orderInfo.type}&userType=${orderInfo.userType === 'PERSONAL_USER' ? '1' : '2'}`); | navTo(`${url}?orderId=${orderInfo.orderId}&clientFee=${orderInfo.amount}&id=${orderInfo.productId}&vehiclePlateColor=${orderInfo.vehiclePlateColor}&fromOrder=true&type=${orderInfo.type}&userType=${orderInfo.userType === 'PERSONAL_USER' ? '1' : '2'}`); |
}, | }, | ||||
{ | { | ||||
key: 5, | key: 5, | ||||
value: "已支付" | |||||
value: "完成签约" | |||||
}, | }, | ||||
{ | { | ||||
key: 6, | key: 6, | ||||
export const getOrderStatus = (id) => { | export const getOrderStatus = (id) => { | ||||
let types = OrderStatus.filter(item => item.key == id); | let types = OrderStatus.filter(item => item.key == id); | ||||
return types[0]?.value | return types[0]?.value | ||||
} | |||||
} |
} | } | ||||
//订单状态 | //订单状态 | ||||
// export enum OrderStatus { | |||||
// '已取消' = -1, //注意“已取消”判断字段未orderStatus,下面判断字段为orderStep | |||||
// '完成填写基本信息' = 1, | |||||
// '完成个人/单位信息上传' = 2, | |||||
// '完成车辆信息上传' = 3, | |||||
// '待加购权益' = 4, | |||||
// '待支付2' = 26, //已经生成二维码但未支付 | |||||
// '待支付3' = 27, //加购完权益但未支付 | |||||
// '已支付' = 5, | |||||
// '待审核' = 6, | |||||
// '审核不通过' = 7, | |||||
// '待发货' = 8, | |||||
// '待收货' = 9, | |||||
// '待激活' = 10, | |||||
// '已完成' = 11, | |||||
// '已申请-换货' = 12, | |||||
// '已申请-退货' = 13, | |||||
// '已结束' = 14, | |||||
// '退款中' = 15, | |||||
// '退款成功' = 16, | |||||
// '退货成功' = 17, | |||||
// '换货-设备已回收' = 18, | |||||
// } | |||||
export enum OrderStatus { | export enum OrderStatus { | ||||
'已取消' = -1, //注意“已取消”判断字段未orderStatus,下面判断字段为orderStep | '已取消' = -1, //注意“已取消”判断字段未orderStatus,下面判断字段为orderStep | ||||
'完成填写基本信息' = 1, | '完成填写基本信息' = 1, | ||||
'完成个人/单位信息上传' = 2, | '完成个人/单位信息上传' = 2, | ||||
'完成车辆信息上传' = 3, | |||||
'待加购权益' = 4, | |||||
'待支付2' = 26, | |||||
'待支付3' = 27, | |||||
'已支付' = 5, | |||||
'已支付/待签约' = 3, | |||||
'完成车辆信息上传/待支付' = 4, | |||||
'待支付2' = 26, //已经生成二维码但未支付 | |||||
'待支付3' = 27, //加购完权益但未支付 | |||||
'完成签约' = 5, | |||||
'待审核' = 6, | '待审核' = 6, | ||||
'审核不通过' = 7, | '审核不通过' = 7, | ||||
'待发货' = 8, | '待发货' = 8, |
@click="$util.navTo('/subpackage/orders/moreHighMsg/moreHighMsg',true)">查看更多</view> | @click="$util.navTo('/subpackage/orders/moreHighMsg/moreHighMsg',true)">查看更多</view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<!-- <button type="default" @click="qq">111111111111</button> --> | |||||
<!-- 专区服务 --> | <!-- 专区服务 --> | ||||
<!-- <view class="service"> | <!-- <view class="service"> | ||||
<view class="title">专区服务</view> | <view class="title">专区服务</view> | ||||
// doSomething();//代办事项 | // doSomething();//代办事项 | ||||
}) | }) | ||||
const qq = () => { | |||||
uni.navigateToMiniProgram({ | |||||
appId: "wxbcad394b3d99dac9", | |||||
path: "pages/route/index", | |||||
extraData: { | |||||
appid: "wxcb1388c809fe25a9", | |||||
sub_appid: "wx008c60533388527a", | |||||
mch_id: "1500877591", | |||||
sub_mch_id: "1622652848", | |||||
nonce_str: "e9eb7a02533947389f8f4e7cb9394fb5", | |||||
sign_type: "HMAC-SHA256", | |||||
trade_scene: "HIGHWAY", | |||||
plate_number: "贵ZBYD09", | |||||
sub_openid: "oHQtp5C8821AImJa1ibf6rZ6xc60", | |||||
sign: "B926E47DF8DE6B5FE53FF7AC3CCB5FA7C5CDB3459A4C1AFC0CDC8B143EC68DDA", | |||||
channel_type: "ETC" | |||||
}, | |||||
// extraData: { | |||||
// appid: "wxe5572b2938f35c09", | |||||
// channel_type: "ETC", //没有 | |||||
// mch_id: "1641444218", | |||||
// nonce_str: "e9eb7a02533947389f8f4e7cb9394fb5", | |||||
// plate_number: "贵ZBYD09", | |||||
// sign: "B926E47DF8DE6B5FE53FF7AC3CCB5FA7C5CDB3459A4C1AFC0CDC8B143EC68DDA", | |||||
// sign_type: "HMAC-SHA256", | |||||
// sub_appid: "wx008c60533388527a", | |||||
// sub_mch_id: "1648725759", | |||||
// sub_openid: "oHQtp5C8821AImJa1ibf6rZ6xc60", | |||||
// trade_scene: "HIGHWAY" | |||||
// }, | |||||
success(res) { | |||||
console.log(res); | |||||
}, | |||||
complete(res) { | |||||
console.log(res); | |||||
}, | |||||
fail(res) { | |||||
console.log(res); | |||||
// 未成功跳转到车主小程序 | |||||
}, | |||||
}); | |||||
} | |||||
onMounted(() => { | onMounted(() => { | ||||
uni.getSystemInfo({ | uni.getSystemInfo({ | ||||
success: (e : any) => { | success: (e : any) => { |
<template v-if="item.orderStatus != OrderStatus.已取消"> | <template v-if="item.orderStatus != OrderStatus.已取消"> | ||||
<!-- 信息填写未完成 --> | <!-- 信息填写未完成 --> | ||||
<view class="btns" | <view class="btns" | ||||
v-if="item.orderStep == OrderStatus['完成个人/单位信息上传'] || item.orderStep == OrderStatus.完成填写基本信息 || item.orderStep == OrderStatus.完成车辆信息上传"> | |||||
v-if="item.orderStep == OrderStatus['完成个人/单位信息上传'] || item.orderStep == OrderStatus.完成填写基本信息 || item.orderStep == OrderStatus.完成车辆信息上传 || item.orderStep == OrderStatus.待支付3"> | |||||
<view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view> | <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view> | ||||
<view class="btn btn-primary" @click.stop="gotoEditUserOrUnitInfo(item)">继续申请</view> | <view class="btn btn-primary" @click.stop="gotoEditUserOrUnitInfo(item)">继续申请</view> | ||||
<view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view> | <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view> | ||||
<view class="btn btn-primary" @click.stop="gotoEditUserOrUnitInfo(item)">加购权益</view> | <view class="btn btn-primary" @click.stop="gotoEditUserOrUnitInfo(item)">加购权益</view> | ||||
</view> | </view> | ||||
<!-- <view class="btns" v-if="item.orderStep == OrderStatus.待加购权益&& item.isValueCard != 1"> | |||||
<view class="btns" v-if="item.orderStep == OrderStatus['完成车辆信息上传/待支付']"> | |||||
<view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view> | <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view> | ||||
<view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">支付</view> | <view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">支付</view> | ||||
</view> --> | |||||
</view> | |||||
<view class="btns" v-if="item.orderStep == OrderStatus.待支付2"> | <view class="btns" v-if="item.orderStep == OrderStatus.待支付2"> | ||||
<!-- <view class="btn btn-normal" @click.stop="gotoEditUserOrUnitInfo(item)">修改资料</view> --> | <!-- <view class="btn btn-normal" @click.stop="gotoEditUserOrUnitInfo(item)">修改资料</view> --> | ||||
<view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view> | <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view> | ||||
<view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">支付</view> | <view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">支付</view> | ||||
</view> | </view> | ||||
<view class="btns" v-if="item.orderStep == OrderStatus.待支付3"> | |||||
<!-- <view class="btns" v-if="item.orderStep == OrderStatus.待支付3"> | |||||
<view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view> | <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view> | ||||
<view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">支付</view> | <view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">支付</view> | ||||
</view> | |||||
</view> --> | |||||
<!-- 审核中/审核不通过 --> | <!-- 审核中/审核不通过 --> | ||||
<view class="btns" v-if="item.orderStep == OrderStatus.待审核 || item.orderStep == OrderStatus.审核不通过"> | <view class="btns" v-if="item.orderStep == OrderStatus.待审核 || item.orderStep == OrderStatus.审核不通过"> | ||||
<view class="btn btn-normal" @click.stop="gotoCheckLogistics(item)">查看物流</view> | <view class="btn btn-normal" @click.stop="gotoCheckLogistics(item)">查看物流</view> | ||||
<view class="btn btn-primary" @click.stop="gotoConfirmReceipt(item)">确认收货</view> | <view class="btn btn-primary" @click.stop="gotoConfirmReceipt(item)">确认收货</view> | ||||
</view> | </view> | ||||
<!-- '已支付' = 5, | |||||
<!-- '完成签约' = 5, | |||||
'已申请-退货' = 13, | '已申请-退货' = 13, | ||||
'退款中' = 15, | '退款中' = 15, | ||||
'退款成功' = 16, | '退款成功' = 16, |
state.orderId = option.orderId; | state.orderId = option.orderId; | ||||
state.applyId = option.applyId; | state.applyId = option.applyId; | ||||
state.type = option.type; | state.type = option.type; | ||||
state.agencyId = option.agencyId; | |||||
var data = { | var data = { | ||||
type: state.type, | type: state.type, | ||||
source: state.sysType //请求方来源 | |||||
source: state.sysType, //请求方来源 | |||||
agencyId: state.agencyId,//渠道编号 | |||||
}; | }; | ||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
}; | }; | ||||
const state = reactive({ | const state = reactive({ | ||||
agencyId: "",//渠道编号id | |||||
applyId: "", | applyId: "", | ||||
isValueCard: 1, //卡的类型 | isValueCard: 1, //卡的类型 | ||||
radiolist1: [], //选择卡的数据列表 | radiolist1: [], //选择卡的数据列表 |
/*视图进入后操作*/ | /*视图进入后操作*/ | ||||
onLoad((option) => { | onLoad((option) => { | ||||
queryOrderDetail(option.id).then((val : any) => { | queryOrderDetail(option.id).then((val : any) => { | ||||
console.log("订单详情", val) | |||||
state.data = val | state.data = val | ||||
}) | }) | ||||
}); | }); | ||||
// // `/subpackage/after-sale/to-bookkeeping-card/mailing_information?orderId=${state.data.orderId}&&applyId=${val.applyId}` | // // `/subpackage/after-sale/to-bookkeeping-card/mailing_information?orderId=${state.data.orderId}&&applyId=${val.applyId}` | ||||
// // ) | // // ) | ||||
navTo( | navTo( | ||||
`/subpackage/after-sale/to-bookkeeping-card/choice-product-new?orderId=${state.data.orderId}&&applyId=${val.applyId}&&type=${state.data.type}` | |||||
`/subpackage/after-sale/to-bookkeeping-card/choice-product-new?orderId=${state.data.orderId}&&applyId=${val.applyId}&&type=${state.data.type}&&agencyId=${state.data.agencyId}` | |||||
) | ) | ||||
}) | }) | ||||
// navTo( | // navTo( |
:disabled="state.isEnableChangeOCRCarInfo" /> | :disabled="state.isEnableChangeOCRCarInfo" /> | ||||
</u-form-item> | </u-form-item> | ||||
<u-form-item label="车轴数"> | <u-form-item label="车轴数"> | ||||
<u-input inputAlign="right" placeholder="请输入车轴数" v-model="state.form.axleCount" /> | |||||
<u-input inputAlign="right" placeholder="请输入车轴数" v-model="state.form.axleCount" type="number" | |||||
maxlength="2" /> | |||||
</u-form-item> | </u-form-item> | ||||
<view class="form-item"> | <view class="form-item"> | ||||
<label>车辆用户类型</label> | <label>车辆用户类型</label> | ||||
const data = stringToJson(res.bizContent); | const data = stringToJson(res.bizContent); | ||||
console.log(data); | console.log(data); | ||||
if (val === "1") { | if (val === "1") { | ||||
state.form.vehicleIdNum = data.plate_a; | |||||
if (data.plate_a.length > 8) { | |||||
state.form.vehicleIdNum = data.plate_a.substring(0, 8); | |||||
} else { | |||||
state.form.vehicleIdNum = data.plate_a; | |||||
} | |||||
state.form.man = data.man; | state.form.man = data.man; | ||||
state.form.vehicleType = data.vehicle; | state.form.vehicleType = data.vehicle; | ||||
state.form.character = data.character; | state.form.character = data.character; |
console.log("订单状态舔砖", val); | console.log("订单状态舔砖", val); | ||||
//完成填写基本信息 | //完成填写基本信息 | ||||
if (val.orderStep === 1) { | if (val.orderStep === 1) { | ||||
if (state.data.userType === 1) { | |||||
if (state.data.userType === 1 || val.orderStep === 27) { | |||||
uni.redirectTo({ | uni.redirectTo({ | ||||
url: `/subpackage/orders/opening-account-people?orderId=${val.orderId}&&vehiclePlateColor=${val.vehiclePlateColor}`, | url: `/subpackage/orders/opening-account-people?orderId=${val.orderId}&&vehiclePlateColor=${val.vehiclePlateColor}`, | ||||
}); | }); | ||||
uni.redirectTo({ | uni.redirectTo({ | ||||
url: `/subpackage/orders/product-detail?orderId=${val.orderId}&&clientFee=${val.product.clientFee}&&id=${val.productId}`, | url: `/subpackage/orders/product-detail?orderId=${val.orderId}&&clientFee=${val.product.clientFee}&&id=${val.productId}`, | ||||
}); | }); | ||||
} else if (val.orderStep === 26 || val.orderStep === 27) { | |||||
} else if (val.orderStep === 26) { | |||||
uni.redirectTo({ | uni.redirectTo({ | ||||
url: `/subpackage/orders/product-detail?orderId=${val.orderId}&&clientFee=${val.product.clientFee}&&id=${val.productId}`, | url: `/subpackage/orders/product-detail?orderId=${val.orderId}&&clientFee=${val.product.clientFee}&&id=${val.productId}`, | ||||
}); | }); |
<!-- 订单-评价 --> | <!-- 订单-评价 --> | ||||
<template> | <template> | ||||
<!-- 1,4 --> | |||||
<!-- 1,4 --> | |||||
<!-- 产品 --> | <!-- 产品 --> | ||||
<view class="card" style="padding: 40rpx 30rpx;"> | <view class="card" style="padding: 40rpx 30rpx;"> | ||||
<view class="title">{{state.orderInfo.productName}}</view> | <view class="title">{{state.orderInfo.productName}}</view> | ||||
style="height: 260rpx;" placeholder="从多角度评价,可以帮助我们提升服务质量。"> | style="height: 260rpx;" placeholder="从多角度评价,可以帮助我们提升服务质量。"> | ||||
</textarea> | </textarea> | ||||
<view class="upload-img"> | <view class="upload-img"> | ||||
<form-image @backImg="backImg($event)" @removeImg="removeImg" :isUrl="false" style="width: 100%;" :retract="-15"></form-image> | |||||
<form-image @backImg="backImg($event)" @removeImg="removeImg" :isUrl="false" style="width: 100%;" | |||||
:retract="-15"></form-image> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<!-- 权益产品评价 --> | |||||
<!-- 权益产品评价 --> | |||||
<view class="card" v-if='state.haveInterestsProduct' style="padding: 40rpx 30rpx;"> | <view class="card" v-if='state.haveInterestsProduct' style="padding: 40rpx 30rpx;"> | ||||
<view class="title">权益产品评价</view> | <view class="title">权益产品评价</view> | ||||
<evaluate-star v-model="state.interest.score" title="评价得分"></evaluate-star> | <evaluate-star v-model="state.interest.score" title="评价得分"></evaluate-star> | ||||
style="height: 260rpx;" placeholder="从多角度评价,可以帮助我们提升服务质量。"> | style="height: 260rpx;" placeholder="从多角度评价,可以帮助我们提升服务质量。"> | ||||
</textarea> | </textarea> | ||||
<view class="upload-img"> | <view class="upload-img"> | ||||
<form-image @backImg="backImgInterest($event)" @removeImg="removeImgInterest" :isUrl="false" style="width: 100%;" :retract="-15"></form-image> | |||||
<form-image @backImg="backImgInterest($event)" @removeImg="removeImgInterest" :isUrl="false" | |||||
style="width: 100%;" :retract="-15"></form-image> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="uni-list" style='font-size:32rpx'> | |||||
<view class="uni-list" style='font-size:32rpx'> | |||||
<view class="uni-list-cell uni-list-cell-pd"> | <view class="uni-list-cell uni-list-cell-pd"> | ||||
<view class="uni-list-cell-db">是否匿名</view> | <view class="uni-list-cell-db">是否匿名</view> | ||||
<switch checked style="transform:scale(0.7)" @change="switchChange"/> | |||||
<switch checked style="transform:scale(0.7)" @change="switchChange" /> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="btn"> | <view class="btn"> | ||||
<!-- 选择标签弹窗 --> | <!-- 选择标签弹窗 --> | ||||
<u-popup v-model="state.showTagPop" mode="bottom" height="60%"> | <u-popup v-model="state.showTagPop" mode="bottom" height="60%"> | ||||
<view v-if="state.showTagPop"> | <view v-if="state.showTagPop"> | ||||
<tag-popup :selTags="state.user.tagList" :tagAllList="state.tagAllList" @cancel="state.showTagPop = !state.showTagPop" @confirm="confirmSelectTag"></tag-popup> | |||||
<tag-popup :selTags="state.user.tagList" :tagAllList="state.tagAllList" | |||||
@cancel="state.showTagPop = !state.showTagPop" @confirm="confirmSelectTag"></tag-popup> | |||||
</view> | </view> | ||||
</u-popup> | </u-popup> | ||||
</template> | </template> | ||||
<script setup lang="ts"> | <script setup lang="ts"> | ||||
import evaluateStar from "./components/evaluate-star.vue" | import evaluateStar from "./components/evaluate-star.vue" | ||||
import {reactive} from "vue"; | |||||
import {confirm, isBlank, msg} from "@/utils/utils"; | |||||
import { reactive } from "vue"; | |||||
import { confirm, isBlank, msg } from "@/utils/utils"; | |||||
import tagPopup from "./components/popup-order-evaluate-tag"; | import tagPopup from "./components/popup-order-evaluate-tag"; | ||||
import { request } from "@/utils/network/request"; | import { request } from "@/utils/network/request"; | ||||
import { orderDetail, orderEvaluate,orderEvaluateTag,saleMessage,addEvaluation,judageQuanProduct } from "@/utils/network/api"; | |||||
import {onLoad} from "@dcloudio/uni-app"; | |||||
import { orderDetail, orderEvaluate, orderEvaluateTag, saleMessage, addEvaluation, judageQuanProduct } from "@/utils/network/api"; | |||||
import { onLoad } from "@dcloudio/uni-app"; | |||||
import { stringToJson } from "@/utils/network/encryption"; | import { stringToJson } from "@/utils/network/encryption"; | ||||
import { getItem, StorageKeys } from "@/utils/storage"; | import { getItem, StorageKeys } from "@/utils/storage"; | ||||
const state = reactive({ | const state = reactive({ | ||||
orderInfo:{} as any, //订单信息 | |||||
orderInfo: {} as any, //订单信息 | |||||
showTagPop: false, //显示标签选择弹窗 | showTagPop: false, //显示标签选择弹窗 | ||||
product: { //产品 | product: { //产品 | ||||
score: 0, //星级得分 最高5分,0.5小数点 2.5分及以下为差评 2.5以上4.0以下为中评 4.0及4.0以上为好评(必选) | score: 0, //星级得分 最高5分,0.5小数点 2.5分及以下为差评 2.5以上4.0以下为中评 4.0及4.0以上为好评(必选) | ||||
content: '', //评价内容 | content: '', //评价内容 | ||||
tagList: [], //已选择的评价标签列表 | tagList: [], //已选择的评价标签列表 | ||||
}, | }, | ||||
tagAllList:[], | |||||
orderId:"", | |||||
haveInterestsProduct:false, //是否有权益产品 | |||||
isAnonymity:1, //是否匿名 | |||||
tagAllList: [], | |||||
orderId: "", | |||||
haveInterestsProduct: false, //是否有权益产品 | |||||
isAnonymity: 1, //是否匿名 | |||||
}) | }) | ||||
/* 确认选择tag */ | /* 确认选择tag */ | ||||
} | } | ||||
//选择图片 | //选择图片 | ||||
const backImg = (e: any) => { | |||||
const backImg = (e : any) => { | |||||
state.product.imageList = e; | state.product.imageList = e; | ||||
} | } | ||||
//删除图片 | //删除图片 | ||||
const removeImg = (imgList) => { | const removeImg = (imgList) => { | ||||
state.product.imageList = imgList | state.product.imageList = imgList | ||||
} | } | ||||
//选择图片权益产品 | |||||
const backImgInterest = (e: any) => { | |||||
//选择图片权益产品 | |||||
const backImgInterest = (e : any) => { | |||||
state.interest.imageList = e; | state.interest.imageList = e; | ||||
} | } | ||||
//删除图片 | //删除图片 | ||||
const removeImgInterest = (imgList) => { | const removeImgInterest = (imgList) => { | ||||
state.interest.imageList = imgList | state.interest.imageList = imgList | ||||
} | } | ||||
/* 删除评价标签 */ | /* 删除评价标签 */ | ||||
const removeTag = (item: any) => { | |||||
const removeTag = (item : any) => { | |||||
state.user.tagList.map((tag, index) => { | state.user.tagList.map((tag, index) => { | ||||
if (tag.id === item.id) { | if (tag.id === item.id) { | ||||
state.user.tagList.splice(index, 1) | state.user.tagList.splice(index, 1) | ||||
const publish = (e) => { | const publish = (e) => { | ||||
addProduct(); | addProduct(); | ||||
} | } | ||||
const addProduct=()=>{ | |||||
const addProduct = () => { | |||||
if (state.product.score === 0) { | if (state.product.score === 0) { | ||||
msg('请对产品进行打分!'); | msg('请对产品进行打分!'); | ||||
return; | return; | ||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
data: { | data: { | ||||
"orderId":state.orderId, | |||||
"serviceType":"product", | |||||
"score":state.product.score, | |||||
"pictureUrl":state.product.imageList.join(";"), | |||||
"message":'', | |||||
"suggestion":state.product.content, | |||||
"isAnonymity":state.isAnonymity | |||||
"orderId": state.orderId, | |||||
"serviceType": "product", | |||||
"score": state.product.score, | |||||
"pictureUrl": state.product.imageList.join(";"), | |||||
"message": '', | |||||
"suggestion": state.product.content, | |||||
"isAnonymity": state.isAnonymity | |||||
}, | }, | ||||
method: 'POST', | |||||
showLoading: true, | |||||
method: 'POST', | |||||
showLoading: true, | |||||
} | } | ||||
console.log("options",options) | |||||
request(addEvaluation,options).then((res)=>{ | |||||
if(state.haveInterestsProduct){ | |||||
console.log("options", options) | |||||
request(addEvaluation, options).then((res) => { | |||||
if (state.haveInterestsProduct) { | |||||
addProductInterest(); | addProductInterest(); | ||||
}else{ | |||||
confirm('您的评价已发布成功!',()=>{ | |||||
} else { | |||||
confirm('您的评价已发布成功!', () => { | |||||
uni.$emit('refreshOrder'); | uni.$emit('refreshOrder'); | ||||
uni.navigateBack(); | uni.navigateBack(); | ||||
},'发布成功',false); | |||||
}, '发布成功', false); | |||||
} | } | ||||
}) | }) | ||||
} | } | ||||
const addProductInterest=()=>{ | |||||
const addProductInterest = () => { | |||||
if (state.interest.score === 0) { | if (state.interest.score === 0) { | ||||
msg('请对权益产品进行打分!'); | msg('请对权益产品进行打分!'); | ||||
return; | return; | ||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
data: { | data: { | ||||
"orderId":state.orderId, | |||||
"serviceType":"equity", | |||||
"score":state.interest.score, | |||||
"pictureUrl":state.interest.imageList.join(";"), | |||||
"message":'', | |||||
"suggestion":state.interest.content, | |||||
"isAnonymity":state.isAnonymity | |||||
"orderId": state.orderId, | |||||
"serviceType": "equity", | |||||
"equityId": state.orderInfo.equityId,//权益产品id | |||||
"score": state.interest.score, | |||||
"pictureUrl": state.interest.imageList.join(";"), | |||||
"message": '', | |||||
"suggestion": state.interest.content, | |||||
"isAnonymity": state.isAnonymity | |||||
}, | }, | ||||
method: 'POST', | |||||
showLoading: true, | |||||
method: 'POST', | |||||
showLoading: true, | |||||
} | } | ||||
console.log("options",options) | |||||
request(addEvaluation,options).then((res)=>{ | |||||
confirm('您的评价已发布成功!',()=>{ | |||||
console.log("options", options) | |||||
request(addEvaluation, options).then((res) => { | |||||
confirm('您的评价已发布成功!', () => { | |||||
uni.$emit('refreshOrder'); | uni.$emit('refreshOrder'); | ||||
uni.navigateBack(); | uni.navigateBack(); | ||||
},'发布成功',false); | |||||
}, '发布成功', false); | |||||
}) | }) | ||||
} | } | ||||
/* 获取业务员标签ID */ | /* 获取业务员标签ID */ | ||||
const getTagIds = () => { | const getTagIds = () => { | ||||
const list = []; | const list = []; | ||||
state.user.tagList.map((tag)=>{ | |||||
state.user.tagList.map((tag) => { | |||||
list.push(tag.id); | list.push(tag.id); | ||||
}); | }); | ||||
return list; | return list; | ||||
} | } | ||||
// 获取是否有权益产品 | |||||
const isInterestsProduct=(orderId)=>{ | |||||
// 获取是否有权益产品 | |||||
const isInterestsProduct = (orderId) => { | |||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
data: {"orderId": orderId}, | |||||
data: { "orderId": orderId }, | |||||
method: 'POST', | method: 'POST', | ||||
showLoading: true, | showLoading: true, | ||||
} | } | ||||
request(judageQuanProduct, options).then((res) => { | request(judageQuanProduct, options).then((res) => { | ||||
console.log("获取是否有业务员",stringToJson(res.bizContent)) | |||||
console.log("获取是否有业务员", stringToJson(res.bizContent)) | |||||
state.haveInterestsProduct = stringToJson(res.bizContent); | state.haveInterestsProduct = stringToJson(res.bizContent); | ||||
}) | }) | ||||
} | } | ||||
const getOrderDetails = (id) => { | const getOrderDetails = (id) => { | ||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
data: {"id": id}, | |||||
data: { "id": id }, | |||||
method: 'POST', | method: 'POST', | ||||
showLoading: true, | showLoading: true, | ||||
} | } | ||||
request(orderDetail, options).then((res) => { | request(orderDetail, options).then((res) => { | ||||
console.log("获取订单详情",stringToJson(res.bizContent)) | |||||
state.orderInfo = stringToJson(res.bizContent); | state.orderInfo = stringToJson(res.bizContent); | ||||
console.log("获取订单详情", stringToJson(res.bizContent), state.orderInfo.equityId) | |||||
}) | }) | ||||
} | } | ||||
// 是否匿名 | // 是否匿名 | ||||
const switchChange=(e)=>{ | |||||
const switchChange = (e) => { | |||||
console.log('switch1 发生 change 事件,携带值为', e.detail.value); | console.log('switch1 发生 change 事件,携带值为', e.detail.value); | ||||
if(e.detail.value){ | |||||
state.isAnonymity=1 | |||||
}else{ | |||||
state.isAnonymity=0 | |||||
if (e.detail.value) { | |||||
state.isAnonymity = 1 | |||||
} else { | |||||
state.isAnonymity = 0 | |||||
} | } | ||||
} | } | ||||
onLoad((option) => { | onLoad((option) => { | ||||
console.log("option11111", option) | |||||
getOrderDetails(option.id); | getOrderDetails(option.id); | ||||
state.orderId=option.orderId | |||||
state.orderId = option.orderId | |||||
isInterestsProduct(option.orderId); //获取是否有权益产品 | isInterestsProduct(option.orderId); //获取是否有权益产品 | ||||
}) | }) | ||||
</script> | </script> | ||||
margin-top: 40rpx; | margin-top: 40rpx; | ||||
padding-bottom: 20rpx; | padding-bottom: 20rpx; | ||||
border-bottom: 1rpx solid #DCDCDC; | border-bottom: 1rpx solid #DCDCDC; | ||||
.tags { | .tags { | ||||
flex-wrap: wrap; | flex-wrap: wrap; | ||||
.btn { | .btn { | ||||
margin: 60rpx 40rpx 0rpx; | margin: 60rpx 40rpx 0rpx; | ||||
} | } | ||||
.uni-list-cell{ | |||||
.uni-list-cell { | |||||
display: flex; | display: flex; | ||||
margin: 10rpx auto; | margin: 10rpx auto; | ||||
width: 90%; | width: 90%; | ||||
justify-content: space-between; | justify-content: space-between; | ||||
align-items: center; | align-items: center; | ||||
} | } | ||||
</style> | |||||
</style> |
<view class="title"> 运费 </view> | <view class="title"> 运费 </view> | ||||
<view class="value"> ¥0.00 </view> | <view class="value"> ¥0.00 </view> | ||||
</view> | </view> | ||||
<view class="flex"> | |||||
<!-- <view class="flex"> | |||||
<view class="title"> 优惠券 </view> | <view class="title"> 优惠券 </view> | ||||
<view class="value"> 暂无优惠券 </view> | <view class="value"> 暂无优惠券 </view> | ||||
</view> | </view> | ||||
<view class="flex"> | <view class="flex"> | ||||
<view class="title"> 积分兑换 </view> | <view class="title"> 积分兑换 </view> | ||||
<view class="value"> 暂无积分 </view> | <view class="value"> 暂无积分 </view> | ||||
</view> | |||||
</view> --> | |||||
<view class="flex"> | <view class="flex"> | ||||
<view class="title"> 实付款 </view> | <view class="title"> 实付款 </view> | ||||
<view class="money"> | <view class="money"> | ||||
state.orderId = option.orderId; | state.orderId = option.orderId; | ||||
state.isValueCard = option.isValueCard; | state.isValueCard = option.isValueCard; | ||||
console.log("传递过来的参数", option) | console.log("传递过来的参数", option) | ||||
console.log("查协议", envs[process.env.NODE_ENV].baseUrl) | |||||
// state.clientFee = option.clientFee / 100; | // state.clientFee = option.clientFee / 100; | ||||
state.id = option.id; | state.id = option.id; | ||||
getOpenID(); | getOpenID(); | ||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
data: { | data: { | ||||
// orderId: state.orderId, //订单编号 | |||||
orderId: "20231016180507480853307", //订单编号 | |||||
orderId: state.orderId, //订单编号 | |||||
}, | }, | ||||
method: "POST", | method: "POST", | ||||
showLoading: true, | showLoading: true, | ||||
request(getAgreementApi, options).then((res) => { | request(getAgreementApi, options).then((res) => { | ||||
let data = stringToJson(res.bizContent); | let data = stringToJson(res.bizContent); | ||||
state.agreeURL = envs[process.env.NODE_ENV].baseUrl + data.supAgree | state.agreeURL = envs[process.env.NODE_ENV].baseUrl + data.supAgree | ||||
console.log("查协议", data) | |||||
console.log("查协议", envs[process.env.NODE_ENV].baseUrl) | |||||
}); | }); | ||||
} | } | ||||
const checkboxChange = (e) => { | const checkboxChange = (e) => { |
// #ifdef MP-WEIXIN | // #ifdef MP-WEIXIN | ||||
request(getOpenidApi, options).then((res) => { | request(getOpenidApi, options).then((res) => { | ||||
const result = stringToJson(res.bizContent); | const result = stringToJson(res.bizContent); | ||||
console.log("获取微信小程序openid", result); | |||||
const openidData = stringToJson(result.data); | const openidData = stringToJson(result.data); | ||||
state.openid = openidData.openid; | state.openid = openidData.openid; | ||||
console.log("获取微信小程序openid", state.openid); | |||||
setItem("QYorder", state); | setItem("QYorder", state); | ||||
}); | }); | ||||
// #endif | // #endif | ||||
if (state.openid) { | if (state.openid) { | ||||
var data = { | var data = { | ||||
// orderId: state.orderId, | // orderId: state.orderId, | ||||
orderId: "20231012114651162505354", | |||||
// orderId: "20231121174825916656609", | |||||
subOpenId: state.openid, | |||||
// subOpenId: state.openid, | |||||
orderId: "20231213200339195365136", | |||||
subOpenId: "o_Ucm45wcKKt1W2Ah0OSVco81G_4", | |||||
}; | }; | ||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
plate_number: data.plateNumber, | plate_number: data.plateNumber, | ||||
sub_openid: data.subOpenId, | sub_openid: data.subOpenId, | ||||
sign: data.sign, | sign: data.sign, | ||||
channel_type: "ETC" | |||||
}, | }, | ||||
// extraData: { | |||||
// appid: "wxe5572b2938f35c09", | |||||
// channel_type: "ETC", //没有 | |||||
// mch_id: "1641444218", | |||||
// nonce_str: "e9eb7a02533947389f8f4e7cb9394fb5", | |||||
// plate_number: "贵ZBYD09", | |||||
// sign: "B926E47DF8DE6B5FE53FF7AC3CCB5FA7C5CDB3459A4C1AFC0CDC8B143EC68DDA", | |||||
// sign_type: "HMAC-SHA256", | |||||
// sub_appid: "wx008c60533388527a", | |||||
// sub_mch_id: "1648725759", | |||||
// sub_openid: "oHQtp5C8821AImJa1ibf6rZ6xc60", | |||||
// trade_scene: "HIGHWAY" | |||||
// }, | |||||
success(res) { | success(res) { | ||||
console.log(res); | console.log(res); | ||||
}, | }, |
</view> | </view> | ||||
<view class="phone"> | <view class="phone"> | ||||
{{ item.consigneeTel }} | {{ item.consigneeTel }} | ||||
<text class="default" v-if="item.defaultAddress==1">默认</text> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="address"> | <view class="address"> | ||||
}); | }); | ||||
}; | }; | ||||
const addressSelected = (val: any) => { | |||||
const addressSelected = (val : any) => { | |||||
if (state.fromOrder) { | if (state.fromOrder) { | ||||
//来自订单-直接返回选中数据 | //来自订单-直接返回选中数据 | ||||
uni.$emit("selectAddressSuccess", val); | uni.$emit("selectAddressSuccess", val); | ||||
}); | }); | ||||
}); | }); | ||||
onLoad((option: any) => { | |||||
onLoad((option : any) => { | |||||
state.fromOrder = option.fromOrder; | state.fromOrder = option.fromOrder; | ||||
}); | }); | ||||
</script> | </script> | ||||
line-height: 80rpx; | line-height: 80rpx; | ||||
} | } | ||||
} | } | ||||
</style> | |||||
.default { | |||||
border: 1rpx solid #00b38b; | |||||
border-radius: 5rpx; | |||||
padding: 2rpx 4rpx; | |||||
color: #00b38b; | |||||
margin-left: 4rpx; | |||||
} | |||||
</style> |
<u-input v-model="state.form.begindate" type="select" /> | <u-input v-model="state.form.begindate" type="select" /> | ||||
</u-form-item> --> | </u-form-item> --> | ||||
<u-form-item label="手机号" class="phoneBox"> | <u-form-item label="手机号" class="phoneBox"> | ||||
<u-input placeholder='手机号' type="number" v-model="state.form.tel" /> | |||||
<u-input placeholder='手机号' type="number" v-model="state.form.tel" maxlength="11" /> | |||||
<u-button type="success" size="mini" @click="getCode" v-if="waitTime==0">获取验证码</u-button> | <u-button type="success" size="mini" @click="getCode" v-if="waitTime==0">获取验证码</u-button> | ||||
<text class="btn" v-else>{{waitTime}}后重试</text> | <text class="btn" v-else>{{waitTime}}后重试</text> | ||||
</u-form-item> | </u-form-item> | ||||
<u-form-item label="验证码"> | <u-form-item label="验证码"> | ||||
<u-input placeholder='如果修改手机号请输入验证码' type="number" v-model="state.form.newMobileCode" /> | |||||
<u-input placeholder='请输入验证码' type="number" v-model="state.form.newMobileCode" /> | |||||
</u-form-item> | </u-form-item> | ||||
</u-form> | </u-form> | ||||
</view> | </view> | ||||
// }); | // }); | ||||
const state = reactive({ | const state = reactive({ | ||||
genderList: [{ | genderList: [{ | ||||
value: '男', | |||||
label: '男' | |||||
}, | |||||
{ | |||||
value: '女', | |||||
label: '女' | |||||
} | |||||
value: '男', | |||||
label: '男' | |||||
}, | |||||
{ | |||||
value: '女', | |||||
label: '女' | |||||
} | |||||
], | ], | ||||
codeTips: "获取验证码", | codeTips: "获取验证码", | ||||
form: { | form: { | ||||
// agentIdVld: '', | // agentIdVld: '', | ||||
} | } | ||||
}) | }) | ||||
const strReplace = (str : string) => { | |||||
const strReplace = (str : string) => { | |||||
let imgUrl = str.replace("http://192.168.101.145:9000", envs[process.env.NODE_ENV].baseUrl); | let imgUrl = str.replace("http://192.168.101.145:9000", envs[process.env.NODE_ENV].baseUrl); | ||||
imgUrl = imgUrl.replace("http://100.64.2.113:9000", envs[process.env.NODE_ENV].baseUrl); | imgUrl = imgUrl.replace("http://100.64.2.113:9000", envs[process.env.NODE_ENV].baseUrl); | ||||
return imgUrl; | return imgUrl; | ||||
const getCode = () => { | const getCode = () => { | ||||
console.log(123); | console.log(123); | ||||
if (state.form.tel) { | |||||
if (checkStr(state.form.tel, "mobile")) { | |||||
sendCodeApi() | sendCodeApi() | ||||
codeInterval() | codeInterval() | ||||
} else { | } else { | ||||
uni.showToast({ | uni.showToast({ | ||||
title: '请输入手机号', | |||||
title: '请输入正确的手机号', | |||||
icon: 'none' | icon: 'none' | ||||
}); | }); | ||||
} | } | ||||
//选择图片 | //选择图片 | ||||
//orc接口调用 | //orc接口调用 | ||||
const cardImageOcr = (val: any) => { | |||||
const cardImageOcr = (val : any) => { | |||||
console.log("点击了"); | console.log("点击了"); | ||||
var imageType = val; | var imageType = val; | ||||
uni.chooseImage({ | uni.chooseImage({ | ||||
count: 1, //只能选取一张照片 | count: 1, //只能选取一张照片 | ||||
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 | sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 | ||||
sourceType: ["camera", "album"], //从相册选择 | sourceType: ["camera", "album"], //从相册选择 | ||||
success: function(res) { | |||||
success: function (res) { | |||||
pathToBase64(res.tempFilePaths[0]) | pathToBase64(res.tempFilePaths[0]) | ||||
.then((path) => { | .then((path) => { | ||||
console.log(path); | console.log(path); | ||||
} | } | ||||
}); | }); | ||||
}) | }) | ||||
.catch((error) => {}); | |||||
.catch((error) => { }); | |||||
}, | }, | ||||
}); | }); | ||||
}; | }; | ||||
//下一步 | //下一步 | ||||
const savaHandle = () => { | const savaHandle = () => { | ||||
console.log(state.form); | console.log(state.form); | ||||
if (!state.form.userPosImgUrl) { | |||||
msg("请上传身份证正面") | |||||
return; | |||||
} | |||||
if (!state.form.userNegImgUrl) { | |||||
msg("请上传身份证反面") | |||||
return; | |||||
} | |||||
if (!state.form.customerName) { | |||||
msg("请输入姓名") | |||||
return; | |||||
} | |||||
if (!state.form.address) { | |||||
msg("请输入地址") | |||||
return; | |||||
} | |||||
if (!checkStr(state.form.tel, "mobile")) { | |||||
msg("请输入正确的手机号") | |||||
return; | |||||
} | |||||
if (!state.form.newMobileCode) { | |||||
msg("请输入验证码") | |||||
return; | |||||
} | |||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
data: state.form, | data: state.form, | ||||
uni.navigateBack({ | uni.navigateBack({ | ||||
delta: 1 | delta: 1 | ||||
}); | }); | ||||
}); | }); | ||||
} | } | ||||
} | } | ||||
</style> | </style> | ||||
<style lang="scss" scoped> | <style lang="scss" scoped> | ||||
::v-deep .u-size-mini{ | |||||
::v-deep .u-size-mini { | |||||
white-space: nowrap; | white-space: nowrap; | ||||
} | } | ||||
.main { | .main { | ||||
// overflow: hidden; | // overflow: hidden; | ||||
background: #fff; | background: #fff; | ||||
padding: 40rpx 30rpx; | padding: 40rpx 30rpx; | ||||
border-radius: 20rpx; | border-radius: 20rpx; | ||||
box-shadow: 0 4rpx 13rpx 3rpx rgba(223,223,223,.8); | |||||
box-shadow: 0 4rpx 13rpx 3rpx rgba(223, 223, 223, .8); | |||||
.title { | .title { | ||||
font-size: 30rpx; | font-size: 30rpx; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
</style> | |||||
</style> |
export const aliPayConfigIdTwo = "6a9a54bc01f644312543761234"; | export const aliPayConfigIdTwo = "6a9a54bc01f644312543761234"; | ||||
export const wechatAppID = "wx8fba957179c1329a"; //九州小程序APPid:wx008c60533388527a | export const wechatAppID = "wx8fba957179c1329a"; //九州小程序APPid:wx008c60533388527a | ||||
export const wechatSecret = "699c10826113ddb350fbe58a96e2b015"; //九州小程序AppSecret:95197718b43b497f02732bd9f8011080 | export const wechatSecret = "699c10826113ddb350fbe58a96e2b015"; //九州小程序AppSecret:95197718b43b497f02732bd9f8011080 | ||||
export const sm4Key = | |||||
"5dc11f854ceca1473e1a5075ed16eb226b4543a9a05fe50f7fba40f898099ce34abba69a07a20509f315f94d808a4d0e988935588858f65a"; | |||||
// export const sm4Key = "5dc11f854ceca147"; | |||||
// export const sm4Key = | |||||
// "5dc11f854ceca1473e1a5075ed16eb226b4543a9a05fe50f7fba40f898099ce34abba69a07a20509f315f94d808a4d0e988935588858f65a"; | |||||
export const sm4Key = "5dc11f854ceca147"; | |||||
//字典 | //字典 |
*json字符串转换成json对象 | *json字符串转换成json对象 | ||||
*/ | */ | ||||
export function stringToJson(data) { | export function stringToJson(data) { | ||||
let index = data.lastIndexOf("}") | |||||
let content = data.substring(0, index + 1); | |||||
return JSON.parse(content); | |||||
// let index = data.lastIndexOf("}") | |||||
// let content = data.substring(0, index + 1); | |||||
// console.log("content111111", content) | |||||
return JSON.parse(data); | |||||
} | } | ||||
//array转json对象 | //array转json对象 | ||||
//调用中台参数 | //调用中台参数 | ||||
export function encryption(ifCode, subdata, type) { | export function encryption(ifCode, subdata, type) { | ||||
var requestData = new Array(); | var requestData = new Array(); | ||||
// const key = 'WVdSdGFXNHdNREZmTWpBeU16QTRNRE09' | |||||
const key = 'TlRJd016QXhNekZmTWpBeU16QTRNekU9' | |||||
const key = 'WVdSdGFXNHdNREZmTWpBeU16QTRNRE09' | |||||
// const key = 'TlRJd016QXhNekZmTWpBeU16QTRNekU9' | |||||
requestData["ifCode"] = ifCode; | requestData["ifCode"] = ifCode; | ||||
requestData["appId"] = "52030131"; // || "admin001" | |||||
// requestData["appId"] = "admin001"; // || "admin001" | |||||
// requestData["appId"] = "52030131"; // || "admin001" | |||||
requestData["appId"] = "admin001"; // || "admin001" | |||||
requestData["signType"] = "SM3"; // || "NONE" | requestData["signType"] = "SM3"; // || "NONE" | ||||
requestData["encryptType"] = "SM4"; | |||||
// requestData["encryptType"] = "NONE"; | |||||
// requestData["encryptType"] = "SM4"; | |||||
requestData["encryptType"] = "NONE"; | |||||
requestData["reqId"] = requestData["appId"] + "_" + getDate() + "_" + generateMixed(5); | requestData["reqId"] = requestData["appId"] + "_" + getDate() + "_" + generateMixed(5); | ||||
requestData["timestamp"] = formatTime(new Date()); | requestData["timestamp"] = formatTime(new Date()); | ||||
requestData["bizContent"] = s4.encryptData_CBC(subdata, sm4Key) | |||||
// requestData["bizContent"] = JSON.stringify(subdata) | |||||
// requestData["bizContent"] = s4.encryptData_CBC(subdata, sm4Key) | |||||
requestData["bizContent"] = JSON.stringify(subdata) | |||||
requestData["accessToken"] = getItem(StorageKeys.Token) | requestData["accessToken"] = getItem(StorageKeys.Token) | ||||
requestData["sign"] = sm3( | requestData["sign"] = sm3( | ||||
"appId=" + requestData["appId"] + | "appId=" + requestData["appId"] + |
//请求 | //请求 | ||||
export function request(code, options = {}, start = false) { | export function request(code, options = {}, start = false) { | ||||
// console.log("11111", s4.decryptData_CBC( | |||||
// "bbc41fb5d44e797b1d7d1f3b666bea5d3d0ef0fb6f9564f0159d77eb4f69180ecec404d0ebbe3618249be4be775ae8bde73277c244154755bbf0fccea3c700a8e72e740154a3b57e65857940f5b39b9f7c8a8c8a52f6b3da134863aef333fbbebf145a5d7a7aca47f854bf075188954f14a02e1a71989cf01f6d9da860a0adb200584bdfe26b89429966953e2bd1b524623bb442576a4587cf8ad704eea13a7d26374d3f4144bafcaeb23463597eb0b430de26e170628f762da60fc658fcb9fb7f55322e8318fb9ea0da38ddadecb73ef212f2604eedebfd46bfd5053b5d2a60840340eaec1be389c06dce0d29c89655145e053684eb57d5e4447425197585251cf73fcaa82bc94bda3a84e36e169045e59bc900890eb360b9b37b25416e3a1a2c84d5b2fc6cd760135eb69c4d814dfd93cba9be9d9a3cd6835265aa7832c38da53e86e32b26161a2a059ec1bb19897300bb89283e7974c01ee3353f848120fa546284312976da4acfe21cce797a4c704aaedcfee2f1edf318dafadce822fa9b74f91c13dca3256e0a9a986a5e3ffe5d755ca622dea8631119c83b509965bf94034244250d1032f3ba8159ab51595d7769a208eee6a549d711dee82911ffb80284dd736672f68100a6dece1e9f9e55e523d188c67e55d1f6a8c9ac279381f95bbc90adadf1758f44bf16483e86024abe", | |||||
// sm4Key)) | |||||
//公参 | //公参 | ||||
const Common = { | const Common = { | ||||
agentId: "52010106004", | agentId: "52010106004", | ||||
content: res.data.errorMsg, | content: res.data.errorMsg, | ||||
success: function(res) { | success: function(res) { | ||||
if (res.confirm) { | if (res.confirm) { | ||||
console.log('用户点击确定'); | |||||
console.log('用户点击确定1'); | |||||
} else if (res.cancel) { | } else if (res.cancel) { | ||||
console.log('用户点击取消'); | |||||
console.log('用户点击取消1'); | |||||
} | } | ||||
} | } | ||||
}); | }); | ||||
content: res.data.errorMsg, | content: res.data.errorMsg, | ||||
success: function(res) { | success: function(res) { | ||||
if (res.confirm) { | if (res.confirm) { | ||||
console.log('用户点击确定'); | |||||
console.log('用户点击确定2'); | |||||
} else if (res.cancel) { | } else if (res.cancel) { | ||||
console.log('用户点击取消'); | |||||
console.log('用户点击取消2'); | |||||
} | } | ||||
} | } | ||||
}); | }); | ||||
reject(res.data.errorMsg) | reject(res.data.errorMsg) | ||||
return | return | ||||
} else { | } else { | ||||
// let content = res | |||||
let content = s4.decryptData_CBC(res, sm4Key) | |||||
// let content = s4.decryptData_CBC(res, sm4Key) | |||||
let content = res | |||||
// console.log(content); | // console.log(content); | ||||
// content.data.bizContent = JSON.stringify(content.data.bizContent) | // content.data.bizContent = JSON.stringify(content.data.bizContent) | ||||
resolve(content.data) | resolve(content.data) |
sm4.encryptData_CBC(''); | sm4.encryptData_CBC(''); | ||||
*/ | */ | ||||
import * as base64js from 'base64-js' | import * as base64js from 'base64-js' | ||||
console.log('base64js:',base64js) | |||||
console.log('base64js:', base64js) | |||||
/** | /** | ||||
* 国密SM4加密算法 | * 国密SM4加密算法 | ||||
sm4.sm4_setkey_dec(ctx, keyBytes) | sm4.sm4_setkey_dec(ctx, keyBytes) | ||||
let decrypted = sm4.sm4_crypt_cbc(ctx, ivBytes, base64js.toByteArray(cipherText.data.bizContent)) | let decrypted = sm4.sm4_crypt_cbc(ctx, ivBytes, base64js.toByteArray(cipherText.data.bizContent)) | ||||
let bizContent = utf8ByteToUnicodeStr(decrypted) | let bizContent = utf8ByteToUnicodeStr(decrypted) | ||||
// let begin = bizContent.indexOf('{'); | |||||
// let end = bizContent.lastIndexOf('}'); | |||||
// cipherText.data.bizContent = bizContent.substring(begin,end+1) | |||||
cipherText.data.bizContent = bizContent; | |||||
let begin = bizContent.indexOf('{'); | |||||
let end = bizContent.lastIndexOf('}'); | |||||
cipherText.data.bizContent = bizContent.substring(begin, end + 1) | |||||
// cipherText.data.bizContent = bizContent; | |||||
return cipherText | return cipherText | ||||
} catch (e) { | } catch (e) { | ||||
console.error(e) | console.error(e) |
//根据订单状态获取订单状态文字 | //根据订单状态获取订单状态文字 | ||||
export const getOrderStatusName = (status) => { | export const getOrderStatusName = (status) => { | ||||
console.log(Number(OrderStatus["完成车辆信息上传/待支付"]), status) | |||||
switch (Number(status)) { | switch (Number(status)) { | ||||
case Number(OrderStatus.完成填写基本信息): | case Number(OrderStatus.完成填写基本信息): | ||||
return '申请中'; | return '申请中'; | ||||
return '待支付'; | return '待支付'; | ||||
break; | break; | ||||
case Number(OrderStatus.待支付3): | case Number(OrderStatus.待支付3): | ||||
return '待支付'; | |||||
return '申请中'; | |||||
break; | break; | ||||
case Number(OrderStatus.待支付2): | case Number(OrderStatus.待支付2): | ||||
return '待支付'; | return '待支付'; | ||||
break; | break; | ||||
case Number(OrderStatus.已支付): | |||||
return '已支付'; | |||||
case Number(OrderStatus.完成签约): | |||||
return '完成签约'; | |||||
break; | break; | ||||
case Number(OrderStatus.待审核): | case Number(OrderStatus.待审核): | ||||
return '待审核'; | return '待审核'; | ||||
case Number(OrderStatus.待加购权益): | case Number(OrderStatus.待加购权益): | ||||
return '代加购权益'; | return '代加购权益'; | ||||
break; | break; | ||||
case Number(OrderStatus["完成车辆信息上传/待支付"]): | |||||
return '待支付'; | |||||
break; | |||||
default: | default: | ||||
break; | break; | ||||
} | } |