Compare commits
2 Commits
b544ca1868
...
b226641a52
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b226641a52 | ||
|
|
cb864a7f08 |
@ -1,8 +1,10 @@
|
||||
export const apiArr = {
|
||||
ecApply: "/api/v2/wechat/lkl-split-business/ec-apply", //电子合同申请
|
||||
ecQuery: "/api/v2/wechat/lkl-split-business/ec-query", //电子合同查询
|
||||
ecDownload: "/api/v2/wechat/lkl-split-business/ec-download", //电子合同下载
|
||||
upload: "/api/v2/wechat/lkl-split-business/upload", //附件上传
|
||||
applyLedgerReceiver: "/api/v2/wechat/lkl-split-business/apply-ledger-receiver", //分账接收方创建申请
|
||||
applyBind: "/api/v2/wechat/lkl-split-business/apply-bind", //分账关系绑定申请
|
||||
addMer: "/api/v2/wechat/lkl-split-business/add-mer", //商户进件
|
||||
applyLedgerMer: "/api/v2/wechat/lkl-split-business/apply-ledger-mer", //商户分账业务开通申请
|
||||
};
|
||||
|
||||
268
packages/customerService/applyLedgerMer/index.css
Normal file
268
packages/customerService/applyLedgerMer/index.css
Normal file
@ -0,0 +1,268 @@
|
||||
/* addMer/index.css */
|
||||
page {
|
||||
padding-bottom: 0rpx;
|
||||
}
|
||||
|
||||
.establish-acceptor-container {
|
||||
padding: 0 30rpx;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.acceptor-form {
|
||||
background-color: #fff;
|
||||
border-radius: 12rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.form-section {
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
margin-bottom: 24rpx;
|
||||
padding-bottom: 12rpx;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 32rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
display: block;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.form-label.required::after {
|
||||
content: '*';
|
||||
color: #e64340;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
|
||||
.form-input {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
padding: 0 24rpx;
|
||||
font-size: 28rpx;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.form-input:focus {
|
||||
border-color: #007aff;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.form-input::placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* 弹窗样式 */
|
||||
.popup {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
width: 80%;
|
||||
max-height: 70vh;
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
padding: 30rpx;
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
|
||||
.popup-list {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
max-height: 50vh;
|
||||
}
|
||||
|
||||
.popup-item {
|
||||
padding: 30rpx;
|
||||
text-align: center;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.popup-item:active {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.popup-footer {
|
||||
padding: 20rpx;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
|
||||
.popup-cancel-btn {
|
||||
width: 100%;
|
||||
padding: 0 20rpx;
|
||||
background-color: #fff;
|
||||
border: 1rpx solid #ddd;
|
||||
border-radius: 8rpx;
|
||||
font-size: 32rpx;
|
||||
background-color: #007aff;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* 弹窗选择器样式 */
|
||||
.popup-select {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 24rpx;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8rpx;
|
||||
background-color: #fff;
|
||||
height: 88rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
/* 附件上传样式 */
|
||||
.attachment-section {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.attachment-item {
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 8rpx;
|
||||
padding: 24rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.upload-btn {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
background-color: #007aff;
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
border: none;
|
||||
border-radius: 8rpx;
|
||||
margin-top: 16rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.upload-btn:active {
|
||||
background-color: #0051d5;
|
||||
}
|
||||
|
||||
.file-info {
|
||||
margin-top: 16rpx;
|
||||
padding: 16rpx;
|
||||
background-color: #e8f4ff;
|
||||
border-radius: 8rpx;
|
||||
font-size: 26rpx;
|
||||
color: #007aff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.delete-btn {
|
||||
padding: 0rpx 20rpx;
|
||||
background-color: #e64340;
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: 10rpx;
|
||||
font-size: 24rpx;
|
||||
cursor: pointer;
|
||||
margin-right: 0rpx;
|
||||
}
|
||||
|
||||
.delete-btn:active {
|
||||
background-color: #c21f1c;
|
||||
}
|
||||
|
||||
.add-attachment-btn {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
background-color: #f0f0f0;
|
||||
color: #666;
|
||||
font-size: 28rpx;
|
||||
border-radius: 8rpx;
|
||||
margin-top: 16rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.add-attachment-btn:active {
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
|
||||
/* 提交按钮样式 */
|
||||
.submit-section {
|
||||
margin-top: 40rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
background-color: #007aff;
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
border-radius: 8rpx;
|
||||
margin-top: 16rpx;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 122, 255, 0.3);
|
||||
}
|
||||
|
||||
.submit-btn:active {
|
||||
background-color: #0051d5;
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.submit-btn:disabled {
|
||||
background-color: #b8d5ff;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* 输入框错误状态 */
|
||||
.form-input.error {
|
||||
border-color: #e64340;
|
||||
}
|
||||
|
||||
/* 滚动条样式 */
|
||||
::-webkit-scrollbar {
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #c1c1c1;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #a8a8a8;
|
||||
}
|
||||
308
packages/customerService/applyLedgerMer/index.vue
Normal file
308
packages/customerService/applyLedgerMer/index.vue
Normal file
@ -0,0 +1,308 @@
|
||||
<template>
|
||||
<view class="establish-acceptor-container">
|
||||
<form class="acceptor-form" @submit.prevent="submitForm">
|
||||
<!-- 基本信息 -->
|
||||
<view class="form-section">
|
||||
<view class="form-item">
|
||||
<label class="form-label required">商户号</label>
|
||||
<input type="number" class="form-input" v-model.number="formData.mch_id" placeholder="请输入商户号" required>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<label class="form-label">拉卡拉内部商户号</label>
|
||||
<input type="text" class="form-input" v-model="formData.merInnerNo" placeholder="请输入拉卡拉内部商户号(可选)">
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<label class="form-label">银联商户号</label>
|
||||
<input type="text" class="form-input" v-model="formData.merCupNo" placeholder="请输入银联商户号(可选)">
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<label class="form-label required">联系手机号</label>
|
||||
<input type="number" class="form-input" v-model="formData.contactMobile" placeholder="请输入联系手机号" required>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<label class="form-label">电子分账协议号</label>
|
||||
<input type="text" class="form-input" v-model="formData.eleContractNo" placeholder="请输入电子分账协议号(可选)">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 附件上传 -->
|
||||
<view class="form-section">
|
||||
<h3 class="section-title">附件上传(可选)</h3>
|
||||
<view class="attachment-section">
|
||||
<view class="attachment-item" v-for="(file, index) in formData.fileData" :key="index">
|
||||
<view class="form-item">
|
||||
<label class="form-label">附件类型</label>
|
||||
<view class="popup-select" @click="showFileAttachTypePopup = index">
|
||||
<span>{{ getAttachTypeLabel(file.attType) || '请选择附件类型' }}</span>
|
||||
</view>
|
||||
</view>
|
||||
<button class="upload-btn" @click="uploadFile(index)">上传文件</button>
|
||||
<view v-if="file.attFileId" class="file-info">
|
||||
<span>{{ file.attachName || '已上传文件' }}</span>
|
||||
<button class="delete-btn" @click="removeFile(index)">删除</button>
|
||||
</view>
|
||||
</view>
|
||||
<button class="add-attachment-btn" @click="addFile">添加附件</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 提交按钮 -->
|
||||
<view class="form-section submit-section">
|
||||
<button type="submit" class="submit-btn" @click="submitForm">提交申请</button>
|
||||
</view>
|
||||
</form>
|
||||
|
||||
<!-- 文件附件类型弹窗 -->
|
||||
<view class="popup" v-if="showFileAttachTypePopup >= 0">
|
||||
<view class="popup-content">
|
||||
<view class="popup-title">选择附件类型</view>
|
||||
<view class="popup-list">
|
||||
<view class="popup-item" v-for="type in fileAttachTypeOptions" :key="type.value" @click="selectFileAttachType(showFileAttachTypePopup, type)">
|
||||
{{ type.label }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup-footer">
|
||||
<button class="popup-cancel-btn" @click="showFileAttachTypePopup = -1">取消</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { picUrl, menuButtonInfo, request, NavgateTo, RequsetUrl } from "../../../utils";
|
||||
import { apiArr } from "../../../api/contract";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 表单数据
|
||||
formData: {
|
||||
mch_id: null, // 商户号(必需)
|
||||
merInnerNo: '', // 拉卡拉内部商户号(可选)
|
||||
merCupNo: '', // 银联商户号(可选)
|
||||
contactMobile: '', // 联系手机号(必需)
|
||||
eleContractNo: '', // 电子分账协议号(可选)
|
||||
fileData: [
|
||||
{
|
||||
attType: '',
|
||||
attFileId: '',
|
||||
attachName: ''
|
||||
}
|
||||
] // 文件数据(可选)
|
||||
},
|
||||
|
||||
// 弹窗控制
|
||||
showFileAttachTypePopup: -1,
|
||||
|
||||
// 文件附件类型选项(示例数据,实际应从API获取)
|
||||
fileAttachTypeOptions: [
|
||||
{ value: 'BUSINESS_LICENSE', label: '营业执照' },
|
||||
{ value: 'ID_CARD_FRONT', label: '身份证正面' },
|
||||
{ value: 'ID_CARD_BACK', label: '身份证反面' },
|
||||
{ value: 'BANK_CARD', label: '银行卡' },
|
||||
{ value: 'CONTRACT', label: '合同文件' },
|
||||
{ value: 'OTHER', label: '其他' }
|
||||
]
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 添加附件
|
||||
addFile() {
|
||||
this.formData.fileData.push({
|
||||
attType: '',
|
||||
attFileId: '',
|
||||
attachName: ''
|
||||
});
|
||||
},
|
||||
|
||||
// 选择文件附件类型
|
||||
selectFileAttachType(index, type) {
|
||||
this.formData.fileData[index].attType = type.value;
|
||||
this.showFileAttachTypePopup = -1;
|
||||
},
|
||||
|
||||
// 获取附件类型标签
|
||||
getAttachTypeLabel(typeValue) {
|
||||
if (!typeValue) return '';
|
||||
const option = this.fileAttachTypeOptions.find(type => type.value === typeValue);
|
||||
return option ? option.label : '';
|
||||
},
|
||||
|
||||
// 删除附件
|
||||
removeFile(index) {
|
||||
this.formData.fileData.splice(index, 1);
|
||||
},
|
||||
|
||||
// 上传文件
|
||||
uploadFile(index) {
|
||||
const fileData = this.formData.fileData[index];
|
||||
|
||||
// 检查是否选择了附件类型
|
||||
if (!fileData.attType) {
|
||||
uni.showToast({
|
||||
title: '请先选择附件类型',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 调用 uni.chooseMessageFile API 选择文件
|
||||
uni.chooseMessageFile({
|
||||
count: 1,
|
||||
type: 'file',
|
||||
extension: ['pdf', 'doc', 'docx', 'jpg', 'jpeg', 'png'], // 支持的文件类型
|
||||
success: (res) => {
|
||||
const tempFile = res.tempFiles[0];
|
||||
console.log("选择的文件:", tempFile);
|
||||
|
||||
// 设置文件名
|
||||
fileData.attachName = tempFile.name;
|
||||
|
||||
// 显示上传中提示
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
});
|
||||
|
||||
// 直接使用uni.uploadFile上传文件
|
||||
uni.uploadFile({
|
||||
url: RequsetUrl + apiArr.upload, // 完整的上传接口URL
|
||||
filePath: tempFile.path, // 文件路径
|
||||
name: 'file', // 文件对应的key,根据后端要求设置
|
||||
formData: {
|
||||
attType: fileData.attType // 附件类型
|
||||
},
|
||||
header: {
|
||||
Authorization: uni.getStorageSync("ctoken") // 添加认证信息
|
||||
},
|
||||
success: (uploadRes) => {
|
||||
// 解析响应数据
|
||||
const res = JSON.parse(uploadRes.data);
|
||||
|
||||
// 更新附件信息
|
||||
fileData.attFileId = res.data.respData.attFileId;
|
||||
fileData.attachName = tempFile.name; // 文件名
|
||||
|
||||
uni.showToast({
|
||||
title: '上传成功',
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: (error) => {
|
||||
console.error('文件上传失败:', error);
|
||||
uni.showToast({
|
||||
title: '上传失败',
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
complete: () => {
|
||||
uni.hideLoading(); // 隐藏加载提示
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('选择文件失败:', err);
|
||||
uni.showToast({
|
||||
title: '选择文件失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 表单验证
|
||||
validateForm() {
|
||||
const { formData } = this;
|
||||
|
||||
// 验证必需字段
|
||||
if (!formData.mch_id) {
|
||||
uni.showToast({ title: '请输入商户号', icon: 'none' });
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!formData.contactMobile) {
|
||||
uni.showToast({ title: '请输入联系手机号', icon: 'none' });
|
||||
return false;
|
||||
} else if (!/^1[3-9]\d{9}$/.test(formData.contactMobile)) {
|
||||
uni.showToast({ title: '请输入有效的手机号', icon: 'none' });
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
// 表单提交逻辑
|
||||
submitForm() {
|
||||
// 验证表单
|
||||
if (!this.validateForm()) {
|
||||
return;
|
||||
}
|
||||
|
||||
uni.showLoading({
|
||||
title: '提交中...',
|
||||
mask: true
|
||||
});
|
||||
|
||||
// 准备请求参数
|
||||
const submitData = {
|
||||
mch_id: this.formData.mch_id,
|
||||
merInnerNo: this.formData.merInnerNo,
|
||||
merCupNo: this.formData.merCupNo,
|
||||
contactMobile: this.formData.contactMobile,
|
||||
eleContractNo: this.formData.eleContractNo,
|
||||
attachments: []
|
||||
};
|
||||
|
||||
// 只添加有attFileId的文件到attachments
|
||||
const validFiles = this.formData.fileData.filter(file => file.attFileId);
|
||||
if (validFiles.length > 0) {
|
||||
submitData.attachments = validFiles.map(file => ({
|
||||
attachType: file.attType,
|
||||
attachName: file.attachName,
|
||||
attachStorePath: file.attFileId
|
||||
}));
|
||||
}
|
||||
|
||||
console.log('提交的数据:', submitData);
|
||||
|
||||
// 调用applyLedgerMer接口提交数据
|
||||
request(apiArr.applyLedgerMer, "POST", submitData).then(res => {
|
||||
uni.hideLoading();
|
||||
|
||||
if (res && res.cmdRetCode === 'SUCCESS') {
|
||||
uni.showToast({
|
||||
title: '提交成功',
|
||||
icon: 'success'
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res?.retMsg || '提交失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
uni.hideLoading();
|
||||
console.error('提交失败:', error);
|
||||
uni.showToast({
|
||||
title: '提交失败',
|
||||
icon: 'none'
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import url("./index.css");
|
||||
</style>
|
||||
@ -22,7 +22,7 @@ page {
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.select-btn{
|
||||
.download-btn{
|
||||
height: 65rpx;
|
||||
border: none;
|
||||
border-radius: 10rpx;
|
||||
@ -84,8 +84,14 @@ page {
|
||||
background-size: 24rpx 24rpx;
|
||||
}
|
||||
|
||||
.bottom-btn{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
/* 按钮样式 */
|
||||
.sign-btn,
|
||||
.submit-btn1,
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
@ -110,6 +116,13 @@ page {
|
||||
.submit-btn {
|
||||
background-color: #409eff;
|
||||
color: #fff;
|
||||
margin-left: 5rpx;
|
||||
}
|
||||
|
||||
.submit-btn1 {
|
||||
background-color: #ff4016;
|
||||
color: #fff;
|
||||
margin-right: 5rpx;
|
||||
}
|
||||
|
||||
.submit-btn:active {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<view class="contract-apply-container">
|
||||
<view class="page-header">
|
||||
<h1>合同申请</h1>
|
||||
<button type="button" class="select-btn" @click="ecQuery">合同查询</button>
|
||||
<button type="button" class="download-btn" @click="download">合同下载</button>
|
||||
</view>
|
||||
|
||||
<form class="contract-form">
|
||||
@ -103,13 +103,16 @@
|
||||
<button type="button" class="sign-btn" @click="goToSignAgreement">签署协议</button>
|
||||
|
||||
<!-- 提交申请按钮 -->
|
||||
<button type="button" class="submit-btn" @click="submitApplication">提交申请</button>
|
||||
<view class="bottom-btn">
|
||||
<button type="button" class="submit-btn1" @click="ecQuery">结果查询</button>
|
||||
<button type="button" class="submit-btn" @click="submitApplication">提交申请</button>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { picUrl, menuButtonInfo, request, NavgateTo } from "../../../utils";
|
||||
import { picUrl, menuButtonInfo, request, NavgateTo, RequsetUrl } from "../../../utils";
|
||||
import { apiArr } from "../../../api/contract";
|
||||
export default {
|
||||
data() {
|
||||
@ -156,9 +159,10 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 合同查询
|
||||
ecQuery() {
|
||||
if (!uni.getStorageSync('ec_apply_id')) {
|
||||
//下载合同
|
||||
download() {
|
||||
const storeValue = uni.getStorageSync('storeValue');
|
||||
if (!storeValue || !storeValue.ec_apply_id) {
|
||||
uni.showToast({
|
||||
title: '请先提交申请',
|
||||
icon: 'none'
|
||||
@ -166,10 +170,91 @@ export default {
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
ec_apply_id: uni.getStorageSync('ec_apply_id')
|
||||
ec_apply_id: storeValue.ec_apply_id
|
||||
};
|
||||
|
||||
uni.showLoading({
|
||||
title: '下载中',
|
||||
mask: true
|
||||
});
|
||||
|
||||
// 构建完整的下载URL
|
||||
const downloadUrl = `${RequsetUrl}${apiArr.ecDownload}?ec_apply_id=${storeValue.ec_apply_id}`;
|
||||
|
||||
// 调用uni.downloadFile进行文件下载
|
||||
uni.downloadFile({
|
||||
url: downloadUrl,
|
||||
header: {
|
||||
'Authorization': uni.getStorageSync('ctoken')
|
||||
},
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
// 下载成功,保存文件到本地
|
||||
uni.saveFile({
|
||||
tempFilePath: res.tempFilePath,
|
||||
success: (saveRes) => {
|
||||
uni.showToast({
|
||||
title: '下载成功',
|
||||
icon: 'success'
|
||||
});
|
||||
// 提示用户打开文件
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '合同已下载完成,是否立即打开?',
|
||||
success: (modalRes) => {
|
||||
if (modalRes.confirm) {
|
||||
// 打开文件
|
||||
uni.openDocument({
|
||||
filePath: saveRes.savedFilePath,
|
||||
showMenu: true,
|
||||
success: (openRes) => {
|
||||
console.log('文件打开成功');
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('文件打开失败:', err);
|
||||
uni.showToast({
|
||||
title: '文件打开失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('文件保存失败:', err);
|
||||
uni.showToast({
|
||||
title: '文件保存失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.hideLoading();
|
||||
console.error('下载请求失败:', err);
|
||||
uni.showToast({
|
||||
title: '下载失败,请稍后重试',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 合同查询
|
||||
ecQuery() {
|
||||
const storeValue = uni.getStorageSync('storeValue');
|
||||
if (!storeValue || !storeValue.ec_apply_id) {
|
||||
uni.showToast({
|
||||
title: '请先提交申请',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
ec_apply_id: storeValue.ec_apply_id
|
||||
}
|
||||
request(apiArr.ecQuery, "POST", params).then(res => {
|
||||
console.log("🚀 ~ res:", res)
|
||||
})
|
||||
},
|
||||
// 获取合同类别显示文本
|
||||
@ -253,7 +338,7 @@ export default {
|
||||
icon: 'success'
|
||||
});
|
||||
// 保存合同申请ID
|
||||
uni.setStorageSync('ec_apply_id', res.resp_data.ec_apply_id);
|
||||
uni.setStorageSync('storeValue', { ec_apply_id: res.resp_data.ec_apply_id });
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
@ -146,6 +146,11 @@ export default {
|
||||
image: "https://static.hshuishang.com/contract.png",
|
||||
name: "商户进件",
|
||||
url: "/packages/customerService/addMer/index",
|
||||
},
|
||||
{
|
||||
image: "https://static.hshuishang.com/contract.png",
|
||||
name: "分账申请",
|
||||
url: "/packages/customerService/applyLedgerMer/index",
|
||||
}
|
||||
],
|
||||
walletInfo: {},
|
||||
|
||||
@ -193,6 +193,13 @@
|
||||
"navigationBarTitleText": "商户进件",
|
||||
"navigationBarBackgroundColor": "#fff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "applyLedgerMer/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商户分账业务开通申请",
|
||||
"navigationBarBackgroundColor": "#fff"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user