From a2b654185bda00bbc90c8bf290ba993dc46b3ffb Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 6 Nov 2024 16:26:12 +0800 Subject: [PATCH] fix --- src/components/Popup/index.less | 13 ++++++++--- src/components/Popup/index.tsx | 11 +++++---- src/components/defaultPage2/index.less | 10 ++++---- src/components/goToMemberModal/index.less | 4 ++-- src/components/goToMemberModal/index.tsx | 10 ++++---- src/components/goToStoreModal/index.less | 21 ++++++++++------- src/components/goToStoreModal/index.tsx | 3 ++- src/pages/Customer/index.tsx | 27 ++++++++++++++++++++++ src/pages/ListenDetail/index.tsx | 10 ++++---- src/pages/Subscribe/index.tsx | 11 +++++++-- src/pages/UserHome/UserSubscribe/index.tsx | 23 ++++++++++++++---- src/pages/UserHome/index.less | 2 +- src/pages/UserHome/index.tsx | 5 +--- src/pages/Vip/index.less | 19 ++++++--------- src/pages/Vip/index.tsx | 3 ++- 15 files changed, 112 insertions(+), 60 deletions(-) diff --git a/src/components/Popup/index.less b/src/components/Popup/index.less index 385edd4..7112214 100644 --- a/src/components/Popup/index.less +++ b/src/components/Popup/index.less @@ -24,7 +24,7 @@ bottom: 0; // 移动到屏幕底部 left: 0; width: 100%; - height: 50%; // 占据屏幕高度的一半 + height: 95%; background-color: white; z-index: 1000; overflow-y: auto; @@ -61,7 +61,7 @@ .popup_content_body { width: 100%; - height: calc(50vh - 2.75rem - 2.5rem - 4rem); + height: calc(95vh - 2.75rem - 2.5rem - 4rem); display: flex; flex-direction: column; @@ -75,7 +75,7 @@ .popup_content_body_item_title { font-size: 1rem; - font-weight: 600; + font-weight: 600; } .popup_content_body_item_group { @@ -123,5 +123,12 @@ } } } + + &.half { + height: 50%; + .popup_content_body { + height: calc(50vh - 2.75rem - 2.5rem - 4rem); + } + } } diff --git a/src/components/Popup/index.tsx b/src/components/Popup/index.tsx index 2e071f2..abb3b4b 100644 --- a/src/components/Popup/index.tsx +++ b/src/components/Popup/index.tsx @@ -13,9 +13,6 @@ export default function PopupHalfScreen({ visible, onClose, hideFilter, onFilter //管理关闭动画状态 const [isAnimationOpen, setisAnimationOpen] = useState(false) - //本地记录筛选内容 - const [userFilter, setuserFilter] = useState(0) - //记录用户筛选状态 const [filterForm, setFilterForm] = useState({ filter: '', @@ -83,7 +80,11 @@ export default function PopupHalfScreen({ visible, onClose, hideFilter, onFilter } const handleReset = () => { - setuserFilter(0) + setFilterForm({ + filter: '', + state: '', + refer: '', + }) onFilter('reset') handleOverlayClick(null) } @@ -100,7 +101,7 @@ export default function PopupHalfScreen({ visible, onClose, hideFilter, onFilter onClick={handleOverlayClick} /> { + const handleOverlayClick = () => { // 点击蒙层时关闭弹窗 setisAnimationOpen(true) setTimeout(() =>{ @@ -25,7 +25,7 @@ export default function GoToStoreModal({ visible, onClose, type}) { const handleNavigateToMiniProgram = () => { Taro.navigateToMiniProgram({ appId: 'wxbd3d383851fea776', - path: '', + path: memberInfo?.MallLink || '', success: (res) => { console.log('打开成功=>',res) }, @@ -57,14 +57,14 @@ export default function GoToStoreModal({ visible, onClose, type}) { 专辑播放 - 你的会员{type === -1 ? '已过期' : '未开通'},请前往商城购买VIP会员解锁全部专辑 + 你的会员{memberInfo.SubscribedState === -1 ? '已过期' : '未开通'},请前往商城购买VIP会员解锁全部专辑 去选购 diff --git a/src/components/goToStoreModal/index.less b/src/components/goToStoreModal/index.less index d0c4b2a..de9d6c3 100644 --- a/src/components/goToStoreModal/index.less +++ b/src/components/goToStoreModal/index.less @@ -3,29 +3,34 @@ top: 50%; left: 50%; transform: translate(-50%, -50%); - width: 18rem; - height: 9rem; + width: 17rem; background: #fff; border-radius: 1rem; display: flex; flex-direction: column; - padding: .125rem; + padding: 0 .5rem .8rem; z-index: 1000; .store_modal_close { width: 1.5rem; height: 1.5rem; - margin: 1rem 1rem auto auto; + margin: .5rem 1rem auto auto; background-image: url(https://oss.jm-kid.com/wx_5colorflower/close.png); background-repeat: no-repeat; background-size: cover; } + .store_modal_title { + font-size: 1rem; + font-weight: 600; + text-align: center; + } + .store_modal_context { font-size: .875rem; font-weight: 600; text-align: center; - margin: auto; + margin: .5rem 0 .8rem; } .store_modal_container { @@ -38,8 +43,8 @@ border-radius: 1rem; margin: auto; gap: 1rem; - - .store_modal_title { + + .store_modal_btn { font-size: 1rem; font-weight: 600; height: 1.125rem; @@ -58,4 +63,4 @@ height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 999; -} \ No newline at end of file +} diff --git a/src/components/goToStoreModal/index.tsx b/src/components/goToStoreModal/index.tsx index e2b3040..c1fc001 100644 --- a/src/components/goToStoreModal/index.tsx +++ b/src/components/goToStoreModal/index.tsx @@ -56,6 +56,7 @@ export default function GoToStoreModal({ visible, onClose, type, mallLink = 'pag } > + 订阅绘本 {type === 0 ? '您还没有订阅,请前往商城购买' : '更多绘本请前往商城选购'} @@ -64,7 +65,7 @@ export default function GoToStoreModal({ visible, onClose, type, mallLink = 'pag onClick={handleNavigateToMiniProgram} > 去选购 diff --git a/src/pages/Customer/index.tsx b/src/pages/Customer/index.tsx index f4680c4..2ae1455 100644 --- a/src/pages/Customer/index.tsx +++ b/src/pages/Customer/index.tsx @@ -1,14 +1,41 @@ import { Image } from '@tarojs/components' +import Taro, { useShareAppMessage, useShareTimeline } from '@tarojs/taro' import './index.less' export default function Customer() { + useShareAppMessage((res) => { + return { + title: '五色花', + path: '/pages/Home/index' + } + }) + + useShareTimeline(() => { + return { + title: '五色花', + path: '/pages/Home/index' + } + }) + + const handleLongPress = () => { + Taro.scanCode({ + success: (res) => { + console.log(44, res) + }, + fail: () => { + + }, + }) + } + return ( ) } diff --git a/src/pages/ListenDetail/index.tsx b/src/pages/ListenDetail/index.tsx index 1f0e4e0..68e1604 100644 --- a/src/pages/ListenDetail/index.tsx +++ b/src/pages/ListenDetail/index.tsx @@ -64,7 +64,7 @@ export default function ListenDetail() { const [queryId, setqueryId] = useState('') //会员开通状态 - const [memberState, setMemberState] = useState(0) + const [memberInfo, setMemberInfo] = useState({}) useLoad((query) => { setqueryId(query.prdtId) @@ -104,8 +104,8 @@ export default function ListenDetail() { if(!Taro.getStorageSync('UserToken')){ setisLoginOpen(true) }else{ - console.log('IsSubscribed=>', memberState) - if (memberState !== 1) { + console.log('IsSubscribed=>', memberInfo) + if (memberInfo?.SubscribedState !== 1) { //没有会员,跳转商城 setisToStoreOpen(true) }else{ @@ -148,7 +148,7 @@ export default function ListenDetail() { }, success: (res: any) => { if(res.data.state === 200){ - setMemberState(res.data.data.main.SubscribedState) + setMemberInfo(res.data.data.main) } }, }) @@ -251,7 +251,7 @@ export default function ListenDetail() { setisToStoreOpen(false)} - type={memberState} + memberInfo={memberInfo} > ) diff --git a/src/pages/Subscribe/index.tsx b/src/pages/Subscribe/index.tsx index 92e379f..e80edde 100644 --- a/src/pages/Subscribe/index.tsx +++ b/src/pages/Subscribe/index.tsx @@ -220,7 +220,14 @@ export default function Subscribe() { }, [isFilter]) const requestUserSubscribe = () => { - if(!Taro.getStorageSync('UserToken')){ + if (!Taro.getStorageSync('UserToken')) { + setuserSubscribeSingleList([]) + setuserSubscribeCollectionList([]) + setuserSubscribeSingleFreeCount(0) + setuserSubscribeSinglePaidCount(0) + setuserSubscribeCollectionFreeCount(0) + setuserSubscribeCollectionPaidCount(0) + setisLoginOpen(true) }else{ //查询用户订阅信息 @@ -619,7 +626,7 @@ export default function Subscribe() { handleToCollectionDetail(item.PrdtId)} + onClick={() => handleToCollectionDetail(item)} > { Taro.navigateTo({ @@ -90,6 +88,21 @@ export default function UserSubscribe() { }) } + // 续费 + const toRenew = (item: any, e) => { + e.stopPropagation() + Taro.navigateToMiniProgram({ + appId: 'wxbd3d383851fea776', + path: item.MallLink, + success: (res) => { + console.log('打开成功=>',res) + }, + fail: (res) => { + console.log('打开失败=>',res) + } + }) + } + return ( @@ -170,7 +183,7 @@ export default function UserSubscribe() { > {item.PrdtTitle} 到期时间:{item.PrdtDeadline.slice(0,10)} - 去续费 > + toRenew(item, e)}>去续费 > diff --git a/src/pages/UserHome/index.less b/src/pages/UserHome/index.less index bc63e5b..1eeb856 100644 --- a/src/pages/UserHome/index.less +++ b/src/pages/UserHome/index.less @@ -103,7 +103,7 @@ .user_home_content_item_btn { width: 1.5rem; height: 1.5rem; - margin: 0 1rem; + margin-left: 1rem; } } diff --git a/src/pages/UserHome/index.tsx b/src/pages/UserHome/index.tsx index 20d70c0..fa0ae7d 100644 --- a/src/pages/UserHome/index.tsx +++ b/src/pages/UserHome/index.tsx @@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react' import Taro, { useDidHide, useDidShow, useLoad, useShareAppMessage, useShareTimeline } from '@tarojs/taro' import { Image, View, Text } from '@tarojs/components' import UserExchangeModal from '../../components/UserExchangeModal' -import Gift from '../../components/gift' import './index.less' import GetPhoneNumber from '../../components/getPhoneModal' @@ -126,7 +125,7 @@ export default function UserHome() { const state = data.Member.SubscribedState // 会员状态 list[0].des = data.Subscribed.Count list[1].des = state === -1 ? '已过期' : state === 1 ? '已开通' : '未开通' // -1 已过期 1 已开通 0 未开通 - list[6].des = data.Message.UnreadCount + list[6].des = data.Message.UnreadCount || '' setOperationList([...list]) console.log(44,operationList ) } @@ -221,8 +220,6 @@ export default function UserHome() { } - - { Taro.navigateToMiniProgram({ appId: 'wxbd3d383851fea776', - path: '', + path: info?.MallLink || '', success: (res) => { console.log('打开成功=>',res) },