Browse Source

添加订单详情

yxb
DESKTOP-2IO5MST\huting 1 year ago
parent
commit
686d2f27be

+ 6
- 3
subpackage/orders/interestsList.vue View File

}; };
console.log("optionss", optionss); console.log("optionss", optionss);
request(addProduct, optionss).then((res) => { request(addProduct, optionss).then((res) => {
uni.navigateTo({
url: `/subpackage/orders/order_payment?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}&&data=${items}&&isValueCard=${state.detailsObj.isValueCard}`,
// uni.navigateTo({
// url: `/subpackage/orders/order_payment?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}&&data=${items}&&isValueCard=${state.detailsObj.isValueCard}`,
// });
uni.redirectTo({
url: `/subpackage/orders/product-detail?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}&&data=${items}&&isValueCard=${state.detailsObj.isValueCard}`,
}); });
}); });


}); });
} else if (data.userState === "NORMAL") { } else if (data.userState === "NORMAL") {
msg("已开通车主服务"); msg("已开通车主服务");
uni.navigateTo({ uni.navigateTo({
url: `/subpackage/orders/product-detail?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}&&data=${items}`, url: `/subpackage/orders/product-detail?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}&&data=${items}`,
}); });

+ 15
- 15
subpackage/orders/order_payment.vue View File

CardBillPayStatus, CardBillPayStatus,
wechatPayConfigId, wechatPayConfigId,
aliPayConfigId, aliPayConfigId,
obtainUserId,
obtainUserId,
getOpenidApi, getOpenidApi,
orderDetail orderDetail


import { request } from "@/utils/network/request.js"; import { request } 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-car5";
import navBar from "@/components/nav-bar/nav-bar2.vue"; import navBar from "@/components/nav-bar/nav-bar2.vue";
import { getItem, StorageKeys, setItem } from "@/utils/storage.ts"; import { getItem, StorageKeys, setItem } from "@/utils/storage.ts";
import { msg } from "@/utils/utils"; import { msg } from "@/utils/utils";
// uni.request({ // uni.request({
// url: `https://api.weixin.qq.com/sns/jscode2session?appid=${wechatAppID}&secret=${wechatSecret}&js_code=${e.code}&grant_type=authorization_code`, // url: `https://api.weixin.qq.com/sns/jscode2session?appid=${wechatAppID}&secret=${wechatSecret}&js_code=${e.code}&grant_type=authorization_code`,
// success: (res : any) => { // success: (res : any) => {
const options1 = { const options1 = {
type: 2, type: 2,
data: { data: {
request(getOpenidApi, options1).then((res) => { request(getOpenidApi, options1).then((res) => {
const result = stringToJson(res.bizContent); const result = stringToJson(res.bizContent);
const openidData = stringToJson(result.data); const openidData = stringToJson(result.data);
console.log("获取openId",openidData)
console.log("获取openId", openidData)
const options = { const options = {
type: 2, type: 2,
data: { data: {
}); });
}; };
const gotoEditUserOrUnitInfo = () => { const gotoEditUserOrUnitInfo = () => {
if (state.isValueCard != 1) {
uni.redirectTo({
url: `/subpackage/orders/release-products?orderId=${state.orderId}`,
});
} else {
uni.switchTab({
url: "/pages/order/order"
})
}
if (state.isValueCard != 1) {
uni.redirectTo({
url: `/subpackage/orders/release-products?orderId=${state.orderId}`,
});
} else {
uni.switchTab({
url: "/pages/order/order"
})
}
} }
const state = reactive({ const state = reactive({
isValueCard: 1, //卡的类型 isValueCard: 1, //卡的类型
radiolist1: [], //选择卡的数据列表 radiolist1: [], //选择卡的数据列表
choiceCardShow: false, //选择卡的弹出框 choiceCardShow: false, //选择卡的弹出框
isSign: '', isSign: '',
id:"",
id: "",
orderId: "", orderId: "",
userType: 1, //1 个人 2单位 userType: 1, //1 个人 2单位
type: 0, //0 客车 1货车 type: 0, //0 客车 1货车

+ 164
- 39
subpackage/orders/product-detail.vue View File

<navBar title="产品详情"></navBar> <navBar title="产品详情"></navBar>
<navBgCar></navBgCar> <navBgCar></navBgCar>
<view class="content-wrap"> <view class="content-wrap">
<view class="ul-item">
<!-- <view class="ul-item">
<image style="width: 100%; height: 170rpx; background-color: #eeeeee" <image style="width: 100%; height: 170rpx; background-color: #eeeeee"
:src="`${$imgUrl}applyCard/product-bg.png`"></image> :src="`${$imgUrl}applyCard/product-bg.png`"></image>
<view class="item-value"> <view class="item-value">
¥:{{state.detailsObj.product.oncePrice * 0.01}} ¥:{{state.detailsObj.product.oncePrice * 0.01}}
</view> </view>
</view> </view>
</view>
<view style="margin: 20rpx 0 10rpx 20rpx;font-size: 32rpx;">加购权益列表</view>
<view class="add_all">
</view> -->
<!-- <view style="margin: 20rpx 0 10rpx 20rpx;font-size: 32rpx;">加购权益列表</view> -->
<!-- <view class="add_all">
<uni-swipe-action> <uni-swipe-action>
<uni-swipe-action-item class="del_item" v-for="(item,index) in state.list" <uni-swipe-action-item class="del_item" v-for="(item,index) in state.list"
:right-options="state.options2" :show="item.isOpened" :auto-close="false" @change="change" :right-options="state.options2" :show="item.isOpened" :auto-close="false" @change="change"
</uni-swipe-action-item> </uni-swipe-action-item>


</uni-swipe-action> </uni-swipe-action>
</view>
</view> -->


<view class="value-wrapper"> <view class="value-wrapper">
<view class="flex">
<view class="flex" v-for="(item,index) in state.dataArray">
<view class="title"> {{item.payName}} </view>
<view class="value">
{{ "¥" + item.fee * 0.01 }}
</view>
</view>
<!-- <view class="flex">
<view class="title"> 产品金额 </view> <view class="title"> 产品金额 </view>
<view class="value"> <view class="value">
{{ "¥" + state.detailsObj.product.oncePrice * 0.01 }} {{ "¥" + state.detailsObj.product.oncePrice * 0.01 }}
</view> </view>
</view>
<view class="flex">
</view> -->
<!-- <view class="flex">
<view class="title"> 加购权益 </view> <view class="title"> 加购权益 </view>
<view class="value">{{ "¥" + state.productMoney }} </view> <view class="value">{{ "¥" + state.productMoney }} </view>
</view>
</view> -->
<view class="flex"> <view class="flex">
<view class="title"> 运费 </view> <view class="title"> 运费 </view>
<view class="value"> ¥0.00 </view> <view class="value"> ¥0.00 </view>
{{ "¥" + state.allMoney }} {{ "¥" + state.allMoney }}
</view> </view>
</view> </view>
<!-- <view class="as-layout-horizontal as-gravity-center">
<checkbox value="cb" />请先阅读并同意

<view class="as-layout-horizontal agreement">
<checkbox-group @change="checkboxChange">
<checkbox :checked="state.checked" style="transform: scale(0.8)" />我已阅读并同意
</checkbox-group>
<a style="color:#007AFF;text-decoration: underline;">《ETC客户协议》</a> <a style="color:#007AFF;text-decoration: underline;">《ETC客户协议》</a>
</view> -->
<a style="color:#007AFF;text-decoration: underline;">《风险提示告知书》</a>
</view>
</view> </view>


<view class="action"> <view class="action">
import { import {
etcQueryProduct, etcQueryProduct,
addProduct, addProduct,
getOpenidApi
getOpenidApi,
getAgreementApi,
PAYDETECTION
} from "@/utils/network/api.js"; } from "@/utils/network/api.js";
import { import {
request request
const savaHandle = () => { const savaHandle = () => {
console.log("state.productId.length", state.productId.length) console.log("state.productId.length", state.productId.length)
//判断是否有加购权益 //判断是否有加购权益
if (state.productId.length > 0) {
queryAddProduct();
}
uni.showModal({
// title: '提示',
content: '确定支付',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
wxPayment();
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
// if (state.productId.length > 0) {
// queryAddProduct();
// }
// uni.showModal({
// // title: '提示',
// content: '确定支付',
// success: function (res) {
// if (res.confirm) {
// console.log('用户点击确定');
// wxPayment();
// } else if (res.cancel) {
// console.log('用户点击取消');
// }
// }
// });
// msg("确定绑定权益产品"); // msg("确定绑定权益产品");
// wxPayment(); // wxPayment();
if (state.checked) {
uni.navigateTo({
url: `/subpackage/orders/order_payment?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}&&isValueCard=${state.isValueCard}`,
});
} else {
msg("请勾选协议");
}
}; };


//获取微信小程序openid //获取微信小程序openid
}; };
onLoad((option : any) => { onLoad((option : any) => {
state.orderId = option.orderId; state.orderId = option.orderId;
state.isValueCard = option.isValueCard;

// state.clientFee = option.clientFee / 100; // state.clientFee = option.clientFee / 100;
state.id = option.id; state.id = option.id;
getOpenID(); getOpenID();
const data = JSON.parse(decodeURIComponent(option.data));
for (var i = 0; i < data.length; i++) {
data['isOpened'] = 'node';
state.productMoney += data[i]['discountPrice'] / 100;
state.productId.push(data[i]['equityId'])
}


state.list = data;
queryDetailsData();

queryAgreement();
// const data = JSON.parse(decodeURIComponent(option.data));
// for (var i = 0; i < data.length; i++) {
// data['isOpened'] = 'node';
// state.productMoney += data[i]['discountPrice'] / 100;
// state.productId.push(data[i]['equityId'])
// }
// state.list = data;
// queryDetailsData();
refresh();
}); });


const state = reactive({ const state = reactive({
messageText: '这是一条成功提示', messageText: '这是一条成功提示',
value: '', value: '',
detailsObj: '', detailsObj: '',
isValueCard: "",
dataArray: [],
checked: false
}); });
const bindClick = (i) => { const bindClick = (i) => {
console.log(i); console.log(i);
state.allMoney = (parseFloat(state.detailsObj.product.oncePrice * 0.01) + parseFloat(state.productMoney)).toFixed(2) state.allMoney = (parseFloat(state.detailsObj.product.oncePrice * 0.01) + parseFloat(state.productMoney)).toFixed(2)
}); });
} }
// 查协议
const queryAgreement = () => {
const options = {
type: 2,
data: {
orderId: state.orderId, //订单编号
},
method: "POST",
showLoading: true,
};
request(getAgreementApi, options).then((res) => {
let data = stringToJson(res.bizContent);
console.log("查协议", data)
});
}
const checkboxChange = (e) => {
state.checked = !state.checked;
console.log(state.checked);
};
const refresh = () => {
let source = ""
// #ifdef MP-ALIPAY
source = "ALI"
// #endif
// #ifdef MP-WEIXIN
source = "WECHAT"
// getOpenID();
// #endif
var data = {
orderId: state.orderId,
source: source //请求方来源
};
const options = {
type: 2,
data: data,
method: "POST",
showLoading: true,
};
console.log("输出内容", options);
request(PAYDETECTION, options).then((res) => {
// console.log(res.bizContent);
const data = stringToJson(res.bizContent);
console.log(data);
// console.log(typeof(data));
// if (data.paymentStatus == 'ALLSUCCESS') {
// gotoEditUserOrUnitInfo()
// }
state.dataArray = data.datas;
// HANDLE("办理费",1){},
// MARGIN("保证金",2){},
// PRESTORE("预存金",3){},
// EQUITY("权益费",4){},
for (let i = 0; i < state.dataArray.length; i++) {
if (state.dataArray[i].payType === 'HANDLE') {
state.dataArray[i].payName = '办理费'
} else if (state.dataArray[i].payType === 'MARGIN') {
state.dataArray[i].payName = '保证金'
} else if (state.dataArray[i].payType === 'PRESTORE') {
state.dataArray[i].payName = '预存金'
} else if (state.dataArray[i].payType === 'EQUITY') {
state.dataArray[i].payName = '权益费'
} else {
state.dataArray[i].payName = '未知费'
}
// SUCCESS("支付成功",1){},
// PAYING("支付中",2){},
// FAILED("支付失败",3){},
// UNPAY("未支付",4){},
// CLOSED("已关闭",5){},
// CANCELED("已撤销",6){},
// REFUND("转入退费",7){},
if (state.dataArray[i].payStatus === 'SUCCESS') {
state.dataArray[i].payStatusName = '已支付'
} else if (state.dataArray[i].payStatus === 'PAYING') {
state.dataArray[i].payStatusName = '支付中'
} else if (state.dataArray[i].payStatus === 'FAILED') {
state.dataArray[i].payStatusName = '支付失败'
} else if (state.dataArray[i].payStatus === 'UNPAY') {
state.dataArray[i].payStatusName = '未支付'
} else if (state.dataArray[i].payStatus === 'CLOSED') {
state.dataArray[i].payStatusName = '已关闭'
} else if (state.dataArray[i].payStatus === 'CANCELED') {
state.dataArray[i].payStatusName = '已撤销'
} else if (state.dataArray[i].payStatus === 'REFUND') {
state.dataArray[i].payStatusName = '转入退费'
} else {
state.dataArray[i].payStatusName = '未知'
}
state.allMoney += state.dataArray[i]["fee"] * 0.01
}
console.log("state.dataArray", state.dataArray)
});
}
</script> </script>


<style lang="scss" scoped> <style lang="scss" scoped>
.price { .price {
color: white; color: white;
} }

.agreement {
font-size: 30rpx;
display: flex;
flex-wrap: wrap;
margin-top: 20rpx;
align-items: center;
}
</style> </style>

+ 2
- 2
utils/network/api.js View File

production: { production: {
// baseUrl: "http://192.168.124.6:8087", // baseUrl: "http://192.168.124.6:8087",
// baseUrl: "http://222.85.144.89:19002", // baseUrl: "http://222.85.144.89:19002",
// baseUrl: "http://192.168.100.158:8085/html/",
baseUrl: "https://qtzl.etcjz.cn", baseUrl: "https://qtzl.etcjz.cn",
// baseUrl: "https://trial.etcjz.cn", // baseUrl: "https://trial.etcjz.cn",
// baseUrl: "http://192.168.100.158:8085", // baseUrl: "http://192.168.100.158:8085",
export const businessApi = "b275644e586b447791eede4ad6a41640" //业务完成日志 export const businessApi = "b275644e586b447791eede4ad6a41640" //业务完成日志
export const inventoryEquipmentApi = "5570160d4b8d46408664b6c289de6b57" //库存设备统计 export const inventoryEquipmentApi = "5570160d4b8d46408664b6c289de6b57" //库存设备统计
export const getOpenidApi = "53c0698b512a44539ea05cc88157e68b" //获取微信小程序openid
export const getOpenidApi = "53c0698b512a44539ea05cc88157e68b" //获取微信小程序openid
export const getAgreementApi = "32a9d99a781a4bf2af29a46d903702bd" //根据订单编号获取渠道产品的补充协议

Loading…
Cancel
Save