新增功能 -- 合同申请之后弹窗提醒用户跳转页面输入信息

This commit is contained in:
赵毅 2025-12-05 14:04:51 +08:00
parent 57cfbe00d7
commit bb54f833d3
2 changed files with 151 additions and 14 deletions

View File

@ -138,4 +138,109 @@ page {
.contract-form { .contract-form {
padding: 20rpx; padding: 20rpx;
} }
}
/* 自定义弹窗样式 */
.custom-modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
.custom-modal {
width: 100%;
max-width: 650rpx;
background-color: #fff;
border-radius: 12rpx;
overflow: hidden;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.15);
}
.modal-header {
padding: 30rpx;
border-bottom: 2rpx solid #f0f0f0;
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-header h3 {
margin: 0;
font-size: 32rpx;
font-weight: 600;
color: #333;
}
.close-btn {
background: none;
border: none;
font-size: 40rpx;
color: #999;
cursor: pointer;
padding: 0;
width: 40rpx;
height: 40rpx;
display: flex;
justify-content: center;
align-items: center;
}
.modal-content {
padding: 40rpx 30rpx;
}
.modal-content p {
margin: 0 0 30rpx 0;
font-size: 28rpx;
color: #666;
line-height: 1.5;
}
.link-container {
background-color: #f5f5f5;
padding: 20rpx;
border-radius: 8rpx;
word-break: break-all;
}
.link-text {
color: #007aff;
font-size: 26rpx;
text-decoration: underline;
cursor: pointer;
}
.modal-footer {
padding: 0 30rpx 30rpx;
display: flex;
justify-content: center;
}
.confirm-btn {
background-color: #007aff;
color: #fff;
border: none;
line-height: 80rpx;
border-radius: 8rpx;
font-size: 28rpx;
cursor: pointer;
min-width: 200rpx;
height: 80rpx;
}
.confirm-btn2 {
border: none;
line-height: 80rpx;
border-radius: 8rpx;
font-size: 28rpx;
cursor: pointer;
min-width: 200rpx;
height: 80rpx;
} }

View File

@ -108,6 +108,22 @@
<button type="button" class="submit-btn" @click="submitApplication">提交申请</button> <button type="button" class="submit-btn" @click="submitApplication">提交申请</button>
</view> </view>
</form> </form>
<!-- 自定义弹窗 -->
<view v-if="showCustomModal" class="custom-modal-overlay" @click="closeModal">
<view class="custom-modal" @click.stop>
<view class="modal-content">
<p>查询结果前请先确认是否在以下页面中填写信息</p>
<view class="link-container">
<text class="link-text" @click="openApplyUrl">{{ applyUrl || '暂无链接' }}</text>
</view>
</view>
<view class="modal-footer">
<button type="button" class="confirm-btn2" @click="closeModal">取消</button>
<button type="button" class="confirm-btn" @click="confirmQuery">确认</button>
</view>
</view>
</view>
</view> </view>
</template> </template>
@ -149,7 +165,10 @@ export default {
acctTypeOptions: [ acctTypeOptions: [
{ label: '对公', value: '57' }, { label: '对公', value: '57' },
{ label: '对私', value: '58' } { label: '对私', value: '58' }
] ],
//
showCustomModal: false,
applyUrl: ''
}; };
}, },
onLoad(options) { onLoad(options) {
@ -243,6 +262,30 @@ export default {
}, },
// //
ecQuery() { ecQuery() {
//
this.applyUrl = uni.getStorageSync('applyUrl');
this.showCustomModal = true;
},
//
closeModal() {
this.showCustomModal = false;
},
//
openApplyUrl() {
if (this.applyUrl) {
uni.navigateTo({
url: `/pages/webview/webview?url=${encodeURIComponent(this.applyUrl)}`
});
}
},
//
confirmQuery() {
this.showCustomModal = false;
//
const storeValue = uni.getStorageSync('storeValue'); const storeValue = uni.getStorageSync('storeValue');
if (!storeValue || !storeValue.ec_apply_id) { if (!storeValue || !storeValue.ec_apply_id) {
uni.showToast({ uni.showToast({
@ -268,6 +311,7 @@ export default {
} }
}) })
}, },
// //
getEcTypeLabel(code) { getEcTypeLabel(code) {
// valuevalue // valuevalue
@ -282,24 +326,16 @@ export default {
}, },
// //
handleEcTypeClick() { handleEcTypeClick() {
console.log('点击了合同类别,当前状态:', this.showEcTypePicker);
this.showEcTypePicker = true; this.showEcTypePicker = true;
console.log('设置后状态:', this.showEcTypePicker);
}, },
handleCertTypeClick() { handleCertTypeClick() {
console.log('点击了证件类型,当前状态:', this.showCertTypePicker);
this.showCertTypePicker = true; this.showCertTypePicker = true;
console.log('设置后状态:', this.showCertTypePicker);
}, },
handleAcctTypeClick() { handleAcctTypeClick() {
console.log('点击了结算卡性质,当前状态:', this.showAcctTypePicker);
this.showAcctTypePicker = true; this.showAcctTypePicker = true;
console.log('设置后状态:', this.showAcctTypePicker);
}, },
// //
onEcTypeConfirm(e) { onEcTypeConfirm(e) {
console.log('合同类别确认事件:', e);
// uview-uiu-picker
const selectedValue = e.value[0]; const selectedValue = e.value[0];
// //
const selectedOption = this.ecTypeOptions.find(item => item.value === selectedValue); const selectedOption = this.ecTypeOptions.find(item => item.value === selectedValue);
@ -308,7 +344,6 @@ export default {
}, },
// //
onCertTypeConfirm(e) { onCertTypeConfirm(e) {
console.log('证件类型确认事件:', e);
const selectedValue = e.value[0]; const selectedValue = e.value[0];
const selectedOption = this.certTypeOptions.find(item => item.value === selectedValue.value); const selectedOption = this.certTypeOptions.find(item => item.value === selectedValue.value);
this.formData.cert_type = selectedOption ? selectedOption.value : selectedValue; this.formData.cert_type = selectedOption ? selectedOption.value : selectedValue;
@ -316,7 +351,6 @@ export default {
}, },
// //
onAcctTypeConfirm(e) { onAcctTypeConfirm(e) {
console.log('结算卡性质确认事件:', e);
const selectedValue = e.value[0]; const selectedValue = e.value[0];
const selectedOption = this.acctTypeOptions.find(item => item.value === selectedValue.value); const selectedOption = this.acctTypeOptions.find(item => item.value === selectedValue.value);
this.formData.acct_type_code = selectedOption ? selectedOption.value : selectedValue; this.formData.acct_type_code = selectedOption ? selectedOption.value : selectedValue;
@ -341,15 +375,13 @@ export default {
if (!this.validateForm()) { if (!this.validateForm()) {
return; return;
} }
//
console.log('提交的合同申请参数:', this.formData);
request(apiArr.ecApply, "POST", this.formData).then(res => { request(apiArr.ecApply, "POST", this.formData).then(res => {
uni.showToast({ uni.showToast({
title: '提交成功', title: '提交成功',
icon: 'success' icon: 'success'
}); });
// ID
uni.setStorageSync('storeValue', { ec_apply_id: res.resp_data.ec_apply_id }); uni.setStorageSync('storeValue', { ec_apply_id: res.resp_data.ec_apply_id });
uni.setStorageSync('applyUrl', res.resp_data.result_url);
}) })
}, },