From 502eea08096272b9d6f5e933c6eddca5065eba7b Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 20 Nov 2024 10:45:09 +0800 Subject: [PATCH] fix --- src/components/UserExchangeModal/index.tsx | 6 ++-- src/components/goToMemberModal/index.tsx | 2 +- src/pages/Subscribe/index.tsx | 36 +++++++++++----------- src/pages/UserHome/UserSubscribe/index.tsx | 3 +- src/pages/Vip/index.less | 1 - 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/components/UserExchangeModal/index.tsx b/src/components/UserExchangeModal/index.tsx index 9f5adb4..5080d75 100644 --- a/src/components/UserExchangeModal/index.tsx +++ b/src/components/UserExchangeModal/index.tsx @@ -38,10 +38,10 @@ export default function UserExchangeModal({ isOpen, setIsOpen }: Props) { const handleScanCode = () => { Taro.scanCode({ success: (res: any) => { - console.log('唤起扫码:',res,res.path) + const { path } = res if(!Taro.getStorageSync('UserToken')){ setisLoginOpen(true) - setuserScene(res.path.slice(-8)) + setuserScene(path ? path.slice(-8) : '') }else{ Taro.request({ url: 'https://interapi.jm-kid.com/api/product/exchange', @@ -51,7 +51,7 @@ export default function UserExchangeModal({ isOpen, setIsOpen }: Props) { }, data: { timestamp: Date.now(), - change_code: res.path.slice(-8) + change_code: path ? path.slice(-8) : '' }, success: (s_res: any) => { const { state, data } = s_res.data diff --git a/src/components/goToMemberModal/index.tsx b/src/components/goToMemberModal/index.tsx index aeeb792..ed12281 100644 --- a/src/components/goToMemberModal/index.tsx +++ b/src/components/goToMemberModal/index.tsx @@ -57,7 +57,7 @@ export default function GoToStoreModal({ visible, onClose, memberInfo}) { 专辑播放 - 你的会员{memberInfo.SubscribedState === -1 ? '已过期' : '未开通'},请前往商城购买VIP会员解锁全部专辑 + 你的会员{memberInfo.SubscribedState === -1 ? '已过期' : '未开通'},请前往商城购买VIP会员解锁专辑 { - console.log(res.path.slice(-8)) + console.log('二维码内容:', res) + const { path } = res if(!Taro.getStorageSync('UserToken')){ setisLoginOpen(true) - setuserScene(res.path.slice(-8)) + setuserScene(path ? path.slice(-8) : '') }else{ Taro.request({ url: 'https://interapi.jm-kid.com/api/product/exchange', @@ -410,7 +411,7 @@ export default function Subscribe() { }, data: { timestamp: Date.now(), - change_code: res.path.slice(-8) + change_code: path ? path.slice(-8) : '' }, success: (s_res: any) => { const { state, data } = s_res.data @@ -579,12 +580,6 @@ export default function Subscribe() { > - setisPopupOpen(!isPopupOpen)} - onFilter={setisFilter} - > - + setisPopupOpen(!isPopupOpen)} + onFilter={setisFilter} + > + + {/* 跳转商城 */} + setisToStoreOpen(false)} + type={1} + mallLink={prdtMallLink} + setmallLink={setprdtMallLink} + > } @@ -744,15 +753,6 @@ export default function Subscribe() { onModalClose={() => setisLoginOpen(false)} > - {/* 跳转商城 */} - setisToStoreOpen(false)} - type={1} - mallLink={prdtMallLink} - setmallLink={setprdtMallLink} - > - ) diff --git a/src/pages/UserHome/UserSubscribe/index.tsx b/src/pages/UserHome/UserSubscribe/index.tsx index 999b861..b1f1285 100644 --- a/src/pages/UserHome/UserSubscribe/index.tsx +++ b/src/pages/UserHome/UserSubscribe/index.tsx @@ -63,6 +63,7 @@ export default function UserSubscribe() { console.log('唤起扫码') Taro.scanCode({ success: (res: any) => { + const { path } = res Taro.request({ url: 'https://interapi.jm-kid.com/api/product/exchange', method: 'POST', @@ -71,7 +72,7 @@ export default function UserSubscribe() { }, data: { timestamp: Date.now(), - change_code: res.path.slice(-8) + change_code: path ? path.slice(-8) : '' }, success: (s_res: any) => { const { state, data } = s_res.data diff --git a/src/pages/Vip/index.less b/src/pages/Vip/index.less index 7ae09dd..f36f700 100644 --- a/src/pages/Vip/index.less +++ b/src/pages/Vip/index.less @@ -44,7 +44,6 @@ width: 3.75rem; height: 3.75rem; margin-right: 1rem; - border: .0625rem solid #444; border-radius: 50%; } .vip_info {