@@ -186,12 +186,13 @@ | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
// #ifdef MP-WEIXIN | |||
request(getGlobalParam, options).then((res) => { | |||
const result = stringToJson(res.bizContent); | |||
setItem('globalParam', result.data) | |||
console.log("配置", result); | |||
}); | |||
// #ifdef MP-WEIXIN | |||
// #endif | |||
}, | |||
@@ -23,7 +23,7 @@ | |||
</view> | |||
<view class="btn"> | |||
<submit-button title="同意协议并获取验证码" @submit="nextStep"></submit-button> | |||
<submit-button title="同意协议并获取验证码" @submit="mobileIsRepeat"></submit-button> | |||
</view> | |||
</template> | |||
@@ -31,9 +31,9 @@ | |||
// import uCheckBox from "@/uni_modules/vk-uview-ui/components/u-checkbox/u-checkbox.vue"; | |||
import { reactive } from "vue"; | |||
import { checkStr, msg, navTo } from "@/utils/utils"; | |||
import { sendCode, regist } from "@/utils/network/api.js"; | |||
import { sendCode, regist, mobileIsRepeatApi } from "@/utils/network/api.js"; | |||
import { request } from "@/utils/network/request.js"; | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
const state = reactive({ | |||
phone: "", //电话 | |||
checked: false, //是否勾选阅读协议 | |||
@@ -42,12 +42,12 @@ | |||
console.log(e); | |||
state.checked = !state.checked; | |||
}; | |||
// 去协议页面 | |||
const toRead=()=>{ | |||
const toRead = () => { | |||
navTo("/login/agreement") | |||
} | |||
/* 下一步 */ | |||
const nextStep = () => { | |||
if (!state.phone) { | |||
@@ -83,6 +83,40 @@ | |||
console.log(err); | |||
}); | |||
}; | |||
const mobileIsRepeat = () => { | |||
if (!state.phone) { | |||
msg("请输入手机号!"); | |||
return; | |||
} | |||
if (!checkStr(state.phone, "mobile")) { | |||
msg("请输入正确的手机号!"); | |||
return; | |||
} | |||
if (!state.checked) { | |||
msg("请勾选我已阅读并同意《平台用户服务隐私协议》"); | |||
return; | |||
} | |||
const options = { | |||
type: 2, | |||
data: { mobile: state.phone }, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(mobileIsRepeatApi, options) | |||
.then((res) => { | |||
const result = stringToJson(res.bizContent); | |||
console.log("个人账号重复注册校验", result.canRegister) | |||
if (result.canRegister) { | |||
nextStep(); | |||
} else { | |||
msg("该手机号已注册!"); | |||
} | |||
}) | |||
.catch((err) => { | |||
console.log(err); | |||
}); | |||
}; | |||
</script> | |||
<style lang="scss" scoped> |
@@ -19,7 +19,6 @@ | |||
"navigationBarTitleText": "", | |||
"enablePullDownRefresh": false | |||
} | |||
}, | |||
{ | |||
"path": "pages/order/order", | |||
@@ -41,7 +40,6 @@ | |||
} | |||
} | |||
}, | |||
{ | |||
"path": "pages/service/service", | |||
"style": { |
@@ -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" /> | |||
@@ -405,32 +405,9 @@ | |||
// .catch((err) => { | |||
// console.log(err); | |||
// }); | |||
// uni.navigateTo({ | |||
// url: "/subpackage/orders/payment/payment?token=445dff5be89c4dcaa89386d1c390930a&openId=0e716af635634d749a981524cc6146a5&orderId=20231016175113823159477&qdOrderNo=20231016175113823159477" | |||
// }) | |||
// uni.navigateTo({ | |||
// url: "/subpackage/orders/sign/sign-up-ali?token=dcb93cca0dde44cdb444b6afab95b66e&openId=c3e66c33299e4faea553ba32a028418c&orderId=20231017142743224495637&qdOrderNo=20231017142747520101000029802083" | |||
// }) | |||
my.navigateToMiniProgram({ | |||
appId: '2021004124602167', // 16 位 | |||
path: `/subpackage/orders/payment/payment?qdOrderNo=1&type=3&orderId=1&isPay=1`, | |||
query: { | |||
a: 'foo', | |||
b: 'bar', | |||
}, | |||
envVersion: "develop", | |||
extraData: { | |||
x: { | |||
y: 'z', | |||
}, | |||
}, | |||
success: function (res) { | |||
console.log(res); | |||
}, | |||
fail: function (err) { | |||
console.log(err); | |||
} | |||
}); | |||
uni.navigateTo({ | |||
url: "/subpackage/orders/payment/payment?token=445dff5be89c4dcaa89386d1c390930a&openId=0e716af635634d749a981524cc6146a5&orderId=20231016175113823159477&qdOrderNo=20231016175113823159477" | |||
}) | |||
}; | |||
//轮播跳转 | |||
@@ -485,17 +462,6 @@ | |||
const showMask = (val : any) => { | |||
state.type = val; //1 客车 2货车 | |||
isShowMask.value = true; | |||
// uni.navigateToMiniProgram({ | |||
// appId: '2021004107608006', // 16 位 | |||
// path: `/pages/recharge/recharge`, | |||
// envVersion: "develop", | |||
// success: function (res) { | |||
// console.log(res); | |||
// }, | |||
// fail: function (err) { | |||
// console.log(err); | |||
// } | |||
// }); | |||
}; | |||
const closeMask = () => { |
@@ -20,7 +20,7 @@ | |||
state.isPay = option.isPay; | |||
state.token = option.token; | |||
state.openId = option.openId; | |||
console.log("option11111", option) | |||
console.log("option1111111111", option) | |||
if (state.isPay == "1") { | |||
// 为1时跳转到2小程序支付 | |||
my.navigateToMiniProgram({ |
@@ -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> |
@@ -61,7 +61,7 @@ | |||
CardBillPlaceOrder, | |||
CardBillPayStatus, | |||
wechatPayConfigId, | |||
aliPayConfigId, | |||
aliPayConfigIdTwo, | |||
obtainUserId, | |||
getOpenidApi, | |||
orderDetail | |||
@@ -106,7 +106,7 @@ | |||
const optionsUser = { | |||
type: 2, | |||
data: { | |||
payConfigId: aliPayConfigId, | |||
payConfigId: aliPayConfigIdTwo, | |||
code: res.authCode | |||
}, | |||
method: "POST", |
@@ -109,17 +109,10 @@ | |||
}; | |||
request(checkOrderStatus, optionsaliquery).then((res) => { | |||
console.log('支付结果查询:', res) | |||
// 支付完成跳转到h5 | |||
// const param = `https://qtzl.etcjz.cn/order/#/pages/payment/payment?qdOrderNo=${state.qdOrderNo}&type=3` | |||
// const params = encodeURIComponent(JSON.stringify(param)) | |||
// console.log('支付结果查询params', params) | |||
// uni.navigateTo({ | |||
// url: `/subpackage/personal-center/webview?url=` + params | |||
// }) | |||
if (state.isPay == "1") { | |||
my.navigateToMiniProgram({ | |||
appId: '2021004102619032', // 16 位 | |||
path: `/subpackage/after-sale/empty?qdOrderNo=${state.qdOrderNo}&type=3&orderId=${state.orderId}isPay=2`, | |||
path: `/subpackage/after-sale/empty?qdOrderNo=${state.qdOrderNo}&type=3&orderId=${state.orderId}&isPay=2`, | |||
query: { | |||
a: 'foo', | |||
b: 'bar', | |||
@@ -137,19 +130,6 @@ | |||
} | |||
}); | |||
} | |||
// my.navigateBackMiniProgram({ | |||
// extraData: { | |||
// 'qdOrderNo': state.qdOrderNo, | |||
// 'type': 3 | |||
// }, | |||
// success: (res) => { | |||
// console.log(res) | |||
// }, | |||
// fail: (err) => { | |||
// console.log(err) | |||
// } | |||
// }); | |||
}) | |||
}, | |||
fail: res => { |
@@ -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) | |||
}); | |||
} |
@@ -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> |
@@ -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> |
@@ -245,4 +245,5 @@ export const PAYMENTORDERAPPLY = "377421d6ed4f48a29575aa126838a4d2" //CSMSN-订 | |||
export const businessApi = "b275644e586b447791eede4ad6a41640" //业务完成日志 | |||
export const inventoryEquipmentApi = "5570160d4b8d46408664b6c289de6b57" //库存设备统计 | |||
export const getOpenidApi = "53c0698b512a44539ea05cc88157e68b" //获取微信小程序openid | |||
export const getAgreementApi = "32a9d99a781a4bf2af29a46d903702bd" //根据订单编号获取渠道产品的补充协议 | |||
export const getAgreementApi = "32a9d99a781a4bf2af29a46d903702bd" //根据订单编号获取渠道产品的补充协议 | |||
export const mobileIsRepeatApi = "19d58812148d41bbb7d435ab93928787" //个人账号重复注册校验 |