4ecc383f by lttnew

bug修复

1 parent 2a11a442
...@@ -17,24 +17,23 @@ ...@@ -17,24 +17,23 @@
17 17
18 let userName = uni.getStorageSync('userName') 18 let userName = uni.getStorageSync('userName')
19 if (userName) { 19 if (userName) {
20 try { 20 try {
21 await getInfo(this) 21 await getInfo(this)
22 this.globalData.isLogin = true 22 this.globalData.isLogin = true
23 } catch (e) { 23 } catch (e) {
24 this.globalData.isLogin = false 24 this.globalData.isLogin = false
25 uni.removeStorageSync('token') 25 uni.removeStorageSync('token')
26 uni.removeStorageSync('userName') 26 uni.removeStorageSync('userName')
27 uni.reLaunch({ 27 uni.reLaunch({
28 url: '/login/login' 28 url: '/login/login'
29 }) 29 })
30 return 30 return
31 } 31 }
32 // 道馆用户跳转到道馆首页 32 // 道馆用户跳转到道馆首页
33 const deptType = this.globalData.deptType 33 const deptType = this.globalData.deptType
34 const userType = this.globalData.userType 34 const userType = this.globalData.userType
35
36 // 道馆判断:deptType=6 或者 userType='4' 35 // 道馆判断:deptType=6 或者 userType='4'
37 if (deptType == 6 || deptType == '6' || userType == '4') { 36 if (deptType == 6 || deptType == '6' || userType == '4' || deptType == null) {
38 uni.reLaunch({ 37 uni.reLaunch({
39 url: '/pages/index/daoGuanPerson' 38 url: '/pages/index/daoGuanPerson'
40 }) 39 })
......
...@@ -141,13 +141,14 @@ export function deptTreeSelect(params) { ...@@ -141,13 +141,14 @@ export function deptTreeSelect(params) {
141 } 141 }
142 142
143 // 注册选择协会树 143 // 注册选择协会树
144 export function certifiedDeptTreeRegister(params) { 144 export function certifiedDeptTreeRegister(params, options = {}) {
145 return request({ 145 return request({
146 url: '/system/user/certifiedDeptTreeWithNoDaoguan2', 146 ...options,
147 method: 'get', 147 url: '/system/user/certifiedDeptTreeWithNoDaoguan2',
148 params 148 method: 'get',
149 }) 149 params
150 } 150 })
151 }
151 152
152 const setIdToString = (list) => { 153 const setIdToString = (list) => {
153 for (var l of list) { 154 for (var l of list) {
...@@ -208,13 +209,14 @@ export function reader(query) { ...@@ -208,13 +209,14 @@ export function reader(query) {
208 }) 209 })
209 } 210 }
210 211
211 export function regionsList(params) { 212 export function regionsList(params, options = {}) {
212 return request({ 213 return request({
213 url: '/common/region/regionsList', 214 ...options,
214 method: 'get', 215 url: '/common/region/regionsList',
215 params 216 method: 'get',
216 }) 217 params
217 } 218 })
219 }
218 220
219 // 添加会员自动录入 上传图片 221 // 添加会员自动录入 上传图片
220 export function carUrl(data, type) { 222 export function carUrl(data, type) {
...@@ -477,12 +479,13 @@ export function getFeeBillDetail(payId) { ...@@ -477,12 +479,13 @@ export function getFeeBillDetail(payId) {
477 } 479 }
478 480
479 // 获取自己团队成员信息 481 // 获取自己团队成员信息
480 export function getMyOwnMemberInfo() { 482 export function getMyOwnMemberInfo(options = {}) {
481 return request({ 483 return request({
482 url: '/member/info/getMyOwnMemberInfo', 484 ...options,
483 method: 'get' 485 url: '/member/info/getMyOwnMemberInfo',
484 }) 486 method: 'get'
485 } 487 })
488 }
486 489
487 // 会员调入 490 // 会员调入
488 export function getMobilizelist(params) { 491 export function getMobilizelist(params) {
...@@ -1530,13 +1533,14 @@ export function checkPersonByPersonId(perId) { ...@@ -1530,13 +1533,14 @@ export function checkPersonByPersonId(perId) {
1530 } 1533 }
1531 1534
1532 // 获取单位会员优惠政策 1535 // 获取单位会员优惠政策
1533 export function canUseDiscount(params) { 1536 export function canUseDiscount(params, options = {}) {
1534 return request({ 1537 return request({
1535 url: `/system/certifiedNew/canUseDiscount`, 1538 ...options,
1536 method: 'get', 1539 url: `/system/certifiedNew/canUseDiscount`,
1537 params 1540 method: 'get',
1538 }) 1541 params
1539 } 1542 })
1543 }
1540 1544
1541 // 获取单位会员一年缴费价格 1545 // 获取单位会员一年缴费价格
1542 export function getMyMemberCertUnitFee(params) { 1546 export function getMyMemberCertUnitFee(params) {
...@@ -1626,13 +1630,14 @@ export function pcallBack2(orderId) { ...@@ -1626,13 +1630,14 @@ export function pcallBack2(orderId) {
1626 } 1630 }
1627 1631
1628 // 优惠政策回显 1632 // 优惠政策回显
1629 export function getZtxDiscountPolicy(params) { 1633 export function getZtxDiscountPolicy(params, options = {}) {
1630 return request({ 1634 return request({
1631 url: '/system/config/getZtxDiscountPolicy', 1635 ...options,
1632 method: 'get', 1636 url: '/system/config/getZtxDiscountPolicy',
1633 params 1637 method: 'get',
1634 }) 1638 params
1635 } 1639 })
1640 }
1636 1641
1637 // 考官列表 1642 // 考官列表
1638 export function listApi(params) { 1643 export function listApi(params) {
...@@ -1684,12 +1689,13 @@ export function commitExamPointApply(params) { ...@@ -1684,12 +1689,13 @@ export function commitExamPointApply(params) {
1684 }) 1689 })
1685 } 1690 }
1686 1691
1687 export function getMyStatus() { 1692 export function getMyStatus(options = {}) {
1688 return request({ 1693 return request({
1689 url: `/member/examPointApply/getMyStatus`, 1694 ...options,
1690 method: 'get', 1695 url: `/member/examPointApply/getMyStatus`,
1691 }) 1696 method: 'get',
1692 } 1697 })
1698 }
1693 1699
1694 // 个人会员缴费支付 1700 // 个人会员缴费支付
1695 export function goPay(params) { 1701 export function goPay(params) {
...@@ -1782,12 +1788,13 @@ export function createMemberPayRange(data) { ...@@ -1782,12 +1788,13 @@ export function createMemberPayRange(data) {
1782 } 1788 }
1783 1789
1784 // 获取最近认证记录 单位会员 1790 // 获取最近认证记录 单位会员
1785 export function getMyRecent() { 1791 export function getMyRecent(options = {}) {
1786 return request({ 1792 return request({
1787 url: '/system/certifiedNew/getMyRecent', 1793 ...options,
1788 method: 'get' 1794 url: '/system/certifiedNew/getMyRecent',
1789 }) 1795 method: 'get'
1790 } 1796 })
1797 }
1791 1798
1792 1799
1793 // 获取最近认证记录 考点 1800 // 获取最近认证记录 考点
......
...@@ -44,7 +44,7 @@ export function isDaoGuanRole() { ...@@ -44,7 +44,7 @@ export function isDaoGuanRole() {
44 const app = getApp() 44 const app = getApp()
45 const deptType = app.globalData?.deptType 45 const deptType = app.globalData?.deptType
46 const userType = app.globalData?.userType 46 const userType = app.globalData?.userType
47 return deptType == 6 || deptType == '6' || userType == '4' 47 return deptType == null || deptType == 6 || deptType == '6' || userType == '4'
48 } 48 }
49 49
50 export function reLaunchHomeByRole() { 50 export function reLaunchHomeByRole() {
......
...@@ -190,7 +190,7 @@ function goHomeAfterLogin() { ...@@ -190,7 +190,7 @@ function goHomeAfterLogin() {
190 const deptType = app.globalData.deptType 190 const deptType = app.globalData.deptType
191 const userType = app.globalData.userType 191 const userType = app.globalData.userType
192 uni.reLaunch({ 192 uni.reLaunch({
193 url: (deptType == 6 || deptType == '6' || userType == '4') ? '/pages/index/daoGuanPerson' : '/pages/index/home' 193 url: (deptType == 6 || deptType == '6' || userType == '4' || deptType == null ) ? '/pages/index/daoGuanPerson' : '/pages/index/home'
194 }) 194 })
195 } 195 }
196 196
...@@ -235,12 +235,12 @@ function login() { ...@@ -235,12 +235,12 @@ function login() {
235 pcLogin(form.value).then(() => { 235 pcLogin(form.value).then(() => {
236 app.globalData.isLogin = true 236 app.globalData.isLogin = true
237 goHomeAfterLogin() 237 goHomeAfterLogin()
238 }).catch((err) => { 238 }).catch((err) => {
239 console.error('登录失败:', err) 239 console.error('登录失败:', err)
240 refreshCodeWhenNotServerError(err) 240 refreshCodeWhenNotServerError(err)
241 uni.showToast({title: '登录失败', icon: 'none'}) 241 uni.showToast({title: '登录失败', icon: 'none'})
242 }).finally(() => { 242 }).finally(() => {
243 loading.value = false 243 loading.value = false
244 }) 244 })
245 } else if (isActive.value == 1) { 245 } else if (isActive.value == 1) {
246 if (!form2.value.telNo) { 246 if (!form2.value.telNo) {
...@@ -258,16 +258,16 @@ function login() { ...@@ -258,16 +258,16 @@ function login() {
258 } 258 }
259 if (loading.value) return; 259 if (loading.value) return;
260 loading.value = true 260 loading.value = true
261 loginByPhone(form2.value.telNo, form2.value.code) 261 loginByPhone(form2.value.telNo, form2.value.code)
262 .then(() => { 262 .then(() => {
263 app.globalData.isLogin = true 263 app.globalData.isLogin = true
264 goHomeAfterLogin() 264 goHomeAfterLogin()
265 }).catch((err) => { 265 }).catch((err) => {
266 console.error('短信登录失败:', err) 266 console.error('短信登录失败:', err)
267 refreshCodeWhenNotServerError(err) 267 refreshCodeWhenNotServerError(err)
268 }).finally(() => { 268 }).finally(() => {
269 loading.value = false 269 loading.value = false
270 }) 270 })
271 } 271 }
272 } 272 }
273 273
...@@ -288,29 +288,29 @@ function confirmRegister() { ...@@ -288,29 +288,29 @@ function confirmRegister() {
288 uni.navigateTo({url: '/login/register'}) 288 uni.navigateTo({url: '/login/register'})
289 } 289 }
290 290
291 function getCode() { 291 function getCode() {
292 uni.hideLoading() 292 uni.hideLoading()
293 getCodeImg().then((res) => { 293 getCodeImg().then((res) => {
294 codeUrl.value = 'data:image/gif;base64,' + res.data.img 294 codeUrl.value = 'data:image/gif;base64,' + res.data.img
295 form.value.uuid = res.data.uuid 295 form.value.uuid = res.data.uuid
296 form2.value.uuid = res.data.uuid 296 form2.value.uuid = res.data.uuid
297 }) 297 })
298 } 298 }
299 299
300 function isServer500(err) { 300 function isServer500(err) {
301 const message = String(err?.message || err?.errMsg || '') 301 const message = String(err?.message || err?.errMsg || '')
302 return err?.statusCode === 500 || 302 return err?.statusCode === 500 ||
303 err?.code === 500 || 303 err?.code === 500 ||
304 err?.data?.code === 500 || 304 err?.data?.code === 500 ||
305 message.includes('HTTP 500') 305 message.includes('HTTP 500')
306 } 306 }
307 307
308 function refreshCodeWhenNotServerError(err) { 308 function refreshCodeWhenNotServerError(err) {
309 if (isServer500(err)) return 309 if (isServer500(err)) return
310 getCode() 310 getCode()
311 } 311 }
312 312
313 function getCaptchaSms() { 313 function getCaptchaSms() {
314 if (!form2.value.telNo) { 314 if (!form2.value.telNo) {
315 uni.showToast({title: '手机号不能为空', icon: 'none'}) 315 uni.showToast({title: '手机号不能为空', icon: 'none'})
316 return 316 return
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
48 <view class="info"> 48 <view class="info">
49 <text class="name">{{ item.perName }} {{ item.perCode }}</text> 49 <text class="name">{{ item.perName }} {{ item.perCode }}</text>
50 <text class="idc">证件号码:{{ item.perIdcCode }}</text> 50 <text class="idc">证件号码:{{ item.perIdcCode }}</text>
51 <text class="reg">注册地:{{ JSON.parse(item.roleInfo).unit || '' }}</text> 51 <text class="reg">注册地:{{ item.pmName }}</text>
52 </view> 52 </view>
53 53
54 <button class="del-btn" @click="handleDel(item)">删除</button> 54 <button class="del-btn" @click="handleDel(item)">删除</button>
...@@ -186,6 +186,9 @@ function handleDel(row) { ...@@ -186,6 +186,9 @@ function handleDel(row) {
186 function onSelfSelectChange(e) { 186 function onSelfSelectChange(e) {
187 form.value.selfSelect = e.detail.value 187 form.value.selfSelect = e.detail.value
188 showExamine.value = e.detail.value == '1' 188 showExamine.value = e.detail.value == '1'
189 list.value = []
190 searchResult.value = null
191 searchNoData.value = false
189 // if (e.detail.value == '0') { 192 // if (e.detail.value == '0') {
190 // modalAction = 'assign' 193 // modalAction = 'assign'
191 // modalConfig.value = { 194 // modalConfig.value = {
......
...@@ -128,6 +128,7 @@ const unpaidPopup = ref(null) ...@@ -128,6 +128,7 @@ const unpaidPopup = ref(null)
128 const payForm = ref({}) 128 const payForm = ref({})
129 const customModalRef = ref(null) 129 const customModalRef = ref(null)
130 const modalConfig = ref({}) 130 const modalConfig = ref({})
131 const navigatingPerfect = ref(false)
131 const showDirectlyForAuthPay = ref(false) 132 const showDirectlyForAuthPay = ref(false)
132 const directUnderFlagForAuthPay = ref(0) 133 const directUnderFlagForAuthPay = ref(0)
133 const associateIdForAuthPay = ref(0) 134 const associateIdForAuthPay = ref(0)
...@@ -175,14 +176,35 @@ onLoad((option) => { ...@@ -175,14 +176,35 @@ onLoad((option) => {
175 176
176 onShow(() => { 177 onShow(() => {
177 if (app.globalData.isLogin) { 178 if (app.globalData.isLogin) {
179 if (quickGoPerfectByCachedStatus()) return
178 init() 180 init()
179 } else { 181 } else {
180 app.firstLoadCallback = () => { 182 app.firstLoadCallback = () => {
183 if (quickGoPerfectByCachedStatus()) return
181 init() 184 init()
182 } 185 }
183 } 186 }
184 }) 187 })
185 188
189 function quickGoPerfectByCachedStatus() {
190 if (!hasCachedAuthStatus()) return false
191 if (navigatingPerfect.value) return true
192 const authStatus = String(app.globalData.authenticationStatus)
193 const memberInfoData = app.globalData.memberInfo || {}
194 const shouldGoPerfect = authStatus === '0' ||
195 authStatus === '3' ||
196 (authStatus === '1' && !memberInfoData.memCode)
197 if (!shouldGoPerfect) return false
198 goPerfectFromDaoGuan()
199 return true
200 }
201
202 function hasCachedAuthStatus() {
203 return app.globalData.authenticationStatus !== undefined &&
204 app.globalData.authenticationStatus !== null &&
205 String(app.globalData.authenticationStatus) !== 'undefined'
206 }
207
186 function init() { 208 function init() {
187 checkImgExist() 209 checkImgExist()
188 // handelGetMyRecent() 210 // handelGetMyRecent()
...@@ -203,9 +225,9 @@ function init() { ...@@ -203,9 +225,9 @@ function init() {
203 checkDialogs() 225 checkDialogs()
204 }) 226 })
205 227
206 api.getRemindCount().then(res => { 228 // api.getRemindCount().then(res => {
207 numData.value = res.data || {} 229 // numData.value = res.data || {}
208 }) 230 // })
209 231
210 api.getBlack().then(res => { 232 api.getBlack().then(res => {
211 isBlack.value = res.data 233 isBlack.value = res.data
...@@ -239,13 +261,13 @@ function handleAccountStatus() { ...@@ -239,13 +261,13 @@ function handleAccountStatus() {
239 const activeStatus = memberInfoData.activeStatus 261 const activeStatus = memberInfoData.activeStatus
240 262
241 if (!app.globalData.authenticationStatus || authStatus === 'undefined' || authStatus === '0' || authStatus === '3') { 263 if (!app.globalData.authenticationStatus || authStatus === 'undefined' || authStatus === '0' || authStatus === '3') {
242 uni.navigateTo({ url: '/pages/index/perfect' }) 264 goPerfectFromDaoGuan()
243 return 265 return
244 } 266 }
245 267
246 if (authStatus === '1') { 268 if (authStatus === '1') {
247 if (!memberInfoData.memCode) { 269 if (!memberInfoData.memCode) {
248 uni.navigateTo({ url: '/pages/index/perfect' }) 270 goPerfectFromDaoGuan()
249 } 271 }
250 return 272 return
251 } 273 }
...@@ -292,6 +314,19 @@ function showMemberStatusDialog(content, shouldGoAuth) { ...@@ -292,6 +314,19 @@ function showMemberStatusDialog(content, shouldGoAuth) {
292 }) 314 })
293 } 315 }
294 316
317 function goPerfectFromDaoGuan() {
318 if (navigatingPerfect.value) return
319 navigatingPerfect.value = true
320 uni.redirectTo({
321 url: '/pages/index/perfect',
322 complete: () => {
323 setTimeout(() => {
324 navigatingPerfect.value = false
325 }, 300)
326 }
327 })
328 }
329
295 function goPath(path) { 330 function goPath(path) {
296 if (isBlack.value == '1') { 331 if (isBlack.value == '1') {
297 uni.showModal({ 332 uni.showModal({
...@@ -428,6 +463,7 @@ async function checkExamPointDialog() { ...@@ -428,6 +463,7 @@ async function checkExamPointDialog() {
428 const examData = res?.data 463 const examData = res?.data
429 const status = examData?.auditStatus 464 const status = examData?.auditStatus
430 const canShowByExamStatus = examData == null || status == 0 || status == 3 465 const canShowByExamStatus = examData == null || status == 0 || status == 3
466 console.log('打印',canShowByExamStatus, app.globalData.memberInfo?.activeStatus,app.globalData.authenticationStatus, app.globalData.deptType ,app.globalData.userInfo.hintFlag,app.globalData.memberInfo?.isPoints)
431 if (canShowByExamStatus && 467 if (canShowByExamStatus &&
432 app.globalData.memberInfo?.activeStatus == 1 && 468 app.globalData.memberInfo?.activeStatus == 1 &&
433 app.globalData.authenticationStatus == 2 && 469 app.globalData.authenticationStatus == 2 &&
......
...@@ -341,10 +341,10 @@ ...@@ -341,10 +341,10 @@
341 <image :src="config.baseUrl_api+'/fs/static/icon/17.png'"/> 341 <image :src="config.baseUrl_api+'/fs/static/icon/17.png'"/>
342 审核记录 342 审核记录
343 </view> 343 </view>
344 <view @click="goPath('/level/ztx/costSettlement')"> 344 <!-- <view @click="goPath('/level/ztx/costSettlement')">
345 <image :src="config.baseUrl_api+'/fs/static/icon/10.png'"/> 345 <image :src="config.baseUrl_api+'/fs/static/icon/10.png'"/>
346 费用结算 346 费用结算
347 </view> 347 </view> -->
348 </view> 348 </view>
349 349
350 <!-- <view class="ttt">段位管理</view> 350 <!-- <view class="ttt">段位管理</view>
......
...@@ -483,7 +483,7 @@ const payForm = ref({}) ...@@ -483,7 +483,7 @@ const payForm = ref({})
483 // 获取最近认证记录,判断是否有未支付订单 483 // 获取最近认证记录,判断是否有未支付订单
484 function handelGetMyRecent() { 484 function handelGetMyRecent() {
485 return new Promise(async (resolve, reject) => { 485 return new Promise(async (resolve, reject) => {
486 const res = await api.getMyRecent() ?? {} 486 const res = await api.getMyRecent({showLoading: false}) ?? {}
487 payForm.value = res.data?.comOrder ?? {} 487 payForm.value = res.data?.comOrder ?? {}
488 // payStatus: '0' 未支付, '1' 已支付, '2' 已取消 488 // payStatus: '0' 未支付, '1' 已支付, '2' 已取消
489 if (payForm.value.content) payForm.value.content = JSON.parse(payForm.value.content) 489 if (payForm.value.content) payForm.value.content = JSON.parse(payForm.value.content)
...@@ -540,7 +540,7 @@ async function handelCancelOrder() { ...@@ -540,7 +540,7 @@ async function handelCancelOrder() {
540 // 获取审核详情 540 // 获取审核详情
541 function getMyCertStageFN() { 541 function getMyCertStageFN() {
542 auditLoading.value = true 542 auditLoading.value = true
543 api.getMyRecent().then(res => { 543 api.getMyRecent({showLoading: false}).then(res => {
544 auditLoading.value = false 544 auditLoading.value = false
545 if (res.data && res.data.auditLogs) { 545 if (res.data && res.data.auditLogs) {
546 try { 546 try {
...@@ -638,12 +638,12 @@ function init() { ...@@ -638,12 +638,12 @@ function init() {
638 638
639 // 获取详情 639 // 获取详情
640 function getDetail() { 640 function getDetail() {
641 api.getMyOwnMemberInfo().then(res => { 641 api.getMyOwnMemberInfo({showLoading: false}).then(res => {
642 // if (res.data.memberInfo) { 642 // if (res.data.memberInfo) {
643 // Object.assign(form.value, res.data.memberInfo) 643 // Object.assign(form.value, res.data.memberInfo)
644 // } 644 // }
645 form.value = {...res.data.dept, ...res.data.memberInfo} 645 form.value = {...res.data.dept, ...res.data.memberInfo}
646 form.value.deptType = res.data.memberInfo.deptType || res.data.dept.deptType 646 form.value.deptType = res.data.memberInfo?.deptType || res.data.dept?.deptType
647 if (form.value.type) { 647 if (form.value.type) {
648 form.value.type = String(form.value.type) 648 form.value.type = String(form.value.type)
649 } 649 }
...@@ -753,7 +753,7 @@ function formatRegionTree(node) { ...@@ -753,7 +753,7 @@ function formatRegionTree(node) {
753 753
754 // 获取地区列表 754 // 获取地区列表
755 function getRegionsList() { 755 function getRegionsList() {
756 api.regionsList().then(res => { 756 api.regionsList(null, {showLoading: false}).then(res => {
757 options.value = res.data 757 options.value = res.data
758 // 转换为级联选择器格式 758 // 转换为级联选择器格式
759 regionOptions.value = res.data 759 regionOptions.value = res.data
...@@ -763,13 +763,12 @@ function getRegionsList() { ...@@ -763,13 +763,12 @@ function getRegionsList() {
763 763
764 // 获取协会树 764 // 获取协会树
765 function getTree() { 765 function getTree() {
766 console.log('获取协会树')
767 api.certifiedDeptTreeRegister({ 766 api.certifiedDeptTreeRegister({
768 selfDeptId: -1, // 修复:传数字类型,避免后端类型转换错误 767 selfDeptId: -1, // 修复:传数字类型,避免后端类型转换错误
769 webSiteShow: 1, 768 webSiteShow: 1,
770 showDisabled: 1, 769 showDisabled: 1,
771 isBlack: 0 770 isBlack: 0
772 }).then(res => { 771 }, {showLoading: false}).then(res => {
773 assoList.value = res.data.map(item => formatTree(item)) 772 assoList.value = res.data.map(item => formatTree(item))
774 // 树加载完成后,如果有parentId,设置完整路径名称 773 // 树加载完成后,如果有parentId,设置完整路径名称
775 if (form.value.parentId) { 774 if (form.value.parentId) {
...@@ -826,16 +825,13 @@ function changCase(e) { ...@@ -826,16 +825,13 @@ function changCase(e) {
826 // 取最后一级的value(纯ID) 825 // 取最后一级的value(纯ID)
827 const lastNode = valueArr[valueArr.length - 1]; 826 const lastNode = valueArr[valueArr.length - 1];
828 form.value.parentId = lastNode?.value || ''; 827 form.value.parentId = lastNode?.value || '';
829 console.log('最终提交的parentId:', form.value.parentId);
830 assoFullName.value = getAssoFullName(valueArr) 828 assoFullName.value = getAssoFullName(valueArr)
831 console.log('协会完整路径:', assoFullName.value);
832 } 829 }
833 830
834 // 地址选择(核心修复:从对象中提取纯value,对齐PC端格式) 831 // 地址选择(核心修复:从对象中提取纯value,对齐PC端格式)
835 // 地址选择(还原成你之前能用的版本:纯ID数组赋值) 832 // 地址选择(还原成你之前能用的版本:纯ID数组赋值)
836 function changeAddress(e) { 833 function changeAddress(e) {
837 const selectedValue = e.detail?.value ?? e; 834 const selectedValue = e.detail?.value ?? e;
838 console.log("选择的地址:", selectedValue);
839 835
840 // 直接赋值纯ID,不要再取 .value 836 // 直接赋值纯ID,不要再取 .value
841 form.value.provinceId = selectedValue[0].value || ''; 837 form.value.provinceId = selectedValue[0].value || '';
...@@ -845,7 +841,6 @@ function changeAddress(e) { ...@@ -845,7 +841,6 @@ function changeAddress(e) {
845 // 同步更新选择器显示 841 // 同步更新选择器显示
846 coordinates1.value = selectedValue; 842 coordinates1.value = selectedValue;
847 843
848 console.log('最终地址ID:', form.value.provinceId, form.value.cityId, form.value.regionId);
849 } 844 }
850 845
851 // 获取会员认证费用 846 // 获取会员认证费用
...@@ -857,21 +852,21 @@ function getMyMemberCertUnitFeeApi() { ...@@ -857,21 +852,21 @@ function getMyMemberCertUnitFeeApi() {
857 852
858 // 检查是否可用优惠政策 853 // 检查是否可用优惠政策
859 function canUseDiscountApi() { 854 function canUseDiscountApi() {
860 api.canUseDiscount().then(res => { 855 api.canUseDiscount(null, {showLoading: false}).then(res => {
861 preferentialPolicy.value = res.data 856 preferentialPolicy.value = res.data
862 }) 857 })
863 } 858 }
864 859
865 // 获取优惠政策详情 860 // 获取优惠政策详情
866 function getZtxDiscountPolicyApi() { 861 function getZtxDiscountPolicyApi() {
867 api.getZtxDiscountPolicy().then(res => { 862 api.getZtxDiscountPolicy(null, {showLoading: false}).then(res => {
868 preferentialData.value = res.data 863 preferentialData.value = res.data
869 }) 864 })
870 } 865 }
871 866
872 // 获取考点申请状态 867 // 获取考点申请状态
873 function getMyStatusAPI() { 868 function getMyStatusAPI() {
874 api.getMyStatus().then(res => { 869 api.getMyStatus({showLoading: false}).then(res => {
875 if (res.data && res.data.auditStatus) { 870 if (res.data && res.data.auditStatus) {
876 auditStatus.value = res.data.auditStatus 871 auditStatus.value = res.data.auditStatus
877 } else { 872 } else {
...@@ -913,7 +908,7 @@ function submitStep1() { ...@@ -913,7 +908,7 @@ function submitStep1() {
913 setTimeout(() => { 908 setTimeout(() => {
914 activeStep.value = 2 909 activeStep.value = 2
915 getDetail() 910 getDetail()
916 }, 1500) 911 }, 500)
917 } else { 912 } else {
918 uni.showToast({title: res.msg || '操作失败', duration: 2000, icon: 'none'}) 913 uni.showToast({title: res.msg || '操作失败', duration: 2000, icon: 'none'})
919 } 914 }
...@@ -1058,7 +1053,6 @@ function submitCertification() { ...@@ -1058,7 +1053,6 @@ function submitCertification() {
1058 companyName: form.value.companyName, 1053 companyName: form.value.companyName,
1059 legalIdcCode: form.value.legalIdcCode 1054 legalIdcCode: form.value.legalIdcCode
1060 } 1055 }
1061 console.log(666, params)
1062 // return 1056 // return
1063 uni.showLoading({title: '提交中...'}) 1057 uni.showLoading({title: '提交中...'})
1064 api.editMyMemberCertifiedInfo(params).then(res => { 1058 api.editMyMemberCertifiedInfo(params).then(res => {
...@@ -1068,12 +1062,11 @@ function submitCertification() { ...@@ -1068,12 +1062,11 @@ function submitCertification() {
1068 // 跳转缴费页面 1062 // 跳转缴费页面
1069 setTimeout(() => { 1063 setTimeout(() => {
1070 const assoName = assoFullName.value 1064 const assoName = assoFullName.value
1071 console.log(888, assoName)
1072 // 跳转到缴费页面 1065 // 跳转到缴费页面
1073 uni.navigateTo({ 1066 uni.navigateTo({
1074 url: `/myCenter/goPay?payName=${encodeURIComponent(form.value.name || '')}&assoName=${encodeURIComponent(assoName)}` 1067 url: `/myCenter/goPay?payName=${encodeURIComponent(form.value.name || '')}&assoName=${encodeURIComponent(assoName)}`
1075 }) 1068 })
1076 }, 1500) 1069 }, 500)
1077 } else { 1070 } else {
1078 uni.showToast({title: res.msg || '提交失败', duration: 2000, icon: 'none'}) 1071 uni.showToast({title: res.msg || '提交失败', duration: 2000, icon: 'none'})
1079 } 1072 }
...@@ -1357,7 +1350,6 @@ function handleLogout() { ...@@ -1357,7 +1350,6 @@ function handleLogout() {
1357 1350
1358 // 监听步骤变化,加载审核详情 1351 // 监听步骤变化,加载审核详情
1359 watch(activeStep, (newVal) => { 1352 watch(activeStep, (newVal) => {
1360 console.log('activeStep changed:', newVal)
1361 if (newVal === 3) { 1353 if (newVal === 3) {
1362 getMyCertStageFN() 1354 getMyCertStageFN()
1363 } 1355 }
......
...@@ -78,9 +78,9 @@ ...@@ -78,9 +78,9 @@
78 v-model="form.name" 78 v-model="form.name"
79 class="input" 79 class="input"
80 :disabled="!showPersonalType && form.type === '1'" 80 :disabled="!showPersonalType && form.type === '1'"
81 :placeholder="form.type === '1' ? '请输入公司全称' : '请输入发票抬头'" 81 :placeholder="invoiceTitlePlaceholder"
82 /> 82 />
83 <text class="hint">请确保发票抬头与公司营业执照或个人身份证上的名称一致。</text> 83 <text class="hint">{{ invoiceTitleHint }}</text>
84 </view> 84 </view>
85 85
86 <!-- 纳税人识别号(企业才显示) --> 86 <!-- 纳税人识别号(企业才显示) -->
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
93 maxlength="20" 93 maxlength="20"
94 placeholder="请输入纳税人识别号" 94 placeholder="请输入纳税人识别号"
95 /> 95 />
96 <text class="hint">企业税务登记证上的号码,一般为15~20位</text> 96 <text class="hint">企业税务登记证上的号码,由 15~20 位数字、大写字母组成</text>
97 </view> 97 </view>
98 98
99 <!-- 接收方式 --> 99 <!-- 接收方式 -->
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
134 </template> 134 </template>
135 135
136 <script setup> 136 <script setup>
137 import {ref, reactive} from 'vue'; 137 import {ref, reactive, computed} from 'vue';
138 import {onLoad} from '@dcloudio/uni-app'; 138 import {onLoad} from '@dcloudio/uni-app';
139 import {outputInvoiceNo} from '@/common/api.js'; 139 import {outputInvoiceNo} from '@/common/api.js';
140 import customModal from '@/components/custom-modal.vue'; 140 import customModal from '@/components/custom-modal.vue';
...@@ -159,6 +159,16 @@ const form = reactive({ ...@@ -159,6 +159,16 @@ const form = reactive({
159 id: '' // 订单ID 159 id: '' // 订单ID
160 }); 160 });
161 161
162 const invoiceTitlePlaceholder = computed(() => {
163 return form.type === '1' ? '请输入公司全称' : '请输入个人姓名';
164 });
165
166 const invoiceTitleHint = computed(() => {
167 return form.type === '1'
168 ? '请确保发票抬头与营业执照上的单位名称一致'
169 : '请确保发票抬头与个人身份证上的姓名一致';
170 });
171
162 // 切换开票类型 172 // 切换开票类型
163 function changeInvoiceType(val) { 173 function changeInvoiceType(val) {
164 form.type = val 174 form.type = val
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
26 v-if="!personalInvoiceMode" 26 v-if="!personalInvoiceMode"
27 :class="{ active: form.type === '0' }" 27 :class="{ active: form.type === '0' }"
28 class="type-option" 28 class="type-option"
29 @click="form.type = '0'" 29 @click="changeInvoiceType('0')"
30 > 30 >
31 <view class="type-icon enterprise"> 31 <view class="type-icon enterprise">
32 <text class="icon-text"></text> 32 <text class="icon-text"></text>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
39 v-if="showIndividualType" 39 v-if="showIndividualType"
40 :class="{ active: form.type === '1' }" 40 :class="{ active: form.type === '1' }"
41 class="type-option" 41 class="type-option"
42 @click="form.type = '1'" 42 @click="changeInvoiceType('1')"
43 > 43 >
44 <view class="type-icon"> 44 <view class="type-icon">
45 <text class="icon-text"></text> 45 <text class="icon-text"></text>
...@@ -59,9 +59,9 @@ ...@@ -59,9 +59,9 @@
59 v-model="form.name" 59 v-model="form.name"
60 class="input" 60 class="input"
61 :disabled="!showIndividualType || personalInvoiceMode" 61 :disabled="!showIndividualType || personalInvoiceMode"
62 :placeholder="form.type === '0' ? '请输入公司全称' : '请输入发票抬头'" 62 :placeholder="invoiceTitlePlaceholder"
63 /> 63 />
64 <text class="hint">请确保发票抬头与公司营业执照或个人身份证上的名称一致</text> 64 <text class="hint">{{ invoiceTitleHint }}</text>
65 </view> 65 </view>
66 66
67 <!-- 纳税人识别号(企业才显示) --> 67 <!-- 纳税人识别号(企业才显示) -->
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
74 placeholder="请输入纳税人识别号" 74 placeholder="请输入纳税人识别号"
75 :disabled="!showIndividualType" 75 :disabled="!showIndividualType"
76 /> 76 />
77 <text class="hint">企业税务登记证上的号码,一般为15~20位</text> 77 <text class="hint">企业税务登记证上的号码,由 15~20 位数字、大写字母组成</text>
78 </view> 78 </view>
79 79
80 <!-- 开票金额(只读) --> 80 <!-- 开票金额(只读) -->
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
94 </template> 94 </template>
95 95
96 <script setup> 96 <script setup>
97 import {ref, reactive} from 'vue'; 97 import {ref, reactive, computed} from 'vue';
98 import {onLoad} from '@dcloudio/uni-app'; 98 import {onLoad} from '@dcloudio/uni-app';
99 import {outputInvoiceNoFeisui} from '@/common/api.js'; 99 import {outputInvoiceNoFeisui} from '@/common/api.js';
100 import customModal from '@/components/custom-modal.vue'; 100 import customModal from '@/components/custom-modal.vue';
...@@ -114,6 +114,24 @@ const form = reactive({ ...@@ -114,6 +114,24 @@ const form = reactive({
114 amount: 0 // 金额 114 amount: 0 // 金额
115 }); 115 });
116 116
117 const invoiceTitlePlaceholder = computed(() => {
118 return form.type === '0' ? '请输入公司全称' : '请输入个人姓名';
119 });
120
121 const invoiceTitleHint = computed(() => {
122 return form.type === '0'
123 ? '请确保发票抬头与营业执照上的单位名称一致'
124 : '请确保发票抬头与个人身份证上的姓名一致';
125 });
126
127 function changeInvoiceType(type) {
128 if (form.type === type) return;
129 form.type = type;
130 if (type === '1') {
131 form.taxno = '';
132 }
133 }
134
117 // 页面加载 135 // 页面加载
118 onLoad((options) => { 136 onLoad((options) => {
119 if (options.id || options.orderId) { 137 if (options.id || options.orderId) {
......
...@@ -202,6 +202,9 @@ const showValidityModal = ref(false) ...@@ -202,6 +202,9 @@ const showValidityModal = ref(false)
202 const validityDateText = ref('') 202 const validityDateText = ref('')
203 203
204 onLoad(async (option) => { 204 onLoad(async (option) => {
205 if (option.idcType !== undefined) {
206 baseFormData.value.idcType = String(option.idcType)
207 }
205 if (option.name && option.idcCode) { 208 if (option.name && option.idcCode) {
206 baseFormData.value.name = decodeURIComponent(option.name) 209 baseFormData.value.name = decodeURIComponent(option.name)
207 baseFormData.value.idcCode = decodeURIComponent(option.idcCode) 210 baseFormData.value.idcCode = decodeURIComponent(option.idcCode)
......
...@@ -57,10 +57,10 @@ ...@@ -57,10 +57,10 @@
57 57
58 <!-- 卡片右下角按钮 --> 58 <!-- 卡片右下角按钮 -->
59 <view class="card-btns"> 59 <view class="card-btns">
60 <view class="card-btn" @click="goToPay"> 60 <view v-if=" perInfo.idcTypeStr != '外国护照'" class="card-btn" @click="goToPay">
61 <text>认证缴费</text> 61 <text>认证缴费</text>
62 </view> 62 </view>
63 <view class="card-btn" @click="downCert"> 63 <view v-if=" perInfo.idcTypeStr != '外国护照'" class="card-btn" @click="downCert">
64 <text>电子会员证</text> 64 <text>电子会员证</text>
65 </view> 65 </view>
66 </view> 66 </view>
...@@ -163,6 +163,14 @@ ...@@ -163,6 +163,14 @@
163 </view> 163 </view>
164 </view> 164 </view>
165 <view class="form-item"> 165 <view class="form-item">
166 <view class="form-label">证件类型</view>
167 <view class="form-input">
168 <picker :value="idcTypeIndex" :range="idcTypeList" range-key="text" @change="onIdcTypeChange">
169 <view class="picker-value">{{ idcTypeList[idcTypeIndex]?.text || '请选择证件类型' }}</view>
170 </picker>
171 </view>
172 </view>
173 <view class="form-item">
166 <view class="form-label">证件号</view> 174 <view class="form-label">证件号</view>
167 <view class="form-input"> 175 <view class="form-input">
168 <input v-model="bindForm.idcCode" placeholder="请输入证件号" 176 <input v-model="bindForm.idcCode" placeholder="请输入证件号"
...@@ -227,8 +235,33 @@ const isBound = computed(() => { ...@@ -227,8 +235,33 @@ const isBound = computed(() => {
227 return perName !== undefined && perName !== null && perName !== '' 235 return perName !== undefined && perName !== null && perName !== ''
228 }) 236 })
229 237
238 const boundIdcType = computed(() => {
239 return String(perInfo.value?.idcType ?? perInfo.value?.perIdcType ?? bindForm.value.idcType ?? '0')
240 })
241
242 const isPassportBound = computed(() => isBound.value && boundIdcType.value === '1')
243
230 const bindPopup = ref(null) 244 const bindPopup = ref(null)
245 const idcTypeList = ref([{
246 value: '0',
247 text: "身份证"
248 },
249 {
250 value: '1',
251 text: "来往大陆(内地)通行证 "
252 },
253 {
254 value: '3',
255 text: "护照"
256 },
257 {
258 value: '5',
259 text: "香港身份证"
260 }
261 ])
262 const idcTypeIndex = ref(0)
231 const bindForm = ref({ 263 const bindForm = ref({
264 idcType: '0',
232 name: '', 265 name: '',
233 idcCode: '' 266 idcCode: ''
234 }) 267 })
...@@ -290,9 +323,11 @@ const checkAndOpenBindPopup = () => { ...@@ -290,9 +323,11 @@ const checkAndOpenBindPopup = () => {
290 const openBindPopup = () => { 323 const openBindPopup = () => {
291 if (bindPopup.value) { 324 if (bindPopup.value) {
292 bindForm.value = { 325 bindForm.value = {
326 idcType: '0',
293 name: '', 327 name: '',
294 idcCode: '' 328 idcCode: ''
295 } 329 }
330 idcTypeIndex.value = 0
296 bindPopup.value.open() 331 bindPopup.value.open()
297 } else { 332 } else {
298 nextTick(() => { 333 nextTick(() => {
...@@ -306,6 +341,11 @@ const closeBindPopup = () => { ...@@ -306,6 +341,11 @@ const closeBindPopup = () => {
306 bindPopup.value?.close() 341 bindPopup.value?.close()
307 } 342 }
308 343
344 const onIdcTypeChange = (e) => {
345 idcTypeIndex.value = Number(e.detail.value)
346 bindForm.value.idcType = idcTypeList.value[idcTypeIndex.value]?.value || '0'
347 }
348
309 // 处理绑定/切换操作 349 // 处理绑定/切换操作
310 const handleBindAction = async () => { 350 const handleBindAction = async () => {
311 // if (isBound.value) { 351 // if (isBound.value) {
...@@ -361,6 +401,7 @@ const confirmBind = async () => { ...@@ -361,6 +401,7 @@ const confirmBind = async () => {
361 }) 401 })
362 402
363 const [err, res] = await to(bindUser({ 403 const [err, res] = await to(bindUser({
404 idcType: bindForm.value.idcType,
364 name: bindForm.value.name, 405 name: bindForm.value.name,
365 idcCode: bindForm.value.idcCode 406 idcCode: bindForm.value.idcCode
366 })) 407 }))
...@@ -406,14 +447,17 @@ const confirmBind = async () => { ...@@ -406,14 +447,17 @@ const confirmBind = async () => {
406 } 447 }
407 448
408 const handelGo = () => { 449 const handelGo = () => {
450 if (bindForm.value.idcType === '1') return
409 uni.showModal({ 451 uni.showModal({
410 title: "提示", 452 title: "提示",
411 content: "当前账号非中国跆拳道协会有效会员。请先完成认证缴费,即可正常登录使用。", 453 content: "当前账号非中国跆拳道协会有效会员。请先完成认证缴费,即可正常登录使用。",
412 success: function (res) { 454 success: function (res) {
413 if (res.confirm) { 455 if (res.confirm) {
414 // closeBindPopup() 456 // closeBindPopup()
457 const name = encodeURIComponent(bindForm.value.name || '')
458 const idcCode = encodeURIComponent(bindForm.value.idcCode || '')
415 uni.navigateTo({ 459 uni.navigateTo({
416 url: `/personal/addVip_per?name=${bindForm.value.name}&idcCode=${bindForm.value.idcCode}` 460 url: `/personal/addVip_per?name=${name}&idcCode=${idcCode}&idcType=${bindForm.value.idcType}`
417 }); 461 });
418 } else if (res.cancel) { 462 } else if (res.cancel) {
419 // closeBindPopup() 463 // closeBindPopup()
...@@ -484,11 +528,13 @@ const goToOrder = () => { ...@@ -484,11 +528,13 @@ const goToOrder = () => {
484 528
485 // 导航到缴费 529 // 导航到缴费
486 const goToPay = () => { 530 const goToPay = () => {
531 if (isPassportBound.value) return
487 const perId = userInfo.value.perId ?? '' 532 const perId = userInfo.value.perId ?? ''
488 const name = perInfo.value?.perName ? encodeURIComponent(perInfo.value.perName) : '' 533 const name = perInfo.value?.perName ? encodeURIComponent(perInfo.value.perName) : ''
489 const idcCode = perInfo.value?.perIdcCode ? encodeURIComponent(perInfo.value.perIdcCode) : '' 534 const idcCode = perInfo.value?.perIdcCode ? encodeURIComponent(perInfo.value.perIdcCode) : ''
535 const idcType = boundIdcType.value
490 uni.navigateTo({ 536 uni.navigateTo({
491 url: `/personal/addVip_per?perId=${perId}&name=${name}&idcCode=${idcCode}` 537 url: `/personal/addVip_per?perId=${perId}&name=${name}&idcCode=${idcCode}&idcType=${idcType}`
492 }); 538 });
493 }; 539 };
494 540
...@@ -862,6 +908,11 @@ const confirmLogout = async () => { ...@@ -862,6 +908,11 @@ const confirmLogout = async () => {
862 width: 100%; 908 width: 100%;
863 } 909 }
864 910
911 .picker-value {
912 font-size: 28rpx;
913 color: #333;
914 }
915
865 .placeholder-class { 916 .placeholder-class {
866 color: #999; 917 color: #999;
867 } 918 }
......
...@@ -101,17 +101,17 @@ ...@@ -101,17 +101,17 @@
101 // 获取证件类型 101 // 获取证件类型
102 const getCertType = (type) => { 102 const getCertType = (type) => {
103 switch (type) { 103 switch (type) {
104 // case '0':
104 case '0': 105 case '0':
105 case '1':
106 return '身份证'; 106 return '身份证';
107 case '2': 107 case '1':
108 return '护照'; 108 return '来往大陆(内地)通行证';
109 case '3': 109 case '3':
110 return '军官证'; 110 return '护照';
111 case '4': 111 case '4':
112 return '港澳通行证'; 112 return '港澳通行证';
113 case '5': 113 case '5':
114 return '台湾通行证'; 114 return '“香港身份证';
115 default: 115 default:
116 return '--'; 116 return '--';
117 } 117 }
......
...@@ -70,8 +70,8 @@ ...@@ -70,8 +70,8 @@
70 <uni-forms-item label="头像" required> 70 <uni-forms-item label="头像" required>
71 <uni-file-picker v-model="photoArr" @delete="delPhoto" return-type="object" limit="1" 71 <uni-file-picker v-model="photoArr" @delete="delPhoto" return-type="object" limit="1"
72 @select="upPhoto" :del-ico="false" :image-styles="imageStylesTx"></uni-file-picker> 72 @select="upPhoto" :del-ico="false" :image-styles="imageStylesTx"></uni-file-picker>
73 <image mode="aspectFill" v-if="baseFormData.photo2" style="height:200rpx;width:200rpx;" 73 <!-- <image mode="aspectFill" v-if="baseFormData.photo2" style="height:200rpx;width:200rpx;"
74 :src="config.baseUrl_api + baseFormData.photo2" /> 74 :src="config.baseUrl_api + baseFormData.photo2" /> -->
75 </uni-forms-item> 75 </uni-forms-item>
76 </view> 76 </view>
77 </uni-forms> 77 </uni-forms>
...@@ -278,6 +278,13 @@ ...@@ -278,6 +278,13 @@
278 if (!file) { 278 if (!file) {
279 return 279 return
280 } 280 }
281 const imgUrl = getPickerFilePath(e)
282 if (!imgUrl) {
283 openCustomModal({
284 content: '未获取到图片地址,请重新选择图片'
285 })
286 return
287 }
281 uni.showLoading({ 288 uni.showLoading({
282 title: '加载中' 289 title: '加载中'
283 }); 290 });
...@@ -285,7 +292,7 @@ ...@@ -285,7 +292,7 @@
285 // console.log(e) 292 // console.log(e)
286 // const formData = new FormData() 293 // const formData = new FormData()
287 // formData.append('pic', e.tempFiles[0].file) 294 // formData.append('pic', e.tempFiles[0].file)
288 api.carUrl(e.tempFilePaths[0], baseFormData.value.idcType).then(res => { 295 api.carUrl(imgUrl, baseFormData.value.idcType).then(res => {
289 console.log(res) 296 console.log(res)
290 if (res.data) { 297 if (res.data) {
291 baseFormData.value.sex = res.data.sex 298 baseFormData.value.sex = res.data.sex
...@@ -313,37 +320,59 @@ ...@@ -313,37 +320,59 @@
313 } 320 }
314 321
315 function upPhoto(e) { 322 function upPhoto(e) {
316 const tempFilePaths = e.tempFilePaths; 323 const imgUrl = getPickerFilePath(e)
317 const imgUrl = tempFilePaths[0]
318 if (!imgUrl) { 324 if (!imgUrl) {
325 openCustomModal({
326 content: '未获取到图片地址,请重新选择图片'
327 })
328 return
329 }
330 const uploadPhoto = (path) => {
331 uni.showLoading({
332 title: '加载中'
333 });
334 api.uploadImgCorpPhoto(path).then(data => {
335 console.log(data)
336 baseFormData.value.photo = data.data.fang;
337 baseFormData.value.photo2 = data.data.yuan;
338 photoArr.value = {
339 url: config.baseUrl_api + baseFormData.value.photo,
340 name: '头像',
341 extname: 'jpg'
342 }
343 }).catch(() => {
344 photoArr.value = {}
345 baseFormData.value.photo = ''
346 baseFormData.value.photo2 = ''
347 openCustomModal({
348 content: '头像上传失败,请重新上传'
349 })
350 });
351 }
352 if (typeof wx === 'undefined' || typeof wx.cropImage !== 'function') {
353 uploadPhoto(imgUrl)
319 return 354 return
320 } 355 }
321 wx.cropImage({ 356 wx.cropImage({
322 src: imgUrl, 357 src: imgUrl,
323 cropScale: '4:5', 358 cropScale: '4:5',
324 success: function(resp) { 359 success: function(resp) {
325 uni.showLoading({ 360 uploadPhoto(resp.tempFilePath || imgUrl)
326 title: '加载中'
327 });
328 api.uploadImgCorpPhoto(resp.tempFilePath).then(data => {
329 console.log(data)
330 baseFormData.value.photo = data.data.fang;
331 baseFormData.value.photo2 = data.data.yuan;
332 photoArr.value = {
333 url: config.baseUrl_api + baseFormData.value.photo,
334 name: '头像',
335 extname: 'jpg'
336 }
337 });
338 }, 361 },
339 fail: function(err) { 362 fail: function(err) {
340 photoArr.value = {} 363 console.warn('cropImage failed, upload original image:', err)
364 uploadPhoto(imgUrl)
341 } 365 }
342 }) 366 })
343 367
344 368
345 } 369 }
346 370
371 function getPickerFilePath(e) {
372 const file = e?.tempFiles?.[0] || {}
373 return e?.tempFilePaths?.[0] || file.tempFilePath || file.path || file.url || ''
374 }
375
347 376
348 function delimgFont(n) { 377 function delimgFont(n) {
349 photoArr.value = {} 378 photoArr.value = {}
...@@ -528,6 +557,7 @@ ...@@ -528,6 +557,7 @@
528 const time = new Date().valueOf() + '' 557 const time = new Date().valueOf() + ''
529 baseFormData.value.t = time + Math.floor(Math.random() * 10) 558 baseFormData.value.t = time + Math.floor(Math.random() * 10)
530 baseFormData.value.signT = aes2.AESEncrypt(baseFormData.value.idcType + time) 559 baseFormData.value.signT = aes2.AESEncrypt(baseFormData.value.idcType + time)
560 console.log(666,baseFormData.value)
531 api.addPersonToMyDept(baseFormData.value).then(Response => { 561 api.addPersonToMyDept(baseFormData.value).then(Response => {
532 if (Response.data == 0) { 562 if (Response.data == 0) {
533 let msg = '该成员,实名认证未通过,注册失败!' 563 let msg = '该成员,实名认证未通过,注册失败!'
......
...@@ -313,7 +313,7 @@ async function commitFN(row) { ...@@ -313,7 +313,7 @@ async function commitFN(row) {
313 const res = await api.getNewCountByRangeId(row.rangId) 313 const res = await api.getNewCountByRangeId(row.rangId)
314 const countData = res?.data || {} 314 const countData = res?.data || {}
315 if (Number(countData.all || 0) <= 0) { 315 if (Number(countData.all || 0) <= 0) {
316 uni.showToast({ title: '请添加缴费学员', icon: 'none' }) 316 uni.showToast({ title: '此缴费单尚未关联学员,请先添加缴费学员。', icon: 'none' })
317 return 317 return
318 } 318 }
319 uni.navigateTo({ 319 uni.navigateTo({
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!