浏览代码

添加三个协议

yxb
DESKTOP-2IO5MST\huting 1年前
父节点
当前提交
fd775f1dca

+ 2
- 2
pages/index/index.vue 查看文件

@@ -89,12 +89,12 @@
</view>
<view class="text">基础信息变更</view>
</view>
<view class="item-box" @click="test">
<!-- <view class="item-box" @click="test">
<view class="item item-7">
<image :src="fileURL + 'image/index/item-7.png'" mode="aspectFill" />
</view>
<view class="text">测试</view>
</view>
</view> -->
<view class="item-box" @click="$util.navTo(`/pages/service/service`,true)">
<view class="item item-8">
<image :src="fileURL + 'image/index/item-more.png'" mode="aspectFill" />

+ 84
- 5
subpackage/orders/essential-information.vue 查看文件

@@ -49,7 +49,12 @@
<image :src="`${$imgUrl}common/arror-right.png`" class="icon"></image>
</view>
</view>

<view class="as-layout-horizontal agreement">
<checkbox-group @change="checkboxChange">
<checkbox :checked="state.checked" style="transform: scale(0.8)" />我已阅读并同意
</checkbox-group>
<text style="color:#007AFF;text-decoration: underline;" @click="downAuthD()">《用户协议》</text>
</view>
<view style="margin-top: 30rpx" class="action">
<button type="default" class="button" @click="nextAction()">
下一步
@@ -86,6 +91,7 @@
style="width: 48rpx; height: 48rpx"></image>
</view>
</view>

<view :style="state.addressArray ? 'margin-top: 60rpx;' : ''" class="action-bottom">
<button type="default" class="button" @click="goToAddAddress()">
添加收货地址
@@ -93,6 +99,7 @@
</view>
</view>
</u-popup>

</template>

<script setup lang="ts">
@@ -110,7 +117,9 @@
etcVehiclePlateVer,
searchOrder,
productReCode,
getGlobalParam
getGlobalParam,
infoQuery,
envs
} from "@/utils/network/api.js";
import { request } from "@/utils/network/request.js";
import { reactive, ref } from "vue";
@@ -141,6 +150,8 @@
addressArray: [],
isSign: '',
isValueCard: '',
checked: false,
agreeURL: "",
});
const globalParam = () => {
const options = {
@@ -156,6 +167,58 @@
console.log("配置", result);
});
}
const downAuthD = () => {
// tools.showLoadingAlert("加载中");
uni.downloadFile({
url: state.agreeURL,
filePath: wx.env.USER_DATA_PATH + '/' + '用户协议.docx',
success(res) {
const filePath = res.filePath
uni.openDocument({
filePath: filePath,
fileType: 'docx',
showMenu: true, //关键点
success: function (res) {
msg("打开文档成功");
},
fail: function (err) {
msg("打开文档失败");
}
});
},
fail: function (err) {
msg("下载文档失败");
console.log("err", err)
},
complete(res) {

}
})
}
const getInfo = () => {
//参数说明
let options = {
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
data: {
businessType: 'USER_AGREEMENT' //用户协议
}, //请求参数
method: "POST", //提交方式(默认POST)
showLoading: true, //是否显示加载中(默认显示)
};

//调用方式
request(infoQuery, options)
.then((res) => {
let data = stringToJson(res.bizContent)
if (data.textType = "URL") {
state.agreeURL = envs[process.env.NODE_ENV].baseUrl + data.text
}
console.log("用户协议", state.agreeURL);
})
.catch((err) => {
console.log(err);
});
}
/* 选择车牌颜色 */
const checkNumberplateColor = (item : any) => {
state.data.vehiclePlateColor = item.id;
@@ -172,7 +235,10 @@
url: `/subpackage/orders/editAddress?content=` + JSON.stringify(val),
});
};

const checkboxChange = (e) => {
state.checked = !state.checked;
console.log(state.checked);
};
const carNumber = (val : any) => {
state.data.vehiclePlate = val;
state.data.vehiclePlateNumber = val;
@@ -201,7 +267,10 @@
msg("请输入正确的申办车牌");
return;
}

