hookehuyr

feat(收款设置): 添加收款账户绑定状态控制

添加 jee_pay_receiver_id 字段到用户状态管理
在收款设置页面根据绑定状态控制操作按钮显示
1 <!-- 1 <!--
2 * @Date: 2022-09-19 14:11:06 2 * @Date: 2022-09-19 14:11:06
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-08-13 16:46:03 4 + * @LastEditTime: 2025-08-16 14:16:46
5 * @FilePath: /jgdl/src/pages/collectionSettings/index.vue 5 * @FilePath: /jgdl/src/pages/collectionSettings/index.vue
6 * @Description: 收款设置 6 * @Description: 收款设置
7 --> 7 -->
...@@ -73,11 +73,13 @@ ...@@ -73,11 +73,13 @@
73 73
74 </view> 74 </view>
75 75
76 + <!-- 操作按钮 -->
76 <view class="modal-footer"> 77 <view class="modal-footer">
77 <nut-button type="default" @click="closeAccountModal" class="footer-btn footer-btn-cancel"> 78 <nut-button type="default" @click="closeAccountModal" class="footer-btn footer-btn-cancel">
78 关闭 79 关闭
79 </nut-button> 80 </nut-button>
80 - <nut-button type="primary" @click="saveAccountInfo" color="#ffa500" 81 + <!-- 保存按钮 - 只有在未绑定收款账户时才显示 -->
82 + <nut-button v-if="!jeePayReceiverId" type="primary" @click="saveAccountInfo" color="#ffa500"
81 :disabled="!tempAccountInfo.bankName || !tempAccountInfo.bankAccount" 83 :disabled="!tempAccountInfo.bankName || !tempAccountInfo.bankAccount"
82 class="footer-btn footer-btn-save"> 84 class="footer-btn footer-btn-save">
83 保存 85 保存
...@@ -171,11 +173,13 @@ ...@@ -171,11 +173,13 @@
171 </view> 173 </view>
172 </view> 174 </view>
173 175
176 + <!-- 操作按钮 -->
174 <view class="modal-footer"> 177 <view class="modal-footer">
175 <nut-button type="default" @click="closeIdentityModal" class="footer-btn footer-btn-cancel"> 178 <nut-button type="default" @click="closeIdentityModal" class="footer-btn footer-btn-cancel">
176 关闭 179 关闭
177 </nut-button> 180 </nut-button>
178 - <nut-button type="primary" @click="saveIdentityInfo" color="#ffa500" 181 + <!-- 保存按钮 - 只有在未绑定收款账户时才显示 -->
182 + <nut-button v-if="!jeePayReceiverId" type="primary" @click="saveIdentityInfo" color="#ffa500"
179 :disabled="!tempIdentityInfo.userName || !tempIdentityInfo.idCard || !tempIdentityInfo.idcard_1_img || !tempIdentityInfo.idcard_2_img || !tempIdentityInfo.idcard_province || !tempIdentityInfo.idcard_city || !tempIdentityInfo.idcard_district || !tempIdentityInfo.idcard_address || !!idCardError" 183 :disabled="!tempIdentityInfo.userName || !tempIdentityInfo.idCard || !tempIdentityInfo.idcard_1_img || !tempIdentityInfo.idcard_2_img || !tempIdentityInfo.idcard_province || !tempIdentityInfo.idcard_city || !tempIdentityInfo.idcard_district || !tempIdentityInfo.idcard_address || !!idCardError"
180 class="footer-btn footer-btn-save"> 184 class="footer-btn footer-btn-save">
181 保存 185 保存
...@@ -210,7 +214,7 @@ import "./index.less"; ...@@ -210,7 +214,7 @@ import "./index.less";
210 import { RectRight } from '@nutui/icons-vue-taro' 214 import { RectRight } from '@nutui/icons-vue-taro'
211 215
212 // 导入接口 216 // 导入接口
213 -import { updateProfileAPI, getProfileAPI } from '@/api/index' 217 +import { updateProfileAPI, getProfileAPI, bindJeePayAPI } from '@/api/index'
214 import { getBanksAPI } from '@/api/other' 218 import { getBanksAPI } from '@/api/other'
215 import BASE_URL from '@/utils/config' 219 import BASE_URL from '@/utils/config'
216 220
...@@ -229,6 +233,12 @@ const { target } = instance.router?.params || {} ...@@ -229,6 +233,12 @@ const { target } = instance.router?.params || {}
229 const userStore = useUserStore() 233 const userStore = useUserStore()
230 234
231 /** 235 /**
236 + * 收款账户绑定状态
237 + * 用于控制操作按钮的显示与隐藏
238 + */
239 +const jeePayReceiverId = ref('')
240 +
241 +/**
232 * 判断是否显示返回按钮 242 * 判断是否显示返回按钮
233 * 只有当参数target=sell时才显示 243 * 只有当参数target=sell时才显示
234 */ 244 */
...@@ -340,6 +350,10 @@ const getUserInfo = async () => { ...@@ -340,6 +350,10 @@ const getUserInfo = async () => {
340 if (result.code && result.data) { 350 if (result.code && result.data) {
341 const userInfo = result.data; 351 const userInfo = result.data;
342 352
353 + // 获取收款账户绑定状态
354 + jeePayReceiverId.value = userInfo.jee_pay_receiver_id || '';
355 + console.log('获取到的jee_pay_receiver_id:', jeePayReceiverId.value);
356 +
343 // 设置收款账号信息 357 // 设置收款账号信息
344 if (userInfo.bank_id && userInfo.bank_no) { 358 if (userInfo.bank_id && userInfo.bank_no) {
345 accountInfo.value = { 359 accountInfo.value = {
......
1 /* 1 /*
2 * @Date: 2025-01-08 18:00:00 2 * @Date: 2025-01-08 18:00:00
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-08-12 16:36:02 4 + * @LastEditTime: 2025-08-16 14:09:27
5 * @FilePath: /jgdl/src/stores/user.js 5 * @FilePath: /jgdl/src/stores/user.js
6 * @Description: 用户状态管理 6 * @Description: 用户状态管理
7 */ 7 */
...@@ -37,6 +37,7 @@ export const useUserStore = defineStore('user', { ...@@ -37,6 +37,7 @@ export const useUserStore = defineStore('user', {
37 idcard_district: '', 37 idcard_district: '',
38 idcard_address: '', 38 idcard_address: '',
39 division_agree_pic: '', 39 division_agree_pic: '',
40 + jee_pay_receiver_id: '',
40 }, 41 },
41 isAuthenticated: false, 42 isAuthenticated: false,
42 isLoading: false 43 isLoading: false
...@@ -146,6 +147,7 @@ export const useUserStore = defineStore('user', { ...@@ -146,6 +147,7 @@ export const useUserStore = defineStore('user', {
146 idcard_district: '', 147 idcard_district: '',
147 idcard_address: '', 148 idcard_address: '',
148 division_agree_pic: '', 149 division_agree_pic: '',
150 + jee_pay_receiver_id: '',
149 } 151 }
150 this.isAuthenticated = false 152 this.isAuthenticated = false
151 }, 153 },
......