d437ba67 by 张猛

小程序支付标志位

1 parent 256a8622
......@@ -1552,7 +1552,7 @@ export function certifiedNew(data) {
let url = '/system/certifiedNew/commit'
const params = []
if (data.renewYear) params.push(`renewYear=${data.renewYear}`)
if (data.type) params.push(`type=${data.type}`)
params.push(`type=${data.type}`)
if (data.contactPerson) params.push(`contactPerson=${data.contactPerson}`)
if (data.contactTel) params.push(`contactTel=${data.contactTel}`)
if (params.length > 0) {
......
......@@ -47,7 +47,7 @@
<view class="payRow ">
<radio-group @change="onPayTypeChange">
<label class="radioItem">
<radio :checked="payType == '1'" class="custom-radio" value="0"/>
<radio :checked="payType == '0'" class="custom-radio" value="0"/>
<view class="payInfo">
<image :src="config.baseUrl_api + '/fs/static/min.png'" class="icon" mode="widthFix"></image>
<text>民生付</text>
......@@ -116,7 +116,7 @@ const preferentialPolicy = ref(false)
const preferentialData = ref({
name: '优惠'
})
const payType = ref('1')
const payType = ref('0')
const isPaying = ref(false)
const payName = ref('')
const assoName = ref('')
......@@ -194,7 +194,7 @@ const handelPay = async () => {
// 构建请求参数
const params = {
renewYear: form.value.renewYear,
type: payType.value
type: payType.value,
}
// 对公转账需要传联系人信息
......
......@@ -30,32 +30,32 @@
<view class="section-title">选择支付方式</view>
<view class="payment-methods">
<radio-group @change="handlePayTypeChange">
<label class="payment-item" :class="{ selected: payType === '1' }">
<radio :checked="payType === '1'" value="0" />
<label :class="{ selected: payType === '1' }" class="payment-item">
<radio :checked="payType =='0'" value="0"/>
<image :src="config.baseUrl_api + '/fs/static/min.png'" class="icon ml10" mode="widthFix"></image>
<text class="pay-name ml10">民生付</text>
</label>
<label class="payment-item" :class="{ selected: payType === '3' }">
<radio :checked="payType === '3'" value="1" />
<label :class="{ selected: payType === '3' }" class="payment-item">
<radio :checked="payType === '3'" value="1"/>
<image :src="config.baseUrl_api + '/fs/static/min.png'" class="icon ml10" mode="widthFix"></image>
<text class="pay-name ml10">对公转账</text>
</label>
</radio-group>
</view>
</view>
<!-- 对公转账表单 -->
<view v-if="payType === '3'" class="transfer-form">
<view class="form-item">
<text class="form-label">联系人</text>
<input class="form-input" v-model="form.contactPerson" placeholder="请输入联系人" />
<input v-model="form.contactPerson" class="form-input" placeholder="请输入联系人"/>
</view>
<view class="form-item">
<text class="form-label">联系电话</text>
<input class="form-input" v-model="form.contactTel" type="number" placeholder="请输入联系电话" />
<input v-model="form.contactTel" class="form-input" placeholder="请输入联系电话" type="number"/>
</view>
</view>
<!-- 底部支付按钮 -->
<view class="fixed-bottom">
<button :loading="payLoading" class="pay-btn red-bg" @click="handlePay">立即支付</button>
......@@ -77,7 +77,7 @@ import {minShengPay} from "@/common/pay";
// 核心数据
const formData = ref({}) // 订单统计数据
const rangeId = ref('') // 核心业务ID
const payType = ref('1') // 支付方式(默认0=民生付)
const payType = ref('0') // 支付方式(默认0=民生付)
const payLoading = ref(false) // 支付按钮加载状态
const form = ref({
contactPerson: '',
......@@ -112,7 +112,7 @@ async function getCount() {
// 支付方式切换
function handlePayTypeChange(e) {
payType.value = e.detail.value == '0' ? '1' : '3'
payType.value = e.detail.value == '0' ? '0' : '3'
console.log('支付方式:', payType.value)
if (payType.value === '3') {
form.value.contactPerson = ''
......@@ -129,28 +129,28 @@ async function handlePay() {
icon: 'none'
})
}
// 对公转账校验
if (payType.value === '3') {
if (!form.value.contactPerson) {
return uni.showToast({ title: '请输入联系人', icon: 'none' })
return uni.showToast({title: '请输入联系人', icon: 'none'})
}
if (!form.value.contactTel) {
return uni.showToast({ title: '请输入联系电话', icon: 'none' })
return uni.showToast({title: '请输入联系电话', icon: 'none'})
}
// 手机号格式校验
if (!/^1[3-9]\d{9}$/.test(form.value.contactTel)) {
return uni.showToast({ title: '请输入正确的手机号', icon: 'none' })
return uni.showToast({title: '请输入正确的手机号', icon: 'none'})
}
}
try {
payLoading.value = true
uni.showLoading({
title: '提交中...',
mask: true
})
// 构建请求参数
const params = {
id: rangeId.value,
......@@ -160,10 +160,10 @@ async function handlePay() {
params.contactPerson = form.value.contactPerson
params.contactTel = form.value.contactTel
}
const res = await api.goPay(params)
const resData = res.data
// 对公转账 - 跳转转账信息页面
if (resData.payFlag == 2) {
uni.hideLoading()
......@@ -172,12 +172,12 @@ async function handlePay() {
})
return
}
// 民生付
if (resData.payResult && resData.payResult.encryptedData) {
const reason = await minShengPay(resData.orderId, resData.payResult.encryptedData)
if (reason == 'OK') {
uni.showToast({ title: '支付成功', icon: 'success' })
uni.showToast({title: '支付成功', icon: 'success'})
setTimeout(() => {
uni.hideLoading()
uni.redirectTo({
......@@ -186,7 +186,7 @@ async function handlePay() {
}, 1500)
}
}
} catch (err) {
console.log(err)
const errMsg = err?.data?.msg || err?.message || '支付失败,请稍后重试'
......@@ -271,7 +271,7 @@ async function handlePay() {
// 支付方式区域
.pay-type-section {
margin-bottom: 30rpx;
.section-title {
font-size: 32rpx;
font-weight: 600;
......@@ -279,7 +279,7 @@ async function handlePay() {
margin-bottom: 20rpx;
position: relative;
padding-left: 20rpx;
&::before {
content: '';
position: absolute;
......@@ -298,19 +298,19 @@ async function handlePay() {
background: #f8f9fa;
border-radius: 12rpx;
padding: 20rpx;
.payment-item {
display: flex;
align-items: center;
padding: 16rpx;
border-radius: 12rpx;
border: 2rpx solid transparent;
&.selected {
border-color: #e4393c;
background: #fff;
}
// 覆盖原生 radio 样式
::v-deep radio .wx-radio-input,
::v-deep radio .uni-radio-input {
......@@ -318,24 +318,24 @@ async function handlePay() {
height: 36rpx;
border-color: #ccc !important;
}
::v-deep radio .wx-radio-input.wx-radio-input-checked,
::v-deep radio .uni-radio-input-checked {
border-color: #e4393c !important;
background: #e4393c !important;
}
.icon {
width: 40rpx;
height: 40rpx;
}
.pay-name {
font-size: 30rpx;
color: #333;
font-weight: 500;
}
.ml10 {
margin-left: 10rpx;
}
......@@ -348,25 +348,25 @@ async function handlePay() {
border-radius: 12rpx;
padding: 20rpx;
margin-bottom: 30rpx;
.form-item {
display: flex;
align-items: center;
padding: 20rpx 0;
border-bottom: 1rpx solid #eee;
&:last-child {
border-bottom: none;
}
}
.form-label {
font-size: 28rpx;
color: #333;
width: 140rpx;
flex-shrink: 0;
}
.form-input {
flex: 1;
font-size: 28rpx;
......
......@@ -96,7 +96,7 @@
<text>我的订单</text>
<view class="arrow"></view>
</view>
<view class="level-item" @click="goPath('/level/chooseExaminer?pageType=1')">
<view class="level-item" @click="goPath('/level/chooseExaminer?pageType=1')">
<image :src="config.loginImage_api + '/fs/static/dg/icon11@2x.png'" class="level-icon"></image>
<text>考官库</text>
<view class="arrow"></view>
......@@ -569,7 +569,7 @@
</view>
</view>
</uni-popup>
<uni-popup ref="authPayPopup" :mask-click="false" type="center">
<view class="dialog-wrapper auth-pay-dialog">
<view class="dialog-title">提示</view>
......@@ -581,7 +581,7 @@
</view>
</view>
</uni-popup>
<!-- 密码长期未更新提示弹框 -->
<uni-popup ref="passwordTipPopup" :mask-click="false" type="center">
<view class="dialog-wrapper password-tip-dialog">
......@@ -637,7 +637,7 @@ const associateIdForAuthPay = ref(0)
// 是否是道馆用户
const isDaoGuan = computed(() => {
console.log('isDaoGuan', app.globalData.deptType,userType.value)
console.log('isDaoGuan', app.globalData.deptType, userType.value)
return userType.value == '4' || app.globalData.deptType == '6' || app.globalData.deptType == '3'
})
......@@ -691,7 +691,7 @@ onLoad(option => {
menus: ['shareAppMessage', 'shareTimeline']
});
}
console.log('app.globalData22',app.globalData.changePassFlag,app.globalData.memberInfo?.activeStatus,app.globalData.authenticationStatus)
console.log('app.globalData22', app.globalData.changePassFlag, app.globalData.memberInfo?.activeStatus, app.globalData.authenticationStatus)
});
......@@ -1027,14 +1027,14 @@ async function handleNoDisplay() {
function checkDialogs() {
const user = app.globalData.userInfo || {}
const memberInfoData = app.globalData.memberInfo || {}
// 密码长期未更新提示: changePassFlag='1' && activeStatus=1 && authenticationStatus=2
if (app.globalData.changePassFlag == '1' &&
app.globalData.memberInfo?.activeStatus == '1' &&
app.globalData.authenticationStatus == 2) {
passwordTipPopup.value.open()
// passwordTipPopup.value.open()
}
// 绑定手机号条件: changePassFlag='1' && activeStatus=1 && authenticationStatus=2 && phonenumber为空 && checkFlag=1
if (app.globalData.changePassFlag === '1' &&
app.globalData.memberInfo?.activeStatus == 1 &&
......@@ -1044,7 +1044,7 @@ function checkDialogs() {
refreshCaptcha()
bindingPhonePopup.value.open()
}
// 申请考点条件: activeStatus=1 && authenticationStatus=2 && hintFlag=1 && deptType=6 && isPoints=1
if (app.globalData.memberInfo?.activeStatus == 1 &&
app.globalData.authenticationStatus == 2 &&
......@@ -1484,6 +1484,7 @@ function checkDialogs() {
.dialog-icon {
color: #AD181F;
}
.dialog-message {
font-size: 28rpx;
color: #606266;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!