if (!state.checked) {
msg("请勾选协议!")
return;
}
//1.优先车牌校验 2.在进行订单创建
var vehicleData = {
vehiclePlate: state.data.vehiclePlate,
@@ -217,7 +286,7 @@
request(etcVehiclePlateVer, options).then((res) => {
var data = state.data;
// #ifdef MP-ALIPAY
data.orderSource = 'ALI'
data.orderSource = 'ALI'
// #endif
const options = {
type: 2,
@@ -321,6 +390,7 @@
state.data.promoteId = option.promoteId;
state.isValueCard = option.isValueCard
console.log("订单选择推广发行产品接口", option)
getInfo();
uni.getLocation({
type: 'wgs84',
success: function (res) {
@@ -592,4 +662,13 @@
:deep(.numberplates) {
justify-content: space-between;
}

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

+ 35
- 6
subpackage/orders/product-detail.vue 查看文件

@@ -81,9 +81,7 @@
<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;">《风险提示告知书》</a>
<a style="color:#007AFF;text-decoration: underline;" @click="downAuthD()">《产品协议》</a>
</view>
</view>

@@ -110,7 +108,8 @@
addProduct,
getOpenidApi,
getAgreementApi,
PAYDETECTION
PAYDETECTION,
envs
} from "@/utils/network/api.js";
import {
request
@@ -171,7 +170,34 @@
msg("请勾选协议");
}
};
const downAuthD = () => {
// tools.showLoadingAlert("加载中");
uni.downloadFile({
url: state.agreeURL,
filePath: wx.env.USER_DATA_PATH + '/' + '产品协议.docx',
success(res) {
const filePath = res.filePath
uni.openDocument({
filePath: filePath,
fileType: 'docx',
showMenu: true, //关键点
success: function (res) {
msg("打开文档成功");
},
fail: function (err) {
msg("打开文档失败");
}
});
},
fail: function (err) {
msg("下载文档失败");
console.log("err", err)
},
complete(res) {

}
})
}
//获取微信小程序openid
const getOpenID = () => {
uni.login({
@@ -307,7 +333,8 @@
detailsObj: '',
isValueCard: "",
dataArray: [],
checked: false
checked: false,
agreeURL: "",
});
const bindClick = (i) => {
console.log(i);
@@ -384,13 +411,15 @@
const options = {
type: 2,
data: {
orderId: state.orderId, //订单编号
// orderId: state.orderId, //订单编号
orderId: "20231016180507480853307", //订单编号
},
method: "POST",
showLoading: true,
};
request(getAgreementApi, options).then((res) => {
let data = stringToJson(res.bizContent);
state.agreeURL = envs[process.env.NODE_ENV].baseUrl + data.supAgree
console.log("查协议", data)
});
}

+ 285
- 209
subpackage/orders/sign-up-ali.vue 查看文件

@@ -1,225 +1,301 @@
<template>
<image
style="
<image style="
margin-top: 20rpx;
width: 100%;
height: 240rpx;
background-color: #eeeeee;
"
:src="`${$imgUrl}applyCard/car-service.png`"
></image>
<view class="title"> 支付宝签约代扣 </view>
<view class="value">
<view class="content_1">
支付宝签约代扣是支付宝支付为车主用户提供的安全便捷的智慧服务
</view>
<view class="content_2">
本次将为贵州黔通智联科技股份有限公司开启免密支付服务,后续相关的费用将通过支付宝签约代扣从你的支付宝账户扣除
</view>
<view class="content_3">
注:签约成功后请返回本页面,再次点击开通服务
" :src="`${$imgUrl}applyCard/car-service.png`"></image>
<view class="title"> 支付宝签约代扣 </view>
<view class="value">
<view class="content_1">
支付宝签约代扣是支付宝支付为车主用户提供的安全便捷的智慧服务
</view>
<view class="content_2">
本次将为贵州黔通智联科技股份有限公司开启免密支付服务,后续相关的费用将通过支付宝签约代扣从你的支付宝账户扣除
</view>
<view class="content_3">
注:签约成功后请返回本页面,再次点击开通服务
</view>
</view>
</view>
<view class="action">
<button type="default" class="button" @click="savaHandle()">
开通服务
</button>
<!-- <button type="default" class="button" @click="addInterestsList()">
<view class="as-layout-horizontal agreement">
<checkbox-group @change="checkboxChange">
<checkbox :checked="state.checked" style="transform: scale(0.8)" />我已阅读并同意
</checkbox-group>
<text style="color:#007AFF;text-decoration: underline;" @click="downAuthD()">《代扣协议》</text>
</view>
<view class="action">
<button type="default" class="button" @click="savaHandle()">
开通服务
</button>
<!-- <button type="default" class="button" @click="addInterestsList()">
加购权益
</button> -->
</view>
</view>
</template>

<script setup lang="ts">
import { onLoad, onShow } from "@dcloudio/uni-app";
import { reactive } from "vue";
import { etcQYAction } from "@/utils/network/api.js";
import { request } from "@/utils/network/request.js";

import { stringToJson } from "@/utils/network/encryption";
import { fileURL } from "@/datas/fileURL.js";
import navBar from "@/components/nav-bar/nav-bar2.vue";
import navBgCar from "./components/nav-bg-car4";
import { setItem } from "@/utils/storage";
import { msg, confirm, getOrderStatusName } from "@/utils/utils";
import {
checkOrderStatus,
orderPay,
wechatAppID,
wechatPayConfigId,
wechatSecret,
aliPayConfigIdTwo,
obtainUserId,
} from "@/utils/network/api";
const imgURL = `${fileURL}image/`;

const state = reactive({
openid: "",
orderId: "",
id: "",
clientFee: "",
code:""
});
onLoad((option: any) => {
state.orderId = option.orderId;
});


const addInterestsList=()=>{
uni.navigateTo({
url:`/subpackage/orders/interestsList?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}`
import { onLoad, onShow } from "@dcloudio/uni-app";
import { reactive } from "vue";
import { etcQYAction } from "@/utils/network/api.js";
import { request } from "@/utils/network/request.js";

import { stringToJson } from "@/utils/network/encryption";
import { fileURL } from "@/datas/fileURL.js";
import navBar from "@/components/nav-bar/nav-bar2.vue";
import navBgCar from "./components/nav-bg-car4";
import { setItem } from "@/utils/storage";
import { msg, confirm, getOrderStatusName } from "@/utils/utils";
import {
checkOrderStatus,
orderPay,
wechatAppID,
wechatPayConfigId,
wechatSecret,
aliPayConfigIdTwo,
obtainUserId,
infoQuery,
envs
} from "@/utils/network/api";
const imgURL = `${fileURL}image/`;

const state = reactive({
openid: "",
orderId: "",
id: "",
clientFee: "",
code: "",
checked: false,
agreeURL: "",
});
}
const savaHandle = () => {
my.getAuthCode({
scopes: 'auth_user',
success: res => {
// 获取需要的用户信息
state.code = res.authCode
//如果获取openId成功
if (state.code) {
console.log("code*******", state.code);
const optionsUser = {
type: 2,
data: {
payConfigId: aliPayConfigIdTwo,
code: res.authCode
},
method: "POST",
showLoading: true,
};
console.log('支付宝用户编号请求:', optionsUser)
request(obtainUserId, optionsUser).then((res) => {
console.log('支付宝用户编号返回:', res)
const bizContent = stringToJson(res.bizContent);
var data = {
orderId: state.orderId,
subOpenId: bizContent.openId,
};
const options = {
type: 2,
data: data,
method: "POST",
showLoading: true,
};
request(etcQYAction, options).then((res) => {
console.log("res*******", res);
const data = stringToJson(res.bizContent);
console.log("data*******", data);
if (data.signStatus === "WAIT_SIGN") {
//待签约
my.ap.navigateToAlipayPage({
path: "https://render.alipay.com/p/yuyan/180020010001250649/sign.html?orderId="+data.alipayOrderId
});
}else if (data.signStatus === "SIGNED") {
//已签约
// msg("已签约");
confirm(
"您已完成签约,等待业务员审核发货",
() => {
uni.switchTab({
url: "/pages/order/order"
})
// uni.$emit("refreshOrder");
// uni.navigateBack();
},
"已完成签约",
false
);
}else if (data.signStatus === "UNSIGN") {
//已解约
// msg("已解约");
confirm(
"您已解约!",
() => {
uni.switchTab({
url: "/pages/order/order"
})
},
"您已解约",
false
);
}
});
})
} else {
//如果获取openId失败
uni.showToast({
title: "网络异常,请重试!",
icon: "none",
duration: 1000,
});
return;
}
},
fail: err => {
console.log('my.getAuthCode 调用失败', err)
}
onLoad((option : any) => {
state.orderId = option.orderId;
getInfo();
});
}
const checkboxChange = (e) => {
state.checked = !state.checked;
console.log(state.checked);
};
const downAuthD = () => {
// tools.showLoadingAlert("加载中");
uni.downloadFile({
url: state.agreeURL,
filePath: wx.env.USER_DATA_PATH + '/' + '代扣协议1.docx',
success(res) {
const filePath = res.filePath
uni.openDocument({
filePath: filePath,
fileType: 'docx',
showMenu: true, //关键点
success: function (res) {
msg("打开文档成功");
},
fail: function (err) {
msg("打开文档失败");
}
});
},
fail: function (err) {
msg("下载文档失败");
console.log("err", err)
},
complete(res) {

}
})
}
const getInfo = () => {
//参数说明
let options = {
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
data: {
businessType: 'WITHHOLD_AGREEMENT' //代扣协议
}, //请求参数
method: "POST", //提交方式(默认POST)
showLoading: true, //是否显示加载中(默认显示)
};

//调用方式
request(infoQuery, options)
.then((res) => {
let data = stringToJson(res.bizContent)
if (data.textType = "URL") {
state.agreeURL = envs[process.env.NODE_ENV].baseUrl + data.text
}
console.log("代扣协议", state.agreeURL);
})
.catch((err) => {
console.log(err);
});
}

const addInterestsList = () => {
uni.navigateTo({
url: `/subpackage/orders/interestsList?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}`
});
}
const savaHandle = () => {
if (!state.checked) {
msg("请勾选协议!")
return;
}
my.getAuthCode({
scopes: 'auth_user',
success: res => {
// 获取需要的用户信息
state.code = res.authCode
//如果获取openId成功
if (state.code) {
console.log("code*******", state.code);
const optionsUser = {
type: 2,
data: {
payConfigId: aliPayConfigIdTwo,
code: res.authCode
},
method: "POST",
showLoading: true,
};
console.log('支付宝用户编号请求:', optionsUser)

request(obtainUserId, optionsUser).then((res) => {
console.log('支付宝用户编号返回:', res)
const bizContent = stringToJson(res.bizContent);
var data = {
orderId: state.orderId,
subOpenId: bizContent.openId,
};
const options = {
type: 2,
data: data,
method: "POST",
showLoading: true,
};
request(etcQYAction, options).then((res) => {
console.log("res*******", res);
const data = stringToJson(res.bizContent);
console.log("data*******", data);
if (data.signStatus === "WAIT_SIGN") {
//待签约
my.ap.navigateToAlipayPage({
path: "https://render.alipay.com/p/yuyan/180020010001250649/sign.html?orderId=" + data.alipayOrderId
});
} else if (data.signStatus === "SIGNED") {
//已签约
// msg("已签约");
confirm(
"您已完成签约,等待业务员审核发货",
() => {
uni.switchTab({
url: "/pages/order/order"
})
// uni.$emit("refreshOrder");
// uni.navigateBack();
},
"已完成签约",
false
);
} else if (data.signStatus === "UNSIGN") {
//已解约
// msg("已解约");
confirm(
"您已解约!",
() => {
uni.switchTab({
url: "/pages/order/order"
})
},
"您已解约",
false
);
}
});

})


} else {
//如果获取openId失败
uni.showToast({
title: "网络异常,请重试!",
icon: "none",
duration: 1000,
});
return;
}
},
fail: err => {
console.log('my.getAuthCode 调用失败', err)
}
});

}
</script>

<style lang="scss" scoped>
.action {
margin-top: 40rpx;
padding-left: 20rpx;
padding-right: 20rpx;
padding-bottom: 30rpx;

.button {
height: 80rpx;
background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
border-radius: 40rpx;
font-size: 32rpx;
font-weight: 400;
color: #ffffff;
line-height: 80rpx;
}
}

.title {
text-align: center;
margin-top: 15rpx;
font-size: 36rpx;
font-family: Microsoft YaHei;
font-weight: 400;
color: #333333;
line-height: 36rpx;
}

.value {
padding: 0rpx 60rpx;
}

.content_1 {
margin-top: 60rpx;
font-size: 30rpx;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
line-height: 58rpx;
}

.content_2 {
margin-top: 50rpx;
font-size: 30rpx;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
line-height: 58rpx;
}

.content_3 {
margin-top: 50rpx;
font-size: 30rpx;
font-family: Microsoft YaHei;
font-weight: 400;
color: #ff0000;
line-height: 58rpx;
}
</style>
.action {
margin-top: 40rpx;
padding-left: 20rpx;
padding-right: 20rpx;
padding-bottom: 30rpx;

.button {
height: 80rpx;
background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
border-radius: 40rpx;
font-size: 32rpx;
font-weight: 400;
color: #ffffff;
line-height: 80rpx;
}
}

.title {
text-align: center;
margin-top: 15rpx;
font-size: 36rpx;
font-family: Microsoft YaHei;
font-weight: 400;
color: #333333;
line-height: 36rpx;
}

.value {
padding: 0rpx 60rpx;
}

.content_1 {
margin-top: 60rpx;
font-size: 30rpx;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
line-height: 58rpx;
}

.content_2 {
margin-top: 50rpx;
font-size: 30rpx;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
line-height: 58rpx;
}

.content_3 {
margin-top: 50rpx;
font-size: 30rpx;
font-family: Microsoft YaHei;
font-weight: 400;
color: #ff0000;
line-height: 58rpx;
}

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

+ 80
- 1
subpackage/orders/sign-up.vue 查看文件

@@ -14,6 +14,12 @@
本次将为贵州黔通智联科技股份有限公司开启免密支付服务,后续相关的费用将通过微信车主服务从你的微信支付账户扣除
</view>
</view>
<view class="as-layout-horizontal agreement">
<checkbox-group @change="checkboxChange">
<checkbox :checked="state.checked" style="transform: scale(0.8)" />我已阅读并同意
</checkbox-group>
<text style="color:#007AFF;text-decoration: underline;" @click="downAuthD()">《代扣协议》</text>
</view>
<view class="action">
<button type="default" class="button" @click="savaHandle()">
开通服务
@@ -42,7 +48,9 @@
wechatAppID,
wechatPayConfigId,
wechatSecret,
getOpenidApi
getOpenidApi,
infoQuery,
envs
} from "@/utils/network/api";
const imgURL = `${fileURL}image/`;

@@ -51,14 +59,44 @@
orderId: "",
id: "",
clientFee: "",
checked: false,
agreeURL: "",
});
onLoad((option : any) => {
getOpenID();
state.orderId = option.orderId;
state.clientFee = option.clientFee;
state.id = option.id;
getInfo();
});
const checkboxChange = (e) => {
state.checked = !state.checked;
console.log(state.checked);
};
const getInfo = () => {
//参数说明
let options = {
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
data: {
businessType: 'WITHHOLD_AGREEMENT' //代扣协议
}, //请求参数
method: "POST", //提交方式(默认POST)
showLoading: true, //是否显示加载中(默认显示)
};

//调用方式
request(infoQuery, options)
.then((res) => {
let data = stringToJson(res.bizContent)
if (data.textType = "URL") {
state.agreeURL = envs[process.env.NODE_ENV].baseUrl + data.text
}
console.log("代扣协议", state.agreeURL);
})
.catch((err) => {
console.log(err);
});
}
//获取微信小程序openid
const getOpenID = () => {
// #ifdef MP-WEIXIN
@@ -87,6 +125,34 @@
});
// #endif
};
const downAuthD = () => {
// tools.showLoadingAlert("加载中");
uni.downloadFile({
url: state.agreeURL,
filePath: wx.env.USER_DATA_PATH + '/' + '代扣协议.docx',
success(res) {
const filePath = res.filePath
uni.openDocument({
filePath: filePath,
fileType: 'docx',
showMenu: true, //关键点
success: function (res) {
msg("打开文档成功");
},
fail: function (err) {
msg("打开文档失败");
}
});
},
fail: function (err) {
msg("下载文档失败");
console.log("err", err)
},
complete(res) {

}
})
}
const getOpenid = (code) => {
const options = {
type: 2,
@@ -112,6 +178,10 @@
});
}
const savaHandle = () => {
if (!state.checked) {
msg("请勾选协议!")
return;
}
console.log("openid*******", state.openid);
//如果获取openId成功
if (state.openid) {
@@ -231,4 +301,13 @@
color: #666666;
line-height: 58rpx;
}

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

+ 6
- 6
utils/network/api.js 查看文件

@@ -1,23 +1,23 @@
/* 接口中常量 */
// export const URL = "192.168.100.63";
export const URL = "trial.etcjz.cn";
// export const URL = "qtzl.etcjz.cn";
// export const URL = "trial.etcjz.cn";
export const URL = "qtzl.etcjz.cn";
/**
* 配置信息,针对不同的平台进行配置
*/
export const envs = {
//开发环境配置
development: {
// baseUrl: "https://qtzl.etcjz.cn",
baseUrl: "https://trial.etcjz.cn",
baseUrl: "https://qtzl.etcjz.cn",
// baseUrl: "https://trial.etcjz.cn",
// baseUrl: "http://192.168.100.158:8085",
},
//生产环境配置
production: {
// baseUrl: "http://192.168.124.6:8087",
// baseUrl: "http://222.85.144.89:19002",
// baseUrl: "https://qtzl.etcjz.cn",
baseUrl: "https://trial.etcjz.cn",
baseUrl: "https://qtzl.etcjz.cn",
// baseUrl: "https://trial.etcjz.cn",
// baseUrl: "http://192.168.100.158:8085",
},
}

正在加载...
取消
保存