DESKTOP-2IO5MST\huting пре 1 година
родитељ
комит
686d2f27be

+ 6
- 3
subpackage/orders/interestsList.vue Прегледај датотеку

@@ -121,8 +121,11 @@ s<template>
};
console.log("optionss", optionss);
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}`,
});
});

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

+ 15
- 15
subpackage/orders/order_payment.vue Прегледај датотеку

@@ -62,7 +62,7 @@
CardBillPayStatus,
wechatPayConfigId,
aliPayConfigId,
obtainUserId,
obtainUserId,
getOpenidApi,
orderDetail

@@ -70,7 +70,7 @@
import { request } from "@/utils/network/request.js";
import { stringToJson } from "@/utils/network/encryption";
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 { getItem, StorageKeys, setItem } from "@/utils/storage.ts";
import { msg } from "@/utils/utils";
@@ -161,7 +161,7 @@
// uni.request({
// url: `https://api.weixin.qq.com/sns/jscode2session?appid=${wechatAppID}&secret=${wechatSecret}&js_code=${e.code}&grant_type=authorization_code`,
// success: (res : any) => {
const options1 = {
type: 2,
data: {
@@ -173,7 +173,7 @@
request(getOpenidApi, options1).then((res) => {
const result = stringToJson(res.bizContent);
const openidData = stringToJson(result.data);
console.log("获取openId",openidData)
console.log("获取openId", openidData)
const options = {
type: 2,
data: {
@@ -448,23 +448,23 @@
});
};
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({
isValueCard: 1, //卡的类型
radiolist1: [], //选择卡的数据列表
choiceCardShow: false, //选择卡的弹出框
isSign: '',
id:"",
id: "",
orderId: "",
userType: 1, //1 个人 2单位
type: 0, //0 客车 1货车

+ 164
- 39
subpackage/orders/product-detail.vue Прегледај датотеку

@@ -2,7 +2,7 @@
<navBar title="产品详情"></navBar>
<navBgCar></navBgCar>
<view class="content-wrap">
<view class="ul-item">
<!-- <view class="ul-item">
<image style="width: 100%; height: 170rpx; background-color: #eeeeee"
:src="`${$imgUrl}applyCard/product-bg.png`"></image>
<view class="item-value">
@@ -15,9 +15,9 @@
¥:{{state.detailsObj.product.oncePrice * 0.01}}
</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-item class="del_item" v-for="(item,index) in state.list"
:right-options="state.options2" :show="item.isOpened" :auto-close="false" @change="change"
@@ -39,19 +39,25 @@
</uni-swipe-action-item>

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

<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="value">
{{ "¥" + state.detailsObj.product.oncePrice * 0.01 }}
</view>
</view>
<view class="flex">
</view> -->
<!-- <view class="flex">
<view class="title"> 加购权益 </view>
<view class="value">{{ "¥" + state.productMoney }} </view>
</view>
</view> -->
<view class="flex">
<view class="title"> 运费 </view>
<view class="value"> ¥0.00 </view>
@@ -70,10 +76,15 @@
{{ "¥" + state.allMoney }}
</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>
</view> -->
<a style="color:#007AFF;text-decoration: underline;">《风险提示告知书》</a>
</view>
</view>

<view class="action">
@@ -97,7 +108,9 @@
import {
etcQueryProduct,
addProduct,
getOpenidApi
getOpenidApi,
getAgreementApi,
PAYDETECTION
} from "@/utils/network/api.js";
import {
request
@@ -133,23 +146,30 @@
const savaHandle = () => {
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("确定绑定权益产品");
// 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
@@ -246,20 +266,21 @@
};
onLoad((option : any) => {
state.orderId = option.orderId;
state.isValueCard = option.isValueCard;

// state.clientFee = option.clientFee / 100;
state.id = option.id;
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({
@@ -284,6 +305,9 @@
messageText: '这是一条成功提示',
value: '',
detailsObj: '',
isValueCard: "",
dataArray: [],
checked: false
});
const bindClick = (i) => {
console.log(i);
@@ -355,6 +379,99 @@
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>

<style lang="scss" scoped>
@@ -513,4 +630,12 @@
.price {
color: white;
}

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

+ 2
- 2
utils/network/api.js Прегледај датотеку

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

Loading…
Откажи
Сачувај